joe-3.7/0000777000100100007640000000000011103454344007135 500000000000000joe-3.7/po/0000777000100100007640000000000011103454344007553 500000000000000joe-3.7/po/de.po0000644000100100007640000010653011100501715010414 00000000000000# JOE german translation # Copyright (C) 2006 Joseph H Allen # This file is distributed under the same license as the PACKAGE package. # Joe Allen # msgid "" msgstr "" "Project-Id-Version: joe 3.5\n" "POT-Creation-Date: 2006-06-15 14:12-0400\n" "PO-Revision-Date: 2007-01-03 13:58+0100\n" "Last-Translator: Jan Engelhardt \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Report-Msgid-Bugs-To: \n" #: b.c:31 msgid "No error" msgstr "Kein Fehler" #: b.c:32 msgid "New File" msgstr "Neue Datei" #: b.c:33 msgid "Error reading file" msgstr "Fehler beim Lesen der Datei" #: b.c:34 msgid "Error seeking file" msgstr "Fehler beim Springen (Seek) in der Datei" #: b.c:35 msgid "Error opening file" msgstr "Fehler beim Öffnen der Datei" #: b.c:36 msgid "Error writing file" msgstr "Fehler beim Schreiben der Datei" #: b.c:37 msgid "File on disk is newer" msgstr "Datei auf dem Datenträger ist neuer" #: b.c:2736 #, c-format msgid "" "\n" "*** These modified files were found in JOE when it aborted on %s" msgstr "" "\n" "*** Diese geänderten Dateien wurden nach Abbruch von %s in JOE gefunden" #: b.c:2738 #, c-format msgid "*** JOE was aborted by UNIX signal %d\n" msgstr "*** JOE wurde durch UNIX-Signal %d abgebrochen\n" #: b.c:2740 msgid "*** JOE was aborted because the terminal closed\n" msgstr "*** JOE wurde durch Schließen des Terminals abgebrochen\n" #: b.c:2745 #, c-format msgid "" "\n" "*** File '%s'\n" msgstr "" "\n" "*** Datei '%s'\n" #: b.c:2747 msgid "" "\n" "*** File '(Unnamed)'\n" msgstr "" "\n" "*** Datei '(Unbenannt)'\n" #: bw.c:1274 msgid "** Line %ld Col %ld Offset %s(0x%s) **" msgstr "** Zeile %ld Spalte %ld Offset %s(0x%s) **" #: bw.c:1276 msgid "** Line %ld Col %ld Offset %s(0x%s) %s %d(0%o/0x%X) Width %d **" msgstr "** Zeile %ld Spalte %ld Offset %s(0x%s) %s %d(0%o/0x%X) Breite %d **" #: cmd.c:211 msgid "Could not create lock. (I) edit anyway, (Q) cancel edit? " msgstr "Konnte Lock nicht erstellen. (I)trotzem editieren, (Q)abbrechen? " #: cmd.c:212 msgid "Locked by %s. (S)teal lock, (I) edit anyway, (Q) cancel edit? " msgstr "Gesperrt durch %s. (S)perre stehlen, (I)trotzdem editieren, (Q)abbrechen? " #: cmd.c:214 msgid "|steal the lock|sS" msgstr "|Sperre stehlen|sS" #: cmd.c:215 msgid "|cancel edit due to lock|qQ" msgstr "|Editieren wegen Sperre abbrechen|qQ" #: cmd.c:216 msgid "|ignore lock, continue with edit|iI" msgstr "|Sperre ignorieren, mit Editieren fortfahren|iI" #: cmd.c:265 msgid "Notice: File on disk changed! (hit ^C to continue) " msgstr "Hinweis: Datei auf dem Datenträger geändert! (^C zum Fortfahren) " #: cmd.c:325 msgid "Modify other window first for macro" msgstr "Ändern Sie für das Makro zuerst das andere Fenster" #: cmd.c:333 msgid "Other buffer is read only" msgstr "Der andere Puffer ist schreibgeschützt" #: cmd.c:348 rc.c:340 msgid "Read only" msgstr "Schreibgeschützt" #: cmd.c:542 cmd.c:552 msgid "No such command" msgstr "Unbekannter Befehl" #: cmd.c:569 msgid "Command: " msgstr "Befehl: " #: help.c:77 #, c-format msgid "" "\n" "%d: EOF before end of help text\n" msgstr "" "\n" "%d: EOF vor Ende des Hilfetextes\n" #: kbd.c:352 msgid "No such keymap" msgstr "Unbekannte Keymap" #: kbd.c:381 msgid "Change keymap: " msgstr "Keymap ändern: " #: macro.c:662 msgid "Macro to record (0-9 or ^C to abort): " msgstr "Aufzunehmendes Makro (0-9 oder ^C zum Abbrechen): " #: macro.c:764 msgid "Play-" msgstr "" #: macro.c:791 msgid "No. times to repeat next command (^C to abort): " msgstr "Anzahl der Widerholungen für nächsten Befehl (^C zum Abbrechen): " #: macro.c:819 msgid "If (^C to abort): " msgstr "If (^C zum Abbrechen): " #: macro.c:826 msgid "Elsif without if" msgstr "Elsif ohne if" #: macro.c:832 msgid "Else if: " msgstr "Else if: " #: macro.c:841 msgid "Else without if" msgstr "Else ohne if" #: macro.c:852 msgid "Endif without if" msgstr "Endif ohne if" #: macro.c:895 #, c-format msgid "Repeat %s%d" msgstr "Repeat %s%d" #: macro.c:908 msgid "Repeat" msgstr "Repeat" #: main.c:207 msgid "Couldn't load termcap/terminfo entry\n" msgstr "Konnte termcap/terminfo-Eintrag nicht laden\n" #: main.c:222 main.c:239 #, c-format msgid "There were errors in '%s'. Use it anyway?" msgstr "Fehler in '%s'. Trotzdem verwenden?" #: main.c:294 #, c-format msgid "Warning: %s is newer than your %s.\n" msgstr "Warnung: %s ist neuer als Ihr %s.\n" #: main.c:295 #, c-format msgid "You should update or delete %s\n" msgstr "%s sollte aktualisiert oder gelöscht werden\n" #: main.c:296 #, c-format msgid "Hit enter to continue with %s " msgstr "Drücken Sie ENTER um mit %s fortzufahren " #: main.c:309 main.c:328 main.c:345 #, c-format msgid "There were errors in '%s'. Use it anyway (y,n)? " msgstr "Fehler in '%s'. Trotzdem verwenden (y,n)? " #: main.c:353 #, c-format msgid "Couldn't open '%s'\n" msgstr "Konnte '%s' nicht öffnen\n" #: main.c:359 msgid "rc file has no :main key binding section or no bindings. Bye.\n" msgstr "RC-Datei hat keine :main Tastenbelegungs-Sektion oder gar keine Belegungen.\n" #: main.c:372 #, c-format msgid "Unknown option '%s'\n" msgstr "Unbekannte Option '%s'\n" #: main.c:508 #, c-format msgid "\\i** Joe's Own Editor v%s ** (%s) ** Copyright %s 2006 **\\i" msgstr "\\i** Joe's Own Editor v%s ** (%s) ** Copyright %s 2006 **\\i" #: rc.c:295 msgid "Overtype mode" msgstr "Überschreib-Modus" #: rc.c:295 msgid "Insert mode" msgstr "Einfüge-Modus" #: rc.c:295 msgid "T Overtype " msgstr "T Überschreiben " #: rc.c:296 msgid "Hex edit mode" msgstr "Hexedit-Modus" #: rc.c:296 msgid "Text edit mode" msgstr "Textedit-Modus" #: rc.c:296 msgid " Hex edit mode " msgstr " Hexedit-Modus " #: rc.c:297 msgid "Autoindent enabled" msgstr "Automatische Einrückung aktiviert" #: rc.c:297 msgid "Autoindent disabled" msgstr "Automatische Einrückung deaktiviert" #: rc.c:297 msgid "I Autoindent " msgstr "I Einrückung " #: rc.c:298 msgid "Wordwrap enabled" msgstr "Zeilenumbruch aktiviert" #: rc.c:298 msgid "Wordwrap disabled" msgstr "Zeilenumbruch deaktiviert" #: rc.c:298 msgid "W Word wrap " msgstr "W Zeilenumbruch " #: rc.c:299 #, c-format msgid "Tab width (%d): " msgstr "Tabulator-Breite (%d): " #: rc.c:299 msgid "D Tab width " msgstr "D Tab-Breite " #: rc.c:300 #, c-format msgid "Left margin (%d): " msgstr "Linker Einzug (%d): " #: rc.c:300 msgid "L Left margin " msgstr "L Linker Einzug " #: rc.c:301 #, c-format msgid "Right margin (%d): " msgstr "Rechter Einzug (%d): " #: rc.c:301 msgid "R Right margin " msgstr "R Rechter Einzug" #: rc.c:302 msgid "Restore cursor position when files loaded" msgstr "Springe beim Öffnen von Dateien an die letzte Cursorposition" #: rc.c:302 msgid "Don't restore cursor when files loaded" msgstr "Springe beim Öffnen von Dateien NICHT an die letzte Cursorposition" #: rc.c:302 msgid " Restore cursor " msgstr " Springe zu Cursorpos. " #: rc.c:303 msgid "Rectangle mode" msgstr "Rechteck-Modus" #: rc.c:303 msgid "Text-stream mode" msgstr "Textstrom-Modus" #: rc.c:303 msgid "X Rectangle mode " msgstr "X Rechteck-Modus " #: rc.c:304 msgid "Search ignores case by default" msgstr "Suche ignoriert standardmäßig Groß-/Kleinschreibung" #: rc.c:304 msgid "Case sensitive search by default" msgstr "Suche beachtet Groß-/Kleinschreibung" #: rc.c:304 msgid " Case insensitivity " msgstr " Groß-/Kleinschr. beachten " #: rc.c:305 msgid "Search wraps" msgstr "Suche wird am Anfang fortgesetzt" #: rc.c:305 msgid "Search doesn't wrap" msgstr "Surche wird nicht am Anfang fortgesetzt" #: rc.c:305 msgid " Search wraps " msgstr " Suche durch ganzes Dokument " #: rc.c:306 msgid "Menu explorer mode" msgstr "Menü-Explorer-Modus" #: rc.c:306 msgid "Simple completion mode" msgstr "Einfache Vervollständigung" #: rc.c:306 msgid " Menu explorer " msgstr " Menü-Explorer " #: rc.c:307 msgid "Menu above prompt" msgstr "Menü über Prompt" #: rc.c:307 msgid "Menu below prompt" msgstr "Menü unter Prompt" #: rc.c:307 msgid " Menu position " msgstr " Menüposition " #: rc.c:308 msgid "Search prompting on" msgstr "" #: rc.c:308 msgid "Search prompting off" msgstr "" #: rc.c:308 msgid " Search prompting " msgstr "" #: rc.c:309 msgid "Jump into menu is on" msgstr "" #: rc.c:309 msgid "Jump into menu is off" msgstr "" #: rc.c:309 msgid " Jump into menu " msgstr "" #: rc.c:310 msgid "Autoswap ^KB and ^KK" msgstr "^KB und ^KK automatisch tauschen" #: rc.c:310 msgid "Autoswap off " msgstr "Automatisher Tausch von ^KB und ^KK deaktiviert " #: rc.c:310 msgid " Autoswap mode " msgstr " Autoswap-Modus " #: rc.c:311 #, c-format msgid "Indent char %d (SPACE=32, TAB=9, ^C to abort): " msgstr "Einrückungszeichen %d (SPACE=32, TAB=9, ^C zum Abbrechen): " #: rc.c:311 msgid " Indent char " msgstr " Einrückungszeichen " #: rc.c:312 #, c-format msgid "Indent step %d (^C to abort): " msgstr "Einrückungsschritt %d (^C zum Abbrechen): " #: rc.c:312 msgid " Indent step " msgstr " Einrückungsschritt " #: rc.c:313 msgid "One space after periods for paragraph reformat" msgstr "" #: rc.c:313 msgid "Two spaces after periods for paragraph reformat" msgstr "" #: rc.c:313 msgid " French spacing " msgstr "" #: rc.c:314 msgid "Highlighting enabled" msgstr "Highlighting aktiviert" #: rc.c:314 msgid "Highlighting disabled" msgstr "Highlighting deaktiviert" #: rc.c:314 msgid "H Highlighting " msgstr "H Highlighting " #: rc.c:315 msgid "Inserting spaces when tab key is hit" msgstr "" #: rc.c:315 msgid "Inserting tabs when tab key is hit" msgstr "" #: rc.c:315 msgid " No tabs " msgstr " Keine Tabs " #: rc.c:316 msgid "Cursor will be recentered on scrolls" msgstr "" #: rc.c:316 msgid "Cursor will not be recentered on scroll" msgstr "" #: rc.c:316 msgid "C Center on scroll " msgstr "Z Zentrieren beim Blättern " #: rc.c:317 msgid "Automatically detect MS-DOS files" msgstr "Automatische Erkennung von MS-DOS-Dateien" #: rc.c:317 msgid "Do not automatically detect MS-DOS files" msgstr "Keine automatische Erkennung von MS-DOS-Dateien" #: rc.c:317 msgid " Auto detect CR-LF " msgstr " CR-LF automatisch erkennen " #: rc.c:318 msgid "Automatically detect indentation" msgstr "Einrückung wird automatisch erkannt" #: rc.c:318 msgid "Do not automatically detect indentation" msgstr "Einrückung wird nicht automatisch erkannt" #: rc.c:318 msgid " Guess indent " msgstr " Einrückung erkennen " #: rc.c:319 msgid "Automatically detect non-UTF-8 in UTF-8 locale" msgstr "Automatische Erkennung von nicht-UTF-8 in UTF-8-Umgebung" #: rc.c:319 msgid "Do not automatically detect non-UTF-8" msgstr "Keine Automatische Erkennung von nicht-UTF-8" #: rc.c:319 msgid " Guess non-UTF-8 " msgstr " Rate nicht-UTF-8 " #: rc.c:320 msgid "Automatically detect UTF-8 in non-UTF-8 locale" msgstr "Automatische Erkennung von UTF-8 in nicht-UTF-8-Umgebung" #: rc.c:320 msgid "Do not automatically detect UTF-8" msgstr "Keine Automatische Erkennung von UTF-8" #: rc.c:320 msgid " Guess UTF-8 " msgstr " Rate UTF-8 " #: rc.c:321 msgid "Menu is transposed" msgstr "Menüelemente werden umgeordnet" #: rc.c:321 msgid "Menus are not transposed" msgstr "Menüelemente werden nicht umgeordnet" #: rc.c:321 msgid " Transpose menus " msgstr " Menüs umordnen " #: rc.c:322 msgid "CR-LF is line terminator" msgstr "CR-LF ist Zeilenbegrenzer" #: rc.c:322 msgid "LF is line terminator" msgstr "LF ist Zeilenbegrenzer" #: rc.c:322 msgid "Z CR-LF (MS-DOS) " msgstr "Z CR-LF (MS-DOS) " #: rc.c:323 msgid "Line numbers enabled" msgstr "Zeilennummern aktiviert" #: rc.c:323 msgid "Line numbers disabled" msgstr "Zeilennummern deaktiviert" #: rc.c:323 msgid "N Line numbers " msgstr "N Zeilennummern " #: rc.c:324 msgid "Anchored block marking on" msgstr "" #: rc.c:324 msgid "Anchored block marking off" msgstr "" #: rc.c:324 msgid " Marking " msgstr "" #: rc.c:325 msgid "Characters above 127 shown as-is" msgstr "Zeichen über 127 so-wie-sie-sind anzeigen" #: rc.c:325 msgid "Characters above 127 shown in inverse" msgstr "Zeichen über 127 invertiert anzeigen" #: rc.c:325 msgid " Meta chars as-is " msgstr "" #: rc.c:326 msgid "Last line forced to have NL when file saved" msgstr "" #: rc.c:326 msgid "Last line not forced to have NL" msgstr "" #: rc.c:326 msgid " Force last NL " msgstr "" #: rc.c:327 msgid "~/.joe_state file will be updated" msgstr "Datei ~/.joe_state wird aktualisiert" #: rc.c:327 msgid "~/.joe_state file will not be updated" msgstr "Datei ~/.joe_state wird nicht aktualisiert" #: rc.c:327 msgid " Joe_state file " msgstr " joe_state-Datei " #: rc.c:328 msgid "Backup files will not be made" msgstr "Keine Erstellung von Backup-Dateien" #: rc.c:328 msgid "Backup files will be made" msgstr "Erstellung von Backup-Dateien" #: rc.c:328 msgid " Disable backups " msgstr " Backups deaktivieren " #: rc.c:329 msgid "Files will not be locked" msgstr "Dateien werden nicht gesperrt" #: rc.c:329 msgid "Files will be locked" msgstr "Dateien werden gesperrt" #: rc.c:329 msgid " Disable locks " msgstr " Sperren deaktivieren " #: rc.c:330 msgid "No file modification time check" msgstr "Keine Prüfung der Änderungszeit von Dateien" #: rc.c:330 msgid "File modification time checking enabled" msgstr "Prüfung der Änderungszeit von Dateien" #: rc.c:330 msgid " Disable mtime check " msgstr " Deaktiviere mtime-Prüfung " #: rc.c:331 msgid "No current dir" msgstr "Kein aktuelles Verzeichnis" #: rc.c:331 msgid "Current dir enabled" msgstr "" #: rc.c:331 msgid " Disable current dir " msgstr "" #: rc.c:332 msgid "Hardlinks will be broken" msgstr "Hardlinks werden gebrochen" #: rc.c:332 msgid "Hardlinks not broken" msgstr "Hardlinks werden nicht gebrochen" #: rc.c:332 msgid " Break hard links " msgstr " Hardlinks brechen " #: rc.c:333 msgid "Highlighting turned off after block operations" msgstr "Blockmarkierung nach Operationen aufheben" #: rc.c:333 msgid "Highlighting not turned off after block operations" msgstr "Blockmarkierung wird nach Operationen nicht aufgehoben" #: rc.c:333 msgid " Auto unmark " msgstr " Markierung aufheben " #: rc.c:334 msgid "Prompt for filename in save & exit command" msgstr "Prompt für Dateiname bei Speichern+Beenden-Befehl" #: rc.c:334 msgid "Don't prompt for filename in save & exit command" msgstr "Kein Prompt für Dateiname bei Speichern+Beenden-Befehl" #: rc.c:334 msgid " Exit ask " msgstr " Ende-Frage " #: rc.c:335 msgid "Warning bell enabled" msgstr "" #: rc.c:335 msgid "Warning bell disabled" msgstr "" #: rc.c:335 msgid "B Beeps " msgstr "B Beeps " #: rc.c:336 msgid "Top-most status line disabled" msgstr "" #: rc.c:336 msgid "Top-most status line enabled" msgstr "" #: rc.c:336 msgid " Disable status line " msgstr "" #: rc.c:337 msgid "Status line updated constantly" msgstr "Statuszeile dauerhaft aktualisiert" #: rc.c:337 msgid "Status line updated once/sec" msgstr "Statuszeile einmal pro Sekunde aktualisiert" #: rc.c:337 msgid " Fast status line " msgstr " Schnelle Statuszeile " #: rc.c:338 #, c-format msgid "Lines to keep for PgUp/PgDn or -1 for 1/2 window (%d): " msgstr "" #: rc.c:338 msgid " No. PgUp/PgDn lines " msgstr "" #: rc.c:339 msgid "Start search after a search repeats previous search" msgstr "" #: rc.c:339 msgid "Start search always starts a new search" msgstr "" #: rc.c:339 msgid " Continued search " msgstr "" #: rc.c:340 msgid "Full editing" msgstr "" #: rc.c:340 msgid "O Read only " msgstr "O Nur Lesen " #: rc.c:341 msgid "Smart home key enabled" msgstr "Smarte Pos1-Taste aktiviert" #: rc.c:341 msgid "Smart home key disabled" msgstr "Smarte Pos1-Taste deaktiviert" #: rc.c:341 msgid " Smart home key " msgstr " Smarte Pos1-Taste " #: rc.c:342 msgid "Smart home goes to indentation first" msgstr "Smart Pos1 geht zuerst zur Einrückung" #: rc.c:342 msgid "Smart home goes home first" msgstr "Smart Pos1 geht zuerst an den Anfang" #: rc.c:342 msgid " To indent first " msgstr " Pos1 z.Einrückung " #: rc.c:343 msgid "Smart backspace key enabled" msgstr "Smartes Backspace aktiviert" #: rc.c:343 msgid "Smart backspace key disabled" msgstr "Smartes Backspace deaktiviert" #: rc.c:343 msgid " Smart backspace " msgstr " Smartes Backspace " #: rc.c:344 msgid "Indentation clean up enabled" msgstr "Einrückungen werden automatisch gesäubert" #: rc.c:344 msgid "Indentation clean up disabled" msgstr "Einrückungen werden nicht automatisch gesäubert" #: rc.c:344 msgid " Clean up indents " msgstr " Einrückungen säubern " #: rc.c:345 msgid "Picture drawing mode enabled" msgstr "Bildzeichnermodus aktiviert" #: rc.c:345 msgid "Picture drawing mode disabled" msgstr "Bildzeichnermodus deaktiviert" #: rc.c:345 msgid "P Picture mode " msgstr "P Bildmodus " #: rc.c:346 #, c-format msgid "Backup files stored in (%s): " msgstr "Backupdateien speichern in (%s): " #: rc.c:346 msgid " Path to backup files " msgstr " Pfad zu Backupdateien " #: rc.c:347 msgid "Select syntax (^C to abort): " msgstr "Syntax (^C zum Abbrechen): " #: rc.c:347 msgid "Y Syntax" msgstr "Y Syntax" #: rc.c:348 msgid "Select file character set (^C to abort): " msgstr "Dateikodierung (^C zum Abbrechen): " #: rc.c:348 msgid "E Encoding " msgstr "E Kodierung " #: rc.c:349 msgid "Single quoting enabled" msgstr "Einfache Anführungszeichen aktiviert" #: rc.c:349 msgid "Single quoting disabled" msgstr "Einfache Anführungszeichen deaktiviert" #: rc.c:349 msgid " ^G ignores '... ' " msgstr " ^G ignoriert '... ' " #: rc.c:350 msgid "/* comments enabled" msgstr "/* */ Kommentare aktiviert" #: rc.c:350 msgid "/* comments disabled" msgstr "/* */ Kommentare deaktiviert" #: rc.c:350 msgid " ^G ignores /*...*/ " msgstr " ^G ignoriert /*...*/ " #: rc.c:351 msgid "// comments enabled" msgstr "// Kommentare aktiviert" #: rc.c:351 msgid "// comments disabled" msgstr "// Kommentare deaktiviert" #: rc.c:351 msgid " ^G ignores //... " msgstr " ^G ignoriert //... " #: rc.c:352 msgid "# comments enabled" msgstr "# Kommentare aktiviert" #: rc.c:352 msgid "# comments disabled" msgstr "# Kommentare deaktiviert" #: rc.c:352 msgid " ^G ignores #... " msgstr " ^G ignoriert #... " #: rc.c:353 msgid "-- comments enabled" msgstr "-- Kommentare aktiviert" #: rc.c:353 msgid "-- comments disabled" msgstr "-- Kommmentare deaktiviert" #: rc.c:353 msgid " ^G ignores --... " msgstr " ^G ignoriert --... " #: rc.c:354 msgid "; comments enabled" msgstr "; Kommentare aktiviert" #: rc.c:354 msgid "; comments disabled" msgstr "; Kommentare deaktiviert" #: rc.c:354 msgid " ^G ignores ;... " msgstr " ^G ignoriert ;... " #: rc.c:355 msgid "Text delimiters (%s): " msgstr "Textbregrenzer (%s): " #: rc.c:355 msgid " Text delimiters " msgstr " Textbegrenzer " #: rc.c:356 #, c-format msgid "Language (%s): " msgstr "Sprache (%s): " #: rc.c:356 msgid "V Language " msgstr "V Sprache " #: rc.c:357 #, c-format msgid "Characters which can indent paragraphs (%s): " msgstr "Zeichen, die Absätze einrücken können (%s): " #: rc.c:357 msgid " Paragraph indent chars " msgstr " Absatzeinrückungszeichen " #: rc.c:358 msgid "Clicking can move the cursor past end of line" msgstr "" #: rc.c:358 msgid "Clicking past end of line moves cursor to the end" msgstr "" #: rc.c:358 msgid " Click past end " msgstr "" #: rc.c:359 msgid "Mouse action is done with the right button" msgstr "Mausaktion wird mit der rechten Taste durchgeführt" #: rc.c:359 msgid "Mouse action is done with the left button" msgstr "Mausaktion wird mit der linken Taste durchgeführt" #: rc.c:359 msgid " Right button " msgstr " Rechte Maustaste " #: rc.c:669 rc.c:688 rc.c:700 msgid "Value out of range" msgstr "Wert außerhalb des zulässigen Bereiches" #: rc.c:724 msgid "Syntax definition file not found" msgstr "Syntax-Definitionsdatei nicht gefunden" #: rc.c:799 #, c-format msgid "%s encoding assumed for this file" msgstr "Kodierung %s für diese Datei geraten" #: rc.c:802 msgid "Character set not found" msgstr "Zeichenkodierung nicht gefunden" #: rc.c:1010 #, c-format msgid "Processing '%s'..." msgstr "Bearbeite '%s'..." #: rc.c:1066 #, c-format msgid "" "\n" "%s %d: Unknown option %s" msgstr "" "\n" "%s %d: Unbekannte Option %s" #: rc.c:1099 #, c-format msgid "" "\n" "%s %d: macro missing from :def" msgstr "" "\n" "%s %d: Makro fehlt in :def" #: rc.c:1103 #, c-format msgid "" "\n" "%s %d: command name missing from :def" msgstr "" "\n" "%s %d: Befehlsname fehlt in :def" #: rc.c:1114 #, c-format msgid "" "\n" "%s %d: context name missing from :inherit" msgstr "" "\n" "%s %d: Kontextname fehlt in :inherit" #: rc.c:1118 #, c-format msgid "" "\n" "%s %d: No context selected for :inherit" msgstr "" "\n" "%s %d: Kein Kontext für :inherit ausgewählt" #: rc.c:1146 #, c-format msgid "" "\n" "%s %d: Couldn't open %s" msgstr "" "\n" "%s %d: Konnte %s nicht öffnen" #: rc.c:1154 #, c-format msgid "" "\n" "%s %d: :include missing file name" msgstr "" "\n" "%s %d: :include fehlt der Dateiname" #: rc.c:1167 #, c-format msgid "" "\n" "%s %d: No context selected for :delete" msgstr "" "\n" "%s %d: Kein Kontext für :delete ausgewählt" #: rc.c:1174 #, c-format msgid "" "\n" "%s %d: Invalid context name" msgstr "" "\n" "%s %d: Ungültiger Kontextname" #: rc.c:1185 #, c-format msgid "" "\n" "%s %d: No context selected for macro to key-sequence binding" msgstr "" #: rc.c:1194 #, c-format msgid "" "\n" "%s %d: Unknown command in macro" msgstr "" "\n" "%s %d: Unbekannter Befehl in Makro" #: rc.c:1210 #, c-format msgid "" "\n" "%s %d: Bad key sequence '%s'" msgstr "" #: rc.c:1221 msgid "" "\n" "done\n" msgstr "" "\n" "fertig\n" #: rc.c:1223 msgid "done\n" msgstr "fertig\n" #: scrn.c:720 msgid "" "Sorry, your terminal can't do absolute cursor positioning.\n" "It's broken\n" msgstr "" "Das Terminal kann keine absolute Cursorpositionierung vornehmen.\n" #: selinux.c:35 selinux.c:84 selinux.c:141 #, c-format msgid "Could not get security context for %s" msgstr "Konnte Sicherheitskontext für %s nicht holen" #: selinux.c:41 #, fuzzy msgid "" "\n" "Could not get security context for " msgstr "" "\n" "Konnte Sicherheitskontext für %%s nicht holen: " #: selinux.c:51 #, c-format msgid "Could not set security context for %s" msgstr "Konnte Sicherheitskontext für %s nicht setzen" #: selinux.c:91 #, c-format msgid "Could not set default security context for %s" msgstr "Konnte den Default-Sicherheitskontext für %s nicht setzen" #: selinux.c:113 msgid "Could not reset default security context" msgstr "Konnte den Default-Sicherheitskontext nicht zurücksetzen" #: selinux.c:146 #, c-format msgid "%s Security Context %s" msgstr "%s Sicherheitskontext %s" #: syntax.c:259 #, c-format msgid "%s %d: Class already defined\n" msgstr "%s %d: Klasse bereits definiert\n" #: syntax.c:339 #, c-format msgid "%s %d: Missing )\n" msgstr "%s %d: Fehlende )\n" #: syntax.c:411 #, c-format msgid "%s %d: missing parameter for ifdef\n" msgstr "%s %d: fehlender Parameter für ifdef\n" #: syntax.c:421 #, c-format msgid "%s %d: else with no matching if\n" msgstr "%s %d: else with no matching if\n" #: syntax.c:428 #, c-format msgid "%s %d: endif with no matching if\n" msgstr "%s %d: endif ohne passendes if\n" #: syntax.c:432 syntax.c:560 #, c-format msgid "%s %d: Missing subroutine name\n" msgstr "%s %d: Fehlender Subroutinen-Name\n" #: syntax.c:447 #, c-format msgid "%s %d: Unknown control statement\n" msgstr "%s %d: Unbekannte Kontrollanweisung\n" #: syntax.c:450 #, c-format msgid "%s %d: Missing control statement name\n" msgstr "%s %d: Felender Kontrollanweisunsname\n" #: syntax.c:477 #, c-format msgid "%s %d: Unknown class\n" msgstr "%s %d: Unbekannte Klasse\n" #: syntax.c:480 #, c-format msgid "%s %d: Missing color for state definition\n" msgstr "%s %d: Fehlende Farbe für Zustandsdefinition\n" #: syntax.c:482 syntax.c:610 #, c-format msgid "%s %d: Missing state name\n" msgstr "%s %d: Fehlender Zustandsname\n" #: syntax.c:503 #, c-format msgid "%s %d: Bad string\n" msgstr "%s %d: Inakzeptable Zeichenkette\n" #: syntax.c:543 syntax.c:545 syntax.c:554 syntax.c:568 syntax.c:604 #: syntax.c:606 #, c-format msgid "%s %d: Missing value for option\n" msgstr "%s %d: Fehlender Wert für option\n" #: syntax.c:608 syntax.c:624 #, c-format msgid "%s %d: Unknown option\n" msgstr "%s %d: Unbekannte Option\n" #: syntax.c:612 #, c-format msgid "%s %d: Missing string\n" msgstr "%s %d: Fehlende Zeichenkette\n" #: syntax.c:633 #, c-format msgid "%s %d: Missing jump\n" msgstr "%s %d: Fehlender Sprung\n" #: syntax.c:635 #, c-format msgid "%s %d: No state\n" msgstr "%s %d: Kein Zustand\n" #: syntax.c:637 #, c-format msgid "%s %d: Unknown character\n" msgstr "%s %d: Unbekanntes Zeichen\n" #: syntax.c:644 #, c-format msgid "%s %d: ifdef with no matching endif\n" msgstr "%s %d: ifdef ohne passendes endif\n" #: tab.c:212 tab.c:271 msgid "Couldn't read directory " msgstr "Konnte Verzeichnis nicht lesen " #: termcap.c:219 msgid "Couldn't load termcap entry. Using ansi default\n" msgstr "Konnte termcap-Eintrag nicht laden. Verwende ANSI-Default\n" #: termcap.c:240 #, c-format msgid "%s is out of date\n" msgstr "%s ist veraltet\n" #: tty.c:314 msgid "Couldn't open /dev/tty\n" msgstr "Konnte /dev/tty nicht öffnen\n" #: tty.c:731 msgid "You are at the command shell. Type 'exit' to return\n" msgstr "Befehlszeilenmodus. 'exit' eingeben um zurückzukehren\n" #: tty.c:795 msgid "You have suspended the program. Type 'fg' to return\n" msgstr "Das Program wurde unterbrochen. 'fg' eingeben um zurückzukehren\n" #: tty.c:1146 #, c-format msgid "Couldn't execute shell '%s'\n" msgstr "Konnte Shell '%s' nicht ausführen\n" #: tw.c:213 msgid "Unnamed" msgstr "Unbenannt" #: tw.c:219 msgid "(Modified)" msgstr "(Geändert)" #: tw.c:223 msgid "(Read only)" msgstr "(Schreibgeschützt)" #: tw.c:329 msgid "*SHELL*" msgstr "*SHELL*" #: tw.c:333 #, c-format msgid "(Macro %d recording...)" msgstr "(Makro %d wird aufgenommen...)" #: tw.c:558 tw.c:584 ufile.c:1010 msgid "Lose changes to this file (y,n,^C)? " msgstr "Änderungen an dieser Datei verwerfen (y,n,^C)? " #: ublock.c:284 msgid "Selection cleared." msgstr "Markierung aufgehoben." #: ublock.c:292 ublock.c:309 msgid "Selection started." msgstr "Markierung gestartet." #: ublock.c:417 ublock.c:503 ublock.c:559 ublock.c:887 ublock.c:921 #: ublock.c:1083 ufile.c:435 umath.c:177 undo.c:455 msgid "No block" msgstr "Nichts markiert" #: ublock.c:756 ublock.c:839 msgid "Selected lines not properly indented" msgstr "Markierte Zeilen sind nicht korrekt eingerückt" #: ublock.c:1067 ushell.c:86 msgid "Sorry, no sub-processes in DOS (yet)" msgstr "Keine Subprozesse in DOS (bisher)" #: ublock.c:1072 msgid "Command to filter block through (^C to abort): " msgstr "Filterbefehl für Block (^C to abort): " #: ublock.c:1077 msgid "Command to filter file through (^C to abort): " msgstr "Filterbefehl für Datei (^C to abort): " #: uedit.c:1388 utag.c:73 msgid "Invalid line number" msgstr "Ungültige Zeilennummer" #: uedit.c:1395 msgid "Go to line (^C to abort): " msgstr "Gehe zu Zeile (^C zum Abbrechen): " #: uedit.c:1424 msgid "Invalid column number" msgstr "Ungültige Spaltennummer" #: uedit.c:1431 msgid "Go to column (^C to abort): " msgstr "Gehe zu Spalte (^C zum Abbrechen): " #: uedit.c:1460 msgid "Invalid byte number" msgstr "Ungültige Byteposition" #: uedit.c:1467 msgid "Go to byte (^C to abort): " msgstr "Gehe zu Byte (^C zum Abbrechen): " #: uedit.c:1911 msgid "Unicode (ISO-10646) character in hex (^C to abort): " msgstr "Unicode-Zeichen (ISO-10646) in Hex (^C zum Abbrechen): " #: uedit.c:2036 msgid "Ctrl- (or 0-9 for dec. ascii, x for hex, or o for octal)" msgstr "Strg- (oder 0-9 für dez. ASCII, x für hex, oder o für oktal)" #: uedit.c:2099 msgid "Quote" msgstr "Quote" #: uedit.c:2166 #, c-format msgid "Mark %d set" msgstr "Marker %d gesetzt" #: uedit.c:2180 msgid "Set mark (0-9):" msgstr "Setze Marker (0-9):" #: uedit.c:2198 #, c-format msgid "Mark %d not set" msgstr "Marker %d nicht gesetzt" #: uedit.c:2211 msgid "Goto bookmark (0-9):" msgstr "Gehe zu Lesezeichen (0-9):" #: uedit.c:2243 usearch.c:995 utag.c:107 msgid "Not found" msgstr "Nicht gefunden" #: uedit.c:2259 msgid "Forward to char: " msgstr "" #: uedit.c:2270 msgid "Backward to char: " msgstr "" #: uedit.c:2290 msgid "Message (^C to abort): " msgstr "Meldung (^C zum Abbrechen): " #: uedit.c:2312 msgid "Insert (^C to abort): " msgstr "Einfügen (^C zum Abbrechen): " #: uerror.c:330 uerror.c:344 #, c-format msgid "%d messages found" msgstr "%d Meldungen gefunden" #: uerror.c:332 uerror.c:346 msgid "No messages found" msgstr "Keine Meldungen gefunden" #: uerror.c:377 msgid "No messages" msgstr "Keine Meldungen" #: uerror.c:432 uerror.c:443 msgid "No more errors" msgstr "Keine weiteren Fehler" #: ufile.c:39 msgid "(Unnamed)" msgstr "(Unbenannt)" #: ufile.c:44 ufile.c:51 #, c-format msgid "File %s saved" msgstr "Datei %s gespeichert" #: ufile.c:46 ufile.c:49 #, c-format msgid "File %s not saved" msgstr "Datei %s nicht saved" #: ufile.c:53 #, c-format msgid "File %s not changed so no update needed" msgstr "Datei %s nicht geändert, daher keine Aktualisierung notwendig" #: ufile.c:67 msgid "Some files have not been saved." msgstr "Einige Dateien wurden nicht gespeichert." #: ufile.c:69 msgid "All modified files have been saved." msgstr "Alle geänderten Dateien wurden gespeichert." #: ufile.c:71 msgid "No modified files, so no updates needed." msgstr "Keine geänderten Dateien, daher keine Aktualisierung notwendig." #: ufile.c:107 msgid "System (^C to abort): " msgstr "System (^C zum Abbrechen): " #: ufile.c:273 msgid "|yes|yY" msgstr "|Ja|yY" #: ufile.c:274 msgid "|no|nN" msgstr "|Nein|nN" #: ufile.c:309 msgid "Couldn't make backup file... file not saved" msgstr "Konnte Backupdatei nicht erstellen... Datei nicht gespeichert" #: ufile.c:321 msgid "Could not make backup file. Save anyway (y,n,^C)? " msgstr "Konnte Backupdatei nicht erstellen. Trotzdem speichern (y,n,^C)? " #: ufile.c:409 ufile.c:425 #, c-format msgid "Block written to file %s" msgstr "Block nach Datei %s geschrieben" #: ufile.c:488 msgid "File exists. Overwrite (y,n,^C)? " msgstr "Datei existiert. Überschreiben (y,n,^C)? " #: ufile.c:495 msgid "File on disk is newer. Overwrite (y,n,^C)? " msgstr "Datei auf Datenträger ist neuer. Überschreiben (y,n,^C)? " #: ufile.c:510 ufile.c:899 ufile.c:1103 msgid "Name of file to save (^C to abort): " msgstr "Name der zu speichernden Datei (^C zum Abbrechen): " #: ufile.c:538 msgid "Name of file to write (^C to abort): " msgstr "Name der zu schreibenden Datei (^C zum Abbrechen): " #: ufile.c:654 msgid "Load original file from disk (y,n,^C)? " msgstr "Originaldatei von Datenträger laden (y,n,^C)? " #: ufile.c:684 msgid "Can't replace modified file" msgstr "Kann geänderte Datei nicht ersetzen" #: ufile.c:693 msgid "Name of file to edit (^C to abort): " msgstr "Name der zu editierenden Datei (^C zum Abbrechen): " #: ufile.c:708 ufile.c:1085 msgid "Name of buffer to edit (^C to abort): " msgstr "Name des zu editierenden Puffers (^C zum Abbrechen): " #: ufile.c:764 msgid "Name of scratch buffer to edit (^C to abort): " msgstr "Name des zu editierenden temp. Puffers (^C zum Abbrechen): " #: ufile.c:865 msgid "Name of file to insert (^C to abort): " msgstr "Name der einzufügenden Dateien (^C zum Abbrechen): " #: ufile.c:933 msgid "Save changes to this file (y,n,^C)? " msgstr "Änderungen an dieser Datei speichern (y,n,^C)? " #: ufile.c:1137 #, c-format msgid "File %s has been modified. Save it (y,n,^C)? " msgstr "Datei %s wurde geändert. Speichern (y,n,^C)? " #: uisrch.c:267 msgid "I-find: " msgstr "I-Suche: " #: umath.c:19 msgid "Float point exception" msgstr "Gleitkomma-Ausnahme" #: umath.c:93 umath.c:195 umath.c:214 msgid "Missing )" msgstr "Fehlende )" #: umath.c:104 msgid "Syntax error in macro" msgstr "Syntaxfehler in Makro" #: umath.c:111 msgid "Missing (" msgstr "Fehlende (" #: umath.c:140 umath.c:146 umath.c:153 umath.c:162 msgid "No numbers in block" msgstr "Keine Nummern im Block" #: umath.c:220 msgid "Called object is not a function" msgstr "Aufgerufenes Objekt ist keine Funktion" #: umath.c:234 msgid "Factorial can only take positive integers" msgstr "Fakultät can nur von positive Ganzzahlen genommen werden" #: umath.c:332 msgid "Left side of = is not an l-value" msgstr "Linke Seite von = ist keine Lvalue" #: umath.c:346 msgid "Recursion depth exceeded" msgstr "Rekursionstiefe überschritten" #: umath.c:366 msgid "Extra junk after end of expr" msgstr "Extrakrempel nach Ende des Ausdrucks" #: undo.c:438 msgid "Modified flag cleared" msgstr "Geändert-Flag entfernt" #: usearch.c:281 usearch.c:350 msgid "Wrapped" msgstr "Gesprungen" #: usearch.c:553 msgid "|all files|aA" msgstr "|alle Dateien|aA" #: usearch.c:554 msgid "|error list files|eE" msgstr "" #: usearch.c:555 msgid "|search and replace|rR" msgstr "|Suchen und Ersetzen|rR" #: usearch.c:556 msgid "|backwards|bB" msgstr "|rückwärts|bB" #: usearch.c:557 msgid "|ignore case|iI" msgstr "|Groß-/Kleinschreibung ignorieren|iI" #: usearch.c:558 msgid "|restrict to highlighted block|kK" msgstr "|nur innerhalb Markierung|kK" #: usearch.c:559 msgid "|don't ignore case|sS" msgstr "|Groß-/Kleinschreibung beachten|sS" #: usearch.c:560 msgid "|wrap|wW" msgstr "|springen|wW" #: usearch.c:561 msgid "|don't wrap|nN" msgstr "|nicht springen|nN" #: usearch.c:618 msgid "Replace with (^C to abort): " msgstr "Ersetzen durch (^C zum Abbrechen): " #: usearch.c:633 msgid "" "case (S)ensitive (R)eplace (B)ackwards Bloc(K) (A)ll files NNN (^C to " "abort): " msgstr "" "case-(s)ensitiv e(R)setzen (B)rückwärts Bloc(K) (A)lle Dateien NNN (o.^C) " #: usearch.c:635 msgid "(I)gnore (R)eplace (B)ackwards Bloc(K) (A)ll files NNN (^C to abort): " msgstr "(I)gn. e(R)setzen (B)rückwärts Bloc(K) (A)lle Dateien NNN (od.^C): " #: usearch.c:717 #, c-format msgid "Find (^C to abort) [%s]: " msgstr "Suchen (^C zum Abbrechen) [%s]: " #: usearch.c:719 msgid "Find (^C to abort): " msgstr "Suchen (^C zum Abbrechen): " #: usearch.c:813 msgid "|rest of file|rR" msgstr "|Rest der Datei|rR" #: usearch.c:814 msgid "|backup|bB" msgstr "|Backup|bB" #: usearch.c:845 msgid "Replace (Y)es (N)o (R)est (B)ackup (^C to abort)?" msgstr "Ersetzen (Y)Ja (N)ein (R)est (B)ackup (^C zum Abbrechen)?" #: usearch.c:993 msgid "Not found (search restricted to marked block)" msgstr "Nicht gefunden (Suche auf Markierung begrenzt)" #: usearch.c:1000 msgid "Infinite loop aborted: your search repeatedly matched same place" msgstr "Unendliche Schleife abgebrochen: Suche traf gleiche Stelle mehrmals" #: ushell.c:95 msgid "Program already running in this window" msgstr "Programm läuft bereits im Fenster" #: ushell.c:103 msgid "No ptys available" msgstr "Keine pyts verfügbar" #: ushell.c:128 msgid "\"SHELL\" environment variable not defined or exported" msgstr "\"SHELL\" Umgebungsvariable nicht definiert oder exportiert" #: ushell.c:164 msgid "Program to run: " msgstr "Auszufürendes Programm: " #: ushell.c:188 msgid "Build command: " msgstr "Build-Befehl: " #: ushell.c:197 msgid "Enter build command (for example, 'make'): " msgstr "Buildbefehl eingeben (z.B. `make`): " #: ushell.c:212 msgid "Grep command: " msgstr "grep-Befehl: " #: ushell.c:221 msgid "Enter grep command (for example, 'grep -n foo *.c'): " msgstr "grep-Befehl eingeben (z.B. `grep -n foo *.c`): " #: ushell.c:250 msgid "Kill program (y,n,^C)?" msgstr "Programm abbrechen (y,n,^C)?" #: utag.c:26 msgid "Couldn't open tags file" msgstr "Konnte Tags-Datei nicht öffnen" #: utag.c:168 msgid "Tag search: " msgstr "Tag-Suche: " #: vfile.c:174 msgid "vfile: out of memory\n" msgstr "" #: vfile.c:229 #, c-format msgid "Couldn't open file '%s'\n" msgstr "Konnte '%s' nicht öffnen\n" #: w.c:822 msgid "There is no message buffer" msgstr "Kein Nachrichtenpuffer vorhanden" #~ msgid "Delimiters (%s): " #~ msgstr "Begrenzer (%s): " #~ msgid "Delimiters: " #~ msgstr "Begrenzer: " joe-3.7/po/fr.po0000644000100100007640000010513311100501500010421 00000000000000# JOE french translation # Copyright (C) 2006 Joseph H Allen # This file is distributed under the same license as the PACKAGE package. # Sébastien Koechlin # msgid "" msgstr "" "Project-Id-Version: joe 3.3\n" "POT-Creation-Date: 2006-06-15 14:12-0400\n" "PO-Revision-Date: 2006-05-30 17:05+0200\n" "Last-Translator: Sébastien Koechlin \n" "Language-Team: French \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-15\n" "Content-Transfer-Encoding: 8bit\n" "Report-Msgid-Bugs-To: \n" #: b.c:31 msgid "No error" msgstr "Aucune erreur" #: b.c:32 msgid "New File" msgstr "Nouveau fichier" #: b.c:33 msgid "Error reading file" msgstr "Erreur à la lecture du fichier" #: b.c:34 msgid "Error seeking file" msgstr "Erreur lors du positionnement dans le fichier" #: b.c:35 msgid "Error opening file" msgstr "Erreur à l'ouverture du fichier" #: b.c:36 msgid "Error writing file" msgstr "Erreur à l'écriture du fichier" #: b.c:37 msgid "File on disk is newer" msgstr "Le fichier sur le disque est plus récent" #: b.c:2736 #, c-format msgid "" "\n" "*** These modified files were found in JOE when it aborted on %s" msgstr "" "\n" "*** Ces fichiers modifiés étaient ouvert dans JOE quand il a quitté le %s" #: b.c:2738 #, c-format msgid "*** JOE was aborted by UNIX signal %d\n" msgstr "*** JOE a quitté à la réception du signal UNIX %d\n" #: b.c:2740 msgid "*** JOE was aborted because the terminal closed\n" msgstr "*** JOE a quitté suite à la fermeture du terminal\n" #: b.c:2745 #, c-format msgid "" "\n" "*** File '%s'\n" msgstr "" "\n" "*** Fichier '%s'\n" #: b.c:2747 msgid "" "\n" "*** File '(Unnamed)'\n" msgstr "" "\n" "*** Fichier '(Sans nom)'\n" #: bw.c:1274 #, c-format msgid "** Line %ld Col %ld Offset %s(0x%s) **" msgstr "** Ligne %ld Col %ld Position %s(0x%s) **" #: bw.c:1276 #, c-format msgid "** Line %ld Col %ld Offset %s(0x%s) %s %d(0%o/0x%X) Width %d **" msgstr "" "** Ligne %ld Col %ld Position %s(0x%s) %s %d(0%o/0x%X) Largeur %d **" #: cmd.c:211 msgid "Could not create lock. (I) edit anyway, (Q) cancel edit? " msgstr "Impossible de créer le verrou. (E)diter tout de même, (A)bandonner ? " #: cmd.c:212 #, c-format msgid "Locked by %s. (S)teal lock, (I) edit anyway, (Q) cancel edit? " msgstr "" "Verrouillé par %s. (S)'approprier le verrou, (E)diter tout de même, (A)" "bandonner ? " #: cmd.c:214 msgid "|steal the lock|sS" msgstr "" #: cmd.c:215 msgid "|cancel edit due to lock|qQ" msgstr "|cancel edit due to lock|qQaA" #: cmd.c:216 #, fuzzy msgid "|ignore lock, continue with edit|iI" msgstr "|ignore lock, continue with edit|iIeE" #: cmd.c:265 msgid "Notice: File on disk changed! (hit ^C to continue) " msgstr "Attention: Le fichier sur le disque a été modifié (^C pour continuer) " #: cmd.c:325 msgid "Modify other window first for macro" msgstr "" #: cmd.c:333 msgid "Other buffer is read only" msgstr "" #: cmd.c:348 rc.c:340 msgid "Read only" msgstr "Lecture seule" #: cmd.c:542 cmd.c:552 msgid "No such command" msgstr "Commande inconnue" #: cmd.c:569 msgid "Command: " msgstr "Commande: " #: help.c:77 #, c-format msgid "" "\n" "%d: EOF before end of help text\n" msgstr "" #: kbd.c:352 msgid "No such keymap" msgstr "" #: kbd.c:381 msgid "Change keymap: " msgstr "" #: macro.c:662 msgid "Macro to record (0-9 or ^C to abort): " msgstr "Macro à enregistrer (0-9 ou ^C pour abandonner): " #: macro.c:764 msgid "Play-" msgstr "" #: macro.c:791 msgid "No. times to repeat next command (^C to abort): " msgstr "Nombre de répét. de la prochaine commande (^C pour abandonner): " #: macro.c:819 msgid "If (^C to abort): " msgstr "If (^C pour abandonner): " #: macro.c:826 msgid "Elsif without if" msgstr "Elsif sans if" #: macro.c:832 msgid "Else if: " msgstr "Else sans if" #: macro.c:841 msgid "Else without if" msgstr "Endif sans if" #: macro.c:852 msgid "Endif without if" msgstr "Endif sans if" #: macro.c:895 #, c-format msgid "Repeat %s%d" msgstr "Repeat %.s%d" #: macro.c:908 msgid "Repeat" msgstr "Repeat" #: main.c:207 msgid "Couldn't load termcap/terminfo entry\n" msgstr "Impossible de charger les informations termcap/terminfo\n" #: main.c:222 main.c:239 #, c-format msgid "There were errors in '%s'. Use it anyway?" msgstr "Il y a des erreurs dans '%s'. L'utiliser quand même ?" #: main.c:294 #, c-format msgid "Warning: %s is newer than your %s.\n" msgstr "Attention: %s est plus récent que votre %s.\n" #: main.c:295 #, c-format msgid "You should update or delete %s\n" msgstr "Vous devez mettre à jour ou effacer %s\n" #: main.c:296 #, c-format msgid "Hit enter to continue with %s " msgstr "Pressez Entrée pour continuer avec %s " #: main.c:309 main.c:328 main.c:345 #, c-format msgid "There were errors in '%s'. Use it anyway (y,n)? " msgstr "Il y a des erreurs dans '%s'. L'utiliser quand même (o,n) ?" #: main.c:353 #, c-format msgid "Couldn't open '%s'\n" msgstr "Impossible d'ouvrir '%s'\n" #: main.c:359 msgid "rc file has no :main key binding section or no bindings. Bye.\n" msgstr "Le fichier de configuration n'a pas de section :main\n" #: main.c:372 #, c-format msgid "Unknown option '%s'\n" msgstr "Option inconnue: '%s'\n" #: main.c:508 #, c-format msgid "\\i** Joe's Own Editor v%s ** (%s) ** Copyright %s 2006 **\\i" msgstr "\\i** Joe's Own Editor v%s ** (%s) ** Copyright %s 2006 **\\i" #: rc.c:295 msgid "Overtype mode" msgstr "Mode écrasement" #: rc.c:295 msgid "Insert mode" msgstr "Mode insertion" #: rc.c:295 msgid "T Overtype " msgstr "" #: rc.c:296 msgid "Hex edit mode" msgstr "Édition en mode hexadécimal" #: rc.c:296 msgid "Text edit mode" msgstr "Édition en mode texte" #: rc.c:296 msgid " Hex edit mode " msgstr "" #: rc.c:297 msgid "Autoindent enabled" msgstr "Auto-indentation activée" #: rc.c:297 msgid "Autoindent disabled" msgstr "Auto-indentation désactivée" #: rc.c:297 msgid "I Autoindent " msgstr "I Auto-indent " #: rc.c:298 msgid "Wordwrap enabled" msgstr "Retour à la ligne automatique activé" #: rc.c:298 msgid "Wordwrap disabled" msgstr "Retour à la ligne automatique désactivé" #: rc.c:298 msgid "W Word wrap " msgstr "" #: rc.c:299 #, c-format msgid "Tab width (%d): " msgstr "Largeur des tabulations (%d): " #: rc.c:299 msgid "D Tab width " msgstr "" #: rc.c:300 #, c-format msgid "Left margin (%d): " msgstr "Marge gauche (%d): " #: rc.c:300 msgid "L Left margin " msgstr "L Marge gauche " #: rc.c:301 #, c-format msgid "Right margin (%d): " msgstr "Marge droite (%d): " #: rc.c:301 msgid "R Right margin " msgstr "R Marge droite " #: rc.c:302 msgid "Restore cursor position when files loaded" msgstr "Restaurer la position du curseur au chargement du fichier" #: rc.c:302 msgid "Don't restore cursor when files loaded" msgstr "Ne restaure pas la position du curseur au chargement du fichier" #: rc.c:302 msgid " Restore cursor " msgstr "" #: rc.c:303 msgid "Rectangle mode" msgstr "Mode de sélection en rectangle" #: rc.c:303 msgid "Text-stream mode" msgstr "Mode de sélection ordinaire (flux textuel)" #: rc.c:303 msgid "X Rectangle mode " msgstr "" #: rc.c:304 msgid "Search ignores case by default" msgstr "Recherche sans respecter la casse" #: rc.c:304 msgid "Case sensitive search by default" msgstr "Recherche en respectant la casse" #: rc.c:304 msgid " Case insensitivity " msgstr "" #: rc.c:305 msgid "Search wraps" msgstr "La recherche recommence au début du fichier" #: rc.c:305 msgid "Search doesn't wrap" msgstr "La recherche ne recommence pas au début du fichier" #: rc.c:305 msgid " Search wraps " msgstr "" #: rc.c:306 msgid "Menu explorer mode" msgstr "" #: rc.c:306 msgid "Simple completion mode" msgstr "" #: rc.c:306 msgid " Menu explorer " msgstr "" #: rc.c:307 msgid "Menu above prompt" msgstr "Menu au dessus du prompt" #: rc.c:307 msgid "Menu below prompt" msgstr "Menu en dessous du prompt" #: rc.c:307 msgid " Menu position " msgstr "" #: rc.c:308 msgid "Search prompting on" msgstr "" #: rc.c:308 msgid "Search prompting off" msgstr "" #: rc.c:308 msgid " Search prompting " msgstr "" #: rc.c:309 msgid "Jump into menu is on" msgstr "" #: rc.c:309 msgid "Jump into menu is off" msgstr "" #: rc.c:309 msgid " Jump into menu " msgstr "" #: rc.c:310 msgid "Autoswap ^KB and ^KK" msgstr "Inversion automatique de ^KB et de ^KK" #: rc.c:310 msgid "Autoswap off " msgstr "Inversion automatique désactivée" #: rc.c:310 msgid " Autoswap mode " msgstr "" #: rc.c:311 #, c-format msgid "Indent char %d (SPACE=32, TAB=9, ^C to abort): " msgstr "" "Caractère d'indentation (Espace=32, Tabulation=9, ^C pour quitter) (%d): " #: rc.c:311 msgid " Indent char " msgstr "" #: rc.c:312 #, c-format msgid "Indent step %d (^C to abort): " msgstr "Taille de l'indentation (^C pour abandonner) (%d): " #: rc.c:312 msgid " Indent step " msgstr "" #: rc.c:313 msgid "One space after periods for paragraph reformat" msgstr "Un seul espace après un point lors du reformatage des paragraphes" #: rc.c:313 msgid "Two spaces after periods for paragraph reformat" msgstr "Deux espaces après un point lors du reformatage des paragraphes" #: rc.c:313 msgid " French spacing " msgstr "" #: rc.c:314 msgid "Highlighting enabled" msgstr "Surlignage activé" #: rc.c:314 msgid "Highlighting disabled" msgstr "Surlignage désactivé" #: rc.c:314 msgid "H Highlighting " msgstr "" #: rc.c:315 msgid "Inserting spaces when tab key is hit" msgstr "La touche tabulation insère des espaces" #: rc.c:315 msgid "Inserting tabs when tab key is hit" msgstr "La touche tabulation insère des tabulations" #: rc.c:315 msgid " No tabs " msgstr "" #: rc.c:316 msgid "Cursor will be recentered on scrolls" msgstr "Le curseur est recentré lors d'un changement de page" #: rc.c:316 msgid "Cursor will not be recentered on scroll" msgstr "Le curseur n'est pas recentré lors d'un changement de page" #: rc.c:316 msgid "C Center on scroll " msgstr "" #: rc.c:317 msgid "Automatically detect MS-DOS files" msgstr "Détection automatique des fichiers au format MS-DOS" #: rc.c:317 msgid "Do not automatically detect MS-DOS files" msgstr "Pas de détection automatique des fichiers au format MS-DOS" #: rc.c:317 msgid " Auto detect CR-LF " msgstr "" #: rc.c:318 msgid "Automatically detect indentation" msgstr "Détection automatique de l'indentation" #: rc.c:318 msgid "Do not automatically detect indentation" msgstr "Pas de détection automatique de l'indentation" #: rc.c:318 msgid " Guess indent " msgstr "" #: rc.c:319 msgid "Automatically detect non-UTF-8 in UTF-8 locale" msgstr "" "Détection automatique des fichiers non UTF-8 lorsque la locale est UTF-8" #: rc.c:319 msgid "Do not automatically detect non-UTF-8" msgstr "Pas de détection automatique des fichiers non-UTF-8" #: rc.c:319 msgid " Guess non-UTF-8 " msgstr "" #: rc.c:320 msgid "Automatically detect UTF-8 in non-UTF-8 locale" msgstr "" "Détection automatique des fichiers UTF-8 lorsque la locale n'est pas UTF-8" #: rc.c:320 msgid "Do not automatically detect UTF-8" msgstr "Pas de détection automatique des fichiers UTF-8" #: rc.c:320 msgid " Guess UTF-8 " msgstr "" #: rc.c:321 msgid "Menu is transposed" msgstr "" #: rc.c:321 msgid "Menus are not transposed" msgstr "" #: rc.c:321 msgid " Transpose menus " msgstr "" #: rc.c:322 msgid "CR-LF is line terminator" msgstr "CR-LF marque la fin d'une ligne (MS-DOS)" #: rc.c:322 msgid "LF is line terminator" msgstr "LF marque la fin d'une ligne (UNIX)" #: rc.c:322 msgid "Z CR-LF (MS-DOS) " msgstr "Z CR-LF (MS-DOS) " #: rc.c:323 msgid "Line numbers enabled" msgstr "Numérotation des lignes activée" #: rc.c:323 msgid "Line numbers disabled" msgstr "Numérotation des lignes désactivée" #: rc.c:323 msgid "N Line numbers " msgstr "" #: rc.c:324 msgid "Anchored block marking on" msgstr "" #: rc.c:324 msgid "Anchored block marking off" msgstr "" #: rc.c:324 msgid " Marking " msgstr "" #: rc.c:325 msgid "Characters above 127 shown as-is" msgstr "Caractères au dessus de 127 affichés tel quel" #: rc.c:325 msgid "Characters above 127 shown in inverse" msgstr "Caractères au dessus de 127 affiché en inverse-vidéo" #: rc.c:325 msgid " Meta chars as-is " msgstr "" #: rc.c:326 msgid "Last line forced to have NL when file saved" msgstr "Impose un NL final au fichier lors de la sauvegarde" #: rc.c:326 msgid "Last line not forced to have NL" msgstr "Pas de NL final imposé à la sauvegarde" #: rc.c:326 msgid " Force last NL " msgstr "" #: rc.c:327 msgid "~/.joe_state file will be updated" msgstr "Le fichier ~/.joe_state sera mis à jour" #: rc.c:327 msgid "~/.joe_state file will not be updated" msgstr "Le fichier ~/.joe_state ne sera pas mis à jour" #: rc.c:327 msgid " Joe_state file " msgstr "" #: rc.c:328 msgid "Backup files will not be made" msgstr "Aucun fichier de sauvegarde ne sera créé" #: rc.c:328 msgid "Backup files will be made" msgstr "Les fichiers de sauvegarde seront créés" #: rc.c:328 msgid " Disable backups " msgstr "" #: rc.c:329 msgid "Files will not be locked" msgstr "Les fichiers ne seront pas verrouillés" #: rc.c:329 msgid "Files will be locked" msgstr "Les fichiers seront verrouillés" #: rc.c:329 msgid " Disable locks " msgstr "" #: rc.c:330 msgid "No file modification time check" msgstr "Pas de vérification des dates de modification des fichiers" #: rc.c:330 msgid "File modification time checking enabled" msgstr "Vérification de la date de modification des fichiers active" #: rc.c:330 msgid " Disable mtime check " msgstr "" #: rc.c:331 msgid "No current dir" msgstr "" #: rc.c:331 msgid "Current dir enabled" msgstr "" #: rc.c:331 msgid " Disable current dir " msgstr "" #: rc.c:332 msgid "Hardlinks will be broken" msgstr "Casse les liens physiques (hardlinks) des fichiers à la sauvegarde" #: rc.c:332 msgid "Hardlinks not broken" msgstr "Les liens physiques (hardlinks) des fichiers sont conservés" #: rc.c:332 msgid " Break hard links " msgstr "" #: rc.c:333 msgid "Highlighting turned off after block operations" msgstr "Surlignage désactivé après une opération sur un bloc" #: rc.c:333 msgid "Highlighting not turned off after block operations" msgstr "Surlignage conservé après une opération sur un bloc" #: rc.c:333 msgid " Auto unmark " msgstr "" #: rc.c:334 msgid "Prompt for filename in save & exit command" msgstr "Réclame un nom de fichier pour la commande Sauve & Quitte" #: rc.c:334 msgid "Don't prompt for filename in save & exit command" msgstr "Ne réclame pas de nom de fichier pour la commande Sauve & Quitte" #: rc.c:334 msgid " Exit ask " msgstr "" #: rc.c:335 msgid "Warning bell enabled" msgstr "Bip activé" #: rc.c:335 msgid "Warning bell disabled" msgstr "Bip désactivé" #: rc.c:335 msgid "B Beeps " msgstr "" #: rc.c:336 msgid "Top-most status line disabled" msgstr "Statut en haut de page désactivée" #: rc.c:336 msgid "Top-most status line enabled" msgstr "Statut en haut de page activée" #: rc.c:336 msgid " Disable status line " msgstr "" #: rc.c:337 msgid "Status line updated constantly" msgstr "Ligne de statut mise à jour en continue" #: rc.c:337 msgid "Status line updated once/sec" msgstr "Ligne de statut mise à jour une fois par seconde" #: rc.c:337 msgid " Fast status line " msgstr "" #: rc.c:338 #, c-format msgid "Lines to keep for PgUp/PgDn or -1 for 1/2 window (%d): " msgstr "" #: rc.c:338 msgid " No. PgUp/PgDn lines " msgstr "" #: rc.c:339 msgid "Start search after a search repeats previous search" msgstr "" #: rc.c:339 msgid "Start search always starts a new search" msgstr "" #: rc.c:339 msgid " Continued search " msgstr "" #: rc.c:340 msgid "Full editing" msgstr "" #: rc.c:340 msgid "O Read only " msgstr "" #: rc.c:341 msgid "Smart home key enabled" msgstr "Touche 'Début' intelligente" #: rc.c:341 msgid "Smart home key disabled" msgstr "Touche 'Début' simple" #: rc.c:341 msgid " Smart home key " msgstr "" #: rc.c:342 msgid "Smart home goes to indentation first" msgstr "La touche 'Début' va premièrement au début du texte" #: rc.c:342 msgid "Smart home goes home first" msgstr "La touche 'Début' va premièrement au début de la ligne" #: rc.c:342 msgid " To indent first " msgstr "" #: rc.c:343 msgid "Smart backspace key enabled" msgstr "Touche 'Correction' intelligente" #: rc.c:343 msgid "Smart backspace key disabled" msgstr "Touche 'Correction' simple" #: rc.c:343 msgid " Smart backspace " msgstr "" #: rc.c:344 msgid "Indentation clean up enabled" msgstr "Normalisation de l'indentation activée" #: rc.c:344 msgid "Indentation clean up disabled" msgstr "Normalisation de l'indentation déactivée" #: rc.c:344 msgid " Clean up indents " msgstr "" #: rc.c:345 msgid "Picture drawing mode enabled" msgstr "Mode dessin activé" #: rc.c:345 msgid "Picture drawing mode disabled" msgstr "Mode dessin désactivé" #: rc.c:345 msgid "P Picture mode " msgstr "" #: rc.c:346 #, c-format msgid "Backup files stored in (%s): " msgstr "Fichiers de sauvegarde enregistrés dans (%s): " #: rc.c:346 msgid " Path to backup files " msgstr "" #: rc.c:347 msgid "Select syntax (^C to abort): " msgstr "Syntaxe à utiliser (^C pour abandonner): " #: rc.c:347 msgid "Y Syntax" msgstr "Y Syntaxe" #: rc.c:348 msgid "Select file character set (^C to abort): " msgstr "Jeu de caractères à utiliser (^C pour abandonner): " #: rc.c:348 msgid "E Encoding " msgstr "E Codage" #: rc.c:349 msgid "Single quoting enabled" msgstr "" #: rc.c:349 msgid "Single quoting disabled" msgstr "" #: rc.c:349 msgid " ^G ignores '... ' " msgstr "" #: rc.c:350 msgid "/* comments enabled" msgstr "Commentaires '/*' activés" #: rc.c:350 msgid "/* comments disabled" msgstr "Commentaires '/*' désactivés" #: rc.c:350 msgid " ^G ignores /*...*/ " msgstr "" #: rc.c:351 msgid "// comments enabled" msgstr "Commentaires '//' activés" #: rc.c:351 msgid "// comments disabled" msgstr "Commentaires '//' désactivés" #: rc.c:351 msgid " ^G ignores //... " msgstr "" #: rc.c:352 msgid "# comments enabled" msgstr "Commentaires '#' activés" #: rc.c:352 msgid "# comments disabled" msgstr "Commentaires '#' désactivés" #: rc.c:352 msgid " ^G ignores #... " msgstr "" #: rc.c:353 msgid "-- comments enabled" msgstr "Commentaires '--' activés" #: rc.c:353 msgid "-- comments disabled" msgstr "Commentaires '--' désactivés" #: rc.c:353 msgid " ^G ignores --... " msgstr "" #: rc.c:354 msgid "; comments enabled" msgstr "Commentaires ';' activés" #: rc.c:354 msgid "; comments disabled" msgstr "Commentaires ';' désactivés" #: rc.c:354 msgid " ^G ignores ;... " msgstr "" #: rc.c:355 #, c-format msgid "Text delimiters (%s): " msgstr "Délimiteurs de texte (%s): " #: rc.c:355 msgid " Text delimiters " msgstr "" #: rc.c:356 #, c-format msgid "Language (%s): " msgstr "Langue (%s): " #: rc.c:356 msgid "V Language " msgstr "V Langue " #: rc.c:357 #, c-format msgid "Characters which can indent paragraphs (%s): " msgstr "Caractères pouvant servir à indenter un paragraphe (%s): " #: rc.c:357 msgid " Paragraph indent chars " msgstr "" #: rc.c:358 msgid "Clicking can move the cursor past end of line" msgstr "Un clic peut déplacer le curseur au dela de la fin de la ligne" #: rc.c:358 msgid "Clicking past end of line moves cursor to the end" msgstr "" "Un clic au dela de la fin de la ligne déplace le curseur à la fin de la ligne" #: rc.c:358 msgid " Click past end " msgstr "" #: rc.c:359 msgid "Mouse action is done with the right button" msgstr "Utilisation du bouton droit de la souris" #: rc.c:359 msgid "Mouse action is done with the left button" msgstr "Utilisation du bouton gauche de la souris" #: rc.c:359 msgid " Right button " msgstr "" #: rc.c:669 rc.c:688 rc.c:700 msgid "Value out of range" msgstr "Valeur en dehors de la plage" #: rc.c:724 msgid "Syntax definition file not found" msgstr "" #: rc.c:799 #, c-format msgid "%s encoding assumed for this file" msgstr "Jeu de caractère %s détecté pour ce fichier" #: rc.c:802 msgid "Character set not found" msgstr "Jeu de caractères non détecté" #: rc.c:1010 #, c-format msgid "Processing '%s'..." msgstr "Traitement de '%s'..." #: rc.c:1066 #, c-format msgid "" "\n" "%s %d: Unknown option %s" msgstr "" "\n" "%s %d: Option inconnue %s" #: rc.c:1099 #, c-format msgid "" "\n" "%s %d: macro missing from :def" msgstr "" #: rc.c:1103 #, c-format msgid "" "\n" "%s %d: command name missing from :def" msgstr "" #: rc.c:1114 #, c-format msgid "" "\n" "%s %d: context name missing from :inherit" msgstr "" #: rc.c:1118 #, c-format msgid "" "\n" "%s %d: No context selected for :inherit" msgstr "" #: rc.c:1146 #, c-format msgid "" "\n" "%s %d: Couldn't open %s" msgstr "" "\n" "%s %d: Impossible d'ouvrir %s" #: rc.c:1154 #, c-format msgid "" "\n" "%s %d: :include missing file name" msgstr "" #: rc.c:1167 #, c-format msgid "" "\n" "%s %d: No context selected for :delete" msgstr "" #: rc.c:1174 #, c-format msgid "" "\n" "%s %d: Invalid context name" msgstr "" #: rc.c:1185 #, c-format msgid "" "\n" "%s %d: No context selected for macro to key-sequence binding" msgstr "" #: rc.c:1194 #, c-format msgid "" "\n" "%s %d: Unknown command in macro" msgstr "" "\n" "%s %d: Commande inconnue dans la macro" #: rc.c:1210 #, c-format msgid "" "\n" "%s %d: Bad key sequence '%s'" msgstr "" #: rc.c:1221 msgid "" "\n" "done\n" msgstr "" "\n" "Terminé\n" #: rc.c:1223 msgid "done\n" msgstr "Terminé\n" #: scrn.c:720 msgid "" "Sorry, your terminal can't do absolute cursor positioning.\n" "It's broken\n" msgstr "" "Désolé, votre terminal ne permet pas le positionnement absolu.\n" "Il est cassé\n" #: selinux.c:35 selinux.c:84 selinux.c:141 #, c-format msgid "Could not get security context for %s" msgstr "" #: selinux.c:41 msgid "" "\n" "Could not get security context for " msgstr "" #: selinux.c:51 #, c-format msgid "Could not set security context for %s" msgstr "" #: selinux.c:91 #, c-format msgid "Could not set default security context for %s" msgstr "" #: selinux.c:113 msgid "Could not reset default security context" msgstr "" #: selinux.c:146 #, c-format msgid "%s Security Context %s" msgstr "" #: syntax.c:259 #, c-format msgid "%s %d: Class already defined\n" msgstr "%s %d: Classe déjà définie\n" #: syntax.c:339 #, c-format msgid "%s %d: Missing )\n" msgstr "%s %d: ) manquante\n" #: syntax.c:411 #, c-format msgid "%s %d: missing parameter for ifdef\n" msgstr "%s %d: Paramêtre de ifdef manquant\n" #: syntax.c:421 #, c-format msgid "%s %d: else with no matching if\n" msgstr "%s %d: Le else ne correspond à aucun if\n" #: syntax.c:428 #, c-format msgid "%s %d: endif with no matching if\n" msgstr "%s %d: Le endif ne correspond à aucun if\n" #: syntax.c:432 syntax.c:560 #, c-format msgid "%s %d: Missing subroutine name\n" msgstr "%s %d: Il manque le nom de la sous-routine\n" #: syntax.c:447 #, c-format msgid "%s %d: Unknown control statement\n" msgstr "%s %d: Bloc de controle inconnu\n" #: syntax.c:450 #, c-format msgid "%s %d: Missing control statement name\n" msgstr "%s %d: Nom du bloc de controle manquant\n" #: syntax.c:477 #, c-format msgid "%s %d: Unknown class\n" msgstr "%s %d: Classe inconnue\n" #: syntax.c:480 #, c-format msgid "%s %d: Missing color for state definition\n" msgstr "" #: syntax.c:482 syntax.c:610 #, c-format msgid "%s %d: Missing state name\n" msgstr "" #: syntax.c:503 #, c-format msgid "%s %d: Bad string\n" msgstr "%s %d: Chaine de caractères invalide\n" #: syntax.c:543 syntax.c:545 syntax.c:554 syntax.c:568 syntax.c:604 #: syntax.c:606 #, c-format msgid "%s %d: Missing value for option\n" msgstr "%s %d: Il manque une valeur à l'option\n" #: syntax.c:608 syntax.c:624 #, c-format msgid "%s %d: Unknown option\n" msgstr "%s %d: Option inconnue\n" #: syntax.c:612 #, c-format msgid "%s %d: Missing string\n" msgstr "%s %d: Chaine de caractères manquante\n" #: syntax.c:633 #, c-format msgid "%s %d: Missing jump\n" msgstr "%s %d: Saut manquant\n" #: syntax.c:635 #, c-format msgid "%s %d: No state\n" msgstr "" #: syntax.c:637 #, c-format msgid "%s %d: Unknown character\n" msgstr "%s %d: Caractère inconnu/invalide\n" #: syntax.c:644 #, c-format msgid "%s %d: ifdef with no matching endif\n" msgstr "%s %d: ifdef sans endif correspondant\n" #: tab.c:212 tab.c:271 msgid "Couldn't read directory " msgstr "Impossible de lire le contenu du répertoire" #: termcap.c:219 msgid "Couldn't load termcap entry. Using ansi default\n" msgstr "Impossible de lire l'entrée termcap. Utilisation des valeurs ansi\n" #: termcap.c:240 #, c-format msgid "%s is out of date\n" msgstr "%s est obsolète\n" #: tty.c:314 msgid "Couldn't open /dev/tty\n" msgstr "Impossible d'ouvrir /dev/tty\n" #: tty.c:731 msgid "You are at the command shell. Type 'exit' to return\n" msgstr "Vous êtes dans le shell. Faites 'exit' pour revenir\n" #: tty.c:795 msgid "You have suspended the program. Type 'fg' to return\n" msgstr "Vous avez suspendu le programme. Faites 'fg' pour revenir à JOE\n" #: tty.c:1146 #, c-format msgid "Couldn't execute shell '%s'\n" msgstr "Impossible d'exécuter le shell '%s'\n" #: tw.c:213 msgid "Unnamed" msgstr "Sans nom" #: tw.c:219 msgid "(Modified)" msgstr "(Modifié)" #: tw.c:223 msgid "(Read only)" msgstr "(Lecture seule)" #: tw.c:329 msgid "*SHELL*" msgstr "*SHELL*" #: tw.c:333 #, c-format msgid "(Macro %d recording...)" msgstr "(Enregistrement de la macro %d...)" #: tw.c:558 tw.c:584 ufile.c:1010 msgid "Lose changes to this file (y,n,^C)? " msgstr "Abandonner les changements dans ce fichier (o,n,^C) ? " #: ublock.c:284 msgid "Selection cleared." msgstr "Sélection abandonnée" #: ublock.c:292 ublock.c:309 msgid "Selection started." msgstr "Début de sélection" #: ublock.c:417 ublock.c:503 ublock.c:559 ublock.c:887 ublock.c:921 #: ublock.c:1083 ufile.c:435 umath.c:177 undo.c:455 msgid "No block" msgstr "Aucun bloc" #: ublock.c:756 ublock.c:839 msgid "Selected lines not properly indented" msgstr "La ligne sélectionnée n'est pas correctement indentée" #: ublock.c:1067 ushell.c:86 msgid "Sorry, no sub-processes in DOS (yet)" msgstr "Désolé, pas de sous-processus sous DOS (pour l'instant)" #: ublock.c:1072 msgid "Command to filter block through (^C to abort): " msgstr "Commande à exécuter sur le bloc (^C pour abandonner): " #: ublock.c:1077 msgid "Command to filter file through (^C to abort): " msgstr "Commande à exécuter sur le fichier (^C pour abandonner): " #: uedit.c:1388 utag.c:73 msgid "Invalid line number" msgstr "Numéro de ligne invalide" #: uedit.c:1395 msgid "Go to line (^C to abort): " msgstr "Aller à la ligne (^C pour abandonner): " #: uedit.c:1424 msgid "Invalid column number" msgstr "Numéro de colonne invalide" #: uedit.c:1431 msgid "Go to column (^C to abort): " msgstr "Aller à la colonne (^C pour abandonner): " #: uedit.c:1460 msgid "Invalid byte number" msgstr "Numéro d'octet invalide" #: uedit.c:1467 msgid "Go to byte (^C to abort): " msgstr "Aller à l'octet (^C pour abandonner): " #: uedit.c:1911 msgid "Unicode (ISO-10646) character in hex (^C to abort): " msgstr "" "Code hexadécimal du caractère unicode (ISO-10646) (^C pour abandonner): " #: uedit.c:2036 msgid "Ctrl- (or 0-9 for dec. ascii, x for hex, or o for octal)" msgstr "Ctrl- (ou 0-9 décimal ascii, x pour hexa ou o pour octal)" #: uedit.c:2099 msgid "Quote" msgstr "" #: uedit.c:2166 #, c-format msgid "Mark %d set" msgstr "Marque %d posée" #: uedit.c:2180 msgid "Set mark (0-9):" msgstr "Poser la marque (0-9): " #: uedit.c:2198 #, c-format msgid "Mark %d not set" msgstr "Marque %d non posée" #: uedit.c:2211 msgid "Goto bookmark (0-9):" msgstr "Aller à la marque (0-9): " #: uedit.c:2243 usearch.c:995 utag.c:107 msgid "Not found" msgstr "Non trouvé" #: uedit.c:2259 msgid "Forward to char: " msgstr "Avancer jusqu'au caractère: " #: uedit.c:2270 msgid "Backward to char: " msgstr "Reculer jusqu'au caractère: " #: uedit.c:2290 msgid "Message (^C to abort): " msgstr "Message (^C pour abandonner: " #: uedit.c:2312 msgid "Insert (^C to abort): " msgstr "Insérer (^C pour abandonner): " #: uerror.c:330 uerror.c:344 #, c-format msgid "%d messages found" msgstr "%d messages trouvés" #: uerror.c:332 uerror.c:346 msgid "No messages found" msgstr "Aucun message trouvé" #: uerror.c:377 msgid "No messages" msgstr "Aucun message" #: uerror.c:432 uerror.c:443 msgid "No more errors" msgstr "Aucune autre erreur" #: ufile.c:39 msgid "(Unnamed)" msgstr "(sans nom)" #: ufile.c:44 ufile.c:51 #, c-format msgid "File %s saved" msgstr "Fichier %s enregistré" #: ufile.c:46 ufile.c:49 #, c-format msgid "File %s not saved" msgstr "Fichier %s non enregistré" #: ufile.c:53 #, c-format msgid "File %s not changed so no update needed" msgstr "Fichier %s non modifié, aucune enregistrement nécessaire" #: ufile.c:67 msgid "Some files have not been saved." msgstr "Certains fichiers n'ont pas été enregistrés." #: ufile.c:69 msgid "All modified files have been saved." msgstr "Tous les fichiers modifiés ont été enregistrés." #: ufile.c:71 msgid "No modified files, so no updates needed." msgstr "Aucun fichier modifié, aucun enregistrement nécessaire." #: ufile.c:107 msgid "System (^C to abort): " msgstr "" #: ufile.c:273 msgid "|yes|yY" msgstr "|yes|yYoO" #: ufile.c:274 msgid "|no|nN" msgstr "" #: ufile.c:309 msgid "Couldn't make backup file... file not saved" msgstr "Impossible de créer le fichier de sauvegarde. Fichier non enregistré" #: ufile.c:321 msgid "Could not make backup file. Save anyway (y,n,^C)? " msgstr "" "Impossible de créer le fichier de sauvegarde. Enregistrer quand même (o,n," "^C) ? " #: ufile.c:409 ufile.c:425 #, c-format msgid "Block written to file %s" msgstr "Bloc écrit dans le fichier %s" #: ufile.c:488 msgid "File exists. Overwrite (y,n,^C)? " msgstr "Ce fichier existe. Écraser (o,n,^C) ? " #: ufile.c:495 msgid "File on disk is newer. Overwrite (y,n,^C)? " msgstr "Le fichier sur le disque est plus récent. Écraser (o,n,^C) ? " #: ufile.c:510 ufile.c:899 ufile.c:1103 msgid "Name of file to save (^C to abort): " msgstr "Nom du fichier à enregistrer (^C pour abandonner): " #: ufile.c:538 msgid "Name of file to write (^C to abort): " msgstr "Nom du fichier à écrire (^C pour abandonner): " #: ufile.c:654 msgid "Load original file from disk (y,n,^C)? " msgstr "Recharger le fichier original depuis le disque (o,n,^C) ? " #: ufile.c:684 msgid "Can't replace modified file" msgstr "Impossible de remplacer le fichier modifié" #: ufile.c:693 msgid "Name of file to edit (^C to abort): " msgstr "Nom du fichier à éditer (^C pour abandonner): " #: ufile.c:708 ufile.c:1085 msgid "Name of buffer to edit (^C to abort): " msgstr "" #: ufile.c:764 msgid "Name of scratch buffer to edit (^C to abort): " msgstr "" #: ufile.c:865 msgid "Name of file to insert (^C to abort): " msgstr "Nom du fichier à insérer (^C pour abandonner): " #: ufile.c:933 msgid "Save changes to this file (y,n,^C)? " msgstr "Enregistrer les modifications de ce fichier (o,n,^C) ? " #: ufile.c:1137 #, c-format msgid "File %s has been modified. Save it (y,n,^C)? " msgstr "Le fichier %s a été modifié. Enregistrer (o,n,^C) ? " #: uisrch.c:267 msgid "I-find: " msgstr "Recherche interactive: " #: umath.c:19 msgid "Float point exception" msgstr "Exception sur un calcul de réel (Float point Exception)" #: umath.c:93 umath.c:195 umath.c:214 msgid "Missing )" msgstr "'(' manquant" #: umath.c:104 msgid "Syntax error in macro" msgstr "Erreur de syntaxe dans la macro" #: umath.c:111 msgid "Missing (" msgstr "')' manquant" #: umath.c:140 umath.c:146 umath.c:153 umath.c:162 msgid "No numbers in block" msgstr "" #: umath.c:220 msgid "Called object is not a function" msgstr "L'objet appelé n'est pas une fonction" #: umath.c:234 msgid "Factorial can only take positive integers" msgstr "La fonction factoriel ne fonctionne que sur un entier positif" #: umath.c:332 msgid "Left side of = is not an l-value" msgstr "Le texte à gauche de '=' n'est pas utilisable pour une affectation" #: umath.c:346 msgid "Recursion depth exceeded" msgstr "Profondeur de récursivité dépassée" #: umath.c:366 msgid "Extra junk after end of expr" msgstr "" #: undo.c:438 msgid "Modified flag cleared" msgstr "" #: usearch.c:281 usearch.c:350 msgid "Wrapped" msgstr "" #: usearch.c:553 msgid "|all files|aA" msgstr "" #: usearch.c:554 #, fuzzy msgid "|error list files|eE" msgstr "" #: usearch.c:555 msgid "|search and replace|rR" msgstr "" #: usearch.c:556 msgid "|backwards|bB" msgstr "" #: usearch.c:557 msgid "|ignore case|iI" msgstr "" #: usearch.c:558 msgid "|restrict to highlighted block|kK" msgstr "" #: usearch.c:559 msgid "|don't ignore case|sS" msgstr "" #: usearch.c:560 msgid "|wrap|wW" msgstr "" #: usearch.c:561 #, fuzzy msgid "|don't wrap|nN" msgstr "" #: usearch.c:618 msgid "Replace with (^C to abort): " msgstr "Remplacer par (^C pour abandonner): " #: usearch.c:633 msgid "" "case (S)ensitive (R)eplace (B)ackwards Bloc(K) (A)ll files NNN (^C to " "abort): " msgstr "" #: usearch.c:635 msgid "(I)gnore (R)eplace (B)ackwards Bloc(K) (A)ll files NNN (^C to abort): " msgstr "" #: usearch.c:717 #, c-format msgid "Find (^C to abort) [%s]: " msgstr "Chercher (^C pour abandonner) [%s]: " #: usearch.c:719 msgid "Find (^C to abort): " msgstr "Chercher (^C pour abandonner): " #: usearch.c:813 msgid "|rest of file|rR" msgstr "" #: usearch.c:814 msgid "|backup|bB" msgstr "" #: usearch.c:845 msgid "Replace (Y)es (N)o (R)est (B)ackup (^C to abort)?" msgstr "" #: usearch.c:993 msgid "Not found (search restricted to marked block)" msgstr "Non trouvé (recherche limité au bloc sélectionné)" #: usearch.c:1000 msgid "Infinite loop aborted: your search repeatedly matched same place" msgstr "" "Boucle infinie: votre recherche correspond continuellement à la même place" #: ushell.c:95 msgid "Program already running in this window" msgstr "Un programme tourne déjà dans cette fenêtre" #: ushell.c:103 msgid "No ptys available" msgstr "Aucun ptys disponible" #: ushell.c:128 msgid "\"SHELL\" environment variable not defined or exported" msgstr "La variable d'environnement \"SHELL\" n'est pas définie ou exportée" #: ushell.c:164 msgid "Program to run: " msgstr "Programme a exécuter: " #: ushell.c:188 msgid "Build command: " msgstr "Commande de compilation: " #: ushell.c:197 msgid "Enter build command (for example, 'make'): " msgstr "Commande de compilation (par exemple 'make'): " #: ushell.c:212 msgid "Grep command: " msgstr "Commande pour le grep: " #: ushell.c:221 msgid "Enter grep command (for example, 'grep -n foo *.c'): " msgstr "Commande pour le grep (par exemple 'grep -n foo *.c'): " #: ushell.c:250 msgid "Kill program (y,n,^C)?" msgstr "Tuer le programme (o,n,^C) ? " #: utag.c:26 msgid "Couldn't open tags file" msgstr "" #: utag.c:168 msgid "Tag search: " msgstr "" #: vfile.c:174 msgid "vfile: out of memory\n" msgstr "vfile: Plus de mémoire disponible\n" #: vfile.c:229 #, c-format msgid "Couldn't open file '%s'\n" msgstr "Impossible d'ouvrir le fichier '%s'\n" #: w.c:822 msgid "There is no message buffer" msgstr "Il n'y a pas de message" #~msgid "|error list files|eE" #~msgstr "Erreur à l'écriture du fichier" #~msgid "|don't wrap|nN" #~msgstr "La recherche ne recommence pas au début du fichier" #~msgid "|ignore lock, continue with edit|iI" #~ msgstr "Pressez Entrée pour continuer avec %s " #~ msgid "sS" #~ msgstr "sS" #~ msgid "qQ" #~ msgstr "qQaA" #~ msgid "iI" #~ msgstr "iIeE" #~ msgid "yY" #~ msgstr "yYoO" #~ msgid "nN" #~ msgstr "nN" joe-3.7/po/ru.po0000644000100100007640000011354011100445357010462 00000000000000# Russian messages for joe editor # Yura Kalinichenko , 2002. # # #, fuzzy msgid "" msgstr "" "Project-Id-Version: 2.9.6\n" "POT-Creation-Date: 2006-06-15 14:12-0400\n" "PO-Revision-Date: 2006-05-22 22:56-0400\n" "Last-Translator: Yura Kalinichenko \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=koi8-r\n" "Content-Transfer-Encoding: 8bit\n" "Report-Msgid-Bugs-To: \n" #: b.c:31 msgid "No error" msgstr "âÅÚ ÏÛÉÂÏË" #: b.c:32 msgid "New File" msgstr "îÏ×ÙÊ æÁÊÌ" #: b.c:33 msgid "Error reading file" msgstr "ïÛÉÂËÁ ÞÔÅÎÉÑ ÆÁÊÌÁ" #: b.c:34 msgid "Error seeking file" msgstr "ïÛÉÂËÁ ÐÏÚÉÃÉÏÎÉÒÏ×ÁÎÉÑ × ÆÁÊÌÅ" #: b.c:35 msgid "Error opening file" msgstr "ïÛÉÂËÁ ÏÔËÒÙÔÉÑ ÆÁÊÌÁ" #: b.c:36 msgid "Error writing file" msgstr "ïÛÉÂËÁ ÚÁÐÉÓÉ ÆÁÊÌÁ" #: b.c:37 msgid "File on disk is newer" msgstr "æÁÊÌ ÎÁ ÄÉÓËÅ - ÂÏÌÅÅ ÎÏ×ÙÊ" #: b.c:2736 #, fuzzy, c-format msgid "" "\n" "*** These modified files were found in JOE when it aborted on %s" msgstr "" "\n" "*** üÔÉ ÆÁÊÌÙ ÍÏÄÉÆÉÃÉÒÏ×ÁÌÉÓØ ÒÅÄÁËÔÏÒÏÍ JOE, ËÏÇÄÁ ÏÎ ÂÙÌ ÐÒÅÒ×ÁÎ %s" #: b.c:2738 #, fuzzy, c-format msgid "*** JOE was aborted by UNIX signal %d\n" msgstr "*** JOE ÂÙÌ ÐÒÅÒ×ÁÎ ÓÉÇÎÁÌÏÍ %d\n" #: b.c:2740 msgid "*** JOE was aborted because the terminal closed\n" msgstr "*** JOE ÂÙÌ ÐÒÅÒ×ÁÎ ÉÚ-ÚÁ ÚÁËÒÙÔÉÑ ÔÅÒÍÉÎÁÌÁ\n" #: b.c:2745 #, c-format msgid "" "\n" "*** File '%s'\n" msgstr "" "\n" "*** æÁÊÌ '%s'\n" #: b.c:2747 msgid "" "\n" "*** File '(Unnamed)'\n" msgstr "" "\n" "*** æÁÊÌ '(âÅÚéÍÅÎÉ)'\n" #: bw.c:1274 #, fuzzy, c-format msgid "** Line %ld Col %ld Offset %s(0x%s) **" msgstr "** óÔÒ %ld ðÏÚ %ld óÄ×ÉÇ %s(0x%s) **" #: bw.c:1276 #, fuzzy, c-format msgid "** Line %ld Col %ld Offset %s(0x%s) %s %d(0%o/0x%X) Width %d **" msgstr "** óÔÒ %ld ðÏÚ %ld óÄ×ÉÇ %s(0x%s) %s %d(0%o/0x%X) ûÉÒÉÎÁ %d **" #: cmd.c:211 #, fuzzy msgid "Could not create lock. (I) edit anyway, (Q) cancel edit? " msgstr "îÅ ÍÏÇÕ ÓÏÚÄÁÔØ ÆÁÊÌ ÂÌÏËÉÒÏ×ËÉ. (I)ÒÅÄÁËÔÉÒÏ×ÁÔØ ×ÓÅ ÒÁ×ÎÏ, (Q)ÏÔÍÅÎÉÔØ ? " #: cmd.c:212 #, fuzzy, c-format msgid "Locked by %s. (S)teal lock, (I) edit anyway, (Q) cancel edit? " msgstr "úÁÂÌÏËÉÒÏ×ÁÎÏ %s. (S)ÚÁÈ×ÁÔÉÔØ, (I)ÉÇÎÏÒÉÒÏ×ÁÔØ, (Q) ÏÔÍÅÎÉÔØ?" #: cmd.c:214 msgid "|steal the lock|sS" msgstr "|ÐÅÒÅÈ×ÁÔ ÂÌÏËÉÒÏ×ËÉ|sSÙù¦¶" #: cmd.c:215 msgid "|cancel edit due to lock|qQ" msgstr "|ÏÔÍÅÎÁ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ÉÚ-ÚÁ ÂÌÏËÉÒÏ×ËÉ|qQÊê" #: cmd.c:216 #, fuzzy msgid "|ignore lock, continue with edit|iI" msgstr "|ÉÇÎÏÒÉÒÏ×ÁÎÉÅ ÂÌÏËÉÒÏ×ËÕ, ÐÒÏÄÏÌÖÁÅÔÓÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ|iIÛû" #: cmd.c:265 msgid "Notice: File on disk changed! (hit ^C to continue) " msgstr "÷ÎÉÍÁÎÉÅ: æÁÊÌ ÎÁ ÄÉÓËÅ ÉÚÍÅÎÅÎ! (ÎÁÖÍÉÔÅ ^C ÄÌÑ ÐÒÏÄÏÌÖÅÎÉÑ) " #: cmd.c:325 #, fuzzy msgid "Modify other window first for macro" msgstr "óÎÁÞÁÌÁ ÍÏÄÉÆÉÃÉÒÕÊÔÅ ÄÒÕÇÏÅ ÏËÎÏ ÄÌÑ ÍÁËÒÏ" #: cmd.c:333 msgid "Other buffer is read only" msgstr "äÒÕÇÏÊ ÂÕÆÅÒ - ÔÏÌØËÏ ÄÌÑ ÞÔÅÎÉÑ" #: cmd.c:348 rc.c:340 msgid "Read only" msgstr "ôÏÌØËÏþÔÎ" #: cmd.c:542 cmd.c:552 msgid "No such command" msgstr "îÅÔ ÔÁËÏÊ ËÏÍÁÎÄÙ" #: cmd.c:569 #, fuzzy msgid "Command: " msgstr "ëÏÍÁÎÄÁ: " #: help.c:77 #, c-format msgid "" "\n" "%d: EOF before end of help text\n" msgstr "" "\n" "%d: EOF ÐÅÒÅÄ ËÏÎÃÏÍ ÔÅËÓÔÁ ÐÏÄÓËÁÚËÉ\n" #: kbd.c:352 msgid "No such keymap" msgstr "îÅÔ ÔÁËÏÊ ÒÁÓËÌÁÄËÉ ËÌÁ×ÉÁÔÕÒÙ" #: kbd.c:381 msgid "Change keymap: " msgstr "éÚÍÅÎÅÎÉÅ ÒÁÓËÌÁÄËÉ ËÌÁ×ÉÁÔÕÒÙ: " #: macro.c:662 msgid "Macro to record (0-9 or ^C to abort): " msgstr "îÏÍÅÒ ÍÁËÒÏ (0-9 ÉÌÉ ^C ÄÌÑ ÏÔÍÅÎÙ): " #: macro.c:764 msgid "Play-" msgstr "÷ÙÐÏÌÎÑÀ-" #: macro.c:791 msgid "No. times to repeat next command (^C to abort): " msgstr "óË. ÒÁÚ ÐÏ×ÔÏÒÉÔØ ËÏÍÁÎÄÕ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: macro.c:819 msgid "If (^C to abort): " msgstr "If (^C ÄÌÑ ÏÔÍÅÎÙ): " #: macro.c:826 msgid "Elsif without if" msgstr "Elsif ÂÅÚ if" #: macro.c:832 msgid "Else if: " msgstr "" #: macro.c:841 msgid "Else without if" msgstr "Else ÂÅÚ if" #: macro.c:852 msgid "Endif without if" msgstr "Endif ÂÅÚ if" #: macro.c:895 #, c-format msgid "Repeat %s%d" msgstr "ðÏ×ÔÏÒÉÔØ %s%d" #: macro.c:908 msgid "Repeat" msgstr "ðÏ×ÔÏÒ" #: main.c:207 msgid "Couldn't load termcap/terminfo entry\n" msgstr "îÅ ÍÏÇÕ ÚÁÇÒÕÚÉÔØ ÏÐÉÓÁÎÉÅ termcap/terminfo\n" #: main.c:222 main.c:239 #, c-format msgid "There were errors in '%s'. Use it anyway?" msgstr "âÙÌÉ ÏÛÉÂËÉ ÐÒÉ '%s'. éÓÐÏÌØÚÏ×ÁÔØ ×ÓÅ ÒÁ×ÎÏ?" #: main.c:294 #, c-format msgid "Warning: %s is newer than your %s.\n" msgstr "ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: %s ÂÏÌÅÅ ÎÏ×ÙÊ, ÞÅÍ ×ÁÛ %s.\n" #: main.c:295 #, c-format msgid "You should update or delete %s\n" msgstr "îÅÏÂÈÏÄÉÍÏ ÉÚÍÅÎÉÔØ ÉÌÉ ÕÄÁÌÉÔØ %s\n" #: main.c:296 #, c-format msgid "Hit enter to continue with %s " msgstr "îÁÖÍÉÔÅ Enter ÞÔÏÂÙ ÐÒÏÄÏÌÖÉÔØ ÒÁÂÏÔÕ Ó %s " #: main.c:309 main.c:328 main.c:345 #, c-format msgid "There were errors in '%s'. Use it anyway (y,n)? " msgstr "âÙÌÉ ÏÛÉÂËÉ × '%s'. éÓÐÏÌØÚÏ×ÁÔØ ÅÇÏ ×ÓÅ ÒÁ×ÎÏ (y,n)? " #: main.c:353 #, c-format msgid "Couldn't open '%s'\n" msgstr "îÅ ÍÏÇÕ ÏÔËÒÙÔØ '%s'\n" #: main.c:359 msgid "rc file has no :main key binding section or no bindings. Bye.\n" msgstr "× rc-ÆÁÊÌÅ ÏÔÓÕÔÓÔ×ÕÅÔ ÒÁÓËÌÁÄËÁ ËÌÁ×ÉÁÔÕÒÙ × ÓÅËÃÉÉ :main. Bye.\n" #: main.c:372 #, c-format msgid "Unknown option '%s'\n" msgstr "îÅÉÚ×ÅÓÔÎÁÑ ÏÐÃÉÑ '%s'\n" #: main.c:508 #, c-format msgid "\\i** Joe's Own Editor v%s ** (%s) ** Copyright %s 2006 **\\i" msgstr "" #: rc.c:295 msgid "Overtype mode" msgstr "òÅÖÉÍ ÚÁÍÅÎÙ" #: rc.c:295 msgid "Insert mode" msgstr "òÅÖÉÍ ×ÓÔÁ×ËÉ" #: rc.c:295 msgid "T Overtype " msgstr "T úÁÍÅÎÁ " #: rc.c:296 msgid "Hex edit mode" msgstr "16ÒÉÞÎ.ÒÅÄÁËÔ." #: rc.c:296 msgid "Text edit mode" msgstr "ôÅËÓÔ.ÒÅÄÁËÔ." #: rc.c:296 msgid " Hex edit mode " msgstr " òÅÖÉÍ 16ÒÉÞÎ. " #: rc.c:297 msgid "Autoindent enabled" msgstr "á×ÔÏÏÔÓÔÕÐ ×ËÌÀÞÅÎ" #: rc.c:297 msgid "Autoindent disabled" msgstr "á×ÔÏÏÔÓÔÕÐ ×ÙËÌÀÞÅÎ" #: rc.c:297 msgid "I Autoindent " msgstr "I á×ÔÏÏÔÓÔÕÐ " #: rc.c:298 msgid "Wordwrap enabled" msgstr "á×ÔÏÐÅÒÅÎÏÓ ×ËÌÀÞÅÎ" #: rc.c:298 msgid "Wordwrap disabled" msgstr "á×ÔÏÐÅÒÅÎÏÓ ×ÙËÌÀÞÅÎ" #: rc.c:298 #, fuzzy msgid "W Word wrap " msgstr "W á×ÔÏÐÅÒÅÎÏÓ " #: rc.c:299 #, c-format msgid "Tab width (%d): " msgstr "òÁÓÓÔÏÑÎÉÅ ÍÅÖÄÕ ÔÁÂÕÌÏÓÔÏÐÁÍÉ (%d): " #: rc.c:299 msgid "D Tab width " msgstr "D ûÉÒÉÎÁ Tab " #: rc.c:300 #, c-format msgid "Left margin (%d): " msgstr "ìÅ×ÙÊ ËÒÁÊ (%d): " #: rc.c:300 #, fuzzy msgid "L Left margin " msgstr "L ìÅ×ÙÊ ËÒÁÊ " #: rc.c:301 #, c-format msgid "Right margin (%d): " msgstr "ðÒÁ×ÙÊ ËÒÁÊ (%d): " #: rc.c:301 #, fuzzy msgid "R Right margin " msgstr "R ðÒÁ×ÙÊ ËÒÁÊ " #: rc.c:302 msgid "Restore cursor position when files loaded" msgstr "ðÏÚÉÃÉÀ ËÕÒÓÏÒÁ ÂÕÄÅÔ ×ÏÓÓÔÁÎÁ×ÌÉ×ÁÔØÓÑ ÐÒÉ ÚÁÇÒÕÚËÅ ÆÁÊÌÏ×" #: rc.c:302 msgid "Don't restore cursor when files loaded" msgstr "ðÏÚÉÃÉÀ ËÕÒÓÏÒÁ ÎÅ ÂÕÄÅÔ ×ÏÓÓÔÁÎÁ×ÌÉ×ÁÔØÓÑ ÐÒÉ ÚÁÇÒÕÚËÅ ÆÁÊÌÏ×" #: rc.c:302 msgid " Restore cursor " msgstr " ÷ÏÓÓÔÁÎÏ×ÌÅÎÉÅ ËÕÒÓÏÒÁ " #: rc.c:303 msgid "Rectangle mode" msgstr "òÅÖÉÍ ÐÒÑÍÏÕÇÏÌØÎÙÈ ÂÌÏËÏ×" #: rc.c:303 msgid "Text-stream mode" msgstr "òÅÖÉÍ ÐÏÓÔÒÏÞÎÙÈ ÂÌÏËÏ×" #: rc.c:303 msgid "X Rectangle mode " msgstr "X ðÒÑÍÏÕÇ. ÂÌÏËÉ " #: rc.c:304 #, fuzzy msgid "Search ignores case by default" msgstr "ðÏÉÓË ÂÕÄÅÔ ÉÇÎÏÒÉÒÏ×ÁÔØ ÒÅÇÉÓÔÒ ÐÏ ÕÍÏÌÞÁÎÉÀ" #: rc.c:304 #, fuzzy msgid "Case sensitive search by default" msgstr "ðÏÉÓË ÂÕÄÅÔ ÕÞÉÔÙ×ÁÔØ ÒÅÇÉÓÔÒ ÐÏ ÕÍÏÌÞÁÎÉÀ" #: rc.c:304 msgid " Case insensitivity " msgstr " òÅÇÉÓÔÒÏÎÅÚÁ×ÉÓÉÍ. " #: rc.c:305 msgid "Search wraps" msgstr "ãÉËÌÉÞÅÓËÉÊ ÐÏÉÓË" #: rc.c:305 msgid "Search doesn't wrap" msgstr "ðÏÉÓË ÎÅ ÃÉËÌÉÞÅÓËÉÊ" #: rc.c:305 msgid " Search wraps " msgstr " ãÉËÌ. ÐÏÉÓË " #: rc.c:306 msgid "Menu explorer mode" msgstr "òÅÖÉÍ ÍÅÎÀ" #: rc.c:306 #, fuzzy msgid "Simple completion mode" msgstr "ðÒÏÓÔÏÅ ÄÏÐÏÌÎÅÎÉÅ" #: rc.c:306 msgid " Menu explorer " msgstr " ðÒÏÓÍÏÔÒ ÍÅÎÀ " #: rc.c:307 msgid "Menu above prompt" msgstr "íÅÎÀ ÎÁÄ ÐÏÄÓËÁÚËÏÊ" #: rc.c:307 msgid "Menu below prompt" msgstr "íÅÎÀ ÐÏÄ ÐÏÄÓËÁÚËÏÊ" #: rc.c:307 #, fuzzy msgid " Menu position " msgstr " ðÏÚÉÃÉÑ ÍÅÎÀ " #: rc.c:308 msgid "Search prompting on" msgstr "úÁÐÒÏÓ ÐÒÉ ÐÏÉÓËÅ ×ËÌ." #: rc.c:308 msgid "Search prompting off" msgstr "úÁÐÒÏÓ ÐÒÉ ÐÏÉÓËÅ ×ÙËÌ." #: rc.c:308 msgid " Search prompting " msgstr " úÁÐÒÏÓ ÐÏÉÓËÁ " #: rc.c:309 #, fuzzy msgid "Jump into menu is on" msgstr " ðÒÙÖÏË × ÍÅÎÀ ×ËÌ." #: rc.c:309 #, fuzzy msgid "Jump into menu is off" msgstr " ðÒÙÖÏË × ÍÅÎÀ ×ÙËÌ." #: rc.c:309 msgid " Jump into menu " msgstr " ðÒÙÖÏË × ÍÅÎÀ " #: rc.c:310 msgid "Autoswap ^KB and ^KK" msgstr "á×ÔÏÏÂÍÅÎ ^KB É ^KK" #: rc.c:310 #, fuzzy msgid "Autoswap off " msgstr " á×ÔÏÏÂÍÅÎ ×ÙËÌ" #: rc.c:310 msgid " Autoswap mode " msgstr " á×ÔÏÏÂÍÅÎ " #: rc.c:311 #, c-format msgid "Indent char %d (SPACE=32, TAB=9, ^C to abort): " msgstr "óÉÍ×ÏÌ ×ÙÒÁ×ÎÉ×ÁÎÉÑ %d (ðòïâåì=32, TAB=9, ^C ÄÌÑ ÏÔÍÅÎÙ): " #: rc.c:311 msgid " Indent char " msgstr " óÉÍ×ÏÌ ×ÙÒÁ×ÎÉ×ÁÎÉÑ " #: rc.c:312 #, c-format msgid "Indent step %d (^C to abort): " msgstr "ûÁÇ ×ÙÒÁ×ÎÉ×ÁÎÉÑ %d (^C ÄÌÑ ÏÔÍÅÎÙ): " #: rc.c:312 msgid " Indent step " msgstr " ûÁÇ ×ÙÒÁ×ÎÉ×ÁÎÉÑ " #: rc.c:313 msgid "One space after periods for paragraph reformat" msgstr "ïÄÉÎ ÐÒÏÂÅÌ ÐÏÓÌÅ ÔÏÞËÉ ÐÒÉ ÆÏÒÍÁÔÉÒÏ×ÁÎÉÉ ÁÂÚÁÃÁ" #: rc.c:313 msgid "Two spaces after periods for paragraph reformat" msgstr "ä×Á ÐÒÏÂÅÌÁ ÐÏÓÌÅ ÔÏÞËÉ ÐÒÉ ÆÏÒÍÁÔÉÒÏ×ÁÎÉÉ ÁÂÚÁÃÁ" #: rc.c:313 #, fuzzy msgid " French spacing " msgstr " æÒÁÎÃÕÚÓËÉÊ ÐÒÏÂÅÌ " #: rc.c:314 msgid "Highlighting enabled" msgstr "ðÏÄÓ×ÅÔËÁ ÒÁÚÒÅÛÅÎÁ" #: rc.c:314 msgid "Highlighting disabled" msgstr "ðÏÄÓ×ÅÔËÁ ÚÁÐÒÅÝÅÎÁ" #: rc.c:314 #, fuzzy msgid "H Highlighting " msgstr "H ðÏÄÓ×ÅÔËÁ " #: rc.c:315 msgid "Inserting spaces when tab key is hit" msgstr "÷ÓÔÁ×ËÁ ÐÒÏÂÅÌÏ× ÐÒÉ ÎÁÖÁÔÉÉ Tab" #: rc.c:315 msgid "Inserting tabs when tab key is hit" msgstr "÷ÓÔÁ×ËÁ ÔÁÂÕÌÑÔÏÒÏ× ÐÒÉ ÎÁÖÁÔÉÉ Tab" #: rc.c:315 #, fuzzy msgid " No tabs " msgstr " âÅÚ ÔÁÂÏ× " #: rc.c:316 msgid "Cursor will be recentered on scrolls" msgstr "ëÕÒÓÏÒ ÂÕÄÅÔ ÃÅÎÔÒÉÒÏ×ÁÔØÓÑ ÐÒÉ ÓËÒÏÌÌÅ" #: rc.c:316 msgid "Cursor will not be recentered on scroll" msgstr "ëÕÒÓÏÒ ÎÅ ÂÕÄÅÔ ÃÅÎÔÒÉÒÏ×ÁÔØÓÑ ÐÒÉ ÓËÒÏÌÌÅ" #: rc.c:316 #, fuzzy msgid "C Center on scroll " msgstr "C ãÅÎÔÒ ÐÒÉ ÓËÒÏÌÌÅ " #: rc.c:317 msgid "Automatically detect MS-DOS files" msgstr "æÁÊÌÙ MS-DOS ÂÕÄÕÔ Á×ÔÏÏÐÒÅÄÅÌÑÔØÓÑ" #: rc.c:317 msgid "Do not automatically detect MS-DOS files" msgstr "æÁÊÌÙ MS-DOS ÎÅ ÂÕÄÕÔ Á×ÔÏÏÐÒÅÄÅÌÑÔØÓÑ" #: rc.c:317 msgid " Auto detect CR-LF " msgstr " á×ÔÏÏÐÒÅÄÅÌÅÎÉÅ CR-LF " #: rc.c:318 msgid "Automatically detect indentation" msgstr "óÉÍ×ÏÌÙ ÏÔÓÔÕÐÁ ÂÕÄÕÔ Á×ÔÏÏÐÒÅÄÅÌÑÔØÓÑ" #: rc.c:318 msgid "Do not automatically detect indentation" msgstr "óÉÍ×ÏÌÙ ÏÔÓÔÕÐÁ ÂÕÄÕÔ Á×ÔÏÏÐÒÅÄÅÌÑÔØÓÑ" #: rc.c:318 msgid " Guess indent " msgstr " õÇÁÄÙ×ÁÔØ ÏÔÓÔÕÐ " #: rc.c:319 #, fuzzy msgid "Automatically detect non-UTF-8 in UTF-8 locale" msgstr "îÅ-UTF-8 ËÏÄÉÒÏ×ËÉ × ÌÏËÁÌÉ UTF-8 ÂÕÄÕÔ Á×ÔÏÏÐÒÅÄÅÌÑÔØÓÑ" #: rc.c:319 #, fuzzy msgid "Do not automatically detect non-UTF-8" msgstr "îÅ-UTF-8 ËÏÄÉÒÏ×ËÉ × ÌÏËÁÌÉ UTF-8 ÎÅ ÂÕÄÕÔ Á×ÔÏÏÐÒÅÄÅÌÑÔØÓÑ" #: rc.c:319 #, fuzzy msgid " Guess non-UTF-8 " msgstr " õÇÁÄÙ×ÁÔØ ÎÅ-UTF-8 " #: rc.c:320 #, fuzzy msgid "Automatically detect UTF-8 in non-UTF-8 locale" msgstr "ëÏÄÉÒÏ×ËÁ UTF-8 × ÎÅ-UTF-8 ÌÏËÁÌÉ ÂÕÄÅÔ Á×ÔÏÏÐÒÅÄÅÌÑÔØÓÑ" #: rc.c:320 #, fuzzy msgid "Do not automatically detect UTF-8" msgstr "ëÏÄÉÒÏ×ËÁ UTF-8 ÎÅ ÂÕÄÅÔ Á×ÔÏÏÐÒÅÄÅÌÑÔØÓÑ" #: rc.c:320 #, fuzzy msgid " Guess UTF-8 " msgstr " õÇÁÄÙ×ÁÔØ UTF-8 " #: rc.c:321 msgid "Menu is transposed" msgstr "íÅÎÀ ÐÅÒÅÍÅÝÁÅÍÏÅ" #: rc.c:321 msgid "Menus are not transposed" msgstr "íÅÎÀ ÎÅÐÅÒÅÍÅÝÁÅÍÏÅ" #: rc.c:321 msgid " Transpose menus " msgstr " ðÅÒÅÍÅÝÁÅÍÏÓÔØ ÍÅÎÀ " #: rc.c:322 msgid "CR-LF is line terminator" msgstr "ëÏÎÅà ÓÔÒÏËÉ CR-LF" #: rc.c:322 msgid "LF is line terminator" msgstr "ëÏÎÅà ÓÔÒÏËÉ LF" #: rc.c:322 msgid "Z CR-LF (MS-DOS) " msgstr "" #: rc.c:323 msgid "Line numbers enabled" msgstr "îÕÍÅÒÁÃÉÑ ÓÔÒÏË ×ËÌÀÞÅÎÁ" #: rc.c:323 msgid "Line numbers disabled" msgstr "îÕÍÅÒÁÃÉÑ ÓÔÒÏË ×ÙËÌÀÞÅÎÁ" #: rc.c:323 msgid "N Line numbers " msgstr "N îÏÍÅÒÁ ÓÔÒÏË " #: rc.c:324 msgid "Anchored block marking on" msgstr "úÁÑËÏÒÅÎÎÁÑ ÏÔÍÅÔËÁ ÂÌÏËÁ ×ËÌ." #: rc.c:324 msgid "Anchored block marking off" msgstr "úÁÑËÏÒÅÎÎÁÑ ÏÔÍÅÔËÁ ÂÌÏËÁ ×ÙËÌ." #: rc.c:324 #, fuzzy msgid " Marking " msgstr " ïÔÍÅÔËÁ " #: rc.c:325 msgid "Characters above 127 shown as-is" msgstr "8-ÂÉÔÎÙÅ ÓÉÍ×ÏÌÙ ÐÏËÁÚÙ×ÁÀÔÓÑ ËÁË ÅÓÔØ" #: rc.c:325 msgid "Characters above 127 shown in inverse" msgstr "8-ÂÉÔÎÙÅ ÓÉÍ×ÏÌÙ ÐÏËÁÚÙ×ÁÀÔÓÑ × ÉÎ×ÅÒÓÉÉ" #: rc.c:325 msgid " Meta chars as-is " msgstr " 8-ÂÉÔÎÙÅ ÓÉÍ×ÏÌÙ " #: rc.c:326 msgid "Last line forced to have NL when file saved" msgstr "÷ ËÏÎÅà ÆÁÊÌÁ ÂÕÄÅÔ ÄÏÂÁ×ÌÑÔØÓÑ ÐÅÒÅ×ÏÄ ÓÔÒÏËÉ ÐÒÉ ÓÏÈÒÁÎÅÎÉÉ" #: rc.c:326 msgid "Last line not forced to have NL" msgstr "îÅ ÂÕÄÅÔ ÆÏÒÓÉÒÏ×ÁÔØÓÑ ÄÏÂÁ×ÌÅÎÉÅ ÐÅÒÅ×ÏÄÁ ÓÔÒÏËÉ × ËÏÎÃÅ ÆÁÊÌÁ" #: rc.c:326 #, fuzzy msgid " Force last NL " msgstr " ðÏÓÌÅÄÎÉÊ LF " #: rc.c:327 msgid "~/.joe_state file will be updated" msgstr "æÁÊÌ ~/.joe_state ÂÕÄÅÔ ÉÚÍÅÎÑÔØÓÑ" #: rc.c:327 msgid "~/.joe_state file will not be updated" msgstr "æÁÊÌ ~/.joe_state îå ÂÕÄÅÔ ÉÚÍÅÎÑÔØÓÑ" #: rc.c:327 msgid " Joe_state file " msgstr " æÁÊÌ joe_state " #: rc.c:328 msgid "Backup files will not be made" msgstr "òÅÚÅÒ×ÎÙÅ ÆÁÊÌÙ ÎÅ ÂÕÄÕÔ ÓÏÚÄÁ×ÁÔØÓÑ" #: rc.c:328 msgid "Backup files will be made" msgstr "òÅÚÅÒ×ÎÙÅ ÆÁÊÌÙ ÂÕÄÕÔ ÓÏÚÄÁ×ÁÔØÓÑ" #: rc.c:328 msgid " Disable backups " msgstr " úÁÐÒÅÔ ÒÅÚÅÒ×-Ñ " #: rc.c:329 msgid "Files will not be locked" msgstr "æÁÊÌÙ ÎÅ ÂÕÄÕÔ ÂÌÏËÉÒÏ×ÁÔØÓÑ" #: rc.c:329 msgid "Files will be locked" msgstr "æÁÊÌÙ ÂÕÄÕÔ ÂÌÏËÉÒÏ×ÁÔØÓÑ" #: rc.c:329 msgid " Disable locks " msgstr " úÁÐÒÅÔ âÌÏËÉÒ." #: rc.c:330 #, fuzzy msgid "No file modification time check" msgstr "÷ÒÅÍÑ ÍÏÄÉÆÉËÁÃÉÉ ÆÁÊÌÁ ÎÅ ÂÕÄÅÔ ÐÒÏ×ÅÒÑÔØÓÑ" #: rc.c:330 #, fuzzy msgid "File modification time checking enabled" msgstr "òÁÚÒÅÛÅÎÁ ÐÒÏ×ÅÒËÁ ×ÒÅÍÅÎÉ ÍÏÄÉÆÉËÁÃÉÉ ÆÁÊÌÁ" #: rc.c:330 msgid " Disable mtime check " msgstr " úÁÐÒÅÔ ËÏÎÔÒÏÌÑ mtime " #: rc.c:331 msgid "No current dir" msgstr "âÅÚ ÔÅËÕÝÅÊ ÄÉÒÅËÔÏÒÉÉ" #: rc.c:331 msgid "Current dir enabled" msgstr "ôÅËÕÝÁÑ ÄÉÒÅËÔÏÒÉÑ ×ËÌÀÞÅÎÁ" #: rc.c:331 msgid " Disable current dir " msgstr " úÁÐÒÅÔ ÔÅË. ÄÉÒÅËÔÏÒÉÉ " #: rc.c:332 msgid "Hardlinks will be broken" msgstr "öÅÓÔËÉÅ ÓÓÙÌËÉ ÂÕÄÕÔ ÒÁÚÒÙ×ÁÔØÓÑ" #: rc.c:332 msgid "Hardlinks not broken" msgstr "öÅÓÔËÉÅ ÓÓÙÌËÉ ÎÅ ÂÕÄÕÔ ÒÁÚÒÙ×ÁÔØÓÑ" #: rc.c:332 msgid " Break hard links " msgstr " òÁÚÒÙ× ÖÅÓÔ.ÓÓÙÌ. " #: rc.c:333 msgid "Highlighting turned off after block operations" msgstr "ïÔÍÅÔËÁ ÂÌÏËÁ ×ÙËÌÀÞÁÅÔÓÑ ÐÏÓÌÅ ÏÐÅÒÁÃÉÉ" #: rc.c:333 msgid "Highlighting not turned off after block operations" msgstr "ïÔÍÅÔËÁ ÂÌÏËÁ ÎÅ ×ÙËÌÀÞÁÅÔÓÑ ÐÏÓÌÅ ÏÐÅÒÁÃÉÉ" #: rc.c:333 #, fuzzy msgid " Auto unmark " msgstr "A×ÔÏäÅíÁÒË " #: rc.c:334 msgid "Prompt for filename in save & exit command" msgstr "úÁÐÒÏÓ ÉÍÅÎÉ ÆÁÊÌÁ ÐÒÉ ×ÙÈÏÄÅ Ó ÓÏÈÒÁÎÅÎÉÅÍ" #: rc.c:334 msgid "Don't prompt for filename in save & exit command" msgstr "îÅ ÚÁÐÒÁÛÉ×ÁÔØ ÉÍÑ ÆÁÊÌÁ ÐÒÉ ×ÙÈÏÄÅ Ó ÓÏÈÒÁÎÅÎÉÅÍ" #: rc.c:334 msgid " Exit ask " msgstr " E ÷ÙÈÏÄ Ó ÚÁÐÒÏÓÏÍ " #: rc.c:335 msgid "Warning bell enabled" msgstr "ú×ÏÎÏË ÒÁÚÒÅÛÅÎ" #: rc.c:335 msgid "Warning bell disabled" msgstr "ú×ÏÎÏË ÚÁÐÒÅÝÅÎ" #: rc.c:335 #, fuzzy msgid "B Beeps " msgstr "B ú×ÏÎÏË " #: rc.c:336 msgid "Top-most status line disabled" msgstr "óÔÒÏËÁ ÓÏÓÔÏÑÎÉÑ ×ÙËÌÀÞÅÎÁ" #: rc.c:336 msgid "Top-most status line enabled" msgstr "óÔÒÏËÁ ÓÏÓÔÏÑÎÉÑ ×ËÌÀÞÅÎÁ" #: rc.c:336 msgid " Disable status line " msgstr " úÁÐÒÅÔ ÓÔÒÏËÉ ÓÏÓÔ. " #: rc.c:337 msgid "Status line updated constantly" msgstr "óÔÒÏËÁ ÓÏÓÔÏÑÎÉÑ ÉÚÍÅÎÑÅÔÓÑ ÎÅÐÒÅÒÙ×ÎÏ" #: rc.c:337 msgid "Status line updated once/sec" msgstr "óÔÒÏËÁ ÓÏÓÔÏÑÎÉÑ ÉÚÍÅÎÑÅÔÓÑ ÒÁÚ × ÓÅËÕÎÄÕ" #: rc.c:337 msgid " Fast status line " msgstr " âÙÓÔÒÁÑ ÓÔÒÏËÁ ÓÏÓÔÏÑÎÉÑ " #: rc.c:338 #, c-format msgid "Lines to keep for PgUp/PgDn or -1 for 1/2 window (%d): " msgstr "óË. ÓÔÒÏË ÏÓÔÁ×ÌÑÔØ ÐÒÉ PgUp/PgDn ÉÌÉ -1 ÄÌÑ 1/2 ÏËÎÁ (%d): " #: rc.c:338 msgid " No. PgUp/PgDn lines " msgstr " ëÏÌ-×Ï ÓÔÒÏË PgUp/PgDn " #: rc.c:339 msgid "Start search after a search repeats previous search" msgstr "ðÏÉÓË ÐÒÏÄÏÌÖÁÅÔ ÉÓËÁÔØ ÐÒÅÄÙÄÕÝÉÊ ÏÂÒÁÚÅÃ" #: rc.c:339 msgid "Start search always starts a new search" msgstr "÷ÓÅÇÄÁ ÚÁÐÒÁÛÉ×ÁÔØ ÎÏ×ÙÊ ÏÂÒÁÚÅÃ" #: rc.c:339 #, fuzzy msgid " Continued search " msgstr "C ðÒÏÄÏÌÖÅÎÉÅ ÐÏÉÓËÁ " #: rc.c:340 msgid "Full editing" msgstr "éÚÍÅÎÅÎÉÅ ÒÁÚÒÅÛÅÎÏ" #: rc.c:340 msgid "O Read only " msgstr "O ôÏÌØËÏþÔÎ " #: rc.c:341 msgid "Smart home key enabled" msgstr "õÍÎÏÅ ÐÏ×ÅÄÅÎÉÅ ËÌÁ×ÉÛÉ Home ÒÁÚÒÅÛÅÎÏ" #: rc.c:341 msgid "Smart home key disabled" msgstr "õÍÎÏÅ ÐÏ×ÅÄÅÎÉÅ ËÌÁ×ÉÛÉ Home ÚÁÐÒÅÝÅÎÏ" #: rc.c:341 msgid " Smart home key " msgstr " õÍÎÙÊ Home " #: rc.c:342 #, fuzzy msgid "Smart home goes to indentation first" msgstr "õÍÎÙÊ Home ÐÅÒÅÈÏÄÉÔ ÎÁ ÐÅÒ×ÙÊ ÓÉÍ×ÏÌ" #: rc.c:342 msgid "Smart home goes home first" msgstr "õÍÎÙÊ Home ÐÅÒÅÈÏÄÉÔ ÎÁ ÎÁÞÁÌÏ ÓÔÒÏËÉ" #: rc.c:342 msgid " To indent first " msgstr " îÁ ÐÅÒ×ÙÊ ÓÉÍ×ÏÌ " #: rc.c:343 msgid "Smart backspace key enabled" msgstr "õÍÎÏÅ ÐÏ×ÅÄÅÎÉÅ ËÌÁ×ÉÛÉ BS ÒÁÚÒÅÛÅÎÏ" #: rc.c:343 msgid "Smart backspace key disabled" msgstr "õÍÎÏÅ ÐÏ×ÅÄÅÎÉÅ ËÌÁ×ÉÛÉ BS ÚÁÐÒÅÝÅÎÏ" #: rc.c:343 msgid " Smart backspace " msgstr " õÍÎÙÊ BS " #: rc.c:344 msgid "Indentation clean up enabled" msgstr "éÓÐÒÁ×ÌÅÎÉÅ ÏÔÓÔÕÐÏ× ÒÁÚÒÅÛÅÎÏ" #: rc.c:344 msgid "Indentation clean up disabled" msgstr "éÓÐÒÁ×ÌÅÎÉÅ ÏÔÓÔÕÐÏ× ÚÁÐÒÅÝÅÎÏ" #: rc.c:344 msgid " Clean up indents " msgstr " éÓÐÒÁ×ÌÅÎÉÅ ÏÔÓÔÕÐÏ× " #: rc.c:345 msgid "Picture drawing mode enabled" msgstr "òÅÖÉÍ ÒÉÓÏ×ÁÎÉÑ ÒÁÚÒÅÛÅÎ" #: rc.c:345 msgid "Picture drawing mode disabled" msgstr "òÅÖÉÍ ÒÉÓÏ×ÁÎÉÑ ÚÁÐÒÅÝÅÎ" #: rc.c:345 #, fuzzy msgid "P Picture mode " msgstr "òÅÖÉÍ ÒÉÓÏ×ÁÎÉÑ " #: rc.c:346 #, c-format msgid "Backup files stored in (%s): " msgstr "òÅÚÅÒ×ÎÙÅ ÆÁÊÌÙ ÓÏÈÒÁÎÑÀÔÓÑ × (%s): " #: rc.c:346 msgid " Path to backup files " msgstr " ðÕÔØ ÒÅÚÅÒ×ÎÙÈ ÆÁÊÌÏ× " #: rc.c:347 msgid "Select syntax (^C to abort): " msgstr "÷ÙÂÅÒÉÔÅ ÓÉÎÔÁËÓÉÓ (^C ÄÌÑ ÏÔÍÅÎÙ)" #: rc.c:347 msgid "Y Syntax" msgstr "Y óÉÎÔÁËÓÉÓ" #: rc.c:348 msgid "Select file character set (^C to abort): " msgstr "õËÁÖÉÔÅ ÆÁÊÌ ËÏÄÏ×ÏÇÏ ÎÁÂÏÒÁ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: rc.c:348 #, fuzzy msgid "E Encoding " msgstr "E ëÏÄÉÒÏ×ËÁ " #: rc.c:349 msgid "Single quoting enabled" msgstr "ïÄÉÎÏÞÎÙÅ ËÁ×ÙÞËÉ ÕÞÉÔÙ×ÁÀÔÓÑ" #: rc.c:349 msgid "Single quoting disabled" msgstr "ïÄÉÎÏÞÎÙÅ ËÁ×ÙÞËÉ ÎÅ ÕÞÉÔÙ×ÁÀÔÓÑ" #: rc.c:349 #, fuzzy msgid " ^G ignores '... ' " msgstr " ^G ÉÇÎÏÒ. '...' " #: rc.c:350 msgid "/* comments enabled" msgstr "/* ËÏÍÍÅÎÔÁÒÉÉ ÕÞÉÔÙ×ÁÀÔÓÑ" #: rc.c:350 msgid "/* comments disabled" msgstr "/* ËÏÍÍÅÎÔÁÒÉÉ ÎÅ ÕÞÉÔÙ×ÁÀÔÓÑ" #: rc.c:350 #, fuzzy msgid " ^G ignores /*...*/ " msgstr " ^G ÉÇÎÏÒ. /*...*/ " #: rc.c:351 msgid "// comments enabled" msgstr "// ËÏÍÍÅÎÔÁÒÉÉ ÕÞÉÔÙ×ÁÀÔÓÑ" #: rc.c:351 msgid "// comments disabled" msgstr "// ËÏÍÍÅÎÔÁÒÉÉ ÎÅ ÕÞÉÔÙ×ÁÀÔÓÑ" #: rc.c:351 #, fuzzy msgid " ^G ignores //... " msgstr " ^G ÉÇÎÏÒ. //... " #: rc.c:352 msgid "# comments enabled" msgstr "# ËÏÍÍÅÎÔÁÒÉÉ ÕÞÉÔÙ×ÁÀÔÓÑ" #: rc.c:352 msgid "# comments disabled" msgstr "# ËÏÍÍÅÎÔÁÒÉÉ ÎÅ ÕÞÉÔÙ×ÁÀÔÓÑ" #: rc.c:352 #, fuzzy msgid " ^G ignores #... " msgstr " ^G ÉÇÎÏÒ. #... " #: rc.c:353 msgid "-- comments enabled" msgstr "-- ËÏÍÍÅÎÔÁÒÉÉ ÕÞÉÔÙ×ÁÀÔÓÑ" #: rc.c:353 msgid "-- comments disabled" msgstr "-- ËÏÍÍÅÎÔÁÒÉÉ ÎÅ ÕÞÉÔÙ×ÁÀÔÓÑ" #: rc.c:353 #, fuzzy msgid " ^G ignores --... " msgstr " ^G ÉÇÎÏÒ. --... " #: rc.c:354 msgid "; comments enabled" msgstr "; ËÏÍÍÅÎÔÁÒÉÉ ÕÞÉÔÙ×ÁÀÔÓÑ" #: rc.c:354 msgid "; comments disabled" msgstr "; ËÏÍÍÅÎÔÁÒÉÉ ÎÅ ÕÞÉÔÙ×ÁÀÔÓÑ" #: rc.c:354 #, fuzzy msgid " ^G ignores ;... " msgstr " ^G ÉÇÎÏÒ. ;... " #: rc.c:355 #, c-format msgid "Text delimiters (%s): " msgstr "ïÇÒÁÎÉÞÉÔÅÌÉ ÔÅËÓÔÁ (%s): " #: rc.c:355 msgid " Text delimiters " msgstr " ïÇÒÁÎÉÞÉÔÅÌÉ ÔÅËÓÔÁ " #: rc.c:356 #, c-format msgid "Language (%s): " msgstr "ñÚÙË (%s): " #: rc.c:356 msgid "V Language " msgstr "V ñÚÙË " #: rc.c:357 #, c-format msgid "Characters which can indent paragraphs (%s): " msgstr "óÉÍ×ÏÌÙ, ËÏÔÏÒÙÍÉ ÍÏÖÅÔ ÎÁÞÉÎÁÔØÓÑ ÁÂÚÁà (%s): " #: rc.c:357 #, fuzzy msgid " Paragraph indent chars " msgstr " óÉÍ×ÏÌÙ ×ÙÒÁ×ÎÉ×ÁÎÉÑ " #: rc.c:358 msgid "Clicking can move the cursor past end of line" msgstr "íÙÛØÀ ÍÏÖÎÏ ÐÅÒÅÍÅÓÔÉÔØ ËÕÒÓÏÒ ÚÁ ËÏÎÅà ÓÔÒÏËÉ" #: rc.c:358 msgid "Clicking past end of line moves cursor to the end" msgstr "ëÌÉË ÚÁ ËÏÎÃÏÍ ÓÔÒÏËÉ ÐÅÒÅÍÅÓÔÉÔ ËÕÒÓÏÒ × ËÏÎÅà ÅÅ" #: rc.c:358 msgid " Click past end " msgstr " ëÌÉË ÚÁ ÓÔÒÏËÏÊ " #: rc.c:359 msgid "Mouse action is done with the right button" msgstr "äÅÊÓÔ×ÉÅ ÍÙÛÉ ÁËÔÉ×ÉÒÕÅÔÓÑ ÐÒÁ×ÏÊ ËÎÏÐËÏÊ" #: rc.c:359 msgid "Mouse action is done with the left button" msgstr "äÅÊÓÔ×ÉÅ ÍÙÛÉ ÁËÔÉ×ÉÒÕÅÔÓÑ ÌÅ×ÏÊ ËÎÏÐËÏÊ" #: rc.c:359 msgid " Right button " msgstr " ðÒÁ×ÁÑ ËÎÏÐËÁ " #: rc.c:669 rc.c:688 rc.c:700 msgid "Value out of range" msgstr "úÎÁÞÅÎÉÅ ×ÎÅ ÄÏÐÕÓÔÉÍÏÇÏ" #: rc.c:724 msgid "Syntax definition file not found" msgstr "æÁÊÌ ÏÐÒÅÄÅÌÅÎÉÑ ÓÉÎÔÁËÓÉÓÁ ÎÅ ÎÁÊÄÅÎ" #: rc.c:799 #, c-format msgid "%s encoding assumed for this file" msgstr "ðÒÅÄÐÏÌÁÇÁÅÔÓÑ, ÞÔÏ ÆÁÊÌ × ËÏÄÉÒÏ×ËÅ %s" #: rc.c:802 msgid "Character set not found" msgstr "ëÏÄÉÒÏ×ËÁ ÎÅÉÚ×ÅÓÔÎÁ" #: rc.c:1010 #, c-format msgid "Processing '%s'..." msgstr "ïÂÒÁÂÏÔËÁ '%s'..." #: rc.c:1066 #, c-format msgid "" "\n" "%s %d: Unknown option %s" msgstr "" "\n" "%s %d: îÅÉÚ×ÅÓÔÎÁÑ ÏÐÃÉÑ %s" #: rc.c:1099 #, c-format msgid "" "\n" "%s %d: macro missing from :def" msgstr "" "\n" "%s %d: ÍÁËÒÏ ÏÔÓÕÔÓÔ×ÕÅÔ ÏÔ :def" #: rc.c:1103 #, c-format msgid "" "\n" "%s %d: command name missing from :def" msgstr "" "\n" "%s %d: ÉÍÑ ËÏÍÁÎÄÙ ÏÔÓÕÔÓÔ×ÕÅÔ ÏÔ :def" #: rc.c:1114 #, c-format msgid "" "\n" "%s %d: context name missing from :inherit" msgstr "" "\n" "%s %d: ÎÁÉÍÅÎÏ×ÁÎÉÅ ËÏÎÔÅËÓÔÁ ÏÔÓÕÔÓÔ×ÕÅÔ ÏÔ :inherit" #: rc.c:1118 #, c-format msgid "" "\n" "%s %d: No context selected for :inherit" msgstr "" "\n" "%s %d: îÅ ×ÙÂÒÁÎ ËÏÎÔÅËÓÔ ÄÌÑ :inherit" #: rc.c:1146 #, c-format msgid "" "\n" "%s %d: Couldn't open %s" msgstr "" "\n" "%s %d: îÅ ÍÏÇÕ ÏÔËÒÙÔØ %s" #: rc.c:1154 #, c-format msgid "" "\n" "%s %d: :include missing file name" msgstr "" "\n" "%s %d: :include ÂÅÚ ÉÍÅÎÉ ÆÁÊÌÁ" #: rc.c:1167 #, c-format msgid "" "\n" "%s %d: No context selected for :delete" msgstr "" "\n" "%s %d: îÅ ×ÙÂÒÁÎ ËÏÎÔÅËÓÔ ÄÌÑ :delete" #: rc.c:1174 #, c-format msgid "" "\n" "%s %d: Invalid context name" msgstr "" "\n" "%s %d: îÅÄÏÐÕÓÔÉÍÏÅ ÉÍÑ ËÏÎÔÅËÓÔÁ" #: rc.c:1185 #, c-format msgid "" "\n" "%s %d: No context selected for macro to key-sequence binding" msgstr "" "\n" "%s %d: îÅ ×ÙÂÒÁÎ ËÏÎÔÅËÓÔ ÄÌÑ ÍÁËÒÏ ÒÁÓËÌÁÄËÉ ËÌÁ×ÉÁÔÕÒÙ" #: rc.c:1194 #, c-format msgid "" "\n" "%s %d: Unknown command in macro" msgstr "" "\n" "%s %d: îÅÉÚ×ÅÓÔÎÁÑ ËÏÍÁÎÄÁ × ÍÁËÒÏ" #: rc.c:1210 #, c-format msgid "" "\n" "%s %d: Bad key sequence '%s'" msgstr "" "\n" "%s %d: îÅÄÏÐÕÓÔÉÍÁÑ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔØ ËÌÁ×ÉÛ '%s'" #: rc.c:1221 msgid "" "\n" "done\n" msgstr "" "\n" "×ÙÐÏÌÎÅÎÏ\n" #: rc.c:1223 msgid "done\n" msgstr "ÓÄÅÌÁÎÏ\n" #: scrn.c:720 msgid "" "Sorry, your terminal can't do absolute cursor positioning.\n" "It's broken\n" msgstr "" "éÚ×ÉÎÉÔÅ, ×ÁÛ ÔÅÒÍÉÎÁÌ ÎÅ ÕÍÅÅÔ ÐÏÚÉÃÉÏÎÉÒÏ×ÁÔØ ËÕÒÓÏÒ.\n" "÷ÙÂÒÏÓØÔÅ ÅÇÏ\n" #: selinux.c:35 selinux.c:84 selinux.c:141 #, c-format msgid "Could not get security context for %s" msgstr "îÅ ÍÏÇÕ ÐÏÌÕÞÉÔØ ËÏÎÔÅËÓÔ ÓÅËÒÅÔÎÏÓÔÉ ÄÌÑ %s" #: selinux.c:41 msgid "" "\n" "Could not get security context for " msgstr "" "\n" "îÅ ÍÏÇÕ ÐÏÌÕÞÉÔØ ËÏÎÔÅËÓÔ ÓÅËÒÅÔÎÏÓÔÉ ÄÌÑ " #: selinux.c:51 #, c-format msgid "Could not set security context for %s" msgstr "îÅ ÍÏÇÕ ÕÓÔÁÎÏ×ÉÔØ ËÏÎÔÅËÓÔ ÓÅËÒÅÔÎÏÓÔÉ ÄÌÑ %s" #: selinux.c:91 #, c-format msgid "Could not set default security context for %s" msgstr "îÅ ÍÏÇÕ ÕÓÔÁÎÏ×ÉÔØ ËÏÎÔÅËÓÔ ÓÅËÒÅÔÎÏÓÔÉ ÐÏ ÕÍÏÌÞÁÎÉÀ ÄÌÑ %s" #: selinux.c:113 msgid "Could not reset default security context" msgstr "îÅ ÍÏÇÕ ÓÂÒÏÓÉÔØ ËÏÎÔÅËÓÔ ÓÅËÒÅÔÎÏÓÔÉ ÐÏ ÕÍÏÌÞÁÎÉÀ" #: selinux.c:146 #, c-format msgid "%s Security Context %s" msgstr "%s ëÏÎÔÅËÓÔ óÅËÒÅÔ. %s" #: syntax.c:259 #, c-format msgid "%s %d: Class already defined\n" msgstr "%s %d: ëÌÁÓÓ ÕÖÅ ÏÐÒÅÄÅÌÅÎ\n" #: syntax.c:339 #, fuzzy, c-format msgid "%s %d: Missing )\n" msgstr "%s %d: ïÔÓÕÔÓÔ×ÕÅÔ )\n" #: syntax.c:411 #, fuzzy, c-format msgid "%s %d: missing parameter for ifdef\n" msgstr "%s %d: ïÔÓÕÔÓÔ×ÕÅÔ ÐÁÒÁÍÅÔÒ ÄÌÑ ifdef\n" #: syntax.c:421 #, c-format msgid "%s %d: else with no matching if\n" msgstr "%s %d: else ÂÅÚ ÓÏÏÔ×. if\n" #: syntax.c:428 #, c-format msgid "%s %d: endif with no matching if\n" msgstr "%s %d: endif ÂÅÚ ÓÏÏÔ×. if\n" #: syntax.c:432 syntax.c:560 #, fuzzy, c-format msgid "%s %d: Missing subroutine name\n" msgstr "%s %d: ïÔÓÕÔÓÔ×ÕÅÔ ÉÍÑ ÐÏÄÐÒÏÇÒÁÍÍÙ\n" #: syntax.c:447 #, fuzzy, c-format msgid "%s %d: Unknown control statement\n" msgstr "%s %d: îÅÉÚ×ÅÓÔÎÙÊ ÕÐÒÁ×ÌÑÀÝÉÊ ÏÐÅÒÁÔÏÒ\n" #: syntax.c:450 #, fuzzy, c-format msgid "%s %d: Missing control statement name\n" msgstr "%s %d: ïÔÓÕÔÓÔ×ÕÅÔ ÉÍÑ ÕÐÒÁ×ÌÑÀÝÅÇÏ ÏÐÅÒÁÔÏÒÁ\n" #: syntax.c:477 #, c-format msgid "%s %d: Unknown class\n" msgstr "%s %d: îÅÉÚ×ÅÓÔÎÙÊ ËÌÁÓÓ\n" #: syntax.c:480 #, c-format msgid "%s %d: Missing color for state definition\n" msgstr "%s %d: ïÔÓÕÔÓÔ×ÕÅÔ Ã×ÅÔ ÄÌÑ ÏÐÒÅÄÅÌÅÎÉÑ ÓÏÓÔÏÑÎÉÑ\n" #: syntax.c:482 syntax.c:610 #, c-format msgid "%s %d: Missing state name\n" msgstr "%s %d: ïÔÓÕÔÓÔ×ÕÅÔ ÉÍÑ ÓÏÓÔÏÑÎÉÑ\n" #: syntax.c:503 #, c-format msgid "%s %d: Bad string\n" msgstr "%s %d: îÅ×ÅÒÎÁÑ ÓÔÒÏËÁ\n" #: syntax.c:543 syntax.c:545 syntax.c:554 syntax.c:568 syntax.c:604 #: syntax.c:606 #, c-format msgid "%s %d: Missing value for option\n" msgstr "%s %d: ïÔÓÕÔÓÔ×ÕÅÔ ÚÎÁÞÅÎÉÅ ÄÌÑ ÏÐÃÉÉ\n" #: syntax.c:608 syntax.c:624 #, c-format msgid "%s %d: Unknown option\n" msgstr "%s %d: îÅÉÚ×ÅÓÔÎÁÑ ÏÐÃÉÑ\n" #: syntax.c:612 #, c-format msgid "%s %d: Missing string\n" msgstr "%s %d: ïÔÓÕÔÓÔ×ÕÅÔ ÓÔÒÏËÁ\n" #: syntax.c:633 #, c-format msgid "%s %d: Missing jump\n" msgstr "%s %d: ïÔÓÕÔÓÔ×ÕÅÔ ÐÅÒÅÈÏÄ\n" #: syntax.c:635 #, c-format msgid "%s %d: No state\n" msgstr "%s %d: îÅÔ ÓÏÓÔÏÑÎÉÑ\n" #: syntax.c:637 #, c-format msgid "%s %d: Unknown character\n" msgstr "%s %d: îÅÉÚ×ÅÓÔÎÙÊ ÓÉÍ×ÏÌ\n" #: syntax.c:644 #, c-format msgid "%s %d: ifdef with no matching endif\n" msgstr "%s %d: ifdef ÂÅÚ ÓÏÏÔ×. endif\n" #: tab.c:212 tab.c:271 msgid "Couldn't read directory " msgstr "îÅ ÍÏÇÕ ÐÒÏÞÉÔÁÔØ ÄÉÒÅËÔÏÒÉÀ" #: termcap.c:219 msgid "Couldn't load termcap entry. Using ansi default\n" msgstr "îÅ ÍÏÇÕ ÐÒÏÞÉÔÁÔØ ÏÐÉÓÁÎÉÅ termcap. éÓÐÏÌØÚÕÀ ANSI ÐÏ ÕÍÏÌÞÁÎÉÀ\n" #: termcap.c:240 #, c-format msgid "%s is out of date\n" msgstr "%s ÕÓÔÁÒÅÌ\n" #: tty.c:314 msgid "Couldn't open /dev/tty\n" msgstr "îÅ ÍÏÇÕ ÏÔËÒÙÔØ /dev/tty\n" #: tty.c:731 msgid "You are at the command shell. Type 'exit' to return\n" msgstr "÷Ù × ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÅ. ÷×ÅÄÉÔÅ 'exit' ÄÌÑ ×ÏÚ×ÒÁÔÁ\n" #: tty.c:795 msgid "You have suspended the program. Type 'fg' to return\n" msgstr "÷Ù ÐÒÉÏÓÔÁÎÏ×ÉÌÉ ÐÒÏÇÒÁÍÍÕ. ÷×ÅÄÉÔÅ 'fg' ÄÌÑ ×ÏÚ×ÒÁÔÁ\n" #: tty.c:1146 #, c-format msgid "Couldn't execute shell '%s'\n" msgstr "îÅ ÍÏÇÕ ×ÙÐÏÌÎÉÔØ ÛÅÌÌ '%s'\n" #: tw.c:213 msgid "Unnamed" msgstr "âÅÚéÍÅÎÉ" #: tw.c:219 msgid "(Modified)" msgstr "(éÚÍÅÎÅÎÏ)" #: tw.c:223 msgid "(Read only)" msgstr "(ôÏÌØËÏþÔÅÎÉÅ)" #: tw.c:329 msgid "*SHELL*" msgstr "" #: tw.c:333 #, c-format msgid "(Macro %d recording...)" msgstr "(úÁÐÉÓØ ÍÁËÒÏ %d...)" #: tw.c:558 tw.c:584 ufile.c:1010 msgid "Lose changes to this file (y,n,^C)? " msgstr "ïÔÍÅÎÉÔØ ÉÚÍÅÎÅÎÉÑ ÆÁÊÌÁ (y,n,^C)? " #: ublock.c:284 msgid "Selection cleared." msgstr "ïÔÍÅÔËÁ ÓÎÑÔÁ." #: ublock.c:292 ublock.c:309 msgid "Selection started." msgstr "ïÔÍÅÔËÁ ÎÁÞÁÔÁ." #: ublock.c:417 ublock.c:503 ublock.c:559 ublock.c:887 ublock.c:921 #: ublock.c:1083 ufile.c:435 umath.c:177 undo.c:455 msgid "No block" msgstr "îÅÔ ÂÌÏËÁ" #: ublock.c:756 ublock.c:839 msgid "Selected lines not properly indented" msgstr "ïÔÍÅÞÅÎÎÙÅ ÓÔÒÏËÉ ÉÍÅÀÔ ÎÅ×ÅÒÎÙÊ ÏÔÓÔÕÐ" #: ublock.c:1067 ushell.c:86 msgid "Sorry, no sub-processes in DOS (yet)" msgstr "éÚ×ÉÎÉÔÅ, ÐÏÄÐÒÏÃÅÓÓÙ × DOS ÎÅ ÐÏÄÄÅÒÖÉ×ÁÀÔÓÑ (ÐÏËÁ)" #: ublock.c:1072 msgid "Command to filter block through (^C to abort): " msgstr "ëÏÍÁÎÄÁ ÄÌÑ ÆÉÌØÔÒÁÃÉÉ ÂÌÏËÁ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: ublock.c:1077 msgid "Command to filter file through (^C to abort): " msgstr "ëÏÍÁÎÄÁ ÄÌÑ ÆÉÌØÔÒÁÃÉÉ ÆÁÊÌÁ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: uedit.c:1388 utag.c:73 msgid "Invalid line number" msgstr "îÅÄÏÐÕÓÔÉÍÙÊ ÎÏÍÅÒ ÓÔÒÏËÉ" #: uedit.c:1395 msgid "Go to line (^C to abort): " msgstr "îÏÍÅÒ ÓÔÒÏËÉ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: uedit.c:1424 msgid "Invalid column number" msgstr "îÅÄÏÐÕÓÔÉÍÙÊ ÎÏÍÅÒ ËÏÌÏÎËÉ" #: uedit.c:1431 msgid "Go to column (^C to abort): " msgstr "îÏÍÅÒ ËÏÌÏÎËÉ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: uedit.c:1460 msgid "Invalid byte number" msgstr "îÅÄÏÐÕÓÔÉÍÙÊ ÎÏÍÅÒ ÂÁÊÔÁ" #: uedit.c:1467 msgid "Go to byte (^C to abort): " msgstr "îÏÍÅÒ ÂÁÊÔÁ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: uedit.c:1911 msgid "Unicode (ISO-10646) character in hex (^C to abort): " msgstr "óÉÍ×ÏÌ Unicode (ISO-10646) × 16ÒÉÞÎÏÍ ×ÉÄÅ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: uedit.c:2036 msgid "Ctrl- (or 0-9 for dec. ascii, x for hex, or o for octal)" msgstr "Ctrl- (ÉÌÉ 0-9 ÄÌÑ ÄÅÓ. ËÏÄÁ, x - ÄÌÑ 16, ÉÌÉ o - ÄÌÑ 8)" #: uedit.c:2099 msgid "Quote" msgstr "áÐÏÓÔÒÏÆ" #: uedit.c:2166 #, c-format msgid "Mark %d set" msgstr "íÅÔËÁ %d ÕÓÔÁÎÏ×ÌÅÎÁ" #: uedit.c:2180 msgid "Set mark (0-9):" msgstr "îÏÍÅÒ ÍÅÔËÉ (0-9):" #: uedit.c:2198 #, c-format msgid "Mark %d not set" msgstr "íÅÔËÁ %d ÎÅ ÕÓÔÁÎÏ×ÌÅÎÁ" #: uedit.c:2211 msgid "Goto bookmark (0-9):" msgstr "ðÅÒÅÊÔÉ Ë ÚÁËÌÁÄËÅ (0-9): " #: uedit.c:2243 usearch.c:995 utag.c:107 msgid "Not found" msgstr "îÅ ÎÁÊÄÅÎ" #: uedit.c:2259 #, fuzzy msgid "Forward to char: " msgstr "÷ÐÅÒÅÄ Ë ÓÉÍ×ÏÌÕ: " #: uedit.c:2270 #, fuzzy msgid "Backward to char: " msgstr "îÁÚÁÄ Ë ÓÉÍ×ÏÌÕ: " #: uedit.c:2290 #, fuzzy msgid "Message (^C to abort): " msgstr "óÏÏÂÝ. (^C ÄÌÑ ÏÔÍÅÎÙ): " #: uedit.c:2312 msgid "Insert (^C to abort): " msgstr "÷ÓÔÁ×ÉÔØ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: uerror.c:330 uerror.c:344 #, fuzzy, c-format msgid "%d messages found" msgstr "%ld ÓÏÏÂÝÅÎÉÊ ÎÁÊÄÅÎÏ" #: uerror.c:332 uerror.c:346 msgid "No messages found" msgstr "îÉ ÏÄÎÏÇÏ ÓÏÏÂÝÅÎÉÑ ÎÅ ÎÁÊÄÅÎÏ" #: uerror.c:377 #, fuzzy msgid "No messages" msgstr "îÅÔ ÓÏÏÂÝÅÎÉÊ" #: uerror.c:432 uerror.c:443 msgid "No more errors" msgstr "âÏÌØÛÅ ÎÅÔ ÏÛÉÂÏË" #: ufile.c:39 msgid "(Unnamed)" msgstr "(âÅÚéÍÅÎÉ)" #: ufile.c:44 ufile.c:51 #, c-format msgid "File %s saved" msgstr "æÁÊÌ %s ÓÏÈÒÁΣÎ" #: ufile.c:46 ufile.c:49 #, c-format msgid "File %s not saved" msgstr "æÁÊÌ %s ÎÅ ÓÏÈÒÁÎÅÎ" #: ufile.c:53 #, c-format msgid "File %s not changed so no update needed" msgstr "æÁÊÌ %s ÎÅ ÉÚÍÅÎÅÎ, Ô.Ë. ÎÅ ÂÙÌÏ ÍÏÄÉÆÉËÁÃÉÊ" #: ufile.c:67 msgid "Some files have not been saved." msgstr "îÅËÏÔÏÒÙÅ ÆÁÊÌÙ ÎÅ ÓÏÈÒÁÎÅÎÙ." #: ufile.c:69 msgid "All modified files have been saved." msgstr "÷ÓÅ ÍÏÄÉÆÉÃÉÒÏ×ÁÎÎÙÅ ÆÁÊÌÙ ÓÏÈÒÁÎÅÎÙ." #: ufile.c:71 msgid "No modified files, so no updates needed." msgstr "îÉ ÏÄÉÎ ÆÁÊÌ ÎÅ ÍÏÄÉÆÉÃÉÒÏ×ÁÌÓÑ, ÎÉÞÅÇÏ ÉÚÍÅÎÑÔØ ÎÅ ÎÕÖÎÏ." #: ufile.c:107 msgid "System (^C to abort): " msgstr "óÉÓÔÅÍÁ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: ufile.c:273 msgid "|yes|yY" msgstr "|yes|yYÎî" #: ufile.c:274 msgid "|no|nN" msgstr "|no|nNÔô" #: ufile.c:309 msgid "Couldn't make backup file... file not saved" msgstr "îÅ ÍÏÇÕ ÓÏÚÄÁÔØ ÒÅÚÅÒ×ÎÙÊ ÆÁÊÌ... ÆÁÊÌ ÎÅ ÓÏÈÒÁΣÎ" #: ufile.c:321 msgid "Could not make backup file. Save anyway (y,n,^C)? " msgstr "îÅ ÍÏÇÕ ÓÏÚÄÁÔØ ÒÅÚÅÒ×ÎÙÊ ÆÁÊÌ. óÏÈÒÁÎÑÔØ ×ÓÅ ÒÁ×ÎÏ (y,n,^C)? " #: ufile.c:409 ufile.c:425 #, c-format msgid "Block written to file %s" msgstr "âÌÏË ÚÁÐÉÓÁÎ × ÆÁÊÌ %s" #: ufile.c:488 msgid "File exists. Overwrite (y,n,^C)? " msgstr "æÁÊÌ ÓÕÝÅÓÔ×ÕÅÔ. ðÅÒÅÚÁÐÉÓÙ×ÁÔØ (y,n,^C)? " #: ufile.c:495 msgid "File on disk is newer. Overwrite (y,n,^C)? " msgstr "éÍÅÀÝÉÊÓÑ ÎÁ ÄÉÓËÅ ÆÁÊÌ - ÂÏÌÅÅ ÎÏ×ÙÊ. ðÅÒÅÚÁÐÉÓÙ×ÁÔØ (y,n,^C)? " #: ufile.c:510 ufile.c:899 ufile.c:1103 msgid "Name of file to save (^C to abort): " msgstr "éÍÑ ÆÁÊÌÁ ÄÌÑ ÓÏÈÒÁÎÅÎÉÑ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: ufile.c:538 msgid "Name of file to write (^C to abort): " msgstr "éÍÑ ÆÁÊÌÁ ÄÌÑ ÚÁÐÉÓÉ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: ufile.c:654 msgid "Load original file from disk (y,n,^C)? " msgstr "úÁÇÒÕÚÉÔØ ÏÒÉÇÉÎÁÌØÎÙÊ ÆÁÊÌ Ó ÄÉÓËÁ (y,n,^C)? " #: ufile.c:684 msgid "Can't replace modified file" msgstr "îÅ ÍÏÇÕ ÚÁÍÅÎÉÔØ ÍÏÄÉÆÉÃÉÒÏ×ÁÎÎÙÊ ÆÁÊÌ" #: ufile.c:693 msgid "Name of file to edit (^C to abort): " msgstr "éÍÑ ÆÁÊÌÁ ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: ufile.c:708 ufile.c:1085 msgid "Name of buffer to edit (^C to abort): " msgstr "éÍÑ ÂÕÆÅÒÁ ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: ufile.c:764 msgid "Name of scratch buffer to edit (^C to abort): " msgstr "éÍÑ ÂÕÆÅÒÁ ÞÅÒÎÏ×ÉËÁ ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: ufile.c:865 msgid "Name of file to insert (^C to abort): " msgstr "éÍÑ ÆÁÊÌÁ ÄÌÑ ×ÓÔÁ×ËÉ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: ufile.c:933 msgid "Save changes to this file (y,n,^C)? " msgstr "óÏÈÒÁÎÉÔØ ÉÚÍÅÎÅÎÉÑ ÜÔÏÇÏ ÆÁÊÌÁ (y,n,^C)? " #: ufile.c:1137 #, c-format msgid "File %s has been modified. Save it (y,n,^C)? " msgstr "æÁÊÌ %s ÉÚÍÅÎÅÎ. óÏÈÒÁÎÉÔØ ÅÇÏ (y,n,^C)? " #: uisrch.c:267 msgid "I-find: " msgstr "" #: umath.c:19 msgid "Float point exception" msgstr "ðÒÅÒÙ×ÁÎÉÅ ÐÏ ÐÌÁ×ÁÀÝÅÊ ÔÏÞËÅ" #: umath.c:93 umath.c:195 umath.c:214 msgid "Missing )" msgstr "ïÔÓÕÔÓÔ×ÕÅÔ )" #: umath.c:104 msgid "Syntax error in macro" msgstr "óÉÎÔÁËÓÉÞÅÓËÁÑ ÏÛÉÂËÁ × ÍÁËÒÏ" #: umath.c:111 msgid "Missing (" msgstr "ïÔÓÕÔÓÔ×ÕÅÔ (" #: umath.c:140 umath.c:146 umath.c:153 umath.c:162 msgid "No numbers in block" msgstr "÷ ÂÌÏËÅ ÎÅÔ ÞÉÓÅÌ" #: umath.c:220 msgid "Called object is not a function" msgstr "÷ÙÚÙ×ÁÅÍÙÊ ÏÂßÅËÔ - ÎÅ ÆÕÎËÃÉÑ" #: umath.c:234 msgid "Factorial can only take positive integers" msgstr "æÁËÔÏÒÉÁÌ ÍÏÖÅÔ ×ÙÞÉÓÌÑÔØÓÑ ÔÏÌØËÏ ÄÌÑ ÐÏÌÏÖÉÔÅÌØÎÙÈ ÃÅÌÙÈ" #: umath.c:332 msgid "Left side of = is not an l-value" msgstr "÷ ÌÅ×ÏÊ ÞÁÓÔÉ ÒÁ×ÅÎÓÔ×Á - ÎÅ l-ÚÎÁÞÅÎÉÅ" #: umath.c:346 msgid "Recursion depth exceeded" msgstr "ðÒÅ×ÙÛÅÎÁ ÇÌÕÂÉÎÁ ÒÅËÕÒÓÉÉ" #: umath.c:366 msgid "Extra junk after end of expr" msgstr "ìÉÛÎÉÅ ÓÉÍ×ÏÌÙ ÐÏÓÌÅ ËÏÎÃÁ ×ÙÒÁÖÅÎÉÑ" #: undo.c:438 msgid "Modified flag cleared" msgstr "æÌÁÇ ÍÏÄÉÆÉËÁÃÉÉ ÓÂÒÏÛÅÎ" #: usearch.c:281 usearch.c:350 msgid "Wrapped" msgstr "óÎÁÞÁÌÁ" #: usearch.c:553 msgid "|all files|aA" msgstr "|×ÓÅ ÆÁÊÌÙ|aAÆæ" #: usearch.c:554 #, fuzzy msgid "|error list files|eE" msgstr "|ÆÁÊÌÙ ÓÐÉÓËÏ× ÏÛÉÂÏË|eEÕõ" #: usearch.c:555 msgid "|search and replace|rR" msgstr "|ÐÏÉÓË É ÚÁÍÅÝÅÎÉÅ|rRËë" #: usearch.c:556 msgid "|backwards|bB" msgstr "|ÎÁÚÁÄ|bBÉé" #: usearch.c:557 msgid "|ignore case|iI" msgstr "|ÉÇÎÏÒÉÒÏ×ÁÔØ ÒÅÇÉÓÔÒ|iIÛû" #: usearch.c:558 msgid "|restrict to highlighted block|kK" msgstr "|×ÎÕÔÒÉ ÏÔÍÅÞÅÎÎÏÇÏ ÂÌÏËÁ|kKÌì" #: usearch.c:559 msgid "|don't ignore case|sS" msgstr "|ÎÅ ÉÇÎÏÒÉÒÏ×ÁÔØ ÒÅÇÉÓÔÒ|sSÙù¦¶" #: usearch.c:560 msgid "|wrap|wW" msgstr "|ÃÉËÌÉÞÅÓËÉÊ|wWÃã" #: usearch.c:561 #, fuzzy msgid "|don't wrap|nN" msgstr "|ÎÅ ÃÉËÌÉÞÅÓËÉÊ|nNÔô" #: usearch.c:618 msgid "Replace with (^C to abort): " msgstr "þÅÍ ÚÁÍÅÎÑÔØ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: usearch.c:633 #, fuzzy msgid "case (S)ensitive (R)eplace (B)ackwards Bloc(K) (A)ll files NNN (^C to abort): " msgstr "(S)ÕÞÅÔ ÒÅÇÉÓÔÒÁ (R)ÚÁÍÅÎÁ (B)ÎÁÚÁÄ ÂÌÏ(K) (A)×ÓÅ ÆÁÊÌÙ NNN (^C - ÏÔÍÅÎÁ): " #: usearch.c:635 #, fuzzy msgid "(I)gnore (R)eplace (B)ackwards Bloc(K) (A)ll files NNN (^C to abort): " msgstr "(I)ÉÇÎ.ÒÅÇ. (R)ÚÁÍÅÎÁ (B)ÎÁÚÁÄ ÂÌÏ(K) (A)×ÓÅ ÆÁÊÌÙ NNN (^C - ÏÔÍÅÎÁ): " #: usearch.c:717 #, c-format msgid "Find (^C to abort) [%s]: " msgstr "þÔÏ ÉÓËÁÔØ (^C ÄÌÑ ÏÔÍÅÎÙ) [%s]: " #: usearch.c:719 msgid "Find (^C to abort): " msgstr "þÔÏ ÉÓËÁÔØ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: usearch.c:813 msgid "|rest of file|rR" msgstr "|ÄÏ ËÏÎÃÁ ÆÁÊÌÁ|rR" #: usearch.c:814 msgid "|backup|bB" msgstr "|ÒÅÚÅÒ×|bBÉé" #: usearch.c:845 msgid "Replace (Y)es (N)o (R)est (B)ackup (^C to abort)?" msgstr "úÁÍÅÎÑÔØ (Y)ÄÁ (N)ÎÅÔ (R)×Ó£ (B)×ÅÒÎÕÔØ (^C ÄÌÑ ÏÔÍÅÎÙ): " #: usearch.c:993 msgid "Not found (search restricted to marked block)" msgstr "îÅ ÎÁÊÄÅÎÏ (ÐÏÉÓË ÏÇÒÁÎÉÞÅÎ ÂÌÏËÏÍ)" #: usearch.c:1000 msgid "Infinite loop aborted: your search repeatedly matched same place" msgstr "âÅÓËÏÎÅÞÎÙÊ ÃÉËÌ ÐÒÅÒ×ÁÎ: ×ÁÛ ÐÏÉÓË ÚÁÃÉËÌÉÌÓÑ ÎÁ ÏÄÎÏÍ ÍÅÓÔÅ" #: ushell.c:95 msgid "Program already running in this window" msgstr "ðÒÏÇÒÁÍÍÁ ÕÖÅ ×ÙÐÏÌÎÑÅÔÓÑ × ÜÔÏÍ ÏËÎÅ" #: ushell.c:103 msgid "No ptys available" msgstr "îÅÔ Ó×ÏÂÏÄÎÙÈ ÐÓÅ×ÄÏÔÅÒÍÉÎÁÌÏ×" #: ushell.c:128 msgid "\"SHELL\" environment variable not defined or exported" msgstr "ðÅÒÅÍÅÎÎÁÑ ÓÒÅÄÙ \"SHELL\" ÎÅ ÏÐÒÅÄÅÌÅÎÁ ÉÌÉ ÎÅ ÜËÓÐÏÒÔÉÒÏ×ÁÎÁ" #: ushell.c:164 msgid "Program to run: " msgstr "úÁÐÕÓÔÉÔØ ÐÒÏÇÒÁÍÍÕ: " #: ushell.c:188 msgid "Build command: " msgstr "ëÏÍÁÎÄÁ ÐÏÓÔÒÏÅÎÉÑ: " #: ushell.c:197 msgid "Enter build command (for example, 'make'): " msgstr "õËÁÖÉÔÅ ËÏÍÁÎÄÕ ÐÏÓÔÒÏÅÎÉÑ (ÎÁÐÒÉÍÅÒ, 'make'): " #: ushell.c:212 msgid "Grep command: " msgstr "ëÏÍÁÎÄÁ ÐÏÉÓËÁ: " #: ushell.c:221 msgid "Enter grep command (for example, 'grep -n foo *.c'): " msgstr "õËÁÖÉÔÅ ËÏÍÁÎÄÕ ÐÏÉÓËÁ (ÎÁÐÒÉÍÅÒ, 'grep -n foo *.c'): " #: ushell.c:250 msgid "Kill program (y,n,^C)?" msgstr "ðÒÅÒ×ÁÔØ ÐÒÏÇÒÁÍÍÕ (y,n,^C)?" #: utag.c:26 msgid "Couldn't open tags file" msgstr "îÅ ÍÏÇÕ ÏÔËÒÙÔØ ÆÁÊÌ ÔÜÇÏ×" #: utag.c:168 msgid "Tag search: " msgstr "éÓËÁÔØ ÔÜÇ: " #: vfile.c:174 msgid "vfile: out of memory\n" msgstr "vfile: ÎÅÔ ÐÁÍÑÔÉ\n" #: vfile.c:229 #, c-format msgid "Couldn't open file '%s'\n" msgstr "îÅ ÍÏÇÕ ÏÔËÒÙÔØ ÆÁÊÌ '%s'\n" #: w.c:822 msgid "There is no message buffer" msgstr "ïÔÓÕÔÓÔ×ÕÅÔ ÂÕÆÅÒ ÓÏÏÂÝÅÎÉÑ" #~ msgid "Delimiters (%s): " #~ msgstr "ïÇÒÁÎÉÞÉÔÅÌÉ (%s): " #~ msgid "Delimiters: " #~ msgstr "ïÇÒÁÎÉÞÉÔÅÌÉ:" #~ msgid "Not found\n" #~ msgstr "îÅ ÎÁÊÄÅÎ\n" #~ msgid "Could not lock. (S)teal, (I)gnore, (Q)uit? " #~ msgstr "îÅ ÍÏÇÕ ÚÁÂÌÏËÉÒÏ×ÁÔØ. (S)ÚÁÈ×ÁÔÉÔØ, (I)ÉÇÎÏÒÉÒÏ×ÁÔØ, (Q)×ÙÊÔÉ? " #~ msgid "cmd: " #~ msgstr "ËÏÍÁÎÄÁ: " #~ msgid "\t^K %c\tMacro %d" #~ msgstr "\t^K %c\tíÁËÒÏ %d" #~ msgid "Jump is on" #~ msgstr "ðÒÙÖÏË ×ËÌ." #~ msgid "Jump is off" #~ msgstr "ðÒÙÖÏË ×ÙËÌ." #~ msgid " %S Ctrl-K H for help" #~ msgstr " %S Ctrl-K H for help" #~ msgid "ON" #~ msgstr "÷ëì" #~ msgid "OFF" #~ msgstr "÷ùëì" #~ msgid "File " #~ msgstr "æÁÊÌ " #~ msgid " not saved." #~ msgstr " ÎÅ ÓÏÈÒÁΣÎ." #~ msgid " saved." #~ msgstr " ÓÏÈÒÁΣÎ." #~ msgid " not changed so no update needed." #~ msgstr " ÎÅ ÉÚÍÅÎÅÎ, Ô.Ë. ÎÅ ÂÙÌÏ ÍÏÄÉÆÉËÁÃÉÊ" #~ msgid ": missing after ?" #~ msgstr ": ÏÔÓÕÔÓÔ×ÕÅÔ ÐÏÓÌÅ ?" #~ msgid "Replace with (^C to abort) [%s]: " #~ msgstr "þÅÍ ÚÁÍÅÎÑÔØ (^C ÄÌÑ ÏÔÍÅÎÙ) [%s]: " #~ msgid "corrupt heap: head %x\n" #~ msgstr "ÉÓÐÏÒÞÅÎÎÁÑ ËÕÞÁ: ×ÅÒÈÕÛËÁ %x\n" #~ msgid "Corrupt heap: tail %x\n" #~ msgstr "éÓÐÏÒÞÅÎÎÁÑ ËÕÞÁ: ËÏÎÅà %x\n" #~ msgid "Corrupt heap: modified free block %x\n" #~ msgstr "éÓÐÏÒÞÅÎÎÁÑ ËÕÞÁ: ÍÏÄÉÆÉÃÉÒÏ×ÁÎ Ó×ÏÂÏÄÎÙÊ ÂÌÏË %x\n" #~ msgid "0 passed to malloc\n" #~ msgstr "0 ÐÅÒÅÄÁÎÏ malloc\n" #~ msgid "0 passed to realloc\n" #~ msgstr "0 ÐÅÒÅÄÁÎÏ realloc\n" #~ msgid "Free non-malloc block %x\n" #~ msgstr "ïÓ×ÏÂÏÖÄÅÎÉÅ ÎÅÚÁÈ×ÁÞÅÎÎÏÇÏ ÂÌÏËÁ %x\n" #~ msgid "Double-free %x\n" #~ msgstr "ðÏ×ÔÏÒÎÏÅ ÏÓ×ÏÂÏÖÄÅÎÉÅ %x\n" joe-3.7/po/uk.po0000644000100100007640000011336311100120254010440 00000000000000# Ukrainian messages for joe editor # Yura Kalinichenko , 2006. # # #, fuzzy msgid "" msgstr "" "Project-Id-Version: 3.5\n" "POT-Creation-Date: 2006-06-15 14:12-0400\n" "PO-Revision-Date: 2006-05-22 22:56-0400\n" "Last-Translator: Yura Kalinichenko \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=koi8-u\n" "Content-Transfer-Encoding: 8bit\n" "Report-Msgid-Bugs-To: \n" #: b.c:31 msgid "No error" msgstr "âÅÚ ÐÏÍÉÌÏË" #: b.c:32 msgid "New File" msgstr "îÏ×ÉÊ æÁÊÌ" #: b.c:33 msgid "Error reading file" msgstr "ðÏÍÉÌËÁ ÞÉÔÁÎÎÑ ÆÁÊÌÁ" #: b.c:34 msgid "Error seeking file" msgstr "ðÏÍÉÌËÁ ÐÏÚÉæÏÎÕ×ÁÎÎÑ × ÆÁÊ̦" #: b.c:35 msgid "Error opening file" msgstr "ðÏÍÉÌËÁ צÄËÒÉÔÔÑ ÆÁÊÌÁ" #: b.c:36 msgid "Error writing file" msgstr "ðÏÍÉÌËÁ ÚÁÐÉÓÕ ÆÁÊÌÁ" #: b.c:37 msgid "File on disk is newer" msgstr "æÁÊÌ ÎÁ ÄÉÓËÕ - ÎÏצÝÉÊ" #: b.c:2736 #, fuzzy, c-format msgid "" "\n" "*** These modified files were found in JOE when it aborted on %s" msgstr "" "\n" "*** 㦠ÆÁÊÌÉ ÍÏÄÉÆ¦ËÕ×ÁÌÉÓÑ ÒÅÄÁËÔÏÒÏÍ JOE, ÑËÉÊ ÂÕÌÏ ÐÅÒÅÒ×ÁÎÏ %s" #: b.c:2738 #, fuzzy, c-format msgid "*** JOE was aborted by UNIX signal %d\n" msgstr "*** JOE ÂÕÌÏ ÐÅÒÅÒ×ÁÎÏ ÓÉÇÎÁÌÏÍ %d\n" #: b.c:2740 msgid "*** JOE was aborted because the terminal closed\n" msgstr "*** JOE ÂÕÌÏ ÐÅÒÅÒ×ÁÎÏ ÞÅÒÅÚ ÚÁËÒÉÔÔÑ ÔÅÒͦÎÁÌÁ\n" #: b.c:2745 #, c-format msgid "" "\n" "*** File '%s'\n" msgstr "" "\n" "*** æÁÊÌ '%s'\n" #: b.c:2747 msgid "" "\n" "*** File '(Unnamed)'\n" msgstr "" "\n" "*** æÁÊÌ '(âÅÚ¶ÍÅΦ)'\n" #: bw.c:1274 #, fuzzy, c-format msgid "** Line %ld Col %ld Offset %s(0x%s) **" msgstr "** óÔÒ %ld ðÏÚ %ld úͦÝ. %s(0x%s) **" #: bw.c:1276 #, fuzzy, c-format msgid "** Line %ld Col %ld Offset %s(0x%s) %s %d(0%o/0x%X) Width %d **" msgstr "** óÔÒ %ld ðÏÚ %ld úͦÝ. %s(0x%s) %s %d(0%o/0x%X) ûÉÒÉÎÁ %d **" #: cmd.c:211 #, fuzzy msgid "Could not create lock. (I) edit anyway, (Q) cancel edit? " msgstr "îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ ÆÁÊÌ ÂÌÏËÕ×ÁÎÎÑ. (I)ÒÅÄÁËÔÕ×ÁÔÉ ×ÓÅ Ò¦×ÎÏ, (Q)צÄͦÎÁ ? " #: cmd.c:212 #, fuzzy, c-format msgid "Locked by %s. (S)teal lock, (I) edit anyway, (Q) cancel edit? " msgstr "úÁÂÌÏËÏ×ÁÎÏ %s. (S)ÐÅÒÅÈ×ÁÔÉÔÉ, (I)¦ÇÎÏÒÕ×ÁÔÉ, (Q)צÄͦÎÁ? " #: cmd.c:214 msgid "|steal the lock|sS" msgstr "|ÐÅÒÅÈ×ÁÞÅÎÎÑ ÂÌÏËÕ×ÁÎÎÑ|sSÙù¦¶" #: cmd.c:215 msgid "|cancel edit due to lock|qQ" msgstr "|×ÙÄͦÎÁ ÒÅÄÁËÔÕ×ÁÎÎÑ ÞÅÒÅÚ ÂÌÏËÕ×ÁÎÎÑ|qQÊê" #: cmd.c:216 #, fuzzy msgid "|ignore lock, continue with edit|iI" msgstr "|¦ÇÎÏÒÕ×ÁÎÎÑ ÂÌÏËÕ×ÁÎÎÑ, ÐÒÏÄÏ×ÖÕ¤ÔØÓÑ ÒÅÄÁËÔÕ×ÁÎÎÑ|iIÛû" #: cmd.c:265 msgid "Notice: File on disk changed! (hit ^C to continue) " msgstr "õ×ÁÇÁ: æÁÊÌ ÎÁ ÄÉÓËÕ ÚͦÎÅÎÏ! (ÎÁÔÉÓÎ¦ÔØ ^C ÄÌÑ ÐÒÏÄÏ×ÖÅÎÎÑ) " #: cmd.c:325 #, fuzzy msgid "Modify other window first for macro" msgstr "óÐÏÞÁÔËÕ ÍÏÄÉÆ¦ËÕÊÔÅ ¦ÎÛŠצËÎÏ ÄÌÑ ÍÁËÒÏ" #: cmd.c:333 msgid "Other buffer is read only" msgstr "äÒÕÇÉÊ ÂÕÆÅÒ - Ô¦ÌØËÉ ÄÌÑ ÞÉÔÁÎÎÑ" #: cmd.c:348 rc.c:340 msgid "Read only" msgstr "ô¦ÌØËÉþÔÎ" #: cmd.c:542 cmd.c:552 msgid "No such command" msgstr "îÅÍÁ¤ ÔÁËϧ ËÏÍÁÎÄÉ" #: cmd.c:569 #, fuzzy msgid "Command: " msgstr "ëÏÍÁÎÄÁ: " #: help.c:77 #, c-format msgid "" "\n" "%d: EOF before end of help text\n" msgstr "" "\n" "%d: EOF ÐÅÒÅÄ Ë¦ÎÃÅÍ ÔÅËÓÔÁ ЦÄËÁÚËÉ\n" #: kbd.c:352 msgid "No such keymap" msgstr "îÅÍÁ¤ ÔÁËϧ ÒÁÓËÌÁÄËÉ ËÌÁצÁÔÕÒÉ" #: kbd.c:381 msgid "Change keymap: " msgstr "úͦÎÁ ÒÁÓËÌÁÄËÉ ËÌÁצÁÔÕÒÉ: " #: macro.c:662 msgid "Macro to record (0-9 or ^C to abort): " msgstr "îÏÍÅÒ ÍÁËÒÏ (0-9 ÁÂÏ ^C ÄÌÑ ×¦ÄͦÎÉ): " #: macro.c:764 msgid "Play-" msgstr "÷ÉËÏÎÕÀ-" #: macro.c:791 msgid "No. times to repeat next command (^C to abort): " msgstr "óË. ÒÁÚ¦× ÐÏ×ÔÏÒÉÔÉ ËÏÍÁÎÄÕ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: macro.c:819 msgid "If (^C to abort): " msgstr "If (^C ÄÌÑ ×¦ÄͦÎÉ): " #: macro.c:826 msgid "Elsif without if" msgstr "Elsif ÂÅÚ if" #: macro.c:832 msgid "Else if: " msgstr "" #: macro.c:841 msgid "Else without if" msgstr "Else ÂÅÚ if" #: macro.c:852 msgid "Endif without if" msgstr "Endif ÂÅÚ if" #: macro.c:895 #, c-format msgid "Repeat %s%d" msgstr "ðÏ×ÔÏÒÉÔÉ %s%d" #: macro.c:908 msgid "Repeat" msgstr "ðÏ×ÔÏÒ" #: main.c:207 msgid "Couldn't load termcap/terminfo entry\n" msgstr "îÅ ÍÏÖÕ ÚÁÇÒÕÚÉÔÉ ÏÐÉÓÁÎÎÑ termcap/terminfo\n" #: main.c:222 main.c:239 #, c-format msgid "There were errors in '%s'. Use it anyway?" msgstr "âÕÌÉ ÐÏÍÉÌËÉ ÐÒÉ '%s'. ÷ÉËÏÒÉÓÔÏ×Õ×ÁÔÉ ×ÓÅ Ò¦×ÎÏ?" #: main.c:294 #, c-format msgid "Warning: %s is newer than your %s.\n" msgstr "ðÏÐÅÒÅÄÖÅÎÎÑ: %s ÎÏצÝÉÊ ÚÁ ×ÁÛ %s.\n" #: main.c:295 #, c-format msgid "You should update or delete %s\n" msgstr "îÅÏÂȦÄÎÏ ÚͦÎÉÔÉ ÞÉ ×ÉÄÁÌÉÔÉ %s\n" #: main.c:296 #, c-format msgid "Hit enter to continue with %s " msgstr "îÁÔÉÓÎ¦ÔØ Enter ÄÌÑ ÐÒÏÄÏ×ÖÅÎÎÑ ÒÏÂÏÔÉ Ú %s " #: main.c:309 main.c:328 main.c:345 #, c-format msgid "There were errors in '%s'. Use it anyway (y,n)? " msgstr "âÕÌÉ ÐÏÍÉÌËÉ × '%s'. ÷ÉËÏÒÉÓÔÏ×Õ×ÁÔÉ ÊÏÇÏ ×ÓÅ Ò¦×ÎÏ (y,n)?" #: main.c:353 #, c-format msgid "Couldn't open '%s'\n" msgstr "îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ '%s'\n" #: main.c:359 msgid "rc file has no :main key binding section or no bindings. Bye.\n" msgstr "× rc-ÆÁÊ̦ צÄÓÕÔÎÑ ÒÏÚËÌÁÄËÁ ËÌÁצÁÔÕÒÉ × ÓÅËæ§ :main. Bye.\n" #: main.c:372 #, c-format msgid "Unknown option '%s'\n" msgstr "îÅצÄÏÍÁ ÏÐÃ¦Ñ '%s'\n" #: main.c:508 #, c-format msgid "\\i** Joe's Own Editor v%s ** (%s) ** Copyright %s 2006 **\\i" msgstr "" #: rc.c:295 msgid "Overtype mode" msgstr "òÅÖÉÍ ÚÁͦÎÉ" #: rc.c:295 msgid "Insert mode" msgstr "òÅÖÉÍ ×ÓÔÁ×ËÉ" #: rc.c:295 msgid "T Overtype " msgstr "T úÁͦÎÁ " #: rc.c:296 msgid "Hex edit mode" msgstr "16ÒÉÞÎ.ÒÅÄÁËÔ." #: rc.c:296 msgid "Text edit mode" msgstr "ôÅËÓÔ.ÒÅÄÁËÔ." #: rc.c:296 msgid " Hex edit mode " msgstr " òÅÖÉÍ 16ÒÉÞÎ. " #: rc.c:297 msgid "Autoindent enabled" msgstr "á×ÔÏצÓÔÕÐ ×ËÌÀÞÅÎÏ" #: rc.c:297 msgid "Autoindent disabled" msgstr "á×ÔÏצÓÔÕÐ ×ÉÍËÎÅÎÏ" #: rc.c:297 msgid "I Autoindent " msgstr "I á×ÔÏצÄÓÔÕÐ " #: rc.c:298 msgid "Wordwrap enabled" msgstr "á×ÔÏÐÅÒÅÎÏÓ ×ËÌÀÞÅÎÏ" #: rc.c:298 msgid "Wordwrap disabled" msgstr "á×ÔÏÐÅÒÅÎÏÓ ×ÉÍËÎÅÎÏ" #: rc.c:298 #, fuzzy msgid "W Word wrap " msgstr "W á×ÔÏÐÅÒÅÎÏÓ " #: rc.c:299 #, c-format msgid "Tab width (%d): " msgstr "÷¦ÄÓÔÁÎØ Í¦Ö ÔÁÂÕÌÏÓÔÏÐÁÍÉ (%d): " #: rc.c:299 msgid "D Tab width " msgstr "D ûÉÒÉÎÁ Tab " #: rc.c:300 #, c-format msgid "Left margin (%d): " msgstr "ì¦×ÉÊ ËÒÁÊ (%d): " #: rc.c:300 #, fuzzy msgid "L Left margin " msgstr "L ì¦×ÉÊ ËÒÁÊ " #: rc.c:301 #, c-format msgid "Right margin (%d): " msgstr "ðÒÁ×ÉÊ ËÒÁÊ (%d): " #: rc.c:301 #, fuzzy msgid "R Right margin " msgstr "R ðÒÁ×ÉÊ ËÒÁÊ " #: rc.c:302 msgid "Restore cursor position when files loaded" msgstr "ðÏÚÉÃ¦Ñ ËÕÒÓÏÒÁ ÂÕÄŠצÄÎÏ×ÌÀ×ÁÔÉÓØ ÐÒÉ ÚÁÇÒÕÚæ ÆÁÊ̦×" #: rc.c:302 msgid "Don't restore cursor when files loaded" msgstr "ðÏÚÉÃ¦Ñ ËÕÒÓÏÒÁ ÎÅ ÂÕÄŠצÄÎÏ×ÌÀ×ÁÔÉÓØ ÐÒÉ ÚÁÇÒÕÚæ ÆÁÊ̦×" #: rc.c:302 msgid " Restore cursor " msgstr " ÷¦ÄÎÏ×ÌÅÎÎÑ ËÕÒÓÏÒÁ " #: rc.c:303 msgid "Rectangle mode" msgstr "òÅÖÉÍ ÐÒÑÍÏËÕÔÎÉÈ ÂÌÏ˦×" #: rc.c:303 msgid "Text-stream mode" msgstr "òÅÖÉÍ ÐÏÓÔÒÏÞÎÉÈ ÂÌÏ˦×" #: rc.c:303 msgid "X Rectangle mode " msgstr "X ðÒÑÍÏËÕÔ. ÂÌÏËÉ " #: rc.c:304 #, fuzzy msgid "Search ignores case by default" msgstr "ðÏÛÕË ¦ÇÎÏÒÕ¤ ÒÅǦÓÔÒ ÚÁ ÕÍÏ×ÞÁÎÎÑÍ" #: rc.c:304 #, fuzzy msgid "Case sensitive search by default" msgstr "ðÏÛÕË ×ÒÁÈÏ×Õ¤ ÒÅǦÓÔÒ ÚÁ ÕÍÏ×ÞÁÎÎÑÍ" #: rc.c:304 msgid " Case insensitivity " msgstr " òÅÇs¦ÓÔÒÏÎÅÞÕÔÌÉ×. " #: rc.c:305 msgid "Search wraps" msgstr "ãÉËÌÉÞÎÉÊ ÐÏÛÕË" #: rc.c:305 msgid "Search doesn't wrap" msgstr "ðÏÛÕË ÎÅ ÃÉËÌÉÞÎÉÊ" #: rc.c:305 msgid " Search wraps " msgstr " ãÉËÌ. ÐÏÛÕË " #: rc.c:306 msgid "Menu explorer mode" msgstr "òÅÖÉÍ ÍÅÎÀ" #: rc.c:306 #, fuzzy msgid "Simple completion mode" msgstr "ðÒÏÓÔÅ ÄÏÐÏ×ÎÅÎÎÑ" #: rc.c:306 msgid " Menu explorer " msgstr " ðÅÒÅÇÌÑÄ ÍÅÎÀ " #: rc.c:307 msgid "Menu above prompt" msgstr "íÅÎÀ ÎÁÄ ÚÁÐÉÔÏÍ" #: rc.c:307 msgid "Menu below prompt" msgstr "íÅÎÀ Ð¦Ä ÚÁÐÉÔÏÍ" #: rc.c:307 #, fuzzy msgid " Menu position " msgstr " ðÏÚÉÃ¦Ñ ÍÅÎÀ" #: rc.c:308 msgid "Search prompting on" msgstr "úÁÐÉÔ ÐÏÛÕËÕ ×ËÌ." #: rc.c:308 msgid "Search prompting off" msgstr "úÁÐÉÔ ÐÏÛÕËÕ ×ÉÍË." #: rc.c:308 msgid " Search prompting " msgstr " úÁÐÉÔ ÐÏÛÕËÁ " #: rc.c:309 #, fuzzy msgid "Jump into menu is on" msgstr " óËÁÞÏË × ÍÅÎÀ ×ËÌ." #: rc.c:309 #, fuzzy msgid "Jump into menu is off" msgstr " óËÁÞÏË × ÍÅÎÀ ×ÉÍË." #: rc.c:309 msgid " Jump into menu " msgstr " óËÁÞÏË × ÍÅÎÀ " #: rc.c:310 msgid "Autoswap ^KB and ^KK" msgstr "á×ÔÏÏÂͦΠ^KB É ^KK" #: rc.c:310 #, fuzzy msgid "Autoswap off " msgstr " á×ÔÏÏÂͦΠ×ÉÍË" #: rc.c:310 msgid " Autoswap mode " msgstr " á×ÔÏÏÂͦΠ" #: rc.c:311 #, c-format msgid "Indent char %d (SPACE=32, TAB=9, ^C to abort): " msgstr "óÉÍ×ÏÌ ×ÉÒ¦×ÎÀ×ÁÎÎÑ %d (ðòïâ¶ì=32, TAB=9, ^C ÄÌÑ ×¦ÄͦÎÉ): " #: rc.c:311 msgid " Indent char " msgstr " óÉÍ×ÏÌ ×ÉÒ¦×ÎÀ×ÁÎÎÑ " #: rc.c:312 #, c-format msgid "Indent step %d (^C to abort): " msgstr "ûÁÇ ×ÉÒ¦×ÎÀ×ÁÎÎÑ %d (^C ÄÌÑ ×¦ÄͦÎÉ): " #: rc.c:312 msgid " Indent step " msgstr " ûÁÇ ×ÉÒ¦×ÎÀ×ÁÎÎÑ " #: rc.c:313 msgid "One space after periods for paragraph reformat" msgstr "ïÄÉÎ ÐÒÏÂ¦Ì Ð¦ÓÌÑ ËÒÁÐËÉ ÐÒÉ ÆÏÒÍÁÔÕ×ÁÎΦ ÁÂÚÁÃÁ" #: rc.c:313 msgid "Two spaces after periods for paragraph reformat" msgstr "ä×Á ÐÒϦÌÁ ЦÓÌÑ ËÒÁÐËÉ ÐÒÉ ÆÏÒÍÁÔÕ×ÁÎΦ ÁÂÚÁÃÁ" #: rc.c:313 #, fuzzy msgid " French spacing " msgstr " æÒÁÎÃÕÚÓØËÉÊ ÐÒÏÂ¦Ì " #: rc.c:314 msgid "Highlighting enabled" msgstr "ðÏÄÓצÞÕ×ÁÎÎÑ ÄÏÚ×ÏÌÅÎÏ" #: rc.c:314 msgid "Highlighting disabled" msgstr "ðÏÄÓצÞÕ×ÁÎÎÑ ÚÁÂÏÒÏÎÅÎÏ" #: rc.c:314 #, fuzzy msgid "H Highlighting " msgstr "H ð¦ÄÓצÞÕ×ÁÎÎÑ " #: rc.c:315 msgid "Inserting spaces when tab key is hit" msgstr "÷ÓÔÁ×ËÁ ÐÒÏÂ¦Ì¦× ÐÒÉ ÎÁÔÉÓËÁÎΦ Tab" #: rc.c:315 msgid "Inserting tabs when tab key is hit" msgstr "÷ÓÔÁ×ËÁ ÔÁÂÕÌÑÔÏÒ¦× ÐÒÉ ÎÁÔÉÓËÁÎΦ Tab" #: rc.c:315 #, fuzzy msgid " No tabs " msgstr " âÅÚ ÔÁÂ¦× " #: rc.c:316 msgid "Cursor will be recentered on scrolls" msgstr "ëÕÒÓÏÒ ÂÕÄÅ ÃÅÎÔÒÕ×ÁÔÉÓÑ ÐÒÉ ÓËÒÏÌ̦" #: rc.c:316 msgid "Cursor will not be recentered on scroll" msgstr "ëÕÒÓÏÒ ÎÅ ÂÕÄÅ ÃÅÎÔÒÕ×ÁÔÉÓÑ ÐÒÉ ÓËÒÏÌ̦" #: rc.c:316 #, fuzzy msgid "C Center on scroll " msgstr "C ãÅÎÔÒ ÐÒÉ ÓËÒÏÌ̦ " #: rc.c:317 msgid "Automatically detect MS-DOS files" msgstr "æÁÊÌÉ MS-DOS ÂÕÄÕÔØ Á×ÔÏ×ÉÚÎÁÞÕ×ÁÔÉÓØ" #: rc.c:317 msgid "Do not automatically detect MS-DOS files" msgstr "æÁÊÌÉ MS-DOS ÎÅ ÂÕÄÕÔØ Á×ÔÏ×ÉÚÎÁÞÕ×ÁÔÉÓØ" #: rc.c:317 msgid " Auto detect CR-LF " msgstr " á×ÔÏ×ÉÚÎÁÞÅÎÎÑ CR-LF " #: rc.c:318 msgid "Automatically detect indentation" msgstr "óÉÍ×ÏÌÉ ×¦ÄÓÔÕÐ¦× ÂÕÄÕÔØ Á×ÔÏ×ÉÚÎÁÞÕ×ÁÔÉÓØ" #: rc.c:318 msgid "Do not automatically detect indentation" msgstr "óÉÍ×ÏÌÉ ×¦ÄÓÔÕÐ¦× ÎÅ ÂÕÄÕÔØ Á×ÔÏ×ÉÚÎÁÞÕ×ÁÔÉÓØ" #: rc.c:318 msgid " Guess indent " msgstr " ÷ÇÁÄÕ×ÁÔÉ ×¦ÄÓÔÕÐ " #: rc.c:319 #, fuzzy msgid "Automatically detect non-UTF-8 in UTF-8 locale" msgstr "îÅ-UTF-8 ËÏÄÕ×ÁÎÎÑ × ÌÏËÁ̦ UTF-8 ÂÕÄÕÔØ Á×ÔÏ×ÉÚÎÁÞÕ×ÁÔÉÓØ" #: rc.c:319 #, fuzzy msgid "Do not automatically detect non-UTF-8" msgstr "îÅ-UTF-8 ËÏÄÕ×ÁÎÎÑ × ÌÏËÁ̦ UTF-8 ÎÅ ÂÕÄÕÔØ Á×ÔÏ×ÉÚÎÁÞÕ×ÁÔÉÓØ" #: rc.c:319 #, fuzzy msgid " Guess non-UTF-8 " msgstr " ÷ÇÁÄÕ×ÁÔÉ ÎÅ-UTF-8 " #: rc.c:320 #, fuzzy msgid "Automatically detect UTF-8 in non-UTF-8 locale" msgstr "ëÏÄÕ×ÁÎÎÑ UTF-8 × ÎÅ-UTF-8 ÌÏËÁ̦ ÂÕÄÅ Á×ÔÏ×ÉÚÎÁÞÕ×ÁÔÉÓØ" #: rc.c:320 #, fuzzy msgid "Do not automatically detect UTF-8" msgstr "ëÏÄÕ×ÁÎÎÑ UTF-8 ÎÅ ÂÕÄÅ Á×ÔÏ×ÉÚÎÁÞÕ×ÁÔÉÓØ" #: rc.c:320 #, fuzzy msgid " Guess UTF-8 " msgstr " ÷ÇÁÄÕ×ÁÔÉ UTF-8 " #: rc.c:321 msgid "Menu is transposed" msgstr "íÅÎÀ ÐÅÒÅÎÏÓÉÍÅ" #: rc.c:321 msgid "Menus are not transposed" msgstr "íÅÎÀ ÎÅÐÅÒÅÎÏÓÉÍÅ" #: rc.c:321 msgid " Transpose menus " msgstr " ðÅÒÅÎÏÓÉͦÓÔØ ÍÅÎÀ " #: rc.c:322 msgid "CR-LF is line terminator" msgstr "ë¦ÎÅÃØ ÓÔÒÏËÉ CR-LF" #: rc.c:322 msgid "LF is line terminator" msgstr "ë¦ÎÅà ÓÔÒÏËÉ LF" #: rc.c:322 msgid "Z CR-LF (MS-DOS) " msgstr "" #: rc.c:323 msgid "Line numbers enabled" msgstr "îÕÍÅÒÁæÀ ÓÔÒÏË ×ËÌÀÞÅÎÏ" #: rc.c:323 msgid "Line numbers disabled" msgstr "îÕÍÅÒÁæÀ ÓÔÒÏË ×ÉÍËÎÅÎÏ" #: rc.c:323 msgid "N Line numbers " msgstr "N îÏÍÅÒÁ ÓÔÒÏË " #: rc.c:324 msgid "Anchored block marking on" msgstr "úÁÑËÏÒÅÎÁ צÄͦÔËÁ ÂÌÏËÁ ×ËÌ." #: rc.c:324 msgid "Anchored block marking off" msgstr "úÁÑËÏÒÅÎÁ צÄͦÔËÁ ÂÌÏËÁ ×ÉÍË." #: rc.c:324 #, fuzzy msgid " Marking " msgstr " ÷¦ÄͦÔËÁ " #: rc.c:325 msgid "Characters above 127 shown as-is" msgstr "8-ÂÉÔΦ ÓÉÍ×ÏÌÉ ÐÏËÁÚÕÀÔØÓÑ ÑË ¤" #: rc.c:325 msgid "Characters above 127 shown in inverse" msgstr "8-ÂÉÔΦ ÓÉÍ×ÏÌÉ ÐÏËÁÚÕÀÔÓÑ × ¦Î×ÅÒÓ¦§" #: rc.c:325 msgid " Meta chars as-is " msgstr " 8-¦ÔΦ ÓÉÍ×ÏÌÉ " #: rc.c:326 msgid "Last line forced to have NL when file saved" msgstr "÷ ˦Îæ ÆÁÊÌÁ ÂÕÄÅ ÄÏÄÁ×ÁÔÉÓÑ ÐÅÒÅ×ÅÄÅÎÎÑ ÓÔÒÏËÉ ÐÒÉ ÚÂÅÒÅÖÅÎΦ" #: rc.c:326 msgid "Last line not forced to have NL" msgstr "îÅ ÂÕÄÅ ÆÏÒÓÕ×ÁÔÉÓÑ ÄÏÄÁ×ÁÎÎÑ ÐÅÒÅ×ÅÄÅÎÎÑ ÓÔÒÏËÉ × ËÏÎæ ÆÁÊÌÁ" #: rc.c:326 #, fuzzy msgid " Force last NL " msgstr "F ïÓÔÁÎÎ¦Ê LF " #: rc.c:327 msgid "~/.joe_state file will be updated" msgstr "æÁÊÌ ~/.joe_state ÂÕÄÅ ÚͦÎÀ×ÁÔÉÓØ" #: rc.c:327 msgid "~/.joe_state file will not be updated" msgstr "æÁÊÌ ~/.joe_state îå ÂÕÄÅ ÚͦÎÀ×ÁÔÉÓØ" #: rc.c:327 msgid " Joe_state file " msgstr " æÁÊÌ joe_state " #: rc.c:328 msgid "Backup files will not be made" msgstr "òÅÚÅÒ×Φ ÆÁÊÌÉ ÎÅ ÂÕÄÕÔØ ÓÔ×ÏÒÀ×ÁÔÉÓÑ" #: rc.c:328 msgid "Backup files will be made" msgstr "òÅÚÅÒ×Φ ÆÁÊÌÉ ÂÕÄÕÔØ ÓÔ×ÏÒÀ×ÁÔÉÓÑ" #: rc.c:328 msgid " Disable backups " msgstr " úÁÂÏÒÏÎÁ ÒÅÚÅÒ×-Ñ " #: rc.c:329 msgid "Files will not be locked" msgstr "æÁÊÌÉ ÎÅ ÂÕÄÕÔØ ÂÌÏËÕ×ÁÔÉÓÑ" #: rc.c:329 msgid "Files will be locked" msgstr "æÁÊÌÉ ÂÕÄÕÔØ ÂÌÏËÕ×ÁÔØÓÑ" #: rc.c:329 msgid " Disable locks " msgstr " úÁÂÏÒÏÎÁ ÂÌÏË. " #: rc.c:330 #, fuzzy msgid "No file modification time check" msgstr "îÅ ÂÕÄÅ ÐÅÒÅצÒÑÔÉÓÑ ÞÁÓ ÍÏÄÉÆ¦ËÁæ§ ÆÁÊÌÁ" #: rc.c:330 #, fuzzy msgid "File modification time checking enabled" msgstr "ðÅÒÅצÒÑ¤ÔØÓÑ ÞÁÓ ÍÏÄÉÆ¦ËÁæ§ ÆÁÊÌÁ" #: rc.c:330 msgid " Disable mtime check " msgstr " úÁÂÏÒÏÎÁ ËÏÎÔÒÏÌÑ mtime " #: rc.c:331 msgid "No current dir" msgstr "âÅÚ ÐÏÔÏÞÎϧ ÄÉÒÅËÔÏÒ¦§" #: rc.c:331 msgid "Current dir enabled" msgstr "ðÏÔÏÞÎÁ ÄÉÒÅËÔÏÒ¦Ñ ×ËÌÀÞÅÎÁ" #: rc.c:331 msgid " Disable current dir " msgstr " úÁÂÏÒÏÎÁ ÐÏÔÏÞ. ÄÉÒÅËÔÏÒ¦§ " #: rc.c:332 msgid "Hardlinks will be broken" msgstr "öÏÒÓÔ˦ ÐÏÓÉÌÁÎÎÑ ÂÕÄÕÔØ ÒÏÚÒÉ×ÁÔÉÓÑ" #: rc.c:332 msgid "Hardlinks not broken" msgstr "öÏÒÓÔ˦ ÐÏÓÉÌÁÎÎÑ ÎÅ ÂÕÄÕÔØ ÒÏÚÒÉ×ÁÔÉÓÑ" #: rc.c:332 msgid " Break hard links " msgstr " òÏÚÒÉ× ÖÏÒÓÔ.ÐÏÓ. " #: rc.c:333 msgid "Highlighting turned off after block operations" msgstr "÷¦ÄͦÔËÁ ÂÌÏËÁ ×ÉÍÉËÁ¤ÔØÓÑ Ð¦ÓÌÑ ÏÐÅÒÁæ§" #: rc.c:333 msgid "Highlighting not turned off after block operations" msgstr "÷¦ÄͦÔËÁ ÂÌÏËÁ ÎÅ ×ÉÍÉËÁ¤ÔØÓÑ Ð¦ÓÌÑ ÏÐÅÒÁæ§" #: rc.c:333 #, fuzzy msgid " Auto unmark " msgstr "A×ÔÏäÅíÁÒË " #: rc.c:334 msgid "Prompt for filename in save & exit command" msgstr "úÁÐÉÔ ¦ÍÅΦ ÆÁÊÌÁ ÐÒÉ ×ÙÈÏĦ Ú¦ ÚÂÅÒÅÖÅÎÎÑÍ" #: rc.c:334 msgid "Don't prompt for filename in save & exit command" msgstr "îÅ ÚÁÐÉÔÕ×ÁÔÉ ÉÍ'Ñ ÆÁÊÌÁ ÐÒÉ ×ÙÈÏĦ Ú¦ ÚÂÅÒÅÖÅÎÎÑÍ" #: rc.c:334 msgid " Exit ask " msgstr " ÷ÉÈ¦Ä Ú ÚÁÐÉÔÏÍ " #: rc.c:335 msgid "Warning bell enabled" msgstr "äÚצÎÏË ÄÏÚ×ÏÌÅÎÉÊ" #: rc.c:335 msgid "Warning bell disabled" msgstr "äÚצÎÏË ÚÁÂÏÒÏÎÅÎÏ" #: rc.c:335 #, fuzzy msgid "B Beeps " msgstr "B äÚצÎÏË " #: rc.c:336 msgid "Top-most status line disabled" msgstr "óÔÒÏËÕ ÓÔÁÔÕÓÁ ×ÉÍËÎÅÎÏ" #: rc.c:336 msgid "Top-most status line enabled" msgstr "óÔÒÏËÕ ÓÔÁÔÕÓÁ ×ËÌÀÞÅÎÏ" #: rc.c:336 msgid " Disable status line " msgstr " úÁÂÏÒÏÎÁ ÓÔÒÏËÉ ÓÔÁÔ. " #: rc.c:337 msgid "Status line updated constantly" msgstr "óÔÒÏËÁ ÓÔÁÔÕÓÁ ÚͦÎÀ¤ÔØÓÑ ÂÅÚÐÅÒÅÒ×ÎÏ" #: rc.c:337 msgid "Status line updated once/sec" msgstr "óÔÒÏËÁ ÓÔÁÔÕÓÁ ÚͦÎÀ¤ÔØÓÑ ÒÁÚ ÎÁ ÓÅËÕÎÄÕ" #: rc.c:337 msgid " Fast status line " msgstr " û×ÉÄËÁ ÓÔÒÏËÁ ÓÔÁÔÕÓÁ " #: rc.c:338 #, c-format msgid "Lines to keep for PgUp/PgDn or -1 for 1/2 window (%d): " msgstr "óË. ÓÔÒÏË ÚÁÌÉÛÁÔÉ ÄÌÑ PgUp/PgDn ÁÂÏ -1 ÄÌÑ 1/2 צËÎÁ (%d): " #: rc.c:338 msgid " No. PgUp/PgDn lines " msgstr " ë¦ÌØË. ÓÔÒÏË PgUp/PgDn " #: rc.c:339 msgid "Start search after a search repeats previous search" msgstr "ðÏÛÕË ÐÒÏÄÏ×ÖÕ¤ÔØÓÑ Ú ÐÏÐÅÒÅÄÎ¦Í ÚÒÁÚËÏÍ" #: rc.c:339 msgid "Start search always starts a new search" msgstr "úÁ×ÖÄÉ ÚÁÐÉÔÕ×ÁÔÉ ÎÏ×ÉÊ ÚÒÁÚÏË ÐÏÛÕËÕ" #: rc.c:339 #, fuzzy msgid " Continued search " msgstr " ðÒÏÄÏ×ÖÅÎÎÑ ÐÏÛÕËÁ " #: rc.c:340 msgid "Full editing" msgstr "úͦÎÉ ÄÏÚ×ÏÌÅÎÏ" #: rc.c:340 msgid "O Read only " msgstr "O ô¦ÌØËÉþÔÎ " #: rc.c:341 msgid "Smart home key enabled" msgstr "òÏÚÕÍÎÁ ÐÏ×ÅĦÎËÁ ËÌÁצÛÉ Home ÄÏÚ×ÏÌÅÎÁ" #: rc.c:341 msgid "Smart home key disabled" msgstr "òÏÚÕÍÎÁ ÐÏ×ÅĦÎËÁ ËÌÁצÛÉ Home ÚÁÂÏÒÏÎÅÎÁ" #: rc.c:341 msgid " Smart home key " msgstr " òÏÚÕÍÎÉÊ Home " #: rc.c:342 #, fuzzy msgid "Smart home goes to indentation first" msgstr "òÏÚÕÍÎÉÊ Home ÐÅÒÅÈÏÄÉÔØ ÎÁ ÐÅÒÛÉÊ ÓÉÍ×ÏÌ" #: rc.c:342 msgid "Smart home goes home first" msgstr "òÏÚÕÍÎÉÊ Home ÐÅÒÅÈÏÄÉÔØ ÎÁ ÐÏÞÁÔÏË ÓÔÒÏËÉ" #: rc.c:342 msgid " To indent first " msgstr " îÁ ÐÅÒÛÉÊ ÓÉÍ×ÏÌ " #: rc.c:343 msgid "Smart backspace key enabled" msgstr "òÏÚÕÍÎÁ ÐÏ×ÅĦÎËÁ ËÌÁצÛÉ BS ÄÏÚ×ÏÌÅÎÁ" #: rc.c:343 msgid "Smart backspace key disabled" msgstr "òÏÚÕÍÎÁ ÐÏ×ÅĦÎËÁ ËÌÁצÛÉ BS ÚÁÂÏÒÏÎÅÎÁ" #: rc.c:343 msgid " Smart backspace " msgstr " òÏÚÕÍÎÉÊ BS " #: rc.c:344 msgid "Indentation clean up enabled" msgstr "÷ÉÐÒÁ×ÌÅÎÎÑ ×¦ÄÓÔÕÐ¦× ÄÏÚ×ÏÌÅÎÏ" #: rc.c:344 msgid "Indentation clean up disabled" msgstr "÷ÉÐÒÁ×ÌÅÎÎÑ ×¦ÄÓÔÕÐ¦× ÚÁÂÏÒÏÎÅÎÅ" #: rc.c:344 msgid " Clean up indents " msgstr " ÷ÉÐÒÁ×ÌÅÎÎÑ ×¦ÄÓÔÕÐ¦× " #: rc.c:345 msgid "Picture drawing mode enabled" msgstr "òÅÖÉÍ ÍÁÌÀ×ÁÎÎÑ ÄÏÚ×ÏÌÅÎÉÊ" #: rc.c:345 msgid "Picture drawing mode disabled" msgstr "òÅÖÉÍ ÍÁÌÀ×ÁÎÎÑ ÚÁÂÏÒÏÎÅÎÉÊ" #: rc.c:345 #, fuzzy msgid "P Picture mode " msgstr "òÅÖÉÍ ÍÁÌÀ×ÁÎÎÑ " #: rc.c:346 #, c-format msgid "Backup files stored in (%s): " msgstr "òÅÚÅÒ×Φ ÆÁÊÌÉ ÚÂÅÒ¦ÇÁÀÔØÓÑ × (%s): " #: rc.c:346 msgid " Path to backup files " msgstr " ûÌÑÈ ÄÏ ÒÅÚÅÒ×ÎÉÈ ÆÁÊÌ¦× " #: rc.c:347 msgid "Select syntax (^C to abort): " msgstr "÷ÉÂÅÒ¦ÔØ ÓÉÎÔÁËÓÉÓ (^C ÄÌÑ ×¦ÄͦÎÉ)" #: rc.c:347 msgid "Y Syntax" msgstr "Y óÉÎÔÁËÓÉÓ" #: rc.c:348 msgid "Select file character set (^C to abort): " msgstr "÷ËÁÖ¦ÔØ ÆÁÊÌ ËÏÄÏ×ÏÇÏ ÎÁÂÏÒÁ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: rc.c:348 #, fuzzy msgid "E Encoding " msgstr "ëÏÄÕ×ÁÎÎÑ " #: rc.c:349 msgid "Single quoting enabled" msgstr "ïÄÉÎÏÞΦ ÌÁÐËÉ ×ÒÁÈÏ×ÕÀÔØÓÑ" #: rc.c:349 msgid "Single quoting disabled" msgstr "ïÄÉÎÏÞΦ ÌÁÐËÉ ÎÅ ×ÒÁÈÏ×ÕÀÔØÓÑ" #: rc.c:349 #, fuzzy msgid " ^G ignores '... ' " msgstr " ^G ¦ÇÎÏÒ. '...' " #: rc.c:350 msgid "/* comments enabled" msgstr "/* ËÏÍÍÅÎÔÁÒ¦ ×ÒÁÈÏ×ÕÀÔØÓÑ" #: rc.c:350 msgid "/* comments disabled" msgstr "/* ËÏÍÍÅÎÔÁÒÉÉ ÎÅ ×ÒÁÈÏ×ÕÀÔØÓÑ" #: rc.c:350 #, fuzzy msgid " ^G ignores /*...*/ " msgstr " ^G ÉÇÎÏÒ. /*...*/ " #: rc.c:351 msgid "// comments enabled" msgstr "// ËÏÍÍÅÎÔÁÒ¦ ×ÒÁÈÏ×ÕÀÔØÓÑ" #: rc.c:351 msgid "// comments disabled" msgstr "// ËÏÍÍÅÎÔÁÒ¦ ÎÅ ×ÒÁÈÏ×ÕÀÔØÓÑ" #: rc.c:351 #, fuzzy msgid " ^G ignores //... " msgstr " ^G ÉÇÎÏÒ. //... " #: rc.c:352 msgid "# comments enabled" msgstr "# ËÏÍÍÅÎÔÁÒ¦ ×ÒÁÈÏ×ÕÀÔØÓÑ" #: rc.c:352 msgid "# comments disabled" msgstr "# ËÏÍÍÅÎÔÁÒ¦ ÎÅ ×ÒÁÈÏ×ÕÀÔØÓÑ" #: rc.c:352 #, fuzzy msgid " ^G ignores #... " msgstr " ^G ÉÇÎÏÒ. #... " #: rc.c:353 msgid "-- comments enabled" msgstr "-- ËÏÍÍÅÎÔÁÒ¦ ×ÒÁÈÏ×ÕÀÔØÓÑ" #: rc.c:353 msgid "-- comments disabled" msgstr "-- ËÏÍÍÅÎÔÁÒ¦ ÎÅ ×ÒÁÈÏ×ÕÀÔØÓÑ" #: rc.c:353 #, fuzzy msgid " ^G ignores --... " msgstr " ^G ÉÇÎÏÒ. --... " #: rc.c:354 msgid "; comments enabled" msgstr "; ËÏÍÍÅÎÔÁÒ¦ ×ÒÁÈÏ×ÕÀÔØÓÑ" #: rc.c:354 msgid "; comments disabled" msgstr "; ËÏÍÍÅÎÔÁÒ¦ ÎÅ ×ÒÁÈÏ×ÕÀÔØÓÑ" #: rc.c:354 #, fuzzy msgid " ^G ignores ;... " msgstr " ^G ÉÇÎÏÒ. ;... " #: rc.c:355 #, c-format msgid "Text delimiters (%s): " msgstr "ïÂÍÅÖÕ×ÁÞ¦ ÔÅËÓÔÁ (%s): " #: rc.c:355 msgid " Text delimiters " msgstr " ïÂÍÅÖÕ×ÁÞ¦ ÔÅËÓÔÁ " #: rc.c:356 #, c-format msgid "Language (%s): " msgstr "íÏ×Á (%s): " #: rc.c:356 msgid "V Language " msgstr "V íÏ×Á " #: rc.c:357 #, c-format msgid "Characters which can indent paragraphs (%s): " msgstr "óÉÍ×ÏÌÉ, ÑËÉÍÉ ÍÏÖÅ ÐÏÞÉÎÁÔÉÓÑ ÁÂÚÁà (%s): " #: rc.c:357 #, fuzzy msgid " Paragraph indent chars " msgstr " óÉÍ×ÏÌ ×ÉÒ¦×ÎÀ×ÁÎÎÑ " #: rc.c:358 msgid "Clicking can move the cursor past end of line" msgstr "íÉÛÅÀ ÍÏÖÎÁ ÐÅÒÅÎÅÓÔÉ ËÕÒÓÏÒ ÚÁ ˦ÎÅÃØ ÓÔÒÏËÉ" #: rc.c:358 msgid "Clicking past end of line moves cursor to the end" msgstr "ëÌÉË ÚÁ ËÏÎÃÅÍ ÓÔÒÏËÉ ÐÅÒÅÎÅÓÅ ËÕÒÓÏÒ × §§ ˦ÎÅÃØ" #: rc.c:358 msgid " Click past end " msgstr " ëÌÉË ÚÁ ÓÔÒÏËÏÀ " #: rc.c:359 msgid "Mouse action is done with the right button" msgstr "ä¦Ñ ÍÉÛ¦ ÁËÔÉ×Õ¤ÔØÓÑ ÐÒÁ×ÏÀ ËÎÏÐËÏÀ" #: rc.c:359 msgid "Mouse action is done with the left button" msgstr "ä¦Ñ ÍÉÛ¦ ÁËÔÉ×Õ¤ÔØÓÑ Ì¦×ÏÀ ËÎÏÐËÏÀ" #: rc.c:359 msgid " Right button " msgstr " ðÒÁ×Á ËÎÏÐËÁ " #: rc.c:669 rc.c:688 rc.c:700 msgid "Value out of range" msgstr "úÎÁÞÅÎÎÑ ÐÏÚÁ ÄÉÁÐÁÚÏÎÏÍ" #: rc.c:724 msgid "Syntax definition file not found" msgstr "æÁÊÌ ×ÉÚÎÁÞÅÎÎÑ ÓÉÎÔÁËÓÉÓÁ ÎÅ ÚÎÁÊÄÅÎÏ" #: rc.c:799 #, c-format msgid "%s encoding assumed for this file" msgstr "÷×ÁÖÁ¤ÔØÓÑ, ÝÏ ÆÁÊÌ Õ ËÏÄÕ×ÁÎΦ %s" #: rc.c:802 msgid "Character set not found" msgstr "ëÏÄÕ×ÁÎÎÑ ÎÅצÄÏÍÅ" #: rc.c:1010 #, c-format msgid "Processing '%s'..." msgstr "ïÂÒÏÂËÁ '%s'..." #: rc.c:1066 #, c-format msgid "" "\n" "%s %d: Unknown option %s" msgstr "" "\n" "%s %d: îÅצÄÏÍÁ ÏÐÃ¦Ñ %s" #: rc.c:1099 #, c-format msgid "" "\n" "%s %d: macro missing from :def" msgstr "" "\n" "%s %d: ÍÁËÒÏ ×¦ÄÓÕÔΤ ×¦Ä :def" #: rc.c:1103 #, c-format msgid "" "\n" "%s %d: command name missing from :def" msgstr "" "\n" "%s %d: ¦Í'Ñ ËÏÍÁÎÄ٠צÄÓÕÔΤ ×¦Ä :def" #: rc.c:1114 #, c-format msgid "" "\n" "%s %d: context name missing from :inherit" msgstr "" "\n" "%s %d: ÎÁÊÍÅÎÕ×ÁÎÎÑ ËÏÎÔÅËÓÔÁ צÄÓÕÔΤ ×¦Ä :inherit" #: rc.c:1118 #, c-format msgid "" "\n" "%s %d: No context selected for :inherit" msgstr "" "\n" "%s %d: îÅ ×ÙÂÒÁÎÉÊ ËÏÎÔÅËÓÔ ÄÌÑ :inherit" #: rc.c:1146 #, c-format msgid "" "\n" "%s %d: Couldn't open %s" msgstr "" "\n" "%s %d: îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ %s" #: rc.c:1154 #, c-format msgid "" "\n" "%s %d: :include missing file name" msgstr "" "\n" "%s %d: :include ÂÅÚ ¦ÍÅΦ ÆÁÊÌÁ" #: rc.c:1167 #, c-format msgid "" "\n" "%s %d: No context selected for :delete" msgstr "" "\n" "%s %d: îÅ ×ÙÂÒÁÎÉÊ ËÏÎÔÅËÓÔ ÄÌÑ :delete" #: rc.c:1174 #, c-format msgid "" "\n" "%s %d: Invalid context name" msgstr "" "\n" "%s %d: îÅÐÒÉÐÕÓÔÉÍÅ ¦Í'Ñ ËÏÎÔÅËÓÔÁ" #: rc.c:1185 #, c-format msgid "" "\n" "%s %d: No context selected for macro to key-sequence binding" msgstr "" "\n" "%s %d: îÅ ×ÙÂÒÁÎÉÊ ËÏÎÔÅËÓÔ ÄÌÑ ÍÁËÒÏ ÒÏÚËÌÁÄËÉ ËÌÁצÁÔÕÒÉ" #: rc.c:1194 #, c-format msgid "" "\n" "%s %d: Unknown command in macro" msgstr "" "\n" "%s %d: îÅצÄÏÍÁ ËÏÍÁÎÄÁ × ÍÁËÒÏ" #: rc.c:1210 #, c-format msgid "" "\n" "%s %d: Bad key sequence '%s'" msgstr "" "\n" "%s %d: îÅÐÒÉÐÕÓÔÉÍÁ ÐÏÓ̦ÄÏ×ΦÓÔØ ËÌÁ×¦Û '%s'" #: rc.c:1221 msgid "" "\n" "done\n" msgstr "" "\n" "ÚÒÏÂÌÅÎÏ\n" #: rc.c:1223 msgid "done\n" msgstr "ÚÒÏÂÌÅÎÏ\n" #: scrn.c:720 msgid "" "Sorry, your terminal can't do absolute cursor positioning.\n" "It's broken\n" msgstr "" "÷ÉÂÁÞÔÅ, ×ÁÛ ÔÅÒͦÎÁÌ ÎÅ ×ͦ¤ ÐÏÚÉæÏÎÕ×ÁÔÉ ËÕÒÓÏÒ.\n" "÷ÉËÉÎØÔÅ ÊÏÇÏ\n" #: selinux.c:35 selinux.c:84 selinux.c:141 #, c-format msgid "Could not get security context for %s" msgstr "îÅ ÍÏÖÕ ÏÔÒÉÍÁÔÉ ËÏÎÔÅËÓÔ ÓÅËÒÅÔÎÏÓÔ¦ ÄÌÑ %s" #: selinux.c:41 msgid "" "\n" "Could not get security context for " msgstr "" "\n" "îÅ ÍÏÖÕ ÏÔÒÉÍÁÔÉ ËÏÎÔÅËÓÔ ÓÅËÒÅÔÎÏÓÔ¦ ÄÌÑ " #: selinux.c:51 #, c-format msgid "Could not set security context for %s" msgstr "îÅ ÍÏÖÕ ×ÓÔÁÎÏ×ÉÔÉ ËÏÎÔÅËÓÔ ÓÅËÒÅÔÎÏÓÔ¦ ÄÌÑ %s" #: selinux.c:91 #, c-format msgid "Could not set default security context for %s" msgstr "îÅ ÍÏÖÕ ×ÓÔÁÎÏ×ÉÔÉ ËÏÎÔÅËÓÔ ÓÅËÒÅÔÎÏÓÔ¦ ÚÁ ÕÍÏ×ÞÁÎÎÑÍ ÄÌÑ %s" #: selinux.c:113 msgid "Could not reset default security context" msgstr "îÅ ÍÏÖÕ ÓËÉÎÕÔÉ ËÏÎÔÅËÓÔ ÓÅËÒÅÔÎÏÓÔ¦ ÚÁ ÕÍÏ×ÞÁÎÎÑÍ" #: selinux.c:146 #, c-format msgid "%s Security Context %s" msgstr "%s ëÏÎÔÅËÓÔ óÅËÒÅÔ. %s" #: syntax.c:259 #, c-format msgid "%s %d: Class already defined\n" msgstr "%s %d: ëÌÁÓÓ ×ÖÅ ×ÉÚÎÁÞÅÎÉÊ\n" #: syntax.c:339 #, fuzzy, c-format msgid "%s %d: Missing )\n" msgstr "%s %d: ÷¦ÄÓÕÔÎÑ )\n" #: syntax.c:411 #, fuzzy, c-format msgid "%s %d: missing parameter for ifdef\n" msgstr "%s %d: ÷¦ÄÓÕÔÎÙÊ ÐÁÒÁÍÅÔÒ ÄÌÑ ifdef\n" #: syntax.c:421 #, c-format msgid "%s %d: else with no matching if\n" msgstr "%s %d: else ÂÅÚ ÐÁÒÎÏÇÏ if\n" #: syntax.c:428 #, c-format msgid "%s %d: endif with no matching if\n" msgstr "%s %d: endif ÂÅÚ ÐÁÒÎÏÇÏ if\n" #: syntax.c:432 syntax.c:560 #, fuzzy, c-format msgid "%s %d: Missing subroutine name\n" msgstr "%s %d: ÷¦ÄÓÕÔΤ ¦Í'Ñ Ð¦ÄÐÒÏÇÒÁÍÉ\n" #: syntax.c:447 #, fuzzy, c-format msgid "%s %d: Unknown control statement\n" msgstr "%s %d: îÅצÄÏÍÉÊ ÕÐÒÁ×ÌÑÀÞÉÊ ÏÐÅÒÁÔÏÒ\n" #: syntax.c:450 #, fuzzy, c-format msgid "%s %d: Missing control statement name\n" msgstr "%s %d: ÷¦ÄÓÕÔΤ ¦Í'Ñ ÕÐÒÁ×ÌÑÀÞÏÇÏ ÏÐÅÒÁÔÏÒÁ\n" #: syntax.c:477 #, c-format msgid "%s %d: Unknown class\n" msgstr "%s %d: îÅצÄÏÍÉÊ ËÌÁÓ\n" #: syntax.c:480 #, c-format msgid "%s %d: Missing color for state definition\n" msgstr "%s %d: ÷¦ÄÓÕÔÎ¦Ê ËÏÌ¦Ò ÄÌÑ ×ÉÚÎÁÞÅÎÎÑ ÓÔÁÎÕ\n" #: syntax.c:482 syntax.c:610 #, c-format msgid "%s %d: Missing state name\n" msgstr "%s %d: ÷¦ÄÓÕÔΤ ¦Í'Ñ ÓÔÁÎÕ\n" #: syntax.c:503 #, c-format msgid "%s %d: Bad string\n" msgstr "%s %d: îÅÐÒÉÐÕÓÔÉÍÁ ÓÔÒÏËÁ\n" #: syntax.c:543 syntax.c:545 syntax.c:554 syntax.c:568 syntax.c:604 #: syntax.c:606 #, c-format msgid "%s %d: Missing value for option\n" msgstr "%s %d: ÷¦ÄÓÕÔΤ ÚÎÁÞÅÎÎÑ ÄÌÑ ÏÐæ§\n" #: syntax.c:608 syntax.c:624 #, c-format msgid "%s %d: Unknown option\n" msgstr "%s %d: îÅצÄÏÍÁ ÏÐæÑ\n" #: syntax.c:612 #, c-format msgid "%s %d: Missing string\n" msgstr "%s %d: ÷¦ÄÓÕÔÎÑ ÓÔÒÏËÁ\n" #: syntax.c:633 #, c-format msgid "%s %d: Missing jump\n" msgstr "%s %d: ÷¦ÄÓÕÔÎ¦Ê ÐÅÒÅȦÄ\n" #: syntax.c:635 #, c-format msgid "%s %d: No state\n" msgstr "%s %d: îÅÍÁ¤ ÓÔÁÎÕ\n" #: syntax.c:637 #, c-format msgid "%s %d: Unknown character\n" msgstr "%s %d: îÅצÄÏÍÉÊ ÓÉÍ×ÏÌ\n" #: syntax.c:644 #, c-format msgid "%s %d: ifdef with no matching endif\n" msgstr "%s %d: ifdef ÂÅÚ ÐÁÒÎÏÇÏ endif\n" #: tab.c:212 tab.c:271 msgid "Couldn't read directory " msgstr "îÅ ÍÏÖÕ ÐÒÏÞÉÔÁÔÉ ÄÉÒÅËÔÏÒ¦À" #: termcap.c:219 msgid "Couldn't load termcap entry. Using ansi default\n" msgstr "îÅ ÍÏÖÕ ÐÒÏÞÉÔÁÔÉ ÏÐÉÓÁÎÎÑ termcap. ÷ÉËÏÒÉÓÔÏ×ÕÀ ANSI ÚÁ ÕÍÏ×ÞÁÎÎÑÍ\n" #: termcap.c:240 #, c-format msgid "%s is out of date\n" msgstr "%s ÕÓÔÁÒ¦×\n" #: tty.c:314 msgid "Couldn't open /dev/tty\n" msgstr "îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ /dev/tty\n" #: tty.c:731 msgid "You are at the command shell. Type 'exit' to return\n" msgstr "÷Ù × ËÏÍÁÎÄÎ¦Ê ÓÔÒÏæ. ÷×ÅÄ¦ÔØ 'exit' ÄÌÑ ÐÏ×ÅÒÎÅÎÎÑ\n" #: tty.c:795 msgid "You have suspended the program. Type 'fg' to return\n" msgstr "÷Ù ÐÒÉÚÕÐÉÎÉÌÉ ÐÒÏÇÒÁÍÕ. ÷×ÅÄ¦ÔØ 'fg' ÄÌÑ ÐÏ×ÅÒÎÅÎÎÑ\n" #: tty.c:1146 #, c-format msgid "Couldn't execute shell '%s'\n" msgstr "îÅ ÍÏÖÕ ×ÉËÏÎÁÔÉ ÛÅÌ '%s'\n" #: tw.c:213 msgid "Unnamed" msgstr "âÅÚ¶ÍÅΦ" #: tw.c:219 msgid "(Modified)" msgstr "(úͦÎÅÎÏ)" #: tw.c:223 msgid "(Read only)" msgstr "(ô¦ÌØËÉþÉÔÁÎÎÑ)" #: tw.c:329 msgid "*SHELL*" msgstr "" #: tw.c:333 #, c-format msgid "(Macro %d recording...)" msgstr "(úÁÐÉÓ ÍÁËÒÏ %d...)" #: tw.c:558 tw.c:584 ufile.c:1010 msgid "Lose changes to this file (y,n,^C)? " msgstr "÷¦ÄͦÎÉÔÉ ÚͦÎÅÎÎÑ ÆÁÊÌÁ (y,n,^C)? " #: ublock.c:284 msgid "Selection cleared." msgstr "÷¦ÄͦÔËÕ ÚÎÑÔÏ." #: ublock.c:292 ublock.c:309 msgid "Selection started." msgstr "ðÏÞÁÔÏË ×¦ÄͦÔËÉ." #: ublock.c:417 ublock.c:503 ublock.c:559 ublock.c:887 ublock.c:921 #: ublock.c:1083 ufile.c:435 umath.c:177 undo.c:455 msgid "No block" msgstr "îÅÍÁ¤ ÂÌÏËÁ" #: ublock.c:756 ublock.c:839 msgid "Selected lines not properly indented" msgstr "÷¦ÄͦÞÅΦ ÓÔÒÏËÉ ÍÁÀÔØ ÎÅצÒÎÉÊ ×¦ÄÓÔÕÐ" #: ublock.c:1067 ushell.c:86 msgid "Sorry, no sub-processes in DOS (yet)" msgstr "÷ÉÂÁÞÔÅ, ЦÄÐÒÏÃÅÓÙ × DOS ΊЦÄÔÒÉÍÕÀÔØÓÑ (ÐÏËÉ ÝÏ)" #: ublock.c:1072 msgid "Command to filter block through (^C to abort): " msgstr "ëÏÍÁÎÄÁ ÄÌÑ Æ¦ÌØÔÒÁæ§ ÂÌÏËÁ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: ublock.c:1077 msgid "Command to filter file through (^C to abort): " msgstr "ëÏÍÁÎÄÁ ÄÌÑ Æ¦ÌØÔÒÁæ§ ÆÁÊÌÁ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: uedit.c:1388 utag.c:73 msgid "Invalid line number" msgstr "îÅÐÒÉÐÕÓÔÉÍÉÊ ÎÏÍÅÒ ÓÔÒÏËÉ" #: uedit.c:1395 msgid "Go to line (^C to abort): " msgstr "îÏÍÅÒ ÓÔÒÏËÉ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: uedit.c:1424 msgid "Invalid column number" msgstr "îÅÐÒÉÐÕÓÔÉÍÉÊ ÎÏÍÅÒ ËÏÌÏÎËÉ" #: uedit.c:1431 msgid "Go to column (^C to abort): " msgstr "îÏÍÅÒ ËÏÌÏÎËÉ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: uedit.c:1460 msgid "Invalid byte number" msgstr "îÅÐÒÉÐÕÓÔÉÍÉÊ ÎÏÍÅÒ ÂÁÊÔÁ" #: uedit.c:1467 msgid "Go to byte (^C to abort): " msgstr "îÏÍÅÒ ÂÁÊÔÁ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: uedit.c:1911 msgid "Unicode (ISO-10646) character in hex (^C to abort): " msgstr "óÉÍ×ÏÌ Unicode (ISO-10646) × 16ÒÉÞÎÏÍÕ ×ÉĦ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: uedit.c:2036 msgid "Ctrl- (or 0-9 for dec. ascii, x for hex, or o for octal)" msgstr "Ctrl- (ÁÂÏ 0-9 ÄÌÑ ÄÅÓ. ËÏÄÁ, x - ÄÌÑ 16, ÉÌÉ o - ÄÌÑ 8)" #: uedit.c:2099 msgid "Quote" msgstr "áÐÏÓÔÒÏÆ" #: uedit.c:2166 #, c-format msgid "Mark %d set" msgstr "í¦ÔËÕ %d ×ÓÔÁÎÏ×ÌÅÎÏ" #: uedit.c:2180 msgid "Set mark (0-9):" msgstr "îÏÍÅÒ Í¦ÔËÉ (0-9):" #: uedit.c:2198 #, c-format msgid "Mark %d not set" msgstr "í¦ÔËÕ %d ÎÅ ×ÓÔÁÎÏ×ÌÅÎÏ" #: uedit.c:2211 msgid "Goto bookmark (0-9):" msgstr "ðÅÒÅÊÔÉ ÄÏ ÚÁËÌÁÄËÉ (0-9): " #: uedit.c:2243 usearch.c:995 utag.c:107 msgid "Not found" msgstr "îÅ ÚÎÁÊÄÅÎÏ" #: uedit.c:2259 #, fuzzy msgid "Forward to char: " msgstr "÷ÐÅÒÅÄ ÄÏ ÓÉÍ×ÏÌÁ: " #: uedit.c:2270 #, fuzzy msgid "Backward to char: " msgstr "îÁÚÁÄ ÄÏ ÓÉÍ×ÏÌÁ: " #: uedit.c:2290 #, fuzzy msgid "Message (^C to abort): " msgstr "ðÏצÄÏÍÌÅÎÎÑ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: uedit.c:2312 msgid "Insert (^C to abort): " msgstr "÷ÓÔÁ×ÉÔÉ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: uerror.c:330 uerror.c:344 #, fuzzy, c-format msgid "%d messages found" msgstr "%ld ÐÏצÄÏÍÌÅÎØ ÚÎÁÊÄÅÎÏ" #: uerror.c:332 uerror.c:346 msgid "No messages found" msgstr "öÏÄÎÏÇÏ ÐÏצÄÏÍÌÅÎÎÑ ÎÅ ÚÎÁÊÄÅÎÏ" #: uerror.c:377 #, fuzzy msgid "No messages" msgstr "îÅÍÁ¤ ÐÏצÄÏÍÌÅÎØ" #: uerror.c:432 uerror.c:443 msgid "No more errors" msgstr "â¦ÌØÛÅ ÎÅÍÁ¤ ÐÏÍÉÌÏË" #: ufile.c:39 msgid "(Unnamed)" msgstr "(âÅÚ¶ÍÅΦ)" #: ufile.c:44 ufile.c:51 #, c-format msgid "File %s saved" msgstr "æÁÊÌ %s ÚÂÅÒÅÖÅÎÉÊ" #: ufile.c:46 ufile.c:49 #, c-format msgid "File %s not saved" msgstr "æÁÊÌ %s ÎÅ ÚÂÅÒÅÖÅÎÏ" #: ufile.c:53 #, c-format msgid "File %s not changed so no update needed" msgstr "æÁÊÌ %s ÎÅ ÚͦÎÅÎÏ, Ô.Ñ. ÎÅ ÂÕÌÏ ÍÏÄÉÆ¦ËÁæÊ" #: ufile.c:67 msgid "Some files have not been saved." msgstr "äÅÑ˦ ÆÁÊÌÉ ÎÅ ÚÂÅÒÅÖÅΦ." #: ufile.c:69 msgid "All modified files have been saved." msgstr "÷Ó¦ ÍÏÄÉÆ¦ËÏ×ÁΦ ÆÁÊÌÉ ÚÂÅÒÅÖÅΦ." #: ufile.c:71 msgid "No modified files, so no updates needed." msgstr "öÏÄÅÎ ÆÁÊÌ ÎÅ ÍÏÄÉÆ¦ËÕ×Á×ÓÑ, ÚͦÎÀ×ÁÔÉ Î¦ÞÏÇÏ." #: ufile.c:107 msgid "System (^C to abort): " msgstr "óÉÓÔÅÍÁ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: ufile.c:273 msgid "|yes|yY" msgstr "|yes|yYÎî" #: ufile.c:274 msgid "|no|nN" msgstr "|no|nNÔô" #: ufile.c:309 msgid "Couldn't make backup file... file not saved" msgstr "îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ ÒÅÚÅÒ×ÎÉÊ ÆÁÊÌ... ÆÁÊÌ ÎÅ ÚÂÅÒÅÖÅÎÉÊ" #: ufile.c:321 msgid "Could not make backup file. Save anyway (y,n,^C)? " msgstr "îÅ ÍÏÇÕ ÓÔ×ÏÒÉÔÉ ÒÅÚÅÒ×ÎÙÊ ÆÁÊÌ. úÂÅÒ¦ÇÁÔÉ ×ÓÅ Ò¦×ÎÏ (y,n,^C)? " #: ufile.c:409 ufile.c:425 #, c-format msgid "Block written to file %s" msgstr "âÌÏË ÚÁÐÉÓÁÎÉÊ × ÆÁÊÌ %s" #: ufile.c:488 msgid "File exists. Overwrite (y,n,^C)? " msgstr "æÁÊÌ ¦ÓÎÕ¤. ðÅÒÅÚÁÐÉÓÕ×ÁÔÉ (y,n,^C)? " #: ufile.c:495 msgid "File on disk is newer. Overwrite (y,n,^C)? " msgstr "æÁÊÌ ÎÁ ÄÉÓËÕ - ÎÏצÝÉÊ. ðÅÒÅÚÁÐÉÓÕ×ÁÔÉ (y,n,^C)? " #: ufile.c:510 ufile.c:899 ufile.c:1103 msgid "Name of file to save (^C to abort): " msgstr "¶Í'Ñ ÆÁÊÌÁ ÄÌÑ ÚÂÅÒÅÖÅÎÎÑ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: ufile.c:538 msgid "Name of file to write (^C to abort): " msgstr "¶Í'Ñ ÆÁÊÌÁ ÄÌÑ ÚÁÐÉÓÕ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: ufile.c:654 msgid "Load original file from disk (y,n,^C)? " msgstr "úÁÇÒÕÚÉÔÉ ÏÒÉǦÎÁÌØÎÉÊ ÆÁÊÌ Ú ÄÉÓËÁ (y,n,^C)? " #: ufile.c:684 msgid "Can't replace modified file" msgstr "îÅ ÍÏÖÕ ÚÁͦÎÉÔÉ ÍÏÄÉÆ¦ËÏ×ÁÎÉÊ ÆÁÊÌ" #: ufile.c:693 msgid "Name of file to edit (^C to abort): " msgstr "¶Í'Ñ ÆÁÊÌÁ ÄÌÑ ÒÅÄÁËÔÕ×ÁÎÎÑ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: ufile.c:708 ufile.c:1085 msgid "Name of buffer to edit (^C to abort): " msgstr "¶Í'Ñ ÂÕÆÅÒÁ ÄÌÑ ÒÅÄÁËÔÕ×ÁÎÎÑ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: ufile.c:764 msgid "Name of scratch buffer to edit (^C to abort): " msgstr "¶Í'Ñ ÂÕÆÅÒÁ ÞÅÒÎÅÔËÉ ÄÌÑ ÒÅÄÁËÔÕ×ÁÎÎÑ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: ufile.c:865 msgid "Name of file to insert (^C to abort): " msgstr "¶Í'Ñ ÆÁÊÌÁ ÄÌÑ ×ÓÔÁ×ËÉ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: ufile.c:933 msgid "Save changes to this file (y,n,^C)? " msgstr "úÂÅÒÅÇÔÉ ÚͦÎÉ ÃØÏÇÏ ÆÁÊÌÁ (y,n,^C)? " #: ufile.c:1137 #, c-format msgid "File %s has been modified. Save it (y,n,^C)? " msgstr "æÁÊÌ %s ÚͦÎÅÎÏ. úÂÅÒ¦ÇÔÉ ÊÏÇÏ (y,n,^C)? " #: uisrch.c:267 msgid "I-find: " msgstr "" #: umath.c:19 msgid "Float point exception" msgstr "ðÅÒÅÒÉ×ÁÎÎÑ ÚÁ ÐÌÁ×ÁÀÞÏÀ ÔÏÞËÏÀ" #: umath.c:93 umath.c:195 umath.c:214 msgid "Missing )" msgstr "÷¦ÄÓÕÔÎÑ )" #: umath.c:104 msgid "Syntax error in macro" msgstr "óÉÎÔÁËÓÉÞÎÁ ÐÏÍÉÌËÁ × ÍÁËÒÏ" #: umath.c:111 msgid "Missing (" msgstr "÷¦ÄÓÕÔÎÑ (" #: umath.c:140 umath.c:146 umath.c:153 umath.c:162 msgid "No numbers in block" msgstr "÷ ÂÌÏæ ÎÅÍÁ¤ ÞÉÓÅÌ" #: umath.c:220 msgid "Called object is not a function" msgstr "÷ÉËÌÉËÁ¤ÍÉÊ ÏÂ'¤ËÔ - ÎÅ ÆÕÎËæÑ" #: umath.c:234 msgid "Factorial can only take positive integers" msgstr "æÁËÔÏÒ¦ÁÌ ÍÏÖÅ ÏÂÞÉÓÌÀ×ÁÔÉÓØ Ô¦ÌØËÉ ÄÌÑ ÐÏÚÉÔÉ×ÎÉÈ Ã¦ÌÉÈ" #: umath.c:332 msgid "Left side of = is not an l-value" msgstr "õ Ì¦×¦Ê ÞÁÓÔÉΦ Ò¦×ÎÑÎÎÑ - ÎÅ l-ÚÎÁÞÅÎÎÑ" #: umath.c:346 msgid "Recursion depth exceeded" msgstr "ðÅÒÅ×ÉÝÅÎÁ ÇÌÉÂÉÎÁ ÒÅËÕÒÓ¦§" #: umath.c:366 msgid "Extra junk after end of expr" msgstr "úÁÊצ ÓÉÍ×ÏÌÉ Ð¦ÓÌÑ Ë¦ÎÃÑ ÏÐÅÒÁÔÏÒÁ" #: undo.c:438 msgid "Modified flag cleared" msgstr "æÌÁÇ ÍÏÄÉÆ¦ËÁæ§ ÓËÉÎÕÔÉÊ" #: usearch.c:281 usearch.c:350 msgid "Wrapped" msgstr "óÐÏÞÁÔËÕ" #: usearch.c:553 msgid "|all files|aA" msgstr "|×Ó¦ ÆÁÊÌÉ|aAÆæ" #: usearch.c:554 #, fuzzy msgid "|error list files|eE" msgstr "|ÆÁÊÌÉ ÓÐÉÓË¦× ÐÏÍÉÌÏË|eEÕõ" #: usearch.c:555 msgid "|search and replace|rR" msgstr "|ÐÏÛÕË ÔÁ ÚÁͦÝÅÎÎÑ|rRËë" #: usearch.c:556 msgid "|backwards|bB" msgstr "|ÎÁÚÁÄ|bBÉé" #: usearch.c:557 msgid "|ignore case|iI" msgstr "|ÉÇÎÏÒÕ×ÁÔÉ ÒÅǦÓÔÒ|iIÛû" #: usearch.c:558 msgid "|restrict to highlighted block|kK" msgstr "|×ÓÅÒÅÄÅΦ צÄͦÞÅÎÏÇÏ ÂÌÏËÁ|kKÌì" #: usearch.c:559 msgid "|don't ignore case|sS" msgstr "|ÎÅ ÉÇÎÏÒÕ×ÁÔÉ ÒÅǦÓÔÒ|sSÙù¦¶" #: usearch.c:560 msgid "|wrap|wW" msgstr "|ÃÉË̦ÞÎÉÊ|wWÃã" #: usearch.c:561 #, fuzzy msgid "|don't wrap|nN" msgstr "|ÎÅ ÃÉË̦ÞÎÉÊ|nNÔô" #: usearch.c:618 msgid "Replace with (^C to abort): " msgstr "þÉÍ ÚÁͦÎÑÔÉ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: usearch.c:633 #, fuzzy msgid "case (S)ensitive (R)eplace (B)ackwards Bloc(K) (A)ll files NNN (^C to abort): " msgstr "(S)×ÒÁÈ.ÒÅǦÓÔÒÁ (R)ÚÁͦÎÁ (B)ÎÁÚÁÄ ÂÌÏ(K) (A)×Ó¦ ÆÁÊÌÉ NNN (^C - צÄͦÎÁ): " #: usearch.c:635 #, fuzzy msgid "(I)gnore (R)eplace (B)ackwards Bloc(K) (A)ll files NNN (^C to abort): " msgstr "(I)ÉÇÎ.ÒÅÇ. (R)ÚÁͦÎÁ (B)ÎÁÚÁÄ ÂÌÏ(K) (A)×Ó¦ ÆÁÊÌÉ NNN (^C - צÄͦÎÁ): " #: usearch.c:717 #, c-format msgid "Find (^C to abort) [%s]: " msgstr "ýÏ ÛÕËÁÔÉ (^C ÄÌÑ ×¦ÄͦÎÉ) [%s]: " #: usearch.c:719 msgid "Find (^C to abort): " msgstr "ýÏ ÛÕËÁÔÉ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: usearch.c:813 msgid "|rest of file|rR" msgstr "|ÄÏ Ë¦ÎÃÑ ÆÁÊÌÁ|rR" #: usearch.c:814 msgid "|backup|bB" msgstr "|ÒÅÚÅÒ×|bBÉé" #: usearch.c:845 msgid "Replace (Y)es (N)o (R)est (B)ackup (^C to abort)?" msgstr "úÁͦÎÑÔÉ (Y)ÔÁË (N)Φ (R)×ÓÅ (B)ÐÏ×ÅÒÎÕÔÉ (^C ÄÌÑ ×¦ÄͦÎÉ): " #: usearch.c:993 msgid "Not found (search restricted to marked block)" msgstr "îÅ ÚÎÁÊÄÅÎÏ (ÐÏÛÕË ÏÂÍÅÖÅÎÉÊ ÂÌÏËÏÍ)" #: usearch.c:1000 msgid "Infinite loop aborted: your search repeatedly matched same place" msgstr "âÅÚ˦ÎÅÞÎÉÊ ÃÉËÌ ÐÅÒÅÒ×ÁÎÉÊ: ×ÁÛ ÐÏÛÕË ÚÁÃÉËÌÉ×ÓÑ ÎÁ ÏÄÎÏÍÕ Í¦Óæ" #: ushell.c:95 msgid "Program already running in this window" msgstr "ðÒÏÇÒÁÍÁ ×ÕÖÅ ×ÉËÏÎÕ¤ÔØÓÑ × ÃØÏÍÕ ×¦ËΦ" #: ushell.c:103 msgid "No ptys available" msgstr "îÅÍÁ¤ ×¦ÌØÎÉÈ ÐÓÅ×ÄÏÔÅÒÍÉÎÁ̦×" #: ushell.c:128 msgid "\"SHELL\" environment variable not defined or exported" msgstr "úͦÎÎÕ ÓÅÒÅÄÏ×ÉÝÁ \"SHELL\" ÎÅ ×ÉÚÎÁÞÅÎÏ ÁÂÏ ÎÅ ÜËÓÐÏÒÔÉÒÏ×ÁÎÏ" #: ushell.c:164 msgid "Program to run: " msgstr "÷ÉËÏÎÁÔÉ ÐÒÏÇÒÁÍÕ: " #: ushell.c:188 msgid "Build command: " msgstr "ëÏÍÁÎÄÁ ÐÏÂÕÄÏ×É: " #: ushell.c:197 msgid "Enter build command (for example, 'make'): " msgstr "÷ËÁÖ¦ÔØ ËÏÍÁÎÄÕ ÐÏÂÕÄÏ×É (ÎÁÐÒÉËÌÁÄ, 'make'): " #: ushell.c:212 msgid "Grep command: " msgstr "ëÏÍÁÎÄÁ ÐÏÛÕËÁ: " #: ushell.c:221 msgid "Enter grep command (for example, 'grep -n foo *.c'): " msgstr "÷ËÁÖ¦ÔØ ËÏÍÁÎÄÕ ÐÏÛÕËÁ (ÎÁÐÒÉËÌÁÄ, 'grep -n foo *.c'): " #: ushell.c:250 msgid "Kill program (y,n,^C)?" msgstr "ðÅÒÅÒ×ÁÔÉ ÐÒÏÇÒÁÍÕ (y,n,^C)?" #: utag.c:26 msgid "Couldn't open tags file" msgstr "îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ÆÁÊÌ ÔÅǦ×" #: utag.c:168 msgid "Tag search: " msgstr "ûÕËÁÔÉ ÔÅÇ: " #: vfile.c:174 msgid "vfile: out of memory\n" msgstr "vfile: ÎÅÍÁ¤ ÐÁÍ'ÑÔ¦\n" #: vfile.c:229 #, c-format msgid "Couldn't open file '%s'\n" msgstr "îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ÆÁÊÌ '%s'\n" #: w.c:822 msgid "There is no message buffer" msgstr "÷¦ÄÓÕÔÎ¦Ê ÂÕÆÅÒ ÐÏצÄÏÍÌÅÎÎÑ" #~ msgid "Delimiters (%s): " #~ msgstr "ïÂÍÅÖÕ×ÁÞ¦ (%s): " #~ msgid "Delimiters: " #~ msgstr "ïÂÍÅÖÕ×ÁÞ¦:" #~ msgid "Not found\n" #~ msgstr "îÅ ÚÎÁÊÄÅÎÏ\n" #~ msgid "Could not lock. (S)teal, (I)gnore, (Q)uit? " #~ msgstr "îÅ ÍÏÖÕ ÚÁÂÌÏËÕ×ÁÔÉ. (S)ÚÁÈÏÐÉÔÉ, (I)¦ÇÎÏÒÕ×ÁÔÉ, (Q)×ÉÊÔÉ? " #~ msgid "cmd: " #~ msgstr "ËÏÍÁÎÄÁ: " #~ msgid "\t^K %c\tMacro %d" #~ msgstr "\t^K %c\tíÁËÒÏ %d" #~ msgid "Jump is on" #~ msgstr "ðÒÙÖÏË ×ËÌ." #~ msgid "Jump is off" #~ msgstr "ðÒÙÖÏË ×ÙËÌ." #~ msgid " %S Ctrl-K H for help" #~ msgstr " %S Ctrl-K H for help" #~ msgid "ON" #~ msgstr "÷ëì" #~ msgid "OFF" #~ msgstr "÷ùëì" #~ msgid "File " #~ msgstr "æÁÊÌ " #~ msgid " not saved." #~ msgstr " ÎÅ ÓÏÈÒÁΣÎ." #~ msgid " saved." #~ msgstr " ÓÏÈÒÁΣÎ." #~ msgid " not changed so no update needed." #~ msgstr " ÎÅ ÉÚÍÅÎÅÎ, Ô.Ë. ÎÅ ÂÙÌÏ ÍÏÄÉÆÉËÁÃÉÊ" #~ msgid ": missing after ?" #~ msgstr ": ÏÔÓÕÔÓÔ×ÕÅÔ ÐÏÓÌÅ ?" #~ msgid "Replace with (^C to abort) [%s]: " #~ msgstr "þÅÍ ÚÁÍÅÎÑÔØ (^C ÄÌÑ ÏÔÍÅÎÙ) [%s]: " #~ msgid "corrupt heap: head %x\n" #~ msgstr "ÉÓÐÏÒÞÅÎÎÁÑ ËÕÞÁ: ×ÅÒÈÕÛËÁ %x\n" #~ msgid "Corrupt heap: tail %x\n" #~ msgstr "éÓÐÏÒÞÅÎÎÁÑ ËÕÞÁ: ËÏÎÅà %x\n" #~ msgid "Corrupt heap: modified free block %x\n" #~ msgstr "éÓÐÏÒÞÅÎÎÁÑ ËÕÞÁ: ÍÏÄÉÆÉÃÉÒÏ×ÁÎ Ó×ÏÂÏÄÎÙÊ ÂÌÏË %x\n" #~ msgid "0 passed to malloc\n" #~ msgstr "0 ÐÅÒÅÄÁÎÏ malloc\n" #~ msgid "0 passed to realloc\n" #~ msgstr "0 ÐÅÒÅÄÁÎÏ realloc\n" #~ msgid "Free non-malloc block %x\n" #~ msgstr "ïÓ×ÏÂÏÖÄÅÎÉÅ ÎÅÚÁÈ×ÁÞÅÎÎÏÇÏ ÂÌÏËÁ %x\n" #~ msgid "Double-free %x\n" #~ msgstr "ðÏ×ÔÏÒÎÏÅ ÏÓ×ÏÂÏÖÄÅÎÉÅ %x\n" joe-3.7/po/Makefile.am0000644000100100007640000000021311101510604011505 00000000000000data_joedir = $(datadir)/joe data_langdir = $(data_joedir)/lang data_lang_DATA = ru.po de.po fr.po uk.po EXTRA_DIST = $(data_lang_DATA) joe-3.7/po/Makefile.in0000644000100100007640000002305511102222351011527 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(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@ subdir = po DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 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) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/autoconf.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = 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|^.*/||'`; am__installdirs = "$(DESTDIR)$(data_langdir)" data_langDATA_INSTALL = $(INSTALL_DATA) DATA = $(data_lang_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ 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 = @INSTALL@ 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@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ 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@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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@ builddir = @builddir@ 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@ 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@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ data_joedir = $(datadir)/joe data_langdir = $(data_joedir)/lang data_lang_DATA = ru.po de.po fr.po uk.po EXTRA_DIST = $(data_lang_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu po/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu po/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-data_langDATA: $(data_lang_DATA) @$(NORMAL_INSTALL) test -z "$(data_langdir)" || $(MKDIR_P) "$(DESTDIR)$(data_langdir)" @list='$(data_lang_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(data_langDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(data_langdir)/$$f'"; \ $(data_langDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(data_langdir)/$$f"; \ done uninstall-data_langDATA: @$(NORMAL_UNINSTALL) @list='$(data_lang_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(data_langdir)/$$f'"; \ rm -f "$(DESTDIR)$(data_langdir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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 check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(data_langdir)"; 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: all-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: 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-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-data_langDATA install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-data_langDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data_langDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-data_langDATA # 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: joe-3.7/rc/0000777000100100007640000000000011103454344007541 500000000000000joe-3.7/rc/jicerc.ru.in0000644000100100007640000011225511103215645011676 00000000000000 éÎÉÃÉÁÌÉÚÁÃÉÏÎÎÙÊ ÆÁÊÌ JOE Joe ÄÌÑ iceB JOE ÉÝÅÔ ÜÔÏÔ ÆÁÊÌ ×: 1 - $HOME/.jicerc 2 - @JOERC@/joerc üÔÏÔ ÆÁÊÌ ÍÏÖÅÔ ×ËÌÀÞÁÔØ ÄÒÕÇÉÅ ÆÁÊÌÙ ÐÕÔÅÍ ÒÁÚÍÅÝÅÎÉÑ Ó ÐÅÒ×ÏÊ ËÏÌÏÎËÉ ËÏÍÁÎÄÙ ×ÉÄÁ: :include filename ðåò÷áñ óåëãéñ: õÍÏÌÞÁÎÉÑ ÇÌÏÂÁÌØÎÙÈ ÏÐÃÉÊ (ÜÔÉ ÏÐÃÉÉ ÔÁËÖÅ ÍÏÇÕÔ ÂÙÔØ ÕËÁÚÁÎÙ × ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÅ. ëÒÏÍÅ ÔÏÇÏ, ÏÐÃÉÉ NOXON, LINES, COLUMNS, DOPADDING É BAUD ÍÏÇÕÔ ÚÁÄÁ×ÁÔØÓÑ Ó ÐÏÍÏÝØÀ ÐÅÒÅÍÅÎÎÙÈ ÓÒÅÄÙ): ðÅÒÅËÒÙÔÉÅ Ã×ÅÔÏ× ÌÅËÓÉÞÅÓËÉÈ ËÌÁÓÓÏ×, ÏÐÒÅÄÅÌÅÎÎÙÈ × ÓÉÎÔÁËÓÉÞÅÓËÉÈ ÆÁÊÌÁÈ: ðÏÍÅÓÔÉÔÅ ÖÅÌÁÅÍÙÊ ÐÅÒÅËÒÙ×ÁÀÝÉÊ Ã×ÅÔ × ÐÅÒ×ÕÀ ËÏÌÏÎËÕ. äÏÐÕÓÔÉÍÙÅ Ã×ÅÔÁ bold (ÑÒËÏÓÔØ) inverse (ÉÎ×ÅÒÓÉÑ) blink (ÍÅÒÃÁÎÉÅ) dim (ÐÏÌÕÑÒËÏÓÔØ) underline (ÐÏÄÞÅÒËÉ×ÁÎÉÅ) white (ÂÅÌÙÊ) cyan (ÂÉÒÀÚÏ×ÙÊ) magenta (ÆÉÏÌÅÔÏ×ÙÊ) blue (ÓÉÎÉÊ) yellow (ÖÅÌÔÙÊ) green (ÚÅÌÅÎÙÊ) red (ËÒÁÓÎÙÊ) black (ÞÅÒÎÙÊ) ÄÌÑ ÆÏÎÁ bg_white bg_cyan bg_magenta bg_blue bg_yellow bg_green bg_red bg_black äÒÕÇÉÅ ×ÏÚÍÏÖÎÙÅ Ã×ÅÔÁ: ÓÍ. syntax/c.jsf õÓÔÁÎÏ×ÉÔØ Ã×ÅÔ ÄÌÑ ×ÓÅÈ ÓÌÕÞÁÅ× ËÌÁÓÓÁ Idle: =Idle red õÓÔÁÎÏ×ÉÔØ Ã×ÅÔ Idle ÔÏÌØËÏ ÄÌÑ ÓÉÎÔÁËÓÉÞÅÓËÏÇÏ ÆÁÊÌÁ ÑÚÙËÁ ó: =c.Idle red óÌÅÄÕÀÝÉÊ ÐÒÉÍÅÒ ×ÚÑÔ ÉÚ c.jsf. ðÒÉÍÅÒÙ ÄÒÕÇÉÈ ËÌÁÓÓÏ× - ÓÍ. × ÏÓÔÁÌØÎÙÈ ÓÉÎÔÁËÓÉÞÅÓËÉÈ ÆÁÊÌÁÈ. =Idle =Bad bold red =Preproc blue =Define bold blue =IncLocal cyan =IncSystem bold cyan =Constant cyan =Escape bold cyan =Type bold =Keyword bold =CppKeyword bold =Brace magenta =Control òÁÚÍÅÓÔÉÔÅ ÏÐÃÉÀ, ËÏÔÏÒÕÀ ÈÏÔÉÔÅ ÕÓÔÁÎÏ×ÉÔØ, ÎÁÞÉÎÁÑ Ó ÐÅÒ×ÏÊ ËÏÌÏÎËÉ: -option õÓÔÁÎÏ×ËÁ ÏÐÃÉÉ --option óÂÒÏÓ ÏÐÃÉÉ -help_is_utf8 õÓÔÁÎÏ×ÉÔØ, ÅÓÌÉ ÔÅËÓÔ ÐÏÄÓËÁÚËÉ - × ËÏÄÉÒÏ×ËÅ UTF-8. éÎÁÞÅ ÂÕÄÅÔ ÓÞÉÔÁÔØÓÑ, ÞÔÏ ÏÎÁ - × ÏÂÙÞÎÏÊ 8-ÂÉÔÎÏÊ ËÏÄÉÒÏ×ËÅ. -mid ðÒÉ ÓËÒÏÌÌÉÎÇÅ ×ÙÐÏÌÎÑÔØ ÃÅÎÔÒÉÒÏ×ÁÎÉÅ ËÕÒÓÏÒÁ -marking ðÏÄÓ×ÅÞÉ×ÁÔØ ÔÅËÓÔ ÍÅÖÄÕ ÎÁÞÁÌÏÍ ÂÌÏËÁ É ËÕÒÓÏÒÏÍ (ÉÓÐÏÌØÚÕÊÔÅ ×ÍÅÓÔÅ Ó -lightoff) -asis óÉÍ×ÏÌÙ Ó ËÏÄÁÍÉ 128 - 255 ÐÏËÁÚÙ×ÁÔØ ÂÅÚ ÐÒÅÏÂÒÁÚÏ×ÁÎÉÊ -force ðÒÉÎÕÄÉÔÅÌØÎÏ ÕÓÔÁÎÁ×ÌÉ×ÁÔØ ÐÅÒÅ×ÏÄ ÓÔÒÏËÉ × ËÏÎÃÅ ÆÁÊÌÁ -nolocks åÓÌÉ ÎÅ ÖÅÌÁÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÂÌÏËÉÒÏ×ËÕ ÆÁÊÌÏ× -nomodcheck úÁÐÒÅÔÉÔØ ÐÅÒÉÏÄÉÞÅÓËÕÀ ÐÒÏ×ÅÒËÕ - ÎÅ ÓÔÁÌ ÌÉ ÆÁÊÌ ÎÁ ÄÉÓËÅ ÎÏ×ÅÅ, ÞÅÍ × ÂÕÆÅÒÅ. (ÐÒÉ ÓÏÈÒÁÎÅÎÉÉ ÜÔÏÔ ËÏÎÔÒÏÌØ ×ÓÅ ÒÁ×ÎÏ ÐÒÏÉÚ×ÏÄÉÔÓÑ - ÄÁÖÅ ÎÅÓÍÏÔÒÑ ÎÁ ÎÁÌÉÞÉÅ ÄÁÎÎÏÊ ÏÐÃÉÉ). -nocurdir îÅ ×ÓÔÁ×ÌÑÔØ ÔÅËÕÝÕÀ ÄÉÒÅËÔÏÒÉÀ × ÚÁÐÒÏÓ ÆÁÊÌÁ -nobackups åÓÌÉ ÎÅ ÖÅÌÁÅÔÅ, ÞÔÏÂÙ ÓÏÚÄÁ×ÁÌÉÓØ ÒÅÚÅÒ×ÎÙÅ ÆÁÊÌÙ -break_hardlinks õÄÁÌÑÔØ ÆÁÊÌ ÐÅÒÅÄ ÚÁÐÉÓØÀ, ÄÌÑ ÒÁÚÒÙ×Á ÖÅÓÔËÉÈ ÓÓÙÌÏË (but don't break symbolic links). -break_links Delete file before writing, to break hard links and symbolic links. -lightoff ÷ÙËÌÀÞÁÔØ ÐÏÄÓ×ÅÔËÕ ÐÏÓÌÅ ËÏÐÉÒÏ×ÁÎÉÑ ÉÌÉ ÐÅÒÅÍÅÝÅÎÉÑ ÂÌÏËÁ -exask úÁÐÒÁÛÉ×ÁÔØ ÐÏÄÔ×ÅÖÄÅÎÉÅ ÉÍÅÎÉ ÆÁÊÌÁ ÐÒÉ ×ÙÈÏÄÅ -beep ú×ÑËÁÔØ × ÓÌÕÞÁÅ ÏÛÉÂËÉ É ÐÒÉ ×ÙÈÏÄÅ ËÕÒÓÏÒÁ ÚÁ ÇÒÁÎÉÃÙ -nosta úÁÐÒÅÔÉÔØ ÓÔÒÏËÕ ÓÏÓÔÏÑÎÉÑ -keepup þÁÓÔÏ ÉÚÍÅÎÑÔØ ÚÎÁÞÅÎÉÅ esc-ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÅÊ %k É %c × ÓÔÒÏËÅ ÓÏÓÔÏÑÎÉÑ -pg nnn ëÏÌÉÞÅÓÔ×Ï ÓÔÒÏË, ÏÓÔÁ×ÌÑÅÍÙÈ ÐÒÉ PgUp/PgDn -undo_keep nnn ëÏÌÉÞÅÓÔ×Ï ÐÏÓÌÅÄÎÉÈ ÉÚÍÅÎÅÎÉÊ, ÚÁÐÏÍÉÎÁÅÍÙÈ ÄÌÑ ×ÏÚÍÏÖÎÏÇÏ "ÏÔËÁÔÁ". 0 - ÅÓÌÉ ÚÁÐÏÍÉÎÁÔØ ÂÅÚ ÏÇÒÁÎÉÞÅÎÉÊ. -csmode ^KF ÐÏÓÌÅ ÐÒÅÄÙÄÕÝÅÇÏ ÐÏÉÓËÁ ÄÅÊÓÔ×ÕÅÔ ËÁË ^L -backpath path äÉÒÅËÔÏÒÉÑ ÄÌÑ ÓÏÈÒÁÎÅÎÉÑ ÒÅÚÅÒ×ÎÙÈ ÆÁÊÌÏ× (ÏÄÉÎ ÐÒÏÂÅÌ ÍÅÖÄÕ 'backpath' É 'path', ÂÅÚ ÚÁ×ÅÒÇÁÀÝÉÈ ÐÒÏÂÅÌÏ× ÉÌÉ ËÏÍÍÅÎÔÁÒÉÅ× ÐÏÓÌÅ path). -floatmouse ëÌÉË ÚÁ ËÏÎÃÏÍ ÓÔÒÏËÉ ÐÅÒÅÎÏÓÉÔ ËÕÒÓÏÒ ÚÁ ËÏÎÅà ÓÔÒÏËÉ -rtbutton äÌÑ ×ÙÐÏÌÎÅÎÉÑ ÄÅÊÓÔ×ÉÑ ÉÓÐÏÌØÚÏ×ÁÔØ ÐÒÁ×ÕÀ ËÎÏÐËÕ ÍÙÛÉ ×ÍÅÓÔÏ ÌÅ×ÏÊ -nonotice îÅ ×Ù×ÏÄÉÔØ copyright -noxon ÷ÙËÌÀÞÉÔØ ÏÂÒÁÂÏÔËÕ ^S/^Q -orphan ðÏÌÏÖÉÔØ ÄÏÐÏÌÎÉÔÅÌØÎÙÅ ÆÁÊÌÙ, ÕËÁÚÁÎÎÙÅ × ËÏÍ.ÓÔÒÏËÅ, × ÓËÒÙÔÙÅ ÂÕÆÅÒÁ, Á ÎÅ × ÏËÎÁ -dopadding éÓÐÏÌØÚÏ×ÁÔØ ÓÉÍ×ÏÌÙ ÚÁÐÏÌÎÅÎÉÑ ÐÒÉ ×Ù×ÏÄÅ (ÅÓÌÉ ÎÅ ÐÒÉÍÅÎÑÅÔÓÑ ÎÉËÁËÏÊ ÐÒÏÔÏËÏÌ ÕÐÒÁ×ÌÅÎÉÑ ÐÏÔÏËÏÍ) -lines nnn õÓÔÁÎÏ×ÉÔØ ËÏÌ-×Ï ÓÔÒÏË ÎÁ ÜËÒÁÎÅ -baud 19200 õÓÔÁÎÏ×ÉÔØ ÓËÏÒÏÓÔÏ ÏÂÍÅÎÁ ÄÌÑ ÏÐÔÉÍÉÚÁÃÉÉ ÔÅÒÍÉÎÁÌØÎÏÇÏ ×Ù×ÏÄÁ -columns nnn õÓÔÁÎÏ×ÉÔØ ËÏÌ-×Ï ËÏÌÏÎÏË ÎÁ ÜËÒÁÎÅ -help ÷ËÌÀÞÁÔØ ÜËÒÁÎ ÐÏÄÓËÁÚËÉ ÐÒÉ ÚÁÐÕÓËÅ -skiptop nnn îÅ ÉÓÐÏÌØÚÏ×ÁÔØ ×ÅÒÈÎÉÅ nnn ÓÔÒÏË ÜËÒÁÎÁ -notite îÅ ÐÏÓÙÌÁÔØ ÓÔÒÏËÉ ÉÎÉÃÉÁÌÉÚÁÃÉÉ É ÔÅÒÍÉÎÁÃÉÉ ÔÅÒÍÉÎÁÌÁ: ÐÒÅÄÏÔ×ÒÁÝÁÅÔ ×ÏÓÓÔÁÎÏ×ÌÅÎÉÅ ÜËÒÁÎÁ ÐÒÉ ×ÙÈÏÄÅ. -usetabs éÓÐÏÌØÚÏ×ÁÔØ ÔÁÂÕÌÑÔÏÒÙ ÄÌÑ ÏÐÔÉÍÉÚÁÃÉÉ ÜËÒÁÎÎÏÇÏ ×Ù×ÏÄÁ -assume_color ðÒÅÄÐÏÌÁÇÁÔØ, ÞÔÏ ÔÅÒÍÉÎÁÌ ÐÏÄÄÅÒÖÉ×ÁÅÔ Ã×ÅÔ × ÓÔÁÎÄÁÒÔÅ ANSI, ÄÁÖÅ ÅÓÌÉ ÜÔÏ ÎÅ ÕËÁÚÁÎÏ × ÏÐÉÓÁÎÉÉ termcap/terminfo. -assume_256color ðÒÅÄÐÏÌÁÇÁÔØ, ÞÔÏ ÔÅÒÍÉÎÁÌ ÐÏÄÄÅÒÖÉ×ÁÅÔ 256 Ã×ÅÔÏ× × ÓÔÉÌÅ xterm (ESC [ 38 ; 5 ; NNN m É ESC [ 48 ; 5 ; NNN m). -guess_non_utf8 Allow guess of non-UTF-8 file encoding in a UTF-8 locale. -guess_utf8 Allow guess of UTF-8 file encoding in non-UTF-8 locale. -guess_crlf á×ÔÏÏÐÒÅÄÅÌÑÔØ ÆÁÊÌÙ MS-DOS É ÓÏÏÔ×. ÕÓÔÁÎÁ×ÌÉ×ÁÔØ -crlf -guess_indent õÇÁÄÙ×ÁÔØ ÓÉÍ×ÏÌÙ ÄÌÑ ÏÔÓÔÕÐÁ (ÔÁÂÕÌÑÔÏÒ ÉÌÉ ÐÒÏÂÅÌ). -menu_explorer ïÓÔÁ×ÁÔØÓÑ × ÍÅÎÀ ÐÒÉ ×ÙÂÏÒÅ ÄÉÒÅËÔÏÒÉÉ (× ÐÒÏÔÉ×ÎÏÍ ÓÌÕÞÁÅ ÄÉÒÅËÔÏÒÉÑ ÄÏÐÉÓÙ×ÁÅÔÓÑ Ë ÐÕÔÉ É ÍÅÎÀ ÚÁËÒÙ×ÁÅÔÓÑ). -menu_above åÓÌÉ ÒÁÚÒÅÛÅÎÏ - ÍÅÎÀ/ÓÐÉÓËÉ ÂÕÄÕÔ ÒÁÓÐÏÌÁÇÁÔØÓÑ ÎÁÄ ÓÔÒÏËÏÊ ÚÁÐÒÏÓÁ. éÎÁÞÅ - ÐÏÄ ÎÅÊ. -transpose ðÅÒÅÍÅÝÁÔØ ÓÔÒÏËÉ Ó ËÏÌÏÎËÁÍÉ ×Ï ×ÓÅÈ ÍÅÎÀ. -menu_jump ðÅÒÅÍÅÝÁÔØÓÑ ÐÏ ÍÅÎÀ ×ÙÂÏÒÁ ÆÁÊÌÁ ÐÏ ÎÁÖÁÔÉÀ ËÌÁ×ÉÛÉ Tab (ÉÎÁÞÅ ÍÅÎÀ ÐÏÑ×ÌÑÅÔÓÑ, ÎÏ ËÕÒÓÏÒ ÏÓÔÁÅÔÓÑ ÎÁ ÚÁÐÒÏÓÅ ÉÍÅÎÉ ÆÁÊÌÁ). -icase ðÏÉÓË ÒÅÇÉÓÔÒÏÎÅÚÁ×ÉÓÉÍ ÐÏ ÕÍÏÌÞÁÎÉÀ. -wrap ãÉËÌÉÞÅÓËÉÊ ÐÏÉÓË. -autoswap ðÒÉ ÎÅÏÂÈÏÄÉÍÏÓÔÉ ÍÅÎÑÔØ ÍÅÓÔÁÍÉ ÍÅÔËÉ ÎÁÞÁÌÁ É ËÏÎÃÁ ÂÌÏËÁ -joe_state éÓÐÏÌØÚÏ×ÁÔØ ÆÁÊÌ ÓÏÈÒÁÎÅÎÉÑ ÓÏÓÔÏÑÎÉÑ ~/.joe_state -mouse ÷ËÌÀÞÉÔØ ÐÏÄÄÅÒÖËÕ ÍÙÛÉ × xterm. ðÒÉ ÜÔÏÍ ÎÁÖÁÔÉÅ ÌÅ×ÏÊ ËÎÏÐËÉ ÍÙÛÉ ÂÕÄÅÔ ÐÅÒÅÍÅÝÁÔØ ËÕÒÓÏÒ, ÅÅ ÎÁÖÁÔÉÅ-ÏÔÔÑÇÉ×ÁÎÉÅ - ÏÔÍÅÞÁÔØ ÂÌÏË. äÌÑ ×ÙÐÏÌÎÅÎÉÑ ÓÔÁÎÄÁÒÔÎÏÇÏ × xterm ÚÁÐÏÍÉÎÁÎÉÑ × ÂÕÆÅÒ É ÉÚ×ÌÅÞÅÎÉÑ ÉÚ ÎÅÇÏ - ÐÒÉÖÍÉÔÅ ËÌÁ×ÉÛÕ Shift. -joexterm åÓÌÉ ×Ù ÉÓÐÏÌØÚÕÅÔÅ Xterm, ÍÏÄÉÆÉÃÉÒÏ×ÁÎÎÙÊ ÄÌÑ Joe - ÜÔÏ ÄÅÌÁÅÔ ÒÅÖÉÍ -mouse ÂÏÌÅÅ ÕÄÏÂÎÙÍ (ÚÁÐÏÍÉÎÁÎÉÅ/ÉÚ×ÌÅÞÅÎÉÅ ÂÕÄÅÔ ×ÙÐÏÌÎÑÔØÓÑ ÐÒÏÚÒÁÞÎÏ). -square òÅÖÉÍ ÐÒÑÍÏÕÇÏÌØÎÙÈ ÂÌÏËÏ× -text_color color õÓÔÁÎÏ×ÉÔØ Ã×ÅÔ ÄÌÑ ÔÅËÓÔÁ. -status_color color õÓÔÁÎÏ×ÉÔØ Ã×ÅÔ ÄÌÑ ÓÔÒÏËÉ ÓÏÓÔÏÑÎÉÑ. -help_color color õÓÔÁÎÏ×ÉÔØ Ã×ÅÔ ÄÌÑ ÐÏÄÓËÁÚËÉ. -menu_color color õÓÔÁÎÏ×ÉÔØ Ã×ÅÔ ÄÌÑ ÍÅÎÀ. -prompt_color color õÓÔÁÎÏ×ÉÔØ Ã×ÅÔ ÄÌÑ ÚÁÐÒÏÓÏ×. -msg_color color õÓÔÁÎÏ×ÉÔØ Ã×ÅÔ ÄÌÑ ÓÏÏÂÝÅÎÉÊ. îÁÐÒÉÍÅÒ: -text_color bg_blue+white õÓÔÁÎÁ×ÌÉ×ÁÅÔ ÇÏÌÕÂÏÊ ÆÏÎ É ÂÅÌÙÊ Ã×ÅÔ ÐÅÒÅÄÎÅÇÏ ÐÌÁÎÁ. -restore ÷ÏÓÓÔÁÎÁ×ÌÉ×ÁÔØ ÐÒÅÄÙÄÕÝÕÀ ÐÏÚÉÃÉÀ ËÕÒÓÏÒÁ ÐÒÉ ÏÔËÒÙÔÉÉ ÆÁÊÌÏ×. -search_prompting úÁÐÒÁÛÉ×ÁÔØ ÏÂÒÁÚÅà ÄÌÑ ÐÏÓÌÅÄÕÀÝÉÈ ÐÏÉÓËÏ×. óÔÒÏËÁ ÏÐÒÅÄÅÌÅÎÉÑ ÓÔÒÏËÉ ÓÏÓÔÏÑÎÉÑ. -lmsg ÏÐÒÅÄÅÌÑÅÔ ÞÁÓÔØ, ×ÙÒÏ×ÎÅÎÎÕÀ ×ÌÅ×Ï, Á -rmsg - ×ÐÒÁ×Ï. ðÅÒ×ÙÊ ÓÉÍ×ÏÌ ÓÔÒÏËÉ -rmsg - ÓÉÍ×ÏÌ ÄÌÑ ÚÁÐÏÌÎÅÎÉÑ ÆÏÎÁ. ÷ ÓÔÒÏËÁÈ ÍÏÇÕÔ ÉÓÐÏÌØÚÏ×ÁÔØÓÑ ÓÌÅÄÕÀÝÉÅ ÕÐÒÁ×ÌÑÀÝÉÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÉ: %t ×ÒÅÍÑ × 12-ÞÁÓÏ×ÏÍ ÆÏÒÍÁÔÅ %u ×ÒÅÍÑ × 24-ÞÁÓÏ×ÏÍ ÆÏÒÍÁÔÅ %T O ÐÒÉ ÒÅÖÉÍÅ ÚÁÍÅÝÅÎÉÑ, I ÐÒÉ ÒÅÖÉÍÅ ×ÓÔÁ×ËÉ %W W ÅÓÌÉ ÒÁÚÒÅÛÅÎ ÐÅÒÅÎÏÓ ÓÌÏ× %I A ÅÓÌÉ ÒÁÚÒÅÛÅÎ Á×ÔÏÏÔÓÔÕÐ %X éÎÄÉËÁÔÏÒ ÒÅÖÉÍÁ ÐÒÑÍÏÕÇÏÌØÎÙÈ ÂÌÏËÏ× %n éÍÑ ÆÁÊÌÁ %m '(éÚÍÅÎÅÎÏ)' ÅÓÌÉ ÆÁÊÌ ÂÙÌ ÉÚÍÅÎÅÎ %* '*' ÅÓÌÉ ÆÁÊÌ ÂÙÌ ÉÚÍÅÎÅÎ %R éÎÄÉËÁÔÏÒ ÒÅÖÉÍÁ "ÔÏÌØËÏ ÞÔÅÎÉÅ" %r îÏÍÅÒ ÓÔÒÏËÉ %c îÏÍÅÒ ËÏÌÏÎËÉ %o âÁÊÔÏ×ÏÅ ÓÍÅÝÅÎÉÅ × ÆÁÊÌÅ %O âÁÊÔÏ×ÏÅ ÓÍÅÝÅÎÉÅ × ÆÁÊÌÅ × ÛÅÓÔÎÁÄÃÁÔÉÒÉÞÎÏÍ ×ÉÄÅ %a ëÏÄ ÓÉÍ×ÏÌÁ ÎÁÄ ËÕÒÓÏÒÏÍ %A ëÏÄ ÓÉÍ×ÏÌÁ ÎÁÄ ËÕÒÓÏÒÏÍ × ÛÅÓÔÎÁÄÃÁÔÉÒÉÞÎÏÍ ×ÉÄÅ %p ðÒÏÃÅÎÔ ÆÁÊÌÁ × ÐÏÚÉÃÉÉ ËÕÒÓÏÒÁ %l ëÏÌ-×Ï ÓÔÒÏË × ÆÁÊÌÅ %k ÷×ÅÄÅÎÎÙÊ ÓÉÍ×ÏÌ-ÐÒÅÆÉËÓ %S '*SHELL*' ÅÓÌÉ × ÏËÎÅ ×ÙÐÏÌÎÑÅÔÓÑ ÛÅÌÌ %M óÏÏÂÝÅÎÉÅ Ï ÚÁÐÉÓÉ ÍÁËÒÏ %y óÉÎÔÁËÓÉÓ %x Context (first non-indented line going backwards) ôÁËÖÅ ÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÓÌÅÄÕÀÝÉÅ ËÏÄÙ: \i éÎ×ÅÒÓÉÑ \u ðÏÄÞÅÒËÉ×ÁÎÉÅ \b ðÏ×ÙÛÅÎÎÁÑ ÑÒËÏÓÔØ \d ðÏÎÉÖÅÎÎÁÑ ÑÒËÏÓÔØ \f íÅÒÃÁÎÉÅ -lmsg \i%k%T%W%I%X %n %m%y%R %M %x -rmsg %S óÔÒ %r ðÏÚ %c %t ðÏÄÓËÁÚËÁ - ÐÏ F1 ÷ôïòáñ óåëãéñ: õÓÔÁÎÏ×ËÁ ÌÏËÁÌØÎÙÈ ÏÐÃÉÊ × ÚÁ×ÉÓÉÍÏÓÔÉ ÏÔ ÉÍÅÎÉ ÆÁÊÌÁ: ëÁÖÄÁÑ ÓÔÒÏËÁ Ó ÓÉÍ×ÏÌÏÍ '*' × ÐÅÒ×ÏÊ ËÏÌÏÎËÅ ÐÒÅÄ×ÁÒÑÅÔ ÓÐÉÓÏË ÒÅÖÉÍÏ×, ËÏÔÏÒÙÅ ÄÏÌÖÎÙ ÕÓÔÁÎÁ×ÌÉ×ÁÔØÓÑ ÄÌÑ ÆÁÊÌÏ×, ÉÍÅÎÁ ËÏÔÏÒÙÈ ÓÏÏÔ×ÅÔÓÔ×ÕÀÔ ÄÁÎÎÏÍÕ ÒÅÇÕÌÑÒÎÏÍÕ ×ÙÒÁÖÅÎÉÀ. åÓÌÉ ÉÍÑ ÆÁÊÌÁ ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ ÂÏÌÅÅ ÞÅÍ ÏÄÎÏÍÕ ÒÅÇÕÌÑÒÎÏÍÕ ×ÙÒÁÖÅÎÉÀ - ×ÙÂÉÒÁÅÔÓÑ ÐÏÓÌÅÄÎÅÅ ÉÚ ÐÏÄÈÏÄÑÝÉÈ. òÅÇÕÌÑÒÎÏÅ ×ÙÒÁÖÅÎÉÅ ÓÏÄÅÒÖÉÍÏÇÏ ÆÁÊÌÁ ÔÁËÖÅ ÍÏÖÅÔ ÕËÁÚÙ×ÁÔØÓÑ × ÏÔÄÅÌØÎÏÊ ÓÔÒÏËÅ, ÎÁÞÉÎÁÀÝÅÊÓÑ Ó '+regex'. åÓÌÉ ÉÓÐÏÌØÚÕÅÔÓÑ ÔÁËÏÅ ÒÅÇÕÌÑÒÎÏÅ ×ÙÒÁÖÅÎÉÅ, ÔÏ ÄÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÕËÁÚÁÎÎÙÅ ÏÐÃÉÉ ÐÒÉÍÅÎÑÌÉÓØ Ë ÆÁÊÌÕ - ÏÎ ÄÏÌÖÅÎ ÓÏÏÔ×ÅÔÓÔ×Ï×ÁÔØ ÏÂÏÉÍ ÒÅÇÕÌÑÒÎÙÍ ×ÙÒÁÖÅÎÉÑÍ: É ÉÍÅÎÉ ÆÁÊÌÁ, É ÓÏÄÅÒÖÉÍÏÇÏ. ÷Ù ÍÏÖÅÔÅ ÕÓÔÁÎÏ×ÉÔØ ÓÌÅÄÕÀÝÉÅ ÏÐÃÉÉ: -cpara >#!;*/% Characters which can indent paragraphs. -encoding name õÓÔÁÎÏ×ÉÔØ ËÏÄÉÒÏ×ËÕ ÆÁÊÌÁ (ÎÁÐÒÉÍÅÒ: utf-8, iso-8859-15) -syntax name ïÐÒÅÄÅÌÉÔØ ÓÉÎÔÁËÓÉÓ (ÂÕÄÅÔ ÚÁÇÒÕÖÅÎ ÆÁÊÌ ÓÉÎÔÁËÓÉÓÁ 'name.jsf') -hex òÅÖÉÍ 16ÒÉÞÎÏÇÏ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ -highlight òÁÚÒÅÛÉÔØ ÐÏÄÓ×ÅÔËÕ -smarthome ëÌÁ×ÉÛÁ Home ÓÎÁÞÁÌÁ ÐÅÒÅÍÅÝÁÅÔ ËÕÒÓÏÒ × ÎÁÞÁÌÏ ÓÔÒÏËÉ, Á ÐÒÉ ÐÏ×ÔÏÒÎÏÍ ÎÁÖÁÔÉÉ - ÎÁ ÐÅÒ×ÙÊ ÎÅÐÒÏÂÅÌØÎÙÊ ÓÉÍ×ÏÌ -indentfirst ðÒÉ ×ËÌÀÞÅÎÎÏÍ ÒÅÖÉÍÅ smarthome ËÌÁ×ÉÛÁ Home ÓÎÁÞÁÌÁ ÐÅÒÅÍÅÝÁÅÔ ËÕÒÓÏÒ ÎÁ ÐÅÒ×ÙÊ ÎÅÐÒÏÂÅÌØÎÙÊ ÓÉÍ×ÏÌ ÓÔÒÏËÉ, Á ÎÅ × ÅÅ ÎÁÞÁÌÏ -smartbacks ëÌÁ×ÉÛÁ Backspace ÕÄÁÌÑÅÔ 'istep' ÓÉÍ×ÏÌÏ× ÚÁÐÏÌÎÅÎÉÑ ÏÔÓÔÕÐÁ 'indentc', ÅÓÌÉ ËÕÒÓÏÒ ÎÁÈÏÄÉÔÓÑ ÎÁ ÐÅÒ×ÏÍ ÎÅÐÒÏÂÅÌØÎÏÍ ÓÉÍ×ÏÌÅ. -tab nnn ûÉÒÉÎÁ ÔÁÂÕÌÑÃÉÉ -indentc nnn óÉÍ×ÏÌ ÚÁÐÏÌÎÅÎÉÑ ÏÔÓÔÕÐÁ (32 - ÐÒÏÂÅÌ, 9 - tab) -istep nnn ëÏÌÉÞÅÓÔ×Ï ËÏÌÏÎÏË ÏÔÓÔÕÐÁ -spaces TAB ×ÓÔÁ×ÌÑÅÔ ÐÒÏÂÅÌÙ, Á ÎÅ ÔÁÂÕÌÑÔÏÒÙ. -purify éÓÐÒÁ×ÌÑÔØ ÏÔÓÔÕÐÙ ÅÓÌÉ ÎÅÏÂÈÏÄÉÍÏ (ÎÁÐÒÉÍÅÒ, ÅÓÌÉ × ÏÔÓÔÕÐÅ ÉÍÅÀÔÓÑ É ÐÒÏÂÅÌÙ, É ÔÁÂÕÌÑÔÏÒÙ, Á indentc - ÐÒÏÂÅÌ, ÔÏ ÏÔÓÔÕÐ ÂÕÄÅÔ ÐÒÅÏÂÒÁÚÏ×ÁÎ × ÐÒÏÂÅÌÙ). -crlf ÷ ËÁÞÅÓÔ×Å ËÏÎÃÁ ÓÔÒÏËÉ ÉÓÐÏÌØÚÕÅÔÓÑ CR-LF -wordwrap ðÅÒÅÎÏÓ ÓÌÏ× -autoindent á×ÔÏÏÔÓÔÕÐ -overwrite òÅÖÉÍ ÚÁÍÅÝÅÎÉÑ -picture òÅÖÉÍ ËÁÒÔÉÎÙ (ÓÔÒÅÌËÁ ×ÐÒÁ×Ï ÍÏÖÅÔ ÕÈÏÄÉÔØ ÚÁ ËÏÎÅà ÓÔÒÏËÉ) -lmargin nnn ìÅ×ÁÑ ÇÒÁÎÉÃÁ -rmargin nnn ðÒÁ×ÁÑ ÇÒÁÎÉÃÁ -flowed Put one space after intermediate paragraph lines for support of flowed text. -french ïÄÉÎ ÐÒÏÂÅÌ ÐÏÓÌÅ '.', '?' and '!' ÐÒÉ ÐÅÒÅÎÏÓÅ ÓÌÏ× É ÆÏÒÍÁÔÉÒÏ×ÁÎÉÉ ÁÂÚÁÃÅ× ×ÍÅÓÔÏ Ä×ÕÈ. Joe ÎÅ ÉÚÍÅÎÑÅÔ ×ÁÛÅÇÏ ÓÔÉÌÑ ÒÁÓÓÔÁÎÏ×ËÉ ÐÒÏÂÅÌÏ×, ÎÏ ÉÎÏÇÄÁ ÄÏÌÖÅÎ ×ÓÔÁ×ÌÑÔØ ÐÒÏÂÅÌÙ ÓÁÍ. üÔÉÍ ËÌÀÞÏÍ ×ÙÂÉÒÁÅÔÓÑ - ÓËÏÌØËÏ ÐÒÏÂÅÌÏ× ÅÍÕ ÓÌÅÄÕÅÔ ×ÓÔÁ×ÌÑÔØ. -linums ÷ËÌÀÞÉÔØ ÎÕÍÅÒÁÃÉÀ ÓÔÒÏË -rdonly æÁÊÌ ÍÏÖÎÏ ÔÏÌØËÏ ÞÉÔÁÔØ -keymap name òÁÓËÌÁÄËÁ ËÌÁ×ÉÁÔÕÒÙ, ÅÓÌÉ ÎÅ 'main' -lmsg ïÐÒÅÄÅÌÅÎÉÅ ÓÔÒÏËÉ ÓÏÓÔÏÑÎÉÑ - ÂÏÌÅÅ ÐÏÄÒÏÂÎÏ -rmsg ÓÍ. ÐÒÅÄÙÄÕÝÕÀ ÓÅËÃÉÀ. -mfirst macro íÁËÒÏ, ×ÙÐÏÌÎÑÅÍÏÅ ÐÒÉ ÐÅÒ×ÏÊ ÍÏÄÉÆÉËÁÃÉÉ ÆÁÊÌÁ -mnew macro íÁËÒÏ, ×ÙÐÏÌÎÑÅÍÏÅ ÐÒÉ ÚÁÇÒÕÚËÅ ÎÏ×ÏÇÏ ÆÁÊÌÁ -mold macro íÁËÒÏ, ×ÙÐÏÌÎÑÅÍÏÅ ÐÒÉ ÚÁÇÒÕÚËÅ ÓÕÝÅÓÔ×ÕÀÝÅÇÏ ÆÁÊÌÁ -msnew macro íÁËÒÏ, ×ÙÐÏÌÎÑÅÍÏÅ ÐÒÉ ÓÏÈÒÁÎÅÎÉÉ ÎÏ×ÏÇÏ ÆÁÊÌÁ -msold macro íÁËÒÏ, ×ÙÐÏÌÎÑÅÍÏÅ ÐÒÉ ÓÏÈÒÁÎÅÎÉÉ ÓÕÝÅÓÔ×ÕÀÝÅÇÏ ÆÁÊÌÁ íÁËÒÏÓÙ, ÉÓÐÏÌØÚÕÅÍÙÅ × ÐÒÉ×ÅÄÅÎÎÙÈ ×ÙÛÅ ÏÐÃÉÑÈ, ÏÐÉÓÙ×ÁÀÔÓÑ ÔÁË ÖÅ, ËÁË É ÒÁÓËÌÁÄËÉ ËÌÁ×ÉÁÔÕÒÙ × ÐÏÓÌÅÄÕÀÝÅÍ ÒÁÚÄÅÌÅ, ÎÏ ÂÅÚ ÓÔÒÏË ÉÍÅÎ ËÌÁ×ÉÛ. These define the language syntax for ^G (goto matching delimiter): -single_quoted ôÅËÓÔ ×ÎÕÔÒÉ ' ' ÓÌÅÄÕÅÔ ÉÇÎÏÒÉÒÏ×ÁÔØ (ÜÔÏ ÎÅ ÏÞÅÎØ ÈÏÒÏÛÏ ÄÌÑ ÏÂÙÞÎÏÇÏ ÔÅËÓÔÁ, Ô.Ë. ' × ÎÅÍ ÍÏÖÅÔ ÉÓÐÏÌØÚÏ×ÁÔØÓÑ × ËÁÞÅÓÔ×Å ÁÐÏÓÔÒÏÆÁ) -c_comment ôÅËÓÔ ×ÎÕÔÒÉ /* */ ÓÌÅÄÕÅÔ ÉÇÎÏÒÏÉÒÏ×ÁÔØ -cpp_comment ôÅËÓÔ ÐÏÓÌÅ // ÓÌÅÄÕÅÔ ÉÇÎÏÒÉÒÏ×ÁÔØ -pound_comment ôÅËÓÔ ÐÏÓÌÅ # ÓÌÅÄÕÅÔ ÉÇÎÏÒÉÒÏ×ÁÔØ -vhdl_comment ôÅËÓÔ ÐÏÓÌÅ -- ÓÌÅÄÕÅÔ ÉÇÎÏÒÉÒÏ×ÁÔØ -semi_comment ôÅËÓÔ ÐÏÓÌÅ ; ÓÌÅÄÕÅÔ ÉÇÎÏÒÉÒÏ×ÁÔØ -text_delimiters begin=end:if=elif=else=endif ïÐÒÅÄÅÌÑÅÔ ÓÌÏ×Á-ÏÇÒÁÎÉÞÉÔÅÌÉ ìÏËÁÌØÎÙÅ ÏÐÃÉÉ ÐÏ ÕÍÏÌÞÁÎÉÀ -highlight -istep 2 éÓÐÏÌØÚÕÊÔÅ ÜÔÏ ÍÁËÒÏ (ÐÏÍÅÓÔÉÔÅ × ÐÅÒ×ÕÀ ËÏÌÏÎËÕ) ÞÔÏÂÙ ÚÁÓÔÁ×ÉÔØ joe ×ÙÚÙ×ÁÔØ ËÏÍÁÎÄÕ "p4 edit" ÄÌÑ ÉÚÍÅÎÅÎÎÏÇÏ ÆÁÊÌÁ. -mfirst if,"rdonly && joe(sys,\"p4 edit \",name,rtn)",then,mode,"o",msg,"executed \"p4 edit ",name,"\"",rtn,endif ôÁÂÌÉÃÁ ÔÉÐÏ× ÆÁÊÌÏ× ÔÅÐÅÒØ ÎÁÈÏÄÉÔÓÑ × ÏÔÄÅÌØÎÏÍ ÆÁÊÌÅ. ÷Ù ÍÏÖÅÔÅ ÓËÏÐÉÒÏ×ÁÔØ ÅÇÏ × ~/.joe É ÎÁÓÔÒÏÉÔØ. :include ftyperc SECOND and 1/2 SECTION: Option menu layout :defmenu name Defines a menu. macro string comment A menu entry. Macro is any JOE macro- see "Macros:" below. String is the label to be used for the macro in the menu. It is in the same format as the -lmsg and -rmsg options above. Two whitespace characters in a row begins a comment. Use '% ' for a leading space in the string. :defmenu root mode,"overwrite",rtn T Overtype %Zoverwrite% mode,"hex",rtn % % Hex edit mode mode,"autoindent",rtn I Autoindent %Zautoindent% mode,"wordwrap",rtn W Word wrap %Zwordwrap% mode,"tab",rtn D Tab width %Ztab% mode,"lmargin",rtn L Left margin %Zlmargin% mode,"rmargin",rtn R Right margin %Zrmargin% mode,"square",rtn X Rectangle mode %Zsquare% mode,"indentc",rtn % % Indent char %Zindentc% mode,"istep",rtn % % Indent step %Zistep% mode,"highlight",rtn H Highlighting %Zhighlight% mode,"crlf",rtn Z CR-LF (MS-DOS) %Zcrlf% mode,"linums",rtn N Line numbers %Zlinums% mode,"beep",rtn B Beep %Zbeep% mode,"rdonly",rtn O Read only %Zrdonly% mode,"syntax",rtn Y Syntax mode,"encoding",rtn E Encoding mode,"asis",rtn % % Meta chars as-is mode,"language",rtn V Language mode,"picture",rtn P picture %Zpicture% menu,"more-options",rtn % % More options... :defmenu more-options menu,"^G",rtn % % ^G options menu,"search",rtn % % search options menu,"paragraph",rtn % % paragraph options menu,"file",rtn % % file options menu,"menu",rtn % % menu options menu,"global",rtn % % global options menu,"cursor",rtn % % cursor options menu,"marking",rtn % % marking options menu,"tab",rtn % % tab/indent options :defmenu menu mode,"menu_explorer",rtn % % Menu explorer %Zmenu_explorer% mode,"menu_above",rtn % % Menu position %Zmenu_above% mode,"menu_jump",rtn % % Jump into menu %Zmenu_jump% mode,"transpose",rtn % % Transpose menus %Ztranspose% :defmenu ^G mode,"single_quoted",rtn % % ^G ignores '...' %Zsingle_quoted% mode,"no_double_quoted",rtn % % ^G no ignore "..." %Zno_double_quoted% mode,"c_comment",rtn % % ^G ignores /*...*/ %Zc_comment% mode,"cpp_comment",rtn % % ^G ignores //... %Zcpp_comment% mode,"pound_comment",rtn % % ^G ignores #... %Zpound_comment% mode,"vhdl_comment",rtn % % ^G ignores --... %Zvhdl_comment% mode,"semi_comment",rtn % % ^G ignores ;... %Zsemi_comment% mode,"tex_comment",rtn % % ^G ignores %... %Ztex_comment% mode,"text_delimiters",rtn % % Text delimiters %Ztext_delimiters% :defmenu search mode,"icase",rtn % % Case insensitivity %Zicase% mode,"wrap",rtn % % Search wraps %Zwrap% mode,"search_prompting",rtn % % Search prompting %Zsearch_prompting% mode,"csmode",rtn % % Continued search %Zcsmode% :defmenu paragraph mode,"french",rtn % % French spacing %Zfrench% mode,"flowed",rtn % % Flowed text %Zflowed% mode,"cpara",rtn % % Paragraph indent chars %Zcpara% :defmenu file mode,"restore",rtn % % Restore cursor %Zrestore% mode,"guess_crlf",rtn % % Auto detect CR-LF %Zguess_crlf% mode,"guess_indent",rtn % % Guess indent %Zguess_indent% mode,"guess_non_utf8",rtn % % Guess non-UTF-8 %Zguess_non_utf8% mode,"guess_utf8",rtn % % Guess UTF-8 %Zguess_utf8% mode,"force",rtn % % Force last NL %Zforce% mode,"nobackup",rtn % % No backup %Znobackup% :defmenu global mode,"nolocks",rtn % % Disable locks %Znolocks% mode,"nobackups",rtn % % Disable backups %Znobackups% mode,"nomodcheck",rtn % % Disable mtime check %Znomodcheck% mode,"nocurdir",rtn % % Disable current dir %Znocurdir% mode,"exask",rtn % % Exit ask %Zexask% mode,"nosta",rtn % % Disable status line %Znosta% mode,"keepup",rtn % % Fast status line %Zkeepup% mode,"break_hardlinks",rtn % % Break hard links %Zbreak_hardlinks% mode,"break_links",rtn % % Break links %Zbreak_links% mode,"joe_state",rtn % % Joe_state file %Zjoe_state% mode,"undo_keep",rtn % % No. undo records %Zundo_keep% mode,"backpath",rtn % % Path to backup files %Zbackpath% :defmenu cursor mode,"pg",rtn % % No. PgUp/PgDn lines %Zpg% mode,"mid",rtn C Center on scroll %Zmid% mode,"floatmouse",rtn % % Click past end %Zfloatmouse% mode,"rtbutton",rtn % % Right button %Zrtbutton% :defmenu marking mode,"autoswap",rtn % % Autoswap mode %Zautoswap% mode,"marking",rtn % % Marking %Zmarking% mode,"lightoff",rtn % % Auto unmask %Zlightoff% :defmenu tab mode,"smarthome",rtn % % Smart home key %Zsmarthome% mode,"smartbacks",rtn % % Smart backspace %Zsmartbacks% mode,"indentfirst",rtn % % To indent first %Zindentfirst% mode,"purify",rtn % % Clean up indents %Zpurify% mode,"spaces",rtn % % No tabs %Zspaces% ôòåôøñ óåëãéñ: üËÒÁÎÙ ÐÏÄÓËÁÚËÉ: éÓÐÏÌØÚÕÊÔÅ \i ÄÌÑ ×ËÌ/×ÙËÌ ÉÎ×ÅÒÓÉÉ éÓÐÏÌØÚÕÊÔÅ \u ÄÌÑ ×ËÌ/×ÙËÌ ÐÏÄÞÅÒËÉ×ÁÎÉÑ éÓÐÏÌØÚÕÊÔÅ \b ÄÌÑ ×ËÌ/×ÙËÌ ÐÏ×ÙÛÅÎÎÏÊ ÑÒËÏÓÔÉ éÓÐÏÌØÚÕÊÔÅ \d ÄÌÑ ×ËÌ/×ÙËÌ ÐÏÎÉÖÅÎÎÏÊ ÑÒËÏÓÔÉ éÓÐÏÌØÚÕÊÔÅ \f ÄÌÑ ×ËÌ/×ÙËÌ ÍÅÒÃÁÎÉÑ éÓÐÏÌØÚÕÊÔÅ \| ÄÌÑ ×ÓÔÁ×ËÉ ÐÒÕÖÉÎËÉ: ×ÓÅ ÐÒÕÖÉÎËÉ × ÓÔÒÏËÅ ÕÓÔÁÎÁ×ÌÉ×ÁÀÔÓÑ ÎÁ ÏÄÉÎÁËÏ×ÕÀ ÛÉÒÉÎÕ, ÞÔÏÂÙ ÓÔÒÏËÁ ÒÁÓÔÑÇÉ×ÁÌÁÓØ ÎÁ ×ÓÀ ÛÉÒÉÎÕ ÜËÒÁÎÁ (ÅÓÌÉ ËÒÁÔÎÏÓÔØ ÎÅ ÐÏÌÕÞÁÅÔÓÑ É ÏÓÔÁÅÔÓÑ N ÐÒÏÂÅÌÏ×, ÔÏ ËÁÖÄÁÑ ÉÚ N ÐÒÕÖÉÎÏË ÓÐÒÁ×Á ÄÏÐÏÌÎÑÅÔÓÑ ÅÝÅ ÏÄÎÉÍ ÐÒÏÂÅÌÏÍ). óÏ×ÅÔ: ÅÓÌÉ ÔÒÅÂÕÅÔÓÑ ×ÅÒÔÉËÁÌØÎÏÅ ×ÙÒÁ×ÎÉ×ÁÎÉÅ - × ËÁÖÄÏÊ ÓÔÒÏËÅ ÄÏÌÖÎÏ ÂÙÔØ ÏÄÉÎÁËÏ×ÏÅ ËÏÌÉÞÅÓÔ×Ï ÐÒÕÖÉÎÏË. éÓÐÏÌØÚÕÊÔÅ ÇÌÏÂÁÌØÎÕÀ ÏÐÃÉÀ '-help_is_utf8' ÞÔÏÂÙ ÒÁÚÒÅÛÉÔØ UTF-8 × ÔÅËÓÔÅ ÐÏÄÓËÁÚËÉ. éÎÁÞÅ ÐÒÅÄÐÏÌÁÇÁÅÔÓÑ ÌÏËÁÌØÎÁÑ 8-ÂÉÔÎÁÑ ËÏÄÉÒÏ×ËÁ. {Basic \i ïËÎÏ ðïäóëáúëé - \|×ÙËÌÀÞÉÔØ ÐÏ F1 ÓÌÅÄ.ÜËÒÁÎ - ^N \i \i \i\|\uðåòåèïäù\u \|\uðåòåèïäù\u \|\uâìïëé\u \|\uõäáìåîéå\u \|\uðòïþåå\u \|\u÷ùèïä\u \|\i \i \i \i\|^B left ^F right \|^U prev. screen \|^KB begin \|^D char. \|^KJ reformat \|^KX save \|\i \i \i \i\|\b^Z\b ÐÒÅÄ. ÓÌÏ×Ï \|\bPgUp\b ÐÒÅÄ. ÜËÒÁÎ \|\bF3\b ÎÁÞÁÌÏ \|\bDel\b ÓÉÍ×.\|\b^KJ\b ÆÏÒÍÁÔ \|\bF10\b ÓÏÈÒ. \|\i \i \i \i\|\b^X\b ÓÌÅÄ. ÓÌÏ×Ï \|\bPgDn\b ÓÌÅÄ. ÜËÒÁÎ \|\bS/F3\b ËÏÎÅà \|\b^Y\b ÓÔÒ. \|\b^T\b ÒÅÖÉÍÙ \|\b^C\b ÐÒÅÒ×.\|\i \i \i \i\| \|\bHome\b ÎÁÞ. ÓÔÒÏËÉ \|\bF6\b ÐÅÒÅÎÏÓ \|\b^W\b >ÓÌÏ×Ï \|\b^R\b ÐÅÒÅÒÉÓ. \|\b^KZ\b shell \|\i \i \i \i\| \|\bEnd\b ËÏÎ. ÓÔÒÏËÉ \|\bF5\b ËÏÐÉÒ. \|\b^O\b ÓÌÏ×Ï< \|\b^@\b ×ÓÔÁ×ËÁ \|\uæáêì\u \|\i \i \i \i\|\uðïéóë\u \|\bF2\b ÎÁÞÁÌÏ ÆÁÊÌÁ \|\bS/F5\b × ÆÁÊÌ \|\b^J\b >ÓÔÒ. \|\uSPELL\u \|\b^KE\b ÎÏ×ÙÊ \|\i \i \i \i\|\bS/F7\b ÐÏ ÏÂÒÁÚÃÕ \|\bS/F2\b ËÏÎÅà ÆÁÊÌÁ \|\bS/F6\b ÕÄÁÌ. \|\b^_\b ÏÔÍÅÎ. \|\b^[N\b ÓÌÏ×Á \|\b^KR\b ÞÉÔÁÔØ\|\i \i \i \i\|\bF7\b ÓÌÅÄÕÀÝÉÊ \|\b^L\b ÎÁ ÓÔÒÏËÕ No. \|\b^K/\b ÆÉÌØÔÒ \|\b^^\b ÎÅ ÏÔÍ \|\b^[L\b ÆÁÊÌÁ \|\bS/F10\b ÐÉÓÁÔØ\|\i \i } {Windows \i ïËÎÏ ðïäóëáúëé - \|×ÙËÌÀÞÉÔØ ÐÏ F1 ÐÒÅÄ.ÜËÒÁÎ - ^P ÓÌÅÄ. ÜËÒÁÎ ^N \i \i \i\b\|^KO\b òÁÚÒÅÚÁÔØ ÏËÎÏ ÐÏÐÏÌÁÍ \|\b^KE\b úÁÇÒÕÚÉÔØ ÆÁÊÌ × ÏËÎÏ \|\i \i \i \i\b\|^KG\b õ×ÅÌÉÞÉÔØ ÔÅËÕÝÅÅ ÏËÎÏ \|\b^KT\b õÍÅÎØÛÉÔØ ÔÅËÕÝÅÅ ÏËÎÏ \|\i \i \i \i\b\|^KN\b ðÅÒÅÊÔÉ × ÎÉÖÎÅÅ ÏËÎÏ \|\b^KP\b ðÅÒÅÊÔÉ × ×ÅÒÈÎÅÅ ÏËÎÏ \|\i \i \i \i\b\|^C\b õÄÁÌÉÔØ ÔÅËÕÝÅÅ ÏËÎÏ \|\b^KI\b ðÏËÁÚÁÔØ ×ÓÅ ÏËÎÁ / ÏÄÎÏ ÏËÎÏ \|\i \i } {Advanced \i ïËÎÏ ðïäóëáúëé - \|×ÙËÌÀÞÉÔØ ÐÏ F1 ÐÒÅÄ.ÜËÒÁÎ - ^P ÓÌÅÄ. ÜËÒÁÎ ^N \i \i \i\|\uíáëòï\u \|\uðòïþåå\u \|\uðòïëòõôëá\u \|\uSHELL\u \|\uGOTO\u \|\uI-SEARCH\u \|\i \i \i \i\b\|^K[ 0-9\b îÁÞÁÌÏ \|\b^K\b ðòâì ÓÔÁÔÕÓ \|\b^[W\b ÷×ÅÒÈ \|\b^K'\b ÷ ÏËÎÅ \|\b^[B\b To ^KB \|\b^[R\b îÁÚÁÄ \|\i \i \i \i\b\|^K]\b ëÏÎÅà \|\b^K\\\b ðÏ×ÔÏÒ \|\b^[Z\b ÷ÎÉÚ \|\b^[!\b ëÏÍÁÎÄÁ \|\b^[K\b To ^KK \|\b^[S\b ÷ÐÅÒÅÄ \|\i \i \i \i\b\|^K 0-9\b ÷ÙÐÏÌÎ.\|\b^[M\b ëÁÌØËÕÌÑÔÏÒ \|\b^K<\b ÷ÌÅ×Ï \|\uQUOTE\u \|\uõäáìåîéå\u \|\uíåôëé\u \|\i \i \i \i\b\|^K?\b Query \|\b^KA\b ãÅÎÔÒÉÒÏ×. \|\b^K>\b ÷ÐÒÁ×Ï\|\b`\b Ctrl- \|\b^[Y\b ÏÔÍÅÎÁ \|\b^[ 0-9\b Goto \|\i \i \i \i\b\|^[D\b äÁÍÐ \|\b^[H\b óÏÏÂÝÅÎÉÅ \| \|\b^\\\b Meta- \|\b^[O\b ÓÔÒ.< \|\b^[^[\b õÓÔÁÎÏ×.\i \|\i } {Programs \i ïËÎÏ ðïäóëáúëé - \|×ÙËÌÀÞÉÔØ ÐÏ F1 ÐÒÅÄ.ÜËÒÁÎ - ^P ÓÌÅÄ. ÜËÒÁÎ ^N \i \i \i\|\uðåòåèïäù\u \|\uóä÷éç\u \|\uCOMPILING\u \|\i \i \i \i\b\|^G\b ë ÓÏÏÔ×. ( [ { \|\b^K,\b ×ÌÅ×Ï \|\b^[C\b Compile and parse errors \|\i \i \i \i\b\|^K-\b îÁ ÐÒÅÖÎÅÅ ÍÅÓÔÏ \|\b^K.\b ×ÐÒÁ×Ï \|\b^[E\b Parse errors \|\i \i \i \i\b\|^K=\b îÁ ÓÌÅÄ. ÍÅÓÔÏ \| \|\b^[=\b To next error \|\i \i \i \i\b\|^K;\b ðÏÉÓË ÆÁÊÌÁ ÔÁÇÏ× \| \|\b^[-\b To prev. error \|\i \i } {Search \i ïËÎÏ ðïäóëáúëé - \|×ÙËÌÀÞÉÔØ ÐÏ F1 ÐÒÅÄ.ÜËÒÁÎ - ^P ÓÌÅÄ. ÜËÒÁÎ ^N \i \i \ióÐÅÃÉÁÌØÎÙÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÉ ÐÏÉÓËÁ: \|\i \i \i \i \b\\^ \\$\b ÎÁÞÁÌÏ/ËÏÎÅà ÓÔÒÏËÉ \b\\?\b ÌÀÂÏÊ ÏÄÉÎÏÞÎÙÊ ÓÉÍ×ÏÌ \|\i \i \i \i \b\\< \\>\b ÎÁÞÁÌÏ/ËÏÎÅà ÓÌÏ×Á \b\\*\b 0 ÉÌÉ ÂÏÌÅÅ ÓÉÍ×ÏÌÏ× \|\i \i \i \i \b\\c\b ÓÂÁÌÁÎÓÉÒÏ×ÁÎÎÏÅ ×ÙÒÁÖÅÎÉÅ C \b\\\\\b ÓÉÍ×ÏÌ \\ \|\i \i \i \i \b\\[..]\b ÏÄÉÎ ÉÚ ÜÌÅÍÅÎÔÏ× ÍÎÏÖÅÓÔ×Á \b\\n\b ÐÅÒÅ×ÏÄ ÓÔÒÏËÉ \|\i \i \i \i \b\\+\b 0 ÉÌÉ ÂÏÌÅÅ ÓÉÍ×ÏÌÏ×, ÓÌÅÄÕÀÝÉÈ ÚÁ \\+ \|\i \i \i \ióÐÅÃÉÁÌØÎÙÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÉ ÚÁÍÅÝÅÎÉÑ: \|\i \i \i \i \b\\&\b ÚÁÍÅÝÁÔØ ÔÅËÓÔÏÍ, ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÍ ÓÔÒÏËÅ ÐÏÉÓËÁ \|\i \i \i \i \b\\0 - 9\b ÚÁÍÅÝÁÔØ ÔÅËÓÔÏÍ, ÓÏÏÔ×. n-ÎÏÍÕ \b\\*\b, \b\\?\b, \b\\c\b, \b\\+\b, ÉÌÉ \b\\[..]\b \|\i \i \i \i \b\\\\\b ÚÁÍÅÝÁÔØ ÓÉÍ×ÏÌÏÍ \\ \b\\n\b ÚÁÍÅÝÁÔØ ÐÅÒÅ×ÏÄÏÍ ÓÔÒÏËÉ \|\i \i } {SearchOptions \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \iSearch options: \|\i \i \i \i r Replace \|\i \i \i \i k Restrict search to highlighted block, which can be rectangular \|\i \i \i \i b Search backward instead of forward \|\i \i \i \i i Ignore case \|\i \i \i \i a Search across all loaded files \|\i \i \i \i e Search across all files in Grep or Compile error list \|\i \i \i \i w Wrap to beginning of file for this search \|\i \i \i \i n Do not wrap to beginning of file for this search \|\i \i \i \i nnn Perform exaclty nnn replacements \|\i \i } {Math \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \i \uCOMMANDS\u (hit ESC m for math) \uFUNCTIONS\u \|\i \i \i \i hex hex display mode sin cos tab asin acos atan \|\i \i \i \i dec decimal mode sinh cosh tanh asinh acosh atanh \|\i \i \i \i ins type result into file sqrt cbrt exp ln log \|\i \i \i \i eval evaluate block int floor ceil abs erg ergc \|\i \i \i \i 0xff enter number in hex joe(..macro..) - runs an editor macro \|\i \i \i \i 3e-4 floating point decimal \uBLOCK\u \|\i \i \i \i a=10 assign a variable sum cnt Sum, count \|\i \i \i \i 2+3:ins multiple commands avg dev Average, std. deviation \|\i \i \i \i e pi constants \uOPERATORS\u \|\i \i \i \i ans previous result ! ^ * / % + - < <= > >= == != && || ? :\|\i \i } {Names \i ïËÎÏ ðïäóëáúëé - \|×ÙËÌÀÞÉÔØ ÐÏ F1 ÐÒÅÄ.ÜËÒÁÎ - ^P ÓÌÅÄ. ÜËÒÁÎ ^N \i \i \i îÁÖÍÉÔÅ TAB ÎÁ ÚÁÐÒÏÓ ÉÍÅÎÉ ÆÁÊÌÁ ÄÌÑ ÇÅÎÅÒÁÃÉÉ ÍÅÎÀ ÉÍÅÎ ÆÁÊÌÏ× \|\i \i \i \i éÌÉ ÉÓÐÏÌØÚÕÊÔÅ ËÌÁ×ÉÛÉ ××ÅÒÈ/×ÎÉÚ ÄÌÑ ×ÙÂÏÒÁ ÉÚ ÒÁÎÅÅ ××ÏÄÉ×ÛÉÈÓÑ ÉÍÅÎ \|\i \i \i \i óÐÅÃÉÁÌØÎÙÅ ÉÍÅÎÁ ÆÁÊÌÏ×: \|\i \i \i \i !command ëÁÎÁÌ ×/ÉÚ ËÏÍÁÎÄÙ ÛÅÌÌÁ \|\i \i \i \i >>filename äÏÂÁ×ÌÑÔØ Ë ÆÁÊÌÕ \|\i \i \i \i - þÉÔÁÔØ/ðÉÓÁÔØ ×/ÉÚ ÓÔÁÎÄÁÒÔÎÏÇÏ ×ÈÏÄÁ/×ÙÈÏÄÁ \|\i \i \i \i filename,START,SIZE þÉÔÁÔØ/ðÉÓÁÔØ ÞÁÓÔØ ÆÁÊÌÁ/ÕÓÔÒÏÊÓÔ×Á \|\i \i \i \i úÁÄÁÊÔÅ START/SIZE × 10-ÎÏÍ (255), 8-ÎÏÍ (0377) ÉÌÉ 16-ÎÏÍ (0xFF) \|\i \i } {Joe \i ïËÎÏ ðïäóëáúëé - \|×ÙËÌÀÞÉÔØ ÐÏ F1 ÐÒÅÄ.ÜËÒÁÎ - ^P ÓÌÅÄ. ÜËÒÁÎ ^N \i \i \i Send bug reports to: http://sourceforge.net/projects/joe-editor \|\i \i \i \i \|\i \i \i \i default joerc file is here @JOERC@/joerc \|\i \i \i \i default syntax and i18n files are here @JOEDATA@ \|\i \i \i \i additional documentation can be found here @JOEDOC@ \|\i \i } {CharTable \i Help Screen \|turn off with F1 prev. screen ^P \i \i \i\| Dec \u 0123 4567 8901 2345 0123 4567 8901 2345 \u Dec \|\i \i \i \i\| | | \|\i \i \i \i\| 0 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \i\u@ABC\u\i \i\uDEFG\u\i \i\uHIJK\u\i \i\uLMNO\u\i | 128 \|\i \i \i \i\| 16 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \i\uPQRS\u\i \i\uTUVW\u\i \i\uXYZ[\u\i \i\u\\]^_\u\i | 144 \|\i \i \i \i\| 32 | !"# $%&' ()*+ ,-./  ¡¢£ ¤¥¦§ ¨©ª« ¬­®¯ | 160 \|\i \i \i \i\| 48 | 0123 4567 89:; <=>? °±²³ ´µ¶· ¸¹º» ¼½¾¿ | 176 \|\i \i \i \i\| 64 | @ABC DEFG HIJK LMNO ÀÁÂà ÄÅÆÇ ÈÉÊË ÌÍÎÏ | 192 \|\i \i \i \i\| 80 | PQRS TUVW XYZ[ \\]^_ ÐÑÒÓ ÔÕÖ× ØÙÚÛ ÜÝÞß | 208 \|\i \i \i \i\| 96 | `abc defg hijk lmno àáâã äåæç èéêë ìíîï | 224 \|\i \i \i \i\| 112 | pqrs tuvw xyz{ |}~ ðñòó ôõö÷ øùúû üýþÿ | 240 \|\i \i } þåô÷åòôáñ óåëãéñ: òÁÓËÌÁÄËÉ ËÌÁ×ÉÁÔÕÒÙ: ÷Ù ÄÏÌÖÎÙ ÏÐÉÓÁÔØ ÓÅËÃÉÉ ÓÏ ÓÌÅÄÕÀÝÉÍÉ ÉÍÅÎÁÍÉ: :main äÌÑ ÏËÎÁ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ :prompt äÌÑ ÓÔÒÏË ÚÁÐÒÏÓÏ× :query For single-character query lines :querya Singe-character query for quote :querysr Search & Replace single-character query ðÒÏÞÉÅ ÓÅËÃÉÉ ÔÁËÖÅ ÍÏÇÕÔ ÂÙÔØ ÏÐÒÅÄÅÌÅÎÙ ÄÌÑ ÏÒÇÁÎÉÚÁÃÉÏÎÎÙÈ ÃÅÌÅÊ ÉÌÉ ÄÌÑ ÉÓÐÏÌØÚÏ×ÁÎÉÑ Ó ËÌÀÞÏÍ '-keymap'. éÓÐÏÌØÚÕÊÔÅ: :inherit name äÌÑ ËÏÐÉÒÏ×ÁÎÉÑ ÓÅËÃÉÉ name × ÔÅËÕÝÕÀ :delete key õÄÁÌÉÔØ ËÌÁ×ÉÛÕ ÉÚ ÔÅËÕÝÅÊ ÓÅËÃÉÉ ëÌÁ×ÉÛÉ: éÓÐÏÌØÚÕÊÔÅ ^@ - ^_, ^# É ^? ÄÌÑ ÏÂÏÚÎÁÞÅÎÉÑ ÕÐÒÁ×ÌÑÀÝÉÈ ÓÉÍ×ÏÌÏ× éÓÐÏÌØÚÕÊÔÅ SP ÄÌÑ ÏÂÏÚÎÁÞÅÎÉÑ ÐÒÏÂÅÌÁ éÓÐÏÌØÚÕÊÔÅ TO b ÄÌÑ ÇÅÎÅÒÁÃÉÉ ÄÉÁÐÁÚÏÎÁ ÓÉÍ×ÏÌÏ× éÓÐÏÌØÚÕÊÔÅ MDOWN, MDRAG, MUP, M2DOWN, M2DRAG, M2UP, M3DOWN, M3DRAG, M3UP ÄÌÑ ÍÙÛÉ éÓÐÏÌØÚÕÊÔÅ MWDOWN, MWUP ÄÌÑ ËÏÌÅÓÁ ÍÙÛÉ ÷Ù ÔÁËÖÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÉÍÅÎÁ ÏÐÉÓÁÎÉÑ termcap. îÁÐÒÉÍÅÒ: .ku óÔÒÅÌËÁ ××ÅÒÈ .kd óÔÒÅÌËÁ ×ÎÉÚ .kl óÔÒÅÌËÁ ×ÌÅ×Ï .kr óÔÒÅÌËÁ ×ÐÒÁ×Ï .kh Home .kH End .kI Insert .kD Delete .kP PgUp .kN PgDn .k1 - .k9 F1 - F9 .k0 F0 ÉÌÉ F10 .k; F10 íÁËÒÏÓÙ: ðÒÏÓÔÏÊ ÍÁËÒÏÓ ÍÏÖÅÔ ÂÙÔØ ÏÐÒÅÄÅÌÅÎ Ä×ÕÍÑ ÉÌÉ ÂÏÌÅÅ ÉÍÅÎÁÍÉ ËÏÍÁÎÄ, ÒÁÚÄÅÌÅÎÎÙÍÉ ÚÁÐÑÔÙÍÉ. îÁÐÒÉÍÅÒ: eof,bol ^T Z ðÅÒÅÊÔÉ × ÎÁÞÁÌÏ ÓÌÅÄÕÀÝÅÊ ÓÔÒÏËÉ Also quoted matter is typed in literally: bol,">",dnarw .k1 Quote news article line íÁËÒÏÓ ÍÏÖÅÔ ÐÅÒÅÎÏÓÉÔØÓÑ ÎÁ ÓÌÅÄÕÀÝÕÀ ÓÔÒÏËÕ, ÅÓÌÉ ÚÁËÁÎÞÉ×ÁÅÔÓÑ ÚÁÐÑÔÏÊ ëÏÍÁÎÄÙ ÉÌÉ ÉÍÅÎÏ×ÁÎÎÙÅ ÍÁËÒÏÓÙ ÍÏÇÕÔ ÂÙÔØ ÓÏÚÄÁÎÙ Ó ÐÏÍÏÝØÀ :def. îÁÐÒÉÍÅÒ, ×Ù ÍÏÖÅÔÅ ÕËÁÚÁÔØ: :def foo eof,bol ÄÌÑ ÏÐÒÅÄÅÌÅÎÉÑ ËÏÍÁÎÄÙ foo, ËÏÔÏÒÁÑ ÂÕÄÅÔ ×ÙÐÏÌÎÑÔØ ÐÅÒÅÈÏÄ Ë ÎÁÞÁÌÕ ÓÌÅÄÕÀÝÅÊ ÓÔÒÏËÉ. :windows ïÂÝÉÅ ËÌÁ×ÉÛÉ ÄÌÑ ×ÓÅÈ ÏËÏÎ type ^@ TO ÿ îÁÐÅÞÁÔÁÔØ ÓÉÍ×ÏÌ abort ^C á×ÁÒÉÊÎÏÅ ÐÒÅÒÙ×ÁÎÉÅ abort ^K Q abort ^K ^Q abort ^K q arg ^K \ ðÏ×ÔÏÒ ÓÌÅÄÕÀÝÅÊ ËÏÍÁÎÄÙ explode ^K I ðÏËÁÚÙ×ÁÔØ ×ÓÅ ÏËÎÁ ÉÌÉ ÔÏÌØËÏ ÏÄÎÏ explode ^K ^I explode ^K i help .k1 help .k8 help .k9 help .F1 help .F4 help .F8 help .F9 help .FB help .FC help ^K H ðÏÄÓËÁÚËÁ help ^K ^H help ^K h hnext ^N óÌÅÄÕÀÝÁÑ ÓÔÒÁÎÉÃÁ ÐÏÄÓËÁÚËÉ hprev ^P ðÒÅÄÙÄÕÝÁÑ ÓÔÒÁÎÉÃÁ ÐÏÄÓËÁÚËÉ math ^[ m ëÁÌØËÕÌÑÔÏÒ math ^[ M ëÁÌØËÕÌÑÔÏÒ math ^[ ^M ëÁÌØËÕÌÑÔÏÒ msg ^[ h ÷Ù×ÏÄ ÓÏÏÂÝÅÎÉÑ msg ^[ H ÷Ù×ÏÄ ÓÏÏÂÝÅÎÉÑ msg ^[ ^H ÷Ù×ÏÄ ÓÏÏÂÝÅÎÉÑ nextw ^K N îÁ ÓÌÅÄÕÀÝÅÅ ÏËÎÏ nextw ^K ^N nextw ^K n nextw ^[ [ 1 ; 3 C ÐÒÁ×ÙÊ Alt × (ÎÏ×ÏÍ) xterm nextw ^[ [ 3 C ÐÒÁ×ÙÊ Alt × gnome-terminal pgdn .kN îÁ ÜËÒÁÎ ×ÎÉÚ pgdn ^V pgdn ^# S pgup .kP îÁ ÜËÒÁÎ ××ÅÒÈ pgup ^U pgup ^# T play ^K 0 TO 9 ÷ÙÐÏÌÎÉÔØ ÍÁËÒÏ prevw ^K P îÁ ÓÌÅÄÕÀÝÅÅ ÏËÎÏ prevw ^K ^P prevw ^K p prevw ^[ [ 1 ; 3 D ìÅ×ÙÊ Alt × (ÎÏ×ÏÍ) xterm prevw ^[ [ 3 D ìÅ×ÙÊ Alt × gnome-terminal query ^K ? Macro query insert record ^K [ úÁÐÉÓÁÔØ ÍÁËÒÏ retype ^R ðÅÒÅÒÉÓÏ×ËÁ ÜËÒÁÎÁ rtn ^M ðÅÒÅ×ÏÄ ÓÔÒÏËÉ shell ^K Z ÷ÙÈÏÄ × ÛÅÌÌ shell ^K ^Z shell ^K z stop ^K ] ëÏÎÅà ÚÁÐÉÓÉ ÍÁËÒÏ õÐÒÁ×ÌÅÎÉÅ ÍÙÛØÀ defmdown MDOWN ðÅÒÅÍÅÓÔÉÔØ ËÕÒÓÏÒ × ÐÏÚÉÃÉÀ ÍÙÛÉ defmup MUP defmdrag MDRAG ïÔÍÅÔÉÔØ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔØ ÓÉÍ×ÏÌÏ× defm2down M2DOWN ïÔÍÅÔÉÔØ ÓÌÏ×Ï × ÐÏÚÉÃÉÉ ÍÙÛÉ defm2up M2UP defm2drag M2DRAG ïÔÍÅÔÉÔØ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔØ ÓÌÏ× defm3down M3DOWN ïÔÍÅÔÉÔØ ÓÔÒÏËÕ × ÐÏÚÉÃÉÉ ÍÙÛÉ defm3up M3UP defm3drag M3DRAG ïÔÍÅÔÉÔØ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔØ ÓÔÒÏË xtmouse ^[ [ M îÁÞÁÌÏ ÏÂÒÁÂÏÔËÉ ÓÏÂÙÔÉÊ ÍÙÛÉ × xterm if,"char==65",then,"it's an A",else,"it's not an a",endif ^[ q :main ïËÎÏ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ÔÅËÓÔÁ :inherit windows íÁËÒÏÓÙ ÐÒÏ×ÅÒËÉ ÇÒÁÍÍÁÔÉÞÅÓËÉÈ ÏÛÉÂÏË Ispell :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 $SPLTMP;aspell -x -c $SPLTMP /dev/tty;cat $SPLTMP;/bin/rm $SPLTMP",rtn,retype :def aspellword psh,nextword,markk,prevword,markb,filt,"SPLTMP=`mktemp -t joespell.XXXXXXXXXX`;cat >$SPLTMP;aspell -x -c $SPLTMP /dev/tty;tr -d <$SPLTMP '\\012';/bin/rm $SPLTMP",rtn,retype,nextword @SPELL@file ^[ l @SPELL@word ^[ n Compile :def compile querysave,query,scratch,"* Build Log *",rtn,bof,markb,eof," ",markk,blkdel,build Grep :def grep_find scratch,"* Grep Log *",rtn,bof,markb,eof," ",markk,blkdel,grep paste ^[ [ 2 0 2 ~ Bracketed paste rtarw,ltarw,begin_marking,rtarw,toggle_marking ^[ [ 1 ; 5 C Mark right Xterm rtarw,ltarw,begin_marking,rtarw,toggle_marking ^[ [ 5 C Mark right Gnome-terminal rtarw,ltarw,begin_marking,rtarw,toggle_marking ^[ O C Mark right Putty Ctrl-rtarw rtarw,ltarw,begin_marking,rtarw,toggle_marking ^[ O c Mark right RxVT Ctrl-rtarw ltarw,rtarw,begin_marking,ltarw,toggle_marking ^[ [ 1 ; 5 D Mark left ltarw,rtarw,begin_marking,ltarw,toggle_marking ^[ [ 5 D Mark left ltarw,rtarw,begin_marking,ltarw,toggle_marking ^[ O D Mark left Putty Ctrl-ltarw ltarw,rtarw,begin_marking,ltarw,toggle_marking ^[ O d Mark left RxVT Ctrl-ltarw uparw,dnarw,begin_marking,uparw,toggle_marking ^[ [ 1 ; 5 A Mark up uparw,dnarw,begin_marking,uparw,toggle_marking ^[ [ 5 A Mark up uparw,dnarw,begin_marking,uparw,toggle_marking ^[ O A Mark up Putty Ctrl-uparw uparw,dnarw,begin_marking,uparw,toggle_marking ^[ O a Mark up RxVT Ctrl-uparw dnarw,uparw,begin_marking,dnarw,toggle_marking ^[ [ 1 ; 5 B Mark down dnarw,uparw,begin_marking,dnarw,toggle_marking ^[ [ 5 B Mark down dnarw,uparw,begin_marking,dnarw,toggle_marking ^[ O B Mark down Putty Ctrl-dnarw dnarw,uparw,begin_marking,dnarw,toggle_marking ^[ O b Mark down RxVT Ctrl-dnarw äÏÐÏÌÎÉÔÅÌØÎÙÅ ÆÕÎËÃÉÉ, ËÏÔÏÒÙÅ × ÄÅÊÓÔ×ÉÔÅÌØÎÏÓÔÉ ÎÅ Ñ×ÌÑÀÔÓÑ ÞÁÓÔØÀ ÐÏÌØÚÏ×ÁÔÅÌØÓËÏÇÏ ÉÎÔÅÒÆÅÊÓÁ JOE: delbol ^[ o õÄÁÌÉÔØ ÄÏ ÎÁÞÁÌÁ ÓÔÒÏËÉ delbol ^[ ^O dnslide ^[ z óËÒÏÌÌ ×ÎÉÚ ÎÁ ÏÄÎÕ ÓÔÒÏËÕ dnslide ^[ Z Scroll down one line dnslide ^[ ^Z Scroll down one line dnslide,dnslide,dnslide,dnslide MWDOWN compile ^[ c Compile compile ^[ ^C Compile compile ^[ C grep_find ^[ g Grep grep_find ^[ G Grep grep_find ^[ ^G Grep execmd ^[ x úÁÐÒÏÓÉÔØ ËÏÍÁÎÄÕ ÄÌÑ ×ÙÐÏÌÎÅÎÉÑ execmd ^[ X execmd ^[ ^X jump ^[ SP finish ^[ ^I Complete word in document finish ^[ ^M Complete word: used to be math isrch ^[ s éÎËÒÅÍÅÎÔÁÌØÎÙÊ ÐÏÉÓË ×ÐÅÒÅÄ isrch ^[ S isrch ^[ ^S notmod ^[ ~ Not modified nxterr ^[ = ë ÓÌÅÄÕÀÝÅÊ ÏÛÉÂËÅ parserr ^[ e òÁÚÏÂÒÁÔØ ÏÛÉÂËÉ × ÔÅËÕÝÅÍ ÂÕÆÅÒÅ parserr ^[ E parserr ^[ ^E prverr ^[ - ë ÐÒÅÄÙÄÕÝÅÊ ÏÛÉÂËÅ rsrch ^[ r éÎËÒÅÍÅÎÔÁÌØÎÙÊ ÐÏÉÓË ÎÁÚÁÄ rsrch ^[ R rsrch ^[ ^R run ^[ ! ÷ÙÐÏÌÎÉÔØ ÐÒÏÇÒÁÍÍÕ × ÏËÎÅ tomarkb ^[ b ë ÎÁÞÁÌÕ ÂÌÏËÁ tomarkb ^[ ^B tomarkk ^[ k ÷ ËÏÎÅà ÂÌÏËÁ tomarkk ^[ ^K tomarkk ^[ K txt ^[ i úÁÐÒÏÓÉÔ ÔÅËÓÔ É ×ÓÔÁ×ÉÔØ ÅÇÏ txt ^[ I upslide ^[ w óËÒÏÌÌ ××ÅÒÈ ÎÁ ÏÄÎÕ ÓÔÒÏËÕ upslide ^[ ^W upslide ^[ W upslide,upslide,upslide,upslide MWUP yank ^[ y ïÔÍÅÎÉÔØ ÕÄÁÌÅÎÉÅ ÔÅËÓÔÁ yankpop ^[ ^Y yank ^[ Y toggle_marking ^@ Ctrl-space block selection method insc ^@ Ctrl-space used to insert a space bufed ^[ d íÅÎÀ ÂÕÆÅÒÏ× pbuf ^[ . óÌÅÄÕÀÝÉÊ ÂÕÆÅÒ nbuf ^[ , ðÒÅÄÙÄÕÝÉÊ ÂÕÆÅÒ nbuf ^[ v óÌÅÄÕÀÝÉÊ ÂÕÆÅÒ nbuf ^[ V óÌÅÄÕÀÝÉÊ ÂÕÆÅÒ nbuf ^[ ^V óÌÅÄÕÀÝÉÊ ÂÕÆÅÒ pbuf ^[ u ðÒÅÄÙÄÕÝÉÊ ÂÕÆÅÒ pbuf ^[ U ðÒÅÄÙÄÕÝÉÊ ÂÕÆÅÒ pbuf ^[ ^U ðÒÅÄÙÄÕÝÉÊ ÂÕÆÅÒ query ^[ q Quoted insert byte ^[ n ðÅÒÅÊÔÉ ÎÁ ÂÁÊÔ col ^[ c ðÅÒÅÊÔÉ × ÐÏÚÉÃÉÀ abortbuf ^[ k Kill current buffer- don't mess with windows ask ^[ a úÁÐÒÏÓ ÎÁ ÓÏÈÒÁÎÅÎÉÅ ÔÅËÕÝÅÇÏ ÂÕÆÅÒÁ bop ^[ p îÁ ÁÂÚÁà ÎÁÚÁÄ bos ^[ x ÷ ËÏÎÅà ÜËÒÁÎÁ copy ^[ ^W Copy block into yank dupw ^[ \ òÁÚÒÅÚÁÔØ ÏËÎÏ eop ^[ n ÷ÐÅÒÅÄ ÎÁ ÁÂÚÁà format ^[ j æÏÒÍÁÔÉÒÏ×ÁÔØ ÁÂÚÁÃ, ÉÇÎÏÒÉÒÕÑ ÂÌÏË markl ^[ l ïÔÍÅÔÉÔØ ÓÔÒÏËÕ nmark ^[ @ ÷ÙËÌÀÞÉÔØ ÏÔÍÅÔËÕ pop ^[ > óÄ×ÉÎÕÔØ ÂÌÏË ×ÐÅÒÅÄ psh ^[ < óÄ×ÉÎÕÔØ ÂÌÏË swap ^[ x ðÏÍÅÎÑÔØ ÍÅÓÔÁÍÉ ÎÁÞÁÌÏ ÏÔÍÅÔËÉ ÂÌÏËÁ É ËÕÒÓÏÒ tomarkbk ^[ g ðÅÒÅÈÏÄÉÔØ × ÎÁÞÁÌÏ É × ËÏÎÅà ÂÌÏËÁ tos ^[ e ÷ ÎÁÞÁÌÏ ÜËÒÁÎÁ tw0 ^[ 0 õÂÉÔØ ÔÅËÕÝÅÅ ÏËÎÏ (ÓËÒÙÔÙÊ ÂÕÆÅÒ) tw1 ^[ 1 õÂÉÔØ ×ÓÅ ÄÒÕÇÉÅ ÏËÎÁ (ÓËÒÙÔÙÅ ÂÕÆÅÒÁ) uarg ^[ u õÎÉ×ÅÒÓÁÌØÎÙÊ ÁÒÇÕÍÅÎÔ yank ^[ ^Y Undelete previous text yapp ^[ w Append next delete to previous yank óÔÁÎÄÁÒÔÎÙÊ ÐÏÌØÚÏ×ÁÔÅÌØÓËÉÊ ÉÎÔÅÒÆÅÊÓ JOE quote8 ^\ ÷×ÅÓÔÉ ÍÅÔÁÓÉÍ×ÏÌ quote ` ÷×ÅÓÔÉ ÕÐÒÁ×ÌÑÀÝÉÊ ÓÉÍ×ÏÌ backs ^? Backspace backs ^H backw ^O õÄÁÌÉÔØ ÓÌÏ×Ï ÎÁÚÁÄ bknd ^K ' ïËÎÏ ÛÅÌÌÁ blkcpy .k5 ëÏÐÉÒÏ×ÁÔØ ÂÌÏË blkcpy ^K C blkcpy ^K ^C blkcpy ^K c blkdel .f6 õÄÁÌÉÔØ ÂÌÏË blkdel .F6 blkdel ^K Y blkdel ^K ^Y blkdel ^K y blkmove ^K M ðÅÒÅÍÅÓÔÉÔØ ÂÌÏË blkmove .k6 blkmove ^K ^M blkmove ^K m blksave .f5 óÏÈÒÁÎÉÔØ ÂÌÏË blksave .F5 blksave ^K W blksave ^K ^W blksave ^K w bof .k2 ÷ ÎÁÞÁÌÏ ÆÁÊÌÁ bof ^K ^U bof ^K u bol .kh ÷ ÎÁÞÁÌÏ ÓÔÒÏËÉ bol ^A home .kh home ^A center ^K A ãÅÎÔÒÉÒÏ×ÁÔØ ÓÔÒÏËÕ center ^K ^A center ^K a crawll ^K < Pan left crawlr ^K > Pan right delch .kD õÄÁÌÉÔØ ÓÉÍ×ÏÌ delch ^D deleol ^J õÄÁÌÉÔØ ÄÏ ËÏÎÃÁ ÓÔÒÏËÉ dellin ^Y õÄÁÌÉÔØ ×ÓÀ ÓÔÒÏËÕ delw ^W õÄÁÌÉÔØ ÄÏ ËÏÎÃÁ ÓÌÏ×Á dnarw .kd ÷ÎÉÚ dnarw ^[ O B dnarw ^[ [ B edit ^K E òÅÄÁËÔÉÒÏ×ÁÔØ ÆÁÊÌ edit ^K ^E edit ^K e eof .f2 ÷ ËÏÎÅà ÆÁÊÌÁ eof .F2 eof ^K V eof ^K ^V eof ^K v eol .kH ÷ ËÏÎÅà ÓÔÒÏËÉ eol .@7 eol ^E exsave .k0 óÏÈÒÁÎÉÔØ ÆÁÊÌ É ×ÙÊÔÉ exsave .k; exsave ^K X exsave ^K ^X exsave ^K x ffirst .f7 ðÏÉÓË ÐÅÒ×ÏÇÏ ffirst .F7 ffirst ^K F ffirst ^K ^F ffirst ^K f filt ^K / æÉÌØÔÒÏ×ÁÔØ ÂÌÏË finish ^K ^M Complete text under cursor fnext .k7 ðÏÉÓË ÄÁÌØÛÅ fnext ^L fmtblk ^K J æÏÒÍÁÔÉÒÏ×ÁÔØ ÁÂÚÁÃ × ÂÌÏËÅ fmtblk ^K ^J fmtblk ^K j gomark ^[ 0 TO 9 ðÅÒÅÊÔÉ Ë ÍÅÔËÅ groww ^K G õ×ÅÌÉÞÉÔØ ÏËÎÏ groww ^K ^G groww ^K g insc .kI ÷ÓÔÁ×ÉÔØ ÐÒÏÂÅÌ insc ^@ insf ^K R ÷ÓÔÁ×ÉÔØ ÆÁÊÌ insf ^K ^R insf ^K r lindent ^K , óÄ×ÉÎÕÔØ ÂÌÏË ×ÌÅ×Ï line ^L ðÅÒÅÊÔÉ ÎÁ ÕËÁÚÁÎÎÕÀ ÓÔÒÏËÕ line ^K L line ^K ^L line ^K l ltarw .kl ÷ÌÅ×Ï ltarw ^[ O D ltarw ^[ [ D macros ^[ d òÁÓËÒÙÔØ ÍÁËÒÏÓ macros ^[ ^D markb .k3 ïÔÍÅÔËÁ ÎÁÞÁÌÁ ÂÌÏËÁ markb ^K B markb ^K ^B markb ^K b markk .f3 ïÔÍÅÔËÁ ËÏÎÃÁ ÂÌÏËÁ markk .F3 markk ^K K markk ^K ^K markk ^K k mode ^T íÅÎÀ ÏÐÃÉÊ menu,"root",rtn ^T nextpos ^K = îÁ ÓÌÅÄÕÀÝÕÀ ÐÏÚÉÃÉÀ × ÉÓÔÏÒÉÉ ÐÏÚÉÃÉÊ nextword ^X îÁ ÓÌÅÄÕÀÝÅÅ ÓÌÏ×Ï nextword ^[ [ 1 ; 5 C ctrl right in (newer) xterm nextword ^[ [ 5 C ctrl right in gnome-terminal open ^] òÁÚÒÅÚÁÔØ ÓÔÒÏËÕ prevpos ^K - îÁ ÐÒÅÄÙÄÕÝÕÀ ÐÏÚÉÃÉÀ × ÉÓÔÏÒÉÉ prevword ^Z îÁ ÐÒÅÄÙÄÕÝÅÅ ÓÌÏ×Ï prevword ^[ [ 1 ; 5 D ctrl left in (newer) xterm prevword ^[ [ 5 D ctrl left in gnome-terminal redo ^^ ïÔÍÅÎÉÔØ ÏÔÍÅÎÕ ÉÚÍÅÎÅÎÉÊ rindent ^K . óÄ×ÉÎÕÔØ ÂÌÏË ×ÐÒÁ×Ï rtarw .kr ÷ÐÒÁ×Ï rtarw ^[ O C rtarw ^[ [ C run ^K ! Run a shell command save .f0 óÏÈÒÁÎÉÔØ ÆÁÊÌ save .FA save ^K D save ^K S save ^K ^D save ^K ^S save ^K d save ^K s setmark ^[ ^[ õÓÔÁÎÏ×ÉÔØ ÍÅÔËÕ shrinkw ^K T õÍÅÎØÛÉÔØ ÏËÎÏ shrinkw ^K ^T shrinkw ^K t splitw ^K O òÁÚÒÅÚÁÔØ ÏËÎÏ splitw ^K ^O splitw ^K o stat ^K SP ðÏËÁÚÁÔØ ÓÔÁÔÕÓ tag ^K ; ðÏÉÓË ÆÁÊÌÁ ÔÁÇÏ× tomatch ^G ë ÐÁÒÎÏÊ ÓËÏÂËÅ undo ^_ ïÔÍÅÎÉÔØ ÉÚÍÅÎÅÎÉÅ uparw .ku ÷×ÅÒÈ uparw ^[ O A uparw ^[ [ A :prompt ïËÎÁ ÚÁÐÒÏÓÁ :inherit main if,"byte>size",then,complete,complete,else,delch,endif ^D complete ^I dnarw,eol .kd Go down dnarw,eol ^N dnarw,eol ^[ O B dnarw,eol ^[ [ B dnarw,eol ^# B uparw,eol .ku Go up uparw,eol ^# A uparw,eol ^P uparw,eol ^[ O A uparw,eol ^[ [ A :menu íÅÎÀ ×ÙÂÏÒÁ :inherit windows abort ^[ ^[ backsmenu ^H bofmenu ^K U bofmenu ^K ^U bofmenu ^K u bolmenu .kh bolmenu ^A dnarwmenu .kd dnarwmenu ^N dnarwmenu ^[ [ B dnarwmenu ^[ O B dnarwmenu MWDOWN eofmenu ^K V eofmenu ^K ^V eofmenu ^K v eolmenu .kH eolmenu ^E ltarwmenu .kl ltarwmenu ^B ltarwmenu ^[ [ D ltarwmenu ^[ O D pgdnmenu .kN îÁ ÜËÒÁÎ ×ÎÉÚ pgdnmenu ^V pgdnmenu ^[ [ 6 ~ pgupmenu .kP îÁ ÜËÒÁÎ ××ÅÒÈ pgupmenu ^U pgupmenu ^[ [ 5 ~ 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 uparwmenu MWUP defm2down M2DOWN Hits return key :query Single-key query window :inherit windows :querya Single-key query window for quoting type ^@ TO š :querysr Search & replace query window type ^@ TO š joe-3.7/rc/jpicorc.in0000644000100100007640000007264211103216124011441 00000000000000 Initialization file for JOE Super Pico JOE looks for this file in: 1 - $HOME/.jpicorc 2 - @JOERC@/jpicorc This file can include other files by placing the following include command in the first column: :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): Override colors of lexical classes specified in syntax files: Put each color override you want in the first column. Valid colors: bold inverse blink dim underline white cyan magenta blue yellow green red black bg_white bg_cyan bg_magenta bg_blue bg_yellow bg_green bg_red bg_black Override all instances of class Idle: =Idle red Override Idle only for c syntax file: =c.Idle red The following list is from c.jsf. Look at other syntax files for more classes. =Idle =Bad bold red =Preproc blue =Define bold blue =IncLocal cyan =IncSystem bold cyan =Constant cyan =Escape bold cyan =Type bold =Keyword bold =CppKeyword bold =Brace magenta =Control Put each option you want set in the first column: -option Sets the option --option Clears the option -help_is_utf8 Set if help text is in UTF-8 format. Leave clear if it's a raw 8-bit format. -mid Cursor is recentered when scrolling is necessary -marking Text between ^KB and cursor is highlighted (use with -lightoff) -lightoff Turn off highlighting after block copy or move -asis Characters 128 - 255 shown as-is -force Force final newline when files are saved -nolocks If you don't want file locks to be used -nomodcheck Disable periodic checking of disk file newer than buffer (this checking happens on save even with this option). -nocurdir Do not prompt with current directory -nobackups If you don't want backup files to be created -break_hardlinks Delete file before writing, to break hard links (but don't break symbolic links). -break_links Delete file before writing, to break hard links and symbolic links. -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 -undo_keep nnn Number of undo records to keep. 0 for infinite. -csmode ^KF after a pervious search does a ^L instead -backpath path Directory to store backup files (one space between 'backpath' and the 'path', no trailing spaces or comments after the path). -floatmouse Clicking past end of line moves the cursor past the end -rtbutton Use the right mouse button for action, instead of the left -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 -notite Don't send terminal initialization and termination strings: prevents restoration of screen on exit. -usetabs Use tabs to help optimize screen update. -assume_color Assume terminal has ANSI color support even if termcap/terminfo entry says that it doesn't. This only applies if the terminal otherwise looks like an ANSI terminal (support bold and capability starts with ESC [). -assume_256color Assume terminal has xterm 256 color support (ESC [ 38 ; 5 ; NNN m and ESC [ 48 ; 5 ; NNN m). -guess_non_utf8 Allow guess of non-UTF-8 file encoding in a UTF-8 locale. -guess_utf8 Allow guess of UTF-8 file encoding in non-UTF-8 locale. -guess_crlf Automatically detect MS-DOS files and set -crlf appropriately -guess_indent Guess indent character (tab or space). -menu_above Position menu/list above prompt when enabled. Otherwise position below prompt. -transpose Transpose rows with columns in all menus. -menu_explorer Stay in menu system when a directory is selected (otherwise directory is added to path and menu is closed). -menu_jump Jump into file selection menu when tab is hit (otherwise, menu comes up, but cursor stays in file name prompt). -icase Search is case insensitive by default. -wrap Search wraps -autoswap Swap markb with markk when necessary -joe_state Use ~/.joe_state file -mouse Enable mouse support -joexterm If you are using Joe's modified Xterm, which makes -mouse mode work better (cut & paste work transparently). -square Rectangular block mode -text_color color Set color for text. -status_color color Set color for status bar. -help_color color Set color for help. -menu_color color Set color for menus. -prompt_color color Set color for prompts. -msg_color color Set color for messages. For example: -text_color bg_blue+white Sets the background color to blue and foreground color to white. -restore Restore previous cursor position when files are opened -search_prompting Search prompts with previous search request. 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. 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 %O Byte offset into file in hex %a Ascii value of character under cursor %A Ascii value of character under cursor in hex %p Percent of file cursor is at %l No. 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 SECOND SECTION: File name dependant local option settings: Each line with '*' in the first column indicates the modes which should be set for files which match the regular expression. If more than one regular expression matches the file name, then the last matching one is chosen. Here are the modes which can be set: -cpara >#!;*/% Characters which can indent paragraphs. -encoding name Set file coding (for example: utf-8, iso-8859-15) -syntax name Specify syntax (syntax file called 'name.jsf' will be loaded) -hex Hex editor mode -highlight Enable highlighting -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 going the beginning of line first. -smartbacks Backspace key deletes 'istep' number of 'indentc's if cursor is at first non-space character. -tab nnn Tab width -indentc nnn Indentation character (32 for space, 9 for tab) -istep nnn Number of indentation columns -spaces TAB inserts spaces instead of tabs. -purify Fix 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). -crlf File uses CR-LF at ends of lines -wordwrap Wordwrap -nobackup If you don't want backup file to be created -autoindent Auto indent -overwrite Overtype mode -picture Picture mode (right arrow can go past end of lines) -lmargin nnn Left margin -rmargin nnn Right margin -flowed Put one space after intermediate paragraph lines for support of flowed text. -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. -linums Enable line numbers on each line -rdonly File is read-only -keymap name Keymap to use if not 'main' -lmsg Status line definition strings- -rmsg see previous section for more info. -mfirst macro Macro to execute on first modification -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. These define the language syntax for ^G (goto matching delimiter): -single_quoted Text between ' ' should be ignored (this is not good for regular text since ' is normally used alone as an apostrophe) -c_comment Text between /* */ should be ignored -cpp_comment Text after // should be ignored -pound_comment Text after # should be ignored -vhdl_comment Text after -- should be ignored -semi_comment Text after ; should be ignored -text_delimiters begin=end:if=elif=else=endif Define word delimiters Default local options -highlight -istep 2 Use this macro (put in first column) to have joe "p4 edit" a file you're about to change. -mfirst if,"rdonly && joe(sys,\"p4 edit \",name,rtn)",then,mode,"o",msg,"executed \"p4 edit ",name,"\"",rtn,endif File type table is now in a separate file. You can copy this file to ~/.joe and customize it. :include ftyperc SECOND and 1/2 SECTION: Option menu layout :defmenu name Defines a menu. macro string comment A menu entry. Macro is any JOE macro- see "Macros:" below. String is the label to be used for the macro in the menu. It is in the same format as the -lmsg and -rmsg options above. Two whitespace characters in a row begins a comment. Use '% ' for a leading space in the string. :defmenu root mode,"overwrite",rtn T Overtype %Zoverwrite% mode,"hex",rtn % % Hex edit mode mode,"autoindent",rtn I Autoindent %Zautoindent% mode,"wordwrap",rtn W Word wrap %Zwordwrap% mode,"tab",rtn D Tab width %Ztab% mode,"lmargin",rtn L Left margin %Zlmargin% mode,"rmargin",rtn R Right margin %Zrmargin% mode,"square",rtn X Rectangle mode %Zsquare% mode,"indentc",rtn % % Indent char %Zindentc% mode,"istep",rtn % % Indent step %Zistep% mode,"highlight",rtn H Highlighting %Zhighlight% mode,"crlf",rtn Z CR-LF (MS-DOS) %Zcrlf% mode,"linums",rtn N Line numbers %Zlinums% mode,"beep",rtn B Beep %Zbeep% mode,"rdonly",rtn O Read only %Zrdonly% mode,"syntax",rtn Y Syntax mode,"encoding",rtn E Encoding mode,"asis",rtn % % Meta chars as-is mode,"language",rtn V Language mode,"picture",rtn P picture %Zpicture% menu,"more-options",rtn % % More options... :defmenu more-options menu,"^G",rtn % % ^G options menu,"search",rtn % % search options menu,"paragraph",rtn % % paragraph options menu,"file",rtn % % file options menu,"menu",rtn % % menu options menu,"global",rtn % % global options menu,"cursor",rtn % % cursor options menu,"marking",rtn % % marking options menu,"tab",rtn % % tab/indent options :defmenu menu mode,"menu_explorer",rtn % % Menu explorer %Zmenu_explorer% mode,"menu_above",rtn % % Menu position %Zmenu_above% mode,"menu_jump",rtn % % Jump into menu %Zmenu_jump% mode,"transpose",rtn % % Transpose menus %Ztranspose% :defmenu ^G mode,"single_quoted",rtn % % ^G ignores '...' %Zsingle_quoted% mode,"no_double_quoted",rtn % % ^G no ignore "..." %Zno_double_quoted% mode,"c_comment",rtn % % ^G ignores /*...*/ %Zc_comment% mode,"cpp_comment",rtn % % ^G ignores //... %Zcpp_comment% mode,"pound_comment",rtn % % ^G ignores #... %Zpound_comment% mode,"vhdl_comment",rtn % % ^G ignores --... %Zvhdl_comment% mode,"semi_comment",rtn % % ^G ignores ;... %Zsemi_comment% mode,"tex_comment",rtn % % ^G ignores %... %Ztex_comment% mode,"text_delimiters",rtn % % Text delimiters %Ztext_delimiters% :defmenu search mode,"icase",rtn % % Case insensitivity %Zicase% mode,"wrap",rtn % % Search wraps %Zwrap% mode,"search_prompting",rtn % % Search prompting %Zsearch_prompting% mode,"csmode",rtn % % Continued search %Zcsmode% :defmenu paragraph mode,"french",rtn % % French spacing %Zfrench% mode,"flowed",rtn % % Flowed text %Zflowed% mode,"cpara",rtn % % Paragraph indent chars %Zcpara% :defmenu file mode,"restore",rtn % % Restore cursor %Zrestore% mode,"guess_crlf",rtn % % Auto detect CR-LF %Zguess_crlf% mode,"guess_indent",rtn % % Guess indent %Zguess_indent% mode,"guess_non_utf8",rtn % % Guess non-UTF-8 %Zguess_non_utf8% mode,"guess_utf8",rtn % % Guess UTF-8 %Zguess_utf8% mode,"force",rtn % % Force last NL %Zforce% mode,"nobackup",rtn % % No backup %Znobackup% :defmenu global mode,"nolocks",rtn % % Disable locks %Znolocks% mode,"nobackups",rtn % % Disable backups %Znobackups% mode,"nomodcheck",rtn % % Disable mtime check %Znomodcheck% mode,"nocurdir",rtn % % Disable current dir %Znocurdir% mode,"exask",rtn % % Exit ask %Zexask% mode,"nosta",rtn % % Disable status line %Znosta% mode,"keepup",rtn % % Fast status line %Zkeepup% mode,"break_hardlinks",rtn % % Break hard links %Zbreak_hardlinks% mode,"break_links",rtn % % Break links %Zbreak_links% mode,"joe_state",rtn % % Joe_state file %Zjoe_state% mode,"undo_keep",rtn % % No. undo records %Zundo_keep% mode,"backpath",rtn % % Path to backup files %Zbackpath% :defmenu cursor mode,"pg",rtn % % No. PgUp/PgDn lines %Zpg% mode,"mid",rtn C Center on scroll %Zmid% mode,"floatmouse",rtn % % Click past end %Zfloatmouse% mode,"rtbutton",rtn % % Right button %Zrtbutton% :defmenu marking mode,"autoswap",rtn % % Autoswap mode %Zautoswap% mode,"marking",rtn % % Marking %Zmarking% mode,"lightoff",rtn % % Auto unmask %Zlightoff% :defmenu tab mode,"smarthome",rtn % % Smart home key %Zsmarthome% mode,"smartbacks",rtn % % Smart backspace %Zsmartbacks% mode,"indentfirst",rtn % % To indent first %Zindentfirst% mode,"purify",rtn % % Clean up indents %Zpurify% mode,"spaces",rtn % % No tabs %Zspaces% THIRD SECTION: Named help screens: Use \i to turn on/off inverse video Use \u to turn on/off underline Use \b to turn on/off bold Use \d to turn on/off dim Use \f to turn on/off flash {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 \| \b^W^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 \|^[U cycle \|^[H word< \|^L refresh \|\uFILE\u \|\i \i \i \i\|^Z prev. word \|^W^T line No. \|^O save \|^[D >word \|^[^[ options \|^O save \|\i \i \i \i\|^SPACE next word \|^W find ^W^W next\|^[/ filter \|^[- 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 } {SearchOptions \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \iSearch options: \|\i \i \i \i r Replace \|\i \i \i \i k Restrict search to highlighted block, which can be rectangular \|\i \i \i \i b Search backward instead of forward \|\i \i \i \i i Ignore case \|\i \i \i \i a Search across all loaded files \|\i \i \i \i e Search across all files in Grep or Compile error list \|\i \i \i \i w Wrap to beginning of file for this search \|\i \i \i \i n Do not wrap to beginning of file for this search \|\i \i \i \i nnn Perform exaclty nnn replacements \|\i \i } {Math \i Help Screen \|turn off with ^G prev. screen ^[, next screen ^[. \i \i \i \uCOMMANDS\u (hit ESC m for math) \uFUNCTIONS\u \|\i \i \i \i hex hex display mode sin cos tab asin acos atan \|\i \i \i \i dec decimal mode sinh cosh tanh asinh acosh atanh \|\i \i \i \i ins type result into file sqrt cbrt exp ln log \|\i \i \i \i eval evaluate block int floor ceil abs erg ergc \|\i \i \i \i 0xff enter number in hex joe(..macro..) - runs an editor macro \|\i \i \i \i 3e-4 floating point decimal \uBLOCK\u \|\i \i \i \i a=10 assign a variable sum cnt Sum, count \|\i \i \i \i 2+3:ins multiple commands avg dev Average, std. deviation \|\i \i \i \i e pi constants \uOPERATORS\u \|\i \i \i \i ans previous result ! ^ * / % + - < <= > >= == != && || ? :\|\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 ^[, next screen ^[. \i \i \i Send bug reports to: http://sourceforge.net/projects/joe-editor \|\i \i \i \i \|\i \i \i \i default joerc file is here @JOERC@/joerc \|\i \i \i \i default syntax and i18n files are here @JOEDATA@ \|\i \i \i \i additional documentation can be found here @JOEDOC@ \|\i \i } {CharTable \i Help Screen \|turn off with ^G prev. screen ^[, \i \i \i\| Dec \u 0123 4567 8901 2345 0123 4567 8901 2345 \u Dec \|\i \i \i \i\| | | \|\i \i \i \i\| 0 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \i\u@ABC\u\i \i\uDEFG\u\i \i\uHIJK\u\i \i\uLMNO\u\i | 128 \|\i \i \i \i\| 16 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \i\uPQRS\u\i \i\uTUVW\u\i \i\uXYZ[\u\i \i\u\\]^_\u\i | 144 \|\i \i \i \i\| 32 | !"# $%&' ()*+ ,-./  ¡¢£ ¤¥¦§ ¨©ª« ¬­®¯ | 160 \|\i \i \i \i\| 48 | 0123 4567 89:; <=>? °±²³ ´µ¶· ¸¹º» ¼½¾¿ | 176 \|\i \i \i \i\| 64 | @ABC DEFG HIJK LMNO ÀÁÂà ÄÅÆÇ ÈÉÊË ÌÍÎÏ | 192 \|\i \i \i \i\| 80 | PQRS TUVW XYZ[ \\]^_ ÐÑÒÓ ÔÕÖ× ØÙÚÛ ÜÝÞß | 208 \|\i \i \i \i\| 96 | `abc defg hijk lmno àáâã äåæç èéêë ìíîï | 224 \|\i \i \i \i\| 112 | pqrs tuvw xyz{ |}~ ðñòó ôõö÷ øùúû üýþÿ | 240 \|\i \i } FOURTH SECTION: Key bindings: Section names you must provide: :main For editing window :prompt For prompt lines :query For single-character query lines :querya Singe-character query for quote :querysr Search & Replace single-character query Other sections may be given as well for organization 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 Ctrl chars Use SP for space Use a TO b to generate a range of characters Use MDOWN, MDRAG, MUP, M2DOWN, M2DRAG, M2UP, M3DOWN, M3DRAG, M3UP for mouse Use MWDOWN, MWUP for wheel mouse motion 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 2 or more command names. For example: eof,bol ^T Z Goto beginning of last line Also quoted matter is typed in literally: bol,">",dnarw .k1 Quote news article line Macros may cross lines if they end with , 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 goto the beginning of the last line. :windows Bindings common to all windows type ^@ TO ÿ Type a character abort ^C Abort window arg ^[ \ Repeat next command explode ^[ I Show all windows or show only one window explode ^[ ^I explode ^[ i help ^G Help menu help .k1 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 ^# S pgup .kP Screen up pgup ^Y pgup ^[ [ 5 ~ pgup ^# T 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 Mouse handling defmdown MDOWN Move the cursor to the mouse location defmup MUP defmdrag MDRAG Select a region of characters defm2down M2DOWN Select the word at the mouse location defm2up M2UP defm2drag M2DRAG Select a region of words defm3down M3DOWN Select the line at the mouse location defm3up M3UP defm3drag M3DRAG Select a region of lines xtmouse ^[ [ M Introduces an xterm mouse event :main Text editing window :inherit windows Spell-check macros Ispell :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 $SPLTMP;aspell --lang=",language,".",charset," -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 --lang=",language,".",charset," -x -c $SPLTMP /dev/tty;tr -d <$SPLTMP '\\012';/bin/rm $SPLTMP",rtn,retype,nextword @SPELL@word ^T @SPELL@file ^[ T Spell check word @SPELL@file ^[ t @SPELL@file ^[ ^T Compile macro :def compile querysave,query,scratch,"* Build Log *",rtn,markb,eof," ",markk,blkdel,build Grep :def grep_find mwind!,mfit!,scratch,"* Grep Log *",rtn,bof,markb,eof," ",markk,blkdel,grep Man page :def man scratch,"* Man Page *",rtn,bof,markb,eof," ",markk,blkdel," ",ltarw,run,"man -P cat -S 2:3 " paste ^[ ] 5 2 ; Bracketed paste insc ^[ [ 2 ~ insc ^[ [ L SCO delch ^[ [ 3 ~ pgup ^[ [ I SCO pgdn ^[ [ G SCO home ^[ [ 1 ~ Putty, Linux, Cygwin home ^[ [ H Xterm, Konsole, SCO home ^[ O H gnome-terminal home ^[ [ 7 ~ RxVT home ^# SP A Amiga eol ^[ [ 4 ~ Putty, Linux, Cygwin, ssh eol ^[ [ F Xterm, Konsole, SCO eol ^[ O F gnome-terminal eol ^[ [ 8 ~ RxVT eol ^# SP @ Amiga ask,query,lose,query,abortbuf ^X Exit after many questions ask,query,exsave ^X Exit backs ^? Backspace backs ^H backw ^[ H Backspace word backw ^[ ^? backw ^[ ^H backw ^[ h bknd ^[ ' Shell window bof ^[ Y Goto beginning of file bof ^[ ^Y bof ^[ y home .kh Goto beginning of line home ^A home ^[ [ H home ^[ [ 1 ~ center ^[ ^C Center line center ^[ c delch .kD Delete character delch ^D deleol ^[ K Delete to end of line deleol ^[ ^K deleol ^[ k delw ^[ ^D Delete word delw ^[ d dnarw .kd Go down dnarw ^N dnarw ^[ O B dnarw ^[ [ B dnarw ^# B dnslide,dnslide,dnslide,dnslide MWDOWN drop,msg,"Mark set",rtn ^^ Drop anchor toggle_marking ^^ Marking edit ^[ E Edit a file edit ^[ ^E edit ^[ e eof ^[ V Go to end of file eof ^[ ^V eof ^[ v eol .kH Go to end of line eol .@7 eol ^E eol ^[ [ F eol ^[ [ 4 ~ execmd ^[ X Prompt for command to execute execmd ^[ ^X Prompt for command to execute execmd ^[ x Prompt for command to execute ffirst ^W Find first fnext ^[ w fnext ^[ W filt ^[ / Filter block though file psh,markk,fmtblk ^J Format paragraphs in block groww ^[ G Grow window groww ^[ ^G groww ^[ g insc .kI Insert a space insf ^R Insert a file isrch ^[ S Forward incremental search isrch ^[ ^S Forward incremental search isrch ^[ s Forward incremental search line ^[ L Goto line no. line ^[ ^L line ^[ l line ^_ ltarw .kl Go left ltarw ^B ltarw ^[ O D ltarw ^[ [ D ltarw ^# D mode ^[ ^[ Options menu menu,"root",rtn ^[ ^[ nextword ^@ Goto next word open ^] Split line prevword ^Z Previous word picokill ^K Pico kill function quote ` Enter Ctrl chars quote8 ^\ Enter Meta chars redo ^[ = Redo changes rsrch ^[ R Backward incremental search rsrch ^[ ^R Backward incremental search rsrch ^[ r Backward incremental search rtarw .kr Go right rtarw ^F rtarw ^[ O C rtarw ^[ [ C rtarw ^# C run ^[ ! Run a program in a window stat ^C Cursor position status psh,markk,blksave,query ^O Save file crawll ^[ < Pan left crawlr ^[ > 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 uparw ^# A upslide,upslide,upslide,upslide MWUP 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,fnext ^W cancel,bop ^W cancel,eop ^O dnarw,eol .kd Go down dnarw,eol ^N dnarw,eol ^[ O B dnarw,eol ^[ [ B dnarw,eol ^# B uparw,eol .ku Go up uparw,eol ^# A uparw,eol ^P uparw,eol ^[ O A uparw,eol ^[ [ A :menu Selection menus :inherit windows pgupmenu ^[ [ I pgdnmenu ^[ [ G bolmenu ^[ [ 1 ~ Putty, Linux, Cygwin bolmenu ^[ [ H Xterm, Konsole bolmenu ^[ O H gnome-terminal bolmenu ^[ [ 7 ~ RxVT bolmenu ^# SP A Amiga eolmenu ^[ [ 4 ~ Putty, Linux, Cygwin, ssh eolmenu ^[ [ F Xterm, Konsole eolmenu ^[ O F gnome-terminal eolmenu ^[ [ 8 ~ RxVT eolmenu ^# SP @ Amiga abort ^[ ^[ backsmenu ^? backsmenu ^H bofmenu ^K U bofmenu ^K ^U bofmenu ^K u bolmenu .kh bolmenu ^A dnarwmenu .kd dnarwmenu ^N dnarwmenu ^[ [ B dnarwmenu ^[ O B dnarwmenu ^# B eofmenu ^K V eofmenu ^K ^V eofmenu ^K v eolmenu .kH eolmenu ^E ltarwmenu .kl ltarwmenu ^B ltarwmenu ^[ [ D ltarwmenu ^# D ltarwmenu ^[ O D pgdnmenu .kN Screen down pgdnmenu ^V pgdnmenu ^[ [ 6 ~ pgdnmenu ^# S pgupmenu .kP Screen up pgupmenu ^Y pgupmenu ^[ [ 5 ~ pgupmenu ^# T rtarwmenu .kr rtarwmenu ^F rtarwmenu ^[ [ C 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 ^# A uparwmenu ^[ O A defm2down M2DOWN Hits return key :query Single-key query window :inherit windows :querya Single-key query window for quoting type ^@ TO ÿ :querysr Search & replace query window type ^@ TO ÿ joe-3.7/rc/Makefile.am0000644000100100007640000000245011101510604011500 00000000000000sysconf_joedir = $(sysconfdir)/joe data_joedir = $(datadir)/joe data_docdir = $(docdir) sysconf_joe_built = joerc jicerc.ru jmacsrc jstarrc rjoerc jpicorc sysconf_joe_DATA = $(sysconf_joe_built) ftyperc EXTRA_DIST = joerc.in jicerc.ru.in jmacsrc.in jstarrc.in jpicorc.in rjoerc.in ftyperc joerc : joerc.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,' $(srcdir)/joerc.in > $@ jicerc.ru : jicerc.ru.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,' $(srcdir)/jicerc.ru.in > $@ jmacsrc : jmacsrc.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,' $(srcdir)/jmacsrc.in > $@ jstarrc : jstarrc.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,' $(srcdir)/jstarrc.in > $@ jpicorc : jpicorc.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,' $(srcdir)/jpicorc.in > $@ rjoerc : rjoerc.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,' $(srcdir)/rjoerc.in > $@ MOSTLYCLEANFILES = $(sysconf_joe_built) joe-3.7/rc/Makefile.in0000644000100100007640000002546311102222346011526 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(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@ subdir = rc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 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) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/autoconf.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = 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|^.*/||'`; am__installdirs = "$(DESTDIR)$(sysconf_joedir)" sysconf_joeDATA_INSTALL = $(INSTALL_DATA) DATA = $(sysconf_joe_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ 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 = @INSTALL@ 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@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ 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@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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@ builddir = @builddir@ 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@ 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@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ sysconf_joedir = $(sysconfdir)/joe data_joedir = $(datadir)/joe data_docdir = $(docdir) sysconf_joe_built = joerc jicerc.ru jmacsrc jstarrc rjoerc jpicorc sysconf_joe_DATA = $(sysconf_joe_built) ftyperc EXTRA_DIST = joerc.in jicerc.ru.in jmacsrc.in jstarrc.in jpicorc.in rjoerc.in ftyperc MOSTLYCLEANFILES = $(sysconf_joe_built) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu rc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu rc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sysconf_joeDATA: $(sysconf_joe_DATA) @$(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 tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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 check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(sysconf_joedir)"; 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: all-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: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: 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-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-sysconf_joeDATA install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sysconf_joeDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-sysconf_joeDATA installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am \ uninstall-sysconf_joeDATA joerc : joerc.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,' $(srcdir)/joerc.in > $@ jicerc.ru : jicerc.ru.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,' $(srcdir)/jicerc.ru.in > $@ jmacsrc : jmacsrc.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,' $(srcdir)/jmacsrc.in > $@ jstarrc : jstarrc.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,' $(srcdir)/jstarrc.in > $@ jpicorc : jpicorc.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,' $(srcdir)/jpicorc.in > $@ rjoerc : rjoerc.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,' $(srcdir)/rjoerc.in > $@ # 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: joe-3.7/rc/joerc.in0000644000100100007640000011151111103217247011106 00000000000000 Initialization file for JOE Standard Joe JOE looks for this file in: 1 - $HOME/.joerc 2 - @JOERC@/joerc This file can include other files by placing the following include command in the first column: :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): Override colors of lexical classes specified in syntax files: Put each color override you want in the first column. Valid colors: bold inverse blink dim underline white cyan magenta blue yellow green red black bg_white bg_cyan bg_magenta bg_blue bg_yellow bg_green bg_red bg_black Other colors are available: see syntax/c.jsf for documentation. Override all instances of class Idle: =Idle red Override Idle only for c syntax file: =c.Idle red The following list is from c.jsf. Look at other syntax files for more classes. =Idle =Bad bold red =Preproc blue =Define bold blue =IncLocal cyan =IncSystem bold cyan =Constant cyan =Escape bold cyan =Type bold =Keyword bold =CppKeyword bold =Brace magenta =Control Put each option you want set in the first column: -option Sets the option --option Clears the option -help_is_utf8 Set if help text is in UTF-8 format. Leave clear if it's a raw 8-bit format. -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 -nolocks If you don't want file locks to be used -nomodcheck Disable periodic checking of disk file newer than buffer (this checking happens on save even with this option). -nocurdir Do not prompt with current directory -nobackups If you don't want backup files to be created -break_hardlinks Delete file before writing, to break hard links (but don't break symbolic links). -break_links Delete file before writing, to break hard links and symbolic links. -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 -undo_keep nnn Number of undo records to keep. 0 for infinite. -csmode ^KF after a pervious search does a ^L instead -backpath path Directory to store backup files (one space between 'backpath' and the 'path', no trailing spaces or comments after the path). -floatmouse Clicking past end of line moves the cursor past the end -rtbutton Use the right mouse button for action, instead of the left -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 -notite Don't send terminal initialization and termination strings: prevents restoration of screen on exit. -usetabs Use tabs to help optimize screen update. -assume_color Assume terminal has ANSI color support even if termcap/terminfo entry says that it doesn't. This only applies if the terminal otherwise looks like an ANSI terminal (support bold and capability starts with ESC [). -assume_256color Assume terminal has xterm 256 color support (ESC [ 38 ; 5 ; NNN m and ESC [ 48 ; 5 ; NNN m). -guess_non_utf8 Allow guess of non-UTF-8 file encoding in a UTF-8 locale. -guess_utf8 Allow guess of UTF-8 file encoding in non-UTF-8 locale. -guess_crlf Automatically detect MS-DOS files and set -crlf appropriately -guess_indent Guess indent character (tab or space). -menu_above Position menu/list above prompt when enabled. Otherwise position below prompt. -transpose Transpose rows with columns in all menus. -menu_explorer Stay in menu system when a directory is selected (otherwise directory is added to path and menu is closed). -menu_jump Jump into file selection menu when tab is hit (otherwise, menu comes up, but cursor stays in file name prompt). -icase Search is case insensitive by default. -wrap Search wraps -autoswap Swap markb with markk when necessary -joe_state Use ~/.joe_state file -mouse Enable xterm mouse support. When enabled, left-click will position the cursor and left-click-drag will select blocks For normal xterm cut and paste, hold the shift key down. -joexterm If you are using XTerm version 212 or higher, and if it was configured with --enable-paste64, set this flag: it allows mouse cut & paste to work properly (text selected with the mouse can be pasted into other application, and middle button clicks paste into JOE). -square Rectangular block mode -text_color color Set color for text. -status_color color Set color for status bar. -help_color color Set color for help. -menu_color color Set color for menus. -prompt_color color Set color for prompts. -msg_color color Set color for messages. For example: -text_color bg_blue+white Sets the background color to blue and foreground color to white. -restore Restore previous cursor position when files are opened -search_prompting Search prompts with previous search request. 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. 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 %O Byte offset into file in hex %a Ascii value of character under cursor %A Ascii value of character under cursor in hex %p Percent of file cursor is at %l No. 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) %dd day %dm month %dY year %Ename% value of environment variable %Tname% value of option (ON or OFF for boolean options) 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 SECOND SECTION: File name dependant 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 are the modes which can be set: -cpara >#!;*/% Characters which can indent paragraphs. -encoding name Set file coding (for example: utf-8, iso-8859-15) -syntax name Specify syntax (syntax file called 'name.jsf' will be loaded) -hex Hex editor mode -highlight Enable highlighting -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 going the beginning of line first. -smartbacks Backspace key deletes 'istep' number of 'indentc's if cursor is at first non-space character. -tab nnn Tab width -indentc nnn Indentation character (32 for space, 9 for tab) -istep nnn Number of indentation columns -spaces TAB inserts spaces instead of tabs. -purify Fix 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). -crlf File uses CR-LF at ends of lines -wordwrap Wordwrap -nobackup If you don't want backup file to be created -autoindent Auto indent -overwrite Overtype mode -picture Picture mode (right arrow can go past end of lines) -lmargin nnn Left margin -rmargin nnn Right margin -flowed Put one space after intermediate paragraph lines for support of flowed text. -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. -linums Enable line numbers on each line -rdonly File is read-only -keymap name Keymap to use if not 'main' -lmsg Status line definition strings- -rmsg see previous section for more info. -mfirst macro Macro to execute on first modification -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. These define the language syntax for ^G (goto matching delimiter): -single_quoted Text between ' ' should be ignored (this is not good for regular text since ' is normally used alone as an apostrophe) -no_double_quoted Text between " " should not be ignored (useful for TeX). -c_comment Text between /* */ should be ignored -cpp_comment Text after // should be ignored -pound_comment Text after # should be ignored -vhdl_comment Text after -- should be ignored -semi_comment Text after ; should be ignored -text_delimiters begin=end:if=elif=else=endif Define word delimiters Default local options -highlight -istep 2 Perforce macro: use this macro (put in first column) to have joe "p4 edit" a file you're about to change. -mfirst if,"rdonly && joe(sys,\"p4 edit \",name,rtn)",then,mode,"o",msg,"executed \"p4 edit ",name,"\"",rtn,endif -mfirst if,"rdonly && joe(sys,\"p4 edit \",name,rtn)",then,reload,msg,"executed \"p4 edit ",name,"\"",rtn,endif File type table is now in a separate file. You can copy this file to ~/.joe and customize it. :include ftyperc SECOND and 1/2 SECTION: Option menu layout :defmenu name Defines a menu. macro string comment A menu entry. Macro is any JOE macro- see "Macros:" below. String is the label to be used for the macro in the menu. It is in the same format as the -lmsg and -rmsg options above. Two whitespace characters in a row begins a comment. Use '% ' for a leading space in the string. :defmenu root mode,"overwrite",rtn T Overtype %Zoverwrite% mode,"hex",rtn % % Hex edit mode mode,"autoindent",rtn I Autoindent %Zautoindent% mode,"wordwrap",rtn W Word wrap %Zwordwrap% mode,"tab",rtn D Tab width %Ztab% mode,"lmargin",rtn L Left margin %Zlmargin% mode,"rmargin",rtn R Right margin %Zrmargin% mode,"square",rtn X Rectangle mode %Zsquare% mode,"indentc",rtn % % Indent char %Zindentc% mode,"istep",rtn % % Indent step %Zistep% mode,"highlight",rtn H Highlighting %Zhighlight% mode,"crlf",rtn Z CR-LF (MS-DOS) %Zcrlf% mode,"linums",rtn N Line numbers %Zlinums% mode,"beep",rtn B Beep %Zbeep% mode,"rdonly",rtn O Read only %Zrdonly% mode,"syntax",rtn Y Syntax mode,"encoding",rtn E Encoding mode,"asis",rtn % % Meta chars as-is mode,"language",rtn V Language mode,"picture",rtn P picture %Zpicture% menu,"more-options",rtn % % More options... :defmenu more-options menu,"^G",rtn % % ^G options menu,"search",rtn % % search options menu,"paragraph",rtn % % paragraph options menu,"file",rtn % % file options menu,"menu",rtn % % menu options menu,"global",rtn % % global options menu,"cursor",rtn % % cursor options menu,"marking",rtn % % marking options menu,"tab",rtn % % tab/indent options :defmenu menu mode,"menu_explorer",rtn % % Menu explorer %Zmenu_explorer% mode,"menu_above",rtn % % Menu position %Zmenu_above% mode,"menu_jump",rtn % % Jump into menu %Zmenu_jump% mode,"transpose",rtn % % Transpose menus %Ztranspose% :defmenu ^G mode,"single_quoted",rtn % % ^G ignores '...' %Zsingle_quoted% mode,"no_double_quoted",rtn % % ^G no ignore "..." %Zno_double_quoted% mode,"c_comment",rtn % % ^G ignores /*...*/ %Zc_comment% mode,"cpp_comment",rtn % % ^G ignores //... %Zcpp_comment% mode,"pound_comment",rtn % % ^G ignores #... %Zpound_comment% mode,"vhdl_comment",rtn % % ^G ignores --... %Zvhdl_comment% mode,"semi_comment",rtn % % ^G ignores ;... %Zsemi_comment% mode,"tex_comment",rtn % % ^G ignores %... %Ztex_comment% mode,"text_delimiters",rtn % % Text delimiters %Ztext_delimiters% :defmenu search mode,"icase",rtn % % Case insensitivity %Zicase% mode,"wrap",rtn % % Search wraps %Zwrap% mode,"search_prompting",rtn % % Search prompting %Zsearch_prompting% mode,"csmode",rtn % % Continued search %Zcsmode% :defmenu paragraph mode,"french",rtn % % French spacing %Zfrench% mode,"flowed",rtn % % Flowed text %Zflowed% mode,"cpara",rtn % % Paragraph indent chars %Zcpara% :defmenu file mode,"restore",rtn % % Restore cursor %Zrestore% mode,"guess_crlf",rtn % % Auto detect CR-LF %Zguess_crlf% mode,"guess_indent",rtn % % Guess indent %Zguess_indent% mode,"guess_non_utf8",rtn % % Guess non-UTF-8 %Zguess_non_utf8% mode,"guess_utf8",rtn % % Guess UTF-8 %Zguess_utf8% mode,"force",rtn % % Force last NL %Zforce% mode,"nobackup",rtn % % No backup %Znobackup% :defmenu global mode,"nolocks",rtn % % Disable locks %Znolocks% mode,"nobackups",rtn % % Disable backups %Znobackups% mode,"nomodcheck",rtn % % Disable mtime check %Znomodcheck% mode,"nocurdir",rtn % % Disable current dir %Znocurdir% mode,"exask",rtn % % Exit ask %Zexask% mode,"nosta",rtn % % Disable status line %Znosta% mode,"keepup",rtn % % Fast status line %Zkeepup% mode,"break_hardlinks",rtn % % Break hard links %Zbreak_hardlinks% mode,"break_links",rtn % % Break links %Zbreak_links% mode,"joe_state",rtn % % Joe_state file %Zjoe_state% mode,"undo_keep",rtn % % No. undo records %Zundo_keep% mode,"backpath",rtn % % Path to backup files %Zbackpath% :defmenu cursor mode,"pg",rtn % % No. PgUp/PgDn lines %Zpg% mode,"mid",rtn C Center on scroll %Zmid% mode,"floatmouse",rtn % % Click past end %Zfloatmouse% mode,"rtbutton",rtn % % Right button %Zrtbutton% :defmenu marking mode,"autoswap",rtn % % Autoswap mode %Zautoswap% mode,"marking",rtn % % Marking %Zmarking% mode,"lightoff",rtn % % Auto unmask %Zlightoff% :defmenu tab mode,"smarthome",rtn % % Smart home key %Zsmarthome% mode,"smartbacks",rtn % % Smart backspace %Zsmartbacks% mode,"indentfirst",rtn % % To indent first %Zindentfirst% mode,"purify",rtn % % Clean up indents %Zpurify% mode,"spaces",rtn % % No tabs %Zspaces% THIRD SECTION: Named help screens: Use \i to turn on/off inverse video Use \u to turn on/off underline Use \b to turn on/off bold Use \d to turn on/off dim Use \f to turn on/off flash 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. Use the '-help_is_utf8' global option to allow UTF-8 sequences in the help text. Otherwise, the locale 8-bit character set is assumed. {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 \|^KA center \|^C abort \|\i \i \i \i\|^Z previous word \|^A beg. of line \|^KM move \|^W >word \|^T options \|^KZ shell \|\i \i \i \i\|^X next word \|^E end of line \|^KC copy \|^O word< \|^R refresh \|\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\|^[V Switch to next buffer \|^[U Switch to previous buffer \|\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 \|\uINSERT\u \|^K< Left \|\uQUOTE\u \|\uDELETE\u \|\uBOOKMARKS\u \|\i \i \i \i\|^K? Query \|^] split line \|^K> Right \|^[' Ctrl- \|^[Y yank \|^[ 0-9 Goto \|\i \i \i \i\|^[D Dump \|^SPACE ins space\| \|^\\ 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 \uQUICK\u \|\i \i \i \i\|^G Matching ( [ { \|^K, less \|^[C Compile & parse ^G find word under cursor \|\i \i \i \i\|^K- Previous place \|^K. more \|^[G Grep & parse ^[ENTER complete word \|\i \i \i \i\|^K= Next place \|\uFILE\u \|^[= To next error ^[Y paste deleted text \|\i \i \i \i\|^K; Tags file search \|^K ` \|^[- To prev. error ^[^Y cycle through deleted \|\i \i \i \i\| \| revert \|^[ SP Jump to 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 } {SearchOptions \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \iSearch options: \|\i \i \i \i r Replace \|\i \i \i \i k Restrict search to highlighted block, which can be rectangular \|\i \i \i \i b Search backward instead of forward \|\i \i \i \i i Ignore case \|\i \i \i \i a Search across all loaded files \|\i \i \i \i e Search across all files in Grep or Compile error list \|\i \i \i \i w Wrap to beginning of file for this search \|\i \i \i \i n Do not wrap to beginning of file for this search \|\i \i \i \i nnn Perform exaclty nnn replacements \|\i \i } {Math \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \i \uCOMMANDS\u (hit ESC m for math) \uFUNCTIONS\u \|\i \i \i \i hex hex display mode sin cos tab asin acos atan \|\i \i \i \i dec decimal mode sinh cosh tanh asinh acosh atanh \|\i \i \i \i ins type result into file sqrt cbrt exp ln log \|\i \i \i \i eval evaluate block int floor ceil abs erg ergc \|\i \i \i \i 0xff enter number in hex joe(..macro..) - runs an editor macro \|\i \i \i \i 3e-4 floating point decimal \uBLOCK\u \|\i \i \i \i a=10 assign a variable sum cnt Sum, count \|\i \i \i \i 2+3:ins multiple commands avg dev Average, std. deviation \|\i \i \i \i e pi constants \uOPERATORS\u \|\i \i \i \i ans previous result ! ^ * / % + - < <= > >= == != && || ? :\|\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 ^[, next screen ^[. \i \i \i Send bug reports to: http://sourceforge.net/projects/joe-editor \|\i \i \i \i \|\i \i \i \i default joerc file is here @JOERC@/joerc \|\i \i \i \i default syntax and i18n files are here @JOEDATA@ \|\i \i \i \i additional documentation can be found here @JOEDOC@ \|\i \i } {CharTable \i Help Screen \|turn off with ^KH prev. screen ^[, \i \i \i\| Dec \u 0123 4567 8901 2345 0123 4567 8901 2345 \u Dec \|\i \i \i \i\| | | \|\i \i \i \i\| 0 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \i\u@ABC\u\i \i\uDEFG\u\i \i\uHIJK\u\i \i\uLMNO\u\i | 128 \|\i \i \i \i\| 16 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \i\uPQRS\u\i \i\uTUVW\u\i \i\uXYZ[\u\i \i\u\\]^_\u\i | 144 \|\i \i \i \i\| 32 | !"# $%&' ()*+ ,-./  ¡¢£ ¤¥¦§ ¨©ª« ¬­®¯ | 160 \|\i \i \i \i\| 48 | 0123 4567 89:; <=>? °±²³ ´µ¶· ¸¹º» ¼½¾¿ | 176 \|\i \i \i \i\| 64 | @ABC DEFG HIJK LMNO ÀÁÂà ÄÅÆÇ ÈÉÊË ÌÍÎÏ | 192 \|\i \i \i \i\| 80 | PQRS TUVW XYZ[ \\]^_ ÐÑÒÓ ÔÕÖ× ØÙÚÛ ÜÝÞß | 208 \|\i \i \i \i\| 96 | `abc defg hijk lmno àáâã äåæç èéêë ìíîï | 224 \|\i \i \i \i\| 112 | pqrs tuvw xyz{ |}~ ðñòó ôõö÷ øùúû üýþÿ | 240 \|\i \i } FOURTH SECTION: Key bindings: Section names you must provide: :main For editing window :prompt For prompt lines :query For single-character query lines :querya Singe-character query for quote :querysr Search & Replace single-character query Other sections may be given as well for organization 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 Ctrl chars Use SP for space Use a TO b to generate a range of characters Use MDOWN, MDRAG, MUP, M2DOWN, M2DRAG, M2UP, M3DOWN, M3DRAG, M3UP for mouse Use MWDOWN, MWUP for wheel mouse motion Use ^# for 0x9B (for Amiga). But warning: this breaks UTF-8 keyboards. 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 2 or more command names. For example: eof,bol ^T Z Goto beginning of last line Also quoted matter is typed in literally: bol,">",dnarw .k1 Quote news article line Macros may cross lines if they end with , 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 goto the beginning of the last line. :windows Bindings common to all windows type ^@ TO ÿ Type a character 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 ^K H Help menu help ^K ^H help ^K h 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 ^# S pgup .kP Screen up pgup ^U pgup ^[ [ 5 ~ pgup ^# T 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 Mouse handling defmdown MDOWN Move the cursor to the mouse location defmup MUP defmdrag MDRAG Select a region of characters defm2down M2DOWN Select the word at the mouse location defm2up M2UP defm2drag M2DRAG Select a region of words defm3down M3DOWN Select the line at the mouse location defm3up M3UP defm3drag M3DRAG Select a region of lines xtmouse ^[ [ M Introduces an xterm mouse event if,"char==65",then,"it's an A",else,"it's not an a",endif ^[ q :main Text editing window :inherit windows Spell-check macros Ispell :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 $SPLTMP;aspell --lang=",language,".",charset," -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 --lang=",language,".",charset," -x -c $SPLTMP /dev/tty;tr -d <$SPLTMP '\\012';/bin/rm $SPLTMP",rtn,retype,nextword aspellfile ^[ l aspellword ^[ n Compile :def compile mwind!,mfit!,querysave,query,scratch,"* Build Log *",rtn,bof,markb,eof," ",markk,blkdel,build Grep :def grep_find mwind!,mfit!,scratch,"* Grep Log *",rtn,bof,markb,eof," ",markk,blkdel,grep Man page :def man scratch,"* Man Page *",rtn,bof,markb,eof," ",markk,blkdel," ",ltarw,run,"man -P cat -S 2:3 " Here we guess some common key sequences which either do not have termcap sequences or which are frequently wrong. Note that if the termcap entry is correct, it will override these later on. paste ^[ ] 5 2 ; Bracketed paste insc ^[ [ 2 ~ insc ^[ [ L SCO delch ^[ [ 3 ~ pgup ^[ [ I SCO pgdn ^[ [ G SCO home ^[ [ 1 ~ Putty, Linux, Cygwin home ^[ [ H Xterm, Konsole, SCO home ^[ O H gnome-terminal home ^[ [ 7 ~ RxVT home ^# SP A Amiga eol ^[ [ 4 ~ Putty, Linux, Cygwin, ssh eol ^[ [ F Xterm, Konsole, SCO eol ^[ O F gnome-terminal eol ^[ [ 8 ~ RxVT eol ^# SP @ Amiga rtarw,ltarw,begin_marking,rtarw,toggle_marking ^[ [ 1 ; 5 C Mark right Xterm rtarw,ltarw,begin_marking,rtarw,toggle_marking ^[ [ 5 C Mark right Gnome-terminal (Almost all termcap entries have ^[ O C as an arrow key). rtarw,ltarw,begin_marking,rtarw,toggle_marking ^[ O C Mark right Putty Ctrl-rtarw rtarw,ltarw,begin_marking,rtarw,toggle_marking ^[ O c Mark right RxVT Ctrl-rtarw ltarw,rtarw,begin_marking,ltarw,toggle_marking ^[ [ 1 ; 5 D Mark left ltarw,rtarw,begin_marking,ltarw,toggle_marking ^[ [ 5 D Mark left ltarw,rtarw,begin_marking,ltarw,toggle_marking ^[ O D Mark left Putty Ctrl-ltarw ltarw,rtarw,begin_marking,ltarw,toggle_marking ^[ O d Mark left RxVT Ctrl-ltarw uparw,dnarw,begin_marking,uparw,toggle_marking ^[ [ 1 ; 5 A Mark up uparw,dnarw,begin_marking,uparw,toggle_marking ^[ [ 5 A Mark up uparw,dnarw,begin_marking,uparw,toggle_marking ^[ O A Mark up Putty Ctrl-uparw uparw,dnarw,begin_marking,uparw,toggle_marking ^[ O a Mark up RxVT Ctrl-uparw dnarw,uparw,begin_marking,dnarw,toggle_marking ^[ [ 1 ; 5 B Mark down dnarw,uparw,begin_marking,dnarw,toggle_marking ^[ [ 5 B Mark down dnarw,uparw,begin_marking,dnarw,toggle_marking ^[ O B Mark down Putty Ctrl-dnarw dnarw,uparw,begin_marking,dnarw,toggle_marking ^[ O b Mark down RxVT Ctrl-dnarw blkdel,nmark ^[ [ 3 ; 5 - Gnome-terminal Ctrl-Del blkdel,nmark ^[ [ 3 ; 5 ~ Xterm Ctrl-Del yank ^[ [ 2 ; 5 - Gnome-terminal Ctrl-Ins yank ^[ [ 2 ; 5 ~ Xterm Ctrl-Ins Extra functions not really part of JOE user interface: delbol ^[ o Delete to beginning of line delbol ^[ ^O Delete to beginning of line dnslide ^[ z Scroll down one line dnslide ^[ Z Scroll down one line dnslide ^[ ^Z Scroll down one line dnslide,dnslide,dnslide,dnslide MWDOWN compile ^[ c Compile compile ^[ C compile ^[ ^C Compile grep_find ^[ g Grep grep_find ^[ G Grep grep_find ^[ ^G Grep execmd ^[ x Prompt for command to execute execmd ^[ X Prompt for command to execute execmd ^[ ^X Prompt for command to execute finish ^[ ^I Complete word in document finish ^[ ^M Complete word: used to be math mwind,mfit,jump,bol ^[ SP isrch ^[ s Forward incremental search isrch ^[ S Forward incremental search isrch ^[ ^S Forward incremental search notmod ^[ ~ Not modified mwind,mfit,prevw,nxterr ^[ = To next error parserr ^[ e Parse errors in current buffer parserr ^[ E Parse errors in current buffer parserr ^[ ^E Parse errors in current buffer mwind,mfit,prevw,prverr ^[ - To previous error rsrch ^[ r Backward incremental search rsrch ^[ R Backward incremental search rsrch ^[ ^R Backward incremental search run ^[ ! Run a program in a window tomarkb ^[ b Go to beginning of marked block tomarkb ^[ ^B Go to beginning of marked block tomarkk ^[ k Go to end of marked block tomarkk ^[ ^K Go to end of marked block tomarkk ^[ K Go to end of marked block txt ^[ i Prompt for text and insert it txt ^[ I Prompt for text and insert it upslide ^[ w Scroll up one line upslide ^[ ^W Scroll up one line upslide ^[ W Scroll up one line upslide,upslide,upslide,upslide MWUP yank ^[ y Undelete text yankpop ^[ ^Y Undelete text yank ^[ Y Undelete text toggle_marking ^@ Ctrl-space block selection method insc ^@ Ctrl-space used to insert a space bufed ^[ d Menu of buffers nbuf ^[ v Next buffer nbuf ^[ V Next buffer nbuf ^[ ^V Next buffer pbuf ^[ u Prev buffer pbuf ^[ U Prev buffer pbuf ^[ ^U Prev buffer query ^[ q Quoted insert byte ^[ n Goto byte col ^[ c Goto column abortbuf ^[ k Kill current buffer- don't mess with windows ask ^[ a Ask to save current buffer bop ^[ p Backwards paragraph bos ^[ x Bottom of screen copy ^[ ^W Copy block into yank dupw ^[ \ Split window eop ^[ n Forwards paragraph format ^[ j Format paragraph ignore block markl ^[ l Mark line nmark ^[ @ Turn off ^KB ^KK pop ^[ > 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 quote ^[ ' Enter Ctrl chars quote ^Q 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 bol .kh Goto beginning of line bol ^A bol ^# SP A home .kh home ^A 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 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 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 eol .kH Go to end of line eol .@7 eol ^E 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 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 ^@ insf ^K R Insert a file insf ^K ^R insf ^K r lindent ^K , Indent to left line ^K L Goto line no. line ^K ^L line ^K l ltarw .kl Go left ltarw ^B ltarw ^[ O D ltarw ^[ [ 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 menu,"root",rtn ^T nextpos ^K = Goto next position in position history nextword ^X Goto next word open ^] Split line prevpos ^K - Previous position in history prevword ^Z Previous word reload ^K ` Revert file redo ^^ Redo changes rindent ^K . Indent to right rtarw .kr Go right rtarw ^F rtarw ^[ O C rtarw ^[ [ 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 ^# A uparw ^P uparw ^[ O A uparw ^[ [ A :prompt Prompt windows :inherit main if,"byte>size",then,complete,complete,else,delch,endif ^D complete ^I dnarw,eol .kd Go down dnarw,eol ^N dnarw,eol ^[ O B dnarw,eol ^[ [ B dnarw,eol ^# B uparw,eol .ku Go up uparw,eol ^# A uparw,eol ^P uparw,eol ^[ O A uparw,eol ^[ [ A :menu Selection menus :inherit windows pgupmenu ^[ [ I pgdnmenu ^[ [ G bolmenu ^[ [ 1 ~ Putty, Linux, Cygwin bolmenu ^[ [ H Xterm, Konsole bolmenu ^[ O H gnome-terminal bolmenu ^[ [ 7 ~ RxVT bolmenu ^# SP A Amiga eolmenu ^[ [ 4 ~ Putty, Linux, Cygwin, ssh eolmenu ^[ [ F Xterm, Konsole eolmenu ^[ O F gnome-terminal eolmenu ^[ [ 8 ~ RxVT eolmenu ^# SP @ Amiga abort ^[ ^[ Why? backsmenu ^? backsmenu ^H bofmenu ^K U bofmenu ^K ^U bofmenu ^K u bolmenu .kh bolmenu ^A dnarwmenu .kd dnarwmenu ^N dnarwmenu ^[ [ B dnarwmenu ^[ O B dnarwmenu ^# B dnarwmenu MWDOWN eofmenu ^K V eofmenu ^K ^V eofmenu ^K v eolmenu .kH eolmenu ^E ltarwmenu .kl ltarwmenu ^B ltarwmenu ^[ [ D ltarwmenu ^[ O D ltarwmenu ^# D pgdnmenu .kN Screen down pgdnmenu ^V pgdnmenu ^[ [ 6 ~ pgdnmenu ^# S pgupmenu .kP Screen up pgupmenu ^U pgupmenu ^[ [ 5 ~ pgupmenu ^# T rtarwmenu .kr rtarwmenu ^F rtarwmenu ^[ [ C 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 uparwmenu ^# A uparwmenu MWUP defm2down M2DOWN Hits return key :query Single-key query window :inherit windows :querya Single-key query window for quoting type ^@ TO ÿ :querysr Search & replace query window type ^@ TO ÿ joe-3.7/rc/ftyperc0000644000100100007640000002214711102461205011053 00000000000000 File Type table. This is :included by the joerc file. No '.' in file name? Assume it's a text file and we want wordwrap on. * -wordwrap File name with '.'? It's probably not a text file. *.* Diff * +--- -syntax diff * +*** -syntax diff * +\[1-9]\+\[0-9]\[cda] -syntax diff *.diff -syntax diff *.patch -syntax diff * +Only in -syntax diff * +Nur in -syntax diff * +Index: \[A-Za-z] -syntax diff * +? \[A-Za-z] -syntax diff Troff *.1 -wordwrap -syntax troff *.1.in -wordwrap -syntax troff TeX *.tex -wordwrap -syntax tex -tex_comment -no_double_quoted *.sty -wordwrap -syntax tex -tex_comment -no_double_quoted Text file. *.txt -wordwrap News/mail files. *.article* -wordwrap -syntax mail *.followup -wordwrap -syntax mail *.letter -wordwrap -syntax mail NN newsreader *tmp/nn.* -wordwrap -syntax mail mail *tmp/Re* -wordwrap -syntax mail elm *tmp/snd.* -wordwrap -syntax mail dmail *tmp/dmt* -wordwrap -syntax mail pine *tmp/pico.* -wordwrap -syntax mail Assembly language *.asm -wordwrap -syntax asm *.s -wordwrap -syntax asm *.S -wordwrap -syntax asm Mason *.mas -autoindent -syntax mason -smarthome -smartbacks SML *.sml -autoindent -syntax sml -smarthome -smartbacks -istep 2 OCaml lanaguage file *.ml -autoindent -syntax ocaml -smarthome -smartbacks -istep 2 OCaml language interface *.mli -autoindent -syntax ocaml -smarthome -smartbacks -istep 2 Ruby *.rb -autoindent -syntax ruby Perl * +#!\+\[ ]\+\[a-z/]/perl\> -autoindent -syntax perl -smarthome -smartbacks -pound_comment -single_quoted *.pl -autoindent -syntax perl -smarthome -smartbacks -pound_comment -single_quoted *.pm -autoindent -syntax perl -smarthome -smartbacks -pound_comment -single_quoted SQL file *.sql -autoindent -syntax sql -smarthome -smartbacks -purify -single_quoted -c_comment -vhdl_comment -cpp_comment -text_delimiters BEGIN|Begin|begin=END|End|end -cpara >#!;*/% AWK language file *.awk -autoindent -syntax awk -smarthome -smartbacks -purify -pound_comment YACC *.y -autoindent -syntax c -smarthome -smartbacks -purify -single_quoted -c_comment -cpp_comment -text_delimiters #if|#ifdef|#ifndef=#elif=#else=#endif -cpara >#!;*/% LEX *.l -autoindent -syntax c -smarthome -smartbacks -purify -single_quoted -c_comment -cpp_comment -text_delimiters #if|#ifdef|#ifndef=#elif=#else=#endif -cpara >#!;*/% *.lex -autoindent -syntax c -smarthome -smartbacks -purify -single_quoted -c_comment -cpp_comment -text_delimiters #if|#ifdef|#ifndef=#elif=#else=#endif -cpara >#!;*/% ADA *.adb -syntax ada -autoindent -istep 2 -smarthome -smartbacks -purify -vhdl_comment -text_delimiters declare|Declare|DECLARE|exception|Exception|EXCEPTION|if|If|IF|loop|Loop|LOOP|case|Case|CASE|package|Package|PACKAGE|procedure|Procedure|PROCEDURE|record|Record|RECORD|function|Function|FUNCTION=end|End|END *.ads -syntax ada -autoindent -istep 2 -smarthome -smartbacks -purify -vhdl_comment -text_delimiters declare|Declare|DECLARE|exception|Exception|EXCEPTION|if|If|IF|loop|Loop|LOOP|case|Case|CASE|package|Package|PACKAGE|procedure|Procedure|PROCEDURE|record|Record|RECORD|function|Function|FUNCTION=end|End|END COBOL *.cbl -syntax cobol *.cob -syntax cobol REXX *.rex -syntax rexx -autoindent *.REX -syntax rexx -autoindent * +#!\+\[ ]\+\[a-z/]/rxx\> -syntax rexx -autoindent sed *.sed -syntax sed Postscript *.ps -syntax ps *.eps -syntax ps C language file *.c -autoindent -syntax c -smarthome -smartbacks -purify -single_quoted -c_comment -cpp_comment -text_delimiters #if|#ifdef|#ifndef=#elif=#else=#endif -cpara >#!;*/% *.cpp -autoindent -syntax c -smarthome -smartbacks -purify -single_quoted -c_comment -cpp_comment -text_delimiters #if|#ifdef|#ifndef=#elif=#else=#endif -cpara >#!;*/% *.cc -autoindent -syntax c -smarthome -smartbacks -purify -single_quoted -c_comment -cpp_comment -text_delimiters #if|#ifdef|#ifndef=#elif=#else=#endif -cpara >#!;*/% *.c++ -autoindent -syntax c -smarthome -smartbacks -purify -single_quoted -c_comment -cpp_comment -text_delimiters #if|#ifdef|#ifndef=#elif=#else=#endif -cpara >#!;*/% C language header file *.h -autoindent -syntax c -smarthome -smartbacks -purify -single_quoted -c_comment -cpp_comment -text_delimiters #if|#ifdef|#ifndef=#elif=#else=#endif -cpara >#!;*/% *.h.in -autoindent -syntax c -smarthome -smartbacks -purify -single_quoted -c_comment -cpp_comment -text_delimiters #if|#ifdef|#ifndef=#elif=#else=#endif -cpara >#!;*/% *.hpp -autoindent -syntax c -smarthome -smartbacks -purify -single_quoted -c_comment -cpp_comment -text_delimiters #if|#ifdef|#ifndef=#elif=#else=#endif -cpara >#!;*/% *.h++ -autoindent -syntax c -smarthome -smartbacks -purify -single_quoted -c_comment -cpp_comment -text_delimiters #if|#ifdef|#ifndef=#elif=#else=#endif -cpara >#!;*/% Verilog file *.v -autoindent -syntax verilog -istep 2 -smarthome -smartbacks -purify -c_comment -cpp_comment -text_delimiters `ifdef|`ifndef=`else=`endif:begin=end:case|casex|casez=endcase:function=endfunction:module=endmodule:task=endtask:attribute=endattribute:primitive=endprimitive:table=endtable -cpara >#!;*/% Verilog header file *.vh -autoindent -syntax verilog -istep 2 -smarthome -smartbacks -purify -c_comment -cpp_comment -text_delimiters `ifdef|`ifndef=`else=`endif:begin=end:case|casex|casez=endcase:function=endfunction:module=endmodule:task=endtask:attribute=endattribute:primitive=endprimitive:table=endtable -cpara >#!;*/% VHDL file *.vhd -autoindent -syntax vhdl -istep 2 -smarthome -smartbacks -purify -vhdl_comment -text_delimiters entity|ENTITY|if|IF|component|COMPONENT|loop|LOOP|configuration|CONFIGURATION|units|UNITS|record|RECORD|case|CASE|function|FUNCTION|package|PACKAGE|architecture|ARCHITECTURE|block|BLOCK|process|PROCESS|generate|GENERATE=end|END -cpara >#!;*-/% XML *.xml -wordwrap -autoindent -syntax xml XML *.xsd -wordwrap -autoindent -syntax xml HTML *.htm -wordwrap -autoindent -syntax html *.html -wordwrap -autoindent -syntax html JAVA *.java -autoindent -syntax java -smarthome -smartbacks -purify -cpara >#!;*/% Javascript *.js -autoindent -syntax java -smarthome -smartbacks -purify -cpara >#!;*/% Hypertext preprocessor file *.php -autoindent -syntax php -smarthome -smartbacks -purify Python * +#!\+\[ ]\+\[a-z/]\+\[ ]python\> -autoindent -syntax python -smarthome -smartbacks -purify *.py -autoindent -syntax python -smarthome -smartbacks -purify CSH * +#!\+\[ ]\+\[a-z/]/csh\> -autoindent -syntax csh -pound_comment *.csh -autoindent -syntax csh -pound_comment *.login -autoindent -syntax csh -pound_comment *.logout -autoindent -syntax csh -pound_comment TCSH * +#!\+\[ ]\+\[a-z/]/tcsh\> -autoindent -syntax csh -pound_comment *.tcsh -autoindent -syntax csh -pound_comment *.tcshrc -autoindent -syntax csh -pound_comment Shell * +#!\+\[ ]\+\[a-z/]/sh\> -autoindent -syntax sh -pound_comment -text_delimiters do=done:if=elif=else=fi:case=esac *.sh -autoindent -syntax sh -pound_comment -text_delimiters do=done:if=elif=else=fi:case=esac *profile -autoindent -syntax sh -pound_comment -text_delimiters do=done:if=elif=else=fi:case=esac BASH Shell * +#!\+\[ ]\+\[a-z/]/bash\> -autoindent -syntax sh -pound_comment -text_delimiters do=done:if=elif=else=fi:case=esac *.bash -autoindent -syntax sh -pound_comment -text_delimiters do=done:if=elif=else=fi:case=esac *.bash_login -autoindent -syntax sh -pound_comment -text_delimiters do=done:if=elif=else=fi:case=esac *.bash_logout -autoindent -syntax sh -pound_comment -text_delimiters do=done:if=elif=else=fi:case=esac LISP *.lisp -autoindent -syntax lisp -semi_comment *.lsp -autoindent -syntax lisp -semi_comment *.el -autoindent -syntax lisp -semi_comment KSH * +#!\+\[ ]\+\[a-z/]/ksh\> -autoindent -syntax sh -pound_comment -text_delimiters do=done:if=elif=else=fi:case=esac *.ksh -autoindent -syntax sh -pound_comment -text_delimiters do=done:if=elif=else=fi:case=esac Makefile *akefile -autoindent -syntax conf -pound_comment *akefile.in -autoindent -syntax conf -pound_comment *AKEFILE -autoindent -syntax conf -pound_comment Pascal *.p -autoindent -syntax pascal -smarthome -smartbacks -purify -text_delimiters begin|BEGIN|record|RECORD|case|CASE=end|END:repeat|REPEAT=until|UNTIL *.pas -autoindent -syntax pascal -smarthome -smartbacks -purify -text_delimiters begin|BEGIN|record|RECORD|case|CASE=end|END:repeat|REPEAT=until|UNTIL Fortran *.f -autoindent -syntax fortran *.for -autoindent -syntax fortran *.FOR -autoindent -syntax fortran Cadence SKILL *.il -semi_comment -syntax skill -autoindent -istep 3 -indentc 32 -smartbacks -smarthome -indentfirst LUA *.lua -autoindent -syntax lua TCL *.tcl -autoindent -syntax tcl Joe Syntax File *.jsf -autoindent -syntax jsf -smarthome *.jsf.in -autoindent -syntax jsf -smarthome Autoconfig file *.ac -autoindent -syntax m4 M4 file *.m4 -autoindent -syntax m4 Matlab file *.m -wordwrap -syntax matlab Automake file *.am -autoindent -syntax conf Mail file *tmp/mutt-* -wordwrap -syntax mail System RC file *rc -syntax conf JOERC file *ftyperc -syntax joerc *joerc -syntax joerc *jmacsrc -syntax joerc *jstarrc -syntax joerc *rjoerc -syntax joerc *jpicorc -syntax joerc *joerc.in -syntax joerc *jmacsrc.in -syntax joerc *jstarrc.in -syntax joerc *rjoerc.in -syntax joerc *jpicorc.in -syntax joerc joe-3.7/rc/jstarrc.in0000644000100100007640000007671211103216163011465 00000000000000 Initialization file for JOE WordStar / Turbo-C Joe JOE looks for this file in: 1 - $HOME/.jstarrc 2 - @JOERC@/jstarrc This file can include other files by placing the following include command in the first column: :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): Override colors of lexical classes specified in syntax files: Put each color override you want in the first column. Valid colors: bold inverse blink dim underline white cyan magenta blue yellow green red black bg_white bg_cyan bg_magenta bg_blue bg_yellow bg_green bg_red bg_black Override all instances of class Idle: =Idle red Override Idle only for c syntax file: =c.Idle red The following list is from c.jsf. Look at other syntax files for more classes. =Idle =Bad bold red =Preproc blue =Define bold blue =IncLocal cyan =IncSystem bold cyan =Constant cyan =Escape bold cyan =Type bold =Keyword bold =CppKeyword bold =Brace magenta =Control Put each option you want set in the first column: -option Sets the option --option Clears the option -help_is_utf8 Set if help text is in UTF-8 format. Leave clear if it's a raw 8-bit format. -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 -nolocks If you don't want file locks to be used -nomodcheck Disable periodic checking of disk file newer than buffer (this checking happens on save even with this option). -nocurdir Do not prompt with current directory -nobackups If you don't want backup files to be created -break_hardlinks Delete file before writing, to break hard links (but don't break symbolic links). -break_links Delete file before writing, to break hard links and symbolic links. -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 -undo_keep nnn Number of undo records to keep. 0 for infinite. -csmode ^KF after a pervious search does a ^L instead -backpath path Directory to store backup files (one space between 'backpath' and the 'path', no trailing spaces or comments after the path). -floatmouse Clicking past end of line moves the cursor past the end -rtbutton Use the right mouse button for action, instead of the left -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 -notite Don't send terminal initialization and termination strings: prevents restoration of screen on exit. -usetabs Use tabs to help optimize screen update. -assume_color Assume terminal has ANSI color support even if termcap/terminfo entry says that it doesn't. This only applies if the terminal otherwise looks like an ANSI terminal (support bold and capability starts with ESC [). -assume_256color Assume terminal has xterm 256 color support (ESC [ 38 ; 5 ; NNN m and ESC [ 48 ; 5 ; NNN m). -guess_non_utf8 Allow guess of non-UTF-8 file encoding in a UTF-8 locale. -guess_utf8 Allow guess of UTF-8 file encoding in non-UTF-8 locale. -guess_crlf Automatically detect MS-DOS files and set -crlf appropriately -guess_indent Guess indent character (tab or space). -menu_above Position menu/list above prompt when enabled. Otherwise position below prompt. -transpose Transpose rows with columns in all menus. -menu_explorer Stay in menu system when a directory is selected (otherwise directory is added to path and menu is closed). -menu_jump Jump into file selection menu when tab is hit (otherwise, menu comes up, but cursor stays in file name prompt). -icase Search is case insensitive by default. -wrap Search wraps -autoswap Swap markb with markk when necessary -joe_state Use ~/.joe_state file -mouse Enable mouse support -joexterm If you are using Joe's modified Xterm, which makes -mouse mode work better (cut & paste work transparently). -square Rectangular block mode -text_color color Set color for text. -status_color color Set color for status bar. -help_color color Set color for help. -menu_color color Set color for menus. -prompt_color color Set color for prompts. -msg_color color Set color for messages. For example: -text_color bg_blue+white Sets the background color to blue and foreground color to white. -restore Restore previous cursor position when files are opened -search_prompting Search prompts with previous search request. 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. The following escape sequences can be used in these string: %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 %O Byte offset into file in hex %a Ascii value of character under cursor %A Ascii value of character under cursor in hex %p Percent of file cursor is at %l No. 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) The 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 SECOND SECTION: File name dependant local option settings: Each line with '*' in the first column indicates the modes which should be files which match the regular expression. If more than one regular expression matches the file name, than the last matching one is chosen. Here is a list of modes which can be set: -cpara >#!;*/% Characters which can indent paragraphs. -encoding name Set file coding (for example: utf-8, iso-8859-15) -syntax name Specify syntax (syntax file called 'name.jsf' will be loaded) -hex Hex editor mode -highlight Enable highlighting -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 going the beginning of line first. -smartbacks Backspace key deletes 'istep' number of 'indentc's if cursor is at first non-space character. -tab nnn Tab width -indentc nnn Indentation character (32 for space, 9 for tab) -istep nnn Number of indentation columns -spaces TAB inserts spaces instead of tabs. -purify Fix 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). -crlf File uses CR-LF at ends of lines -wordwrap Wordwrap -nobackup If you don't want backup file to be created -autoindent Auto indent -overwrite Overtype mode -picture Picture mode (right arrow can go past end of lines) -lmargin nnn Left margin -rmargin nnn Right margin -flowed Put one space after intermediate paragraph lines for support of flowed text. -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. -linums Enable line numbers on each line -rdonly File is read-only -keymap name Keymap to use if not 'main' -lmsg Status line definition strings- -rmsg see previous section for more info. -mfirst macro Macro to execute on first modification -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. These define the language syntax for ^G (goto matching delimiter): -single_quoted Text between ' ' should be ignored (this is not good for regular text since ' is normally used alone as an apostrophe) -c_comment Text between /* */ should be ignored -cpp_comment Text after // should be ignored -pound_comment Text after # should be ignored -vhdl_comment Text after -- should be ignored -semi_comment Text after ; should be ignored -text_delimiters begin=end:if=elif=else=endif Define word delimiters Default local options -highlight -istep 2 Use this macro (put in first column) to have joe "p4 edit" a file you're about to change. -mfirst if,"rdonly && joe(sys,\"p4 edit \",name,rtn)",then,mode,"o",msg,"executed \"p4 edit ",name,"\"",rtn,endif File type table is now in a separate file. You can copy this file to ~/.joe and customize it. :include ftyperc SECOND and 1/2 SECTION: Option menu layout :defmenu name Defines a menu. macro string comment A menu entry. Macro is any JOE macro- see "Macros:" below. String is the label to be used for the macro in the menu. It is in the same format as the -lmsg and -rmsg options above. Two whitespace characters in a row begins a comment. Use '% ' for a leading space in the string. :defmenu root mode,"overwrite",rtn T Overtype %Zoverwrite% mode,"hex",rtn % % Hex edit mode mode,"autoindent",rtn I Autoindent %Zautoindent% mode,"wordwrap",rtn W Word wrap %Zwordwrap% mode,"tab",rtn D Tab width %Ztab% mode,"lmargin",rtn L Left margin %Zlmargin% mode,"rmargin",rtn R Right margin %Zrmargin% mode,"square",rtn X Rectangle mode %Zsquare% mode,"indentc",rtn % % Indent char %Zindentc% mode,"istep",rtn % % Indent step %Zistep% mode,"highlight",rtn H Highlighting %Zhighlight% mode,"crlf",rtn Z CR-LF (MS-DOS) %Zcrlf% mode,"linums",rtn N Line numbers %Zlinums% mode,"beep",rtn B Beep %Zbeep% mode,"rdonly",rtn O Read only %Zrdonly% mode,"syntax",rtn Y Syntax mode,"encoding",rtn E Encoding mode,"asis",rtn % % Meta chars as-is mode,"language",rtn V Language mode,"picture",rtn P picture %Zpicture% menu,"more-options",rtn % % More options... :defmenu more-options menu,"^G",rtn % % ^G options menu,"search",rtn % % search options menu,"paragraph",rtn % % paragraph options menu,"file",rtn % % file options menu,"menu",rtn % % menu options menu,"global",rtn % % global options menu,"cursor",rtn % % cursor options menu,"marking",rtn % % marking options menu,"tab",rtn % % tab/indent options :defmenu menu mode,"menu_explorer",rtn % % Menu explorer %Zmenu_explorer% mode,"menu_above",rtn % % Menu position %Zmenu_above% mode,"menu_jump",rtn % % Jump into menu %Zmenu_jump% mode,"transpose",rtn % % Transpose menus %Ztranspose% :defmenu ^G mode,"single_quoted",rtn % % ^G ignores '...' %Zsingle_quoted% mode,"no_double_quoted",rtn % % ^G no ignore "..." %Zno_double_quoted% mode,"c_comment",rtn % % ^G ignores /*...*/ %Zc_comment% mode,"cpp_comment",rtn % % ^G ignores //... %Zcpp_comment% mode,"pound_comment",rtn % % ^G ignores #... %Zpound_comment% mode,"vhdl_comment",rtn % % ^G ignores --... %Zvhdl_comment% mode,"semi_comment",rtn % % ^G ignores ;... %Zsemi_comment% mode,"tex_comment",rtn % % ^G ignores %... %Ztex_comment% mode,"text_delimiters",rtn % % Text delimiters %Ztext_delimiters% :defmenu search mode,"icase",rtn % % Case insensitivity %Zicase% mode,"wrap",rtn % % Search wraps %Zwrap% mode,"search_prompting",rtn % % Search prompting %Zsearch_prompting% mode,"csmode",rtn % % Continued search %Zcsmode% :defmenu paragraph mode,"french",rtn % % French spacing %Zfrench% mode,"flowed",rtn % % Flowed text %Zflowed% mode,"cpara",rtn % % Paragraph indent chars %Zcpara% :defmenu file mode,"restore",rtn % % Restore cursor %Zrestore% mode,"guess_crlf",rtn % % Auto detect CR-LF %Zguess_crlf% mode,"guess_indent",rtn % % Guess indent %Zguess_indent% mode,"guess_non_utf8",rtn % % Guess non-UTF-8 %Zguess_non_utf8% mode,"guess_utf8",rtn % % Guess UTF-8 %Zguess_utf8% mode,"force",rtn % % Force last NL %Zforce% mode,"nobackup",rtn % % No backup %Znobackup% :defmenu global mode,"nolocks",rtn % % Disable locks %Znolocks% mode,"nobackups",rtn % % Disable backups %Znobackups% mode,"nomodcheck",rtn % % Disable mtime check %Znomodcheck% mode,"nocurdir",rtn % % Disable current dir %Znocurdir% mode,"exask",rtn % % Exit ask %Zexask% mode,"nosta",rtn % % Disable status line %Znosta% mode,"keepup",rtn % % Fast status line %Zkeepup% mode,"break_hardlinks",rtn % % Break hard links %Zbreak_hardlinks% mode,"break_links",rtn % % Break links %Zbreak_links% mode,"joe_state",rtn % % Joe_state file %Zjoe_state% mode,"undo_keep",rtn % % No. undo records %Zundo_keep% mode,"backpath",rtn % % Path to backup files %Zbackpath% :defmenu cursor mode,"pg",rtn % % No. PgUp/PgDn lines %Zpg% mode,"mid",rtn C Center on scroll %Zmid% mode,"floatmouse",rtn % % Click past end %Zfloatmouse% mode,"rtbutton",rtn % % Right button %Zrtbutton% :defmenu marking mode,"autoswap",rtn % % Autoswap mode %Zautoswap% mode,"marking",rtn % % Marking %Zmarking% mode,"lightoff",rtn % % Auto unmask %Zlightoff% :defmenu tab mode,"smarthome",rtn % % Smart home key %Zsmarthome% mode,"smartbacks",rtn % % Smart backspace %Zsmartbacks% mode,"indentfirst",rtn % % To indent first %Zindentfirst% mode,"purify",rtn % % Clean up indents %Zpurify% mode,"spaces",rtn % % No tabs %Zspaces% THIRD SECTION: Named help screens: Use \i to turn on/off inverse video Use \u to turn on/off underline Use \b to turn on/off bold Use \d to turn on/off dim Use \f to turn on/off flash {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 } {SearchOptions \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \iSearch options: \|\i \i \i \i r Replace \|\i \i \i \i k Restrict search to highlighted block, which can be rectangular \|\i \i \i \i b Search backward instead of forward \|\i \i \i \i i Ignore case \|\i \i \i \i a Search across all loaded files \|\i \i \i \i e Search across all files in Grep or Compile error list \|\i \i \i \i w Wrap to beginning of file for this search \|\i \i \i \i n Do not wrap to beginning of file for this search \|\i \i \i \i nnn Perform exaclty nnn replacements \|\i \i } {Math \i Help Screen \|turn off with ^J prev. screen ^[, next screen ^[. \i \i \i \uCOMMANDS\u (hit ^Q M for math) \uFUNCTIONS\u \|\i \i \i \i hex hex display mode sin cos tab asin acos atan \|\i \i \i \i dec decimal mode sinh cosh tanh asinh acosh atanh \|\i \i \i \i ins type result into file sqrt cbrt exp ln log \|\i \i \i \i eval evaluate block int floor ceil abs erg ergc \|\i \i \i \i 0xff enter number in hex joe(..macro..) - runs an editor macro \|\i \i \i \i 3e-4 floating point decimal \uBLOCK\u \|\i \i \i \i a=10 assign a variable sum cnt Sum, count \|\i \i \i \i 2+3:ins multiple commands avg dev Average, std. deviation \|\i \i \i \i e pi constants \uOPERATORS\u \|\i \i \i \i ans previous result ! ^ * / % + - < <= > >= == != && || ? :\|\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 ^[, next screen ^[. \i \i \i Send bug reports to: http://sourceforge.net/projects/joe-editor \|\i \i \i \i \|\i \i \i \i default joerc file is here @JOERC@/joerc \|\i \i \i \i default syntax and i18n files are here @JOEDATA@ \|\i \i \i \i additional documentation can be found here @JOEDOC@ \|\i \i } {CharTable \i Help Screen \|turn off with ^J prev. screen ^[, \i \i \i\| Dec \u 0123 4567 8901 2345 0123 4567 8901 2345 \u Dec \|\i \i \i \i\| | | \|\i \i \i \i\| 0 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \i\u@ABC\u\i \i\uDEFG\u\i \i\uHIJK\u\i \i\uLMNO\u\i | 128 \|\i \i \i \i\| 16 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \i\uPQRS\u\i \i\uTUVW\u\i \i\uXYZ[\u\i \i\u\\]^_\u\i | 144 \|\i \i \i \i\| 32 | !"# $%&' ()*+ ,-./  ¡¢£ ¤¥¦§ ¨©ª« ¬­®¯ | 160 \|\i \i \i \i\| 48 | 0123 4567 89:; <=>? °±²³ ´µ¶· ¸¹º» ¼½¾¿ | 176 \|\i \i \i \i\| 64 | @ABC DEFG HIJK LMNO ÀÁÂà ÄÅÆÇ ÈÉÊË ÌÍÎÏ | 192 \|\i \i \i \i\| 80 | PQRS TUVW XYZ[ \\]^_ ÐÑÒÓ ÔÕÖ× ØÙÚÛ ÜÝÞß | 208 \|\i \i \i \i\| 96 | `abc defg hijk lmno àáâã äåæç èéêë ìíîï | 224 \|\i \i \i \i\| 112 | pqrs tuvw xyz{ |}~ ðñòó ôõö÷ øùúû üýþÿ | 240 \|\i \i } FOURTH SECTION: Key bindings: Section names you must provide: :main For editing window :prompt For prompt lines :query For single-character query lines :querya Singe-character query for quote :querysr Search & Replace single-character query Other sections may be given as well for organization 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 Ctrl chars Use SP for space Use a TO b to generate a range of characters Use MDOWN, MDRAG, MUP, M2DOWN, M2DRAG, M2UP, M3DOWN, M3DRAG, M3UP for mouse Use MWDOWN, MWUP for wheel mouse motion 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 2 or more command names. For example: bof,bol ^T Z Goto beginning of last line Also quoted matter is typed in literally: bol,">",dnarw .k1 Quote news article line Macros may cross lines if they end with , :windows Bindings common to all windows 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 ^J 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 ^# S pgup .kP Screen up pgup ^[ [ 5 ~ pgup ^# T 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 ^[ ) Mouse handling defmdown MDOWN Move the cursor to the mouse location defmup MUP defmdrag MDRAG Select a region of characters defm2down M2DOWN Select the word at the mouse location defm2up M2UP defm2drag M2DRAG Select a region of words defm3down M3DOWN Select the line at the mouse location defm3up M3UP defm3drag M3DRAG Select a region of lines xtmouse ^[ [ M Introduces an xterm mouse event :main Text editing window :inherit windows Ispell :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 $SPLTMP;aspell --lang=",language,".",charset," -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 --lang=",language,".",charset," -x -c $SPLTMP /dev/tty;tr -d <$SPLTMP '\\012';/bin/rm $SPLTMP",rtn,retype,nextword @SPELL@file ^Q l @SPELL@file ^Q L @SPELL@file ^Q ^L @SPELL@word ^Q n @SPELL@word ^Q N @SPELL@word ^Q ^N Compile macro :def compile querysave,query,scratch,"* Build Log *",rtn,markb,eof," ",markk,blkdel,build Grep :def grep_find mwind!,mfit!,scratch,"* Grep Log *",rtn,bof,markb,eof," ",markk,blkdel,grep Man page :def man scratch,"* Man Page *",rtn,bof,markb,eof," ",markk,blkdel," ",ltarw,run,"man -P cat -S 2:3 " paste ^[ ] 5 2 ; Bracketed paste insc ^[ [ 2 ~ insc ^[ [ L SCO delch ^[ [ 3 ~ pgup ^[ [ I SCO pgdn ^[ [ G SCO home ^[ [ 1 ~ Putty, Linux, Cygwin home ^[ [ H Xterm, Konsole, SCO home ^[ O H gnome-terminal home ^[ [ 7 ~ RxVT home ^# SP A Amiga eol ^[ [ 4 ~ Putty, Linux, Cygwin, ssh eol ^[ [ F Xterm, Konsole, SCO eol ^[ O F gnome-terminal eol ^[ [ 8 ~ RxVT eol ^# SP @ Amiga rtarw,prevword,markb,nextword,markk ^K T rtarw,prevword,markb,nextword,markk ^K ^T rtarw,prevword,markb,nextword,markk ^K t run ^[ ! isrch ^[ s isrch ^[ S isrch ^[ ^S rsrch ^[ r rsrch ^[ R rsrch ^[ ^R backw ^[ o backw ^[ ^O yankpop ^[ y yankpop ^[ Y yankpop ^[ ^Y parserr ^[ E parserr ^[ ^E parserr ^[ e mwind,mfit,prevw,nxterr ^[ = mwind,mfit,prevw,prverr ^[ - compile ^[ ^C compile ^[ c compile ^[ C insf," ",bol,deleol,"!date '+%I:%M %p'",rtn ^[ ! insf," ",bol,deleol,"!date '+%b %d, %Y'",rtn ^[ @ center ^[ c psh,prevword,nextword,nextword,markk,prevword,markb,setmark,":", prevword,nextword,blkmove,markk,prevword,markb,gomark,":",blkmove,nextword ^[ t bop ^[ p psh,drop,fwrdc,query,markk,blkdel ^Q T Cut to char psh,drop,fwrdc,query,markk,blkdel ^Q t Cut to char psh,drop,fwrdc,query,markk,blkdel ^Q ^T Cut to char quote8 ^\ Quote Meta chars quote ^P Quote Ctrl chars backs ^? Backspace backs ^H bknd ^K ' Shell window bkwdc ^Q H ^@ TO ÿ bkwdc ^Q ^H ^@ TO ÿ bkwdc ^Q h ^@ TO ÿ 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 V Move marked block blkmove ^K ^V blkmove ^K v blksave ^K W Save marked block blksave ^K ^W blksave ^K w bof ^Q R Goto beginning of file bof ^Q ^R bof ^Q r bof ^Q .kP home .kh Goto beginning of line home ^[ [ H home ^[ [ 1 ~ home ^Q S home ^Q ^S home ^Q s home ^Q .kl crawll ^Q , crawlr ^Q . tos,bol ^Q E tos,bol ^Q ^E tos,bol ^Q e tos,bol ^Q .ku center ^K A Center line center ^K ^A center ^K a delbol ^Q ^H delbol ^Q ^? delbol ^Q .kD delch .kD Delete character delch ^G deleol ^Q Y Delete to end of line deleol ^Q ^Y deleol ^Q y dellin ^Y Delete entire line delw ^T Delete word to right dnarw .kd Go down dnarw ^X dnarw ^[ O B dnarw ^[ [ B dnarw ^# B dnslide ^Z dnslide,dnslide,dnslide,dnslide MWDOWN edit ^K E Edit a file edit ^K ^E edit ^K e eof ^Q C Go to end of file eof ^Q ^C eof ^Q c eof ^Q .kN eol .kH Go to end of line eol .@7 eol ^[ [ F eol ^[ [ 4 ~ eol ^Q D eol ^Q ^D eol ^Q d eol ^Q .kr bos,eol ^Q X bos,eol ^Q ^X bos,eol ^Q x bos,eol ^Q .kd exsave ^K X Save and exit exsave ^K ^X exsave ^K x ffirst ^Q F Find first ffirst ^Q ^F ffirst ^Q f qrepl ^Q A Search & replace qrepl ^Q ^A qrepl ^Q a filt ^K / Filter block fnext ^L Find next format ^B Format paragraph fwrdc ^Q G ^@ TO ÿ fwrdc ^Q ^G ^@ TO ÿ fwrdc ^Q g ^@ TO ÿ gomark ^Q 0 TO 9 groww ^K G Grow window groww ^K ^G groww ^K g insc ^@ insf ^K R Insert a file insf ^K ^R insf ^K r macros ^[ d Dump macros macros ^[ ^D mode,"overtype",rtn ^V Insert/Overtype mode,"overtype",rtn .kI lindent ^K , Indent to left line ^Q I Goto line no. line ^Q ^I line ^Q i ltarw .kl Go left ltarw ^S ltarw ^[ O D ltarw ^[ [ D ltarw ^# 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 markl ^K L markl ^K ^L markl ^K l mode ^O menu,"root",rtn ^O nextpos ^K = Goto next position in position history nextword ^F Goto next word open ^N Split line pgdn ^C pgup ^R prevpos ^Q P prevpos ^Q ^P prevpos ^Q p prevword ^A Previous word redo ^^ Redo changes rindent ^K . Indent to right rtarw .kr Go right rtarw ^D rtarw ^[ O C rtarw ^[ [ C rtarw ^# C save ^K D Save file save ^K S save ^K ^D save ^K ^S save ^K d save ^K s setmark ^K 0 TO 9 shrinkw ^K T Shrink window shrinkw ^K ^T shrinkw ^K t splitw ^K O Split window splitw ^K ^O splitw ^K o stat ^Q ? Show status tag ^K ; tomarkb ^Q B Go to beginning of marked block tomarkb ^Q ^B tomarkb ^Q b tomarkk ^Q K Go to end of marked block tomarkk ^Q ^K tomarkk ^Q k tomatch ^Q [ Goto matching parenthasis tomatch ^Q ^[ tomatch ^Q ] tomatch ^Q ^] undo ^U Undo changes undo ^_ uparw .ku Go up uparw ^E uparw ^[ O A uparw ^[ [ A uparw ^# A upslide ^W upslide,upslide,upslide,upslide MWUP :prompt Prompt windows :inherit main abort ^C complete ^I dnarw,eol .kd Go down dnarw,eol ^N dnarw,eol ^[ O B dnarw,eol ^[ [ B dnarw,eol ^# B uparw,eol .ku Go up uparw,eol ^# A uparw,eol ^P uparw,eol ^[ O A uparw,eol ^[ [ A :menu Selection menus :inherit windows pgupmenu ^[ [ I pgdnmenu ^[ [ G bolmenu ^[ [ 1 ~ Putty, Linux, Cygwin bolmenu ^[ [ H Xterm, Konsole bolmenu ^[ O H gnome-terminal bolmenu ^[ [ 7 ~ RxVT bolmenu ^# SP A Amiga eolmenu ^[ [ 4 ~ Putty, Linux, Cygwin, ssh eolmenu ^[ [ F Xterm, Konsole eolmenu ^[ O F gnome-terminal eolmenu ^[ [ 8 ~ RxVT eolmenu ^# SP @ Amiga abort ^[ ^[ backsmenu ^? backsmenu ^H bofmenu ^Q R bofmenu ^Q ^R bofmenu ^K r bolmenu .kh bolmenu ^Q S bolmenu ^Q ^S bolmenu ^Q s dnarwmenu .kd dnarwmenu ^X dnarwmenu ^[ [ B dnarwmenu ^# B dnarwmenu ^[ O B eofmenu ^Q C eofmenu ^Q ^C eofmenu ^Q c eolmenu .kH eolmenu ^Q D eolmenu ^Q ^D eolmenu ^Q d ltarwmenu .kl ltarwmenu ^S ltarwmenu ^[ [ D ltarwmenu ^# D ltarwmenu ^[ O D pgdnmenu .kN Screen down pgdnmenu ^C pgdnmenu ^[ [ 6 ~ pgupmenu .kP Screen up pgupmenu ^R pgupmenu ^[ [ 5 ~ rtarwmenu .kr rtarwmenu ^D rtarwmenu ^[ [ C rtarwmenu ^# C rtarwmenu ^[ O C rtn SP rtn ^I rtn ^K H rtn ^K h rtn ^K ^H rtn ^J tabmenu ^I uparwmenu .ku uparwmenu ^E uparwmenu ^[ [ A uparwmenu ^# A uparwmenu ^[ O A defm2down M2DOWN Hits return key :query Single-key query window :inherit windows :querya Single-key query window for quoting type ^@ TO ÿ :querysr Search & replace query window type ^@ TO ÿ joe-3.7/rc/jmacsrc.in0000644000100100007640000010331211103375762011435 00000000000000 Initialization file for JOE Gnu-Emacs Joe JOE looks for this file in: 1 - $HOME/.jmacsrc 2 - @JOERC@/jmacsrc This file can include other files by placing the following include command in the first column: :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): Override colors of lexical classes specified in syntax files: Put each color override you want in the first column. Valid colors: bold inverse blink dim underline white cyan magenta blue yellow green red black bg_white bg_cyan bg_magenta bg_blue bg_yellow bg_green bg_red bg_black Override all instances of class Idle: =Idle red Override Idle only for c syntax file: =c.Idle red The following list is from c.jsf. Look at other syntax files for more classes. =Idle =Bad bold red =Preproc blue =Define bold blue =IncLocal cyan =IncSystem bold cyan =Constant cyan =Escape bold cyan =Type bold =Keyword bold =CppKeyword bold =Brace magenta =Control Put each option you want set in the first column: -option Sets the option --option Clears the option -help_is_utf8 Set if help text is in UTF-8 format. Leave clear if it's a raw 8-bit format. -mid Cursor is recentered when scrolling is necessary -marking Text between ^KB and cursor is highlighted -lightoff Turn off highlighting after block copy or move -asis Characters 128 - 255 shown as-is -force Force final newline when files are saved -nolocks If you don't want file locks to be used -nomodcheck Disable periodic checking of disk file newer than buffer (this checking happens on save even with this option). -nobackups If you don't want backup files to be created -nocurdir Do not prompt with current directory -break_hardlinks Delete file before writing, to break hard links (but don't break symbolic links). -break_links Delete file before writing, to break hard links and symbolic links. -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 -undo_keep nnn Number of undo records to keep. 0 for infinite. -csmode ^KF after a pervious search does a ^L instead -backpath path Directory to store backup files (one space between 'backpath' and the 'path', no trailing spaces or comments after the path). -floatmouse Clicking past end of line moves the cursor past the end -rtbutton Use the right mouse button for action, instead of the left -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 optimizations -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 initialization and termination strings: prevents restoration of screen on exit. -usetabs Use tabs to help optimize screen update. -assume_color Assume terminal has ANSI color support even if termcap/terminfo entry says that it doesn't. This only applies if the terminal otherwise looks like an ANSI terminal (support bold and capability starts with ESC [). -assume_256color Assume terminal has xterm 256 color support (ESC [ 38 ; 5 ; NNN m and ESC [ 48 ; 5 ; NNN m). -guess_crlf Automatically detect MS-DOS files and set -crlf appropriately -guess_indent Guess indent character (tab or space). -guess_non_utf8 Allow guess of non-UTF-8 file encoding in a UTF-8 locale. -guess_utf8 Allow guess of UTF-8 file encoding in non-UTF-8 locale. -menu_above Position menu/list above prompt when enabled. Otherwise position below prompt. -transpose Transpose rows with columns in all menus. -menu_explorer Stay in menu system when a directory is selected (otherwise directory is added to path and menu is closed). -menu_jump Jump into file selection menu when tab is hit (otherwise, menu comes up, but cursor stays in file name prompt). -icase Search is case insensitive by default. -wrap Search wraps -autoswap Swap markb with markk when necessary -joe_state Use ~/.joe_state file -mouse Enable mouse support -joexterm If you are using Joe's modified Xterm, which makes -mouse mode work better (cut & paste work transparently). -square Rectangular block mode -text_color color Set color for text. -status_color color Set color for status bar. -help_color color Set color for help. -menu_color color Set color for menus. -prompt_color color Set color for prompts. -msg_color color Set color for messages. For example: -text_color bg_blue+white Sets the background color to blue and foreground color to white. -restore Restore previous cursor position when files are opened -search_prompting Search prompts with previous search request. 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. The following escape sequences can be used in these string: %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 %O Byte offset into file in hex %a Ascii value of character under cursor %A Ascii value of character under cursor in hex %k Entered prefix keys %p Percent of file cursor is at %l No. lines in file %S '*SHELL*' if there is a shell running in window %M Macro recording message %y Syntax %x Context (first non-indented line going backwards) The 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 %t ^X^H for help SECOND SECTION: File name dependant local option settings: Each line with '*' in the first column indicates the modes which should be files which match the regular expression. If more than one regular expression matches the file name, than the last matching one is chosen. Here is a list of modes which can be set: -cpara >#!;*/% Characters which can indent paragraphs. -encoding name Set file coding (for example: utf-8, iso-8859-15) -syntax name Specify syntax (syntax file called 'name.jsf' will be loaded) -hex Hex editor mode -highlight Enable highlighting -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 going the beginning of line first. -smartbacks Backspace key deletes 'istep' number of 'indentc's if cursor is at first non-space character. -tab nnn Tab width -indentc nnn Indentation character (32 for space, 9 for tab) -istep nnn Number of indentation columns -spaces TAB inserts spaces instead of tabs. -purify Fix 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). -crlf File uses CR-LF at ends of lines -wordwrap Wordwrap -nobackup If you don't want backup file to be created -autoindent Auto indent -overwrite Overtype mode -picture Picture mode (right arrow can go past end of lines) -lmargin nnn Left margin -rmargin nnn Right margin -flowed Put one space after intermediate paragraph lines for support of flowed text. -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. -linums Enable line numbers on each line -rdonly File is read-only -keymap name Keymap to use if not 'main' -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 -mfirst macro Macro to execute on first modification Macros for the above options are in the same format as in the key binding section below- but without the key name strings. These define the language syntax for ^G (goto matching delimiter): -single_quoted Text between ' ' should be ignored (this is not good for regular text since ' is normally used alone as an apostrophe) -c_comment Text between /* */ should be ignored -cpp_comment Text after // should be ignored -pound_comment Text after # should be ignored -vhdl_comment Text after -- should be ignored -semi_comment Text after ; should be ignored -text_delimiters begin=end:if=elif=else=endif Define word delimiters Default local options -highlight -istep 2 Use this macro (put in first column) to have joe "p4 edit" a file you're about to change. -mfirst if,"rdonly && joe(sys,\"p4 edit \",name,rtn)",then,mode,"o",msg,"executed \"p4 edit ",name,"\"",rtn,endif File type table is now in a separate file. You can copy this file to ~/.joe and customize it. :include ftyperc SECOND and 1/2 SECTION: Option menu layout :defmenu name Defines a menu. macro string comment A menu entry. Macro is any JOE macro- see "Macros:" below. String is the label to be used for the macro in the menu. It is in the same format as the -lmsg and -rmsg options above. Two whitespace characters in a row begins a comment. Use '% ' for a leading space in the string. :defmenu root mode,"overwrite",rtn T Overtype %Zoverwrite% mode,"hex",rtn % % Hex edit mode mode,"autoindent",rtn I Autoindent %Zautoindent% mode,"wordwrap",rtn W Word wrap %Zwordwrap% mode,"tab",rtn D Tab width %Ztab% mode,"lmargin",rtn L Left margin %Zlmargin% mode,"rmargin",rtn R Right margin %Zrmargin% mode,"square",rtn X Rectangle mode %Zsquare% mode,"indentc",rtn % % Indent char %Zindentc% mode,"istep",rtn % % Indent step %Zistep% mode,"highlight",rtn H Highlighting %Zhighlight% mode,"crlf",rtn Z CR-LF (MS-DOS) %Zcrlf% mode,"linums",rtn N Line numbers %Zlinums% mode,"beep",rtn B Beep %Zbeep% mode,"rdonly",rtn O Read only %Zrdonly% mode,"syntax",rtn Y Syntax mode,"encoding",rtn E Encoding mode,"asis",rtn % % Meta chars as-is mode,"language",rtn V Language mode,"picture",rtn P picture %Zpicture% menu,"more-options",rtn % % More options... :defmenu more-options menu,"^G",rtn % % ^G options menu,"search",rtn % % search options menu,"paragraph",rtn % % paragraph options menu,"file",rtn % % file options menu,"menu",rtn % % menu options menu,"global",rtn % % global options menu,"cursor",rtn % % cursor options menu,"marking",rtn % % marking options menu,"tab",rtn % % tab/indent options :defmenu menu mode,"menu_explorer",rtn % % Menu explorer %Zmenu_explorer% mode,"menu_above",rtn % % Menu position %Zmenu_above% mode,"menu_jump",rtn % % Jump into menu %Zmenu_jump% mode,"transpose",rtn % % Transpose menus %Ztranspose% :defmenu ^G mode,"single_quoted",rtn % % ^G ignores '...' %Zsingle_quoted% mode,"no_double_quoted",rtn % % ^G no ignore "..." %Zno_double_quoted% mode,"c_comment",rtn % % ^G ignores /*...*/ %Zc_comment% mode,"cpp_comment",rtn % % ^G ignores //... %Zcpp_comment% mode,"pound_comment",rtn % % ^G ignores #... %Zpound_comment% mode,"vhdl_comment",rtn % % ^G ignores --... %Zvhdl_comment% mode,"semi_comment",rtn % % ^G ignores ;... %Zsemi_comment% mode,"tex_comment",rtn % % ^G ignores %... %Ztex_comment% mode,"text_delimiters",rtn % % Text delimiters %Ztext_delimiters% :defmenu search mode,"icase",rtn % % Case insensitivity %Zicase% mode,"wrap",rtn % % Search wraps %Zwrap% mode,"search_prompting",rtn % % Search prompting %Zsearch_prompting% mode,"csmode",rtn % % Continued search %Zcsmode% :defmenu paragraph mode,"french",rtn % % French spacing %Zfrench% mode,"flowed",rtn % % Flowed text %Zflowed% mode,"cpara",rtn % % Paragraph indent chars %Zcpara% :defmenu file mode,"restore",rtn % % Restore cursor %Zrestore% mode,"guess_crlf",rtn % % Auto detect CR-LF %Zguess_crlf% mode,"guess_indent",rtn % % Guess indent %Zguess_indent% mode,"guess_non_utf8",rtn % % Guess non-UTF-8 %Zguess_non_utf8% mode,"guess_utf8",rtn % % Guess UTF-8 %Zguess_utf8% mode,"force",rtn % % Force last NL %Zforce% mode,"nobackup",rtn % % No backup %Znobackup% :defmenu global mode,"nolocks",rtn % % Disable locks %Znolocks% mode,"nobackups",rtn % % Disable backups %Znobackups% mode,"nomodcheck",rtn % % Disable mtime check %Znomodcheck% mode,"nocurdir",rtn % % Disable current dir %Znocurdir% mode,"exask",rtn % % Exit ask %Zexask% mode,"nosta",rtn % % Disable status line %Znosta% mode,"keepup",rtn % % Fast status line %Zkeepup% mode,"break_hardlinks",rtn % % Break hard links %Zbreak_hardlinks% mode,"break_links",rtn % % Break links %Zbreak_links% mode,"joe_state",rtn % % Joe_state file %Zjoe_state% mode,"undo_keep",rtn % % No. undo records %Zundo_keep% mode,"backpath",rtn % % Path to backup files %Zbackpath% :defmenu cursor mode,"pg",rtn % % No. PgUp/PgDn lines %Zpg% mode,"mid",rtn C Center on scroll %Zmid% mode,"floatmouse",rtn % % Click past end %Zfloatmouse% mode,"rtbutton",rtn % % Right button %Zrtbutton% :defmenu marking mode,"autoswap",rtn % % Autoswap mode %Zautoswap% mode,"marking",rtn % % Marking %Zmarking% mode,"lightoff",rtn % % Auto unmask %Zlightoff% :defmenu tab mode,"smarthome",rtn % % Smart home key %Zsmarthome% mode,"smartbacks",rtn % % Smart backspace %Zsmartbacks% mode,"indentfirst",rtn % % To indent first %Zindentfirst% mode,"purify",rtn % % Clean up indents %Zpurify% mode,"spaces",rtn % % No tabs %Zspaces% THIRD SECTION: Named help screens: Use \i to turn on/off inverse video Use \u to turn on/off underline Use \b to turn on/off bold Use \d to turn on/off dim Use \f to turn on/off flash {Basic \i Help Screen \|turn off with ^X^H more help with ^X. \i \i \i\|\uCURSOR\u \|\uGO TO\u \|\uUNDO\u \|\uMISC\u \|\uREGION\u \|\uFILE/EXIT\u \|\i \i \i \i\|^B left ^F right \|^[V prev screen \|^_ undo \|^[^[ option \|^@ mark \|^X^C exit \|\i \i \i \i\|^P up ^N down \|^V next screen \|^^ redo \|^[Q format \|^X^X swap \|^X^F find \|\i \i \i \i\|^[B prev. word \|^A beg of line \|\uDELETE\u \|^L refresh \|^W cut \|^X^V revert\|\i \i \i \i\|^[F next word \|^E end of line \|^D char \|^[$ spell \|^[W copy \|^X^S save \|\i \i \i \i\|\uSEARCH\u \|^X[ prev page \|^K >line \|^[M math \|^Y paste \|^XS all \|\i \i \i \i\|^S forward \|^X] next page \|^[D >word \|^[X command \|^[Y switch \|^XI insert\|\i \i \i \i\|^R backward \|^[G to line No. \|^[ DEL \|^XL status \|^XA file \|^XK kill \|\i \i \i \i\|^[% find&replace \|^XG matching ([{\| word< \|^U repeat \|^X| filter \|^X^B switch\|\i \i } {Editing \i Help Screen \|turn off with ^X^H 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 \|^Q Ctrl- \|^XE play \|^X4. Tags other window \|\i \i \i \i\|^X^U Up region \| \|^[( () \|^XQ query suspend \|^XC Compile \|\i \i \i \i\|^X^L Down region\| \| \| \|^XN / ^XP next/prev err\|\i \i } {Window \i Help Screen \|turn off with ^X^H prev. screen ^X, next screen ^X. \i \i \i\|\uWINDOW\u \|\uSCROLL\u \|\uMODE\u \|\uCURSOR\u \|\i \i \i \i\|^X2 Split window in half \|^X^P up \|^XF rght mgn\|^[P prev. paragraph \|\i \i \i \i\|^XO Switch to other window \|^X^N down \|^X^Q rdonly \|^[N next paragraph \|\i \i \i \i\|^XZ Grow window \|^X< left \|^[~ not mod \|\uDELETE\u \|\i \i \i \i\|^X^Z Shrink window \|^X> right \| \|^[ SP just one space \|\i \i \i \i\|^X0 Kill window \|\uSHELL\u \|\uBOOKMARK\u \|^[ \\ no spaces \|\i \i \i \i\|^X1 Kill all other windows \|^[! Command\|^XJ set \|^X^O cut blank lines \|\i \i \i \i\|^[^Z ^[^V other PgUp/PgDn \|^[' Window \|^X/ goto \|^[z cut to character \|\i \i } {Search \i Help Screen \|turn off with ^X^H 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 } {SearchOptions \i Help Screen \|turn off with ^X^H prev. screen ^X, next screen ^X. \i \i \iSearch options: \|\i \i \i \i r Replace \|\i \i \i \i k Restrict search to highlighted block, which can be rectangular \|\i \i \i \i b Search backward instead of forward \|\i \i \i \i i Ignore case \|\i \i \i \i a Search across all loaded files \|\i \i \i \i e Search across all files in Grep or Compile error list \|\i \i \i \i w Wrap to beginning of file for this search \|\i \i \i \i n Do not wrap to beginning of file for this search \|\i \i \i \i nnn Perform exaclty nnn replacements \|\i \i } {Math \i Help Screen \|turn off with ^X^H prev. screen ^X, next screen ^X. \i \i \i \uCOMMANDS\u (hit ESC m for math) \uFUNCTIONS\u \|\i \i \i \i hex hex display mode sin cos tab asin acos atan \|\i \i \i \i dec decimal mode sinh cosh tanh asinh acosh atanh \|\i \i \i \i ins type result into file sqrt cbrt exp ln log \|\i \i \i \i eval evaluate block int floor ceil abs erg ergc \|\i \i \i \i 0xff enter number in hex joe(...macro...) - runs an editor macro \|\i \i \i \i 3e-4 floating point decimal \uBLOCK\u \|\i \i \i \i a=10 assign a variable sum cnt Sum, count \|\i \i \i \i 2+3:ins multiple commands avg dev Average, std. deviation \|\i \i \i \i e pi constants \uOPERATORS\u \|\i \i \i \i ans previous result ! ^ * / % + - < <= > >= == != && || ? :\|\i \i } {Names \i Help Screen \|turn off with ^X^H 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 ^X^H prev. screen ^X, next screen ^X. \i \i \i Send bug reports to: http://sourceforge.net/projects/joe-editor \|\i \i \i \i \|\i \i \i \i default joerc file is here @JOERC@/joerc \|\i \i \i \i default syntax and i18n files are here @JOEDATA@ \|\i \i \i \i additional documentation can be found here @JOEDOC@ \|\i \i } {CharTable \i Help Screen \|turn off with ^X^H prev. screen ^X, \i \i \i\| Dec \u 0123 4567 8901 2345 0123 4567 8901 2345 \u Dec \|\i \i \i \i\| | | \|\i \i \i \i\| 0 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \i\u@ABC\u\i \i\uDEFG\u\i \i\uHIJK\u\i \i\uLMNO\u\i | 128 \|\i \i \i \i\| 16 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \i\uPQRS\u\i \i\uTUVW\u\i \i\uXYZ[\u\i \i\u\\]^_\u\i | 144 \|\i \i \i \i\| 32 | !"# $%&' ()*+ ,-./  ¡¢£ ¤¥¦§ ¨©ª« ¬­®¯ | 160 \|\i \i \i \i\| 48 | 0123 4567 89:; <=>? °±²³ ´µ¶· ¸¹º» ¼½¾¿ | 176 \|\i \i \i \i\| 64 | @ABC DEFG HIJK LMNO ÀÁÂà ÄÅÆÇ ÈÉÊË ÌÍÎÏ | 192 \|\i \i \i \i\| 80 | PQRS TUVW XYZ[ \\]^_ ÐÑÒÓ ÔÕÖ× ØÙÚÛ ÜÝÞß | 208 \|\i \i \i \i\| 96 | `abc defg hijk lmno àáâã äåæç èéêë ìíîï | 224 \|\i \i \i \i\| 112 | pqrs tuvw xyz{ |}~ ðñòó ôõö÷ øùúû üýþÿ | 240 \|\i \i } FOURTH SECTION: Key bindings: Section names you must provide: :main For editing window :prompt For prompt lines :query For single-character query lines :querya Singe-character query for quote :querysr Search & Replace single-character query Other sections may be given as well for organization 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 Ctrl chars Use SP for space Use a TO b to generate a range of characters Use MDOWN, MDRAG, MUP, M2DOWN, M2DRAG, M2UP, M3DOWN, M3DRAG, M3UP for mouse Use MWDOWN, MWUP for wheel mouse motion 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... you decide. .k; F10 Macros: Simple macros can be made by comma seperating 2 or more command names. For example: bof,bol ^T Z Goto beginning of last line Also quoted matter is typed in literally: bol,">",dnarw .k1 Quote news article line Macros may cross lines if they end with , :windows Bindings common to all windows type ^@ TO ÿ Self insert 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 ^X ^H help .k1 help ^[ O P 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 ^# S pgup .kP Screen up pgup ^[ v pgup ^[ [ 5 ~ pgup ^# T 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 Mouse handling defmdown MDOWN Move the cursor to the mouse location defmup MUP defmdrag MDRAG Select a region of characters defm2down M2DOWN Select the word at the mouse location defm2up M2UP defm2drag M2DRAG Select a region of words defm3down M3DOWN Select the line at the mouse location defm3up M3UP defm3drag M3DRAG Select a region of lines xtmouse ^[ [ M Introduces an xterm mouse event :main Text editing window :inherit windows ESC-x compile :def compile mwind!,mfit!,querysave,query,scratch,"* Build Log *",rtn,bof,markb,eof," ",markk,blkdel,build Grep :def grep_find mwind!,mfit!,scratch,"* Grep Log *",rtn,bof,markb,eof," ",markk,blkdel,grep Man page :def man scratch,"* Man Page *",rtn,bof,markb,eof," ",markk,blkdel," ",ltarw,run,"man -P cat -S 2:3 " :def ensure_other if,"no_windows<2",then,splitw,endif Ispell :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 $SPLTMP;aspell --lang=",language,".",charset," -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 --lang=",language,".",charset," -x -c $SPLTMP /dev/tty;tr -d <$SPLTMP '\\012';/bin/rm $SPLTMP",rtn,retype,nextword aspellword ^[ $ ctrl ^Q Quote Ctrl chars ctrl ` Quote Ctrl chars paste ^[ ] 5 2 ; Bracketed paste insc ^[ [ 2 ~ insc ^[ [ L SCO delch ^[ [ 3 ~ pgup ^[ [ I SCO pgdn ^[ [ G SCO home ^[ [ 1 ~ Putty, Linux, Cygwin home ^[ [ H Xterm, Konsole, SCO home ^[ O H gnome-terminal home ^[ [ 7 ~ RxVT home ^# SP A Amiga eol ^[ [ 4 ~ Putty, Linux, Cygwin, ssh eol ^[ [ F Xterm, Konsole, SCO eol ^[ O F gnome-terminal eol ^[ [ 8 ~ RxVT eol ^# SP @ Amiga Macros for non-existant Emacs functions Better off not having this: JOE automatically figure out the fill prefix. If you really want to set the left margin, use ^[ ^[ L. mode,"lmargin",rtn,"col",rtn ^X . Left fill prefix (left margin) eof,drop,msg,"Mark set",rtn,bof ^X H Select entire file eof,drop,msg,"Mark set",rtn,bof ^X h psh,nextword-,markk,prevword-,markb, upper,nextword- ^[ u Upcase word psh,nextword-,markk,prevword-,markb, lower,nextword- ^[ l Downcase word psh,if,"arg>=0",then, nextword,markk,prevword,markb,lower, rtarw,markk,upper,nextword, else, prevword,markb,nextword,markk,lower, prevword,rtarw,markk,upper,ltarw, endif ^[ c Capitalize word psh,markk,lower ^X ^L Downcase region psh,markk,upper ^X ^U Upcase region psh,if,"arg>=0",then, ltarw,markb,rtarw,markk,rtarw, blkmove,rtarw, else, markk,ltarw,markb,ltarw,blkmove, rtarw, endif ^T Transpose chars psh,if,"arg>=0",then, uparw,bol,markb,dnarw,markk,dnarw, blkmove,dnarw, else, bol,markk,uparw,markb,uparw,blkmove, dnarw, endif ^X ^T Transpose lines psh,if,"arg>=0",then, prevword,nextword,nextword,markk, prevword,markb,setmark,":",prevword, nextword,blkmove,markk,prevword, markb,gomark,":",blkmove,nextword, else, prevword,nextword,markk, prevword,markb,setmark,":",prevword, nextword,blkmove,markk,prevword, markb,gomark,":",blkmove,prevword,nextword, endif ^[ t Transpose words eop-,bop-,markb,eop- ^[ h Mark paragraph nextword-,prevword-,markb,nextword- ^[ @ Mark word "()",ltarw ^[ ( Insert () bol,insc,delw ^[ ^ Delete indentation psh,markk,copy,msg,"Region saved",rtn ^[ w Yank copy mode,"rmargin",rtn,"col",rtn, msg,"Fill-column set",rtn ^X f Set right margin bol,rtn,backw,rtn,rtn,uparw,delw ^X ^O Delete blank lines " ",backw," ",insc,delw ^[ SP Just one space " ",backw,insc,delw ^[ \ Delete horizontal space stop,msg,"Abort",beep,rtn ^G Abort message stop,msg,"Abort",beep,rtn ^[ ^G Abort message stop,msg,"Abort",beep,rtn ^X ^G Abort message psh,markk,blkdel ^W Cut savenow ^X ^S Save file querysave ^X s drop,msg,"Mark set",rtn ^@ Drop anchor ensure_other,nextw,pgdn-!,prevw ^[ ^V Scroll other window down ensure_other,nextw,pgup-!,prevw ^[ ^Z Scroll other window up bol,nedge,pedge ^[ m Gnu-emacs goto indentation (prefer ESC m to be math) ensure_other,nextw,nbuf-!,prevw ^X 4 b Switch buffers other window ensure_other,nextw,edit,query,prevw ^X 4 f Find file other window ensure_other,nextw,edit,query,prevw ^X 4 ^F psh,nextword,prevword,markb,nextword,markk,copy, ensure_other,prevw,tag," ",bol,deleol,yank,yankpop,query!,nextw ^X 4 . querysave,query,killjoe ^X ^C Query to save files, then exit lose,query ^X k Kill buffer in window lose,query,edit ^X ^V Edit a file: no orphaned buffers reload ^X ^V Reload current file psh,drop,fwrdc-,query,markk,blkdel ^[ z Cut to char psh,markk,if,"markv",then,blksave,bol,">>",eol,query,else,save,bol,deleol,">>",query,endif ^X a retype, arg,"top+height/2-line",rtn,upslide ^L Recenter arg,"top+height/2-line",rtn,dnarw ^[ r Move to center line psh,markk,swap,math,"z=line",rtn, swap,math,"line-z",rtn,msg,math,"ans",rtn, " lines in region",rtn ^[ = Count lines region mode,"rdonly",rtn ^X ^Q Toggle read-only compile ^X c Compile mwind,mfit,prevw,nxterr ^X n mwind,mfit,prevw,nxterr ^X ` mwind,mfit,prevw,prverr ^X p backs ^? Backspace backs ^H backw ^[ ^? Backspace word backw ^[ ^H bknd ^X ' Shell window (joe) bof ^[ < Goto beginning of file ffirst," ",rtn,if,"!joe(\"bn\",rtn)",then,bof,msg,"Beginning of buffer",rtn,endif ^X [ Go to next page or eof bof ^X [ home .kh Goto beginning of line home ^A home ^[ [ H home ^[ [ 1 ~ bop ^[ p (uemacs) bop ^[ { bufed ^X b bknd ^[ ' Shell window crawlr ^X > Scroll to the right crawll ^X < Scroll to the left delch .kD Delete character delch ^D deleol ^K Delete to end of line delw ^[ d Delete word dnarw .kd Go down dnarw ^N dnarw ^[ O B dnarw ^[ [ B dnarw ^# B dnslide ^X ^N Slide down (uemacs) dnslide,dnslide,dnslide,dnslide MWDOWN edit ^X ^F Edit a file: creates orphaned buffers eof ^[ > Go to end of file ffirst," ",rtn,if,"!joe(\"n\",rtn)",then,eof,msg,"End of buffer",rtn,endif ^X ] Go to next page or eof eof ^X ] eol .kH Go to end of line eol .@7 eol ^E eol ^[ [ F eol ^[ [ 4 ~ eop ^[ n (uemacs) eop ^[ } 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 ltarw ^# D mode ^[ ^[ Change modes menu,"root",rtn ^[ ^[ 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 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 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 if,"markv",then,rindent-!,else,markk,rindent-!,endif ^X ^I if,"markv",then,rindent-!,else,markk,rindent-!,endif ^[ ^\ markk,rindent ^[ ^\ rtarw .kr Go right rtarw ^F rtarw ^[ O C rtarw ^[ [ 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 uparw ^# A upslide ^X ^P Slide up (uemacs) upslide,upslide,upslide,upslide MWUP yank ^Y Yank deleted text yankpop ^[ y Yank-pop :prompt Prompt windows :inherit main abort ^G abort ^C complete ^I dnarw,eol .kd Go down dnarw,eol ^N dnarw,eol ^[ O B dnarw,eol ^[ [ B dnarw,eol ^# B uparw,eol .ku Go up uparw,eol ^# A uparw,eol ^P uparw,eol ^[ O A uparw,eol ^[ [ A :menu Selection menus :inherit windows pgupmenu ^[ [ I pgdnmenu ^[ [ G bolmenu ^[ [ 1 ~ Putty, Linux, Cygwin bolmenu ^[ [ H Xterm, Konsole bolmenu ^[ O H gnome-terminal bolmenu ^[ [ 7 ~ RxVT bolmenu ^# SP A Amiga eolmenu ^[ [ 4 ~ Putty, Linux, Cygwin, ssh eolmenu ^[ [ F Xterm, Konsole eolmenu ^[ O F gnome-terminal eolmenu ^[ [ 8 ~ RxVT eolmenu ^# SP @ Amiga abort ^[ ^[ backsmenu ^? backsmenu ^H bofmenu ^K U bofmenu ^K ^U bofmenu ^K u bolmenu .kh bolmenu ^A dnarwmenu .kd dnarwmenu ^N dnarwmenu ^[ [ B dnarwmenu ^# B dnarwmenu ^[ O B eofmenu ^K V eofmenu ^K ^V eofmenu ^K v eolmenu .kH eolmenu ^E ltarwmenu .kl ltarwmenu ^B ltarwmenu ^[ [ D ltarwmenu ^[ O D ltarwmenu ^# D pgdnmenu .kN Screen down pgdnmenu ^V pgdnmenu ^[ [ 6 ~ pgdnmenu ^# S pgupmenu .kP Screen up pgupmenu ^[ v pgupmenu ^[ [ 5 ~ pgupmenu ^# T rtarwmenu .kr rtarwmenu ^F rtarwmenu ^[ [ C 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 ^# A uparwmenu ^[ O A defm2down M2DOWN Hits return key :querysr Search & replace query window type ^@ TO ÿ :query Single-key query window :inherit windows :querya Single-key query window for quoting type ^@ TO ÿ joe-3.7/rc/rjoerc.in0000644000100100007640000007714111103216174011300 00000000000000 Initialization file for JOE Restricted access Joe JOE looks for this file in: 1 - $HOME/.rjoerc 2 - @JOERC@/rjoerc This file can include other files by placing the following include command in the first column: :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): Override colors of lexical classes specified in syntax files: Put each color override you want in the first column. Valid colors: bold inverse blink dim underline white cyan magenta blue yellow green red black bg_white bg_cyan bg_magenta bg_blue bg_yellow bg_green bg_red bg_black Override all instances of class Idle: =Idle red Override Idle only for c syntax file: =c.Idle red The following list is from c.jsf. Look at other syntax files for more classes. =Idle =Bad bold red =Preproc blue =Define bold blue =IncLocal cyan =IncSystem bold cyan =Constant cyan =Escape bold cyan =Type bold =Keyword bold =CppKeyword bold =Brace magenta =Control Put each option you want set in the first column: -option Sets the option --option Clears the option -help_is_utf8 Set if help text is in UTF-8 format. Leave clear if it's a raw 8-bit format. -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 -nolocks If you don't want file locks to be used -nomodcheck Disable periodic checking of disk file newer than buffer (this checking happens on save even with this option). -nocurdir Do not prompt with current directory -nobackups If you don't want backup files to be created -break_hardlinks Delete file before writing, to break hard links (but don't break symbolic links). -break_links Delete file before writing, to break hard links and symbolic links. -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 -undo_keep nnn Number of undo records to keep. 0 for infinite. -csmode ^KF after a pervious search does a ^L instead -backpath path Directory to store backup files (one space between 'backpath' and the 'path', no trailing spaces or comments after the path). -floatmouse Clicking past end of line moves the cursor past the end -rtbutton Use the right mouse button for action, instead of the left -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 -notite Don't send terminal initialization and termination strings: prevents restoration of screen on exit. -usetabs Use tabs to help optimize screen update. -assume_color Assume terminal has ANSI color support even if termcap/terminfo entry says that it doesn't. This only applies if the terminal otherwise looks like an ANSI terminal (support bold and capability starts with ESC [). -assume_256color Assume terminal has xterm 256 color support (ESC [ 38 ; 5 ; NNN m and ESC [ 48 ; 5 ; NNN m). -guess_non_utf8 Allow guess of non-UTF-8 file encoding in a UTF-8 locale. -guess_utf8 Allow guess of UTF-8 file encoding in non-UTF-8 locale. -guess_crlf Automatically detect MS-DOS files and set -crlf appropriately -guess_indent Guess indent character (tab or space). -menu_above Position menu/list above prompt when enabled. Otherwise position below prompt. -transpose Transpose rows with columns in all menus. -menu_explorer Stay in menu system when a directory is selected (otherwise directory is added to path and menu is closed). -menu_jump Jump into file selection menu when tab is hit (otherwise, menu comes up, but cursor stays in file name prompt). -icase Search is case insensitive by default. -wrap Search wraps -autoswap Swap markb with markk when necessary -joe_state Use ~/.joe_state file -mouse Enable mouse support -joexterm If you are using Joe's modified Xterm, which makes -mouse mode work better (cut & paste work transparently). -square Rectangular block mode -text_color color Set color for text. -status_color color Set color for status bar. -help_color color Set color for help. -menu_color color Set color for menus. -prompt_color color Set color for prompts. -msg_color color Set color for messages. For example: -text_color bg_blue+white Sets the background color to blue and foreground color to white. -restore Restore previous cursor position when files are opened -search_prompting Search prompts with previous search request. 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. 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 %O Byte offset into file in hex %a Ascii value of character under cursor %A Ascii value of character under cursor in hex %p Percent of file cursor is at %l No. 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-K H for help SECOND SECTION: File name dependant local option settings: Each line with '*' in the first column indicates the modes which should be set for files which match the regular expression. If more than one regular expression matches the file name, then the last matching one is chosen. Here are the modes which can be set: -cpara >#!;*/% Characters which can indent paragraphs. -encoding name Set file coding (for example: utf-8, iso-8859-15) -syntax name Specify syntax (syntax file called 'name.jsf' will be loaded) -hex Hex editor mode -highlight Enable highlighting -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 going the beginning of line first. -smartbacks Backspace key deletes 'istep' number of 'indentc's if cursor is at first non-space character. -tab nnn Tab width -indentc nnn Indentation character (32 for space, 9 for tab) -istep nnn Number of indentation columns -spaces TAB inserts spaces instead of tabs. -purify Fix 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). -crlf File uses CR-LF at ends of lines -wordwrap Wordwrap -autoindent Auto indent -overwrite Overtype mode -picture Picture mode (right arrow can go past end of lines) -lmargin nnn Left margin -rmargin nnn Right margin -flowed Put one space after intermediate paragraph lines for support of flowed text. -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. -linums Enable line numbers on each line -rdonly File is read-only -keymap name Keymap to use if not 'main' -lmsg Status line definition strings- -rmsg see previous section for more info. -mfirst macro Macro to execute on first modification -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. These define the language syntax for ^G (goto matching delimiter): -single_quoted Text between ' ' should be ignored (this is not good for regular text since ' is normally used alone as an apostrophe) -c_comment Text between /* */ should be ignored -cpp_comment Text after // should be ignored -pound_comment Text after # should be ignored -vhdl_comment Text after -- should be ignored -semi_comment Text after ; should be ignored -text_delimiters begin=end:if=elif=else=endif Define word delimiters Default local options -highlight -istep 2 Use this macro (put in first column) to have joe "p4 edit" a file you're about to change. -mfirst if,"rdonly && joe(sys,\"p4 edit \",name,rtn)",then,mode,"o",msg,"executed \"p4 edit ",name,"\"",rtn,endif File type table is now in a separate file. You can copy this file to ~/.joe and customize it. :include ftyperc SECOND and 1/2 SECTION: Option menu layout :defmenu name Defines a menu. macro string comment A menu entry. Macro is any JOE macro- see "Macros:" below. String is the label to be used for the macro in the menu. It is in the same format as the -lmsg and -rmsg options above. Two whitespace characters in a row begins a comment. Use '% ' for a leading space in the string. :defmenu root mode,"overwrite",rtn T Overtype %Zoverwrite% mode,"hex",rtn % % Hex edit mode mode,"autoindent",rtn I Autoindent %Zautoindent% mode,"wordwrap",rtn W Word wrap %Zwordwrap% mode,"tab",rtn D Tab width %Ztab% mode,"lmargin",rtn L Left margin %Zlmargin% mode,"rmargin",rtn R Right margin %Zrmargin% mode,"square",rtn X Rectangle mode %Zsquare% mode,"indentc",rtn % % Indent char %Zindentc% mode,"istep",rtn % % Indent step %Zistep% mode,"highlight",rtn H Highlighting %Zhighlight% mode,"crlf",rtn Z CR-LF (MS-DOS) %Zcrlf% mode,"linums",rtn N Line numbers %Zlinums% mode,"beep",rtn B Beep %Zbeep% mode,"rdonly",rtn O Read only %Zrdonly% mode,"syntax",rtn Y Syntax mode,"encoding",rtn E Encoding mode,"asis",rtn % % Meta chars as-is mode,"language",rtn V Language mode,"picture",rtn P picture %Zpicture% menu,"more-options",rtn % % More options... :defmenu more-options menu,"^G",rtn % % ^G options menu,"search",rtn % % search options menu,"paragraph",rtn % % paragraph options menu,"file",rtn % % file options menu,"menu",rtn % % menu options menu,"global",rtn % % global options menu,"cursor",rtn % % cursor options menu,"marking",rtn % % marking options menu,"tab",rtn % % tab/indent options :defmenu menu mode,"menu_explorer",rtn % % Menu explorer %Zmenu_explorer% mode,"menu_above",rtn % % Menu position %Zmenu_above% mode,"menu_jump",rtn % % Jump into menu %Zmenu_jump% mode,"transpose",rtn % % Transpose menus %Ztranspose% :defmenu ^G mode,"single_quoted",rtn % % ^G ignores '...' %Zsingle_quoted% mode,"no_double_quoted",rtn % % ^G no ignore "..." %Zno_double_quoted% mode,"c_comment",rtn % % ^G ignores /*...*/ %Zc_comment% mode,"cpp_comment",rtn % % ^G ignores //... %Zcpp_comment% mode,"pound_comment",rtn % % ^G ignores #... %Zpound_comment% mode,"vhdl_comment",rtn % % ^G ignores --... %Zvhdl_comment% mode,"semi_comment",rtn % % ^G ignores ;... %Zsemi_comment% mode,"tex_comment",rtn % % ^G ignores %... %Ztex_comment% mode,"text_delimiters",rtn % % Text delimiters %Ztext_delimiters% :defmenu search mode,"icase",rtn % % Case insensitivity %Zicase% mode,"wrap",rtn % % Search wraps %Zwrap% mode,"search_prompting",rtn % % Search prompting %Zsearch_prompting% mode,"csmode",rtn % % Continued search %Zcsmode% :defmenu paragraph mode,"french",rtn % % French spacing %Zfrench% mode,"flowed",rtn % % Flowed text %Zflowed% mode,"cpara",rtn % % Paragraph indent chars %Zcpara% :defmenu file mode,"restore",rtn % % Restore cursor %Zrestore% mode,"guess_crlf",rtn % % Auto detect CR-LF %Zguess_crlf% mode,"guess_indent",rtn % % Guess indent %Zguess_indent% mode,"guess_non_utf8",rtn % % Guess non-UTF-8 %Zguess_non_utf8% mode,"guess_utf8",rtn % % Guess UTF-8 %Zguess_utf8% mode,"force",rtn % % Force last NL %Zforce% mode,"nobackup",rtn % % No backup %Znobackup% :defmenu global mode,"nolocks",rtn % % Disable locks %Znolocks% mode,"nobackups",rtn % % Disable backups %Znobackups% mode,"nomodcheck",rtn % % Disable mtime check %Znomodcheck% mode,"nocurdir",rtn % % Disable current dir %Znocurdir% mode,"exask",rtn % % Exit ask %Zexask% mode,"nosta",rtn % % Disable status line %Znosta% mode,"keepup",rtn % % Fast status line %Zkeepup% mode,"break_hardlinks",rtn % % Break hard links %Zbreak_hardlinks% mode,"break_links",rtn % % Break links %Zbreak_links% mode,"joe_state",rtn % % Joe_state file %Zjoe_state% mode,"undo_keep",rtn % % No. undo records %Zundo_keep% mode,"backpath",rtn % % Path to backup files %Zbackpath% :defmenu cursor mode,"pg",rtn % % No. PgUp/PgDn lines %Zpg% mode,"mid",rtn C Center on scroll %Zmid% mode,"floatmouse",rtn % % Click past end %Zfloatmouse% mode,"rtbutton",rtn % % Right button %Zrtbutton% :defmenu marking mode,"autoswap",rtn % % Autoswap mode %Zautoswap% mode,"marking",rtn % % Marking %Zmarking% mode,"lightoff",rtn % % Auto unmask %Zlightoff% :defmenu tab mode,"smarthome",rtn % % Smart home key %Zsmarthome% mode,"smartbacks",rtn % % Smart backspace %Zsmartbacks% mode,"indentfirst",rtn % % To indent first %Zindentfirst% mode,"purify",rtn % % Clean up indents %Zpurify% mode,"spaces",rtn % % No tabs %Zspaces% THIRD SECTION: Named help screens: Use \i to turn on/off inverse video Use \u to turn on/off underline Use \b to turn on/off bold Use \d to turn on/off dim Use \f to turn on/off flash {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 } {SearchOptions \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \iSearch options: \|\i \i \i \i r Replace \|\i \i \i \i k Restrict search to highlighted block, which can be rectangular \|\i \i \i \i b Search backward instead of forward \|\i \i \i \i i Ignore case \|\i \i \i \i a Search across all loaded files \|\i \i \i \i e Search across all files in Grep or Compile error list \|\i \i \i \i w Wrap to beginning of file for this search \|\i \i \i \i n Do not wrap to beginning of file for this search \|\i \i \i \i nnn Perform exaclty nnn replacements \|\i \i } {Math \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \i \uCOMMANDS\u (hit ESC m for math) \uFUNCTIONS\u \|\i \i \i \i hex hex display mode sin cos tab asin acos atan \|\i \i \i \i dec decimal mode sinh cosh tanh asinh acosh atanh \|\i \i \i \i ins type result into file sqrt cbrt exp ln log \|\i \i \i \i eval evaluate block int floor ceil abs erg ergc \|\i \i \i \i 0xff enter number in hex \|\i \i \i \i 3e-4 floating point decimal \uBLOCK\u \|\i \i \i \i a=10 assign a variable sum cnt Sum, count \|\i \i \i \i 2+3:ins multiple commands avg dev Average, std. deviation \|\i \i \i \i e pi constants \uOPERATORS\u \|\i \i \i \i ans previous result ! ^ * / % + - < <= > >= == != && || ? :\|\i \i } {Joe \i Help Screen \|turn off with ^KH prev. screen ^[, next screen ^[. \i \i \i Send bug reports to: http://sourceforge.net/projects/joe-editor \|\i \i \i \i \|\i \i \i \i default joerc file is here @JOERC@/joerc \|\i \i \i \i default syntax and i18n files are here @JOEDATA@ \|\i \i \i \i additional documentation can be found here @JOEDOC@ \|\i \i } {CharTable \i Help Screen \|turn off with ^KH prev. screen ^[, \i \i \i\| Dec \u 0123 4567 8901 2345 0123 4567 8901 2345 \u Dec \|\i \i \i \i\| | | \|\i \i \i \i\| 0 | \u@ABC\u \uDEFG\u \uHIJK\u \uLMNO\u \i\u@ABC\u\i \i\uDEFG\u\i \i\uHIJK\u\i \i\uLMNO\u\i | 128 \|\i \i \i \i\| 16 | \uPQRS\u \uTUVW\u \uXYZ[\u \u\\]^_\u \i\uPQRS\u\i \i\uTUVW\u\i \i\uXYZ[\u\i \i\u\\]^_\u\i | 144 \|\i \i \i \i\| 32 | !"# $%&' ()*+ ,-./  ¡¢£ ¤¥¦§ ¨©ª« ¬­®¯ | 160 \|\i \i \i \i\| 48 | 0123 4567 89:; <=>? °±²³ ´µ¶· ¸¹º» ¼½¾¿ | 176 \|\i \i \i \i\| 64 | @ABC DEFG HIJK LMNO ÀÁÂà ÄÅÆÇ ÈÉÊË ÌÍÎÏ | 192 \|\i \i \i \i\| 80 | PQRS TUVW XYZ[ \\]^_ ÐÑÒÓ ÔÕÖ× ØÙÚÛ ÜÝÞß | 208 \|\i \i \i \i\| 96 | `abc defg hijk lmno àáâã äåæç èéêë ìíîï | 224 \|\i \i \i \i\| 112 | pqrs tuvw xyz{ |}~ ðñòó ôõö÷ øùúû üýþÿ | 240 \|\i \i } FOURTH SECTION: Key bindings: Section names you must provide: :main For editing window :prompt For prompt lines :query For single-character query lines :querya Singe-character query for quote :querysr Search & Replace single-character query Other sections may be given as well for organization 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 Ctrl chars Use SP for space Use a TO b to generate a range of characters Use MDOWN, MDRAG, MUP, M2DOWN, M2DRAG, M2UP, M3DOWN, M3DRAG, M3UP for mouse Use MWDOWN, MWUP for wheel mouse motion 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 2 or more command names. For example: bof,bol ^T Z Goto beginning of last line Also quoted matter is typed in literally: bol,">",dnarw .k1 Quote news article line Macros may cross lines if they end with , :windows Bindings common to all windows type ^@ TO ÿ Type a character 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 ^K H Help menu help ^K ^H help ^K h 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 ^# S pgup .kP Screen up pgup ^U pgup ^[ [ 5 ~ pgup ^# T 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 Mouse handling defmdown MDOWN Move the cursor to the mouse location defmup MUP defmdrag MDRAG Select a region of characters defm2down M2DOWN Select the word at the mouse location defm2up M2UP defm2drag M2DRAG Select a region of words defm3down M3DOWN Select the line at the mouse location defm3up M3UP defm3drag M3DRAG Select a region of lines xtmouse ^[ [ M Introduces an xterm mouse event :main Text editing window :inherit windows Spell-check macros Ispell :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 $SPLTMP;aspell --lang=",language,".",charset," -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 --lang=",language,".",charset," -x -c $SPLTMP /dev/tty;tr -d <$SPLTMP '\\012';/bin/rm $SPLTMP",rtn,retype,nextword @SPELL@file ^[ l @SPELL@word ^[ n paste ^[ ] 5 2 ; Bracketed paste insc ^[ [ 2 ~ insc ^[ [ L SCO delch ^[ [ 3 ~ pgup ^[ [ I SCO pgdn ^[ [ G SCO home ^[ [ 1 ~ Putty, Linux, Cygwin home ^[ [ H Xterm, Konsole, SCO home ^[ O H gnome-terminal home ^[ [ 7 ~ RxVT home ^# SP A Amiga eol ^[ [ 4 ~ Putty, Linux, Cygwin, ssh eol ^[ [ F Xterm, Konsole, SCO eol ^[ O F gnome-terminal eol ^[ [ 8 ~ RxVT eol ^# SP @ Amiga Extra functions not really part of JOE user interface: delbol ^[ o Delete to beginning of line delbol ^[ ^O Delete to beginning of line dnslide ^[ z Scroll down one line dnslide ^[ Z Scroll down one line dnslide ^[ ^Z Scroll down one line dnslide,dnslide,dnslide,dnslide MWDOWN switch,rtn,filt, query,parserr ^[ c Compile switch,rtn,filt, query,parserr ^[ C Compile switch,rtn,filt, query,parserr ^[ ^C Compile execmd ^[ x Prompt for command to execute execmd ^[ X Prompt for command to execute execmd ^[ ^X Prompt for command to execute isrch ^[ s Forward incremental search isrch ^[ S Forward incremental search isrch ^[ ^S Forward incremental search notmod ^[ ~ Not modified nxterr ^[ = To next error parserr ^[ e Parse errors in current buffer parserr ^[ E Parse errors in current buffer parserr ^[ ^E Parse errors in current buffer prverr ^[ - To previous error rsrch ^[ r Backward incremental search rsrch ^[ R Backward incremental search rsrch ^[ ^R Backward incremental search run ^[ ! Run a program in a window tomarkb ^[ b Go to beginning of marked block tomarkb ^[ ^B Go to beginning of marked block tomarkk ^[ k Go to end of marked block tomarkk ^[ ^K Go to end of marked block tomarkk ^[ K Go to end of marked block txt ^[ i Prompt for text and insert it txt ^[ ^I Prompt for text and insert it txt ^[ I Prompt for text and insert it upslide ^[ w Scroll up one line upslide ^[ ^W Scroll up one line upslide ^[ W Scroll up one line upslide,upslide,upslide,upslide MWUP yankpop ^[ y Undelete text yankpop ^[ ^Y Undelete text yankpop ^[ Y Undelete text bufed ^[ d Menu of buffers pbuf ^[ . Next buffer nbuf ^[ , Prev buffer query ^[ q Quoted insert byte ^[ n Goto byte col ^[ c Goto column abortbuf ^[ k Kill current buffer- don't mess with windows ask ^[ a Ask to save current buffer bop ^[ p Backwards paragraph bos ^[ x Bottom of screen copy ^[ ^W Copy block into yank dupw ^[ \ Split window eop ^[ n Forwards paragraph format ^[ j Format paragraph ignore block markl ^[ l Mark line nmark ^[ @ Turn off ^KB ^KK pop ^[ > 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 insc ^@ Ctrl-space used to insert a space 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 bol .kh Goto beginning of line bol ^A bol ^[ [ H bol ^[ [ 1 ~ bol ^# SP A 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 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 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 eol .kH Go to end of line eol ^E eol ^[ [ F eol ^[ [ 4 ~ 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 fnext ^L Find next 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 ^@ insf ^K R Insert a file insf ^K ^R insf ^K r lindent ^K , Indent to left line ^K L Goto line no. line ^K ^L line ^K l ltarw .kl Go left ltarw ^B ltarw ^[ O D ltarw ^[ [ 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 menu,"root",rtn ^T Options menu nextpos ^K = Goto next position in position history nextword ^X Goto next word open ^] Split line prevpos ^K - Previous position in history prevword ^Z Previous word redo ^^ Redo changes rindent ^K . Indent to right rtarw .kr Go right rtarw ^F rtarw ^[ O C rtarw ^[ [ C rtarw ^# C ask ^K D Save file- no prompt ask ^K S ask ^K ^D ask ^K ^S ask ^K d ask ^K s 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 uparw ^# A :prompt Prompt windows :inherit main complete ^I dnarw,eol .kd Go down dnarw,eol ^N dnarw,eol ^[ O B dnarw,eol ^[ [ B dnarw,eol ^# B uparw,eol .ku Go up uparw,eol ^# A uparw,eol ^P uparw,eol ^[ O A uparw,eol ^[ [ A :menu Selection menus :inherit windows pgupmenu ^[ [ I pgdnmenu ^[ [ G bolmenu ^[ [ 1 ~ Putty, Linux, Cygwin bolmenu ^[ [ H Xterm, Konsole bolmenu ^[ O H gnome-terminal bolmenu ^[ [ 7 ~ RxVT bolmenu ^# SP A Amiga eolmenu ^[ [ 4 ~ Putty, Linux, Cygwin, ssh eolmenu ^[ [ F Xterm, Konsole eolmenu ^[ O F gnome-terminal eolmenu ^[ [ 8 ~ RxVT eolmenu ^# SP @ Amiga abort ^[ ^[ backsmenu ^? backsmenu ^H bofmenu ^K U bofmenu ^K ^U bofmenu ^K u bolmenu .kh bolmenu ^A dnarwmenu .kd dnarwmenu ^N dnarwmenu ^[ [ B dnarwmenu ^# B dnarwmenu ^[ O B eofmenu ^K V eofmenu ^K ^V eofmenu ^K v eolmenu .kH eolmenu ^E ltarwmenu .kl ltarwmenu ^B ltarwmenu ^[ [ D ltarwmenu ^# D ltarwmenu ^[ O D pgdnmenu .kN Screen down pgdnmenu ^V pgdnmenu ^[ [ 6 ~ pgdnmenu ^# S pgupmenu .kP Screen up pgupmenu ^U pgupmenu ^[ [ 5 ~ pgupmenu ^# T rtarwmenu .kr rtarwmenu ^F rtarwmenu ^[ [ C 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 ^# A uparwmenu ^[ O A defm2down M2DOWN Hits return key :query Single-key query window :inherit windows :querya Single-key query window for quoting type ^@ TO ÿ :querysr Search & replace query window type ^@ TO ÿ joe-3.7/b.c0000644000100100007640000017177311103412232007444 00000000000000/* * Editor engine * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" #ifdef HAVE_PWD_H #include #endif #ifndef S_ISLNK #ifdef S_IFLNK #define S_ISLNK(n) (((n) & (S_IFMT)) == (S_IFLNK)) #else #define S_ISLNK(n) (0) #endif #endif extern int errno; #ifdef WITH_SELINUX #include static int selinux_enabled = -1; #endif unsigned char stdbuf[stdsiz]; int guesscrlf = 0; int guessindent = 0; int berror; int force = 0; VFILE *vmem; unsigned char *msgs[] = { USTR _("No error"), USTR _("New File"), USTR _("Error reading file"), USTR _("Error seeking file"), USTR _("Error opening file"), USTR _("Error writing file"), USTR _("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, 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} }; static H ohdrs = { {&ohdrs, &ohdrs} }; /* 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} }; /* 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 */ B bufs = { {&bufs, &bufs} }; static B frebufs = { {&frebufs, &frebufs} }; void set_file_pos_orphaned() { B *b; for (b = bufs.link.next; b != &bufs; b = b->link.next) if (b->orphan && b->oldcur) set_file_pos(b->name,b->oldcur->line); } /* Find next buffer in list: for multi-file search and replace */ /* This does not bump reference count on found buffer */ B *bafter(B *b) { for (b = b->link.next; b->internal || b->scratch || b == &bufs; b = b->link.next); return b; } int udebug_joe(BW *bw) { unsigned char buf[1024]; B *b; P *p; binss(bw->cursor, USTR "Buffers and pointers (the number of pointers per buffer should not grow, except for 20 from markpos):\n\n"); pnextl(bw->cursor); for (b = bufs.link.next; b != &bufs; b = b->link.next) { if (b->name) joe_snprintf_1(buf, sizeof(buf), "Buffer %s\n", b->name); else joe_snprintf_1(buf, sizeof(buf), "Buffer 0x%p\n", (void *)b); binss(bw->cursor, buf); pnextl(bw->cursor); for (p = b->bof->link.next; p != b->bof; p = p->link.next) { joe_snprintf_1(buf, sizeof(buf), " Pointer created by %s\n", p->tracker); binss(bw->cursor, buf); pnextl(bw->cursor); } } dump_syntax(bw); return 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->gave_notice = 0; b->locked = 0; b->ignored_lock = 0; b->didfirst = 0; b->count = 1; b->name = NULL; b->er = -3; b->bof = palloc(); b->mod_time = 0; b->check_time = time(NULL); 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->bof->tracker = USTR "bmkchn"; b->eof = pdup(b->bof, USTR "bmkchn"); 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; b->db = 0; b->parseone = 0; 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); } /* Eliminate a buffer */ void brm(B *b) { if (b && !--b->count) { if (b->changed) abrerr(b->name); if (b->locked && !b->ignored_lock && plain_file(b)) unlock_it(b->name); if (b == errbuf) errbuf = NULL; if (b->undo) undorm(b->undo); if (b->eof) { hfreechn(b->eof->hdr); while (!qempty(P, link, b->bof)) prm(b->bof->link.next); prm(b->bof); } if (b->name) joe_free(b->name); if (b->db) rm_all_lattr_db(b->db); demote(B, link, &frebufs, b); } } void brmall() { while (!qempty(B, link, &bufs)) brm(bufs.link.next); } /* Replace contents of b with n. n is destroyed. */ void breplace(B *b, B *n) { P *p, *next; /* Take out many references to b */ abrerr(b->name); if (b->locked && !b->ignored_lock && plain_file(b)) { unlock_it(b->name); b->locked = 0; } if (b == errbuf) errbuf = NULL; if (b->undo) { undorm(b->undo); b->undo = 0; } /* Remove all vfile references */ for (p = b->eof->link.next; p != b->eof; p = p->link.next) if (p->ptr) vunlock(p->ptr); if (b->eof->ptr) vunlock(b->eof->ptr); /* Delete buffer */ hfreechn(b->eof->hdr); /* Delete file name */ if (b->name) joe_free(b->name); reset_all_lattr_db(b->db); /* Take new name */ b->name = zdup(n->name); /* Take bof Pointer */ /* Taking n->bof's vlock */ b->bof->ofst = n->bof->ofst; b->bof->ptr = n->bof->ptr; b->bof->hdr = n->bof->hdr; b->bof->byte = 0; b->bof->line = 0; b->bof->col = 0; b->bof->xcol = 0; b->bof->valcol = 1; b->bof->end = 0; /* Take eof Pointer */ /* Taking b->eof's vlock */ b->eof->ofst = n->eof->ofst; b->eof->ptr = n->eof->ptr; b->eof->hdr = n->eof->hdr; b->eof->byte = n->eof->byte; b->eof->line = n->eof->line; b->eof->col = n->eof->col; b->eof->xcol = n->eof->xcol; b->eof->valcol = n->eof->valcol; b->eof->end = 1; /* Reset other pointers */ for (p = b->eof->link.next; p != b->eof; p = p->link.next) if (p != b->bof) { long goal_line = p->line; long goal_col = p->xcol; p->ptr = 0; /* No need for pset to unlock: we already did it */ if (goal_line > b->eof->line) { pset(p, b->eof); p_goto_bol(p); } else { pset(p, b->bof); pline(p, goal_line); pcol(p, goal_col); } } /* OK, delete pointers from n */ for (p = n->eof->link.next; p != n->eof; p = next) { next = p->link.next; if (p != n->bof) prm(p); } /* Delete bof and eof pointers */ /* Don't delete their locks, they were transferred. */ n->bof->ptr = 0; prm(n->bof); n->bof = 0; n->eof->ptr = 0; prm(n->eof); n->eof = 0; b->undo = undomk(b); b->changed = 0; b->rdonly = n->rdonly; b->mod_time = n->mod_time; /* Delete rest of n */ brm(n); } 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, unsigned char *tr) { P *n = palloc(); n->end = 0; n->ptr = NULL; n->owner = NULL; n->tracker = tr; enquef(P, link, p, n); return pset(n, p); } P *pdupown(P *p, P **o, unsigned char *tr) { P *n = palloc(); n->end = 0; n->ptr = NULL; n->owner = o; n->tracker = tr; 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, USTR "piseol"); 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, USTR "pisbow"); int c = brc(p); int d = prgetc(q); prm(q); if (joe_isalnum_(p->b->o.charmap,c) && (!joe_isalnum_(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, USTR "piseow"); int d = brc(q); int c = prgetc(q); prm(q); if (joe_isalnum_(p->b->o.charmap,c) && (!joe_isalnum_(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, USTR "pisblank"); p_goto_bol(q); while (joe_isblank(p->b->o.charmap,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, USTR "piseolblank"); while (joe_isblank(p->b->o.charmap,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, USTR "pisindent"); long col; p_goto_bol(q); while (joe_isblank(p->b->o.charmap,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, USTR "pispure"); 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 c; } /* return current character and move p to the next character. column will be updated if it was valid. */ int pgetc(P *p) { if (p->b->o.charmap->type) { int val; int c; /* , oc; */ int d; int n; /* , m; */ int wid = 0; val = p->valcol; /* Remember if column number was valid */ c = pgetb(p); /* Get first byte */ /* oc = c; */ if (c==NO_MORE_DATA) return c; if ((c&0xE0)==0xC0) { /* Two bytes */ n = 1; c &= 0x1F; } else if ((c&0xF0)==0xE0) { /* Three bytes */ n = 2; c &= 0x0F; } else if ((c&0xF8)==0xF0) { /* Four bytes */ n = 3; c &= 0x07; } else if ((c&0xFC)==0xF8) { /* Five bytes */ n = 4; c &= 0x03; } else if ((c&0xFE)==0xFC) { /* Six bytes */ n = 5; c &= 0x01; } else if ((c&0x80)==0x00) { /* One byte */ n = 0; } else { /* 128-191, 254, 255: Not a valid UTF-8 start character */ n = 0; c = 'X'; /* c -= 384; */ } /* m = n; */ if (n) { while (n) { d = brc(p); if ((d&0xC0)!=0x80) break; pgetb(p); c = ((c<<6)|(d&0x3F)); --n; } if (n) { /* FIXME: there was a bad UTF-8 sequence */ /* How to represent this? */ /* pbkwd(p,m-n); c = oc - 384; */ c = 'X'; wid = 1; } else if (val) wid = joe_wcwidth(1,c); } else { wid = 1; } if (val) { /* Update column no. if it was valid to start with */ p->valcol = 1; if (c=='\t') p->col += (p->b->o.tab) - (p->col) % (p->b->o.tab); else if (c=='\n') p->col = 0; else p->col += wid; } return c; } else { 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 pgetc(p); else ++p->col; } else { if (c == '\t') p->col += (p->b->o.tab) - (p->col) % (p->b->o.tab); else ++(p->col); } 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; } /* 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) { if (p->b->o.charmap->type) { if (pisbol(p)) return prgetb(p); else { P *q = pdup(p, USTR "prgetc"); P *r; p_goto_bol(q); r = pdup(q, USTR "prgetc"); while (q->bytebyte) { pset(r, q); pgetc(q); } pset(p,r); prm(r); prm(q); return brch(p); } #if 0 int d = 0; int c; int n = 0; int val = p->valcol; for(;;) { c = prgetb(p); if (c == NO_MORE_DATA) return NO_MORE_DATA; else if ((c&0xC0)==0x80) { d |= ((c&0x3F)<valcol = 1; p->col -= joe_wcwidth(1,d); } return d; #endif } else { return prgetb(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 || p->b->o.charmap->type) 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(p->b->o.charmap->type) { do { int c; int wid; c = brch(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(1,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 (p->b->o.charmap->type) { 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, USTR "pbackws"); 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; struct 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, USTR "pfind"); 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, USTR "pifind"); 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; struct 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, USTR "prfind"); 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, USTR "prifind"); 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, USTR "bcpy"); 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 */ struct lattr_db *db; 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 { splicef(H, link, h, snip(H, link, a->link.next, to->hdr->link.prev)); 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); for (db = from->b->db; db; db = db->next) lattr_del(db, from->line, nlines); if (!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(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); 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; struct lattr_db *db; if (!pisbol(p)) scrins(p->b, p->line, nlines, 1); else scrins(p->b, p->line, nlines, 0); for (db = p->b->db; db; db = db->next) lattr_ins(db, p->line, nlines); 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, USTR "binsb"); 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, unsigned char *blk, int amnt) { long nlines; H *h = NULL; int hdramnt = 0; /* Only used if h is set */ P *q; if (!amnt) return p; q = pdup(p, USTR "binsm"); 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, USTR "\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 && p->b->o.charmap->type) { 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, USTR "\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, zlen(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) { berror = 0; return 0; } for (a = b = 0; (a < size) && ((b = joe_read(fi, buff + a, size - a)) > 0); a += b) ; if (b < 0) berror = -2; else berror = 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); berror = 0; while (seg = vlock(vmem, (l = halloc())->seg), !berror && (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 * Replaces ~/ with $HOME * * Returns new variable length string. */ unsigned char *parsens(unsigned char *s, off_t *skip, off_t *amnt) { unsigned char *n = vsncpy(NULL, 0, sz(s)); int x; *skip = 0; *amnt = MAXLONG; x = sLEN(n) - 1; if (x > 0 && n[x] >= '0' && n[x] <= '9') { for (x = sLEN(n) - 1; x > 0 && ((n[x] >= '0' && n[x] <= '9') || n[x] == 'x' || n[x] == 'X'); --x) ; if (n[x] == ',' && x && n[x-1] != '\\') { n[x] = 0; #if SIZEOF_LONG_LONG && SIZEOF_OFF_T == SIZEOF_LONG_LONG if (n[x + 1] == 'x' || n[x + 1] == 'X') sscanf((char *)(n + x + 2), "%llx", skip); else if (n[x + 1] == '0' && (n[x + 2] == 'x' || n[x + 2] == 'X')) sscanf((char *)(n + x + 3), "%llx", skip); else if (n[x + 1] == '0') sscanf((char *)(n + x + 1), "%llo", skip); else sscanf((char *)(n + x + 1), "%lld", skip); #else if (n[x + 1] == 'x' || n[x + 1] == 'X') sscanf((char *)(n + x + 2), "%lx", skip); else if (n[x + 1] == '0' && (n[x + 2] == 'x' || n[x + 2] == 'X')) sscanf((char *)(n + x + 3), "%lx", skip); else if (n[x + 1] == '0') sscanf((char *)(n + x + 1), "%lo", skip); else sscanf((char *)(n + x + 1), "%ld", skip); #endif --x; if (x > 0 && n[x] >= '0' && n[x] <= '9') { for (; x > 0 && ((n[x] >= '0' && n[x] <= '9') || n[x] == 'x' || n[x] == 'X'); --x) ; if (n[x] == ',' && x && n[x-1]!='\\') { n[x] = 0; *amnt = *skip; #if SIZEOF_LONG_LONG && SIZEOF_OFF_T == SIZEOF_LONG_LONG if (n[x + 1] == 'x' || n[x + 1] == 'X') sscanf((char *)(n + x + 2), "%llx", skip); else if (n[x + 1] == '0' && (n[x + 2] == 'x' || n[x + 2] == 'X')) sscanf((char *)(n + x + 3), "%llx", skip); else if (n[x + 1] == '0') sscanf((char *)(n + x + 1), "%llo", skip); else sscanf((char *)(n + x + 1), "%lld", skip); #else if (n[x + 1] == 'x' || n[x + 1] == 'X') sscanf((char *)(n + x + 2), "%lx", skip); else if (n[x + 1] == '0' && (n[x + 2] == 'x' || n[x + 2] == 'X')) sscanf((char *)(n + x + 3), "%lx", skip); else if (n[x + 1] == '0') sscanf((char *)(n + x + 1), "%lo", skip); else sscanf((char *)(n + x + 1), "%ld", skip); #endif } } } } /* Don't do this here: do it in prompt buffer instead, so we're just like the shell doing it on the command line. */ /* n = canonical(n); */ return n; } /* Canonicalize file name: do ~ expansion */ unsigned char *canonical(unsigned char *n) { #ifndef __MSDOS__ int x; unsigned char *s; 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; } 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; } int euclid(int a, int b) { if (!a) return b; while (b) if (a > b) a -= b; else b -= a; return a; } /* return column of first nonblank character, but don't count comments */ int found_space; int found_tab; long pisindentg(P *p) { int i_spc = 0; int i_tab = 0; P *q = pdup(p, USTR "pisindentg"); long col; int ch; p_goto_bol(q); while (joe_isblank(p->b->o.charmap,ch = brc(q))) { if (ch == ' ') i_spc = 1; else if (ch == '\t') i_tab = 1; pgetc(q); } col = q->col; if (ch == '*' || ch == '/' || ch == '-' || ch =='%' || ch == '#' || ch == '\r' || ch == '\n') col = 0; if (col) { found_space |= i_spc; found_tab |= i_tab; } prm(q); return col; } unsigned char *dequote(unsigned char *s) { static unsigned char buf[1024]; unsigned char *p = buf; while (*s) { if (*s =='\\') ++s; if (*s) *p++ = *s++; } *p = 0; return buf; } /* 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(unsigned char *s) { unsigned char buffer[SEGSIZ]; FILE *fi = 0; B *b = 0; off_t skip, amnt; unsigned char *n; int nowrite = 0; P *p; int x; long mod_time = 0; struct stat sbuf; if (!s || !s[0]) { berror = -1; b = bmk(NULL); setopt(b,USTR ""); b->rdonly = b->o.readonly; b->er = berror; return b; } n = parsens(s, &skip, &amnt); /* Open file or stream */ #ifndef __MSDOS__ if (n[0] == '!') { nescape(maint->t); ttclsn(); fi = popen((char *)dequote(n + 1), "r"); } else #endif if (!zcmp(n, USTR "-")) { #ifdef junk FILE *f; struct stat y; fi = stdin; /* Make sure stdin is not tty */ if (fstat(fileno(fi), &y)) goto no_stat; if (y.st_mode & S_IFCHR) { no_stat: b = bmk(NULL); goto empty; } #endif /* Now we always just create an empty buffer for "-" */ b = bmk(NULL); goto empty; } else { fi = fopen((char *)dequote(n), "r+"); if (!fi) nowrite = 1; else fclose(fi); fi = fopen((char *)dequote(n), "r"); if (!fi) nowrite = 0; if (fi) { fstat(fileno(fi),&sbuf); mod_time = sbuf.st_mtime; } } joesep(n); /* Abort if couldn't open */ if (!fi) { if (errno == ENOENT) berror = -1; else berror = -4; b = bmk(NULL); setopt(b,n); b->rdonly = b->o.readonly; 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 || berror) { berror = -3; goto err; } skip -= SEGSIZ; } skip -= bkread(fileno(fi), buffer, (int) skip); if (skip || berror) { berror = -3; goto err; } } /* Read from stream into new buffer */ b = bread(fileno(fi), amnt); empty: b->mod_time = mod_time; setopt(b,n); b->rdonly = b->o.readonly; /* Close stream */ err: #ifndef __MSDOS__ if (s[0] == '!') pclose(fi); else #endif if (zcmp(n, USTR "-")) fclose(fi); opnerr: if (s[0] == '!') { ttopnn(); nreturn(maint->t); } /* Set name */ b->name = joesep(zdup(s)); /* Set flags */ if (berror || s[0] == '!' || skip || amnt != MAXLONG) { b->backup = 1; b->changed = 0; } else if (!zcmp(n, USTR "-")) { 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, USTR "bload"); 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) { int i, x, y; int guessed_step = 0; int hist[20]; int hist_val[20]; int nhist = 0; int old_max; int max; int maxi; found_space = 0; found_tab = 0; p=pdup(b->eof, USTR "bload"); /* Create histogram of indentation values */ for (y = 0; y != 50; ++y) { p_goto_bol(p); if ((i = pisindentg(p))) { for (x = 0; x != nhist; ++x) if (hist_val[x] == i) break; if (x == nhist && nhist != 20) { hist[nhist] = 1; hist_val[nhist] = i; ++nhist; } else if (x != nhist) { ++hist[x]; } } if (prgetc(p)==NO_MORE_DATA) break; } /* Find GCM of top 3 most popular indentation values */ old_max = 0; for (y = 0; y != 3; ++y) { max = 0; for (x = 0; x != nhist; ++x) if (hist[x] > max) { max = hist[x]; maxi = x; } if (max) { if (!old_max) old_max = max; if (guessed_step) guessed_step = euclid(guessed_step, hist_val[maxi]); else guessed_step = hist_val[maxi]; hist[maxi] = 0; } } /* If guessed value is large, scale it down some */ while (!(guessed_step & 1) && guessed_step > 8) guessed_step >>= 1; if (found_tab && !found_space) { b->o.indentc = '\t'; b->o.istep = 1; } else if (found_space) { b->o.indentc = ' '; if (guessed_step) b->o.istep = guessed_step; } prm(p); } /* Eliminate parsed name */ vsrm(n); b->er = berror; return b; } /* Find already loaded buffer or load file into new buffer */ B *bfind(unsigned char *s) { B *b; if (!s || !s[0]) { berror = -1; b = bmk(NULL); setopt(b,USTR ""); b->rdonly = b->o.readonly; b->internal = 0; b->er = berror; return b; } for (b = bufs.link.next; b != &bufs; b = b->link.next) if (b->name && !zcmp(s, b->name)) { if (!b->orphan) ++b->count; /* Assumes caller is going to put this in a window! */ else b->orphan = 0; berror = 0; b->internal = 0; return b; } b = bload(s); /* Returns count==1 */ b->internal = 0; return b; } /* Find already loaded buffer or load file into new buffer */ B *bfind_scratch(unsigned char *s) { B *b; if (!s || !s[0]) { berror = -1; b = bmk(NULL); setopt(b,USTR ""); b->rdonly = b->o.readonly; b->internal = 0; b->er = berror; return b; } for (b = bufs.link.next; b != &bufs; b = b->link.next) if (b->name && !zcmp(s, b->name)) { if (!b->orphan) ++b->count; else b->orphan = 0; berror = 0; b->internal = 0; return b; } b = bmk(NULL); berror = -1; setopt(b,s); b->internal = 0; b->rdonly = b->o.readonly; b->er = berror; b->name = zdup(s); b->scratch = 1; return b; } B *bfind_reload(unsigned char *s) { B *b; b = bload(s); b->internal = 0; return b; } B *bcheck_loaded(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 && !zcmp(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->count of returned buffer should be 1. */ B *borphan(void) { B *b; for (b = bufs.link.next; b != &bufs; b = b->link.next) if (b->orphan && !b->scratch) { 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, off_t size) { P *np = pdup(p, USTR "bsavefd"); 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 berror = 0; err: prm(np); return berror = -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). * * If flag is set to 2, we update original time even if file * name changed (i.e., we're renaming the file). */ int break_links; /* Set to break hard links on writes */ int break_symlinks; /* Set to break symbolic links and hard links on writes */ int bsave(P *p, unsigned char *s, off_t size, int flag) { struct stat sbuf; int have_stat = 0; FILE *f; off_t skip, amnt; int norm = 0; s = parsens(s, &skip, &amnt); if (amnt < size) size = amnt; #ifndef __MSDOS__ if (s[0] == '!') { nescape(maint->t); ttclsn(); f = popen((char *)dequote(s + 1), "w"); } else #endif if (s[0] == '>' && s[1] == '>') f = fopen((char *)dequote(s + 2), "a"); else if (!zcmp(s, USTR "-")) { nescape(maint->t); ttclsn(); f = stdout; } else if (skip || amnt != MAXLONG) f = fopen((char *)dequote(s), "r+"); else { have_stat = !stat((char *)dequote(s), &sbuf); if (!have_stat) sbuf.st_mode = 0666; /* Normal file save */ if (break_links || break_symlinks) { struct stat lsbuf; /* Try to copy permissions */ if (!lstat((char *)dequote(s),&lsbuf)) { int g; if (!break_symlinks && S_ISLNK(lsbuf.st_mode)) { goto nobreak; } #ifdef WITH_SELINUX security_context_t se; if (selinux_enabled == -1) selinux_enabled = (is_selinux_enabled() > 0); if (selinux_enabled) { if (getfilecon((char *)dequote(s), &se) < 0) { berror = -4; goto opnerr; } } #endif unlink((char *)dequote(s)); g = creat((char *)dequote(s), sbuf.st_mode & ~(S_ISUID | S_ISGID)); #ifdef WITH_SELINUX if (selinux_enabled) { setfilecon((char *)dequote(s), &se); freecon(se); } #endif close(g); nobreak:; } else { unlink((char *)dequote(s)); } } f = fopen((char *)dequote(s), "w"); norm = 1; } joesep(s); if (!f) { berror = -4; goto opnerr; } fflush(f); if (skip && lseek(fileno(f), skip, 0) < 0) { berror = -3; goto err; } bsavefd(p, fileno(f), size); if (!berror && force && size && !skip && amnt == MAXLONG) { P *q = pdup(p, USTR "bsave"); unsigned char nl = '\n'; pfwrd(q, size - 1); if (brc(q) != '\n' && joe_write(fileno(f), &nl, 1) < 0) berror = -5; prm(q); } /* Restore setuid bit */ if (!berror && have_stat) { fchmod(fileno(f), sbuf.st_mode); } err: #ifndef __MSDOS__ if (s[0] == '!') pclose(f); else #endif if (zcmp(s, USTR "-")) fclose(f); else fflush(f); /* Update orignal date of file */ /* If it's not named, it's about to be */ if (!berror && norm && flag && (!p->b->name || flag == 2 || !zcmp(s,p->b->name))) { if (!stat((char *)dequote(s),&sbuf)) p->b->mod_time = sbuf.st_mtime; } opnerr: if (s[0] == '!' || !zcmp(s,USTR "-")) { ttopnn(); nreturn(maint->t); } return berror; } /* Return byte at p */ int brc(P *p) { if (p->ofst == GSIZE(p->hdr)) return NO_MORE_DATA; return GCHAR(p); } /* Return character at p */ int brch(P *p) { if (p->b->o.charmap->type) { P *q = pdup(p, USTR "brch"); int c = pgetc(q); prm(q); return c; } else { return brc(p); } } unsigned char *brmem(P *p, unsigned char *blk, int size) { unsigned char *bk = blk; P *np; int amnt; np = pdup(p, USTR "brmem"); 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 = (unsigned char *) joe_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, USTR "brzs"); 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 */ FILE *ttsig_f = 0; RETSIGTYPE ttsig(int sig) { time_t tim = time(NULL); B *b; int tmpfd; struct stat sbuf; /* Do not allow double-fault */ if (ttsig_f) _exit(1); if ((tmpfd = open("DEADJOE", O_RDWR | O_EXCL | O_CREAT, 0600)) < 0) { if (lstat("DEADJOE", &sbuf) < 0) _exit(1); if (!S_ISREG(sbuf.st_mode) || sbuf.st_uid != geteuid()) _exit(1); /* A race condition still exists between the lstat() and the open() systemcall, which leads to a possible denial-of-service attack by setting the file access mode to 600 for every file the user executing joe has permissions to. This can't be fixed w/o breacking the behavior of the orig. joe! */ if ((tmpfd = open("DEADJOE", O_RDWR | O_APPEND)) < 0) _exit(1); if (fchmod(tmpfd, S_IRUSR | S_IWUSR) < 0) _exit(1); } if ((ttsig_f = fdopen(tmpfd, "a")) == NULL) _exit(1); fprintf(ttsig_f, "\n*** These modified files were found in JOE when it aborted on %s", ctime(&tim)); if (sig == -2) fprintf(ttsig_f, "*** JOE was aborted due to swap file I/O error\n"); else if (sig == -1) fprintf(ttsig_f, "*** JOE was aborted due to malloc returning NULL\n"); else if (sig) fprintf(ttsig_f, "*** JOE was aborted by UNIX signal %d\n", sig); else fprintf(ttsig_f, "*** JOE was aborted because the terminal closed\n"); fflush(ttsig_f); for (b = bufs.link.next; b != &bufs; b = b->link.next) if (b->changed) { if (b->name) fprintf(ttsig_f, (char *)joe_gettext(_("\n*** File \'%s\'\n")), b->name); else fprintf(ttsig_f, (char *)joe_gettext(_("\n*** File \'(Unnamed)\'\n"))); fflush(ttsig_f); bsavefd(b->bof, fileno(ttsig_f), b->eof->byte); } if (sig) ttclsn(); if (sig == -2) fprintf(stderr,"\n*** JOE was aborted due to swap file I/O error\n"); else if (sig == -1) fprintf(stderr,"\n*** JOE was aborted due to malloc returning NULL. Buffers saved in DEADJOE\n"); else if (sig) fprintf(stderr,"\n*** JOE was aborted by UNIX signal %d. Buffers saved in DEADJOE\n", sig); _exit(1); } /* Create lock for a file Return 0 for success or -1 for failure */ int lock_it(unsigned char *qpath,unsigned char *bf) { unsigned char *path = dequote(qpath); unsigned char *lock_name=dirprt(path); unsigned char *name=namprt(path); unsigned char buf[1024]; unsigned char *user = (unsigned char *)getenv("USER"); unsigned char *host = (unsigned char *)getenv("HOSTNAME"); int len; if (!user) user=USTR "me"; if (!host) host=USTR "here"; lock_name=vsncpy(sv(lock_name),sc(".#")); lock_name=vsncpy(sv(lock_name),sv(name)); joe_snprintf_3(buf,sizeof(buf),"%s@%s.%d",user,host,getpid()); /* Fail only if there was an existing lock */ if (!symlink((char *)buf,(char *)lock_name) || errno != EEXIST) { vsrm(lock_name); vsrm(name); return 0; } if (bf) { len = readlink((char *)lock_name,(char *)bf,255); if (len<0) len = 0; bf[len] = 0; } vsrm(lock_name); vsrm(name); return -1; } void unlock_it(unsigned char *qpath) { unsigned char *path = dequote(qpath); unsigned char *lock_name=dirprt(path); unsigned char *name=namprt(path); lock_name=vsncpy(sv(lock_name),sc(".#")); lock_name=vsncpy(sv(lock_name),sv(name)); unlink((char *)lock_name); vsrm(lock_name); vsrm(name); } /* True if file is regular */ int plain_file(B *b) { if (b->name && zcmp(b->name,USTR "-") && b->name[0]!='!' && b->name[0]!='>' && !b->scratch) return 1; else return 0; } /* True if file changed under us */ int check_mod(B *b) { struct stat sbuf; if (!plain_file(b)) return 0; if (!stat((char *)b->name,&sbuf)) { if (sbuf.st_mtime>b->mod_time) { return 1; } } return 0; } /* True if file exists */ int file_exists(unsigned char *path) { struct stat sbuf; if (!path) return 0; return !stat((char *)path, &sbuf); } joe-3.7/b.h0000644000100100007640000002371511102737770007461 00000000000000/* * Editor engine * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_B_H #define _JOE_B_H 1 /* A buffer is made up of a doubly-linked list of gap buffer. These are the * buffer headers. The buffers themselves can be swapped out. A buffer with * point referring to it is guaranteed to be swapped in. */ struct header { LINK(H) link; /* Doubly-linked list of gap buffer headers */ long seg; /* Swap file offset to gap buffer */ int hole; /* Offset to gap */ int ehole; /* Offset to after gap */ int nlines; /* No. '\n's in this buffer */ }; /* A pointer to some location within a buffer. After an insert or delete, * all of the pointers following the insertion or deletion point are * adjusted so that they keep pointing to the same character. */ struct point { LINK(P) link; /* Doubly-linked list of pointers for a particular buffer */ B *b; /* Buffer */ int ofst; /* Gap buffer offset */ unsigned char *ptr; /* Gap buffer address */ H *hdr; /* Gap buffer header */ off_t byte; /* Buffer byte offset */ long line; /* Line number */ long col; /* current column */ long xcol; /* cursor column (can be different from actual column) */ int valcol; /* bool: is col valid? */ int end; /* set if this is end of file pointer */ P **owner; /* owner of this pointer. owner gets cleared if pointer is deleted. */ unsigned char *tracker; /* Name of function who pdup()ed me */ }; /* Options: both BWs and Bs have one of these */ struct options { OPTIONS *next; unsigned char *name_regex; unsigned char *contents_regex; int overtype; int lmargin; int rmargin; int autoindent; int wordwrap; int nobackup; int tab; int indentc; int istep; unsigned char *context; unsigned char *lmsg; unsigned char *rmsg; int linums; int readonly; int french; int flowed; 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_syntax() from syntax_name happens in setopt()) */ unsigned char *map_name; /* Name of character set */ struct charmap *charmap; /* Character set */ unsigned char *language; /* Language of this buffer (for spell) */ 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 */ int single_quoted; /* Ignore ' ' for ^G */ int no_double_quoted; /* Don't ignore " " for ^G */ int c_comment; /* Ignore text in C comments */ int cpp_comment; /* Ignore text after // comments */ int pound_comment; /* Ignore text after # comments */ int vhdl_comment; /* Ignore text after -- comments */ int semi_comment; /* Ignore text after ; comments */ int tex_comment; /* Ignore text after % comments */ int hex; /* Hex edit mode */ unsigned char *text_delimiters; /* Define word delimiters */ unsigned char *cpara; /* Characters which can indent paragraphcs */ 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 */ MACRO *mfirst; /* Macro to execute on first change */ }; /* A buffer */ struct buffer { LINK(B) link; /* Doubly-linked list of all buffers */ P *bof; /* Beginning of file pointer */ P *eof; /* End of file pointer */ unsigned char *name; /* File name */ int locked; /* Set if we created a lock for this file */ int ignored_lock; /* Set if we didn't create a lock and we don't care (locked set in this case) */ int didfirst; /* Set after user attempted first change */ long mod_time; /* Last modification time for file */ long check_time; /* Last time we checked the file on disk */ int gave_notice; /* Set if we already gave file changed notice for this file */ int orphan; /* Set if buffer is orphaned: refcount is bumped up by one in this case */ int count; /* Reference count. Buffer is deleted if brm decrements count to 0 */ 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 lattr_db *db; /* Linked list of line attribute databases */ void (*parseone)(struct charmap *map,unsigned char *s,unsigned char **rtn_name, long *rtn_line); /* Error parser for this buffer */ }; extern B bufs; /* 31744 */ extern unsigned char stdbuf[stdsiz]; /* Convenient global buffer */ 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 unsigned char *msgs[]; /* File access status messages */ B *bmk PARAMS((B *prop)); void brm PARAMS((B *b)); void brmall(); B *bfind PARAMS((unsigned char *s)); B *bfind_scratch PARAMS((unsigned char *s)); B *bcheck_loaded PARAMS((unsigned char *s)); B *bfind_reload PARAMS((unsigned char *s)); P *pdup PARAMS((P *p, unsigned char *tr)); P *pdupown PARAMS((P *p, P **o, unsigned char *tr)); P *poffline PARAMS((P *p)); P *ponline PARAMS((P *p)); B *bonline PARAMS((B *b)); B *boffline PARAMS((B *b)); void prm PARAMS((P *p)); P *pset PARAMS((P *n, P *p)); P *p_goto_bof PARAMS((P *p)); /* move cursor to begging of file */ P *p_goto_eof PARAMS((P *p)); /* move cursor to end of file */ P *p_goto_bol PARAMS((P *p)); /* move cursor to begging of line */ P *p_goto_eol PARAMS((P *p)); /* move cursor to end of line */ P *p_goto_indent PARAMS((P *p,int c)); /* move cursor to indentation point */ int pisbof PARAMS((P *p)); int piseof PARAMS((P *p)); int piseol PARAMS((P *p)); int pisbol PARAMS((P *p)); int pisbow PARAMS((P *p)); int piseow PARAMS((P *p)); #define piscol(p) ((p)->valcol ? (p)->col : (pfcol(p), (p)->col)) int pisblank PARAMS((P *p)); int piseolblank PARAMS((P *p)); long pisindent PARAMS((P *p)); int pispure PARAMS((P *p,int c)); int pnext PARAMS((P *p)); int pprev PARAMS((P *p)); int pgetb PARAMS((P *p)); int prgetb PARAMS((P *p)); int pgetc PARAMS((P *p)); int prgetc PARAMS((P *p)); P *pgoto PARAMS((P *p, long int loc)); P *pfwrd PARAMS((P *p, long int n)); P *pbkwd PARAMS((P *p, long int n)); P *pfcol PARAMS((P *p)); P *pnextl PARAMS((P *p)); P *pprevl PARAMS((P *p)); P *pline PARAMS((P *p, long int line)); P *pcolwse PARAMS((P *p, long int goalcol)); P *pcol PARAMS((P *p, long int goalcol)); P *pcoli PARAMS((P *p, long int goalcol)); void pbackws PARAMS((P *p)); void pfill PARAMS((P *p, long int to, int usetabs)); P *pfind PARAMS((P *p, unsigned char *s, int len)); P *pifind PARAMS((P *p, unsigned char *s, int len)); P *prfind PARAMS((P *p, unsigned char *s, int len)); P *prifind PARAMS((P *p, unsigned char *s, int len)); /* copy text between 'from' and 'to' into new buffer */ B *bcpy PARAMS((P *from, P *to)); void pcoalesce PARAMS((P *p)); void bdel PARAMS((P *from, P *to)); /* insert buffer 'b' into another at 'p' */ P *binsb PARAMS((P *p, B *b)); /* insert a block 'blk' of size 'amnt' into buffer at 'p' */ P *binsm PARAMS((P *p, unsigned char *blk, int amnt)); /* insert character 'c' into buffer at 'p' */ P *binsc PARAMS((P *p, int c)); /* insert byte 'c' into buffer at at 'p' */ P *binsbyte PARAMS((P *p, unsigned char c)); /* insert zero term. string 's' into buffer at 'p' */ P *binss PARAMS((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 PARAMS((unsigned char *s)); B *bread PARAMS((int fi, long int max)); B *bfind PARAMS((unsigned char *s)); B *borphan PARAMS((void)); /* Save 'size' bytes beginning at 'p' into file with name in 's' */ int bsave PARAMS((P *p, unsigned char *s, off_t size,int flag)); int bsavefd PARAMS((P *p, int fd, off_t size)); unsigned char *parsens PARAMS((unsigned char *s, off_t *skip, off_t *amnt)); unsigned char *canonical PARAMS((unsigned char *s)); /* Get byte at pointer or return NO_MORE_DATA if pointer is at end of buffer */ int brc PARAMS((P *p)); /* Get character at pointer or return NO_MORE_DATA if pointer is at end of buffer */ int brch PARAMS((P *p)); /* Copy 'size' bytes from a buffer beginning at p into block 'blk' */ unsigned char *brmem PARAMS((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 PARAMS((P *p, int size)); /* Copy 'size' bytes from a buffer beginning at p into a variable length string. */ unsigned char *brvs PARAMS((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 PARAMS((P *p, unsigned char *buf, int size)); B *bnext PARAMS((void)); B *bafter PARAMS((B *b)); B *bprev PARAMS((void)); extern int berror; /* bload error status code (use msgs[-berror] to get message) */ unsigned char **getbufs PARAMS((void)); int lock_it PARAMS((unsigned char *path,unsigned char *buf)); void unlock_it PARAMS((unsigned char *path)); int plain_file PARAMS((B *b)); int check_mod PARAMS((B *b)); int file_exists PARAMS((unsigned char *path)); int udebug_joe PARAMS((BW *bw)); extern int guesscrlf; /* Try to guess line ending when set */ extern int guessindent; /* Try to guess indent character and step when set */ extern int break_links; /* Break hard links on write */ extern int break_symlinks; /* Break symbolic links on write */ void set_file_pos_orphaned(); void breplace(B *b, B *n); unsigned char *dequote(unsigned char *); #endif joe-3.7/man/0000777000100100007640000000000011103454343007707 500000000000000joe-3.7/man/ru/0000777000100100007640000000000011103454343010335 500000000000000joe-3.7/man/ru/joe.1.in0000644000100100007640000011370611100502740011515 00000000000000.\" Russian translation of joe man page. .\" May be distributed under the GNU General Public License .\" .TH JOE 1 "May 2004" "Joe 3.0" .SH îÁÚ×ÁÎÉÅ joe \- Joe's Own Editor .SH éÓÐÏÌØÚÏ×ÁÎÉÅ .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 jice [global-options] [ [local-options] filename ]... .SH ïÐÉÓÁÎÉÅ JOE - ÍÏÝÎÙÊ ÔÅËÓÔÏ×ÙÊ ÒÅÄÁËÔÏÒ. ïÎ ÏÂÌÁÄÁÅÔ ÜËÒÁÎÎÙÍ ÐÏÌØÚÏ×ÁÔÅÌØÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ, ÐÏÄÏÂÎÏ ÍÎÏÇÉÍ ÄÒÕÖÅÓÔ×ÅÎÎÙÍ ÐÏÌØÚÏ×ÁÔÅÌÀ ÒÅÄÁËÔÏÒÁÍ ÄÌÑ PC. ðÏÌØÚÏ×ÁÔÅÌÉ WordStar ÏÔ Micro-Pro ÉÌÉ "ôÕÒÂÏ"-ÑÚÙËÏ× ÏÔ Borland ÐÏÞÕ×ÓÔ×ÕÀÔ ÓÅÂÑ Ó ÎÉÍ ËÁË ÄÏÍÁ. ÷ ÔÏ ÖÅ ×ÒÅÍÑ JOE Ñ×ÌÑÅÔÓÑ ÐÏÌÎÏÆÕÎËÃÉÏÎÁÌØÎÙÍ ÔÅËÓÔÏ×ÙÍ ÜËÒÁÎÎÙÍ ÒÅÄÁËÔÏÒÏÍ ÄÌÑ UNIX, É ÏÂÌÁÄÁÅÔ ÍÁÓÓÏÊ ÆÕÎËÃÉÊ ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ÐÒÏÇÒÁÍÍ É ÔÅËÓÔÏ×. JOE ÔÁËÖÅ ÜÍÕÌÉÒÕÅÔ ÎÅÓËÏÌØËÏ ÄÒÕÇÉÈ ÒÅÄÁËÔÏÒÏ×. JSTAR - ÜÔÏ ÉÍÉÔÁÃÉÑ WordStar ÓÏ ÍÎÏÇÉÍÉ ÒÁÓÛÉÒÅÎÉÑÍÉ JOE. JPICO - ÉÍÉÔÁÃÉÑ ÔÅËÓÔÏ×ÏÇÏ ÒÅÄÁËÔÏÒÁ PICO, ÉÓÐÏÌØÚÕÅÍÏÇÏ × ÐÏÞÔÏ×ÏÊ ÓÉÓÔÅÍÅ PINE, ÎÏ ÓÏ ÍÎÏÇÉÍÉ ÒÁÓÛÉÒÅÎÉÑÍÉ É ÕÌÕÞÛÅÎÉÑÍÉ. JMACS - ÜÔÏ ÉÍÉÔÁÃÉÑ GNU-EMACS. JICE - ÎÁÓÔÒÏÅÎÎÙÊ ÎÁ ÉÓÐÏÌØÚÏ×ÁÎÉÅ ÆÕÎËÃÉÏÎÁÌØÎÏÊ ËÌÁ×ÉÁÔÕÒÙ × ÔÒÁÄÉÃÉÏÎÎÏÍ PC-ÓÔÉÌÅ ÒÅÄÁËÔÏÒ, ÒÅËÏÍÅÎÄÕÅÍÙÊ ÄÌÑ ÉÓÐÏÌØÚÏ×ÁÎÉÑ × ËÏÍÐÌÅËÓÅ ÐÒÏÇÒÁÍÍ ÂÕÈÕÞÅÔÁ iceB. RJOE - ÕÒÅÚÁÎÎÁÑ ×ÅÒÓÉÑ JOE, ËÏÔÏÒÁÑ ÐÏÚ×ÏÌÑÅÔ ÒÅÄÁËÔÉÒÏ×ÁÔØ ÔÏÌØËÏ ÆÁÊÌÙ, ÕËÁÚÁÎÎÙÅ × ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÅ. èÏÔÑ JOE ×ÙÇÌÑÄÉÔ ËÁ ÛÅÓÔØ ÒÁÚÌÉÞÎÙÈ ÒÅÄÁËÔÏÒÏ×, ÏÎ × ÄÅÊÓÔ×ÉÔÅÌØÎÏÓÔÉ ÐÒÅÄÓÔÁ×ÌÑÅÔ ÓÏÂÏÊ ÅÄÉÎÓÔ×ÅÎÎÕÀ ÉÓÐÏÌÎÑÅÍÕÀ ÐÒÏÇÒÁÍÍÕ, ÎÏ Ó ÛÅÓÔØÀ ÒÁÚÎÙÍÉ ÉÍÅÎÁÍÉ. éÍÑ ÒÅÄÁËÔÏÒÁ ×ÍÅÓÔÅ Ó ÓÕÆÆÉËÓÏÍ "rc" ÓÏÓÔÁ×ÌÑÀÔ ÉÍÑ ÉÎÉÃÉÁÌÉÚÁÃÉÏÎÎÏÇÏ ÆÁÊÌÁ JOE, ËÏÔÏÒÙÊ ÏÐÒÅÄÅÌÑÅÔ ×ÎÅÛÎÉÅ ÏÓÏÂÅÎÎÏÓÔÉ ÒÅÄÁËÔÏÒÁ. JOE - Ó×ÏÂÏÄÎÁÑ ÐÒÏÇÒÁÍÍÁ; ×Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ É/ÉÌÉ ÍÏÄÉÆÉÃÉÒÏ×ÁÔØ ÅÇÏ × ÓÏÏÔ×ÅÔÓÔ×ÉÉ Ó ÐÏÌÏÖÅÎÉÑÍÉ GNU General Public License, ÏÐÕÂÌÉËÏ×ÁÎÎÏÊ Free Software Foundation. õ ÍÅÎÑ ÎÅÔ ÐÌÁÎÏ× ÐÏ ÐÒÅ×ÒÁÝÅÎÉÀ JOE × ËÏÍÍÅÒÞÅÓËÉÊ ÉÌÉ share-ware ÐÒÏÄÕËÔ. JOE ÄÏÓÔÕÐÅÎ ÞÅÒÅÚ Internet ÐÏ ÁÄÒÅÓÕ \fBwww.sourceforge.net/projects/joe-editor\fR. .SH éÓÐÏÌØÚÏ×ÁÎÉÅ äÌÑ ÚÁÐÕÓËÁ ÒÅÄÁËÔÏÒÁ ××ÅÄÉÔÅ ÉÍÑ \fBjoe\fR, ÍÏÖÎÏ ÓÏ ÓÌÅÄÕÀÝÉÍÉ ÚÁ ÎÉÍ ÉÍÅÎÁÍÉ ÒÅÄÁËÔÉÒÕÅÍÙÈ ÆÁÊÌÏ×. ëÁÖÄÏÍÕ ÉÍÅÎÉ ÆÁÊÌÁ ÍÏÇÕÔ ÐÒÅÄÛÅÓÔ×Ï×ÁÔØ ËÌÀÞÉ ÌÏËÁÌØÎÙÈ ÏÐÃÉÊ (ÎÉÖÅ ÓÍ. ÔÁÂÌÉÃÕ ÌÏËÁÌØÎÙÈ ÏÐÃÉÊ). ÷ ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÅ ÔÁËÖÅ ÍÏÇÕÔ ÂÙÔØ ÕËÁÚÁÎÙ ËÌÀÞÉ ÇÌÏÂÁÌØÎÙÈ ÏÐÃÉÊ, ×ÏÚÄÅÊÓÔ×ÕÀÝÉÅ ÎÁ ÒÅÄÁËÔÏÒ × ÃÅÌÏÍ (ÎÉÖÅ ÓÍ. ÔÁÂÌÉÃÕ ÇÌÏÂÁÌØÎÙÈ ÏÐÃÉÊ). åÓÌÉ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÎÏ×ÙÊ ÆÁÊÌ - ÍÏÖÅÔÅ ÕËÁÚÁÔØ ÅÇÏ ÉÍÑ ÌÉÂÏ × ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÅ ÐÒÉ ÚÁÐÕÓËÅ ÒÅÄÁËÔÏÒÁ, ÌÉÂÏ ÉÚ ÒÅÄÁËÔÏÒÁ ÐÒÉ ÓÏÈÒÁÎÅÎÉÉ ÆÁÊÌÁ. ðÒÅÄÏÓÔÁ×ÌÑÅÔÓÑ ÓÐÅÃÉÁÌØÎÙÊ ÓÉÎÔÁËÓÉÓ ÉÍÅÎÉ ÆÁÊÌÁ ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ×Ù×ÏÄÁ ÐÒÏÇÒÁÍÍ, ÓÔÁÎÄÁÒÔÎÏÇÏ ××ÏÄÁ/×Ù×ÏÄÁ ÉÌÉ ÕÞÁÓÔËÏ× ÆÁÊÌÏ× ÉÌÉ ÕÓÔÒÏÊÓÔ×. ðÏÄÒÏÂÎÏÓÔÉ ÓÍ. ÎÉÖÅ × ÒÁÚÄÅÌÅ \fBéÍÅÎÁ ÆÁÊÌÏ×\fR. úÁÐÕÓÔÉ× ÒÅÄÁËÔÏÒ, ×Ù ÍÏÖÅÔÅ ××ÏÄÉÔØ × ÎÅÍ ÔÅËÓÔ É ÉÓÐÏÌØÚÏ×ÁÔØ ÓÐÅÃÉÁÌØÎÙÅ ÕÐÒÁ×ÌÑÀÝÉÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÉ ÄÌÑ ×ÙÐÏÌÎÅÎÉÑ ÄÒÕÇÉÈ ÚÁÄÁÞ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ. ïÐÉÓÁÎÉÅ ÔÏÇÏ, ÞÔÏ ×ÙÐÏÌÎÑÅÔ ÔÁ ÉÌÉ ÄÒÕÇÁÑ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔØ, ×Ù ÍÏÖÅÔÅ ÎÁÊÔÉ ÎÉÖÅ × ÜÔÏÍ ÓÐÒÁ×ÏÞÏÍ ÒÕËÏ×ÏÄÓÔ×Å ÌÉÂÏ ÎÁÂÒÁ× × ÒÅÄÁËÔÏÒÅ \fB^K H\fR ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÐÏÄÓËÁÚËÉ. úÁÍÅÞÁÎÉÑ ÐÏ ÎÅËÏÔÏÒÙÍ ÏÂÝÅÐÒÉÎÑÔÙÍ ÄÏÇÏ×ÏÒÅÎÎÏÓÔÑÍ: \fB^\fR ÚÎÁÞÉÔ, ÞÔÏ ×Ù ÕÄÅÒÖÉ×ÁÅÔÅ ËÌÁ×ÉÛÕ \fBControl\fR ÐÒÉ ÎÁÖÁÔÉÉ ÕËÁÚÁÎÎÏÊ ÄÁÌÅÅ ËÌÁ×ÉÛÉ (ÁÎÁÌÏÇÉÞÎÏ ÔÏÍÕ, ËÁË ÒÁÂÏÔÁÅÔ \fBShift\fR ÄÌÑ ××ÏÄÁ ÂÕË×Ù ×ÅÒÈÎÅÇÏ ÒÅÇÉÓÔÒÁ). îÅËÏÔÏÒÙÅ ÕÐÒÁ×ÌÑÀÝÉÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÉ ÄÕÂÌÉÒÕÀÔÓÑ ÄÒÕÇÉÍÉ ËÌÁ×ÉÛÁÍÉ, ÔÁË ÞÔÏ ×ÁÍ ÎÅ ×ÓÅÇÄÁ ÏÂÑÚÁÔÅÌØÎÏ ÎÁÖÉÍÁÔØ Control: \fBESC\fR ÒÁÂÏÔÁÅÔ ËÁË \fB^[\fR, \fBDel\fR - ËÁË \fB^?\fR, \fBBackspace\fR - \fB^H\fR, \fBTab\fR - \fB^I\fR, \fBReturn\fR ÉÌÉ \fBEnter\fR - ÜÔÏ \fB^M\fR É \fBLinefeed\fR ÍÏÖÅÔ ÉÓÐÏÌØÚÏ×ÁÔØÓÑ ×ÍÅÓÔÏ \fB^J\fR. îÁ ÎÅËÏÔÏÒÙÈ ËÌÁ×ÉÁÔÕÒÁÈ ÏÔÄÅÌØÎÙÅ ÕÐÒÁ×ÌÑÀÝÉÅ ËÌÁ×ÉÛÉ ÍÏÇÕÔ ÎÅ ÒÁÂÏÔÁÔØ. \fB^_\fR, \fB^^\fR É \fB^@\fR ÏÂÙÞÎÏ ××ÏÄÑÔÓÑ ÂÅÚ ÎÁÖÁÔÉÑ Shift (Ô.Å., ÐÒÏÂÕÊÔÅ \fB^-\fR, \fB^6\fR É \fB^2\fR). îÁ ÄÒÕÇÉÈ ËÌÁ×ÉÁÔÕÒÁÈ ÜÔÉ ËÌÁ×ÉÛÉ ÍÏÇÕÔ ÂÙÔØ ÐÅÒÅÎÁÚÎÁÞÅÎÙ. ðÏÐÒÏÂÕÊÔÅ: \fB^.\fR, \fB^,\fR É \fB^/\fR. \fB^ðòïâåì\fR ÏÂÙÞÎÏ ÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ×ÍÅÓÔÏ \fB^@\fR. \fB^\\\fR É \fB^]\fR ÉÎÔÅÒÐÒÅÔÉÒÕÀÔÓÑ ÍÎÏÇÉÍÉ ËÏÍÍÕÎÉËÁÃÉÏÎÎÙÍÉ ÐÒÏÇÒÁÍÍÁÍÉ, ×ËÌÀÞÁÑ telnet É kermit. ÷ ÜÔÏÍ ÓÌÕÞÁÅ ×ÁÍ ÐÒÉÄÅÔÓÑ ÎÁÖÁÔØ ÄÁÎÎÕÀ ËÌÁ×ÉÛÕ Ä×ÁÖÄÙ, ÞÔÏÂÙ ÐÒÏÒ×ÁÔØÓÑ ÞÅÒÅÚ ËÏÍÍÕÎÉËÁÃÉÏÎÎÕÀ ÐÒÏÇÒÁÍÍÕ. ðÏÓÌÅ ÎÁÖÁÔÉÑ \fB^K H\fR × ×ÅÒÈÎÅÊ ÞÁÓÔÉ ÜËÒÁÎÁ ÐÏÑ×ÉÔÓÑ ÐÅÒ×ÏÅ ÏËÎÏ ÐÏÄÓËÁÚËÉ. ÷Ù ÍÏÖÅÔÅ ÐÒÏÄÏÌÖÁÔØ ××ÏÄÉÔØ É ÒÅÄÁËÔÉÒÏ×ÁÔØ ÔÅËÓÔ, ÐÏËÁ ÏÎÏ ÔÁÍ ÎÁÈÏÄÉÔÓÑ. äÌÑ ÌÉÓÔÁÎÉÑ ÐÏÄÓËÁÚËÉ ÉÓÐÏÌØÚÕÊÔÅ ^[, É ^[. (Ô.Å., ESC , É ESC .). îÁÖÍÉÔÅ \fB^K H\fR ÓÎÏ×Á ÄÌÑ ÚÁËÒÙÔÉÑ ÏËÎÁ ÐÏÄÓËÁÚËÉ. ÷Ù ÍÏÖÅÔÅ ÎÁÓÔÒÏÉÔØ ÒÁÓËÌÁÄËÕ ËÌÁ×ÉÁÔÕÒÙ, ÏËÎÁ ÐÏÄÓËÁÚËÉ É ÒÁÚÌÉÞÎÏÅ ÐÏ×ÅÄÅÎÉÅ ÒÅÄÁËÔÏÒÁ, ÓËÏÐÉÒÏ×Á× ÉÎÉÃÉÁÌÉÚÁÃÉÏÎÎÙÊ ÆÁÊÌ JOE (ÏÂÙÞÎÏ \fB@JOERC@/joerc\fR) × \fB.joerc\fR × ×ÁÛÅÊ ÄÏÍÁÛÎÅÊ ÄÉÒÅËÔÏÒÉÉ É ÚÁÔÅÍ ÏÔÒÅÄÁËÔÉÒÏ×Á× ÅÇÏ. îÉÖÅ ÓÍ. ÒÁÚÄÅÌ \fBjoerc\fR. þÔÏÂÙ ÉÓÐÏÌØÚÏ×ÁÔØ JOE × ËÁÞÅÓÔ×Å ÒÅÄÁËÔÏÒÁ ÐÏ ÕÍÏÌÞÁÎÉÀ ÄÌÑ e-mail É News, ×ÁÍ ÎÅÏÂÈÏÄÉÍÏ ÕÓÔÁÎÏ×ÉÔØ ÐÅÒÅÍÅÎÎÙÅ ÓÒÅÄÙ \fBEDITOR\fR É \fBVISUAL\fR × ÓÔÁÒÔÏ×ÏÍ ËÏÍÁÎÄÎÏÍ ÆÁÊÌÅ ×ÁÛÅÇÏ ÛÅÌÌÁ (\fB.cshrc\fR ÉÌÉ \fB.profile\fR) ÔÁË, ÞÔÏÂÙ ÏÎÉ ÓÓÙÌÁÌÉÓØ ÎÁ JOE (joe ÏÂÙÞÎÏ ÒÁÓÐÏÌÁÇÁÅÔÓÑ × \fB@BINDIR@/joe\fR). ôÁËÖÅ ÉÍÅÀÔÓÑ ÎÅËÏÔÏÒÙÅ ÓÐÅÃÉÁÌØÎÙÅ ÐÁÒÁÍÅÔÒÙ ×ÙÐÏÌÎÅÎÉÑ, ËÏÔÏÒÙÅ, ×ÏÚÍÏÖÎÏ, ÐÒÉÄÅÔÓÑ ÕÓÔÁÎÏ×ÉÔØ, × ÞÁÓÔÎÏÓÔÉ, ÅÓÌÉ ÜËÒÁÎ ×ÁÛÅÇÏ ÔÅÒÍÉÎÁÌÁ ÉÚÍÅÎÑÅÔÓÑ ÎÅ ÔÁË, ËÁË ×Ù ÜÔÏÇÏ ÏÖÉÄÁÅÔÅ. óÍ. ÒÁÚÄÅÌ \fBðÅÒÅÍÅÎÎÙÅ ÓÒÅÄÙ\fR ÎÉÖÅ. .SH ïÐÃÉÉ ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÉ ÷ ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÅ ÍÏÇÕÔ ÂÙÔØ ÕËÁÚÁÎÙ ÓÌÅÄÕÀÝÉÅ ÇÌÏÂÁÌØÎÙÅ ÏÐÃÉÉ: .IP -asis óÉÍ×ÏÌÙ Ó ËÏÄÁÍÉ ÂÏÌØÛÉÍÉ, ÞÅÍ 127, ÂÕÄÕÔ ÐÅÒÅÄÁ×ÁÔØÓÑ ÎÁ ÔÅÒÍÉÎÁÌ ËÁË ÅÓÔØ, ×ÍÅÓÔÏ ÐÒÅÏÂÒÁÚÏ×ÁÎÉÑ ÉÈ × ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÅ ÓÉÍ×ÏÌÙ Ó ËÏÄÁÍÉ ÍÅÎØÛÉÍÉ 128. åÓÌÉ ÜÔÏ ÎÅ ÓÒÁÂÁÔÙ×ÁÅÔ - ÐÒÏ×ÅÒØÔÅ ×ÁÛ ÔÅÒÍÉÎÁÌØÎÙÊ ÓÅÒ×ÅÒ. .IP -backpath\ path åÓÌÉ ÜÔÁ ÏÐÃÉÑ ÚÁÄÁÎÁ - ÆÁÊÌÙ ÒÅÚÅÒ×ÎÙÈ ËÏÐÉÊ ÂÕÄÕÔ ÓÏÚÄÁ×ÁÔØÓÑ × ÕËÁÚÁÎÎÏÊ ÄÉÒÅËÔÏÒÉÉ, Á ÎÅ × "ÒÏÄÎÏÊ" ÄÉÒÅËÔÏÒÉÉ ÒÅÄÁËÔÉÒÕÅÍÏÇÏ ÆÁÊÌÁ. .IP -baud\ nnn õÓÔÁÎÏ×ÉÔØ ÓËÏÒÏÓÔØ ÐÅÒÅÄÁÞÉ ÄÌÑ ÏÐÔÉÍÉÚÁÃÉÉ ÜËÒÁÎÎÏÇÏ ×Ù×ÙÏÄÁ. Joe ÂÕÄÅÔ ×ÓÔÁ×ÌÑÔØ ÍÅÖÓÉÍ×ÏÌØÎÙÅ ÐÁÕÚÙ ÄÌÑ ÓËÏÒÏÓÔÅÊ ÎÉÖÅ 19200, ÞÔÏ ÐÏÚ×ÏÌÑÅÔ ÏÂÏÊÔÉ ÔÅÒÍÉÎÁÌØÎÕÀ ÂÕÆÅÒÉÚÁÃÉÀ É ÐÒÅÒÙ×ÁÔØ ÜËÒÁÎÎÙÊ ×Ù×ÏÄ ËÌÁ×ÉÁÔÕÒÎÙÍ ××ÏÄÏÍ. ëÏÍÁÎÄÙ ÓËÏÌÌÉÎÇÁ ÎÅ ÂÕÄÕÔ ÉÓÐÏÌØÚÏ×ÁÔØÓÑ ÐÒÉ ÕËÁÚÁÎÉÉ ÓËÏÒÏÓÔÉ 38400 ÂÏÄ. üÔÏ ÐÏÌÅÚÎÏ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ X-ÔÅÒÍÉÎÁÌÏ× É ÜËÒÁÎÏ× ËÏÎÓÏÌÉ, ËÏÔÏÒÙÅ ÎÅ ÐÏÄËÌÀÞÅÎÙ ÞÅÒÅÚ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÕÀ ÌÉÎÉÀ. .IP -beep Joe ÂÕÄÅÔ ÉÚÄÁ×ÁÔØ Ú×ÏÎÏË × ÓÌÕÞÁÅ ÎÅÐÒÁ×ÉÌØÎÙÈ ËÏÍÁÎÄ É ÐÏ ÄÏÓÔÉÖÅÎÉÀ ËÕÒÓÏÒÏÍ ÇÒÁÎÉà ××ÏÄÁ. .IP -columns\ nnn õÓÔÁÎÁ×ÌÉ×ÁÅÔ ËÏÌÉÞÅÓÔ×Ï ËÏÌÏÎÏË ÎÁ ÜËÒÁÎÅ. .IP -csmode ðÒÏÄÏÌÖÅÎÎÙÊ ÒÅÖÉÍ ÐÏÉÓËÁ: ËÏÍÁÎÄÁ ÐÏÉÓËÁ, ÓÌÅÄÕÀÝÁÑ ÚÁ ÐÅÒ×ÏÊ, ÂÕÄÅÔ ÐÒÏÄÏÌÖÁÔØ ÐÏÉÓË ÚÁÄÁÎÎÏÇÏ ÒÁÎÅÅ ÏÂÒÁÚÃÁ, Á ÎÅ ÚÁÐÒÁÛÉ×ÁÔØ ÎÏ×ÙÊ. üÔÏ ÐÏÌÅÚÎÏ ÄÌÑ ËÏÍÁÎÄ ^[S É ^[R, É ËÏÇÄÁ joe ÉÚÏÂÒÁÖÁÅÔ ÉÚ ÓÅÂÑ emacs. .IP -dopadding Joe ÏÂÙÞÎÏ ÐÒÅÄÐÏÌÁÇÁÅÔ ÎÁÌÉÞÉÅ ËÁËÏÇÏ-ÌÉÂÏ ÐÒÏÔÏËÏÌÁ ÕÐÒÁ×ÌÅÎÉÑ ÐÏÔÏËÏÍ ÍÅÖÄÕ ÎÉÍ É ÔÅÒÍÉÎÁÌÏÍ. åÓÌÉ ÎÉËÁËÏÊ ÐÒÏÔÏËÏÌ ÎÅ ÉÓÐÏÌØÚÕÅÔÓÑ - ÄÁÎÎÁÑ ÏÐÃÉÑ ÚÁÓÔÁ×ÌÑÅÔ joe ×Ù×ÏÄÉÔØ ÎÁ ÔÅÒÍÉÎÁÌ ÄÏÐÏÌÎÉÔÅÌØÎÙÅ ^@ ËÁË ÕËÁÚÁÎÏ × termcap-ÏÐÉÓÁÎÉÉ ÔÅÒÍÉÎÁÌÁ. äÏÐÏÌÎÉÔÅÌØÎÙÅ ^@ ÄÁÀÔ ×ÏÚÍÏÖÎÏÓÔØ ÔÅÒÍÉÎÁÌÕ ÚÁËÏÎÞÉÔØ ÄÌÉÔÅÌØÎÙÅ ÔÅÒÍÉÎÁÌØÎÙÅ ËÏÍÁÎÄÙ. .IP -exask üÔÁ ÏÐÃÉÑ ÄÁÅÔ ×ÏÚÍÏÖÎÏÓÔØ ÐÒÏ×ÅÒÉÔØ ÉÍÑ ÆÁÊÌÁ, ÓÏÈÒÁÎÑÅÍÏÇÏ ÐÏ ^KX. .IP -force üÔÁ ÏÐÃÉÑ ÏÂÅÓÐÅÞÉ×ÁÅÔ ÏÂÑÚÁÔÅÌØÎÏÅ ÄÏÂÁ×ÌÅÎÉÅ ÐÅÒÅ×ÏÄÁ ÓÔÒÏËÉ × ËÏÎÅà ÓÏÈÒÁÎÑÅÍÏÇÏ ÆÁÊÌÁ. .IP -help åÓÌÉ ÕËÁÚÁÎÁ ÜÔÁ ÏÐÃÉÑ - ÒÅÄÁËÔÏÒ ÂÕÄÅÔ ÓÔÁÒÔÏ×ÁÔØ Ó ÏÔËÒÙÔÙÍ ÏËÎÏÍ ÐÏÄÓËÁÚËÉ. .IP -keepup ïÂÙÞÎÏ ÐÏÌÑ ÓÔÒÏËÉ ÓÏÓÔÏÑÎÉÑ, × ËÏÔÏÒÙÈ ÏÔÏÂÒÁÖÁÅÔÓÑ ÎÏÍÅÒ ÐÏÚÉÃÉÉ É ÐÒÅÆÉËÓ ÕÐÒÁ×ÌÑÀÝÅÊ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÉ, ÏÂÎÏ×ÌÑÀÔÓÑ ÒÁÚ × ÓÅËÕÎÄÕ ÄÌÑ ÕÍÅÎØÛÅÎÉÑ ÎÁÇÒÕÚËÉ ÎÁ ÐÒÏÃÅÓÓÏÒ, ÎÏ × ÓÌÕÞÁÅ ÕËÁÚÁÎÉÑ ÜÔÏÊ ÏÐÃÉÉ ÏÂÎÏ×ÌÅÎÉÅ ÂÕÄÅÔ ÐÒÏÉÚ×ÏÄÉÔØÓÑ ÐÏ ËÁÖÄÏÍÕ ÎÁÖÁÔÉÀ ËÌÁ×ÉÛÉ. .IP -lightoff åÓÌÉ ÄÁÎÎÁÑ ÏÐÃÉÑ ÕËÁÚÁÎÁ - ÏÔÍÅÔËÁ ÂÌÏËÁ ÂÕÄÅÔ ÓÎÉÍÁÔØÓÑ ÐÏÓÌÅ ÌÀÂÏÊ ÏÐÅÒÁÃÉÉ ÎÁÄ ÂÌÏËÏÍ. .IP -lines\ nnn õÓÔÁÎÁ×ÌÉ×ÁÅÔ ËÏÌÉÞÅÓÔ×Ï ÓÔÒÏË ÜËÒÁÎÁ. .IP -marking ôÅËÓÔ ÍÅÖÄÕ ÎÁÞÁÌÏÍ ÂÌÏËÁ É ËÕÒÓÏÒÏÍ ÂÕÄÅÔ ÐÏÄÓ×ÅÞÉ×ÁÔØÓÑ (ÉÓÐÏÌØÚÕÊÔÅ ×ÍÅÓÔÅ Ó -lightoff É ÍÏÄÉÆÉÃÉÒÏ×ÁÎÎÙÍ ÆÁÊÌÏÍ joerc ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÏÔÍÅÔËÉ ÂÌÏËÁ × ÓÔÉÌÅ "ÂÒÏÛÅÎÎÏÇÏ ÑËÏÒÑ"). .IP -mid åÓÌÉ ÜÔÁ ÏÐÃÉÑ ÕÓÔÁÎÏ×ÌÅÎÁ É ËÕÒÓÏÒ ÐÅÒÅÍÅÝÁÅÔÓÑ ÚÁ ÐÒÅÄÅÌÙ ÜËÒÁÎÁ - ÏËÎÏ ÂÕÄÅÔ ÓËÒÏÌÌÉÒÏ×ÁÔØÓÑ ÔÁËÉÍ ÏÂÒÁÚÏÍ, ÞÔÏÂÙ ËÕÒÓÏÒ ÏÓÔÁ×ÁÌÓÑ × ÃÅÎÔÒÅ. üÔÁ ÏÐÃÉÑ ÐÒÉÎÕÄÉÔÅÌØÎÏ ×ÙÓÔÁ×ÌÑÅÔÓÑ ÄÌÑ ÍÅÄÌÅÎÎÙÈ ÔÅÒÍÉÎÁÌÏ×, ÎÅ ÉÍÅÀÝÉÈ ËÏÍÁÎÄ ÓËÒÏÌÌÉÎÇÁ. .IP -nobackups üÔÁ ÏÐÃÉÑ ÚÁÐÒÅÝÁÅÔ ÓÏÚÄÁÎÉÅ ÆÁÊÌÏ× ÒÅÚÅÒ×ÎÙÈ ËÏÐÉÊ. .IP -nonotice üÔÁ ÏÐÃÉÑ ÚÁÐÒÅÝÁÅÔ ×Ù×ÏÄ ÉÎÆÏÒÍÁÃÉÉ Ï ËÏÐÉÒÁÊÔÅ ÐÒÉ ÚÁÐÕÓËÅ ÒÅÄÁËÔÏÒÁ. .IP -nosta üÔÁ ÏÐÃÉÑ ÚÁÐÒÅÝÁÅÔ ÏÔÏÂÒÁÖÅÎÉÅ ÓÔÒÏËÉ ÓÏÓÔÏÑÎÉÑ ××ÅÒÈÕ ÜËÒÁÎÁ. ðÏÎÁÄÏÂÉÔÓÑ, ÅÓÌÉ ×Ù ÈÏÔÉÔÅ ×ÉÄÅÔØ ÎÁ ÜËÒÁÎÅ ÔÏÌØËÏ ×ÁÛ ÔÅËÓÔ ÉÌÉ ÉÓÐÏÌØÚÕÅÔÅ vt52. .IP -noxon ðÙÔÁÅÔÓÑ ×ÙËÌÀÞÉÔØ ÏÂÒÁÂÏÔËÕ ^S/^Q. ðÏÌÅÚÎÏ, ËÏÇÄÁ JOE ÉÚÏÂÒÁÖÁÅÔ ÉÚ ÓÅÂÑ WordStar ÉÌÉ EMACS. .IP -orphan ëÏÇÄÁ ÄÁÎÎÁÑ ÏÐÃÉÑ ÁËÔÉ×ÎÁ, ÄÏÐÏÌÎÉÔÅÌØÎÙÅ ÆÁÊÌÙ × ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÅ ÂÕÄÕÔ ÐÏÍÅÝÁÔØÓÑ × ÓËÒÙÔÙÈ ÂÕÆÅÒÁÈ, Á ÎÅ × ÏÔÄÅÌØÎÙÈ ÏËÎÁÈ. ðÏÌÅÚÎÏ, ËÏÇÄÁ JOE ÉÚÏÂÒÁÖÁÅÔ ÉÚ ÓÅÂÑ EMACS. .IP -pg\ nnn ïÐÒÅÄÅÌÑÅÔ ËÏÌÉÞÅÓÔ×Ï ÓÔÒÏË, ÏÓÔÁ×ÌÑÅÍÙÈ ÎÁ ÜÒÁÎÅ ÐÏÓÌÅ PgUp/PgDn (^U/^V). åÓÌÉ ÕËÁÚÁÎÏ ÚÎÁÞÅÎÉÅ -1 - ÏÓÔÁÅÔÓÑ ÐÏÌ-ÜËÒÁÎÁ. .IP -skiptop\ nnn îÅ ÉÓÐÏÌØÚÏ×ÁÔØ ×ÅÒÈÎÉÅ nnn ÓÔÒÏË ÜËÒÁÎÁ. ðÏÌÅÚÎÏ, ËÏÇÄÁ joe ÉÓÐÏÌØÚÕÅÔÓÑ × ËÁÞÅÓÔ×Å BBS-ÒÅÄÁËÔÏÒÁ. .LP ëÁÖÄÁÑ ÉÚ ÜÔÉÈ ÏÐÃÉÊ ÍÏÖÅÔ ÔÁËÖÅ ÂÙÔØ ÏÐÒÅÄÅÌÅÎÁ × ÆÁÊÌÅ joerc. ëÒÏÍÅ ÔÏÇÏ, ÏÐÃÉÉ NOXON, BAUD, LINES, COLUMNS É DOPADDING ÍÏÇÕÔ ÂÙÔØ ÏÐÒÅÄÅÌÅÎÙ × ×ÉÄÅ ÐÅÒÅÍÅÎÎÙÈ ÓÒÅÄÙ. ðÅÒÅÍÅÎÎÁÑ ÓÒÅÄÙ JOETERM ÍÏÖÅÔ ÂÙÔØ ÕÓÔÁÎÏ×ÌÅÎÁ ÄÌÑ ÚÁÍÅÎÙ ÏÂÙÞÎÏÊ ÐÅÒÅÍÅÎÎÏÊ ÓÒÅÄÙ TERM ÄÌÑ ÏÐÒÅÄÅÌÅÎÉÑ ÔÉÐÁ ×ÁÛÅÇÏ ÔÅÒÍÉÎÁÌÁ. óÌÅÄÕÀÝÉÅ ÏÐÃÉÉ ÍÏÇÕÔ ÂÙÔØ ÕËÁÚÁÎÙ ÐÅÒÅÄ ËÁÖÄÙÍ ÉÍÅÎÅÍ ÆÁÊÌÁ × ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÅ: .IP +nnn ëÕÒÓÏÒ ÐÒÉ ÓÔÁÒÔÅ ÒÁÚÍÅÝÁÅÔÓÑ ÎÁ ÓÔÒÏËÅ Ó ÕËÁÚÁÎÎÙÍ ÎÏÍÅÒÏÍ. .IP -crlf Joe ÉÓÐÏÌØÚÕÅÔ CR-LF × ËÁÞÅÓÔ×Å ÚÁ×ÅÒÛÉÔÅÌÑ ÓÔÒÏËÉ ×ÍÅÓÔÏ ÐÒÏÓÔÏ LF. äÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ÆÁÊÌÏ× ÉÚ MS-DOS ÉÌÉ VMS. .IP -wordwrap Joe ÐÅÒÅÎÏÓÉÔ ÓÌÏ×Ï ÎÁ ÎÏ×ÕÀ ÓÔÒÏËÕ ÐÏ ÄÏÓÔÉÖÅÎÉÀ ÐÒÁ×ÏÇÏ ËÒÁÑ. .IP -autoindent ðÒÉ ÎÁÖÁÔÉÉ Enter × ËÏÎÃÅ ÓÔÒÏËÉ Ó ÏÔÓÔÕÐÏÍ ÜÔÏÔ ÏÔÓÔÕÐ ÐÅÒÅÎÏÓÉÔÓÑ × ÎÁÞÁÌÏ ÎÏ×ÏÊ ÓÔÒÏËÉ. .IP -overwrite ÷×ÏÄ ÚÁÍÅÝÁÅÔ ÓÕÝÅÓÔ×ÕÀÝÉÅ ÓÉÍ×ÏÌÙ, Á ÎÅ ×ÓÔÁ×ÌÑÅÔÓÑ ÐÅÒÅÄ ÎÉÍÉ. .IP -lmargin\ nnn õÓÔÁÎÁ×ÌÉ×ÁÅÔ ÌÅ×ÕÀ ÇÒÁÎÉÃÕ. .IP -rmargin\ nnn õÓÔÁÎÁ×ÌÉ×ÁÅÔ ÐÒÁ×ÕÀ ÇÒÁÎÉÃÕ. .IP -tab\ nnn õÓÔÁÎÁ×ÌÉ×ÁÅÔ ÛÉÒÉÎÕ ÔÁÂÕÌÑÃÉÉ. .IP -indentc\ nnn õÓÔÁÎÁ×ÌÉ×ÁÅÔ ÓÉÍ×ÏÌ ÚÁÐÏÌÎÅÎÉÑ ÄÌÑ ^K, É ^K. (32 - ðòïâåì, 9 - TAB). .IP -istep\ nnn õÓÔÁÎÁ×ÌÉ×ÁÅÔ ÛÁÇ ÐÅÒÅÍÅÝÅÎÉÑ ÄÌÑ ^K, É ^K.. .IP -linums ÷ ÎÁÞÁÌÅ ËÁÖÄÏÊ ÓÔÒÏËÉ ×Ù×ÏÄÉÔÓÑ ÅÅ ÎÏÍÅÒ. .IP -rdonly ôÏÌØËÏ ÞÉÔÁÔØ ÆÁÊÌ. .IP -keymap\ name éÓÐÏÌØÚÏ×ÁÔØ ÁÌØÔÅÒÎÁÔÉ×ÎÕÀ ÓÅËÃÉÀ ÆÁÊÌÁ joerc ÄÌÑ ÏÐÒÅÄÅÌÅÎÉÑ ËÌÁ×ÉÁÔÕÒÎÙÈ ÕÐÒÁ×ÌÑÀÝÉÈ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÅÊ. .LP üÔÉ ÏÐÃÉÉ ÔÁËÖÅ ÍÏÇÕÔ ÂÙÔØ ÏÐÒÅÄÅÌÅÎÙ × ÆÁÊÌÅ joerc. ïÎÉ ÍÏÇÕÔ ÂÙÔØ ÕÓÔÁÎÏ×ÌÅÎÙ × ÚÁ×ÉÓÉÍÏÓÔÉ ÏÔ ÒÁÓÛÉÒÅÎÉÑ ÉÍÅÎÉ ÆÁÊÌÁ. äÌÑ ÐÒÏÇÒÁÍÍ (Ó ÒÁÓÛÉÒÅÎÉÑÍÉ .c, .h ÉÌÉ .p) ÏÂÙÞÎÏ ×ËÌÀÞÁÅÔÓÑ Á×ÔÏÏÏÔÓÔÕÐ. ðÅÒÅÎÏÓ ÓÌÏ× ÒÁÚÒÅÛÅÎ ÄÌÑ ×ÓÅÈ ÐÒÏÞÉÈ ÆÁÊÌÏ×, ËÒÏÍÅ ÉÎÉÃÉÁÌÉÚÁÃÉÏÎÎÙÈ rc-ÆÁÊÌÏ×. .SH òÅÄÁËÔÉÒÏ×ÁÎÉÅ .SS ïÓÎÏ×Ù ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ëÏÇÄÁ ×Ù ××ÏÄÉÔÅ ÓÉÍ×ÏÌÙ × ÒÅÄÁËÔÏÒÅ, ÏÎÉ ÏÂÙÞÎÏ ×ÓÔÁ×ÌÑÀÔÓÑ × ÒÅÄÁËÔÉÒÕÅÍÙÊ ÆÁÊÌ (ÉÌÉ ÄÏÂÁ×ÌÑÀÔÓÑ Ë ÎÅÍÕ, ÅÓÌÉ ËÕÒÓÏÒ ÓÔÏÉÔ × ËÏÎÃÅ ÆÁÊÌÁ). üÔÏ - ÎÏÒÍÁÌØÎÙÊ ÒÅÖÉÍ ÒÁÂÏÔÙ ÒÅÄÁËÔÏÒÁ. åÓÌÉ ×Ù ÈÏÔÉÔÅ ÚÁÍÅÎÉÔØ ÎÅËÏÔÏÒÙÊ ÓÕÝÅÓÔ×ÕÀÝÉÊ ÔÅËÓÔ - ÍÏÖÅÔÅ ÕÄÁÌÉÔØ ÅÇÏ ÄÏ ÉÌÉ ÐÏÓÌÅ ××ÏÄÁ ÎÏ×ÏÇÏ ÔÅËÓÔÁ. äÌÑ ÕÄÁÌÅÎÉÑ ÔÅËÓÔÁ ÍÏÖÅÔ ÉÓÐÏÌØÚÏ×ÁÔØÓÑ ËÌÁ×ÉÛÁ \fBBackspace\fR: ÐÏÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÓÐÒÁ×Á ÏÔ ÔÅËÓÔÁ, ËÏÔÏÒÙÊ ÔÒÅÂÕÅÔÓÑ ÕÄÁÌÉÔØ É ÎÁÖÍÉÔÅ \fBBackspace\fR ÎÕÖÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÒÁÚ. îÁÖÁÔÉÅ \fBEnter\fR ÉÌÉ \fBReturn\fR ×ÙÚÙ×ÁÅÔ ×ÓÔÁ×ËÕ ÒÁÚÒÙ×Á ÓÔÒÏËÉ. îÁÐÒÉÍÅÒ, ÅÓÌÉ ËÕÒÓÏÒ ÎÁÈÏÄÉÌÓÑ ×ÓÅÒÅÄÉÎÅ ÓÔÒÏËÉ É ×Ù ÎÁÖÁÌÉ \fBEnter\fR, ÜÔÁ ÓÔÒÏËÁ ÂÕÄÅÔ ÒÁÚÒÅÚÁÎÁ ÎÁ Ä×Å, É ËÕÒÓÏÒ ÂÕÄÅÔ ÎÁÈÏÄÉÔØÓÑ ×ÎÁÞÁÌÅ ×ÔÏÒÏÊ ÓÔÒÏËÉ. îÁÖÁÔÉÅ \fBBackspace\fR × ÎÁÞÁÌÅ ÓÔÒÏËÉ ÐÒÉ×ÅÄÅÔ Ë ÕÄÁÌÅÎÉÀ ÐÒÅÄÙÄÕÝÅÇÏ ÒÁÚÒÙ×Á ÓÔÒÏËÉ. äÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÐÏ ÆÁÊÌÕ ÉÓÐÏÌØÚÕÊÔÅ ËÌÁ×ÉÛÉ ÓÔÒÅÌÏË. åÓÌÉ ÎÁ ×ÁÛÅÊ ËÌÁ×ÉÁÔÕÒÅ ÔÁËÉÈ ËÌÁ×ÉÛ ÎÅÔ (ÉÌÉ ÏÎÉ ÐÏÞÅÍÕ-ÔÏ ÎÅ ÒÁÂÏÔÁÀÔ) - ÉÓÐÏÌØÚÕÊÔÅ \fB^F\fR ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ×ÐÅÒÅÄ (×ÐÒÁ×Ï), \fB^B\fR - ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÎÁÚÁÄ (×ÌÅ×Ï), \fB^P\fR - ÎÁ ÐÒÅÄÙÄÕÝÕÀ ÓÔÒÏËÕ (××ÅÒÈ), É \fB^N\fR - ÎÁ ÓÌÅÄÕÀÝÕÀ (×ÎÉÚ). ëÌÁ×ÉÛÉ ÓÔÒÅÌÏË ×ÐÒÁ×Ï É ×ÌÅ×Ï ÐÒÏÓÔÏ ÐÅÒÅÍÅÝÁÀÔ ËÕÒÓÏÒ ÎÁ ÏÄÉÎ ÓÉÍ×ÏÌ ×ÐÒÁ×Ï ÉÌÉ ×ÌÅ×Ï ÐÏ ÔÅËÓÔÕ ÚÁ ÒÁÚ: ÅÓÌÉ ×Ù ÎÁÈÏÄÉÔÅÓØ × ÎÁÞÁÌÅ ÓÔÒÏËÉ É ÎÁÖÍÅÔÅ ÓÔÒÅÌËÕ ×ÌÅ×Ï - ÔÏ ÏËÁÖÅÔÅÓØ × ËÏÎÃÅ ÐÒÅÄÙÄÕÝÅÊ ÓÔÒÏËÉ. îÁÖÁÔÉÅ ËÌÁ×ÉÛ ÓÔÒÅÌÏË ××ÅÒÈ É ×ÎÉÚ ×ÙÚÙ×ÁÅÔ ÐÅÒÅÍÅÝÅÎÉÅ ËÕÒÓÏÒÁ ÎÁ ÓÔÏÌØËÏ ÓÉÍ×ÏÌÏ×, ÞÔÏÂÙ ÏËÁÚÁÔØÓÑ × ÔÏÊ ÖÅ ÐÏÚÉÃÉÉ ÐÒÅÄÙÄÕÝÅÊ ÉÌÉ ÐÏÓÌÅÄÕÀÝÅÊ ÓÔÒÏËÉ, × ËÏÔÏÒÏÊ ÎÁÈÏÄÉÌÉÓØ × ÉÓÈÏÄÎÏÊ ÓÔÒÏËÅ. åÓÌÉ ×Ù ÖÅÌÁÅÔÅ ÓÄÅÌÁÔØ ÏÔÓÔÕÐ ÐÅÒÅÄ ××ÏÄÏÍ ÔÅËÓÔÁ - ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ËÌÁ×ÉÛÕ \fBTAB\fR. ïÎÁ ×ÓÔÁ×ÌÑÅÔ × ÔÅËÓÔ ÓÐÅÃÉÁÌØÎÙÊ ÕÐÒÁ×ÌÑÀÝÉÊ ÓÉÍ×ÏÌ, ËÏÔÏÒÙÊ ÚÁÓÔÁ×ÌÑÅÔ ÓÌÅÄÕÀÝÉÅ ÚÁ ÎÉÍ ÓÉÍ×ÏÌÙ ××ÏÄÉÔØÓÑ Ó ÎÁÞÁÌÁ ÓÌÅÄÕÀÝÅÇÏ ÔÁÂÕÌÏÓÔÏÐÁ (TAB STOP). ôÁÂÕÌÏÓÔÏÐÙ ÏÂÙÞÎÏ ÒÁÓÐÏÌÁÇÁÀÔÓÑ ÞÅÒÅÚ ËÁÖÄÙÅ 8 ÐÏÚÉÃÉÊ, ÎÏ ÜÔÏ ÍÏÖÅÔ ÂÙÔØ ÉÚÍÅÎÅÎÏ Ó ÐÏÍÏÝØÀ ËÏÍÁÎÄÙ \fB^T D\fR. ðÒÏÇÒÁÍÍÉÓÔÙ ÎÁ ÑÚÙËÁÈ PASCAL É C ÞÁÓÔÏ ÒÁÓÐÏÌÁÇÁÀÔ ÔÁÂÕÌÏÓÔÏÐÙ × ËÁÖÄÏÊ 4-ÏÊ ÐÏÚÉÃÉÉ. åÓÌÉ ÐÏ ËÁËÉÍ-ÌÉÂÏ ÐÒÉÞÉÎÁÍ ÜËÒÁÎ ×ÁÛÅÇÏ ÔÅÒÍÉÎÁÌÁ ÓÂÉ×ÁÅÔÓÑ (ÎÁÐÒÉÍÅÒ, ÐÒÉ ÐÏÌÕÞÅÎÉÉ ÓÏÏÂÝÅÎÉÑ Ï ÐÒÉÂÙÔÉÉ ÐÏÞÔÙ ÏÔ ÐÒÏÇÒÁÍÍÙ biff), ×Ù ÍÏÖÅÔÅ ÐÏÔÒÅÂÏ×ÁÔØ ÏÔ ÒÅÄÁËÔÏÒÁ ÐÅÒÅÒÉÓÏ×ÁÔØ ÜËÒÁÎ - ÎÁÖÁÔÉÅÍ \fB^R\fR. éÍÅÀÔÓÑ É ÄÒÕÇÉÅ ËÏÍÁÎÄÙ ÄÌÑ ÕÄÁÌÅÎÉÑ ÔÅËÓÔÁ É ÐÅÒÅÍÅÝÅÎÉÑ ÐÏ ÆÁÊÌÕ. îÁÐÒÉÍÅÒ, ÍÏÖÎÏ ÎÁÖÁÔØ \fB^D\fR ÄÌÑ ÕÄÁÌÅÎÉÑ ÓÉÍ×ÏÌÁ × ÐÏÚÉÃÉÉ ËÕÒÓÏÒÁ ×ÍÅÓÔÏ ÕÄÁÌÅÎÉÑ ÎÁÚÁÄ, ËÁË ÜÔÏ ÄÅÌÁÅÔ ËÌÁ×ÉÛÁ \fBBackspace\fR. \fB^D\fR ÔÁËÖÅ ÕÄÁÌÑÅÔ ÒÁÚÒÙ× ÓÔÒÏËÉ, ÅÓÌÉ ËÕÒÓÏÒ ÎÁÈÏÄÉÔÓÑ × ËÏÎÃÅ ÓÔÒÏËÉ. îÁÖÍÉÔÅ \fB^Y\fR ÄÌÑ ÕÄÁÌÅÎÉÑ ×ÓÅÊ ÓÔÒÏËÉ × ÐÏÚÉÃÉÉ ËÕÒÓÏÒÁ ÉÌÉ \fB^J\fR ÄÌÑ ÕÄÁÌÅÎÉÑ ÏÔ ËÕÒÓÏÒÁ ÄÏ ËÏÎÃÁ ÓÔÒÏËÉ. îÁÖÍÉÔÅ \fB^A\fR ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ × ÎÁÞÁÌÏ ÔÅËÕÝÅÊ ÓÔÒÏËÉ. îÁÖÍÉÔÅ \fB^E\fR ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ × ËÏÎÅà ÓÔÒÏËÉ. îÁÖÁÔÉÅ \fB^U\fR ÉÌÉ \fB^V\fR ÐÒÉ×ÅÄÅÔ Ë ÓËÒÏÌÌÉÒÏ×ÁÎÉÀ ÎÁ ÐÏÌÜËÒÁÎÁ ××ÅÒÈ ÉÌÉ ×ÎÉÚ. "óËÒÏÌÌÉÒÏ×ÁÎÉÅ ÏÂÏÚÎÁÞÁÅÔ, ÞÔÏ ÞÔÏ ÔÅËÓÔ ÎÁ ÜËÒÁÎÅ ÐÅÒÅÍÅÝÁÅÔÓÑ, ÎÏ ËÕÒÓÏÒ ÏÓÔÁÅÔÓÑ × ÏÄÎÏÊ É ÔÏÊ ÖÅ ÐÏÚÉÃÉÉ ÏÔÎÏÓÉÔÅÌØÎÏ ÜËÒÁÎÁ. îÁÖÍÉÔÅ \fB^K U\fR ÉÌÉ \fB^K V\fR ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ × ÎÁÞÁÌÏ ÉÌÉ ËÏÎÅà ÆÁÊÌÁ. äÒÕÇÉÅ ËÏÍÁÎÄÙ ÕÄÁÌÅÎÉÑ É ÐÅÒÅÍÅÝÅÎÉÑ ×Ù ÍÏÖÅÔÅ ÎÁÊÔÉ ÎÁ ÜËÒÁÎÅ ÐÏÄÓËÁÚËÉ ÒÅÄÁËÔÏÒÁ. åÓÌÉ ×Ù ÓÄÅÌÁÌÉ ÏÛÉÂËÕ - ÍÏÖÅÔÅ ÏÔÍÅÎÉÔØ ÐÏÓÌÅÄÎÅÅ ÄÅÊÓÔ×ÉÅ ÎÁÖÁÔÉÅÍ \fB^_\fR. îÁ ÂÏÌØÛÉÎÓÔ×Å ËÌÁ×ÉÁÔÕÒ ×ÁÍ ÐÏÔÒÅÂÕÅÔÓÑ ÐÒÏÔÏ ÎÁÖÁÔØ \fB^-\fR ÄÌÑ ÐÏÌÕÞÅÎÉÑ \fB^_\fR, ÎÏ ÎÁ ÎÅËÏÔÏÒÙÈ ×ÁÍ ÐÏÎÁÄÏÂÉÔÓÑ ÄÌÑ ÜÔÏÇÏ ÏÄÎÏ×ÒÅÍÅÎÎÏ ÕÄÅÒÖÉ×ÁÔØ \fBShift\fR É \fBControl\fR. åÓÌÉ ×Ù ÓÌÕÞÁÊÎÏ ×ÁÐÏÌÎÉÌÉ ÓÌÉÛËÏÍ ÍÎÏÇÏ ÏÔÍÅÎ - ÍÏÖÎÏ ÏÔÍÅÎÉÔØ ÐÒÅÄÙÄÕÝÕÀ ÏÔÍÅÎÕ ÐÏ ÎÁÖÁÔÉÀ \fB^^\fR (ÄÌÑ ÜÔÏÇÏ ÎÁ ÂÏÌØÛÉÎÓÔ×Å ËÌÁ×ÉÁÔÕÒ ÓÌÅÄÕÅÔ ÐÒÏÓÔÏ ÎÁÖÁÔØ \fB^6\fR). åÓÌÉ ×Ù ÎÁÈÏÄÉÔÅÓØ × ÏÄÎÏÊ ÐÏÚÉÃÉÉ ÆÁÊÌÁ, Á ÎÅÏÂÈÏÄÉÍÏ ×ÒÅÍÅÎÎÏ ÐÒÏÓÍÏÔÒÅÔØ ÉÌÉ ÏÔÒÅÄÁËÔÉÒÏ×ÁÔØ ÄÒÕÇÏÊ ÕÞÁÓÔÏË ÔÅËÓÔÁ - ×Ù ÓÍÏÖÅÔÅ ×ÅÒÎÕÔØÓÑ × ÉÓÈÏÄÎÕÀ ÐÏÚÉÃÉÀ ÐÏ ÎÁÖÁÔÉÀ \fB^K -\fR. üÔÁ ËÏÍÁÎÄÁ ×ÏÚ×ÒÁÔÉÔ ×ÁÓ × ÔÏ ÍÅÓÔÏ, ÇÄÅ ÂÙÌÉ ×ÙÐÏÌÎÅÎÙ ÐÏÓÌÅÄÎÉÅ ÉÚÍÅÎÅÎÉÑ × ÆÁÊÌÅ. ÷Ù ÍÏÖÅÔÅ ÐÅÒÅÍÅÝÁÔØÓÑ ÐÏ ÍÅÓÔÁÍ ÉÚÍÅÎÅÎÉÊ Ó ÐÏÍÏÝØÀ \fB^K -\fR É \fB^K =\fR, ÔÁË ÖÅ, ËÁË ×ÄÏÌØ ÉÓÔÏÒÉÉ ÉÚÍÅÎÅÎÉÊ Ó ÐÏÍÏÝØÀ ËÏÍÁÎÄ "ÏÔÍÅÎÁ" É "ÏÔÍÅÎÁ ÏÔÍÅÎÙ". ëÏÇÄÁ ×Ù ÚÁËÏÎÞÉÔÅ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ ÆÁÊÌÁ - ÎÁÖÍÉÔÅ \fB^K X\fR ÄÌÑ ×ÙÈÏÄÁ ÉÚ ÒÅÄÁËÔÏÒÁ. åÓÌÉ ×Ù ÎÅ ÒÅÄÁËÔÉÒÏ×ÁÌÉ ÒÁÎÅÅ ÓÕÝÅÓÔ×Ï×Á×ÛÉÊ ÆÁÊÌ - Õ ×ÁÓ ÂÕÄÅÔ ÚÁÐÒÏÛÅÎÏ ÉÍÑ, ÐÏÄ ËÏÔÏÒÙÍ ×Ù ÈÏÔÉÔÅ ÜÔÏÔ ÆÁÊÌ ÓÏÈÒÁÎÉÔØ. ëÏÇÄÁ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÆÁÊÌ - × ÄÅÊÓÔ×ÉÔÅÌØÎÏÓÔÉ ÉÚÍÅÎÅÎÉÀ ÐÏÄ×ÅÒÇÁÅÔÓÑ ÔÏÌØËÏ ÅÇÏ ËÏÐÉÑ. ôÁË ÞÔÏ ÅÓÌÉ ×Ù ÒÅÛÉÔÅ, ÞÔÏ ÉÚÍÅÎÅÎÉÑ, ÓÄÅÌÁÎÎÙÅ ×Ï ×ÒÅÍÑ ÄÁÎÎÏÇÏ ÓÅÁÎÓÁ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ, ×ÁÍ ÎÅ ÎÕÖÎÙ - ÍÏÖÅÔÅ ÎÁÖÁÔØ \fB^C\fR ÄÌÑ ×ÙÈÏÄÁ ÉÚ ÒÅÄÁËÔÏÒÁ ÂÅÚ ÉÈ ÓÏÈÒÁÎÅÎÉÑ. åÓÌÉ ×Ù ÏÔÒÅÄÁËÔÉÒÏ×ÁÌÉ ÆÁÊÌ É ÓÏÈÒÁÎÉÌÉ ÉÚÍÅÎÅÎÉÑ - × ÔÅËÕÝÅÊ ÄÉÒÅËÔÏÒÉÉ ÂÕÄÅÔ ÓÏÚÄÁÎÁ ÒÅÚÅÒ×ÎÁÑ ËÏÐÉÑ ("backup"), ÉÍÑ ËÏÔÏÒÏÊ ÆÏÒÍÉÒÕÅÔÓÑ ÐÕÔÅÍ ÄÏÂÁ×ÌÅÎÉÑ ÓÉÍ×ÏÌÁ ~ × ËÏÎÅà ÉÍÅÎÉ ÒÅÄÁËÔÉÒÕÅÍÏÇÏ ÆÁÊÌÁ, É ÓÏÄÅÒÖÁÝÁÑ ÉÓÈÏÄÎÕÀ ×ÅÒÓÉÀ ÜÔÏÇÏ ÆÁÊÌÁ. .SS ðÅÒÅÎÏÓÙ É ÆÏÒÍÁÔÉÒÏ×ÁÎÉÅ åÓÌÉ ×Ù ÂÕÄÅÔÅ ××ÏÄÉÔØ ÎÁ ÐÒÁ×ÏÍ ËÒÁÀ ÜËÒÁÎÁ ÎÁ ÐÒÏÇÒÁÍÍÕ ÎÁ ÑÚÙËÅ C ÉÌÉ PASCAL - ÜËÒÁÎ ÂÕÄÅÔ ÓËÒÏÌÌÉÒÏ×ÁÔØÓÑ ×ÐÒÁ×Ï ÄÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÕÄÅÒÖÉ×ÁÔØ ÎÁ ÎÅÍ ÔÅËÕÝÅÅ ÐÏÌÏÖÅÎÉÅ ËÕÒÓÏÒÁ. åÓÌÉ ×Ù ÂÕÄÅÔÅ ××ÏÄÉÔØ ÎÁ ÐÒÁ×ÏÍ ËÒÁÀ ÄÁÎÎÙÅ × ÏÂÙÞÎÙÊ ÆÁÊÌ (ÉÍÑ ËÏÔÏÒÏÇÏ ÎÅ ÚÁËÎÞÉ×ÁÅÔÓÑ ÎÉ ÎÁ .c, ÎÉ ÎÁ .h ÉÌÉ .p), JOE Á×ÔÏÍÁÔÉÞÅÓËÉ ÐÅÒÅÎÅÓÅÔ ÐÏÓÌÅÄÎÅÅ ÓÌÏ×Ï ÎÁ ÓÌÅÄÕÀÝÕÀ ÓÔÒÏËÕ, ÔÁË ÞÔÏ ×ÁÍ ÎÅ ÏÂÑÚÁÔÅÌØÎÏ ÎÁÖÉÍÁÔØ \fBEnter\fR. üÔÏ ÎÁÚÙ×ÁÅÔÓÑ ÒÅÖÉÍÏÍ Á×ÔÏÐÅÒÅÎÏÓÁ. ðÅÒÅÎÏÓ ÓÌÏ× ÍÏÖÅÔ ÂÙÔØ ÒÁÚÒÅÛÅÎ ÉÌÉ ÚÁÐÒÅÝÅÎ Ó ÐÏÍÏÝØÀ ËÏÍÁÎÄÙ \fB^T W\fR . éÎÉÃÉÁÌÉÚÁÃÉÏÎÎÙÊ ÆÁÊÌ JOE ÏÂÙÞÎÏ ÎÁÓÔÒÁÉ×ÁÅÔÓÑ ÔÁË, ÞÔÏÂÙ ÜÔÏÔ ÒÅÖÉÍ ×ËÌÀÞÁÌÓÑ ÄÌÑ ×ÓÅÈ ÆÁÊÌÏ×, ÎÅ Ñ×ÌÑÀÝÉÈÓÑ ÔÅËÓÔÁÍÉ ÐÒÏÇÒÁÍÍ. óÍÏÔÒÉÔÅ ÎÉÖÅ ÒÁÚÄÅÌ \fBjoerc\fR - ËÁË ÉÚÍÅÎÑÔØ ÜÔÏ É ÄÒÕÇÉÅ ÕÍÏÌÞÁÎÉÑ. úÁ ÉÓËÌÀÞÅÎÉÅÍ ÓÌÕÞÁÑ ÒÅÖÉÍÁ Á×ÔÏÐÅÒÅÎÏÓÁ, JOE ÎÅ ÈÒÁÎÉÔ ÁÂÚÁÃÙ ÏÔÆÏÒÍÁÔÉÒÏ×ÁÎÎÙÍÉ, ËÁË ÜÔÏ ÄÅÌÁÀÔ ÎÅËÏÔÏÒÙÅ ÔÅËÓÔÏ×ÙÅ ÐÒÏÃÅÓÓÏÒÙ. ÷ÍÅÓÔÏ ÜÔÏÇÏ ÅÓÌÉ ×ÁÍ ÐÏÔÒÅÂÕÅÔÓÑ ÏÔÆÏÒÍÁÔÉÒÏ×ÁÔØ ÁÂÚÁà - ÎÁÖÍÉÔÅ \fB^K J\fR. äÁÎÎÁÑ ËÏÍÁÎÄÁ "×ÙÒÁ×ÎÉ×ÁÅÔ" ÁÂÚÁÃ, × ËÏÔÏÒÏÍ ÎÁÈÏÄÉÔÓÑ ËÕÒÓÏÒ, ÐÙÔÁÑÓØ ÒÁÚÍÅÓÔÉÔØ × ÏÄÎÏÊ ÓÔÒÏËÅ ÓÔÏÌØËÏ ÓÌÏ×, ÓËÏÌØËÏ ×ÏÚÍÏÖÎÏ. ÷ ÄÁÎÎÏÍ ÓÌÕÞÁÅ ÁÂÚÁÃÅÍ ÓÞÉÔÁÅÔÓÑ ÞÁÓÔØ ÔÅËÓÔÁ, ÏÇÒÁÎÉÞÅÎÎÁÑ Ó×ÅÒÈÕ É ÓÎÉÚÕ ÐÕÓÔÙÍÉ ÓÔÒÏËÁÍÉ. çÒÁÎÉÃÙ, × ËÏÔÏÒÙÈ JOE ×ÙÐÏÌÎÑÅÔ ÆÏÒÍÁÔÉÒÏ×ÁÎÉÅ ÁÂÚÁÃÁ É Á×ÔÏÐÅÒÅÎÏÓ ÓÌÏ×, ÍÏÇÕÔ ÂÙÔØ ÕÓÔÁÎÏ×ÌÅÎÙ Ó ÐÏÍÏÝØÀ ËÏÍÁÎÄ \fB^T L\fR É \fB^T R\fR. åÓÌÉ ÌÅ×ÁÑ ÇÒÁÎÉÃÁ ÕÓÔÁÎÏ×ÌÅÎÁ × ÚÎÁÞÅÎÉÅ, ÏÔÌÉÞÎÏÅ ÏÔ 1, ÔÏ ËÏÄÁ ×Ù ÎÁÞÉÎÁÅÔÅ ××ÏÄÉÔØ ÄÁÎÎÙÅ Ó ÎÁÞÁÌÁ ÓÔÒÏËÉ - ËÕÒÓÏÒ ÓÒÁÚÕ ÐÅÒÅÐÒÙÇÎÅÔ ÎÁ ÕËÁÚÁÎÎÕÀ ÌÅ×ÕÀ ÇÒÁÎÉÃÕ. åÓÌÉ ×Ù ÖÅÌÁÅÔÅ ÃÅÎÔÒÉÒÏ×ÁÔØ ÓÔÒÏËÕ × ÕËÁÚÁÎÎÙÈ ÇÒÁÎÉÃÁÈ - ÉÓÐÏÌØÚÕÊÔÅ ËÏÍÁÎÄÕ \fB^K A\fR. .SS òÅÖÉÍ ÚÁÍÅÝÅÎÉÑ éÎÏÇÄÁ ÕÔÏÍÉÔÅÌØÎÏ ÕÄÁÌÑÔØ ÓÔÁÒÙÊ ÔÅËÓÔ ÐÅÒÅÄ ×ÓÔÁ×ËÏÊ ÎÏ×ÏÇÏ ÉÌÉ ÐÏÓÌÅ ÎÅÅ. üÔÏ ÓÌÕÞÁÅÔÓÑ, ÎÁÐÒÉÍÅÒ, ËÏÇÄÁ ×Ù ÚÁÐÏÌÎÑÅÔÅ ÄÁÎÎÙÅ × ÔÁÂÌÉÃÅ É ×ÙÎÕÖÄÅÎÙ ÓÌÅÄÉÔØ ÚÁ ÐÏÌÏÖÅÎÉÅÍ ÐÒÁ×ÏÇÏ ËÒÁÑ ÜÔÏÊ ÔÁÂÌÉÃÙ. ÷ ÔÁËÉÈ ÓÌÕÞÁÑÈ ×Ù ÍÏÖÅÔÅ ÐÅÒÅ×ÅÓÔÉ ÒÅÄÁËÔÏÒ × ÒÅÖÉÍ ÚÁÍÅÝÅÎÉÑ Ó ÐÏÍÏÝØÀ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÉ \fB^T T\fR. åÓÌÉ ×Ù ÎÁÈÏÄÉÔÅÓØ × ÄÁÎÎÏÍ ÒÅÖÉÍÅ - ××ÏÄÉÍÙÅ ÓÉÍ×ÏÌÙ ÚÁÍÅÝÁÀÔ ÓÏÂÏÊ ÓÕÝÅÓÔ×ÕÀÝÉÅ. ëÒÏÍÅ ÔÏÇÏ, \fBBackspace\fR ÐÒÏÓÔÏ ×ÙÐÏÌÎÑÅÔ ÐÅÒÅÍÅÝÅÎÉÅ ×ÌÅ×Ï ×ÍÅÓÔÏ ÕÄÁÌÅÎÉÑ ÒÁÓÐÏÌÏÖÅÎÎÏÇÏ ÔÁÍ ÓÉÍ×ÏÌÁ, ÅÓÌÉ ËÕÒÓÏÒ ÎÁÈÏÄÉÌÓÑ ÎÅ × ËÏÎÃÅ É ÎÅ × ÎÁÞÁÌÅ ÓÔÒÏËÉ. òÅÖÉÍ ÚÁÍÅÝÅÎÉÑ ÎÅ Ñ×ÌÑÅÔÓÑ ÏÂÝÅÐÒÉÎÑÔÙÍ ÐÒÉ ÜÌÅËÔÒÏÎÎÏÊ ÏÂÒÁÂÏÔËÅ ÔÅËÓÔÏ×, ÐÏÜÔÏÍÕ ÒÅËÏÍÅÎÄÕÅÔÓÑ ×ÅÒÎÕÔØÓÑ Ë ÒÅÖÉÍÕ ×ÓÔÁ×ËÉ ÔÁË ÓËÏÒÏ, ËÁË ÜÔÏ ×ÏÚÍÏÖÎÏ, ÎÁÖÁ× \fB^T T\fR ÅÝÅ ÒÁÚ. åÓÌÉ ×ÁÍ ÎÅÏÂÈÏÄÉÍÏ ×ÙÐÏÌÎÉÔØ ×ÓÔÁ×ËÕ ×Ï ×ÒÅÍÑ ÎÁÈÏÖÄÅÎÉÑ × ÒÅÖÉÍÅ ÚÁÍÅÝÅÎÉÑ - ÎÁÖÍÉÔÅ \fB^@\fR. üÔÏ ÐÒÉ×ÅÄÅÔ Ë ×ÓÔÁ×ËÅ × ÔÅËÓÔ ÏÄÉÎÏÞÎÏÇÏ ðòïâåìá. .SS õÐÒÁ×ÌÑÀÝÉÅ É íÅÔÁ- ÓÉÍ×ÏÌÙ ëÁÖÄÙÊ ÓÉÍ×ÏÌ ÐÒÅÄÓÔÁ×ÌÑÅÔÓÑ ÎÅËÏÔÏÒÙÍ ÞÉÓÌÏ×ÙÍ ËÏÄÏÍ. îÁÐÒÉÍÅÒ, ËÏÄÏÍ ÓÉÍ×ÏÌÁ 'A' Ñ×ÌÑÅÔÓÑ 65, Á ËÏÄ '1' - 49. ÷ÓÅ ÓÉÍ×ÏÌÙ, ËÏÔÏÒÙÅ ×Ù ÏÂÙÞÎÏ ×ÉÄÉÔÅ, ÉÍÅÀÔ ËÏÄÙ × ÄÉÁÐÁÚÏÎÅ 32 - 126 (ÄÁÎÎÏÅ ÓÏÏÔ×ÅÔÓÔ×ÉÅ ÍÅÖÄÕ ÓÉÍ×ÏÌÁÍÉ É ÉÈ ËÏÄÁÍÉ ÎÁÚÙ×ÁÅÔÓÑ ÓÉÍ×ÏÌØÎÙÍ ÎÁÂÏÒÏÍ ASCII). ëÏÄÙ ×ÎÅ ÜÔÏÇÏ ÄÉÁÐÁÚÏÎÁ, ÏÔ 0 ÄÏ 255, ÏÂÙÞÎÏ ÎÅ ÏÔÏÂÒÁÖÁÀÔÓÑ, ÎÏ ÉÎÏÇÄÁ ÉÍÅÀÔ ÎÅËÏÔÏÒÏÅ ÓÐÅÃÉÁÌØÎÏÅ ÚÎÁÞÅÎÉÅ. óÉÍ×ÏÌ Ó ËÏÄÏÍ 10, ÎÁÐÒÉÍÅÒ, ÉÓÐÏÌØÚÕÅÔÓÑ ÄÌÑ ÏÂÏÚÎÁÞÅÎÉÑ ËÏÎÃÁ ÓÔÒÏËÉ. ÷Ù ÍÏÖÅÔÅ ××ÅÓÔÉ ÜÔÉ ÎÅÏÔÏÂÒÁÖÁÅÍÙÅ \fBÕÐÒÁ×ÌÑÀÝÉÅ ÓÉÍ×ÏÌÙ\fR, ÎÁÖÁ× ÓÎÁÞÁÌÁ \fB`\fR, Á ÚÁÔÅÍ - ××ÅÄÑ ÓÉÍ×ÏÌ ÉÚ ÄÉÁÐÁÚÏÎÁ \fB@ A B C ... X Y Z [ ^ ] \e _\fR ÄÌÑ ÐÏÌÕÞÅÎÉÑ ËÏÄÏ× 0 - 31, É ? ÄÌÑ ÐÏÌÕÞÅÎÉÑ 127. îÁÐÒÉÍÅÒ, ÅÓÌÉ ×Ù ÎÁÖÍÅÔÅ \fB` J\fR - ×ÙÐÏÌÎÉÔÓÑ ×ÓÔÁ×ËÁ ÓÉÍ×ÏÌÁ ÒÁÚÒÙ×Á ÓÔÒÏËÉ, Á ÅÓÌÉ ÎÁÖÍÅÔÅ \fB` I\fR - ×ÓÔÁ×ÉÔÓÑ ÓÉÍ×ÏÌ ÔÁÂÕÌÑÃÉÉ (ÔÏ ÖÅ ÓÁÍÏÅ ÄÅÌÁÅÔ ËÌÁ×ÉÛÁ TAB). ðÏÌÅÚÎÙÊ ÕÐÒÁ×ÌÑÀÝÉÊ ÓÉÍ×ÏÌ - 12 (\fB` L\fR), ËÏÔÏÒÙÊ ÚÁÓÔÁ×ÌÑÅÔ ÂÏÌØÛÉÎÓÔ×Ï ÐÒÉÎÔÅÒÏ× ×ÙÐÏÌÎÉÔØ ÐÒÏÇÏÎ ÓÔÒÁÎÉÃÙ. ÷Ù ÓÍÏÖÅÔÅ ÚÁÍÅÔÉÔØ, ÞÔÏ JOE ×Ù×ÏÄÉÔ ÜÔÏÔ ÓÉÍ×ÏÌ ËÁË ÐÏÄÞÅÒËÎÕÔÏÅ L. ÷Ù ÍÏÖÅÔÅ ××ÏÄÉÔØ ÓÉÍ×ÏÌÙ Ó ËÏÄÁÍÉ ÂÏÌÅÅ 127, ÎÁÚÙ×ÁÅÍÙÅ \fBÍÅÔÁ-ÓÉÍ×ÏÌÁÍÉ\fR, ÎÁÖÁ× ÓÐÅÒ×Á \fB^\e\fR. üÔÏ ÄÏÂÁ×ÉÔ 128 Ë ËÏÄÕ ÓÌÅÄÕÀÝÅÇÏ (×ÏÚÍÏÖÎÏ ÕÐÒÁ×ÌÑÀÝÅÇÏ) ××ÅÄÅÎÎÏÇÏ ÓÉÍ×ÏÌÁ. JOE ×Ù×ÏÄÉÔ ÓÉÍ×ÏÌÙ Ó ËÏÄÁÍÉ ÂÏÌØÛÉÍÉ, ÞÅÍ 128, × ÉÎ×ÅÒÓÎÏÍ ÉÚÏÂÒÁÖÅÎÉÉ. ÷ ÎÅËÏÔÏÒÙÈ ÑÚÙËÁÈ, ÉÍÅÀÝÉÈ ÂÏÌØÛÅ ÓÉÍ×ÏÌÏ×, ÞÅÍ × ÁÎÇÌÉÊÓËÏÍ, ÍÅÔÁÓÉÍ×ÏÌÙ ÉÓÐÏÌØÚÕÀÔÓÑ ÄÌÑ ÏÓÔÁÌØÎÙÈ ÂÕË× ÉÈÎÅÇÏ ÁÌÆÁ×ÉÔÁ. ÷ÁÍ ÐÒÉÄÅÔÓÑ ÐÅÒÅ×ÅÓÔÉ ÒÅÄÁËÔÏÒ × ÒÅÖÉÍ \fBASIS\fR (ÏÐÉÓÁÎ ÄÁÌÅÅ), ÞÔÏÂÙ ÜÔÉ ÓÉÍ×ÏÌÙ ÐÅÒÅÄÁ×ÁÌÉÓØ ÎÁ ÔÅÒÍÉÎÁÌ ÂÅÚ ÐÒÅÏÂÒÁÚÏ×ÁÎÉÑ. (ðÒÉÍ. ÐÅÒÅ×ÏÄÞÉËÁ: ÐÏÓËÏÌØËÕ ÄÌÑ ×ÓÅÈ ËÏÄÏ×ÙÈ ÎÁÂÏÒÏ× Ó ËÉÒÉÌÌÉÃÅÊ ÔÁË É ÐÒÏÉÓÈÏÄÉÔ - × ÂÏÌØÛÉÎÓÔ×Å ÄÉÓÔÒÉÂÕÔÉ×Ï×, ÉÓÐÏÌØÚÕÅÍÙÈ ÎÁ ÔÅÒÒÉÔÏÒÉÉ ÂÙ×ÛÅÇÏ óóóò, ÒÅÖÉÍ \fBASIS\fR ÄÌÑ JOE ×ËÌÀÞÁÅÔÓÑ ÐÏ ÕÍÏÌÞÁÎÉÀ). .SS úÁÐÒÏÓÙ åÓÌÉ ×Ù ÎÁÖÍÅÔÅ \fBTAB\fR ×Ï ×ÒÅÍÑ ÌÀÂÏÇÏ ÚÁÐÒÏÓÁ ÉÍÅÎÉ ÆÁÊÌÁ - joe ÐÏÐÙÔÁÅÔÓÑ ÐÏ ×ÏÚÍÏÖÎÏÓÔÉ ÄÏÐÏÌÎÉÔØ ××ÏÄÉÍÏÅ ×ÁÍÉ ÉÍÑ. åÓÌÉ ÏÎ ÎÅ ÓÍÏÖÅÔ ÜÔÏÇÏ ÓÄÅÌÁÔØ ÉÚ-ÚÁ ÔÏÇÏ, ÞÔÏ ×ÏÚÍÏÖÎÏ ÂÏÌÅÅ ÏÄÎÏÇÏ ×ÁÒÉÁÎÔÁ ÄÏÐÏÌÎÅÎÉÑ - joe ÉÚÄÁÓÔ Ú×ÏÎÏË. åÓÌÉ ×Ù ÎÁÖÍÅÔÅ \fBTAB\fR ÅÝÅ ÒÁÚ - ÂÕÄÅÔ ÐÒÅÄÌÏÖÅÎ ÓÐÉÓÏË ÄÏÐÏÌÎÅÎÉÊ. ÷Ù ÓÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ËÌÁ×ÉÛÉ ÓÔÒÅÌÏË ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÐÏ ÜÔÏÍÕ ÍÅÎÀ É ÎÁÖÁÔØ ENTER ÉÌÉ ðòïâåì ÄÌÑ ×ÙÂÏÒÁ ÜÌÅÍÅÎÔÁ. åÓÌÉ ×Ù ÎÁÖÍÅÔÅ ÐÅÒ×ÕÀ ÂÕË×Õ ÏÄÎÏÇÏ ÉÚ ÜÌÅÍÅÎÔÏ× ÓÐÉÓËÁ - ÏÎ ÂÕÄÅÔ ×ÙÂÒÁÎ, ÉÌÉ, ÅÓÌÉ ÂÏÌÅÅ ÏÄÎÏÇÏ ÜÌÅÍÅÎÔÁ ÉÍÅÀÔ ÏÄÉÎÁËÏ×ÕÀ ÐÅÒ×ÕÀ ÂÕË×Õ - ËÕÒÓÏÒ ÂÕÄÅÔ ÐÒÙÇÁÔØ ÐÏ ÜÔÉÍ ÜÌÅÍÅÎÔÁÍ. åÓÌÉ ×Ù ×ÙÂÅÒÅÔÅ ÐÏÄÄÉÒÅËÔÏÒÉÀ ÉÌÉ .. - ÉÍÑ ÄÉÒÅËÔÏÒÉÉ ÄÏÂÁ×ÉÔÓÑ Ë ÚÁÐÒÏÓÕ É ÎÏ×ÁÑ ÄÉÒÅËÔÏÒÉÑ ÂÕÄÅÔ ÚÁÇÒÕÖÅÎÁ × ÍÅÎÀ. ÷Ù ÍÏÖÅÔÅ ÎÁÖÁÔØ Backspace ÄÌÑ ×ÏÚ×ÒÁÔÁ Ë ÐÒÅÄÙÄÕÝÅÊ ÄÉÒÅËÔÏÒÉÉ. âÏÌØÛÉÎÓÔ×Ï ÚÁÐÒÏÓÏ× ×ÅÄÕÔ ÉÓÔÏÒÉÀ ÏÂÒÁÝÅÎÉÑ Ë ÎÉÍ. ÷Ù ÍÏÖÅÔÅ ÐÅÒÅÍÅÝÁÔØÓÑ ÐÏ ÜÔÉÍ ÉÓÔÏÒÉÑÍ Ó ÐÏÍÏÝØÀ ËÌÁ×ÉÛ-ÓÔÒÅÌÏË ××ÅÒÈ É ×ÎÉÚ. úÁÐÒÏÓÙ × ÄÅÊÓÔ×ÉÔÅÌØÎÏÓÔÉ Ñ×ÌÑÀÔÓÑ ÏÄÎÏÓÔÒÏÞÎÙÍÉ ÏËÎÁÍÉ ÂÅÚ ÓÔÒÏËÉ ÓÏÓÔÏÑÎÉÑ, ÔÁË ÞÔÏ ×Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ × ÎÅÍ ÌÀÂÙÅ ËÏÍÁÎÄÙ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ. éÓÔÏÒÉÑ ÚÁÐÒÏÓÁ × ÄÅÊÓÔ×ÉÔÅÌØÎÏÓÔÉ ÐÒÅÄÓÔÁ×ÌÅÎÁ ÒÁÚÎÙÍÉ ÓÔÒÏËÁÍÉ × ÏÄÎÏÍ É ÔÏÍ ÖÅ "ÆÁÊÌÅ ÚÁÐÒÏÓÁ". ðÏÜÔÏÍÕ ×Ù ÍÏÖÅÔÅ ×ÙÐÏÌÎÑÔØ ÐÏÉÓË × ÉÓÔÏÒÉÉ ÚÁÐÒÏÓÁ Ó ÐÏÍÏÝØÀ ÏÂÙÞÎÏÊ ËÏÍÁÎÄÙ \fB^K F\fR. ðÏÓËÏÌØËÕ ÚÁÐÒÏÓÙ Ñ×ÌÑÀÔÓÑ ÏËÎÁÍÉ - ×Ù ÔÁËÖÅ ÍÏÖÅÔÅ ÐÅÒÅËÌÀÞÁÔØÓÑ ÍÅÖÄÕ ÎÉÍÉ Ó ÐÏÍÏÝØÀ \fB^K P\fR É \fB^K N\fR. .SS çÄÅ Ñ? îÁÖÍÉÔÅ \fB^K ðòïâåì\fR ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÏÔÞÅÔÁ JOE Ï ÎÏÍÅÒÅ ÓÔÒÏËÉ É ËÏÌÏÎËÉ, Á ÔÁËÖÅ ÎÏÍÅÒÅ ÔÅËÕÝÅÇÏ ÂÁÊÔÁ × ÆÁÊÌÅ, × ÐÏÓÌÅÄÎÅÊ ÓÔÒÏËÅ ÜËÒÁÎÁ. ôÁËÖÅ ÐÏËÁÚÙ×ÁÅÔÓÑ ËÏÄ ÔÅËÕÝÅÇÏ ÓÉÍ×ÏÌÁ. ÷Ù ÍÏÖÅÔÅ ÎÁÓÔÒÏÉÔØ ÒÅÄÁËÔÏÒ ÔÁË, ÞÔÏÂÙ ÎÏÍÅÒ ÔÅËÕÝÅÊ ÓÔÒÏËÉ É/ÉÌÉ ËÏÌÏÎËÉ ÐÏÓÔÏÑÎÎÏ ÏÔÏÂÒÁÖÁÌÓÑ × ÓÔÒÏËÅ ÓÏÓÔÏÑÎÉÑ, ÐÏÍÅÓÔÉ× ÓÐÅÃÉÁÌØÎÙÅ ÕÐÒÁ×ÌÑÀÝÉÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÉ × ÎÁÓÔÒÏÅÞÎÕÀ ÓÔÒÏËÕ ÓÔÒÏËÉ ÓÏÓÔÏÑÎÉÑ. âÏÌÅÅ ÐÏÄÒÏÂÎÁÑ ÉÎÆÏÒÍÁÃÉÑ ÐÏ ÜÔÏÍÕ ×ÏÐÒÏÓÕ ÐÒÉ×ÅÄÅÎÁ × ÆÁÊÌÅ joerc. .SS ïÐÅÒÁÃÉÉ ÎÁÄ ÆÁÊÌÁÍÉ ÷Ù ÍÏÖÅÔÅ ÎÁÖÁÔØ \fB^K D\fR ÄÌÑ ÓÏÈÒÁÎÅÎÉÑ ÔÅËÕÝÅÇÏ ÆÁÊÌÁ (×ÏÚÍÏÖÎÏ, ÐÏÄ ÉÍÅÎÅÍ, ÏÔÌÉÞÁÀÝÉÍÓÑ ÏÔ ÏÒÉÇÉÎÁÌØÎÏÇÏ). ðÏÓÌÅ ÔÏÇÏ, ËÁË ÆÁÊÌ ÓÏÈÒÁÎÅÎ - ÍÏÖÅÔÅ ÎÁÖÁÔØ \fB^K E\fR ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ÄÒÕÇÏÇÏ ÆÁÊÌÁ. åÓÌÉ ×Ù ÖÅÌÁÅÔÅ ÓÏÈÒÁÎÉÔØ ÔÏÌØËÏ ÏÔÄÅÌØÎÕÀ ÞÁÓÔØ ÆÁÊÌÁ - ÓÍ. ÎÉÖÅ ÒÁÚÄÅÌ \fBâÌÏËÉ\fR. åÓÌÉ ×Ù ÖÅÌÁÅÔÅ ×ËÌÀÞÉÔØ ÄÒÕÇÏÊ ÆÁÊÌ × ÒÅÄÁËÔÉÒÕÅÍÙÊ - ÉÓÐÏÌØÚÕÊÔÅ ÄÌÑ ÅÇÏ ×ÓÔÁ×ËÉ ËÏÍÁÎÄÕ \fB^K R\fR. .SS ÷ÒÅÍÅÎÎÙÊ ÐÒÉÏÓÔÁÎÏ× ÒÅÄÁËÔÏÒÁ åÓÌÉ ×ÁÍ ÎÅÏÂÈÏÄÉÍÏ ×ÒÅÍÅÎÎÏ ÐÒÉÏÓÔÁÎÏ×ÉÔØ ÒÅÄÁËÔÏÒ É ×ÅÒÎÕÔØÓÑ × ÛÅÌÌ - ÎÁÖÍÉÔÅ \fB^K Z\fR. ÷Ù ÍÏÖÅÔÅ ÓÄÅÌÁÔØ ÜÔÏ, Ë ÐÒÉÍÅÒÕ, ÄÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÐÒÅÒ×ÁÔØ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ É ÏÔ×ÅÔÉÔØ ÎÁ ÐÏÞÔÏ×ÏÅ ÓÏÏÂÝÅÎÉÅ ÉÌÉ ÐÏÞÉÔÁÔØ man page. äÌÑ ×ÏÚ×ÒÁÔÁ × ÒÅÄÁËÔÏÒ ×ÁÍ ÎÁÄÏ ÂÕÄÅÔ ×ÙÐÏÌÎÉÔØ ËÏÍÁÎÄÕ fg ÉÌÉ exit (×ÁÍ ÂÕÄÅÔ ÓËÁÚÁÎÏ ËÁËÕÀ ÉÍÅÎÎÏ, ËÏÇÄÁ ×Ù ÎÁÖÍÅÔÅ \fB^K Z\fR). .SS ðÏÉÓË ÔÅËÓÔÁ îÁÖÍÉÔÅ \fB^K F\fR, ÞÔÏÂÙ ×ÙÐÏÌÎÉÔØ ÐÏÉÓË ÆÒÁÇÍÅÎÔÁ ÔÅËÓÔÁ (\fBÓÔÒÏËÉ\fR) ×ÐÅÒÅÄ ÉÌÉ ÎÁÚÁÄ. õ ×ÁÓ ÂÕÄÅÔ ÚÁÐÒÏÛÅÎ ÏÂÒÁÚÅà ÐÏÉÓËÁ. ðÏÓÌÅ ÎÁÖÁÔÉÑ \fBEnter\fR ×Ù ÐÏÌÕÞÉÔÅ ÚÁÐÒÏÓ ÎÁ ××ÏÄ ÏÐÃÉÊ ÐÏÉÓËÁ. ÷Ù ÍÏÖÅÔÅ ÐÒÏÓÔÏ ÎÁÖÁÔØ \fBEnter\fR ÅÝÅ ÒÁÚ, ÞÔÏÂÙ ÒÅÄÁËÔÏÒ ÓÒÁÚÕ ÎÁÞÁÌ ÐÏÉÓË ×ÐÅÒÅÄ, ÉÌÉ ÍÏÖÅÔÅ ××ÅÓÔÉ ÏÄÎÕ ÉÌÉ ÂÏÌØÛÅ ÉÚ ÓÌÅÄÕÀÝÉÈ ÏÐÃÉÊ: .IP \fBb ðÏÉÓË ÎÁÚÁÄ, Á ÎÅ ×ÐÅÒÅÄ. .IP \fBi îÅ ÒÁÚÌÉÞÁÔØ ÐÒÉ ÐÏÉÓËÅ ÓÉÍ×ÏÌÙ ×ÅÒÈÎÅÇÏ É ÎÉÖÎÅÇÏ ÒÅÇÉÓÔÒÏ×. ïÂÙÞÎÏ ÓÞÉÔÁÅÔÓÑ, ÞÔÏ ÏÎÉ ÒÁÚÌÉÞÎÙ. .IP \fBnnn (ÇÄÅ \fBnnn\fR - ÞÉÓÌÏ) åÓÌÉ ×Ù ××ÅÄÅÔÅ ÞÉÓÌÏ - JOE ÎÁÊÄÅÔ n-ÎÏÅ ×ÈÏÖÄÅÎÉÅ ÉÓËÏÍÏÇÏ ÔÅËÓÔÁ. üÔÏ ÐÏÌÅÚÎÏ ÄÌÑ ÐÅÒÅÈÏÄÁ × ÎÕÖÎÙÅ ÍÅÓÔÁ ×ÎÕÔÒÉ ÆÁÊÌÏ×, ÓÔÒÕËÔÕÒÉÒÏ×ÁÎÎÙÈ ÎÅËÏÔÏÒÙÍ ÏÐÒÅÄÅÌÅÎÎÙÍ ÏÂÒÁÚÏÍ. .IP \fBr úÁÍÅÝÁÔØ ÔÅËÓÔ. åÓÌÉ ×Ù ××ÅÄÅÔÅ ÏÐÃÉÀ \fBr\fR, ÄÁÌÅÅ Õ ×ÁÓ ÂÕÄÅÔ ÚÁÐÒÏÛÅÎ ÚÁÍÅÝÁÀÝÉÊ ÔÅËÓÔ. ëÁÖÄÙÊ ÒÁÚ ÐÒÉ ÎÁÈÏÖÄÅÎÉÉ ÔÅËÓÔÁ Õ ×ÁÓ ÂÕÄÅÔ ÚÁÐÒÁÛÉ×ÁÔØÓÑ - ÖÅÌÁÅÔÅ ÌÉ ×Ù ×ÙÐÏÌÎÉÔØ ÅÇÏ ÚÁÍÅÝÅÎÉÅ. ÷Ù ÍÏÖÅÔÅ ÎÁÖÁÔØ: \fBy\fR ÄÌÑ ÚÁÍÅÝÅÎÉÑ ÔÅËÓÔÁ É ×ÙÐÏÌÎÅÎÉÑ ÄÁÌØÎÅÊÛÅÇÏ ÐÏÉÓËÁ, \fBn\fR - ÞÔÏÂÙ ÎÅ ÚÁÍÅÝÁÔØ ÔÅËÓÔ, ÎÏ ÐÒÏÄÏÌÖÁÔØ ÐÏÉÓË, \fBr\fR - ÄÌÑ ÚÁÍÅÎÙ ×ÓÅÈ ÐÏÓÌÅÄÕÀÝÉÈ ×ÈÏÖÄÅÎÉÊ ÄÁÌÅÅ ÐÏ ÆÁÊÌÕ ÂÅÚ ÄÏÐÏÌÎÉÔÅÌØÎÙÈ ÚÁÐÒÏÓÏ× ÎÁ ÐÏÄÔ×ÅÒÖÄÅÎÉÅ, ÉÌÉ \fB^C\fR ÄÌÑ ÐÒÅËÒÁÝÅÎÉÑ ÐÏÉÓËÁ É ÚÁÍÅÎÙ. .PP ÷Ù ÍÏÖÅÔÅ ÎÁÖÁÔØ \fB^L\fR ÄÌÑ ÐÏ×ÔÏÒÅÎÉÑ ÐÒÅÄÙÄÕÝÅÇÏ ÐÏÉÓËÁ. .SS òÅÇÕÌÑÒÎÙÅ ×ÙÒÁÖÅÎÉÑ ðÒÉ ÐÏÉÓËÅ ÔÅËÓÔÁ × ËÁÞÅÓÔ×Å ÏÂÒÁÚÃÁ ÍÏÇÕÔ ÉÓÐÏÌØÚÏ×ÁÔØÓÑ ÒÁÚÌÉÞÎÙÅ ÓÐÅÃÉÁÌØÎÙÅ ÓÉÍ×ÏÌØÎÙÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÉ: .IP \fB\e* üÔÏ ÏÚÎÁÞÁÅÔ ÎÏÌØ ÉÌÉ ÂÏÌÅÅ ÓÉÍ×ÏÌÏ×. îÁÐÒÉÍÅÒ, ÅÓÌÉ ×Ù ÚÁÄÁÄÉÔÅ \fBA\e*B\fR × ËÁÞÅÓÔ×Å ÏÂÒÁÚÃÁ ÐÏÉÓËÁ, JOE ÐÏÐÙÔÁÅÔÓÑ ÎÁÊÔÉ A ÓÏ ÓÌÅÄÕÀÝÉÍ ÄÁÌÅÅ ÐÒÏÉÚ×ÏÌØÎÙÍ ËÏÌÉÞÅÓÔ×ÏÍ ÌÀÂÙÈ ÓÉÍ×ÏÌÏ×, ÚÁ ËÏÔÏÒÙÍÉ ÓÌÅÄÕÅÔ B. .IP \fB\e? òÏ×ÎÏ ÏÄÉÎ ÓÉÍ×ÏÌ. îÁÐÒÉÍÅÒ, ÅÓÌÉ ×Ù ÕËÁÖÅÔÅ × ËÁÞÅÓÔ×Å ÏÂÒÁÚÃÁ ÐÏÉÓËÁ \fBA\e?B\fR, JOE ÎÁÊÄÅÔ AXB, ÎÏ ÎÅ AB, É ÎÅ AXXB. .IP \fB\e^\ \e$ üÔÏ ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ ÎÁÞÁÌÕ É ËÏÎÃÕ ÓÔÒÏËÉ. îÁÐÒÉÍÅÒ, ÅÓÌÉ ×Ù ÕËÁÖÅÔÅ \fB\e^test\e$\fR, ÔÏ JOE ÂÕÄÅÔ ÉÓËÁÔØ ÓÔÒÏËÕ, × ËÏÔÏÒÏÊ ÓÏÄÅÒÖÉÔÓÑ ÔÏÌØËÏ ÓÌÏ×Ï \fBtest\fR. .IP \fB\e<\ \e> üÔÏ ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ ÎÁÞÁÌÕ ÉÌÉ ËÏÎÃÕ ÓÌÏ×Á. îÁÐÒÉÍÅÒ, ÅÓÌÉ ×Ù ÚÁÄÁÄÉÔÅ \fB\e<\e*is\e*\e>\fR, ÔÏ joe ÂÕÄÅÔ ÉÓËÁÔØ ÓÌÏ×Ï, ÓÏÄÅÒÖÁÝÅÅ ÐÏÄÓÔÒÏËÕ \fBis\fR. .IP \fB\e[...] üÔÏ ÓÏÏÔ×ÅÓÔ×ÕÅÔ ÏÄÎÏÍÕ ÉÚ ÓÉÍ×ÏÌÏ×, ËÏÔÏÒÙÅ ÚÁËÌÀÞÅÎÙ × Ë×ÁÄÒÁÔÎÙÅ ÓËÏÂËÉ. îÁÐÒÉÍÅÒ, ÅÓÌÉ ×Ù ××ÅÄÅÔÅ × ËÁÞÅÓÔ×Å ÏÂÒÁÚÃÁ ÐÏÉÓËÁ \fB\e[Tt]his\fR, ÔÏ JOE ÎÁÊÄÅÔ É \fBThis\fR, É \fBthis\fR. ÷ ÓËÏÂËÁÈ ÍÏÇÕÔ ÕËÁÚÙ×ÁÔØÓÑ É ÄÉÁÐÁÚÏÎÙ ÓÉÍ×ÏÌÏ×. îÁÐÒÉÍÅÒ, \fB\e[A-Z]\fR ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ ÌÀÂÏÊ ÚÁÇÌÁ×ÎÏÊ ÌÁÔÉÎÓËÏÊ ÂÕË×Å. åÓÌÉ ÐÅÒ×ÙÍ ÓÉÍ×ÏÌÏÍ × ÓËÏÂËÁÈ Ñ×ÌÑÅÔÓÑ \fB^\fR, ÔÏ JOE ÂÕÄÅÔ ÉÓËÁÔØ ÓÉÍ×ÏÌÙ, ÎÅ ÕËÁÚÁÎÎÙÅ ×ÎÕÔÒÉ ÓËÏÂÏË. .IP \fB\ec üÔÏ ÒÁÂÏÔÁÅÔ ÁÎÁÌÏÇÉÞÎÏ \fB\e*\fR, ÎÏ ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ ÓÂÁÌÁÎÓÉÒÏ×ÁÎÎÙÍ ×ÙÒÁÖÅÎÉÑÓ ÑÚÙËÁ C. îÁÐÒÉÍÅÒ, ÅÓÌÉ ×Ù ÂÕÄÅÔÅ ÉÓËÁÔØ \fBmalloc(\ec)\fR, ÔÏ JOE ÎÁÊÄÅÔ ÌÀÂÏÊ ×ÙÚÏ× ÆÕÎËÃÉÉ \fBmalloc\fR, ÄÁÖÅ ÅÓÌÉ × ÎÅÍ ÎÁÈÏÄÑÔÓÑ ×ÌÏÖÅÎÎÙÅ \fB)\fR. .IP \fB\e+ âÕÄÅÔ ÉÓËÁÔØÓÑ ÎÏÌØ ÉÌÉ ÂÏÌØÛÅ ÓÉÍ×ÏÌÏ×, ÒÁ×ÎÙÈ ÓÌÅÄÕÀÝÅÍÕ ÓÒÁÚÕ ÚÁ \fB\e+\fR. îÁÐÒÉÍÅÒ, ÅÓÌÉ ×Ù ÕËÁÖÅÔÅ \fB\e[ ]\e+\e[ ]\fR, ÐÒÉÞÅÍ × Ë×ÁÄÒÁÔÎÙÈ ÓËÏÂËÁÈ ÎÁÈÏÄÑÔÓÑ ðòïâåì É TAB, ÔÏ JOE ÂÕÄÅÔ ÉÓËÁÔØ ÐÒÏÂÅÌØÎÙÅ ÏÂÌÁÓÔÉ. .IP \fB\e\e óÏÏÔ×ÅÔÓÔ×ÕÅÔ ÏÄÉÎÏÞÎÏÍÕ \e. .IP \fB\en âÕÄÅÔ ÉÓËÁÔØÓÑ ÓÐÅÃÉÁÌØÎÙÊ ÓÉÍ×ÏÌ ËÏÎËÃÁ ÓÔÒÏËÉ. .PP óÌÅÄÕÀÝÉÅ ÓÐÅÃÉÁÌØÎÙÅ ÓÉÍ×ÏÌØÎÙÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÉ ÍÏÇÕÔ ÉÓÐÏÌØÚÏ×ÁÔØÓÑ × ÓÔÒÏËÅ ÚÁÍÅÝÅÎÉÑ: .IP \fB\e& ðÏÄÓÔÁ×ÌÑÅÔÓÑ ÔÅËÓÔ ÏÂÒÁÚÃÁ ÐÏÉÓËÁ. îÁÐÒÉÍÅÒ, ÅÓÌÉ ÓÔÒÏËÏÊ ÐÏÉÓËÁ ÂÙÌÏ \fB\e<\e*\e>\fR, ÞÔÏ ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ ÓÌÏ×ÁÍ, É ×Ù ÕËÁÖÅÔÅ \fB"\e&"\fR, ÔÏ joe ÂÕÄÅÔ ÚÁËÌÀÞÁÔØ ÓÌÏ×Á × ËÁ×ÙÞËÉ. .IP \fB\e0\ -\ \e9 üÔÏ ÂÕÄÅÔ ÚÁÍÅÝÁÔØÓÑ ÔÅËÓÔÏÍ, ËÏÔÏÒÙÊ ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ N-ÎÏÍÕ \fB\e*\fR, \fB\e?\fR, \fB\e+\fR, \fB\ec\fR, \fB\e+\fR, ÉÌÉ \fB\e[...]\fR × ÏÂÒÁÚÃÅ ÐÏÉÓËÁ. .IP \fB\e\e éÓÐÏÌØÚÕÊÔÅ ÜÔÏ, ÅÓÌÉ ×ÁÍ ÎÅÏÂÈÏÄÉÍÏ ÐÏÍÅÓÔÉÔØ \fB\e\fR × ÓÔÒÏËÕ ÚÁÍÅÝÅÎÉÑ. .IP \fB\en éÓÐÏÌØÚÕÊÔÅ ÜÔÏ, ÅÓÌÉ ×ÁÍ ÎÅÏÂÈÏÄÉÍÏ ÐÏÍÅÓÔÉÔØ ÓÉÍ×ÏÌ ÐÅÒÅ×ÏÄÁ ÓÔÒÏËÉ × ÓÔÒÏËÕ ÚÁÍÅÝÅÎÉÑ. .PP îÅÓËÏÌØËÏ ÐÒÉÍÅÒÏ×: ðÒÅÄÐÏÌÏÖÉÍ, Õ ×ÁÓ ÉÍÅÅÔÓÑ ÓÐÉÓÏË ÁÄÒÅÓÏ×, ÐÏ ÏÄÎÏÍÕ × ÓÔÒÏËÅ, ÎÁÞÉÎÁÀÝÅÊÓÑ ÓÏ ÓÌÏ×Á "Address:", É ÜÌÅÍÅÎÔÙ ÒÁÚÄÅÌÅÎÙ ÚÁÐÑÔÙÍÉ. ÷ÒÏÄÅ ÓÌÅÄÕÀÝÅÇÏ: Address: S. Holmes, 221b Baker St., London, England åÓÌÉ ×Ù ÚÁÈÏÔÉÔÅ ÐÅÒÅÆÏÒÍÉÒÏ×ÁÔØ ÜÔÏÔ ÓÐÉÓÏË, ÞÔÏÂÙ ÓÎÁÞÁÌÁ ÛÌÏ ÎÁÉÍÅÎÏ×ÁÎÉÅ ÓÔÒÁÎÙ, ÚÁÔÅÍ - ÇÏÒÏÄÁ, ÚÁ ÎÉÍ - ÉÍÑ ÞÅÌÏ×ÅËÁ, É × ËÏÎÃÅ - ÁÄÒÅÓ, ×Ù ÍÏÖÅÔÅ ÓÄÅÌÁÔØ ÓÌÅÄÕÀÝÅÅ: îÁÖÍÉÔÅ \fB^K F\fR ÞÔÏÂÙ ÎÁÞÁÔØ ÐÏÉÓË, É ××ÅÄÉÔÅ: \fBAddress:\e*,\e*,\e*,\e*\e$\fR ÞÔÏ ÓÏÏÔ×ÅÔÓ×ÕÅÔ "Address:", ÞÅÔÙÒÅÍ ÜÌÅÍÅÎÔÁÍ, ÒÁÚÄÅÌÅÎÎÙÍ ÚÁÐÑÔÙÍÉ, É ÚÁÔÅÍ - ËÏÎÅà ÓÔÒÏËÉ. ðÒÉ ÚÁÐÒÏÓÅ ÏÃÉÉ ÐÏÉÓËÁ ÎÁÖÍÉÔÅ \fBr\fR ÄÌÑ ÚÁÍÅÎÙ ÓÔÒÏËÉ, É ÚÁÔÅÍ ××ÅÄÉÔÅ: \fBAddress:\e3,\e2,\e0,\e1\fR ÄÌÑ ÐÅÒÅÔÁÓÏ×ËÉ ÄÁÎÎÙÈ ÎÕÖÎÙÍ ×ÁÍ ÓÐÏÓÏÂÏÍ. ðÏÓÌÅ ÎÁÖÁÔÉÑ Enter ÎÁÞÎÅÔÓÑ ÐÏÉÓË É ÉÓÈÏÄÎÁÑ ÓÔÒÏËÁ ÂÕÄÅÔ ÐÒÅÏÂÒÁÚÏ×ÁÎÁ ×: Address: England, London, S. Holmes, 221b Baker St. .SS âÌÏËÉ åÓÌÉ ×Ù ÖÅÌÁÅÔÅ ÐÅÒÅÍÅÝÁÔØ, ËÏÐÉÒÏ×ÁÔØ, ÓÏÈÒÁÎÑÔØ ÉÌÉ ÕÄÁÌÑÔØ ÏÔÄÅÌØÎÙÅ ÞÁÓÔÉ ÔÅËÓÔÁ - ×Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÄÌÑ ÜÔÏÇÏ ÏÔÍÅÞÅÎÎÙÅ ÂÌÏËÉ. óÎÁÞÁÌÁ ÐÏÍÅÓÔÉÔÅ ËÕÒÓÏÒ × ÎÁÞÁÌÏ ÔÅËÓÔÁ, Ó ËÏÔÏÒÙÍ ÖÅÌÁÅÔÅ ÒÁÂÏÔÁÔØ, É ÎÁÖÍÉÔÅ \fB^K B\fR. úÁÔÅÍ ÐÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÚÁ ÐÏÓÌÅÄÎÉÊ ÓÉÍ×ÏÌ ÔÅËÓÔÁ É ÎÁÖÍÉÔÅ \fB^K K\fR. ôÅËÓÔ ÍÅÖÄÕ \fB^K B\fR É \fB^K K\fR ÏÔÍÅÔÉÔÓÑ ÐÏÄÓ×ÅÔËÏÊ. ôÅÐÅÒØ ×Ù ÍÏÖÅÔÅ ÐÅÒÅÍÅÓÔÉÔØ ËÕÒÓÏÒ ËÕÄÁ-ÎÉÂÕÄÉ ÅÝÅ É ÎÁÖÁÔØ \fB^K M\fR ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÏÔÍÅÞÅÎÎÏÇÏ ÔÅËÓÔÁ ÔÕÄÁ. ÷Ù ÍÏÖÅÔÅ ÎÁÖÁÔØ \fB^K C\fR, ÞÔÏÂÙ ×ÓÔÁ×ÉÔØ ËÏÐÉÀ ÏÔÍÅÞÅÎÎÏÇÏ ÔÅËÓÔÁ × ÔÏÞËÕ ÒÁÓÐÏÌÏÖÅÎÉÑ ËÕÒÓÏÒÁ. \fB^K Y\fR ÕÄÁÌÉÔ ÏÔÍÅÞÅÎÎÙÊ ÔÅËÓÔ. \fB^K W\fR ÚÁÐÉÛÅÔ ÅÇÏ × ÆÁÊÌ. ïÞÅÎØ ÐÏÌÅÚÎÁÑ ËÏÍÁÎÄÁ - \fB^K /\fR, ËÏÔÏÒÁÑ ÆÉÌØÔÒÕÅÔ ÂÌÏË ÔÅËÓÔÁ ÞÅÒÅÚ ËÏÍÁÎÄÕ unix. îÁÐÒÉÍÅÒ, ÅÓÌÉ ×Ù ÏÔÍÅÔÉÔÅ ÓÐÉÓÏË ÓÌÏ×, É ÚÁÔÅÍ ÎÁÂÅÒÅÔÅ \fB^K / sort\fR, ÔÏ ÜÔÏÔ ÓÐÉÓÏË ÏÔÓÏÒÔÉÒÕÅÔÓÑ. äÒÕÇÁÑ ÐÏÌÅÚÎÁÑ ËÏÍÁÎÄÁ unix ÄÌÑ \fB^K /\fR - \fBtr\fR. åÓÌÉ ×Ù ××ÅÄÅÔÅ \fB^K / tr a-z A-Z\fR, ÔÏ ×ÓÅ ÌÁÔÉÎÓËÉÅ ÓÉÍ×ÏÌÙ × ÂÌÏËÅ ÂÕÄÕÔ ÐÅÒÅ×ÅÄÅÎÙ × ×ÅÒÈÎÉÊ ÒÅÇÉÓÔÒ. ðÏ ÚÁ×ÅÒÛÅÎÉÀ ÏÐÅÒÁÃÉÊ Ó ÂÌÏËÏÍ ×Ù ÍÏÖÅÔÅ ÐÒÏÓÔÏ ÏÓÔÁ×ÉÔØ ÏÔÍÅÔËÕ ×ËÌÀÞÅÎÎÏÊ É ÎÅ ÏÂÒÁÝÁÔØ ÎÁ ÎÅÅ ×ÎÉÍÁÎÉÑ (ÎÏ, ÅÓÔÅÓÔ×ÅÎÎÏ, ÅÓÌÉ ×Ù ÓÌÕÞÁÊÎÏ ÎÁÖÍÅÔÅ \fB^K Y\fR ...). åÓÌÉ ÖÅ ÜÔÏ ×ÁÓ ÄÅÊÓÔ×ÉÔÅÌØÎÏ ÂÅÓÐÏËÏÉÔ - ÐÒÏÓÔÏ ÎÁÖÍÉÔÅ \fB^K B ^K K\fR ÄÌÑ ÓÎÑÔÉÑ ÏÔÍÅÔËÉ. .SS óÄ×ÉÇÉ ÂÌÏËÏ× × ÐÒÏÇÒÁÍÍÁÈ òÅÖÉÍ Á×ÔÏÏÔÓÔÕÐÁ ×ËÌÀÞÁÅÔÓÑ ËÏÍÁÎÄÏÊ \fB^T I\fR. \fBjoerc\fR ÏÂÙÞÎÏ ÎÁÓÔÒÏÅÎ ÔÁË, ÞÔÏ ÆÁÊÌÙ Ó ÉÍÅÎÁÍÉ, ÚÁÞÁÎÞÉ×ÁÀÝÉÍÉÓÑ ÎÁ .p, .c ÉÌÉ .h ÏÔËÒÙ×ÁÀÔÓÑ Ó ×ËÌÀÞÅÎÎÙÍ Á×ÔÏÏÔÓÔÕÐÏÍ. åÓÌÉ Á×ÔÏÏÔÓÔÕÐ ×ËÌÀÞÅÎ É ×Ù ÎÁÖÉÍÁÅÔÅ \fBEnter\fR, ËÕÒÓÏÒ ÐÅÒÅÍÅÓÔÉÔÓÑ × ÔÕ ÖÅ ÐÏÚÉÃÉÀ ÓÌÅÄÕÀÝÅÊ ÓÔÒÏËÉ, × ËÏÔÏÒÏÊ ÎÁÈÏÄÉÌÓÑ ÐÅÒ×ÙÊ ÎÅÐÒÏÂÅÌØÎÙÊ ÓÉÍ×ÏÌ ÉÓÈÏÄÎÏÊ. ÷Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ËÏÍÁÎÄÙ \fB^K ,\fR É \fB^K .\fR ÄÌÑ ÓÄ×ÉÇÁ ÂÌÏËÁ ÔÅËÓÔÁ ×ÌÅ×Ï É ×ÐÒÁ×Ï. to the left or right. åÓÌÉ ×Ù ÐÏÐÙÔÁÅÔÅÓØ ×ÙÐÏÌÎÉÔØ ÜÔÉ ËÏÍÁÎÄÙ, ËÏÇÄÁ ÂÌÏË ÎÅ ÏÔÍÅÞÅÎ - ×ÅÓØ ÒÅÄÁËÔÉÒÕÅÍÙÊ ÔÅËÓÔ ÂÕÄÅÔ ÏÔÍÅÞÅÎ, É ÐÒÉ ÐÏÓÌÅÄÕÀÝÉÈ ×ÙÚÏ×ÁÈ \fB^K ,\fR É \fB^K .\fR ÂÕÄÅÔ ÓÍÅÝÁÔØÓÑ. ëÏÌÉÞÅÓÔ×Ï ËÏÌÏÎÏË, ÎÁ ËÏÔÏÒÏÅ ×ÙÐÏÌÎÑÅÔÓÑ ÓÄ×ÉÇ ÄÁÎÎÙÍÉ ËÏÍÁÎÄÁÍÉ, ÍÏÖÅÔ ÂÙÔØ ÕÓÔÁÎÏ×ÌÅÎÏ Ó ÐÏÍÏÝØÀ ÏÐÃÉÉ \fB^T\fR. .SS ïËÎÁ ÷Ù ÍÏÖÅÔÅ ÒÅÄÁËÔÉÒÏ×ÁÔØ ÂÏÌÅÅ ÏÄÎÏÇÏ ÆÁÊÌÁ ÏÄÎÏ×ÒÅÍÅÎÎÏ, ÉÌÉ ÒÁÚÎÙÅ ÞÁÓÔÉ ÏÄÎÏÇÏ É ÔÏÇÏ ÖÅ ÆÁÊÌÁ. äÌÑ ÜÔÏÇÏ ÎÁÖÍÉÔÅ \fB^K O\fR, ÞÔÏÂÙ ÒÁÚÒÅÚÁÔØ ÜËÒÁË ÎÁ Ä×Á ÏËÎÁ. éÓÐÏÌØÚÕÊÔÅ \fB^K P\fR ÉÌÉ \fB^K N\fR ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÍÅÖÄÕ ÏËÎÁÍÉ. éÓÐÏÌØÚÕÊÔÅ \fB^K E\fR ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ÎÏ×ÏÇÏ ÆÁÊÌÁ × ÏÄÎÏÍ ÉÚ ÏËÏÎ. ïËÎÏ ÚÁËÒÏÅÔÓÑ, ËÏÇÄÁ ×Ù ÓÏÈÒÁÎÉÔÅ ÆÁÊÌ ÐÏ \fB^K X\fR ÉÌÉ ÏÔÍÅÎÉÔÅ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ ÐÏ \fB^C\fR. åÓÌÉ ×Ù ÐÒÅÒ×ÅÔÅ ÒÁÄÁËÔÉÒÏ×ÁÎÉÅ ÏÄÎÏÇÏ É ÔÏÇÏ ÖÅ ÆÁÊÌÁ, ÎÏ ÒÅÄÁËÔÉÒÕÅÍÏÇÏ × Ä×ÕÈ ÏËÎÁÈ, ÚÁËÒÏÅÔÓÑ ÏÄÎÏ ÉÚ ÏËÏÎ ÚÁËÒÏÅÔÓÑ, ÎÏ ÎÅ ÆÁÊÌ. ÷Ù ÍÏÖÅÔÅ ÐÏ×ÔÏÒÎÏ ÎÁÖÁÔØ \fB^K O\fR × ÏËÎÅ, ÞÔÏÂÙ ÓÏÚÄÁÔØ ÂÏÌØÛÅ ÏËÏÎ. åÓÌÉ ÎÁ ÜËÒÁÎÅ ÏÂÒÁÚÏ×ÁÌÏÓØ ÓÌÉÛËÏÍ ÍÎÏÇÏ ÏËÏÎ, ÎÏ ×Ù ÎÅ ÈÏÔÉÔÅ ÉÈ ÚÁËÒÙ×ÁÔØ - ÍÏÖÅÔÅ ÎÁÖÁÔØ \fB^K I\fR. üÔÏ ÐÒÉ×ÅÄÅÔ Ë ÔÏÍÕ, ÞÔÏ ÎÁ ÜËÒÁÎÅ ÂÕÄÅÔ ÏÔÏÂÒÁÖÁÔØÓÑ ÔÏÌØËÏ ÏÄÎÏ ÔÅËÕÝÅÅ ÏËÎÏ. ðÏ×ÔÏÒÎÏÅ ÎÁÖÁÔÉÅ ÜÔÏÊ ËÏÍÂÉÎÁÃÉÉ ÐÒÉ×ÅÄÅÔ Ë ÏÂÒÁÔÎÏÊ ÐÏÐÙÔËÅ - ÒÁÚÍÅÓÔÉÔØ ×ÓÅ ÓÐÒÑÔÁÎÎÙÅ ÏËÎÁ ÎÁ ÜËÒÁÎÅ. åÓÌÉ ×Ù ÏÔËÒÙÌÉ ÂÏÌØÛÅ ÏËÏÎ, ÞÅÍ ÍÏÖÅÔ ÐÏÍÅÓÔÉÔØÓÑ ÎÁ ÜËÒÁÎÅ - ×Ù ÍÏÖÅÔÅ ÎÁÖÁÔØ \fB^K N\fR × ÓÁÍÏÍ ×ÅÒÈÎÅÍ ÉÌÉ \fB^K P\fR × ÓÁÍÏÍ ÎÉÖÎÅÍ ÏËÎÅ ÄÌÑ ÄÏÓÔÕÐÁ Ë ÔÅÍ ÏËÎÁÍ, ËÏÔÏÒÙÅ ÎÅ ×ÌÅÚÌÉ. åÓÌÉ × ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÅ ×ÙÚÏ×Á JOE ×Ù ÕËÁÚÁÌÉ ÂÏÌÅÅ ÏÄÎÏÇÏ ÆÁÊÌÁ - ËÁÖÄÙÊ ÂÕÄÅÔ ÒÁÚÍÅÝÅÎ × ÏÔÄÅÌØÎÏÍ ÏËÎÅ. ÷Ù ÍÏÖÅÔÅ ÉÚÍÅÎÉÔØ ×ÙÓÏÔÕ ÏËÎÁ Ó ÐÏÍÏÝØÀ ËÏÍÁÎÄ \fB^K G\fR É \fB^K T\fR. .SS ëÌÁ×ÉÁÔÕÒÎÙÅ ÍÁËÒÏÓÙ ó ÐÏÍÏÝØÀ ÍÁËÒÏÓÏ× ×Ù ÍÏÖÅÔÅ ÚÁÐÉÓÁÔØ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔØ ÎÁÖÁÔÉÊ ËÌÁ×ÉÛ É ÚÁÔÅÍ ÐÏ×ÔÏÒÑÔØ ÅÅ ÐÏ ÎÁÖÁÔÉÀ Ä×ÕÈ ËÌÁ×ÉÛ. üÔÏ ÐÏÌÅÚÎÏ ÄÌÑ Á×ÔÏÍÁÔÉÚÁÃÉÉ ÐÏ×ÔÏÒÑÀÝÉÈÓÑ ÚÁÄÁÞ. þÔÏÂÙ ÎÁÞÁÔØ ÚÁÐÉÓØ ÍÁËÒÏ - ÎÁÖÍÉÔÅ \fB^K [\fR É ÚÁÔÅÍ ÞÉÓÌÏ ÏÔ 0 ÄÏ 9. ÷ ÓÔÁÔÕÓÎÏÊ ÓÔÒÏËÅ ÐÏÑ×ÉÔÓÑ ÓÏÏÂÝÅÎÉÅ (úÁÐÉÓØ ÍÁËÒÏ n...). ôÅÐÅÒØ ××ÏÄÉÔÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔØ ËÌÁ×ÉÛ, ËÏÔÏÒÕÀ ÖÅÌÁÅÔÅ ÐÏ×ÔÏÒÑÔØ. ÷×ÏÄÉÍÙÅ ËÏÍÁÎÄÙ ÂÕÄÕÔ ÄÅÊÓÔ×Ï×ÁÔØ ËÁË ÏÂÙÞÎÏ. îÁÖÍÉÔÅ \fB^K ]\fR ÄÌÑ ÚÁ×ÅÒÛÅÎÉÑ ÚÁÐÉÓÉ ÍÁËÒÏ. îÁÖÍÉÔÅ \fB^K\fR Ó ÐÏÓÌÅÄÕÀÝÅÊ ÃÉÆÒÏÊ ÄÌÑ ÐÏ×ÔÏÒÅÎÉÑ ÚÁÐÉÓÁÎÎÏÊ ÒÁÎÅÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÉ ÎÁÖÁÔÉÊ. îÁÐÒÉÍÅÒ, ÅÓÌÉ ×Ù ÖÅÌÁÅÔÅ ÐÏÍÅÓÔÉÔØ "**" × ÎÁÞÁÌÏ ÎÅËÏÔÏÒÙÈ ÓÔÒÏË - ÍÏÖÅÔÅ ××ÅÓÔÉ ÓÌÅÄÕÀÝÅÅ: \fB^K [ ^A ** \fR<ÓÔÒÅÌËÁ ×ÎÉÚ> \fB^K ]\fR ÷ ÎÁÞÁÌÅ ÚÁÐÉÓÉ ÍÁËÒÏ ÐÅÒÅÍÅÝÁÅÔÅ ËÕÒÓÏÒ × ÎÁÞÁÌÏ ÓÔÒÏËÉ, ×ÓÔÁ×ÌÑÅÔÅ "**", ÐÅÒÅÍÅÝÁÅÔÅ ËÕÒÓÏÒ ÎÁ ÓÌÅÄÕÀÝÕÀ ÓÔÒÏËÕ É ÚÁËÁÎÞÉ×ÁÅÔÅ ÚÁÐÉÓØ. ðÏÓËÏÌØËÕ ÍÙ ×ËÌÀÞÉÌÉ × ÍÁËÒÏ ËÏÍÁÎÄÕ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ ÎÁ ÓÌÅÄÕÀÝÕÀ ÓÔÒÏËÕ - ÍÙ ÓÍÏÖÅÍ ÃÉËÌÉÞÅÓËÉ ÐÏÔÏÒÑÔØ ×ÙÚÏ× ÍÁËÒÏ, ÎÅ ÐÅÒÅ×ÏÄÑ ËÕÒÓÏÒ ×ÒÕÞÎÕÀ, ÞÔÏ ×ÁÍ ÓÌÅÄÕÅÔ ÞÁÓÔÏ ÉÍÅÔØ × ×ÉÄÕ ÐÒÉ ÚÁÐÉÓÉ ÍÁËÒÏ. åÓÌÉ ×Ù ÏÂÎÁÒÕÖÉÔÅ, ÞÔÏ ÍÁËÒÏ, ËÏÔÏÒÏÅ ×Ù ÚÁÐÉÓÙ×ÅÔÅ, ÓÁÍÏ ×ËÌÀÞÁÅÔ × ÓÅÂÑ ÐÏ×ÔÏÒÑÀÝÉÅÓÑ ÎÁÖÁÔÉÑ ËÌÁ×ÉÛ - ×Ù ÍÏÖÅÔÅ ÚÁÐÉÓÁÔØ ÍÁËÒÏ ×ÎÕÔÒÉ ÍÁËÒÏ, ÔÏÌØËÏ Ó ÄÒÕÇÉÍ ÎÏÍÅÒÏÍ. ÷Ù ÔÁËÖÅ ÍÏÖÅÔÅ ×ÙÚÙ×ÁÔØ ÒÁÎÅÅ ÚÁÐÉÓÁÎÎÏÅ ÍÁËÒÏ ÐÒÉ ÚÁÐÉÓÉ ÎÏ×ÏÇÏ. .SS ðÏ×ÔÏÒ ÷Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ËÏÍÁÎÄÕ ÐÏ×ÔÏÒÁ \fB^K \e\fR, ÞÔÏÂÙ ÐÏ×ÔÏÒÑÔØ ×ÙÚÏ× ÍÁËÒÏ ÉÌÉ ÌÀÂÏÊ ËÏÍÁÎÄÙ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ, ÉÌÉ ÄÁÖÅ ÏÂÙÞÎÙÊ ÓÉÍ×ÏÌ, ÕËÁÚÁÎÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÒÁÚ. îÁÖÍÉÔÅ \fB^K \e\fR, ××ÅÄÉÔÅ ÖÅÌÁÅÍÏÅ ÞÉÓÌÏ ÐÏ×ÔÏÒÅÎÉÊ ËÏÍÁÎÄÙ É ÎÁÖÍÉÔÅ \fBEnter\fR. óÌÅÄÕÀÝÁÑ ××ÅÄÅÎÎÁÑ ËÏÍÁÎÄÁ ÐÏ×ÔÏÒÉÔÓÑ ÕËÁÚÁÎÎÏÅ ÞÉÓÌÏ ÒÁÚ. îÁÐÒÉÍÅÒ, ÄÌÑ ÕÄÁÌÅÎÉÑ ÓÌÅÄÕÀÝÉÈ 20 ÓÔÒÏË ÔÅËÓÔÁ ÎÁÖÍÉÔÅ: \fB^K \e\ 20\fR\fB^Y\fR .SS òÅÖÉÍ ÐÒÑÍÏÕÇÏÌØÎÙÈ ÂÌÏËÏ× îÁÖÍÉÔÅ \fB^T X\fR ÅÓÌÉ ÈÏÔÉÔÅ, ÞÔÏÂÙ ÐÏ \fB^K B\fR É \fB^K K\fR ÏÔÍÅÞÁÌÉÓØ ÐÒÑÍÏÕÇÏÌØÎÙÅ, Á ÎÅ ÐÏÓÔÒÏÞÎÙÅ ÂÌÏËÉ. üÔÏÔ ÒÅÖÉÍ ÐÏÌÅÚÅÎ ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ, ËÏÐÉÒÏ×ÁÎÉÑ, ÕÄÁÌÅÎÉÑ ÉÌÉ ÓÏÈÒÁÎÅÎÉÑ ËÏÌÏÎÏË ÔÅËÓÔÁ. ÷Ù ÔÁËÖÅ ÍÏÖÅÔÅ ÆÉÌØÔÒÏ×ÁÔØ ËÏÌÏÎËÉ ÔÅËÓÔÁ Ó ÐÏÍÏÝØÀ ËÏÍÁÎÄÙ \fB^K /\fR, ÅÓÌÉ, Ë ÐÒÉÍÅÒÕ, ÐÏÖÅÌÁÅÔÅ ÏÔÓÏÒÔÉÒÏ×ÁÔØ ËÏÌÏÎËÕ. ôÁËÖÅ ÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ËÏÍÁÎÄÕ ×ÓÔÁ×ËÉ ÆÁÊÌÁ \fB^K R\fR. ëÏÇÄÁ ×ËÌÀÞÅÎ ÒÅÖÉÍ ÐÒÑÍÏÕÇÏÌØÎÙÈ ÂÌÏËÏ×, ÔÁËÖÅ ÍÏÖÅÔ ÏËÁÚÁÔØÓÑ ÐÏÌÅÚÎÙÍ ×ËÌÀÞÉÔØ ÒÅÖÉÍ ÚÁÍÅÝÅÎÉÑ (\fB^T T\fR). ÷ ÜÔÏÍ ÓÌÕÞÁÅ ÐÒÑÍÏÕÇÏÌØÎÉËÉ ÂÕÄÕÔ ÚÁÍÅÝÁÔØ ÓÕÝÅÓÔ×ÕÀÝÉÊ ÔÅËÓÔ. ôÁËÖÅ ËÏÍÁÎÄÁ ÕÄÁÌÅÎÉÑ ÂÌÏËÁ (\fB^K Y\fR) ÂÕÄÅÔ ÚÁÐÏÌÎÑÔØ ÏÔÍÅÞÅÎÎÙÅ ÐÒÑÍÏÕÇÏÌØÎÉËÉ ÐÒÏÂÅÌÁÍÉ É ÔÁÂÕÌÑÔÏÒÁÍÉ ×ÍÅÓÔÏ ÔÏÇÏ, ÞÔÏÂÙ ÕÄÁÌÑÔØ ÉÈ. òÅÖÉÍ ÚÁÍÅÝÅÎÉÑ ÔÁËÖÅ ÍÏÖÅÔ ÂÙÔØ ÐÏÌÅÚÅÎ ÐÒÉ ×ÙÐÏÌÎÅÎÉÉ ËÏÍÁÎÄÙ ÆÉÌØÔÒÁÃÉÉ ÂÌÏËÁ (\fB^K /\fR), ÐÏÓËÏÌØËÕ ÉÓÈÏÄÎÁÑ ÛÉÒÉÎÅ ×ÙÂÒÁÎÎÏÊ ËÏÌÏÎËÉ ÏÓÔÁÎÅÔÓÑ ÎÅÉÚÍÅÎÎÏÊ. .SS ðÏÉÓË ÔÁÇÏ× åÓÌÉ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÂÏÌØÛÕÀ ÐÒÏÇÒÁÍÍÕ ÎÁ ÑÚÙËÅ C ÓÏ ÍÎÏÇÉÍÉ ÉÓÈÏÄÎÙÍÉ ÆÁÊÌÁÍÉ - ÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÐÒÏÇÒÁÍÍÕ \fBctags\fR ÄÌÑ ÇÅÎÅÒÁÃÉÉ ÆÁÊÌÁ \fBÔÁÇÏ×\fR. üÔÏÔ ÆÁÊÌ ÓÏÄÅÒÖÉÔ ÓÐÉÓÏË ÉÍÅÎ, ÉÓÐÏÌØÚÕÅÍÙÈ × ÐÒÏÇÒÁÍÍÅ É ÐÏÚÉÃÉÊ × ÆÁÊÌÁÈ, ÇÄÅ ÜÔÉ ÉÍÅÎÁ ÏÐÒÅÄÅÌÅÎÙ. ëÏÍÁÎÄÁ \fB^K ;\fR ÍÏÖÅÔ ÉÓÐÏÌØÚÏ×ÁÔØÓÑ ÄÌÑ ÐÏÉÓËÁ ÉÍÅÎ (ÆÕÎËÃÉÊ, ÐÒÅÄÏÐÒÅÄÅÌÅÎÎÙÈ ËÏÎÓÔÁÎÔ, É Ô.Ð.), ÚÁÇÒÕÚËÉ ÆÁÊÌÁ, × ËÏÔÏÒÏÍ ÏÐÒÅÄÅÌÅÎÏ ÄÁÎÎÏÅ ÉÍÑ, × ÔÅËÕÝÅÅ ÏËÎÏ, É ÐÏÚÉÃÉÏÎÉÒÏ×ÁÎÉÑ ËÕÒÓÏÒÁ × ÔÏÞËÕ ÏÐÒÅÄÅÌÅÎÉÑ. \fB^K ;\fR ÚÁÐÒÁÛÉ×ÁÅÔ ÔÒÅÂÕÅÍÏÅ ÉÍÑ, ÉÓÐÏÌØÚÕÑ ÓÌÏ×Ï, ÎÁ ËÏÔÏÒÏÍ ÎÁÈÏÄÉÔÓÑ ËÕÒÓÏÒ, × ËÁÞÅÓÔ×Å ÕÍÏÌÞÁÎÉÑ. ðÏÓËÏÌØËÕ \fB^K ;\fR ÚÁÇÒÕÖÁÅÔ ÆÁÊÌ ÏÐÒÅÄÅÌÅÎÉÑ × ÔÅËÕÝÅÅ ÏËÎÏ - ×ÏÚÍÏÖÎÏ, ×ÁÍ ÐÏÔÒÅÂÕÅÔÓÑ ÓÎÁÞÁÌÁ ÒÁÚÒÅÚÁÔØ ÏËÎÏ Ó ÐÏÍÏÝØÀ ËÏÍÁÎÄÙ \fB^K O\fR, ÞÔÏÂÙ ×ÉÄÅÔØ ÏÄÎÏ×ÒÅÍÅÎÎÏ É ÉÓÈÏÄÎÙÊ ÆÁÊÌ, É ÆÁÊÌ ÏÐÒÅÄÅÌÅÎÉÑ. .SS ïËÎÁ ÛÅÌÌÏ× îÁÖÍÉÔÅ \fB^K '\fR ÄÌÑ ×ÙÐÏÌÎÅÎÉÑ ËÏÍÁÎÄÎÏÇÏ ÛÅÌÌÁ × ÏËÎÅ JOE. ëÏÇÄÁ ËÕÒÓÏÒ ÎÁÈÏÄÉÔÓÑ × ËÏÎÃÅ ÏËÎÁ ÛÅÌÌÁ (ÉÓÐÏÌØÚÕÊÔÅ ÄÌÑ ÜÔÏÇÏ \fB^K V\fR), ×ÓÅ, ÞÔÏ ×Ù ××ÏÄÉÔÅ - ÂÕÄÅÔ ÐÅÒÅÄÁ×ÁÔØÓÑ × ÛÅÌÌ, Á ÎÅ × ÏËÎÏ. ìÀÂÏÊ ×Ù×ÏÄ ÛÅÌÌÁ ÉÌÉ ×ÙÚÙ×ÁÅÍÙÈ ÐÒÏÇÒÁÍÍ, ×ÙÐÏÌÎÑÅÍÙÈ × ÎÅÍ, ÂÕÄÅÔ ÄÏÂÁ×ÌÑÔØÓÑ × ÏËÎÏ (ËÕÒÓÏÒ ÂÕÄÅÔ ÐÅÒÅÍÅÝÁÔØÓÑ ÚÁ ÜÔÏÔ ×Ù×ÏÄ, ÅÓÌÉ ÎÁÈÏÄÉÌÓÑ × ËÏÎÃÅ ÏËÎÁ ÛÅÌÌÁ). üÔÁ ËÏÍÁÎÄÁ ÐÏÌÅÚÎÁ ÄÌÑ ÚÁÐÉÓÉ ÛÅÌÌ-ËÏÍÁÎÄ, ÎÁÐÒÉÍÅÒ, ×Ù×ÏÄÁ \fBmake\fR, ÒÅÚÕÌØÔÁÔÁ \fBgrep\fR ÎÁÄ ÍÎÏÖÅÓÔ×ÏÍ ÆÁÊÌÏ×, ÉÌÉ ÓÐÉÓËÁ ÆÁÊÌÏ× ÉÚ ÓÅÁÎÓÁ \fBFTP\fR. ëÒÏÍÅ ÔÏÇÏ, ÐÅÞÁÔÁÅÍÙÅ ÓÉÍ×ÏÌÙ, ËÌÁ×ÉÛÉ ^C, Backspace, DEL, Enter É ^D ÐÅÒÅÄÁÀÔÓÑ × ÛÅÌÌ. ÷×ÅÄÉÔÅ ËÏÍÁÎÄÕ ÛÅÌÌÁ \fBexit\fR ÄÌÑ ÐÒÅËÒÁÝÅÎÉÑ ÚÁÐÉÓÉ ×Ù×ÏÄÁ ÛÅÌÌÁ. åÓÌÉ × ÏËÎÅ ÛÅÌÌÁ ×Ù ÎÁÖÍÅÔÅ \fB^C\fR, ËÏÇÄÁ ËÕÒÓÏÒ ÎÁÈÏÄÉÔÓÑ ÎÅ × ËÏÎÃÅ ÏËÎÁ, ÛÅÌÌ ÂÕÄÅÔ ÐÒÅÒ×ÁÎ. .SH ðÅÒÅÍÅÎÎÙÅ \fBóÒÅÄÙ\ äÌÑ ËÏÒÒÅÔÎÏÊ ÒÁÂÏÔÙ JOE ÎÅÏÂÈÏÄÉÍÏ ÐÒÁ×ÉÌØÎÏ ÕÓÔÁÎÏ×ÉÔØ ÎÅËÏÔÏÒÙÅ ÐÅÒÅÍÅÎÎÙÅ ÓÒÅÄÙ. óËÏÒÏÓÔØ (× ÂÏÄÁÈ) Ó×ÑÚÉ ÍÅÖÄÕ ËÏÍÐØÀÔÅÒÏÍ É ×ÁÛÉÍ ÔÅÒÍÉÎÁÌÏÍ ÓÌÅÄÕÅÔ ÐÒÁ×ÉÌØÎÏ ÕËÁÚÙ×ÁÔØ ÄÌÑ JOE, ÞÔÏÂÙ ÜËÒÁÎ ÐÅÒÅÒÉÓÏ×Ù×ÁÌÓÑ ÐÌÁ×ÎÏ É ÍÏÖÎÏ ÂÙÌÏ ××ÏÄÉÔØ ×ÓÌÅÐÕÀ ÄÌÑ ÏÐÔÉÍÉÚÁÃÉÉ ÏÔÌÏÖÅÎÎÏÇÏ ×Ù×ÏÄÁ. äÌÑ ÕÓÔÁÎÏ×ËÉ ÜÔÏÇÏ ÉÓÐÏÌØÚÕÊÔÅ ËÏÍÁÎÄÕ \fBstty nnn\fR. úÎÁÞÅÎÉÅ ÓÌÅÄÕÅÔ ÕËÁÚÙ×ÁÔØ ÎÁÓÔÏÌØËÏ ÔÏÞÎÏ, ÎÁÓËÏÌØËÏ ÜÔÏ ×ÏÚÍÏÖÎÏ. îÁÐÒÉÍÅÒ, ÅÓÌÉ ×Ù ÐÏÄËÌÀÞÁÅÔÅÓØ ÞÅÒÅÚ ÍÏÄÅÍ ÓÏ ÓËÏÒÏÓÔØÀ 1200 ÂÏÄ - ×ÁÍ ÓÌÅÄÕÅÔ ÉÓÐÏÌØÚÏ×ÁÔØ ÄÌÑ \fBstty\fR ÉÍÅÎÎÏ ÜÔÏ ÚÎÁÞÅÎÉÅ. åÓÌÉ ×Ù ÐÏÄËÌÀÞÁÅÔÅÓØ ÞÅÒÅÚ ÍÏÄÅÍ ÓÏ ÓËÏÒÏÓÔØÀ 14.4kÂÏÄ, ÎÏ ÔÅÒÍÉÎÁÌØÎÙÊ ÓÅÒ×ÅÒ, Ë ËÏÔÏÒÏÍÕ ×Ù ÐÏÄËÌÀÞÅÎÙ, Ó×ÑÚÁÎ Ó ËÏÍÐØÀÔÅÒÏÍ ÎÁ ÓËÏÒÏÓÔÉ 9600 ÂÏÄ, ×ÁÍ ÓÌÅÄÕÅÔ ÕÓÔÁÎÏ×ÉÔØ ÓËÏÒÏÓÔØ 9600. óÐÅÃÉÁÌØÎÁÑ ÓËÏÒÏÓÔØ 38400 ÉÌÉ \fBextb\fR ÉÓÐÏÌØÚÕÅÔÓÑ ÄÌÑ ÕËÁÚÁÎÉÑ ÔÏÇÏ, ÞÔÏ ×Ù ÉÓÐÏÌØÚÕÅÔÅ ×ÙÓÏËÏÓËÏÒÏÓÔÎÏÅ ÐÏÄËÌÀÞÅÎÉÅ, ÔÁËÏÅ ËÁË ËÏÎÓÏÌØ ÉÌÉ ÜÍÕÌÑÔÏÒ ÔÅÒÍÉÎÁÌÁ × X-window. åÓÌÉ ×Ù ÎÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ \fBstty\fR ÄÌÑ ÕÓÔÁÎÏ×ËÉ ÒÅÁÌØÎÏÊ ÓËÏÒÏÓÔÉ (×ÏÚÍÏÖÎÏ, ÐÏÔÏÍÕ, ÞÔÏ ÓËÏÒÏÓÔØ Ó×ÑÚÉ ÍÏÄÅÍÁ Ó ËÏÍÐØÀÔÅÒÏÍ ÏÔÌÉÞÁÅÔÓÑ ÏÔ ÓËÏÒÏÓÔÉ × ÌÉÎÉÉ) - ×Ù ÍÏÖÅÔÅ ×ÍÅÓÔÏ ÜÔÏÇÏ ÚÁÐÉÓÁÔØ ÞÉÓÌÏ×ÏÅ ÚÎÁÞÅÎÉÅ × ÐÅÒÅÍÅÎÎÕÀ ÓÒÅÄÙ \fBBAUD\fR (ÉÓÐÏÌØÚÕÊÔÅ \fBsetenv BAUD 9600\fR ÄÌÑ csh ÉÌÉ \fBBAUD=9600; export BAUD\fR ÄÌÑ sh). ðÅÒÅÍÅÎÎÁÑ ÓÒÅÄÙ \fBTERM\fR ÄÏÌÖÎÁ ÕËÁÚÙ×ÁÔØ ÎÁ ÔÉÐ ÉÓÐÏÌØÚÕÅÍÏÇÏ ×ÁÍÉ ÔÅÒÍÉÎÁÌÁ. åÓÌÉ ÒÁÚÍÅÒ (ÞÉÓÌÏ ÓÔÒÏË/ËÏÌÏÎÏË) ×ÁÛÅÇÏ ÔÅÒÍÉÎÁÌÁ ÏÔÌÉÞÁÅÔÓÑ ÏÔ ÕËÁÚÁÎÎÏÇÏ × ÅÇÏ ÏÐÉÓÁÎÉÉ TERMCAP ÉÌÉ TERMINFO - ×Ù ÍÏÖÅÔÅ ÕÓÔÁÎÏ×ÉÔØ ÐÒÁ×ÉÌØÎÏÅ ÚÎÅÎÉÅ Ó ÐÏÍÏÝØÀ ËÏÍÁÎÄÙ \fBstty rows nn cols nn\fR, ÉÌÉ ÏÐÒÅÄÅÌÉ× ÐÅÒÅÍÅÎÎÙÅ ÓÒÅÄÙ \fBLINES\fR É \fBCOLUMNS\fR. ïÂÙÞÎÏ JOE ÏÖÉÄÁÅÔ, ÞÔÏ ÄÌÑ ÕÐÒÁ×ÌÅÎÉÑ ÐÏÔÏËÏÍ ÄÁÎÎÙÈ ÍÅÖÄÕ ËÏÍÐØÀÔÅÒÏÍ É ×ÁÛÉÍ ÔÅÒÍÉÎÁÌÏÍ ÉÓÐÏÌØÚÕÅÔÓÑ ÐÒÏÔÏËÏÌ ^S/^Q (Ô.Å., ÅÓÌÉ ËÏÍÐØÀÔÅÒ ÐÏÓÙÌÁÅÔ ÄÁÎÎÙÅ ÓÌÉÛËÏÍ ÂÙÓÔÒÏ ÄÌÑ ×ÁÛÅÇÏ ÔÅÒÍÉÎÁÌÁ - ÔÅÒÍÉÎÁÌ ÐÏÓÙÌÁÅÔ ^S ÄÌÑ ÐÒÉÏÓÔÁÎÏ×ËÉ ×Ù×ÏÄÁ É ^Q ÄÌÑ ÅÇÏ ÐÒÏÄÏÌÖÅÎÉÑ). åÓÌÉ ÄÌÑ ÕÐÒÁ×ÌÅÎÉÑ ÐÏÔÏËÏÍ ÉÓÐÏÌØÚÕÅÔÓÑ ÁÐÐÁÒÁÔÎÙÊ ÐÒÏÔÏËÏÌ, ÉÌÉ ÅÓÌÉ ×ÁÛ ÔÅÒÍÉÎÁÌ ÄÏÓÔÁÔÏÞÎÏ ÂÙÓÔÒ, ÞÔÏÂÙ ×ÓÅÇÄÁ ×Ï-×ÒÅÍÑ ÏÔÒÁÂÁÔÙ×ÁÔØ ËÏÍÐØÀÔÅÒÎÙÊ ×Ù×ÏÄ É ×Ù ÖÅÌÁÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ^S/^Q × ËÁÞÅÓÔ×Å ËÏÍÁÎÄ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ - ×Ù ÍÏÖÅÔÅ ÕÓÔÁÎÏ×ÉÔØ ÐÅÒÅÍÅÎÎÕÀ ÓÒÅÄÙ \fBNOXON\fR, ÞÔÏÂÙ JOE ÐÙÔÁÌÓÑ ÐÒÉÎÉÍÁÔØ ^S/^Q. åÓÌÉ Ó×ÑÚØ ÍÅÖÄÕ ËÏÍÐØÀÔÅÒÏÍ É ×ÁÛÉÍ ÔÅÒÍÉÎÁÌÏÍ ÎÅ ÉÓÐÏÌØÚÕÅÔ ÎÉËÁËÏÇÏ ÐÒÏÔÏËÏÌÁ ÕÐÒÁ×ÌÅÎÉÑ ÐÏÔÏËÏÍ, Á ×ÁÛ ÔÅÒÍÉÎÁÌ ÎÅÄÏÓÔÁÔÏÞÎÏ ÂÙÓÔÒ, ÞÔÏÂÙ ×Ï×ÒÅÍÑ ÏÔÒÁÂÁÔÙ×ÁÔØ ×Ù×ÏÄ ËÏÍÐØÀÔÅÒÁ - ÍÏÖÅÔÅ ÕÓÔÁÎÏ×ÉÔØ ÐÅÒÅÍÅÎÎÕÀ ÓÒÅÄÙ \fBDOPADDING\fR, ÞÔÏÂÙ \fBJOE\fR ÚÁÍÅÄÌÑÌ ×Ù×ÏÄ ÐÕÔÅÍ ×ÓÔÁ×ËÉ ÓÉÍ×ÏÌÏ× ÚÁÐÏÌÎÅÎÉÑ × ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÉ ÉÚÍÅÎÅÎÉÑ ÜËÒÁÎÁ. .SH éÍÅÎÁ ÆÁÊÌÏ× ëÏÇÄÁ JOE ÏÖÉÄÁÅÔ ÏÔ ×ÁÓ ××ÏÄÁ ÉÍÅÎÉ ÆÁÊÌÁ - ÎÅ×ÁÖÎÏ, ÉÚ ËÏÍÁÎÄÎÏÊ ÌÉ ÓÔÒÏËÉ, ÉÌÉ ÐÏ ÚÁÐÒÏÓÕ ÒÅÄÁËÔÏÒÁ, ×Ù ÔÁËÖÅ ÍÏÖÅÔÅ ××ÏÄÉÔØ: .IP \fB!command þÉÔÁÔØ ÉÌÉ ÐÉÓÁÔØ ÄÁÎÎÙÅ ÉÚ ÉÌÉ × ËÏÍÁÎÄÕ ÛÅÌÌÁ. îÁÐÒÉÍÅÒ, ÉÓÐÏÌØÚÕÊÔÅ \fBjoe '!ls'\fR ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ×ÓÅÈ ÆÁÊÌÏ× ÉÚ ÔÅËÕÝÅÊ ÄÉÒÅËÔÏÒÉÉ, ÉÌÉ × ÒÅÄÁËÔÏÒÅ ×ÙÐÏÌÎÉÔÅ \fB^K D !mail jhallen@world.std.com\fR ÄÌÑ ÏÔÐÒÁ×ËÉ ÍÎÅ ÒÅÄÁËÔÉÒÕÅÍÏÇÏ ÆÁÊÌÁ. .IP \fB>>filename éÓÐÏÌØÚÕÊÔÅ ÜÔÏ, ÞÔÏÂÙ JOE ÄÏÂÁ×ÉÌ ÒÅÄÁËÔÉÒÕÅÍÙÊ ÔÅËÓÔ × ËÏÎÅà ÆÁÊÌÁ "filename." .IP \fBfilename,START,SIZE éÓÐÏÌØÚÕÊÔÅ ÜÔÏ ÄÌÑ ÄÏÓÔÕÐÁ Ë ÏÐÒÅÄÅÌÅÎÎÏÊ ÞÁÓÔÉ ÆÁÊÌÁ ÉÌÉ ÕÓÔÒÏÊÓÔ×Á. \fBSTART\fR É \fBSIZE\fR ÍÏÇÕÔ ÕËÁÚÙ×ÁÔØÓÑ × ÄÅÓÑÔÉÞÎÏÍ ×ÉÄÅ (ÎÁÐÒ.: 123), × ×ÏÓØÍÅÒÉÞÎÏÍ (ÎÁÐÒ.: 0777) ÉÌÉ ÛÅÓÔÎÁÄÃÁÔÉÒÉÞÎÏÍ (ÎÁÐÒ.: 0xFF). îÁÐÒÉÍÅÒ, ÉÓÐÏÌØÚÕÊÔÅ \fBjoe /dev/fd0,508,2\fR ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ÂÁÊÔÏ× 508 É 509 ÎÁ ÐÅÒ×ÏÍ ÆÌÏÐÐÉ-ÄÉÓËÅ × Linux. .IP \fB- éÓÐÏÌØÚÕÊÔÅ ÜÔÏ ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÄÁÎÎÙÈ ÓÏ ÓÔÁÎÄÁÒÔÎÏÇÏ ××ÏÄÁ ÉÌÉ ÄÌÑ ÚÁÐÉÓÉ ÎÁ ÓÔÁÎÄÁÒÔÎÙÊ ×Ù×ÏÄ. îÁÐÒÉÍÅÒ, ×Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ joe × ËÏÎ×ÅÊÅÒÅ ËÏÍÁÎÄ: \fBquota -v | joe - | mail root\fR, ÅÓÌÉ ÈÏÔÉÔÅ ÐÏÖÁÌÏ×ÁÔØÓÑ ÎÁ ×ÁÛÉ ÎÉÚËÉÅ Ë×ÏÔÙ. .SH æÁÊÌ \ joerc ÷ÓÅ ÏÐÃÉÉ, ÄÏÓÔÕÐÎÙÅ ÐÏ \fB^T\fR, ÜËÒÁÎ ÐÏÄÓËÁÚËÉ É ËÏÍÂÉÎÁÃÉÉ ËÌÁ×ÉÛ ËÏÍÁÎÄ ÒÅÄÁËÔÏÒÁ ÏÐÒÅÄÅÌÑÀÔÓÑ × ÉÎÉÃÉÁÌÉÚÁÃÉÏÎÎÏÍ ÆÁÊÌÅ JOE. åÓÌÉ ×Ù ÓËÏÐÉÒÕÅÔÅ ÜÔÏÔ ÆÁÊÌ (ÏÂÙÞÎÏ ÒÁÓÐÏÌÏÖÅÎÎÙÊ × \fB@JOERC@/joerc\fR) × \fB$HOME/.joerc\fR, ÔÏ ÓÍÏÖÅÔÅ ÎÁÓÔÒÁÉ×ÁÔØ ×ÓÅ ÜÔÏ ÐÏ Ó×ÏÅÍÕ ×ËÕÓÕ. óÉÎÔÁËÓÉÓ ÉÎÉÃÉÁÌÉÚÁÃÉÏÎÎÏÇÏ ÆÁÊÌÁ ÄÏÓÔÁÔÏÞÎÏ ÐÏÎÑÔÅÎ, É ×ÎÕÔÒÉ ÎÅÇÏ ÓÏÄÅÒÖÁÔÓÑ ÐÏÄÒÏÂÎÙÅ ÉÎÓÔÒÕËÃÉÉ. .SH âÌÁÇÏÄÁÒÎÏÓÔÉ JOE ÂÙÌ ÎÁÐÉÓÁÎ Joseph H. Allen. åÓÌÉ Õ ×ÁÓ ÉÍÅÀÔÓÑ ÏÔÞÅÔÙ Ï ÏÛÉÂËÁÈ ÉÌÉ ×ÏÐÒÏÓÙ - ÐÉÛÉÔÅ ÅÍÕ ÐÏ ÁÄÒÅÓÕ jhallen@world.std.com. Larry Foard (entropy@world.std.com) É Gary Gray (ggray@world.std.com) ÔÁËÖÅ ÐÏÍÏÇÌÉ × ÓÏÚÄÁÎÉÉ JOE. ðÅÒÅ×ÏÄ ÎÁ ÒÕÓÓËÉÊ ÑÚÙË - àÒÉÊ ëÁÌÉÎÉÞÅÎËÏ joe-3.7/man/ru/Makefile.am0000644000100100007640000000055711101510604012303 00000000000000sysconf_joedir = $(sysconfdir)/joe data_joedir = $(datadir)/joe data_docdir = $(docdir) man_MANS = joe.1 mandir = @mandir@/ru EXTRA_DIST = joe.1.in joe.1 : joe.1.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,; s,@BINDIR\@,$(bindir),' $(srcdir)/joe.1.in > $@ MOSTLYCLEANFILES = $(man_MANS) joe-3.7/man/ru/Makefile.in0000644000100100007640000002462011102222344012313 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(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@ subdir = man/ru DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 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) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/autoconf.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ 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 = @INSTALL@ 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@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ 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@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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@ builddir = @builddir@ 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@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@/ru mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ sysconf_joedir = $(sysconfdir)/joe data_joedir = $(datadir)/joe data_docdir = $(docdir) man_MANS = joe.1 EXTRA_DIST = joe.1.in MOSTLYCLEANFILES = $(man_MANS) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/ru/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu man/ru/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-man1: $(man1_MANS) $(man_MANS) @$(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 tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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 check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)"; 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: all-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: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: 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-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-man1 install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-man uninstall-man1 joe.1 : joe.1.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,; s,@BINDIR\@,$(bindir),' $(srcdir)/joe.1.in > $@ # 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: joe-3.7/man/joe.1.in0000644000100100007640000010776011100502637011077 00000000000000.TH JOE 1 .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 ]... .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 five different editors, it still requires only one executable, but one with five different names. The name of the editor with an "rc" appended gives the name of JOE's initialization file, which determines the personality of the editor. JOE is free software; you can distribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. I have no plans for turning JOE into a commercial or share-ware product. JOE is available over the Internet from \fBwww.sourceforge.net/projects/joe-editor\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. 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 customize the keyboard layout, the help screens and a number of behavior defaults by copying JOE's initialization file (usually \fB@JOERC@/joerc\fR) to \fB.joerc\fR in your home directory and then by modifying it. See the section \fBjoerc\fR below. To have JOE used as your default editor for e-mail and News, you need to set the \fBEDITOR\fR and \fBVISUAL\fR environment variables in your shell initialization file (\fB.cshrc\fR or \fB.profile\fR) to refer to JOE (joe usually resides as \fB@BINDIR@/joe\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 optimization. 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-terms 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 which it's 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 key-stroke. .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 top-most 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. The JOETERM environment variable may be set to override the regular TERM environment variable for specifying your terminal type. 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 -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. .LP These options can also be specified in the joerc file. They can be set depending on the file-name 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. PASCAL and C 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 initialization 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. 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 Over-type 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 over-type 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 idealized typewriter would. Also, \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. Over-type 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 over-type 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 - 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 - 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 \fBASIS\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 e-mail 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, \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 sub-string \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 accidently 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 key-strokes. 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 key-strokes 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 key-strokes 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 \e\ 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- if you want to sort a column, for example. The insert file command, \fB^K R\fR is also effected. When rectangle mode is selected, over-type mode is also useful (\fB^T T\fR). When over-type 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. Over-type 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- for 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 \fBEnvironment\ 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 \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. 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 initialization file. If you make a copy of this file (which normally resides in \fB@JOERC@/joerc\fR) to \fB$HOME/.joerc\fR, you can customize these setting to your liking. The syntax of the initialization 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, e-mail 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. joe-3.7/man/Makefile.am0000644000100100007640000000054711101510604011654 00000000000000sysconf_joedir = $(sysconfdir)/joe data_joedir = $(datadir)/joe data_docdir = $(docdir) SUBDIRS = ru man_MANS = joe.1 EXTRA_DIST = joe.1.in joe.1 : joe.1.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,; s,@BINDIR\@,$(bindir),' $(srcdir)/joe.1.in > $@ MOSTLYCLEANFILES = $(man_MANS) joe-3.7/man/Makefile.in0000644000100100007640000003752711102222343011676 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(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@ subdir = man DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 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) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/autoconf.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ 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 = @INSTALL@ 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@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ 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@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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@ builddir = @builddir@ 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@ 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@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ sysconf_joedir = $(sysconfdir)/joe data_joedir = $(datadir)/joe data_docdir = $(docdir) SUBDIRS = ru man_MANS = joe.1 EXTRA_DIST = joe.1.in MOSTLYCLEANFILES = $(man_MANS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu man/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-man1: $(man1_MANS) $(man_MANS) @$(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 # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ 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: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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; }'`; \ 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: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ 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; }'`; \ 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) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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 list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: 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-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-man1 install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic ctags \ ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-man uninstall-man1 joe.1 : joe.1.in sed 's,@JOERC\@,$(sysconf_joedir),; s,@JOEDOC\@,$(data_docdir),; s,@JOEDATA\@,$(data_joedir),; s,@SPELL\@,@SPELL@,; s,@BINDIR\@,$(bindir),' $(srcdir)/joe.1.in > $@ # 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: joe-3.7/w.c0000644000100100007640000003771710457233470007510 00000000000000/* * Window system * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" /* 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); } /* 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; w->reqh = h; tmp = 1000L * h; w->hh = tmp / (w->t->h - w->t->wind) + (tmp % (w->t->h - w->t->wind) ? 1 : 0); } /* 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 = (Screen *) joe_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; } } 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 && w->watom->ins) w->watom->ins(w->object, 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 && w->watom->del) w->watom->del(w->object, b, l, n, flg); } w = w->link.next; } while (w != scr->topwin); } } W *watpos(Screen *t,int x,int y) { W *w=t->topwin; do if(w->y>=0 && w->y<=y && w->y+w->h>y && w->x<=x && w->x+w->w>x) return w; while(w=w->link.next, w!=t->topwin); return 0; } /* 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); 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); /* 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) { 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); } 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; } /* Grow window up */ int wgrowup(W *w) { return wshrink(w->link.prev->main); } /* Grow window down */ int wgrowdown(W *w) { return wgrow(w->link.prev->main); } /* 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) < 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, unsigned char *huh, int *notify) { W *new; if (height < 1) return NULL; /* Create the window */ new = (W *) joe_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 = NULL; new->msgb = NULL; new->msgt = NULL; /* Set window's target and family */ /* was: if (new->win = target) { which may be mistyped == */ 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 */ joe_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)); 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) { *ret = w->watom->abort(w->object); if (w->notify) *w->notify = -1; } else { *ret = -1; if (w->notify) *w->notify = 1; } rmkbd(w->kbd); joe_free(w); windie(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 */ int bg_msg; static void mdisp(SCRN *t, int y, 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, BG_COLOR(bg_msg), 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 = 0; } if (w->msgt) { mdisp(t, w->y + ((w->h > 1 && (w->y || !staen)) ? 1 : 0), w->msgt); w->msgt = 0; } } /* Set temporary message */ unsigned char msgbuf[JOE_MSGBUFSIZE]; /* display message on bottom line of window */ void msgnw(W *w, unsigned char *s) { w->msgb = s; } void msgnwt(W *w, unsigned char *s) { w->msgt = s; } int urtn(BASE *b, int k) { if (b->parent->watom->rtn) return b->parent->watom->rtn(b, k); else return -1; } int utype(BASE *b, int k) { if (b->parent->watom->type) return b->parent->watom->type(b, 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; } /* Get message window on screen */ W *find_window(Screen *t, B *b) { W *w = t->topwin; do { if (w->watom == &watomtw && ((BW *)w->object)->b == b) return w; w = w->link.next; } while(w != t->topwin); return 0; } int umwind(BW *bw) { W *msgw; if (!errbuf) { msgnw(bw->parent, joe_gettext(_("There is no message buffer"))); return -1; } /* Find message window */ msgw = find_window(bw->parent->t, errbuf); if (msgw) { /* The window exists */ bw->parent->t->curwin = msgw; wshowone(msgw); return 0; } else { /* Make it the current window */ msgw = bw->parent; get_buffer_in_window(bw, errbuf); wshowone(msgw); return 0; } } /* Fit previous window and current window on screen. If there is no previous window, * split the current window to create one. */ int umfit(BW *bw) { W *p; W *w = bw->parent->main; Screen *t = w->t; wshowone(w); p = findtopw(w)->link.prev->main; if (p == w) { /* We have to split */ usplitw(bw); } w = t->curwin; p = findtopw(w)->link.prev->main; if (p == w) { return -1; } /* Request size */ if (p->t->h - 6 < 3) return -1; seth(p, p->t->h - 6); t->topwin = p; t->curwin = p; /* Fit them on the screen */ wfit(t); t->curwin = w; wfit(t); return 0; } joe-3.7/w.h0000644000100100007640000001576711100666530007507 00000000000000/* * Window management * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_W_H #define _JOE_W_H 1 struct watom { unsigned char *context; /* Context name */ void (*disp) (); /* Display window */ void (*follow) (); /* Called to have window follow cursor */ int (*abort) (); /* Common user functions */ int (*rtn) (); int (*type) (); void (*resize) (); /* Called when window changed size */ void (*move) (); /* Called when window moved */ void (*ins) (); /* Called on line insertions */ void (*del) (); /* Called on line deletions */ int what; /* Type of this thing */ }; /* A screen with windows */ 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 */ }; /* A window (base class) */ 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 */ void *object; /* Object which inherits this */ #if 0 union { /* FIXME: instead of void *object we should */ BW *bw; /* use this union to get strict type checking */ PW *pw; /* from C compiler (need to check and change */ QW *qw; /* all of the occurrencies of ->object) */ TW *tw; MENU *menu; BASE *base; } object; #endif unsigned char *msgt; /* Message at top of window */ unsigned char *msgb; /* Message at bottom of window */ 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; }; /***************/ /* Subroutines */ /***************/ /* int getgrouph(W *); * Get height of a family of windows */ int getgrouph PARAMS((W *w)); /* W *findtopw(W *); * Find first (top-most) window of a family */ W *findtopw PARAMS((W *w)); /* W *findbotw(W *); * Find last (bottom-most) window a family */ W *findbotw PARAMS((W *w)); int demotegroup PARAMS((W *w)); /* W *lastw(Screen *t); * Find last window on screen */ W *lastw PARAMS((Screen *t)); /* Determine number of main windows */ int countmain PARAMS((Screen *t)); /* void wfit(Screen *t); * * Fit all of the windows onto the screen */ void wfit PARAMS((Screen *t)); /* W *watpos(Screen *t, int x, int y); * Return the window at the given location, or NULL if there is none */ W *watpos PARAMS((Screen *t, int x, int y)); /*****************/ /* Main routines */ /*****************/ /* Screen *screate(SCRN *); * * Create a screen */ Screen *screate PARAMS((SCRN *scrn)); /* void sresize(Screen *t); * Screen size changed */ void sresize PARAMS((Screen *t)); /* void chsize(Screen *t,int mul,int div) * Resize windows: each window is multiplied by the fraction mul/div */ /* void chsize PARAMS(()); */ /* 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 PARAMS((Screen *t, WATOM *watom, W *where, W *target, W *original, int height, unsigned char *huh, int *notify)); /* int wabort(W *w); * * Kill a window and it's children */ int wabort PARAMS((W *w)); /* int wnext(Screen *); * * Switch to next window */ int wnext PARAMS((Screen *t)); /* int wprev(Screen *); * * Switch to previous window */ int wprev PARAMS((Screen *t)); /* int wgrow(W *); * * increase size of window. Return 0 for success, -1 for fail. */ int wgrow PARAMS((W *w)); /* int wshrink(W *); * * Decrease size of window. Returns 0 for success, -1 for fail. */ int wshrink PARAMS((W *w)); int wgrowup PARAMS((W *w)); int wgrowdown PARAMS((W *w)); /* void wshowone(W *); * * Show only one window on the screen */ void wshowone PARAMS((W *w)); /* void wshowall(Screen *); * * Show all windows on the screen, including the given one */ void wshowall PARAMS((Screen *t)); /* void wredraw(W *); * * Force complete redraw of window */ void wredraw PARAMS((W *w)); /* void updall() * * Redraw all windows */ void updall PARAMS((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 PARAMS((W *w, unsigned char *s)); void msgnwt PARAMS((W *w, unsigned char *s)); #define JOE_MSGBUFSIZE 300 extern unsigned char msgbuf[JOE_MSGBUFSIZE]; /* Message composition buffer for msgnw/msgnwt */ void msgout PARAMS((W *w)); /* Output msgnw/msgnwt messages */ /* Common user functions */ int urtn PARAMS((BASE *b, int k)); /* User hit return */ int utype PARAMS((BASE *b, int k)); /* User types a character */ int uretyp PARAMS((BASE *bw)); /* Refresh the screen */ int ugroww PARAMS((BASE *bw)); /* Grow current window */ int uexpld PARAMS((BASE *bw)); /* Explode current window or show all windows */ int ushrnk PARAMS((BASE *bw)); /* Shrink current window */ int unextw PARAMS((BASE *bw)); /* Goto next window */ int uprevw PARAMS((BASE *bw)); /* Goto previous window */ int umwind PARAMS((BW *bw)); /* Go to message window */ int umfit PARAMS((BW *bw)); /* Fit two windows on screen */ void scrdel PARAMS((B *b, long int l, long int n, int flg)); void scrins PARAMS((B *b, long int l, long int n, int flg)); extern int bg_msg; /* Background color for messages */ #endif joe-3.7/LIST0000644000100100007640000002405711103370507007555 00000000000000Joe 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 sys Run a UNIX command and return to editor when done (I/O does not go through editor, be we get the command's return status). 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. dropon Set markb. If it was already set, eliminate it. Turn on marking mode. 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 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 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 showerr Show current message 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 Files ----- save Save file savenow Save immediately, unless file name is not known insf Insert a file reload Reload current file reloadall Reload all unmodified files 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 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 dnslidemenu Scroll menu down one line upslidemenu Scroll menu up one line pgupmenu Scroll menu up pgdnmenu Scroll menu down Misc ---- beep Beep execmd Execute a joe command math Calculator mode Mode prompt menu Menu prompt msg Display a message notmod Clear the modified flag retype Refresh screen shell Suspend process or execute a sub-shell stat Display cursor position tag Tags file search txt Insert text. If first character of entered text, then the rest of the text is treated as if it were a status line definition string, like -lmsg and -rmsg. name Insert current file name language Insert current language charset Insert current character set keymap Switch to another keymap Prompts ------- complete Complete a file-name in a prompt if Only run following cmds if expr is true (non-zero) then Same as rtn but only works in prompt windows elsif Try a new condition else Toggle truth flag endif Start running cmds again Here is an example 'if' macro: if,"char==65",then,"it's an A",else,"it's not an A",endif ^[ q When you hit ^[ q, if the character under the cursor is an 'A': "it's a A" is inserted into the buffer, otherwise "it's not an A" is inserted. "if" creates a math prompt (like ESC m). "then" is like "rtn"- it hits the return key for this prompt. Within the math prompt, the following variables are available: char ASCII value of character under cursor width Width of screen height Height of screen byte byte number col column number line line number lines no. lines in file top line number of top line of window 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 mwind Get error messages window on the screen and put cursor in it. mfit Fit two windows on the screen: make current window 6 lines, and give rest of space to window above. The window above is either the existing previous window, a newly created one if there wasn't one. Undo ---- redo Re-execute the latest undone change undo Undo last change Mouse ----- tomouse Move the cursor to where the mouse was clicked/dragged defmdown Default single-click handlers defmdrag (click to move cursor, drag to select characters) defmup defm2down Default double-click handlers defm2drag (drag to select words) defm2up defm3down Default triple-click handlers defm3drag (drag to select lines) defm3up paste Insert text until magic sequence ^[ [ 2 0 1 ~ is received. (for XTerm bracketed paste). Math ---- Math functions: sin, cos, tan, exp, sqrt, cbrt, ln, log, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, int, floor, ceil, abs, erf, erfc, j0, j1, y0, y1 Variables: e Set to 'e' pi Set to 'pi' top Set to line number of top window line lines Set to number of lines in file line Set to current line number col Set to current column number byte Set to current byte number size Set to buffer size height Set to window height width Set to window width char Set to ASCII val of character under cursor markv True if there is a valid block set (^KB ... ^KK) rdonly True if file is read-only arg Current repeat argument argset True if a repeat argument was given no_windows No. buffer windows on the screen ans Result of previous expression Commands: hex Hex display mode dec Decimal display mode ins Insert 'ans' into buffer sum Sum of numbers in block cnt Count numbers in block avg Average value of numbers in block dev Standard deviation of numbers in block eval Evaluate math expressions in block (or whole file if no block set). joe(..) Execute a JOE macro (argument in same format as joerc file macros). Return value of JOE macro is returned (for macro success, return true (non-zero)). For example: joe(sys,"[ 1 == 1 ]",rtn) ([ 1 == 1 ]) is a shell command. "[" is a synonym for the "test" UNIX command. Returns true. Remember: argument for JOE macro command "if" is a math expression. So for example, the macro: if,"joe(sys,\"[ 1 == 1 ]\",rtn)",then,"TRUE",endif Types TRUE into the buffer. Operators: ^ * / % + - < <= > >= == != && || ? : = : &&, || and ? : work as in C and sh as far as side effects: if the left side of && is false, the right side is not evaluated. : is expression separator joe-3.7/NEWS0000644000100100007640000005264711103376717007575 00000000000000- backspace/DEL means 'n' in replace prompt for better emacs compatibility - Menus are now made up of macros instead of options. New commands: menu Prompt for a menu to display with tab completion. mode Prompt for an option to change with tab completion. Menus are defined in joerc file with :defmenu command. Menu entries are the pair: macro string. String is a format string displayed in the menu. Macro is executed when then menu entry is selected. Use this to add your own macros to ^T. - ^T is now a user definable menu system - Treat \ as a quote character for file I/O. Now you can edit files like !test with \!test - Print NULs in default search string. Handle many \s properly. - Allow backslashes in file names - Fix %A to print unicode - Charles Tabony's (vectorshifts's) highlighter stack patch - ! is relace all in replace prompt - Turn off UTF-8 when we enter hex mode - Call ttsig on vfile I/O errors. - Abort cleanly when malloc returns NULL - Add reload command to reload file from disk - Modify configure scrips to use docdir for extra documents and datadir/joe for syntax and i18n files. - Don't use bold yellow, it's bad for white screens - Fix TeX highlighter: don't highlight " - Make mail.jsf more forgiving for those of us who still use old UNIX mail - Fix file rename bugs - Improve ubop: can reformat a block of paragraphs again. Reformat of adjacent indented paragraphs working again. - Improve XML highlighter: allow \r in whitespace JOE 3.6 - Preserve setuid bit - Fix bug where backup file did not get modtime of original - New diff highlighter - Fix paragraph format when overtype is on - Fix non-french spacing - Fix bug with joe +2 on single line files - Add syntax file for .jsf files - Add ASCII table to joerc help - ^KD renames file - Improve HTML highlighter... if you see allowed in xml content - Add -flowed option: adds a space after paragraph lines. - Fix German and French .po files: they were cause search&replace to break. - Look at LC_MESSAGES to get the language to use for editor messages. - Added -no_double_quoted and -tex_comment for TeX - Added -break_symlinks option and changed -break_links option to not break symbolic links. - Paragraph format of single line paragraph is indented only if autoindent is enabled. (jqh) - Guessindent no longer overrides istep if indendation is space. - Fix low limit of lmargin - Allow inserting file in rectangle mode even if selected rectangle is zero-width. - .js is Javascript - Fix ^G in perl mode when you hit it on second brace in: {\' \'} - Fix LUA highlighter (dirk_s) - Improved conf.jsf (dirk_s) - Added local option (-nobackup) to suppress backup files (peje) - Add Matlab syntax file (neer) - Improve mail syntax highlighter (jqh) - Fix crash when calling syntax file as subroutine (hal9042) - Get "ctags" tag search to work again - Fix crash when JOE tries to write to unwritable file - Fix crash when entering blank macro ESC x - Improve Verilog highlighter - Fix crash when typing ESC x !ls - Add C++ keywords to highlighter (otterpop81) - Added RPM spec file syntax spec.jsf - Improve 'istring' (.jsf command) (hal9042) - Update French .po file (jengelh) - Fix infinite search/replace loop bug (yugk) - New feature: insert status line format string using 'txt' (tykef) - Update Russion .po file (yugk) - Update Russian manpage (yugk) - Update jicerc Russian rc file (yugk) - Fix lock prompt message (yugk) - Add Ukrainian .po file (yugk) JOE 3.5 - Query windows now expand to multiple lines if necessary - Single key queries are now internationalized (set local versions in the .po file) - Spell check language can be set in the editor - New syntax files: m4, joerc - New debug window for highlight file syntax errors. - Macros can be typed at the ESC X prompt (before it used to accept only commands). - Built-in joerc file allows joe to run even if /etc/joe directory is missing. - Support for 'long long' allows editing parts of files larger than 4GB. For example, you can say: joe /dev/hda,0x100000000,0x1000 to edit the 4KB block at offset 4GB of a hard drive. - Option which allows you set how many undo records to keep. - You can give a path to the tags file in the TAGS environment variable. JOE 3.4 - Paragraph reformatter and word wrap now handle '*' and '-' bullet lists. - Better internationalization (i18n): JOE now uses gettext(), so that internal messages can be translated to the local language. The /etc/joe directory now has a lang subdirectory for the .po files. Internationalized joerc files are now possible. If LANG is en_GB, JOE tries successively to load joerc.en_GB, joerc.en and joerc. - Multi-file search and replace: There are two new search and replace options: 'a': the search covers all loaded buffers. So you can say: joe *.c and then ^KF foo ra bar to replace all instances of foo in all .c files. 'e': the search covers all files in the error list. You can use grep-find to create a list of files: ESC g grep -n foo f*.c ^KF foo re bar You can also use 'ls' and 'find' instead of grep to create the file list. - JOE now restores cursor position in previously visited files. - Build and grep window work more like Turbo-C: the messages window is forced onto the screen when you hit ^[ = and ^[ -. - Syntax highlighter definition files (.jsf files) can now have subroutines. This eases highlighter reuse: for example, Mason and PHP can share the HTML highlighter. - I've changed the way JOE handles '-' and redirected input: joe < file A shell process is started which 'cat's the file into the first buffer. tail -f log | joe A shell process is started which 'cat's the output from 'tail -f' (watch a log file) into the first buffer. joe - JOE does not try to read from stdin, but when the file is saved, it writes to stdout. echo "hi" | joe - | mail fred "hi" ends up in first buffer. When you save, mail is sent. - Many bugs have been fixed. I've tried to address every issue in the bug tracker. Hopefully I didn't create too many new ones :-) - You can now define which characters can indent paragraphs. Also the default list has been reduced so that formatting of TeX/LaTeX files works better. - Highlighting now uses less CPU time and always parses from the beginning of the file (the number of sync lines option is deprecated). Here is a CPU usage comparison for scrolling forwards and backwards through a 35K line C file: JOE .58 JED .57 NEDIT 3.26 VIM 7.33 EMACS 11.98 - JOE now matches Thomas Dickey's implementation of my xterm patch (but configure xterm with --paste64). - File selection menu/completion-list is now above the prompt (which is more like bash). Also it is transposed, so that it is sorted by columns instead of rows. - "Bufed" (prompt for a buffer to edit), works like other file prompt commands: it's a real prompt with history and completion. - Automatic horizontal left scroll jumps by 5-10 columns. - New syntax files: troff, Haskell, Cadance SKILL, REXX, LUA, RUBY. Many of the existing syntax files have been improved. JOE 3.3 - The default background color can now be set. - JOE now supports 256 color xterm. - The mouse can now resize windows and select menu entries. - During selection with the mouse, the window will autoscroll when you go past the edge. - An xterm-patch is included which makes "-mouse" mode work better. (With the patch, also set "-joexterm"). - Syntax files are provided: ADA, AWK, COBOL, SED, Postscript, and SQL - Improved jpico: search now looks more like real pico - Grep find: use ESC g to grep. Then use ESC space to jump to to indicated file/line. - Cygwin setup.exe support JOE 3.2 - A Perforce SCM "p4 edit" macro has been supplied (along with the hooks within JOE which support it) so that when you make the first change to a read-only file, JOE runs "p4 edit". (look in joerc file to enable the macro). - Hex edit mode has been added. For example: joe -hex /dev/hda,0,1024 - New '-break_links' option causes JOE to delete before writing files, to break hard links. Useful for 'arch' SCM. - JOE now has GNU-Emacs compatible file locks. A symbolic link called .#name is created, "pointing" to "user@machine.pid" whenever the buffer goes from unmodified to modified. If the lock can't be created, the user is allowed to steal or ignore the lock, or cancel the edit. The lock is deleted when buffer goes from modified to unmodified (or you close the file). - JOE now periodically checks the file on the disk and gives a warning if it changed when you try to modify the buffer. (JOE already performed this test on file save). - The built-in calculator (ESC m) is now a full featured scientific calculator (I'm shooting for Casio Fx-4000 level here :-), including hexadecimal and ability to sum (and perform statistics on) a highlighted (possibly rectangular) block of numbers. Hit ^K H at the math prompt for documentation. - You can now change the current directory in JOE (well, it prompts with the latest used directory). - Colors can now be specified in the joerc file - Macro language now has conditionals and modifiers for dealing with repeat arguments. Jmacs now works better due to this. - Tab completion works at tags search prompt ^K ; - ^G now jumps between word delimiters (begin..end in Verilog, #if #else #endif in C, /* .. */ and XML tags). If it doesn't know the word, it starts a search with the word seeding the prompt. It is also much smarter about skipping over comments and quoted matter. - TAB completion is now much more like bash (again :-). The cursor stays at the file name prompt instead of jumping into the menu system. Also ^D brings up the menu, as in tcsh. Also, tab completion now works on user names for ~ expansion. - Now there is a ~/.joe_state file which stores: all history buffers current keyboard macros yank records - Joe now has xterm mouse support: when enabled, the mouse can position the cursor and select blocks. The mouse wheel will scroll the screen. When enabled, shift-click emulates old xterm mouse behavior (cut & paste between applications). - More syntax files: TeX, CSS, OCaml, Delphi, SML and 4GL. Thanks to all of the contributers. - Vastly improved highlighting of Perl and Shell due to the highlighter now understanding word and balanced delimiters. - Many bugs have been fixed (every bug which has been entered into the sourceforge project page has been addressed). Hopefully I didn't add too many new ones :-) 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 joe-3.7/TODO0000644000100100007640000003627011103376117007552 00000000000000For JOE-3.6 auto reload of modified files? a mode for this? tab completion should escape file names for joe mode where wordwrap wraps rest of paragraph? mode where all editing wraps rest of paragraph? handling of bullets could be better, but conflicts with C comments a common operation is search&replace within a selected block. possibly cursor should go to start of block after each operation. a common operation is macro execution to end of selected block. abort macro when it reaches ^K K? EMACS has "narrow to region" concept to deal with this. a common operation is clearing a shell buffer: make a key for this? document ` in 'txt' (format test as status line) additional formatting things in status line `%n filename `%dd day `%dm month `%dY year `%Ename% environment variable Immediate: full path needs to go in line number restore code? ^C breaks in Cygwin when piping into joe empty syntax file crashes? startup log should pop up whenever syntax files are loaded. joerc file messages are funny because of the :include autodetect xterm? it doesn't give enough information. did shell window in joe-3.2 3.2 create a new window? bugs? grep ... | joe missing lots sometime pipe into joe is broken. If it's a regular file, we should just load it. Make joerc merge program and run it on joerc.ru =-=-=-=-= should force -Wall if compiler is gcc =-=-=-=-= - rc file format needs revamping: You can not put comments on lines with string arguments. =-=-=-=-= option for compile window size (or make mfit prompt for the size) multi-file search & replace: check for deleted 'B *'. =-=-=-=-= - We need regexp for error parsing. =-=-=-=-= - better grep-find (trigger in ^KE) - need current directory for grep-find. Compiling: ---------- Key to bring up help on word under cursor: like pop up window with man page, or google search for the function. man -P cat -S 2:3 printf work with cscope? hit F1 to look up man entry for function? Tags file search should auto-run ctags if there is no tags file. It should update it if any files have changed... gdb inteface? run (when segfault, jump to given source location) run-to step-over step-into eval (to look at variables) peek up stack frame allow options after string and istring? -just note it for now. Makefile.in and Makefile.am need to be the same as Makefile. 622978 use last column 1218708 ? for unknown characters is not informative (at least highlight the ?) 1218701 report character offset in ^K- (not just byte offset). 1304794 X at end of line is changed to space when character above 128 in utf-8 1323285 joe does not repeatedly wrap searches (add an option for this?) 1218686 syntax hightlight in hex mode (sheesh!) 1211243 long $HOME causes joe to crash 531899 joe +23 is weird: cursor on startup line 1413863 sigwinch breaks tcsetsw which messes up keyboard? I haven't seen this Garbage collect line attribute databases. Parse xterm version number. we should store location of menu. menu_above could change while menu is open (but menu could be deleted, so this raises other problems). performace: getcontext causes huge cpu usage for very large functions (xp_useq.v for example). Short (infinite) list for 3.4: -smart bs/tab is driving me up the wall: if (sdfjklhsdfkjhsdfjkh sdflks dfkjshdf sd sdfkjhsdkjfhsdkhsd) . <- thinks this is indentation point. -tab should default to tab? - improve mnew/mold etc so we can gzip/gunzip files being edited (maybe recursive call to file recognizer with .gz removed). - when lock is stolen under us, we don't tell anyone. - reformat/reindent function on ^KJ - insert last word (last word typed/copied/etc.). - orthogonal jump - safer hex edit mode - win32? DOS? - man page - cygwin- make sure we put files in the right place. - dynamic spell checking with highlighter- there should be a way - smart-end key Mouse issues: - autoscroll: keep track of selection type (double-click or triple-click) - just scroll window with right button down? help screen mouse commands? double-click at prompts hits enter? double-click empty prompt, hits tab? right-click pops directory? right-click is cancel? double-click is yes? - i18n issues: hex is screwed up. utf-8 file encoding needs to be off for hex mode. also crlf mode. - - - - Dangerous situations: assume maint->curwin->object is a BW * call interactive functions (like doedit) and expect them to leave maint a buffer window (it could start a prompt). should check plain file checking. vs, zstring, cstring, there are too many, each with its own memory management. - - - - - - - - - backspace in picture mode (it jumps to end of line - should it be like left-arrow?) - - - - - - - - - name keyboard macro and append it to .joerc file - - - - - - - - - update man page - - - - - - - - - hex edit mode - force switch to overtype mode? - - - - - - - - - security hole with spell checker: abs path to checker needed. - - - - - - - - - commands should be as deterministic as possible for easier macro writing. (some prompts give defaults sometime... this is bad) (psh should save all possible state information) - merge math with macro language - tab at math prompt should go through variables, functions. - eliminate need for : separator - add loops, user defined functions with local variables - add comments - user should be able to bring up a program and hit 'eval'. - use ivy? - - - - - - - - - better editing in shell windows: use for calculator mode too? - - - - - - - - - highlight all words which match during search? - - - - - - - - (a user asked: can it periodically reload log file like tail -f)? (just run tail -f in shell window) - - - - - - - - Make joerc file so we load system and local customizations. - - - - - - - - can we highlight backup files? files ending in .in? - - - - - - - - define characters which make up words There are some A-Zs in tomatch (should use i18n). - - - - - - - - - - - - - - - - exemac for first change: it should be run with cursor in window. -orphan will break -mnew, -mold macros (because macros are run without a window on the screen). - - - - - - - - - .joe_state file: - try for previous screen configuration? - multiple joes: the last one who exits wins: merge them - - - - - - - - Completion list build could take a long time in general we should be able to abort long operations... - - - - - - - - Others: - completion list of internal commands brings up documentation - rectangular blocks: make this a local file option? - 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. It's usually bound to options, so at least make options pass unknown characters back to keysequence parser. - save all files without asking thing for quick compile 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. regex: character classes? a-z matches any letter? can't load terminfo- should switch to termcap or provide compiled ANSI terminfo built in. Perl compatible regex search. Improvements for programming ---------------------------- Jump to definition (tags does this) Show list of references Diff mode (need vertical window) Tie in with CVS Refactoring Support for more languages: Reformat paragraph should reformat C function if we're editing C. File loading/storing: Unnamed buffers should be in bufed list (was fixed in the lost joe 2.9) Jmacs: search and replace 'fred' to 'foo': find 'Fred', gets 'Foo'. Rectangle mode for emacs yank system Overtype mode works for yank exiting options and i-search with ESC is not pretty (it isn't in emacs either) jmacs glitches: history for incremental search ^S return supposed to be normal search ^[ 0 ^K delete line bkwd (arg set) ^[ @ set mark arg words away ^X ^P mark page ^X . set left margin (fill prefix) (better off not setting this: JOE automatically sets the fill prefix). 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 -------------------------- byte to byte conversions? UTF-8 decoder right at input instead of in qw and utype? UTF-8 syntax files? - 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. 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? CUA? Prompts: HTML-style thing for option selection? Terminal handling: Emit ESC c to reset terminal on startup? Look into clearing right-most column. Major new display 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. Other requests: -cleanup (delete extra lines and extra spaces at ends of lines). Do something with these keys: ------- ssh 3.2 ------- Arrow:     Home: [2~ (uhg!) End: [4~ Pgup: [5~ Pgdn: [6~ Ins: [2~ Del:  F1: [11~ F2: [12~ F3: [13~ F4: [14~ F5: [15~ F6: [17~ F7: [18~ F8: [19~ F9: [20~ F10: [21~ F11: [23~ F12: [24~ 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~ F1: [11~ F2: [12~ F3: [13~ F4: [14~ F5: [15~ F6: [17~ F7: [18~ F8: [19~ F9: [20~ F10: [21~ F11: [23~ F12: [24~ 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~ F1: OP F2: OQ F3: OR F4: OS F5: [15~ F6: [17~ F7: [18~ F8: [19~ F9: [20~ F10: [21~ F11: [23~ F12: [24~ 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: ttp://www.gush-shalom.org/archives/kurdi_eng.html 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~ F1: [11~ F2: [12~ F3: [13~ F4: [14~ F5: [15~ F6: [17~ F7: [18~ F8: [19~ F9: [20~ F10: [21~ F11: [23~ F12: [24~ 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~ F1: - F2: OQ F3: OR F4: OS F5: [15~~ F6: [17~~ F7: [18~~ F8: [19~ F9: [20~ F10: - F11: [23~ F12: [24~ 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~ F1: OP F2: OQ F3: OR F4: OS F5: [15~ F6: [17~ F7: [18~ F8: [19~ F9: [20~ F10: [21~ F11: [23~ F12: [24~ 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~ F1: [[A F2: [[B F3: [[C F4: [[D F5: [[E F6: [17~ F7: [18~ F8: [19~ F9: [20~ F10: [21~ F11: [23~ F12: [24~ 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~ F1: [[A F2: [[B F3: [[C F4: [[D F5: [[E F6: [17~ F7: [18~ F8: [19~ F9: [20~ F10: [21~ F11: [23~ F12: [24~ Ctrl-arrows: - Shift-arrows: - Alt-enything: 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 ESC $ insert math result money formatted ESC # insert math equation ESC m Memorandum ESC s isearch fwrd (supposed to be Sincerely) ESC c compile (supposed to be center line) ^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 X ^H replace X ^J return - ^N new blank file - ^O edit file (asks to save current) ^P print - ^S save - ^V paste - ^Z undo - ^X cut - ^C copy - F3 find next - F5 date/time joe-3.7/bw.c0000644000100100007640000007541310457276140007646 00000000000000/* * Edit buffer window generation * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" /* Display modes */ int dspasis = 0; int marking = 0; static P *getto(P *p, P *cur, P *top, long int line) { if (p == NULL) { P *best = cur; long dist = MAXLONG; 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) { dist = d; best = top; } p = pdup(best, USTR "getto"); 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 */ void bwfllwh(BW *w) { /* 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->offset) { w->offset = w->cursor->byte%16+60; msetI(w->t->t->updtab + w->y, 1, w->h); } else if (w->cursor->byte%16+60 >= w->offset + w->w) { w->offset = w->cursor->byte%16+60 - (w->w - 1); msetI(w->t->t->updtab + w->y, 1, w->h); } } /* For text */ void bwfllwt(BW *w) { P *newtop; if (!pisbol(w->top)) { p_goto_bol(w->top); } if (w->cursor->line < w->top->line) { newtop = pdup(w->cursor, USTR "bwfllwt"); 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); } pset(w->top, newtop); prm(newtop); } else if (w->cursor->line >= w->top->line + w->h) { /* newtop = pdup(w->top); */ /* getto() creates newtop */ if (mid) newtop = getto(NULL, w->cursor, w->top, w->cursor->line - w->h / 2); else newtop = getto(NULL, w->cursor, w->top, w->cursor->line - (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); } pset(w->top, newtop); prm(newtop); } /* Adjust column */ if (w->cursor->xcol < w->offset) { long target = w->cursor->xcol; if (target < 5) target = 0; else { target -= 5; target -= (target % 5); } w->offset = target; msetI(w->t->t->updtab + w->y, 1, w->h); } 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(BW *w) { 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. */ HIGHLIGHT_STATE get_highlight_state(BW *w, P *p, int line) { HIGHLIGHT_STATE state; if(!w->o.highlight || !w->o.syntax) { invalidate_state(&state); return state; } return lattr_get(w->db, w->o.syntax, p, line); /* Old way... */ #ifdef junk ln = line; lattr_get(w->db, &ln, &state); if (ln != line) { tmp = pdup(p, USTR "get_highlight_state"); pline(tmp, ln); while (tmp->line < line && !piseof(tmp)) { state = parse(w->o.syntax, tmp, state); } if (tmp->line == line) lattr_set(w->db, line, state); prm(tmp); } return state; #endif #ifdef junk P *tmp = 0; HIGHLIGHT_STATE state; /* Screen y position of requested line */ int y = line-w->top->line+w->y; if(!w->o.highlight || !w->o.syntax) { invalidate_state(&state); return state; } /* If we know the state, just return it */ if (w->parent->t->t->syntab[y].state>=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].state < 0) --y; /* If we don't have state for this line, calculate by going 100 lines back */ if (w->parent->t->t->syntab[y].state<0) { /* We must be on the top line */ clear_state(&state); tmp = pdup(w->top, USTR "get_highlight_state"); 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, USTR "get_highlight_state"); 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]; #endif } /* Scroll a buffer window after an insert occured. 'flg' is set to 1 if * the first line was split */ void bwins(BW *w, long int l, long int n, int flg) { /* If highlighting is enabled... */ if (w->o.highlight && w->o.syntax) { /* Invalidate cache */ /* lattr_cut(w->db, l + 1); */ /* Force updates */ if (l < w->top->line) { msetI(w->t->t->updtab + w->y, 1, w->h); } else if ((l + 1) < w->top->line + w->h) { int start = l + 1 - w->top->line; int size = w->h - start; msetI(w->t->t->updtab + w->y + start, 1, size); } } /* Scroll */ 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); } /* Force update of lines in opened hole */ 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)); } else { msetI(w->t->t->updtab + 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) { /* If highlighting is enabled... */ if (w->o.highlight && w->o.syntax) { /* lattr_cut(w->db, l + 1); */ if (l < w->top->line) { msetI(w->t->t->updtab + w->y, 1, w->h); } else if ((l + 1) < w->top->line + w->h) { int start = l + 1 - w->top->line; int size = w->h - start; msetI(w->t->t->updtab + w->y + start, 1, size); } } /* 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 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, int *screen, int *attr, int x, int w, P *p, long int scr, long int from, long int to,HIGHLIGHT_STATE st,BW *bw) /* Screen line address */ /* Window */ /* Buffer pointer */ /* Starting column to display */ /* Range for marked block */ { int ox = x; int tach; 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; unsigned char bc; int ungetit = -1; struct utf8_sm utf8_sm; int *syn = 0; P *tmp; int idx=0; int atr = BG_COLOR(bg_text); utf8_init(&utf8_sm); if(st.state!=-1) { tmp=pdup(p, USTR "lgen"); p_goto_bol(tmp); parse(bw->o.syntax,tmp,st); syn = attr_buf; prm(tmp); } /* Initialize 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 loop; lp: /* Display next character */ if (amnt) do { if (ungetit== -1) bc = *bp++; else { bc = ungetit; ungetit = -1; } if(st.state!=-1) { atr = syn[idx++]; if (!((atr & BG_VALUE) >> BG_SHIFT)) atr |= BG_COLOR(bg_text); } if (p->b->o.crlf && bc == '\r') { ++byte; if (!--amnt) { pppl: if (bp == p->ptr + SEGSIZ) { if (pnext(p)) { bp = p->ptr; amnt = p->hdr->hole; } else goto nnnl; } else { bp = p->ptr + p->hdr->ehole; amnt = SEGSIZ - p->hdr->ehole; if (!amnt) goto pppl; } } if (*bp == '\n') { ++bp; ++byte; ++amnt; goto eobl; } nnnl: --byte; ++amnt; } if (square) if (bc == '\t') { long tcol = col + p->b->o.tab - col % p->b->o.tab; if (tcol > from && tcol <= to) c1 = INVERSE; else c1 = 0; } else if (col >= from && col < 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 - col % p->b->o.tab; if (ta + col > scr) { ta -= scr - col; tach = ' '; goto dota; } if ((col += ta) == scr) { --amnt; goto loop; } } else if (bc == '\n') goto eobl; else { int wid = 1; if (p->b->o.charmap->type) { c = utf8_decode(&utf8_sm,bc); if (c>=0) /* Normal decoded character */ wid = joe_wcwidth(1,c); else if(c== -1) /* Character taken */ wid = -1; else if(c== -2) { /* Incomplete sequence (FIXME: do something better here) */ wid = 1; ungetit = c; ++amnt; --byte; } else if(c== -3) /* Control character 128-191, 254, 255 */ wid = 1; } else { wid = 1; } if(wid>0) { col += wid; if (col == scr) { --amnt; goto loop; } else if (col > scr) { ta = col - scr; tach = '<'; goto dota; } } else --idx; /* Get highlighting character again.. */ } } while (--amnt); if (bp == p->ptr + SEGSIZ) { if (pnext(p)) { bp = p->ptr; amnt = p->hdr->hole; goto lp; } } else { bp = p->ptr + p->hdr->ehole; amnt = SEGSIZ - p->hdr->ehole; goto lp; } goto eof; loop: /* Display next character */ if (amnt) do { if (ungetit== -1) bc = *bp++; else { bc = ungetit; ungetit = -1; } if(st.state!=-1) { atr = syn[idx++]; if (!(atr & BG_MASK)) atr |= BG_COLOR(bg_text); } if (p->b->o.crlf && bc == '\r') { ++byte; if (!--amnt) { ppl: if (bp == p->ptr + SEGSIZ) { if (pnext(p)) { bp = p->ptr; amnt = p->hdr->hole; } else goto nnl; } else { bp = p->ptr + p->hdr->ehole; amnt = SEGSIZ - p->hdr->ehole; if (!amnt) goto ppl; } } if (*bp == '\n') { ++bp; ++byte; ++amnt; goto eobl; } nnl: --byte; ++amnt; } if (square) if (bc == '\t') { long tcol = scr + x - ox + p->b->o.tab - (scr + x - ox) % p->b->o.tab; if (tcol > from && tcol <= to) c1 = INVERSE; else c1 = 0; } else if (scr + x - ox >= from && scr + x - ox < 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 - ((x - ox + scr) % p->b->o.tab); tach = ' '; dota: do { outatr(bw->b->o.charmap, t, screen + x, attr + x, x, y, tach, c1|atr); if (ifhave) goto bye; if (++x == w) goto eosl; } while (--ta); } else if (bc == '\n') goto eobl; else { int wid = -1; int utf8_char; if (p->b->o.charmap->type) { /* UTF-8 */ utf8_char = utf8_decode(&utf8_sm,bc); if (utf8_char >= 0) { /* Normal decoded character */ wid = joe_wcwidth(1,utf8_char); } else if(utf8_char== -1) { /* Character taken */ wid = -1; } else if(utf8_char== -2) { /* Incomplete sequence (FIXME: do something better here) */ ungetit = bc; ++amnt; --byte; utf8_char = 'X'; wid = 1; } else if(utf8_char== -3) { /* Invalid UTF-8 start character 128-191, 254, 255 */ /* Show as control character */ wid = 1; utf8_char = 'X'; } } else { /* Regular */ utf8_char = bc; wid = 1; } if(wid>=0) { if (x+wid > w) { /* If character hits right most column, don't display it */ while (x < w) { outatr(bw->b->o.charmap, t, screen + x, attr + x, x, y, '>', c1|atr); x++; } } else { outatr(bw->b->o.charmap, t, screen + x, attr + x, x, y, utf8_char, c1|atr); x += wid; } } else --idx; if (ifhave) goto bye; if (x >= w) goto eosl; } } while (--amnt); if (bp == p->ptr + SEGSIZ) { if (pnext(p)) { bp = p->ptr; amnt = p->hdr->hole; goto loop; } } else { bp = p->ptr + p->hdr->ehole; amnt = SEGSIZ - p->hdr->ehole; goto loop; } goto eof; eobl: /* End of buffer line found. Erase to end of screen line */ ++p->line; eof: if (x != w) done = eraeol(t, x, y, BG_COLOR(bg_text)); else done = 0; /* Set p to bp/amnt */ bye: if (bp - p->ptr <= p->hdr->hole) p->ofst = bp - p->ptr; else p->ofst = bp - p->ptr - (p->hdr->ehole - p->hdr->hole); p->byte = byte; return done; eosl: if (bp - p->ptr <= p->hdr->hole) p->ofst = bp - p->ptr; else p->ofst = bp - p->ptr - (p->hdr->ehole - p->hdr->hole); p->byte = byte; pnextl(p); return 0; } /* Generate line into an array */ #ifdef junk static int lgena(SCRN *t, int y, int *screen, int x, int w, P *p, long int scr, long int from, long int to) /* Screen line address */ /* Window */ /* Buffer pointer */ /* Starting column to display */ /* Range for marked block */ { int ox = x; 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; unsigned char bc; /* Initialize 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 loop; lp: /* Display next character */ if (amnt) do { bc = *bp++; if (square) if (bc == '\t') { long tcol = col + p->b->o.tab - col % p->b->o.tab; if (tcol > from && tcol <= to) c1 = INVERSE; else c1 = 0; } else if (col >= from && col < 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 - col % p->b->o.tab; if (ta + col > scr) { ta -= scr - col; goto dota; } if ((col += ta) == scr) { --amnt; goto loop; } } else if (bc == '\n') goto eobl; else if (++col == scr) { --amnt; goto loop; } } while (--amnt); if (bp == p->ptr + SEGSIZ) { if (pnext(p)) { bp = p->ptr; amnt = p->hdr->hole; goto lp; } } else { bp = p->ptr + p->hdr->ehole; amnt = SEGSIZ - p->hdr->ehole; goto lp; } goto eobl; loop: /* Display next character */ if (amnt) do { bc = *bp++; if (square) if (bc == '\t') { long tcol = scr + x - ox + p->b->o.tab - (scr + x - ox) % p->b->o.tab; if (tcol > from && tcol <= to) c1 = INVERSE; else c1 = 0; } else if (scr + x - ox >= from && scr + x - ox < 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 - ((x - ox + scr) % p->b->o.tab); dota: do { screen[x] = ' ' + c1; if (++x == w) goto eosl; } while (--ta); } else if (bc == '\n') goto eobl; else { /* xlat(&c, &bc);*/ c ^= c1; screen[x] = c + bc; if (++x == w) goto eosl; } } while (--amnt); if (bp == p->ptr + SEGSIZ) { if (pnext(p)) { bp = p->ptr; amnt = p->hdr->hole; goto loop; } } else { bp = p->ptr + p->hdr->ehole; amnt = SEGSIZ - p->hdr->ehole; goto loop; } goto eof; eobl: /* End of buffer line found. Erase to end of screen line */ ++p->line; eof: while (x != w) screen[x++] = ' '; done = 0; /* Set p to bp/amnt */ if (bp - p->ptr <= p->hdr->hole) p->ofst = bp - p->ptr; else p->ofst = bp - p->ptr - (p->hdr->ehole - p->hdr->hole); p->byte = byte; return done; eosl: if (bp - p->ptr <= p->hdr->hole) p->ofst = bp - p->ptr; else p->ofst = bp - p->ptr - (p->hdr->ehole - p->hdr->hole); p->byte = byte; pnextl(p); return 0; } #endif 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(buf, sizeof(buf), "%9ld ", w->top->line + y - w->y + 1); else { int x; for (x = 0; x != LINCOLS; ++x) buf[x] = ' '; buf[x] = 0; } for (z = 0; buf[z]; ++z) { outatr(w->b->o.charmap, t, screen + z, attr + z, z, y, buf[z], BG_COLOR(bg_text)); if (ifhave) return; comp[z] = buf[z]; } } void bwgenh(BW *w) { int *screen; int *attr; P *q = pdup(w->top, USTR "bwgenh"); 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 == (BW *)maint->curwin->object && 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 == (BW *)maint->curwin->object) 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),76); txt[76]=0; if (!flg) { #if SIZEOF_LONG_LONG && SIZEOF_LONG_LONG == SIZEOF_OFF_T sprintf((char *)bf,"%8llx ",q->byte); #else sprintf((char *)bf,"%8lx ",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) { sprintf((char *)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) { sprintf((char *)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; int bot = w->h + w->y; int y; int dosquare = 0; long from, to; long fromline, toline; SCRN *t = w->t->t; /* Set w.db to correct value */ if (w->o.highlight && w->o.syntax && (!w->db || w->db->syn != w->o.syntax)) w->db = find_lattr_db(w->b, w->o.syntax); fromline = toline = from = to = 0; if (w->b == errbuf) { P *tmp = pdup(w->cursor, USTR "bwgen"); p_goto_bol(tmp); from = tmp->byte; pnextl(tmp); to = tmp->byte; prm(tmp); } else 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 == (BW *)maint->curwin->object && 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 == (BW *)maint->curwin->object) msetI(t->updtab + w->y, 1, w->h); q = pdup(w->cursor, USTR "bwgen"); 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 (ifhave && !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, attr, 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,p,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,p,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,p,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 (ifhave && !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, attr, 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,p,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,p,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,p,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); } w->w = wi; w->h = he; } BW *bwmk(W *window, B *b, int prompt) { BW *w = (BW *) joe_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, USTR "bwmk"); w->cursor = pdup(b->bof, USTR "bwmk"); } w->t = window->t; w->object = NULL; w->offset = 0; w->o = w->b->o; if (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)); } w->top->xcol = 0; w->cursor->xcol = 0; w->linums = 0; w->top_changed = 1; w->linums = 0; w->db = 0; return w; } /* Database of last file positions */ #define MAX_FILE_POS 20 /* Maximum number of file positions we track */ static struct file_pos { LINK(struct file_pos) link; unsigned char *name; long line; } file_pos = { { &file_pos, &file_pos } }; static int file_pos_count; struct file_pos *find_file_pos(unsigned char *name) { struct file_pos *p; for (p = file_pos.link.next; p != &file_pos; p = p->link.next) if (!zcmp(p->name, name)) { promote(struct file_pos,link,&file_pos,p); return p; } p = (struct file_pos *)malloc(sizeof(struct file_pos)); p->name = zdup(name); p->line = 0; enquef(struct file_pos,link,&file_pos,p); if (++file_pos_count == MAX_FILE_POS) { free(deque_f(struct file_pos,link,file_pos.link.prev)); --file_pos_count; } return p; } int restore_file_pos; long get_file_pos(unsigned char *name) { if (name && restore_file_pos) { struct file_pos *p = find_file_pos(name); return p->line; } else { return 0; } } void set_file_pos(unsigned char *name, long pos) { if (name) { struct file_pos *p = find_file_pos(name); p->line = pos; } } void save_file_pos(FILE *f) { struct file_pos *p; for (p = file_pos.link.prev; p != &file_pos; p = p->link.prev) { fprintf(f," %ld ",p->line); emit_string(f,p->name,zlen(p->name)); fprintf(f,"\n"); } fprintf(f,"done\n"); } void load_file_pos(FILE *f) { unsigned char buf[1024]; while (fgets((char *)buf,sizeof(buf)-1,f) && zcmp(buf,USTR "done\n")) { unsigned char *p = buf; long pos; unsigned char name[1024]; parse_ws(&p,'#'); if (!parse_long(&p, &pos)) { parse_ws(&p, '#'); if (parse_string(&p, name, sizeof(name)) > 0) { set_file_pos(name, pos); } } } } /* Save file position for all windows */ void set_file_pos_all(Screen *t) { /* Step through all windows */ W *w = t->topwin; do { if (w->watom == &watomtw) { BW *bw = w->object; set_file_pos(bw->b->name, bw->cursor->line); } w = w->link.next; } while(w != t->topwin); /* Set through orphaned buffers */ set_file_pos_orphaned(); } void bwrm(BW *w) { if (w->b == errbuf && w->b->count == 1) { /* Do not lose message buffer */ orphit(w); } set_file_pos(w->b->name,w->cursor->line); prm(w->top); prm(w->cursor); brm(w->b); joe_free(w); } int ustat(BW *bw) { static unsigned char buf[160]; unsigned char bf1[100]; unsigned char bf2[100]; int c = brch(bw->cursor); #if SIZEOF_LONG_LONG && SIZEOF_LONG_LONG == SIZEOF_OFF_T joe_snprintf_1(bf1, sizeof(bf1), "%lld", bw->cursor->byte); joe_snprintf_1(bf2, sizeof(bf2), "%llx", bw->cursor->byte); #else joe_snprintf_1(bf1, sizeof(bf1), "%ld", bw->cursor->byte); joe_snprintf_1(bf2, sizeof(bf2), "%lx", bw->cursor->byte); #endif if (c == NO_MORE_DATA) joe_snprintf_4(buf, sizeof(buf), joe_gettext(_("** Line %ld Col %ld Offset %s(0x%s) **")), bw->cursor->line + 1, piscol(bw->cursor) + 1, bf1, bf2); else joe_snprintf_9(buf, sizeof(buf), joe_gettext(_("** Line %ld Col %ld Offset %s(0x%s) %s %d(0%o/0x%X) Width %d **")), bw->cursor->line + 1, piscol(bw->cursor) + 1, bf1, bf2, bw->b->o.charmap->name, c, c, c, joe_wcwidth(bw->o.charmap->type,c)); 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; } /* If we are about to call bwrm, and b->count is 1, and orphan mode * is set, call this. */ void orphit(BW *bw) { ++bw->b->count; /* Assumes bwrm() is abour to be called */ bw->b->orphan = 1; pdupown(bw->cursor, &bw->b->oldcur, USTR "orphit"); pdupown(bw->top, &bw->b->oldtop, USTR "orphit"); } joe-3.7/bw.h0000644000100100007640000000302010435702706007632 00000000000000/* * Edit buffer window generation * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_BW_H #define _JOE_BW_H 1 /* A buffer window: there are several kinds, depending on what is in 'object' */ 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 lattr_db *db; /* line attribute database */ }; extern int dspasis; /* Display characters above 127 as-is */ extern int mid; /* Controls how window scrolls: when set, scroll window enough so that line with cursor becomes centered */ void bwfllw PARAMS((BW *w)); void bwfllwt PARAMS((BW *w)); void bwfllwh PARAMS((BW *w)); void bwins PARAMS((BW *w, long int l, long int n, int flg)); void bwdel PARAMS((BW *w, long int l, long int n, int flg)); void bwgen PARAMS((BW *w, int linums)); void bwgenh PARAMS((BW *w)); BW *bwmk PARAMS((W *window, B *b, int prompt)); void bwmove PARAMS((BW *w, int x, int y)); void bwresz PARAMS((BW *w, int wi, int he)); void bwrm PARAMS((BW *w)); int ustat PARAMS((BW *bw)); int ucrawll PARAMS((BW *bw)); int ucrawlr PARAMS((BW *bw)); void orphit PARAMS((BW *bw)); extern int marking; /* Anchored block marking mode */ void save_file_pos PARAMS((FILE *f)); void load_file_pos PARAMS((FILE *f)); long get_file_pos PARAMS((unsigned char *name)); void set_file_pos PARAMS((unsigned char *name, long pos)); extern int restore_file_pos; void set_file_pos_all PARAMS((Screen *t)); #endif joe-3.7/docs/0000777000100100007640000000000011103454343010064 500000000000000joe-3.7/docs/help-system.html0000644000100100007640000000561207372236363013161 00000000000000 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

joe-3.7/pw.c0000644000100100007640000001640411102222304007634 00000000000000/* * Prompt windows * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" /* The current directory */ int bg_prompt; int nocurdir; unsigned char *current_dir; void set_current_dir(unsigned char *s,int simp) { if (s[0]=='!' || (s[0]=='>' && s[1]=='>')) return; vsrm(current_dir); if (s) { current_dir=dirprt(s); if (simp) { unsigned char *tmp = simplify_prefix(current_dir); vsrm(current_dir); current_dir = tmp; } } else current_dir = 0; } static void disppw(BW *bw, int flg) { W *w = bw->parent; PW *pw = (PW *) bw->object; if (!flg) { return; } /* Scroll buffer and position prompt */ if (pw->promptlen > w->w - 5) { 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, BG_COLOR(bg_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); } /* History functions */ void setup_history(B **history) { if (!*history) { *history = bmk(NULL); } } /* Add line to history buffer */ void append_history(B *hist,unsigned char *s,int len) { P *q = pdup(hist->eof, USTR "append_history"); binsm(q, s, len); p_goto_eof(q); binsc(q, '\n'); prm(q); } /* Promote line to end of history buffer */ void promote_history(B *hist, long line) { P *q = pdup(hist->bof, USTR "promote_history"); P *r; P *t; pline(q, line); r = pdup(q, USTR "promote_history"); pnextl(r); t = pdup(hist->eof, USTR "promote_history"); binsb(t, bcpy(q, r)); bdel(q, r); prm(q); prm(r); prm(t); } /* When user hits return in a prompt window */ static int rtnpw(BW *bw) { W *w = bw->parent; PW *pw = (PW *) bw->object; unsigned char *s; W *win; int *notify; int (*pfunc) (); void *object; long byte; /* Extract entered text from buffer */ p_goto_eol(bw->cursor); byte = bw->cursor->byte; p_goto_bol(bw->cursor); s = brvs(bw->cursor, (int) (byte - bw->cursor->byte)); /* Save text into history buffer */ if (pw->hist) { if (bw->b->changed) { append_history(pw->hist, sv(s)); } else { promote_history(pw->hist, bw->cursor->line); } } /* Do ~ expansion and set new current directory */ if (pw->file_prompt&2) { set_current_dir(s,1); } if (pw->file_prompt) { s = canonical(s); } win = w->win; pfunc = pw->pfunc; object = pw->object; bwrm(bw); joe_free(pw->prompt); joe_free(pw); w->object = NULL; notify = w->notify; w->notify = 0; wabort(w); dostaupd = 1; /* Call callback function */ 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(BW *b) { PW *pw = b->object; void *object = pw->object; int (*abrt) () = pw->abrt; W *win = b->parent->win; bwrm(b); joe_free(pw->prompt); joe_free(pw); if (abrt) { return abrt(win->object, object); } else { return -1; } } WATOM watompw = { USTR "prompt", disppw, bwfllwt, abortpw, rtnpw, utypebw, NULL, NULL, inspw, delpw, TYPEPW }; /* Create a prompt window */ BW *wmkpw(W *w, unsigned char *prompt, B **history, int (*func) (), unsigned char *huh, int (*abrt) (), int (*tab) (), void *object, int *notify,struct charmap *map,int file_prompt) { 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 = (void *) (bw = bwmk(new, bmk(NULL), 1)); bw->b->o.charmap = map; bw->object = (void *) (pw = (PW *) joe_malloc(sizeof(PW))); pw->abrt = abrt; pw->tab = tab; pw->object = object; pw->prompt = zdup(prompt); pw->promptlen = fmtlen(prompt); pw->promptofst = 0; pw->pfunc = func; pw->file_prompt = file_prompt; if (history) { setup_history(history); 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; } /* Install current directory */ if ((file_prompt&4) && !nocurdir) { binsm (bw->cursor, sv(current_dir)); p_goto_eof(bw->cursor); bw->cursor->xcol = piscol(bw->cursor); } 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; for (x = 0; x != len; ++x) 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, USTR "cmplt_ins"); 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, 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, USTR "simple_cmplt"); p_goto_bol(p); q = pdup(bw->cursor, USTR "simple_cmplt"); 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; } if (menu_above) { if (bw->parent->link.prev->watom==&watommenu) { wabort(bw->parent->link.prev); } } else { if (bw->parent->link.next->watom==&watommenu) { wabort(bw->parent->link.next); } } m = mkmenu((menu_above ? bw->parent->link.prev : bw->parent), 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)) { if (!menu_jump) bw->parent->t->curwin=bw->parent; return 0; } else { unsigned char *com = mcomplete(m); vsrm(m->object); m->object = com; cmplt_ins(bw, com); wabort(m->parent); smode = 2; ttputc(7); return 0; } } joe-3.7/pw.h0000644000100100007640000000342711102222304007642 00000000000000/* * Prompt windows * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_PW_H #define _JOE_PW_H 1 /* Prompt window (a BW) */ struct pw { int (*pfunc) (); /* Func which gets called when RTN is hit */ int (*abrt) (); /* Func which gets called when window is aborted */ 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 */ int file_prompt; /* Set if this is a file name prompt, so do ~ expansion */ }; /* 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 * file_prompt flags: * bit 0: ~ expansion * bit 1: update directory * bit 2: seed with directory */ BW *wmkpw PARAMS((W *w, unsigned char *prompt, B **history, int (*func) (), unsigned char *huh, int (*abrt) (), int (*tab) (), void *object, int *notify, struct charmap *map, int file_prompt)); int ucmplt PARAMS((BW *bw, int k)); /* Function for TAB completion */ unsigned char **regsub PARAMS((unsigned char **z, int len, unsigned char *s)); void cmplt_ins PARAMS((BW *bw,unsigned char *line)); int cmplt_abrt PARAMS((BW *bw,int x, unsigned char *line)); int cmplt_rtn PARAMS((MENU *m,int x,unsigned char *line)); int simple_cmplt PARAMS((BW *bw,unsigned char **list)); void setup_history PARAMS((B **history)); void append_history PARAMS((B *hist,unsigned char *s,int len)); void promote_history PARAMS((B *hist, long line)); void set_current_dir PARAMS((unsigned char *s,int simp)); extern int bg_prompt; extern int nocurdir; extern WATOM watompw; #endif joe-3.7/rc.c0000644000100100007640000014102411103407251007616 00000000000000/* * *rc file parser * Copyright * (C) 1992 Joseph H. Allen; * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" /* Commands which just type in variable values */ int ucharset(BW *bw) { unsigned char *s; W *w=bw->parent->main; s=((BW *)w->object)->o.charmap->name; if (!s || !*s) return -1; while (*s) if (utypebw(bw,*s++)) return -1; return 0; } int ulanguage(BW *bw) { unsigned char *s; W *w=bw->parent->main; s=((BW *)w->object)->o.language; if (!s || !*s) return -1; while (*s) if (utypebw(bw,*s++)) return -1; return 0; } #define OPT_BUF_SIZE 300 static struct context { struct context *next; unsigned char *name; KMAP *kmap; } *contexts = NULL; /* List of named contexts */ /* Find a context of a given name- if not found, one with an empty kmap * is created. */ KMAP *kmap_getcontext(unsigned char *name) { struct context *c; for (c = contexts; c; c = c->next) if (!zcmp(c->name, name)) return c->kmap; c = (struct context *) joe_malloc(sizeof(struct context)); c->next = contexts; c->name = zdup(name); contexts = c; return c->kmap = mkkmap(); } /* JM - ngetcontext(name) - like getcontext, but return NULL if it * doesn't exist, instead of creating a new one. */ KMAP *ngetcontext(unsigned char *name) { struct context *c; for(c=contexts;c;c=c->next) if(!zcmp(c->name,name)) return c->kmap; return 0; } /* Validate joerc file */ int validate_rc() { KMAP *k = ngetcontext(USTR "main"); int x; /* Make sure main exists */ if (!k) return -1; /* Make sure there is at least one key binding */ for (x = 0; x != KEYS; ++x) if (k->keys[x].value.bind) return 0; return -1; } unsigned char **get_keymap_list() { unsigned char **lst = 0; struct context *c; for (c=contexts; c; c=c->next) lst = vaadd(lst, vsncpy(NULL,0,sz(c->name))); return lst; } OPTIONS *options = NULL; /* Set to use ~/.joe_state file */ int joe_state; /* 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 */ 0, /* nobackup */ 8, /* tab */ ' ', /* indent char */ 1, /* indent step */ NULL, /* *context */ NULL, /* *lmsg */ NULL, /* *rmsg */ 0, /* line numbers */ 0, /* read only */ 0, /* french spacing */ 0, /* flowed text */ 0, /* spaces */ #ifdef __MSDOS__ 1, /* crlf */ #else 0, /* crlf */ #endif 0, /* Highlight */ NULL, /* Syntax name */ NULL, /* Syntax */ NULL, /* Name of character set */ NULL, /* Character set */ NULL, /* Language */ 0, /* Smart home key */ 0, /* Goto indent first */ 0, /* Smart backspace key */ 0, /* Purify indentation */ 0, /* Picture mode */ 0, /* single_quoted */ 0, /* no_double_quoted */ 0, /* c_comment */ 0, /* cpp_comment */ 0, /* pound_comment */ 0, /* vhdl_comment */ 0, /* semi_comment */ 0, /* tex_comment */ 0, /* hex */ NULL, /* text_delimiters */ NULL, /* Characters which can indent paragraphs */ 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 */ NULL /* macro to execute on first change */ }; /* Default options for file windows */ OPTIONS fdefault = { NULL, /* *next */ NULL, /* *name_regex */ NULL, /* *contents_regex */ 0, /* overtype */ 0, /* lmargin */ 76, /* rmargin */ 0, /* autoindent */ 0, /* wordwrap */ 0, /* nobackup */ 8, /* tab */ ' ', /* indent char */ 1, /* indent step */ USTR "main", /* *context */ USTR "\\i%n %m %M", /* *lmsg */ USTR " %S Ctrl-K H for help", /* *rmsg */ 0, /* line numbers */ 0, /* read only */ 0, /* french spacing */ 0, /* flowed text */ 0, /* spaces */ #ifdef __MSDOS__ 1, /* crlf */ #else 0, /* crlf */ #endif 0, /* Highlight */ NULL, /* Syntax name */ NULL, /* Syntax */ NULL, /* Name of character set */ NULL, /* Character set */ NULL, /* Language */ 0, /* Smart home key */ 0, /* Goto indent first */ 0, /* Smart backspace key */ 0, /* Purity indentation */ 0, /* Picture mode */ 0, /* single_quoted */ 0, /* no_double_quoted */ 0, /* c_comment */ 0, /* cpp_comment */ 0, /* pound_comment */ 0, /* vhdl_comment */ 0, /* semi_comment */ 0, /* tex_comment */ 0, /* hex */ NULL, /* text_delimiters */ USTR ">;!#%/*-", /* Characters which can indent paragraphs */ NULL, NULL, NULL, NULL, NULL /* macros (see above) */ }; /* Update options */ void lazy_opts(B *b, OPTIONS *o) { o->syntax = load_syntax(o->syntax_name); if (!o->map_name) { /* Guess encoding if it's not explicitly given */ unsigned char buf[1024]; int len = 1024; if (b->eof->byte < 1024) len = b->eof->byte; brmem(b->bof, buf, len); o->charmap = guess_map(buf, len); o->map_name = zdup(o->charmap->name); } else { o->charmap = find_charmap(o->map_name); } if (!o->charmap) o->charmap = locale_map; if (!o->language) o->language = zdup(locale_msgs); /* Hex not allowed with UTF-8 */ if (o->hex && o->charmap->type) { o->charmap = find_charmap(USTR "c"); } } /* Set local options depending on file name and contents */ void setopt(B *b, unsigned char *parsed_name) { OPTIONS *o; int x; unsigned char *pieces[26]; 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) { P *p = pdup(b->bof, USTR "setopt"); if (pmatch(pieces,o->contents_regex,zlen(o->contents_regex),p,0,0)) { prm(p); b->o = *o; lazy_opts(b, &b->o); goto done; } else { prm(p); } } else { b->o = *o; lazy_opts(b, &b->o); goto done; } } b->o = fdefault; lazy_opts(b, &b->o); done: 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 */ struct glopts { unsigned char *name; /* Option name */ 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 */ void *set; /* Address of global option */ unsigned char *addr; /* Local options structure member address */ unsigned char *yes; /* Message if option was turned on, or prompt string */ unsigned char *no; /* Message if option was turned off */ unsigned char *menu; /* Menu string */ int ofst; /* Local options structure member offset */ int low; /* Low limit for numeric options */ int high; /* High limit for numeric options */ } glopts[] = { {USTR "overwrite",4, NULL, (unsigned char *) &fdefault.overtype, USTR _("Overtype mode"), USTR _("Insert mode"), USTR _("T Overtype ") }, {USTR "hex",4, NULL, (unsigned char *) &fdefault.hex, USTR _("Hex edit mode"), USTR _("Text edit mode"), USTR _(" Hex edit mode ") }, {USTR "autoindent", 4, NULL, (unsigned char *) &fdefault.autoindent, USTR _("Autoindent enabled"), USTR _("Autoindent disabled"), USTR _("I Autoindent ") }, {USTR "wordwrap", 4, NULL, (unsigned char *) &fdefault.wordwrap, USTR _("Wordwrap enabled"), USTR _("Wordwrap disabled"), USTR _("W Word wrap ") }, {USTR "tab", 5, NULL, (unsigned char *) &fdefault.tab, USTR _("Tab width (%d): "), 0, USTR _("D Tab width "), 0, 1, 64 }, {USTR "lmargin", 7, NULL, (unsigned char *) &fdefault.lmargin, USTR _("Left margin (%d): "), 0, USTR _("L Left margin "), 0, 0, 63 }, {USTR "rmargin", 7, NULL, (unsigned char *) &fdefault.rmargin, USTR _("Right margin (%d): "), 0, USTR _("R Right margin "), 0, 7, 255 }, {USTR "restore", 0, &restore_file_pos, NULL, USTR _("Restore cursor position when files loaded"), USTR _("Don't restore cursor when files loaded"), USTR _(" Restore cursor ") }, {USTR "square", 0, &square, NULL, USTR _("Rectangle mode"), USTR _("Text-stream mode"), USTR _("X Rectangle mode ") }, {USTR "icase", 0, &icase, NULL, USTR _("Search ignores case by default"), USTR _("Case sensitive search by default"), USTR _(" Case insensitivity ") }, {USTR "wrap", 0, &wrap, NULL, USTR _("Search wraps"), USTR _("Search doesn't wrap"), USTR _(" Search wraps ") }, {USTR "menu_explorer", 0, &menu_explorer, NULL, USTR _("Menu explorer mode"), USTR _("Simple completion mode"), USTR _(" Menu explorer ") }, {USTR "menu_above", 0, &menu_above, NULL, USTR _("Menu above prompt"), USTR _("Menu below prompt"), USTR _(" Menu position ") }, {USTR "search_prompting", 0, &pico, NULL, USTR _("Search prompting on"), USTR _("Search prompting off"), USTR _(" Search prompting ") }, {USTR "menu_jump", 0, &menu_jump, NULL, USTR _("Jump into menu is on"), USTR _("Jump into menu is off"), USTR _(" Jump into menu ") }, {USTR "autoswap", 0, &autoswap, NULL, USTR _("Autoswap ^KB and ^KK"), USTR _("Autoswap off "), USTR _(" Autoswap mode ") }, {USTR "indentc", 5, NULL, (unsigned char *) &fdefault.indentc, USTR _("Indent char %d (SPACE=32, TAB=9, ^C to abort): "), 0, USTR _(" Indent char "), 0, 0, 255 }, {USTR "istep", 5, NULL, (unsigned char *) &fdefault.istep, USTR _("Indent step %d (^C to abort): "), 0, USTR _(" Indent step "), 0, 1, 64 }, {USTR "french", 4, NULL, (unsigned char *) &fdefault.french, USTR _("One space after periods for paragraph reformat"), USTR _("Two spaces after periods for paragraph reformat"), USTR _(" French spacing ") }, {USTR "flowed", 4, NULL, (unsigned char *) &fdefault.flowed, USTR _("One space after paragraph line"), USTR _("No spaces after paragraph lines"), USTR _(" Flowed text ") }, {USTR "highlight", 4, NULL, (unsigned char *) &fdefault.highlight, USTR _("Highlighting enabled"), USTR _("Highlighting disabled"), USTR _("H Highlighting ") }, {USTR "spaces", 4, NULL, (unsigned char *) &fdefault.spaces, USTR _("Inserting spaces when tab key is hit"), USTR _("Inserting tabs when tab key is hit"), USTR _(" No tabs ") }, {USTR "mid", 0, &mid, NULL, USTR _("Cursor will be recentered on scrolls"), USTR _("Cursor will not be recentered on scroll"), USTR _("C Center on scroll ") }, {USTR "guess_crlf",0, &guesscrlf, NULL, USTR _("Automatically detect MS-DOS files"), USTR _("Do not automatically detect MS-DOS files"), USTR _(" Auto detect CR-LF ") }, {USTR "guess_indent",0, &guessindent, NULL, USTR _("Automatically detect indentation"), USTR _("Do not automatically detect indentation"), USTR _(" Guess indent ") }, {USTR "guess_non_utf8",0, &guess_non_utf8, NULL, USTR _("Automatically detect non-UTF-8 in UTF-8 locale"), USTR _("Do not automatically detect non-UTF-8"), USTR _(" Guess non-UTF-8 ") }, {USTR "guess_utf8",0, &guess_utf8, NULL, USTR _("Automatically detect UTF-8 in non-UTF-8 locale"), USTR _("Do not automatically detect UTF-8"), USTR _(" Guess UTF-8 ") }, {USTR "transpose",0, &transpose, NULL, USTR _("Menu is transposed"), USTR _("Menus are not transposed"), USTR _(" Transpose menus ") }, {USTR "crlf", 4, NULL, (unsigned char *) &fdefault.crlf, USTR _("CR-LF is line terminator"), USTR _("LF is line terminator"), USTR _("Z CR-LF (MS-DOS) ") }, {USTR "linums", 4, NULL, (unsigned char *) &fdefault.linums, USTR _("Line numbers enabled"), USTR _("Line numbers disabled"), USTR _("N Line numbers ") }, {USTR "marking", 0, &marking, NULL, USTR _("Anchored block marking on"), USTR _("Anchored block marking off"), USTR _(" Marking ") }, {USTR "asis", 0, &dspasis, NULL, USTR _("Characters above 127 shown as-is"), USTR _("Characters above 127 shown in inverse"), USTR _(" Meta chars as-is ") }, {USTR "force", 0, &force, NULL, USTR _("Last line forced to have NL when file saved"), USTR _("Last line not forced to have NL"), USTR _(" Force last NL ") }, {USTR "joe_state",0, &joe_state, NULL, USTR _("~/.joe_state file will be updated"), USTR _("~/.joe_state file will not be updated"), USTR _(" Joe_state file ") }, {USTR "nobackup", 4, NULL, (unsigned char *) &fdefault.nobackup, USTR _("Nobackup enabled"), USTR _("Nobackup disabled"), USTR _(" No backup ") }, {USTR "nobackups", 0, &nobackups, NULL, USTR _("Backup files will not be made"), USTR _("Backup files will be made"), USTR _(" Disable backups ") }, {USTR "nolocks", 0, &nolocks, NULL, USTR _("Files will not be locked"), USTR _("Files will be locked"), USTR _(" Disable locks ") }, {USTR "nomodcheck", 0, &nomodcheck, NULL, USTR _("No file modification time check"), USTR _("File modification time checking enabled"), USTR _(" Disable mtime check ") }, {USTR "nocurdir", 0, &nocurdir, NULL, USTR _("No current dir"), USTR _("Current dir enabled"), USTR _(" Disable current dir ") }, {USTR "break_hardlinks", 0, &break_links, NULL, USTR _("Hardlinks will be broken"), USTR _("Hardlinks not broken"), USTR _(" Break hard links ") }, {USTR "break_links", 0, &break_symlinks, NULL, USTR _("Links will be broken"), USTR _("Links not broken"), USTR _(" Break links ") }, {USTR "lightoff", 0, &lightoff, NULL, USTR _("Highlighting turned off after block operations"), USTR _("Highlighting not turned off after block operations"), USTR _(" Auto unmark ") }, {USTR "exask", 0, &exask, NULL, USTR _("Prompt for filename in save & exit command"), USTR _("Don't prompt for filename in save & exit command"), USTR _(" Exit ask ") }, {USTR "beep", 0, &joe_beep, NULL, USTR _("Warning bell enabled"), USTR _("Warning bell disabled"), USTR _("B Beeps ") }, {USTR "nosta", 0, &staen, NULL, USTR _("Top-most status line disabled"), USTR _("Top-most status line enabled"), USTR _(" Disable status line ") }, {USTR "keepup", 0, &keepup, NULL, USTR _("Status line updated constantly"), USTR _("Status line updated once/sec"), USTR _(" Fast status line ") }, {USTR "pg", 1, &pgamnt, NULL, USTR _("Lines to keep for PgUp/PgDn or -1 for 1/2 window (%d): "), 0, USTR _(" No. PgUp/PgDn lines "), 0, -1, 64 }, {USTR "undo_keep", 1, &undo_keep, NULL, USTR _("No. undo records to keep, or (0 for infinite): "), 0, USTR _(" No. undo records "), 0, -1, 64 }, {USTR "csmode", 0, &csmode, NULL, USTR _("Start search after a search repeats previous search"), USTR _("Start search always starts a new search"), USTR _(" Continued search ") }, {USTR "rdonly", 4, NULL, (unsigned char *) &fdefault.readonly, USTR _("Read only"), USTR _("Full editing"), USTR _("O Read only ") }, {USTR "smarthome", 4, NULL, (unsigned char *) &fdefault.smarthome, USTR _("Smart home key enabled"), USTR _("Smart home key disabled"), USTR _(" Smart home key ") }, {USTR "indentfirst", 4, NULL, (unsigned char *) &fdefault.indentfirst, USTR _("Smart home goes to indentation first"), USTR _("Smart home goes home first"), USTR _(" To indent first ") }, {USTR "smartbacks", 4, NULL, (unsigned char *) &fdefault.smartbacks, USTR _("Smart backspace key enabled"), USTR _("Smart backspace key disabled"), USTR _(" Smart backspace ") }, {USTR "purify", 4, NULL, (unsigned char *) &fdefault.purify, USTR _("Indentation clean up enabled"), USTR _("Indentation clean up disabled"), USTR _(" Clean up indents ") }, {USTR "picture", 4, NULL, (unsigned char *) &fdefault.picture, USTR _("Picture drawing mode enabled"), USTR _("Picture drawing mode disabled"), USTR _("P Picture mode ") }, {USTR "backpath", 2, &backpath, NULL, USTR _("Backup files stored in (%s): "), 0, USTR _(" Path to backup files ") }, {USTR "syntax", 9, NULL, NULL, USTR _("Select syntax (^C to abort): "), 0, USTR _("Y Syntax") }, {USTR "encoding",13, NULL, NULL, USTR _("Select file character set (^C to abort): "), 0, USTR _("E Encoding ") }, {USTR "single_quoted", 4, NULL, (unsigned char *) &fdefault.single_quoted, USTR _("Single quoting enabled"), USTR _("Single quoting disabled"), USTR _(" ^G ignores '... ' ") }, {USTR "no_double_quoted",4, NULL, (unsigned char *) &fdefault.no_double_quoted, USTR _("Double quoting disabled"), USTR _("Double quoting enabled"), USTR _(" ^G ignores \"... \" ") }, {USTR "c_comment", 4, NULL, (unsigned char *) &fdefault.c_comment, USTR _("/* comments enabled"), USTR _("/* comments disabled"), USTR _(" ^G ignores /*...*/ ") }, {USTR "cpp_comment", 4, NULL, (unsigned char *) &fdefault.cpp_comment, USTR _("// comments enabled"), USTR _("// comments disabled"), USTR _(" ^G ignores //... ") }, {USTR "pound_comment", 4, NULL, (unsigned char *) &fdefault.pound_comment, USTR _("# comments enabled"), USTR _("# comments disabled"), USTR _(" ^G ignores #... ") }, {USTR "vhdl_comment", 4, NULL, (unsigned char *) &fdefault.vhdl_comment, USTR _("-- comments enabled"), USTR _("-- comments disabled"), USTR _(" ^G ignores --... ") }, {USTR "semi_comment", 4, NULL, (unsigned char *) &fdefault.semi_comment, USTR _("; comments enabled"), USTR _("; comments disabled"), USTR _(" ^G ignores ;... ") }, {USTR "tex_comment", 4, NULL, (unsigned char *) &fdefault.tex_comment, USTR _("% comments enabled"), USTR _("% comments disabled"), USTR _(" ^G ignores %... ") }, {USTR "text_delimiters", 6, NULL, (unsigned char *) &fdefault.text_delimiters, USTR _("Text delimiters (%s): "), 0, USTR _(" Text delimiters ") }, {USTR "language", 6, NULL, (unsigned char *) &fdefault.language, USTR _("Language (%s): "), 0, USTR _("V Language ") }, {USTR "cpara", 6, NULL, (unsigned char *) &fdefault.cpara, USTR _("Characters which can indent paragraphs (%s): "), 0, USTR _(" Paragraph indent chars ") }, {USTR "floatmouse", 0, &floatmouse, 0, USTR _("Clicking can move the cursor past end of line"), USTR _("Clicking past end of line moves cursor to the end"), USTR _(" Click past end ") }, {USTR "rtbutton", 0, &rtbutton, 0, USTR _("Mouse action is done with the right button"), USTR _("Mouse action is done with the left button"), USTR _(" Right button ") }, {USTR "nonotice", 0, &nonotice, NULL, 0, 0, 0 }, {USTR "help_is_utf8", 0, &help_is_utf8, NULL, 0, 0, 0 }, {USTR "noxon", 0, &noxon, NULL, 0, 0, 0 }, {USTR "orphan", 0, &orphan, NULL, 0, 0, 0 }, {USTR "help", 0, &help, NULL, 0, 0, 0 }, {USTR "dopadding", 0, &dopadding, NULL, 0, 0, 0 }, {USTR "lines", 1, &lines, NULL, 0, 0, 0, 0, 2, 1024 }, {USTR "baud", 1, &Baud, NULL, 0, 0, 0, 0, 50, 32767 }, {USTR "columns", 1, &columns, NULL, 0, 0, 0, 0, 2, 1024 }, {USTR "skiptop", 1, &skiptop, NULL, 0, 0, 0, 0, 0, 64 }, {USTR "notite", 0, ¬ite, NULL, 0, 0, 0 }, {USTR "mouse", 0, &xmouse, NULL, 0, 0, 0 }, {USTR "usetabs", 0, &usetabs, NULL, 0, 0, 0 }, {USTR "assume_color", 0, &assume_color, NULL, 0, 0, 0 }, {USTR "assume_256color", 0, &assume_256color, NULL, 0, 0, 0 }, {USTR "joexterm", 0, &joexterm, NULL, 0, 0, 0 }, { NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } }; /* Initialize .ofsts above. Is this really necessary? */ int isiz = 0; HASH *opt_tab; static void izopts(void) { int x; opt_tab = htmk(128); for (x = 0; glopts[x].name; ++x) { htadd(opt_tab, glopts[x].name, glopts + x); switch (glopts[x].type) { case 4: case 5: case 6: case 7: case 8: glopts[x].ofst = glopts[x].addr - (unsigned char *) &fdefault; } } isiz = 1; } /* 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(unsigned char *s, unsigned char *arg, OPTIONS *options, int set) { int val; int ret = 0; int st = 1; /* 1 to set option, 0 to clear it */ struct glopts *opt; /* Initialize offsets */ if (!isiz) izopts(); /* Clear instead of set? */ if (s[0] == '-') { st = 0; ++s; } opt = htfind(opt_tab, s); if (opt) { switch (opt->type) { case 0: /* Global variable flag option */ if (set) *(int *)opt->set = st; break; case 1: /* Global variable integer option */ if (set && arg) { sscanf((char *)arg, "%d", &val); if (val >= opt->low && val <= opt->high) *(int *)opt->set = val; } break; case 2: /* Global variable string option */ if (set) { if (arg) *(unsigned char **) opt->set = zdup(arg); else *(unsigned char **) opt->set = 0; } break; case 4: /* Local option flag */ if (options) *(int *) ((unsigned char *) options + opt->ofst) = st; break; case 5: /* Local option integer */ if (arg) { if (options) { sscanf((char *)arg, "%d", &val); if (val >= opt->low && val <= opt->high) *(int *) ((unsigned char *) options + opt->ofst) = val; } } break; case 6: /* Local string option */ if (options) { if (arg) { *(unsigned char **) ((unsigned char *) options + opt->ofst) = zdup(arg); } else { *(unsigned char **) ((unsigned char *) options + opt->ofst) = 0; } } break; case 7: /* Local option numeric + 1, with range checking */ if (arg) { int zz = 0; sscanf((char *)arg, "%d", &zz); if (zz >= opt->low && zz <= opt->high) { --zz; if (options) *(int *) ((unsigned char *) options + opt->ofst) = zz; } } break; case 9: /* Set syntax */ if (arg && options) options->syntax_name = zdup(arg); /* this was causing all syntax files to be loaded... if (arg && options) options->syntax = load_syntax(arg); */ break; case 13: /* Set byte mode encoding */ if (arg && options) options->map_name = zdup(arg); break; } /* This is a stupid hack... */ if ((opt->type & 3) == 0 || !arg) return 1; else return 2; } else { /* Why no case 6, string option? */ /* Keymap, mold, mnew, etc. are not strings */ /* These options do not show up in ^T */ if (!zcmp(s, USTR "lmsg")) { if (arg) { if (options) options->lmsg = zdup(arg); ret = 2; } else ret = 1; } else if (!zcmp(s, USTR "rmsg")) { if (arg) { if (options) options->rmsg = zdup(arg); ret = 2; } else ret = 1; } else if (!zcmp(s, USTR "keymap")) { if (arg) { int y; for (y = 0; !joe_isspace(locale_map,arg[y]); ++y) ; if (!arg[y]) arg[y] = 0; if (options && y) options->context = zdup(arg); ret = 2; } else ret = 1; } else if (!zcmp(s, USTR "mnew")) { if (arg) { int sta; if (options) options->mnew = mparse(NULL, arg, &sta); ret = 2; } else ret = 1; } else if (!zcmp(s, USTR "mfirst")) { if (arg) { int sta; if (options) options->mfirst = mparse(NULL, arg, &sta); ret = 2; } else ret = 1; } else if (!zcmp(s, USTR "mold")) { if (arg) { int sta; if (options) options->mold = mparse(NULL, arg, &sta); ret = 2; } else ret = 1; } else if (!zcmp(s, USTR "msnew")) { if (arg) { int sta; if (options) options->msnew = mparse(NULL, arg, &sta); ret = 2; } else ret = 1; } else if (!zcmp(s, USTR "msold")) { if (arg) { int sta; if (options) options->msold = mparse(NULL, arg, &sta); ret = 2; } else ret = 1; } else if (!zcmp(s, USTR "text_color")) { if (arg) { bg_text = meta_color(arg); bg_help = bg_text; bg_prompt = bg_text; bg_menu = bg_text; bg_msg = bg_text; bg_stalin = bg_text; ret = 2; } else ret = 1; } else if (!zcmp(s, USTR "help_color")) { if (arg) { bg_help = meta_color(arg); ret = 2; } else ret = 1; } else if (!zcmp(s, USTR "status_color")) { if (arg) { bg_stalin = meta_color(arg); ret = 2; } else ret = 1; } else if (!zcmp(s, USTR "menu_color")) { if (arg) { bg_menu = meta_color(arg); ret = 2; } else ret = 1; } else if (!zcmp(s, USTR "prompt_color")) { if (arg) { bg_prompt = meta_color(arg); ret = 2; } else ret = 1; } else if (!zcmp(s, USTR "msg_color")) { if (arg) { bg_msg = meta_color(arg); ret = 2; } else ret = 1; } } return ret; } /* Option setting user interface (^T command) */ static int doabrt1(BW *bw, int *xx) { joe_free(xx); return -1; } static int doopt1(BW *bw, unsigned char *s, int *xx, int *notify) { int ret = 0; int x = *xx; int v; joe_free(xx); switch (glopts[x].type) { case 1: v = calc(bw, s); if (merr) { msgnw(bw->parent, merr); ret = -1; } else if (v >= glopts[x].low && v <= glopts[x].high) *(int *)glopts[x].set = v; else { msgnw(bw->parent, joe_gettext(_("Value out of range"))); ret = -1; } break; case 2: if (s[0]) *(unsigned char **) glopts[x].set = zdup(s); break; case 6: *(unsigned char **)((unsigned char *)&bw->o+glopts[x].ofst) = zdup(s); break; case 5: v = calc(bw, s); if (merr) { msgnw(bw->parent, merr); ret = -1; } else if (v >= glopts[x].low && v <= glopts[x].high) *(int *) ((unsigned char *) &bw->o + glopts[x].ofst) = v; else { msgnw(bw->parent, joe_gettext(_("Value out of range"))); ret = -1; } break; case 7: v = calc(bw, s) - 1.0; if (merr) { msgnw(bw->parent, merr); ret = -1; } else if (v >= glopts[x].low && v <= glopts[x].high) *(int *) ((unsigned char *) &bw->o + glopts[x].ofst) = v; else { msgnw(bw->parent, joe_gettext(_("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; syn = load_syntax(s); if (syn) bw->o.syntax = syn; else msgnw(bw->parent, joe_gettext(_("Syntax definition file not found"))); vsrm(s); bw->b->o = bw->o; updall(); if (notify) *notify = 1; return ret; } unsigned char **syntaxes = NULL; /* Array of available syntaxes */ static int syntaxcmplt(BW *bw) { if (!syntaxes) { unsigned char *oldpwd = pwd(); unsigned char **t; unsigned char *p; int x, y; if (chpwd(USTR (JOEDATA "syntax"))) return -1; t = rexpnd(USTR "*.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(buf,sizeof(buf),"%s/.joe/syntax",p); if (!chpwd(buf) && (t = rexpnd(USTR "*.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 (!zcmp(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); } 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) && ((BW *)w->object)->b == bw->b && ((BW *)w->object)->o.hex) return 1; return 0; } static int doencoding(BW *bw, unsigned char *s, int *xx, int *notify) { int ret = 0; struct charmap *map; map = find_charmap(s); if (map && map->type && check_for_hex(bw)) { msgnw(bw->parent, joe_gettext(_("UTF-8 encoding not allowed with hexadecimal windows"))); if (notify) *notify = 1; return -1; } if (map) { bw->o.charmap = map; joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("%s encoding assumed for this file")), map->name); msgnw(bw->parent, msgbuf); } else msgnw(bw->parent, joe_gettext(_("Character set not found"))); vsrm(s); bw->b->o = bw->o; updall(); if (notify) *notify = 1; return ret; } unsigned char **encodings = NULL; /* Array of available encodinges */ static int encodingcmplt(BW *bw) { if (!encodings) { encodings = get_encodings(); vasort(av(encodings)); } return simple_cmplt(bw,encodings); } /* Menus of macros */ struct rc_menu_entry { MACRO *m; unsigned char *name; }; struct rc_menu { struct rc_menu *next; /* Next one in list */ unsigned char *name; /* Name of this menu */ int last_position; /* Last cursor position */ int size; /* Number of entries */ struct rc_menu_entry **entries; } *menus; struct menu_instance { struct rc_menu *menu; unsigned char **s; }; int find_option(unsigned char *s) { int y; for (y = 0; glopts[y].name; ++y) if (!zcmp(glopts[y].name, s)) return y; return -1; } struct rc_menu *find_menu(unsigned char *s) { struct rc_menu *m; for (m = menus; m; m = m->next) if (!zcmp(m->name, s)) break; return m; } struct rc_menu *create_menu(unsigned char *name) { struct rc_menu *menu = find_menu(name); if (menu) return menu; menu = (struct rc_menu *)joe_malloc(sizeof(struct rc_menu)); menu->name = zdup(name); menu->next = menus; menus = menu; menu->last_position = 0; menu->size = 0; menu->entries = 0; return menu; } void add_menu_entry(struct rc_menu *menu, unsigned char *entry_name, MACRO *m) { struct rc_menu_entry *e = (struct rc_menu_entry *)joe_malloc(sizeof(struct rc_menu_entry)); e->m = m; e->name = zdup(entry_name); ++menu->size; if (!menu->entries) { menu->entries = (struct rc_menu_entry **)joe_malloc(menu->size * sizeof(struct rc_menu_entry *)); } else { menu->entries = (struct rc_menu_entry **)joe_realloc(menu->entries, menu->size * sizeof(struct rc_menu_entry *)); } menu->entries[menu->size - 1] = e; } static int olddoopt(BW *bw, int y, int flg, int *notify) { int *xx; unsigned char buf[OPT_BUF_SIZE]; if (y >= 0) { switch (glopts[y].type) { case 0: if (!flg) *(int *)glopts[y].set = !*(int *)glopts[y].set; else if (flg == 1) *(int *)glopts[y].set = 1; else *(int *)glopts[y].set = 0; msgnw(bw->parent, *(int *)glopts[y].set ? joe_gettext(glopts[y].yes) : joe_gettext(glopts[y].no)); break; case 4: if (!flg) *(int *) ((unsigned char *) &bw->o + glopts[y].ofst) = !*(int *) ((unsigned char *) &bw->o + glopts[y].ofst); else if (flg == 1) *(int *) ((unsigned char *) &bw->o + glopts[y].ofst) = 1; else *(int *) ((unsigned char *) &bw->o + glopts[y].ofst) = 0; msgnw(bw->parent, *(int *) ((unsigned char *) &bw->o + glopts[y].ofst) ? joe_gettext(glopts[y].yes) : joe_gettext(glopts[y].no)); if (glopts[y].ofst == (unsigned char *) &fdefault.readonly - (unsigned char *) &fdefault) bw->b->rdonly = bw->o.readonly; /* Kill UTF-8 mode if we switch to hex display */ if (glopts[y].ofst == (unsigned char *) &fdefault.hex - (unsigned char *) &fdefault && bw->o.hex && bw->b->o.charmap->type) { doencoding(bw, vsncpy(NULL, 0, sc("C")), NULL, NULL); } break; case 6: xx = (int *) joe_malloc(sizeof(int)); *xx = y; if(*(unsigned char **)((unsigned char *)&bw->o+glopts[y].ofst)) joe_snprintf_1(buf, OPT_BUF_SIZE, glopts[y].yes,*(unsigned char **)((unsigned char *)&bw->o+glopts[y].ofst)); else joe_snprintf_1(buf, OPT_BUF_SIZE, glopts[y].yes,""); if(wmkpw(bw->parent, buf, NULL, doopt1, NULL, doabrt1, utypebw, xx, notify, locale_map, 0)) return 0; else return -1; /* break; warns on some systems */ case 1: joe_snprintf_1(buf, OPT_BUF_SIZE, joe_gettext(glopts[y].yes), *(int *)glopts[y].set); xx = (int *) joe_malloc(sizeof(int)); *xx = y; if (wmkpw(bw->parent, buf, NULL, doopt1, NULL, doabrt1, utypebw, xx, notify, locale_map, 0)) return 0; else return -1; case 2: if (*(unsigned char **) glopts[y].set) joe_snprintf_1(buf, OPT_BUF_SIZE, joe_gettext(glopts[y].yes), *(unsigned char **) glopts[y].set); else joe_snprintf_1(buf, OPT_BUF_SIZE, joe_gettext(glopts[y].yes), ""); xx = (int *) joe_malloc(sizeof(int)); *xx = y; if (wmkpw(bw->parent, buf, NULL, doopt1, NULL, doabrt1, utypebw, xx, notify, locale_map, 0)) return 0; else return -1; case 5: joe_snprintf_1(buf, OPT_BUF_SIZE, joe_gettext(glopts[y].yes), *(int *) ((unsigned char *) &bw->o + glopts[y].ofst)); goto in; case 7: joe_snprintf_1(buf, OPT_BUF_SIZE, joe_gettext(glopts[y].yes), *(int *) ((unsigned char *) &bw->o + glopts[y].ofst) + 1); in:xx = (int *) joe_malloc(sizeof(int)); *xx = y; if (wmkpw(bw->parent, buf, NULL, doopt1, NULL, doabrt1, utypebw, xx, notify, locale_map, 0)) return 0; else return -1; case 9: joe_snprintf_1(buf, OPT_BUF_SIZE, joe_gettext(glopts[y].yes), ""); if (wmkpw(bw->parent, buf, NULL, dosyntax, NULL, NULL, syntaxcmplt, NULL, notify, locale_map, 0)) return 0; else return -1; case 13: joe_snprintf_1(buf, OPT_BUF_SIZE, joe_gettext(glopts[y].yes), ""); if (wmkpw(bw->parent, buf, NULL, doencoding, NULL, NULL, encodingcmplt, NULL, notify, locale_map, 0)) 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, struct menu_instance *mi) { mi->menu->last_position = x; for (x = 0; mi->s[x]; ++x) vsrm(mi->s[x]); /* joe_free(mi->s[x]); */ joe_free(mi->s); joe_free(mi); return -1; } int menu_flg; /* Key used to select menu entry */ static int execmenu(MENU *m, int x, struct menu_instance *mi, int flg) { struct rc_menu *menu = mi->menu; int *notify = m->parent->notify; if (notify) *notify = 1; wabort(m->parent); menu_flg = flg; return exmacro(menu->entries[x]->m, 1); } int display_menu(BW *bw, struct rc_menu *menu, int *notify) { struct menu_instance *m = (struct menu_instance *)joe_malloc(sizeof(struct menu_instance)); unsigned char **s = (unsigned char **)joe_malloc(sizeof(unsigned char *) * (menu->size + 1)); int x; for (x = 0; x != menu->size; ++x) { /* s[x] = zdup(menu->entries[x]->name); */ s[x] = stagen(NULL, bw, menu->entries[x]->name, ' '); #if 0 int y; if ((y = find_option(menu->entries[x])) >= 0) { s[x] = (unsigned char *) joe_malloc(OPT_BUF_SIZE); /* FIXME: why 40 ??? */ switch (glopts[y].type) { case 0: joe_snprintf_2((s[x]), OPT_BUF_SIZE, "%s%s", joe_gettext(glopts[y].menu), *(int *)glopts[y].set ? "ON" : "OFF"); break; case 1: joe_snprintf_2((s[x]), OPT_BUF_SIZE, "%s%d", joe_gettext(glopts[y].menu), *(int *)glopts[y].set); break; case 2: case 9: case 13: case 6: zcpy(s[x], joe_gettext(glopts[y].menu)); break; case 4: joe_snprintf_2((s[x]), OPT_BUF_SIZE, "%s%s", joe_gettext(glopts[y].menu), *(int *) ((unsigned char *) &bw->o + glopts[y].ofst) ? "ON" : "OFF"); break; case 5: joe_snprintf_2((s[x]), OPT_BUF_SIZE, "%s%d", joe_gettext(glopts[y].menu), *(int *) ((unsigned char *) &bw->o + glopts[y].ofst)); break; case 7: joe_snprintf_2((s[x]), OPT_BUF_SIZE, "%s%d", joe_gettext(glopts[y].menu), *(int *) ((unsigned char *) &bw->o + glopts[y].ofst) + 1); break; } } else { s[x] = zdup(menu->entries[x]); } #endif } s[x] = 0; m->menu = menu; m->s = s; if (mkmenu(bw->parent, bw->parent, m->s, execmenu, doabrt, NULL, menu->last_position, m, notify)) return 0; else return -1; } unsigned char *get_status(BW *bw, unsigned char *s) { static unsigned char buf[OPT_BUF_SIZE]; int y = find_option(s); if (y == -1) return USTR "???"; else { switch (glopts[y].type) { case 0: { return *(int *)glopts[y].set ? USTR "ON" : USTR "OFF"; } case 1: { joe_snprintf_1(buf, OPT_BUF_SIZE, "%d", *(int *)glopts[y].set); return buf; } case 4: { return *(int *) ((unsigned char *) &bw->o + glopts[y].ofst) ? USTR "ON" : USTR "OFF"; } case 5: { joe_snprintf_1(buf, OPT_BUF_SIZE, "%d", *(int *) ((unsigned char *) &bw->o + glopts[y].ofst)); return buf; } case 7: { joe_snprintf_1(buf, OPT_BUF_SIZE, "%d", *(int *) ((unsigned char *) &bw->o + glopts[y].ofst) + 1); return buf; } default: { return USTR ""; } } } } /* ^T command */ unsigned char **getmenus(void) { unsigned char **s = vaensure(NULL, 20); struct rc_menu *m; for (m = menus; m; m = m->next) s = vaadd(s, vsncpy(NULL, 0, sz(m->name))); vasort(s, aLen(s)); return s; } unsigned char **smenus = NULL; /* Array of command names */ static int menucmplt(BW *bw) { if (!smenus) smenus = getmenus(); return simple_cmplt(bw,smenus); } static int domenu(BW *bw, unsigned char *s, void *object, int *notify) { struct rc_menu *menu = find_menu(s); vsrm(s); if (!menu) { msgnw(bw->parent, joe_gettext(_("No such menu"))); if (notify) *notify = 1; return -1; } else { bw->b->o.readonly = bw->o.readonly = bw->b->rdonly; return display_menu(bw, menu, notify); } } B *menuhist = NULL; int umenu(BW *bw) { if (wmkpw(bw->parent, joe_gettext(_("Menu: ")), &menuhist, domenu, USTR "menu", NULL, menucmplt, NULL, NULL, locale_map, 0)) { return 0; } else { return -1; } } /* Simplified mode command */ unsigned char **getoptions(void) { unsigned char **s = vaensure(NULL, 20); int x; for (x = 0; glopts[x].name; ++x) s = vaadd(s, vsncpy(NULL, 0, sz(glopts[x].name))); vasort(s, aLen(s)); return s; } /* Command line */ unsigned char **sopts = NULL; /* Array of command names */ static int optcmplt(BW *bw) { if (!sopts) sopts = getoptions(); return simple_cmplt(bw,sopts); } static int doopt(BW *bw, unsigned char *s, void *object, int *notify) { int y = find_option(s); vsrm(s); if (y == -1) { msgnw(bw->parent, joe_gettext(_("No such option"))); if (notify) *notify = 1; return -1; } else { int flg = menu_flg; menu_flg = 0; return olddoopt(bw, y, flg, notify); } } B *opthist = NULL; int umode(BW *bw) { if (wmkpw(bw->parent, joe_gettext(USTR _("Option: ")), &opthist, doopt, USTR "opt", NULL, optcmplt, NULL, NULL, locale_map, 0)) { 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, unsigned char *name) { OPTIONS *o = &fdefault; /* Current options */ KMAP *context = NULL; /* Current context */ struct rc_menu *current_menu = NULL; 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 */ strncpy((char *)buf, (char *)name, sizeof(buf) - 1); buf[sizeof(buf)-1] = '\0'; #ifdef __MSDOS__ fd = jfopen(buf, "rt"); #else fd = jfopen(buf, "r"); #endif if (!fd) return -1; /* Return if we couldn't open the rc file */ fprintf(stderr,(char *)joe_gettext(_("Processing '%s'...")), name); fflush(stderr); while (jfgets(buf, sizeof(buf), fd)) { line++; switch (buf[0]) { case ' ': case '\t': case '\n': case '\f': case 0: break; /* Skip comment lines */ case '=': /* Define a global color */ { /* # introduces comment */ parse_color_def(&global_colors,buf+1,name,line); } break; case '*': /* Select file types for file-type dependant options */ { /* Space and tab introduce comments- which means we can't have them in the regex */ int x; o = (OPTIONS *) joe_malloc(sizeof(OPTIONS)); *o = fdefault; for (x = 0; buf[x] && buf[x] != '\n' && buf[x] != ' ' && buf[x] != '\t'; ++x) ; buf[x] = 0; o->next = options; options = o; o->name_regex = zdup(buf); } break; case '+': /* Set file contents match regex */ { /* No comments allowed- entire line used. */ int x; for (x = 0; buf[x] && buf[x] != '\n' && buf[x] != '\r'; ++x) ; buf[x] = 0; if (o) o->contents_regex = zdup(buf+1); } break; case '-': /* Set an option */ { /* parse option and arg. arg goes to end of line. This is bad. */ unsigned char *opt = buf + 1; int x; unsigned char *arg = NULL; for (x = 0; buf[x] && buf[x] != '\n' && buf[x] != ' ' && buf[x] != '\t'; ++x) ; if (buf[x] && buf[x] != '\n') { buf[x] = 0; for (arg = buf + ++x; buf[x] && buf[x] != '\n'; ++x) ; } buf[x] = 0; if (!glopt(opt, arg, o, 2)) { err = 1; fprintf(stderr,(char *)joe_gettext(_("\n%s %d: Unknown option %s")), name, line, opt); } } break; case '{': /* Process help text. No comment allowed after {name */ { /* everything after } is ignored. */ line = help_init(fd,buf,line); } break; case ':': /* Select context */ { int x, c; for (x = 1; !joe_isspace_eof(locale_map,buf[x]); ++x) ; c = buf[x]; buf[x] = 0; if (x != 1) if (!zcmp(buf + 1, USTR "def")) { int y; for (buf[x] = c; joe_isblank(locale_map,buf[x]); ++x) ; for (y = x; !joe_isspace_eof(locale_map,buf[y]); ++y) ; c = buf[y]; buf[y] = 0; if (y != x) { int sta; MACRO *m; if (joe_isblank(locale_map,c) && (m = mparse(NULL, buf + y + 1, &sta))) addcmd(buf + x, m); else { err = 1; fprintf(stderr, (char *)joe_gettext(_("\n%s %d: macro missing from :def")), name, line); } } else { err = 1; fprintf(stderr, (char *)joe_gettext(_("\n%s %d: command name missing from :def")), name, line); } } else if (!zcmp(buf + 1, USTR "inherit")) { if (context) { for (buf[x] = c; joe_isblank(locale_map,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)); else { err = 1; fprintf(stderr, (char *)joe_gettext(_("\n%s %d: context name missing from :inherit")), name, line); } } else { err = 1; fprintf(stderr, (char *)joe_gettext(_("\n%s %d: No context selected for :inherit")), name, line); } } else if (!zcmp(buf + 1, USTR "include")) { for (buf[x] = c; joe_isblank(locale_map,buf[x]); ++x) ; for (c = x; !joe_isspace_eof(locale_map,buf[c]); ++c) ; buf[c] = 0; if (c != x) { unsigned char bf[1024]; unsigned char *p = (unsigned char *)getenv("HOME"); int rtn = -1; bf[0] = 0; if (p && buf[x] != '/') { joe_snprintf_2(bf,sizeof(bf),"%s/.joe/%s",p,buf + x); rtn = procrc(cap, bf); } if (rtn == -1 && buf[x] != '/') { joe_snprintf_2(bf,sizeof(bf),"%s%s",JOERC,buf + x); rtn = procrc(cap, bf); } if (rtn == -1 && buf[x] == '/') { joe_snprintf_1(bf,sizeof(bf),"%s",buf + x); rtn = procrc(cap, bf); } switch (rtn) { case 1: err = 1; break; case -1: fprintf(stderr, (char *)joe_gettext(_("\n%s %d: Couldn't open %s")), name, line, bf); err = 1; break; } context = 0; o = &fdefault; } else { err = 1; fprintf(stderr, (char *)joe_gettext(_("\n%s %d: :include missing file name")), name, line); } } else if (!zcmp(buf + 1, USTR "delete")) { if (context) { int y; for (buf[x] = c; joe_isblank(locale_map,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, (char *)joe_gettext(_("\n%s %d: No context selected for :delete")), name, line); } } else if (!zcmp(buf + 1, USTR "defmap")) { for (buf[x] = c; joe_isblank(locale_map,buf[x]); ++x) ; for (c = x; !joe_isspace_eof(locale_map,buf[c]); ++c) ; buf[c] = 0; if (c != x) { context = kmap_getcontext(buf + x); current_menu = 0; } else { err = 1; fprintf(stderr, (char *)joe_gettext(_("\n%s %d: :defmap missing name")), name, line); } } else if (!zcmp(buf + 1, USTR "defmenu")) { for (buf[x] = c; joe_isblank(locale_map,buf[x]); ++x) ; for (c = x; !joe_isspace_eof(locale_map,buf[c]); ++c) ; buf[c] = 0; current_menu = create_menu(buf + x); context = 0; } else { context = kmap_getcontext(buf + 1); current_menu = 0; /* err = 1; fprintf(stderr, (char *)joe_gettext(_("\n%s %d: unknown :command")), name, line);*/ } else { err = 1; fprintf(stderr,(char *)joe_gettext(_("\n%s %d: Invalid context name")), name, line); } } break; default: /* Get key-sequence to macro binding */ { int x, y; MACRO *m; if (!context && !current_menu) { err = 1; fprintf(stderr,(char *)joe_gettext(_("\n%s %d: No context selected for macro to key-sequence binding")), name, line); break; } m = 0; macroloop: m = mparse(m, buf, &x); if (x == -1) { err = 1; fprintf(stderr,(char *)joe_gettext(_("\n%s %d: Unknown command in macro")), name, line); break; } else if (x == -2) { jfgets(buf, 1024, fd); ++line; 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; if (current_menu) { /* Add menu entry */ add_menu_entry(current_menu, buf + x, m); } else { /* Add binding to context */ if (kadd(cap, context, buf + x, m) == -1) { fprintf(stderr,(char *)joe_gettext(_("\n%s %d: Bad key sequence '%s'")), name, line, buf + x); err = 1; } } } break; } } jfclose(fd); /* Close rc file */ /* Print proper ending string */ if (err) fprintf(stderr, (char *)joe_gettext(_("\ndone\n"))); else fprintf(stderr, (char *)joe_gettext(_("done\n"))); return err; /* 0 for success, 1 for syntax error */ } /* Save a history buffer */ void save_hist(FILE *f,B *b) { unsigned char buf[512]; int len; if (b) { P *p = pdup(b->bof, USTR "save_hist"); P *q = pdup(b->bof, USTR "save_hist"); if (b->eof->line>10) pline(p,b->eof->line-10); pset(q,p); while (!piseof(p)) { pnextl(q); if (q->byte-p->byte<512) { len = q->byte - p->byte; brmem(p,buf,len); } else { brmem(p,buf,512); len = 512; } fprintf(f,"\t"); emit_string(f,buf,len); fprintf(f,"\n"); pset(p,q); } prm(p); prm(q); } fprintf(f,"done\n"); } /* Load a history buffer */ void load_hist(FILE *f,B **bp) { B *b; unsigned char buf[1024]; unsigned char bf[1024]; P *q; b = *bp; if (!b) *bp = b = bmk(NULL); q = pdup(b->eof, USTR "load_hist"); while(fgets((char *)buf,1023,f) && zcmp(buf,USTR "done\n")) { unsigned char *p = buf; int len; parse_ws(&p,'#'); len = parse_string(&p,bf,sizeof(bf)); if (len>0) { binsm(q,bf,len); pset(q,b->eof); } } prm(q); } /* Save state */ #define STATE_ID (unsigned char *)"# JOE state file v1.0\n" void save_state() { unsigned char *home = (unsigned char *)getenv("HOME"); int old_mask; FILE *f; if (!joe_state) return; if (!home) return; joe_snprintf_1(stdbuf,stdsiz,"%s/.joe_state",home); old_mask = umask(0066); f = fopen((char *)stdbuf,"w"); umask(old_mask); if(!f) return; /* Write ID */ fprintf(f,"%s",(char *)STATE_ID); /* Write state information */ fprintf(f,"search\n"); save_srch(f); fprintf(f,"macros\n"); save_macros(f); fprintf(f,"files\n"); save_hist(f,filehist); fprintf(f,"find\n"); save_hist(f,findhist); fprintf(f,"replace\n"); save_hist(f,replhist); fprintf(f,"run\n"); save_hist(f,runhist); fprintf(f,"build\n"); save_hist(f,buildhist); fprintf(f,"grep\n"); save_hist(f,grephist); fprintf(f,"cmd\n"); save_hist(f,cmdhist); fprintf(f,"math\n"); save_hist(f,mathhist); fprintf(f,"yank\n"); save_yank(f); fprintf(f,"file_pos\n"); save_file_pos(f); fclose(f); } /* Load state */ void load_state() { unsigned char *home = (unsigned char *)getenv("HOME"); unsigned char buf[1024]; FILE *f; if (!joe_state) return; if (!home) return; joe_snprintf_1(stdbuf,stdsiz,"%s/.joe_state",home); f = fopen((char *)stdbuf,"r"); if(!f) return; /* Only read state information if the version is correct */ if (fgets((char *)buf,1024,f) && !zcmp(buf,STATE_ID)) { /* Read state information */ while(fgets((char *)buf,1023,f)) { if(!zcmp(buf,USTR "search\n")) load_srch(f); else if(!zcmp(buf,USTR "macros\n")) load_macros(f); else if(!zcmp(buf,USTR "files\n")) load_hist(f,&filehist); else if(!zcmp(buf,USTR "find\n")) load_hist(f,&findhist); else if(!zcmp(buf,USTR "replace\n")) load_hist(f,&replhist); else if(!zcmp(buf,USTR "run\n")) load_hist(f,&runhist); else if(!zcmp(buf,USTR "build\n")) load_hist(f,&buildhist); else if(!zcmp(buf,USTR "grep\n")) load_hist(f,&grephist); else if(!zcmp(buf,USTR "cmd\n")) load_hist(f,&cmdhist); else if(!zcmp(buf,USTR "math\n")) load_hist(f,&mathhist); else if(!zcmp(buf,USTR "yank\n")) load_yank(f); else if (!zcmp(buf,USTR "file_pos\n")) load_file_pos(f); else { /* Unknown... skip until next done */ while(fgets((char *)buf,1023,f) && zcmp(buf,USTR "done\n")); } } } fclose(f); } joe-3.7/rc.h0000644000100100007640000000266711103204506007632 00000000000000/* * *rc file parser * Copyright * (C) 1992 Joseph H. Allen; * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_RC_H #define _JOE_RC_H 1 extern OPTIONS pdefault; extern OPTIONS fdefault; void setopt PARAMS((B *b, 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 PARAMS((unsigned char *name)); /* KMAP *ngetcontext(char *name); * JM - Find and return the KMAP for a given context name. If none is found, * NULL is returned. */ KMAP *ngetcontext PARAMS((unsigned char *name)); unsigned char **get_keymap_list(); /* 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 PARAMS((CAP *cap, unsigned char *name)); int glopt PARAMS((unsigned char *s, unsigned char *arg, OPTIONS *options, int set)); int umode PARAMS((BW *bw)); int umenu PARAMS((BW *bw)); /* Save state */ void save_state(); /* Load state */ void load_state(); /* Validate rc file: return -1 if it's bad (call this after rc file has been loaded) */ int validate_rc(); /* Update options */ void lazy_opts PARAMS((B *b, OPTIONS *o)); int ucharset PARAMS((BW *bw)); int ulanguage PARAMS((BW *bw)); unsigned char *get_status(BW *bw, unsigned char *s); #endif joe-3.7/qw.c0000644000100100007640000001423610457276140007661 00000000000000/* * Query windows * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" /* Return width of a string */ int joe_wcswidth(struct charmap *map,unsigned char *s, int len) { if (!map->type) { return len; } else { int width = 0; while (len) { int c = utf8_decode_fwrd(&s, &len); if (c >= 0) { width += joe_wcwidth(1, c); } else ++width; } return width; } } /* Calculate number of lines needed for a given prompt string and a given window width. Also this finds the nth line and returns the position of the substring which is that line. Set n to -1 if you just want the height. */ int break_height(struct charmap *map,unsigned char **src,int *src_len,int wid,int n) { unsigned char *s = *src; int len = *src_len; int h = 1; /* Number of lines */ int col = 0; /* Current column */ int x = 0; /* Offset into string */ int start_of_line = 0; /* Start of most recent line */ while (x != len) { int space = 0; int word = 0; int start = x; int start_word; while (x != len && s[x] == ' ') { ++space; ++x; } start_word = x; while (x != len && s[x] != ' ') { ++x; } word = joe_wcswidth(map, s + start_word, x - start_word); if (col + space + word < wid || !col) { /* Leading space and word fit on current line */ col += space + word; } else { /* They don't fit, start a new line */ if (!n--) { x = start; break; } ++h; col = word; start_of_line = start_word; } } *src = s + start_of_line; *src_len = x - start_of_line; return h; } static void dispqw(QW *qw) { int y; W *w = qw->parent; /* Generate prompt */ for (y = 0; y != w->h; ++y) { unsigned char *s = qw->prompt; int l = qw->promptlen; break_height(locale_map, &s, &l, qw->org_w, y); w->t->t->updtab[w->y + y] = 1; genfield(w->t->t, w->t->t->scrn + (w->y + y) * w->t->t->co + w->x, w->t->t->attr + (w->y + y) * w->t->t->co + w->x, w->x, w->y + y, 0, s, l, BG_COLOR(bg_prompt), w->w - w->x, 1,NULL); w->cury = y; w->curx = w->x + joe_wcswidth(locale_map, s, l); } } static void dispqwn(QW *qw) { int y; W *w = qw->parent; /* Set cursor position */ if (w->win->watom->follow && w->win->object) w->win->watom->follow(w->win->object); if (w->win->watom->disp && w->win->object) 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 */ for (y = 0; y != w->h; ++y) { unsigned char *s = qw->prompt; int l = qw->promptlen; break_height(locale_map, &s, &l, qw->org_w, y); w->t->t->updtab[w->y + y] = 1; genfield(w->t->t, w->t->t->scrn + (w->y + y) * w->t->t->co + w->x, w->t->t->attr + (w->y + y) * w->t->t->co + w->x, w->x, w->y + y, 0, s, l, BG_COLOR(bg_prompt), w->w - w->x, 1,NULL); } } /* When user hits a key in a query window */ struct utf8_sm qw_sm; static int utypeqw(QW *qw, int c) { W *win; W *w = qw->parent; int *notify = w->notify; int (*func) (); void *object = qw->object; if (locale_map->type) { c = utf8_decode(&qw_sm, c); if (c<0) return 0; } win = qw->parent->win; func = qw->func; vsrm(qw->prompt); joe_free(qw); w->object = NULL; w->notify = NULL; wabort(w); if (func) return func(win->object, c, object, notify); return -1; } static int abortqw(QW *qw) { W *win = qw->parent->win; void *object = qw->object; int (*abrt) () = qw->abrt; vsrm(qw->prompt); joe_free(qw); if (abrt) return abrt(win->object, object); else return -1; } static WATOM watomqw = { USTR "query", dispqw, NULL, abortqw, NULL, utypeqw, NULL, NULL, NULL, NULL, TYPEQW }; static WATOM watqwn = { USTR "querya", dispqwn, NULL, abortqw, NULL, utypeqw, NULL, NULL, NULL, NULL, TYPEQW }; static WATOM watqwsr = { USTR "querysr", dispqwn, NULL, abortqw, NULL, utypeqw, NULL, NULL, NULL, NULL, TYPEQW }; /* Create a query window */ QW *mkqw(W *w, unsigned char *prompt, int len, int (*func) (/* ??? */), int (*abrt) (/* ??? */), void *object, int *notify) { W *new; QW *qw; unsigned char *s = prompt; int l = len; int h = break_height(locale_map, &s, &l, w->w, -1); new = wcreate(w->t, &watomqw, w, w, w->main, h, NULL, notify); if (!new) { if (notify) *notify = 1; return NULL; } wfit(new->t); new->object = (void *) (qw = (QW *) joe_malloc(sizeof(QW))); qw->parent = new; qw->prompt = vsncpy(NULL, 0, prompt, len); qw->promptlen = len; qw->org_w = w->w; qw->org_h = h; 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, unsigned char *prompt, int len, int (*func) (/* ??? */), int (*abrt) (/* ??? */), void *object, int *notify) { W *new; QW *qw; unsigned char *s = prompt; int l = len; int h = break_height(locale_map, &s, &l, w->w, -1); new = wcreate(w->t, &watqwn, w, w, w->main, h, NULL, notify); if (!new) { if (notify) *notify = 1; return NULL; } wfit(new->t); new->object = (void *) (qw = (QW *) joe_malloc(sizeof(QW))); qw->parent = new; qw->prompt = vsncpy(NULL, 0, prompt, len); qw->promptlen = len; qw->org_w = w->w; qw->org_h = h; 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, unsigned char *prompt, int len, int (*func) (/* ??? */), int (*abrt) (/* ??? */), void *object, int *notify) { W *new; QW *qw; unsigned char *s = prompt; int l = len; int h = break_height(locale_map, &s, &l, w->w, -1); new = wcreate(w->t, &watqwsr, w, w, w->main, h, NULL, notify); if (!new) { if (notify) *notify = 1; return NULL; } wfit(new->t); new->object = (void *) (qw = (QW *) joe_malloc(sizeof(QW))); qw->parent = new; qw->prompt = vsncpy(NULL, 0, prompt, len); qw->promptlen = len; qw->org_w = w->w; qw->org_h = h; qw->func = func; qw->abrt = abrt; qw->object = object; w->t->curwin = new; return qw; } joe-3.7/qw.h0000644000100100007640000000177710437455044007674 00000000000000/* * Single-key query windows * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_QW_H #define _JOE_QW_H 1 /* Single-key Query window */ struct query { W *parent; /* Window we're in */ int (*func) (); /* Func. which gets called when key is hit */ int (*abrt) (); void *object; unsigned char *prompt; /* Prompt string */ int promptlen; /* Width of prompt string */ int org_w; int org_h; }; /* QW *mkqw(W *w, char *prompt, int (*func)(), int (*abrt)(), void *object); * Create a query window for the given window */ /* FIXME: ??? ----> */ QW *mkqw PARAMS((W *w, unsigned char *prompt, int len, int (*func) (/* ??? */), int (*abrt) (/* ??? */), void *object, int *notify)); QW *mkqwna PARAMS((W *w, unsigned char *prompt, int len, int (*func) (/* ??? */), int (*abrt) (/* ??? */), void *object, int *notify)); QW *mkqwnsr PARAMS((W *w, unsigned char *prompt, int len, int (*func) (/* ??? */), int (*abrt) (/* ??? */), void *object, int *notify)); #endif joe-3.7/va.c0000644000100100007640000000756410431662534007644 00000000000000/* * Variable length array of strings * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" aELEMENT *vamk(int len) { int *new = (int *) joe_malloc((1 + len) * sizeof(aELEMENT) + 2 * sizeof(int)); new[0] = len; new[1] = 0; ((aELEMENT *)(new + 2))[0] = aterm; return (aELEMENT *)(new + 2); } void varm(aELEMENT *vary) { if (vary) { vazap(vary, 0, aLen(vary)); joe_free((int *) vary - 2); } } int alen(aELEMENT *ary) { if (ary) { aELEMENT *beg = ary; while (acmp(*ary, aterm)) ++ary; return ary - beg; } else return 0; } aELEMENT *vaensure(aELEMENT *vary, int len) { if (!vary) vary = vamk(len); else if (len > aSiz(vary)) { len += (len >> 2); vary = (aELEMENT *)(2 + (int *) joe_realloc((int *) vary - 2, (len + 1) * sizeof(aELEMENT) + 2 * sizeof(int))); aSiz(vary) = len; } return vary; } 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; } #ifdef junk aELEMENT *vancpy(aELEMENT *vary, int pos, aELEMENT *array, int len) { int olen = aLEN(vary); 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); mfwrd(vary + pos, array, len * sizeof(aELEMENT)); return vary; } #endif 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) return ary; qsort(ary, len, sizeof(aELEMENT), (int (*)(const void *, const void *))_acmp); return ary; } aELEMENT *vawords(aELEMENT *a, unsigned char *s, int len, 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; } joe-3.7/va.h0000644000100100007640000002100710431662534007635 00000000000000/* * Variable length arrays of strings * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_VA_H #define _JOE_VA_H 1 /* 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 PARAMS((int len)); /* void varm(aELEMENT *vary); * Free an array and everything which is in it. Does nothing if 'vary' is * 0. */ void varm PARAMS((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) ((a) ? *((int *)(a) - 2) : 0) #define aSiz(a) (*((int *)(a) - 2)) /* 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) ((a) ? *((int *)(a) - 1) : 0) #define aLen(a) (*((int *)(a) - 1)) /* 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 PARAMS((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 PARAMS((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 PARAMS((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 PARAMS((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 PARAMS((aELEMENT *vary, int pos, aELEMENT el, int len)); #ifdef junk /* aELEMENT *vancpy(aELEMENT *vary, int pos, aELEMENT *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. */ aELEMENT *vancpy PARAMS((aELEMENT *vary, int pos, aELEMENT *array, int len)); #endif /* 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 PARAMS((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 PARAMS((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 PARAMS((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 PARAMS((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 PARAMS((aELEMENT *a, unsigned char *s, int len, unsigned char *sep, int seplen)); #endif joe-3.7/tw.c0000644000100100007640000004323011103410566007647 00000000000000/* * Text editing windows * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" int staen = 0; int staupd = 0; int keepup = 0; int bg_stalin; /* Move text window */ static void movetw(BW *bw, int x, int y) { 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(BW *bw, int wi, int he) { 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 * */ unsigned char *get_context(BW *bw) { P *p = pdup(bw->cursor, USTR "get_context"); static unsigned char buf1[stdsiz]; int i, j, spc; 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)) { /* next: */ brzs(p,stdbuf,stdsiz/8); /* To avoid buffer overruns with my_iconv */ /* Ignore comment and block structuring lines */ if (!(stdbuf[0]=='{' || (stdbuf[0]=='/' && stdbuf[1]=='*') || stdbuf[0]=='\f' || (stdbuf[0]=='/' && stdbuf[1]=='/') || stdbuf[0]=='#' || (stdbuf[0]=='b' && stdbuf[1]=='e' && stdbuf[2]=='g' && stdbuf[3]=='i' && stdbuf[4]=='n') || (stdbuf[0]=='B' && stdbuf[1]=='E' && stdbuf[2]=='G' && stdbuf[3]=='I' && stdbuf[4]=='N') || (stdbuf[0]=='-' && stdbuf[1]=='-') || stdbuf[0]==';')) { /* zcpy(buf1,stdbuf); */ /* replace tabs to spaces and remove adjoining spaces */ for (i=0,j=0,spc=0; stdbuf[i]; i++) { if (stdbuf[i]=='\t' || stdbuf[i]==' ') { if (spc) continue; spc = 1; } else spc = 0; if (stdbuf[i]=='\t') buf1[j++] = ' '; else if (stdbuf[i]=='\\') { buf1[j++] = '\\'; buf1[j++] = '\\'; } else buf1[j++] = stdbuf[i]; } buf1[j]= '\0'; /* 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; } unsigned char *duplicate_backslashes(unsigned char *s, int len) { unsigned char *m; int x, count; for (x = count = 0; x != len; ++x) if (s[x] == '\\') ++count; m = vsmk(len + count); for (x = 0; x != len; ++x) { m = vsadd(m, s[x]); if (s[x] == '\\') m = vsadd(m, '\\'); } return m; } /* static */unsigned char *stagen(unsigned char *stalin, BW *bw, unsigned char *s, int fill) { unsigned char buf[80]; int x; W *w = bw->parent; time_t n=time(NULL); struct tm *cas; cas=localtime(&n); 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) { unsigned char *s = get_context(bw); /* We need to translate between file's character set to locale */ my_iconv(stdbuf,locale_map,s,bw->o.charmap); stalin = vsncpy(sv(stalin), sz(stdbuf)); } } break; case 'y': { if (bw->o.syntax) { joe_snprintf_1(buf, sizeof(buf), "(%s)", bw->o.syntax->name); stalin = vsncpy(sv(stalin), sz(buf)); } } break; case 't': { time_t n = time(NULL); int l; unsigned char *d = (unsigned char *)ctime(&n); l = (d[11] - '0') * 10 + d[12] - '0'; if (l > 12) l -= 12; joe_snprintf_1(buf, sizeof(buf), "%2.2d", l); if (buf[0] == '0') buf[0] = fill; stalin = vsncpy(sv(stalin), buf, 2); stalin = vsncpy(sv(stalin), d + 13, 3); } break; case 'd': { if (s[1]) switch (*++s) { case 'd' : joe_snprintf_1(buf, sizeof(buf), "%02d",cas->tm_mday); break; case 'm' : joe_snprintf_1(buf, sizeof(buf), "%02d",cas->tm_mon + 1); break; case 'y' : joe_snprintf_1(buf, sizeof(buf), "%02d",cas->tm_year % 100); break; case 'Y' : joe_snprintf_1(buf, sizeof(buf), "%04d",cas->tm_year + 1900); break; case 'w' : joe_snprintf_1(buf, sizeof(buf), "%d",cas->tm_wday); break; case 'D' : joe_snprintf_1(buf, sizeof(buf), "%03d",cas->tm_yday); break; default : buf[0]='d'; buf[1]=*s; buf[2]=0; } else { buf[0]='d'; buf[1]=0; } stalin=vsncpy(sv(stalin),sz(buf)); } break; case 'E': { unsigned char *ch; int l; buf[0]=0; for(l=0;s[l+1] && s[l+1] != '%'; l++) buf[l]=s[l+1]; if (s[l+1]=='%' && buf[0]) { buf[l]=0; s+=l+1; ch=(unsigned char *)getenv((char *)buf); if (ch) stalin=vsncpy(sv(stalin),sz(ch)); } } break; case 'Z': { unsigned char *ch; int l; buf[0]=0; for(l=0;s[l+1] && s[l+1] != '%'; l++) buf[l]=s[l+1]; if (s[l+1]=='%' && buf[0]) { buf[l]=0; s+=l+1; ch=get_status(bw, buf); if (ch) stalin=vsncpy(sv(stalin),sz(ch)); } } break; case 'u': { time_t n = time(NULL); unsigned char *d = (unsigned char *)ctime(&n); stalin = vsncpy(sv(stalin), d + 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) { unsigned char *tmp = simplify_prefix(bw->b->name); unsigned char *tmp1 = duplicate_backslashes(sv(tmp)); vsrm(tmp); stalin = vsncpy(sv(stalin), sv(tmp1)); vsrm(tmp1); } else { stalin = vsncpy(sv(stalin), sz(joe_gettext(_("Unnamed")))); } } break; case 'm': if (bw->b->changed) stalin = vsncpy(sv(stalin), sz(joe_gettext(_("(Modified)")))); break; case 'R': if (bw->b->rdonly) stalin = vsncpy(sv(stalin), sz(joe_gettext(_("(Read only)")))); break; case '*': if (bw->b->changed) stalin = vsadd(stalin, '*'); else stalin = vsadd(stalin, fill); break; case 'r': joe_snprintf_1(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(buf, sizeof(buf), "%-4lld", 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(buf, sizeof(buf), "%-4llX", 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 (!piseof(bw->cursor)) joe_snprintf_1(buf, sizeof(buf), "%3d", brch(bw->cursor)); else joe_snprintf_0(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 (!piseof(bw->cursor)) joe_snprintf_1(buf, sizeof(buf), "%2.2X", brch(bw->cursor)); else joe_snprintf_0(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(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 >= 1024*1024) joe_snprintf_1(buf, sizeof(buf), "%3lld", (bw->cursor->byte >> 10) * 100 / (bw->b->eof->byte >> 10)); else if (bw->b->eof->byte) joe_snprintf_1(buf, sizeof(buf), "%3lld", bw->cursor->byte * 100 / bw->b->eof->byte); else joe_snprintf_0(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(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': { int i; unsigned char *cpos = buf; buf[0] = 0; if (w->kbd->x && w->kbd->seq[0]) for (i = 0; i != w->kbd->x; ++i) { int c = w->kbd->seq[i] & 127; if (c < 32) { cpos[0] = '^'; cpos[1] = c + '@'; cpos += 2; } else if (c == 127) { cpos[0] = '^'; cpos[1] = '?'; cpos += 2; } else { cpos[0] = c; cpos += 1; } } *cpos++ = fill; while (cpos - buf < 4) *cpos++ = fill; stalin = vsncpy(sv(stalin), buf, cpos - buf); } break; case 'S': if (bw->b->pid) stalin = vsncpy(sv(stalin), sz(joe_gettext(_("*SHELL*")))); break; case 'M': if (recmac) { joe_snprintf_1(buf, sizeof(buf), joe_gettext(_("(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(BW *bw, int flg) { W *w = bw->parent; TW *tw = (TW *) bw->object; if (bw->o.linums != bw->linums) { bw->linums = bw->o.linums; resizetw(bw, w->w, w->h); movetw(bw, w->x, w->y); bwfllw(bw); } 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, bg_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; } 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 = (void *) (newbw = bwmk(new, bw->b, 0)); ++bw->b->count; newbw->offset = bw->offset; newbw->object = (void *) (newtw = (TW *) joe_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 = (void *) (newbw = bwmk(new, bw->b, 0)); ++bw->b->count; newbw->offset = bw->offset; newbw->object = (void *) (newtw = (TW *) joe_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 = { USTR "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 = (void *) (bw = bwmk(w, b, 0)); wredraw(bw->parent); bw->object = object; return 0; } bwrm(bw); vsrm(tw->stalin); joe_free(tw); w->object = 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 != YES_CODE && !yncheck(yes_key, k)) 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 != YES_CODE && !yncheck(yes_key, k)) 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, sz(joe_gettext(_("Lose changes to this file (y,n,^C)? "))), naborttw, NULL, NULL, NULL)) return 0; else return -1; else return naborttw(bw, YES_CODE, 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, sz(joe_gettext(_("Lose changes to this file (y,n,^C)? "))), naborttw1, NULL, NULL, NULL)) return 0; else return -1; else return naborttw1(bw, YES_CODE, 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 = (void *) (bw = bwmk(w, b, 0)); wredraw(bw->parent); bw->object = object; return 0; } return naborttw(bw, YES_CODE, NULL, NULL); } /* Kill current window (orphans buffer) */ int utw0(BASE *b) { BW *bw = b->parent->main->object; 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; 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; 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)); msetI(bw->t->t->updtab + bw->y, 1, bw->h); } } } while ((w = w->link.next) != maint->curwin); /* In case error buffer was orphaned */ if (errbuf == b && b->oldcur) { pline(b->oldcur, line); } } /* 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); wfit(w->t); w->object = (void *) (bw = bwmk(w, b, 0)); bw->object = (void *) (tw = (TW *) joe_malloc(sizeof(TW))); iztw(tw, w->y); return bw; } joe-3.7/tw.h0000644000100100007640000000203611100464224007650 00000000000000/* * Text editing windows * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_TW_H #define _JOE_TW_H 1 /* Text window (a BW) */ 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) */ }; BW *wmktw PARAMS((Screen *t, B *b)); int usplitw PARAMS((BW *bw)); int uduptw PARAMS((BW *bw)); int utw0 PARAMS((BASE *b)); int utw1 PARAMS((BASE *b)); int uabortbuf PARAMS((BW *bw)); int ucancel PARAMS((BW *bw, int k)); int uabort PARAMS((BW *bw, int k)); int uabort1 PARAMS((BW *bw, int k)); void setline PARAMS((B *b, long int line)); int abortit PARAMS((BW *bw)); extern int staen; extern int staupd; extern int keepup; extern int bg_stalin; extern WATOM watomtw; unsigned char *stagen(unsigned char *stalin, BW *bw, unsigned char *s, int fill); #endif joe-3.7/vs.c0000644000100100007640000001461610431662534007662 00000000000000/* * Variable length strings * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" int sicmp(unsigned char a, unsigned char b) { if (a >= 'A' || a <= 'Z') a += 'a' - 'A'; if (b >= 'A' || b <= 'Z') b += 'a' - 'A'; return scmp(a, b); } sELEMENT *vsmk(int len) { int *new = (int *) joe_malloc((1 + len) * sizeof(sELEMENT) + 2 * sizeof(int)); new[0] = len; new[1] = 0; ((sELEMENT *)(new + 2))[0] = sdup(sterm); return (sELEMENT *)(new + 2); } void vsrm(sELEMENT *vary) { if (vary) joe_free((int *) vary - 2); } int slen(sELEMENT *ary) { if (ary) { sELEMENT *beg = ary; while (scmp(*ary, sterm)) ++ary; return ary - beg; } else return 0; } sELEMENT *vsensure(sELEMENT *vary, int len) { if (!vary) vary = vsmk(len); else if (len > sSiz(vary)) { len += (len >> 2); vary = (sELEMENT *)(2 + (int *) joe_realloc((int *) vary - 2, (len + 1) * sizeof(sELEMENT) + 2 * sizeof(int))); sSiz(vary) = len; } return vary; } 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, 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); mmove(vary + pos, array, len * sizeof(sELEMENT)); 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; } #ifdef junk sELEMENT *vsins(sELEMENT *vary, int pos, int n) { if (!vary || sLEN(vary) + n > sSIZ(vary)) vary = vsensure(vary, sLEN(vary) + n); if (pos >= sLen(vary)) vary = vstrunc(vary, pos + n); else { mmove(vary + pos + n, vary + pos, sLen(vary) - (pos + n) + 1); sLen(vary) += n; } return vary; } sELEMENT *vsdel(sELEMENT *vary, int pos, int n) { if (pos >= sLEN(vary)) return vary; if (pos + n >= sLen(vary)) return vstrunc(vary, pos); mmove(vary + pos, vary + pos + n, sLen(vary) - (pos + n) + 1); sLen(vary) -= n; return vary; } int _scmp(sELEMENT a, sELEMENT b) { return scmp(a, b); } sELEMENT *vssort(sELEMENT *ary, int len) { if (!ary || !len) return ary; qsort(ary, len, sizeof(sELEMENT), _scmp); return ary; } #endif int vsbsearch(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; } #ifdef junk int vsfirst(sELEMENT *ary, int len, sELEMENT el) { int x; if (!ary || !len) return ~0; for (x = 0; x != len; ++x) if (!scmp(ary[x], el)) return x; return ~0; } int vslast(sELEMENT *ary, int len, sELEMENT el) { int x = len; if (!ary || !len) return ~0; do { --x; if (!scmp(ary[x], el)) return x; } while (x); return ~0; } #endif 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)); } #ifdef junk int vsicmpn(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 = sicmp(a[x], b[x])) return t; if (alen > blen) return 1; if (alen < blen) return -1; return 0; } int vss(sELEMENT *a, int alen, sELEMENT *b, int blen) { int x; if (!a && !b) return 0; if (!a || !b) return ~0; if (alen < blen) return ~0; if (!blen) return 0; for (x = 0; x != alen - blen; ++x) if (!vscmpn(a, blen, b, blen)) return x; return ~0; } #endif int vsscan(sELEMENT *a, int alen, 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(sELEMENT *a, int alen, 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])) break; } return x; } #ifdef junk sELEMENT *vsread(sELEMENT d, int p, int (*getC)(), void *ptr) { int c; if (!d) d = vsmk(10); c = getC(ptr); if (c == NO_MORE_DATA) { vsrm(d); return NULL; } else if (c == '\n') return d; else { d = vsset(d, p, c); p++; } while (c = getC(ptr), c != NO_MORE_DATA && c != '\n') { d = vsset(d, p, c); p++; } return d; } sELEMENT *vwords(sELEMENT *s, sELEMENT **a, int len, sELEMENT t) { int x; if (!s) s = vsmk(32); else s = vstrunc(s, 0); for (x = 0; x != len; ++x) { s = vsncpy(s, sLEN(s), sz(a[x])); if (a[1]) s = vsadd(s, t); } return s; } #endif joe-3.7/vs.h0000644000100100007640000003702610431662534007667 00000000000000/* * Dynamic string library * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_VS_H #define _JOE_VS_H 1 /*** * * 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)) /* Compare a single element- case insensitive */ int sicmp(unsigned char a, unsigned char b); /* 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 PARAMS((int len)); /* void vsrm(sELEMENT *vary); * Free an array and everything which is in it. Does nothing if 'vary' is * 0. */ void vsrm PARAMS((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) ((a) ? *((int *)(a) - 2) : 0) #define sSiz(a) (*((int *)(a) - 2)) /* 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) ((a) ? *((int *)(a) - 1) : 0) #define sLen(a) (*((int *)(a) - 1)) /* int slen(sELEMENT *ary); * Compute length of char or variable length array by searching for termination * element. Returns 0 if 'vary' is 0. */ int slen PARAMS((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 PARAMS((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 PARAMS((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 PARAMS((sELEMENT *vary, int pos, sELEMENT el, int len)); /* sELEMENT *vsncpy(sELEMENT *vary, int pos, 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 PARAMS((sELEMENT *vary, int pos, 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 PARAMS((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 PARAMS((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 PARAMS((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) (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]) /**********************/ /* Insertion/Deletion */ /**********************/ #ifdef junk /* sELEMENT *vsins(sELEMENT *vary, int pos, int n)); * Insert n empty slots into the array. If 'pos' >= the length of the array, * the array is simply extended. The new slots are not set to anything. * This does not set the elements in the created hole to any particular * value: use vsfill if you need that to occur. */ sELEMENT *vsins PARAMS((sELEMENT *vary, int pos, int n)); /* sELEMENT *vsdel(sELEMENT *vary, int pos, int n)); * Delete n slots from the array. This does not zap the elements first; call * vszap first if you need this to happen. */ sELEMENT *vsdel PARAMS((SELEMENT *vary, int pos, int n)); /*************************/ /* Searching and Sorting */ /*************************/ /* sELEMENT *vssort(sELEMENT *ary, int len)) * Sort the elements of an array (char or variable length) using qsort(). */ sELEMENT *vssort PARAMS((sELEMENT *ary, int len)); #endif /* int vsbsearch(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 PARAMS((sELEMENT *ary, int len, sELEMENT el)); #ifdef junk /* int vsfirst(sELEMENT *ary, int len, sELEMENT element); * Find offset to first matching element in 'vary' or return ~0 if not found. */ int vsfirst PARAMS((sELEMENT *ary, int len, sELEMENT element)); /* int vslast(sELEMENT *ary, int len, sELEMENT element); * Find offset to last matching element in 'vary' or return ~0 if none found. */ int vslast PARAMS((sELEMENT *ary, int len, sELEMENT element)); /* int vss(sELEMENT *a, int alen, sELEMENT *b, int blen); * Do a substring search on 'a'. Return offset from 'a' to first matching * occurance of 'b' in 'a' or return ~0 if none found. */ int vss PARAMS((sELEMENT *a, int alen, sELEMENT *b, int blen)); #endif /* 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 PARAMS((sELEMENT *a, int alen, sELEMENT *b, int blen)); /* int vscmp(sELEMENT *a, sELEMENT *b); * * Functionalized version of: vscmpn(sv(a), sv(b)); */ int vscmp PARAMS((sELEMENT *a, sELEMENT *b)); #ifdef junk /* int vsicmpn(sELEMENT *a, int alen, sELEMENT *b, int blen); * * Compare two arrays using sicmp. If 'a' > 'b', return 1. If 'a' == 'b', * return 0. If 'a' < 'b', return -1. Longer strings are > shorter ones if * their beginning match. * * This is same as vscmpn except that it is case insensitive. */ int vsicmpn PARAMS((sELEMENT *a, int alen, sELEMENT *b, int blen)); /* int vsicmp(sELEMENT *a, sELEMENT *b); * * Functionalized version of: vsicmpn(sv(a), sv(b)); */ int vsicmp PARAMS((sELEMENT *a, sELEMENT *b)); #endif /* int vsscan(sELEMENT *a, int alen, 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 PARAMS((sELEMENT *a, int alen, 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 PARAMS((sELEMENT *a, int alen, sELEMENT *b, int blen)); /***************/ /* Other stuff */ /***************/ #ifdef junk /* char *vsread(char *d, int p, int (*getC)(void *ptr), void *ptr); * Replace 'd' with next line read from read-character function 'getC'. If * 'd' is 0, a new string is allocated. If there is no more input, the string * is freed and 0 is returned. The \n is deleted from the entered line. * * 'ptr' is passed as the first arg to 'getC'. 'getC' should return -1 if * there is no more input. */ unsigned char *vsread PARAMS(()); /* char *vwords(char *s, char **a, int len, char t); * * Generate a 't'-seperated word list from the words in the zero-terminated * array of zero-terminated strings 'a'. For example a simple 'echo.c': * * main(argc, argv) * char *argv[]; * { * printf("%s\n",vwords(NULL,argv,argc,' ')): * } * */ unsigned char *vwords PARAMS(()); #endif #endif joe-3.7/depcomp0000755000100100007640000003677410430772560010454 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-02-09.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, 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. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" 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. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # 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,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$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" ;; 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 mecanism 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 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 '/^# [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: joe-3.7/INSTALL.AMIGA0000644000100100007640000000237510215632604010726 000000000000001. Introduction --------------- This file describes particular issues on AmigaOS port of JOE. 2. Requirements --------------- To compile JOE you need ncurses and termcap libraries installed. 3. Installation --------------- - Extract the archive into your GeekGadgets tree - Go to AmigaOS shell and execute "setenv TERM amiga" - Copy file ENV:TERM to your ENVARC: directory. 4. Usage -------- Unfortunately ixemul.library does not implement pseudo-terminals (ptys), so inserting shell command output (CTRL-K !) does not work. All other functions are fully implemented and work exactly in the same way as in UNIX version. 5. Compiling ------------ To recompile JOE just cd to the directory with sources and type (if you use standard Amiga shell): sh configure --prefix=/gg From UNIX shell (like ksh) you may just type: ./configure --prefix=/gg When the configuration process finishes, type: make After compiling you may install the program by using: make install To clean up the distribution (erase all binary and #?.o files) you can use: make clean 6. Known bugs ------------- AmigaOS port of JOE currently has no specific bugs 7. Port author --------- My name is Pavel Fedin, i live in Russia, and you can always reach me by E-Mail: sonic_amiga@rambler.rujoe-3.7/regex.c0000644000100100007640000002045610457276140010345 00000000000000/* * Regular expression subroutines * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" int escape(int utf8,unsigned char **a, int *b) { int c; unsigned char *s = *a; int l = *b; 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': c = *s - '0'; ++s; --l; if (l > 0 && *s >= '0' && *s <= '7') { c = c * 8 + s[1] - '0'; ++s; --l; } if (l > 0 && *s >= '0' && *s <= '7') { c = c * 8 + s[1] - '0'; ++s; --l; } break; case 'x': case 'X': c = 0; ++s; --l; if (l > 0 && *s >= '0' && *s <= '9') { c = c * 16 + *s - '0'; ++s; --l; } else if (l > 0 && *s >= 'A' && *s <= 'F') { c = c * 16 + *s - 'A' + 10; ++s; --l; } else if (l > 0 && *s >= 'a' && *s <= 'f') { c = c * 16 + *s - 'a' + 10; ++s; --l; } if (l > 0 && *s >= '0' && *s <= '9') { c = c * 16 + *s - '0'; ++s; --l; } else if (l > 0 && *s >= 'A' && *s <= 'F') { c = c * 16 + *s - 'A' + 10; ++s; --l; } else if (l > 0 && *s >= 'a' && *s <= 'f') { c = c * 16 + *s - 'a' + 10; ++s; --l; } break; default: if (utf8) c = utf8_decode_fwrd(&s, &l); else { c = *s++; --l; } break; } } else if (utf8) { c = utf8_decode_fwrd(&s,&l); } else { c = *s++; --l; } *a = s; *b = l; return c; } static int brack(int utf8,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(utf8, &s, &l); if (l >= 2 && s[0] == '-' && s[1] != ']') { --l; ++s; cr = escape(utf8, &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 utf8,unsigned char **pieces, int n, int c) { unsigned char buf[16]; int len; unsigned char *s = NULL; if (utf8) 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)) == '\\') { s = 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, USTR "pmatch"); P *o = NULL; int utf8 = p->b->o.charmap->type; struct charmap *map = p->b->o.charmap; struct utf8_sm sm; utf8_init(&sm); while (len) { if (utf8) { 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(utf8, 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(utf8, ®ex, &len)) goto fail; break; case '*': /* Find shortest matching sequence */ o = pdup(p, USTR "pmatch"); 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, USTR "pmatch"); 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(utf8, ®ex, &len, d)) goto fail; savec(utf8, 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; int d = 0; o = pdup(p, USTR "pmatch"); /* 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(utf8, ®ex, &len, 0); } else { d = escape(utf8, ®ex, &len); if (icase) d = joe_tolower(map,d); } } else if (utf8) { 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, USTR "pmatch"); if (pmatch(pieces, regex, len, p, n + 1, icase)) { saves(pieces, n, o, z->byte - o->byte); if (r) prm(r); r = pdup(p, USTR "pmatch"); } pset(p, z); prm(z); c = pgetc(p); tregex = oregex; tlen = olen; if (*oregex == '\\') { if (oregex[1] == '[') { tregex += 2; tlen -= 2; match = brack(utf8, &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; } joe-3.7/regex.h0000644000100100007640000000052710431662534010345 00000000000000/* * Regular expression subroutines * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_REGEX_H #define _JOE_REGEX_H 1 int escape PARAMS((int utf8,unsigned char **a, int *b)); int pmatch PARAMS((unsigned char **pieces, unsigned char *regex, int len, P *p, int n, int icase)); #endif joe-3.7/HINTS0000644000100100007640000002015710217620416007666 00000000000000This documentation should go elsewhere, but I haven't gotten around to it yet. UTF-8 ----- 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). 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 ~/.joe/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 Unicode 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. Hit Ctrl-G to jump between matching delimiters. This works on word delimiters for languages like Pascal and Verilog which use begin...end to delimit blocks. If a word is not known, Ctrl-G starts a search with the word moved into the search prompt. 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: hit Ctrl-rtarw (right arrow) 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 within JOE 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). Also you can hit Ctrl-delete to cut and Ctrl-insert to paste if the sequence for these keys are known. Xterm Mouse support ------------------- Use the -mouse option to enable xterm mouse support. When enabled, you can position the cursor or select text with the mouse. Unfortunately, text selected this way is not paste-able to other X windows. However, when xterm mouse support is enable you can use Shift-left-click and Shift-middle-click for normal Xterm select and paste. Shell Windows ------------- If you use Bash, you can hit: ` UP-ARROW and ` DOWN-ARROW to scroll through Bash's history buffer. Other keys work as well: try ` A to go to beginning of line or ` E to go to end of line. Unfortunately JOE only emulates a dumb terminal, so you have to use a lot of imagination to do any editing beyond hitting backspace. In general, any character quoted with ` is sent to the shell. Also sent to the shell: TAB, Backspace, Enter, ^C and ^D. Macros ------ A macro is a comma separated list of commands or named macros. When the macro is executed, each command is executed until either the end of the list is reached, or one of the commands fails (non-zero return value from the command). Failed commands beep if you have beeps enabled (^T B). Macro don't stop modifier ------------------------- Sometimes, you expect commands to sometimes fail, but want the rest of the commands in the list to be executed anyway. To mark a command which is allowed to fail, postfix it with '!'. For example, here a macro which hits down page in the window above: prevw,pgdn!,nextw If prevw fails, the macro is aborted as usual. Even if pgdn fails (already at end of buffer), nextw will be executed so that the cursor is returned to the original window. Macro repeat argument modifiers ------------------------------- Repeat arguments can be specified with ^K \. When a command is executed with a repeat argument, it is repeatedly executed the specified number of times. If the repeat argument is negative, an opposite command (if one exists) is executed instead. For example, if you repeat "rtarw" -3 times, "ltarw" will be repeated 3 times. If a negative argument is given for a command which does not have an opposite, the repeat argument is ignored. Normally, if a repeat argument is specified for a macro, the macro is simply repeated the given number of times. If a negative argument is given, the argument is ignored. Sometimes you want to allow negative arguments for macros and have their behavior modified. To do this, postfix each command within the macro which should be switched to its opposite for negative arguments with '-'. For example, here is the page down other window macro: prevw,pgdn-!,nextw Now if you execute this with an argument of -2, it will be repeated twice, but pgup will be executed instead of pgdn. (not that several postfix modifiers can be placed after each command). Sometimes when a repeat argument is given to macro, you want only one of the commands in the list to be repeated, not the entire macro. This can be indicated as follows: prevw,pgdn#!,nextw If this is executed with an argument of 2, prevw is executed once, pgdn is executed twice, and nextw is executed once. Finally, even more complex semantics can be expressed with the "if" command: if~,"arg<0",then, ltarw, else, rtarw, endif When the macro is executed, the "arg" math variable is set to the given repeat argument. The "argset" variable is set to true if the user set an argument, even if it's 1. If no argument was given, argset is false. If any command in the list is postfixed with ~ (if above), the macro is not repeated, even if there is an argument. 'arg' is still set to the given repeat count, however. 'psh'/'query' interaction ------------------------- The 'psh' command saves the ^KB and ^KK positions on a stack. When the macro completes, (or when the 'pop' command is called) the positions are restored. The 'query' command suspends macro execution until the current dialog is complete. It also suspends the automatic 'pop' which happens at the end of a macro- so if the macro ends in a dialog you often want to call 'query' to prevent the ^KB ^KK positions from being restored too early. 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. joe-3.7/cmd.c0000644000100100007640000005156111103201417007757 00000000000000/* * Command execution * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" int joe_beep = 0; /* Command table */ int ubeep(BW *bw, int k) { ttputc(7); return 0; } CMD cmds[] = { {USTR "abort", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uabort, NULL, 0, NULL}, {USTR "abortbuf", TYPETW, uabortbuf, NULL, 0, NULL}, {USTR "arg", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uarg, NULL, 0, NULL}, {USTR "ask", TYPETW + TYPEPW, uask, NULL, 0, NULL}, {USTR "uarg", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uuarg, NULL, 0, NULL}, {USTR "backs", TYPETW + TYPEPW + ECHKXCOL + EFIXXCOL + EMINOR + EKILL + EMOD, ubacks, NULL, 1, USTR "delch"}, {USTR "backsmenu", TYPEMENU, umbacks, NULL, 1, NULL}, {USTR "backw", TYPETW + TYPEPW + ECHKXCOL + EFIXXCOL + EKILL + EMOD, ubackw, NULL, 1, USTR "delw"}, {USTR "beep", TYPETW + TYPEPW + TYPEMENU + TYPEQW, ubeep, NULL, 0, NULL}, {USTR "begin_marking", TYPETW + TYPEPW, ubegin_marking, NULL, 0, NULL}, {USTR "bknd", TYPETW, ubknd, NULL, 0, NULL}, {USTR "bkwdc", TYPETW + TYPEPW, ubkwdc, NULL, 1, USTR "fwrdc"}, {USTR "blkcpy", TYPETW + TYPEPW + EFIXXCOL + EMOD + EBLOCK, ublkcpy, NULL, 1, NULL}, {USTR "blkdel", TYPETW + TYPEPW + EFIXXCOL + EKILL + EMOD + EBLOCK, ublkdel, NULL, 0, NULL}, {USTR "blkmove", TYPETW + TYPEPW + EFIXXCOL + EMOD + EBLOCK, ublkmove, NULL, 0, NULL}, {USTR "blksave", TYPETW + TYPEPW + EBLOCK, ublksave, NULL, 0, NULL}, {USTR "bof", TYPETW + TYPEPW + EMOVE + EFIXXCOL, u_goto_bof, NULL, 0, NULL}, {USTR "bofmenu", TYPEMENU, umbof, NULL, 0, NULL}, {USTR "bol", TYPETW + TYPEPW + EFIXXCOL, u_goto_bol, NULL, 0, NULL}, {USTR "bolmenu", TYPEMENU, umbol, NULL, 0, NULL}, {USTR "bop", TYPETW + TYPEPW + EFIXXCOL, ubop, NULL, 1, USTR "eop"}, {USTR "bos", TYPETW + TYPEPW + EMOVE, ubos, NULL, 0, NULL}, {USTR "bufed", TYPETW, ubufed, NULL, 0, NULL}, {USTR "build", TYPETW + TYPEPW, ubuild, NULL, 0, NULL}, {USTR "byte", TYPETW + TYPEPW, ubyte, NULL, 0, NULL}, {USTR "cancel", TYPETW + TYPEPW + TYPEMENU + TYPEQW, ucancel, NULL, 0, NULL}, {USTR "center", TYPETW + TYPEPW + EFIXXCOL + EMOD, ucenter, NULL, 1, NULL}, {USTR "charset", TYPETW + TYPEPW, ucharset, NULL, 0, NULL}, {USTR "ctrl", TYPETW + TYPEPW + EMOD, uctrl, NULL, 0, NULL}, {USTR "col", TYPETW + TYPEPW, ucol, NULL, 0, NULL}, {USTR "complete", TYPEPW + EMINOR + EMOD, ucmplt, NULL, 0, NULL}, {USTR "copy", TYPETW + TYPEPW, ucopy, NULL, 0, NULL}, {USTR "crawll", TYPETW + TYPEPW, ucrawll, NULL, 1, USTR "crawlr"}, {USTR "crawlr", TYPETW + TYPEPW, ucrawlr, NULL, 1, USTR "crawll"}, {USTR "defmdown", TYPETW+TYPEPW+TYPEQW+TYPEMENU, udefmdown, 0, 0, 0 }, {USTR "defmup", TYPETW+TYPEPW, udefmup, 0, 0, 0 }, {USTR "defmdrag", TYPETW+TYPEPW, udefmdrag, 0, 0, 0 }, {USTR "defm2down", TYPETW+TYPEPW+TYPEMENU, udefm2down, 0, 0, 0 }, {USTR "defm2up", TYPETW+TYPEPW, udefm2up, 0, 0, 0 }, {USTR "defm2drag", TYPETW+TYPEPW, udefm2drag, 0, 0, 0 }, {USTR "defm3down", TYPETW+TYPEPW, udefm3down, 0, 0, 0 }, {USTR "defm3up", TYPETW+TYPEPW, udefm3up, 0, 0, 0 }, {USTR "defm3drag", TYPETW+TYPEPW, udefm3drag, 0, 0, 0 }, {USTR "delbol", TYPETW + TYPEPW + EFIXXCOL + EKILL + EMOD, udelbl, NULL, 1, USTR "deleol"}, {USTR "delch", TYPETW + TYPEPW + ECHKXCOL + EFIXXCOL + EMINOR + EKILL + EMOD, udelch, NULL, 1, USTR "backs"}, {USTR "deleol", TYPETW + TYPEPW + EKILL + EMOD, udelel, NULL, 1, USTR "delbol"}, {USTR "dellin", TYPETW + TYPEPW + EFIXXCOL + EKILL + EMOD, udelln, NULL, 1, NULL}, {USTR "delw", TYPETW + TYPEPW + EFIXXCOL + ECHKXCOL + EKILL + EMOD, u_word_delete, NULL, 1, USTR "backw"}, {USTR "dnarw", TYPETW + TYPEPW + EMOVE, udnarw, NULL, 1, USTR "uparw"}, {USTR "dnarwmenu", TYPEMENU, umdnarw, NULL, 1, USTR "uparwmenu"}, {USTR "dnslide", TYPETW + TYPEPW + TYPEMENU + TYPEQW + EMOVE, udnslide, NULL, 1, USTR "upslide"}, {USTR "dnslidemenu", TYPEMENU, umscrdn, NULL, 1, USTR "upslidemenu"}, {USTR "drop", TYPETW + TYPEPW, udrop, NULL, 0, NULL}, {USTR "dupw", TYPETW, uduptw, NULL, 0, NULL}, {USTR "edit", TYPETW, uedit, NULL, 0, NULL}, {USTR "else", TYPETW+TYPEPW+TYPEMENU+TYPEQW+EMETA, uelse, 0, 0, 0 }, {USTR "elsif", TYPETW+TYPEPW+TYPEMENU+TYPEQW+EMETA, uelsif, 0, 0, 0 }, {USTR "endif", TYPETW+TYPEPW+TYPEMENU+TYPEQW+EMETA, uendif, 0, 0, 0 }, {USTR "eof", TYPETW + TYPEPW + EFIXXCOL + EMOVE, u_goto_eof, NULL, 0, NULL}, {USTR "eofmenu", TYPEMENU, umeof, NULL, 0, NULL}, {USTR "eol", TYPETW + TYPEPW + EFIXXCOL, u_goto_eol, NULL, 0, NULL}, {USTR "eolmenu", TYPEMENU, umeol, NULL, 0, NULL}, {USTR "eop", TYPETW + TYPEPW + EFIXXCOL, ueop, NULL, 1, USTR "bop"}, {USTR "execmd", TYPETW + TYPEPW, uexecmd, NULL, 0, NULL}, {USTR "explode", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uexpld, NULL, 0, NULL}, {USTR "exsave", TYPETW + TYPEPW, uexsve, NULL, 0, NULL}, {USTR "ffirst", TYPETW + TYPEPW, pffirst, NULL, 0, NULL}, {USTR "filt", TYPETW + TYPEPW + EMOD + EBLOCK, ufilt, NULL, 0, NULL}, {USTR "finish", TYPETW + TYPEPW + EMOD, ufinish, NULL, 1, NULL}, {USTR "fnext", TYPETW + TYPEPW, pfnext, NULL, 1, NULL}, {USTR "format", TYPETW + TYPEPW + EFIXXCOL + EMOD, uformat, NULL, 1, NULL}, {USTR "fmtblk", TYPETW + EMOD + EFIXXCOL + EBLOCK, ufmtblk, NULL, 1, NULL}, {USTR "fwrdc", TYPETW + TYPEPW, ufwrdc, NULL, 1, USTR "bkwdc"}, {USTR "gomark", TYPETW + TYPEPW + EMOVE, ugomark, NULL, 0, NULL}, {USTR "grep", TYPETW, ugrep, NULL, 0, NULL}, {USTR "groww", TYPETW, ugroww, NULL, 1, USTR "shrinkw"}, {USTR "if", TYPETW+TYPEPW+TYPEMENU+TYPEQW+EMETA, uif, 0, 0, 0 }, {USTR "isrch", TYPETW + TYPEPW, uisrch, NULL, 0, NULL}, {USTR "jump", TYPETW, ujump, NULL, 0, NULL }, {USTR "killjoe", TYPETW + TYPEPW + TYPEMENU + TYPEQW, ukilljoe, NULL, 0, NULL}, {USTR "killproc", TYPETW + TYPEPW, ukillpid, NULL, 0, NULL}, {USTR "help", TYPETW + TYPEPW + TYPEQW, u_help, NULL, 0, NULL}, {USTR "home", TYPETW + TYPEPW + EFIXXCOL, uhome, NULL, 0, NULL}, {USTR "hnext", TYPETW + TYPEPW + TYPEQW, u_help_next, NULL, 0, NULL}, {USTR "hprev", TYPETW + TYPEPW + TYPEQW, u_help_prev, NULL, 0, NULL}, {USTR "insc", TYPETW + TYPEPW + EFIXXCOL + EMOD, uinsc, NULL, 1, USTR "delch"}, {USTR "keymap", TYPETW, ukeymap, 0, 0, 0 }, /* JM */ {USTR "insf", TYPETW + TYPEPW + EMOD, uinsf, NULL, 0, NULL}, {USTR "language", TYPETW + TYPEPW, ulanguage, NULL, 0, NULL}, {USTR "lindent", TYPETW + TYPEPW + EFIXXCOL + EMOD + EBLOCK, ulindent, NULL, 1, USTR "rindent"}, {USTR "line", TYPETW + TYPEPW, uline, NULL, 0, NULL}, {USTR "lose", TYPETW + TYPEPW, ulose, NULL, 0, NULL}, {USTR "lower", TYPETW + TYPEPW + EMOD + EBLOCK, ulower, NULL, 0, NULL}, {USTR "ltarw", TYPETW + TYPEPW /* + EFIXXCOL + ECHKXCOL */, u_goto_left, NULL, 1, USTR "rtarw"}, {USTR "ltarwmenu", TYPEMENU, umltarw, NULL, 1, USTR "rtarwmenu"}, {USTR "macros", TYPETW + EFIXXCOL, umacros, NULL, 0, NULL}, {USTR "debug_joe", TYPETW + EFIXXCOL, udebug_joe, NULL, 0, NULL}, {USTR "markb", TYPETW + TYPEPW, umarkb, NULL, 0, NULL}, {USTR "markk", TYPETW + TYPEPW, umarkk, NULL, 0, NULL}, {USTR "markl", TYPETW + TYPEPW, umarkl, NULL, 0, NULL}, {USTR "math", TYPETW + TYPEPW, umath, NULL, 0, NULL}, {USTR "menu", TYPETW + TYPEPW + TYPEQW, umenu, NULL, 0, NULL}, {USTR "mode", TYPETW + TYPEPW + TYPEQW, umode, NULL, 0, NULL}, {USTR "msg", TYPETW + TYPEPW + TYPEQW + TYPEMENU, umsg, NULL, 0, NULL}, {USTR "mfit", TYPETW, umfit, NULL, 0, NULL}, {USTR "mwind", TYPETW, umwind, NULL, 0, NULL}, {USTR "name", TYPETW + TYPEPW, uname_joe, NULL, 0, NULL}, {USTR "nbuf", TYPETW, unbuf, NULL, 1, USTR "pbuf"}, {USTR "nedge", TYPETW + TYPEPW + EFIXXCOL, unedge, NULL, 1, USTR "pedge"}, {USTR "nextpos", TYPETW + TYPEPW + EFIXXCOL + EMID + EPOS, unextpos, NULL, 1, USTR "prevpos"}, {USTR "nextw", TYPETW + TYPEPW + TYPEMENU + TYPEQW, unextw, NULL, 1, USTR "prevw"}, {USTR "nextword", TYPETW + TYPEPW + EFIXXCOL, u_goto_next, NULL, 1, USTR "prevword"}, {USTR "nmark", TYPETW + TYPEPW, unmark, NULL, 0, NULL}, {USTR "notmod", TYPETW, unotmod, NULL, 0, NULL}, {USTR "nxterr", TYPETW, unxterr, NULL, 1, USTR "prverr"}, {USTR "open", TYPETW + TYPEPW + EFIXXCOL + EMOD, uopen, NULL, 1, USTR "deleol"}, {USTR "parserr", TYPETW, uparserr, NULL, 0, NULL}, {USTR "paste", TYPETW + TYPEPW + EMOD, upaste, NULL, 0, NULL }, {USTR "pbuf", TYPETW, upbuf, NULL, 1, USTR "nbuf"}, {USTR "pedge", TYPETW + TYPEPW + EFIXXCOL, upedge, NULL, 1, USTR "nedge"}, {USTR "pgdn", TYPETW + TYPEPW + TYPEMENU + TYPEQW + EMOVE, upgdn, NULL, 1, USTR "pgup"}, {USTR "pgdnmenu", TYPEMENU, umpgdn, NULL, 1, USTR "pgupmenu"}, {USTR "pgup", TYPETW + TYPEPW + TYPEMENU + TYPEQW + EMOVE, upgup, NULL, 1, USTR "pgdn"}, {USTR "pgupmenu", TYPEMENU, umpgup, NULL, 1, USTR "pgdnmenu"}, {USTR "picokill", TYPETW + TYPEPW + EFIXXCOL + EKILL + EMOD, upicokill, NULL, 1, NULL}, {USTR "play", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uplay, NULL, 1, NULL}, /* EFIXX? */ {USTR "prevpos", TYPETW + TYPEPW + EPOS + EMID + EFIXXCOL, uprevpos, NULL, 1, USTR "nextpos"}, {USTR "prevw", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uprevw, NULL, 1, USTR "nextw"}, {USTR "prevword", TYPETW + TYPEPW + EFIXXCOL + ECHKXCOL, u_goto_prev, NULL, 1, USTR "nextword"}, {USTR "prverr", TYPETW, uprverr, NULL, 1, USTR "nxterr"}, {USTR "psh", TYPETW + TYPEPW + TYPEMENU + TYPEQW, upsh, NULL, 0, NULL}, {USTR "pop", TYPETW + TYPEPW + TYPEMENU + TYPEQW, upop, NULL, 0, NULL}, {USTR "qrepl", TYPETW + TYPEPW + EMOD, pqrepl, NULL, 0, NULL}, {USTR "query", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uquery, NULL, 0, NULL}, {USTR "querysave", TYPETW, uquerysave, NULL, 0, NULL}, {USTR "quote", TYPETW + TYPEPW + EMOD, uquote, NULL, 0, NULL}, {USTR "quote8", TYPETW + TYPEPW + EMOD, uquote8, NULL, 0, NULL}, {USTR "record", TYPETW + TYPEPW + TYPEMENU + TYPEQW, urecord, NULL, 0, NULL}, {USTR "redo", TYPETW + TYPEPW + EFIXXCOL, uredo, NULL, 1, USTR "undo"}, {USTR "reload", TYPETW, ureload, NULL, 0, NULL }, {USTR "reloadall", TYPETW, ureload_all, NULL, 0, NULL }, {USTR "retype", TYPETW + TYPEPW + TYPEMENU + TYPEQW, uretyp, NULL, 0, NULL}, {USTR "rfirst", TYPETW + TYPEPW, prfirst, NULL, 0, NULL}, {USTR "rindent", TYPETW + TYPEPW + EFIXXCOL + EMOD + EBLOCK, urindent, NULL, 1, USTR "lindent"}, {USTR "run", TYPETW + TYPEPW, urun, NULL, 0, NULL}, {USTR "rsrch", TYPETW + TYPEPW, ursrch, NULL, 0, NULL}, {USTR "rtarw", TYPETW + TYPEPW /* + EFIXXCOL */, u_goto_right, NULL, 1, USTR "ltarw"}, /* EFIX removed for picture mode */ {USTR "rtarwmenu", TYPEMENU, umrtarw, NULL, 1, USTR "ltarwmenu"}, {USTR "rtn", TYPETW + TYPEPW + TYPEMENU + TYPEQW + EMOD, urtn, NULL, 1, NULL}, {USTR "save", TYPETW + TYPEPW, usave, NULL, 0, NULL}, {USTR "savenow", TYPETW + TYPEPW, usavenow, NULL, 0, NULL}, {USTR "scratch", TYPETW + TYPEPW, uscratch, NULL, 0, NULL}, {USTR "select", TYPETW + TYPEPW, uselect, NULL, 0, NULL}, {USTR "setmark", TYPETW + TYPEPW, usetmark, NULL, 0, NULL}, {USTR "shell", TYPETW + TYPEPW + TYPEMENU + TYPEQW, ushell, NULL, 0, NULL}, {USTR "showerr", TYPETW + TYPEPW, ucurrent_msg, NULL, 0, NULL}, {USTR "shrinkw", TYPETW, ushrnk, NULL, 1, USTR "groww"}, {USTR "splitw", TYPETW, usplitw, NULL, 0, NULL}, {USTR "stat", TYPETW + TYPEPW, ustat, NULL, 0, NULL}, {USTR "stop", TYPETW + TYPEPW + TYPEMENU + TYPEQW, ustop, NULL, 0, NULL}, {USTR "swap", TYPETW + TYPEPW + EFIXXCOL, uswap, NULL, 0, NULL}, {USTR "switch", TYPETW + TYPEPW, uswitch, NULL, 0, NULL}, {USTR "sys", TYPETW + TYPEPW, usys, NULL, 0, NULL }, {USTR "tabmenu", TYPEMENU, umtab, NULL, 1, USTR "ltarwmenu"}, {USTR "tag", TYPETW + TYPEPW, utag, NULL, 0, NULL}, {USTR "toggle_marking", TYPETW + TYPEPW, utoggle_marking, NULL, 0, NULL}, {USTR "then", TYPEPW+EMOD, urtn, 0, 0, 0 }, {USTR "tomarkb", TYPETW + TYPEPW + EFIXXCOL + EBLOCK, utomarkb, NULL, 0, NULL}, {USTR "tomarkbk", TYPETW + TYPEPW + EFIXXCOL + EBLOCK, utomarkbk, NULL, 0, NULL}, {USTR "tomarkk", TYPETW + TYPEPW + EFIXXCOL + EBLOCK, utomarkk, NULL, 0, NULL}, {USTR "tomatch", TYPETW + TYPEPW + EFIXXCOL, utomatch, NULL, 0, NULL}, {USTR "tomouse", TYPETW+TYPEPW+TYPEQW+TYPEMENU, utomouse, 0, 0, 0 }, {USTR "tos", TYPETW + TYPEPW + EMOVE, utos, NULL, 0, NULL}, {USTR "tw0", TYPETW + TYPEPW + TYPEQW + TYPEMENU, utw0, NULL, 0, NULL}, {USTR "tw1", TYPETW + TYPEPW + TYPEQW + TYPEMENU, utw1, NULL, 0, NULL}, {USTR "txt", TYPETW + TYPEPW, utxt, NULL, 0, NULL}, {USTR "type", TYPETW + TYPEPW + TYPEQW + TYPEMENU + EMINOR + EMOD, utype, NULL, 1, USTR "backs"}, {USTR "undo", TYPETW + TYPEPW + EFIXXCOL, uundo, NULL, 1, USTR "redo"}, {USTR "uparw", TYPETW + TYPEPW + EMOVE, uuparw, NULL, 1, USTR "dnarw"}, {USTR "uparwmenu", TYPEMENU, umuparw, NULL, 1, USTR "dnarwmenu"}, {USTR "upper", TYPETW + TYPEPW + EMOD + EBLOCK, uupper, NULL, 0, NULL}, {USTR "upslide", TYPETW + TYPEPW + TYPEMENU + TYPEQW + EMOVE, uupslide, NULL, 1, USTR "dnslide"}, {USTR "upslidemenu", TYPEMENU, umscrup, NULL, 1, USTR "dnslidemenu"}, {USTR "xtmouse", TYPETW+TYPEPW+TYPEMENU+TYPEQW, uxtmouse, 0, 0, 0 }, {USTR "yank", TYPETW + TYPEPW + EFIXXCOL + EMOD, uyank, NULL, 1, NULL}, {USTR "yapp", TYPETW + TYPEPW + EKILL, uyapp, NULL, 0, NULL}, {USTR "yankpop", TYPETW + TYPEPW + EFIXXCOL + EMOD, uyankpop, NULL, 1, NULL} }; /* Steal Lock dialog */ int nolocks; #define LOCKMSG2 _("Could not create lock. (I) edit anyway, (Q) cancel edit? ") #define LOCKMSG1 _("Locked by %s. (S)teal lock, (I) edit anyway, (Q) cancel edit? ") unsigned char *steallock_key= (unsigned char *) _("|steal the lock|sS"); unsigned char *canceledit_key= (unsigned char *) _("|cancel edit due to lock|qQ"); unsigned char *ignorelock_key= (unsigned char *) _("|ignore lock, continue with edit|iI"); int steal_lock(BW *bw,int c,B *b,int *notify) { if (yncheck(steallock_key, c)) { unsigned char bf1[256]; unsigned char bf[300]; unlock_it(b->name); if (lock_it(b->name,bf1)) { int x; for(x=0;bf1[x] && bf1[x]!=':';++x); bf1[x]=0; if(bf1[0]) joe_snprintf_1(bf,sizeof(bf),joe_gettext(LOCKMSG1),bf1); else joe_snprintf_0(bf,sizeof(bf),joe_gettext(LOCKMSG2)); if (mkqw(bw->parent, sz(bf), steal_lock, NULL, b, notify)) { return 0; } else { if (notify) *notify = -1; return -1; } } else { b->locked=1; if (notify) *notify = 1; return 0; } } else if (yncheck(ignorelock_key, c)) { b->locked=1; b->ignored_lock=1; if (notify) *notify = 1; return 0; } else if (yncheck(canceledit_key, c)) { if (notify) *notify = 1; return 0; } else { if (mkqw(bw->parent, sz(joe_gettext(LOCKMSG2)), steal_lock, NULL, b, notify)) { return 0; } else return -1; } } int file_changed(BW *bw,int c,B *b,int *notify) { if (mkqw(bw->parent, sz(joe_gettext(_("Notice: File on disk changed! (hit ^C to continue) "))), file_changed, NULL, b, notify)) { b->gave_notice = 1; return 0; } else return -1; } /* Try to lock: start dialog if we can't. Returns 0 if we couldn't lock */ int try_lock(BW *bw,B *b) { /* First time we modify the file */ /* If we're a plain file, acquire lock */ if (!nolocks && plain_file(b)) { unsigned char bf1[256]; unsigned char bf[300]; int x; /* It's a plain file- try to lock it */ if (lock_it(b->name,bf1)) { for(x=0;bf1[x] && bf1[x]!=':';++x); bf1[x]=0; if(bf1[0]) joe_snprintf_1(bf,sizeof(bf),joe_gettext(LOCKMSG1),bf1); else joe_snprintf_0(bf,sizeof(bf),joe_gettext(LOCKMSG2)); if (mkqw(bw->parent, sz(bf), steal_lock, NULL, b, NULL)) { uquery(bw); if (!b->locked) return 0; } else return 0; } else { /* Remember to unlock it */ b->locked = 1; } } return 1; } /* Called when we are about to modify a buffer */ /* Returns 0 if we're not allowed to modify buffer */ #define CHECK_INTERVAL 15 int nomodcheck; int modify_logic(BW *bw,B *b) { if (last_time > b->check_time + CHECK_INTERVAL) { b->check_time = last_time; if (!nomodcheck && !b->gave_notice && check_mod(b)) { file_changed(bw,0,b,NULL); return 0; } } if (b != bw->b) { if (!b->didfirst) { /* This happens when we try to block move from a window which is not on the screen */ if (bw->o.mfirst) { msgnw(bw->parent,joe_gettext(_("Modify other window first for macro"))); return 0; } b->didfirst = 1; if (bw->o.mfirst) exmacro(bw->o.mfirst,1); } if (b->rdonly) { msgnw(bw->parent,joe_gettext(_("Other buffer is read only"))); if (joe_beep) ttputc(7); return 0; } else if (!b->changed && !b->locked) { if (!try_lock(bw,b)) return 0; } } else { if (!b->didfirst) { b->didfirst = 1; if (bw->o.mfirst) exmacro(bw->o.mfirst,1); } if (b->rdonly) { msgnw(bw->parent,joe_gettext(_("Read only"))); if (joe_beep) ttputc(7); return 0; } else if (!b->changed && !b->locked) { if (!try_lock(bw,b)) return 0; } } return 1; } /* Execute a command n with key k */ int execmd(CMD *cmd, int k) { BW *bw = (BW *) maint->curwin->object; int ret = -1; /* Warning: bw is a BW * only if maint->curwin->watom->what & (TYPETW|TYPEPW) */ /* 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==9 || 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) && nowmarking) utoggle_marking(maint->curwin->object); /* We are about to modify the file */ if ((maint->curwin->watom->what & TYPETW) && (cmd->flag & EMOD)) { if (!modify_logic(bw,bw->b)) 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 */ /* This is bad: maint->curwin might not be the same window */ /* Safer would be to attach a pointer to curwin- if curwin gets clobbered, so does pointer. */ bw = (BW *) maint->curwin->object; /* 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: /* Make dislayed cursor column equal the actual cursor column * for commands which arn'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 (joe_beep && ret) ttputc(7); return ret; } void do_auto_scroll() { static CMD *scrup = 0; static CMD *scrdn = 0; static CMD *drag = 0; if (!scrup) { scrup = findcmd(USTR "upslide"); scrdn = findcmd(USTR "dnslide"); drag = findcmd(USTR "defmdrag"); } if (auto_scroll > 0) execmd(scrdn,0); else if (auto_scroll < 0) execmd(scrup,0); execmd(drag,0); reset_trig_time(); } /* 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(unsigned char *s) { if (!cmdhash) izcmds(); return (CMD *) htfind(cmdhash, s); } void addcmd(unsigned char *s, MACRO *m) { CMD *cmd = (CMD *) joe_malloc(sizeof(CMD)); if (!cmdhash) izcmds(); cmd->name = zdup(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(); return simple_cmplt(bw,scmds); } static int docmd(BW *bw, unsigned char *s, void *object, int *notify) { MACRO *mac; int ret = -1; mac = mparse(NULL, s, &ret); if (ret < 0) { msgnw(bw->parent,joe_gettext(_("No such command"))); } else { ret = exmacro(mac, 1); rmmacro(mac); } #ifdef junk CMD *cmd = findcmd(s); vsrm(s); /* allocated in pw.c::rtnpw() */ if (!cmd) msgnw(bw->parent,joe_gettext(_("No such command"))); else { mac = mkmacro(-1, 0, 0, cmd); ret = exmacro(mac, 1); rmmacro(mac); } #endif if (notify) *notify = 1; return ret; } B *cmdhist = NULL; int uexecmd(BW *bw) { if (wmkpw(bw->parent, joe_gettext(USTR _("Command: ")), &cmdhist, docmd, USTR "cmd", NULL, cmdcmplt, NULL, NULL, locale_map, 0)) { return 0; } else { return -1; } } joe-3.7/cmd.h0000644000100100007640000000340510431662534007774 00000000000000/* * Command execution * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_CMD_H #define _JOE_CMD_H 1 /* Command entry */ struct cmd { unsigned char *name; /* Command name */ int flag; /* Execution flags */ int (*func) (); /* Function bound to name */ MACRO *m; /* Macro bound to name */ int arg; /* 0= arg is meaningless, 1= ok */ unsigned char *negarg; /* Command to use if arg was negative */ }; extern CMD cmds[]; /* Built-in commands */ extern int joe_beep; /* Enable beep on command error */ /* 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 (call udropon) */ #define EMETA 0x10000 /* JM: Executes even when if flag is zero */ /* CMD *findcmd(char *s); * Return command address for given name */ CMD *findcmd PARAMS((unsigned char *s)); void addcmd PARAMS((unsigned char *s, MACRO *m)); /* Execute a command. Returns return value of command */ int execmd PARAMS((CMD *cmd, int k)); void do_auto_scroll(); extern B *cmdhist; /* Command history buffer */ int try_lock PARAMS((BW *bw,B *b)); int modify_logic PARAMS((BW *bw,B *b)); int uexecmd PARAMS((BW *bw)); extern int nolocks; /* Disable file locking */ extern int nomodcheck; /* Disable file modified check */ #endif joe-3.7/dir.c0000644000100100007640000000135110036520203007763 00000000000000/* * Directory package for older UNIXs * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ 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; } joe-3.7/aclocal.m40000644000100100007640000010102211102222332010672 00000000000000# generated automatically by aclocal 1.10 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 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. m4_if(m4_PACKAGE_VERSION, [2.63],, [m4_fatal([this file was generated for autoconf 2.63. You have another version of autoconf. If you want to use that, you should regenerate the build system entirely.], [63])]) # Copyright (C) 2002, 2003, 2005, 2006 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. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10])dnl _AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) # 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, 2006 # 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_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])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl 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, 2006 # 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 9 # 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], UPC, [depcc="$UPC" am_compiler_list=], [$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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /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, 2006 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.60])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 if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi 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 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])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 AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])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-"\$(SHELL) $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 file-system 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, 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 5 # 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 AC_REQUIRE_AUX_FILE([missing])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, 2006 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 for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # 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="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 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_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # 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]) joe-3.7/kbd.c0000644000100100007640000002007610457276140007771 00000000000000/* * Key-map handler * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" /* Create a KBD */ KBD *mkkbd(KMAP *kmap) { KBD *kbd = (KBD *) joe_malloc(sizeof(KBD)); kbd->topmap = kmap; kbd->curmap = kmap; kbd->x = 0; return kbd; } /* Eliminate a KBD */ void rmkbd(KBD *k) { joe_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 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 for key name or -1 for syntax error */ static int keyval(unsigned char *s) { if (s[0] == '^' && s[1] && !s[2]) switch (s[1]) { case '?': return 127; case '#': return 0x9B; default: return s[1] & 0x1F; } else if ((s[0] == 'S' || s[0] == 's') && (s[1] == 'P' || s[1] == 'p') && !s[2]) return ' '; else if((s[0]=='M'||s[0]=='m') && s[1]) { if(!zcmp(s,USTR "MDOWN")) return KEY_MDOWN; else if(!zcmp(s,USTR "MWDOWN")) return KEY_MWDOWN; else if(!zcmp(s,USTR "MWUP")) return KEY_MWUP; else if(!zcmp(s,USTR "MUP")) return KEY_MUP; else if(!zcmp(s,USTR "MDRAG")) return KEY_MDRAG; else if(!zcmp(s,USTR "M2DOWN")) return KEY_M2DOWN; else if(!zcmp(s,USTR "M2UP")) return KEY_M2UP; else if(!zcmp(s,USTR "M2DRAG")) return KEY_M2DRAG; else if(!zcmp(s,USTR "M3DOWN")) return KEY_M3DOWN; else if(!zcmp(s,USTR "M3UP")) return KEY_M3UP; else if(!zcmp(s,USTR "M3DRAG")) return KEY_M3DRAG; else return s[0]; } else if (s[1] || !s[0]) return -1; else return (unsigned char) s[0]; } /* Create an empty keymap */ KMAP *mkkmap(void) { KMAP *kmap = (KMAP *) joe_calloc(sizeof(KMAP), 1); return kmap; } /* Eliminate a keymap */ void rmkmap(KMAP *kmap) { int x; if (!kmap) return; for (x = 0; x != KEYS; ++x) if (kmap->keys[x].k == 1) rmkmap(kmap->keys[x].value.submap); joe_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; if (w < 0) return NULL; seq[x] = c; /* Restore the space or 0 */ for (seq += x; *seq == ' '; ++seq) ; /* Skip over spaces */ /* Check for 'TO ' */ if ((seq[0] == 'T' || seq[0] == 't') && (seq[1] == 'O' || seq[1] == '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 */ if (w < 0) return NULL; seq[x] = c; /* Restore the space or 0 */ 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, unsigned char *capseq, int seql) { int v, w; if (!seql && seq[0] == '.' && seq[1]) { int x, c; unsigned char *s; for (x = 0; seq[x] && seq[x] != ' '; ++x) ; c = seq[x]; seq[x] = 0; #ifdef __MSDOS__ if (!zcmp(seq + 1, "ku")) { capseq = "\0H"; seql = 2; } else if (!zcmp(seq + 1, USTR "kd")) { capseq = "\0P"; seql = 2; } else if (!zcmp(seq + 1, USTR "kl")) { capseq = "\0K"; seql = 2; } else if (!zcmp(seq + 1, USTR "kr")) { capseq = "\0M"; seql = 2; } else if (!zcmp(seq + 1, USTR "kI")) { capseq = "\0R"; seql = 2; } else if (!zcmp(seq + 1, USTR "kD")) { capseq = "\0S"; seql = 2; } else if (!zcmp(seq + 1, USTR "kh")) { capseq = "\0G"; seql = 2; } else if (!zcmp(seq + 1, USTR "kH")) { capseq = "\0O"; seql = 2; } else if (!zcmp(seq + 1, USTR "kP")) { capseq = "\0I"; seql = 2; } else if (!zcmp(seq + 1, USTR "kN")) { capseq = "\0Q"; seql = 2; } else if (!zcmp(seq + 1, USTR "k1")) { capseq = "\0;"; seql = 2; } else if (!zcmp(seq + 1, USTR "k2")) { capseq = "\0<"; seql = 2; } else if (!zcmp(seq + 1, USTR "k3")) { capseq = "\0="; seql = 2; } else if (!zcmp(seq + 1, USTR "k4")) { capseq = "\0>"; seql = 2; } else if (!zcmp(seq + 1, USTR "k5")) { capseq = "\0?"; seql = 2; } else if (!zcmp(seq + 1, USTR "k6")) { capseq = "\0@"; seql = 2; } else if (!zcmp(seq + 1, USTR "k7")) { capseq = "\0A"; seql = 2; } else if (!zcmp(seq + 1, USTR "k8")) { capseq = "\0B"; seql = 2; } else if (!zcmp(seq + 1, USTR "k9")) { capseq = "\0C"; seql = 2; } else if (!zcmp(seq + 1, USTR "k0")) { capseq = "\0D"; seql = 2; } seq[x] = c; if (seql) { for (seq += x; *seq == ' '; ++seq) ; } #else s = jgetstr(cap, seq + 1); seq[x] = c; if (s && (s = tcompile(cap, s, 0, 0, 0, 0)) && (sLEN(s) > 1 || (signed char)s[0] < 0)) { capseq = s; seql = sLEN(s); for (seq += x; *seq == ' '; ++seq) ; } #endif 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 != KEYS; ++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; } /* JM */ B *keymaphist=0; int dokeymap(BW *bw,unsigned char *s,void *object,int *notify) { KMAP *k=ngetcontext(s); vsrm(s); if(notify) *notify=1; if(!k) { msgnw(bw->parent,joe_gettext(_("No such keymap"))); return -1; } rmkbd(bw->parent->kbd); bw->parent->kbd=mkkbd(k); return 0; } static unsigned char **keymap_list; static int keymap_cmplt(BW *bw) { /* Reload every time: we should really check date of tags file... if (tag_word_list) varm(tag_word_list); */ if (!keymap_list) keymap_list = get_keymap_list(); if (!keymap_list) { ttputc(7); return 0; } return simple_cmplt(bw,keymap_list); } int ukeymap(BASE *bw) { if (wmkpw(bw->parent,joe_gettext(_("Change keymap: ")),&keymaphist,dokeymap,USTR "keymap",NULL,keymap_cmplt,NULL,NULL,locale_map,0)) return 0; else return -1; } joe-3.7/kbd.h0000644000100100007640000000504310431662534007771 00000000000000/* * Key-map handler * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_KBD_H #define _JOE_KBD_H 1 /* 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 to command/sub-map bindings */ struct kmap { KEY keys[KEYS]; /* 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 */ }; /* KMAP *mkkmap(void); * Create an empty keymap */ KMAP *mkkmap PARAMS((void)); /* void rmkmap(KMAP *kmap); * Free a key map */ void rmkmap PARAMS((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 speicified, then the key sequences * ^K A, ^K B, ^K C, ... ^K Z are all bound. */ int kadd PARAMS((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 PARAMS((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 PARAMS((KMAP *kmap, unsigned char *seq)); /* KBD *mkkbd(KMAP *kmap); Create a keyboard handler which uses the given keymap */ KBD *mkkbd PARAMS((KMAP *kmap)); /* void rmkbd(KBD *); * * Eliminate a keyboard handler */ void rmkbd PARAMS((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 PARAMS((KBD *kbd, int n)); /* JM - user command handler */ int ukeymap(); #endif joe-3.7/tab.c0000644000100100007640000002270410457276140007777 00000000000000/* * File selection menu * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" typedef struct tab TAB; int menu_explorer = 0; /* Stay in menu system when directory selected */ int menu_jump = 0; /* Jump into menu */ extern WATOM watommenu; 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; unsigned char *tmp; int users_flg = 0; tmp = vsncpy(NULL,0,sv(tab->path)); tmp = canonical(tmp); if (chpwd(tmp)) { vsrm(tmp); return -1; } vsrm(tmp); if (!tab->path[0] && tab->pattern[0]=='~') { files = rexpnd_users(tab->pattern); users_flg = 1; } else files = rexpnd(tab->pattern); if (!files) { chpwd(oldpwd); return -1; } if (!aLEN(files)) { chpwd(oldpwd); return -1; } tab->len = aLEN(files); varm(tab->files); tab->files = files; vasort(files, tab->len); if (tab->type) joe_free(tab->type); tab->type = (unsigned char *) joe_malloc(tab->len); for (a = 0; a != tab->len; a++) if(users_flg) { tab->type[a] = F_DIR; } else { struct stat buf; mset(&buf, 0, sizeof(struct stat)); stat((char *)(files[a]), &buf); if (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, USTR "insnam"); 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; if (tab->path && tab->path[0]) stat((char *)tab->path, &buf); else stat(".", &buf); tab->prv = 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; /* bash */ /* insnam(bw, tab->path, tab->pattern, 0, tab->ofst); */ return tab->list; } else { ldmenu(m, tab->list, which); /* bash */ /* 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) joe_free(tab->type); joe_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 (!zcmp(tab->files[cursor], USTR "..") && 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, 0, NULL)) { msgnw(m->parent, joe_gettext(_("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; 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; 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, 1, NULL)) { msgnw(m->parent, joe_gettext(_("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; } } /*****************************************************************************/ /* This should verify that bw still exists... */ static int tababrt(BW *bw, int cursor, TAB *tab) { /* bash */ /* insnam(bw, tab->orgpath, tab->orgnam, 0, tab->ofst); */ rmtab(tab); return -1; } P *p_goto_start_of_path(P *p) { int c; do c = prgetc(p); while (c!=NO_MORE_DATA && c!=' ' && c!='\n'); if (c!=NO_MORE_DATA) pgetc(p); return p; } /*****************************************************************************/ /****************** Create a tab window **************************************/ /*****************************************************************************/ int cmplt(BW *bw) { MENU *new; TAB *tab; P *p, *q; unsigned char *cline; int which; unsigned char **l; int ofst; tab = (TAB *) joe_malloc(sizeof(TAB)); tab->files = NULL; tab->type = NULL; tab->list = NULL; tab->prv = 0; tab->len = 0; q = pdup(bw->cursor, USTR "cmplt"); p_goto_eol(q); p = pdup(q, USTR "cmplt"); p_goto_start_of_path(p); ofst = p->byte; cline = brvs(p, (int) (q->byte - p->byte)); /* Don't do it so soon... */ /* cline = canonical(cline); */ 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); /* bash */ /* TRY */ if (menu_above) { if (bw->parent->link.prev->watom==&watommenu) { wabort(bw->parent->link.prev); /* smode=2; */ } } else { if (bw->parent->link.next->watom==&watommenu) { wabort(bw->parent->link.next); /* smode=2; */ } } if (l && (new = mkmenu((menu_above ? bw->parent->link.prev : bw->parent), bw->parent, l, tabrtn, tababrt, tabbacks, which, tab, NULL))) { if (sLEN(tab->files) == 1) /* Only one file found, so select it */ return tabrtn1(new, 0, tab); else if (smode || isreg(tab->orgnam)) { /* User tried to complete twice (see smode=2 below), so leave menu on */ /* bash */ if (!menu_jump) bw->parent->t->curwin=bw->parent; return 0; } else { /* Complete name as much as possible, turn menu off */ unsigned char *com = mcomplete(new); vsrm(tab->orgnam); tab->orgnam = com; /* wabort causes tab->orgnam to be copied to prompt */ insnam(bw, tab->orgpath, tab->orgnam, 0, tab->ofst); wabort(new->parent); smode = 2; /* if(joe_beep) */ ttputc(7); return 0; } } else { /* if(joe_beep) */ ttputc(7); rmtab(tab); return -1; } } joe-3.7/tab.h0000644000100100007640000000036710431662534010003 00000000000000/* * File selection menu * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_TAB_H #define _JOE_TAB_H 1 int cmplt PARAMS((BW *bw)); extern int menu_jump; extern int menu_explorer; #endif joe-3.7/tty.c0000644000100100007640000006043711103411524010040 00000000000000/* * UNIX Tty and Process interface * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" /* not needed: ioctl() moved to utils.c #ifdef GWINSZ_IN_SYS_IOCTL #ifdef HAVE_SYS_IOCTL_H #include #endif #endif */ #ifdef HAVE_SYS_WAIT_H #include #endif #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_OPENPTY #ifdef HAVE_PTY_H #include #endif #ifdef HAVE_LIBUTIL_H #include #endif #endif #ifdef HAVE_LOGIN_TTY #ifdef HAVE_UTMP_H #include #endif #endif int idleout = 1; #ifdef __amigaos #undef SIGTSTP #endif /* We use the defines in sys/ioctl to determine what type * tty interface the system uses and what type of system * we actually have. */ #ifdef HAVE_POSIX_TERMIOS # include #else # ifdef HAVE_SYSV_TERMIO # include # include # else # include # endif #endif #ifdef HAVE_SETITIMER #ifdef HAVE_SYS_TIME_H #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 /** 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; /* 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 acceptch = 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]; /* 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(SIGABRT, ttsig); joe_set_signal(SIGINT, SIG_IGN); joe_set_signal(SIGPIPE, SIG_IGN); } /* Restore signals for exiting */ void signrm(void) { if (!ttysig) return; ttysig = 0; joe_set_signal(SIGABRT, SIG_DFL); 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(); } static int winched = 0; #ifdef SIGWINCH /* Window size interrupt handler */ static RETSIGTYPE winchd(int unused) { ++winched; REINSTALL_SIGHANDLER(SIGWINCH, winchd); } #endif /* Second ticker */ int ticked = 0; static RETSIGTYPE dotick(int unused) { ticked = 1; } void tickoff(void) { #ifdef HAVE_SETITIMER struct itimerval val; val.it_value.tv_sec = 0; val.it_value.tv_usec = 0; val.it_interval.tv_sec = 0; val.it_interval.tv_usec = 0; setitimer(ITIMER_REAL,&val,NULL); #else alarm(0); #endif } void tickon(void) { #ifdef HAVE_SETITIMER struct itimerval val; val.it_interval.tv_sec = 0; val.it_interval.tv_usec = 0; if (auto_scroll) { int tim = auto_trig_time - mnow(); if (tim < 0) tim = 1; tim *= 1000; val.it_value.tv_sec = 0; val.it_value.tv_usec = tim; } else { val.it_value.tv_sec = 1; val.it_value.tv_usec = 0; } ticked = 0; joe_set_signal(SIGALRM, dotick); setitimer(ITIMER_REAL,&val,NULL); #else ticked = 0; joe_set_signal(SIGALRM, dotick); alarm(1); #endif } /* Open terminal */ void ttopnn(void) { int x, 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, (char *)joe_gettext(_("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 joe_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; joe_ioctl(fileno(termin), TCSETAW, &newterm); bbaud = (newterm.c_cflag & CBAUD); #else joe_ioctl(fileno(termin), TIOCGETP, &arg); joe_ioctl(fileno(termin), TIOCGETC, &targ); joe_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; joe_ioctl(fileno(termin), TIOCSETN, &arg); joe_ioctl(fileno(termin), TIOCSETC, &targ); joe_ioctl(fileno(termin), TIOCSLTC, <arg); bbaud = arg.sg_ospeed; #endif #endif baud = 9600; upc = 0; for (x = 0; x != 30; x += 2) if (bbaud == speeds[x]) { baud = speeds[x + 1]; break; } if (Baud) baud = Baud; upc = DIVIDEND / baud; if (obuf) joe_free(obuf); if (!(TIMES * upc)) obufsiz = 4096; else { obufsiz = 1000000 / (TIMES * upc); if (obufsiz > 4096) obufsiz = 4096; } if (!obufsiz) obufsiz = 1; obuf = (unsigned char *) joe_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 joe_ioctl(fileno(termin), TCSETAW, &oldterm); #else joe_ioctl(fileno(termin), TIOCSETN, &oarg); joe_ioctl(fileno(termin), TIOCSETC, &otarg); joe_ioctl(fileno(termin), TIOCSLTC, &oltarg); #endif #endif leave = oleave; } /* Timer interrupt handler */ static int 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; } /* Ack previous packet */ if (ackkbd != -1 && acceptch != 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); acceptch = NO_MORE_DATA; } /* Check for typeahead or next packet */ if (!have && !leave) { if (ackkbd != -1) { fcntl(mpxfd, F_SETFL, O_NDELAY); if (read(mpxfd, &pack, sizeof(struct packet) - 1024) > 0) { fcntl(mpxfd, F_SETFL, 0); joe_read(mpxfd, pack.data, pack.size); have = 1; acceptch = pack.ch; } else fcntl(mpxfd, F_SETFL, 0); } else { /* 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 */ void mpxdied(MPX *m); long last_time; int ttgetc(void) { int stat; long new_time; int flg; tickon(); loop: flg = 0; /* Status line clock */ new_time = time(NULL); if (new_time != last_time) { last_time = new_time; dostaupd = 1; ticked = 1; } /* Autoscroller */ if (auto_scroll && mnow() >= auto_trig_time) { do_auto_scroll(); ticked = 1; flg = 1; } ttflsh(); while (winched) { winched = 0; edupd(1); ttflsh(); } if (ticked) { edupd(flg); ttflsh(); tickon(); } if (ackkbd != -1) { if (!have) { /* Wait for input */ stat = read(mpxfd, &pack, sizeof(struct packet) - 1024); if (pack.size && stat > 0) { joe_read(mpxfd, pack.data, pack.size); } else if (stat < 1) { if (winched || ticked) goto loop; else ttsig(0); } acceptch = pack.ch; } have = 0; if (pack.who) { /* Got bknd input */ if (acceptch != 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 (acceptch != NO_MORE_DATA) { tickoff(); return acceptch; } else { tickoff(); ttsig(0); return 0; } } } if (have) { have = 0; } else { if (read(fileno(termin), &havec, 1) < 1) { if (winched || ticked) goto loop; else 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 (joe_ioctl(fileno(termout), TIOCGSIZE, &getit) != -1) { *x = getit.ts_cols; *y = getit.ts_lines; } #else #ifdef TIOCGWINSZ if (joe_ioctl(fileno(termout), TIOCGWINSZ, &getit) != -1) { *x = getit.ws_col; *y = getit.ws_row; } #endif #endif } int ttshell(unsigned char *cmd) { int x, omode = ttymode; int stat= -1; unsigned char *s = (unsigned char *)getenv("SHELL"); if (!s) { s = USTR "/bin/sh"; /* return; */ } ttclsn(); #ifdef HAVE_FORK if ((x = fork()) != 0) { #else if ((x = vfork()) != 0) { /* For AMIGA only */ #endif if (x != -1) wait(&stat); if (omode) ttopnn(); return stat; } else { signrm(); if (cmd) execl((char *)s, (char *)s, "-c", cmd, NULL); else { fprintf(stderr, (char *)joe_gettext(_("You are at the command shell. Type 'exit' to return\n"))); execl((char *)s, (char *)s, NULL); } _exit(0); return 0; } } /* Create keyboard task */ static void mpxresume(void) { int fds[2]; pipe(fds); acceptch = 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]; } /* Kill keyboard task */ static void mpxsusp(void) { if (ackkbd!=-1) { kill(kbdpid, 9); while (wait(NULL) < 0 && errno == EINTR) /* do nothing */; close(ackkbd); } } /* 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; mpxsusp(); ttclsn(); fprintf(stderr, (char *)joe_gettext(_("You have suspended the program. Type 'fg' to return\n"))); kill(0, SIGTSTP); #ifdef junk /* Hmmm... this should not have been necessary */ if (ackkbd != -1) kill(kbdpid, SIGCONT); #endif if (omode) ttopnn(); if (ackkbd!= -1) mpxresume(); #else ttshell(NULL); #endif } /* 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. */ static void mpxstart(void) { int fds[2]; pipe(fds); mpxfd = fds[0]; mpxsfd = fds[1]; 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(); static unsigned char *getpty(int *ptyfd) { return (unsigned char *)_getpty(ptyfd, O_RDWR, 0600, 0); } #else #ifdef USEPTMX /* Strange streams way */ extern char *ptsname(); 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 */ static unsigned char *getpty(int *ptyfd) { static unsigned char name[32]; int ttyfd; if (openpty(ptyfd, &ttyfd, (char *)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 unsigned char *ttydir; static unsigned char *ptydir; static unsigned char ttyname[32]; if (!ptys) { ttydir = USTR "/dev/pty/"; ptydir = USTR "/dev/ptym/"; /* HPUX systems */ if (chpwd(ptydir) || !(ptys = rexpnd(USTR "pty*"))) if (!ptys) { ttydir = ptydir = USTR "/dev/"; /* Everyone else */ if (!chpwd(ptydir)) ptys = rexpnd(USTR "pty*"); } } chpwd(orgpwd); if (ptys) for (fd = 0; ptys[fd]; ++fd) { zcpy(ttyname, ptydir); zcat(ttyname, ptys[fd]); if ((*ptyfd = open((char *)ttyname, O_RDWR)) >= 0) { ptys[fd][0] = 't'; zcpy(ttyname, ttydir); zcat(ttyname, ptys[fd]); ptys[fd][0] = 'p'; x = open((char *)ttyname, O_RDWR); if (x >= 0) { close(x); close(*ptyfd); zcpy(ttyname, ptydir); zcat(ttyname, ptys[fd]); *ptyfd = open((char *)ttyname, O_RDWR); ptys[fd][0] = 't'; zcpy(ttyname, ttydir); zcat(ttyname, ptys[fd]); 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. */ int 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 */ static unsigned char **newenv(unsigned char **old, unsigned char *s) { unsigned char **new; int x, y, z; for (x = 0; old[x]; ++x) ; new = (unsigned char **) joe_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++] = s; } else new[y++] = old[x]; } if (x == y) new[y++] = s; new[y] = 0; return new; } /* Create a shell process */ /* If out_only is set, leave program's stdin attached to JOE's stdin */ MPX *mpxmk(int *ptyfd, unsigned char *cmd, unsigned char **args, void (*func) (/* ??? */), void *object, void (*die) (/* ??? */), void *dieobj, int out_only) { unsigned char buf[80]; int fds[2]; int comm[2]; pid_t pid; int x; MPX *m = 0; 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; /* Fixes cygwin console bug: if you fork() with inverse video he 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) mpxstart(); /* Remember callback function */ m->func = func; m->object = object; m->die = die; m->dieobj = dieobj; /* Acknowledgement pipe */ pipe(fds); m->ackfd = fds[1]; /* PID number pipe */ pipe(comm); /* 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 */ signrm(); /* Close pty (we only need tty) */ close(*ptyfd); /* All of this stuff is for disassociating ourself from 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); joe_ioctl(x, TIOCNOTTY, 0); #endif setsid(); /* I think you do setprgp(0,0) on systems with no setsid() */ #ifndef SETPGRP_VOID setpgrp(0, 0); #else setpgrp(); #endif #endif /* Close all fds */ for (x = (out_only ? 1 : 0); x != 32; ++x) close(x); /* Yes, this is quite a kludge... all in the name of portability */ /* Open the TTY */ if ((x = open((char *)name, O_RDWR)) != -1) { /* Standard input */ unsigned char **env = newenv(mainenv, USTR "TERM="); if (!out_only) { #ifdef HAVE_LOGIN_TTY login_tty(x); #else /* This tells the fd that it's a tty (I think) */ #ifdef __svr4__ joe_ioctl(x, I_PUSH, "ptem"); joe_ioctl(x, I_PUSH, "ldterm"); #endif /* Open stdout, stderr */ dup(x); dup(x); /* Standard output, standard error */ /* (yes, stdin, stdout, and stderr must all be open for reading and * writing. On some systems the shell assumes this */ #endif #ifdef HAVE_POSIX_TERMIOS tcsetattr(0, TCSADRAIN, &oldterm); #else #ifdef HAVE_SYSV_TERMIO joe_ioctl(0, TCSETAW, &oldterm); #else joe_ioctl(0, TIOCSETN, &oarg); joe_ioctl(0, TIOCSETC, &otarg); joe_ioctl(0, TIOCSLTC, &oltarg); #endif #endif /* We could probably have a special TTY set-up for JOE, but for now * we'll just use the TTY setup for the TTY was was run on */ /* Execute the shell */ execve((char *)cmd, (char **)args, (char **)env); /* If shell didn't execute */ joe_snprintf_1(buf,sizeof(buf),joe_gettext(_("Couldn't execute shell '%s'\n")),cmd); write(1,(char *)buf,zlen(buf)); sleep(1); } else { unsigned char buf[1024]; int len; dup(x); /* Standard error */ for (;;) { len = read(0, buf, sizeof(buf)); if (len > 0) write(1, buf, len); else break; } } } _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; } 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); } joe-3.7/tty.h0000644000100100007640000001655010431662534010056 00000000000000/* * TTY interface header file * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_TTY_H #define _JOE_TTY_H 1 struct mpx { int ackfd; /* Packetizer response descriptor */ int kpid; /* Packetizer process id */ int pid; /* Client process id */ void (*func) (); /* Function to call when read occures */ void *object; /* First arg to pass to function */ void (*die) (); /* Function: call when client dies or closes */ void *dieobj; }; /* 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 PARAMS((void)); void ttopnn PARAMS((void)); extern unsigned long upc; /* Microseconds per character */ extern unsigned baud; /* Baud rate */ #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 PARAMS((void)); void ttclsn PARAMS((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 PARAMS((void)); /* void ttputc(char c); Write a character to the output buffer. If it becomes * full, call ttflsh() */ extern int obufp; /* Output buffer index */ extern int obufsiz; /* Output buffer size */ extern unsigned char *obuf; /* Output buffer */ #define ttputc(c) { obuf[obufp++] = (c); if(obufp == obufsiz) ttflsh(); } /* void ttputs(char *s); Write a string to the output buffer. Any time the * output buffer gets full, call ttflsh() */ void ttputs PARAMS((unsigned char *s)); /* int ttshell(char *s); Run a shell command or if 's' is zero, run a * sub-shell */ int ttshell PARAMS((unsigned char *cmd)); /* void ttsusp(void); Suspend the process, or if the UNIX can't do it, call * ttshell(NULL) */ void ttsusp PARAMS((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 PARAMS((void)); extern int have; /* Set if we have typeahead */ extern int leave; /* Set if we're exiting (so don't check for typeahead) */ #ifdef __MSDOS__ #define ifhave bioskey(1) #else #define ifhave have #endif /* 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. */ void ttsig PARAMS((int sig)); /* void ttgtsz(int *x,int *y); Get size of screen from ttsize/winsize * structure */ void ttgtsz PARAMS((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 PARAMS((void)); /* void signrm(void); Set above signals back to their default values. */ void signrm PARAMS((void)); /* 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 PARAMS((int *ptyfd, unsigned char *cmd, unsigned char **args, void (*func) (/* ??? */), void *object, void (*die) (/* ??? */), void *dieobj, int out_only)); /* int subshell(int *ptyfd); * Execute a subshell. Returns 'pid' of shell or zero if there was a * problem. Returns file descriptor for the connected pty in 'ptyfd'. */ int subshell PARAMS(()); extern int noxon; /* Set if ^S/^Q processing should be disabled */ extern int Baud; /* Baud rate from joerc, cmd line or environment */ void tickoff PARAMS((void)); void tickon PARAMS((void)); extern long last_time; /* Current time in seconds */ extern int idleout; /* Clear to use /dev/tty for screen */ #endif joe-3.7/queue.c0000644000100100007640000000151210431662534010345 00000000000000/* * Doubly linked list primitives * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" void *QUEUE; void *ITEM; void *LAST; void *alitem(void *list, int itemsize) { STDITEM *freelist = (STDITEM *)list; if (qempty(STDITEM, link, freelist)) { STDITEM *i = (STDITEM *) joe_malloc(itemsize * 16); STDITEM *z = (STDITEM *) ((unsigned char *) i + itemsize * 16); while (i != z) { enquef(STDITEM, link, freelist, i); i = (STDITEM *) ((unsigned char *) 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); } } joe-3.7/queue.h0000644000100100007640000001047110433613730010352 00000000000000/* * Doubly linked list primitives * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_QUEUE #define _JOE_QUEUE 1 extern void *ITEM; extern void *QUEUE; extern void *LAST; struct stditem { LINK(STDITEM) link; }; /* Initialize a doubly-linked list */ #define izque(type,member,item) do { \ QUEUE = (void *)(item); \ ((type *)QUEUE)->member.prev = (type *)QUEUE; \ ((type *)QUEUE)->member.next = (type *)QUEUE; \ } while(0) /* Remove an item from a list */ #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) /* Remove an item from a list and return it */ #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 \ ) /* Return true if doubly-linked list is empty */ #define qempty(type,member,item) \ ( \ QUEUE=(void *)(item), \ (type *)QUEUE==((type *)QUEUE)->member.next \ ) /* Insert an item at front of list */ #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) /* Insert an item at back of list */ #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) /* Insert an item at front of list and return it */ #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 \ ) /* Promote an item to front of list */ #define promote(type,member,queue,item) \ enquef(type,member,(queue),deque_f(type,member,(item))) /* Demote an item to back of list */ #define demote(type,member,queue,item) \ enqueb(type,member,(queue),deque_f(type,member,(item))) /* Splice a chain into from of a list */ #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) /* Splice a chain into back of a list */ #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 \ ) /* Remove a range of items from a list and return it as a chain for later splicing */ #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 \ ) /* Allocate an item */ void *alitem PARAMS((void *list, int itemsize)); /* Free an item */ void frchn PARAMS((void *list, void *ch)); #endif joe-3.7/lattr.c0000644000100100007640000002316611101745465010360 00000000000000/* * Line attribute cache * Copyright * (C) 2006 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) * * This is a gap buffer which stores the syntax highlighter parser state for * the beginning of each line. The computation is lazy, so not all lines in * the file will have their state computed (for example, if you never visit * the end of the file). * * When a change occurs (an insert or a delete), two things happen: * First, if whole lines are inserted or deleted, the corresponding states * are inserted or deleted as well, so that the cached states still match * up with their lines following the insert or delete. * * Second, a window of states which must be recomputed is generated. This * covers all the space for the change with the lowest line number to the * change with the highest line number. * * Now, when the screen update algorithm requests the state for a line in or * after this region, the states within the region are recomputed. The * cached states after the region may be valid: if a state is computed which * matches whatever is in the cache, then all of the remaining states are * trusted. The idea is that we should not always have to recompute the * syntax states for the entire file for small changes. * * Anyway, prior to this cache, JOE would use lots of CPU time whenever you * hit PgUp, because it would have to recompute all of the states from the * first line of the file to the top of the screen. Now this information is * saved, which uses more space, but allows JOE to use much less CPU time. */ #include "types.h" /* Create a line attribute database */ struct lattr_db *mk_lattr_db(B *new_b, struct high_syntax *new_syn) { struct lattr_db *db = (struct lattr_db *)joe_malloc(sizeof(struct lattr_db)); db->next = 0; db->syn = new_syn; db->b = new_b; db->end = 512; db->hole = 1; db->ehole = db->end; db->buffer = (HIGHLIGHT_STATE *)malloc(db->end * sizeof(HIGHLIGHT_STATE)); db->first_invalid = 1; db->invalid_window = -1; /* State of first line is idle */ clear_state(db->buffer+0); return db; } /* Delete a database */ void rm_lattr_db(struct lattr_db *db) { free(db->buffer); free(db); } /* Delete linked list of databases */ void rm_all_lattr_db(struct lattr_db *db) { struct lattr_db *n; while (db) { n = db->next; db->next = 0; rm_lattr_db(db); db = n; } } /* Reset linked list of databases (because of file reload) */ void reset_all_lattr_db(struct lattr_db *db) { struct lattr_db *n; for (n = db; n; n=n->next) { n->hole = 1; n->ehole = n->end; n->first_invalid = 1; n->invalid_window = -1; clear_state(n->buffer+0); } } /* Set gap position */ void lattr_hole(struct lattr_db *db, long pos) { if (pos > db->hole) mmove(db->buffer + db->hole, db->buffer + db->ehole, (pos - db->hole) * sizeof(HIGHLIGHT_STATE)); else if (pos < db->hole) mmove(db->buffer + db->ehole - (db->hole - pos), db->buffer + pos, (db->hole - pos) * sizeof(HIGHLIGHT_STATE)); db->ehole = pos + db->ehole - db->hole; db->hole = pos; } /* Make sure there is enough space for an insert */ void lattr_check(struct lattr_db *db, long amnt) { if (amnt > db->ehole - db->hole) { /* Not enough space */ /* Amount of additional space needed */ amnt = amnt - (db->ehole - db->hole) + 16; db->buffer = (HIGHLIGHT_STATE *)realloc(db->buffer, (db->end + amnt) * sizeof(HIGHLIGHT_STATE)); mmove(db->buffer + db->ehole + amnt, db->buffer + db->ehole, (db->end - db->ehole) * sizeof(HIGHLIGHT_STATE)); db->ehole += amnt; db->end += amnt; } } /* Find a database for a particular syntax in a buffer. If none exists, create one. */ struct lattr_db *find_lattr_db(B *b, struct high_syntax *y) { struct lattr_db *db; for (db = b->db; db && db->syn != y; db = db->next); if (!db) { db = mk_lattr_db(b, y); db->next = b->db; b->db = db; } return db; } /* Drop a database, but only if no BWs refer to it */ void drop_lattr_db(B *b, struct lattr_db *db) { #if junk if (!lattr_db_in_use(db)) { if (b->db == db) { b->db = db->next; } else { struct lattr_db *x; for (x = b->db; x->next != db; x = x->next); x->next = db->next; } rm_lattr_db(db); } #endif } /* An insert occurred */ void lattr_ins(struct lattr_db *db,long line,long size) { ++line; /* First invalid line is the one following the insert */ /* Are we before the end? */ if (line < lattr_size(db)) { /* Insert */ if (size) { lattr_hole(db, line); lattr_check(db, size); db->ehole -= size; } if (db->invalid_window == -1) { /* Create invalid window */ db->first_invalid = line; db->invalid_window = size; } else if (line >= db->first_invalid + db->invalid_window) { /* Insert after end of existing window */ db->invalid_window = line + size - db->first_invalid; } else if (line >= db->first_invalid) { /* Insert into existing window */ db->invalid_window += size; } else { /* Insert before existing window */ db->invalid_window += db->first_invalid - line + size; db->first_invalid = line; } } } /* A deletion occurred */ void lattr_del(struct lattr_db *db, long line, long size) { ++line; /* First invalid line is the one following the delete */ /* Are we before the end? */ if (line < lattr_size(db)) { /* Delete */ if (size) { lattr_hole(db, line); if (size > db->end - db->ehole) size = db->end - db->ehole; db->ehole += size; } if (db->invalid_window == -1) { /* Create invalid window */ db->first_invalid = line; db->invalid_window = 0; } else if (line < db->first_invalid) { /* Delete point is before existing window */ if (line + size <= db->first_invalid) { /* End point is before start of window */ db->invalid_window = db->first_invalid + db->invalid_window - line - size; db->first_invalid = line; } else if (line + size <= db->first_invalid + db->invalid_window) { /* End point is in window */ db->invalid_window -= line + size - db->first_invalid; db->first_invalid = line; } else { /* End point is beyond window */ db->invalid_window = 0; db->first_invalid = line; } } else if (line < db->first_invalid + db->invalid_window) { /* Delete point is in window */ if (line + size < db->first_invalid + db->invalid_window) { /* Deletion is entirely in window */ db->invalid_window -= size; } else { /* End of window got deleted */ db->invalid_window = line - db->first_invalid; } } else { /* Delete point is after window */ db->invalid_window = line - db->first_invalid; } } } HIGHLIGHT_STATE *lattr_gt(struct lattr_db *db, long line) { HIGHLIGHT_STATE *st; if (line >= db->hole) st = db->buffer + line - db->hole + db->ehole; else st = db->buffer + line; return st; } void lattr_st(struct lattr_db *db, long line, HIGHLIGHT_STATE *state) { HIGHLIGHT_STATE *st = lattr_gt(db, line); *st = *state; } /* Get attribute for a specific line */ HIGHLIGHT_STATE lattr_get(struct lattr_db *db, struct high_syntax *y, P *p, long line) { /* Past end of file? */ if (line > p->b->eof->line) { HIGHLIGHT_STATE x; clear_state(&x); return x; } /* Check if we need to expand */ if (line >= lattr_size(db)) { /* Expand by this amount */ long amnt = line - lattr_size(db) + 1; /* Set position to end */ lattr_hole(db, lattr_size(db)); lattr_check(db, amnt); db->ehole -= amnt; /* Set invalid window to cover new space */ if (db->invalid_window == -1) { db->first_invalid = lattr_size(db) - amnt; db->invalid_window = amnt; } else { db->invalid_window = lattr_size(db) - db->first_invalid; } } /* Check if we need to shrink */ /* if (p->b->eof->line + 1 < lattr_size(db)) { lattr_hole(db, p->b->eof->line + 1); db->ehole = db->end; if (db->first_invalid > lattr_size(db)) { db->first_invalid = lattr_size(db); db->invalid_window = -1; } if (db->invalid_window != -1 && db->first_invalid + db->invalid_window > lattr_size(db)) { db->invalid_window = lattr_size(db) - db->first_invalid; } } */ /* Check if we are pointing to a valid record */ if (line >= db->first_invalid) { long ln; P *tmp = 0; HIGHLIGHT_STATE state; tmp = pdup(p, USTR "lattr_get"); ln = db->first_invalid; /* First line with known good state */ state = lattr_lvalue(db, ln - 1); /* Known good state */ /* Compute up to requested line */ pline(tmp, ln - 1); /* Recompute everything in invalid window */ while (ln < db->first_invalid + db->invalid_window) { state = parse(y, tmp, state); lattr_st(db, ln, &state); ++ln; } /* Update invalid window: hopefully we did the whole window */ db->invalid_window -= ln - db->first_invalid; db->first_invalid = ln; /* Recompute until match found. If match is found, we can assume rest is valid */ while (ln < lattr_size(db)) { HIGHLIGHT_STATE *prev; state = parse(y, tmp, state); prev = lattr_gt(db, ln); if (!eq_state(prev, &state)) lattr_st(db, ln, &state); else { db->first_invalid = lattr_size(db); db->invalid_window = -1; ++ln; break; } ++ln; } /* Update invalid pointer */ if (ln > db->first_invalid) { db->first_invalid = ln; db->invalid_window = 0; } if (ln == lattr_size(db)) { db->first_invalid = ln; db->invalid_window = -1; } prm(tmp); } /* Check it */ #ifdef junk { HIGHLIGHT_STATE st; P *tmp =pdup(p, USTR "lattr_get"); pline(tmp, 0); clear_state(&st); for (z = 0; z != db->first_invalid; ++z) { HIGHLIGHT_STATE *prev; prev = lattr_gt(db, z); if (prev->state != st.state) { printf("** Mismatch!! %d %d %d %d **\n",z,tmp->line,prev->state,st.state); abort(); } st = parse(y, tmp, st); } prm(tmp); } #endif /* Return with attribute */ return lattr_lvalue(db, line); } joe-3.7/lattr.h0000644000100100007640000000571111101745465010361 00000000000000/* * Line attribute cache * Copyright * (C) 2006 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ struct lattr_db { struct lattr_db *next; /* Linked list of attribute databases owned by a B */ struct high_syntax *syn; /* This database is for this syntax */ B *b; /* This database is for this buffer */ /* Use a gap buffer for the attribute records */ HIGHLIGHT_STATE *buffer; /* Address of buffer */ long hole; /* Offset to hole */ long ehole; /* Offset to end of hole */ long end; /* Malloc() size of buffer */ long first_invalid; /* Lines beginning with this are invalid */ long invalid_window; /* Lines beyond first_invalid+invalid_window might be valid */ /* -1 means all lines are valid */ }; struct lattr_db *mk_lattr_db PARAMS((B *new_b, struct high_syntax *new_syn)); /* Create database structure */ void rm_lattr_db PARAMS((struct lattr_db *db)); /* Delete database structure */ void rm_all_lattr_db PARAMS((struct lattr_db *db)); /* Delete linked-list of databases */ void reset_all_lattr_db PARAMS((struct lattr_db *db)); /* Delete linked-list of databases */ struct lattr_db *find_lattr_db PARAMS((B *b, struct high_syntax *y)); /* Find database for a particular syntax. If one doesn't exist, create it and add it to the list for the B */ void drop_lattr_db PARAMS((B *b, struct lattr_db *db)); /* Drop a database if it's no longer needed. This checks through all BWs on a B to see if any of them refer to db. If none, the db is dropped. */ #define lattr_size(db) ((db)->end - ((db)->ehole - (db)->hole)) void lattr_hole PARAMS((struct lattr_db *db, long pos)); /* Set hole position */ void lattr_check PARAMS((struct lattr_db *db, long size)); /* Make sure we have enough space for insert. If not, expand buffer. */ void lattr_ins PARAMS((struct lattr_db *db,long line,long size)); /* An insert occured, beginning on specified line. 'size' lines were inserted. Adjust invalid window to cover inserted area. */ void lattr_del PARAMS((struct lattr_db *db,long line,long size)); /* A deletion occured, beginning on specified line. 'size' lines were deleted. Adjust invalid window to cover deleted area. */ HIGHLIGHT_STATE lattr_get PARAMS((struct lattr_db *db,struct high_syntax *y,P *p,long line)); /* Get state for specified line. If we don't have it, compute it. Records results of any computation so that we don't have to do it again. If first_invalid is < number of lines we have, compute forward until we start matching again as this is a very common case. */ #define lattr_lvalue(db, line) ((line) >= (db)->hole ? (db)->buffer[(line) - (db)->hole + (db)->ehole] : (db)->buffer[line]) joe-3.7/README0000644000100100007640000001615211101213023007717 00000000000000 Joe's Own Editor 3.6 A Free ASCII-Text Screen Editor for UNIX by Joseph Allen (<= 2.8) Marek 'Marx' Grac (=> 2.9) by Joseph Allen again (=>3.0) Get it from: 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 four "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 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. 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: 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 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]]);} joe-3.7/selinux.c0000644000100100007640000000732610434235355010721 00000000000000/* * Example code to show how to copy the security context from one file to * another. */ #include "types.h" #ifdef WITH_SELINUX #include static int selinux_enabled = -1; #endif int copy_security_context(const char *from_file, const char *to_file) { int status = 0; #ifdef WITH_SELINUX security_context_t from_context; security_context_t 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; error(0, errno, (char *)joe_gettext(_("Could not get security context for %s")), from_file); return 1; } if (getfilecon(to_file, &to_context) < 0) { MSG_PUTS(_(joe_gettext(_("\nCould not get security context for ")))); msg_outtrans(to_file); msg_putchar('\n'); freecon(from_context); return 1; } if (zcmp(from_context, to_context) != 0) { if (setfilecon(to_file, from_context) < 0) { error(0, errno, (char *)joe_gettext(_("Could not set security context for %s")), to_file); status = 1; } } freecon(to_context); freecon(from_context); #endif return status; } int match_default_security_context(const char *from_file) { #ifdef WITH_SELINUX security_context_t scontext; if (selinux_enabled == -1) selinux_enabled = (is_selinux_enabled() > 0); if (!selinux_enabled) return 0; if (getfilecon(from_file, &scontext) < 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; error(0, errno, (char *)joe_gettext(_("Could not get security context for %s")), from_file); return 1; } if (setfscreatecon(scontext) < 0) { error(0, errno, (char *)joe_gettext(_("Could not set default security context for %s")), from_file); freecon(scontext); return 1; } freecon(scontext); #endif return 0; } int reset_default_security_context() { #ifdef WITH_SELINUX if (selinux_enabled == -1) selinux_enabled = (is_selinux_enabled() > 0); if (!selinux_enabled) return 0; if (setfscreatecon(0) < 0) { error(0, errno, (char *)joe_gettext(_("Could not reset default security context"))); return 1; } #endif return 0; } int output_security_context(char *from_file) { #ifdef WITH_SELINUX security_context_t scontext; if (selinux_enabled == -1) selinux_enabled = (is_selinux_enabled() > 0); if (!selinux_enabled) return 0; if (getfilecon(from_file, &scontext) < 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; error(0, errno,(char *)joe_gettext(_("Could not get security context for %s")), from_file); return 1; } error(0, 0, (char *)joe_gettext(_("%s Security Context %s")), from_file, scontext); freecon(scontext); #endif return 0; } #if 0 /* Test program compile using the following command cc -o t t.c -DWITH_SELINUX -DTEST -lselinux */ #include #include main(int argc, char **argv) { printf("%d: %s\n", argc, argv[1]); if (argc == 3) { copy_security_context(argv[1], argv[2]); output_security_context(argv[2]); } if (argc == 2) { FILE *fd; char *temp; match_default_security_context(argv[1]); mkstemp(temp); printf("temp=%s", temp); fd = fopen(temp, "w"); fclose(fd); output_security_context(temp); reset_default_security_context(); } } #endif joe-3.7/configure0000755000100100007640000127674111102222352010771 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63 for joe 3.7. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 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=: # Pre-4.2 versions of Zsh do 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 as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } 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.) 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 $as_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. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # 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 || $as_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=: # Pre-4.2 versions of Zsh do 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=: # Pre-4.2 versions of Zsh do 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 bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } 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" || { $as_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 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then 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 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.7' PACKAGE_STRING='joe 3.7' 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='LTLIBOBJS SPELL LIBOBJS LN_S EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_dependency_tracking enable_curses enable_termcap enable_largefile ' 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 ac_unrecognized_opts= ac_unrecognized_sep= # 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_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=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_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) { $as_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 && { $as_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. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_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'` { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. 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 # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { $as_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 $as_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 .` || { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_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 -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | 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 .." { $as_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" || { $as_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.7 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.7:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --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-largefile omit support for large files 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" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_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 $as_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.7 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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.7, which was generated by GNU Autoconf 2.63. 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=. $as_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=`$as_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_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $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=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_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=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_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 && $as_echo "$as_me: caught signal $ac_signal" $as_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 an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 $as_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 { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 $as_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,) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 $as_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 # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_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 { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_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 ac_aux_dir= for ac_dir in "$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 { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 $as_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 || { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 $as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then $as_echo_n "(cached) " >&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 && { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 $as_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` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 $as_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 { $as_echo "$as_me:$LINENO: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then $as_echo_n "(cached) " >&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` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 $as_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 { $as_echo "$as_me:$LINENO: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if test "${ac_cv_target+set}" = set; then $as_echo_n "(cached) " >&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` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 $as_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.10' # 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. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&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 rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&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". { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 $as_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 { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 $as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "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 $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # 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= { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P 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. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac 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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then $as_echo_n "(cached) " >&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" $as_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 { $as_echo "$as_me:$LINENO: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_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 $as_echo_n "(cached) " >&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 { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "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 if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi 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.7' 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-"\$(SHELL) $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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&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" $as_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 { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&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" $as_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 { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(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 -' { $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&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 { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&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" $as_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 { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&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" $as_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 { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&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" $as_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 { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&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" $as_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 { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&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" $as_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 { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "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 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&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" $as_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 { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_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. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_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.out.dSYM 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. { $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_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 | *.dSYM | *.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 { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 $as_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. { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM 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. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_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 | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$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. { $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&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 { $as_echo "$as_me:$LINENO: result: $_am_result" >&5 $as_echo "$_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= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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 { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$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 { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&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 $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_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 { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_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 if test -z "$ac_cv_path_GREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_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 if test -z "$ac_cv_path_EGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$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. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&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 rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi case "$host" in *-*-solaris*) CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib" ;; *) ;; esac search_libs="$search_libs m" # Checks for libraries. # Check whether --enable-curses was given. if test "${enable_curses+set}" = set; then enableval=$enable_curses; curses=$enableval else curses=yes fi if test "$curses" = "yes"; then search_libs="ncurses curses" fi # Check whether --enable-termcap was given. if test "${enable_termcap+set}" = set; then enableval=$enable_termcap; termcap=$enableval else termcap=yes fi if test "$termcap" = "yes"; then search_libs="$search_libs termcap" fi { $as_echo "$as_me:$LINENO: checking for library containing openpty" >&5 $as_echo_n "checking for library containing openpty... " >&6; } if test "${ac_cv_search_openpty+set}" = set; then $as_echo_n "(cached) " >&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 '' 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_openpty=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_search_openpty" >&5 $as_echo "$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 { $as_echo "$as_me:$LINENO: checking for library containing login_tty" >&5 $as_echo_n "checking for library containing login_tty... " >&6; } if test "${ac_cv_search_login_tty+set}" = set; then $as_echo_n "(cached) " >&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 '' 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_login_tty=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_search_login_tty" >&5 $as_echo "$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 { $as_echo "$as_me:$LINENO: checking for library containing tgetflag" >&5 $as_echo_n "checking for library containing tgetflag... " >&6; } if test "${ac_cv_search_tgetflag+set}" = set; then $as_echo_n "(cached) " >&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; 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_tgetflag=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_search_tgetflag" >&5 $as_echo "$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 { $as_echo "$as_me:$LINENO: checking for library containing snprintf" >&5 $as_echo_n "checking for library containing snprintf... " >&6; } if test "${ac_cv_search_snprintf+set}" = set; then $as_echo_n "(cached) " >&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 '' snprintf db; 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_snprintf=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_search_snprintf" >&5 $as_echo "$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 # Checks for header files. # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if test "${ac_cv_sys_largefile_CC+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if test "${ac_cv_sys_file_offset_bits+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$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 -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if test "${ac_cv_sys_large_files+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 $as_echo "$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 -rf conftest* fi fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_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 { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_opendir=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 $as_echo "$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 { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_opendir=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 $as_echo "$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 { $as_echo "$as_me:$LINENO: checking POSIX termios" >&5 $as_echo_n "checking POSIX termios... " >&6; } if test "${ac_cv_sys_posix_termios+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_sys_posix_termios=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_sys_posix_termios=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_posix_termios" >&5 $as_echo "$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 { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in termio.h sys/termio.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done 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 { $as_echo "$as_me:$LINENO: checking whether termios.h defines TIOCGWINSZ" >&5 $as_echo_n "checking whether termios.h defines TIOCGWINSZ... " >&6; } if test "${ac_cv_sys_tiocgwinsz_in_termios_h+set}" = set; then $as_echo_n "(cached) " >&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 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_tiocgwinsz_in_termios_h" >&5 $as_echo "$ac_cv_sys_tiocgwinsz_in_termios_h" >&6; } if test $ac_cv_sys_tiocgwinsz_in_termios_h != yes; then { $as_echo "$as_me:$LINENO: checking whether sys/ioctl.h defines TIOCGWINSZ" >&5 $as_echo_n "checking whether sys/ioctl.h defines TIOCGWINSZ... " >&6; } if test "${ac_cv_sys_tiocgwinsz_in_sys_ioctl_h+set}" = set; then $as_echo_n "(cached) " >&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 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&5 $as_echo "$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 for ac_header in errno.h fcntl.h locale.h sgtty.h stdlib.h string.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/ioctl.h sys/param.h sys/time.h unistd.h utime.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/dirent.h time.h pwd.h paths.h pty.h libutil.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/types.h sys/stat.h sys/wait.h limits.h signal.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in curses.h term.h utmp.h sys/utime.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in selinux/selinux.h selinux/context.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "$ac_cv_header_selinux_selinux_h" = "yes" -a "$ac_cv_header_selinux_context_h" = "yes" ; then echo "Enabling SELinux context copying!" cat >>confdefs.h <<\_ACEOF #define HAVE_SELINUX 1 _ACEOF fi # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:$LINENO: checking for function prototypes" >&5 $as_echo_n "checking for function prototypes... " >&6; } if test "$ac_cv_prog_cc_c89" != no; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define PROTOTYPES 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define __PROTOTYPES 1 _ACEOF else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const /**/ _ACEOF fi if test "$cross_compiling" = "yes" ; then { $as_echo "$as_me:$LINENO: WARNING: cross compiling so assuming defaults for most 32 bit machines" >&5 $as_echo "$as_me: WARNING: cross compiling so assuming defaults for most 32 bit machines" >&2;} fi # 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. { $as_echo "$as_me:$LINENO: checking size of char" >&5 $as_echo_n "checking size of char... " >&6; } if test "${ac_cv_sizeof_char+set}" = set; then $as_echo_n "(cached) " >&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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (char))) >= 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (char))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (char))) < 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (char))) >= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (char))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (char) See \`config.log' for more details." >&5 $as_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 static long int longval () { return (long int) (sizeof (char)); } static unsigned long int ulongval () { return (long int) (sizeof (char)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (char))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (char)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (char)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_char=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_char" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (char) See \`config.log' for more details." >&5 $as_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 -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 $as_echo "$ac_cv_sizeof_char" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_CHAR $ac_cv_sizeof_char _ACEOF # 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. { $as_echo "$as_me:$LINENO: checking size of short" >&5 $as_echo_n "checking size of short... " >&6; } if test "${ac_cv_sizeof_short+set}" = set; then $as_echo_n "(cached) " >&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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (short))) < 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 $as_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 static long int longval () { return (long int) (sizeof (short)); } static unsigned long int ulongval () { return (long int) (sizeof (short)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (short))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (short)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (short)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_short" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 $as_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 -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 $as_echo "$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF # 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. { $as_echo "$as_me:$LINENO: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if test "${ac_cv_sizeof_int+set}" = set; then $as_echo_n "(cached) " >&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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 $as_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 static long int longval () { return (long int) (sizeof (int)); } static unsigned long int ulongval () { return (long int) (sizeof (int)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (int))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (int)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (int)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 $as_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 -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # 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. { $as_echo "$as_me:$LINENO: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if test "${ac_cv_sizeof_long+set}" = set; then $as_echo_n "(cached) " >&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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 $as_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 static long int longval () { return (long int) (sizeof (long)); } static unsigned long int ulongval () { return (long int) (sizeof (long)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (long))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (long)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (long)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 $as_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 -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # 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. { $as_echo "$as_me:$LINENO: checking size of long long" >&5 $as_echo_n "checking size of long long... " >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then $as_echo_n "(cached) " >&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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long long))) < 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 $as_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 static long int longval () { return (long int) (sizeof (long long)); } static unsigned long int ulongval () { return (long int) (sizeof (long long)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (long long))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (long long)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (long long)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_long=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 $as_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 -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 $as_echo "$ac_cv_sizeof_long_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF # 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. { $as_echo "$as_me:$LINENO: checking size of void *" >&5 $as_echo_n "checking size of void *... " >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then $as_echo_n "(cached) " >&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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 $as_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 static long int longval () { return (long int) (sizeof (void *)); } static unsigned long int ulongval () { return (long int) (sizeof (void *)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (void *))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (void *)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (void *)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 $as_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 -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 $as_echo "$ac_cv_sizeof_void_p" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF { $as_echo "$as_me:$LINENO: checking for sighandler_t" >&5 $as_echo_n "checking for sighandler_t... " >&6; } if test "${ac_cv_type_sighandler_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_sighandler_t=no 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 int main () { if (sizeof (sighandler_t)) 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 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 int main () { if (sizeof ((sighandler_t))) 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_sighandler_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_sighandler_t" >&5 $as_echo "$ac_cv_type_sighandler_t" >&6; } if test "x$ac_cv_type_sighandler_t" = x""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 { $as_echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then $as_echo_n "(cached) " >&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 { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { $as_echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 $as_echo_n "checking whether lstat dereferences a symlink specified with a trailing slash... " >&6; } if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_lstat_dereferences_slashed_symlink=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_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 -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 $as_echo "$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 { $as_echo "$as_me:$LINENO: checking whether lstat accepts an empty string" >&5 $as_echo_n "checking whether lstat accepts an empty string... " >&6; } if test "${ac_cv_func_lstat_empty_string_bug+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_lstat_empty_string_bug=no else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_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 -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_lstat_empty_string_bug" >&5 $as_echo "$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 { $as_echo "$as_me:$LINENO: checking whether setpgrp() takes no arguments" >&5 $as_echo_n "checking whether setpgrp() takes no arguments... " >&6; } if test "${joe_cv_setpgrp_void+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then joe_cv_setpgrp_void=no else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) joe_cv_setpgrp_void=yes fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $joe_cv_setpgrp_void" >&5 $as_echo "$joe_cv_setpgrp_void" >&6; } if test "$joe_cv_setpgrp_void" = yes; then cat >>confdefs.h <<\_ACEOF #define SETPGRP_VOID 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for pid_t" >&5 $as_echo_n "checking for pid_t... " >&6; } if test "${ac_cv_type_pid_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_pid_t=no 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 () { if (sizeof (pid_t)) 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 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 () { if (sizeof ((pid_t))) 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 $as_echo "$ac_cv_type_pid_t" >&6; } if test "x$ac_cv_type_pid_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi { $as_echo "$as_me:$LINENO: checking for size_t" >&5 $as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_size_t=no 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 () { if (sizeof (size_t)) 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 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 () { if (sizeof ((size_t))) 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 $as_echo "$ac_cv_type_size_t" >&6; } if test "x$ac_cv_type_size_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:$LINENO: checking for off_t" >&5 $as_echo_n "checking for off_t... " >&6; } if test "${ac_cv_type_off_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_off_t=no 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 () { if (sizeof (off_t)) 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 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 () { if (sizeof ((off_t))) 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 $as_echo "$ac_cv_type_off_t" >&6; } if test "x$ac_cv_type_off_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi # 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. { $as_echo "$as_me:$LINENO: checking size of off_t" >&5 $as_echo_n "checking size of off_t... " >&6; } if test "${ac_cv_sizeof_off_t+set}" = set; then $as_echo_n "(cached) " >&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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) >= 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) < 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) >= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 $as_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 int main () { static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&5 $as_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 static long int longval () { return (long int) (sizeof (off_t)); } static unsigned long int ulongval () { return (long int) (sizeof (off_t)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (off_t))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (off_t)))) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (off_t)))) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off_t=`cat conftest.val` else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_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 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&5 $as_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 -rf conftest.dSYM 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 { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 $as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF { $as_echo "$as_me:$LINENO: checking for ssize_t" >&5 $as_echo_n "checking for ssize_t... " >&6; } if test "${ac_cv_type_ssize_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_ssize_t=no 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 () { if (sizeof (ssize_t)) 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 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 () { if (sizeof ((ssize_t))) 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_ssize_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 $as_echo "$ac_cv_type_ssize_t" >&6; } if test "x$ac_cv_type_ssize_t" = x""yes; then : else cat >>confdefs.h <<\_ACEOF #define ssize_t int _ACEOF fi { $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if test "${ac_cv_type_signal+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF { $as_echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5 $as_echo_n "checking whether stat accepts an empty string... " >&6; } if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_stat_empty_string_bug=no else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_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 -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5 $as_echo "$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_header in vfork.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 $as_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 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in fork vfork do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:$LINENO: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if test "${ac_cv_func_fork_works+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_fork_works=cross 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 () { /* By Ruediger Kuhlmann. */ return fork () < 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_fork_works=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_fork_works=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:$LINENO: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if test "${ac_cv_func_vfork_works+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_vfork_works=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_vfork_works=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_vfork_works=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WORKING_VFORK 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define vfork fork _ACEOF fi if test "x$ac_cv_func_fork_works" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WORKING_FORK 1 _ACEOF fi for ac_func in getcwd getwd do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_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 { { $as_echo "$as_me:$LINENO: error: don't know how to get current working directory" >&5 $as_echo "$as_me: error: don't know how to get current working directory" >&2;} { (exit 1); exit 1; }; } fi fi for ac_func in isblank do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test x"$ac_cv_func_isblank" = xyes; then { $as_echo "$as_me:$LINENO: checking whether isblank() works correctly with side effect expressions" >&5 $as_echo_n "checking whether isblank() works correctly with side effect expressions... " >&6; } if test "${joe_cv_isblank+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then joe_cv_isblank=no else 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() { int a = 0; isblank(a++); exit(a != 1); } _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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then joe_cv_isblank=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) joe_cv_isblank=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $joe_cv_isblank" >&5 $as_echo "$joe_cv_isblank" >&6; } if test "$joe_cv_isblank" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WORKING_ISBLANK 1 _ACEOF fi fi for ac_func in alarm mkdir mkstemp putenv setlocale strchr strdup utime setpgid do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in setitimer sigaction sigvec siginterrupt sigprocmask do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$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 $as_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 && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking whether sighandlers must be reinstalled" >&5 $as_echo_n "checking whether sighandlers must be reinstalled... " >&6; } if test "${joe_cv_reinstall_sighandlers+set}" = set; then $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then joe_cv_reinstall_sighandlers=no else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) joe_cv_reinstall_sighandlers=yes fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $joe_cv_reinstall_sighandlers" >&5 $as_echo "$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 if -liconv is necessary # if iconv() is in libc, don't bother with -liconv #AC_CHECK_LIB(c,iconv, # [REQRD_LIBS= ], # [REQRD_LIBS=-liconv]) # #AC_SUBST(REQRD_LIBS) # Check for programs.. # Extract the first word of "aspell", so it can be a program name with args. set dummy aspell; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_SPELL+set}" = set; then $as_echo_n "(cached) " >&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" $as_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 { $as_echo "$as_me:$LINENO: result: $SPELL" >&5 $as_echo "$SPELL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi ac_config_files="$ac_config_files Makefile rc/Makefile man/Makefile man/ru/Makefile syntax/Makefile po/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/css.jsf syntax/tex.jsf syntax/ocaml.jsf syntax/4gl.jsf syntax/sml.jsf syntax/sql.jsf syntax/awk.jsf syntax/cobol.jsf syntax/sed.jsf syntax/ps.jsf syntax/ada.jsf syntax/troff.jsf syntax/haskell.jsf syntax/rexx.jsf syntax/skill.jsf syntax/lua.jsf syntax/ruby.jsf syntax/m4.jsf syntax/joerc.jsf syntax/spec.jsf syntax/matlab.jsf syntax/jsf.jsf syntax/jsf_check.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_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $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" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_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=`$as_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 { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_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 { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_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 { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_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 : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $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 || ac_write_fail=1 ## --------------------- ## ## 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=: # Pre-4.2 versions of Zsh do 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 as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } 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.) 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 $as_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. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # 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 || $as_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" || { $as_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 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then 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 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.7, which was generated by GNU Autoconf 2.63. 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 case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # 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_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet, --silent 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_write_fail=1 ac_cs_version="\\ joe config.status 3.7 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 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' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. 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 ) $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) $as_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. -*) { $as_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 || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # 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" ;; "rc/Makefile") CONFIG_FILES="$CONFIG_FILES rc/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "man/ru/Makefile") CONFIG_FILES="$CONFIG_FILES man/ru/Makefile" ;; "syntax/Makefile") CONFIG_FILES="$CONFIG_FILES syntax/Makefile" ;; "po/Makefile") CONFIG_FILES="$CONFIG_FILES po/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/css.jsf") CONFIG_FILES="$CONFIG_FILES syntax/css.jsf" ;; "syntax/tex.jsf") CONFIG_FILES="$CONFIG_FILES syntax/tex.jsf" ;; "syntax/ocaml.jsf") CONFIG_FILES="$CONFIG_FILES syntax/ocaml.jsf" ;; "syntax/4gl.jsf") CONFIG_FILES="$CONFIG_FILES syntax/4gl.jsf" ;; "syntax/sml.jsf") CONFIG_FILES="$CONFIG_FILES syntax/sml.jsf" ;; "syntax/sql.jsf") CONFIG_FILES="$CONFIG_FILES syntax/sql.jsf" ;; "syntax/awk.jsf") CONFIG_FILES="$CONFIG_FILES syntax/awk.jsf" ;; "syntax/cobol.jsf") CONFIG_FILES="$CONFIG_FILES syntax/cobol.jsf" ;; "syntax/sed.jsf") CONFIG_FILES="$CONFIG_FILES syntax/sed.jsf" ;; "syntax/ps.jsf") CONFIG_FILES="$CONFIG_FILES syntax/ps.jsf" ;; "syntax/ada.jsf") CONFIG_FILES="$CONFIG_FILES syntax/ada.jsf" ;; "syntax/troff.jsf") CONFIG_FILES="$CONFIG_FILES syntax/troff.jsf" ;; "syntax/haskell.jsf") CONFIG_FILES="$CONFIG_FILES syntax/haskell.jsf" ;; "syntax/rexx.jsf") CONFIG_FILES="$CONFIG_FILES syntax/rexx.jsf" ;; "syntax/skill.jsf") CONFIG_FILES="$CONFIG_FILES syntax/skill.jsf" ;; "syntax/lua.jsf") CONFIG_FILES="$CONFIG_FILES syntax/lua.jsf" ;; "syntax/ruby.jsf") CONFIG_FILES="$CONFIG_FILES syntax/ruby.jsf" ;; "syntax/m4.jsf") CONFIG_FILES="$CONFIG_FILES syntax/m4.jsf" ;; "syntax/joerc.jsf") CONFIG_FILES="$CONFIG_FILES syntax/joerc.jsf" ;; "syntax/spec.jsf") CONFIG_FILES="$CONFIG_FILES syntax/spec.jsf" ;; "syntax/matlab.jsf") CONFIG_FILES="$CONFIG_FILES syntax/matlab.jsf" ;; "syntax/jsf.jsf") CONFIG_FILES="$CONFIG_FILES syntax/jsf.jsf" ;; "syntax/jsf_check.jsf") CONFIG_FILES="$CONFIG_FILES syntax/jsf_check.jsf" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_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") } || { $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_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 rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _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 || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # 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. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 $as_echo "$as_me: error: could not setup config headers machinery" >&2;} { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_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 || { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; 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 '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; 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 || $as_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=`$as_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 || $as_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" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_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 ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # 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= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 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 || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;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 s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } 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"; } && { $as_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 $as_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 \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 $as_echo "$as_me: error: could not create -" >&2;} { (exit 1); exit 1; }; } fi # 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 || $as_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) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 $as_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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /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 || $as_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 || $as_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=`$as_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 || $as_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" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_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 test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # 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 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi joe-3.7/xterm-readme0000644000100100007640000000310310225010115011347 00000000000000xterm-patch should be applied to xterm-200, which can be found at: http://dickey.his.com/xterm/xterm.html With this patch, the following escape sequences become available, and you can enable "-joexterm" in the joerc file: ESC [ ? 2 0 0 4 h Enable bracketed pastes. ESC [ ? 2 0 0 4 l Disable bracketed pastes. When bracketed pastes are enabled, paste data looks like this: ESC [ 2 0 0 ~ ESC [ 2 0 1 ~ ESC [ ? P Send base64 encoded paste data to program (when JOE gets middle button click, it sends this to xterm to make it send the paste data). ESC [ ? 2 P Accept base64 encoded paste data until ESC. This data becomes the "selected text" which can be pasted by other applications. ESC [ ? 2 0 0 7 h Enable outside of frame mouse coordinates. ESC [ ? 2 0 0 7 l Disable outside of frame mouse coordinates. When outside of frame mouse coordinates are enabled, and xterm mouse support is enabled (ESC [ ? 1 0 0 2 h), mouse coordinates are sent even if they are outside of xterm's window frame. The coordinate code bytes should be interpreted like this (we need negative coordinates in case mouse is above or to left of window): Code Coordinate ---- ---------- 33 - 240 1 - 208 (normal) 32 0 (left/top of frame) 241 - 255 -15 - -1 (left/top of frame) (When this mode is off, codes 33 - 255 correspond to coordinates 1 - 223). Also, this patch makes XTerms compiled with wide character support much faster. Also, this patch makes XTerm stores UTF-8 data in the server's cut buffer, instead of latin1. joe-3.7/xterm-patch0000644000100100007640000007420010225010114011216 00000000000000diff -Naur xterm-200/VTPrsTbl.c xterm-200-new/VTPrsTbl.c --- xterm-200/VTPrsTbl.c 2004-11-30 20:27:46.000000000 -0500 +++ xterm-200-new/VTPrsTbl.c 2005-04-05 22:35:40.000000000 -0400 @@ -399,6 +399,330 @@ CASE_PRINT, }; +Const PARSE_T take_table[] = /* TAKE Base64 SELECTION DATA */ +{ +/* NUL SOH STX ETX */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* EOT ENQ ACK BEL */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* BS HT NL VT */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* NP CR SO SI */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* DLE DC1 DC2 DC3 */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* DC4 NAK SYN ETB */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* CAN EM SUB ESC */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* FS GS RS US */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* SP ! " # */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* $ % & ' */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* ( ) * + */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE, +/* , - . / */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE, +/* 0 1 2 3 */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +/* 4 5 6 7 */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +/* 8 9 : ; */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* < = > ? */ +CASE_TAKE_DONE, +CASE_IGNORE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* @ A B C */ +CASE_TAKE_DONE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +/* D E F G */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +/* H I J K */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +/* L M N O */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +/* P Q R S */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +/* T U V W */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +/* X Y Z [ */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE_DONE, +/* \ ] ^ _ */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* ` a b c */ +CASE_TAKE_DONE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +/* d e f g */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +/* h i j k */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +/* l m n o */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +/* p q r s */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +/* t u v w */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +/* x y z { */ +CASE_TAKE, +CASE_TAKE, +CASE_TAKE, +CASE_TAKE_DONE, +/* | } ~ DEL */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* 0x80 0x81 0x82 0x83 */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* 0x84 0x85 0x86 0x87 */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* 0x88 0x89 0x8a 0x8b */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* 0x8c 0x8d 0x8e 0x8f */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* 0x90 0x91 0x92 0x93 */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* 0x94 0x95 0x96 0x97 */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* 0x98 0x99 0x9a 0x9b */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* 0x9c 0x9d 0x9e 0x9f */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* nobreakspace exclamdown cent sterling */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* currency yen brokenbar section */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* diaeresis copyright ordfeminine guillemotleft */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* notsign hyphen registered macron */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* degree plusminus twosuperior threesuperior */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* acute mu paragraph periodcentered */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* cedilla onesuperior masculine guillemotright */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* onequarter onehalf threequarters questiondown */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* Agrave Aacute Acircumflex Atilde */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* Adiaeresis Aring AE Ccedilla */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* Egrave Eacute Ecircumflex Ediaeresis */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* Igrave Iacute Icircumflex Idiaeresis */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* Eth Ntilde Ograve Oacute */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* Ocircumflex Otilde Odiaeresis multiply */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* Ooblique Ugrave Uacute Ucircumflex */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* Udiaeresis Yacute Thorn ssharp */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* agrave aacute acircumflex atilde */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* adiaeresis aring ae ccedilla */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* egrave eacute ecircumflex ediaeresis */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* igrave iacute icircumflex idiaeresis */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* eth ntilde ograve oacute */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* ocircumflex otilde odiaeresis division */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* oslash ugrave uacute ucircumflex */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +/* udiaeresis yacute thorn ydiaeresis */ +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE, +CASE_TAKE_DONE +}; + Const PARSE_T csi_table[] = /* CSI */ { /* NUL SOH STX ETX */ @@ -877,7 +1201,7 @@ CASE_GROUND_STATE, /* x y z { */ CASE_DECREQTPARM, -CASE_GROUND_STATE, +CASE_PASTE, CASE_GROUND_STATE, CASE_GROUND_STATE, /* | } ~ DEL */ @@ -2774,7 +3098,7 @@ CASE_GROUND_STATE, CASE_GROUND_STATE, /* P Q R S */ -CASE_GROUND_STATE, +CASE_PASTE, CASE_GROUND_STATE, CASE_GROUND_STATE, CASE_GROUND_STATE, diff -Naur xterm-200/VTparse.def xterm-200-new/VTparse.def --- xterm-200/VTparse.def 2004-11-30 20:27:46.000000000 -0500 +++ xterm-200-new/VTparse.def 2005-04-05 22:29:16.000000000 -0400 @@ -140,3 +140,6 @@ CASE_DECCARA CASE_DECRARA CASE_CSI_STAR_STATE +CASE_PASTE +CASE_TAKE +CASE_TAKE_DONE diff -Naur xterm-200/VTparse.h xterm-200-new/VTparse.h --- xterm-200/VTparse.h 2004-11-30 20:27:46.000000000 -0500 +++ xterm-200-new/VTparse.h 2005-04-06 11:52:19.000000000 -0400 @@ -82,6 +82,7 @@ extern Const PARSE_T scrtable[]; extern Const PARSE_T scstable[]; extern Const PARSE_T sos_table[]; +extern Const PARSE_T take_table[]; #if OPT_DEC_LOCATOR extern Const PARSE_T csi_tick_table[]; @@ -244,5 +245,8 @@ #define CASE_DECCARA 128 #define CASE_DECRARA 129 #define CASE_CSI_STAR_STATE 130 +#define CASE_PASTE 131 +#define CASE_TAKE 132 +#define CASE_TAKE_DONE 133 #endif /* included_VTparse_h */ diff -Naur xterm-200/button.c xterm-200-new/button.c --- xterm-200/button.c 2005-02-06 16:42:37.000000000 -0500 +++ xterm-200-new/button.c 2005-04-06 11:31:46.000000000 -0400 @@ -1174,7 +1174,9 @@ return cutbuffer; } -static void +int base64_paste = 0; /* Set if paste data should be sent as base64 */ + +void _GetSelection(Widget w, Time ev_time, String * params, /* selections in precedence order */ @@ -1208,19 +1210,34 @@ int fmt8 = 8; Atom type = XA_STRING; char *line; + int x; + + /* Selection from X server */ + +#if OPT_WIDE_CHARS + /* Joe Allen - 2005-4-4: assume X's cut buffer is UTF-8 if + the xterm is UTF-8 */ + if (term->screen.utf8_mode) + type = XA_UTF8_STRING(XtDisplay(w)); +#endif /* 'line' is freed in SelectionReceived */ line = XFetchBuffer(XtDisplay(w), &inbytes, cutbuffer); nbytes = (unsigned long) inbytes; + if (nbytes > 0) SelectionReceived(w, NULL, &selection, &type, (XtPointer) line, &nbytes, &fmt8); else if (num_params > 1) _GetSelection(w, ev_time, params + 1, num_params - 1, NULL); + else + base64_paste = 0; return; } else { struct _SelectionList *list; + /* Selection owned by someone */ + if (targets == NULL || targets[0] == None) { targets = _SelectionTargets(w); } @@ -1280,9 +1297,65 @@ # define tty_vwrite(pty,lag,l) v_write(pty,lag,l) #endif /* defined VMS */ +/* Return base64 code character given 6-bit number */ + +char base64_code[]="\ +ABCDEFGHIJKLMNOPQRSTUVWXYZ\ +abcdefghijklmnopqrstuvwxyz\ +0123456789+/"; + +/* Be careful: _qWriteSelectionData expects these to be initialized + to zero. Base64_flush() is the last step of the conversion, it + clears these variables. */ + +int base64_accu = 0; +int base64_count = 0; +int base64_pad = 0; + static void _qWriteSelectionData(TScreen * screen, Char * lag, unsigned length) { + if (base64_paste) { + /* Send data as base64 */ + unsigned char *p = (unsigned char *)lag; + Char buf[64]; + unsigned x = 0; + while (length--) { + switch (base64_count) { + case 0: + buf[x++] = base64_code[*p >> 2]; + base64_accu = (*p & 0x3); + base64_count = 2; + ++p; + break; + case 2: + buf[x++] = base64_code[(base64_accu << 4) + (*p >> 4)]; + base64_accu = (*p & 0xF); + base64_count = 4; + ++p; + break; + case 4: + buf[x++] = base64_code[(base64_accu << 2) + (*p >> 6)]; + buf[x++] = base64_code[*p & 0x3F]; + base64_accu = 0; + base64_count = 0; + ++p; + break; + } + if (x >= 63) { + /* Write 63 or 64 characters */ + base64_pad += x; + tty_vwrite(screen->respond, buf, x); + x = 0; + } + } + if (x != 0) { + base64_pad += x; + tty_vwrite(screen->respond, buf, x); + } + return; + } + #if OPT_READLINE if (SCREEN_FLAG(screen, paste_quotes)) { while (length--) { @@ -1295,6 +1368,29 @@ } static void +base64_flush(TScreen *screen) +{ + unsigned char x; + switch (base64_count) { + case 0: + break; + case 2: + x = base64_code[base64_accu << 4]; + tty_vwrite(screen->respond, &x, 1); + break; + case 4: + x = base64_code[base64_accu << 2]; + tty_vwrite(screen->respond, &x, 1); + break; + } + if (base64_pad & 3) + tty_vwrite(screen->respond, "===", 4 - (base64_pad & 3)); + base64_count = 0; + base64_accu = 0; + base64_pad = 0; +} + +static void _WriteSelectionData(TScreen * screen, Char * line, int length) { /* Write data to pty a line at a time. */ @@ -1325,13 +1421,14 @@ if (lag != end) { _qWriteSelectionData(screen, lag, (unsigned) (end - lag)); } + if (base64_paste) + base64_flush(screen); #ifdef VMS tt_pasting = False; tt_start_read(); /* reenable reads or a character may be lost */ #endif } -#if OPT_READLINE static void _WriteKey(TScreen * screen, Char * in) { @@ -1350,7 +1447,6 @@ line[count++] = '~'; tty_vwrite(screen->respond, line, count); } -#endif /* OPT_READLINE */ /* SelectionReceived: stuff received selection text into pty */ @@ -1434,18 +1530,20 @@ if (text_list != NULL && text_list_count != 0) { int i; -#if OPT_READLINE - if (SCREEN_FLAG(screen, paste_brackets)) + if (base64_paste) + _WriteKey(screen, "202"); + else if (screen->paste_brackets) _WriteKey(screen, "200"); -#endif for (i = 0; i < text_list_count; i++) { int len = strlen(text_list[i]); _WriteSelectionData(screen, (Char *) text_list[i], len); } -#if OPT_READLINE - if (SCREEN_FLAG(screen, paste_brackets)) + if (base64_paste) { + tty_vwrite(screen->respond, "\33", 1); + base64_paste = 0; + } + else if (screen->paste_brackets) _WriteKey(screen, "201"); -#endif XFreeStringList(text_list); } else goto fail; @@ -1461,6 +1559,8 @@ _GetSelection(w, list->time, list->params, list->count, list->targets); XtFree((char *) client_data); + } else { + base64_paste = 0; } return; } @@ -2452,6 +2552,96 @@ _OwnSelection(term, params, num_params); } +void ClearSelectionBuffer() +{ + TScreen *screen = &term->screen; + screen->selection_length = 0; + base64_count = 0; +} + +void AppendStrToSelectionBuffer(Char *text,int len) +{ + TScreen *screen = &term->screen; + if (len != 0) { + int j = screen->selection_length + len; /* New length */ + int k = j + (j >> 2) + 80; /* New size if we grow buffer: grow by ~50% */ + if (j + 1 >= screen->selection_size) { + if (!screen->selection_length) { + /* New buffer */ + Char *line; + if ((line = (Char *) malloc((unsigned) k)) == 0) + SysError(ERROR_BMALLOC2); + XtFree((char *) screen->selection_data); + screen->selection_data = line; + } else { + /* Realloc buffer */ + screen->selection_data = (Char *) realloc(screen->selection_data, (unsigned) k); + if (screen->selection_data == 0) + SysError(ERROR_BMALLOC2); + } + screen->selection_size = k; + } + memcpy(screen->selection_data + screen->selection_length, text, len); + screen->selection_length += len; + screen->selection_data[screen->selection_length] = 0; + } +} + +void AppendToSelectionBuffer(unsigned c) +{ + int six; + Char ch; + + /* Decode base64 character */ + if (c >= 'A' && c <= 'Z') + six = c - 'A'; + else if (c >= 'a' && c <= 'z') + six = c - 'a' + 26; + else if (c >= '0' && c <= '9') + six = c - '0' + 52; + else if (c == '+') + six = 62; + else + six = 63; + + /* Accumulate bytes */ + switch (base64_count) { + case 0: + base64_accu = six; + base64_count = 6; + break; + + case 2: + ch = (base64_accu << 6) + six; + base64_count = 0; + AppendStrToSelectionBuffer(&ch, 1); + break; + + case 4: + ch = (base64_accu << 4) + (six >> 2); + base64_accu = (six & 0x3); + base64_count = 2; + AppendStrToSelectionBuffer(&ch, 1); + break; + + case 6: + ch = (base64_accu << 2) + (six >> 4); + base64_accu = (six & 0xF); + base64_count = 4; + AppendStrToSelectionBuffer(&ch, 1); + break; + } +} + +extern char *select_args[]; /* in charproc.c */ + +void CompleteSelection() +{ + base64_count = 0; + base64_accu = 0; + _OwnSelection(term, select_args, 2); +} + static Bool _ConvertSelectionHelper(Widget w, Atom * type, XtPointer *value, @@ -2715,9 +2905,14 @@ */ unsigned long length = termw->screen.selection_length; Char *data = termw->screen.selection_data; +#ifdef junk +/* These days it's better to assume that X server's cut & paste buffers + are UTF-8 when the locale is UTF-8. + Joe Allen, 2005-04-04 */ if_OPT_WIDE_CHARS((&(termw->screen)), { data = UTF8toLatin1(data, length, &length); }); +#endif TRACE(("XStoreBuffer(%d)\n", cutbuffer)); XStoreBuffer(XtDisplay((Widget) termw), (char *) data, @@ -2885,6 +3080,18 @@ return (result); } +/* 32 + following 7-bit word: + + 1:0 Button no: 0, 1, 2. 3=release. + 2 shift + 3 meta + 4 ctrl + 5 set for motion notify + 6 set for wheel +*/ + +/* Position: 32 - 255. */ + static int BtnCode(XButtonEvent * event, int button) { @@ -2904,6 +3111,16 @@ #define MOUSE_LIMIT (255 - 32) +/* When screen->out_of_frame set, coordinates can go outside + of frame as follows: + Code Coord + ---- ----- + 33 - 240 1 - 208 (208 positive coordinates) + 32, 255 - 241 0, -1 - -15 (16 negative coordinates) + + When range is exceeded, the maximum closest value is sent +*/ + static void EditorButton(XButtonEvent * event) { @@ -2923,20 +3140,41 @@ row = (event->y - screen->border) / FontHeight(screen); col = (event->x - OriginX(screen)) / FontWidth(screen); - /* Limit to screen dimensions */ - if (row < 0) - row = 0; - else if (row > screen->max_row) - row = screen->max_row; - else if (row > MOUSE_LIMIT) - row = MOUSE_LIMIT; - - if (col < 0) - col = 0; - else if (col > screen->max_col) - col = screen->max_col; - else if (col > MOUSE_LIMIT) - col = MOUSE_LIMIT; + if (screen->out_of_frame) { + if (row > 207) + row = 207; + else if (row < -16) + row = 208; + else if (row == -1) + row = -1; + else if (row < 0) + row = 224 + row; + + if (col > 207) + col = 207; + else if (col < -16) + col = 208; + else if (col == -1) + col = -1; + else if (col < 0) + col = 224 + col; + + } else { + /* Limit to screen dimensions */ + if (row < 0) + row = 0; + else if (row > screen->max_row) + row = screen->max_row; + else if (row > MOUSE_LIMIT) + row = MOUSE_LIMIT; + + if (col < 0) + col = 0; + else if (col > screen->max_col) + col = screen->max_col; + else if (col > MOUSE_LIMIT) + col = MOUSE_LIMIT; + } /* Build key sequence starting with \E[M */ if (screen->control_eight_bits) { diff -Naur xterm-200/charproc.c xterm-200-new/charproc.c --- xterm-200/charproc.c 2005-02-06 16:42:38.000000000 -0500 +++ xterm-200-new/charproc.c 2005-04-06 11:32:53.000000000 -0400 @@ -1098,6 +1098,20 @@ static struct ParseState myState; +extern Widget current_widget; +extern XEvent *current_event; +extern String *current_params; +extern Cardinal *current_num_params; + +char *select_args[]= +{ + "PRIMARY", + "CUT_BUFFER0", + 0 +}; + +extern int base64_paste; + static Boolean doparsing(unsigned c, struct ParseState *sp) { @@ -1121,7 +1135,19 @@ do { #if OPT_WIDE_CHARS - if (screen->wide_chars + + /* Feed wide characters into state machine when we're + reading in a selection */ + if (sp->parsestate == take_table) { + if (c < 256) + sp->nextstate = sp->parsestate[E2A(c)]; + else + sp->nextstate = CASE_TAKE; + goto just_take_it; + } + + /* Jhallen: this code was very very slow, so I put in the (c >= 0x300) */ + if (c >= 0x300 && screen->wide_chars && my_wcwidth((int) c) == 0) { int prev, precomposed; @@ -1366,6 +1392,8 @@ string_used = 0; } + just_take_it: + TRACE(("parse %04X -> %d %s\n", c, sp->nextstate, which_table(sp->parsestate))); switch (sp->nextstate) { @@ -1654,6 +1682,38 @@ sp->parsestate = sp->groundtable; break; + case CASE_PASTE: { + int cmd = param[0]; + TRACE(("CASE_PASTE - cut & paste\n")); + if (cmd < 2) + cmd = 0; + if (cmd == 0) { + TRACE(("CASE_PASTE - paste selection\n")); + /* Paste current selection */ + base64_paste = 1; /* Tells _GetSelection data is base64 encoded */ + _GetSelection(current_widget, 0, select_args, 2, NULL); + /* _GetSelection clears base64_paste */ + sp->parsestate = sp->groundtable; + } else if (cmd == 2) { + TRACE(("CASE_PASTE - taking selection data\n")); + ClearSelectionBuffer(); + sp->parsestate = take_table; + } else + sp->parsestate = sp->groundtable; + break; + } + + case CASE_TAKE: { + AppendToSelectionBuffer(c); + sp->parsestate = take_table; + break; + } + + case CASE_TAKE_DONE: + CompleteSelection(); + sp->parsestate = sp->groundtable; + break; + case CASE_ECH: TRACE(("CASE_ECH - erase char\n")); /* ECH */ @@ -3877,6 +3937,12 @@ set_keyboard_type(keyboardIsVT220, func == bitset); break; #endif + case SET_PASTE_IN_BRACKET: + screen->paste_brackets = (func == bitset); + break; + case SET_OUT_OF_FRAME: + screen->out_of_frame = (func == bitset); + break; #if OPT_READLINE case SET_BUTTON1_MOVE_POINT: set_mouseflag(click1_moves); @@ -3887,9 +3953,6 @@ case SET_DBUTTON3_DELETE: set_mouseflag(dclick3_deletes); break; - case SET_PASTE_IN_BRACKET: - set_mouseflag(paste_brackets); - break; case SET_PASTE_QUOTE: set_mouseflag(paste_quotes); break; @@ -3993,6 +4056,12 @@ CursorSave(termw); } break; + case SET_PASTE_IN_BRACKET: + DoSM(DP_PASTE_BRACKETS, screen->paste_brackets); + break; + case SET_OUT_OF_FRAME: + DoSM(DP_OUT_OF_FRAME, screen->out_of_frame); + break; #if OPT_READLINE case SET_BUTTON1_MOVE_POINT: SCREEN_FLAG_save(screen, click1_moves); @@ -4003,9 +4072,6 @@ case SET_DBUTTON3_DELETE: SCREEN_FLAG_save(screen, dclick3_deletes); break; - case SET_PASTE_IN_BRACKET: - SCREEN_FLAG_save(screen, paste_brackets); - break; case SET_PASTE_QUOTE: SCREEN_FLAG_save(screen, paste_quotes); break; @@ -4156,6 +4222,11 @@ CursorRestore(termw); } break; + case SET_PASTE_IN_BRACKET: + DoRM(DP_PASTE_BRACKETS, screen->paste_brackets); + break; + case SET_OUT_OF_FRAME: + DoRM(DP_OUT_OF_FRAME, screen->out_of_frame); #if OPT_READLINE case SET_BUTTON1_MOVE_POINT: SCREEN_FLAG_restore(screen, click1_moves); @@ -4166,9 +4237,6 @@ case SET_DBUTTON3_DELETE: SCREEN_FLAG_restore(screen, dclick3_deletes); break; - case SET_PASTE_IN_BRACKET: - SCREEN_FLAG_restore(screen, paste_brackets); - break; case SET_PASTE_QUOTE: SCREEN_FLAG_restore(screen, paste_quotes); break; diff -Naur xterm-200/ctlseqs.ms xterm-200-new/ctlseqs.ms --- xterm-200/ctlseqs.ms 2005-01-13 20:50:00.000000000 -0500 +++ xterm-200-new/ctlseqs.ms 2005-04-06 11:45:04.000000000 -0400 @@ -792,6 +792,8 @@ \*(Ps = \*1\*0\*5\*3 \(-> Set SCO function-key mode. \*(Ps = \*1\*0\*6\*0 \(-> Set legacy keyboard emulation (X11R6). \*(Ps = \*1\*0\*6\*1 \(-> Set Sun/PC keyboard emulation of VT220 keyboard. + \*(Ps = \*2\*0\*0\*4 \(-> Set bracketed paste mode. + \*(Ps = \*2\*0\*0\*7 \(-> Allow mouse coordinates beyond frame. . .IP \\*(Cs\\*(Pm\\*s\\*i Media Copy (MC) @@ -869,6 +871,8 @@ \*(Ps = \*1\*0\*5\*3 \(-> Reset SCO function-key mode. \*(Ps = \*1\*0\*6\*0 \(-> Reset legacy keyboard emulation (X11R6). \*(Ps = \*1\*0\*6\*1 \(-> Reset Sun/PC keyboard emulation of VT220 keyboard. + \*(Ps = \*2\*0\*0\*4 \(-> Reset bracketed paste mode. + \*(Ps = \*2\*0\*0\*7 \(-> Mouse coordinates constrained within frame. . .IP \\*(Cs\\*(Pm\\*s\\*m Character Attributes (SGR) @@ -1086,6 +1090,15 @@ \*(Pc is the character to use. \*(Pt\*;\*(Pl\*;\*(Pb\*;\*(Pr denotes the rectangle. . +.IP \\*(Cs\\*?\\*(Ps\\*s\\*P +Cut and Paste. + \*(Ps = \*1 \(-> Paste (default). The current selection is sent to the program in Base64: +ESC [ ? 202 ~ ESC. + \*(Ps = \*2 \(-> Select. Give Base64 encoded selection +data to Xterm. Base64 encoded data is sent to the XTerm following this command. The Data +is terminated with a single ESC. This data becomes the new selection, which is then +available for pasting by other applications. +. .IP \\*(Cs\\*(Ps\\*s\\*;\\*(Pu\\*s\\*(qu\\*z Enable Locator Reporting (DECELR) .br @@ -1563,6 +1576,14 @@ to make the details of switching independent of the application that requests the switch. .SH +Bracketed Paste Mode +.ds RH Bracketed Paste Mode +.LP +When bracketed paste mode is set, pasted text is bracketed with control +sequences so that the program can differentiate pasted text from typed-in +text. When bracketed paste mode is set, the program will receive: ESC [ 200 ~, +followed by the pasted text, followed by ESC [ 201 ~. +.SH Mouse Tracking .ds RH Mouse Tracking .LP @@ -1592,6 +1613,7 @@ #define SET_VT200_HIGHLIGHT_MOUSE 1001 #define SET_BTN_EVENT_MOUSE 1002 #define SET_ANY_EVENT_MOUSE 1003 +#define SET_OUT_OF_FRAME 2007 .DE .LP The motion reporting modes are strictly \fIxterm\fP extensions, and are not @@ -1605,6 +1627,13 @@ For example, \*! specifies the value 1. The upper left character position on the terminal is denoted as 1,1. +If OUT_OF_FRAME mode is enabled, and the mouse goes beyond the window frame, +coordinates beyond the frame are sent to the program. Coordinate values 1 - +208 are sent as usual, as byte values between 33 and 240. The coordinate +value 0 (the first cell above or to the left of the frame) is sent as SPACE +(32). The coordinate values -15 through -1 are sent as byte values 241 +through 255. + X10 compatibility mode sends an escape sequence only on button press, encoding the location and the mouse button pressed. It is enabled by specifying parameter 9 to DECSET. diff -Naur xterm-200/misc.c xterm-200-new/misc.c --- xterm-200/misc.c 2005-01-29 17:17:32.000000000 -0500 +++ xterm-200-new/misc.c 2005-03-27 17:29:23.000000000 -0500 @@ -228,6 +228,11 @@ return (c); } +Widget current_widget; +XEvent *current_event; +String *current_params; +Cardinal *current_num_params; + /* ARGSUSED */ void HandleKeyPressed(Widget w GCC_UNUSED, @@ -238,9 +243,14 @@ TScreen *screen = &term->screen; TRACE(("Handle 7bit-key\n")); + current_widget = w; + current_event = event; + current_params = params; + current_num_params = nparams; #ifdef ACTIVEWINDOWINPUTONLY if (w == CURRENT_EMU(screen)) #endif + Input(&term->keyboard, screen, &event->xkey, False); } diff -Naur xterm-200/paste xterm-200-new/paste --- xterm-200/paste 1969-12-31 19:00:00.000000000 -0500 +++ xterm-200-new/paste 2005-04-06 11:46:10.000000000 -0400 @@ -0,0 +1 @@ +[?P diff -Naur xterm-200/ptyx.h xterm-200-new/ptyx.h --- xterm-200/ptyx.h 2005-01-13 20:50:03.000000000 -0500 +++ xterm-200-new/ptyx.h 2005-03-28 22:48:06.000000000 -0500 @@ -1108,6 +1108,8 @@ #if OPT_TOOLBAR DP_TOOLBAR, #endif + DP_PASTE_BRACKETS, + DP_OUT_OF_FRAME, DP_LAST } SaveModes; @@ -1269,11 +1271,12 @@ unsigned long event_mask; unsigned short send_mouse_pos; /* user wants mouse transition */ /* and position information */ + unsigned paste_brackets; + unsigned out_of_frame; #if OPT_READLINE unsigned click1_moves; unsigned paste_moves; unsigned dclick3_deletes; - unsigned paste_brackets; unsigned paste_quotes; unsigned paste_literal_nl; #endif /* OPT_READLINE */ diff -Naur xterm-200/select xterm-200-new/select --- xterm-200/select 1969-12-31 19:00:00.000000000 -0500 +++ xterm-200-new/select 2005-04-06 11:47:39.000000000 -0400 @@ -0,0 +1,2 @@ +[?2PSGVsbG8sIHdvcmxkIQo= + diff -Naur xterm-200/xcharmouse.h xterm-200-new/xcharmouse.h --- xterm-200/xcharmouse.h 2002-08-24 14:54:39.000000000 -0400 +++ xterm-200-new/xcharmouse.h 2005-03-28 22:39:35.000000000 -0500 @@ -50,6 +50,8 @@ #define SET_PASTE_IN_BRACKET 2004 /* Surround paste by escapes */ #define SET_PASTE_QUOTE 2005 /* Quote each char during paste */ #define SET_PASTE_LITERAL_NL 2006 /* Paste "\n" as C-j */ +#define SET_OUT_OF_FRAME 2007 /* Give mouse coords even when cursor + is outside of frame */ #if OPT_DEC_LOCATOR diff -Naur xterm-200/xterm.h xterm-200-new/xterm.h --- xterm-200/xterm.h 2005-01-13 20:50:03.000000000 -0500 +++ xterm-200-new/xterm.h 2005-03-30 22:35:45.000000000 -0500 @@ -603,6 +603,9 @@ extern void DisownSelection (XtermWidget termw); extern void HandleGINInput PROTO_XT_ACTIONS_ARGS; extern void HandleInsertSelection PROTO_XT_ACTIONS_ARGS; + +extern void _GetSelection (Widget w, Time ev_time, String *params, Cardinal num_params, Atom *targets); + extern void HandleKeyboardSelectEnd PROTO_XT_ACTIONS_ARGS; extern void HandleKeyboardSelectStart PROTO_XT_ACTIONS_ARGS; extern void HandleKeyboardStartExtend PROTO_XT_ACTIONS_ARGS; @@ -630,6 +633,10 @@ extern Bool iswide(int i); #endif +extern void ClearSelectionBuffer (); +extern void AppendToSelectionBuffer (unsigned c); +extern void CompleteSelection (); + /* charproc.c */ extern int VTInit (void); extern int v_write (int f, Char *d, unsigned len); @@ -1052,4 +1059,6 @@ } #endif + + #endif /* included_xterm_h */ joe-3.7/macro.c0000644000100100007640000004223011100445357010320 00000000000000/* * Keyboard macros * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" MACRO *freemacros = NULL; /* Create a macro */ MACRO *mkmacro(int k, int flg, int n, CMD *cmd) { MACRO *macro; if (!freemacros) { int x; macro = (MACRO *) joe_malloc(sizeof(MACRO) * 64); 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->flg = flg; 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]); joe_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 = (MACRO **) joe_realloc(macro->steps, (macro->size += 8) * sizeof(MACRO *)); else macro->steps = (MACRO **) joe_malloc((macro->size = 8) * sizeof(MACRO *)); } macro->steps[macro->n++] = m; } /* Duplicate a macro */ MACRO *dupmacro(MACRO *mac) { MACRO *m = mkmacro(mac->k, mac->flg, mac->n, mac->cmd); if (mac->steps) { int x; m->steps = (MACRO **) joe_malloc((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 flg part of macro */ MACRO *macsta(MACRO *m, int a) { m->flg = 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(locale_map,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': c = 0; if (buf[x + 1] >= '0' && buf[x + 1] <= '9') c = c * 16 + buf[++x] - '0'; else if ((buf[x + 1] >= 'a' && buf[x + 1] <= 'f') || (buf[x + 1] >= 'A' && buf[x + 1] <= 'F')) c = c * 16 + (buf[++x] & 0xF) + 9; if (buf[x + 1] >= '0' && buf[x + 1] <= '9') c = c * 16 + buf[++x] - '0'; else if ((buf[x + 1] >= 'a' && buf[x + 1] <= 'f') || (buf[x + 1] >= 'A' && buf[x + 1] <= 'F')) c = c * 16 + (buf[++x] & 0xF) + 9; buf[x] = c; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': c = buf[x] - '0'; if (buf[x + 1] >= '0' && buf[x + 1] <= '7') c = c * 8 + buf[++x] - '0'; if (buf[x + 1] >= '0' && buf[x + 1] <= '7') c = c * 8 + buf[++x] - '0'; buf[x] = c; break; } } if (m) { if (!m->steps) { MACRO *macro = m; m = mkmacro(-1, 0, 0, NULL); addmacro(m, macro); } } else m = mkmacro(-1, 0, 0, NULL); addmacro(m, mkmacro(buf[x], 0, 0, findcmd(USTR "type"))); ++x; } if (buf[x] == '\"') ++x; } /* Do we have a command? */ else { for (y = x; buf[y] && buf[y]!='#' && buf[y] != '!' && buf[y] != '~' && buf[y] !='-' && buf[y] != ',' && buf[y] != ' ' && buf[y] != '\t' && buf[y] != '\n' && buf[x] != '\r'; ++y) ; if (y != x) { CMD *cmd; int flg = 0; c = buf[y]; buf[y] = 0; cmd = findcmd(buf + x); buf[x = y] = c; /* Parse flags */ while (buf[x]=='-' || buf[x]=='!' || buf[x]=='#' || buf[x]=='~') { if (buf[x]=='-') flg |= 1; if (buf[x]=='!') flg |= 2; if (buf[x]=='#') flg |= 4; if (buf[x]=='~') flg |= 8; ++x; } if (!cmd) { *sta = -1; return NULL; } else if (m) { if (!m->steps) { MACRO *macro = m; m = mkmacro(-1, 0, 0, NULL); addmacro(m, macro); } addmacro(m, mkmacro(-1, flg, 0, cmd)); } else m = mkmacro(-1, flg, 0, cmd); } else { /* not a valid command */ *sta = -1; return NULL; } } /* Skip whitespace */ while (joe_isblank(locale_map,buf[x])) ++x; /* Do we have a comma? */ if (buf[x] == ',') { ++x; while (joe_isblank(locale_map,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; unsigned char *unescape(unsigned char *ptr, int c) { if (c == '"') { *ptr++ = '\\'; *ptr++ = '"'; } else if (c == '\\') { *ptr++ = '\\'; *ptr++ = '\\'; } else if (c == '\'') { *ptr++ = '\\'; *ptr++ = '\''; } else if (c < 32 || c > 126) { /* FIXME: what if c > 256 or c < 0 ? */ *ptr++ = '\\'; *ptr++ = 'x'; *ptr++ = "0123456789ABCDEF"[c >> 4]; *ptr++ = "0123456789ABCDEF"[c & 15]; } else *ptr++ = c; return ptr; } 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 && zcmp(m->cmd->name, USTR "type")) { *ptr++ = '\"'; instr = 0; } if (first) first = 0; else if (!instr) *ptr++ = ','; if (!zcmp(m->cmd->name, USTR "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 (!zcmp(m->cmd->name, USTR "play") || !zcmp(m->cmd->name, USTR "gomark") || !zcmp(m->cmd->name, USTR "setmark") || !zcmp(m->cmd->name, USTR "record") || !zcmp(m->cmd->name, USTR "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)); } static int ifdepth=0; /* JM: Nesting level of if cmds */ static int ifflag=1; /* JM: Truth flag for if */ static int iffail=0; /* JM: Depth where ifflag became 0 */ /* Suspend macro record/play to allow for user input. * * Stop recording current macro, make recursive call to edit loop, which * runs until dialog is complete, then continue with macro recording. * * When the macro is played, edit loop is run as a subroutine until dialog * is complete, then uquery returns, which continues macro execution. * * Completion of a dialog is indicated with 'notify' flag (look at interactive * dialogs in ufile.c). */ int uquery(BW *bw) { int ret; int oid=ifdepth, oifl=ifflag, oifa=iffail; struct recmac *tmp = recmac; recmac = NULL; ret = edloop(1); recmac = tmp; ifdepth = oid; ifflag = oifl; iffail = oifa; 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 */ /* Execute a macro which is just a simple command */ int exsimple(MACRO *m, int arg, int u) { CMD *cmd = m->cmd; int flg = 0; /* set if we should not try to merge minor changes into single undo record */ int ret = 0; /* Find command to execute if repeat argument is negative */ if (arg < 0) { arg = -arg; if (cmd->negarg) cmd = findcmd(cmd->negarg); else arg = 0; /* Do not execute */ } /* Check if command doesn't like an arg... */ if (arg != 1 && !cmd->arg) arg = 0; /* Do not execute */ if (arg != 1 || !(cmd->flag & EMINOR) || maint->curwin->watom->what == TYPEQW) /* Undo work right for s & r */ flg = 1; if (ifflag || (cmd->flag&EMETA)) { if (flg && u) umclear(); /* Repeat... */ while (arg-- && !leave && !ret) ret = execmd(cmd, m->k); if (leave) return ret; if (flg && u) umclear(); if (u) undomark(); } return ret; } int current_arg = 1; int current_arg_set = 0; int exmacro(MACRO *m, int u) { int larg; int negarg = 0; int oid=0, oifl=0, oifa=0; int ret = 0; int main_ret = 0; int o_arg_set = argset; int o_arg = arg; /* Take argument */ if (argset) { larg = arg; arg = 0; argset = 0; } else { larg = 1; } /* Just a simple command? */ if (!m->steps) { return exsimple(m, larg, u); } /* Must be a real macro then... */ if (larg < 0) { larg = -larg; negarg = 1; } if (ifflag) { if (u) umclear(); /* Repeat... */ while (larg && !leave && !ret) { MACRO *tmpmac = curmacro; int tmpptr = macroptr; int x = 0; int stk = nstack; /* Steps of macro... */ while (m && x != m->n && !leave && !ret) { MACRO *d; int tmp_arg; int tmp_set; d = m->steps[x++]; curmacro = m; macroptr = x; tmp_arg = current_arg; tmp_set = current_arg_set; current_arg = o_arg; current_arg_set = o_arg_set; if(d->steps) oid=ifdepth, oifl=ifflag, oifa=iffail, ifdepth=iffail=0; /* If this step wants to know about negative args... */ if ((d->flg&4)) { argset = o_arg_set; arg = o_arg; larg = 1; } else if ((d->flg&1) && negarg) { if (argset) { arg = -arg; } else { argset = 1; arg = -1; } } if (d->flg&8) { larg = 1; } /* This is the key step of the macro... */ if (d->flg&2) main_ret = exmacro(d, 0); else ret = exmacro(d, 0); if(d->steps) ifdepth=oid, ifflag=oifl, iffail=oifa; current_arg = tmp_arg; current_arg_set = tmp_set; m = curmacro; x = macroptr; } curmacro = tmpmac; macroptr = tmpptr; /* Pop ^KB ^KK stack */ while (nstack > stk) upop(NULL); --larg; } ret |= main_ret; if (leave) return ret; if (u) umclear(); if (u) undomark(); } return ret; } #if 0 int exmacro(MACRO *m, int u) { int larg; int negarg = 0; int flg = 0; int oid, oifl, oifa; CMD *cmd; int ret = 0; if (argset) { larg = arg; arg = 0; argset = 0; if (larg < 0) { negarg = 1; larg = -larg; } if (m->steps) 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 (ifflag || (!m->steps && (cmd->flag&EMETA))) { 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; if(d->steps) oid=ifdepth, oifl=ifflag, oifa=iffail, ifdepth=iffail=0; ret = exmacro(d, 0); if(d->steps) ifdepth=oid, ifflag=oifl, iffail=oifa; 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; } #endif /* Execute a macro - for user typing */ /* Records macro in macro recorder, resets if */ int exemac(MACRO *m) { record(m); ifflag=1; ifdepth=iffail=0; 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 = (struct recmac *) joe_malloc(sizeof(struct recmac)); r->m = mkmacro(0, 0, 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, sz(joe_gettext(_("Macro to record (0-9 or ^C to abort): "))), dorecord, NULL, NULL, NULL)) return 0; else return -1; } 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', 0, 0, findcmd(USTR "play"))), rmmacro(m); joe_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(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; } void save_macros(FILE *f) { int x; unsigned char buf[1024]; for(x = 0; x!= 10; ++x) if(kbdmacro[x]) { mtext(buf, kbdmacro[x]); fprintf(f," %d ",x); emit_string(f,buf,zlen(buf)); fprintf(f,"\n"); } fprintf(f,"done\n"); } void load_macros(FILE *f) { unsigned char buf[1024]; unsigned char bf[1024]; while(fgets((char *)buf,1023,f) && zcmp(buf,USTR "done\n")) { unsigned char *p = buf; int n; int len; int sta; parse_ws(&p, '#'); if(!parse_int(&p,&n)) { parse_ws(&p, '#'); len = parse_string(&p,bf,sizeof(bf)); if (len>0) kbdmacro[n] = mparse(NULL,bf,&sta); } } } int uplay(BW *bw, int c) { if (c >= '0' && c <= '9') return doplay(bw, c, NULL, NULL); else if (mkqwna(bw->parent, sz(joe_gettext(_("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 = calc(bw, s); if (merr) { msgnw(bw->parent, merr); return -1; } arg = num; argset = 1; vsrm(s); return 0; } int uarg(BW *bw) { if (wmkpw(bw->parent, joe_gettext(_("No. times to repeat next command (^C to abort): ")), NULL, doarg, NULL, NULL, utypebw, NULL, NULL, locale_map,0)) return 0; else return -1; } static int doif(BW *bw,unsigned char *s,void *object,int *notify) { long num; if(notify) *notify=1; num=calc(bw,s); if(merr) { msgnw(bw->parent,merr); return -1; } ifflag=(num?1:0); iffail=ifdepth; vsrm(s); return 0; } static int ifabrt() { ifdepth--; return 0; } int uif(BW *bw) { ifdepth++; if (!ifflag) return 0; if (wmkpw(bw->parent,joe_gettext(_("If (^C to abort): ")),NULL,doif,NULL,ifabrt,utypebw,NULL,NULL,locale_map,0)) return 0; else return -1; } int uelsif(BW *bw) { if (!ifdepth) { msgnw(bw->parent,joe_gettext(_("Elsif without if"))); return -1; } else if(ifflag) { ifflag=iffail=0; /* don't let the next else/elsif get run */ } else if(ifdepth == iffail) { ifflag=1; /* so the script can type the condition :) */ if(wmkpw(bw->parent,joe_gettext(_("Else if: ")),NULL,doif,NULL,NULL,utypebw,NULL,NULL,locale_map,0)) return 0; else return -1; } return 0; } int uelse(BW *bw) { if (!ifdepth) { msgnw(bw->parent,joe_gettext(_("Else without if"))); return -1; } else if(ifdepth == iffail) { ifflag = !ifflag; } return 0; } int uendif(BW *bw) { if(!ifdepth) { msgnw(bw->parent,joe_gettext(_("Endif without if"))); return -1; } if(iffail==ifdepth) iffail--, ifflag=1; ifdepth--; if(ifdepth==0) ifflag=1; return 0; } 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(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("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, sz(joe_gettext(_("Repeat"))), douarg, NULL, NULL, NULL)) return 0; else return -1; } joe-3.7/macro.h0000644000100100007640000000362710431662534010340 00000000000000/* * Keyboard macros * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_MACRO_H #define _JOE_MACRO_H 1 struct macro { int k; /* Keycode */ int flg; /* Flags: bit 0: this step wants the negative arg, bit 1: ignore return value of this step, but use it as return value of macro */ 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; }; extern struct recmac *recmac; /* Set when macro is recording: for status line */ /* Macro construction functions */ MACRO *mkmacro PARAMS((int k, int arg, int n, CMD *cmd)); void addmacro PARAMS((MACRO *macro, MACRO *m)); MACRO *dupmacro PARAMS((MACRO *mac)); void rmmacro PARAMS((MACRO *macro)); MACRO *macstk PARAMS((MACRO *m, int k)); MACRO *macsta PARAMS((MACRO *m, int a)); void chmac PARAMS((void)); /* Text to macro / Macro to text */ MACRO *mparse PARAMS((MACRO *m, unsigned char *buf, int *sta)); unsigned char *mtext PARAMS((unsigned char *s, MACRO *m)); /* Execute a macro */ extern MACRO *curmacro; /* Current macro being executed */ int exemac PARAMS((MACRO *m)); int exmacro PARAMS((MACRO *m, int u)); /* Keyboard macros user interface */ int uplay PARAMS((BW *bw, int c)); int ustop PARAMS((void)); int urecord PARAMS((BW *bw, int c)); int uquery PARAMS((BW *bw)); int umacros PARAMS((BW *bw)); /* Repeat prefix user command */ int uarg PARAMS((BW *bw)); int uuarg PARAMS((BW *bw, int c)); int uif PARAMS((BW *bw)); int uelsif PARAMS((BW *bw)); int uelse PARAMS((BW *bw)); int uendif PARAMS((BW *bw)); unsigned char *unescape PARAMS((unsigned char *ptr,int c)); void load_macros PARAMS((FILE *f)); void save_macros PARAMS((FILE *f)); extern int current_arg; /* Current macro repeat argument */ extern int current_arg_set; /* Set if repeat arg was given */ #endif joe-3.7/charmaps/0000777000100100007640000000000011103454342010731 500000000000000joe-3.7/charmaps/klingon.in0000644000100100007640000002516510046332521012646 00000000000000 Klingon-ASCII % / % 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 joe-3.7/configure.ac0000644000100100007640000001206111102222304011323 00000000000000# 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.7) 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 *-*-solaris*) CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib" ;; *) ;; esac search_libs="$search_libs m" # Checks for libraries. AC_ARG_ENABLE(curses, [ --disable-curses disable use of curses library], curses=$enableval, curses=yes) if test "$curses" = "yes"; then search_libs="ncurses curses" fi AC_ARG_ENABLE(termcap, [ --disable-termcap disable use of termcap library], termcap=$enableval, termcap=yes) if test "$termcap" = "yes"; then search_libs="$search_libs termcap" fi AC_SEARCH_LIBS(openpty, util, AC_DEFINE_UNQUOTED(HAVE_OPENPTY, 1, [If we have BSD function openpty()])) AC_SEARCH_LIBS(login_tty, util, AC_DEFINE_UNQUOTED(HAVE_LOGIN_TTY, 1, [If we have BSD function login_tty()])) AC_SEARCH_LIBS(tgetflag, $search_libs, AC_DEFINE_UNQUOTED(TERMINFO, 1, [If we have newer terminfo/termcap capabilities])) AC_SEARCH_LIBS(snprintf, snprintf db, AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [If we have snprintf])) # Checks for header files. AC_SYS_LARGEFILE 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 ]) else AC_CHECK_HEADERS([termio.h sys/termio.h]) 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_CHECK_HEADERS([errno.h fcntl.h locale.h sgtty.h stdlib.h string.h]) AC_CHECK_HEADERS([sys/ioctl.h sys/param.h sys/time.h unistd.h utime.h]) AC_CHECK_HEADERS([sys/dirent.h time.h pwd.h paths.h pty.h libutil.h]) AC_CHECK_HEADERS([sys/types.h sys/stat.h sys/wait.h limits.h signal.h]) AC_CHECK_HEADERS([curses.h term.h utmp.h sys/utime.h]) AC_CHECK_HEADERS([selinux/selinux.h selinux/context.h]) if test "$ac_cv_header_selinux_selinux_h" = "yes" -a "$ac_cv_header_selinux_context_h" = "yes" ; then echo "Enabling SELinux context copying!" AC_DEFINE(HAVE_SELINUX, 1, [We have SELinux headers]) fi # Checks for typedefs, structures, and compiler characteristics. AC_C_PROTOTYPES AC_C_CONST 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(long long, 4) AC_CHECK_SIZEOF(void *, 4) 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_LSTAT joe_SETPGRP AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_OFF_T AC_CHECK_SIZEOF(off_t, 4) AC_CHECK_TYPE([ssize_t], [], [ AC_DEFINE([ssize_t], [int], [Define to `int' if does not define.]) ], []) AC_TYPE_SIGNAL AC_FUNC_STAT AC_FUNC_FORK 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([isblank]) if test x"$ac_cv_func_isblank" = xyes; then joe_ISBLANK fi AC_CHECK_FUNCS([alarm mkdir mkstemp putenv setlocale strchr strdup utime setpgid]) AC_CHECK_FUNCS([setitimer sigaction sigvec siginterrupt sigprocmask]) joe_REINSTALL_SIGHANDLERS # check if -liconv is necessary # if iconv() is in libc, don't bother with -liconv #AC_CHECK_LIB(c,iconv, # [REQRD_LIBS= ], # [REQRD_LIBS=-liconv]) # #AC_SUBST(REQRD_LIBS) dnl OK lets try it... dnl AM_GNU_GETTEXT([external]) AH_VERBATIM([_PARAMS],[/* Check to see if we can use strict prototypes */ #ifndef PARAMS # ifdef PROTOTYPES # define PARAMS(protos) protos # else # define PARAMS(protos) () # endif #endif]) # Check for programs.. AC_CHECK_PROG(SPELL,aspell,aspell,ispell) AC_CONFIG_FILES([Makefile rc/Makefile man/Makefile man/ru/Makefile syntax/Makefile po/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/css.jsf syntax/tex.jsf syntax/ocaml.jsf syntax/4gl.jsf syntax/sml.jsf syntax/sql.jsf syntax/awk.jsf syntax/cobol.jsf syntax/sed.jsf syntax/ps.jsf syntax/ada.jsf syntax/troff.jsf syntax/haskell.jsf syntax/rexx.jsf syntax/skill.jsf syntax/lua.jsf syntax/ruby.jsf syntax/m4.jsf syntax/joerc.jsf syntax/spec.jsf syntax/matlab.jsf syntax/jsf.jsf syntax/jsf_check.jsf]) AC_OUTPUT joe-3.7/charmap.c0000644000100100007640000020561311101510604010625 00000000000000/* * UNICODE/ISO-10646 conversion utilities * Copyright * (C) 2004 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" /* Convert from byte code to unicode. Returns -1 for unknown. */ int to_uni(struct charmap *cset, int c) { return cset->to_map[c]; } /* Convert from unicode to byte code. Returns -1 for unknown. */ int from_uni(struct charmap *cset, int c) { int x, y, z; x = 0; y = cset->from_size-1; z = -1; while (z != (x + y) / 2) { z = (x + y) / 2; if (c > cset->from_map[z].first) x = z; else if (c < cset->from_map[z].first) y = z; else return cset->from_map[z].last; } return -1; } /* Builtin maps */ /* Aliases */ static struct { unsigned char *alias; unsigned char *builtin; } alias_table[] = { { USTR "c", USTR "ascii" }, { USTR "posix", USTR "ascii" }, { USTR "8859-1", USTR "iso-8859-1" }, { USTR "8859-2", USTR "iso-8859-2" }, { USTR "8859-3", USTR "iso-8859-3" }, { USTR "8859-4", USTR "iso-8859-4" }, { USTR "8859-5", USTR "iso-8859-5" }, { USTR "8859-6", USTR "iso-8859-6" }, { USTR "8859-7", USTR "iso-8859-7" }, { USTR "8859-8", USTR "iso-8859-8" }, { USTR "8859-9", USTR "iso-8859-9" }, { USTR "8859-10", USTR "iso-8859-10" }, { USTR "8859-11", USTR "iso-8859-11" }, { USTR "8859-13", USTR "iso-8859-13" }, { USTR "8859-14", USTR "iso-8859-14" }, { USTR "8859-15", USTR "iso-8859-15" }, { USTR "8859-16", USTR "iso-8859-16" }, { USTR "ansi", USTR "iso-8859-1" }, { USTR "latin1", USTR "iso-8859-1" }, { USTR "latin2", USTR "iso-8859-2" }, { USTR "latin3", USTR "iso-8859-3" }, { USTR "latin4", USTR "iso-8859-4" }, { USTR "cyrillic", USTR "iso-8859-5" }, { USTR "arabic", USTR "iso-8859-6" }, { USTR "greek", USTR "iso-8859-7" }, { USTR "hebrew", USTR "iso-8859-8" }, /* cp1255 on windows machines? */ { USTR "latin5", USTR "iso-8859-9" }, { USTR "turkish", USTR "iso-8859-9" }, { USTR "latin6", USTR "iso-8859-10" }, { USTR "nordic", USTR "iso-8859-10" }, { USTR "thai", USTR "iso-8859-11" }, { USTR "latin7", USTR "iso-8859-13" }, { USTR "latin8", USTR "iso-8859-14" }, { USTR "latin9", USTR "iso-8859-15" }, { 0, 0 } }; /* I took all the ISO-8859- ones, plus any ones referenced by a locale */ struct builtin_charmap { unsigned char *name; int to_uni[256]; }; static struct builtin_charmap builtin_charmaps[]= { { USTR "ascii", { 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 } }, { USTR "iso-8859-1", { 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 } }, { USTR "iso-8859-2", { 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 } }, { USTR "iso-8859-3", { 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 } }, { USTR "iso-8859-4", { 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 } }, { USTR "iso-8859-5", { 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 } }, { USTR "iso-8859-6", { 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 } }, { USTR "iso-8859-7", { 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 } }, { USTR "iso-8859-8", { 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 } }, { USTR "iso-8859-9", { 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 } }, { USTR "iso-8859-10", { 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 } }, { USTR "iso-8859-11", { 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 } }, { USTR "iso-8859-13", { 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 } }, { USTR "iso-8859-14", { 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 } }, { USTR "iso-8859-15", { 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 } }, { USTR "iso-8859-16", { 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 } }, { USTR "koi-8", { 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 } }, { USTR "koi8-r", { 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 } }, { USTR "koi8-t", { 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 } }, { USTR "koi8-u", { 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 } }, { USTR "cp1251", { 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 } }, { USTR "cp1256", { 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 } }, { USTR "cp1255", { 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 } }, { USTR "armscii-8", { 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 } }, { USTR "tis-620", { 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 } }, { USTR "georgian-ps", { 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->firstfirst) return -1; else return 0; } /* Predicate and conversion functions for byte-oriented charmaps */ int byte_ispunct(struct charmap *map,int c) { int ofst = (c>>3); int bitn = (1<<(c&7)); if (c<0 || c>255) return 0; return (map->print_map[ofst]&bitn) != 0 && (map->alnum__map[ofst]&bitn) == 0; } int byte_isprint(struct charmap *map,int c) { int ofst = (c>>3); int bitn = (1<<(c&7)); if (c<0 || c>255) return 0; return (map->print_map[ofst]&bitn) != 0; } int byte_isspace(struct charmap *map,int c) { return c==32 || (c >= 9 && c <= 13); } int byte_isalpha_(struct charmap *map,int c) { int ofst = (c>>3); int bitn = (1<<(c&7)); if (c<0 || c>255) return 0; return (map->alpha__map[ofst]&bitn) != 0; } int byte_isalnum_(struct charmap *map,int c) { int ofst = (c>>3); int bitn = (1<<(c&7)); if (c<0 || c>255) return 0; return (map->alnum__map[ofst]&bitn) != 0; } int byte_tolower(struct charmap *map,int c) { if (c<0 || c>255) return c; else return map->lower_map[c]; } int byte_toupper(struct charmap *map,int c) { if (c<0 || c>255) return c; else return map->upper_map[c]; } /* Load built-in character maps */ static void set_bit(unsigned char *map,int n) { map[n>>3] |= (1<<(n&7)); } static int rtn_arg(struct charmap *map,int c) { return c; } static struct charmap *charmaps = NULL; /* Loaded character sets */ /* Process a byte-oriented character map and add it to database. Consults unicode database "i18n.c" to determine which characters are uppercase, etc. */ static struct charmap *process_builtin(struct builtin_charmap *builtin) { int x; struct charmap *map; map = joe_malloc(sizeof(struct charmap)); map->name = zdup(builtin->name); map->type = 0; map->is_punct = byte_ispunct; map->is_print = byte_isprint; map->is_space = byte_isspace; map->is_alpha_ = byte_isalpha_; map->is_alnum_ = byte_isalnum_; map->to_lower = byte_tolower; map->to_upper = byte_toupper; map->to_uni = to_uni; map->from_uni = from_uni; map->from_size = 0; map->to_map = builtin->to_uni; for (x=0; x!=256; ++x) { if (map->to_map[x]!=-1) { map->from_map[map->from_size].first = map->to_map[x]; map->from_map[map->from_size].last = x; ++map->from_size; } } qsort(map->from_map,map->from_size,sizeof(struct pair), (int (*)(const void *, const void *))pair_cmp); /* Fill in print, alpha and alnum bit maps */ for (x=0;x!=32;++x) { map->print_map[x] = 0; map->alpha__map[x] = 0; map->alnum__map[x] = 0; } for (x=0; x!=256; ++x) if (map->to_map[x] != -1) { if (joe_iswprint(NULL,map->to_map[x])) set_bit(map->print_map,x); if (joe_iswalpha(NULL,map->to_map[x])) { set_bit(map->alpha__map,x); set_bit(map->alnum__map,x); } } /* Set underbar */ x = from_uni(map,0x5F); if (x != -1) { set_bit(map->alpha__map,x); set_bit(map->alnum__map,x); } /* Put digits in alnum map */ for (x=0x30; x!=0x3A; ++x) { int y = from_uni(map,x); if (y != -1) set_bit(map->alnum__map,y); } /* Build case conversion tables */ for (x=0; x!=256; ++x) { map->lower_map[x] = x; if (map->to_map[x] != -1) { int y = joe_towlower(NULL,map->to_map[x]); int z = from_uni(map,y); if (z != -1) map->lower_map[x] = z; } } for (x=0; x!=256; ++x) { map->upper_map[x] = x; if (map->to_map[x] != -1) { int y = joe_towupper(NULL,map->to_map[x]); int z = from_uni(map,y); if (z != -1) map->upper_map[x] = z; } } map->next = charmaps; charmaps = map; return map; } static void load_builtins(void) { struct charmap *map; /* install UTF-8 map (ties into i18n module) */ map = joe_malloc(sizeof(struct charmap)); map->name = USTR "utf-8"; map->type = 1; map->to_uni = rtn_arg; map->from_uni = rtn_arg; map->is_punct = joe_iswpunct; map->is_print = joe_iswprint; map->is_space = joe_iswspace; map->is_alpha_ = joe_iswalpha_; map->is_alnum_ = joe_iswalnum_; map->to_lower = joe_towlower; map->to_upper = joe_towupper; map->next = charmaps; charmaps = map; /* Load all built-in byte maps */ /* for (y=0; y!=sizeof(builtin_charmaps)/sizeof(struct builtin_charmap); ++y) process_builtin(builtin_charmaps + y); */ } /* Parse character map file */ struct builtin_charmap *parse_charmap(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 0; b = joe_malloc(sizeof(struct builtin_charmap)); b->name = zdup(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 (!zcmp(bf1,USTR "")) { parse_ws(&p, comment_char); parse_tows(&p, bf1); comment_char = bf1[0]; } else if (!zcmp(bf1,USTR "")) { parse_ws(&p, comment_char); parse_tows(&p, bf1); } else if (!zcmp(bf1,USTR "CHARMAP")) { in_map = 1; } else if (!zcmp(bf1,USTR "END")) { in_map = 0; } else if (in_map && bf1[0]=='<' && bf1[1]=='U') { int uni; int byt; sscanf((char *)bf1+2,"%x",(unsigned *)&uni); parse_ws(&p, comment_char); parse_tows(&p, bf1); sscanf((char *)bf1+2,"%x",(unsigned *)&byt); b->to_uni[byt]=uni; } } /* For generating builtin maps from /usr/share/i18n/charmaps/ * */ /* printf(" { \"%s\"\n",name); for (y=0;y!=256;y+=8) { printf("\t"); for(x=0;x!=8;++x) { if (b->to_uni[y+x]==-1) printf(" -1, "); else printf("0x%4.4x, ",b->to_uni[y+x]); } printf("\n"); } */ fclose(f); return b; } /* Byte wide character map to unicode conversion */ /* Compare character map names. Ignores '-'s and terminates string on '.' */ /* Chicken and egg problem here.. */ static int map_up(int c) { if (c>='a' && c<='z') return c+'A'-'a'; else return c; } int map_name_cmp(unsigned char *a,unsigned char *b) { while (*a=='-') ++a; while (*b=='-') ++b; while (*a && *b && map_up(*a)==map_up(*b)) { ++a; ++b; while (*a=='-') ++a; while (*b=='-') ++b; } if (!*a && (*b=='.' || !*b)) return 0; else return 1; } /* Find a character map */ struct charmap *find_charmap(unsigned char *name) { unsigned char buf[1024]; unsigned char *p; struct charmap *m; struct builtin_charmap *b; FILE *f; 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->next) if (!map_name_cmp(m->name,name)) return m; /* Check ~/.joe/charmaps */ p = (unsigned char *)getenv("HOME"); f = 0; if (p) { joe_snprintf_2(buf,sizeof(buf),"%s/.joe/charmaps/%s",p,name); f = fopen((char *)buf,"r"); } /* Check JOERCcharmaps */ if (!f) { joe_snprintf_2(buf,sizeof(buf),"%scharmaps/%s",JOEDATA,name); f = fopen((char *)buf,"r"); } /* Parse and install character map from file */ if (f && (b = parse_charmap(name,f))) return process_builtin(b); /* Check builtin sets */ for (y=0; y!=sizeof(builtin_charmaps)/sizeof(struct builtin_charmap); ++y) if (!map_name_cmp(builtin_charmaps[y].name,name)) return process_builtin(builtin_charmaps + y); return NULL; } /* Test */ #if 0 main(int argc,char *argv[]) { struct charmap *map=find_charmap(argv[1]); int u; int uni; if (!map) printf("Not found\n"); sscanf(argv[2],"%x",&u); printf("Unicode=%x\n",uni=to_uni(map,u)); printf("Local=%x\n",from_uni(map,uni)); } #endif /* Get names of available encodings (for tab completion of ^T E prompt) */ unsigned char **get_encodings() { 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("utf-8")); encodings = vaadd(encodings, r); for (y=0; y!=sizeof(builtin_charmaps)/sizeof(struct builtin_charmap); ++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 */ p = (unsigned char *)getenv("HOME"); if (p) { joe_snprintf_1(buf,sizeof(buf),"%s/.joe/charmaps",p); if (!chpwd(buf) && (t = rexpnd(USTR "*"))) { for (x = 0; x != aLEN(t); ++x) if (zcmp(t[x],USTR "..")) { for (y = 0; y != aLEN(encodings); ++y) if (!zcmp(t[x],encodings[y])) break; if (y == aLEN(encodings)) { r = vsncpy(NULL,0,sv(t[x])); encodings = vaadd(encodings,r); } } varm(t); } } if (!chpwd(USTR (JOEDATA "charmaps")) && (t = rexpnd(USTR "*"))) { for (x = 0; x != aLEN(t); ++x) if (zcmp(t[x],USTR "..")) { for (y = 0; y != aLEN(encodings); ++y) if (!zcmp(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; } #if 0 /* Convert to uppercase via unicode. Returns original character if there was no conversion. */ int joe_toupper(struct charmap *map,int c) { int d; /* This appears to always be true */ if (c>='a' && c<='z') return c+'A'-'a'; else if (c<128) return c; /* Slow... */ d = to_uni(map,c); if (d== -1) return c; d = joe_towupper(d); if (d== -1) return c; d = from_uni(map,d); if (d== -1) return c; else return d; } /* Convert to uppercase via unicode. Returns original character if there was no conversion. */ int joe_tolower(struct charmap *map,int c) { int d; /* This appears to always be true */ if (c>='A' && c<='Z') return c+'a'-'A'; else if (c<128) return c; /* Slow... */ d = to_uni(map,c); if (d== -1) return c; d = joe_towlower(d); if (d== -1) return c; d = from_uni(map,d); if (d== -1) return c; else return d; } #endif /* This is not correct... (EBCDIC for example) */ int joe_isblank(struct charmap *map,int c) { return c==32 || c==9; } int joe_isspace_eof(struct charmap *map,int c) { return (c==0) || joe_isspace(map,c); } unsigned char *lowerize(unsigned char *s) { unsigned char *t; for (t=s;*t;t++) *t = joe_tolower(locale_map,*t); return s; } joe-3.7/charmap.h0000644000100100007640000000465310431662534010652 00000000000000/* * Character sets * Copyright * (C) 2004 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _Icharmap #define _Icharmap 1 /* For sorted from_map entries */ struct pair { int first; /* Unicode */ int last; /* Byte */ }; /* A character set */ struct charmap { struct charmap *next; /* Linked list of loaded character maps */ unsigned char *name; /* Name of this one */ int type; /* 0=byte, 1=UTF-8 */ /* Character predicate functions */ int (*is_punct)(struct charmap *map,int c); int (*is_print)(struct charmap *map,int c); int (*is_space)(struct charmap *map,int c); int (*is_alpha_)(struct charmap *map,int c); int (*is_alnum_)(struct charmap *map,int c); /* Character conversion functions */ int (*to_lower)(struct charmap *map,int c); int (*to_upper)(struct charmap *map,int c); int (*to_uni)(struct charmap *map,int c); int (*from_uni)(struct charmap *map,int c); /* Information for byte-oriented character sets */ int *to_map; /* Convert byte to unicode */ unsigned char lower_map[256]; /* Convert to lower case */ unsigned char upper_map[256]; struct pair from_map[256]; /* Convert from unicode to byte */ int from_size; /* No. paris in from_map */ unsigned char print_map[32]; /* Bit map of printable characters */ unsigned char alpha__map[32]; /* Bit map of alphabetic characters and _ */ unsigned char alnum__map[32]; /* Bit map of alphanumeric characters and _ */ }; /* Predicates */ #define joe_ispunct(map,c) ((map)->is_punct((map),(c))) #define joe_isprint(map,c) ((map)->is_print((map),(c))) #define joe_isspace(map,c) ((map)->is_space((map),(c))) #define joe_isalpha_(map,c) ((map)->is_alpha_((map),(c))) #define joe_isalnum_(map,c) ((map)->is_alnum_((map),(c))) int joe_isblank PARAMS((struct charmap *map,int c)); int joe_isspace_eof PARAMS((struct charmap *map,int c)); /* Conversion functions */ #define joe_tolower(map,c) ((map)->to_lower((map),(c))) #define joe_toupper(map,c) ((map)->to_upper((map),(c))) #define joe_to_uni(map,c) ((map)->to_uni((map),(c))) #define joe_from_uni(map,c) ((map)->from_uni((map),(c))) unsigned char *lowerize PARAMS((unsigned char *s)); /* Find (load if necessary) a character set */ struct charmap *find_charmap PARAMS((unsigned char *name)); /* Get available encodings */ unsigned char **get_encodings PARAMS((void)); int from_uni PARAMS((struct charmap *cset, int c)); int to_uni PARAMS((struct charmap *cset, int c)); #endif joe-3.7/config.guess0000755000100100007640000012513210430772560011402 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-02-10' # 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted 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. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. 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 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 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # 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 -q "$TMPDIR/cgXXXXXX") 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 ;' # 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 tupples: *-*-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 ;; *) 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 __ELF__ >/dev/null 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 0 ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; luna88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; 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'` exit 0 ;; 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 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; 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 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; 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 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; 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 0 ;; 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 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; 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 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # 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 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; 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 \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; 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 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????: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 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; 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 0 ;; *: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 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 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 0 ;; *:AIX:*:[45]) 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 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 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 # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 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 && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; 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 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; 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 0 ;; 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 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; 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 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; amd64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *: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 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit 0 ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #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 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #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 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; 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 ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; 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 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; 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 0 ;; 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 0 ;; 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 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; 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 0 ;; i*86:*:5:[78]*) 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 0 ;; 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 0 ;; 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 i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; 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 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 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 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *: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 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; 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 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *: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 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *: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 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms && exit 0 ;; I*) echo ia64-dec-vms && exit 0 ;; V*) echo vax-dec-vms && exit 0 ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 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"); 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 && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # 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 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; 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: joe-3.7/install-sh0000755000100100007640000002202110430772560011057 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2005-02-02.21 # 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. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= 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: -c (ignored) -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. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; 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 for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi 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 "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $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 "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 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. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); 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: joe-3.7/config.sub0000755000100100007640000007540710430772560011056 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-02-10' # 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, 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. # Please send patches to . Submit a context # diff and a properly formatted 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. # 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 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 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # 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 0;; * ) 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-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) 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) os= basic_machine=$1 ;; -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 ;; -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/'` ;; -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*) 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 \ | 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[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # 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-* \ | 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-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # 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 ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; 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 ;; cr16c) basic_machine=cr16c-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 ;; 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'm not sure what "Sysv32" means. Should this be sysv3.2? 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 ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; 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 ;; mvs) basic_machine=i370-ibm os=-mvs ;; 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 ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; 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 ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; 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) basic_machine=powerpc-unknown ;; ppc-*) 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 ;; 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 ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; 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 ;; 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 ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; 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 ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-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 ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) 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. -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* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -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* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -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*) # 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* \ | -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 ;; -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 *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) 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 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; 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 ;; *-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 ;; -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 ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: joe-3.7/ublock.c0000644000100100007640000006377311103454321010507 00000000000000/* * Highlighted block functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" #ifdef HAVE_SYS_WAIT_H #include #endif int nowmarking; /* Global options */ int square = 0; /* Set for rectangle mode */ int lightoff = 0; /* Set if highlighting should turn off after block operations */ /* 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} }; MARKSAV markfree = { {&markfree, &markfree} }; 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, USTR "upsh"); if (markb) pdupown(markb, &m->markb, USTR "upsh"); 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 && (r == 2 ? markk->byte >= markb->byte : markk->byte > markb->byte) && (!square || (r == 2 ? markk->xcol >= markb->xcol : 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, USTR "markv"); prm(markb); markb=0; pdupown(markk, &markb, USTR "markv"); prm(markk); markk=0; pdupown(p, &markk, USTR "markv"); 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, USTR "pextrect"); /* Left part of text to extract */ P *q = pdup(p, USTR "pextrect"); /* After right part of text to extract */ B *tmp = bmk(NULL); /* Buffer to extract to */ P *z = pdup(tmp->eof, USTR "pextrect"); /* 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, USTR "pdelrect"); P *q = pdup(p, USTR "pdelrect"); 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, USTR "pclrrect"); P *q = pdup(p, USTR "pclrrect"); 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, USTR "ptabrect"); 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, USTR "pinsrect"); /* We insert at & move this pointer */ P *q = pdup(tmp->bof, USTR "pinsrect"); /* These are for scanning through 'tmp' */ P *r = pdup(q, USTR "pinsrect"); /* 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, USTR "umarkb"); 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 (nowmarking) { /* 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; nowmarking = 1; return 0; } else if(bw->cursor->byte==markk->byte) { prm(markk); markk=0; nowmarking = 1; return 0; } } /* Start marking - no message */ prm(markb); markb=0; prm(markk); markk=0; updall(); nowmarking = 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(); nowmarking = 0; msgnw(bw->parent, joe_gettext(_("Selection cleared."))); return 0; } else if (markk) { /* Clear selection and start new one */ prm(markb); markb=0; prm(markk); markk=0; updall(); nowmarking = 1; msgnw(bw->parent, joe_gettext(_("Selection started."))); return umarkb(bw); } else if (markb && markb->b==bw->cursor->b) { nowmarking = 0; if (bw->cursor->bytebyte) { pdupown(markb, &markk, USTR "utoggle_marking"); prm(markb); markb=0; pdupown(bw->cursor, &markb, USTR "utoggle_marking"); markb->xcol = bw->cursor->xcol; } else { pdupown(bw->cursor, &markk, USTR "utoggle_marking"); markk->xcol = bw->cursor->xcol; } updall(); /* Because other windows could be changed */ return 0; } else { nowmarking = 1; msgnw(bw->parent, joe_gettext(_("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, USTR "umarkk"); markk->xcol = bw->cursor->xcol; updall(); return 0; } /* Unset marks */ int unmark(BW *bw) { prm(markb); prm(markk); nowmarking = 0; 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, USTR "uswap"); 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, joe_gettext(_("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!=bw->b && !modify_logic(bw,markb->b)) 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, joe_gettext(_("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, USTR "ublkcpy"); 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, joe_gettext(_("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) { if (notify) *notify = 1; if (markv(1)) { if (square) { int fl; int ret = 0; B *tmp = pextrect(markb, markk->line - markb->line + 1, markk->xcol); if ((fl = bsave(tmp->bof, s, tmp->eof->byte, 0)) != 0) { msgnw(bw->parent, joe_gettext(msgs[-fl])); ret = -1; } brm(tmp); if (lightoff) unmark(bw); vsrm(s); return ret; } else { int fl; int ret = 0; if ((fl = bsave(markb, s, markk->byte - markb->byte, 0)) != 0) { msgnw(bw->parent, joe_gettext(msgs[-fl])); ret = -1; } if (lightoff) unmark(bw); vsrm(s); return ret; } } else { vsrm(s); msgnw(bw->parent, USTR _(_("No block"))); return -1; } }*/ /* 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, USTR "setindent"); q = pdup(p, USTR "setindent"); 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 */ int purity_check(int c, int n) { P *p = pdup(markb, USTR "purity_check"); 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 */ int lindent_check(int c, int n) { P *p = pdup(markb, USTR "lindent_check"); 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, USTR "urindent"); 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, USTR "urindent"); P *q = pdup(markb, USTR "urindent"); 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, USTR "urindent"); 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,joe_gettext(_("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, USTR "ulindent"); P *q = pdup(p, USTR "ulindent"); 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, USTR "ulindent"); P *q = pdup(markb, USTR "ulindent"); 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, USTR "ulindent"); P *q = pdup(p, USTR "ulindent"); 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,joe_gettext(_("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(2)) { 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 (berror) { msgnw(bw->parent, joe_gettext(msgs[-berror])); brm(tmp); 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, USTR "doinsf"); 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(); return 0; } else { msgnw(bw->parent, joe_gettext(_("No block"))); return -1; } else { int ret = 0; B *tmp = bload(s); if (berror) { msgnw(bw->parent, joe_gettext(msgs[-berror])), brm(tmp); ret = -1; } else binsb(bw->cursor, tmp); vsrm(s); bw->cursor->xcol = piscol(bw->cursor); return ret; } } /* Filter highlighted block through a UNIX command */ static int filtflg = 0; static int dofilt(BW *bw, unsigned char *s, void *object, int *notify) { int fr[2]; int fw[2]; int flg = 0; 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)) { msgnw(bw->parent, joe_gettext(_("No block"))); return -1; } ok: pipe(fr); pipe(fw); npartial(bw->parent->t->t); ttclsn(); #ifdef HAVE_FORK if (!fork()) { #else if (!vfork()) { /* For AMIGA only */ #endif #ifdef HAVE_PUTENV unsigned char *fname, *name; unsigned len; #endif signrm(); close(0); close(1); close(2); dup(fw[0]); dup(fr[1]); dup(fr[1]); close(fw[0]); close(fr[1]); close(fw[1]); close(fr[0]); #ifdef HAVE_PUTENV fname = vsncpy(NULL, 0, sc("JOE_FILENAME=")); name = bw->b->name ? bw->b->name : (unsigned char *)"Unnamed"; if((len = slen(name)) >= 512) /* limit filename length */ len = 512; fname = vsncpy(sv(fname), name, len); putenv((char *)fname); vsrm(fname); #endif execl("/bin/sh", "/bin/sh", "-c", s, NULL); _exit(0); } close(fr[1]); close(fw[0]); #ifdef HAVE_FORK if (fork()) { #else if (vfork()) { /* For AMIGA only */ #endif close(fw[1]); 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], MAXLONG); 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, USTR "dofilt"); 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, USTR "dofilt"); if (!flg) prgetc(p); bdel(markb, p); binsb(p, bread(fr[0], MAXLONG)); if (!flg) { pset(p,markk); prgetc(p); bdel(p,markk); } prm(p); if (lightoff) unmark(bw); } close(fr[0]); wait(NULL); wait(NULL); } else { if (square) { B *tmp = pextrect(markb, markk->line - markb->line + 1, markk->xcol); bsavefd(tmp->bof, fw[1], tmp->eof->byte); } else bsavefd(markb, fw[1], markk->byte - markb->byte); close(fw[1]); _exit(0); } 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, USTR "markall"); markb->xcol = 0; pdupown(bw->cursor->b->eof, &markk, USTR "markall"); 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) { #ifdef __MSDOS__ msgnw(bw->parent, joe_gettext(_("Sorry, no sub-processes in DOS (yet)"))); return -1; #else switch (checkmark(bw)) { case 0: if (wmkpw(bw->parent, joe_gettext(_("Command to filter block through (^C to abort): ")), &filthist, dofilt, NULL, NULL, utypebw, NULL, NULL, locale_map, 1)) return 0; else return -1; case 1: if (wmkpw(bw->parent, joe_gettext(_("Command to filter file through (^C to abort): ")), &filthist, dofilt, NULL, NULL, utypebw, NULL, NULL, locale_map, 1)) return 0; else return -1; case 2: default: msgnw(bw->parent, joe_gettext(_("No block"))); return -1; } #endif } /* 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, USTR "ulower"); prgetc(q); bdel(markb,q); b->o.charmap = markb->b->o.charmap; p=pdup(b->bof, USTR "ulower"); 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, USTR "uupper"); prgetc(q); bdel(markb,q); b->o.charmap = markb->b->o.charmap; p=pdup(b->bof, USTR "uupper"); 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; } /* Get sum, sum of squares, and return count of * a block of numbers. * * avg = sum/count * * stddev = sqrt( (a-avg)^2 + (b-avg)^2 + (c-avg)^2 ) * = sqrt( a^2-2*a*avg+avg^2 + b^2-2*b*avg+avg^2 + c^2-2*c*avg+avg^2 ) * = sqrt( a^2+b^2+c^2 + 3*avg^2 - 2*avg*(a+b+c) ) * = sqrt( sumsq + count*avg^2 - 2*avg*sum ) * */ int blksum(double *sum, double *sumsq) { unsigned char buf[80]; if (markv(1)) { P *q = pdup(markb, USTR "blksum"); int x; int c; double accu = 0.0; double accusq = 0.0; double v; int count = 0; long left = markb->xcol; long right = markk->xcol; while (q->byte < markk->byte) { /* Skip until we're within columns */ while (q->byte < markk->byte && square && (piscol(q) < left || piscol(q) >= right)) pgetc(q); /* Skip to first number */ while (q->byte < markk->byte && (!square || (piscol(q) >= left && piscol(q) < right))) { c=pgetc(q); if ((c >= '0' && c <= '9') || c == '.' || c == '-') { /* Copy number into buffer */ buf[0]=c; x=1; while (q->byte < markk->byte && (!square || (piscol(q) >= left && piscol(q) < right))) { c=pgetc(q); if ((c >= '0' && c <= '9') || c == 'e' || c == 'E' || c == 'p' || c == 'P' || c == 'x' || c == 'X' || c == '.' || c == '-' || c == '+' || (c >= 'a' && c <= 'f') || (c >= 'A' && c<='F')) { if(x != 79) buf[x++]=c; } else break; } /* Convert number to floating point, add it to total */ buf[x] = 0; v = strtod((char *)buf,NULL); ++count; accu += v; accusq += v*v; break; } } } prm(q); *sum = accu; *sumsq = accusq; return count; } else return -1; } /* Get a (possibly square) block into a buffer */ unsigned char *blkget() { if (markv(1)) { P *q; unsigned char *buf=joe_malloc(markk->byte-markb->byte+1); unsigned char *s=buf; long left = markb->xcol; long right = markk->xcol; q = pdup(markb, USTR "blkget"); while (q->byte < markk->byte) { /* Skip until we're within columns */ while (q->byte < markk->byte && square && (piscol(q) < left || piscol(q) >= right)) pgetc(q); /* Copy text into buffer */ while (q->byte < markk->byte && (!square || (piscol(q) >= left && piscol(q) < right))) { *s++ = pgetc(q); } /* Add a new line if we went past right edge of column */ if (square && q->bytebyte && piscol(q) >= right) *s++ = '\n'; } prm(q); *s = 0; return buf; } else return 0; } joe-3.7/ublock.h0000644000100100007640000000360010431662534010505 00000000000000/* * Highlighted block functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_UBLOCK_H #define _JOE_UBLOCK_H 1 extern int square; /* Column / rectangular block mode */ extern int lightoff; /* Automatic turn off highlighting */ extern P *markb, *markk; /* ^KB and ^KK positions */ void pinsrect PARAMS((P *cur, B *tmp, long int width, int usetabs)); int ptabrect PARAMS((P *org, long int height, long int right)); void pclrrect PARAMS((P *org, long int height, long int right, int usetabs)); void pdelrect PARAMS((P *org, long int height, long int right)); B *pextrect PARAMS((P *org, long int height, long int right)); int markv PARAMS((int r)); int umarkb PARAMS((BW *bw)); int umarkk PARAMS((BW *bw)); int uswap PARAMS((BW *bw)); int umarkl PARAMS((BW *bw)); int utomarkb PARAMS((BW *bw)); int utomarkk PARAMS((BW *bw)); int utomarkbk PARAMS((BW *bw)); int ublkdel PARAMS((BW *bw)); int upicokill PARAMS((BW *bw)); int ublkmove PARAMS((BW *bw)); int ublkcpy PARAMS((BW *bw)); int dowrite PARAMS((BW *bw, unsigned char *s, void *object, int *notify)); int doinsf PARAMS((BW *bw, unsigned char *s, void *object, int *notify)); void setindent PARAMS((BW *bw)); int urindent PARAMS((BW *bw)); int ulindent PARAMS((BW *bw)); int ufilt PARAMS((BW *bw)); int unmark PARAMS((BW *bw)); int udrop PARAMS((BW *bw)); int utoggle_marking PARAMS((BW *bw)); int ubegin_marking PARAMS((BW *bw)); int uselect PARAMS((BW *bw)); int upsh PARAMS((BW *bw)); int upop PARAMS((BW *bw)); int ulower PARAMS((BW *bw)); int uupper PARAMS((BW *bw)); extern int nstack; /* No. block markers pushed on stack */ int blksum PARAMS((double *,double *)); unsigned char *blkget(); extern int autoswap; /* Automatically swap markb and markk if need to make a valid block */ extern int nowmarking; /* Now marking flag (so make block bigger) for Ctrl-arrow key block selection */ #endif joe-3.7/missing0000755000100100007640000002517010430772560010462 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2005-02-08.22 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, 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=: # 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' 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 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` 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 [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -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 [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -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 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -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 's/.*-o \([^ ]*\).*/\1/p'` 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 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: joe-3.7/HACKING0000644000100100007640000003064710431662533010056 00000000000000SQA: Some of this is a little pedantic these days. The need for accessing old versions of UNIX is less now that Linux and BSD exist on PCs. Unsigned char: Use 'unsigned char', never 'char'. This is a big pain, but it prevents char to int when you meant unsigned char to int conversion bugs. gcc: Please run gcc -Wall. Make especially sure that there are no functions used before defined warnings. These are OK on 32-bit systems, but break on 64-bit systems where sizeof(int) doesn't equal sizeof(void *). Buffer and file offsets: Use 'long'.  We should really be using 'unsigned long'. Valgrind: Please do some checking with 'valgrind'. This tool finds accesses to uninitialized memory. It also finds memory leaks. debug_joe: Please hit ESC x debug_joe a few times. Make sure there are no P leaks (forgot to call prm()). It would be nice: If vs type was different from z-string type. Dangerous situations: assume maint->curwin->object is a BW * call interactive functions (like doedit) and expect them to leave maint a buffer window (it could start a prompt). should check plain file checking. vs, zstring, cstring, there are too many, each with its own memory management. These should be relaxed. Nobody uses ancient C compilers any more: Include files: You can rely on: stdio.h, string.h, errno.h and math.h Everything else needs #ifdefs and a check in the configure script. Really old systems did not have stdlib.h or unistd.h. Non UNIX systems don't necessarily have fcntl.h or sys/stat.h. #if: Use #ifdef, not #if. Old systems did not have #if. For example, use #ifdef junk instead of #if 0. PARAMS(): This should help porting JOE to really old systems (except that the configure script probably wont work). However, declarations allow the compiler to automatically insert casts. This can't happen if they are not there. This has different consequences, depending on the word size: 32-bit systems: functions should not define float args, only double. should not rely on prototypes for double to long conversions. Systems where int is not the same as long (16-bit systems) will have lots of trouble without declarations. ------------ Edit Buffers ------------ API: Look at the comments in b.h for more information. B *bfind(unsigned char *name); Load disk file into memory buffer 'B'. bsave(P *p,unsigned char *name,int size); Write size bytes from buffer beginning at p to disk file brm(b); Free data structure Once you have a B you can access the characters in it via P pointers (which are like C++ STL iterators). B *b = bfind("foo"); Load file into memory P *p = pdup(b->bof); Get pointer to beginning of file (duplicate b->bof which is a P). prm(p); Free p when we're done with it. int c=brch(p); Get character at p. int c=pgetc(p); Get character at p and advance it. int c=prgetc(p); Retract p, then return character at it. - These return -1 (NO_MORE_DATA) if you try to read end of file or before beginning of file. - A pointer can point to any character of the file and right after the end of the file. - For UTF-8 files, character can be between 0 and 0x7FFFFFFF Publicly readable members of P: p->byte The byte offset into the buffer p->line The line number p->xcol If P is the cursor, this is the column number where the cursor will be displayed on the screen (which does not have to match the column of the character at P). Some predicates: pisbof(p); True if pointer is at beginning of buffer piseof(p); True if pointer is at end of buffer pisbol(p); True if pointer is at beginning of line piseol(p); True if pointer is at end of line pisbow(p); True if pointer is at beginning of a word piseow(p); True if pointer is at end of a word More information about character at p: piscol(p); Get column number of character at p. Some other ways of moving a P through a B: pnextl(p); Go to beginning of next line pprevl(p); Go to end of previous line pfwrd(p,int n); Move forward n characters pbkwd(p,int n); Move backward n characters p_goto_bof(p); p_goto_eof(p); p_goto_bol(p); p_goto_eol(p); pset(p,q); Move p to same position as q. pline(p,n); Goto to beginning of a specific line. pgoto(p,n); Goto a specific byte position. pfind(P,unsigned char *s,int len); Fast Boyer-Moore search forward. prfind(P,unsigned char *s,int len); Fast Boyer-Moore search backward. These are very fast- they look at low level data structure and don't go through pgetc(). Boyer-Moore allows you to skip over many characters without reading them, so you can get something like O(n/len). Some facts: Local operations are fast: pgetc(), prgetc(). Copy is fast: pset(). pline() and pgoto() are slower, but look for the closest existing P to start from. The column number is stored in P, but it is only updated if it is easy to do so. If it's hard (like you crossed a line boundary backward) it's marked as invalid. piscol() then has to recalculate it. Modifying a buffer: binsc(p,int c); Insert character at p. bdel(P *from,P *to); Delete character between two Ps. Note that when you insert or delete, all of the Ps after the insertion/ deletion point are adjusted so that they continue to point to the same characeter before the insert or delete. Insert and Delete create undo records. Insert and Delete set dirty flags on lines which are currently being displayed on the screen, so that when you return to the edit loop, these lines automatically get redrawn. Internal: An edit buffer is made up of a doubly-linked list of fixed sized (4 KB) gap buffers. A gap buffer has two parts: a ~16 byte header, which is always in memory, and the actual buffer, which can be paged out to a swap file (a vfile- see vfile.h). A gap buffer consists of three regions: text before the gap, the gap and text after the gap (which always goes all the way to the end of buffer). (hole and ehole in the header indicate the gap position). The size of the gap may be 0 (which is the case when a file is first loaded). Gap buffers are fast for small inserts and deletes when the cursor is at the gap (for delete you just adjust a pointer, for insert you copy the data into gap). When you reposition the cursor, you have to move the gap before any inserts or deletes occur. If you had only one window and a single large gap buffer for the file, you could always keep the gap at the cursor- the right-arrow key copies one character across the gap. Of course for edits which span gap buffers or which are larger than a gap buffer, you get a big mess of gap buffer splitting and merging plus doubly-linked list splicing. Still, this buffer method is quite fast: you never have to do large memory moves since the gap buffers are limited in size. To help search for line numbers, the number of newlines '\n's contained in each gap buffer is stored in the header. Reads are fast as long as you have a P at the place you want to read from, which is almost always the case. It should be possible to quickly load files by mapping them directly into memory (using mmap()) and treating each 4KB page as a gap buffer with 0 size gap. When page is modified, use copy-on-write to move the page into the swap file (change pointer in header). This is not done now. Instead the file is copied when loaded. ---------------- Windowing System ---------------- There is a tiny object-oriented windowing system built into JOE. This is the class hierarchy: SCRN A optimizing terminal screen driver (very similar to 'curses'). has a pointer to a CAP, which has the terminal capabilities read from termcap or terminfo. writes output to screen with calls to the macro ttputc(). (tty.c is the actual interface to the tty device). cpos() - set cursor position outatr() - draw a character at a screen position with attributes eraeol() - erase from some position to the end of the line SCREEN Contains list of windows on the screen (W *topwin). Points to window with focus (W *curwin). Contains pointer to a 'SCRN', the tty driver for the particular terminal type. W A window on a screen. Has position and size of window. Has: void *object- pointer to a structure which inherits window (W should really be a base class for these objects- since C doesn't have this concept, a pointer to the derived class is used instead- the derived class has a pointer to the base class: it's called 'parent'). Currently this is one of: BW * a text buffer window (screen update code is here.) QW * query window (single character yes/no questions) MENU * file selection menu BW * is inherited by (in the same way that a BW inherits a W): PW * a single line prompt window (file name prompts) TW * a text buffer window (main editing window). WATOM *watom- Gives type of this window. The WATOM structure has pointers to virtual member functions. KBD *kbd- The keyboard handler for this window. When window has focus, keyboard events are sent to this object. When key sequences are recognized, macros bound to them are invoked. Some window are operators on others. For example ^K E, load a file into a window prompt operates on a text window. If you hit tab, a file selection menu which operates on the prompt window appears below this. When a window is the target of operator windows is killed, the operators are killed also. Currently all windows are currently the width of the screen (should be fixed in the future). The windows are in a big circular list (think of a big loop of paper). The screen is small window onto this list. So unlike emacs, you can have windows which exist, but which are not on the screen. ^K N and ^K P move the cursor to next or previous window. If the next window is off the screen it is moved onto the screen, along with any operator windows are target it. ------ MACROS ------ - add something here. ------------- Screen update ------------- - add something here. ----- Files ----- main.c has main(). b.c Text buffer management undo.c Undo system. kbd.c Keymap datastructure (keysequence to macro bindings). macro.c Keyboard and joerc file macros help.c Implement the on-line help window poshist.c Cursor position history rc.c joerc file loader tab.c tab completion for file selection prompt regex.c regular expressions blocks.c Library: fast memcpy() functions (necessary on really old versions of UNIX). dir.c Directory reading functions (for old UNIXs). hash.c Library: simple hash functions. vs.c Automatic variable length strings (like C++ string). va.c Automatic array of strings (like STL container) vfile.c Library: virtual memory functions (allows you to edit files larger than memory) utils.c Misc. utilities queue.c Library: doubly linked lists path.c Library: file name and path manipulation functions selinux.c secure linux functions i18n.c Unicode character type information database charmap.c UNICODE to 8-bit conversion functions utf8.c UTF-8 to unicode coding functions termcap.c load terminal capabilities from /etc/termcap file or terminfo database scrn.c terminal update functions (curses) syntax.c syntax highlighter cmd.c Table of user edit functions ublock.c User edit functions: block moves uedit.c User edit functions: basic edit functions uerror.c User edit functions: parse compiler error messages and goto next error, previous error ufile.c User edit functions: load and save file uformat.c User edit functions: paragraph formatting, centering uisrch.c User edit functions: incremental search umath.c User edit functions: calculator usearch.c User edit functions: search & replace ushell.c User edit functions: subshell utag.c User edit functions: tags file search menu.c A class: menu windows tw.c A class: main text editing window qw.c A class: query windows pw.c A class: prompt windows bw.c A class: text buffer window (screen update code is here) w.c A class: base class for all windows ------- Strings ------- char * C-strings: only used for system calls or C-library calls. unsigned char * Z-strings: used in JOE for read-only code vs s V-strings: exist in heap s.c_string Get C-string out of it (0 time) z.z_string Get Z-string out of it (0 time) vsrm(&s); Free a vs. vs n=vsdup(s) Duplicate a vs. vsadd(&s, 'c') Append one character. vscat(&s, zs, int len) Concatenate array on end of string vscat(&s, sc("Hi there")) vscat(&s, sv(s)) vscat(&s, sz(z)) vscmp() joe-3.7/blocks.c0000644000100100007640000002725510431662534010512 00000000000000/* * Fast block move/copy subroutines * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ /* This module requires ALIGNED and SIZEOF_INT to be defined correctly */ #include "types.h" #define BITS 8 #if SIZEOF_INT == 8 # define SHFT 3 #elif SIZEOF_INT == 4 # define SHFT 2 #elif SIZEOF_INT == 2 # define SHFT 1 #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; case 14: d[13] = c; case 13: d[12] = c; case 12: d[11] = c; case 11: d[10] = c; case 10: d[9] = c; case 9: d[8] = c; case 8: d[7] = c; case 7: d[6] = c; case 6: d[5] = c; case 5: d[4] = c; case 4: d[3] = c; case 3: d[2] = c; case 2: d[1] = c; case 1: d[0] = c; 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; case 14: d[13] = c; case 13: d[12] = c; case 12: d[11] = c; case 11: d[10] = c; case 10: d[9] = c; case 9: d[8] = c; case 8: d[7] = c; case 7: d[6] = c; case 6: d[5] = c; case 5: d[4] = c; case 4: d[3] = c; case 3: d[2] = c; case 2: d[1] = c; case 1: d[0] = c; 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; case 14: d[13] = c; case 13: d[12] = c; case 12: d[11] = c; case 11: d[10] = c; case 10: d[9] = c; case 9: d[8] = c; case 8: d[7] = c; case 7: d[6] = c; case 6: d[5] = c; case 5: d[4] = c; case 4: d[3] = c; case 3: d[2] = c; case 2: d[1] = c; case 1: d[0] = c; case 0: /* do nothing */; } } else { unsigned z = SIZEOF_INT - ((unsigned long)d & (SIZEOF_INT - 1)); if (z != SIZEOF_INT) { switch (z) { case 7: d[6] = c; case 6: d[5] = c; case 5: d[4] = c; case 4: d[3] = c; case 3: d[2] = c; case 2: d[1] = c; case 1: d[0] = c; case 0: /* do nothing */; } d += z; sz -= z; } 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)) { case 7: d[6] = c; case 6: d[5] = c; case 5: d[4] = c; case 4: d[3] = c; case 3: d[2] = c; case 2: d[1] = c; case 1: d[0] = c; case 0: /* do nothing */; } } return orgd; } /* Copy a block of integers */ /* Copy from highest address to lowest */ static int *mbkwdI(void *dest, void *src, int sz) { int *d = dest; 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]; case 14: d[13] = s[13]; case 13: d[12] = s[12]; case 12: d[11] = s[11]; case 11: d[10] = s[10]; case 10: d[9] = s[9]; case 9: d[8] = s[8]; case 8: d[7] = s[7]; case 7: d[6] = s[6]; case 6: d[5] = s[5]; case 5: d[4] = s[4]; case 4: d[3] = s[3]; case 3: d[2] = s[2]; case 2: d[1] = s[1]; case 1: d[0] = s[0]; case 0: /* do nothing */; } return d; } /* Copy a block of 'int's. Copy from lowest address to highest */ static int *mfwrdI(void *dest, void *src, int sz) { int *d = dest; 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]; case 14: d[1] = s[1]; case 13: d[2] = s[2]; case 12: d[3] = s[3]; case 11: d[4] = s[4]; case 10: d[5] = s[5]; case 9: d[6] = s[6]; case 8: d[7] = s[7]; case 7: d[8] = s[8]; case 6: d[9] = s[9]; case 5: d[10] = s[10]; case 4: d[11] = s[11]; case 3: d[12] = s[12]; case 2: d[13] = s[13]; case 1: d[14] = s[14]; 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 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) { case 7: d[6] = s[6]; case 6: d[5] = s[5]; case 5: d[4] = s[4]; case 4: d[3] = s[3]; case 3: d[2] = s[2]; case 2: d[1] = s[1]; case 1: d[0] = s[0]; 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)) { case 7: d[6] = s[6]; case 6: d[5] = s[5]; case 5: d[4] = s[4]; case 4: d[3] = s[3]; case 3: d[2] = s[2]; case 2: d[1] = s[1]; case 1: d[0] = s[0]; 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]; case 14: d[13] = s[13]; case 13: d[12] = s[12]; case 12: d[11] = s[11]; case 11: d[10] = s[10]; case 10: d[9] = s[9]; case 9: d[8] = s[8]; case 8: d[7] = s[7]; case 7: d[6] = s[6]; case 6: d[5] = s[5]; case 5: d[4] = s[4]; case 4: d[3] = s[3]; case 3: d[2] = s[2]; case 2: d[1] = s[1]; case 1: d[0] = s[0]; 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 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]; case 6: d[2] = s[2]; case 5: d[3] = s[3]; case 4: d[4] = s[4]; case 3: d[5] = s[5]; case 2: d[6] = s[6]; case 1: d[7] = s[7]; case 0: /* do nothing */; #else #if SIZEOF_INT == 4 case 3: d[1] = s[1]; case 2: d[2] = s[2]; case 1: d[3] = s[3]; case 0: /* do nothing */; #else #if SIZEOF_INT == 2 case 1: d[1] = s[1]; case 0: /* do nothing */; #endif #endif #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]; case 6: d[1] = s[1]; case 5: d[2] = s[2]; case 4: d[3] = s[3]; case 3: d[4] = s[4]; case 2: d[5] = s[5]; case 1: d[6] = s[6]; case 0: /* do nothing */; #else #if SIZEOF_INT == 4 case 3: d[0] = s[0]; case 2: d[1] = s[1]; case 1: d[2] = s[2]; case 0: /* do nothing */; #else #if SIZEOF_INT == 2 case 1: d[0] = s[0]; case 0: /* do nothing */; #endif #endif #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]; case 14: d[1] = s[1]; case 13: d[2] = s[2]; case 12: d[3] = s[3]; case 11: d[4] = s[4]; case 10: d[5] = s[5]; case 9: d[6] = s[6]; case 8: d[7] = s[7]; case 7: d[8] = s[8]; case 6: d[9] = s[9]; case 5: d[10] = s[10]; case 4: d[11] = s[11]; case 3: d[12] = s[12]; case 2: d[13] = s[13]; case 1: d[14] = s[14]; case 0: /* do nothing */; } } return od; } void *mmove(void *d, 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 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; case 14: if (blk[13] == c) ++nlines; case 13: if (blk[12] == c) ++nlines; case 12: if (blk[11] == c) ++nlines; case 11: if (blk[10] == c) ++nlines; case 10: if (blk[9] == c) ++nlines; case 9: if (blk[8] == c) ++nlines; case 8: if (blk[7] == c) ++nlines; case 7: if (blk[6] == c) ++nlines; case 6: if (blk[5] == c) ++nlines; case 5: if (blk[4] == c) ++nlines; case 4: if (blk[3] == c) ++nlines; case 3: if (blk[2] == c) ++nlines; case 2: if (blk[1] == c) ++nlines; case 1: if (blk[0] == c) ++nlines; case 0: /* do nothing */; } return nlines; } #ifdef junk unsigned char *mchr(blk, c) register unsigned char *blk, c; { loop: if (blk[0] == c) return blk + 0; if (blk[1] == c) return blk + 1; if (blk[2] == c) return blk + 2; if (blk[3] == c) return blk + 3; if (blk[4] == c) return blk + 4; if (blk[5] == c) return blk + 5; if (blk[6] == c) return blk + 6; if (blk[7] == c) return blk + 7; if (blk[8] == c) return blk + 8; if (blk[9] == c) return blk + 9; if (blk[10] == c) return blk + 10; if (blk[11] == c) return blk + 11; if (blk[12] == c) return blk + 12; if (blk[13] == c) return blk + 13; if (blk[14] == c) return blk + 14; if (blk[15] == c) return blk + 15; blk += 15; goto loop; } #endif joe-3.7/blocks.h0000644000100100007640000000253110433613730010501 00000000000000/* * Fast block move/copy subroutines * * These exist because memmove on older UNIXs was really slow. * * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_BLOCKS_H #define _JOE_BLOCKS_H 1 /* 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 PARAMS((void *d, 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 PARAMS((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 PARAMS((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 PARAMS((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 PARAMS((unsigned char *blk, unsigned char c, int size)); #ifdef junk /* char *mchr(char *s,char c); * * Return address of first 'c' following 's'. */ unsigned char *mchr PARAMS(()); #endif #endif joe-3.7/i18n.c0000644000100100007640000023706610431662534010017 00000000000000/* * UNICODE/ISO-10646 functions for JOE * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) * * This is basically the "i18n" file in C * * There really should be a program to convert from i18n to c, but this * was very easy to do with just the text editor. */ #include "types.h" /* * This is an implementation of wcwidth() and wcswidth() (defined in * IEEE Std 1002.1-2001) for Unicode. * * http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html * http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html * * In fixed-width output devices, Latin characters all occupy a single * "cell" position of equal width, whereas ideographic CJK characters * occupy two such cells. Interoperability between terminal-line * applications and (teletype-style) character terminals using the * UTF-8 encoding requires agreement on which character should advance * the cursor by how many cell positions. No established formal * standards exist at present on which Unicode character shall occupy * how many cell positions on character terminals. These routines are * a first attempt of defining such behavior based on simple rules * applied to data provided by the Unicode Consortium. * * For some graphical characters, the Unicode standard explicitly * defines a character-cell width via the definition of the East Asian * FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes. * In all these cases, there is no ambiguity about which width a * terminal shall use. For characters in the East Asian Ambiguous (A) * class, the width choice depends purely on a preference of backward * compatibility with either historic CJK or Western practice. * Choosing single-width for these characters is easy to justify as * the appropriate long-term solution, as the CJK practice of * displaying these characters as double-width comes from historic * implementation simplicity (8-bit encoded characters were displayed * single-width and 16-bit ones double-width, even for Greek, * Cyrillic, etc.) and not any typographic considerations. * * Much less clear is the choice of width for the Not East Asian * (Neutral) class. Existing practice does not dictate a width for any * of these characters. It would nevertheless make sense * typographically to allocate two character cells to characters such * as for instance EM SPACE or VOLUME INTEGRAL, which cannot be * represented adequately with a single-width glyph. The following * routines at present merely assign a single-cell width to all * neutral characters, in the interest of simplicity. This is not * entirely satisfactory and should be reconsidered before * establishing a formal standard in this area. At the moment, the * decision which Not East Asian (Neutral) characters should be * represented by double-width glyphs cannot yet be answered by * applying a simple rule from the Unicode database content. Setting * up a proper standard for the behavior of UTF-8 character terminals * will require a careful analysis not only of each Unicode character, * but also of each presentation form, something the author of these * routines has avoided to do so far. * * http://www.unicode.org/unicode/reports/tr11/ * * Markus Kuhn -- 2003-05-20 (Unicode 4.0) * * Permission to use, copy, modify, and distribute this software * for any purpose and without fee is hereby granted. The author * disclaims all warranties with regard to this software. * * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c */ struct interval { int first; int last; }; static int bisearch(int ucs, const struct interval *table, int max) { int min = 0; int mid; if (ucs < table[0].first || ucs > table[max].last) return -1; while (max >= min) { mid = (min + max) / 2; if (ucs > table[mid].last) min = mid + 1; else if (ucs < table[mid].first) max = mid - 1; else return mid; } return -1; } /* Macro for generating joe_iswXXX functions */ #define MAKE_ISW(x) \ int joe_isw##x(struct charmap *foo,int c) \ { \ if (-1!=bisearch(c, data_wctype_##x, sizeof(data_wctype_##x)/sizeof(struct interval) - 1)) \ return 1; \ else \ return 0; \ } /* The following two functions define the column width of an ISO 10646 * character as follows: * * - The null character (U+0000) has a column width of 0. * * - Other C0/C1 control characters and DEL will lead to a return * value of -1. * * - Non-spacing and enclosing combining characters (general * category code Mn or Me in the Unicode database) have a * column width of 0. * * - SOFT HYPHEN (U+00AD) has a column width of 1. * * - Other format characters (general category code Cf in the Unicode * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0. * * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) * have a column width of 0. * * - Spacing characters in the East Asian Wide (W) or East Asian * Full-width (F) category as defined in Unicode Technical * Report #11 have a column width of 2. * * - All remaining characters (including all printable * ISO 8859-1 and WGL4 characters, Unicode control characters, * etc.) have a column width of 1. * * This implementation assumes that wchar_t characters are encoded * in ISO 10646. */ /* Modified for JOE: returns printed width of control and other non-printable characters */ int joe_wcwidth(int wide,int ucs) { /* sorted list of non-overlapping intervals of non-spacing characters */ /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */ static const struct interval combining[] = { { 0x0300, 0x0357 }, { 0x035D, 0x036F }, { 0x0483, 0x0486 }, { 0x0488, 0x0489 }, { 0x0591, 0x05A1 }, { 0x05A3, 0x05B9 }, { 0x05BB, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, { 0x05C4, 0x05C4 }, { 0x0600, 0x0603 }, { 0x0610, 0x0615 }, { 0x064B, 0x0658 }, { 0x0670, 0x0670 }, { 0x06D6, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED }, { 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A }, { 0x07A6, 0x07B0 }, { 0x0901, 0x0902 }, { 0x093C, 0x093C }, { 0x0941, 0x0948 }, { 0x094D, 0x094D }, { 0x0951, 0x0954 }, { 0x0962, 0x0963 }, { 0x0981, 0x0981 }, { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD }, { 0x09E2, 0x09E3 }, { 0x0A01, 0x0A02 }, { 0x0A3C, 0x0A3C }, { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, { 0x0A70, 0x0A71 }, { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC }, { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD }, { 0x0AE2, 0x0AE3 }, { 0x0B01, 0x0B01 }, { 0x0B3C, 0x0B3C }, { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B43 }, { 0x0B4D, 0x0B4D }, { 0x0B56, 0x0B56 }, { 0x0B82, 0x0B82 }, { 0x0BC0, 0x0BC0 }, { 0x0BCD, 0x0BCD }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 }, { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0CBC, 0x0CBC }, { 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, { 0x0D41, 0x0D43 }, { 0x0D4D, 0x0D4D }, { 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, { 0x0EC8, 0x0ECD }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, { 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, { 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F90, 0x0F97 }, { 0x0F99, 0x0FBC }, { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, { 0x1032, 0x1032 }, { 0x1036, 0x1037 }, { 0x1039, 0x1039 }, { 0x1058, 0x1059 }, { 0x1160, 0x11FF }, { 0x1712, 0x1714 }, { 0x1732, 0x1734 }, { 0x1752, 0x1753 }, { 0x1772, 0x1773 }, { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, { 0x17C6, 0x17C6 }, { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, { 0x180B, 0x180D }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 }, { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B }, { 0x200B, 0x200F }, { 0x202A, 0x202E }, { 0x2060, 0x2063 }, { 0x206A, 0x206F }, { 0x20D0, 0x20EA }, { 0x302A, 0x302F }, { 0x3099, 0x309A }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F }, { 0xFE20, 0xFE23 }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB }, { 0x1D167, 0x1D169 }, { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, { 0xE0100, 0xE01EF } }; /* If terminal is not UTF-8 or file is not UTF-8: width is 1 */ /* FIXME */ if (!locale_map->type || !wide) return 1; /* Control characters are one column wide in JOE */ if (ucs < 32 || ucs == 0x7F) return 1; /* More control characters... */ if (ucs>=0x80 && ucs<=0x9F) return 4; /* More control characters... */ if (ucs>=0x200b && ucs<=0x206f) { if (ucs<=0x200f) return 6; if (ucs>=0x2028 && ucs<=0x202E) return 6; if (ucs>=0x2060 && ucs<=0x2063) return 6; if (ucs>=0x206a) return 6; } /* More control characters... */ if (ucs>=0xFDD0 && ucs<=0xFDEF) return 6; if (ucs==0xFEFF) return 6; if (ucs>=0xFFF9 && ucs<=0xFFFB) return 6; if (ucs>=0xFFFE && ucs<=0xFFFF) return 6; /* 0 Width Combining characters */ if (-1!=bisearch(ucs, combining, sizeof(combining) / sizeof(struct interval) - 1)) return 0; /* Double-wide characters */ return 1 + (ucs >= 0x1100 && (ucs <= 0x115f || /* Hangul Jamo init. consonants */ ucs == 0x2329 || ucs == 0x232a || (ucs >= 0x2e80 && ucs <= 0xa4cf && ucs != 0x303f) || /* CJK ... Yi */ (ucs >= 0xac00 && ucs <= 0xd7a3) || /* Hangul Syllables */ (ucs >= 0xf900 && ucs <= 0xfaff) || /* CJK Compatibility Ideographs */ (ucs >= 0xfe30 && ucs <= 0xfe6f) || /* CJK Compatibility Forms */ (ucs >= 0xff00 && ucs <= 0xff60) || /* Fullwidth Forms */ (ucs >= 0xffe0 && ucs <= 0xffe6) || (ucs >= 0x20000 && ucs <= 0x2fffd) || (ucs >= 0x30000 && ucs <= 0x3fffd))); } /* MAKE_ISW functions... */ static struct interval data_wctype_upper[]= { { 0x0041, 0x005A }, { 0x00C0, 0x00D6 }, { 0x00D8, 0x00DE }, { 0x0100, 0x0136 }, { 0x0139, 0x0147 }, { 0x014A, 0x0178 }, { 0x0179, 0x017D }, { 0x0181, 0x0181 }, { 0x0182, 0x0186 }, { 0x0187, 0x0187 }, { 0x0189, 0x018B }, { 0x018E, 0x0191 }, { 0x0193, 0x0193 }, { 0x0194, 0x0194 }, { 0x0196, 0x0198 }, { 0x019C, 0x019C }, { 0x019D, 0x019D }, { 0x019F, 0x019F }, { 0x01A0, 0x01A4 }, { 0x01A6, 0x01A6 }, { 0x01A7, 0x01A7 }, { 0x01A9, 0x01A9 }, { 0x01AC, 0x01AC }, { 0x01AE, 0x01AE }, { 0x01AF, 0x01AF }, { 0x01B1, 0x01B3 }, { 0x01B5, 0x01B5 }, { 0x01B7, 0x01B7 }, { 0x01B8, 0x01B8 }, { 0x01BC, 0x01BC }, { 0x01C4, 0x01C4 }, { 0x01C5, 0x01C5 }, { 0x01C7, 0x01C7 }, { 0x01C8, 0x01C8 }, { 0x01CA, 0x01CA }, { 0x01CB, 0x01CB }, { 0x01CD, 0x01DB }, { 0x01DE, 0x01EE }, { 0x01F1, 0x01F1 }, { 0x01F2, 0x01F2 }, { 0x01F4, 0x01F4 }, { 0x01F6, 0x01F8 }, { 0x01FA, 0x01FE }, { 0x0200, 0x0232 }, { 0x0386, 0x0386 }, { 0x0388, 0x038A }, { 0x038C, 0x038C }, { 0x038E, 0x038E }, { 0x038F, 0x038F }, { 0x0391, 0x03A1 }, { 0x03A3, 0x03AB }, { 0x03D8, 0x03DE }, { 0x03E0, 0x03EE }, { 0x03F4, 0x03F4 }, { 0x0400, 0x042F }, { 0x0460, 0x047E }, { 0x0480, 0x0480 }, { 0x048A, 0x04BE }, { 0x04C1, 0x04CD }, { 0x04D0, 0x04F4 }, { 0x04F8, 0x04F8 }, { 0x0500, 0x050E }, { 0x0531, 0x0556 }, { 0x1E00, 0x1E7E }, { 0x1E80, 0x1E94 }, { 0x1EA0, 0x1EF8 }, { 0x1F08, 0x1F0F }, { 0x1F18, 0x1F1D }, { 0x1F28, 0x1F2F }, { 0x1F38, 0x1F3F }, { 0x1F48, 0x1F4D }, { 0x1F59, 0x1F5F }, { 0x1F68, 0x1F6F }, { 0x1F88, 0x1F8F }, { 0x1F98, 0x1F9F }, { 0x1FA8, 0x1FAF }, { 0x1FB8, 0x1FBC }, { 0x1FC8, 0x1FCC }, { 0x1FD8, 0x1FDB }, { 0x1FE8, 0x1FEC }, { 0x1FF8, 0x1FFC }, { 0x2126, 0x2126 }, { 0x212A, 0x212B }, { 0x2160, 0x216F }, { 0x24B6, 0x24CF }, { 0xFF21, 0xFF3A }, { 0x00010400, 0x00010425 } }; MAKE_ISW(upper) static struct interval data_wctype_lower[]= { { 0x0061, 0x007A }, { 0x00B5, 0x00B5 }, { 0x00DF, 0x00F6 }, { 0x00F8, 0x00FF }, { 0x0101, 0x0137 }, { 0x013A, 0x0148 }, { 0x014B, 0x0177 }, { 0x017A, 0x017E }, { 0x017F, 0x017F }, { 0x0183, 0x0183 }, { 0x0185, 0x0185 }, { 0x0188, 0x0188 }, { 0x018C, 0x018C }, { 0x0192, 0x0192 }, { 0x0195, 0x0195 }, { 0x0199, 0x0199 }, { 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, 0x01DC }, { 0x01DD, 0x01EF }, { 0x01F2, 0x01F2 }, { 0x01F3, 0x01F3 }, { 0x01F5, 0x01F5 }, { 0x01F9, 0x01FF }, { 0x0201, 0x021F }, { 0x0223, 0x0233 }, { 0x0253, 0x0253 }, { 0x0254, 0x0254 }, { 0x0256, 0x0256 }, { 0x0257, 0x0257 }, { 0x0259, 0x0259 }, { 0x025B, 0x025B }, { 0x0260, 0x0260 }, { 0x0263, 0x0263 }, { 0x0268, 0x0268 }, { 0x0269, 0x0269 }, { 0x026F, 0x026F }, { 0x0272, 0x0272 }, { 0x0275, 0x0275 }, { 0x0280, 0x0280 }, { 0x0283, 0x0283 }, { 0x0288, 0x0288 }, { 0x028A, 0x028A }, { 0x028B, 0x028B }, { 0x0292, 0x0292 }, { 0x0345, 0x0345 }, { 0x03AC, 0x03AF }, { 0x03B1, 0x03CE }, { 0x03D0, 0x03D0 }, { 0x03D1, 0x03D1 }, { 0x03D5, 0x03D5 }, { 0x03D6, 0x03D6 }, { 0x03D9, 0x03EF }, { 0x03F0, 0x03F2 }, { 0x03F5, 0x03F5 }, { 0x0430, 0x045F }, { 0x0461, 0x047F }, { 0x0481, 0x0481 }, { 0x048B, 0x04BF }, { 0x04C2, 0x04CE }, { 0x04D1, 0x04F5 }, { 0x04F9, 0x04F9 }, { 0x0501, 0x050F }, { 0x0561, 0x0586 }, { 0x1E01, 0x1E95 }, { 0x1E9B, 0x1E9B }, { 0x1EA1, 0x1EF9 }, { 0x1F00, 0x1F07 }, { 0x1F10, 0x1F15 }, { 0x1F20, 0x1F27 }, { 0x1F30, 0x1F37 }, { 0x1F40, 0x1F45 }, { 0x1F51, 0x1F57 }, { 0x1F60, 0x1F67 }, { 0x1F70, 0x1F7D }, { 0x1F80, 0x1F87 }, { 0x1F90, 0x1F97 }, { 0x1FA0, 0x1FA7 }, { 0x1FB0, 0x1FB0 }, { 0x1FB1, 0x1FB1 }, { 0x1FB3, 0x1FB3 }, { 0x1FBE, 0x1FBE }, { 0x1FC3, 0x1FC3 }, { 0x1FD0, 0x1FD0 }, { 0x1FD1, 0x1FD1 }, { 0x1FE0, 0x1FE0 }, { 0x1FE1, 0x1FE1 }, { 0x1FE5, 0x1FE5 }, { 0x1FF3, 0x1FF3 }, { 0x2170, 0x217F }, { 0x24D0, 0x24E9 }, { 0xFF41, 0xFF5A }, { 0x00010428, 0x0001044D } }; MAKE_ISW(lower) struct interval data_wctype_alpha[]= { { 0x0041, 0x005A }, { 0x005F, 0x005F }, /* Include _ for joe */ { 0x0061, 0x007A }, { 0x00AA, 0x00AA }, { 0x00B5, 0x00B5 }, { 0x00BA, 0x00BA }, { 0x00C0, 0x00D6 }, { 0x00D8, 0x00F6 }, { 0x00F8, 0x00FF }, { 0x0100, 0x017F }, { 0x0180, 0x0220 }, { 0x0222, 0x0233 }, { 0x0250, 0x02AD }, { 0x02B0, 0x02B8 }, { 0x02BB, 0x02C1 }, { 0x02D0, 0x02D0 }, { 0x02D1, 0x02D1 }, { 0x02E0, 0x02E4 }, { 0x02EE, 0x02EE }, { 0x0345, 0x0345 }, { 0x037A, 0x037A }, { 0x0386, 0x0386 }, { 0x0388, 0x038A }, { 0x038C, 0x038C }, { 0x038E, 0x03A1 }, { 0x03A3, 0x03CE }, { 0x03D0, 0x03F5 }, { 0x0400, 0x0481 }, { 0x048A, 0x04CE }, { 0x04D0, 0x04F5 }, { 0x04F8, 0x04F9 }, { 0x0500, 0x050F }, { 0x0531, 0x0556 }, { 0x0559, 0x0559 }, { 0x0561, 0x0587 }, { 0x05D0, 0x05EA }, { 0x05F0, 0x05F2 }, { 0x0621, 0x063A }, { 0x0640, 0x064A }, { 0x0660, 0x0669 }, { 0x066E, 0x066F }, { 0x0671, 0x06D3 }, { 0x06D5, 0x06D5 }, { 0x06E5, 0x06E6 }, { 0x06F0, 0x06F9 }, { 0x06FA, 0x06FC }, { 0x0710, 0x0710 }, { 0x0712, 0x072C }, { 0x0780, 0x07A5 }, { 0x07B1, 0x07B1 }, { 0x0905, 0x0939 }, { 0x093D, 0x093D }, { 0x0950, 0x0950 }, { 0x0958, 0x0961 }, { 0x0966, 0x096F }, { 0x0985, 0x098C }, { 0x098F, 0x098F }, { 0x0990, 0x0990 }, { 0x0993, 0x09A8 }, { 0x09AA, 0x09B0 }, { 0x09B2, 0x09B2 }, { 0x09B6, 0x09B9 }, { 0x09DC, 0x09DC }, { 0x09DD, 0x09DD }, { 0x09DF, 0x09E1 }, { 0x09E6, 0x09EF }, { 0x09F0, 0x09F1 }, { 0x0A05, 0x0A0A }, { 0x0A0F, 0x0A0F }, { 0x0A10, 0x0A10 }, { 0x0A13, 0x0A28 }, { 0x0A2A, 0x0A30 }, { 0x0A32, 0x0A32 }, { 0x0A33, 0x0A33 }, { 0x0A35, 0x0A35 }, { 0x0A36, 0x0A36 }, { 0x0A38, 0x0A38 }, { 0x0A39, 0x0A39 }, { 0x0A59, 0x0A5C }, { 0x0A5E, 0x0A5E }, { 0x0A66, 0x0A6F }, { 0x0A72, 0x0A74 }, { 0x0A85, 0x0A8B }, { 0x0A8D, 0x0A8D }, { 0x0A8F, 0x0A91 }, { 0x0A93, 0x0AA8 }, { 0x0AAA, 0x0AB0 }, { 0x0AB2, 0x0AB2 }, { 0x0AB3, 0x0AB3 }, { 0x0AB5, 0x0AB9 }, { 0x0ABD, 0x0ABD }, { 0x0AD0, 0x0AD0 }, { 0x0AE0, 0x0AE0 }, { 0x0AE6, 0x0AEF }, { 0x0B05, 0x0B0C }, { 0x0B0F, 0x0B0F }, { 0x0B10, 0x0B10 }, { 0x0B13, 0x0B28 }, { 0x0B2A, 0x0B30 }, { 0x0B32, 0x0B32 }, { 0x0B33, 0x0B33 }, { 0x0B36, 0x0B39 }, { 0x0B3D, 0x0B3D }, { 0x0B5C, 0x0B5C }, { 0x0B5D, 0x0B5D }, { 0x0B5F, 0x0B61 }, { 0x0B66, 0x0B6F }, { 0x0B83, 0x0B83 }, { 0x0B85, 0x0B8A }, { 0x0B8E, 0x0B90 }, { 0x0B92, 0x0B95 }, { 0x0B99, 0x0B99 }, { 0x0B9A, 0x0B9A }, { 0x0B9C, 0x0B9C }, { 0x0B9E, 0x0B9E }, { 0x0B9F, 0x0B9F }, { 0x0BA3, 0x0BA3 }, { 0x0BA4, 0x0BA4 }, { 0x0BA8, 0x0BAA }, { 0x0BAE, 0x0BB5 }, { 0x0BB7, 0x0BB9 }, { 0x0BE7, 0x0BEF }, { 0x0C05, 0x0C0C }, { 0x0C0E, 0x0C10 }, { 0x0C12, 0x0C28 }, { 0x0C2A, 0x0C33 }, { 0x0C35, 0x0C39 }, { 0x0C60, 0x0C61 }, { 0x0C66, 0x0C6F }, { 0x0C85, 0x0C8C }, { 0x0C8E, 0x0C90 }, { 0x0C92, 0x0CA8 }, { 0x0CAA, 0x0CB3 }, { 0x0CB5, 0x0CB9 }, { 0x0CDE, 0x0CDE }, { 0x0CE0, 0x0CE1 }, { 0x0CE6, 0x0CEF }, { 0x0D05, 0x0D0C }, { 0x0D0E, 0x0D10 }, { 0x0D12, 0x0D28 }, { 0x0D2A, 0x0D39 }, { 0x0D60, 0x0D61 }, { 0x0D66, 0x0D6F }, { 0x0D85, 0x0D96 }, { 0x0D9A, 0x0DB1 }, { 0x0DB3, 0x0DBB }, { 0x0DBD, 0x0DBD }, { 0x0DC0, 0x0DC6 }, { 0x0E01, 0x0E2E }, { 0x0E30, 0x0E3A }, { 0x0E40, 0x0E45 }, { 0x0E47, 0x0E4E }, { 0x0E50, 0x0E59 }, { 0x0E81, 0x0E82 }, { 0x0E84, 0x0E84 }, { 0x0E87, 0x0E88 }, { 0x0E8A, 0x0E8A }, { 0x0E8D, 0x0E8D }, { 0x0E94, 0x0E97 }, { 0x0E99, 0x0E9F }, { 0x0EA1, 0x0EA3 }, { 0x0EA5, 0x0EA5 }, { 0x0EA7, 0x0EA7 }, { 0x0EAA, 0x0EAB }, { 0x0EAD, 0x0EB0 }, { 0x0EB2, 0x0EB3 }, { 0x0EBD, 0x0EBD }, { 0x0EC0, 0x0EC4 }, { 0x0EC6, 0x0EC6 }, { 0x0ED0, 0x0ED9 }, { 0x0EDC, 0x0EDD }, { 0x0F00, 0x0F00 }, { 0x0F20, 0x0F29 }, { 0x0F40, 0x0F47 }, { 0x0F49, 0x0F6A }, { 0x0F88, 0x0F8B }, { 0x1000, 0x1021 }, { 0x1023, 0x1027 }, { 0x1029, 0x1029 }, { 0x102A, 0x102A }, { 0x1040, 0x1049 }, { 0x1050, 0x1055 }, { 0x10A0, 0x10C5 }, { 0x10D0, 0x10F8 }, { 0x1100, 0x1159 }, { 0x115F, 0x11A2 }, { 0x11A8, 0x11F9 }, { 0x1200, 0x1206 }, { 0x1208, 0x1246 }, { 0x1248, 0x1248 }, { 0x124A, 0x124D }, { 0x1250, 0x1256 }, { 0x1258, 0x1258 }, { 0x125A, 0x125D }, { 0x1260, 0x1286 }, { 0x1288, 0x1288 }, { 0x128A, 0x128D }, { 0x1290, 0x12AE }, { 0x12B0, 0x12B0 }, { 0x12B2, 0x12B5 }, { 0x12B8, 0x12BE }, { 0x12C0, 0x12C0 }, { 0x12C2, 0x12C5 }, { 0x12C8, 0x12CE }, { 0x12D0, 0x12D6 }, { 0x12D8, 0x12EE }, { 0x12F0, 0x130E }, { 0x1310, 0x1310 }, { 0x1312, 0x1315 }, { 0x1318, 0x131E }, { 0x1320, 0x1346 }, { 0x1348, 0x135A }, { 0x1369, 0x1371 }, { 0x13A0, 0x13F4 }, { 0x1401, 0x166C }, { 0x166F, 0x1676 }, { 0x1681, 0x169A }, { 0x16A0, 0x16EA }, { 0x16EE, 0x16F0 }, { 0x1700, 0x170C }, { 0x170E, 0x1711 }, { 0x1720, 0x1731 }, { 0x1740, 0x1751 }, { 0x1760, 0x176C }, { 0x176E, 0x1770 }, { 0x1780, 0x17B3 }, { 0x17D7, 0x17D7 }, { 0x17DC, 0x17DC }, { 0x17E0, 0x17E9 }, { 0x1810, 0x1819 }, { 0x1820, 0x1877 }, { 0x1880, 0x18A8 }, { 0x1E00, 0x1E9B }, { 0x1EA0, 0x1EF9 }, { 0x1F00, 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 }, { 0x2102, 0x2102 }, { 0x2107, 0x2107 }, { 0x210A, 0x2113 }, { 0x2115, 0x2115 }, { 0x2119, 0x211D }, { 0x2124, 0x2124 }, { 0x2126, 0x2126 }, { 0x2128, 0x212D }, { 0x212F, 0x2131 }, { 0x2133, 0x2139 }, { 0x213D, 0x213F }, { 0x2145, 0x2149 }, { 0x2160, 0x2183 }, { 0x249C, 0x24E9 }, { 0x3005, 0x3007 }, { 0x3021, 0x3029 }, { 0x3031, 0x3035 }, { 0x3038, 0x303C }, { 0x3041, 0x3096 }, { 0x309D, 0x309F }, { 0x30A1, 0x30FA }, { 0x30FC, 0x30FF }, { 0x3105, 0x312C }, { 0x3131, 0x318E }, { 0x31A0, 0x31B7 }, { 0x31F0, 0x31FF }, { 0x3400, 0x4DB5 }, { 0x4E00, 0x9FA5 }, { 0xA000, 0xA48C }, { 0xAC00, 0xD7A3 }, { 0xF900, 0xFA2D }, { 0xFA30, 0xFA6A }, { 0xFB00, 0xFB06 }, { 0xFB13, 0xFB17 }, { 0xFB1D, 0xFB1D }, { 0xFB1F, 0xFB28 }, { 0xFB2A, 0xFB36 }, { 0xFB38, 0xFB3C }, { 0xFB3E, 0xFB3E }, { 0xFB40, 0xFB40 }, { 0xFB41, 0xFB41 }, { 0xFB43, 0xFB43 }, { 0xFB44, 0xFB44 }, { 0xFB46, 0xFB4F }, { 0xFB50, 0xFBB1 }, { 0xFBD3, 0xFD3D }, { 0xFD50, 0xFD8F }, { 0xFD92, 0xFDC7 }, { 0xFDF0, 0xFDFB }, { 0xFE70, 0xFE74 }, { 0xFE76, 0xFEFC }, { 0xFF10, 0xFF19 }, { 0xFF21, 0xFF3A }, { 0xFF41, 0xFF5A }, { 0xFF66, 0xFFBE }, { 0xFFC2, 0xFFC7 }, { 0xFFCA, 0xFFCF }, { 0xFFD2, 0xFFD7 }, { 0xFFDA, 0xFFDC }, { 0x00010300, 0x0001031E }, { 0x00010330, 0x0001034A }, { 0x00010400, 0x00010425 }, { 0x00010428, 0x0001044D }, { 0x0001D400, 0x0001D454 }, { 0x0001D456, 0x0001D49C }, { 0x0001D49E, 0x0001D49F }, { 0x0001D4A2, 0x0001D4A2 }, { 0x0001D4A5, 0x0001D4A6 }, { 0x0001D4A9, 0x0001D4AC }, { 0x0001D4AE, 0x0001D4B9 }, { 0x0001D4BB, 0x0001D4BB }, { 0x0001D4BD, 0x0001D4C0 }, { 0x0001D4C2, 0x0001D4C3 }, { 0x0001D4C5, 0x0001D505 }, { 0x0001D507, 0x0001D50A }, { 0x0001D50D, 0x0001D514 }, { 0x0001D516, 0x0001D51C }, { 0x0001D51E, 0x0001D539 }, { 0x0001D53B, 0x0001D53E }, { 0x0001D540, 0x0001D544 }, { 0x0001D546, 0x0001D546 }, { 0x0001D54A, 0x0001D550 }, { 0x0001D552, 0x0001D6A3 }, { 0x0001D6A8, 0x0001D6C0 }, { 0x0001D6C2, 0x0001D6DA }, { 0x0001D6DC, 0x0001D6FA }, { 0x0001D6FC, 0x0001D714 }, { 0x0001D716, 0x0001D734 }, { 0x0001D736, 0x0001D74E }, { 0x0001D750, 0x0001D76E }, { 0x0001D770, 0x0001D788 }, { 0x0001D78A, 0x0001D7A8 }, { 0x0001D7AA, 0x0001D7C2 }, { 0x0001D7C4, 0x0001D7C9 }, { 0x0001D7CE, 0x0001D7FF }, { 0x00020000, 0x0002A6D6 }, { 0x0002F800, 0x0002FA1D } }; MAKE_ISW(alpha) int joe_iswalpha_(struct charmap *foo,int c) { if (c==0x5F) return 1; else return joe_iswalpha(foo,c); } int joe_iswalnum_(struct charmap *foo,int c) { if ((c>=0x30 && c<=0x39) || c==0x5F) return 1; else return joe_iswalpha(foo,c); } struct interval data_wctype_digit[]= { { 0x0030, 0x0039 } }; MAKE_ISW(digit) struct interval data_wctype_space[]= { { 0x0009, 0x000D }, { 0x0020, 0x0020 }, { 0x1680, 0x1680 }, { 0x2000, 0x2006 }, { 0x2008, 0x200B }, { 0x2028, 0x2028 }, { 0x2029, 0x2029 }, { 0x205F, 0x205F }, { 0x3000, 0x3000 } }; MAKE_ISW(space) struct interval data_wctype_ctrl[]= { { 0x0000, 0x001F }, { 0x007F, 0x009F }, { 0x2028, 0x2028 }, { 0x2029, 0x2029 } }; MAKE_ISW(ctrl) struct interval data_wctype_punct[]= { { 0x0021, 0x002F }, { 0x003A, 0x0040 }, { 0x005B, 0x0060 }, { 0x007B, 0x007E }, { 0x00A0, 0x00A9 }, { 0x00AB, 0x00B4 }, { 0x00B6, 0x00B9 }, { 0x00BB, 0x00BF }, { 0x00D7, 0x00D7 }, { 0x00F7, 0x00F7 }, { 0x02B9, 0x02BA }, { 0x02C2, 0x02CF }, { 0x02D2, 0x02DF }, { 0x02E5, 0x02ED }, { 0x0300, 0x0344 }, { 0x0346, 0x034F }, { 0x0360, 0x036F }, { 0x0374, 0x0375 }, { 0x037E, 0x037E }, { 0x0384, 0x0385 }, { 0x0387, 0x0387 }, { 0x03F6, 0x03F6 }, { 0x0482, 0x0486 }, { 0x0488, 0x0489 }, { 0x055A, 0x055F }, { 0x0589, 0x058A }, { 0x0591, 0x05A1 }, { 0x05A3, 0x05B9 }, { 0x05BB, 0x05C4 }, { 0x05F3, 0x05F4 }, { 0x060C, 0x060C }, { 0x061B, 0x061B }, { 0x061F, 0x061F }, { 0x064B, 0x0655 }, { 0x066A, 0x066D }, { 0x0670, 0x0670 }, { 0x06D4, 0x06D4 }, { 0x06D6, 0x06E4 }, { 0x06E7, 0x06ED }, { 0x06FD, 0x06FE }, { 0x0700, 0x070D }, { 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A }, { 0x07A6, 0x07B0 }, { 0x0901, 0x0903 }, { 0x093C, 0x093C }, { 0x093E, 0x094D }, { 0x0951, 0x0954 }, { 0x0962, 0x0965 }, { 0x0970, 0x0970 }, { 0x0981, 0x0983 }, { 0x09BC, 0x09BC }, { 0x09BE, 0x09C4 }, { 0x09C7, 0x09C8 }, { 0x09CB, 0x09CD }, { 0x09D7, 0x09D7 }, { 0x09E2, 0x09E3 }, { 0x09F2, 0x09FA }, { 0x0A02, 0x0A02 }, { 0x0A3C, 0x0A3C }, { 0x0A3E, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, { 0x0A70, 0x0A71 }, { 0x0A81, 0x0A83 }, { 0x0ABC, 0x0ABC }, { 0x0ABE, 0x0AC5 }, { 0x0AC7, 0x0AC9 }, { 0x0ACB, 0x0ACD }, { 0x0B01, 0x0B03 }, { 0x0B3C, 0x0B3C }, { 0x0B3E, 0x0B43 }, { 0x0B47, 0x0B48 }, { 0x0B4B, 0x0B4D }, { 0x0B56, 0x0B57 }, { 0x0B70, 0x0B70 }, { 0x0B82, 0x0B82 }, { 0x0BBE, 0x0BC2 }, { 0x0BC6, 0x0BC8 }, { 0x0BCA, 0x0BCD }, { 0x0BD7, 0x0BD7 }, { 0x0BF0, 0x0BF2 }, { 0x0C01, 0x0C03 }, { 0x0C3E, 0x0C44 }, { 0x0C46, 0x0C48 }, { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0C82, 0x0C83 }, { 0x0CBE, 0x0CC4 }, { 0x0CC6, 0x0CC8 }, { 0x0CCA, 0x0CCD }, { 0x0CD5, 0x0CD6 }, { 0x0D02, 0x0D03 }, { 0x0D3E, 0x0D43 }, { 0x0D46, 0x0D48 }, { 0x0D4A, 0x0D4D }, { 0x0D57, 0x0D57 }, { 0x0D82, 0x0D83 }, { 0x0DCA, 0x0DCA }, { 0x0DCF, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0DD8, 0x0DDF }, { 0x0DF2, 0x0DF4 }, { 0x0E2F, 0x0E2F }, { 0x0E3F, 0x0E3F }, { 0x0E46, 0x0E46 }, { 0x0E4F, 0x0E4F }, { 0x0E5A, 0x0E5B }, { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, { 0x0EC8, 0x0ECD }, { 0x0F01, 0x0F1F }, { 0x0F2A, 0x0F3F }, { 0x0F71, 0x0F87 }, { 0x0F90, 0x0F97 }, { 0x0F99, 0x0FBC }, { 0x0FBE, 0x0FCC }, { 0x0FCF, 0x0FCF }, { 0x102C, 0x1032 }, { 0x1036, 0x1039 }, { 0x104A, 0x104F }, { 0x1056, 0x1059 }, { 0x10FB, 0x10FB }, { 0x1361, 0x1368 }, { 0x1372, 0x137C }, { 0x166D, 0x166E }, { 0x169B, 0x169C }, { 0x16EB, 0x16ED }, { 0x1712, 0x1714 }, { 0x1732, 0x1736 }, { 0x1752, 0x1753 }, { 0x1772, 0x1773 }, { 0x17B4, 0x17D6 }, { 0x17D8, 0x17DB }, { 0x1800, 0x180E }, { 0x18A9, 0x18A9 }, { 0x1FBD, 0x1FBD }, { 0x1FBF, 0x1FC1 }, { 0x1FCD, 0x1FCF }, { 0x1FDD, 0x1FDF }, { 0x1FED, 0x1FEF }, { 0x1FFD, 0x1FFE }, { 0x2007, 0x2007 }, { 0x200C, 0x2027 }, { 0x202A, 0x2052 }, { 0x2057, 0x2057 }, { 0x2060, 0x2063 }, { 0x206A, 0x2070 }, { 0x2074, 0x207E }, { 0x2080, 0x208E }, { 0x20A0, 0x20B1 }, { 0x20D0, 0x20EA }, { 0x2100, 0x2101 }, { 0x2103, 0x2106 }, { 0x2108, 0x2109 }, { 0x2114, 0x2114 }, { 0x2116, 0x2118 }, { 0x211E, 0x2123 }, { 0x2125, 0x2125 }, { 0x2127, 0x2127 }, { 0x212E, 0x212E }, { 0x2132, 0x2132 }, { 0x213A, 0x213A }, { 0x2140, 0x2144 }, { 0x214A, 0x214B }, { 0x2153, 0x215F }, { 0x2190, 0x23CE }, { 0x2400, 0x2426 }, { 0x2440, 0x244A }, { 0x2460, 0x249B }, { 0x24EA, 0x24FE }, { 0x2500, 0x2613 }, { 0x2616, 0x2617 }, { 0x2619, 0x267D }, { 0x2680, 0x2689 }, { 0x2701, 0x2704 }, { 0x2706, 0x2709 }, { 0x270C, 0x2727 }, { 0x2729, 0x274B }, { 0x274D, 0x274D }, { 0x274F, 0x2752 }, { 0x2756, 0x2756 }, { 0x2758, 0x275E }, { 0x2761, 0x2794 }, { 0x2798, 0x27AF }, { 0x27B1, 0x27BE }, { 0x27D0, 0x27EB }, { 0x27F0, 0x2AFF }, { 0x2E80, 0x2E99 }, { 0x2E9B, 0x2EF3 }, { 0x2F00, 0x2FD5 }, { 0x2FF0, 0x2FFB }, { 0x3001, 0x3004 }, { 0x3008, 0x3020 }, { 0x302A, 0x3030 }, { 0x3036, 0x3037 }, { 0x303D, 0x303F }, { 0x3099, 0x309C }, { 0x30A0, 0x30A0 }, { 0x30FB, 0x30FB }, { 0x3190, 0x319F }, { 0x3200, 0x321C }, { 0x3220, 0x3243 }, { 0x3251, 0x327B }, { 0x327F, 0x32CB }, { 0x32D0, 0x32FE }, { 0x3300, 0x3376 }, { 0x337B, 0x33DD }, { 0x33E0, 0x33FE }, { 0xA490, 0xA4C6 }, { 0xE000, 0xF8FF }, { 0xFB1E, 0xFB1E }, { 0xFB29, 0xFB29 }, { 0xFD3E, 0xFD3F }, { 0xFDFC, 0xFDFC }, { 0xFE00, 0xFE0F }, { 0xFE20, 0xFE23 }, { 0xFE30, 0xFE44 }, { 0xFE49, 0xFE52 }, { 0xFE54, 0xFE66 }, { 0xFE68, 0xFE6B }, { 0xFEFF, 0xFEFF }, { 0xFF01, 0xFF0F }, { 0xFF1A, 0xFF20 }, { 0xFF3B, 0xFF40 }, { 0xFF5B, 0xFF65 }, { 0xFFE0, 0xFFE6 }, { 0xFFE8, 0xFFEE }, { 0xFFF9, 0xFFFD }, { 0x00010320, 0x00010323 }, { 0x0001D000, 0x0001D0F5 }, { 0x0001D100, 0x0001D126 }, { 0x0001D12A, 0x0001D1DD }, { 0x0001D6C1, 0x0001D6C1 }, { 0x0001D6DB, 0x0001D6DB }, { 0x0001D6FB, 0x0001D6FB }, { 0x0001D715, 0x0001D715 }, { 0x0001D735, 0x0001D735 }, { 0x0001D74F, 0x0001D74F }, { 0x0001D76F, 0x0001D76F }, { 0x0001D789, 0x0001D789 }, { 0x0001D7A9, 0x0001D7A9 }, { 0x0001D7C3, 0x0001D7C3 }, { 0x000E0001, 0x000E0001 }, { 0x000E0020, 0x000E007F }, { 0x000F0000, 0x000FFFFD }, { 0x00100000, 0x0010FFFD } }; MAKE_ISW(punct) struct interval data_wctype_graph[]= { { 0x0021, 0x007E }, { 0x00A0, 0x0220 }, { 0x0222, 0x0233 }, { 0x0250, 0x02AD }, { 0x02B0, 0x02EE }, { 0x0300, 0x034F }, { 0x0360, 0x036F }, { 0x0374, 0x0375 }, { 0x037A, 0x037A }, { 0x037E, 0x037E }, { 0x0384, 0x038A }, { 0x038C, 0x038C }, { 0x038E, 0x03A1 }, { 0x03A3, 0x03CE }, { 0x03D0, 0x03F6 }, { 0x0400, 0x0486 }, { 0x0488, 0x04CE }, { 0x04D0, 0x04F5 }, { 0x04F8, 0x04F9 }, { 0x0500, 0x050F }, { 0x0531, 0x0556 }, { 0x0559, 0x055F }, { 0x0561, 0x0587 }, { 0x0589, 0x058A }, { 0x0591, 0x05A1 }, { 0x05A3, 0x05B9 }, { 0x05BB, 0x05C4 }, { 0x05D0, 0x05EA }, { 0x05F0, 0x05F4 }, { 0x060C, 0x060C }, { 0x061B, 0x061B }, { 0x061F, 0x061F }, { 0x0621, 0x063A }, { 0x0640, 0x0655 }, { 0x0660, 0x06ED }, { 0x06F0, 0x06FE }, { 0x0700, 0x070D }, { 0x070F, 0x072C }, { 0x0730, 0x074A }, { 0x0780, 0x07B1 }, { 0x0901, 0x0903 }, { 0x0905, 0x0939 }, { 0x093C, 0x094D }, { 0x0950, 0x0954 }, { 0x0958, 0x0970 }, { 0x0981, 0x0983 }, { 0x0985, 0x098C }, { 0x098F, 0x0990 }, { 0x0993, 0x09A8 }, { 0x09AA, 0x09B0 }, { 0x09B2, 0x09B2 }, { 0x09B6, 0x09B9 }, { 0x09BC, 0x09BC }, { 0x09BE, 0x09C4 }, { 0x09C7, 0x09C8 }, { 0x09CB, 0x09CD }, { 0x09D7, 0x09D7 }, { 0x09DC, 0x09DD }, { 0x09DF, 0x09E3 }, { 0x09E6, 0x09FA }, { 0x0A02, 0x0A02 }, { 0x0A05, 0x0A0A }, { 0x0A0F, 0x0A10 }, { 0x0A13, 0x0A28 }, { 0x0A2A, 0x0A30 }, { 0x0A32, 0x0A33 }, { 0x0A35, 0x0A36 }, { 0x0A38, 0x0A39 }, { 0x0A3C, 0x0A3C }, { 0x0A3E, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, { 0x0A59, 0x0A5C }, { 0x0A5E, 0x0A5E }, { 0x0A66, 0x0A74 }, { 0x0A81, 0x0A83 }, { 0x0A85, 0x0A8B }, { 0x0A8D, 0x0A8D }, { 0x0A8F, 0x0A91 }, { 0x0A93, 0x0AA8 }, { 0x0AAA, 0x0AB0 }, { 0x0AB2, 0x0AB3 }, { 0x0AB5, 0x0AB9 }, { 0x0ABC, 0x0AC5 }, { 0x0AC7, 0x0AC9 }, { 0x0ACB, 0x0ACD }, { 0x0AD0, 0x0AD0 }, { 0x0AE0, 0x0AE0 }, { 0x0AE6, 0x0AEF }, { 0x0B01, 0x0B03 }, { 0x0B05, 0x0B0C }, { 0x0B0F, 0x0B10 }, { 0x0B13, 0x0B28 }, { 0x0B2A, 0x0B30 }, { 0x0B32, 0x0B33 }, { 0x0B36, 0x0B39 }, { 0x0B3C, 0x0B43 }, { 0x0B47, 0x0B48 }, { 0x0B4B, 0x0B4D }, { 0x0B56, 0x0B57 }, { 0x0B5C, 0x0B5D }, { 0x0B5F, 0x0B61 }, { 0x0B66, 0x0B70 }, { 0x0B82, 0x0B83 }, { 0x0B85, 0x0B8A }, { 0x0B8E, 0x0B90 }, { 0x0B92, 0x0B95 }, { 0x0B99, 0x0B9A }, { 0x0B9C, 0x0B9C }, { 0x0B9E, 0x0B9F }, { 0x0BA3, 0x0BA4 }, { 0x0BA8, 0x0BAA }, { 0x0BAE, 0x0BB5 }, { 0x0BB7, 0x0BB9 }, { 0x0BBE, 0x0BC2 }, { 0x0BC6, 0x0BC8 }, { 0x0BCA, 0x0BCD }, { 0x0BD7, 0x0BD7 }, { 0x0BE7, 0x0BF2 }, { 0x0C01, 0x0C03 }, { 0x0C05, 0x0C0C }, { 0x0C0E, 0x0C10 }, { 0x0C12, 0x0C28 }, { 0x0C2A, 0x0C33 }, { 0x0C35, 0x0C39 }, { 0x0C3E, 0x0C44 }, { 0x0C46, 0x0C48 }, { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0C60, 0x0C61 }, { 0x0C66, 0x0C6F }, { 0x0C82, 0x0C83 }, { 0x0C85, 0x0C8C }, { 0x0C8E, 0x0C90 }, { 0x0C92, 0x0CA8 }, { 0x0CAA, 0x0CB3 }, { 0x0CB5, 0x0CB9 }, { 0x0CBE, 0x0CC4 }, { 0x0CC6, 0x0CC8 }, { 0x0CCA, 0x0CCD }, { 0x0CD5, 0x0CD6 }, { 0x0CDE, 0x0CDE }, { 0x0CE0, 0x0CE1 }, { 0x0CE6, 0x0CEF }, { 0x0D02, 0x0D03 }, { 0x0D05, 0x0D0C }, { 0x0D0E, 0x0D10 }, { 0x0D12, 0x0D28 }, { 0x0D2A, 0x0D39 }, { 0x0D3E, 0x0D43 }, { 0x0D46, 0x0D48 }, { 0x0D4A, 0x0D4D }, { 0x0D57, 0x0D57 }, { 0x0D60, 0x0D61 }, { 0x0D66, 0x0D6F }, { 0x0D82, 0x0D83 }, { 0x0D85, 0x0D96 }, { 0x0D9A, 0x0DB1 }, { 0x0DB3, 0x0DBB }, { 0x0DBD, 0x0DBD }, { 0x0DC0, 0x0DC6 }, { 0x0DCA, 0x0DCA }, { 0x0DCF, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0DD8, 0x0DDF }, { 0x0DF2, 0x0DF4 }, { 0x0E01, 0x0E3A }, { 0x0E3F, 0x0E5B }, { 0x0E81, 0x0E82 }, { 0x0E84, 0x0E84 }, { 0x0E87, 0x0E88 }, { 0x0E8A, 0x0E8A }, { 0x0E8D, 0x0E8D }, { 0x0E94, 0x0E97 }, { 0x0E99, 0x0E9F }, { 0x0EA1, 0x0EA3 }, { 0x0EA5, 0x0EA5 }, { 0x0EA7, 0x0EA7 }, { 0x0EAA, 0x0EAB }, { 0x0EAD, 0x0EB9 }, { 0x0EBB, 0x0EBD }, { 0x0EC0, 0x0EC4 }, { 0x0EC6, 0x0EC6 }, { 0x0EC8, 0x0ECD }, { 0x0ED0, 0x0ED9 }, { 0x0EDC, 0x0EDD }, { 0x0F00, 0x0F47 }, { 0x0F49, 0x0F6A }, { 0x0F71, 0x0F8B }, { 0x0F90, 0x0F97 }, { 0x0F99, 0x0FBC }, { 0x0FBE, 0x0FCC }, { 0x0FCF, 0x0FCF }, { 0x1000, 0x1021 }, { 0x1023, 0x1027 }, { 0x1029, 0x102A }, { 0x102C, 0x1032 }, { 0x1036, 0x1039 }, { 0x1040, 0x1059 }, { 0x10A0, 0x10C5 }, { 0x10D0, 0x10F8 }, { 0x10FB, 0x10FB }, { 0x1100, 0x1159 }, { 0x115F, 0x11A2 }, { 0x11A8, 0x11F9 }, { 0x1200, 0x1206 }, { 0x1208, 0x1246 }, { 0x1248, 0x1248 }, { 0x124A, 0x124D }, { 0x1250, 0x1256 }, { 0x1258, 0x1258 }, { 0x125A, 0x125D }, { 0x1260, 0x1286 }, { 0x1288, 0x1288 }, { 0x128A, 0x128D }, { 0x1290, 0x12AE }, { 0x12B0, 0x12B0 }, { 0x12B2, 0x12B5 }, { 0x12B8, 0x12BE }, { 0x12C0, 0x12C0 }, { 0x12C2, 0x12C5 }, { 0x12C8, 0x12CE }, { 0x12D0, 0x12D6 }, { 0x12D8, 0x12EE }, { 0x12F0, 0x130E }, { 0x1310, 0x1310 }, { 0x1312, 0x1315 }, { 0x1318, 0x131E }, { 0x1320, 0x1346 }, { 0x1348, 0x135A }, { 0x1361, 0x137C }, { 0x13A0, 0x13F4 }, { 0x1401, 0x1676 }, { 0x1681, 0x169C }, { 0x16A0, 0x16F0 }, { 0x1700, 0x170C }, { 0x170E, 0x1714 }, { 0x1720, 0x1736 }, { 0x1740, 0x1753 }, { 0x1760, 0x176C }, { 0x176E, 0x1770 }, { 0x1772, 0x1773 }, { 0x1780, 0x17DC }, { 0x17E0, 0x17E9 }, { 0x1800, 0x180E }, { 0x1810, 0x1819 }, { 0x1820, 0x1877 }, { 0x1880, 0x18A9 }, { 0x1E00, 0x1E9B }, { 0x1EA0, 0x1EF9 }, { 0x1F00, 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 }, { 0x2007, 0x2007 }, { 0x200C, 0x2027 }, { 0x202A, 0x2052 }, { 0x2057, 0x2057 }, { 0x2060, 0x2063 }, { 0x206A, 0x2071 }, { 0x2074, 0x208E }, { 0x20A0, 0x20B1 }, { 0x20D0, 0x20EA }, { 0x2100, 0x213A }, { 0x213D, 0x214B }, { 0x2153, 0x2183 }, { 0x2190, 0x23CE }, { 0x2400, 0x2426 }, { 0x2440, 0x244A }, { 0x2460, 0x24FE }, { 0x2500, 0x2613 }, { 0x2616, 0x2617 }, { 0x2619, 0x267D }, { 0x2680, 0x2689 }, { 0x2701, 0x2704 }, { 0x2706, 0x2709 }, { 0x270C, 0x2727 }, { 0x2729, 0x274B }, { 0x274D, 0x274D }, { 0x274F, 0x2752 }, { 0x2756, 0x2756 }, { 0x2758, 0x275E }, { 0x2761, 0x2794 }, { 0x2798, 0x27AF }, { 0x27B1, 0x27BE }, { 0x27D0, 0x27EB }, { 0x27F0, 0x2AFF }, { 0x2E80, 0x2E99 }, { 0x2E9B, 0x2EF3 }, { 0x2F00, 0x2FD5 }, { 0x2FF0, 0x2FFB }, { 0x3001, 0x303F }, { 0x3041, 0x3096 }, { 0x3099, 0x30FF }, { 0x3105, 0x312C }, { 0x3131, 0x318E }, { 0x3190, 0x31B7 }, { 0x31F0, 0x321C }, { 0x3220, 0x3243 }, { 0x3251, 0x327B }, { 0x327F, 0x32CB }, { 0x32D0, 0x32FE }, { 0x3300, 0x3376 }, { 0x337B, 0x33DD }, { 0x33E0, 0x33FE }, { 0x3400, 0x4DB5 }, { 0x4E00, 0x9FA5 }, { 0xA000, 0xA48C }, { 0xA490, 0xA4C6 }, { 0xAC00, 0xD7A3 }, { 0xE000, 0xFA2D }, { 0xFA30, 0xFA6A }, { 0xFB00, 0xFB06 }, { 0xFB13, 0xFB17 }, { 0xFB1D, 0xFB36 }, { 0xFB38, 0xFB3C }, { 0xFB3E, 0xFB3E }, { 0xFB40, 0xFB41 }, { 0xFB43, 0xFB44 }, { 0xFB46, 0xFBB1 }, { 0xFBD3, 0xFD3F }, { 0xFD50, 0xFD8F }, { 0xFD92, 0xFDC7 }, { 0xFDF0, 0xFDFC }, { 0xFE00, 0xFE0F }, { 0xFE20, 0xFE23 }, { 0xFE30, 0xFE46 }, { 0xFE49, 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 }, { 0x00010300, 0x0001031E }, { 0x00010320, 0x00010323 }, { 0x00010330, 0x0001034A }, { 0x00010400, 0x00010425 }, { 0x00010428, 0x0001044D }, { 0x0001D000, 0x0001D0F5 }, { 0x0001D100, 0x0001D126 }, { 0x0001D12A, 0x0001D1DD }, { 0x0001D400, 0x0001D454 }, { 0x0001D456, 0x0001D49C }, { 0x0001D49E, 0x0001D49F }, { 0x0001D4A2, 0x0001D4A2 }, { 0x0001D4A5, 0x0001D4A6 }, { 0x0001D4A9, 0x0001D4AC }, { 0x0001D4AE, 0x0001D4B9 }, { 0x0001D4BB, 0x0001D4BB }, { 0x0001D4BD, 0x0001D4C0 }, { 0x0001D4C2, 0x0001D4C3 }, { 0x0001D4C5, 0x0001D505 }, { 0x0001D507, 0x0001D50A }, { 0x0001D50D, 0x0001D514 }, { 0x0001D516, 0x0001D51C }, { 0x0001D51E, 0x0001D539 }, { 0x0001D53B, 0x0001D53E }, { 0x0001D540, 0x0001D544 }, { 0x0001D546, 0x0001D546 }, { 0x0001D54A, 0x0001D550 }, { 0x0001D552, 0x0001D6A3 }, { 0x0001D6A8, 0x0001D7C9 }, { 0x0001D7CE, 0x0001D7FF }, { 0x00020000, 0x0002A6D6 }, { 0x0002F800, 0x0002FA1D }, { 0x000E0001, 0x000E0001 }, { 0x000E0020, 0x000E007F }, { 0x000F0000, 0x000FFFFD }, { 0x00100000, 0x0010FFFD } }; MAKE_ISW(graph) struct interval data_wctype_print[]= { { 0x0020, 0x007E }, { 0x00A0, 0x0220 }, { 0x0222, 0x0233 }, { 0x0250, 0x02AD }, { 0x02B0, 0x02EE }, { 0x0300, 0x034F }, { 0x0360, 0x036F }, { 0x0374, 0x0375 }, { 0x037A, 0x037A }, { 0x037E, 0x037E }, { 0x0384, 0x038A }, { 0x038C, 0x038C }, { 0x038E, 0x03A1 }, { 0x03A3, 0x03CE }, { 0x03D0, 0x03F6 }, { 0x0400, 0x0486 }, { 0x0488, 0x04CE }, { 0x04D0, 0x04F5 }, { 0x04F8, 0x04F9 }, { 0x0500, 0x050F }, { 0x0531, 0x0556 }, { 0x0559, 0x055F }, { 0x0561, 0x0587 }, { 0x0589, 0x058A }, { 0x0591, 0x05A1 }, { 0x05A3, 0x05B9 }, { 0x05BB, 0x05C4 }, { 0x05D0, 0x05EA }, { 0x05F0, 0x05F4 }, { 0x060C, 0x060C }, { 0x061B, 0x061B }, { 0x061F, 0x061F }, { 0x0621, 0x063A }, { 0x0640, 0x0655 }, { 0x0660, 0x06ED }, { 0x06F0, 0x06FE }, { 0x0700, 0x070D }, { 0x070F, 0x072C }, { 0x0730, 0x074A }, { 0x0780, 0x07B1 }, { 0x0901, 0x0903 }, { 0x0905, 0x0939 }, { 0x093C, 0x094D }, { 0x0950, 0x0954 }, { 0x0958, 0x0970 }, { 0x0981, 0x0983 }, { 0x0985, 0x098C }, { 0x098F, 0x0990 }, { 0x0993, 0x09A8 }, { 0x09AA, 0x09B0 }, { 0x09B2, 0x09B2 }, { 0x09B6, 0x09B9 }, { 0x09BC, 0x09BC }, { 0x09BE, 0x09C4 }, { 0x09C7, 0x09C8 }, { 0x09CB, 0x09CD }, { 0x09D7, 0x09D7 }, { 0x09DC, 0x09DD }, { 0x09DF, 0x09E3 }, { 0x09E6, 0x09FA }, { 0x0A02, 0x0A02 }, { 0x0A05, 0x0A0A }, { 0x0A0F, 0x0A10 }, { 0x0A13, 0x0A28 }, { 0x0A2A, 0x0A30 }, { 0x0A32, 0x0A33 }, { 0x0A35, 0x0A36 }, { 0x0A38, 0x0A39 }, { 0x0A3C, 0x0A3C }, { 0x0A3E, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, { 0x0A59, 0x0A5C }, { 0x0A5E, 0x0A5E }, { 0x0A66, 0x0A74 }, { 0x0A81, 0x0A83 }, { 0x0A85, 0x0A8B }, { 0x0A8D, 0x0A8D }, { 0x0A8F, 0x0A91 }, { 0x0A93, 0x0AA8 }, { 0x0AAA, 0x0AB0 }, { 0x0AB2, 0x0AB3 }, { 0x0AB5, 0x0AB9 }, { 0x0ABC, 0x0AC5 }, { 0x0AC7, 0x0AC9 }, { 0x0ACB, 0x0ACD }, { 0x0AD0, 0x0AD0 }, { 0x0AE0, 0x0AE0 }, { 0x0AE6, 0x0AEF }, { 0x0B01, 0x0B03 }, { 0x0B05, 0x0B0C }, { 0x0B0F, 0x0B10 }, { 0x0B13, 0x0B28 }, { 0x0B2A, 0x0B30 }, { 0x0B32, 0x0B33 }, { 0x0B36, 0x0B39 }, { 0x0B3C, 0x0B43 }, { 0x0B47, 0x0B48 }, { 0x0B4B, 0x0B4D }, { 0x0B56, 0x0B57 }, { 0x0B5C, 0x0B5D }, { 0x0B5F, 0x0B61 }, { 0x0B66, 0x0B70 }, { 0x0B82, 0x0B83 }, { 0x0B85, 0x0B8A }, { 0x0B8E, 0x0B90 }, { 0x0B92, 0x0B95 }, { 0x0B99, 0x0B9A }, { 0x0B9C, 0x0B9C }, { 0x0B9E, 0x0B9F }, { 0x0BA3, 0x0BA4 }, { 0x0BA8, 0x0BAA }, { 0x0BAE, 0x0BB5 }, { 0x0BB7, 0x0BB9 }, { 0x0BBE, 0x0BC2 }, { 0x0BC6, 0x0BC8 }, { 0x0BCA, 0x0BCD }, { 0x0BD7, 0x0BD7 }, { 0x0BE7, 0x0BF2 }, { 0x0C01, 0x0C03 }, { 0x0C05, 0x0C0C }, { 0x0C0E, 0x0C10 }, { 0x0C12, 0x0C28 }, { 0x0C2A, 0x0C33 }, { 0x0C35, 0x0C39 }, { 0x0C3E, 0x0C44 }, { 0x0C46, 0x0C48 }, { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0C60, 0x0C61 }, { 0x0C66, 0x0C6F }, { 0x0C82, 0x0C83 }, { 0x0C85, 0x0C8C }, { 0x0C8E, 0x0C90 }, { 0x0C92, 0x0CA8 }, { 0x0CAA, 0x0CB3 }, { 0x0CB5, 0x0CB9 }, { 0x0CBE, 0x0CC4 }, { 0x0CC6, 0x0CC8 }, { 0x0CCA, 0x0CCD }, { 0x0CD5, 0x0CD6 }, { 0x0CDE, 0x0CDE }, { 0x0CE0, 0x0CE1 }, { 0x0CE6, 0x0CEF }, { 0x0D02, 0x0D03 }, { 0x0D05, 0x0D0C }, { 0x0D0E, 0x0D10 }, { 0x0D12, 0x0D28 }, { 0x0D2A, 0x0D39 }, { 0x0D3E, 0x0D43 }, { 0x0D46, 0x0D48 }, { 0x0D4A, 0x0D4D }, { 0x0D57, 0x0D57 }, { 0x0D60, 0x0D61 }, { 0x0D66, 0x0D6F }, { 0x0D82, 0x0D83 }, { 0x0D85, 0x0D96 }, { 0x0D9A, 0x0DB1 }, { 0x0DB3, 0x0DBB }, { 0x0DBD, 0x0DBD }, { 0x0DC0, 0x0DC6 }, { 0x0DCA, 0x0DCA }, { 0x0DCF, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0DD8, 0x0DDF }, { 0x0DF2, 0x0DF4 }, { 0x0E01, 0x0E3A }, { 0x0E3F, 0x0E5B }, { 0x0E81, 0x0E82 }, { 0x0E84, 0x0E84 }, { 0x0E87, 0x0E88 }, { 0x0E8A, 0x0E8A }, { 0x0E8D, 0x0E8D }, { 0x0E94, 0x0E97 }, { 0x0E99, 0x0E9F }, { 0x0EA1, 0x0EA3 }, { 0x0EA5, 0x0EA5 }, { 0x0EA7, 0x0EA7 }, { 0x0EAA, 0x0EAB }, { 0x0EAD, 0x0EB9 }, { 0x0EBB, 0x0EBD }, { 0x0EC0, 0x0EC4 }, { 0x0EC6, 0x0EC6 }, { 0x0EC8, 0x0ECD }, { 0x0ED0, 0x0ED9 }, { 0x0EDC, 0x0EDD }, { 0x0F00, 0x0F47 }, { 0x0F49, 0x0F6A }, { 0x0F71, 0x0F8B }, { 0x0F90, 0x0F97 }, { 0x0F99, 0x0FBC }, { 0x0FBE, 0x0FCC }, { 0x0FCF, 0x0FCF }, { 0x1000, 0x1021 }, { 0x1023, 0x1027 }, { 0x1029, 0x102A }, { 0x102C, 0x1032 }, { 0x1036, 0x1039 }, { 0x1040, 0x1059 }, { 0x10A0, 0x10C5 }, { 0x10D0, 0x10F8 }, { 0x10FB, 0x10FB }, { 0x1100, 0x1159 }, { 0x115F, 0x11A2 }, { 0x11A8, 0x11F9 }, { 0x1200, 0x1206 }, { 0x1208, 0x1246 }, { 0x1248, 0x1248 }, { 0x124A, 0x124D }, { 0x1250, 0x1256 }, { 0x1258, 0x1258 }, { 0x125A, 0x125D }, { 0x1260, 0x1286 }, { 0x1288, 0x1288 }, { 0x128A, 0x128D }, { 0x1290, 0x12AE }, { 0x12B0, 0x12B0 }, { 0x12B2, 0x12B5 }, { 0x12B8, 0x12BE }, { 0x12C0, 0x12C0 }, { 0x12C2, 0x12C5 }, { 0x12C8, 0x12CE }, { 0x12D0, 0x12D6 }, { 0x12D8, 0x12EE }, { 0x12F0, 0x130E }, { 0x1310, 0x1310 }, { 0x1312, 0x1315 }, { 0x1318, 0x131E }, { 0x1320, 0x1346 }, { 0x1348, 0x135A }, { 0x1361, 0x137C }, { 0x13A0, 0x13F4 }, { 0x1401, 0x1676 }, { 0x1680, 0x169C }, { 0x16A0, 0x16F0 }, { 0x1700, 0x170C }, { 0x170E, 0x1714 }, { 0x1720, 0x1736 }, { 0x1740, 0x1753 }, { 0x1760, 0x176C }, { 0x176E, 0x1770 }, { 0x1772, 0x1773 }, { 0x1780, 0x17DC }, { 0x17E0, 0x17E9 }, { 0x1800, 0x180E }, { 0x1810, 0x1819 }, { 0x1820, 0x1877 }, { 0x1880, 0x18A9 }, { 0x1E00, 0x1E9B }, { 0x1EA0, 0x1EF9 }, { 0x1F00, 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, 0x2027 }, { 0x202A, 0x2052 }, { 0x2057, 0x2057 }, { 0x205F, 0x2063 }, { 0x206A, 0x2071 }, { 0x2074, 0x208E }, { 0x20A0, 0x20B1 }, { 0x20D0, 0x20EA }, { 0x2100, 0x213A }, { 0x213D, 0x214B }, { 0x2153, 0x2183 }, { 0x2190, 0x23CE }, { 0x2400, 0x2426 }, { 0x2440, 0x244A }, { 0x2460, 0x24FE }, { 0x2500, 0x2613 }, { 0x2616, 0x2617 }, { 0x2619, 0x267D }, { 0x2680, 0x2689 }, { 0x2701, 0x2704 }, { 0x2706, 0x2709 }, { 0x270C, 0x2727 }, { 0x2729, 0x274B }, { 0x274D, 0x274D }, { 0x274F, 0x2752 }, { 0x2756, 0x2756 }, { 0x2758, 0x275E }, { 0x2761, 0x2794 }, { 0x2798, 0x27AF }, { 0x27B1, 0x27BE }, { 0x27D0, 0x27EB }, { 0x27F0, 0x2AFF }, { 0x2E80, 0x2E99 }, { 0x2E9B, 0x2EF3 }, { 0x2F00, 0x2FD5 }, { 0x2FF0, 0x2FFB }, { 0x3000, 0x303F }, { 0x3041, 0x3096 }, { 0x3099, 0x30FF }, { 0x3105, 0x312C }, { 0x3131, 0x318E }, { 0x3190, 0x31B7 }, { 0x31F0, 0x321C }, { 0x3220, 0x3243 }, { 0x3251, 0x327B }, { 0x327F, 0x32CB }, { 0x32D0, 0x32FE }, { 0x3300, 0x3376 }, { 0x337B, 0x33DD }, { 0x33E0, 0x33FE }, { 0x3400, 0x4DB5 }, { 0x4E00, 0x9FA5 }, { 0xA000, 0xA48C }, { 0xA490, 0xA4C6 }, { 0xAC00, 0xD7A3 }, { 0xE000, 0xFA2D }, { 0xFA30, 0xFA6A }, { 0xFB00, 0xFB06 }, { 0xFB13, 0xFB17 }, { 0xFB1D, 0xFB36 }, { 0xFB38, 0xFB3C }, { 0xFB3E, 0xFB3E }, { 0xFB40, 0xFB41 }, { 0xFB43, 0xFB44 }, { 0xFB46, 0xFBB1 }, { 0xFBD3, 0xFD3F }, { 0xFD50, 0xFD8F }, { 0xFD92, 0xFDC7 }, { 0xFDF0, 0xFDFC }, { 0xFE00, 0xFE0F }, { 0xFE20, 0xFE23 }, { 0xFE30, 0xFE46 }, { 0xFE49, 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 }, { 0x00010300, 0x0001031E }, { 0x00010320, 0x00010323 }, { 0x00010330, 0x0001034A }, { 0x00010400, 0x00010425 }, { 0x00010428, 0x0001044D }, { 0x0001D000, 0x0001D0F5 }, { 0x0001D100, 0x0001D126 }, { 0x0001D12A, 0x0001D1DD }, { 0x0001D400, 0x0001D454 }, { 0x0001D456, 0x0001D49C }, { 0x0001D49E, 0x0001D49F }, { 0x0001D4A2, 0x0001D4A2 }, { 0x0001D4A5, 0x0001D4A6 }, { 0x0001D4A9, 0x0001D4AC }, { 0x0001D4AE, 0x0001D4B9 }, { 0x0001D4BB, 0x0001D4BB }, { 0x0001D4BD, 0x0001D4C0 }, { 0x0001D4C2, 0x0001D4C3 }, { 0x0001D4C5, 0x0001D505 }, { 0x0001D507, 0x0001D50A }, { 0x0001D50D, 0x0001D514 }, { 0x0001D516, 0x0001D51C }, { 0x0001D51E, 0x0001D539 }, { 0x0001D53B, 0x0001D53E }, { 0x0001D540, 0x0001D544 }, { 0x0001D546, 0x0001D546 }, { 0x0001D54A, 0x0001D550 }, { 0x0001D552, 0x0001D6A3 }, { 0x0001D6A8, 0x0001D7C9 }, { 0x0001D7CE, 0x0001D7FF }, { 0x00020000, 0x0002A6D6 }, { 0x0002F800, 0x0002FA1D }, { 0x000E0001, 0x000E0001 }, { 0x000E0020, 0x000E007F }, { 0x000F0000, 0x000FFFFD }, { 0x00100000, 0x0010FFFD } }; MAKE_ISW(print) struct interval data_wctype_xdigit[]= { { 0x0030, 0x0039 }, { 0x0041, 0x0046 }, { 0x0061, 0x0066 } }; MAKE_ISW(xdigit) struct interval data_wctype_blank[]= { { 0x0009, 0x0009 }, { 0x0020, 0x0020 }, { 0x1680, 0x1680 }, { 0x2000, 0x2006 }, { 0x2008, 0x200B }, { 0x205F, 0x205F }, { 0x3000, 0x3000 } }; MAKE_ISW(blank) /* Conversion functions */ static struct interval data_wctype_toupper[]= { { 0x0061, 0x0041 }, { 0x0062, 0x0042 }, { 0x0063, 0x0043 }, { 0x0064, 0x0044 }, { 0x0065, 0x0045 }, { 0x0066, 0x0046 }, { 0x0067, 0x0047 }, { 0x0068, 0x0048 }, { 0x0069, 0x0049 }, { 0x006A, 0x004A }, { 0x006B, 0x004B }, { 0x006C, 0x004C }, { 0x006D, 0x004D }, { 0x006E, 0x004E }, { 0x006F, 0x004F }, { 0x0070, 0x0050 }, { 0x0071, 0x0051 }, { 0x0072, 0x0052 }, { 0x0073, 0x0053 }, { 0x0074, 0x0054 }, { 0x0075, 0x0055 }, { 0x0076, 0x0056 }, { 0x0077, 0x0057 }, { 0x0078, 0x0058 }, { 0x0079, 0x0059 }, { 0x007A, 0x005A }, { 0x00B5, 0x039C }, { 0x00E0, 0x00C0 }, { 0x00E1, 0x00C1 }, { 0x00E2, 0x00C2 }, { 0x00E3, 0x00C3 }, { 0x00E4, 0x00C4 }, { 0x00E5, 0x00C5 }, { 0x00E6, 0x00C6 }, { 0x00E7, 0x00C7 }, { 0x00E8, 0x00C8 }, { 0x00E9, 0x00C9 }, { 0x00EA, 0x00CA }, { 0x00EB, 0x00CB }, { 0x00EC, 0x00CC }, { 0x00ED, 0x00CD }, { 0x00EE, 0x00CE }, { 0x00EF, 0x00CF }, { 0x00F0, 0x00D0 }, { 0x00F1, 0x00D1 }, { 0x00F2, 0x00D2 }, { 0x00F3, 0x00D3 }, { 0x00F4, 0x00D4 }, { 0x00F5, 0x00D5 }, { 0x00F6, 0x00D6 }, { 0x00F8, 0x00D8 }, { 0x00F9, 0x00D9 }, { 0x00FA, 0x00DA }, { 0x00FB, 0x00DB }, { 0x00FC, 0x00DC }, { 0x00FD, 0x00DD }, { 0x00FE, 0x00DE }, { 0x00FF, 0x0178 }, { 0x0101, 0x0100 }, { 0x0103, 0x0102 }, { 0x0105, 0x0104 }, { 0x0107, 0x0106 }, { 0x0109, 0x0108 }, { 0x010B, 0x010A }, { 0x010D, 0x010C }, { 0x010F, 0x010E }, { 0x0111, 0x0110 }, { 0x0113, 0x0112 }, { 0x0115, 0x0114 }, { 0x0117, 0x0116 }, { 0x0119, 0x0118 }, { 0x011B, 0x011A }, { 0x011D, 0x011C }, { 0x011F, 0x011E }, { 0x0121, 0x0120 }, { 0x0123, 0x0122 }, { 0x0125, 0x0124 }, { 0x0127, 0x0126 }, { 0x0129, 0x0128 }, { 0x012B, 0x012A }, { 0x012D, 0x012C }, { 0x012F, 0x012E }, { 0x0131, 0x0049 }, { 0x0133, 0x0132 }, { 0x0135, 0x0134 }, { 0x0137, 0x0136 }, { 0x013A, 0x0139 }, { 0x013C, 0x013B }, { 0x013E, 0x013D }, { 0x0140, 0x013F }, { 0x0142, 0x0141 }, { 0x0144, 0x0143 }, { 0x0146, 0x0145 }, { 0x0148, 0x0147 }, { 0x014B, 0x014A }, { 0x014D, 0x014C }, { 0x014F, 0x014E }, { 0x0151, 0x0150 }, { 0x0153, 0x0152 }, { 0x0155, 0x0154 }, { 0x0157, 0x0156 }, { 0x0159, 0x0158 }, { 0x015B, 0x015A }, { 0x015D, 0x015C }, { 0x015F, 0x015E }, { 0x0161, 0x0160 }, { 0x0163, 0x0162 }, { 0x0165, 0x0164 }, { 0x0167, 0x0166 }, { 0x0169, 0x0168 }, { 0x016B, 0x016A }, { 0x016D, 0x016C }, { 0x016F, 0x016E }, { 0x0171, 0x0170 }, { 0x0173, 0x0172 }, { 0x0175, 0x0174 }, { 0x0177, 0x0176 }, { 0x017A, 0x0179 }, { 0x017C, 0x017B }, { 0x017E, 0x017D }, { 0x017F, 0x0053 }, { 0x0183, 0x0182 }, { 0x0185, 0x0184 }, { 0x0188, 0x0187 }, { 0x018C, 0x018B }, { 0x0192, 0x0191 }, { 0x0195, 0x01F6 }, { 0x0199, 0x0198 }, { 0x019E, 0x0220 }, { 0x01A1, 0x01A0 }, { 0x01A3, 0x01A2 }, { 0x01A5, 0x01A4 }, { 0x01A8, 0x01A7 }, { 0x01AD, 0x01AC }, { 0x01B0, 0x01AF }, { 0x01B4, 0x01B3 }, { 0x01B6, 0x01B5 }, { 0x01B9, 0x01B8 }, { 0x01BD, 0x01BC }, { 0x01BF, 0x01F7 }, { 0x01C5, 0x01C4 }, { 0x01C6, 0x01C4 }, { 0x01C8, 0x01C7 }, { 0x01C9, 0x01C7 }, { 0x01CB, 0x01CA }, { 0x01CC, 0x01CA }, { 0x01CE, 0x01CD }, { 0x01D0, 0x01CF }, { 0x01D2, 0x01D1 }, { 0x01D4, 0x01D3 }, { 0x01D6, 0x01D5 }, { 0x01D8, 0x01D7 }, { 0x01DA, 0x01D9 }, { 0x01DC, 0x01DB }, { 0x01DD, 0x018E }, { 0x01DF, 0x01DE }, { 0x01E1, 0x01E0 }, { 0x01E3, 0x01E2 }, { 0x01E5, 0x01E4 }, { 0x01E7, 0x01E6 }, { 0x01E9, 0x01E8 }, { 0x01EB, 0x01EA }, { 0x01ED, 0x01EC }, { 0x01EF, 0x01EE }, { 0x01F2, 0x01F1 }, { 0x01F3, 0x01F1 }, { 0x01F5, 0x01F4 }, { 0x01F9, 0x01F8 }, { 0x01FB, 0x01FA }, { 0x01FD, 0x01FC }, { 0x01FF, 0x01FE }, { 0x0201, 0x0200 }, { 0x0203, 0x0202 }, { 0x0205, 0x0204 }, { 0x0207, 0x0206 }, { 0x0209, 0x0208 }, { 0x020B, 0x020A }, { 0x020D, 0x020C }, { 0x020F, 0x020E }, { 0x0211, 0x0210 }, { 0x0213, 0x0212 }, { 0x0215, 0x0214 }, { 0x0217, 0x0216 }, { 0x0219, 0x0218 }, { 0x021B, 0x021A }, { 0x021D, 0x021C }, { 0x021F, 0x021E }, { 0x0223, 0x0222 }, { 0x0225, 0x0224 }, { 0x0227, 0x0226 }, { 0x0229, 0x0228 }, { 0x022B, 0x022A }, { 0x022D, 0x022C }, { 0x022F, 0x022E }, { 0x0231, 0x0230 }, { 0x0233, 0x0232 }, { 0x0253, 0x0181 }, { 0x0254, 0x0186 }, { 0x0256, 0x0189 }, { 0x0257, 0x018A }, { 0x0259, 0x018F }, { 0x025B, 0x0190 }, { 0x0260, 0x0193 }, { 0x0263, 0x0194 }, { 0x0268, 0x0197 }, { 0x0269, 0x0196 }, { 0x026F, 0x019C }, { 0x0272, 0x019D }, { 0x0275, 0x019F }, { 0x0280, 0x01A6 }, { 0x0283, 0x01A9 }, { 0x0288, 0x01AE }, { 0x028A, 0x01B1 }, { 0x028B, 0x01B2 }, { 0x0292, 0x01B7 }, { 0x0345, 0x0399 }, { 0x03AC, 0x0386 }, { 0x03AD, 0x0388 }, { 0x03AE, 0x0389 }, { 0x03AF, 0x038A }, { 0x03B1, 0x0391 }, { 0x03B2, 0x0392 }, { 0x03B3, 0x0393 }, { 0x03B4, 0x0394 }, { 0x03B5, 0x0395 }, { 0x03B6, 0x0396 }, { 0x03B7, 0x0397 }, { 0x03B8, 0x0398 }, { 0x03B9, 0x0399 }, { 0x03BA, 0x039A }, { 0x03BB, 0x039B }, { 0x03BC, 0x039C }, { 0x03BD, 0x039D }, { 0x03BE, 0x039E }, { 0x03BF, 0x039F }, { 0x03C0, 0x03A0 }, { 0x03C1, 0x03A1 }, { 0x03C2, 0x03A3 }, { 0x03C3, 0x03A3 }, { 0x03C4, 0x03A4 }, { 0x03C5, 0x03A5 }, { 0x03C6, 0x03A6 }, { 0x03C7, 0x03A7 }, { 0x03C8, 0x03A8 }, { 0x03C9, 0x03A9 }, { 0x03CA, 0x03AA }, { 0x03CB, 0x03AB }, { 0x03CC, 0x038C }, { 0x03CD, 0x038E }, { 0x03CE, 0x038F }, { 0x03D0, 0x0392 }, { 0x03D1, 0x0398 }, { 0x03D5, 0x03A6 }, { 0x03D6, 0x03A0 }, { 0x03D9, 0x03D8 }, { 0x03DB, 0x03DA }, { 0x03DD, 0x03DC }, { 0x03DF, 0x03DE }, { 0x03E1, 0x03E0 }, { 0x03E3, 0x03E2 }, { 0x03E5, 0x03E4 }, { 0x03E7, 0x03E6 }, { 0x03E9, 0x03E8 }, { 0x03EB, 0x03EA }, { 0x03ED, 0x03EC }, { 0x03EF, 0x03EE }, { 0x03F0, 0x039A }, { 0x03F1, 0x03A1 }, { 0x03F2, 0x03A3 }, { 0x03F5, 0x0395 }, { 0x0430, 0x0410 }, { 0x0431, 0x0411 }, { 0x0432, 0x0412 }, { 0x0433, 0x0413 }, { 0x0434, 0x0414 }, { 0x0435, 0x0415 }, { 0x0436, 0x0416 }, { 0x0437, 0x0417 }, { 0x0438, 0x0418 }, { 0x0439, 0x0419 }, { 0x043A, 0x041A }, { 0x043B, 0x041B }, { 0x043C, 0x041C }, { 0x043D, 0x041D }, { 0x043E, 0x041E }, { 0x043F, 0x041F }, { 0x0440, 0x0420 }, { 0x0441, 0x0421 }, { 0x0442, 0x0422 }, { 0x0443, 0x0423 }, { 0x0444, 0x0424 }, { 0x0445, 0x0425 }, { 0x0446, 0x0426 }, { 0x0447, 0x0427 }, { 0x0448, 0x0428 }, { 0x0449, 0x0429 }, { 0x044A, 0x042A }, { 0x044B, 0x042B }, { 0x044C, 0x042C }, { 0x044D, 0x042D }, { 0x044E, 0x042E }, { 0x044F, 0x042F }, { 0x0450, 0x0400 }, { 0x0451, 0x0401 }, { 0x0452, 0x0402 }, { 0x0453, 0x0403 }, { 0x0454, 0x0404 }, { 0x0455, 0x0405 }, { 0x0456, 0x0406 }, { 0x0457, 0x0407 }, { 0x0458, 0x0408 }, { 0x0459, 0x0409 }, { 0x045A, 0x040A }, { 0x045B, 0x040B }, { 0x045C, 0x040C }, { 0x045D, 0x040D }, { 0x045E, 0x040E }, { 0x045F, 0x040F }, { 0x0461, 0x0460 }, { 0x0463, 0x0462 }, { 0x0465, 0x0464 }, { 0x0467, 0x0466 }, { 0x0469, 0x0468 }, { 0x046B, 0x046A }, { 0x046D, 0x046C }, { 0x046F, 0x046E }, { 0x0471, 0x0470 }, { 0x0473, 0x0472 }, { 0x0475, 0x0474 }, { 0x0477, 0x0476 }, { 0x0479, 0x0478 }, { 0x047B, 0x047A }, { 0x047D, 0x047C }, { 0x047F, 0x047E }, { 0x0481, 0x0480 }, { 0x048B, 0x048A }, { 0x048D, 0x048C }, { 0x048F, 0x048E }, { 0x0491, 0x0490 }, { 0x0493, 0x0492 }, { 0x0495, 0x0494 }, { 0x0497, 0x0496 }, { 0x0499, 0x0498 }, { 0x049B, 0x049A }, { 0x049D, 0x049C }, { 0x049F, 0x049E }, { 0x04A1, 0x04A0 }, { 0x04A3, 0x04A2 }, { 0x04A5, 0x04A4 }, { 0x04A7, 0x04A6 }, { 0x04A9, 0x04A8 }, { 0x04AB, 0x04AA }, { 0x04AD, 0x04AC }, { 0x04AF, 0x04AE }, { 0x04B1, 0x04B0 }, { 0x04B3, 0x04B2 }, { 0x04B5, 0x04B4 }, { 0x04B7, 0x04B6 }, { 0x04B9, 0x04B8 }, { 0x04BB, 0x04BA }, { 0x04BD, 0x04BC }, { 0x04BF, 0x04BE }, { 0x04C2, 0x04C1 }, { 0x04C4, 0x04C3 }, { 0x04C6, 0x04C5 }, { 0x04C8, 0x04C7 }, { 0x04CA, 0x04C9 }, { 0x04CC, 0x04CB }, { 0x04CE, 0x04CD }, { 0x04D1, 0x04D0 }, { 0x04D3, 0x04D2 }, { 0x04D5, 0x04D4 }, { 0x04D7, 0x04D6 }, { 0x04D9, 0x04D8 }, { 0x04DB, 0x04DA }, { 0x04DD, 0x04DC }, { 0x04DF, 0x04DE }, { 0x04E1, 0x04E0 }, { 0x04E3, 0x04E2 }, { 0x04E5, 0x04E4 }, { 0x04E7, 0x04E6 }, { 0x04E9, 0x04E8 }, { 0x04EB, 0x04EA }, { 0x04ED, 0x04EC }, { 0x04EF, 0x04EE }, { 0x04F1, 0x04F0 }, { 0x04F3, 0x04F2 }, { 0x04F5, 0x04F4 }, { 0x04F9, 0x04F8 }, { 0x0501, 0x0500 }, { 0x0503, 0x0502 }, { 0x0505, 0x0504 }, { 0x0507, 0x0506 }, { 0x0509, 0x0508 }, { 0x050B, 0x050A }, { 0x050D, 0x050C }, { 0x050F, 0x050E }, { 0x0561, 0x0531 }, { 0x0562, 0x0532 }, { 0x0563, 0x0533 }, { 0x0564, 0x0534 }, { 0x0565, 0x0535 }, { 0x0566, 0x0536 }, { 0x0567, 0x0537 }, { 0x0568, 0x0538 }, { 0x0569, 0x0539 }, { 0x056A, 0x053A }, { 0x056B, 0x053B }, { 0x056C, 0x053C }, { 0x056D, 0x053D }, { 0x056E, 0x053E }, { 0x056F, 0x053F }, { 0x0570, 0x0540 }, { 0x0571, 0x0541 }, { 0x0572, 0x0542 }, { 0x0573, 0x0543 }, { 0x0574, 0x0544 }, { 0x0575, 0x0545 }, { 0x0576, 0x0546 }, { 0x0577, 0x0547 }, { 0x0578, 0x0548 }, { 0x0579, 0x0549 }, { 0x057A, 0x054A }, { 0x057B, 0x054B }, { 0x057C, 0x054C }, { 0x057D, 0x054D }, { 0x057E, 0x054E }, { 0x057F, 0x054F }, { 0x0580, 0x0550 }, { 0x0581, 0x0551 }, { 0x0582, 0x0552 }, { 0x0583, 0x0553 }, { 0x0584, 0x0554 }, { 0x0585, 0x0555 }, { 0x0586, 0x0556 }, { 0x1E01, 0x1E00 }, { 0x1E03, 0x1E02 }, { 0x1E05, 0x1E04 }, { 0x1E07, 0x1E06 }, { 0x1E09, 0x1E08 }, { 0x1E0B, 0x1E0A }, { 0x1E0D, 0x1E0C }, { 0x1E0F, 0x1E0E }, { 0x1E11, 0x1E10 }, { 0x1E13, 0x1E12 }, { 0x1E15, 0x1E14 }, { 0x1E17, 0x1E16 }, { 0x1E19, 0x1E18 }, { 0x1E1B, 0x1E1A }, { 0x1E1D, 0x1E1C }, { 0x1E1F, 0x1E1E }, { 0x1E21, 0x1E20 }, { 0x1E23, 0x1E22 }, { 0x1E25, 0x1E24 }, { 0x1E27, 0x1E26 }, { 0x1E29, 0x1E28 }, { 0x1E2B, 0x1E2A }, { 0x1E2D, 0x1E2C }, { 0x1E2F, 0x1E2E }, { 0x1E31, 0x1E30 }, { 0x1E33, 0x1E32 }, { 0x1E35, 0x1E34 }, { 0x1E37, 0x1E36 }, { 0x1E39, 0x1E38 }, { 0x1E3B, 0x1E3A }, { 0x1E3D, 0x1E3C }, { 0x1E3F, 0x1E3E }, { 0x1E41, 0x1E40 }, { 0x1E43, 0x1E42 }, { 0x1E45, 0x1E44 }, { 0x1E47, 0x1E46 }, { 0x1E49, 0x1E48 }, { 0x1E4B, 0x1E4A }, { 0x1E4D, 0x1E4C }, { 0x1E4F, 0x1E4E }, { 0x1E51, 0x1E50 }, { 0x1E53, 0x1E52 }, { 0x1E55, 0x1E54 }, { 0x1E57, 0x1E56 }, { 0x1E59, 0x1E58 }, { 0x1E5B, 0x1E5A }, { 0x1E5D, 0x1E5C }, { 0x1E5F, 0x1E5E }, { 0x1E61, 0x1E60 }, { 0x1E63, 0x1E62 }, { 0x1E65, 0x1E64 }, { 0x1E67, 0x1E66 }, { 0x1E69, 0x1E68 }, { 0x1E6B, 0x1E6A }, { 0x1E6D, 0x1E6C }, { 0x1E6F, 0x1E6E }, { 0x1E71, 0x1E70 }, { 0x1E73, 0x1E72 }, { 0x1E75, 0x1E74 }, { 0x1E77, 0x1E76 }, { 0x1E79, 0x1E78 }, { 0x1E7B, 0x1E7A }, { 0x1E7D, 0x1E7C }, { 0x1E7F, 0x1E7E }, { 0x1E81, 0x1E80 }, { 0x1E83, 0x1E82 }, { 0x1E85, 0x1E84 }, { 0x1E87, 0x1E86 }, { 0x1E89, 0x1E88 }, { 0x1E8B, 0x1E8A }, { 0x1E8D, 0x1E8C }, { 0x1E8F, 0x1E8E }, { 0x1E91, 0x1E90 }, { 0x1E93, 0x1E92 }, { 0x1E95, 0x1E94 }, { 0x1E9B, 0x1E60 }, { 0x1EA1, 0x1EA0 }, { 0x1EA3, 0x1EA2 }, { 0x1EA5, 0x1EA4 }, { 0x1EA7, 0x1EA6 }, { 0x1EA9, 0x1EA8 }, { 0x1EAB, 0x1EAA }, { 0x1EAD, 0x1EAC }, { 0x1EAF, 0x1EAE }, { 0x1EB1, 0x1EB0 }, { 0x1EB3, 0x1EB2 }, { 0x1EB5, 0x1EB4 }, { 0x1EB7, 0x1EB6 }, { 0x1EB9, 0x1EB8 }, { 0x1EBB, 0x1EBA }, { 0x1EBD, 0x1EBC }, { 0x1EBF, 0x1EBE }, { 0x1EC1, 0x1EC0 }, { 0x1EC3, 0x1EC2 }, { 0x1EC5, 0x1EC4 }, { 0x1EC7, 0x1EC6 }, { 0x1EC9, 0x1EC8 }, { 0x1ECB, 0x1ECA }, { 0x1ECD, 0x1ECC }, { 0x1ECF, 0x1ECE }, { 0x1ED1, 0x1ED0 }, { 0x1ED3, 0x1ED2 }, { 0x1ED5, 0x1ED4 }, { 0x1ED7, 0x1ED6 }, { 0x1ED9, 0x1ED8 }, { 0x1EDB, 0x1EDA }, { 0x1EDD, 0x1EDC }, { 0x1EDF, 0x1EDE }, { 0x1EE1, 0x1EE0 }, { 0x1EE3, 0x1EE2 }, { 0x1EE5, 0x1EE4 }, { 0x1EE7, 0x1EE6 }, { 0x1EE9, 0x1EE8 }, { 0x1EEB, 0x1EEA }, { 0x1EED, 0x1EEC }, { 0x1EEF, 0x1EEE }, { 0x1EF1, 0x1EF0 }, { 0x1EF3, 0x1EF2 }, { 0x1EF5, 0x1EF4 }, { 0x1EF7, 0x1EF6 }, { 0x1EF9, 0x1EF8 }, { 0x1F00, 0x1F08 }, { 0x1F01, 0x1F09 }, { 0x1F02, 0x1F0A }, { 0x1F03, 0x1F0B }, { 0x1F04, 0x1F0C }, { 0x1F05, 0x1F0D }, { 0x1F06, 0x1F0E }, { 0x1F07, 0x1F0F }, { 0x1F10, 0x1F18 }, { 0x1F11, 0x1F19 }, { 0x1F12, 0x1F1A }, { 0x1F13, 0x1F1B }, { 0x1F14, 0x1F1C }, { 0x1F15, 0x1F1D }, { 0x1F20, 0x1F28 }, { 0x1F21, 0x1F29 }, { 0x1F22, 0x1F2A }, { 0x1F23, 0x1F2B }, { 0x1F24, 0x1F2C }, { 0x1F25, 0x1F2D }, { 0x1F26, 0x1F2E }, { 0x1F27, 0x1F2F }, { 0x1F30, 0x1F38 }, { 0x1F31, 0x1F39 }, { 0x1F32, 0x1F3A }, { 0x1F33, 0x1F3B }, { 0x1F34, 0x1F3C }, { 0x1F35, 0x1F3D }, { 0x1F36, 0x1F3E }, { 0x1F37, 0x1F3F }, { 0x1F40, 0x1F48 }, { 0x1F41, 0x1F49 }, { 0x1F42, 0x1F4A }, { 0x1F43, 0x1F4B }, { 0x1F44, 0x1F4C }, { 0x1F45, 0x1F4D }, { 0x1F51, 0x1F59 }, { 0x1F53, 0x1F5B }, { 0x1F55, 0x1F5D }, { 0x1F57, 0x1F5F }, { 0x1F60, 0x1F68 }, { 0x1F61, 0x1F69 }, { 0x1F62, 0x1F6A }, { 0x1F63, 0x1F6B }, { 0x1F64, 0x1F6C }, { 0x1F65, 0x1F6D }, { 0x1F66, 0x1F6E }, { 0x1F67, 0x1F6F }, { 0x1F70, 0x1FBA }, { 0x1F71, 0x1FBB }, { 0x1F72, 0x1FC8 }, { 0x1F73, 0x1FC9 }, { 0x1F74, 0x1FCA }, { 0x1F75, 0x1FCB }, { 0x1F76, 0x1FDA }, { 0x1F77, 0x1FDB }, { 0x1F78, 0x1FF8 }, { 0x1F79, 0x1FF9 }, { 0x1F7A, 0x1FEA }, { 0x1F7B, 0x1FEB }, { 0x1F7C, 0x1FFA }, { 0x1F7D, 0x1FFB }, { 0x1F80, 0x1F88 }, { 0x1F81, 0x1F89 }, { 0x1F82, 0x1F8A }, { 0x1F83, 0x1F8B }, { 0x1F84, 0x1F8C }, { 0x1F85, 0x1F8D }, { 0x1F86, 0x1F8E }, { 0x1F87, 0x1F8F }, { 0x1F90, 0x1F98 }, { 0x1F91, 0x1F99 }, { 0x1F92, 0x1F9A }, { 0x1F93, 0x1F9B }, { 0x1F94, 0x1F9C }, { 0x1F95, 0x1F9D }, { 0x1F96, 0x1F9E }, { 0x1F97, 0x1F9F }, { 0x1FA0, 0x1FA8 }, { 0x1FA1, 0x1FA9 }, { 0x1FA2, 0x1FAA }, { 0x1FA3, 0x1FAB }, { 0x1FA4, 0x1FAC }, { 0x1FA5, 0x1FAD }, { 0x1FA6, 0x1FAE }, { 0x1FA7, 0x1FAF }, { 0x1FB0, 0x1FB8 }, { 0x1FB1, 0x1FB9 }, { 0x1FB3, 0x1FBC }, { 0x1FBE, 0x0399 }, { 0x1FC3, 0x1FCC }, { 0x1FD0, 0x1FD8 }, { 0x1FD1, 0x1FD9 }, { 0x1FE0, 0x1FE8 }, { 0x1FE1, 0x1FE9 }, { 0x1FE5, 0x1FEC }, { 0x1FF3, 0x1FFC }, { 0x2170, 0x2160 }, { 0x2171, 0x2161 }, { 0x2172, 0x2162 }, { 0x2173, 0x2163 }, { 0x2174, 0x2164 }, { 0x2175, 0x2165 }, { 0x2176, 0x2166 }, { 0x2177, 0x2167 }, { 0x2178, 0x2168 }, { 0x2179, 0x2169 }, { 0x217A, 0x216A }, { 0x217B, 0x216B }, { 0x217C, 0x216C }, { 0x217D, 0x216D }, { 0x217E, 0x216E }, { 0x217F, 0x216F }, { 0x24D0, 0x24B6 }, { 0x24D1, 0x24B7 }, { 0x24D2, 0x24B8 }, { 0x24D3, 0x24B9 }, { 0x24D4, 0x24BA }, { 0x24D5, 0x24BB }, { 0x24D6, 0x24BC }, { 0x24D7, 0x24BD }, { 0x24D8, 0x24BE }, { 0x24D9, 0x24BF }, { 0x24DA, 0x24C0 }, { 0x24DB, 0x24C1 }, { 0x24DC, 0x24C2 }, { 0x24DD, 0x24C3 }, { 0x24DE, 0x24C4 }, { 0x24DF, 0x24C5 }, { 0x24E0, 0x24C6 }, { 0x24E1, 0x24C7 }, { 0x24E2, 0x24C8 }, { 0x24E3, 0x24C9 }, { 0x24E4, 0x24CA }, { 0x24E5, 0x24CB }, { 0x24E6, 0x24CC }, { 0x24E7, 0x24CD }, { 0x24E8, 0x24CE }, { 0x24E9, 0x24CF }, { 0xFF41, 0xFF21 }, { 0xFF42, 0xFF22 }, { 0xFF43, 0xFF23 }, { 0xFF44, 0xFF24 }, { 0xFF45, 0xFF25 }, { 0xFF46, 0xFF26 }, { 0xFF47, 0xFF27 }, { 0xFF48, 0xFF28 }, { 0xFF49, 0xFF29 }, { 0xFF4A, 0xFF2A }, { 0xFF4B, 0xFF2B }, { 0xFF4C, 0xFF2C }, { 0xFF4D, 0xFF2D }, { 0xFF4E, 0xFF2E }, { 0xFF4F, 0xFF2F }, { 0xFF50, 0xFF30 }, { 0xFF51, 0xFF31 }, { 0xFF52, 0xFF32 }, { 0xFF53, 0xFF33 }, { 0xFF54, 0xFF34 }, { 0xFF55, 0xFF35 }, { 0xFF56, 0xFF36 }, { 0xFF57, 0xFF37 }, { 0xFF58, 0xFF38 }, { 0xFF59, 0xFF39 }, { 0xFF5A, 0xFF3A }, { 0x00010428, 0x00010400 }, { 0x00010429, 0x00010401 }, { 0x0001042A, 0x00010402 }, { 0x0001042B, 0x00010403 }, { 0x0001042C, 0x00010404 }, { 0x0001042D, 0x00010405 }, { 0x0001042E, 0x00010406 }, { 0x0001042F, 0x00010407 }, { 0x00010430, 0x00010408 }, { 0x00010431, 0x00010409 }, { 0x00010432, 0x0001040A }, { 0x00010433, 0x0001040B }, { 0x00010434, 0x0001040C }, { 0x00010435, 0x0001040D }, { 0x00010436, 0x0001040E }, { 0x00010437, 0x0001040F }, { 0x00010438, 0x00010410 }, { 0x00010439, 0x00010411 }, { 0x0001043A, 0x00010412 }, { 0x0001043B, 0x00010413 }, { 0x0001043C, 0x00010414 }, { 0x0001043D, 0x00010415 }, { 0x0001043E, 0x00010416 }, { 0x0001043F, 0x00010417 }, { 0x00010440, 0x00010418 }, { 0x00010441, 0x00010419 }, { 0x00010442, 0x0001041A }, { 0x00010443, 0x0001041B }, { 0x00010444, 0x0001041C }, { 0x00010445, 0x0001041D }, { 0x00010446, 0x0001041E }, { 0x00010447, 0x0001041F }, { 0x00010448, 0x00010420 }, { 0x00010449, 0x00010421 }, { 0x0001044A, 0x00010422 }, { 0x0001044B, 0x00010423 }, { 0x0001044C, 0x00010424 }, { 0x0001044D, 0x00010425 } }; static struct interval *data_wctype_toupper_i; static int toupper_i_size; static int *toupper_cvt; int joe_towupper(struct charmap *foo,int c) { int idx; if (c>=0x61 && c<=0x7A) return c+0x41-0x61; else if(c<128) return c; if (!data_wctype_toupper_i) { int x; int y = -1; data_wctype_toupper_i = (struct interval *)joe_malloc(sizeof(data_wctype_toupper)); toupper_cvt = (int *)joe_malloc(sizeof(data_wctype_toupper)/sizeof(struct interval)*sizeof(int)); for (x=0;x!=sizeof(data_wctype_toupper)/sizeof(struct interval);++x) { if (y == -1 || data_wctype_toupper_i[y].first + 1 != data_wctype_toupper[x].first || toupper_cvt[y] != data_wctype_toupper[x].last - data_wctype_toupper[x].first) { ++y; data_wctype_toupper_i[y].first = data_wctype_toupper[x].first; data_wctype_toupper_i[y].last = data_wctype_toupper[x].first; toupper_cvt[y] = data_wctype_toupper[x].last - data_wctype_toupper[x].first; } else ++data_wctype_toupper_i[y].last; } toupper_i_size = y; } idx = bisearch(c, data_wctype_toupper_i, toupper_i_size); if (idx==-1) return c; else return c+toupper_cvt[idx]; } static struct interval data_wctype_tolower[]= { { 0x0041, 0x0061 }, { 0x0042, 0x0062 }, { 0x0043, 0x0063 }, { 0x0044, 0x0064 }, { 0x0045, 0x0065 }, { 0x0046, 0x0066 }, { 0x0047, 0x0067 }, { 0x0048, 0x0068 }, { 0x0049, 0x0069 }, { 0x004A, 0x006A }, { 0x004B, 0x006B }, { 0x004C, 0x006C }, { 0x004D, 0x006D }, { 0x004E, 0x006E }, { 0x004F, 0x006F }, { 0x0050, 0x0070 }, { 0x0051, 0x0071 }, { 0x0052, 0x0072 }, { 0x0053, 0x0073 }, { 0x0054, 0x0074 }, { 0x0055, 0x0075 }, { 0x0056, 0x0076 }, { 0x0057, 0x0077 }, { 0x0058, 0x0078 }, { 0x0059, 0x0079 }, { 0x005A, 0x007A }, { 0x00C0, 0x00E0 }, { 0x00C1, 0x00E1 }, { 0x00C2, 0x00E2 }, { 0x00C3, 0x00E3 }, { 0x00C4, 0x00E4 }, { 0x00C5, 0x00E5 }, { 0x00C6, 0x00E6 }, { 0x00C7, 0x00E7 }, { 0x00C8, 0x00E8 }, { 0x00C9, 0x00E9 }, { 0x00CA, 0x00EA }, { 0x00CB, 0x00EB }, { 0x00CC, 0x00EC }, { 0x00CD, 0x00ED }, { 0x00CE, 0x00EE }, { 0x00CF, 0x00EF }, { 0x00D0, 0x00F0 }, { 0x00D1, 0x00F1 }, { 0x00D2, 0x00F2 }, { 0x00D3, 0x00F3 }, { 0x00D4, 0x00F4 }, { 0x00D5, 0x00F5 }, { 0x00D6, 0x00F6 }, { 0x00D8, 0x00F8 }, { 0x00D9, 0x00F9 }, { 0x00DA, 0x00FA }, { 0x00DB, 0x00FB }, { 0x00DC, 0x00FC }, { 0x00DD, 0x00FD }, { 0x00DE, 0x00FE }, { 0x0100, 0x0101 }, { 0x0102, 0x0103 }, { 0x0104, 0x0105 }, { 0x0106, 0x0107 }, { 0x0108, 0x0109 }, { 0x010A, 0x010B }, { 0x010C, 0x010D }, { 0x010E, 0x010F }, { 0x0110, 0x0111 }, { 0x0112, 0x0113 }, { 0x0114, 0x0115 }, { 0x0116, 0x0117 }, { 0x0118, 0x0119 }, { 0x011A, 0x011B }, { 0x011C, 0x011D }, { 0x011E, 0x011F }, { 0x0120, 0x0121 }, { 0x0122, 0x0123 }, { 0x0124, 0x0125 }, { 0x0126, 0x0127 }, { 0x0128, 0x0129 }, { 0x012A, 0x012B }, { 0x012C, 0x012D }, { 0x012E, 0x012F }, { 0x0130, 0x0069 }, { 0x0132, 0x0133 }, { 0x0134, 0x0135 }, { 0x0136, 0x0137 }, { 0x0139, 0x013A }, { 0x013B, 0x013C }, { 0x013D, 0x013E }, { 0x013F, 0x0140 }, { 0x0141, 0x0142 }, { 0x0143, 0x0144 }, { 0x0145, 0x0146 }, { 0x0147, 0x0148 }, { 0x014A, 0x014B }, { 0x014C, 0x014D }, { 0x014E, 0x014F }, { 0x0150, 0x0151 }, { 0x0152, 0x0153 }, { 0x0154, 0x0155 }, { 0x0156, 0x0157 }, { 0x0158, 0x0159 }, { 0x015A, 0x015B }, { 0x015C, 0x015D }, { 0x015E, 0x015F }, { 0x0160, 0x0161 }, { 0x0162, 0x0163 }, { 0x0164, 0x0165 }, { 0x0166, 0x0167 }, { 0x0168, 0x0169 }, { 0x016A, 0x016B }, { 0x016C, 0x016D }, { 0x016E, 0x016F }, { 0x0170, 0x0171 }, { 0x0172, 0x0173 }, { 0x0174, 0x0175 }, { 0x0176, 0x0177 }, { 0x0178, 0x00FF }, { 0x0179, 0x017A }, { 0x017B, 0x017C }, { 0x017D, 0x017E }, { 0x0181, 0x0253 }, { 0x0182, 0x0183 }, { 0x0184, 0x0185 }, { 0x0186, 0x0254 }, { 0x0187, 0x0188 }, { 0x0189, 0x0256 }, { 0x018A, 0x0257 }, { 0x018B, 0x018C }, { 0x018E, 0x01DD }, { 0x018F, 0x0259 }, { 0x0190, 0x025B }, { 0x0191, 0x0192 }, { 0x0193, 0x0260 }, { 0x0194, 0x0263 }, { 0x0196, 0x0269 }, { 0x0197, 0x0268 }, { 0x0198, 0x0199 }, { 0x019C, 0x026F }, { 0x019D, 0x0272 }, { 0x019F, 0x0275 }, { 0x01A0, 0x01A1 }, { 0x01A2, 0x01A3 }, { 0x01A4, 0x01A5 }, { 0x01A6, 0x0280 }, { 0x01A7, 0x01A8 }, { 0x01A9, 0x0283 }, { 0x01AC, 0x01AD }, { 0x01AE, 0x0288 }, { 0x01AF, 0x01B0 }, { 0x01B1, 0x028A }, { 0x01B2, 0x028B }, { 0x01B3, 0x01B4 }, { 0x01B5, 0x01B6 }, { 0x01B7, 0x0292 }, { 0x01B8, 0x01B9 }, { 0x01BC, 0x01BD }, { 0x01C4, 0x01C6 }, { 0x01C5, 0x01C6 }, { 0x01C7, 0x01C9 }, { 0x01C8, 0x01C9 }, { 0x01CA, 0x01CC }, { 0x01CB, 0x01CC }, { 0x01CD, 0x01CE }, { 0x01CF, 0x01D0 }, { 0x01D1, 0x01D2 }, { 0x01D3, 0x01D4 }, { 0x01D5, 0x01D6 }, { 0x01D7, 0x01D8 }, { 0x01D9, 0x01DA }, { 0x01DB, 0x01DC }, { 0x01DE, 0x01DF }, { 0x01E0, 0x01E1 }, { 0x01E2, 0x01E3 }, { 0x01E4, 0x01E5 }, { 0x01E6, 0x01E7 }, { 0x01E8, 0x01E9 }, { 0x01EA, 0x01EB }, { 0x01EC, 0x01ED }, { 0x01EE, 0x01EF }, { 0x01F1, 0x01F3 }, { 0x01F2, 0x01F3 }, { 0x01F4, 0x01F5 }, { 0x01F6, 0x0195 }, { 0x01F7, 0x01BF }, { 0x01F8, 0x01F9 }, { 0x01FA, 0x01FB }, { 0x01FC, 0x01FD }, { 0x01FE, 0x01FF }, { 0x0200, 0x0201 }, { 0x0202, 0x0203 }, { 0x0204, 0x0205 }, { 0x0206, 0x0207 }, { 0x0208, 0x0209 }, { 0x020A, 0x020B }, { 0x020C, 0x020D }, { 0x020E, 0x020F }, { 0x0210, 0x0211 }, { 0x0212, 0x0213 }, { 0x0214, 0x0215 }, { 0x0216, 0x0217 }, { 0x0218, 0x0219 }, { 0x021A, 0x021B }, { 0x021C, 0x021D }, { 0x021E, 0x021F }, { 0x0220, 0x019E }, { 0x0222, 0x0223 }, { 0x0224, 0x0225 }, { 0x0226, 0x0227 }, { 0x0228, 0x0229 }, { 0x022A, 0x022B }, { 0x022C, 0x022D }, { 0x022E, 0x022F }, { 0x0230, 0x0231 }, { 0x0232, 0x0233 }, { 0x0386, 0x03AC }, { 0x0388, 0x03AD }, { 0x0389, 0x03AE }, { 0x038A, 0x03AF }, { 0x038C, 0x03CC }, { 0x038E, 0x03CD }, { 0x038F, 0x03CE }, { 0x0391, 0x03B1 }, { 0x0392, 0x03B2 }, { 0x0393, 0x03B3 }, { 0x0394, 0x03B4 }, { 0x0395, 0x03B5 }, { 0x0396, 0x03B6 }, { 0x0397, 0x03B7 }, { 0x0398, 0x03B8 }, { 0x0399, 0x03B9 }, { 0x039A, 0x03BA }, { 0x039B, 0x03BB }, { 0x039C, 0x03BC }, { 0x039D, 0x03BD }, { 0x039E, 0x03BE }, { 0x039F, 0x03BF }, { 0x03A0, 0x03C0 }, { 0x03A1, 0x03C1 }, { 0x03A3, 0x03C3 }, { 0x03A4, 0x03C4 }, { 0x03A5, 0x03C5 }, { 0x03A6, 0x03C6 }, { 0x03A7, 0x03C7 }, { 0x03A8, 0x03C8 }, { 0x03A9, 0x03C9 }, { 0x03AA, 0x03CA }, { 0x03AB, 0x03CB }, { 0x03D8, 0x03D9 }, { 0x03DA, 0x03DB }, { 0x03DC, 0x03DD }, { 0x03DE, 0x03DF }, { 0x03E0, 0x03E1 }, { 0x03E2, 0x03E3 }, { 0x03E4, 0x03E5 }, { 0x03E6, 0x03E7 }, { 0x03E8, 0x03E9 }, { 0x03EA, 0x03EB }, { 0x03EC, 0x03ED }, { 0x03EE, 0x03EF }, { 0x03F4, 0x03B8 }, { 0x0400, 0x0450 }, { 0x0401, 0x0451 }, { 0x0402, 0x0452 }, { 0x0403, 0x0453 }, { 0x0404, 0x0454 }, { 0x0405, 0x0455 }, { 0x0406, 0x0456 }, { 0x0407, 0x0457 }, { 0x0408, 0x0458 }, { 0x0409, 0x0459 }, { 0x040A, 0x045A }, { 0x040B, 0x045B }, { 0x040C, 0x045C }, { 0x040D, 0x045D }, { 0x040E, 0x045E }, { 0x040F, 0x045F }, { 0x0410, 0x0430 }, { 0x0411, 0x0431 }, { 0x0412, 0x0432 }, { 0x0413, 0x0433 }, { 0x0414, 0x0434 }, { 0x0415, 0x0435 }, { 0x0416, 0x0436 }, { 0x0417, 0x0437 }, { 0x0418, 0x0438 }, { 0x0419, 0x0439 }, { 0x041A, 0x043A }, { 0x041B, 0x043B }, { 0x041C, 0x043C }, { 0x041D, 0x043D }, { 0x041E, 0x043E }, { 0x041F, 0x043F }, { 0x0420, 0x0440 }, { 0x0421, 0x0441 }, { 0x0422, 0x0442 }, { 0x0423, 0x0443 }, { 0x0424, 0x0444 }, { 0x0425, 0x0445 }, { 0x0426, 0x0446 }, { 0x0427, 0x0447 }, { 0x0428, 0x0448 }, { 0x0429, 0x0449 }, { 0x042A, 0x044A }, { 0x042B, 0x044B }, { 0x042C, 0x044C }, { 0x042D, 0x044D }, { 0x042E, 0x044E }, { 0x042F, 0x044F }, { 0x0460, 0x0461 }, { 0x0462, 0x0463 }, { 0x0464, 0x0465 }, { 0x0466, 0x0467 }, { 0x0468, 0x0469 }, { 0x046A, 0x046B }, { 0x046C, 0x046D }, { 0x046E, 0x046F }, { 0x0470, 0x0471 }, { 0x0472, 0x0473 }, { 0x0474, 0x0475 }, { 0x0476, 0x0477 }, { 0x0478, 0x0479 }, { 0x047A, 0x047B }, { 0x047C, 0x047D }, { 0x047E, 0x047F }, { 0x0480, 0x0481 }, { 0x048A, 0x048B }, { 0x048C, 0x048D }, { 0x048E, 0x048F }, { 0x0490, 0x0491 }, { 0x0492, 0x0493 }, { 0x0494, 0x0495 }, { 0x0496, 0x0497 }, { 0x0498, 0x0499 }, { 0x049A, 0x049B }, { 0x049C, 0x049D }, { 0x049E, 0x049F }, { 0x04A0, 0x04A1 }, { 0x04A2, 0x04A3 }, { 0x04A4, 0x04A5 }, { 0x04A6, 0x04A7 }, { 0x04A8, 0x04A9 }, { 0x04AA, 0x04AB }, { 0x04AC, 0x04AD }, { 0x04AE, 0x04AF }, { 0x04B0, 0x04B1 }, { 0x04B2, 0x04B3 }, { 0x04B4, 0x04B5 }, { 0x04B6, 0x04B7 }, { 0x04B8, 0x04B9 }, { 0x04BA, 0x04BB }, { 0x04BC, 0x04BD }, { 0x04BE, 0x04BF }, { 0x04C1, 0x04C2 }, { 0x04C3, 0x04C4 }, { 0x04C5, 0x04C6 }, { 0x04C7, 0x04C8 }, { 0x04C9, 0x04CA }, { 0x04CB, 0x04CC }, { 0x04CD, 0x04CE }, { 0x04D0, 0x04D1 }, { 0x04D2, 0x04D3 }, { 0x04D4, 0x04D5 }, { 0x04D6, 0x04D7 }, { 0x04D8, 0x04D9 }, { 0x04DA, 0x04DB }, { 0x04DC, 0x04DD }, { 0x04DE, 0x04DF }, { 0x04E0, 0x04E1 }, { 0x04E2, 0x04E3 }, { 0x04E4, 0x04E5 }, { 0x04E6, 0x04E7 }, { 0x04E8, 0x04E9 }, { 0x04EA, 0x04EB }, { 0x04EC, 0x04ED }, { 0x04EE, 0x04EF }, { 0x04F0, 0x04F1 }, { 0x04F2, 0x04F3 }, { 0x04F4, 0x04F5 }, { 0x04F8, 0x04F9 }, { 0x0500, 0x0501 }, { 0x0502, 0x0503 }, { 0x0504, 0x0505 }, { 0x0506, 0x0507 }, { 0x0508, 0x0509 }, { 0x050A, 0x050B }, { 0x050C, 0x050D }, { 0x050E, 0x050F }, { 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 }, { 0x1E00, 0x1E01 }, { 0x1E02, 0x1E03 }, { 0x1E04, 0x1E05 }, { 0x1E06, 0x1E07 }, { 0x1E08, 0x1E09 }, { 0x1E0A, 0x1E0B }, { 0x1E0C, 0x1E0D }, { 0x1E0E, 0x1E0F }, { 0x1E10, 0x1E11 }, { 0x1E12, 0x1E13 }, { 0x1E14, 0x1E15 }, { 0x1E16, 0x1E17 }, { 0x1E18, 0x1E19 }, { 0x1E1A, 0x1E1B }, { 0x1E1C, 0x1E1D }, { 0x1E1E, 0x1E1F }, { 0x1E20, 0x1E21 }, { 0x1E22, 0x1E23 }, { 0x1E24, 0x1E25 }, { 0x1E26, 0x1E27 }, { 0x1E28, 0x1E29 }, { 0x1E2A, 0x1E2B }, { 0x1E2C, 0x1E2D }, { 0x1E2E, 0x1E2F }, { 0x1E30, 0x1E31 }, { 0x1E32, 0x1E33 }, { 0x1E34, 0x1E35 }, { 0x1E36, 0x1E37 }, { 0x1E38, 0x1E39 }, { 0x1E3A, 0x1E3B }, { 0x1E3C, 0x1E3D }, { 0x1E3E, 0x1E3F }, { 0x1E40, 0x1E41 }, { 0x1E42, 0x1E43 }, { 0x1E44, 0x1E45 }, { 0x1E46, 0x1E47 }, { 0x1E48, 0x1E49 }, { 0x1E4A, 0x1E4B }, { 0x1E4C, 0x1E4D }, { 0x1E4E, 0x1E4F }, { 0x1E50, 0x1E51 }, { 0x1E52, 0x1E53 }, { 0x1E54, 0x1E55 }, { 0x1E56, 0x1E57 }, { 0x1E58, 0x1E59 }, { 0x1E5A, 0x1E5B }, { 0x1E5C, 0x1E5D }, { 0x1E5E, 0x1E5F }, { 0x1E60, 0x1E61 }, { 0x1E62, 0x1E63 }, { 0x1E64, 0x1E65 }, { 0x1E66, 0x1E67 }, { 0x1E68, 0x1E69 }, { 0x1E6A, 0x1E6B }, { 0x1E6C, 0x1E6D }, { 0x1E6E, 0x1E6F }, { 0x1E70, 0x1E71 }, { 0x1E72, 0x1E73 }, { 0x1E74, 0x1E75 }, { 0x1E76, 0x1E77 }, { 0x1E78, 0x1E79 }, { 0x1E7A, 0x1E7B }, { 0x1E7C, 0x1E7D }, { 0x1E7E, 0x1E7F }, { 0x1E80, 0x1E81 }, { 0x1E82, 0x1E83 }, { 0x1E84, 0x1E85 }, { 0x1E86, 0x1E87 }, { 0x1E88, 0x1E89 }, { 0x1E8A, 0x1E8B }, { 0x1E8C, 0x1E8D }, { 0x1E8E, 0x1E8F }, { 0x1E90, 0x1E91 }, { 0x1E92, 0x1E93 }, { 0x1E94, 0x1E95 }, { 0x1EA0, 0x1EA1 }, { 0x1EA2, 0x1EA3 }, { 0x1EA4, 0x1EA5 }, { 0x1EA6, 0x1EA7 }, { 0x1EA8, 0x1EA9 }, { 0x1EAA, 0x1EAB }, { 0x1EAC, 0x1EAD }, { 0x1EAE, 0x1EAF }, { 0x1EB0, 0x1EB1 }, { 0x1EB2, 0x1EB3 }, { 0x1EB4, 0x1EB5 }, { 0x1EB6, 0x1EB7 }, { 0x1EB8, 0x1EB9 }, { 0x1EBA, 0x1EBB }, { 0x1EBC, 0x1EBD }, { 0x1EBE, 0x1EBF }, { 0x1EC0, 0x1EC1 }, { 0x1EC2, 0x1EC3 }, { 0x1EC4, 0x1EC5 }, { 0x1EC6, 0x1EC7 }, { 0x1EC8, 0x1EC9 }, { 0x1ECA, 0x1ECB }, { 0x1ECC, 0x1ECD }, { 0x1ECE, 0x1ECF }, { 0x1ED0, 0x1ED1 }, { 0x1ED2, 0x1ED3 }, { 0x1ED4, 0x1ED5 }, { 0x1ED6, 0x1ED7 }, { 0x1ED8, 0x1ED9 }, { 0x1EDA, 0x1EDB }, { 0x1EDC, 0x1EDD }, { 0x1EDE, 0x1EDF }, { 0x1EE0, 0x1EE1 }, { 0x1EE2, 0x1EE3 }, { 0x1EE4, 0x1EE5 }, { 0x1EE6, 0x1EE7 }, { 0x1EE8, 0x1EE9 }, { 0x1EEA, 0x1EEB }, { 0x1EEC, 0x1EED }, { 0x1EEE, 0x1EEF }, { 0x1EF0, 0x1EF1 }, { 0x1EF2, 0x1EF3 }, { 0x1EF4, 0x1EF5 }, { 0x1EF6, 0x1EF7 }, { 0x1EF8, 0x1EF9 }, { 0x1F08, 0x1F00 }, { 0x1F09, 0x1F01 }, { 0x1F0A, 0x1F02 }, { 0x1F0B, 0x1F03 }, { 0x1F0C, 0x1F04 }, { 0x1F0D, 0x1F05 }, { 0x1F0E, 0x1F06 }, { 0x1F0F, 0x1F07 }, { 0x1F18, 0x1F10 }, { 0x1F19, 0x1F11 }, { 0x1F1A, 0x1F12 }, { 0x1F1B, 0x1F13 }, { 0x1F1C, 0x1F14 }, { 0x1F1D, 0x1F15 }, { 0x1F28, 0x1F20 }, { 0x1F29, 0x1F21 }, { 0x1F2A, 0x1F22 }, { 0x1F2B, 0x1F23 }, { 0x1F2C, 0x1F24 }, { 0x1F2D, 0x1F25 }, { 0x1F2E, 0x1F26 }, { 0x1F2F, 0x1F27 }, { 0x1F38, 0x1F30 }, { 0x1F39, 0x1F31 }, { 0x1F3A, 0x1F32 }, { 0x1F3B, 0x1F33 }, { 0x1F3C, 0x1F34 }, { 0x1F3D, 0x1F35 }, { 0x1F3E, 0x1F36 }, { 0x1F3F, 0x1F37 }, { 0x1F48, 0x1F40 }, { 0x1F49, 0x1F41 }, { 0x1F4A, 0x1F42 }, { 0x1F4B, 0x1F43 }, { 0x1F4C, 0x1F44 }, { 0x1F4D, 0x1F45 }, { 0x1F59, 0x1F51 }, { 0x1F5B, 0x1F53 }, { 0x1F5D, 0x1F55 }, { 0x1F5F, 0x1F57 }, { 0x1F68, 0x1F60 }, { 0x1F69, 0x1F61 }, { 0x1F6A, 0x1F62 }, { 0x1F6B, 0x1F63 }, { 0x1F6C, 0x1F64 }, { 0x1F6D, 0x1F65 }, { 0x1F6E, 0x1F66 }, { 0x1F6F, 0x1F67 }, { 0x1F88, 0x1F80 }, { 0x1F89, 0x1F81 }, { 0x1F8A, 0x1F82 }, { 0x1F8B, 0x1F83 }, { 0x1F8C, 0x1F84 }, { 0x1F8D, 0x1F85 }, { 0x1F8E, 0x1F86 }, { 0x1F8F, 0x1F87 }, { 0x1F98, 0x1F90 }, { 0x1F99, 0x1F91 }, { 0x1F9A, 0x1F92 }, { 0x1F9B, 0x1F93 }, { 0x1F9C, 0x1F94 }, { 0x1F9D, 0x1F95 }, { 0x1F9E, 0x1F96 }, { 0x1F9F, 0x1F97 }, { 0x1FA8, 0x1FA0 }, { 0x1FA9, 0x1FA1 }, { 0x1FAA, 0x1FA2 }, { 0x1FAB, 0x1FA3 }, { 0x1FAC, 0x1FA4 }, { 0x1FAD, 0x1FA5 }, { 0x1FAE, 0x1FA6 }, { 0x1FAF, 0x1FA7 }, { 0x1FB8, 0x1FB0 }, { 0x1FB9, 0x1FB1 }, { 0x1FBA, 0x1F70 }, { 0x1FBB, 0x1F71 }, { 0x1FBC, 0x1FB3 }, { 0x1FC8, 0x1F72 }, { 0x1FC9, 0x1F73 }, { 0x1FCA, 0x1F74 }, { 0x1FCB, 0x1F75 }, { 0x1FCC, 0x1FC3 }, { 0x1FD8, 0x1FD0 }, { 0x1FD9, 0x1FD1 }, { 0x1FDA, 0x1F76 }, { 0x1FDB, 0x1F77 }, { 0x1FE8, 0x1FE0 }, { 0x1FE9, 0x1FE1 }, { 0x1FEA, 0x1F7A }, { 0x1FEB, 0x1F7B }, { 0x1FEC, 0x1FE5 }, { 0x1FF8, 0x1F78 }, { 0x1FF9, 0x1F79 }, { 0x1FFA, 0x1F7C }, { 0x1FFB, 0x1F7D }, { 0x1FFC, 0x1FF3 }, { 0x2126, 0x03C9 }, { 0x212A, 0x006B }, { 0x212B, 0x00E5 }, { 0x2160, 0x2170 }, { 0x2161, 0x2171 }, { 0x2162, 0x2172 }, { 0x2163, 0x2173 }, { 0x2164, 0x2174 }, { 0x2165, 0x2175 }, { 0x2166, 0x2176 }, { 0x2167, 0x2177 }, { 0x2168, 0x2178 }, { 0x2169, 0x2179 }, { 0x216A, 0x217A }, { 0x216B, 0x217B }, { 0x216C, 0x217C }, { 0x216D, 0x217D }, { 0x216E, 0x217E }, { 0x216F, 0x217F }, { 0x24B6, 0x24D0 }, { 0x24B7, 0x24D1 }, { 0x24B8, 0x24D2 }, { 0x24B9, 0x24D3 }, { 0x24BA, 0x24D4 }, { 0x24BB, 0x24D5 }, { 0x24BC, 0x24D6 }, { 0x24BD, 0x24D7 }, { 0x24BE, 0x24D8 }, { 0x24BF, 0x24D9 }, { 0x24C0, 0x24DA }, { 0x24C1, 0x24DB }, { 0x24C2, 0x24DC }, { 0x24C3, 0x24DD }, { 0x24C4, 0x24DE }, { 0x24C5, 0x24DF }, { 0x24C6, 0x24E0 }, { 0x24C7, 0x24E1 }, { 0x24C8, 0x24E2 }, { 0x24C9, 0x24E3 }, { 0x24CA, 0x24E4 }, { 0x24CB, 0x24E5 }, { 0x24CC, 0x24E6 }, { 0x24CD, 0x24E7 }, { 0x24CE, 0x24E8 }, { 0x24CF, 0x24E9 }, { 0xFF21, 0xFF41 }, { 0xFF22, 0xFF42 }, { 0xFF23, 0xFF43 }, { 0xFF24, 0xFF44 }, { 0xFF25, 0xFF45 }, { 0xFF26, 0xFF46 }, { 0xFF27, 0xFF47 }, { 0xFF28, 0xFF48 }, { 0xFF29, 0xFF49 }, { 0xFF2A, 0xFF4A }, { 0xFF2B, 0xFF4B }, { 0xFF2C, 0xFF4C }, { 0xFF2D, 0xFF4D }, { 0xFF2E, 0xFF4E }, { 0xFF2F, 0xFF4F }, { 0xFF30, 0xFF50 }, { 0xFF31, 0xFF51 }, { 0xFF32, 0xFF52 }, { 0xFF33, 0xFF53 }, { 0xFF34, 0xFF54 }, { 0xFF35, 0xFF55 }, { 0xFF36, 0xFF56 }, { 0xFF37, 0xFF57 }, { 0xFF38, 0xFF58 }, { 0xFF39, 0xFF59 }, { 0xFF3A, 0xFF5A }, { 0x00010400, 0x00010428 }, { 0x00010401, 0x00010429 }, { 0x00010402, 0x0001042A }, { 0x00010403, 0x0001042B }, { 0x00010404, 0x0001042C }, { 0x00010405, 0x0001042D }, { 0x00010406, 0x0001042E }, { 0x00010407, 0x0001042F }, { 0x00010408, 0x00010430 }, { 0x00010409, 0x00010431 }, { 0x0001040A, 0x00010432 }, { 0x0001040B, 0x00010433 }, { 0x0001040C, 0x00010434 }, { 0x0001040D, 0x00010435 }, { 0x0001040E, 0x00010436 }, { 0x0001040F, 0x00010437 }, { 0x00010410, 0x00010438 }, { 0x00010411, 0x00010439 }, { 0x00010412, 0x0001043A }, { 0x00010413, 0x0001043B }, { 0x00010414, 0x0001043C }, { 0x00010415, 0x0001043D }, { 0x00010416, 0x0001043E }, { 0x00010417, 0x0001043F }, { 0x00010418, 0x00010440 }, { 0x00010419, 0x00010441 }, { 0x0001041A, 0x00010442 }, { 0x0001041B, 0x00010443 }, { 0x0001041C, 0x00010444 }, { 0x0001041D, 0x00010445 }, { 0x0001041E, 0x00010446 }, { 0x0001041F, 0x00010447 }, { 0x00010420, 0x00010448 }, { 0x00010421, 0x00010449 }, { 0x00010422, 0x0001044A }, { 0x00010423, 0x0001044B }, { 0x00010424, 0x0001044C }, { 0x00010425, 0x0001044D } }; static struct interval *data_wctype_tolower_i; static int tolower_i_size; static int *tolower_cvt; int joe_towlower(struct charmap *foo,int c) { int idx; if (c>=0x41 && c<=0x5A) return c + 0x61 - 0x41; else if(c<128) return c; if (!data_wctype_tolower_i) { int x; int y = -1; data_wctype_tolower_i = (struct interval *)joe_malloc(sizeof(data_wctype_tolower)); tolower_cvt = (int *)joe_malloc(sizeof(data_wctype_tolower)/sizeof(struct interval)*sizeof(int)); for (x=0;x!=sizeof(data_wctype_tolower)/sizeof(struct interval);++x) { if (y == -1 || data_wctype_tolower_i[y].last + 1 != data_wctype_tolower[x].first || tolower_cvt[y] != data_wctype_tolower[x].last - data_wctype_tolower[x].first) { ++y; data_wctype_tolower_i[y].first = data_wctype_tolower[x].first; data_wctype_tolower_i[y].last = data_wctype_tolower[x].first; tolower_cvt[y] = data_wctype_tolower[x].last - data_wctype_tolower[x].first; } else ++data_wctype_tolower_i[y].last; } tolower_i_size = y; } idx = bisearch(c, data_wctype_tolower_i, tolower_i_size); if (idx==-1) return c; else return c+tolower_cvt[idx]; } /* Test the functions */ /* main(int argc,char *argv[]) { int c; sscanf(argv[1],"%x",&c); printf("Properties of character %x:\n",c); printf("upper=%x\n",joe_iswupper(NULL,c)); printf("lower=%x\n",joe_iswlower(NULL,c)); printf("alpha=%x\n",joe_iswalpha(NULL,c)); printf("digit=%x\n",joe_iswdigit(NULL,c)); printf("ctrl=%x\n",joe_iswctrl(NULL,c)); printf("punct=%x\n",joe_iswpunct(NULL,c)); printf("graph=%x\n",joe_iswgraph(NULL,c)); printf("print=%x\n",joe_iswprint(NULL,c)); printf("xdigit=%x\n",joe_iswxdigit(NULL,c)); printf("blank=%x\n",joe_iswblank(NULL,c)); printf("width=%x\n",joe_wcwidth(1,c)); printf("toupper=%x\n",joe_towupper(NULL,c)); printf("tolower=%x\n",joe_towlower(NULL,c)); } */ /* Return true if c is a control character which should not be displayed */ /* This should match mk_wcwidth() */ int unictrl(int ucs) { /* Control characters are one column wide in JOE */ if (ucs < 32 || ucs == 0x7F) return 1; if (ucs >= 0x80 && ucs <= 0x9F) return 4; /* More control characters... */ if (ucs>=0x200b && ucs<=0x206f) { if (ucs<=0x200f) return 6; if (ucs>=0x2028 && ucs<=0x202E) return 6; if (ucs>=0x2060 && ucs<=0x2063) return 6; if (ucs>=0x206a) return 6; } /* More control characters... */ if (ucs>=0xFDD0 && ucs<=0xFDEF) return 6; if (ucs==0xFEFF) return 6; if (ucs>=0xFFF9 && ucs<=0xFFFB) return 6; if (ucs>=0xFFFE && ucs<=0xFFFF) return 6; return 0; } joe-3.7/i18n.h0000644000100100007640000000175710431662534010020 00000000000000#ifndef _Ii18n #define _Ii18n 1 int joe_iswupper PARAMS((struct charmap *,int c)); int joe_iswlower PARAMS((struct charmap *,int c)); int joe_iswalpha PARAMS((struct charmap *,int c)); /* or _ */ int joe_iswalpha_ PARAMS((struct charmap *,int c)); int joe_iswalnum PARAMS((struct charmap *,int c)); int joe_iswalnum_ PARAMS((struct charmap *,int c)); int joe_iswdigit PARAMS((struct charmap *,int c)); int joe_iswspace PARAMS((struct charmap *,int c)); int joe_iswctrl PARAMS((struct charmap *,int c)); int joe_iswpunct PARAMS((struct charmap *,int c)); int joe_iswgraph PARAMS((struct charmap *,int c)); int joe_iswprint PARAMS((struct charmap *,int c)); int joe_iswxdigit PARAMS((struct charmap *,int c)); int joe_iswblank PARAMS((struct charmap *,int c)); int joe_wcwidth PARAMS((int wide,int c)); /* Looking for wswidth? Take a look at scrn.c/txtwidth() */ int joe_towupper PARAMS((struct charmap *,int c)); int joe_towlower PARAMS((struct charmap *,int c)); int unictrl PARAMS((int c)); #endif joe-3.7/poshist.c0000644000100100007640000000427610457276140010726 00000000000000/* * Position history * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" typedef struct pos POS; struct pos { LINK(POS) link; P *p; W *w; }; POS pos = { {&pos, &pos} }; POS frpos = { {&frpos, &frpos} }; 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, USTR "markpos"); 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 == ((BW *) w->t->curwin->object)->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 = (BW *) w->object; 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 == ((BW *) w->t->curwin->object)->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 = (BW *) w->object; if (bw->cursor->byte != curpos->p->byte) { pset(bw->cursor, curpos->p); } return 0; } else { return -1; } } joe-3.7/poshist.h0000644000100100007640000000051510431662534010721 00000000000000/* * Position history * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_POSHIST_H #define _JOE_POSHIST_H 1 void afterpos PARAMS((void)); void aftermove PARAMS((W *w, P *p)); void windie PARAMS((W *w)); int uprevpos PARAMS((BW *bw)); int unextpos PARAMS((BW *bw)); #endif joe-3.7/termcapj.h0000644000100100007640000001406310457273543011046 00000000000000/* * TERMCAP/TERMINFO header file * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_TERMCAP_H #define _JOE_TERMCAP_H 1 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 */ unsigned char *pad; /* Padding string or NULL to use NUL */ void (*out) (unsigned char *, unsigned char); /* Character output routine */ void *outptr; /* First arg passed to output routine. Second arg is character to write */ int dopadding; /* Set if pad characters should be used */ }; /* CAP *getcap(char *s,int baud,void (*out)(void *outptr,char c),void *outptr); * * 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 * 'outptr' is the passed as the first arg to 'out' * the second arg contains the char to output * * 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 *my_getcap PARAMS((unsigned char *name, unsigned int baud, void (*out) (unsigned char *, unsigned char), void *outptr)); /* CAP *setcap(CAP *cap,int baud,void (*out)(void *outptr,char c),void *outptr); * * Reset baud, out and outptr for a CAP */ CAP *setcap PARAMS((CAP *cap, unsigned int baud, void (*out) (unsigned char *, unsigned char), void *outptr)); /* 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. */ unsigned char *jgetstr PARAMS((CAP *cap, 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 PARAMS((CAP *cap, 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 PARAMS((CAP *cap, unsigned char *name)); /* void rmcap(CAP *cap); * * Eliminate a CAP entry. */ void rmcap PARAMS((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 PARAMS((CAP *cap, 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 PARAMS((CAP *cap, 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 PARAMS((CAP *cap, unsigned char *s, int a0, int a1, int a2, int a3)); /* Old termcap support */ #ifdef junk int tgetent(); unsigned char *tgetstr(); int tgetflag(); int tgetnum(); unsigned char *tgoto(); void tputs(); extern short ospeed; extern unsigned char PC, *UP, *BC; #endif extern int dopadding; extern unsigned char *joeterm; #endif joe-3.7/config.h0000644000100100007640000000017410431662534010476 00000000000000/* Configuration options for JOE */ #ifndef _Iconfig #define _Iconfig 1 #include "autoconf.h" #define MOUSE_XTERM 1 #endif joe-3.7/uformat.c0000644000100100007640000003644511101510604010674 00000000000000/* * User text formatting functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.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(bw->b->o.charmap, (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(bw->b->o.charmap, (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, USTR "ucenter"); 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 */ /* > is for mail/news * * is for C comments * / is for C++ comments * # is for shell script comments * % is for TeX comments */ static int cpara(BW *bw, int c) { int x; if (c == ' ' || c == '\t') return 1; if (bw->o.cpara) for (x = 0; bw->o.cpara[x]; ++x) if (bw->o.cpara[x] == c) return 1; return 0; #ifdef junk if (c == ' ' || c == '\t' || c == '\\' || c == '>' || c == '|' || c == ':' || c == '*' || c == '/' || c == ',' || c == '.' || c == '?' || c == ';' || c == ']' || c == '}' || c == '=' || c == '+' || c == '-' || c == '_' || c == ')' || c == '&' || c == '^' || c == '%' || c == '$' || c == '#' || c == '@' || c == '!' || c == '~') return 1; else return 0; #endif } /* Return true if line is definitly not a paragraph line. * Lines which arn't paragraph lines: * 1) Blank lines * 2) Lines which begin with '.' */ static int pisnpara(BW *bw, P *p) { P *q; int c; q = pdup(p, USTR "pisnpara"); p_goto_bol(q); while (cpara(bw, 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. Set first to include '-' and '*' bullets. */ static long nindent(BW *bw, P *p, int first) { P *q = pdup(p, USTR "nindent"); long col; int c; p_goto_bol(q); do { col = q->col; } while (cpara(bw, (c = pgetc(q)))); if (first && (c == '-' || c == '*')) { c = pgetc(q); if (c == ' ') { col = q->col; } } prm(q); return col; } /* Get indentation prefix column */ static long prefix(BW *bw, P *p,int up) { long len; P *q = pdup(p, USTR "prefix"); p_goto_bol(q); while (cpara(bw, brch(q))) pgetc(q); while (!pisbol(q)) { /* int c; */ if (!joe_isblank(p->b->o.charmap, ( /* c = */ prgetc(q)))) { /* if (up && (c == '*' || c == '-')) { if (!pisbol(q)) { c = prgetc(q); pgetc(q); if (c == ' ' || c == '\t') goto skip; } else goto skip; } pgetc(q); */ break; /* skip:; */ } } len = piscol(q); 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. */ int within = 0; P *pbop(BW *bw, P *p) { long indent; long prelen; P *last; p_goto_bol(p); indent = nindent(bw, p, 0); prelen = prefix(bw, p, 0); last = pdup(p, USTR "pbop"); while (!pisbof(p) && (!within || !markb || p->byte > markb->byte)) { long ind; long len; pprevl(p); p_goto_bol(p); ind = nindent(bw, p, 0); len = prefix(bw, p, 0); if (pisnpara(bw, p) || len != prelen) { pset(p, last); break; } if (ind > indent) { /* int ok = 1; P *q = pdup(p, USTR "pbop"); if (pprevl(q)) { p_goto_bol(q); if (nindent(bw, q, 0) == ind) ok = 0; } prm(q); if (!ok) pnextl(p); */ break; } if (ind < indent) { pset(p, last); break; /* if (pisbof(p)) { break; } pprevl(p); p_goto_bol(p); if (pisnpara(bw, p)) { pnextl(p); break; } else { pnextl(p); pnextl(p); break; } */ } pset(last, p); } prm(last); 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(BW *bw, P *p) { long indent; long prelen; if (!pnextl(p) || pisnpara(bw, p) || (within && markk && p->byte >= markk->byte)) return p; indent = nindent(bw, p, 0); prelen = prefix(bw, p, 0); while (pnextl(p) && (!within || !markk || p->byte < markk->byte)) { long ind = nindent(bw, p, 0); long len = prefix(bw, p, 0); if (ind != indent || len != prelen || pisnpara(bw, p)) break; } return p; } /* Motion commands */ int ubop(BW *bw) { P *q = pdup(bw->cursor, USTR "ubop"); up: while (pisnpara(bw, q) && !pisbof(q) && (!within || !markb || q->byte > markb->byte)) pprevl(q); pbop(bw, 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, USTR "ueop"); up: while (pisnpara(bw, q) && !piseof(q)) pnextl(q); pbop(bw, q); peop(bw, 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(BW *bw, P *p, long int indent, int french, int no_over, unsigned char *indents) { P *q; P *r; P *s; int rmf = 0; int c; long to = p->byte; int my_indents = 0; /* autoindent when called by utype */ if (!indents) { /* Get indentation prefix from beginning of line */ s = pdup(p, USTR "wrapword"); p_goto_bol(s); pbop(bw, s); /* Record indentation of second line of paragraph, of first * line if there is only one line */ q = pdup(s, USTR "wrapword"); pnextl(q); if (q->line < p->line) { /* Second line */ P *r = pdup(q, USTR "wrapword"); indent = nindent(bw, q, 0); pcol(r, indent); indents = brs(q, r->byte - q->byte); prm(r); } else { /* First line */ P *r = pdup(s, USTR "uformat"); int x, y; indent = nindent(bw, s, 1); pcol(r, indent); indents = brs(s, r->byte - s->byte); prm(r); if (!bw->o.autoindent) { /* Don't indent second line of single-line paragraphs if autoindent is off */ int x = zlen(indents); while (x && (indents[x - 1] == ' ' || indents[x - 1] == '\t')) indents[--x] = 0; if (x) { indents[x++] = ' '; indents[x] = 0; } indent = txtwidth1(bw->o.charmap, bw->o.tab, indents, x); } for (x = 0; indents[x] && (indents[x] == ' ' || indents[x] == '\t'); ++x); y = zlen(indents); while (y && (indents[y - 1] == ' ' || indents[y - 1] == '\t')) --y; /* Don't duplicate bullet */ /* if (y && (indents[y - 1] == '*' || indents[y - 1] == '-') && (y == 1 || indents[y - 2] == ' ' || indents[y - 2] == '\t')) indents[y - 1] = ' '; */ /* Fix C comment */ if (indents[x] == '/' && indents[x + 1] == '*') indents[x] = ' '; } if (bw->o.lmargin > indent) { int x; for (x = 0; indents[x] == ' ' || indents[x] == '\t'; ++x); if (!indents[x]) { joe_free(indents); indent = bw->o.lmargin; indents = joe_malloc(indent+1); for (x = 0; x != indent; ++x) indents[x] = ' '; indents[x] = 0; } } my_indents = 1; prm(q); prm(s); } /* if(!indents) { int f = 0; P *r = pdup(p); p_goto_bol(r); q = pdup(r); while(cpara(c = brc(q))) { if(!joe_isblank(c)) f = 1; pgetc(q); } if(f) { indents = brs(r, q->byte-r->byte); rmf = 1; if(indents[0] == '/' && indents[1] == '*') indents[0] = ' '; } prm(r); prm(q); } */ /* Get to beginning of word */ while (!pisbol(p) && piscol(p) > indent && !joe_isblank(p->b->o.charmap, 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, USTR "wrapword"); while (!pisbol(q)) if (!joe_isblank(p->b->o.charmap, (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); if (bw->o.flowed) { binsc(p, ' '); pgetc(p); ++to; } /* Move word to beginning of next line */ binsc(p, '\n'); /* When overtype is on, do not insert lines */ if (!no_over && p->b->o.overtype){ /* delete the next line break which is unnecessary */ r = pdup(p, USTR "wrapword"); /* p_goto_eol(r); */ pgetc(r); p_goto_eol(r); s = pdup(r, USTR "wrapword"); pgetc(r); bdel(s,r); binsc(r, ' '); /* Now we got to take care that all subsequent lines are not longer than the right margin */ /* Move cursor to right margin */ pfwrd(r, r->b->o.rmargin - r->col); /* Make a copy of the cursor and move the copied cursor to the end of the line */ prm(s); s = pdup(r, USTR "wrapword"); p_goto_eol(s); /* If s is located behind r then the line goes beyond the right margin and we need to call wordwrap() for that line. */ /* if (r->byte < s->byte){ wrapword(bw, r, indent, french, 1, indents); } */ prm(r); prm(s); } ++to; if (p->b->o.crlf) ++to; pgetc(p); /* Indent to left margin */ if (indents) { binss(p, indents); to += zlen(indents); } else while (indent--) { binsc(p, ' '); ++to; } if (rmf) joe_free(indents); } /* Move cursor back to original position */ pfwrd(p, to - p->byte); if (my_indents) joe_free(indents); } /* 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, USTR "uformat"); p_goto_bol(p); /* Do nothing if we're not on a paragraph line */ if (pisnpara(bw, 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(bw, p); curoff = bw->cursor->byte - p->byte; pset(bw->cursor, p); peop(bw, 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, USTR "uformat"); pnextl(q); if (q->line != bw->cursor->line) { P *r = pdup(q, USTR "uformat"); indent = nindent(bw, q, 0); pcol(r, indent); indents = brs(q, r->byte - q->byte); prm(r); } else { P *r = pdup(p, USTR "uformat"); int x, y; indent = nindent(bw, p, 1); /* allowing * and - here */ pcol(r, indent); indents = brs(p, r->byte - p->byte); prm(r); if (!bw->o.autoindent) { /* Don't indent second line of single-line paragraphs if autoindent is off */ int x = zlen(indents); while (x && (indents[x - 1] == ' ' || indents[x - 1] == '\t')) indents[--x] = 0; if (x) { indents[x++] = ' '; indents[x] = 0; } indent = txtwidth1(bw->o.charmap, bw->o.tab, indents, x); } for (x = 0; indents[x] && (indents[x] == ' ' || indents[x] == '\t'); ++x); y = zlen(indents); while (y && (indents[y - 1] == ' ' || indents[y - 1] == '\t')) --y; /* Don't duplicate if it looks like a bullet */ /* if (y && (indents[y - 1] == '*' || indents[y - 1] == '-') && (y == 1 || indents[y - 2] == ' ' || indents[y - 2] == '\t')) indents[y - 1] = ' '; */ /* Fix C comment */ if (indents[x] == '/' && indents[x + 1] == '*') indents[x] = ' '; } prm(q); /* But if the left margin is greater, we use that instead */ if (bw->o.lmargin > indent) { int x; for (x = 0; indents[x] == ' ' || indents[x] == '\t'; ++x); if (!indents[x]) { joe_free(indents); indent = bw->o.lmargin; indents = joe_malloc(indent+1); for (x = 0; x != indent; ++x) indents[x] = ' '; indents[x] = 0; } } /* 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, USTR "uformat"); 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(b->b->o.charmap, c) && piseolblank(b)) { prgetc(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(p->b->o.charmap,c)) { wrapword(bw, p, indent, bw->o.french, 1, indents); break; } } /* Do rest */ while (!piseof(b)) { c = brch(b); if (joe_isblank(b->b->o.charmap,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, USTR "uformat"); g=prgetc(d); if (g=='.' || g=='?' || g=='!') { f = 1; /* pset(d,b); pgetc(d); if (c == '\n' || piseol(d) || 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(bw, (c=brch(b)))) { if (b->byte == curoff) pset(bw->cursor, p); pgetc(b); } } if (joe_isblank(b->b->o.charmap,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(bw, p, indent, bw->o.french, 1, indents); } } binsc(p, '\n'); prm(p); brm(buf); joe_free(indents); return 0; } /* Format entire block */ int ufmtblk(BW *bw) { if (markv(1) && bw->cursor->byte >= markb->byte && bw->cursor->byte <= markk->byte) { markk->end = 1; utomarkk(bw); within = 1; do { ubop(bw), uformat(bw); } while (bw->cursor->byte > markb->byte); within = 0; markk->end = 0; if (lightoff) unmark(bw); return 0; } else return uformat(bw); } joe-3.7/uformat.h0000644000100100007640000000077111101136577010707 00000000000000/* * User text formatting functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_UFORMAT_H #define _JOE_UFORMAT_H 1 int ucenter PARAMS((BW *bw)); P *pbop PARAMS((BW *bw, P *p)); P *peop PARAMS((BW *bw, P *p)); int ubop PARAMS((BW *bw)); int ueop PARAMS((BW *bw)); void wrapword PARAMS((BW *bw, P *p, long int indent, int french, int no_over, unsigned char *indents)); int uformat PARAMS((BW *bw)); int ufmtblk PARAMS((BW *bw)); #endif joe-3.7/mouse.c0000644000100100007640000003725510457276140010370 00000000000000/* GPM/xterm mouse functions Copyright (C) 1999 Jesse McGrew This file is part of JOE (Joe's Own Editor) JOE 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. JOE 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 JOE; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "types.h" #ifdef HAVE_SYS_TIME_H #include #endif int auto_scroll = 0; /* Set for autoscroll */ int auto_rate; /* Rate */ int auto_trig_time; /* Time of next scroll */ int rtbutton=0; /* use button 3 instead of 1 */ int floatmouse=0; /* don't fix xcol after tomouse */ int joexterm=0; /* set if we're using Joe's modified xterm */ static int selecting = 0; /* Set if we did any selecting */ static int Cb, Cx, Cy; static int last_msec=0; /* time in ms when event occurred */ static int clicks; static void fake_key(int c) { MACRO *m=dokey(maint->curwin->kbd,c); 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) exemac(m); } /* Translate mouse coordinates */ int mcoord(int x) { if (x>=33 && x<=240) return x - 33 + 1; else if (x==32) return -1 + 1; else if (x>240) return x - 257 + 1; else return 0; /* This should not happen */ } int uxtmouse(BW *bw) { Cb = ttgetc()-32; if (Cb < 0) return -1; Cx = ttgetc(); if (Cx < 32) return -1; Cy = ttgetc(); if (Cy < 32) return -1; Cx = mcoord(Cx); Cy = mcoord(Cy); if ((Cb & 0x41) == 0x40) { fake_key(KEY_MWUP); return 0; } if ((Cb & 0x41) == 0x41) { fake_key(KEY_MWDOWN); return 0; } if ((Cb & 3) == 3) /* button released */ mouseup(Cx,Cy); else if ((Cb & 3) == (rtbutton ? 2 : 0)) /* preferred button */ if ((Cb & 32) == 0) /* button pressed */ mousedn(Cx,Cy); else /* drag */ mousedrag(Cx,Cy); else if ((maint->curwin->watom->what & TYPETW || maint->curwin->watom->what & TYPEPW) && joexterm && (Cb & 3) == 1) /* Paste */ ttputs(USTR "\33]52;;?\33\\"); return 0; } int mnow() { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec * 1000 + tv.tv_usec / 1000; } void mousedn(int x,int y) { Cx = x, Cy = y; if (last_msec == 0 || mnow() - last_msec > MOUSE_MULTI_THRESH) { /* not a multiple click */ clicks=1; fake_key(KEY_MDOWN); } else if(clicks==1) { /* double click */ clicks=2; fake_key(KEY_M2DOWN); } else if(clicks==2) { /* triple click */ clicks=3; fake_key(KEY_M3DOWN); } else { /* start over */ clicks=1; fake_key(KEY_MDOWN); } } /* Return base64 code character given 6-bit number */ char base64_code[]="\ ABCDEFGHIJKLMNOPQRSTUVWXYZ\ abcdefghijklmnopqrstuvwxyz\ 0123456789+/"; int base64_accu = 0; int base64_count = 0; int base64_pad = 0; static void ttputs64(unsigned char *p, unsigned length) { unsigned char buf[65]; unsigned x = 0; while (length--) { switch (base64_count) { case 0: buf[x++] = base64_code[*p >> 2]; base64_accu = (*p & 0x3); base64_count = 2; ++p; break; case 2: buf[x++] = base64_code[(base64_accu << 4) + (*p >> 4)]; base64_accu = (*p & 0xF); base64_count = 4; ++p; break; case 4: buf[x++] = base64_code[(base64_accu << 2) + (*p >> 6)]; buf[x++] = base64_code[*p & 0x3F]; base64_accu = 0; base64_count = 0; ++p; break; } if (x >= 63) { /* Write 63 or 64 characters */ base64_pad += x; buf[x] = 0; ttputs(buf); x = 0; } } if (x != 0) { base64_pad += x; buf[x] = 0; ttputs(buf); } } static void ttputs64_flush() { unsigned char x; switch (base64_count) { case 0: break; case 2: x = base64_code[base64_accu << 4]; ttputc(x); break; case 4: x = base64_code[base64_accu << 2]; ttputc(x); break; } if (base64_pad & 3) { x = 4 - (base64_pad & 3); while (x--) ttputc('='); } base64_count = 0; base64_accu = 0; base64_pad = 0; } void select_done(struct charmap *map) { /* Feed text to xterm */ if (joexterm && markv(1)) { long left = markb->xcol; long right = markk->xcol; P *q = pdup(markb, USTR "select_done"); int c; /* ttputs(USTR "\33[?2P"); JOE's xterm */ ttputs(USTR "\33]52;;"); /* New xterm */ while (q->byte < markk->byte) { unsigned char buf[16]; int len; /* Skip until we're within columns */ while (q->byte < markk->byte && square && (piscol(q) < left || piscol(q) >= right)) pgetc(q); /* Copy text into buffer */ while (q->byte < markk->byte && (!square || (piscol(q) >= left && piscol(q) < right))) { c = pgetc(q); if (map->type) if (locale_map->type) { /* UTF-8 char to UTF-8 terminal */ len = utf8_encode(buf,c); ttputs64(buf, len); } else { /* UTF-8 char to non-UTF-8 terminal */ c = from_uni(locale_map,c); if (c == -1) c = '?'; buf[0] = c; ttputs64(buf, 1); } else if (locale_map->type) { /* Non-UTF-8 to UTF-8 terminal */ c = to_uni(map, c); if (c == -1) c = '?'; len = utf8_encode(buf,c); ttputs64(buf, len); } else { /* Non-UTF-8 to non-UTF-8 terminal */ buf[0] = c; ttputs64(buf, 1); } } /* Add a new line if we went past right edge of column */ if (square && q->bytebyte && piscol(q) >= right) { buf[0] = 10; ttputs64(buf, 1); } } ttputs64_flush(); ttputs(USTR "\33\\"); prm(q); } } void mouseup(int x,int y) { auto_scroll = 0; Cx = x, Cy = y; if (selecting) { select_done(((BW *)maint->curwin->object)->b->o.charmap); selecting = 0; } switch(clicks) { case 1: fake_key(KEY_MUP); break; case 2: fake_key(KEY_M2UP); break; case 3: fake_key(KEY_M3UP); break; } last_msec = mnow(); } void mousedrag(int x,int y) { Cx = x, Cy = y; switch(clicks) { case 1: fake_key(KEY_MDRAG); break; case 2: fake_key(KEY_M2DRAG); break; case 3: fake_key(KEY_M3DRAG); break; } } int drag_size; /* Set if we are resizing a window */ int utomouse(BW *xx) { BW *bw; int x = Cx - 1, y = Cy - 1; W *w = watpos(maint,x,y); if (!w) return -1; maint->curwin = w; bw = w->object; drag_size = 0; if (w->watom->what == TYPETW) { if (bw->o.hex) { int goal_col = x - w->x + bw->offset - 60; int goal_line; long goal_byte; if (goal_col < 0) goal_col = 0; if (goal_col >15) goal_col = 15; /* window has a status line? */ if (((TW *)bw->object)->staon) /* clicked on it? */ if (y == w->y) { if (y != maint->wind) drag_size = y; return -1; } else goal_line = y - w->y + bw->top->byte/16 - 1; else goal_line = y - w->y + bw->top->byte/16; goal_byte = goal_line*16L + goal_col; if (goal_byte > bw->b->eof->byte) goal_byte = bw->b->eof->byte; pgoto(bw->cursor, goal_byte); return 0; } else { int goal_col = x - w->x + bw->offset - (bw->o.linums ? LINCOLS : 0); int goal_line; if (goal_col < 0) goal_col = 0; /* window has a status line? */ if (((TW *)bw->object)->staon) /* clicked on it? */ if (y == w->y) { if (y != maint->wind) drag_size = y; return -1; } else goal_line = y - w->y + bw->top->line - 1; else goal_line = y - w->y + bw->top->line; pline(bw->cursor, goal_line); pcol(bw->cursor, goal_col); if (floatmouse) bw->cursor->xcol = goal_col; else bw->cursor->xcol = piscol(bw->cursor); return 0; } } else if (w->watom->what == TYPEPW) { PW *pw = (PW *)bw->object; /* only one line in prompt windows */ pcol(bw->cursor,x - w->x + bw->offset - pw->promptlen + pw->promptofst); bw->cursor->xcol = piscol(bw->cursor); return 0; } else if (w->watom->what == TYPEMENU) { menujump((MENU *)w->object, x - w->x, y - w->y); return 0; } else return -1; } /* same as utomouse but won't change windows, and always floats. puts the * position that utomouse would use into tmspos. */ static int tmspos; static int tomousestay() { BW *bw; int x = Cx - 1,y = Cy - 1; W *w; /* w = watpos(maint,x,y); if(!w || w != maint->curwin) return -1; */ w = maint->curwin; bw = w->object; if (w->watom->what == TYPETW) { if (bw->o.hex) { int goal_col = x - w->x + bw->offset - 60; int goal_line; long goal_byte; if (goal_col < 0) goal_col = 0; if (goal_col > 15) goal_col = 15; /* window has a status line? */ if (((TW *)bw->object)->staon) if (y <= w->y) { goal_col = 0; goal_line = bw->top->byte/16; } else if (y >= w->y + w->h) { goal_line = bw->top->byte/16 + w->h - 2; goal_col = 15; } else goal_line = y - w->y + bw->top->byte/16 - 1; else if (y < w->y) { goal_col = 0; goal_line = bw->top->byte/16; } else if (y >= w->y + w->h) { goal_line = bw->top->byte/16 + w->h - 1; goal_col = 15; } else goal_line = y - w->y + bw->top->byte/16; goal_byte = goal_line*16L + goal_col; if (goal_byte > bw->b->eof->byte) goal_byte = bw->b->eof->byte; pgoto(bw->cursor, goal_byte); /* This is not right... */ tmspos = bw->cursor->xcol = piscol(bw->cursor); return 0; } else { int goal_col = x - w->x + bw->offset - (bw->o.linums ? LINCOLS : 0); int goal_line; if (goal_col < 0) goal_col = 0; /* window has a status line? */ if (((TW *)bw->object)->staon) if (y <= w->y) { goal_col = 0; goal_line = bw->top->line; } else if (y >= w->y + w->h) { goal_col = 1000; goal_line = w->h + bw->top->line - 2; } else goal_line = y - w->y + bw->top->line - 1; else if (y < w->y) { goal_col = 0; goal_line = bw->top->line; } else if (y >= w->y + w->h) { goal_col = 1000; goal_line = w->h + bw->top->line - 1; } else goal_line = y - w->y + bw->top->line; pline(bw->cursor, goal_line); pcol(bw->cursor, goal_col); tmspos = bw->cursor->xcol = goal_col; if (!floatmouse) tmspos = piscol(bw->cursor); return 0; } } else if (w->watom->what == TYPEPW) { PW *pw = (PW *)bw->object; /* only one line in prompt windows */ pcol(bw->cursor,x - w->x + bw->offset - pw->promptlen + pw->promptofst); tmspos = bw->cursor->xcol = piscol(bw->cursor); return 0; } else return -1; } static long anchor; /* byte where mouse was originally pressed */ static long anchorn; /* near side of the anchored word */ static int marked; /* mark was set by defmdrag? */ static int reversed; /* mouse was dragged above the anchor? */ int udefmdown(BW *xx) { BW *bw; if (utomouse(xx)) return -1; if ((maint->curwin->watom->what & (TYPEPW | TYPETW)) == 0) return 0; bw = (BW *)maint->curwin->object; anchor = bw->cursor->byte; marked = reversed = 0; return 0; } void reset_trig_time() { if (!auto_rate) auto_rate = 1; auto_trig_time = mnow() + 300 / (1 + auto_rate); } int udefmdrag(BW *xx) { BW *bw = (BW *)maint->curwin->object; int ay = Cy - 1; int new_scroll; int new_rate; if (drag_size) { while (ay > bw->parent->y) { int y = bw->parent->y; wgrowdown(bw->parent); if (y == bw->parent->y) return -1; } while (ay < bw->parent->y) { int y = bw->parent->y; wgrowup(bw->parent); if (y == bw->parent->y) return -1; } return 0; } if (ay < bw->y) { new_scroll = -1; new_rate = bw->y - ay; } else if (ay >= bw->y + bw->h) { new_scroll = 1; new_rate = ay - (bw->y + bw->h) + 1; } else { new_scroll = 0; new_rate = 1; } if (new_rate > 10) new_rate = 10; if (!new_scroll) auto_scroll = 0; else if (new_scroll != auto_scroll) { auto_scroll = new_scroll; auto_rate = new_rate; reset_trig_time(); } else if (new_rate != auto_rate) { /* int left = auto_trig_time - mnow(); if (left > 0) { left = left * auto_rate / new_rate; } */ auto_rate = new_rate; } if (!marked) marked++, umarkb(bw); if (tomousestay()) return -1; selecting = 1; if (reversed) umarkb(bw); else umarkk(bw); if ((!reversed && bw->cursor->byte < anchor) || (reversed && bw->cursor->byte > anchor)) { P *q = pdup(markb, USTR "udefmdrag"); int tmp = markb->xcol; pset(markb,markk); pset(markk,q); markb->xcol = markk->xcol; markk->xcol = tmp; prm(q); reversed = !reversed; } bw->cursor->xcol = tmspos; return 0; } int udefmup(BW *bw) { return 0; } int udefm2down(BW *xx) { BW *bw; if (utomouse(xx)) return -1; if (maint->curwin->watom->what & TYPEMENU) { return maint->curwin->watom->rtn((MENU *)maint->curwin->object); } if ((maint->curwin->watom->what & (TYPEPW | TYPETW)) == 0) return 0; bw = (BW *)maint->curwin->object; /* set anchor to left side, anchorn to right side */ u_goto_prev(bw); anchor = bw->cursor->byte; umarkb(bw); markb->xcol = piscol(markb); u_goto_next(bw); anchorn = bw->cursor->byte; umarkk(bw); markk->xcol = piscol(markk); reversed = 0; bw->cursor->xcol = piscol(bw->cursor); selecting = 1; return 0; } int udefm2drag(BW *xx) { BW *bw=(BW *)maint->curwin->object; if (tomousestay()) return -1; if (!reversed && bw->cursor->byte < anchor) { pgoto(markk,anchorn); markk->xcol = piscol(markk); reversed = 1; } else if(reversed && bw->cursor->byte > anchorn) { pgoto(markb,anchor); markb->xcol = piscol(markb); reversed = 0; } bw->cursor->xcol = piscol(bw->cursor); if(reversed) { if (!pisbol(bw->cursor)) u_goto_prev(bw), bw->cursor->xcol = piscol(bw->cursor); umarkb(bw); } else { if (!piseol(bw->cursor)) u_goto_next(bw), bw->cursor->xcol = piscol(bw->cursor); umarkk(bw); } return 0; } int udefm2up(BW *bw) { return 0; } int udefm3down(BW *xx) { BW *bw; if (utomouse(xx)) return -1; if ((maint->curwin->watom->what & (TYPEPW | TYPETW)) == 0) return 0; bw = (BW *)maint->curwin->object; /* set anchor to beginning of line, anchorn to beginning of next line */ p_goto_bol(bw->cursor); bw->cursor->xcol = piscol(bw->cursor); anchor = bw->cursor->byte; umarkb(bw); umarkk(bw); pnextl(markk); anchorn = markk->byte; reversed = 0; bw->cursor->xcol = piscol(bw->cursor); selecting = 1; return 0; } int udefm3drag(BW *xx) { BW *bw = (BW *)maint->curwin->object; if (tomousestay()) return -1; if (!reversed && bw->cursor->byte < anchor) { pgoto(markk,anchorn); markk->xcol = piscol(markk); reversed = 1; } else if (reversed && bw->cursor->byte > anchorn) { pgoto(markb,anchor); markb->xcol = piscol(markb); reversed = 0; } p_goto_bol(bw->cursor); bw->cursor->xcol = piscol(bw->cursor); if(reversed) umarkb(bw), markb->xcol = piscol(markb); else umarkk(bw), pnextl(markk), markk->xcol = markk->xcol = piscol(markk); return 0; } int udefm3up(BW *bw) { return 0; } void mouseopen() { #ifdef MOUSE_XTERM if (usexmouse) { ttputs(USTR "\33[?1002h"); if (joexterm) ttputs(USTR "\33[?2007h"); ttflsh(); } #endif } void mouseclose() { #ifdef MOUSE_XTERM if (usexmouse) { if (joexterm) ttputs(USTR "\33[?2007l"); ttputs(USTR "\33[?1002l"); ttflsh(); } #endif } joe-3.7/mouse.h0000644000100100007640000000432010431662534010356 00000000000000/* GPM/xterm mouse functions Copyright (C) 1999 Jesse McGrew This file is part of JOE (Joe's Own Editor) JOE 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. JOE 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 JOE; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _Imouse #define _Imouse 1 /* maximum number of milliseconds that can elapse between double/triple clicks */ #define MOUSE_MULTI_THRESH 300 #ifdef MOUSE_GPM int gpmopen(); /* initialize the connection. returns 0 on failure. */ void gpmclose(); /* close the connection. */ #endif void mouseopen(); /* initialize mouse */ void mouseclose(); /* de-initialize mouse */ /* mousedn(int x, int y) - handle a mouse-down event */ void mousedn PARAMS((int x, int y)); /* mouseup(int x, int y) - handle a mouse-up event */ void mouseup PARAMS((int x, int y)); /* mousedrag(int x, int y) - handle a mouse drag event */ void mousedrag PARAMS((int x, int y)); /* user command handlers */ int uxtmouse PARAMS((BW *)); /* handle an xterm mouse control sequence */ int utomouse PARAMS((BW *)); /* move the pointer to the mouse */ int udefmdown PARAMS((BW *)); /* default mouse click handlers */ int udefmup PARAMS((BW *)); int udefmdrag PARAMS((BW *)); int udefm2down PARAMS((BW *)); int udefm2up PARAMS((BW *)); int udefm2drag PARAMS((BW *)); int udefm3down PARAMS((BW *)); int udefm3up PARAMS((BW *)); int udefm3drag PARAMS((BW *)); int mnow(); void reset_trig_time(); /* options */ extern int floatmouse; /* Allow mouse to set cursor past end of lines */ extern int rtbutton; /* Use button 3 instead of button 1 */ extern int auto_scroll; /* Set for autoscroll */ extern int auto_trig_time; /* Time of next scroll */ extern int joexterm; /* Set if xterm can do base64 paste */ #endif joe-3.7/hash.c0000644000100100007640000000461310440416435010146 00000000000000/* * Simple hash table * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" static HENTRY *freentry = NULL; /* Compute hash value of string */ #define hnext(accu, c) (((accu) << 4) + ((accu) >> 28) + (c)) unsigned long hash(unsigned char *s) { unsigned long accu = 0; while (*s) { accu = hnext(accu, *s++); } return accu; } /* Create hash table */ HASH *htmk(int len) { HASH *t = (HASH *) joe_malloc(sizeof(HASH)); t->nentries = 0; t->len = len; t->tab = (HENTRY **) joe_calloc(sizeof(HENTRY *), len); return t; } /* Delete hash table. Only the hash table is deleted, not the names and values */ void htrm(HASH *ht) { int x; for (x = 0; x != ht->len; ++x) { HENTRY *p, *n; for (p = ht->tab[x]; p; p = n) { n = p->next; p->next = freentry; freentry = p; } } joe_free(ht->tab); joe_free(ht); } /* Expand hash table */ void htexpand(HASH *h) { unsigned x; /* Allocate new table */ unsigned new_size = h->len * 2; HENTRY **new_table = (HENTRY **)joe_calloc(new_size, sizeof(HENTRY *)); /* Copy entries from old table to new */ for (x = 0; x != h->len; ++x) { HENTRY *e; while ((e = h->tab[x])) { h->tab[x] = e->next; e->next = new_table[e->hash_val & (new_size - 1)]; new_table[e->hash_val & (new_size - 1)] = e; } } /* Replace old table with new */ free(h->tab); h->tab = new_table; h->len = new_size; } /* Bind a value to a name. This does not check for duplicate entries. The * name and value are not duplicated: it's up to you to keep them around for * the life of the hash table. */ void *htadd(HASH *ht, unsigned char *name, void *val) { unsigned hval = hash(name); unsigned idx = hval & (ht->len - 1); HENTRY *entry; int x; if (!freentry) { entry = (HENTRY *) joe_malloc(sizeof(HENTRY) * 64); 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; entry->val = val; entry->hash_val = hval; if (++ht->nentries == (ht->len >> 1) + (ht->len >> 2)) htexpand(ht); return val; } /* Return value associated with name or NULL if there is none */ void *htfind(HASH *ht, unsigned char *name) { HENTRY *e; for (e = ht->tab[hash(name) & (ht->len - 1)]; e; e = e->next) { if (!zcmp(e->name, name)) { return e->val; } } return NULL; } joe-3.7/hash.h0000644000100100007640000000154710440416435010156 00000000000000/* * Simple hash table * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_HASH_H #define _JOE_HASH_H 1 struct entry { HENTRY *next; unsigned char *name; unsigned hash_val; void *val; }; struct hash { unsigned len; HENTRY **tab; unsigned nentries; }; /* Compute hash code for a string */ unsigned long hash PARAMS((unsigned char *s)); /* Create a hash table of specified size, which must be a power of 2 */ HASH *htmk PARAMS((int len)); /* Delete a hash table. HENTRIES get freed, but name/vals don't. */ void htrm PARAMS((HASH *ht)); /* Add an entry to a hash table. Note: 'name' is _not_ strdup()ed */ void *htadd PARAMS((HASH *ht, unsigned char *name, void *val)); /* Look up an entry in a hash table, returns NULL if not found */ void *htfind PARAMS((HASH *ht, unsigned char *name)); #endif joe-3.7/help.c0000644000100100007640000001602010457233470010152 00000000000000/* * Help system * Copyright * (C) 1992 Joseph H. Allen * (C) 2001 Marek 'Marx' Grac * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" struct help { unsigned char *text; /* help text with attributes */ unsigned int lines; /* number of lines */ struct help *prev; /* previous help screen */ struct help *next; /* nex help screen */ unsigned char *name; /* context name for context sensitive help */ }; #define NOT_ENOUGH_MEMORY -11 int bg_help; /* Background color for help */ struct help *help_actual = NULL; /* actual help screen */ struct help *help_ptr = NULL; /* build pointer */ /* * Process help file * Returns new line number */ int help_init(JFILE *fd,unsigned char *bf,int line) { unsigned char buf[1024]; /* input buffer */ struct help *tmp; unsigned int bfl; /* buffer length */ unsigned int hlpsiz, hlpbsz; /* number of used/allocated bytes for tmp->text */ unsigned char *tempbuf; if (bf[0] == '{') { /* start of help screen */ tmp = (struct help *) joe_malloc(sizeof(struct help)); tmp->text = NULL; tmp->lines = 0; hlpsiz = 0; hlpbsz = 0; tmp->name = vsncpy(NULL, 0, sz(bf + 1) - 1); /* -1 kill the \n */ while ((jfgets(buf, sizeof(buf), fd)) && (buf[0] != '}')) { ++line; bfl = zlen(buf); if (hlpsiz + bfl > hlpbsz) { if (tmp->text) { tempbuf = (unsigned char *) joe_realloc(tmp->text, hlpbsz + bfl + 1024); tmp->text = tempbuf; } else { tmp->text = (unsigned char *) joe_malloc(bfl + 1024); tmp->text[0] = 0; } hlpbsz += bfl + 1024; } zcpy(tmp->text + hlpsiz, buf); hlpsiz += bfl; ++tmp->lines; } tmp->prev = help_ptr; tmp->next = NULL; if (help_ptr) { help_ptr->next = tmp; } else { help_actual = tmp; } help_ptr = tmp; if (buf[0] == '}') { /* set new help screen as actual one */ ++line; } else { fprintf(stderr, (char *)joe_gettext(_("\n%d: EOF before end of help text\n")),line); } } return line; } /* * Find context help - find help entry with the same name */ struct help *find_context_help(unsigned char *name) { struct help *tmp = help_actual; while (tmp->prev != NULL) /* find the first help entry */ tmp = tmp->prev; while (tmp != NULL && zcmp(tmp->name, name) != 0) tmp = tmp->next; return tmp; } int help_is_utf8; /* * Display help text */ void help_display(Screen *t) { unsigned char *str; int y, x, c, z; int atr = BG_COLOR(bg_help); if (help_actual) { str = help_actual->text; } else { str = NULL; } for (y = skiptop; y != t->wind; ++y) { if (t->t->updtab[y]) { unsigned char *start = str, *eol; int width=0; int nspans=0; int spanwidth; int spancount=0; int spanextra; int len; eol = zchr(str, '\n'); /* First pass: count no. springs \| and determine minimum width */ while(*str && *str!='\n') { if (*str == '\\') { ++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 { len = eol - str; if (help_is_utf8) c = utf8_decode_fwrd(&str, &len); else { c = *str++; --len; } width += joe_wcwidth(!!locale_map->type, c); } } 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, BG_COLOR(bg_help))) { 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; } } len = eol - str; if (help_is_utf8) c = utf8_decode_fwrd(&str, &len); else { c = *str++; --len; } outatr(locale_map, t->t, t->t->scrn + x + y * t->w, t->t->attr + x + y * t->w, x, y, c, atr); x += (joe_wcwidth(!!locale_map->type, c) - 1); } } atr = BG_COLOR(bg_help); 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 */ static 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; } } joe-3.7/help.h0000644000100100007640000000132210444322164010151 00000000000000/* * Help system * Copyright * (C) 1992 Joseph H. Allen * (C) 2001 Marek 'Marx' Grac * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_HELP_H #define _JOE_HELP_H 1 void help_display PARAMS((Screen *t)); /* display text in help window */ int help_on PARAMS((Screen *t)); /* turn help on */ int help_init PARAMS((JFILE *fd,unsigned char *bf,int line)); /* read help from rc file */ int u_help PARAMS((BASE *base)); /* toggle help on/off */ int u_help_next PARAMS((BASE *base)); /* goto next help screen */ int u_help_prev PARAMS((BASE *base)); /* goto prev help screen */ extern int bg_help; /* Background color for help */ extern int help_is_utf8; /* Set if help text is UTF-8 */ #endif joe-3.7/Makefile.am0000644000100100007640000000401711101510604011075 00000000000000AUTOMAKE_OPTIONS = foreign SUBDIRS = man rc po syntax EXTRA_DIST = COPYING LIST HACKING ChangeLog NEWS README INSTALL INSTALL.AMIGA INSTALL.cvs \ TODO docs/help-system.html dir.c charmaps/klingon.in HINTS \ cygbuild setup.hint xterm-patch xterm-readme autojoe sysconf_joedir = $(sysconfdir)/joe data_joedir = $(datadir)/joe data_charmapsdir = $(data_joedir)/charmaps data_charmaps_DATA = charmaps/klingon data_docdir = $(docdir) data_doc_DATA = LIST README HINTS ChangeLog HACKING NEWS noinst_HEADERS = b.h blocks.h bw.h cmd.h config.h hash.h help.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 tab.h termcapj.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 \ utils.h va.h vfile.h vs.h w.h utf8.h syntax.h i18n.h charmap.h mouse.h \ lattr.h gettext.h builtin.h bin_PROGRAMS = joe termidx INCLUDES = -DJOERC="\"$(sysconf_joedir)/\"" -DJOEDATA="\"$(data_joedir)/\"" joe_LDADD = -lm joe_SOURCES = b.c blocks.c bw.c cmd.c hash.c help.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 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 va.c vfile.c vs.c w.c utils.c syntax.c \ utf8.c selinux.c i18n.c charmap.c mouse.c lattr.c gettext.c builtin.c \ builtins.c termidx_SOURCES = termidx.c install-exec-hook: rm -f $(DESTDIR)$(bindir)/jmacs $(DESTDIR)$(bindir)/jstar $(DESTDIR)$(bindir)/rjoe $(DESTDIR)$(bindir)/jpico rm -f $(DESTDIR)$(bindir)/jmacs.exe $(DESTDIR)$(bindir)/jstar.exe $(DESTDIR)$(bindir)/rjoe.exe $(DESTDIR)$(bindir)/jpico.exe for i in jmacs jstar rjoe jpico ; do $(LN_S) joe $(DESTDIR)$(bindir)/$$i ; done uninstall-local: rm -f $(DESTDIR)$(bindir)/jmacs $(DESTDIR)$(bindir)/jstar $(DESTDIR)$(bindir)/rjoe $(DESTDIR)$(bindir)/jpico rm -f $(DESTDIR)$(bindir)/jmacs.exe $(DESTDIR)$(bindir)/jstar.exe $(DESTDIR)$(bindir)/rjoe.exe $(DESTDIR)$(bindir)/jpico.exe distclean-local: rm -f *~ .PHONY: termcap joe-3.7/Makefile.in0000644000100100007640000007410511102222341011112 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(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) termidx$(EXEEXT) subdir = . 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 COPYING ChangeLog INSTALL NEWS TODO \ config.guess config.sub depcomp install-sh missing 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 config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = autoconf.h CONFIG_CLEAN_FILES = charmaps/klingon am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(data_charmapsdir)" "$(DESTDIR)$(data_docdir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_joe_OBJECTS = b.$(OBJEXT) blocks.$(OBJEXT) bw.$(OBJEXT) \ cmd.$(OBJEXT) hash.$(OBJEXT) help.$(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) 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) va.$(OBJEXT) vfile.$(OBJEXT) vs.$(OBJEXT) \ w.$(OBJEXT) utils.$(OBJEXT) syntax.$(OBJEXT) utf8.$(OBJEXT) \ selinux.$(OBJEXT) i18n.$(OBJEXT) charmap.$(OBJEXT) \ mouse.$(OBJEXT) lattr.$(OBJEXT) gettext.$(OBJEXT) \ builtin.$(OBJEXT) builtins.$(OBJEXT) joe_OBJECTS = $(am_joe_OBJECTS) joe_DEPENDENCIES = am_termidx_OBJECTS = termidx.$(OBJEXT) termidx_OBJECTS = $(am_termidx_OBJECTS) termidx_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ 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) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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|^.*/||'`; data_charmapsDATA_INSTALL = $(INSTALL_DATA) data_docDATA_INSTALL = $(INSTALL_DATA) DATA = $(data_charmaps_DATA) $(data_doc_DATA) HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) 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@ 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 = @INSTALL@ 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@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ 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@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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@ builddir = @builddir@ 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@ 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@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign SUBDIRS = man rc po syntax EXTRA_DIST = COPYING LIST HACKING ChangeLog NEWS README INSTALL INSTALL.AMIGA INSTALL.cvs \ TODO docs/help-system.html dir.c charmaps/klingon.in HINTS \ cygbuild setup.hint xterm-patch xterm-readme autojoe sysconf_joedir = $(sysconfdir)/joe data_joedir = $(datadir)/joe data_charmapsdir = $(data_joedir)/charmaps data_charmaps_DATA = charmaps/klingon data_docdir = $(docdir) data_doc_DATA = LIST README HINTS ChangeLog HACKING NEWS noinst_HEADERS = b.h blocks.h bw.h cmd.h config.h hash.h help.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 tab.h termcapj.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 \ utils.h va.h vfile.h vs.h w.h utf8.h syntax.h i18n.h charmap.h mouse.h \ lattr.h gettext.h builtin.h INCLUDES = -DJOERC="\"$(sysconf_joedir)/\"" -DJOEDATA="\"$(data_joedir)/\"" joe_LDADD = -lm joe_SOURCES = b.c blocks.c bw.c cmd.c hash.c help.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 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 va.c vfile.c vs.c w.c utils.c syntax.c \ utf8.c selinux.c i18n.c charmap.c mouse.c lattr.c gettext.c builtin.c \ builtins.c termidx_SOURCES = termidx.c all: autoconf.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .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) $(AM_MAKEFLAGS) 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 charmaps/klingon: $(top_builddir)/config.status $(top_srcdir)/charmaps/klingon.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binPROGRAMS: $(bin_PROGRAMS) @$(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_OBJECTS) $(joe_LDADD) $(LIBS) termidx$(EXEEXT): $(termidx_OBJECTS) $(termidx_DEPENDENCIES) @rm -f termidx$(EXEEXT) $(LINK) $(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)/gettext.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)/lattr.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)/mouse.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@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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) '$<'` install-data_charmapsDATA: $(data_charmaps_DATA) @$(NORMAL_INSTALL) test -z "$(data_charmapsdir)" || $(MKDIR_P) "$(DESTDIR)$(data_charmapsdir)" @list='$(data_charmaps_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(data_charmapsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(data_charmapsdir)/$$f'"; \ $(data_charmapsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(data_charmapsdir)/$$f"; \ done uninstall-data_charmapsDATA: @$(NORMAL_UNINSTALL) @list='$(data_charmaps_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(data_charmapsdir)/$$f'"; \ rm -f "$(DESTDIR)$(data_charmapsdir)/$$f"; \ done install-data_docDATA: $(data_doc_DATA) @$(NORMAL_INSTALL) test -z "$(data_docdir)" || $(MKDIR_P) "$(DESTDIR)$(data_docdir)" @list='$(data_doc_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(data_docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(data_docdir)/$$f'"; \ $(data_docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(data_docdir)/$$f"; \ done uninstall-data_docDATA: @$(NORMAL_UNINSTALL) @list='$(data_doc_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(data_docdir)/$$f'"; \ rm -f "$(DESTDIR)$(data_docdir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ 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: tags-recursive $(HEADERS) $(SOURCES) autoconf.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ 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: ctags-recursive $(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) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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 list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || 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 $(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 a+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 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$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-recursive all-am: Makefile $(PROGRAMS) $(DATA) $(HEADERS) autoconf.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(data_charmapsdir)" "$(DESTDIR)$(data_docdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive 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: 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-recursive clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-recursive -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-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-data_charmapsDATA install-data_docDATA install-dvi: install-dvi-recursive install-exec-am: install-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -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-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-data_charmapsDATA \ uninstall-data_docDATA uninstall-local .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-exec-am install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-binPROGRAMS \ clean-generic ctags ctags-recursive 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-data_charmapsDATA install-data_docDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-exec-hook install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-data_charmapsDATA uninstall-data_docDATA \ uninstall-local install-exec-hook: rm -f $(DESTDIR)$(bindir)/jmacs $(DESTDIR)$(bindir)/jstar $(DESTDIR)$(bindir)/rjoe $(DESTDIR)$(bindir)/jpico rm -f $(DESTDIR)$(bindir)/jmacs.exe $(DESTDIR)$(bindir)/jstar.exe $(DESTDIR)$(bindir)/rjoe.exe $(DESTDIR)$(bindir)/jpico.exe for i in jmacs jstar rjoe jpico ; do $(LN_S) joe $(DESTDIR)$(bindir)/$$i ; done uninstall-local: rm -f $(DESTDIR)$(bindir)/jmacs $(DESTDIR)$(bindir)/jstar $(DESTDIR)$(bindir)/rjoe $(DESTDIR)$(bindir)/jpico rm -f $(DESTDIR)$(bindir)/jmacs.exe $(DESTDIR)$(bindir)/jstar.exe $(DESTDIR)$(bindir)/rjoe.exe $(DESTDIR)$(bindir)/jpico.exe distclean-local: rm -f *~ .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: joe-3.7/uedit.c0000644000100100007640000015132011103410060010314 00000000000000/* * Basic user edit functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" /***************/ /* Global options */ int pgamnt = -1; /* No. of PgUp/PgDn lines to keep */ /* * 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, USTR "uhome"); if (bw->o.indentfirst) { if ((bw->o.smarthome) && (piscol(p) > pisindent(p))) { p_goto_bol(p); while (joe_isblank(p->b->o.charmap,brc(p))) pgetc(p); } else p_goto_bol(p); } else { if (bw->o.smarthome && piscol(p)==0 && pisindent(p)) { while (joe_isblank(p->b->o.charmap,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 return -1; } 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; } else { 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 p_goto_prev(P *ptr) { P *p = pdup(ptr, USTR "p_goto_prev"); struct charmap *map=ptr->b->o.charmap; int c = prgetc(p); if (joe_isalnum_(map,c)) { while (joe_isalnum_(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_isalnum_(map,(c=prgetc(p)))) /* Do nothing */; if (c != NO_MORE_DATA) pgetc(p); } pset(ptr, p); prm(p); return 0; } int u_goto_prev(BW *bw) { return p_goto_prev(bw->cursor); } /* * 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 p_goto_next(P *ptr) { P *p = pdup(ptr, USTR "p_goto_next"); struct charmap *map=ptr->b->o.charmap; int c = brch(p); int rtn = -1; if (joe_isalnum_(map,c)) { rtn = 0; while (joe_isalnum_(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_isalnum_(map,(c = brch(p)))) { rtn = 0; pgetc(p); } } else pgetc(p); pset(ptr, p); prm(p); return rtn; } int u_goto_next(BW *bw) { return p_goto_next(bw->cursor); } static P *pboi(P *p) { p_goto_bol(p); while (joe_isblank(p->b->o.charmap,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, USTR "pisedge"); pboi(q); if (q->byte == p->byte) goto left; if (joe_isblank(p->b->o.charmap,(c = brch(p)))) { pset(q, p); if (joe_isblank(p->b->o.charmap,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 */ /* * begin end * * module endmodule * * function endfunction * * cursor, USTR "tomatch_word"); int c; unsigned char buf[MAX_WORD_SIZE+1]; int len; int cnt = 1; p_goto_next(p); p_goto_prev(p); while ((c=prgetc(p)) != NO_MORE_DATA) { int peek = prgetc(p); if(peek!=NO_MORE_DATA) pgetc(p); if (peek=='\\') { } else if (!bw->o.no_double_quoted && c == '"') { while((c = prgetc(p)) != NO_MORE_DATA) { if (c == '"') { c = prgetc(p); if (c != '\\') { if (c != NO_MORE_DATA) pgetc(p); break; } } } } else if (bw->o.single_quoted && c == '\'') { while((c = prgetc(p)) != NO_MORE_DATA) if (c == '\'') { c = prgetc(p); if (c != '\\') { if (c != NO_MORE_DATA) pgetc(p); break; } } } else if (bw->o.c_comment && c == '/') { c = prgetc(p); if (c == '*') { c = prgetc(p); do { do { if (c == '*') break; } while ((c = prgetc(p)) != NO_MORE_DATA); c = prgetc(p); } while (c != NO_MORE_DATA && c != '/'); } else if (c != NO_MORE_DATA) pgetc(p); } else if ((bw->o.cpp_comment || bw->o.pound_comment || bw->o.semi_comment || bw->o.vhdl_comment || bw->o.tex_comment) && c == '\n') { P *q = pdup(p, USTR "tomatch_word"); int cc; p_goto_bol(q); while((cc = pgetc(q)) != '\n') { if (bw->o.pound_comment && cc == '$' && brch(q)=='#') { pgetc(q); } else if(!bw->o.no_double_quoted && cc=='"') { while ((cc = pgetc(q)) != '\n') if (cc == '"') break; else if (cc == '\\') pgetc(q); } else if (bw->o.cpp_comment && cc == '/') { if (brch(q)=='/') { prgetc(q); pset(p,q); break; } } else if (bw->o.single_quoted && cc == '\'') { while((cc = pgetc(q)) != '\n') if (cc == '\'') break; else if (cc == '\\') pgetc(q); } else if (bw->o.vhdl_comment && cc == '-') { if (brch(q)=='-') { prgetc(q); pset(p,q); break; } } else if (bw->o.pound_comment && cc == '#') { pset(p,q); break; } else if (bw->o.semi_comment && cc == ';') { pset(p,q); break; } else if (bw->o.tex_comment && cc == '%') { pset(p,q); break; } } prm(q); } else if ((c >= 'a' && c <= 'z') || (c>='A' && c<='Z') || (c>='0' && c<='9') || c=='_') { int x; int flg=0; P *q; len=0; while ((c >= 'a' && c <= 'z') || (c>='A' && c<='Z') || c=='_' || (c>='0' && c<='9')) { if(len!=MAX_WORD_SIZE) buf[len++]=c; c=prgetc(p); } /* ifdef hack */ q=pdup(p, USTR "tomatch_word"); while (c ==' ' || c=='\t') c=prgetc(q); prm(q); /* VHDL hack */ if ((c=='d' || c=='D') && bw->o.vhdl_comment) { c=prgetc(q); if(c=='n' || c=='N') { c=prgetc(q); if(c=='e' || c=='E') { c=prgetc(q); if(c==' ' || c=='\t' || c=='\n' || c==NO_MORE_DATA) flg=1; } } } prm(q); if (c == set[0]) buf[len++] = c; if(c!=NO_MORE_DATA) pgetc(p); buf[len]=0; for(x=0;x!=len/2;++x) { int d = buf[x]; buf[x] = buf[len-x-1]; buf[len-x-1] = d; } if (is_in_group(last_of_set,buf)) { ++cnt; } else if(is_in_group(set,buf) && !flg && !--cnt) { pset(bw->cursor,p); prm(p); return 0; } } } prm(p); return -1; } else { /* Forward search */ unsigned char *last_of_set = find_last_group(group); P *p=pdup(bw->cursor, USTR "tomatch_word"); int c; unsigned char buf[MAX_WORD_SIZE+1]; int len; int cnt = 1; p_goto_next(p); while ((c=pgetc(p)) != NO_MORE_DATA) { if (c == '\\') { pgetc(p); } else if (!bw->o.no_double_quoted && c == '"') { while ((c = pgetc(p)) != NO_MORE_DATA) if (c == '"') break; else if (c == '\\') pgetc(p); } else if (c == '$' && brch(p)=='#' && bw->o.pound_comment) { pgetc(p); } else if ((bw->o.pound_comment && c == '#') || (bw->o.semi_comment && c == ';') || (bw->o.tex_comment && c == '%') || (bw->o.vhdl_comment && c == '-' && brch(p) == '-')) { while ((c = pgetc(p)) != NO_MORE_DATA) if (c == '\n') break; } else if (bw->o.single_quoted && c == '\'') { while((c = pgetc(p)) != NO_MORE_DATA) if (c == '\'') break; else if (c == '\\') pgetc(p); } else if ((bw->o.c_comment || bw->o.cpp_comment) && c == '/') { c = pgetc(p); if (c == '*') { c = pgetc(p); do { do { if (c == '*') break; } while ((c = pgetc(p)) != NO_MORE_DATA); c = pgetc(p); } while (c != NO_MORE_DATA && c != '/'); } else if (c == '/') { while ((c = pgetc(p)) != NO_MORE_DATA) if (c == '\n') break; } else if (c != NO_MORE_DATA) prgetc(p); } else if (c == set[0]) { /* ifdef hack */ while ((c = pgetc(p))!=NO_MORE_DATA) { if (c!=' ' && c!='\t') break; } buf[0]=set[0]; len=1; if (c >= 'a' && c <= 'z') goto doit; } else if ((c >= 'a' && c <= 'z') || (c>='A' && c<='Z') || c=='_') { len=0; doit: while ((c >= 'a' && c <= 'z') || (c>='A' && c<='Z') || c=='_' || (c>='0' && c<='9')) { if(len!=MAX_WORD_SIZE) buf[len++]=c; c=pgetc(p); } if (c!=NO_MORE_DATA) prgetc(p); buf[len]=0; if (is_in_group(set,buf)) { ++cnt; } else if (cnt==1) { if (is_in_any_group(group,buf)) { if (!((buf[0]>='a' && buf[0]<='z') || (buf[0]>='A' && buf[0]<='Z'))) pgoto(p,p->byte-len+1); else pgoto(p,p->byte-len); pset(bw->cursor,p); prm(p); return 0; } } else if(is_in_group(last_of_set,buf)) { /* VHDL hack */ if (bw->o.vhdl_comment && (!zcmp(buf,USTR "end") || !zcmp(buf,USTR "END"))) while((c=pgetc(p))!=NO_MORE_DATA) if (c==';' || c=='\n') break; --cnt; } } } prm(p); return -1; } } /* Return true if */ int xml_startend(P *p) { int c, d=0; p=pdup(p, USTR "xml_startend"); while((c=pgetc(p)) != NO_MORE_DATA) { if(d=='/' && c=='>') { prm(p); return 1; } else if(c=='>') break; d=c; } prm(p); return 0; } int tomatch_xml(BW *bw,unsigned char *word,int dir) { if (dir== -1) { /* Backward search */ P *p=pdup(bw->cursor, USTR "tomatch_xml"); int c; unsigned char buf[MAX_WORD_SIZE+1]; int len; int cnt = 1; p_goto_next(p); p_goto_prev(p); while ((c=prgetc(p)) != NO_MORE_DATA) { if ((c >= 'a' && c <= 'z') || (c>='A' && c<='Z') || (c>='0' && c<='9') || c=='.' || c==':' || c=='-' || c=='_') { int x; len=0; while ((c >= 'a' && c <= 'z') || (c>='A' && c<='Z') || c=='_' || (c>='0' && c<='9') || c=='.' || c == '-' || c == ':') { if(len!=MAX_WORD_SIZE) buf[len++]=c; c=prgetc(p); } if(c!=NO_MORE_DATA) c = pgetc(p); buf[len]=0; for(x=0;x!=len/2;++x) { int d = buf[x]; buf[x] = buf[len-x-1]; buf[len-x-1] = d; } if (!zcmp(word,buf) && !xml_startend(p)) { if (c=='<') { if (!--cnt) { pset(bw->cursor,p); prm(p); return 0; } } else if (c=='/') { ++cnt; } } } } prm(p); return -1; } else { /* Forward search */ P *p=pdup(bw->cursor, USTR "tomatch_xml"); int c; unsigned char buf[MAX_WORD_SIZE+1]; int len; int cnt = 1; while ((c=pgetc(p)) != NO_MORE_DATA) { if (c == '<') { int e = 1; c = pgetc(p); if (c=='/') { e = 0; c = pgetc(p); } if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c=='_' || c==':' || c=='-' || c=='.') { len=0; while ((c >= 'a' && c <= 'z') || (c>='A' && c<='Z') || c=='_' || c==':' || c=='-' || c=='.' || (c >= '0' && c <= '9')) { if(len!=MAX_WORD_SIZE) buf[len++]=c; c=pgetc(p); } if (c!=NO_MORE_DATA) prgetc(p); buf[len]=0; if (!zcmp(word,buf) && !xml_startend(p)) { if (e) { ++cnt; } else if (!--cnt) { pgoto(p,p->byte-len); pset(bw->cursor,p); prm(p); return 0; } } } else if (c!=NO_MORE_DATA) { prgetc(p); } } } prm(p); return -1; } } void get_xml_name(P *p,unsigned char *buf) { int c; int len=0; p=pdup(p, USTR "get_xml_name"); c=pgetc(p); while ((c >= 'a' && c <= 'z') || (c>='A' && c<='Z') || c=='_' || c==':' || c=='-' || c=='.' || (c >= '0' && c <= '9')) { if(len!=MAX_WORD_SIZE) buf[len++]=c; c=pgetc(p); } buf[len]=0; prm(p); } void get_delim_name(P *q,unsigned char *buf) { int c; int len=0; P *p=pdup(q, USTR "get_delim_name"); while ((c=prgetc(p))!=NO_MORE_DATA) if (c!=' ' && c!='\t') break; prm(p); /* preprocessor directive hack */ if (c=='#' || c=='`') buf[len++]=c; p=pdup(q, USTR "get_delim_name"); c=pgetc(p); while ((c >= 'a' && c <= 'z') || (c>='A' && c<='Z') || c=='_' || (c >= '0' && c <= '9')) { if(len!=MAX_WORD_SIZE) buf[len++]=c; c=pgetc(p); } buf[len]=0; prm(p); } int utomatch(BW *bw) { int d; int c, /* Character under cursor */ f, /* Character to find */ dir; /* 1 to search forward, -1 to search backward */ c = brch(bw->cursor); /* Check for word delimiters */ if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_') { P *p; unsigned char buf[MAX_WORD_SIZE+1]; unsigned char buf1[MAX_WORD_SIZE+1]; unsigned char *list = bw->b->o.text_delimiters; unsigned char *set; unsigned char *group; unsigned char *word; int flg=0; p=pdup(bw->cursor, USTR "utomatch"); p_goto_next(p); p_goto_prev(p); get_delim_name(p,buf); get_xml_name(p,buf1); c=prgetc(p); if (c=='<') flg = 1; else if (c=='/') { c=prgetc(p); if (c=='<') flg = -1; } prm(p); if (flg) { return tomatch_xml(bw, buf1, flg); } for (set = list; set && *set; set = next_set(set)) { for (group = set; *group && *group!='=' && *group!=':'; group=next_group(group)) { for (word = group; *word && *word!='|' && *word!='=' && *word!=':'; word=next_word(word)) { if (match_word(word, buf)) { return tomatch_word(bw, set, next_group(word)); } } } } /* We don't know the word, so start a search */ return dofirst(bw, 0, 0, buf); } switch (c) { case '/': dir = 1; pgetc(bw->cursor); f = brch(bw->cursor); prgetc(bw->cursor); if(f=='*') f = '/'; else { dir = -1; f = prgetc(bw->cursor); if (f!=NO_MORE_DATA) pgetc(bw->cursor); if(f=='*') f = '/'; else return -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; case '}': f = '{'; dir = -1; break; case '\'': f = '`'; dir = -1; break; case '>': f = '<'; dir = -1; break; default: return -1; } /* Search for matching C comment */ if (f == '/') { P *p = pdup(bw->cursor, USTR "utomatch"); if (dir == 1) { d = pgetc(p); do { do { if (d == '*') break; } while ((d = pgetc(p)) != NO_MORE_DATA); d = pgetc(p); } while (d != NO_MORE_DATA && d != '/'); if (d == '/') { pset(bw->cursor,p); prgetc(bw->cursor); } } else { d = prgetc(p); do { do { if (d == '*') break; } while ((d = prgetc(p)) != NO_MORE_DATA); d = prgetc(p); } while (d != NO_MORE_DATA && d != '/'); if (d == '/') { pset(bw->cursor,p); } } prm(p); if (d == NO_MORE_DATA) return -1; else return 0; } /* Search for matching delimiter: ignore things in comments or strings */ /* This really should be language dependent */ if (dir == 1) { P *p = pdup(bw->cursor, USTR "utomatch"); int cnt = 0; /* No. levels of delimiters we're in */ while ((d = pgetc(p)) != NO_MORE_DATA) { if (d == '\\') { pgetc(p); } else if (d == '$' && brch(p)=='#' && bw->o.pound_comment) { pgetc(p); } else if (!bw->o.no_double_quoted && d == '"') { while ((d = pgetc(p)) != NO_MORE_DATA) if (d == '"') break; else if (d == '\\') pgetc(p); } else if (bw->o.single_quoted && d == '\'' && c!='\'' && c!='`') { while((d = pgetc(p)) != NO_MORE_DATA) if (d == '\'') break; else if (d == '\\') pgetc(p); } else if ((bw->o.pound_comment && d == '#') || (bw->o.semi_comment && d == ';') || (bw->o.tex_comment && d == '%') || (bw->o.vhdl_comment && d == '-' && brch(p) == '-')) { while ((d = pgetc(p)) != NO_MORE_DATA) if (d == '\n') break; } else if ((bw->o.c_comment || bw->o.cpp_comment) && d == '/') { d = pgetc(p); if (bw->o.c_comment && d == '*') { d = pgetc(p); do { do { if (d == '*') break; } while ((d = pgetc(p)) != NO_MORE_DATA); d = pgetc(p); } while (d != NO_MORE_DATA && d != '/'); } else if (d == '/') { while ((d = pgetc(p)) != NO_MORE_DATA) if (d == '\n') break; } else if (d != NO_MORE_DATA) prgetc(p); } else if (d == c) ++cnt; else if (d == f && !--cnt) { prgetc(p); pset(bw->cursor, p); break; } } prm(p); } else { P *p = pdup(bw->cursor, USTR "utomatch"); int cnt = 0; /* No. levels of delimiters we're in */ while ((d = prgetc(p)) != NO_MORE_DATA) { int peek = prgetc(p); int peek1 = 0; if(peek != NO_MORE_DATA) { peek1 = prgetc(p); if (peek1 != NO_MORE_DATA) pgetc(p); pgetc(p); } if (peek == '\\' && peek1!='\\') { } else if (!bw->o.no_double_quoted && d == '"') { while((d = prgetc(p)) != NO_MORE_DATA) { if (d == '"') { d = prgetc(p); if (d != '\\') { if (d != NO_MORE_DATA) pgetc(p); break; } } } } else if (bw->o.c_comment && d =='/') { d = prgetc(p); if (d == '*') { d = prgetc(p); do { do { if (d == '*') break; } while ((d = prgetc(p)) != NO_MORE_DATA); d = prgetc(p); } while (d != NO_MORE_DATA && d != '/'); } else if (d != NO_MORE_DATA) pgetc(p); } else if ((bw->o.cpp_comment || bw->o.pound_comment || bw->o.semi_comment || bw->o.vhdl_comment || bw->o.tex_comment) && d == '\n') { P *q = pdup(p, USTR "utomatch"); int cc; p_goto_bol(q); while((cc = pgetc(q)) != '\n') { if (bw->o.pound_comment && cc == '$' && brch(q) == '#') { pgetc(q); } else if (cc == '\\') { if (pgetc(q) == '\n') break; } else if(!bw->o.no_double_quoted && cc=='"') { while ((cc = pgetc(q)) != '\n') if (cc == '"') break; else if (cc == '\\') pgetc(q); if (cc == '\n') break; } else if (bw->o.cpp_comment && cc == '/') { if (brch(q)=='/') { prgetc(q); pset(p,q); break; } } else if (bw->o.single_quoted && cc == '\'') { while((cc = pgetc(q)) != '\n') if (cc == '\'') break; else if (cc == '\\') pgetc(q); if (cc == '\n') break; } else if (bw->o.vhdl_comment && cc == '-') { if (brch(q)=='-') { prgetc(q); pset(p,q); break; } } else if (bw->o.pound_comment && cc == '#') { pset(p,q); break; } else if (bw->o.semi_comment && cc == ';') { pset(p,q); break; } else if (bw->o.tex_comment && cc == '%') { pset(p,q); break; } } prm(q); } else if (bw->o.single_quoted && d =='\'' && c!='\'' && c!='`') { while((d = prgetc(p)) != NO_MORE_DATA) if (d == '\'') { d = prgetc(p); if (d != '\\') { if (d != NO_MORE_DATA) pgetc(p); break; } } } else if (d == c) ++cnt; else if (d == f) if (!cnt--) { pset(bw->cursor, p); break; } } prm(p); } if (d == NO_MORE_DATA) return -1; else return 0; } /* 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) { if (menu_above) { if (bw->parent->link.prev->watom==&watommenu) { return umpgup(bw->parent->link.prev->object); } } else { if (bw->parent->link.next->watom==&watommenu) { return umpgup(bw->parent->link.next->object); } } bw = (BW *) bw->parent->main->object; 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) { if (menu_above) { if (bw->parent->link.prev->watom==&watommenu) { return umpgdn(bw->parent->link.prev->object); } } else { if (bw->parent->link.next->watom==&watommenu) { return umpgdn(bw->parent->link.next->object); } } bw = (BW *) bw->parent->main->object; 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 *) bw->parent->main->object; 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 /* was return -1; */ return uuparw(bw); } int udnslide(BW *bw) { bw = (BW *) bw->parent->main->object; 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 /* was return -1; */ return udnarw(bw); } /* 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 = calc(bw, s); if (notify) *notify = 1; vsrm(s); if (num >= 1 && !merr) { 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 (merr) msgnw(bw->parent, merr); else msgnw(bw->parent, joe_gettext(_("Invalid line number"))); return -1; } } int uline(BW *bw) { if (wmkpw(bw->parent, joe_gettext(_("Go to line (^C to abort): ")), &linehist, doline, NULL, NULL, NULL, NULL, NULL, locale_map, 0)) 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 = calc(bw, s); if (notify) *notify = 1; vsrm(s); if (num >= 1 && !merr) { int tmp = mid; pcol(bw->cursor, num - 1), bw->cursor->xcol = piscol(bw->cursor); mid = 1; dofollows(); mid = tmp; return 0; } else { if (merr) msgnw(bw->parent, merr); else msgnw(bw->parent, joe_gettext(_("Invalid column number"))); return -1; } } int ucol(BW *bw) { if (wmkpw(bw->parent, joe_gettext(_("Go to column (^C to abort): ")), &colhist, docol, NULL, NULL, NULL, NULL, NULL, locale_map, 0)) 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 = calc(bw, s); if (notify) *notify = 1; vsrm(s); if (num >= 0 && !merr) { int tmp = mid; pgoto(bw->cursor, num), bw->cursor->xcol = piscol(bw->cursor); mid = 1; dofollows(); mid = tmp; return 0; } else { if (merr) msgnw(bw->parent, merr); else msgnw(bw->parent, joe_gettext(_("Invalid byte number"))); return -1; } } int ubyte(BW *bw) { if (wmkpw(bw->parent, joe_gettext(_("Go to byte (^C to abort): ")), &bytehist, dobyte, NULL, NULL, NULL, NULL, NULL, locale_map, 0)) 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, USTR "udelch")); 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; /* Degenerate into ltarw for overtype mode */ if (bw->o.overtype) { return u_goto_left(bw); } 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 && bw->o.autoindent) { P *p; /* Delete all indentation */ p = pdup(bw->cursor, USTR "ubacks"); 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)) { /* 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, USTR "ubacks"); do { c = prgetc(bw->cursor); if(c=='\t') cw += bw->o.tab; else cw += 1; bdel(bw->cursor, p); } while(!pisbol(bw->cursor) && cwcursor, USTR "ubacks"); 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, USTR "u_word_delete"); struct charmap *map=bw->b->o.charmap; int c = brch(p); if (joe_isalnum_(map,c)) while (joe_isalnum_(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, USTR "ubackw"); int c = prgetc(bw->cursor); struct charmap *map=bw->b->o.charmap; if (joe_isalnum_(map,c)) { while (joe_isalnum_(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, USTR "udelel")); 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, USTR "udelbl")); 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, USTR "udelln"); 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 */ 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) { struct charmap *map=bw->b->o.charmap; /* Send data to shell window */ if (bw->b->pid && piseof(bw->cursor)) { unsigned char c = k; joe_write(bw->b->out, &c, 1); return 0; } /* 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, USTR "utypebw_raw")); 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, USTR "utypebw_raw"); 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(bw, ' '); } else { int upd; 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(locale_map->type && !no_decode) { int utf8_char = utf8_decode(&utype_utf8_sm,k); if(utf8_char >= 0) k = utf8_char; else return 0; } upd = bw->parent->t->t->updtab[bw->y + bw->cursor->line - bw->top->line]; simple = 1; if (pisblank(bw->cursor)) while (piscol(bw->cursor) < bw->o.lmargin) { binsc(bw->cursor, ' '); pgetc(bw->cursor); } if (!no_decode) { if(locale_map->type && !bw->b->o.charmap->type) { unsigned char buf[10]; utf8_encode(buf,k); k = from_utf8(bw->b->o.charmap,buf); } else if(!locale_map->type && bw->b->o.charmap->type) { unsigned char buf[10]; 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(map,k)) { wrapword(bw, bw->cursor, (long) bw->o.lmargin, bw->o.french, 0, NULL); simple = 0; } bw->cursor->xcol = piscol(bw->cursor); #ifndef __MSDOS__ 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; if (simple && k != '\t' && k != '\n' && !curmacro) { int atr; 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; atr = BG_COLOR(bg_text); if (!upd && 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, k, atr); } #endif } return 0; } int utypebw(BW *bw, int k) { return utypebw_raw(bw, k, 0); } /* Quoting */ static B *unicodehist = NULL; /* History of previously entered unicode characters */ static int dounicode(BW *bw, unsigned char *s, void *object, int *notify) { int num; sscanf((char *)s,"%x",(unsigned *)&num); if (notify) *notify = 1; vsrm(s); utypebw_raw(bw, num, 1); bw->cursor->xcol = piscol(bw->cursor); return 0; } 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(buf, sizeof(buf), "ASCII %c--", c); if (!mkqwna(bw->parent, sz(buf), doquote, NULL, NULL, notify)) return -1; else return 0; } else if (c == 'x' || c == 'X') { if (bw->b->o.charmap->type) { if (!wmkpw(bw->parent, joe_gettext(_("Unicode (ISO-10646) character in hex (^C to abort): ")), &unicodehist, dounicode, NULL, NULL, NULL, NULL, NULL, locale_map, 0)) return 0; else return -1; } else { quotestate = 3; if (!mkqwna(bw->parent, sc("ASCII 0x--"), doquote, NULL, NULL, notify)) return -1; else return 0; } } else if (c == 'o' || c == 'O') { quotestate = 5; if (!mkqwna(bw->parent, sc("ASCII 0---"), doquote, NULL, NULL, notify)) return -1; else return 0; } else { if ((c >= 0x40 && c <= 0x5F) || (c >= 'a' && c <= 'z')) c &= 0x1F; if (c == '?') c = 127; utypebw_raw(bw, c, 1); bw->cursor->xcol = piscol(bw->cursor); } break; case 1: if (c >= '0' && c <= '9') { joe_snprintf_2(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') { joe_snprintf_1(buf, sizeof(buf), "ASCII 0x%c-", c); quoteval = c - '0'; quotestate = 4; if (!mkqwna(bw->parent, sz(buf), doquote, NULL, NULL, notify)) return -1; else return 0; } else if (c >= 'a' && c <= 'f') { joe_snprintf_1(buf, sizeof(buf), "ASCII 0x%c-", c + 'A' - 'a'); quoteval = c - 'a' + 10; quotestate = 4; if (!mkqwna(bw->parent, sz(buf), doquote, NULL, NULL, notify)) return -1; else return 0; } else if (c >= 'A' && c <= 'F') { joe_snprintf_1(buf, sizeof(buf), "ASCII 0x%c-", c); quoteval = c - 'A' + 10; quotestate = 4; if (!mkqwna(bw->parent, sz(buf), doquote, NULL, NULL, notify)) return -1; else return 0; } break; case 4: if (c >= '0' && c <= '9') { quoteval = quoteval * 16 + c - '0'; utypebw_raw(bw, quoteval, 1); bw->cursor->xcol = piscol(bw->cursor); } else if (c >= 'a' && c <= 'f') { quoteval = quoteval * 16 + c - 'a' + 10; utypebw_raw(bw, quoteval, 1); bw->cursor->xcol = piscol(bw->cursor); } else if (c >= 'A' && c <= 'F') { quoteval = quoteval * 16 + c - 'A' + 10; utypebw_raw(bw, quoteval, 1); bw->cursor->xcol = piscol(bw->cursor); } break; case 5: if (c >= '0' && c <= '7') { joe_snprintf_1(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(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; } int uquote(BW *bw) { quotestate = 0; if (mkqwna(bw->parent, sz(joe_gettext(_("Ctrl- (or 0-9 for dec. ascii, x for hex, or o for octal)"))), doquote, NULL, NULL, NULL)) return 0; else return -1; } static int doquote9(BW *bw, int c, void *object, int *notify) { if (notify) *notify = 1; if ((c >= 0x40 && c <= 0x5F) || (c >= 'a' && c <= 'z')) c &= 0x1F; if (c == '?') c = 127; c |= 128; utypebw_raw(bw, c, 1); bw->cursor->xcol = piscol(bw->cursor); 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; } 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(bw, '\\'); utypebw(bw, 'n'); } 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, sz(joe_gettext(_("Quote"))), doctrl, NULL, NULL, NULL)) return 0; else return -1; } /* User hit Return. Deal with autoindent. */ int rtntw(BW *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, USTR "rtntw"); 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'); if (bw->o.autoindent && (brch(bw->cursor)!=' ' && brch(bw->cursor)!='\t')) { P *p = pdup(bw->cursor, USTR "uopen"); P *q = pdup(p, USTR "uopen"); int c; pgetc(q); p_goto_bol(p); while (joe_isspace(bw->b->o.charmap,(c = pgetc(p))) && c != '\n') { binsc(q, c); pgetc(q); } prm(p); prm(q); } 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', USTR "dosetmark"); poffline(bw->b->marks[c - '0']); if (c!=':') { joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("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, sz(joe_gettext(_("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(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("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, sz(joe_gettext(_("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, USTR "dofwrdc"); 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, joe_gettext(_("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, sz(joe_gettext(_("Forward 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, sz(joe_gettext(_("Backward 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; zcpy(msgbuf, s); vsrm(s); msgnw(b->parent, msgbuf); return 0; } int umsg(BASE *b) { if (wmkpw(b->parent, joe_gettext(_("Message (^C to abort): ")), NULL, domsg, NULL, NULL, NULL, NULL, NULL, locale_map, 0)) return 0; else return -1; } /* Insert text */ static int dotxt(BW *bw, unsigned char *s, void *object, int *notify) { int x,fill; unsigned char *str; if (notify) *notify = 1; if (s[0]=='`') { str=vsmk(1024); fill=' '; str=stagen(str,bw,&s[1],fill); if (str) { for(x=0;x!=sLEN(str);++x) utypebw(bw,str[x]); vsrm(str); } } else for (x = 0; x != sLEN(s); ++x) utypebw(bw, s[x]); vsrm(s); return 0; } int utxt(BW *bw) { if (wmkpw(bw->parent, joe_gettext(_("Insert (^C to abort): ")), NULL, dotxt, NULL, NULL, utypebw, NULL, NULL, bw->b->o.charmap, 0)) return 0; else return -1; } /* Insert current file name */ int uname_joe(BW *bw) { unsigned char *s; W *w=bw->parent->main; s=((BW *)w->object)->b->name; if (!s || !*s) return -1; while (*s) if (utypebw(bw,*s++)) return -1; return 0; } /* Insert until non-base64 character received */ int upaste(BW *bw, int k) { int c; int accu = 0; int count; int tmp_ww = bw->o.wordwrap; int tmp_ai = bw->o.autoindent; bw->o.wordwrap = 0; bw->o.autoindent = 0; count = 0; /* We have to wait for the second ';' */ while ((c = ttgetc()) != -1) if (c == ';') break; if (c == -1) goto bye; while ((c = ttgetc()) != -1) { if (c >= 'A' && c <= 'Z') c = c - 'A'; else if (c >= 'a' && c <= 'z') c = c - 'a' + 26; else if (c >= '0' && c <= '9') c = c - '0' + 52; else if (c == '+') c = 62; else if (c == '/') c = 63; else if (c == '=') continue; else break; switch (count) { case 0: accu = c; count = 6; break; case 2: accu = (accu << 6) + c; if (accu == 13) rtntw(bw); else utypebw(bw, accu); count = 0; break; case 4: accu = (accu << 4) + (c >> 2); if (accu == 13) rtntw(bw); else utypebw(bw, accu); accu = (c & 0x3); count = 2; break; case 6: accu = (accu << 2) + (c >> 4); if (accu == 13) rtntw(bw); else utypebw(bw, accu); accu = (c & 0xF); count = 4; break; } } /* Terminator is ESC \ */ if (c == 033) { ttgetc(); } bye: bw->o.wordwrap = tmp_ww; bw->o.autoindent = tmp_ai; return 0; } joe-3.7/uedit.h0000644000100100007640000000416110431662534010343 00000000000000/* * Basic user edit functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_UEDIT_H #define _JOE_UEDIT_H 1 extern int pgamnt; /* Amount of pgup/pgdn lines to keep */ /* * Movable functions * return 0 if action was done * return -1 otherwise */ int u_goto_bol PARAMS((BW *bw)); /* move cursor to beginning of line */ int u_goto_eol PARAMS((BW *bw)); /* move cursor to end of line */ int u_goto_bof PARAMS((BW *bw)); /* move cursor to beginning of file */ int u_goto_eof PARAMS((BW *bw)); /* move cursor to end of file */ int u_goto_left PARAMS((BW *bw)); /* move cursor to left (left arrow) */ int u_goto_right PARAMS((BW *bw)); /* move cursor to right (right arrow) */ int u_goto_prev PARAMS((BW *bw)); /* move cursor to prev. word, edge, or beginning of line */ int u_goto_next PARAMS((BW *bw)); /* move cursor to next word, edge, or end of line */ int utomatch PARAMS((BW *bw)); int uuparw PARAMS((BW *bw)); int udnarw PARAMS((BW *bw)); int utos PARAMS((BW *bw)); int ubos PARAMS((BW *bw)); void scrup PARAMS((BW *bw, int n, int flg)); void scrdn PARAMS((BW *bw, int n, int flg)); int upgup PARAMS((BW *bw)); int upgdn PARAMS((BW *bw)); int uupslide PARAMS((BW *bw)); int udnslide PARAMS((BW *bw)); int uline PARAMS((BW *bw)); int udelch PARAMS((BW *bw)); int ubacks PARAMS((BW *bw, int k)); int u_word_delete PARAMS((BW *bw)); int ubackw PARAMS((BW *bw)); int udelel PARAMS((BW *bw)); int udelbl PARAMS((BW *bw)); int udelln PARAMS((BW *bw)); int uinsc PARAMS((BW *bw)); int utypebw PARAMS((BW *bw, int k)); int uquote PARAMS((BW *bw)); int uquote8 PARAMS((BW *bw)); int rtntw PARAMS((BW *bw)); int uopen PARAMS((BW *bw)); int usetmark PARAMS((BW *bw, int c)); int ugomark PARAMS((BW *bw, int c)); int ufwrdc PARAMS((BW *bw, int k)); int ubkwdc PARAMS((BW *bw, int k)); int umsg PARAMS((BASE *b)); int uctrl PARAMS((BW *bw)); int unedge PARAMS((BW *bw)); int upedge PARAMS((BW *bw)); int ubyte PARAMS((BW *bw)); int ucol PARAMS((BW *bw)); int utxt PARAMS((BW *bw)); int uhome PARAMS((BW *bw)); int uname_joe PARAMS((BW *bw)); int upaste PARAMS((BW *bw, int k)); #endif joe-3.7/uisrch.c0000644000100100007640000001613010457276141010523 00000000000000/* * Incremental search * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" typedef struct irec IREC; 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 isrch *lastisrch = NULL; /* Previous search */ unsigned char *lastpat = NULL; /* Previous pattern */ IREC fri = { {&fri, &fri} }; /* 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); joe_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,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, USTR "iappend"); 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(joe_beep) 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; 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(joe_beep) 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,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, USTR "itype"); 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(joe_beep) 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 (locale_map->type && !bw->b->o.charmap->type) { utf8_encode(buf,c); c = from_utf8(bw->b->o.charmap,buf); } else if(!locale_map->type && bw->b->o.charmap->type) { to_utf8(locale_map,buf,c); c = utf8_decode_string(buf); } if (bw->b->o.charmap->type) { 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 (locale_map->type && !bw->b->o.charmap->type) { /* Translate bytes to utf-8 */ unsigned char buf[16]; int x; for (x=0; x!=sLEN(isrch->pattern); ++x) { int c = to_uni(bw->b->o.charmap, isrch->pattern[x]); utf8_encode(buf,c); isrch->prompt = vsncpy(sv(isrch->prompt),sz(buf)); } } else if (!locale_map->type && bw->b->o.charmap->type) { /* Translate utf-8 to bytes */ unsigned char *p = isrch->pattern; int len = sLEN(isrch->pattern); while (len) { int c = utf8_decode_fwrd(&p, &len); if (c>=0) { c = from_uni(locale_map, c); isrch->prompt = vsadd(isrch->prompt, c); } } } 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; } } static int doisrch(BW *bw, int dir) { /* Create a struct isrch */ struct isrch *isrch = (struct isrch *) joe_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, sz(joe_gettext(_("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); } } joe-3.7/uisrch.h0000644000100100007640000000035210431662534010524 00000000000000/* * Incremental search * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_UISRCH_H #define _JOE_UISRCH_H 1 int uisrch PARAMS((BW *bw)); int ursrch PARAMS((BW *bw)); #endif joe-3.7/ufile.c0000644000100100007640000006355611103410030010320 00000000000000/* * User file operations * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" #ifdef HAVE_UTIME_H #include #else #ifdef HAVE_SYS_UTIME_H #include #endif #endif #ifdef WITH_SELINUX int copy_security_context(const char *from_file, const char *to_file); #endif int orphan; unsigned char *backpath = NULL; /* Place to store backup files */ 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) { unsigned char *s; if (bw->b->name && bw->b->name[0]) { s = bw->b->name; } else { s = joe_gettext(_("(Unnamed)")); } if (name) { if (saved) { joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("File %s saved")), name); } else { joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("File %s not saved")), name); } } else if (bw->b->changed && bw->b->count == 1) { joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("File %s not saved")), s); } else if (saved) { joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("File %s saved")), s); } else { joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("File %s not changed so no update needed")), s); } if (exmsg) vsrm(exmsg); exmsg = vsncpy(NULL,0,sz(msgbuf)); msgnw(bw->parent, msgbuf); } /* For ^X ^C */ void genexmsgmulti(BW *bw, int saved, int skipped) { if (saved) if (skipped) joe_snprintf_0(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("Some files have not been saved."))); else joe_snprintf_0(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("All modified files have been saved."))); else joe_snprintf_0(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("No modified files, so no updates needed."))); msgnw(bw->parent, msgbuf); exmsg = vsncpy(NULL,0,sz(msgbuf)); } /* Shell escape */ int ushell(BW *bw) { nescape(bw->parent->t->t); ttsusp(); nreturn(bw->parent->t->t); return 0; } /* Execute shell command */ static int dosys(BW *bw, unsigned char *s, void *object, int *notify) { int rtn; nescape(bw->parent->t->t); rtn=ttshell(s); nreturn(bw->parent->t->t); if (notify) *notify = 1; vsrm(s); return rtn; } int usys(BW *bw) { if (wmkpw(bw->parent, joe_gettext(_("System (^C to abort): ")), NULL, dosys, NULL, NULL, NULL, NULL, NULL, bw->b->o.charmap, 1)) return 0; else return -1; } /* Copy a file */ static int cp(unsigned char *from, unsigned char *to) { int f, g, amnt; struct stat sbuf; #ifdef HAVE_UTIME #ifdef NeXT time_t utbuf[2]; #else struct utimbuf utbuf; #endif #endif f = open((char *)from, O_RDONLY); if (f < 0) { return -1; } if (fstat(f, &sbuf) < 0) { return -1; } g = creat((char *)to, sbuf.st_mode & ~(S_ISUID | S_ISGID)); if (g < 0) { close(f); return -1; } while ((amnt = read(f, stdbuf, stdsiz)) > 0) { if (amnt != joe_write(g, stdbuf, amnt)) { break; } } close(f); close(g); if (amnt) { return -1; } #ifdef HAVE_UTIME #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((char *)to, &utbuf); #endif #ifdef WITH_SELINUX copy_security_context(from,to); #endif 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) { if (!bw->b->backup && !nobackups && !bw->o.nobackup && bw->b->name && bw->b->name[0]) { unsigned char tmp[1024]; unsigned char name[1024]; #ifdef __MSDOS__ int x; if (backpath) { unsigned char *t = vsncpy(NULL,0,sz(backpath)); t = canonical(t); joe_snprintf_2(name, sizeof(name), "%s/%s", t, namepart(tmp, bw->b->name)); vsrm(t); } else { joe_snprintf_1(name, sizeof(name), "%s", bw->b->name); } for (x = zlen(name); name[--x] != '.';) { if (name[x] == '\\' || (name[x] == ':' && x == 1) || x == 0) { x = zlen(name); break; } } zcpy(name + x, USTR ".bak"); #else /* Create backup file name */ unsigned char *simple_backup_suffix = (unsigned char *)getenv("SIMPLE_BACKUP_SUFFIX"); if (simple_backup_suffix == NULL) { simple_backup_suffix = USTR "~"; } if (backpath) { unsigned char *t = vsncpy(NULL, 0, sz(backpath)); t = canonical(t); joe_snprintf_3(name, sizeof(name), "%s/%s%s", t, namepart(tmp, dequote(bw->b->name)), simple_backup_suffix); vsrm(t); } else { joe_snprintf_2(name, sizeof(name), "%s%s", dequote(bw->b->name), simple_backup_suffix); } /* Attempt to delete backup file first */ unlink((char *)name); #endif /* Copy original file to backup file */ if (cp(dequote(bw->b->name), name)) { return 1; } else { bw->b->backup = 1; return 0; } } else { return 0; } } /* Write file */ /* Continuation structure */ struct savereq { int (*callback) (); 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 */ int block_save; /* Flag, if we want to save a block# */ unsigned char *message; /* String for messages to be shown to the user */ }; struct savereq *mksavereq(int (*callback)(), unsigned char *name, B *first,int rename, int block_save) { struct savereq *req = (struct savereq *) joe_malloc(sizeof(struct savereq)); req->callback = callback; req->name = name; req->first = first; req->not_saved = 0; req->rename = rename; req->block_save = block_save; return req; } static void rmsavereq(struct savereq *req) { vsrm(req->name); joe_free(req); } /* Check if character 'c' is in the set. * 'c' should be unicode if the locale is UTF-8, otherwise it's * an 8-bit character. 'set' should be of this format: "xxxx<>yyyy". xxxx * is a list of 8-bit characters. yyyy is a list of UTF-8 characters. */ unsigned char *yes_key = (unsigned char *) _("|yes|yY"); unsigned char *no_key = (unsigned char *) _("|no|nN"); int yncheck(unsigned char *key_set, int c) { unsigned char *set = joe_gettext(key_set); if (locale_map->type) { /* 'c' is unicode */ while (*set) { if (c == utf8_decode_fwrd(&set, NULL)) return 1; } return 0; } else { /* 'c' is 8-bit */ while (set[0]) { if (set[0] == c) return 1; ++set; } return 0; } } int ynchecks(unsigned char *set, unsigned char *s) { if (locale_map->type) return yncheck(set, utf8_decode_fwrd(&s, NULL)); else return yncheck(set, s[0]); } static int saver(BW *bw, int c, struct savereq *req, int *notify) { int fl; if (c == NO_CODE || yncheck(no_key, c)) { msgnw(bw->parent, joe_gettext(_("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 != YES_CODE && !yncheck(yes_key, c)) { if (mkqw(bw->parent, sz(joe_gettext(_("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) { exmacro(bw->o.msnew,1); bw->b->er = -3; } if (bw->b->er == 0 && bw->o.msold) { exmacro(bw->o.msold,1); } if ((fl = bsave(bw->b->bof, req->name, bw->b->eof->byte, req->rename ? 2 : 1)) != 0) { msgnw(bw->parent, joe_gettext(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 && req->name[0] != '!' && req->name[0] != '>') { bw_unlock(bw); joe_free(bw->b->name); bw->b->name = 0; } if (!bw->b->name && req->name[0]!='!' && req->name[0]!='>') bw->b->name = joesep(zdup(req->name)); if (bw->b->name && !zcmp(bw->b->name, req->name)) { bw_unlock(bw); 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) { if (req->block_save) { if (notify) *notify = 1; if (markv(1)) { if (square) { int fl; int ret = 0; B *tmp = pextrect(markb, markk->line - markb->line + 1, markk->xcol); if ((fl = bsave(tmp->bof, req->name, tmp->eof->byte, 0)) != 0) { msgnw(bw->parent, joe_gettext(msgs[-fl])); ret = -1; } brm(tmp); if (!ret) { joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("Block written to file %s")), req->name); msgnw(bw->parent, msgbuf); } if (lightoff) unmark(bw); vsrm(req->name); return ret; } else { int fl; int ret = 0; if ((fl = bsave(markb, req->name, markk->byte - markb->byte, 0)) != 0) { msgnw(bw->parent, joe_gettext(msgs[-fl])); ret = -1; } if (!ret) { joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("Block written to file %s")), req->name); msgnw(bw->parent, msgbuf); } if (lightoff) unmark(bw); vsrm(req->name); return ret; } } else { vsrm(req->name); msgnw(bw->parent, joe_gettext(_("No block"))); return -1; } } else { if (backup(bw)) { return saver(bw, 0, req, notify); } else { return saver(bw, YES_CODE, req, notify); } } } static int dosave2(BW *bw, int c, struct savereq *req, int *notify) { if (c == YES_CODE || yncheck(yes_key, c)) { return dosave(bw, req, notify); } else if (c == NO_CODE || yncheck(no_key, c)) { if (notify) { *notify = 1; } genexmsg(bw, 0, req->name); rmsavereq(req); return -1; } else if (mkqw(bw->parent, sz(req->message), dosave2, NULL, req, notify)) { return 0; } else { /* Should be in abort function */ 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 || zcmp(s, bw->b->name)) { /* Newly named file or name is different than buffer */ f = open((char *)dequote(s), O_RDONLY); if (f != -1) { close(f); /* char *msg = "File exists. Overwrite (y,n,^C)? "; req->message = msg; */ req->message = joe_gettext(_("File exists. Overwrite (y,n,^C)? ")); return dosave2(bw, 0, req, notify); } } else { /* We're saving a newer version of the same file */ if (check_mod(bw->b)) { req->message = joe_gettext(_("File on disk is newer. Overwrite (y,n,^C)? ")); return dosave2(bw, 0, req, notify); } } } return dosave(bw, req, notify); } /* User command: ^K D */ int usave(BW *bw) { BW *pbw; pbw = wmkpw(bw->parent, joe_gettext(_("Name of file to save (^C to abort): ")), &filehist, dosave1, USTR "Names", NULL, cmplt, mksavereq(NULL,NULL,NULL, 1, 0), NULL, locale_map, bw->b->name ? 1 : 7); 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; } } int usavenow(BW *bw) { if (bw->b->name) { return dosave1(bw,vsncpy(NULL,0,sz(bw->b->name)),mksavereq(NULL,NULL,NULL,0,0),NULL); } else return usave(bw); } /* 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, joe_gettext(_("Name of file to write (^C to abort): ")), &filehist, dosave1, USTR "Names", NULL, cmplt, mksavereq(NULL, NULL, NULL, 0, 1), NULL, locale_map, 3)) { return 0; } else { return -1; } } else { return usave(bw); } } /* Load file to edit */ int doedit1(BW *bw,int c,unsigned char *s,int *notify) { int omid; int ret = 0; int er; void *object; W *w; B *b; if (c == YES_CODE || yncheck(yes_key, c)) { /* Reload from file */ if (notify) { *notify = 1; } b = bfind_reload(s); er = berror; if (bw->b->count == 1 && (bw->b->changed || bw->b->name)) { if (orphan) { orphit(bw); } else { if (uduptw(bw)) { brm(b); return -1; } bw = (BW *) maint->curwin->object; } } if (er) { msgnwt(bw->parent, joe_gettext(msgs[-er])); if (er != -1) { ret = -1; } } object = bw->object; w = bw->parent; bwrm(bw); w->object = (void *) (bw = bwmk(w, b, 0)); wredraw(bw->parent); bw->object = object; vsrm(s); if (er == -1 && bw->o.mnew) { exmacro(bw->o.mnew,1); } if (er == 0 && bw->o.mold) { exmacro(bw->o.mold,1); } /* Restore cursor line */ pline(bw->cursor, get_file_pos(bw->b->name)); omid = mid; mid = 1; dofollows(); mid = omid; return ret; } else if (c == NO_CODE || yncheck(no_key, c)) { /* Edit already loaded buffer */ if (notify) { *notify = 1; } b = bfind(s); er = berror; if (bw->b->count == 1 && (bw->b->changed || bw->b->name)) { if (orphan) { orphit(bw); } else { if (uduptw(bw)) { brm(b); return -1; } bw = (BW *) maint->curwin->object; } } if (er) { msgnwt(bw->parent, joe_gettext(msgs[-er])); if (er != -1) { ret = -1; } } object = bw->object; w = bw->parent; bwrm(bw); w->object = (void *) (bw = bwmk(w, b, 0)); wredraw(bw->parent); bw->object = object; vsrm(s); if (er == -1 && bw->o.mnew) { exmacro(bw->o.mnew,1); } if (er == 0 && bw->o.mold) { exmacro(bw->o.mold,1); } /* Restore cursor line */ pline(bw->cursor, get_file_pos(bw->b->name)); omid = mid; mid = 1; dofollows(); mid = omid; return ret; } else { /* FIXME: need abort handler to prevent leak */ if (mkqw(bw->parent, sz(joe_gettext(_("Load original file from disk (y,n,^C)? "))), doedit1, NULL, s, notify)) return 0; else { vsrm(s); return -1; } } } int doedit(BW *bw, unsigned char *s, void *obj, int *notify) { B *b; b = bcheck_loaded(s); if (b) { if (b->changed && !b->scratch) /* Modified buffer exists, so ask */ return doedit1(bw, 0, s, notify); else /* Buffer not modified- just use it as is */ return doedit1(bw, NO_CODE, s, notify); } else /* File not in buffer: don't ask */ return doedit1(bw, YES_CODE, s, notify); } int okrepl(BW *bw) { if (bw->b->count == 1 && bw->b->changed) { msgnw(bw->parent, joe_gettext(_("Can't replace modified file"))); return -1; } else { return 0; } } int uedit(BW *bw) { if (wmkpw(bw->parent, joe_gettext(_("Name of file to edit (^C to abort): ")), &filehist, doedit, USTR "Names", NULL, cmplt, NULL, NULL, locale_map,7)) { return 0; } else { return -1; } } int doswitch(BW *bw, unsigned char *s, void *obj, int *notify) { /* Try buffer, then file */ return doedit1(bw, NO_CODE, s, notify); } int uswitch(BW *bw) { if (wmkpw(bw->parent, joe_gettext(_("Name of buffer to edit (^C to abort): ")), &filehist, doswitch, USTR "Names", NULL, cmplt, NULL, NULL, locale_map,1)) { return 0; } else { return -1; } } 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 = berror; if (bw->b->count == 1 && (bw->b->changed || bw->b->name)) { if (orphan) { orphit(bw); } else { if (uduptw(bw)) { brm(b); return -1; } bw = (BW *) maint->curwin->object; } } if (er) { msgnwt(bw->parent, joe_gettext(msgs[-er])); if (er != -1) { ret = -1; } } object = bw->object; w = bw->parent; bwrm(bw); w->object = (void *) (bw = bwmk(w, b, 0)); wredraw(bw->parent); bw->object = object; vsrm(s); if (er == -1 && bw->o.mnew) { exmacro(bw->o.mnew,1); } if (er == 0 && bw->o.mold) { exmacro(bw->o.mold,1); } return ret; } int uscratch(BW *bw) { if (wmkpw(bw->parent, joe_gettext(_("Name of scratch buffer to edit (^C to abort): ")), &filehist, doscratch, USTR "Names", NULL, cmplt, NULL, NULL, locale_map, 1)) { 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 omid; int ret = 0; int er; W *w = bw->parent; B *b; if (notify) { *notify = 1; } b = bfind(s); er = berror; if (berror) { msgnwt(bw->parent, joe_gettext(msgs[-berror])); if (berror != -1) { ret = -1; } } if (bw->b->count == 1 && (bw->b->changed || bw->b->name)) { orphit(bw); } bwrm(bw); w->object = (void *) (bw = bwmk(w, b, 0)); wredraw(bw->parent); bw->object = object; vsrm(s); if (er == -1 && bw->o.mnew) { exmacro(bw->o.mnew,1); } if (er == 0 && bw->o.mold) { exmacro(bw->o.mold,1); } /* Restore cursor line */ pline(bw->cursor, get_file_pos(bw->b->name)); omid = mid; mid = 1; dofollows(); mid = omid; return ret; } /* Switch to a particular buffer */ int get_buffer_in_window(BW *bw, B *b) { void *object = bw->object; W *w = bw->parent; 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 = (void *) (bw = bwmk(w, b, 0)); wredraw(bw->parent); bw->object = object; return 0; } /* Switch to next buffer in window */ int unbuf(BW *bw) { B *b; b = bnext(); if (b == bw->b) { b = bnext(); } return get_buffer_in_window(bw,b); } int upbuf(BW *bw) { B *b; b = bprev(); if (b == bw->b) { b = bprev(); } return get_buffer_in_window(bw, b); } int uinsf(BW *bw) { if (wmkpw(bw->parent, joe_gettext(_("Name of file to insert (^C to abort): ")), &filehist, doinsf, USTR "Names", NULL, cmplt, NULL, NULL, locale_map, 3)) { 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_unlock(bw); 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,0), NULL); } else { BW *pbw = wmkpw(bw->parent, joe_gettext(_("Name of file to save (^C to abort): ")), &filehist, dosave1, USTR "Names", NULL, cmplt, mksavereq(exdone,NULL,NULL,1,0), NULL, locale_map, 1); 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 == YES_CODE || yncheck(yes_key, c)) { /* uexsve macro should be here... */ if(notify) *notify = 1; return 0; } else if (c == NO_CODE || yncheck(no_key, c)) { 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, sz(joe_gettext(_("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 != YES_CODE && !yncheck(yes_key, c)) { 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) && ((BW *)w->object)->b==b) { if ((new_b = borphan()) != NULL) { BW *bw = (BW *)w->object; void *object = bw->object; /* FIXME: Shouldn't we wabort() and wcreate here to kill any prompt windows? */ bwrm(bw); w->object = (void *) (bw = bwmk(w, new_b, 0)); wredraw(w); bw->object = object; } else { BW *bw = (BW *)w->object; object = bw->object; bwrm(bw); w->object = (void *) (bw = bwmk(w, bfind(USTR ""), 0)); wredraw(w); bw->object = object; if (bw->o.mnew) exmacro(bw->o.mnew,1); } } 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, sz(joe_gettext(_("Lose changes to this file (y,n,^C)? "))), dolose, NULL, NULL, NULL)) { return 0; } else { return -1; } } else { return dolose(bw, YES_CODE, NULL, NULL); } } /* Buffer list */ #ifdef junk static int dobuf(MENU *m, int x, unsigned char **s) { unsigned char *name; BW *bw = m->parent->win->object; 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, bw->parent, s, dobuf, abrtb, NULL, 0, s, NULL)) return 0; else { varm(s); return -1; } } #endif unsigned char **sbufs = NULL; /* Array of command names */ static int bufedcmplt(BW *bw) { if (sbufs) { varm(sbufs); sbufs = 0; } if (!sbufs) sbufs = getbufs(); return simple_cmplt(bw,sbufs); } static int dobufed(BW *bw, unsigned char *s, void *object, int *notify) { /* not understanding this... int *notify = bw->parent->notify; bw->parent->notify = 0; wabort(bw->parent); */ return dorepl(bw, s, NULL, notify); } B *bufhist = NULL; int ubufed(BW *bw) { if (wmkpw(bw->parent, joe_gettext(_("Name of buffer to edit (^C to abort): ")), &bufhist, dobufed, USTR "bufed", NULL, bufedcmplt, NULL, NULL, locale_map, 0)) { return 0; } else { return -1; } } /* Query save loop */ static int doquerysave(BW *bw,int c,struct savereq *req,int *notify) { W *w = bw->parent; if (c == YES_CODE || yncheck(yes_key, c)) { 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, joe_gettext(_("Name of file to save (^C to abort): ")), &filehist, dosave1, USTR "Names", NULL, cmplt, req, notify, locale_map, 7); if (pbw) { return 0; } else { joe_free(req); return -1; } } } else if (c == NO_CODE || yncheck(no_key, c)) { /* 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; if (bw->b==req->first) { if (notify) *notify = 1; rmsavereq(req); genexmsgmulti(bw,1,req->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,joe_gettext(_("File %s has been modified. Save it (y,n,^C)? ")),bw->b->name ? bw->b->name : USTR "(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,NO_CODE,req,notify); } int uquerysave(BW *bw) { W *w = bw->parent; B *first; /* Get synchronized with buffer ring */ unbuf(bw); bw = w->object; 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,0),NULL); else if (unbuf(bw)) return -1; bw = w->object; } while(bw->b!=first); genexmsgmulti(bw,0,0); return 0; } int ukilljoe(BW *bw) { /* Save file positions */ set_file_pos_all(bw->parent->t); /* FIXME: emacs checks for unsaved modified buffers at this point */ leave = 1; return 0; } static int doreload(BW *bw, int c, void *object, int *notify) { B *n; if (notify) { *notify = 1; } if (c != YES_CODE && !yncheck(yes_key, c)) { return -1; } n = bload(bw->b->name); if (berror) { brm(n); msgnw(bw->parent, joe_gettext(msgs[-berror])); return -1; } breplace(bw->b, n); nredraw(bw->parent->t->t); msgnw(bw->parent, joe_gettext(_("File reloaded"))); return 0; } int ureload(BW *bw) { if (!plain_file(bw->b)) { msgnw(bw->parent, joe_gettext(_("Can only reload plain files"))); return -1; } if (bw->b->changed) { if (mkqw(bw->parent, sz(joe_gettext(_("Lose changes to this file (y,n,^C)? "))), doreload, NULL, NULL, NULL)) { return 0; } else { return -1; } } return doreload(bw, YES_CODE, NULL, NULL); } int ureload_all(BW *bw) { int count = 0; int er = 0; B *b; for (b = bufs.link.next; b != &bufs; b = b->link.next) if (!b->changed && plain_file(b)) { B *n = bload(b->name); if (berror) { msgnw(bw->parent, joe_gettext(msgs[-berror])); er = -1; brm(n); } else { breplace(b, n); ++count; } } nredraw(bw->parent->t->t); if (!er) { joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, joe_gettext(_("%d files reloaded")), count); msgnw(bw->parent, msgbuf); } return er; } joe-3.7/ufile.h0000644000100100007640000000271011101750542010323 00000000000000/* * User file operations * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_UFILE_H #define _JOE_UFILE_H 1 extern int exask; /* Ask for file name during ^K X */ void genexmsg PARAMS((BW *bw, int saved, unsigned char *name)); int ublksave PARAMS((BW *bw)); int ushell PARAMS((BW *bw)); int usys PARAMS((BW *bw)); int usave PARAMS((BW *bw)); int usavenow PARAMS((BW *bw)); int uedit PARAMS((BW *bw)); int uswitch PARAMS((BW *bw)); int uscratch PARAMS((BW *bw)); int uinsf PARAMS((BW *bw)); int uexsve PARAMS((BW *bw)); int unbuf PARAMS((BW *bw)); int upbuf PARAMS((BW *bw)); int uask PARAMS((BW *bw)); int ubufed PARAMS((BW *bw)); int ulose PARAMS((BW *bw)); int okrepl PARAMS((BW *bw)); int doswitch PARAMS((BW *bw, unsigned char *s, void *obj, int *notify)); int uquerysave PARAMS((BW *bw)); int ukilljoe PARAMS((BW *bw)); int get_buffer_in_window PARAMS((BW *bw, B *b)); extern B *filehist; /* History of file names */ extern int nobackups; /* Set to disable backup files */ extern unsigned char *backpath; /* Path to backup files if not current directory */ extern int orphan; /* Set to keep orphaned buffers (buffers with no windows) */ extern unsigned char *yes_key; extern unsigned char *no_key; #define YES_CODE -10 #define NO_CODE -20 int yncheck PARAMS((unsigned char *string, int c)); int ynchecks PARAMS((unsigned char *string, unsigned char *s)); int ureload(BW *bw); int ureload_all(BW *bw); #endif joe-3.7/main.c0000644000100100007640000002673111101227367010153 00000000000000/* * Editor startup and main edit loop * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" #ifdef MOUSE_GPM #include #endif unsigned char *exmsg = NULL; /* Message to display when exiting the editor */ int usexmouse=0; int xmouse=0; int nonotice; int help; Screen *maint; /* Main edit screen */ /* Make windows follow cursor */ void dofollows(void) { W *w = maint->curwin; do { if (w->y != -1 && w->watom->follow && w->object) w->watom->follow(w->object); w = (W *) (w->link.next); } while (w != maint->curwin); } /* Update screen */ volatile int dostaupd = 1; 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); #ifdef MOUSE_GPM gpm_mx = wid; gpm_my = hei; #endif } dofollows(); ttflsh(); nscroll(maint->t, BG_COLOR(bg_text)); help_display(maint); w = maint->curwin; do { if (w->y != -1) { if (w->object && 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 int ahead = 0; static int 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; } #ifdef __MSDOS__ extern void setbreak(); extern int breakflg; #endif unsigned char **mainenv; B *startup_log; unsigned char i_msg[128]; void internal_msg(unsigned char *s) { P *t = pdup(startup_log->eof, USTR "internal_msg"); binss(t, s); prm(t); } int main(int argc, char **real_argv, char **envv) { CAP *cap; unsigned char **argv = (unsigned char **)real_argv; struct stat sbuf; unsigned char *s; unsigned char *t; long time_rc; unsigned char *run; #ifdef __MSDOS__ unsigned char *rundir; #endif SCRN *n; int opened = 0; int omid; int backopt; int c; joe_locale(); mainenv = (unsigned char **)envv; #ifdef __MSDOS__ _fmode = O_BINARY; zcpy(stdbuf, argv[0]); joesep(stdbuf); run = namprt(stdbuf); rundir = dirprt(stdbuf); for (c = 0; run[c]; ++c) if (run[c] == '.') { run = vstrunc(run, c); break; } #else run = namprt(argv[0]); #endif if ((s = (unsigned char *)getenv("LINES")) != NULL) sscanf((char *)s, "%d", &lines); if ((s = (unsigned char *)getenv("COLUMNS")) != NULL) sscanf((char *)s, "%d", &columns); if ((s = (unsigned char *)getenv("BAUD")) != NULL) sscanf((char *)s, "%u", (unsigned *)&Baud); if (getenv("DOPADDING")) dopadding = 1; if (getenv("NOXON")) noxon = 1; if ((s = (unsigned char *)getenv("JOETERM")) != NULL) joeterm = s; #ifndef __MSDOS__ if (!(cap = my_getcap(NULL, 9600, NULL, NULL))) { fprintf(stderr, (char *)joe_gettext(_("Couldn't load termcap/terminfo entry\n"))); return 1; } #endif #ifdef __MSDOS__ s = vsncpy(NULL, 0, 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, (char *)joe_gettext(_("There were errors in '%s'. Use it anyway?")), s); fflush(stderr); fgets(buf, 8, stdin); if (yn_checks(yes_key, buf)) goto donerc; } vsrm(s); s = vsncpy(NULL, 0, sv(rundir)); 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, (char *)joe_gettext(_("There were errors in '%s'. Use it anyway?")), s); fflush(stderr); fgets(buf, 8, stdin); if (yn_checks(yes_key, buf)) goto donerc; } #else /* Name of system joerc file. Try to find one with matching language... */ /* Try full language: like joerc.de_DE */ t = vsncpy(NULL, 0, sc(JOERC)); t = vsncpy(sv(t), sv(run)); t = vsncpy(sv(t), sc("rc.")); t = vsncpy(sv(t), sz(locale_msgs)); if (!stat((char *)t,&sbuf)) time_rc = sbuf.st_mtime; else { /* Try generic language: like joerc.de */ if (locale_msgs[0] && locale_msgs[1] && locale_msgs[2]=='_') { vsrm(t); t = vsncpy(NULL, 0, sc(JOERC)); t = vsncpy(sv(t), sv(run)); t = vsncpy(sv(t), sc("rc.")); t = vsncpy(sv(t), locale_msgs, 2); if (!stat((char *)t,&sbuf)) time_rc = sbuf.st_mtime; else goto nope; } else { nope: vsrm(t); /* Try Joe's bad english */ t = vsncpy(NULL, 0, sc(JOERC)); t = vsncpy(sv(t), sv(run)); t = vsncpy(sv(t), sc("rc")); if (!stat((char *)t,&sbuf)) time_rc = sbuf.st_mtime; else time_rc = 0; } } /* User's joerc file */ s = (unsigned char *)getenv("HOME"); if (s) { unsigned char buf[8]; s = vsncpy(NULL, 0, sz(s)); s = vsncpy(sv(s), sc("/.")); s = vsncpy(sv(s), sv(run)); s = vsncpy(sv(s), sc("rc")); if (!stat((char *)s,&sbuf)) { if (sbuf.st_mtime < time_rc) { fprintf(stderr,(char *)joe_gettext(_("Warning: %s is newer than your %s.\n")),t,s); fprintf(stderr,(char *)joe_gettext(_("You should update or delete %s\n")),s); fprintf(stderr,(char *)joe_gettext(_("Hit enter to continue with %s ")),t); fflush(stderr); fgets((char *)buf, 8, stdin); goto use_sys; } } c = procrc(cap, s); if (c == 0) { vsrm(t); goto donerc; } if (c == 1) { fprintf(stderr,(char *)joe_gettext(_("There were errors in '%s'. Use it anyway (y,n)? ")), s); fflush(stderr); fgets((char *)buf, 8, stdin); if (ynchecks(yes_key, buf)) { vsrm(t); goto donerc; } } } use_sys: vsrm(s); s = t; c = procrc(cap, s); if (c == 0) goto donerc; if (c == 1) { unsigned char buf[8]; fprintf(stderr,(char *)joe_gettext(_("There were errors in '%s'. Use it anyway (y,n)? ")), s); fflush(stderr); fgets((char *)buf, 8, stdin); if (ynchecks(yes_key, buf)) goto donerc; } /* Try built-in joerc */ 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,(char *)joe_gettext(_("There were errors in '%s'. Use it anyway (y,n)? ")), s); fflush(stderr); fgets((char *)buf, 8, stdin); if (ynchecks(yes_key, buf)) goto donerc; } #endif fprintf(stderr,(char *)joe_gettext(_("Couldn't open '%s'\n")), s); return 1; donerc: if (validate_rc()) { fprintf(stderr,(char *)joe_gettext(_("rc file has no :main key binding section or no bindings. Bye.\n"))); return 1; } if (!isatty(fileno(stdin))) idleout = 0; for (c = 1; argv[c]; ++c) { if (argv[c][0] == '-') { if (argv[c][1]) switch (glopt(argv[c] + 1, argv[c + 1], NULL, 1)) { case 0: fprintf(stderr,(char *)joe_gettext(_("Unknown option '%s'\n")), argv[c]); break; case 1: break; case 2: ++c; break; } else idleout = 0; } } /* initialize mouse support */ if (xmouse && (s=(unsigned char *)getenv("TERM")) && strstr((char *)s,"xterm")) usexmouse=1; if (!(n = nopen(cap))) return 1; maint = screate(n); vmem = vtmp(); startup_log = bfind_scratch(USTR "* Startup Log *"); startup_log->internal = 1; load_state(); /* It would be better if this ran uedit() to load files */ /* The business with backopt is to load the file first, then apply file * local options afterwords */ /* orphan is not compatible with exemac()- macros need a window to exist */ for (c = 1, backopt = 0; argv[c]; ++c) if (argv[c][0] == '+' && argv[c][1]>='0' && argv[c][1]<='9') { 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 = berror; /* This is too annoying */ /* set_current_dir(argv[c],1); */ setup_history(&filehist); append_history(filehist,sz(argv[c])); /* wmktw inserts the window before maint->curwin */ if (!orphan || !opened) { bw = wmktw(maint, b); if (er) msgnwt(bw->parent, joe_gettext(msgs[-er])); } else { long line; b->orphan = 1; b->oldcur = pdup(b->bof, USTR "main"); pline(b->oldcur, get_file_pos(b->name)); p_goto_bol(bw->cursor); line = b->oldcur->line - (maint->h - 1) / 2; if (line < 0) line = 0; b->oldtop = pdup(b->oldcur, USTR "main"); pline(b->oldtop, line); p_goto_bol(b->oldtop); } if (bw) { long lnum = 0; bw->o.readonly = bw->b->rdonly; if (backopt) { while (backopt != c) { if (argv[backopt][0] == '+') { sscanf((char *)(argv[backopt] + 1), "%ld", &lnum); ++backopt; } else { if (glopt(argv[backopt] + 1, argv[backopt + 1], &bw->o, 0) == 2) backopt += 2; else backopt += 1; lazy_opts(bw->b, &bw->o); } } } bw->b->o = bw->o; bw->b->rdonly = bw->o.readonly; /* Put cursor in window, so macros work properly */ maint->curwin = bw->parent; /* Execute macro */ if (er == -1 && bw->o.mnew) exmacro(bw->o.mnew,1); if (er == 0 && bw->o.mold) exmacro(bw->o.mold,1); /* Hmm... window might not exist any more... depends on what macro does... */ if (lnum > 0) pline(bw->cursor, lnum - 1); else pline(bw->cursor, get_file_pos(bw->b->name)); p_goto_bol(bw->cursor); /* Go back to first window so windows are in same order as command line */ if (opened) wnext(maint); } opened = 1; backopt = 0; } if (opened) { wshowall(maint); omid = mid; mid = 1; dofollows(); mid = omid; } else { BW *bw = wmktw(maint, bfind(USTR "")); if (bw->o.mnew) exmacro(bw->o.mnew,1); } maint->curwin = maint->topwin; if (startup_log->eof->byte) { BW *bw = wmktw(maint, startup_log); startup_log = 0; maint->curwin = bw->parent; wshowall(maint); uparserr(bw); } if (help) { help_on(maint); } if (!nonotice) { joe_snprintf_3(msgbuf,JOE_MSGBUFSIZE,joe_gettext(_("\\i** Joe's Own Editor v%s ** (%s) ** Copyright %s 2008 **\\i")),VERSION,locale_map->name,(locale_map->type ? "©" : "(C)")); msgnw(((BASE *)lastw(maint)->object)->parent, msgbuf); } if (!idleout) { if (!isatty(fileno(stdin)) && modify_logic(maint->curwin->object, ((BW *)maint->curwin->object)->b)) { /* Start shell going in first window */ unsigned char **a; unsigned char *cmd; a = vamk(10); cmd = vsncpy(NULL, 0, sc("/bin/sh")); a = vaadd(a, cmd); cmd = vsncpy(NULL, 0, sc("-c")); a = vaadd(a, cmd); cmd = vsncpy(NULL, 0, sc("/bin/cat")); a = vaadd(a, cmd); cstart (maint->curwin->object, USTR "/bin/sh", a, NULL, NULL, 0, 1); } } edloop(0); save_state(); /* Delete all buffer so left over locks get eliminated */ brmall(); vclose(vmem); nclose(n); if (exmsg) fprintf(stderr, "\n%s\n", exmsg); return 0; } joe-3.7/main.h0000644000100100007640000000155310437455044010161 00000000000000/* * Editor startup and edit loop * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_MAIN_H #define _JOE_MAIN_H 1 extern unsigned char *exmsg; /* Exit message */ extern int help; /* Set to start with help on */ extern Screen *maint; /* Primary screen */ extern int usexmouse; /* Use xterm mouse support? */ void nungetc PARAMS((int c)); void dofollows PARAMS((void)); int edloop PARAMS((int flg)); void edupd PARAMS((int flg)); extern volatile int dostaupd; /* Force status line update */ extern int nonotice; /* Set to prevent copyright notice */ extern int xmouse; /* XTerm mouse mode request by user (only allowed if terminal looks like xterm) */ extern unsigned char **mainenv; /* Environment variables passed to JOE */ extern unsigned char i_msg[128]; void internal_msg PARAMS((unsigned char *)); #endif joe-3.7/menu.c0000644000100100007640000003053510457276140010176 00000000000000/* * Menu selection window * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" int bg_menu; int transpose; static void menufllw(MENU *m) { if (transpose) { if ((m->cursor % m->lines) < m->top) m->top = m->cursor % m->lines; else if (m->cursor % m->lines >= (m->top % m->lines) + m->h) m->top = (m->cursor % m->lines) - (m->h - 1); } else { 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(MENU *m) { 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; int cut = m->nitems % m->lines; if (!cut) cut = m->lines; utf8_init(&sm); for (y = 0; y != m->h; ++y) { col = 0; if (transpose) { for (x = 0; x < ((y + m->top) >= cut ? m->perline - 1 : m->perline) ; ++x) { int atr; int index = x * m->lines + y + m->top; if (index == m->cursor && m->t->curwin == m->parent) atr = INVERSE|BG_COLOR(bg_menu); else atr = BG_COLOR(bg_menu); if (col == m->w) break; /* Generate field */ genfield(m->t->t, s + col, a + col, m->x + col, m->y + y, 0, m->list[index], zlen(m->list[index]), 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, ' ', BG_COLOR(bg_menu)); ++col; } } } else { for (x = 0; x != m->perline && y * m->perline + x + m->top < m->nitems; ++x) { int atr; int index = x + y * m->perline + m->top; if (index == m->cursor && m->t->curwin==m->parent) atr = INVERSE|BG_COLOR(bg_menu); else atr = BG_COLOR(bg_menu); if (col == m->w) break; /* Generate field */ genfield(m->t->t, s + col, a + col, m->x + col, m->y + y, 0, m->list[index], zlen(m->list[index]), 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, ' ', BG_COLOR(bg_menu)); ++col; } } } /* Clear to end of line */ if (col != m->w) eraeol(m->t->t, m->x + col, m->y + y, BG_COLOR(bg_menu)); s += m->t->t->co; a += m->t->t->co; } if (transpose) { m->parent->cury = (m->cursor % m->lines) - m->top; col = txtwidth(m->list[m->cursor],zlen(m->list[m->cursor])); if (col < m->width) m->parent->curx = (m->cursor / m->lines) * (m->width + 1) + col; else m->parent->curx = (m->cursor / m->lines) * (m->width + 1) + m->width; } else { m->parent->cury = (m->cursor - m->top) / m->perline; col = txtwidth(m->list[m->cursor],zlen(m->list[m->cursor])); if (col < m->width) m->parent->curx = ((m->cursor - m->top) % m->perline) * (m->width + 1) + col; else m->parent->curx = ((m->cursor - m->top) % m->perline) * (m->width + 1) + m->width; } } static void menumove(MENU *m, int x, int y) { m->x = x; m->y = y; } 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],zlen(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],zlen(m->list[x])); if (d > m->width) m->width = d; } m->nitems = x; if (m->width > m->w) m->width = m->w - 1; m->fitline = m->w / (m->width + 1); m->lines = (m->nitems + m->fitline - 1) / m->fitline; if (transpose) m->perline = (m->nitems + m->lines - 1) / m->lines; else m->perline = m->fitline; } } static void menuresz(MENU *m, int wi, int he) { m->w = wi; m->h = he; mconfig(m); } int umbol(MENU *m) { if (transpose) m->cursor %= m->lines; else m->cursor -= m->cursor % m->perline; return 0; } int umbof(MENU *m) { m->cursor = 0; return 0; } int umeof(MENU *m) { if (m->nitems) { if (transpose && (m->nitems % m->lines != 0)) { m->cursor = m->lines - 1 + (m->lines * (m->perline - 2)); } else { m->cursor = m->nitems - 1; } } return 0; } int umeol(MENU *m) { if (transpose) { int cut = m->nitems % m->lines; if (!cut) cut = m->lines; m->cursor %= m->lines; if (m->cursor >= cut) m->cursor += m->lines * (m->perline - 2); else m->cursor += m->lines * (m->perline - 1); } else { 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 (transpose) { int cut = m->nitems % m->lines; if (!cut) cut = m->lines; if (m->cursor % m->lines >= cut) { if (m->cursor / m->lines != m->perline - 2) { m->cursor += m->lines; return 0; } } else { if (m->cursor / m->lines != m->perline - 1) { m->cursor += m->lines; return 0; } } if ((m->cursor % m->lines) + 1 < m->lines) { m->cursor = m->cursor % m->lines + 1; return 0; } return -1; } else 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 (transpose && m->cursor >= m->lines) { m->cursor -= m->lines; return 0; } else if (transpose && m->cursor) { int cut = m->nitems % m->lines; if (!cut) cut = m->lines; --m->cursor; if (m->cursor >= cut) m->cursor += (m->perline - 2) * m->lines; else m->cursor += (m->perline - 1) * m->lines; return 0; } else if (!transpose && m->cursor) { --m->cursor; return 0; } else return -1; } int umuparw(MENU *m) { if (transpose && (m->cursor % m->lines)) { --m->cursor; return 0; } else if (!transpose && m->cursor >= m->perline) { m->cursor -= m->perline; return 0; } else return -1; } int umdnarw(MENU *m) { if (transpose) { if (m->cursor != m->nitems - 1 && m->cursor % m->lines != m->lines - 1) { ++m->cursor; return 0; } else { return -1; } } else { 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; } } } void menujump(MENU *m,int x,int y) { int pos = m->top; if (transpose) { pos += y; pos += (x / (m->width + 1)) * m->lines; } else { pos += y * m->perline; pos += x / (m->width + 1); } if (pos >= m->nitems) pos = m->nitems - 1; if (pos < 0) pos = 0; m->cursor = pos; } int mscrup(MENU *m,int amnt) { if (transpose) { if (m->top >= amnt) { m->top -= amnt; m->cursor -= amnt; return 0; } else if (m->top) { m->cursor -= m->top; m->top = 0; return 0; } else if (m->cursor % m->lines) { m->cursor -= (m->cursor % m->lines); return 0; } else return -1; } else { 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 umscrup(MENU *m) { return mscrup(m, 1); } int umpgup(MENU *m) { return mscrup(m, (m->h + 1) / 2); } int mscrdn(MENU *m, int amnt) { if (transpose) { int col = m->cursor / m->lines; int y = m->cursor % m->lines; int h = m->lines; int t = m->top; int cut = m->nitems % m->lines; if (!cut) cut = m->lines; m->cursor %= m->lines; if (t + m->h + amnt <= h) { m->top += amnt; m->cursor += amnt; if (m->cursor >= cut && col == m->perline - 1) --col; m->cursor += col * m->lines; return 0; } else if (t + m->h < h) { amnt = h - (t + m->h); m->top += amnt; m->cursor += amnt; if (m->cursor >= cut && col == m->perline - 1) --col; m->cursor += col * m->lines; return 0; } else if (y + 1 != h) { m->cursor = h - 1; if (m->cursor >= cut && col == m->perline - 1) --col; m->cursor += col * m->lines; return 0; } else { m->cursor += col * m->lines; return -1; } } else { 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; } } } int umscrdn(MENU *m) { return mscrdn(m, 1); } int umpgdn(MENU *m) { return mscrdn(m, (m->h + 1) / 2); } static int umrtn(MENU *m) { 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(MENU *m, int c) { 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 &= 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(m); } do { ++m->cursor; if (m->cursor == m->nitems) m->cursor = 0; } while ((m->list[m->cursor][0] & 0x1F) != c); return -1; } static int menuabort(MENU *m) { W *w = m->parent; int (*func) () = m->abrt; void *object = m->object; int x = m->cursor; W *win = w->win; joe_free(m); if (func) return func(win->object, x, object); else return -1; } WATOM watommenu = { USTR "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); } int menu_above; MENU *mkmenu(W *w, W *targ, unsigned char **s, int (*func) (/* ??? */), int (*abrt) (/* ??? */), 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, targ, targ->main, h, NULL, notify); if (!new) { if (notify) *notify = 1; return NULL; } wfit(new->t); new->object = (void *) (m = (MENU *) joe_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; 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; } joe-3.7/menu.h0000644000100100007640000000361710435702264010201 00000000000000/* * Menu selection window * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_MENU_H #define _JOE_MENU_H 1 /* A menu window */ 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 fitline; /* Number of items we can fit on each line */ int perline; /* Number of items we place on each line */ int lines; /* Total no. of lines */ int nitems; /* No. items in list */ Screen *t; /* Screen we're on */ int h, w, x, y; int (*abrt) (); /* Abort callback function */ int (*func) (); /* Return callback function */ int (*backs) (); /* Backspace callback function */ void *object; }; /* Create a menu */ /* FIXME: ??? ---> */ MENU *mkmenu PARAMS((W *loc, W *targ, unsigned char **s, int (*func) (/* ??? */), int (*abrt) (/* ??? */), int (*backs) (/* ??? */), int cursor, void *object, int *notify)); /* Menu user functions */ int umuparw PARAMS((MENU *m)); int umdnarw PARAMS((MENU *m)); int umpgup PARAMS((MENU *m)); int umpgdn PARAMS((MENU *m)); int umscrup PARAMS((MENU *m)); int umscrdn PARAMS((MENU *m)); int umltarw PARAMS((MENU *m)); int umrtarw PARAMS((MENU *m)); int umtab PARAMS((MENU *m)); int umbof PARAMS((MENU *m)); int umeof PARAMS((MENU *m)); int umbol PARAMS((MENU *m)); int umeol PARAMS((MENU *m)); int umbacks PARAMS((MENU *m)); void ldmenu PARAMS((MENU *m, unsigned char **s, int cursor)); unsigned char *mcomplete PARAMS((MENU *m)); unsigned char *find_longest PARAMS((unsigned char **lst)); void menujump PARAMS((MENU *m, int x, int y)); extern int lines; /* Number of menu lines */ extern WATOM watommenu; /* Menu WATOM */ extern int menu_above; /* Menu position: above or below */ extern int bg_menu; /* Background color for menu */ extern int transpose; #endif joe-3.7/gettext.c0000644000100100007640000000651011101510604010671 00000000000000/* JOE's gettext() library. Why? Once again we can not rely on the * system's or GNU's gettext being installed properly */ /* One modification from standard gettext: comments are allowed at * the start of strings: "|comment|comment|comment|foo". The leading * '|' is required to indicate the comment. * * Comments can be used to make two otherwise identical strings distinct. */ #include "types.h" HASH *gettext_ht; unsigned char *ignore_prefix(unsigned char *set) { unsigned char *s = zrchr(set, '|'); if (s) ++s; else s = set; return s; } unsigned char *my_gettext(unsigned char *s) { if (gettext_ht) { unsigned char *r = htfind(gettext_ht, s); if (r) s = r; } if (s[0] == '|') return ignore_prefix(s); else return s; } /* Load a .po file, convert entries to local character set and add them to * hash table */ int load_po(FILE *f) { unsigned char buf[1024]; unsigned char msgid[1024]; unsigned char msgstr[1024]; unsigned char bf[8192]; struct charmap *po_map = locale_map; int preload_flag = 0; msgid[0] = 0; msgstr[0] = 0; while (preload_flag || fgets((char *)buf,sizeof(buf)-1,f)) { unsigned char *p; preload_flag = 0; p = buf; parse_ws(&p, '#'); if (!parse_field(&p, USTR "msgid")) { int ofst = 0; int len; msgid[0] = 0; parse_ws(&p, '#'); while ((len = parse_string(&p, msgid + ofst, sizeof(msgid)-ofst)) >= 0) { preload_flag = 0; ofst += len; parse_ws(&p, '#'); if (!*p) { if (fgets((char *)buf,sizeof(buf) - 1,f)) { p = buf; preload_flag = 1; parse_ws(&p, '#'); } else { goto bye; } } } } else if (!parse_field(&p, USTR "msgstr")) { int ofst = 0; int len; msgstr[0] = 0; parse_ws(&p, '#'); while ((len = parse_string(&p, msgstr + ofst, sizeof(msgstr)-ofst)) >= 0) { preload_flag = 0; ofst += len; parse_ws(&p, '#'); if (!*p) { if (fgets((char *)buf,sizeof(buf) - 1,f)) { p = buf; preload_flag = 1; parse_ws(&p, '#'); } else { break; } } } if (msgid[0] && msgstr[0]) { /* Convert to locale character map */ my_iconv(bf,locale_map,msgstr,po_map); /* Add to hash table */ htadd(gettext_ht, zdup(msgid), zdup(bf)); } else if (!msgid[0] && msgstr[0]) { unsigned char *p = (unsigned char *)strstr((char *)msgstr, "charset="); if (p) { /* Copy character set name up to next delimiter */ int x; p += sizeof("charset=") - 1; while (*p == ' ' || *p == '\t') ++p; for (x = 0; p[x] && p[x] !='\n' && p[x] != '\r' && p[x] != ' ' && p[x] != '\t' && p[x] != ';' && p[x] != ','; ++x) msgid[x] = p[x]; msgid[x] = 0; po_map = find_charmap(msgid); if (!po_map) po_map = locale_map; } } } } bye: fclose(f); return 0; } /* Initialize my_gettext(). Call after locale_map has been set. */ void init_gettext(unsigned char *s) { FILE *f; unsigned char buf[1024]; joe_snprintf_2(buf, sizeof(buf), "%slang/%s.po",JOEDATA,s); if ((f = fopen((char *)buf, "r"))) { /* Try specific language, like en_GB */ gettext_ht = htmk(256); load_po(f); } else if (s[0] && s[1]) { /* Try generic language, like en */ joe_snprintf_3(buf, sizeof(buf), "%slang/%c%c.po",JOEDATA,s[0],s[1]); if ((f = fopen((char *)buf, "r"))) { gettext_ht = htmk(256); load_po(f); } } } joe-3.7/gettext.h0000644000100100007640000000012210434701044010677 00000000000000unsigned char *my_gettext(unsigned char *s); void init_gettext(unsigned char *s); joe-3.7/syntax.c0000644000100100007640000005373511103412264010553 00000000000000/* * Syntax highlighting DFA interpreter * Copyright * (C) 2004 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" /* 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 stack_count = 0; HIGHLIGHT_STATE parse(struct high_syntax *syntax,P *line,HIGHLIGHT_STATE h_state) { struct high_frame *stack = h_state.stack; struct high_state *h = (stack ? stack->syntax : syntax)->states[h_state.state]; /* Current state */ unsigned char buf[24]; /* Name buffer (trunc after 23 characters) */ unsigned char lbuf[24]; /* Lower case version of name buffer */ unsigned char lsaved_s[24]; /* Lower case version of delimiter match buffer */ int buf_idx=0; /* Index into buffer */ int c; /* Current character */ int *attr = attr_buf; int *attr_end = attr_buf+attr_size; int buf_en = 0; /* Set for name buffering */ int ofst = 0; /* record offset after we've stopped buffering */ int mark1 = 0; /* offset to mark start from current pos */ int mark2 = 0; /* offset to mark end from current pos */ int mark_en = 0;/* set if marking */ int recolor_delimiter_or_keyword; buf[0]=0; /* Forgot this originally... took 5 months to fix! */ /* Get next character */ while((c=pgetc(line))!=NO_MORE_DATA) { struct high_cmd *cmd, *kw_cmd; int x; /* Hack so we can have UTF-8 characters without crashing */ if (c < 0 || c > 255) c = 0x1F; /* Create or expand attribute array if necessary */ if(attr==attr_end) { if(!attr_buf) { attr_size = 1024; attr_buf = joe_malloc(sizeof(int)*attr_size); attr = attr_buf; } else { attr_buf = joe_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) */ attr++; /* Loop while noeat */ do { /* Color with current state */ attr[-1] = h->color; /* Get command for this character */ if (h->delim && c == h_state.saved_s[0] && h_state.saved_s[1] == 0) cmd = h->delim; else cmd = h->cmd[c]; /* Lowerize strings for case-insensitive matching */ if (cmd->ignore) { zcpy(lbuf,buf); lowerize(lbuf); if (cmd->delim) { zcpy(lsaved_s,h_state.saved_s); lowerize(lsaved_s); } } /* Check for delimiter or keyword matches */ recolor_delimiter_or_keyword = 0; if (cmd->delim && (cmd->ignore ? !zcmp(lsaved_s,lbuf) : !zcmp(h_state.saved_s,buf))) { cmd = cmd->delim; recolor_delimiter_or_keyword = 1; } else if (cmd->keywords && (cmd->ignore ? (kw_cmd=htfind(cmd->keywords,lbuf)) : (kw_cmd=htfind(cmd->keywords,buf)))) { cmd = kw_cmd; recolor_delimiter_or_keyword = 1; } /* Determine new state */ if (cmd->call) { /* Call */ struct high_frame **frame_ptr = stack ? &stack->child : &syntax->stack_base; /* Search for an existing stack frame for this call */ while (*frame_ptr && !((*frame_ptr)->syntax == cmd->call && (*frame_ptr)->return_state == cmd->new_state)) frame_ptr = &(*frame_ptr)->sibling; if (*frame_ptr) stack = *frame_ptr; else { struct high_frame *frame = joe_malloc(sizeof(struct high_frame)); frame->parent = stack; frame->child = 0; frame->sibling = 0; frame->syntax = cmd->call; frame->return_state = cmd->new_state; *frame_ptr = frame; stack = frame; ++stack_count; } h = stack->syntax->states[0]; } else if (cmd->rtn) { /* Return */ if (stack) { h = stack->return_state; stack = stack->parent; } else /* Not in a subroutine, so ignore the return */ h = cmd->new_state; } else if (cmd->reset) { /* Reset the state and call stack */ h = syntax->states[0]; stack = syntax->stack_base; } else { /* Normal edge */ h = cmd->new_state; } /* Recolor if necessary */ if (recolor_delimiter_or_keyword) for(x= -(buf_idx+1);x<-1;++x) attr[x-ofst] = h->color; for(x=cmd->recolor;x<0;++x) if (attr + x >= attr_buf) attr[x] = h->color; /* Mark recoloring */ if (cmd->recolor_mark) for(x= -mark1;x<-mark2;++x) attr[x] = h->color; /* Save string? */ if (cmd->save_s) zcpy(h_state.saved_s,buf); /* Save character? */ if (cmd->save_c) { h_state.saved_s[1] = 0; if (c=='<') h_state.saved_s[0] = '>'; else if (c=='(') h_state.saved_s[0] = ')'; else if (c=='[') h_state.saved_s[0] = ']'; else if (c=='{') h_state.saved_s[0] = '}'; else if (c=='`') h_state.saved_s[0] = '\''; else h_state.saved_s[0] = c; } /* Start buffering? */ if (cmd->start_buffering) { buf_idx = 0; buf_en = 1; ofst = 0; } /* Stop buffering? */ if (cmd->stop_buffering) buf_en = 0; /* Set mark begin? */ if (cmd->start_mark) { mark2 = 1; mark1 = 1; mark_en = 1; } /* Set mark end? */ if(cmd->stop_mark) { mark_en = 0; mark2 = 1; } } while(cmd->noeat); /* Save character in buffer */ if (buf_idx<23 && buf_en) buf[buf_idx++]=c; if (!buf_en) ++ofst; buf[buf_idx] = 0; /* Update mark pointers */ ++mark1; if(!mark_en) ++mark2; if(c=='\n') break; } /* Return new state */ h_state.stack = stack; h_state.state = h->no; return h_state; } /* Subroutines for load_dfa() */ static struct high_state *find_state(struct high_syntax *syntax,unsigned char *name) { struct high_state *state; /* Find state */ state = htfind(syntax->ht_states, name); /* It doesn't exist, so create it */ if(!state) { int y; state=joe_malloc(sizeof(struct high_state)); state->name=zdup(name); state->no=syntax->nstates; state->color=FG_WHITE; /* Expand the state table if necessary */ if(syntax->nstates==syntax->szstates) syntax->states=joe_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; state->delim = 0; htadd(syntax->ht_states, state->name, state); } return state; } /* Create empty command */ static void iz_cmd(struct high_cmd *cmd) { cmd->noeat = 0; cmd->recolor = 0; cmd->start_buffering = 0; cmd->stop_buffering = 0; cmd->save_c = 0; cmd->save_s = 0; cmd->new_state = 0; cmd->keywords = 0; cmd->delim = 0; cmd->ignore = 0; cmd->start_mark = 0; cmd->stop_mark = 0; cmd->recolor_mark = 0; cmd->rtn = 0; cmd->reset = 0; cmd->call = 0; } static struct high_cmd *mkcmd() { struct high_cmd *cmd = joe_malloc(sizeof(struct high_cmd)); iz_cmd(cmd); return cmd; } /* Globally defined colors */ struct high_color *global_colors; struct high_color *find_color(struct high_color *colors,unsigned char *name,unsigned char *syn) { unsigned char bf[256]; struct high_color *color; joe_snprintf_2(bf, sizeof(bf), "%s.%s", syn, name); for (color = colors; color; color = color->next) if (!zcmp(color->name,bf)) break; if (color) return color; for (color = colors; color; color = color->next) if (!zcmp(color->name,name)) break; return color; } void parse_color_def(struct high_color **color_list,unsigned char *p,unsigned char *name,int line) { unsigned char bf[256]; if(!parse_tows(&p, bf)) { struct high_color *color, *gcolor; /* Find color */ color=find_color(*color_list,bf,name); /* If it doesn't exist, create it */ if(!color) { color = joe_malloc(sizeof(struct high_color)); color->name = zdup(bf); color->color = 0; color->next = *color_list; *color_list = color; } else { i_printf_2((char *)joe_gettext(_("%s %d: Class already defined\n")),name,line); } /* Find it in global list */ if (color_list != &global_colors && (gcolor=find_color(global_colors,bf,name))) { color->color = gcolor->color; } else { /* Parse color definition */ while(parse_ws(&p,'#'), !parse_ident(&p,bf,sizeof(bf))) { color->color |= meta_color(bf); } } } else { i_printf_2((char *)joe_gettext(_("%s %d: Missing class name\n")),name,line); } } /* Load syntax file */ struct high_syntax *syntax_list; /* Dump sytnax file */ void dump_syntax(BW *bw) { struct high_syntax *syntax; struct high_param *params; unsigned char buf[1024]; joe_snprintf_1(buf, sizeof(buf), "Allocated %d stack frames\n", stack_count); binss(bw->cursor, buf); pnextl(bw->cursor); for (syntax = syntax_list; syntax; syntax = syntax->next) { int x; joe_snprintf_3(buf, sizeof(buf), "Syntax name=%s, subr=%s, nstates=%d\n",syntax->name,syntax->subr,syntax->nstates); binss(bw->cursor, buf); pnextl(bw->cursor); zcpy(buf, USTR "params=("); for(params = syntax->params; params; params = params->next) { zcat(buf, USTR " "); zcat(buf, params->name); } zcat(buf, USTR " )\n"); binss(bw->cursor, buf); pnextl(bw->cursor); for(x=0;x!=syntax->nstates;++x) { int y; int f = -1; struct high_state *s = syntax->states[x]; joe_snprintf_2(buf, sizeof(buf), " state %s %x\n",s->name,s->color); binss(bw->cursor, buf); pnextl(bw->cursor); for (y = 0; y != 256; ++y) { if (f == -1) f = y; else if (s->cmd[f]->new_state != s->cmd[y]->new_state) { joe_snprintf_4(buf, sizeof(buf), " [%d-%d] -> %s %d\n",f,y-1,(s->cmd[f]->new_state ? s->cmd[f]->new_state->name : USTR "ERROR! Unknown state!"),s->cmd[f]->recolor); binss(bw->cursor, buf); pnextl(bw->cursor); f = y; } } joe_snprintf_4(buf, sizeof(buf), " [%d-%d] -> %s %d\n",f,y-1,(s->cmd[f]->new_state ? s->cmd[f]->new_state->name : USTR "ERROR! Unknown state!"),s->cmd[f]->recolor); binss(bw->cursor, buf); pnextl(bw->cursor); } } } struct high_param *parse_params(struct high_param *current_params,unsigned char **ptr,unsigned char *name,int line) { unsigned char *p = *ptr; unsigned char bf[256]; struct high_param *params; struct high_param **param_ptr; /* Propagate currently defined parameters */ param_ptr = ¶ms; while (current_params) { *param_ptr = joe_malloc(sizeof(struct high_param)); (*param_ptr)->name = zdup(current_params->name); param_ptr = &(*param_ptr)->next; current_params = current_params->next; } *param_ptr = 0; parse_ws(&p, '#'); if (!parse_char(&p, '(')) { for (;;) { parse_ws(&p, '#'); if (!parse_char(&p, ')')) break; else if (!parse_char(&p, '-')) { if (!parse_ident(&p,bf,sizeof(bf))) { int cmp = 0; param_ptr = ¶ms; /* Parameters are sorted */ while (*param_ptr && (cmp = zcmp(bf,(*param_ptr)->name)) > 0) param_ptr = &(*param_ptr)->next; if (*param_ptr && !cmp) { /* Remove this parameter */ struct high_param *param = *param_ptr; *param_ptr = param->next; joe_free(param); } } else { i_printf_2((char *)joe_gettext(_("%s %d: Missing parameter name\n")),name,line); } } else if (!parse_ident(&p,bf,sizeof(bf))) { int cmp = 0; param_ptr = ¶ms; /* Keep parameters sorted */ while (*param_ptr && (cmp = zcmp(bf,(*param_ptr)->name)) > 0) param_ptr = &(*param_ptr)->next; /* Discard duplicates */ if (!*param_ptr || cmp) { struct high_param *param = joe_malloc(sizeof(struct high_param)); param->name = zdup(bf); param->next = *param_ptr; *param_ptr = param; } } else { i_printf_2((char *)joe_gettext(_("%s %d: Missing )\n")),name,line); break; } } } *ptr = p; return params; } struct high_syntax *load_syntax_subr(unsigned char *name,unsigned char *subr,struct high_param *params); /* Parse options */ void parse_options(struct high_syntax *syntax,struct high_cmd *cmd,FILE *f,unsigned char *p,int parsing_strings,unsigned char *name,int line) { unsigned char buf[1024]; unsigned char bf[256]; unsigned char bf1[256]; while (parse_ws(&p,'#'), !parse_ident(&p,bf,sizeof(bf))) if(!zcmp(bf,USTR "buffer")) { cmd->start_buffering = 1; } else if(!zcmp(bf,USTR "hold")) { cmd->stop_buffering = 1; } else if(!zcmp(bf,USTR "save_c")) { cmd->save_c = 1; } else if(!zcmp(bf,USTR "save_s")) { cmd->save_s = 1; } else if(!zcmp(bf,USTR "recolor")) { parse_ws(&p,'#'); if(!parse_char(&p,'=')) { parse_ws(&p,'#'); if(parse_int(&p,&cmd->recolor)) i_printf_2((char *)joe_gettext(_("%s %d: Missing value for option\n")),name,line); } else i_printf_2((char *)joe_gettext(_("%s %d: Missing value for option\n")),name,line); } else if(!zcmp(bf,USTR "call")) { parse_ws(&p,'#'); if(!parse_char(&p,'=')) { parse_ws(&p,'#'); if (!parse_char(&p,'.')) { zcpy(bf,syntax->name); goto subr; } else if (parse_ident(&p,bf,sizeof(bf))) i_printf_2((char *)joe_gettext(_("%s %d: Missing value for option\n")),name,line); else { if (!parse_char(&p,'.')) { subr: if (parse_ident(&p,bf1,sizeof(bf1))) i_printf_2((char *)joe_gettext(_("%s %d: Missing subroutine name\n")),name,line); cmd->call = load_syntax_subr(bf,bf1,parse_params(syntax->params,&p,name,line)); } else cmd->call = load_syntax_subr(bf,0,parse_params(syntax->params,&p,name,line)); } } else i_printf_2((char *)joe_gettext(_("%s %d: Missing value for option\n")),name,line); } else if(!zcmp(bf,USTR "return")) { cmd->rtn = 1; } else if(!zcmp(bf,USTR "reset")) { cmd->reset = 1; } else if(!parsing_strings && (!zcmp(bf,USTR "strings") || !zcmp(bf,USTR "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,USTR "done")) break; if(parse_string(&p,bf,sizeof(bf)) >= 0) { parse_ws(&p,'#'); if (cmd->ignore) lowerize(bf); if(!parse_ident(&p,bf1,sizeof(bf1))) { struct high_cmd *kw_cmd=mkcmd(); kw_cmd->noeat=1; kw_cmd->new_state = find_state(syntax,bf1); if (!zcmp(bf, USTR "&")) { cmd->delim = kw_cmd; } else { if(!cmd->keywords) cmd->keywords = htmk(64); htadd(cmd->keywords,zdup(bf),kw_cmd); } parse_options(syntax,kw_cmd,f,p,1,name,line); } else i_printf_2((char *)joe_gettext(_("%s %d: Missing state name\n")),name,line); } else i_printf_2((char *)joe_gettext(_("%s %d: Missing string\n")),name,line); } } } else if(!zcmp(bf,USTR "noeat")) { cmd->noeat = 1; } else if(!zcmp(bf,USTR "mark")) { cmd->start_mark = 1; } else if(!zcmp(bf,USTR "markend")) { cmd->stop_mark = 1; } else if(!zcmp(bf,USTR "recolormark")) { cmd->recolor_mark = 1; } else i_printf_2((char *)joe_gettext(_("%s %d: Unknown option\n")),name,line); } struct ifstack { struct ifstack *next; int ignore; /* Ignore input lines if set */ int skip; /* Set to skip the else part */ int else_part; /* Set if we're in the else part */ int line; }; /* Load dfa */ struct high_state *load_dfa(struct high_syntax *syntax) { unsigned char name[1024]; unsigned char buf[1024]; unsigned char bf[256]; int clist[256]; unsigned char *p; int c; FILE *f = 0; struct ifstack *stack=0; struct high_state *state=0; /* Current state */ struct high_state *first=0; /* First state */ int line = 0; int this_one = 0; int inside_subr = 0; /* Load it */ p = (unsigned char *)getenv("HOME"); if (p) { joe_snprintf_2(name,sizeof(name),"%s/.joe/syntax/%s.jsf",p,syntax->name); f = fopen((char *)name,"r"); } if (!f) { joe_snprintf_2(name,sizeof(name),"%ssyntax/%s.jsf",JOEDATA,syntax->name); f = fopen((char *)name,"r"); } if(!f) { return 0; } /* Parse file */ while(fgets((char *)buf,1023,f)) { ++line; p = buf; c = parse_ws(&p,'#'); if (!parse_char(&p, '.')) { if (!parse_ident(&p, bf, sizeof(bf))) { if (!zcmp(bf, USTR "ifdef")) { struct ifstack *st = joe_malloc(sizeof(struct ifstack)); st->next = stack; st->else_part = 0; st->ignore = 1; st->skip = 1; st->line = line; if (!stack || !stack->ignore) { parse_ws(&p,'#'); if (!parse_ident(&p, bf, sizeof(bf))) { struct high_param *param; for (param = syntax->params; param; param = param->next) if (!zcmp(param->name, bf)) { st->ignore = 0; break; } st->skip = 0; } else { i_printf_2((char *)joe_gettext(_("%s %d: missing parameter for ifdef\n")),name,line); } } stack = st; } else if (!zcmp(bf, USTR "else")) { if (stack && !stack->else_part) { stack->else_part = 1; if (!stack->skip) stack->ignore = !stack->ignore; } else i_printf_2((char *)joe_gettext(_("%s %d: else with no matching if\n")),name,line); } else if (!zcmp(bf, USTR "endif")) { if (stack) { struct ifstack *st = stack; stack = st->next; joe_free(st); } else i_printf_2((char *)joe_gettext(_("%s %d: endif with no matching if\n")),name,line); } else if (!zcmp(bf, USTR "subr")) { parse_ws(&p, '#'); if (parse_ident(&p, bf, sizeof(bf))) { i_printf_2((char *)joe_gettext(_("%s %d: Missing subroutine name\n")),name,line); } else { if (!stack || !stack->ignore) { inside_subr = 1; this_one = 0; if (syntax->subr && !zcmp(bf, syntax->subr)) this_one = 1; } } } else if (!zcmp(bf, USTR "end")) { if (!stack || !stack->ignore) { this_one = 0; inside_subr = 0; } } else { i_printf_2((char *)joe_gettext(_("%s %d: Unknown control statement\n")),name,line); } } else { i_printf_2((char *)joe_gettext(_("%s %d: Missing control statement name\n")),name,line); } } else if (stack && stack->ignore) { /* Ignore this line because of ifdef */ } else if(!parse_char(&p, '=')) { /* Parse color */ parse_color_def(&syntax->color,p,name,line); } else if ((syntax->subr && !this_one) || (!syntax->subr && inside_subr)) { /* Ignore this line because it's not the code we want */ } else if(!parse_char(&p, ':')) { if(!parse_ident(&p, bf, sizeof(bf))) { state = find_state(syntax,bf); if (!first) first = state; parse_ws(&p,'#'); if(!parse_tows(&p,bf)) { struct high_color *color; for(color=syntax->color;color;color=color->next) if(!zcmp(color->name,bf)) break; if(color) state->color=color->color; else { state->color=0; i_printf_2((char *)joe_gettext(_("%s %d: Unknown class\n")),name,line); } } else i_printf_2((char *)joe_gettext(_("%s %d: Missing color for state definition\n")),name,line); } else i_printf_2((char *)joe_gettext(_("%s %d: Missing state name\n")),name,line); } else if(!parse_char(&p, '-')) { /* No. sync lines ignored */ } else { c = parse_ws(&p,'#'); if (!c) { } else if (c=='"' || c=='*' || c=='&') { if (state) { struct high_cmd *cmd; int delim = 0; if(!parse_field(&p, USTR "*")) { int z; for(z=0;z!=256;++z) clist[z] = 1; } else if(!parse_field(&p, USTR "&")) { delim = 1; } else { c = parse_string(&p, bf, sizeof(bf)); if(c < 0) i_printf_2((char *)joe_gettext(_("%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 */ cmd = mkcmd(); parse_ws(&p,'#'); if(!parse_ident(&p,bf,sizeof(bf))) { int z; cmd->new_state = find_state(syntax,bf); parse_options(syntax,cmd,f,p,0,name,line); /* Install command */ if (delim) state->delim = cmd; else for(z=0;z!=256;++z) if(clist[z]) state->cmd[z]=cmd; } else i_printf_2((char *)joe_gettext(_("%s %d: Missing jump\n")),name,line); } else i_printf_2((char *)joe_gettext(_("%s %d: No state\n")),name,line); } else i_printf_2((char *)joe_gettext(_("%s %d: Unknown character\n")),name,line); } } while (stack) { struct ifstack *st = stack; stack = st->next; i_printf_2((char *)joe_gettext(_("%s %d: ifdef with no matching endif\n")),name,st->line); joe_free(st); } fclose(f); return first; } int syntax_match(struct high_syntax *syntax,unsigned char *name,unsigned char *subr,struct high_param *params) { struct high_param *syntax_params; if (zcmp(syntax->name,name)) return 0; if (!syntax->subr ^ !subr) return 0; if (subr && zcmp(syntax->subr,subr)) return 0; syntax_params = syntax->params; while (syntax_params && params) { if (zcmp(syntax_params->name,params->name)) return 0; syntax_params = syntax_params->next; params = params->next; } return syntax_params == params; } struct high_syntax *load_syntax_subr(unsigned char *name,unsigned char *subr,struct high_param *params) { struct high_syntax *syntax; /* New syntax table */ /* Find syntax table */ /* Already loaded? */ for(syntax=syntax_list;syntax;syntax=syntax->next) if(syntax_match(syntax,name,subr,params)) return syntax; /* Create new one */ syntax = joe_malloc(sizeof(struct high_syntax)); syntax->name = zdup(name); syntax->subr = subr ? zdup(subr) : 0; syntax->params = params; syntax->next = syntax_list; syntax->nstates = 0; syntax->color = 0; syntax->states = joe_malloc(sizeof(struct high_state *)*(syntax->szstates = 64)); syntax->ht_states = htmk(syntax->szstates); iz_cmd(&syntax->default_cmd); syntax->default_cmd.reset = 1; syntax->stack_base = 0; syntax_list = syntax; if (load_dfa(syntax)) { /* dump_syntax(syntax); */ return syntax; } else { if(syntax_list == syntax) syntax_list = syntax_list->next; else { struct high_syntax *syn; for(syn=syntax_list;syn->next!=syntax;syn=syn->next); syn->next = syntax->next; } htrm(syntax->ht_states); joe_free(syntax->name); joe_free(syntax->states); joe_free(syntax); return 0; } } struct high_syntax *load_syntax(unsigned char *name) { if (!name) return 0; return load_syntax_subr(name,0,0); } joe-3.7/syntax.h0000644000100100007640000000665711102711277010566 00000000000000#ifndef _Isyntax #define _Isyntax 1 /* * Syntax highlighting DFA interpreter * Copyright * (C) 2004 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ /* Color definition */ struct high_color { struct high_color *next; unsigned char *name; /* Symbolic name of color */ int color; /* Color value */ }; /* State */ struct high_state { int no; /* State number */ unsigned char *name; /* Highlight state name */ int color; /* Color for this state */ struct high_cmd *cmd[256]; /* Character table */ struct high_cmd *delim; /* Matching delimiter */ }; /* Parameter list */ struct high_param { struct high_param *next; unsigned char *name; }; /* Command (transition) */ struct high_cmd { 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 save_c : 1; /* Save character */ unsigned save_s : 1; /* Save string */ unsigned ignore : 1; /* Set to ignore case */ unsigned start_mark : 1; /* Set to begin marked area including this char */ unsigned stop_mark : 1; /* Set to end marked area excluding this char */ unsigned recolor_mark : 1; /* Set to recolor marked area with new state */ unsigned rtn : 1; /* Set to return */ unsigned reset : 1; /* Set to reset the call stack */ int recolor; /* No. chars to recolor if <0. */ struct high_state *new_state; /* The new state */ HASH *keywords; /* Hash table of keywords */ struct high_cmd *delim; /* Matching delimiter */ struct high_syntax *call; /* Syntax subroutine to call */ }; /* Call stack frame */ struct high_frame { struct high_frame *parent; /* Caller's frame */ struct high_frame *child; /* First callee's frame */ struct high_frame *sibling; /* Caller's next callee's frame */ struct high_syntax *syntax; /* Current syntax subroutine */ struct high_state *return_state; /* Return state in the caller's subroutine */ }; /* Loaded form of syntax file or subroutine */ struct high_syntax { struct high_syntax *next; /* Linked list of loaded syntaxes */ unsigned char *name; /* Name of this syntax */ unsigned char *subr; /* Name of the subroutine (or NULL for whole file) */ struct high_param *params; /* Parameters defined */ struct high_state **states; /* The states of this syntax. states[0] is idle state */ HASH *ht_states; /* Hash table of states */ int nstates; /* No. states */ int szstates; /* Malloc size of states array */ struct high_color *color; /* Linked list of color definitions */ struct high_cmd default_cmd; /* Default transition for new states */ struct high_frame *stack_base; /* Root of run-time call tree */ }; /* Find a syntax. Load it if necessary. */ struct high_syntax *load_syntax PARAMS((unsigned char *name)); /* Parse a lines. Returns new state. */ extern int *attr_buf; HIGHLIGHT_STATE parse PARAMS((struct high_syntax *syntax,P *line,HIGHLIGHT_STATE state)); #define clear_state(s) (((s)->saved_s[0] = 0), ((s)->state = 0), ((s)->stack = 0)) #define invalidate_state(s) ((s)->state = -1) #define move_state(to,from) (*(to)= *(from)) #define eq_state(x,y) ((x)->state == (y)->state && (x)->stack == (y)->stack && !zcmp((x)->saved_s, (y)->saved_s)) extern struct high_color *global_colors; void parse_color_def PARAMS((struct high_color **color_list,unsigned char *p,unsigned char *name,int line)); void dump_syntax PARAMS((BW *bw)); #endif joe-3.7/path.c0000644000100100007640000002241411103407223010146 00000000000000/* * Directory and path functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" #ifdef HAVE_PWD_H #include #endif #ifdef HAVE_PATHS_H # include /* for _PATH_TMP */ #endif #ifdef HAVE_LIMITS_H #include #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 #ifdef __MSDOS__ /* paths in MS-DOS can include a drive letter followed by semicolon */ #define do_if_drive_letter(path, command) do { \ if ((path)[0] && (path)[1] == ':') { \ command; \ } \ } while(0) #else #define do_if_drive_letter(path, command) do { } while(0) #endif #define skip_drive_letter(path) do_if_drive_letter((path), (path) += 2) #ifndef _PATH_TMP # ifdef __MSDOS__ # define _PATH_TMP "" # else # define _PATH_TMP "/tmp/" # endif #endif #ifndef PATH_MAX /* #warning is gcc extension #warning What should we include to have PATH_MAX defined? */ #define PATH_MAX 4096 #endif /********************************************************************/ unsigned char *joesep(unsigned char *path) { #ifdef __MSDOS__ int x; for (x = 0; path[x]; ++x) if (path[x] == '\\') path[x] = '/'; #endif return path; } /********************************************************************/ unsigned char *namprt(unsigned char *path) { unsigned char *z; 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; skip_drive_letter(path); z = path + zlen(path); while ((z != path) && (z[-1] != '/')) --z; return zcpy(tmp, z); } /********************************************************************/ unsigned char *dirprt(unsigned char *path) { unsigned char *b = path; unsigned char *z = path + slen(path); skip_drive_letter(b); while ((z != b) && (z[-1] != '/')) --z; return vsncpy(NULL, 0, path, z - path); } /********************************************************************/ unsigned char *begprt(unsigned char *path) { unsigned char *z = path + slen(path); int drv = 0; 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; 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(unsigned char *where) { #ifndef HAVE_MKSTEMP static unsigned seq = 0; #endif unsigned char *name; int fd; unsigned namesize; if (!where) where = (unsigned char *)getenv("TEMP"); if (!where) where = USTR _PATH_TMP; namesize = zlen(where) + 16; 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(name, namesize, "%s/joe.tmp.XXXXXX", where); if((fd = mkstemp((char *)name)) == -1) return NULL; /* FIXME: vflsh() and vflshf() */ /* expect mktmp() always succeed!!! */ fchmod(fd, 0600); /* Linux glibc 2.0 mkstemp() creates it with */ /* 0666 mode --> change it to 0600, so nobody */ /* else sees content of temporary file */ close(fd); #else loop: seq = (seq + 1) % 1000; joe_snprintf_3(name, namesize, "%s/joe.tmp.%03u%03u", where, seq, (unsigned) time(NULL) % 1000); 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) return NULL; /* FIXME: see above */ else close(fd); #endif return name; } /********************************************************************/ int rmatch(unsigned char *a, 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; } /********************************************************************/ #ifdef __MSDOS__ #include #include struct direct { unsigned char d_name[16]; } direc; int dirstate = 0; struct ffblk ffblk; unsigned char *dirpath = NULL; void *opendir(unsigned char *path) { dirstate = 0; return &direc; } void closedir() { } struct direct *readdir() { int x; if (dirstate) { if (findnext(&ffblk)) return NULL; } else { if (findfirst("*.*", &ffblk, FA_DIREC)) return NULL; dirstate = 1; } zcpy(direc.d_name, ffblk.ff_name); for (x = 0; direc.d_name[x]; ++x) direc.d_name[x] = tolower(direc.d_name[x]); return &direc; } #endif /********************************************************************/ unsigned char **rexpnd(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; } /********************************************************************/ unsigned char **rexpnd_users(unsigned char *word) { unsigned char **lst = NULL; struct passwd *pw; while((pw=getpwent())) if (rmatch(word+1, (unsigned char *)pw->pw_name)) { unsigned char *t = vsncpy(NULL,0,sc("~")); lst = vaadd(lst, vsncpy(sv(t),sz((unsigned char *)pw->pw_name))); } endpwent(); return lst; } /********************************************************************/ int chpwd(unsigned char *path) { #ifdef __MSDOS__ unsigned char buf[256]; int x; if (!path) return 0; if ((path[0]) && (path[1] == ':')) { if (_chdrive(path[0] & 0x1F)) return -1; path += 2; } if (!path[0]) return 0; zcpy(buf, path); x = zlen(buf); while (x > 1) { --x; if ((buf[x] == '/') || (buf[x] == '\\')) buf[x] = 0; else break; } return chdir(buf); #else if ((!path) || (!path[0])) return 0; return chdir((char *)path); #endif } /* The pwd function */ unsigned char *pwd(void) { 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; } /* Simplify prefix by using ~ */ /* Expects s to have trailing / */ unsigned char *simplify_prefix(unsigned char *s) { unsigned char *t = (unsigned char *)getenv("HOME"); unsigned char *n; #ifdef junk unsigned char *org = pwd(); /* Normalize home */ if (t && !chpwd(t)) { t = pwd(); } else { t = 0; } chpwd(org); #endif /* If current directory is prefixed with home directory, use ~... */ if (t && !strncmp((char *)s,(char *)t,zlen(t)) && (!s[zlen(t)] || s[zlen(t)]=='/')) { n = vsncpy(NULL,0,sc("~/")); /* If anything more than just the home directory, add it */ if (s[zlen(t)]) { n = vsncpy(sv(n),s+zlen(t)+1,zlen(s+zlen(t)+1)); } } else { n = vsncpy(NULL,0,sz(s)); } return n; } joe-3.7/path.h0000644000100100007640000000633210431662534010167 00000000000000/* * Directory and path functions * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_PATH_H #define _JOE_PATH_H 1 unsigned char *joesep PARAMS((unsigned char *path)); /* 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 PARAMS((unsigned char *path)); unsigned char *namepart PARAMS((unsigned char *tmp, unsigned char *path)); /* 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 "/" */ unsigned char *dirprt PARAMS((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 PARAMS((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 PARAMS((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 PARAMS((unsigned char *path)); /* char *mktmp(char *); * 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. */ unsigned char *mktmp PARAMS((unsigned char *where)); /* 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 PARAMS((unsigned char *a, unsigned char *b)); int isreg PARAMS((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 PARAMS((unsigned char *word)); unsigned char **rexpnd_users PARAMS((unsigned char *word)); int chpwd PARAMS((unsigned char *path)); unsigned char *pwd PARAMS((void)); unsigned char *simplify_prefix PARAMS((unsigned char *path)); #endif joe-3.7/umath.c0000644000100100007640000002720510457276141010351 00000000000000/* * Math * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" unsigned char *merr; int mode_hex; int mode_eng; int mode_ins; double vzero = 0.0; static RETSIGTYPE fperr(int unused) { if (!merr) { merr = joe_gettext(_("Float point exception")); } REINSTALL_SIGHANDLER(SIGFPE, fperr); } struct var { unsigned char *name; double (*func)(double n); int set; double val; struct var *next; } *vars = NULL; static struct var *get(unsigned char *str) { struct var *v; for (v = vars; v; v = v->next) { if (!zcmp(v->name, str)) { return v; } } v = (struct var *) joe_malloc(sizeof(struct var)); v->set = 0; v->func = 0; v->val = 0; v->next = vars; vars = v; v->name = zdup(str); return v; } unsigned char *ptr; struct var *dumb; static double eval(unsigned char *s); int recur=0; /* en means enable evaluation */ static double expr(int prec, int en,struct var **rtv) { double x = 0.0, y, z; struct var *v = NULL; while (*ptr == ' ' || *ptr == '\t') { ++ptr; } if ((*ptr >= 'a' && *ptr <= 'z') || (*ptr >= 'A' && *ptr <= 'Z') || *ptr == '_') { unsigned char *s = ptr, c; while ((*ptr >= 'a' && *ptr <= 'z') || (*ptr >= 'A' && *ptr <= 'Z') || *ptr == '_' || (*ptr >= '0' && *ptr <= '9')) { ++ptr; } c = *ptr; *ptr = 0; if (!zcmp(s,USTR "joe")) { *ptr = c; v = 0; x = 0.0; while (*ptr==' ' || *ptr=='\t') ++ptr; if (*ptr=='(') { unsigned char *q = ++ptr; MACRO *m; int sta; while (*q && *q!=')') ++q; if (*q!=')') { if (!merr) merr = joe_gettext(_("Missing )")); } else *q++ = 0; if (en) { m = mparse(NULL,ptr,&sta); ptr = q; if (m) { x = !exmacro(m,1); rmmacro(m); } else { if (!merr) merr = joe_gettext(_("Syntax error in macro")); } } else { ptr = q; } } else { if (!merr) merr = joe_gettext(_("Missing (")); } c = *ptr; } else if (!en) { v = 0; x = 0.0; } else if (!zcmp(s,USTR "hex")) { mode_hex = 1; mode_eng = 0; v = get(USTR "ans"); x = v->val; } else if (!zcmp(s,USTR "dec")) { mode_hex = 0; mode_eng = 0; v = get(USTR "ans"); x = v->val; } else if (!zcmp(s,USTR "eng")) { mode_hex = 0; mode_eng = 1; v = get(USTR "ans"); x = v->val; } else if (!zcmp(s,USTR "ins")) { mode_ins = 1; v = get(USTR "ans"); x = v->val; } else if (!zcmp(s,USTR "sum")) { double xsq; int cnt = blksum(&x, &xsq); if (!merr && cnt<=0) merr = joe_gettext(_("No numbers in block")); v = 0; } else if (!zcmp(s,USTR "cnt")) { double xsq; int cnt = blksum(&x, &xsq); if (!merr && cnt<=0) merr = joe_gettext(_("No numbers in block")); v = 0; x = cnt; } else if (!zcmp(s,USTR "avg")) { double xsq; int cnt = blksum(&x, &xsq); if (!merr && cnt<=0) merr = joe_gettext(_("No numbers in block")); v = 0; if (cnt) x /= (double)cnt; } else if (!zcmp(s,USTR "dev")) { double xsq; double avg; int cnt = blksum(&x, &xsq); if (!merr && cnt<=0) merr = joe_gettext(_("No numbers in block")); v = 0; if (cnt) { avg = x / (double)cnt; x = sqrt(xsq + (double)cnt*avg*avg - 2.0*avg*x); } } else if (!zcmp(s,USTR "eval")) { unsigned char *save = ptr; unsigned char *e = blkget(); if (e) { v = 0; x = eval(e); joe_free(e); ptr = save; } else if (!merr) { merr = joe_gettext(_("No block")); } } else { v = get(s); x = v->val; } *ptr = c; } else if ((*ptr >= '0' && *ptr <= '9') || *ptr == '.') { char *eptr; x = strtod((char *)ptr,&eptr); ptr = (unsigned char *)eptr; } else if (*ptr == '(') { ++ptr; x = expr(0, en, &v); if (*ptr == ')') ++ptr; else { if (!merr) merr = joe_gettext(_("Missing )")); } } else if (*ptr == '-') { ++ptr; x = -expr(10, en, &dumb); } else if (*ptr == '!') { ++ptr; x = !expr(10, en, &dumb); } loop: while (*ptr == ' ' || *ptr == '\t') ++ptr; if (*ptr == '(' && 11 > prec) { ++ptr; y = expr(0, en, &dumb); if (*ptr == ')') ++ptr; else { if (!merr) merr = joe_gettext(_("Missing )")); } if (v && v->func) x = v->func(y); else { if (!merr) merr = joe_gettext(_("Called object is not a function")); } goto loop; } else if (*ptr == '!' && ptr[1]!='=' && 10 >= prec) { ++ptr; if (x == (int)x && x>=1.0 && x<70.0) { y = 1.0; while (x>1.0) { y *= x; x -= 1.0; } x = y; } else { if (!merr) merr = joe_gettext(_("Factorial can only take positive integers")); } v = 0; goto loop; } else if (*ptr == '*' && ptr[1] == '*' && 8 > prec) { ptr+=2; x = pow(x, expr(8, en, &dumb)); v = 0; goto loop; } else if (*ptr == '^' && 8 > prec) { ++ptr; x = pow(x, expr(8, en, &dumb)); v = 0; goto loop; } else if (*ptr == '*' && 7 > prec) { ++ptr; x *= expr(7, en, &dumb); v = 0; goto loop; } else if (*ptr == '/' && 7 > prec) { ++ptr; x /= expr(7, en, &dumb); v = 0; goto loop; } else if(*ptr=='%' && 7>prec) { ++ptr; y = expr(7, en, &dumb); if ((int)y == 0) x = 1.0/vzero; else x = ((int) x) % (int)y; v = 0; goto loop; } else if (*ptr == '+' && 6 > prec) { ++ptr; x += expr(6, en, &dumb); v = 0; goto loop; } else if (*ptr == '-' && 6 > prec) { ++ptr; x -= expr(6, en, &dumb); v = 0; goto loop; } else if (*ptr == '<' && 5 > prec) { ++ptr; if (*ptr == '=') ++ptr, x = (x <= expr(5, en, &dumb)); else x = (x < expr(5,en,&dumb)); v = 0; goto loop; } else if (*ptr == '>' && 5 > prec) { ++ptr; if (*ptr == '=') ++ptr, x=(x >= expr(5,en,&dumb)); else x = (x > expr(5,en,&dumb)); v = 0; goto loop; } else if (*ptr == '=' && ptr[1] == '=' && 5 > prec) { ++ptr, ++ptr; x = (x == expr(5,en,&dumb)); v = 0; goto loop; } else if (*ptr == '!' && ptr[1] == '=' && 5 > prec) { ++ptr, ++ptr; x = (x != expr(5,en,&dumb)); v = 0; goto loop; } else if (*ptr == '&' && ptr[1] == '&' && 3 > prec) { ++ptr, ++ptr; y = expr(3,x!=0.0 && en,&dumb); x = (int)x && (int)y; v = 0; goto loop; } else if (*ptr=='|' && ptr[1]=='|' && 3 > prec) { ++ptr, ++ptr; y = expr(3,x==0.0 && en,&dumb); x = (int)x || (int)y; v= 0; goto loop; } else if (*ptr=='?' && 2 >= prec) { ++ptr; y = expr(2,x!=0.0 && en,&dumb); if (*ptr==':') { ++ptr; z = expr(2,x==0.0 && en,&dumb); if (x != 0.0) x = y; else x = z; v = 0; } else if (!merr) { merr = USTR ": missing after ?"; } goto loop; } else if (*ptr == '=' && 1 >= prec) { ++ptr; x = expr(1, en,&dumb); if (v) { v->val = x; v->set = 1; } else { if (!merr) merr = joe_gettext(_("Left side of = is not an l-value")); } v = 0; goto loop; } *rtv = v; return x; } static double eval(unsigned char *s) { double result = 0.0; struct var *v; if(++recur==1000) { merr = joe_gettext(_("Recursion depth exceeded")); --recur; return 0.0; } ptr = s; while (!merr && *ptr) { result = expr(0, 1, &dumb); v = get(USTR "ans"); v->val = result; v->set = 1; if (!merr) { while (*ptr == ' ' || *ptr == '\t' || *ptr == '\r' || *ptr == '\n') { ++ptr; } if (*ptr == ':') { ++ptr; while (*ptr == ' ' || *ptr == '\t' || *ptr == '\r' || *ptr == '\n') { ++ptr; } } else if (*ptr) { merr = joe_gettext(_("Extra junk after end of expr")); } } } --recur; return result; } double m_sin(double n) { return sin(n); } double m_cos(double n) { return cos(n); } double m_tan(double n) { return tan(n); } double m_exp(double n) { return exp(n); } double m_sqrt(double n) { return sqrt(n); } double m_cbrt(double n) { return cbrt(n); } double m_log(double n) { return log(n); } double m_log10(double n) { return log10(n); } double m_asin(double n) { return asin(n); } double m_acos(double n) { return acos(n); } double m_atan(double n) { return atan(n); } double m_sinh(double n) { return sinh(n); } double m_cosh(double n) { return cosh(n); } double m_tanh(double n) { return tanh(n); } double m_asinh(double n) { return asinh(n); } double m_acosh(double n) { return acosh(n); } double m_atanh(double n) { return atanh(n); } double m_int(double n) { return (int)(n); } double m_floor(double n) { return floor(n); } double m_ceil(double n) { return ceil(n); } double m_fabs(double n) { return fabs(n); } double m_erf(double n) { return erf(n); } double m_erfc(double n) { return erfc(n); } double m_j0(double n) { return j0(n); } double m_j1(double n) { return j1(n); } double m_y0(double n) { return y0(n); } double m_y1(double n) { return y1(n); } double calc(BW *bw, unsigned char *s) { /* BW *tbw = bw->parent->main->object; */ BW *tbw = bw; struct var *v; int c = brch(bw->cursor); if (!vars) { v = get(USTR "sin"); v->func = m_sin; v = get(USTR "cos"); v->func = m_cos; v = get(USTR "tan"); v->func = m_tan; v = get(USTR "exp"); v->func = m_exp; v = get(USTR "sqrt"); v->func = m_sqrt; v = get(USTR "cbrt"); v->func = m_cbrt; v = get(USTR "ln"); v->func = m_log; v = get(USTR "log"); v->func = m_log10; v = get(USTR "asin"); v->func = m_asin; v = get(USTR "acos"); v->func = m_acos; v = get(USTR "atan"); v->func = m_atan; v = get(USTR "pi"); v->val = M_PI; v->set = 1; v = get(USTR "e"); v->val = M_E; v->set = 1; v = get(USTR "sinh"); v->func = m_sinh; v = get(USTR "cosh"); v->func = m_cosh; v = get(USTR "tanh"); v->func = m_tanh; v = get(USTR "asinh"); v->func = m_asinh; v = get(USTR "acosh"); v->func = m_acosh; v = get(USTR "atanh"); v->func = m_atanh; v = get(USTR "int"); v->func = m_int; v = get(USTR "floor"); v->func = m_floor; v = get(USTR "ceil"); v->func = m_ceil; v = get(USTR "abs"); v->func = m_fabs; v = get(USTR "erf"); v->func = m_erf; v = get(USTR "erfc"); v->func = m_erfc; v = get(USTR "j0"); v->func = m_j0; v = get(USTR "j1"); v->func = m_j1; v = get(USTR "y0"); v->func = m_y0; v = get(USTR "y1"); v->func = m_y1; } v = get(USTR "top"); v->val = tbw->top->line + 1; v->set = 1; v = get(USTR "lines"); v->val = tbw->b->eof->line + 1; v->set = 1; v = get(USTR "line"); v->val = tbw->cursor->line + 1; v->set = 1; v = get(USTR "col"); v->val = tbw->cursor->col + 1; v->set = 1; v = get(USTR "byte"); v->val = tbw->cursor->byte + 1; v->set = 1; v = get(USTR "size"); v->val = tbw->b->eof->byte; v->set = 1; v = get(USTR "height"); v->val = tbw->h; v->set = 1; v = get(USTR "width"); v->val = tbw->w; v->set = 1; v = get(USTR "char"); v->val = (c == NO_MORE_DATA ? -1.0 : c); v->set = 1; v = get(USTR "markv"); v->val = markv(1) ? 1.0 : 0.0; v->set = 1; v = get(USTR "rdonly"); v->val = tbw->b->rdonly; v->set = 1; v = get(USTR "arg"); v->val = current_arg; v->set = 1; v = get(USTR "argset"); v->val = current_arg_set; v->set = 1; v = get(USTR "no_windows"); v->val = countmain(bw->parent->t); v->set = 1; merr = 0; return eval(s); } /* Main user interface */ static int domath(BW *bw, unsigned char *s, void *object, int *notify) { double result = calc(bw, s); if (notify) { *notify = 1; } if (merr) { msgnw(bw->parent, merr); return -1; } vsrm(s); if (mode_hex) joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, "0x%lX", (long)result); else if (mode_eng) joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, "%.16G", result); else joe_snprintf_1(msgbuf, JOE_MSGBUFSIZE, "%.16G", result); if (bw->parent->watom->what != TYPETW || mode_ins) { binsm(bw->cursor, sz(msgbuf)); pfwrd(bw->cursor, zlen(msgbuf)); bw->cursor->xcol = piscol(bw->cursor); } else { msgnw(bw->parent, msgbuf); } mode_ins = 0; return 0; } B *mathhist = NULL; int umath(BW *bw) { joe_set_signal(SIGFPE, fperr); if (wmkpw(bw->parent, USTR "=", &mathhist, domath, USTR "Math", NULL, NULL, NULL, NULL, locale_map, 0)) { return 0; } else { return -1; } } joe-3.7/umath.h0000644000100100007640000000052510431662534010347 00000000000000/* * Math * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_UMATH_H #define _JOE_UMATH_H 1 extern unsigned char *merr; /* Math error message: set if calc returned an error */ double calc PARAMS((BW *bw, unsigned char *s)); int umath PARAMS((BW *bw)); extern B *mathhist; #endif joe-3.7/types.h0000644000100100007640000002147311102461205010366 00000000000000/* JOE global header file */ #include "config.h" /* Common header files */ #include #include #include #include #ifdef HAVE_SYS_TYPES_H #include #else typedef int pid_t; #endif #ifdef HAVE_SIGNAL_H #include #endif #ifdef HAVE_FCNTL_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_TIME_H #include #endif #define joe_gettext(s) my_gettext((unsigned char *)(s)) /* #ifdef ENABLE_NLS #include #define joe_gettext(s) (unsigned char *)gettext((char *)(s)) #else #define joe_gettext(s) ((unsigned char *)(s)) #endif */ /* Strings needing translation are marked with this macro */ #define _(s) (s) /* Global Defines */ /* Prefix to make string constants unsigned */ #define USTR (unsigned char *) /* Doubly-linked list node */ #define LINK(type) struct { type *next; type *prev; } #ifdef HAVE_SNPRINTF #define joe_snprintf_0(buf,len,fmt) snprintf((char *)(buf),(len),(char *)(fmt)) #define joe_snprintf_1(buf,len,fmt,a) snprintf((char *)(buf),(len),(char *)(fmt),(a)) #define joe_snprintf_2(buf,len,fmt,a,b) snprintf((char *)(buf),(len),(char *)(fmt),(a),(b)) #define joe_snprintf_3(buf,len,fmt,a,b,c) snprintf((char *)(buf),(len),(char *)(fmt),(a),(b),(c)) #define joe_snprintf_4(buf,len,fmt,a,b,c,d) snprintf((char *)(buf),(len),(char *)(fmt),(a),(b),(c),(d)) #define joe_snprintf_5(buf,len,fmt,a,b,c,d,e) snprintf((char *)(buf),(len),(char *)(fmt),(a),(b),(c),(d),(e)) #define joe_snprintf_6(buf,len,fmt,a,b,c,d,e,f) snprintf((char *)(buf),(len),(char *)(fmt),(a),(b),(c),(d),(e),(f)) #define joe_snprintf_7(buf,len,fmt,a,b,c,d,e,f,g) snprintf((char *)(buf),(len),(char *)(fmt),(a),(b),(c),(d),(e),(f),(g)) #define joe_snprintf_8(buf,len,fmt,a,b,c,d,e,f,g,h) snprintf((char *)(buf),(len),(char *)(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((char *)(buf),(len),(char *)(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((char *)(buf),(len),(char *)(fmt),(a),(b),(c),(d),(e),(f),(g),(h),(i),(j)) #define i_printf_0(fmt) (snprintf((char *)(i_msg),sizeof(i_msg),(char *)(fmt)), internal_msg(i_msg)) #define i_printf_1(fmt,a) (snprintf((char *)(i_msg),sizeof(i_msg),(char *)(fmt),(a)), internal_msg(i_msg)) #define i_printf_2(fmt,a,b) (snprintf((char *)(i_msg),sizeof(i_msg),(char *)(fmt),(a),(b)), internal_msg(i_msg)) #define i_printf_3(fmt,a,b,c) (snprintf((char *)(i_msg),sizeof(i_msg),(char *)(fmt),(a),(b),(c)), internal_msg(i_msg)) #define i_printf_4(fmt,a,b,c,d) (snprintf((char *)(i_msg),sizeof(i_msg),(char *)(fmt),(a),(b),(c),(d)), internal_msg(i_msg)) #else #define joe_snprintf_0(buf,len,fmt) sprintf((char *)(buf),(char *)(fmt)) #define joe_snprintf_1(buf,len,fmt,a) sprintf((char *)(buf),(char *)(fmt),(a)) #define joe_snprintf_2(buf,len,fmt,a,b) sprintf((char *)(buf),(char *)(fmt),(a),(b)) #define joe_snprintf_3(buf,len,fmt,a,b,c) sprintf((char *)(buf),(char *)(fmt),(a),(b),(c)) #define joe_snprintf_4(buf,len,fmt,a,b,c,d) sprintf((char *)(buf),(char *)(fmt),(a),(b),(c),(d)) #define joe_snprintf_5(buf,len,fmt,a,b,c,d,e) sprintf((char *)(buf),(char *)(fmt),(a),(b),(c),(d),(e)) #define joe_snprintf_6(buf,len,fmt,a,b,c,d,e,f) sprintf((char *)(buf),(char *)(fmt),(a),(b),(c),(d),(e),(f)) #define joe_snprintf_7(buf,len,fmt,a,b,c,d,e,f,g) sprintf((char *)(buf),(char *)(fmt),(a),(b),(c),(d),(e),(f),(g)) #define joe_snprintf_8(buf,len,fmt,a,b,c,d,e,f,g,h) sprintf((char *)(buf),(char *)(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((char *)(buf),(char *)(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((char *)(buf),(char *)(fmt),(a),(b),(c),(d),(e),(f),(g),(h),(i),(j)) #define i_printf_0(fmt) (sprintf((char *)(i_msg),(char *)(fmt)), internal_msg(i_msg)) #define i_printf_1(fmt,a) (sprintf((char *)(i_msg),(char *)(fmt),(a)), internal_msg(i_msg)) #define i_printf_2(fmt,a,b) (sprintf((char *)(i_msg),(char *)(fmt),(a),(b)), internal_msg(i_msg)) #define i_printf_3(fmt,a,b,c) (sprintf((char *)(i_msg),(char *)(fmt),(a),(b),(c)), internal_msg(i_msg)) #define i_printf_4(fmt,a,b,c,d) (sprintf((char *)(i_msg),(char *)(fmt),(a),(b),(c),(d)), internal_msg(i_msg)) #endif /* Largest signed integer */ #define MAXINT ((((unsigned int)-1)/2)-1) /* Largest signed long */ #define MAXLONG ((((unsigned long)-1L)/2)-1) /* Largest signed long long */ #define MAXLONGLONG ((((unsigned long long)-1L)/2)-1) /* Largest off_t */ /* BSD provides a correct OFF_MAX macro, but AIX provides a broken one, so do it ourselves. */ #if (SIZEOF_OFF_T == SIZEOF_INT) #define MAXOFF MAXINT #elif (SIZEOF_OFF_T == SIZEOF_LONG) #define MAXOFF MAXLONG #elif (SIZEOF_OFF_T == SIZEOF_LONG_LONG) #define MAXOFF MAXLONGLONG #else #error off_t is not an int, long, or long long? #endif #include #ifndef EOF #define EOF -1 #endif #define NO_MORE_DATA EOF #if defined __MSDOS__ && SIZEOF_INT == 2 /* real mode ms-dos compilers */ #if SIZEOF_VOID_P == 4 /* real mode ms-dos compilers with 'far' memory model or something like that */ #define physical(a) (((unsigned long)(a)&0xFFFF)+(((unsigned long)(a)&0xFFFF0000)>>12)) #define normalize(a) ((void *)(((unsigned long)(a)&0xFFFF000F)+(((unsigned long)(a)&0x0000FFF0)<<12))) #else #define physical(a) ((unsigned long)(a)) #define normalize(a) (a) #endif /* sizeof(void *) == 4 */ #define SEGSIZ 1024 #define PGSIZE 1024 #define LPGSIZE 10 #define ILIMIT (PGSIZE*96L) #define HTSIZE 128 #else /* not real mode ms-dos */ #define physical(a) ((unsigned long)(a)) #define normalize(a) (a) /* Log2 of page size */ #define LPGSIZE 12 /* No. bytes in page */ #define PGSIZE (1<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) { int color = ((c & FG_VALUE) >> FG_SHIFT); if (t->assume_256 && color >= t->Co) { unsigned char bf[32]; joe_snprintf_1(bf,sizeof(bf),"\033[38;5;%dm",color); ttputs(bf); } else { if (t->Co & (t->Co - 1)) texec(t->cap, t->Sf, 1, color % t->Co, 0, 0, 0); else texec(t->cap, t->Sf, 1, color & (t->Co - 1), 0, 0, 0); } } } if ((t->attrib & BG_MASK) != (c & BG_MASK)) { if (t->Sb) { int color = ((c & BG_VALUE) >> BG_SHIFT); if (t->assume_256 && color >= t->Co) { unsigned char bf[32]; joe_snprintf_1(bf,sizeof(bf),"\033[48;5;%dm",color); ttputs(bf); } else { if (t->Co & (t->Co - 1)) texec(t->cap, t->Sb, 1, color % t->Co, 0, 0, 0); else texec(t->cap, t->Sb, 1, color & (t->Co - 1), 0, 0, 0); } } } t->attrib = c; return 0; } /* Output character with attributes */ void outatr(struct charmap *map,SCRN *t,int *scrn,int *attrf,int xx,int yy,int c,int a) { if(map->type) if(locale_map->type) { /* UTF-8 char to UTF-8 terminal */ int wid; int uni_ctrl = 0; unsigned char buf[16]; /* Deal with control characters */ if (c<32) { c = c + '@'; a ^= UNDERLINE; } else if (c==127) { c = '?'; a ^= UNDERLINE; } else if (unictrl(c)) { a ^= UNDERLINE; uni_ctrl = 1; } if(*scrn==c && *attrf==a) return; wid = joe_wcwidth(1,c); *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 (uni_ctrl) { sprintf((char *)buf,"<%X>",c); ttputs(buf); } else { utf8_encode(buf,c); ttputs(buf); } t->x+=wid; while (wid>1) { *++scrn= -1; *++attrf= 0; --wid; } } else { /* UTF-8 char to non-UTF-8 terminal */ /* Don't convert control chars below 256 */ if ((c>=32 && c<=126) || c>=160) { if (unictrl(c)) a ^= UNDERLINE; c = from_uni(locale_map,c); if (c==-1) c = '?'; } /* Deal with control characters */ if (!joe_isprint(locale_map,c) && !(dspasis && c>=128)) { a ^= xlata[c]; c = xlatc[c]; } 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); ttputc(c); t->x++; } else if (!locale_map->type) { /* Non UTF-8 char to non UTF-8 terminal */ /* Byte-byte Translate? */ /* Deal with control characters */ if (!joe_isprint(locale_map,c) && !(dspasis && c>=128)) { a ^= xlata[c]; c = xlatc[c]; } 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); ttputc(c); t->x++; } else { /* Non UTF-8 char to UTF-8 terminal */ unsigned char buf[16]; int wid; /* Deal with control characters */ if (!(dspasis && c>=128) && !joe_isprint(map,c)) { a ^= xlata[c]; c = xlatc[c]; } c = to_uni(map,c); if (c == -1) c = '?'; utf8_encode(buf,c); if (*scrn == c && *attrf == a) return; wid = joe_wcwidth(0,c); *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); ttputs(buf); t->x+=wid; while(wid>1) { *++scrn= -1; *++attrf= 0; --wid; } } } /* 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 */ 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); } } /* 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 atr) { 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 != atr) { ++ss; ++aa; break; } } while (ss != s); if ((ss - s > 3 || s[w] != ' ' || a[w] != atr) && t->ce) { cpos(t, x, y); if(t->attrib != atr) set_attr(t, atr); texec(t->cap, t->ce, 1, 0, 0, 0, 0); msetI(s, ' ', w); msetI(a, atr, w); } else if (s != ss) { if (t->ins) clrins(t); if (t->x != x || t->y != y) cpos(t, x, y); if (t->attrib != atr) set_attr(t, atr); while (s != ss) { *s = ' '; *a = atr; ttputc(' '); ++t->x; ++s; ++a; } } return 0; } /* As above but useable in insert mode */ /* The cursor position must already be correct */ static void outatri(SCRN *t, int x, int y, int c, int a) { /* if (c == -1) c = ' '; if (a != t->attrib) set_attr(t, a); if (t->haz && c == '~') c = '\\'; utf8_putc(c); t->x+=joe_wcwidth(1,c); */ /* ++t->x; */ } static void out(unsigned char *t, unsigned char c) { ttputc(c); } SCRN *nopen(CAP *cap) { SCRN *t = (SCRN *) joe_malloc(sizeof(SCRN)); int x, y; ttopen(); t->cap = cap; setcap(cap, baud, out, NULL); t->li = getnum(t->cap,USTR "li"); if (t->li < 1) t->li = 24; t->co = getnum(t->cap,USTR "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,USTR "hz"); t->os = getflag(t->cap,USTR "os"); t->eo = getflag(t->cap,USTR "eo"); if (getflag(t->cap,USTR "hc")) t->os = 1; if (t->os || getflag(t->cap,USTR "ul")) t->ul = 1; else t->ul = 0; t->xn = getflag(t->cap,USTR "xn"); t->am = getflag(t->cap,USTR "am"); if (notite) t->ti = 0; else t->ti = jgetstr(t->cap,USTR "ti"); t->cl = jgetstr(t->cap,USTR "cl"); t->cd = jgetstr(t->cap,USTR "cd"); if (notite) t->te = 0; else t->te = jgetstr(t->cap,USTR "te"); t->ut = getflag(t->cap,USTR "ut"); t->Sb = jgetstr(t->cap,USTR "AB"); if (!t->Sb) t->Sb = jgetstr(t->cap,USTR "Sb"); t->Sf = jgetstr(t->cap,USTR "AF"); if (!t->Sf) t->Sf = jgetstr(t->cap,USTR "Sf"); t->Co = getnum(t->cap,USTR "Co"); if (t->Co == -1) t->Co = 8; t->mb = NULL; t->md = NULL; t->mh = NULL; t->mr = NULL; t->avattr = 0; if (!(t->me = jgetstr(t->cap,USTR "me"))) goto oops; if ((t->mb = jgetstr(t->cap,USTR "mb"))) t->avattr |= BLINK; if ((t->md = jgetstr(t->cap,USTR "md"))) t->avattr |= BOLD; if ((t->mh = jgetstr(t->cap,USTR "mh"))) t->avattr |= DIM; if ((t->mr = jgetstr(t->cap,USTR "mr"))) t->avattr |= INVERSE; oops: if (assume_color || assume_256color) { /* Install 8 color support if it looks like an ansi terminal (it has bold which begins with ESC [) */ #ifndef TERMINFO if (!t->Sf && t->md && t->md[0]=='\\' && t->md[1]=='E' && t->md[2]=='[') { t->ut = 1; t->Sf = USTR "\\E[3%dm"; t->Sb = USTR "\\E[4%dm"; t->Co = 8; } #else if (!t->Sf && t->md && t->md[0]=='\033' && t->md[1]=='[') { t->ut = 1; t->Sf = USTR "\033[3%p1%dm"; t->Sb = USTR "\033[4%p1%dm"; } #endif } t->assume_256 = 0; if (assume_256color && t->Co < 256) { /* Force 256 color support */ #ifndef TERMINFO if (t->md && t->md[0]=='\\' && t->md[1]=='E' && t->md[2]=='[') { t->assume_256 = 1; #ifdef junk t->ut = 1; t->Sf = USTR "\\E[38;5;%dm"; t->Sb = USTR "\\E[48;5;%dm"; #endif } #else if (t->md && t->md[0]=='\033' && t->md[1]=='[') { t->assume_256 = 1; #ifdef junk t->ut = 1; t->Sf = USTR "\033[38;5;%p1%dm"; t->Sb = USTR "\033[48;5;%p1%dm"; #endif } #endif } t->so = NULL; t->se = NULL; if (getnum(t->cap,USTR "sg") <= 0 && !t->mr && jgetstr(t->cap,USTR "se")) { if ((t->so = jgetstr(t->cap,USTR "so")) != NULL) t->avattr |= INVERSE; t->se = jgetstr(t->cap,USTR "se"); } if (getflag(t->cap,USTR "xs") || getflag(t->cap,USTR "xt")) t->so = NULL; t->us = NULL; t->ue = NULL; if (getnum(t->cap,USTR "ug") <= 0 && jgetstr(t->cap,USTR "ue")) { if ((t->us = jgetstr(t->cap,USTR "us")) != NULL) t->avattr |= UNDERLINE; t->ue = jgetstr(t->cap,USTR "ue"); } if (!(t->uc = jgetstr(t->cap,USTR "uc"))) if (t->ul) t->uc =USTR "_"; if (t->uc) t->avattr |= UNDERLINE; t->ms = getflag(t->cap,USTR "ms"); t->da = getflag(t->cap,USTR "da"); t->db = getflag(t->cap,USTR "db"); t->cs = jgetstr(t->cap,USTR "cs"); t->rr = getflag(t->cap,USTR "rr"); t->sf = jgetstr(t->cap,USTR "sf"); t->sr = jgetstr(t->cap,USTR "sr"); t->SF = jgetstr(t->cap,USTR "SF"); t->SR = jgetstr(t->cap,USTR "SR"); t->al = jgetstr(t->cap,USTR "al"); t->dl = jgetstr(t->cap,USTR "dl"); t->AL = jgetstr(t->cap,USTR "AL"); t->DL = jgetstr(t->cap,USTR "DL"); if (!getflag(t->cap,USTR "ns") && !t->sf) t->sf =USTR "\12"; if (!getflag(t->cap,USTR "in") && baud < 38400) { t->dc = jgetstr(t->cap,USTR "dc"); t->DC = jgetstr(t->cap,USTR "DC"); t->dm = jgetstr(t->cap,USTR "dm"); t->ed = jgetstr(t->cap,USTR "ed"); t->im = jgetstr(t->cap,USTR "im"); t->ei = jgetstr(t->cap,USTR "ei"); t->ic = jgetstr(t->cap,USTR "ic"); t->IC = jgetstr(t->cap,USTR "IC"); t->ip = jgetstr(t->cap,USTR "ip"); t->mi = getflag(t->cap,USTR "mi"); } else { t->dm = NULL; t->dc = NULL; t->DC = NULL; t->ed = NULL; t->im = NULL; t->ic = NULL; t->IC = NULL; t->ip = NULL; t->ei = NULL; t->mi = 1; } t->bs = NULL; if (jgetstr(t->cap,USTR "bc")) t->bs = jgetstr(t->cap,USTR "bc"); else if (jgetstr(t->cap,USTR "le")) t->bs = jgetstr(t->cap,USTR "le"); if (getflag(t->cap,USTR "bs")) t->bs =USTR "\10"; t->cbs = tcost(t->cap, t->bs, 1, 2, 2, 0, 0); t->lf =USTR "\12"; if (jgetstr(t->cap,USTR "do")) t->lf = jgetstr(t->cap,USTR "do"); t->clf = tcost(t->cap, t->lf, 1, 2, 2, 0, 0); t->up = jgetstr(t->cap,USTR "up"); t->cup = tcost(t->cap, t->up, 1, 2, 2, 0, 0); t->nd = jgetstr(t->cap,USTR "nd"); t->tw = 8; if (getnum(t->cap,USTR "it") > 0) t->tw = getnum(t->cap,USTR "it"); else if (getnum(t->cap,USTR "tw") > 0) t->tw = getnum(t->cap,USTR "tw"); if (!(t->ta = jgetstr(t->cap,USTR "ta"))) if (getflag(t->cap,USTR "pt")) t->ta =USTR "\11"; t->bt = jgetstr(t->cap,USTR "bt"); if (getflag(t->cap,USTR "xt")) { t->ta = NULL; t->bt = NULL; } if (!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,USTR "ho"); t->cho = tcost(t->cap, t->ho, 1, 2, 2, 0, 0); t->ll = jgetstr(t->cap,USTR "ll"); t->cll = tcost(t->cap, t->ll, 1, 2, 2, 0, 0); t->cr =USTR "\15"; if (jgetstr(t->cap,USTR "cr")) t->cr = jgetstr(t->cap,USTR "cr"); if (getflag(t->cap,USTR "nc") || getflag(t->cap,USTR "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,USTR "RI"), 1, 2, 2, 0, 0); t->cLE = tcost(t->cap, t->LE = jgetstr(t->cap,USTR "LE"), 1, 2, 2, 0, 0); t->cUP = tcost(t->cap, t->UP = jgetstr(t->cap,USTR "UP"), 1, 2, 2, 0, 0); t->cDO = tcost(t->cap, t->DO = jgetstr(t->cap,USTR "DO"), 1, 2, 2, 0, 0); t->cch = tcost(t->cap, t->ch = jgetstr(t->cap,USTR "ch"), 1, 2, 2, 0, 0); t->ccv = tcost(t->cap, t->cv = jgetstr(t->cap,USTR "cv"), 1, 2, 2, 0, 0); t->ccV = tcost(t->cap, t->cV = jgetstr(t->cap,USTR "cV"), 1, 2, 2, 0, 0); t->ccm = tcost(t->cap, t->cm = jgetstr(t->cap,USTR "cm"), 1, 2, 2, 0, 0); t->cce = tcost(t->cap, t->ce = jgetstr(t->cap,USTR "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(); fprintf(stderr,"cm=%p ch=%p cv=%p ho=%p lf=%p DO=%p ll=%p up=%p UP=%p cr=%p\n", t->cm, t->ch, t->cv, t->ho, t->lf, t->DO, t->ll, t->up, t->UP, t->cr); fprintf(stderr,(char *)joe_gettext(_("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 { t->scroll = 0; 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; else t->insdel = 0; /* Adjust for high baud rates */ if (baud >= 38400) { t->scroll = 0; t->insdel = 0; } /* Send out terminal initialization 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); /* Initialize variable screen size dependant vars */ t->scrn = NULL; t->attr = NULL; t->sary = NULL; t->updtab = NULL; t->compose = NULL; t->ofst = NULL; t->ary = NULL; t->htab = (struct hentry *) joe_malloc(256 * sizeof(struct hentry)); nresize(t, t->co, t->li); /* Initialize mouse */ mouseopen(); 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 (t->sary) joe_free(t->sary); if (t->updtab) joe_free(t->updtab); if (t->scrn) joe_free(t->scrn); if (t->attr) joe_free(t->attr); if (t->compose) joe_free(t->compose); if (t->ofst) joe_free(t->ofst); if (t->ary) joe_free(t->ary); t->scrn = (int *) joe_malloc(t->li * t->co * sizeof(int)); t->attr = (int *) joe_malloc(t->li * t->co * sizeof(int)); t->sary = (int *) joe_calloc(t->li, sizeof(int)); t->updtab = (int *) joe_malloc(t->li * sizeof(int)); t->compose = (int *) joe_malloc(t->co * sizeof(int)); t->ofst = (int *) joe_malloc(t->co * sizeof(int)); t->ary = (struct hentry *) joe_malloc(t->co * sizeof(struct hentry)); 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) { 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; doch: 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; docv: 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; } } /* if (t->cRI < x - t->x) { */ /* } else { int *s = t->scrn + t->x + t->y * t->co; int *a = t->attr + t->x + t->y * t->co; if (t->ins) clrins(t); while (x > t->x) { int atr, c; if(*s==-1) c=' ', atr=0; else c= *s, atr= *a; if (atr != t->attrib) set_attr(t, atr); utf8_putc(c); ++s; ++a; ++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; 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; } 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); outatri(t, x + a, y, s[a], as[a]); 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); for (a = 0; a != n; ++a) outatri(t, x + a, y, s[a], as[a]); } } 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, (t->attrib & FG_MASK), n); } /* Insert/Delete within line */ /* FIXME: doesn't know about attr */ void magic(SCRN *t, int y, int *cs, int *ca,int *s, int *a, int placex) { struct 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 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; } } } } static void doupscrl(SCRN *t, int top, int bot, int amnt, int atr) { int a = amnt; if (!amnt) return; set_attr(t, atr); 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); 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); } 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 atr) { int a = amnt; if (!amnt) return; set_attr(t, atr); 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); 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); } 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 atr) { int y, z, q, r, p; for (y = 0; y != t->li; ++y) { q = t->sary[y]; if (ifhave) 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, atr); 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, atr); p = z + 1; } } while (p-- != y); y = r - 1; } } } msetI(t->sary, 0, t->li); } void npartial(SCRN *t) { set_attr(t, BG_COLOR(bg_text)); clrins(t); setregn(t, 0, t->li); } void nescape(SCRN *t) { mouseclose(); npartial(t); cpos(t, 0, t->li - 1); eraeol(t, 0, t->li - 1, 0); if (t->te) texec(t->cap, t->te, 1, 0, 0, 0, 0); } void nreturn(SCRN *t) { mouseopen(); 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) { mouseclose(); 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); joe_free(t->scrn); joe_free(t->attr); joe_free(t->sary); joe_free(t->ofst); joe_free(t->htab); joe_free(t->ary); joe_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]; } for (x = top; x != top + amnt; ++x) { t->updtab[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); } } 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]; } for (x = bot - amnt; x != bot; ++x) { t->updtab[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); } } void nredraw(SCRN *t) { dostaupd = 1; msetI(t->scrn, ' ', t->co * skiptop); msetI(t->attr, BG_COLOR(bg_text), t->co * skiptop); msetI(t->scrn + skiptop * t->co, -1, (t->li - skiptop) * t->co); msetI(t->attr + skiptop * t->co, BG_COLOR(bg_text), (t->li - skiptop) * t->co); msetI(t->sary, 0, t->li); msetI(t->updtab + 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, BG_COLOR(bg_text)); 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, BG_COLOR(bg_text), 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, BG_COLOR(bg_text), t->li * t->co); } } } /* Convert color/attribute name into internal code */ int meta_color_single(unsigned char *s) { if(!zcmp(s,USTR "inverse")) return INVERSE; else if(!zcmp(s,USTR "underline")) return UNDERLINE; else if(!zcmp(s,USTR "bold")) return BOLD; else if(!zcmp(s,USTR "blink")) return BLINK; else if(!zcmp(s,USTR "dim")) return DIM; /* ISO colors */ else if(!zcmp(s,USTR "white")) return FG_WHITE; else if(!zcmp(s,USTR "cyan")) return FG_CYAN; else if(!zcmp(s,USTR "magenta")) return FG_MAGENTA; else if(!zcmp(s,USTR "blue")) return FG_BLUE; else if(!zcmp(s,USTR "yellow")) return FG_YELLOW; else if(!zcmp(s,USTR "green")) return FG_GREEN; else if(!zcmp(s,USTR "red")) return FG_RED; else if(!zcmp(s,USTR "black")) return FG_BLACK; else if(!zcmp(s,USTR "bg_white")) return BG_WHITE; else if(!zcmp(s,USTR "bg_cyan")) return BG_CYAN; else if(!zcmp(s,USTR "bg_magenta")) return BG_MAGENTA; else if(!zcmp(s,USTR "bg_blue")) return BG_BLUE; else if(!zcmp(s,USTR "bg_yellow")) return BG_YELLOW; else if(!zcmp(s,USTR "bg_green")) return BG_GREEN; else if(!zcmp(s,USTR "bg_red")) return BG_RED; else if(!zcmp(s,USTR "bg_black")) return BG_BLACK; /* 16 color xterm support: codes 8 - 15 are brighter versions of above */ else if(!zcmp(s,USTR "WHITE")) return FG_BWHITE; else if(!zcmp(s,USTR "CYAN")) return FG_BCYAN; else if(!zcmp(s,USTR "MAGENTA")) return FG_BMAGENTA; else if(!zcmp(s,USTR "BLUE")) return FG_BBLUE; else if(!zcmp(s,USTR "YELLOW")) return FG_BYELLOW; else if(!zcmp(s,USTR "GREEN")) return FG_BGREEN; else if(!zcmp(s,USTR "RED")) return FG_BRED; else if(!zcmp(s,USTR "BLACK")) return FG_BBLACK; else if(!zcmp(s,USTR "bg_WHITE")) return BG_BWHITE; else if(!zcmp(s,USTR "bg_CYAN")) return BG_BCYAN; else if(!zcmp(s,USTR "bg_MAGENTA")) return BG_BMAGENTA; else if(!zcmp(s,USTR "bg_BLUE")) return BG_BBLUE; else if(!zcmp(s,USTR "bg_YELLOW")) return BG_BYELLOW; else if(!zcmp(s,USTR "bg_GREEN")) return BG_BGREEN; else if(!zcmp(s,USTR "bg_RED")) return BG_BRED; else if(!zcmp(s,USTR "bg_BLACK")) return BG_BBLACK; /* Look at the "256colres.pl" PERL script in the xterm source distribution to see how these work. */ /* 256 color xterm support: bg_RGB and fg_RGB, where R, G, and B range from 0 - 5 */ /* Codes 16 - 231 are a 6x6x6 color cube */ else if(s[0]=='f' && s[1]=='g' && s[2]=='_' && s[3]>='0' && s[3]<='5' && s[4]>='0' && s[4]<='5' && s[5]>='0' && s[5]<='5' && !s[6]) return FG_NOT_DEFAULT | ((16 + (s[3]-'0')*6*6 + (s[4]-'0')*6 + (s[5]-'0')) << FG_SHIFT); else if(s[0]=='b' && s[1]=='g' && s[2]=='_' && s[3]>='0' && s[3]<='5' && s[4]>='0' && s[4]<='5' && s[5]>='0' && s[5]<='5' && !s[6]) return BG_NOT_DEFAULT | ((16 + (s[3]-'0')*6*6 + (s[4]-'0')*6 + (s[5]-'0')) << BG_SHIFT); /* 256 color xterm support: shades of grey */ /* Codes 232 - 255 are shades of grey */ else if(s[0]=='f' && s[1]=='g' && s[2]=='_' && atoi((char *)(s+3)) >= 0 && atoi((char *)(s+3)) <= 23) return FG_NOT_DEFAULT | (232 + (atoi((char *)(s+3)) << FG_SHIFT)); else if(s[0]=='b' && s[1]=='g' && s[2]=='_' && atoi((char *)(s+3)) >= 0 && atoi((char *)(s+3)) <= 23) return BG_NOT_DEFAULT | (232 + (atoi((char *)(s+3)) << BG_SHIFT)); else return 0; } int meta_color(unsigned char *s) { int code = 0; while (*s) { unsigned char buf[32]; int x = 0; while (*s) if (*s && *s != '+') { if (x != sizeof(buf) - 1) buf[x++] = *s; ++s; } else break; if (*s == '+') ++s; buf[x] = 0; code |= meta_color_single(buf); } return code; } /* 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 * 'fmt' is array of attributes, one for each byte. OK if NULL. */ 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 (locale_map->type) { /* UTF-8 mode: decode character and determine its width */ c = utf8_decode(&sm,c); if (c >= 0) wid = joe_wcwidth(1,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(locale_map, t, scrn, attr, x, y, '>', my_atr); ++scrn; ++attr; ++x; } } else if(wid) { /* 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(locale_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(locale_map, t, scrn, attr, x, y, ' ', atr); ++x; ++scrn; ++attr; } /* Erase to end of line */ if (flg) eraeol(t, x, y, atr); } /* Width function for above */ int txtwidth(unsigned char *s,int len) { if (locale_map->type) { int col=0; struct utf8_sm sm; utf8_init(&sm); while(len--) { int d = utf8_decode(&sm,*s++); if (d >= 0) col += joe_wcwidth(1,d); } return col; } else return len; } int txtwidth1(struct charmap *map,int tabwidth,unsigned char *s,int len) { if (map->type) { int col=0; struct utf8_sm sm; utf8_init(&sm); while(len--) { int d = utf8_decode(&sm,*s++); if (d == '\t') { ++col; col += tabwidth - (col % tabwidth); } else if (d >= 0) col += joe_wcwidth(1,d); } return col; } else { int col = 0; while (len--) { if (*s++ == '\t') { ++col; col += tabwidth - (col % tabwidth); } else ++col; } return col; } } /* Generate text with formatting escape sequences */ void genfmt(SCRN *t, int x, int y, int ofst, unsigned char *s, int atr, int flg) { int *scrn = t->scrn + y * t->co + x; int *attr = t->attr + y * t->co + x; int col = 0; int c; struct utf8_sm sm; utf8_init(&sm); while ((c = *s++) != '\0') if (c == '\\') { switch (c = *s++) { case 'u': case 'U': atr ^= UNDERLINE; break; case 'i': case 'I': atr ^= INVERSE; break; case 'b': case 'B': atr ^= BOLD; break; case 'd': case 'D': atr ^= DIM; break; case 'f': case 'F': atr ^= BLINK; break; case 0: --s; break; case '@': c = 0; default: { if (col++ >= ofst) { outatr(locale_map, t, scrn, attr, x, y, (c&0x7F), atr); ++scrn; ++attr; ++x; } break; } } } else { int wid = -1; if (locale_map->type) { /* UTF-8 mode: decode character and determine its width */ c = utf8_decode(&sm,c); if (c >= 0) { wid = joe_wcwidth(1,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 (coltype) { c = utf8_decode(&sm,c); if (c>=0) wid = joe_wcwidth(1,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) && coltype) { c = utf8_decode(&sm,c); if (c>=0) wid = joe_wcwidth(1,c); } else { wid = 1; } col += wid; } } return s - org + goal - col; } joe-3.7/scrn.h0000644000100100007640000002373211100445357010177 00000000000000/* * Device independant tty interface for JOE * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_SCRN_H #define _JOE_SCRN_H 1 struct hentry { int next; int loc; }; /* Each terminal has one of these: terminal capability database */ #ifdef __MSDOS__ struct scrn { int li; /* Height of screen */ int co; /* Width of screen */ short *scrn; /* Buffer */ int scroll; int insdel; int *updtab; /* Lines which need to be updated */ HIGHLIGHT_STATE *syntax; int *compose; int *sary; }; #else struct scrn { CAP *cap; /* Termcap/Terminfo data */ int li; /* Screen height */ int co; /* Screen width */ unsigned char *ti; /* Initialization string */ unsigned char *cl; /* Home and clear screen... really an init. string */ unsigned char *cd; /* Clear to end of screen */ 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 */ unsigned char *so; /* Enter standout (inverse) mode */ unsigned char *se; /* Exit standout mode */ unsigned char *us; /* Enter underline mode */ unsigned char *ue; /* Exit underline mode */ unsigned char *uc; /* Single time underline character */ int ms; /* Ok to move when in standout/underline mode */ unsigned char *mb; /* Enter blinking mode */ unsigned char *md; /* Enter bold mode */ unsigned char *mh; /* Enter dim mode */ unsigned char *mr; /* Enter inverse mode */ unsigned char *me; /* Exit above modes */ unsigned char *Sb; /* Set background color */ unsigned char *Sf; /* Set foregrond color */ int Co; /* No. of colors */ int ut; /* Screen erases with background color */ int da, db; /* Extra lines exist above, below */ unsigned char *al, *dl, *AL, *DL; /* Insert/delete lines */ unsigned char *cs; /* Set scrolling region */ int rr; /* Set for scrolling region relative addressing */ unsigned char *sf, *SF, *sr, *SR; /* Scroll */ unsigned char *dm, *dc, *DC, *ed; /* Delete characters */ unsigned char *im, *ic, *IC, *ip, *ei; /* Insert characters */ int mi; /* Set if ok to move while in insert mode */ unsigned char *bs; /* Move cursor left 1 */ int cbs; unsigned char *lf; /* Move cursor down 1 */ int clf; unsigned char *up; /* Move cursor up 1 */ int cup; unsigned char *nd; /* Move cursor right 1 */ unsigned char *ta; /* Move cursor to next tab stop */ int cta; unsigned char *bt; /* Move cursor to previous tab stop */ int cbt; int tw; /* Tab width */ unsigned char *ho; /* Home cursor to upper left */ int cho; unsigned char *ll; /* Home cursor to lower left */ int cll; unsigned char *cr; /* Move cursor to left edge */ int ccr; unsigned char *RI; /* Move cursor right n */ int cRI; unsigned char *LE; /* Move cursor left n */ int cLE; unsigned char *UP; /* Move cursor up n */ int cUP; unsigned char *DO; /* Move cursor down n */ int cDO; unsigned char *ch; /* Set cursor column */ int cch; unsigned char *cv; /* Set cursor row */ int ccv; unsigned char *cV; /* Goto beginning of specified line */ int ccV; unsigned char *cm; /* Set cursor row and column */ int ccm; unsigned char *ce; /* Clear to end of line */ int cce; int assume_256; /* Assume terminal has 256 color mode, but use regular mode for standard colors just in case */ /* 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 avattr; /* Bits set for available attributes */ int *sary; /* Scroll buffer array */ int *compose; /* Line compose buffer */ int *ofst; /* stuff for magic */ struct hentry *htab; struct hentry *ary; }; #endif extern int skiptop; /* SCRN *nopen(void); * * Open the screen (sets TTY mode so that screen may be used immediatly after * the 'nopen'). */ SCRN *nopen PARAMS((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 PARAMS((SCRN *t, int w, int h)); /* void nredraw(SCRN *t); * * Invalidate all state variables for the terminal. This way, everything gets * redrawn. */ void nredraw PARAMS((SCRN *t)); void npartial PARAMS((SCRN *t)); void nescape PARAMS((SCRN *t)); void nreturn PARAMS((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 PARAMS((SCRN *t)); /* int cpos(SCRN *t,int x,int y); * * Set cursor position */ int cpos PARAMS((register SCRN *t, register int x, register int y)); /* int attr(SCRN *t,int a); * * Set attributes */ int set_attr PARAMS((SCRN *t, int c)); /* Encode character as utf8 */ void utf8_putc PARAMS((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 */ #ifdef __MSDOS__ #define INVERSE 1 #define UNDERLINE 2 #define BOLD 4 #define BLINK 8 #define DIM 16 extern unsigned atab[]; #define outatr(t,scrn,attr,x,y,c,a) do { \ (t); \ (x); \ (y); \ *(scrn) = ((unsigned)(c) | atab[a]); \ } while(0) #else #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 (255< int main() { int a = 0; isblank(a++); exit(a != 1); } ], [joe_cv_isblank=yes], [joe_cv_isblank=no], [joe_cv_isblank=no]) ]) if test "$joe_cv_isblank" = yes; then AC_DEFINE([HAVE_WORKING_ISBLANK], 1, [Define if isblank() works with expressions with side effects]) fi ]) 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 ]) joe-3.7/usearch.c0000644000100100007640000006374111103376217010664 00000000000000/* * Search & Replace system * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.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 */ int pico = 0; /* Pico search prompting */ B *findhist = NULL; /* Search string history */ B *replhist = NULL; /* Replacement string history */ SRCH *globalsrch = NULL; /* Most recent completed search data */ SRCHREC fsr = { {&fsr, &fsr} }; /* Completion stuff: should go somewhere else */ unsigned char **word_list; #define MAX_WORD_SIZE 64 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, USTR "get_word_list"); idx = 0; while ((c=pgetc(p))!=NO_MORE_DATA) if (idx) { if (joe_isalnum_(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_isalpha_(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) list = vaadd(list, t->name); if (list) vasort(list,sLEN(list)); htrm(h); return list; } void fcmplt_ins(BW *bw, unsigned char *line) { P *p = pdup(bw->cursor, USTR "fcmplt_ins"); int c; if (!piseol(bw->cursor)) { int c = brch(bw->cursor); if (joe_isalnum_(bw->b->o.charmap,c)) return; } /* Move p to beginning of word */ p = pdup(bw->cursor, USTR "fcmplt_ins"); do c = prgetc(p); while (joe_isalnum_(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); } } int fcmplt_abrt(BW *bw, int x, unsigned char *line) { if (line) { fcmplt_ins(bw, line); vsrm(line); } return -1; } int fcmplt_rtn(MENU *m, int x, unsigned char *line) { fcmplt_ins(m->parent->win->object, 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)) { int c = brch(bw->cursor); if (joe_isalnum_(bw->b->o.charmap,c)) return -1; } /* Move p to beginning of word */ p = pdup(bw->cursor, USTR "ufinish"); do c = prgetc(p); while (joe_isalnum_(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, 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) { if (word_list) varm(word_list); word_list = get_word_list(((BW *)bw->parent->win->object)->b, -1); if (!word_list) { ttputc(7); return 0; } return simple_cmplt(bw,word_list); } /* 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; P *start; P *end; int x; pattern = srch->pattern; start = pdup(p, USTR "searchf"); end = pdup(p, USTR "searchf"); try_again: for (x = 0; x != sLEN(pattern) && pattern[x] != '\\' && (pattern[x]<128 || !p->b->o.charmap->type); ++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)) { if (end->byte == srch->last_repl) { /* Stuck? */ pattern = srch->pattern; pset(start, p); if (pgetc(start) == NO_MORE_DATA) break; pset(end, start); goto try_again; } else { 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 (srch->allow_wrap && !srch->wrap_flag && srch->wrap_p) { msgnw(bw->parent, joe_gettext(_("Wrapped"))); srch->wrap_flag = 1; p_goto_bof(start); goto wrapped; } srch->last_repl = -1; 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, USTR "searchb"); end = pdup(p, USTR "searchb"); try_again: for (x = 0; x != sLEN(pattern) && pattern[x] != '\\' && (pattern[x]<128 || !p->b->o.charmap->type); ++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)) { if (start->byte == srch->last_repl) { /* Stuck? */ pattern = srch->pattern; pset(start, p); if (prgetc(start) == NO_MORE_DATA) break; pset(end, start); goto try_again; } else { 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 (srch->allow_wrap && !srch->wrap_flag && srch->wrap_p) { msgnw(bw->parent, joe_gettext(_("Wrapped"))); srch->wrap_flag = 1; p_goto_eof(start); goto wrapped; } srch->last_repl = -1; 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, int all) { SRCH *srch = (SRCH *) joe_malloc(sizeof(SRCH)); int x; srch->first = NULL; srch->current = NULL; srch->all = all; 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->last_repl = -1; srch->markb = NULL; srch->markk = NULL; srch->wrap_p = NULL; srch->allow_wrap = wrap; 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); joe_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; long starting = p->byte; 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] >= 'a' && s[1] <= 'z') || (s[1] >= 'A' && s[1] <= '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(p->b->o.charmap->type,&a,&l)); pgetc(p); len -= a - (unsigned char *)s; s = a; } } else len = 0; } if (srch->backwards) pbkwd (p, p->byte - starting); return p; } /* Search system user interface */ /* Query for search string, search options, possible replacement string, * and execute first search */ unsigned char srchstr[] = "Search"; /* Context sensitive help identifier */ unsigned char srchopt[] = "SearchOptions"; static int pfabort(BW *bw, SRCH *srch) { if (srch) rmsrch(srch); return -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) { if (sLEN(s) || !globalsrch || !pico) srch->replacement = s; else { /* Use previous string: this prevents replace with empty string */ /* vsrm(s); srch->replacement = vsdup(globalsrch->replacement); */ srch->replacement = s; } return dopfnext(bw, setmark(srch), notify); } /* Option characters */ unsigned char *all_key = (unsigned char *) _("|all files|aA"); unsigned char *list_key = (unsigned char *) _("|error list files|eE"); unsigned char *replace_key = (unsigned char *) _("|search and replace|rR"); unsigned char *backwards_key = (unsigned char *) _("|backwards|bB"); unsigned char *ignore_key = (unsigned char *) _("|ignore case|iI"); unsigned char *block_key = (unsigned char *) _("|restrict to highlighted block|kK"); unsigned char *noignore_key = (unsigned char *) _("|don't ignore case|sS"); unsigned char *wrap_key = (unsigned char *) _("|wrap|wW"); unsigned char *nowrap_key = (unsigned char *) _("|don't wrap|nN"); /* Get next character from string and advance it, locale dependent */ int fwrd_c(unsigned char **s) { if (locale_map->type) return utf8_decode_fwrd(s, NULL); else { int c = **s; *s = *s + 1; return c; } } static int set_options(BW *bw, unsigned char *s, SRCH *srch, int *notify) { unsigned char buf[80]; unsigned char *t; srch->ignore = icase; t = s; while (*t) { int c = fwrd_c(&t); if (yncheck(all_key, c)) srch->all = 1; else if (yncheck(list_key, c)) srch->all = 2; else if (yncheck(replace_key, c)) srch->replace = 1; else if (yncheck(backwards_key, c)) srch->backwards = 1; else if (yncheck(ignore_key, c)) srch->ignore = 1; else if (yncheck(noignore_key, c)) srch->ignore = 0; else if (yncheck(wrap_key, c)) srch->allow_wrap = 1; else if (yncheck(nowrap_key, c)) srch->allow_wrap = 0; else if (yncheck(block_key, c)) srch->block_restrict = 1; else if (c >= '0' && c <= '9') { if (srch->repeat == -1) srch->repeat = 0; srch->repeat = srch->repeat * 10 + c - '0'; } } vsrm(s); if (srch->replace) { /* if (pico && globalsrch && globalsrch->replacement) { joe_snprintf_1(bf1,30,"%s",globalsrch->replacement); if (zlen(globalsrch->replacement)>29) zcat(bf1,USTR "$"); joe_snprintf_1(buf,sizeof(buf),joe_gettext(_("Replace with (^C to abort) [%s]: ")),bf1); } else */ zcpy(buf, joe_gettext(_("Replace with (^C to abort): "))); if (wmkpw(bw->parent, buf, &replhist, set_replace, srchstr, pfabort, srch_cmplt, srch, notify, bw->b->o.charmap, 0)) return 0; else return -1; } else return dopfnext(bw, setmark(srch), notify); } static int set_pattern(BW *bw, unsigned char *s, SRCH *srch, int *notify) { BW *pbw; unsigned char *p; if (icase) p = joe_gettext(_("case (S)ensitive (R)eplace (B)ackwards Bloc(K) (A)ll files NNN (^C to abort): ")); else p = joe_gettext(_("(I)gnore (R)eplace (B)ackwards Bloc(K) (A)ll files NNN (^C to abort): ")); vsrm(srch->pattern); if (sLEN(s) || !globalsrch || !pico) srch->pattern = s; else { vsrm(s); srch->pattern = vsdup(globalsrch->pattern); } if ((pbw = wmkpw(bw->parent, p, NULL, set_options, srchopt, pfabort, utypebw, srch, notify, bw->b->o.charmap, 0)) != NULL) { unsigned char buf[10]; if (srch->ignore) { unsigned char *t = joe_gettext(ignore_key); binsc(pbw->cursor, fwrd_c(&t)); } if (srch->replace) { unsigned char *t = joe_gettext(replace_key); binsc(pbw->cursor, fwrd_c(&t)); } if (srch->backwards) { unsigned char *t = joe_gettext(backwards_key); binsc(pbw->cursor, fwrd_c(&t)); } if (srch->repeat >= 0) joe_snprintf_1(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; } } /* Unescape for text going to genfmt */ void unesc_genfmt(unsigned char *d, unsigned char *s, int len,int max) { while (max > 0 && len) { if (!*s) { *d++ = '\\'; *d++ = '@'; ++s; } else { if (*s == '\\') { *d++ = '\\'; --max; } *d++ = *s++; } --len; --max; } if (len) *d++ = '$'; *d = 0; } int dofirst(BW *bw, int back, int repl, unsigned char *hint) { SRCH *srch; BW *pbw; unsigned char bf1[80]; unsigned char buf[80]; if (smode && globalsrch) { globalsrch->backwards = back; globalsrch->replace = repl; return pfnext(bw); } if (bw->parent->huh == srchstr) { long byte; p_goto_eol(bw->cursor); byte = bw->cursor->byte; p_goto_bol(bw->cursor); if (byte == bw->cursor->byte) prgetc(bw->cursor); return urtn((BASE *)bw, -1); } srch = mksrch(NULL, NULL, 0, back, -1, repl, 0, 0); srch->addr = bw->cursor->byte; srch->wrap_p = pdup(bw->cursor, USTR "dofirst"); srch->wrap_p->owner = &srch->wrap_p; if (pico && globalsrch && globalsrch->pattern) { unesc_genfmt(bf1, sv(globalsrch->pattern), 30); joe_snprintf_1(buf,sizeof(buf),joe_gettext(_("Find (^C to abort) [%s]: ")),bf1); } else zcpy(buf, joe_gettext(_("Find (^C to abort): "))); if ((pbw=wmkpw(bw->parent, buf, &findhist, set_pattern, srchstr, pfabort, srch_cmplt, srch, NULL, bw->b->o.charmap, 0))) { if (hint) { binss(pbw->cursor, hint); pset(pbw->cursor, pbw->b->eof); pbw->cursor->xcol = piscol(pbw->cursor); } return 0; } else { rmsrch(srch); return -1; } } int pffirst(BW *bw) { return dofirst(bw, 0, 0, NULL); } int prfirst(BW *bw) { return dofirst(bw, 1, 0, NULL); } int pqrepl(BW *bw) { return dofirst(bw, 0, 1, NULL); } /* Execute next search */ static int doreplace(BW *bw, SRCH *srch) { P *q; if (!modify_logic(bw,bw->b)) return -1; if (markk) markk->end = 1; if (srch->markk) srch->markk->end = 1; q = pdup(bw->cursor, USTR "doreplace"); 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; srch->last_repl = 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; r->last_repl = srch->last_repl; r->b = bw->b; enqueb(SRCHREC, link, &srch->recs, r); } static void goback(SRCH *srch, BW *bw) { SRCHREC *r = srch->recs.link.prev; if (r != &srch->recs) { srch->current = r->b; if (r->yn) { uundo(bw); } if (r->b != bw->b) { W *w = bw->parent; get_buffer_in_window(bw, r->b); bw = (BW *)w->object; } if (bw->cursor->byte != r->addr) pgoto(bw->cursor, r->addr); srch->wrap_flag = r->wrap_flag; srch->last_repl = r->last_repl; demote(SRCHREC, link, &fsr, r); } } unsigned char *rest_key = (unsigned char *) _("|rest of file|rR"); unsigned char *backup_key = (unsigned char *) _("|backup|bB"); static int dopfrepl(BW *bw, int c, SRCH *srch, int *notify) { srch->addr = bw->cursor->byte; /* Backspace means no for jmacs */ if (c == NO_CODE || c == 8 || c == 127 || yncheck(no_key, c)) return dopfnext(bw, srch, notify); else if (c == YES_CODE || yncheck(yes_key, c) || c == ' ') { srch->recs.link.prev->yn = 1; if (doreplace(bw, srch)) { pfsave(bw, srch); return -1; } else return dopfnext(bw, srch, notify); } else if (yncheck(rest_key, c) || c == '!') { if (doreplace(bw, srch)) return -1; srch->rest = 1; return dopfnext(bw, srch, notify); } else if (/* c == 8 || c == 127 || */ yncheck(backup_key, c)) { W *w = bw->parent; goback(srch, bw); goback(srch, (BW *)w->object); return dopfnext((BW *)w->object, srch, notify); } else if (c != -1) { if (notify) *notify = 1; pfsave(bw, srch); nungetc(c); return 0; } if (mkqwnsr(bw->parent, sz(joe_gettext(_("Replace (Y)es (N)o (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->valid || !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. * 3) Abort due to infinite loop */ static int fnext(BW *bw, SRCH *srch) { P *sta; if (!srch->first) { srch->first = bw->b; srch->current = bw->b; } 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->all) { B *b; if (srch->all == 2) b = beafter(srch->current); else { berror = 0; b = bafter(srch->current); } if (b && b != srch->first && !berror) { W *w = bw->parent; srch->current = b; /* this bumps reference count of b */ get_buffer_in_window(bw, b); bw = (BW *)w->object; p_goto_bof(bw->cursor); goto again; } else if (berror) { msgnw(bw->parent, joe_gettext(msgs[-berror])); } } if (!sta) { srch->repeat = -1; return 1; } 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) { W *w; int fnr; 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: w = bw->parent; fnr = fnext(bw, srch); bw = (BW *)w->object; switch (fnr) { case 0: break; case 1: bye: if (!srch->flg && !srch->rest) { if (srch->valid && srch->block_restrict) msgnw(bw->parent, joe_gettext(_("Not found (search restricted to marked block)"))); else msgnw(bw->parent, joe_gettext(_("Not found"))); ret = -1; } break; case 3: msgnw(bw->parent, joe_gettext(_("Infinite loop aborted: your search repeatedly matched same place"))); 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, USTR "dopfnext"); markb->xcol = piscol(markb); pdupown(markb, &markk, USTR "dopfnext"); pfwrd(markk, (long) sLEN(srch->entire)); markk->xcol = piscol(markk); } else { pdupown(bw->cursor, &markk, USTR "dopfnext"); markk->xcol = piscol(markk); pdupown(bw->cursor, &markb, USTR "dopfnext"); 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) { if (!globalsrch) { /* Query for search string if there isn't any */ return pffirst(bw); } else { SRCH *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, USTR "pfnext"); srch->wrap_p->owner = &srch->wrap_p; srch->wrap_flag = 0; } return dopfnext(bw, setmark(srch), NULL); } } void save_srch(FILE *f) { if(globalsrch) { if(globalsrch->pattern) { fprintf(f," pattern "); emit_string(f,globalsrch->pattern,sLEN(globalsrch->pattern)); fprintf(f,"\n"); } if(globalsrch->replacement) { fprintf(f," replacement "); emit_string(f,globalsrch->replacement,sLEN(globalsrch->replacement)); fprintf(f,"\n"); } fprintf(f," backwards %d\n",globalsrch->backwards); fprintf(f," ignore %d\n",globalsrch->ignore); fprintf(f," replace %d\n",globalsrch->replace); fprintf(f," block_restrict %d\n",globalsrch->block_restrict); } fprintf(f,"done\n"); } void load_srch(FILE *f) { unsigned char buf[1024]; unsigned char bf[1024]; unsigned char *pattern = 0; unsigned char *replacement = 0; int backwards = 0; int ignore = 0; int replace = 0; int block_restrict = 0; while(fgets((char *)buf,1023,f) && zcmp(buf,USTR "done\n")) { unsigned char *p=buf; parse_ws(&p,'#'); if(!parse_kw(&p,USTR "pattern")) { int len; parse_ws(&p,'#'); bf[0] = 0; len = parse_string(&p,bf,sizeof(bf)); if (len>0) pattern = vsncpy(NULL,0,bf,len); } else if(!parse_kw(&p,USTR "replacement")) { int len; parse_ws(&p,'#'); bf[0] = 0; len = parse_string(&p,bf,sizeof(bf)); if (len>0) replacement = vsncpy(NULL,0,bf,len); } else if(!parse_kw(&p,USTR "backwards")) { parse_ws(&p,'#'); parse_int(&p,&backwards); } else if(!parse_kw(&p,USTR "ignore")) { parse_ws(&p,'#'); parse_int(&p,&ignore); } else if(!parse_kw(&p,USTR "replace")) { parse_ws(&p,'#'); parse_int(&p,&replace); } else if(!parse_kw(&p,USTR "block_restrict")) { parse_ws(&p,'#'); parse_int(&p,&block_restrict); } } globalsrch = mksrch(pattern,replacement,ignore,backwards,-1,replace,0,0); globalsrch->block_restrict = block_restrict; } joe-3.7/usearch.h0000644000100100007640000000470210440704110010647 00000000000000/* * Search & Replace system * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #ifndef _JOE_USEARCH_H #define _JOE_USEARCH_H 1 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 */ B *b; /* Buffer address is in */ long last_repl; }; 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]; /* Peices 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 allow_wrap; /* Set to allow wrapping */ int valid; /* Set if original marks are a valid block */ long addr; /* Where to place cursor after failed restruct_to_block() test */ long last_repl; /* Address of last replacement (prevents infinite loops) */ int block_restrict; /* Search restricted to marked block */ int all; /* Set to continue in other windows */ B *first; /* Starting buffer */ B *current; /* Current buffer */ }; SRCH *mksrch PARAMS((unsigned char *pattern, unsigned char *replacement, int ignore, int backwards, int repeat, int replace, int rest, int all)); void rmsrch PARAMS((SRCH *srch)); int dopfnext PARAMS((BW *bw, SRCH *srch, int *notify)); int pffirst PARAMS((BW *bw)); int pfnext PARAMS((BW *bw)); int pqrepl PARAMS((BW *bw)); int prfirst PARAMS((BW *bw)); int ufinish PARAMS((BW *bw)); int dofirst PARAMS((BW *bw, int back, int repl, unsigned char *hint)); extern B *findhist; /* Search history buffer */ extern B *replhist; /* Replace history buffer */ void save_srch PARAMS((FILE *f)); void load_srch PARAMS((FILE *f)); extern int smode; extern int csmode; extern int icase; extern int wrap; extern int pico; extern unsigned char srchstr[]; extern SRCH *globalsrch; extern unsigned char *rest_key; extern unsigned char *backup_key; int fwrd_c PARAMS((unsigned char **s)); #endif joe-3.7/termcap.c0000644000100100007640000003411010457436257010665 00000000000000/* * TERMCAP/TERMINFO database interface * Copyright * (C) 1992 Joseph H. Allen * * This file is part of JOE (Joe's Own Editor) */ #include "types.h" #ifdef TERMINFO #ifdef HAVE_CURSES_H #include #endif /* curses has to come before term.h on SGI */ #ifdef HAVE_TERM_H /* term.h is a disaster: it #defines 'tab' */ #include #endif #endif int dopadding = 0; unsigned char *joeterm = NULL; /* Default termcap entry */ 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(unsigned char *s, 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, 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') /* do 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') /* do nothing */; else { s = vsset(s, x, c); ++x; } s = vstrunc(s, x); return s; } /* Lookup termcap entry in index */ static long findidx(FILE *file, unsigned char *name) { unsigned char buf[80]; long addr = 0; while (fgets((char *)buf, 80, file)) { int x = 0, flg = 0, c, y, z; do { for (y = x; buf[y] && buf[y] != ' ' && buf[y] != '\n'; ++y) ; c = buf[y]; buf[y] = 0; if (c == '\n' || !c) { z = 0; sscanf((char *)(buf + x), "%x", (unsigned *)&z); addr += z; } else if (!zcmp(buf + x, name)) flg = 1; x = y + 1; } while (c && c != '\n'); if (flg) return addr; } return 0; } /* Load termcap entry */ CAP *my_getcap(unsigned char *name, unsigned int baud, void (*out) (unsigned char *, unsigned char), void *outptr) { CAP *cap; FILE *f, *f1; long 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 = (CAP *) joe_malloc(sizeof(CAP)); cap->tbuf = vsmk(4096); cap->abuf = NULL; cap->sort = NULL; #ifdef TERMINFO cap->abuf = (unsigned char *) joe_malloc(4096); cap->abufp = cap->abuf; if (tgetent((char *)cap->tbuf, (char *)name) == 1) return setcap(cap, baud, out, outptr); else { joe_free(cap->abuf); cap->abuf = NULL; } #endif name = vsncpy(NULL, 0, sz(name)); cap->sort = (struct sortentry *) joe_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 ")); namebuf = vsncpy(sv(namebuf), sc(JOERC)); namebuf = vsncpy(sv(namebuf), sc("termcap /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]) { /* varm(npbuf); vsrm(name); vsrm(cap->tbuf); joe_free(cap->sort); joe_free(cap); return 0; */ fprintf(stderr, (char *)joe_gettext(_("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; fstat(fileno(f), &buf); fstat(fileno(f1), &buf1); if (buf.st_mtime > buf1.st_mtime) idx = findidx(f, name); else fprintf(stderr, (char *)joe_gettext(_("%s is out of date\n")), idxname); fclose(f); } vsrm(idxname); fseek(f1, idx, 0); 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] != ':') /* do 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) { z = 0; goto in; } while (z != (x + y) / 2) { int found; z = (x + y) / 2; found = zcmp(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 = (struct sortentry *) joe_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, USTR "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, outptr); } static struct sortentry *findcap(CAP *cap, 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 = zcmp(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, void (*out) (unsigned char *, unsigned char), void *outptr) { cap->baud = baud; cap->div = 100000 / baud; cap->out = out; cap->outptr = outptr; return cap; } int getflag(CAP *cap, unsigned char *name) { #ifdef TERMINFO if (cap->abuf) return tgetflag((char *)name); #endif return findcap(cap, name) != NULL; } unsigned char *jgetstr(CAP *cap, unsigned char *name) { struct sortentry *s; #ifdef TERMINFO if (cap->abuf) { char *new_ptr = (char *)cap->abufp; char *rtn; rtn = tgetstr((char *)name, &new_ptr); cap->abufp = (unsigned char *)new_ptr; return (unsigned char *)rtn; } #endif s = findcap(cap, name); if (s) return s->value; else return NULL; } int getnum(CAP *cap, unsigned char *name) { struct sortentry *s; #ifdef TERMINFO if (cap->abuf) return tgetnum((char *)name); #endif s = findcap(cap, name); if (s && s->value) return atoi((char *)(s->value)); return -1; } void rmcap(CAP *cap) { vsrm(cap->tbuf); if (cap->abuf) joe_free(cap->abuf); if (cap->sort) joe_free(cap->sort); joe_free(cap); } static unsigned char escape1(unsigned char **s) { unsigned char c = *(*s)++; 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': c -= '0'; if (**s >= '0' && **s <= '7') c = (c << 3) + *((*s)++) - '0'; if (**s >= '0' && **s <= '7') c = (c << 3) + *((*s)++) - '0'; return c; 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; } static CAP *outcap; static int outout(int c) { outcap->out(outcap->outptr, c); return(c); /* act like putchar() - return written char */ } void texec(CAP *cap, unsigned char *s, int l, int a0, int a1, int a2, int a3) { int c, tenth = 0, x; int args[4]; int vars[128]; int *a = args; /* Do nothing if there is no string */ if (!s) return; #ifdef TERMINFO if (cap->abuf) { unsigned char *a; outcap = cap; a = (unsigned char *)tgoto((char *)s, a1, a0); tputs((char *)a, l, outout); 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 = escape1(&s)) { case 'C': if (x >= 96) { cap->out(cap->outptr, x / 96); x %= 96; } case '+': if (*s) x += escape1(&s); case '.': cap->out(cap->outptr, x); ++a; break; case 'd': if (x < 10) goto one; case '2': if (x < 100) goto two; case '3': c = '0'; while (x >= 100) { ++c; x -= 100; } cap->out(cap->outptr, c); two:c = '0'; while (x >= 10) { ++c; x -= 10; } cap->out(cap->outptr, c); one:cap->out(cap->outptr, '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': a[0] = vars[x]; break; case 's': 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] > escape1(&s)) a[0] += escape1(&s); else escape1(&s); default: cap->out(cap->outptr, '%'); cap->out(cap->outptr, c); } } else { --s; cap->out(cap->outptr, escape1(&s)); } /* Output padding characters */ if (cap->dopadding) { if (cap->pad) while (tenth >= cap->div) for (s = cap->pad; *s; ++s) { cap->out(cap->outptr, *s); tenth -= cap->div; } else while (tenth >= cap->div) { cap->out(cap->outptr, 0); tenth -= cap->div; } } } static int total; static void cst(unsigned char *ptr, unsigned char c) { ++total; } int tcost(CAP *cap, unsigned char *s, int l, int a0, int a1, int a2, int a3) { void (*out) (unsigned char *, unsigned char) = 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 void cpl(unsigned char *ptr, unsigned char c) { ssp = vsadd(ssp, c); } unsigned char *tcompile(CAP *cap, unsigned char *s, int a0, int a1, int a2, int a3) { void (*out) (unsigned char *, unsigned char) = cap->out; int div = 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 = div; return ssp; } /* Old termcap compatibility (not to be used when TERMINFO is set) */ #ifdef junk short ospeed; /* Output speed */ unsigned char PC, *UP, *BC; /* Unused */ static CAP *latest; /* CAP entry to use */ static void stupid(ptr, c) void (*ptr) (); unsigned char c; { ptr(c); } int tgetent(buf, name) unsigned char *buf, *name; { latest = my_getcap(name, 9600, stupid, NULL); if (latest) return 1; else return -1; } int tgetflag(name) unsigned char *name; { return getflag(latest, name); } int tgetnum(name) unsigned char *name; { return getnum(latest, name); } unsigned char *tgetstr(name) unsigned char *name; { return jgetstr(latest, name); } static int latestx, latesty; unsigned char *tgoto(str, x, y) unsigned char *str; int x, y; { latestx = x; latesty = y; return str; } void tputs(str, l, out) unsigned char *str; int l; void (*out) (); { latest->outptr = (void *) out; if (latest->baud != ospeed) { latest->baud = ospeed; latest->div = 100000 / ospeed; } texec(latest, str, l, latesty, latestx); } #endif joe-3.7/syntax/0000777000100100007640000000000011103454344010463 500000000000000joe-3.7/syntax/troff.jsf0000644000100100007640000000172611103410700012215 00000000000000# Syntax file for Troff =Idle =Comment green =Escape magenta =Command bold =Bad red # First character of line :first Idle * rest noeat ".'" command_1 :rest Idle * rest "\n" first "\\" escape recolor=-1 :command_1 Command * rest noeat " " command_1 "a-zA-Z_" command_2 :command_2 Command * rest "a-zA-Z0-9_" command_done recolor=-1 :command_done Command * rest noeat :escape Escape * bad recolor=-2 "-\\e'`. 0|^&!%acdprtu{}" rest "*fgn" name "k" reg "z" reg "(" name2 "$s" num "bCDhHlLNoSvwxX" str "\n" first "\"" comment recolor=-2 # A name: ( means two characters :name Escape * rest "(" name2 # Two character name :name2 Escape * reg # One character name :reg Escape * rest # String :str Escape * bad recolor=-1 "'" str_body :str_body Escape * str_body "\n" first "'" rest # Number :num Escape * rest noeat "-+0-9" num :comment Comment * comment "\n" first :bad Bad * rest noeat joe-3.7/syntax/perl.jsf.in0000644000100100007640000001466711101143033012454 00000000000000# JOE syntax highlight file for Perl # Define colors =Idle =Preproc blue =Comment green =POD green =Constant cyan =Escape bold cyan =Type bold =Keyword bold =Bad bold red =Var yellow :begin Idle * begin noeat call=.perl() # # Perl as a subroutine for Mason # .subr perl # Detect pod :idle Idle * idle1 noeat .ifdef mason_line "\n" idle return .else "\n" idle .endif "=" pod_start # allow keywords :idle1 Idle * idle1 "#" line_comment_i recolor=-1 "\n" idle noeat "0" first_digit recolor=-1 "1-9" decimal recolor=-1 "." maybe_float "\"" string recolor=-1 "'" char recolor=-1 "`" backtick recolor=-1 "<" maybe_inc "$" not_string buffer .ifdef mason_block "&%" perl_maybe_done buffer "-a-zA-Z_@" ident buffer .else "/" regex recolor=-1 "-a-zA-Z_@%&" ident buffer .endif :perl_maybe_done Idle * ident noeat ">" idle1 recolor=-2 return # prevent keywords :rest Idle * rest "({;~" idle1 "#" line_comment recolor=-1 "\n" idle noeat "0" first_digit recolor=-1 "1-9" decimal recolor=-1 "." maybe_float "\"" string recolor=-1 "'" char recolor=-1 "`" backtick recolor=-1 "$" not_string buffer "<" maybe_inc .ifdef mason_block "&%" perl_maybe_done buffer "a-zA-Z_@" maybe_string buffer .else "a-zA-Z_@%&" maybe_string buffer .endif :pod_start Idle * pod_start "\n" pod_block :pod_block POD * pod_block "=" pod_ident buffer :pod_ident POD * pod_block noeat strings "=cut" rest done "a-zA-Z0-9_" pod_ident :maybe_inc Idle * rest noeat .ifdef mason_block "/" perl_maybe_done_2 .endif "<" maybe_inc1 :perl_maybe_done_2 Idle * perl_idle noeat "a-z" perl_maybe_done_2 ">" idle :maybe_inc1 Idle * rest noeat " " maybe_inc1 "'\"" quoted_inc_start save_c recolor=-1 "A-Za-z_" inc buffer noeat :quoted_inc_start Var * quoted_inc buffer :quoted_inc Var * quoted_inc & skipline save_s :inc Var * skipline save_s noeat "A-Za-z0-9_" inc # Should be treated as a normal line here... :skipline Idle * skipline "\n" next_line :todelim Constant * todelim "\n" next_line strings "&" founddelim done # eat \n so it's not in string. :next_line Constant * todelim buffer "\n" next_line :founddelim Var * idle noeat :regex Constant * regex "\\" regex_quote recolor=-1 "/" rest :regex_quote Escape * regex :not_string Idle * rest noeat "A-Za-z_" ident "\"'`#" rest :line_comment Comment * line_comment "\n" rest :line_comment_i Comment * line_comment_i "\n" idle noeat :end_of_file_comment Comment * end_of_file_comment :first_digit Constant * rest noeat "x" hex "b" binary "." float "eE" epart "0-7" octal "89" bad_number recolor=-1 :bad_number Bad * rest noeat "0-9" bad_number :octal Constant * rest noeat "0-7_" octal "89" bad_number recolor=-1 :binary Constant * rest noeat "01_" binary "2-9" bad_number recolor=-1 :hex Constant * rest noeat "0-9A-Fa-f_" hex :decimal Constant * rest noeat "0-9_" decimal "eE" epart "." float :maybe_float Constant * rest recolor=-2 noeat "0-9" float recolor=-2 :float Constant * rest noeat "eE" epart "0-9_" float :epart Constant * rest noeat "0-9+\-" enum :enum Constant * rest noeat "0-9_" enum :string Constant * string "\"" rest "\\" string_escape recolor=-1 "$@" string_subst recolor=-1 :string_subst Escape * string noeat recolor=-1 "a-zA-Z_0-9" string_subst :string_escape Escape * string "x" string_hex1 "c" string_ctrl "N" string_named "0-7" string_octal2 "\n" string recolor=-2 :string_named Escape * string "{" string_named_rest :string_named_rest Escape * string_named_rest "}" string :string_ctrl Escape * string :string_hex1 Escape * string noeat "{" string_unicode "0-9a-fA-F" string_hex2 :string_unicode Escape * string_unicode "}" string :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 :char Constant * char "\n" idle noeat "'" rest "\\" char_escape recolor=-1 :char_escape Escape * char recolor=-2 "\\'" char :backtick Constant * backtick "`" rest "\\" backtick_escape recolor=-1 "$@" backtick_subst recolor=-1 :backtick_subst Escape * backtick noeat recolor=-1 "a-zA-Z_0-9" backtick_subst :backtick_escape Escape * backtick "x" backtick_hex1 "c" backtick_ctrl "N" backtick_named "0-7" backtick_octal2 "\n" backtick recolor=-2 :backtick_named Escape * backtick "{" backtick_named_rest :backtick_named_rest Escape * backtick_named_rest "}" backtick :backtick_ctrl Escape * backtick :backtick_hex1 Escape * backtick noeat "{" backtick_unicode "0-9a-fA-F" backtick_hex2 :backtick_unicode Escape * backtick_unicode "}" backtick :backtick_hex2 Escape * backtick noeat "0-9a-fA-F" backtick :backtick_octal2 Escape * backtick noeat "0-7" backtick_octal3 :backtick_octal3 Escape * backtick noeat "0-7" backtick :ident Idle * rest noeat strings "BEGIN" kw "END" kw "if" kw "unless" kw "while" kw "until" kw "foreach" kw "sub" kw "my" kw "do" kw "if" kw "else" kw "elsif" kw "for" kw "continue" kw "last" kw "print" kw "reset" kw "die" kw "goto" kw "require" kw "use" kw "eval" kw "redo" kw "next" kw "warn" kw "return" kw "printf" kw "close" kw "package" kw "m" match "qr" match "qq" match "qx" match "qw" match "q" match "s" subst "tr" subst "y" subst "__END__" end_of_file_comment "__DATA__" end_of_file_comment done "a-zA-Z0-9_" ident :maybe_string Idle * rest noeat strings "qr" match "qq" match "qx" match "qw" match "q" match done "a-zA-Z0-9_" maybe_string :type Type * rest noeat :kw Keyword * rest noeat :match Idle * inmatch save_c recolor=-1 " " match :inmatch Constant * inmatch & rest "\\" inmatch_quote recolor=-1 :inmatch_quote Escape * inmatch :subst Idle * insubst save_c recolor=-1 "<([{`" delim_insubst save_c recolor=-1 " " subst :insubst Constant * insubst & inrepl "\\" insubst_quote recolor=-1 :insubst_quote Escape * insubst :inrepl Constant * inrepl & rest "\\" inrepl_quote :inrepl_quote Escape * inrepl :delim_insubst Constant * delim_insubst & delim_repl "\\" delim_quote :delim_quote Escape * delim_insubst :delim_repl Constant * repl save_c recolor=-1 " " delim_repl :repl Constant * repl & rest "\\" repl_quote :repl_quote Escape * repl .end joe-3.7/syntax/sml.jsf.in0000644000100100007640000001754410172325175012322 00000000000000# JOE syntax highlight file for SML # A (deterministic) state machine which performs lexical analysis of SML. # (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: [