diff --git a/cmd/bpage.cmd b/cmd/bpage.cmd index 0802dc3..8ecc269 100644 --- a/cmd/bpage.cmd +++ b/cmd/bpage.cmd @@ -13,44 +13,37 @@ store-procedure clean delete-buffer "[b-change-line]" delete-buffer "[b-del-block]" delete-buffer "[b-draw-box]" - delete-buffer "[b-ins-line]" delete-buffer "[b-copy-block]" delete-buffer "[b-yank-block]" - delete-buffer "[b-ins-blank]" delete-buffer "[b-yank-block]" delete-buffer "[getblock]" delete-buffer "[putblock]" - delete-buffer "[drawbox]" - delete-buffer "[setpoints]" - delete-buffer "[horizontal]" - delete-buffer "[vertical]" - delete-buffer "[horline]" - delete-buffer "[vertline]" - delete-buffer "[delcol]" !endm ; Write out the page instructions save-window 1 next-window beginning-of-file + delete-mode "VIEW" set $curcol 25 - overwrite-string " F1 Line type [DOUBLE] F2 kill block " + overwrite-string " F1 single line box F2 kill block " next-line set $curcol 25 - overwrite-string " F3 draw box F4 copy block " + overwrite-string " F3 double line box F4 copy block " next-line set $curcol 25 - overwrite-string " F5 insert line F6 yank block " + overwrite-string " F6 yank block " next-line set $curcol 18 overwrite-string "BOX " set $curcol 25 - overwrite-string " F7 insert space F8 insert block " + overwrite-string " F8 insert block " next-line set $curcol 25 overwrite-string " " unmark-buffer beginning-of-file + add-mode "VIEW" !force restore-window update-screen @@ -64,416 +57,25 @@ store-procedure b-change-line set %rcltype 2 set %rctmp "DOUBLE" !else - !if &equ %rcltype 2 - set %rcltype 3 - set %rctmp "C-CMNT" - !else - set %rcltype 1 - set %rctmp "SINGLE" - !endif + set %rcltype 1 + set %rctmp "SINGLE" !endif set %cbuf $cbufname set %cline $cwline - select-buffer "Function Keys" + select-buffer "[Function Keys]" beginning-of-file 1 goto-line 40 forward-character + delete-mode "VIEW" 6 delete-next-character insert-string %rctmp unmark-buffer - select-buffer %cbuf + add-mode "VIEW" + select-buffer %cbuf %cline redraw-display !return !endm -; Draw a box - -store-procedure b-draw-box - !if &equal %rcltype 1 - set %c1 "" - set %c2 "" - set %c3 "" - set %c4 "" - set %c5 "" - set %c6 "" - !else - !if &equal %rcltype 2 - set %c1 "" - set %c2 "" - set %c3 "" - set %c4 "" - set %c5 "" - set %c6 "" - !else - set %c1 "/" - set %c2 "*" - set %c3 "\" - set %c4 "\" - set %c5 "/" - set %c6 "*" - !endif - !endif - run drawbox -!endm - -; insert a blank line in a box - -store-procedure b-ins-blank - set %rctmp %rcltype - set %rcltype 0 - run b-ins-line - set %rcltype %rctmp -!endm - -; insert a line in a box - -store-procedure b-ins-line - run setpoints - !if &equal %pcol %mcol - run vertical - !else - !if &equal %pline %mline - run horizontal - !else - write-message "Illegal point and mark for lines" - !endif - !endif -!endm - -store-procedure setpoints -; procedure will set pcol, pline, mcol and mline. currently at point -; it will also detab the region - set %pcol $curcol - set %pline $curline - exchange-point-and-mark - set %mcol $curcol - set %mline $curline - exchange-point-and-mark - detab-region - set $curline %pline - set $curcol %pcol -!endm - -store-procedure drawbox - run setpoints - set $curline %mline - set $curcol %mcol -;draw top horizontal line - insert-string %c1 -; set %width &sub &sub %pcol %mcol 1 - set %width &add 2 &sub %pcol %mcol - %width insert-string %c2 - insert-string %c3 - newline-and-indent -;draw bottom horizontal line - %pline goto-line - next-line - end-of-line - newline - %mcol insert-string " " -; set $curcol %mcol - insert-string %c4 - %width insert-string %c2 - insert-string %c5 -; bump pline - set %pline &add %pline 1 -;draw verticals -- go to top and work our way down - %mline goto-line - !while &less $curline %pline - next-line - end-of-line - !if &less $curcol %pcol - &sub %pcol $curcol insert-string " " - !endif - set $curcol %pcol - insert-string " " - insert-string %c6 - set $curcol %mcol - insert-string %c6 - insert-string " " - !endwhile -;return to point - %pline goto-line - next-line - beginning-of-line - %width forward-character -!force 6 forward-character -!endm - -; user procedure to draw a horizontal from mark to point making spaces for -; the characters. -store-procedure horizontal - set %s1 "" - set %s2 "" - set %s3 "*" - !if &equal %rcltype 0 -; then insert blanks - set %c1 "" - set %c2 "" - set %c3 " " - set %c4 "" - set %c5 "" - set %c6 "" - set %c7 "" - set %c8 "*" - !else - !if &equal %rcltype 1 -; then insert a single line - set %c1 "" - set %c2 "" - set %c3 "" - set %c4 "" - set %c5 "" - set %c6 "" - set %c7 "" - set %c8 "*" - !else - !if &equal %rcltype 2 -; then insert a double line - set %c1 "" - set %c2 "" - set %c3 "" - set %c4 "" - set %c5 "" - set %c6 "" - set %c7 "" - set %c8 "*" - !else - set %c1 "*" - set %c2 "*" - set %c3 "*" - set %c4 "*" - set %c5 "*" - set %c6 "*" - set %c7 "*" - set %c8 "*" - !endif - !endif - !endif - run horline -!endm - -store-procedure vertical - set %s1 "" - set %s2 "" - set %s3 "*" - !if &equal %rcltype 0 - set %c1 "" - set %c2 "" - set %c3 " " - set %c4 "" - set %c5 "" - set %c6 "" - set %c7 "" - set %c8 "*" - !else - !if &equal %rcltype 1 - set %c1 "" - set %c2 "" - set %c3 "" - set %c4 "" - set %c5 "" - set %c6 "" - set %c7 "" - set %c8 "*" - !else - !if &equal %rcltype 2 - set %c1 "" - set %c2 "" - set %c3 "" - set %c4 "" - set %c5 "" - set %c6 "" - set %c7 "" - set %c8 "*" - !else - set %c1 "*" - set %c2 "*" - set %c3 "*" - set %c4 "*" - set %c5 "*" - set %c6 "*" - set %c7 "*" - set %c8 "*" - !endif - !endif - !endif - run verline -!endm - -store-procedure horline -; procedure to draw a line from beginning of line to point - !if &equal %mcol %pcol - !return - !endif - set $curline %pline - set $curcol %pcol - !if &less %pcol %mcol -; then point was to left of mark. exchange and reset variables - exchange-point-and-mark - run setpoints - !endif - !if %rcinsert - set $curcol %mcol - !else - beginning-of-line - newline - previous-line -; end-of-line -; newline - ; move to under mark - %mcol insert-string " " - !endif -; see if first char is a vertical line - previous-line - set %char &chr $curchar - next-line - %rcinsert delete-next-character - !if &sequal %char %s1 - insert-string %c1 - !else - !if &sequal %char %s2 - insert-string %c2 - !else - !if &sequal %char %s3 - insert-string %c8 - !else - insert-string %c3 - !endif - !endif - !endif -; now for all chars but the last character i.e., char at point - !while &less $curcol %pcol - previous-line - set %char &chr $curchar - next-line - %rcinsert delete-next-character - !if &sequal %char %s1 - insert-string %c4 - !else - !if &sequal %char %s2 - insert-string %c5 - !else - !if &sequal %char %s3 - insert-string %c8 - !else - insert-string %c3 - !endif - !endif - !endif - !endwhile -; see if last char is a vertical line - previous-line - set %char &chr $curchar - next-line - %rcinsert delete-next-character - !if &sequal %char %s1 - insert-string %c6 - !else - !if &sequal %char %s2 - insert-string %c7 - !else - !if &sequal %char %s3 - insert-string %c8 - !else - insert-string %c3 - !endif - !endif - !endif -!endm - -store-procedure verline -; proc to draw vertical line from mark to point. mark should be above point. - !if &equal %mline %pline - !return - !endif -; if point was above mark exchange and reset variables - !if &less %pline %mline - exchange-point-and-mark - run setpoints - !endif -;top line - %mline goto-line - set $curcol %pcol - backward-character - set %char &chr $curchar - forward-character - %rcinsert delete-next-character - !if &sequal %char %s1 - insert-string %c1 - !else - !if &sequal %char %s2 - insert-string %c2 - !else - !if &sequal %char %s3 - insert-string %c8 - !else - insert-string %c3 - !endif - !endif - !endif -;all but pline - !while &less $curline &sub %pline 1 - next-line - beginning-of-line - set $curcol %pcol - backward-character - set %char &chr $curchar - forward-character - %rcinsert delete-next-character - !if &sequal %char %s1 - insert-string %c4 - !else - !if &sequal %char %s2 - insert-string %c5 - !else - !if &sequal %char %s3 - insert-string %c8 - !else - insert-string %c3 - !endif - !endif - !endif - !endwhile -; bottom line - next-line - beginning-of-line - set $curcol %pcol - backward-character - set %char &chr $curchar - forward-character - %rcinsert delete-next-character - !if &sequal %char %s1 - insert-string %c6 - !else - !if &sequal %char %s2 - insert-string %c7 - !else - !if &sequal %char %s3 - insert-string %c8 - !else - insert-string %c3 - !endif - !endif - !endif -!endm - -store-procedure delcol -; proc to delete column. we will use the getblock procedure with the column of -; the point set to one beyond the column point - set-points - !if &equal %mcol %pcol - ; same columns - forward-character - run getblock - !return - !else - !if &equal %mline %pline - run getblock - !return - !endif -!endm - ; delete a rectangular block of text store-procedure b-del-block @@ -511,7 +113,7 @@ store-procedure getblock set %rcbuf $cbufname set %cline $cwline - ;save block boundries + ;save block boundaries set %endpos $curcol set %endline $curline detab-region @@ -562,12 +164,13 @@ store-procedure getblock ; insert/overlay a rectangular block of text store-procedure putblock +; set $debug TRUE ;set up needed variables set $discmd FALSE set %rcbuf $cbufname set %cline $cwline - ;save block boundries + ;save block boundaries set %begpos $curcol set %begline $curline @@ -581,7 +184,7 @@ store-procedure putblock select-buffer %rcbuf beginning-of-line !if ¬ &equ $lwidth 0 - 1 detab-line + 1 detab-region previous-line !endif !force set $curcol %begpos @@ -619,16 +222,140 @@ store-procedure putblock set $curcol %begpos %cline redraw-display set $discmd TRUE + set $debug FALSE +!endm + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; Draw a box + + delete-buffer "[box]" + delete-buffer "[simple-box]" + delete-buffer "[double-box]" + +store-procedure box +; set $debug TRUE + set $discmd FALSE + !if &less $curline $mline + exchange-point-and-mark + !endif + set %endline $curline + set %rcol $curcol + set %endpos $cwline + exchange-point-and-mark + set %topline $curline + set-mark + set %lcol $curcol + !if &les %rcol %lcol + set %rctmp %lcol + set %lcol %rcol + set %rcol %rctmp + !endif + 1 detab-region + previous-line + set $curcol %lcol + !if &equ $curline %endline + ; insert horizontal line + !while ¬ &gre $curcol %rcol + overwrite-string %hor + !endwhile + !else + !if &equ %lcol %rcol + ; insert vertical line + !while ¬ &gre $curline %endline + end-of-line + !while &les $curcol %lcol + overwrite-string " " + !endwhile + !force set $curcol %lcol + overwrite-string %ver + next-line + !endwhile + !else + ; insert box + set %rc %rcol - 1 + set %lc %lcol - 1 + ; insert upper left corner + overwrite-string %ulc + ; insert line + !while ¬ &equ $curcol %rc + overwrite-string %hor + !endwhile + ; insert upper right corner + overwrite-string %urc + next-line + !while &gre %endline $curline + 1 detab-region + previous-line + end-of-line + ; pad line up to the left side of the box + !while &les $curcol %lc + overwrite-string " " + !endwhile + !force set $curcol %lcol + overwrite-string %ver + end-of-line + !while &les $curcol %rc + overwrite-string " " + !endwhile + !force set $curcol %rcol + overwrite-string %ver + next-line + !endwhile + 1 detab-region + previous-line + end-of-line + ; pad line up to the left side of the box + !while &les $curcol %lc + overwrite-string " " + !endwhile + !force set $curcol %lcol + overwrite-string %llc + !while ¬ &equ $curcol %rc + overwrite-string %hor + !endwhile + overwrite-string %lrc + !endif + !endif + set $cwline %endpos + set $discmd TRUE +!endm + +; display single box + +store-procedure simple-box + set %ulc "┌" + set %urc "┐" + set %lrc "┘" + set %llc "└" + set %hor "─" + set %ver "│" + run box +!endm + +; display double box + +store-procedure double-box + set %ulc "╔" + set %urc "╗" + set %lrc "╝" + set %llc "╚" + set %hor "═" + set %ver "║" + run box !endm -macro-to-key b-change-line S-FN1 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +macro-to-key simple-box S-FN1 macro-to-key b-del-block S-FN2 -macro-to-key b-draw-box S-FN3 +macro-to-key double-box S-FN3 macro-to-key b-copy-block S-FN4 -macro-to-key b-ins-line S-FN5 +!force unbind-key S-FN5 macro-to-key b-yank-block S-FN6 -macro-to-key b-ins-blank S-FN7 +!force unbind-key S-FN7 macro-to-key b-ins-block S-FN8 +!force unbind-key S-FN9 +!force unbind-key S-FN0 ; and init some variables set %rcltype 2 diff --git a/cmd/ehelp.cmd b/cmd/ehelp.cmd index 7722a47..61b7952 100644 --- a/cmd/ehelp.cmd +++ b/cmd/ehelp.cmd @@ -22,7 +22,7 @@ store-procedure init-help ;make this screen the proper size for help set $orgrow 0 set $orgcol 0 - set $curwidth 80 + set $curwidth 100 !if ¬ &equ $pagelen 24 set $pagelen 25 !endif @@ -72,7 +72,7 @@ store-procedure gethscreen %helpscreen ;switch the current help screen set %helpfile 1 ;mark which help file we are in !endif delete-mode "view" ;don't lock the help file - + beginning-of-file !force search-forward %tmp !if &seq $status FALSE @@ -428,7 +428,7 @@ store-procedure select-mouse !return !endif - !if &seq %cmd "F10" + !if &seq %cmd "F9" exit-help !return !endif @@ -537,8 +537,11 @@ store-procedure exit-help delete-buffer "[next-hscreen]" delete-buffer "[previous-hscreen]" delete-screen HELP - !force delete-buffer ehelp1.txt - !force delete-buffer ehelp2.txt +; !force delete-buffer ehelp1.txt +; !force delete-buffer ehelp2.txt + !force delete-buffer ehelp1 + !force delete-buffer ehelp2 + !force delete-buffer "Window ID" set $discmd TRUE set %done TRUE !endm diff --git a/cmd/ehelp1.txt b/cmd/ehelp1.txt index ec46a43..05a09c8 100644 --- a/cmd/ehelp1.txt +++ b/cmd/ehelp1.txt @@ -1,19 +1,19 @@ [ENTER] Picks a topic [PG UP] Last Screen Cursor keys - [F10] Exit Help [PG DOWN] Next Screen are active + [F9] Exit Help [PG DOWN] Next Screen are active [F6] Index [HOME] Main Menu < > [ENTER] Picks a topic [PG UP] Last Screen [F6] Index Cursor keys - [F10] Exit Help [PG DOWN] Next Screen [HOME] Main Menu are active + [F9] Exit Help [PG DOWN] Next Screen [HOME] Main Menu are active < > =>Main Menu NEXT[The Basics] PREV[Main Menu] - < > The Basics < > Keystrokes + < > THE BASICS < > KEYSTROKES - < > Getting at Files < > Issuing Commands + < > GETTING AT FILES < > ISSUING COMMANDS - < > Searching and Replacing < > Customizing Command Keys + < > SEARCHING AND REPLACING < > CUSTOMIZING COMMAND KEYS < > Regions < > Using the Mouse @@ -45,16 +45,17 @@ NEXT[History] PREV[Main Menu] written by Daniel M. Lawrence Major code contributions by: - Dave Conroy, John Gamble, Dana Hoggatt, Pierre Perret + Dave Conroy, John Gamble, Dana Hoggatt, Pierre Perret, Jean-Michel Dubois Information about MicroEMACS can be obtained via: - USMAIL: Daniel Lawrence - 1615 Virginia Street - Lafayette, IN 47905 + USMAIL: Daniel Lawrence BBS: The Programmer's Room + 617 New York St (317) 742-5533 + Lafayette, IN 47901 Fidonet 1:201/10 - EMAIL: dan@aquest.com - Phone: (765) 426-3409 + Internet: mdbs!dan@dynamo.ecn.purdue.edu + American Online: bardor + Phone (nights): (317) 742-5153 Register MicroEMACS for prefered phone support and information on new releases by sending $25 US to the address above. @@ -99,9 +100,9 @@ NEXT[Alternative Basic Keys] PREV[Main Menu] | [CSR DOWN] - [F9] This saves your file + [F10] This saves your file - [F10] This leaves MicroEMACS + [F9] This leaves MicroEMACS [PG DOWN] for other basic keys =>Alternative Basic Keys @@ -248,13 +249,104 @@ NEXT[Advanced Text Editing] PREV[Advanced Text Editing] M-M (add-global-mode) Adds a global mode M-^M (delete-global-mode) Removes a global mode - These are some of MicroEMACS's modes: + Editing modes: + < > ABBREV mode < > CMODE mode < > WRAP mode + < > DLINE mode < > SLINE mode < > OVER mode + < > REP mode + Search modes: + < > EXACT mode < > MAGIC Mode + File modes: + < > ASAVE mode < > CRYPT mode < > NOBAK mode + < > VIEW mode + +=>ABBREV Mode +NEXT[Modes of Operation] PREV[Modes of Operation] + + ABBREV mode Don't save backup + + When this mode is on, MicroEMACS expands abbreviations. Abbreviations + are defined, undefined, and listed with the following instructions : + + add-abbrev "abbrev" "word" Add an abbreviation + delete-abbrev "abbrev" Delete an abbreviation + define-abbrevs buffer Add abbreviations contained in a buffer. + Abbreviation definitions consists in + pair of lines, one for the abbreviated + word, one for the complete word. + insert-abbrevs Insert a list of current abbreviations + pairs in the current buffer. + kill-abbrevs Clear the list of abbreviations. + describe-abbrevs Show a list of current abbreviations. + + + + +=>NOBAK Mode +NEXT[Modes of Operation] PREV[Modes of Operation] + + NOBAK mode Don't save backup + + When this mode is on, MicroEMACS doesn't make a backup of a saved + file. The backup file has the same name as the original file with + a tilde (~) added at the end. + + + + + + + + + + + + + + + +=>SLINE Mode +NEXT[Modes of Operation] PREV[Modes of Operation] + + SLINE mode Single line semi-graphics + + When this mode is on, MicroEMACS allows to enter single line + semi-graphics character with the keyboard : + + 7 = upper left corner 8 = upper intersection 9 = upper right corner + 4 = left intersection 5 = four ways intersec. 6 = right intersection + 1 = lower left corner 2 = lower intersection 3 = lower right corner + 0 = horizontal line + = vertical line + + + + + + + + + + + +=>DLINE Mode +NEXT[Modes of Operation] PREV[Modes of Operation] + + DLINE mode Double line semi-graphics + + When this mode is on, MicroEMACS allows to enter double line + semi-graphics character with the keyboard : + + 7 = upper left corner 8 = upper intersection 9 = upper right corner + 4 = left intersection 5 = four ways intersec. 6 = right intersection + 1 = lower left corner 2 = lower intersection 3 = lower right corner + 0 = horizontal line + = vertical line + + + + + - < > ASAVE mode < > EXACT mode < > REP mode - < > CMODE mode < > MAGIC Mode < > VIEW mode - < > CRYPT mode < > OVER mode < > WRAP mode @@ -320,7 +412,7 @@ NEXT[Modes of Operation] PREV[Modes of Operation] written out, all the printing characters have been scrambled. To read such a file back in, call up MicroEMACS like this: - emacs -k + me -k and you will be asked the encryption key before the file is read. The encryption algorithm is a Beaufort Cipher with a @@ -458,7 +550,7 @@ NEXT[Modes of Operation] PREV[Modes of Operation] access to, or other people have locked. To read a file in view mode from the command line, type: - emacs -v + me -v @@ -582,7 +674,7 @@ NEXT[Main Menu] PREV[Main Menu] Regions are used in MicroEMACS to specify what text is acted on by many commands. A region is defined as all the text between the point, and the last placed MARKed. To define a region: - + 1) Move the point to the beginning of the text you want to effect @@ -604,21 +696,21 @@ NEXT[Main Menu] PREV[Main Menu] NEXT[Copying Text] PREV[Main Menu] To move text from one place to another: - + 1) Move to the beginning of the text you want to move. - + 2) Set the mark here with the M- (set-mark) command. - + 3) Move the point to the end of the text. - + 4) Use the ^W (kill-region) command to delete the region you just defined. The text will be saved in the "kill buffer". - + 5) Move the point to the place you want the text to appear. - + 6) Use the ^Y (yank) command to copy the text from the kill buffer to the current point. - + Repeat steps 5 and 6 to place more copies of the same text. [PG DOWN] for more info @@ -630,14 +722,14 @@ NEXT[Main Menu] PREV[Cutting and Pasting] and pasting it, except that in place of the ^W (kill-region) command, you use the M-W (copy-region) command which copies the current region into the kill buffer without deleting it. - + The kill buffer accumulates and text which is deleted by ^W, M-W or a number of other delete commands. If more than one delete command is used in a row, all the text from all the commands will be in the kill buffer. Using any command between deletes causes the kill buffer to discard earlier deletes and just hold the most recent deletions. - + Since there is only one kill buffer, you can switch between windows, screens and files to copy text from one file to another. There is no limit to the amount of text that can be stored in the @@ -654,7 +746,7 @@ NEXT[Buffer Commands] PREV[Main Menu] in buffers can also be MicroEMACS macros, temporary storage for macros, or lists of screens, files, buffers, variables, functions or bindings created by MicroEMACS commands. Buffer commands include: - + ^X-B (select-buffer) This prompt for a buffer name, and then makes that buffer the one @@ -1043,7 +1135,7 @@ NEXT[Main Menu] PREV[Main Menu] < > Narrowing Your Scope [PG UP] to return to Main Menu - + =>Controlling Tabs NEXT[More Tab Commands] PREV[Advanced Text Editing] @@ -1066,7 +1158,7 @@ NEXT[More Tab Commands] PREV[Advanced Text Editing] [PG DOWN] for more commands about tabs - + =>More Tab Commands NEXT[Main Menu] PREV[Controlling Tabs] @@ -1111,7 +1203,7 @@ NEXT[More External Commands] PREV[Main Menu] [PG DOWN] for more external commands - + =>More External Commands NEXT[Main Menu] PREV[The Outside World] diff --git a/cmd/ehelp2.txt b/cmd/ehelp2.txt index bb8ea74..55f46a9 100644 --- a/cmd/ehelp2.txt +++ b/cmd/ehelp2.txt @@ -17,13 +17,13 @@ Next[Index 2] PREV[Main Menu] < > Buffer Commands < > Even More Mousing < > Buffers < > Getting at Files < > CMODE Mode < > Glossary of Terms - < > CRYPT Mode < > History - < > Case Control < > Issuing Commands - < > Command Lines < > Keyboard Macros - < > Command List < > Keystrokes - < > Commands < > MAGIC Mode - < > Copying Text < > Macros - < > Creating New Commands < > Main Menu + < > CRYPT Mode < > GRD Mode + < > Case Control < > GRS Mode + < > Command Lines < > History + < > Command List < > Issuing Commands + < > Commands < > Keyboard Macros + < > Copying Text < > Keystrokes + < > Creating New Commands < > MAGIC Mode Press [PG DOWN] for more index topics @@ -32,19 +32,20 @@ Next[Main Menu] PREV[Index] Index to all HELP topics (continued): + < > Macros < > Replacements + < > Main Menu < > Screen Commands < > Memory Usage < > Screens < > Modes of Operation < > Searching and Replacing < > Narrowing Your Scope < > The Basics - < > Numeric Arguments < > The Outside World - < > OVER Mode < > Unbinding Keys - < > Other Searches < > Using the Mouse - < > Pages < > VIEW Mode - < > Paragraphs < > WRAP Mode - < > REP Mode < > Window Commands - < > Regions < > Windows - < > Repetitive Tasks < > Words - < > Replacements - < > Screen Commands + < > NOBAK Mode < > The Outside World + < > Numeric Arguments < > Unbinding Keys + < > OVER Mode < > Using the Mouse + < > Other Searches < > VIEW Mode + < > Pages < > WRAP Mode + < > Paragraphs < > Window Commands + < > REP Mode < > Windows + < > Regions < > Words + < > Repetitive Tasks Press [PG DOWN] to return to main menu @@ -78,10 +79,12 @@ NEXT[Main Menu] PREV[Main Menu] NEXT[Command Summary 2] PREV[Reference Screens] ^G abort-command Abort any command waiting for input +unbound add-abbrev Add an abbreviation M-M add-global-mode Add a global mode for all new buffers ^XM add-mode Add a mode to the current buffer ^X^A append-file Append current buffer to file M-A apropos List out commands containing a given string +unbound back-from-tag-word Return to the file from where we tagged an identifier ^B backward-character Move one character to the left ^X( begin-macro Begin recording a keyboard macro M-< beginning-of-file Move to the beginning of the current file @@ -92,13 +95,13 @@ M-K bind-to-key Bind a key to a function ^X^U case-region-upper Make a marked region all upper case M-C case-word-capitalize Capitalize the following word M-L case-word-lower Lower case the following word -M-U case-word-upper Upper case the following word -^XN change-file-name Change the name of the current file [PG DOWN] for more commands =>Command Summary 2 NEXT[Command Summary 3] PREV[Command Summary 1] +M-U case-word-upper Upper case the following word +^XN change-file-name Change the name of the current file unbound change-screen-column Change column of upper left of current screen unbound change-screen-row Change row of upper left of current screen unbound change-screen-size Change the number of screen lines @@ -110,27 +113,37 @@ M-^C count-words Count words, lines and characters in region ^X ctlx-prefix Change the key used as the ^X prefix ^XY cycle-ring Reposition current string in kill ring A-C cycle-screens Bring the rearmost screen to front +unbound define-abbrevs Define abbreviations from a buffer +unbound delete-abbrevs Delete an abbreviation ^X^O delete-blank-lines Delete all blank lines around the cursor ^XK delete-buffer Delete a non-displayed buffer -M-^M delete-global-mode Turn off a global mode -M-^Y delete-kill-ring Throw out all kill ring text -^X^M delete-mode Turn off a mode in the current buffer -^D delete-next-character Delete the character following the cursor [PG DOWN] for more commands =>Command Summary 3 NEXT[Command Summary 4] PREV[Command Summary 2] +M-^M delete-global-mode Turn off a global mode +M-^Y delete-kill-ring Throw out all kill ring text +^X^M delete-mode Turn off a mode in the current buffer +^D delete-next-character Delete the character following the cursor M-D delete-next-word Delete the word following the cursor ^X1 delete-other-windows Remove all other displayed windows ^H delete-previous-character Delete character to the left of the cursor M-^H delete-previous-word Delete the word to the left of the cursor A-D delete-screen Delete a non-displayed screen -^X0 delete-window Remove the current window from the screen +M-^U delete-undos Delete current buffer's undo stack +^X0 delete-window Remove the current window from the +screen +unbound describe-abbrevs List all defined abbreviations unbound describe-bindings List all legal commands unbound describe-functions List all defined functions ^X? describe-key Describe the command bound to a keystroke unbound describe-variables List all variables + + [PG DOWN] for more commands +=>Command Summary 4 +NEXT[Command Summary 5] PREV[Command Summary 3] + ^X^D detab-region Change tabs in region to equivalent spaces ^XG display Display variables current value ^X) end-macro stop recording a keyboard macro @@ -138,11 +151,6 @@ M-> end-of-file Move to the end of the current buffer ^E end-of-line Move to the end of the current line unbound end-of-word Move to the end of the current word ^X^E entab-region Change spaces to tabs where possible - - [PG DOWN] for more commands -=>Command Summary 4 -NEXT[Command Summary 5] PREV[Command Summary 3] - ^X^X exchange-point-and-mark Swap cursor and mark positions unbound execute-buffer Execute a buffer as a macro M-^X execute-command-line Execute a command line @@ -153,6 +161,11 @@ M-X execute-named-command Execute a command by name M-^E execute-procedure Execute a procedure by name ^X$ execute-program Execute a program directly (not thru a shell) ^X^C exit-emacs Exit EMACS. + + [PG DOWN] for more commands +=>Command Summary 5 +NEXT[Command Summary 6] PREV[Command Summary 4] + M-Q fill-paragraph Fill the current paragraph ^X# filter-buffer Filter current buffer thru external filter ^X^F find-file Find a file to edit in the current window @@ -160,38 +173,43 @@ A-F find-screen Find and make current a named screen ^F forward-character Move cursor one character to the right M-G goto-line Goto a numbered line M-^G goto-mark Goto a numbered mark (0 by default) - - [PG DOWN] for more commands -=>Command Summary 5 -NEXT[Command Summary 6] PREV[Command Summary 4] - M-^F goto-matching-fence Goto the matching fence ^X^ grow-window Make the current window larger ^I handle-tab Insert a tab or set tab stops -M-? help Read EMACS.HLP into a buffer and display it +M-? help Read emacs.hlp into a buffer and display it +unbound hide-buffer Set a buffer as invisible A-R hunt-backward Hunt for last match of previous search string A-S hunt-forward Hunt for next match of previous search string ^XC i-shell Shell up to a new command processor ^XS incremental-search Search for a string, incrementally M-) indent-region Indent region one tab stop + + [PG DOWN] for more commands +=>Command Summary 6 +NEXT[Command Summary 7] PREV[Command Summary 5] + +unbound index-help List index of language help +unbound insert-abbrevs Insert defined abbreviations in a buffer ^X^I insert-file insert a file at cursor ^C insert-space Insert a space to the right of the cursor unbound insert-string Insert a string at the cursor +unbound kill-abbrevs Clear the list of defined abbreviations M-^W kill-paragraph Delete the current paragraph ^W kill-region Delete marked region, save to kill buffer ^K kill-to-end-of-line Delete the rest of the current line -unbound label-function-key Label a function key (hp150 only) ^X^B list-buffers List all existing buffers - - [PG DOWN] for more commands -=>Command Summary 6 -NEXT[Command Summary 7] PREV[Command Summary 5] - A-B list-screens List all existing screens +unbound list-undos List all undoes +M-H look-word Display help on the current word ^X^K macro-to-key Bind a key to a macro ^[ meta-prefix Key used to precede all META commands ^X^N move-window-down Move all lines in the current window down ^X^P move-window-up Move all lines in the current window up + + [PG DOWN] for more commands +=>Command Summary 7 +NEXT[Command Summary 8] PREV[Command Summary 6] + M-^N name-buffer Change the name of the current buffer ^X< narrow-to-region hides all text not in the current region ^M newline Insert at the cursor @@ -204,20 +222,21 @@ M-N next-paragraph Move cursor to the next paragraph M-F next-word Move cursor to beginning of next word unbound nop Does nothing ^O open-line Open a line at the cursor - - [PG DOWN] for more commands -=>Command Summary 7 -NEXT[Command Summary 8] PREV[Command Summary 6] - unbound overwrite-string Overwrite a string at the cursor ^X@ pipe-command Execute an external command, record output unbound pop-buffer Display named buffer as a pop-up ^P previous-line Move cursor up one line ^Z previous-page Move cursor up one page + + [PG DOWN] for more commands +=>Command Summary 8 +NEXT[Command Summary 9] PREV[Command Summary 7] + M-P previous-paragraph Move back one paragraph ^XP previous-window Move the cursor to the last window M-B previous-word Delete the word to the left of the cursor unbound print Display a string on the command line +M-J prompt-look Display help on asked word M-^R query-replace-string Interactively replace one string with another M-Z quick-exit Exit EMACS, writing out all changed buffers ^Q quote-character Insert the next character, literally @@ -226,15 +245,15 @@ M-^L redraw-display Redraw display, centering current line ^X remove-mark Erase numbered mark A-N rename-screen Change the name of the current screen M-R replace-string Replace one string with another - - [PG DOWN] for more commands -=>Command Summary 8 -NEXT[Command Summary 9] PREV[Command Summary 7] - ^XW resize-window Change number of lines in current window unbound restore-window Move cursor to the last saved window ^XR reverse-incremental-search Search backwards, incrementally M-^E run Execute a named procedure + + [PG DOWN] for more commands +=>Command Summary 9 +NEXT[Command Summary 10] PREV[Command Summary 8] + ^X^S save-file Save the current buffer if it is changed unbound save-window Remember current window (to restore later) M-^V scroll-next-down Scroll the next window down @@ -249,14 +268,16 @@ M- set-mark Set a mark ^X! shell-command Causes external shell to execute command unbound show-files List contents of directory ^X^Z shrink-window Make the current window smaller - [PG DOWN] for more commands -=>Command Summary 9 -NEXT[Reference Screens] PREV[Command Summary 8] - M-^S source Execute a file as a macro ^X2 split-current-window Split the current window in two unbound store-macro Store following macro lines to numbered macro + + [PG DOWN] for more commands +=>Command Summary 10 +NEXT[Reference Screens] PREV[Command Summary 9] + unbound store-procedure Store following macro lines to named procedure +unbound tag-word Tag a word ^T transpose-characters Transpose char at cursor with char to left ^X^T trim-region Trim any trailing white space from a region M-^K unbind-key Unbind a key from a function @@ -265,12 +286,14 @@ M-( undent-region undent region one tab stop M-~ unmark-buffer Unmark the current buffer unbound update-screen Force a screen update during macro execution ^X^V view-file Find a file, and put it in view mode -^X> widen-from-region restores hidden text +^X> widen-from-region Restores hidden text unbound wrap-word Wrap the current word ^X^W write-file Write current buffer under new file name unbound write-message Same as print -^Y yank yank kill buffer into current buffer at cursor -M-Y yank-pop yank the next string in the kill ring +^Y yank Yank (paste) kill buffer into current buffer at cursor +M-Y yank-pop Yank (paste) the next string in the kill ring +M-^[ zap-help Deletes the first window on the screen for the help buffer + [PG DOWN] to return to Reference Screens =>Writing EMACS Macros NEXT[Main Menu] PREV[Menu Menu] @@ -391,7 +414,9 @@ NEXT[Function Summary 2] PREV[Reference Screens] any string Return Function logical value Value Arguments Description ----- No return value -------------------------------------------- +------------------------------------------------------------------------------- + + &abb Lookup abbreviation &abs Returns the absolute value of &add Add two numbers &and Returns TRUE if BOTH logical arguments are TRUE @@ -403,12 +428,17 @@ Value Arguments Description ----- No return value &bxo Bitwise XOR function &cat Concatenate the two strings to form one &chr get character represented by ascii code - &div Divide num1 by num2 - [PG DOWN] for more functions =>Function Summary 2 NEXT[Function Summary 3] PREV[Function Summary 1] + MicroEMACS Function Summary Numeric string + any string +Return Function logical value +Value Arguments Description ----- No return value +------------------------------------------------------------------------------- + + &div Divide num1 by num2 &env get environment variable &equ Is and numerically equal? &exi Does the named file exist? @@ -420,85 +450,127 @@ NEXT[Function Summary 3] PREV[Function Summary 1] any &ind Evaluate as a variable. &isn Is str numeric? &lef get leftmost characters from + +=>Function Summary 3 +NEXT[Function Summary 4] PREV[Function Summary 2] + + MicroEMACS Function Summary Numeric string + any string +Return Function logical value +Value Arguments Description ----- No return value +------------------------------------------------------------------------------- + &len find length of str &les Is < numerically? &low Lowercase &mid Get chars from at + &mkc Get column of a mark + &mkl Get line number of a mark &mod Remainder of num1 / num2 &neg Negates number - - [PG DOWN] for more functions -=>Function Summary 3 -NEXT[Reference Screens] PREV[Function Summary 2] - ¬ Return the opposite logical value &or Returns TRUE if either argument is TRUE &rev Return a string with reversed characters &rig Get the rightmost characters from + +=>Function Summary 4 +NEXT[Function Summary 5] PREV[Function Summary 3] + + MicroEMACS Function Summary Numeric string + any string +Return Function logical value +Value Arguments Description ----- No return value +------------------------------------------------------------------------------- + &rnd Returns a random integer between 1 and &seq Is = alphabetically? &sgr Is >= alphabetically? &sin find position of str2 in str1 (0 if fails) &sle Is < alphabetically? ----- &slo Set lowercasing table + &sri find last position of str2 in str1 (0 if fails) &sub Subtract two numbers ----- &sup Set uppercasing table &tim Multiply two numbers &tri Trim the trailing whitespace from a string &tru Is num answer to Life, The Universe, Everything? + +=>Function Summary 5 +NEXT[Reference Screens] PREV[Function Summary 4] + + MicroEMACS Function Summary Numeric string + any string +Return Function logical value +Value Arguments Description ----- No return value +------------------------------------------------------------------------------- + &upp Uppercase &xla Translate str1 via str2<->str3 table + + + + + + + + [PG DOWN] to return to reference screens + =>Environment Variable List =Environment Summary 1 =>Environment Summary 1 NEXT[Environment Summary 2] PREV[Reference Screens] +$abbell ring bell on abbreviation expansion? +$abcap match capitalization in abbreviation expansions +$abquick quick, aggressive expansions enabled? $acount countdown of inserted characters until the next autosave $asave number of inserted characters between automatic file-saves $bufhook macro called on buffer entry $cbflags current buffer's attribute flags $cbufname buffer name of the current buffer $cfname file name of the current buffer +$class class code of terminal (Theos) $cmdhook function run before each user command $cmode mode of the current buffer +$cquote close quote character $curchar ascii value of the character currently at the point $curcol current column of point in current buffer $curline current line of point in current buffer $curwidth number of columns in current screen -$curwind current window number -$cwline current display line in current window -$debug flag to trigger macro debugging -$deskcolor color to use for current desktop, default to BLACK -$diagflag allow diaganal mouse drags? [PG DOWN] for more environment variables =>Environment Summary 2 NEXT[Environment Summary 3] PREV[Environment Summary 1] +$curwind current window number +$cwline current display line in current window +$debug flag to trigger macro debugging +$deskcolor color to use for current desktop, default to BLACK +$diagflag allow diagonal mouse drags? $discmd echo command prompts? Default is TRUE $disinp echo input at the command prompts? Default is TRUE -$disphigh display high-bit characters symbolically? Default is FALSE $exbhook macro to execute when exiting a buffer $fcol text column being displayed in first column of current window $fillcol current fill column $flicker suppress screen flicker (for old IBM-PC CGA adapter) $fmtlead list of all formatter lead characters +$found last search status $gflags global flags controlling some EMACS internal functions $gmode global mode flags $hardtab number of spaces between hard tab stops $hilight hilight selected region? -$hjump columns to scroll the screen horizontally when needed -$hscrlbar display horizontal scroll bars? (under windowing versions) -$hscroll scroll screen horizontally? or just current line -$isterm incremental search terminator character -$kill contains the first 127 characters in the kill buffer [PG DOWN] for more environment variables =>Environment Summary 3 NEXT[Environment Summary 4] PREV[Environment Summary 2] +$hjump columns to scroll the screen horizontally when needed +$hscrlbar display horizontal scroll bars? (under windowing versions) +$hscroll scroll screen horizontally? or just current line +$isterm incremental search terminator character +$kill contains the first 127 characters in the kill buffer $language [READ ONLY] name of the language which messages display $lastkey [READ ONLY] last keyboard character typed $lastmesg [READ ONLY] text of the last message written on command line @@ -506,29 +578,40 @@ $line current line in the current buffer $lterm line terminator characters. default are native ones $lwidth [READ ONLY] number of characters in the current line $match [READ ONLY] last string matched in a search +$mcol mark column +$mline mark line $mmove mode of mouse movement (0=none, 1=default, 2=always) $modeflag display mode lines? $msflag mouse present? -$numwind number of windows displayed -$orgrow desktop row position of current screen -$orgcol desktop column position of current screen -$os Operating system MicroEMACS is running under -$overlap number of lines to overlap during scroll -$pagelen number of screen lines used currently -$palette string used to control the palette register settings [PG DOWN] for more environment variables =>Environment Summary 4 NEXT[Environment Summary 5] PREV[Environment Summary 3] +$newscreen new screen with new buffer? +$numwind number of windows displayed on current screen +$oquote open quote character +$orgcol desktop column position of current screen +$orgrow desktop row position of current screen +$os Operating system MicroEMACS is running under +$overlap number of lines to overlap during scroll +$pagelen number of screen lines used currently +$palette string used to control the palette register settings $paralead string containing all paragraph start characters $pending [READ ONLY] are there are user keystrokes pending? +$pid process id of MicroEmacs $popflag use pop-up windows? Default is TRUE +$popwait user wait on end of pop-up window? $posflag display line and column position on modeline. Default is FALSE $progname [READ ONLY] contains the string "MicroEMACS" $ram amount of remaining memory if compiled with RAMSIZE + + [PG DOWN] for more environment variables +=>Environment Summary 5 +NEXT[Environment Summary 6] PREV[Environment Summary 4] + $readhook macro to execute before reading in a file -$region string of the current region. truncates at 255 characters +$region [READ ONLY] string of the current region. truncates at 255 characters $replace current replace pattern used in replace commands $rval return value from the last invoked subprocess $scrname current screen name @@ -538,18 +621,20 @@ $seed integer seed of the random number generator $softtab number of spaces inserted by EMACS when soft tabbing $sres Current screen resolution $ssave safe file saving? Default is TRUE - - [PG DOWN] for more environment variables -=>Environment Summary 5 -NEXT[Reference Screens] PREV[Environment Summary 4] - $sscroll smooth scrolling? Default is FALSE $status [READ ONLY] Status of the success of the last command $sterm search string input terminator, default is META $target target for line moves $time [READ ONLY] current date and time. "Mon May 09 10:10:58 1988" $timeflag display time of day on modeline? Default is FALSE. + + [PG DOWN] for more environment variables +=>Environment Summary 6 +NEXT[Reference Screens] PREV[Environment Summary 5] + +$tmpnam temporary file name $tpause Controls length of the pause to display matched fence in CMODE +$undoflag currently processing undoes flag $version [READ ONLY] current MicroEMACS version number $vscrlbar display vertical scroll bars? $wchars letters legal in word. Default is alphanumerics and underscore @@ -561,6 +646,10 @@ $yankflag position at end of yanked text? $ypos last mouse row + + + + [PG DOWN] to return to reference screens =>ENDOFFILE < > diff --git a/cmd/emacs.rc b/cmd/emacs.rc index 5acc747..9401603 100644 --- a/cmd/emacs.rc +++ b/cmd/emacs.rc @@ -13,13 +13,14 @@ write-message "[Setting up....]" ; set $sres "EGA" ; If you hate clocks or position counters, comment these -set $timeflag TRUE +;set $timeflag TRUE set $posflag TRUE +set $sscroll TRUE ; Set Default Global modes -add-global-mode "blue" -add-global-mode "WHITE" +add-global-mode "white" +add-global-mode "BLACK" ;bind-to-key meta-prefix ` ;for annoying keyboards with ` at the top left ; Toggle function key window display @@ -35,16 +36,17 @@ store-procedure toggle-fkeys !if &sequal $cbufname "emacs.hlp" delete-window !endif - !if ¬ &sequal $cbufname "Function Keys" + !if ¬ &sequal $cbufname "[Function Keys]" 1 split-current-window - 1 select-buffer "Function Keys" - add-mode "red" + 1 select-buffer "[Function Keys]" + add-mode "blue" + add-mode "WHITE" !force 5 resize-window 1 goto-line !endif set %rcfkeys TRUE !force restore-window - !if &sequal $cbufname "Function Keys" + !if &sequal $cbufname "[Function Keys]" next-window !endif write-message "[Function key window ON]" @@ -54,7 +56,7 @@ store-procedure toggle-fkeys *rcfoff save-window 1 next-window - !if &sequal "Function Keys" $cbufname + !if &sequal "[Function Keys]" $cbufname delete-window !endif !force restore-window @@ -93,15 +95,29 @@ store-procedure set-default-mode !if &equ %rctmp 0 !return !endif - set %rctmp &mid $cfname &add %rctmp 1 5 - !if &or &seq %rctmp "c" &seq %rctmp "h" - add-mode "cmode" - !endif - !if &or &seq %rctmp "cpp" &seq %rctmp "hpp" - add-mode "cmode" - !endif - !if &or &seq %rctmp "mss" &seq %rctmp "txt" - add-mode "wrap" + !if &seq $os "THEOS" + set %rctmp &mid $cfname &add %rctmp 1 2 + !if &or &seq %rctmp "c:" &seq %rctmp "h:" + add-mode "cmode" + !endif + set %rctmp &mid $cfname &add %rctmp 1 4 + !if &or &seq %rctmp "cpp:" &seq %rctmp "hpp:" + add-mode "cmode" + !endif + !if &seq %rctmp "txt:" + add-mode "wrap" + !endif + !else + set %rctmp &mid $cfname &add %rctmp 1 5 + !if &or &seq %rctmp "c" &seq %rctmp "h" + add-mode "cmode" + !endif + !if &or &seq %rctmp "cpp" &seq %rctmp "hpp" + add-mode "cmode" + !endif + !if &or &seq %rctmp "mss" &seq %rctmp "txt" + add-mode "wrap" + !endif !endif !endm set $readhook set-default-mode @@ -116,7 +132,7 @@ store-procedure mouse-clicks !force mouse-move-down ;If not in the function key window... leave - !if ¬ &sequal $cbufname "Function Keys" + !if ¬ &sequal $cbufname "[Function Keys]" !return !endif @@ -188,23 +204,38 @@ macro-to-key toggle-fkeys FN5 macro-to-key get-help FN6 bind-to-key next-window FN7 macro-to-key get-page-loader FN8 -bind-to-key save-file FN9 -bind-to-key exit-emacs FN0 +bind-to-key exit-emacs FN9 +bind-to-key save-file FN0 + +bind-to-key move-window-up FN^P +bind-to-key move-window-down FN^N +bind-to-key scroll-next-up M-FNZ +bind-to-key scroll-next-down M-FNV + +!if &seq $os "UNIX" + bind-to-key delete-next-character ^? + bind-to-key delete-next-word M-^? + bind-to-key delete-previous-word M-^H +!else + bind-to-key delete-previous-character ^? + bind-to-key delete-previous-word M-^? + bind-to-key delete-next-word M-FND +!endif ; bring up the function key window 1 split-current-window - 1 select-buffer "Function Keys" - insert-string "f1 search-> f2 <-search MicroEMACS: Text Editor~n" - insert-string "f3 hunt-> f4 <-hunt ~n" - insert-string "f5 fkeys f6 help Available function key Pages include:~n" - insert-string "f7 nxt wind f8 pg[ ] Word Box Emacs Pascal C cObol Lisp~n" - insert-string "f9 save f10 exit [use the f8 key to load Pages]~n" + 1 select-buffer "[Function Keys]" + insert-string "f1 search-> f2 <-search | MicroEMACS: Text Editor~n" + insert-string "f3 hunt-> f4 <-hunt | ~n" + insert-string "f5 fkeys f6 help | Available function key Pages include:~n" + insert-string "f7 nxt wind f8 pg[ ] | Word Box Emacs Pascal C cObol Lisp~n" + insert-string "f9 exit f10 save | [use the f8 key to load Pages]~n" unmark-buffer delete-window set %rcfkeys FALSE - !if &seq $os "UNIX" + !if &seq $os "unix" ;Allow mainframes to simulate function ;keys with ^C and ^C shifted- @@ -249,4 +280,31 @@ bind-to-key exit-emacs FN0 set $sres CGA !endif - set $discmd TRUE +store-procedure toggle-insert + !if &gre &mod $cmode 64 31 + delete-mode "over" + !else + add-mode "over" + !endif +!endm +macro-to-key toggle-insert FNC + +store-procedure single-graphics + !force delete-mode "GRD" + add-mode "GRS" +!endm +macro-to-key single-graphics FN- + +store-procedure double-graphics + !force delete-mode "GRS" + add-mode "GRD" +!endm +macro-to-key double-graphics S-FN- + +store-procedure no-graphics + !force add-mode "GRS" + !force add-mode "GRD" +!endm +macro-to-key no-graphics FN^- + +set $discmd TRUE diff --git a/cmd/emacs.rc_linux b/cmd/emacs.rc_linux new file mode 100644 index 0000000..d9e37ec --- /dev/null +++ b/cmd/emacs.rc_linux @@ -0,0 +1,320 @@ +; EMACS.RC: Standard MicroEMACS Startup program +; for MicroEMACS 3.13 and above +; (C)opyright 1987-99 by Daniel M Lawrence +; Last Update: 11/13/93 + +set $discmd TRUE +;set $debug TRUE +write-message "[Setting up....]" + +; If you screen "SNOWS", comment this line + set $flicker "FALSE" + +; To use an IBM-PC EGA card, uncomment the following line +; set $sres "EGA" + +; If you hate clocks or position counters, comment these +;set $timeflag TRUE +set $posflag TRUE +set $sscroll TRUE + +; Set Default Global modes + +add-global-mode "white" +add-global-mode "BLACK" +;bind-to-key meta-prefix ` ;for annoying keyboards with ` at the top left + +; Toggle function key window display + +store-procedure toggle-fkeys + !if %rcfkeys + !goto rcfoff + !endif + +; toggle function key window on + save-window + 1 next-window + !if &sequal $cbufname "emacs.hlp" + delete-window + !endif + !if ¬ &sequal $cbufname "[Function Keys]" + 1 split-current-window + 1 select-buffer "[Function Keys]" + add-mode "red" + add-mode "WHITE" + add-mode "VIEW" + !force 5 resize-window + 1 goto-line + !endif + set %rcfkeys TRUE + !force restore-window + !if &sequal $cbufname "[Function Keys]" + next-window + !endif + write-message "[Function key window ON]" + !return + + ;Toggle the function key window off +*rcfoff + save-window + 1 next-window + !if &sequal "[Function Keys]" $cbufname + delete-window + !endif + !force restore-window + write-message "[Function key window OFF]" + set %rcfkeys FALSE +!endm + +; Bring up Online-help system + +store-procedure get-help + set $discmd FALSE + source ehelp.cmd + set $discmd TRUE +!endm + +; Load a new page + +store-procedure get-page-loader + !if &seq &find newpage.cmd "" + write-message "[Can not find NEWPAGE.CMD]" + !return + !endif + execute-file newpage.cmd +!endm + +;procedure to clean out the current page (which is nothing right now) + +store-procedure clean + ; nothing by default +!endm + +; Set up default modes + +store-procedure set-default-mode +; set $debug TRUE + set %rctmp &sri $cfname "." + !if &equ %rctmp 0 + !return + !endif + !if &seq $os "THEOS" + set %rctmp &mid $cfname &add %rctmp 1 3 + !if &or &seq %rctmp "c:" &seq %rctmp "h:" + add-mode "cmode" + set $hardtab 4 + !endif + set %rctmp &mid $cfname &add %rctmp 1 7 + !if &seq %rctmp "basic:" + add-mode "cmode" + set $hardtab 2 + !endif + !if &seq %rctmp "txt:" + add-mode "wrap" + set $hardtab 8 + !endif + !else + set %rctmp &mid $cfname &add %rctmp 1 5 + !if &or &seq %rctmp "c" &seq %rctmp "h" + add-mode "cmode" + add-mode "utf-8" + set $hardtab 4 + kill-abbrevs + !endif + !if &or &seq %rctmp "cpp" &seq %rctmp "hpp" + add-mode "cmode" + add-mode "utf-8" + set $hardtab 4 + kill-abbrevs + !endif + !if &seq %rctmp "b" + add-mode "cmode" + add-mode "utf-8" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &seq %rctmp "basic" + add-mode "cmode" + add-mode "theox" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &or &seq %rctmp "mss" &seq %rctmp "txt" + add-mode "wrap" + delete-mode "cmode" + add-mode "utf-8" + set $hardtab 8 + kill-abbrevs + !endif + !endif +!endm +set $readhook set-default-mode + +; This function activates the function key window as +; a legitimate place to call up function keys using the mouse + +store-procedure mouse-clicks + + ;remember where we started, and do the mouse movement + save-window + !force mouse-move-down + + ;If not in the function key window... leave + !if ¬ &sequal $cbufname "[Function Keys]" + !return + !endif + + ;First pos is a screen reposition, let it through + !if &and &equ $xpos 0 &equ $ypos 0 + restore-window + !return + !endif + + ;Find out what function key were gonna do + add-mode magic + 2 forward-character + set %rctmp $search + !force search-reverse "[fF][0-9]" + !if &seq $status FALSE + delete-mode magic + set $search %rctmp + !return + !endif + + ;we are on the "f" or "F". Get the function key type and number now + set $search %rctmp + set %fcase lower + !if &equ $curchar 70 + set %fcase upper + !endif + 1 forward-character + set %fnum &chr $curchar + 1 forward-character + set %fnum &cat %fnum &chr $curchar + set %fnum &add %fnum 0 + !if &equ %fnum 10 + set %fnum "0" + !endif + set %fname &cat "FN" %fnum + !if &seq %fcase upper + set %fname &cat "S-" %fname + !endif + + ;save the function + set %rccmd &bind %fname + delete-mode MAGIC + + ;swallow the up-button + set %rctmp >c + + ;restore the window and exit + restore-window + + ;procedures don't need the square brackets + !if &seq &left %rccmd 1 "[" + set %rccmd &mid %rccmd 2 &sub &len %rccmd 2 + %rccmd + !return + !endif + + ;and then execute it + !force execute-named-command %rccmd +!endm +;macro-to-key mouse-clicks MSa + +; ***** Rebind the Function key group + +bind-to-key search-forward FN1 +bind-to-key search-reverse FN2 +bind-to-key hunt-forward FN3 +bind-to-key hunt-backward FN4 +macro-to-key toggle-fkeys FN5 +macro-to-key get-help FN6 +bind-to-key next-window FN7 +macro-to-key get-page-loader FN8 +bind-to-key exit-emacs FN9 +bind-to-key save-file FN0 + +bind-to-key move-window-up FN^P +bind-to-key move-window-down FN^N +bind-to-key scroll-next-up M-FNZ +bind-to-key scroll-next-down M-FNV + +!if &seq $os "UNIX" + bind-to-key delete-next-character ^? + bind-to-key delete-next-word M-^? + bind-to-key delete-previous-word M-^H +!else + bind-to-key delete-previous-character ^? + bind-to-key delete-previous-word M-^? + bind-to-key delete-next-word M-FND +!endif + +; bring up the function key window + + 1 split-current-window + 1 select-buffer "[Function Keys]" + insert-string "f1 search-> f2 <-search | MicroEMACS: Text Editor~n" + insert-string "f3 hunt-> f4 <-hunt | ~n" + insert-string "f5 fkeys f6 help | Available function key Pages include:~n" + insert-string "f7 nxt wind f8 pg[ ] | C Box Emacs TxBasic~n" + insert-string "f9 exit f10 save | [use the f8 key to load Pages]~n" + unmark-buffer + delete-window + set %rcfkeys FALSE + + !if &seq $os "unix" + + ;Allow mainframes to simulate function + ;keys with ^C and ^C shifted- + + store-procedure emulate-fkeys + !if ¬ $pending + write-message "FN-" + !endif + set %rcchar >key + set %rcchar &sindex "1234567890!@#$%^&*()" %rcchar + !if &equ %rcchar 0 + write-message "[Not Bound]" + !return + !endif + clear-message-line + set %rctmp "FN" + !if &gre %rcchar 10 + set %rctmp &cat "S-" %rctmp + !endif + set %rcchar &mid "12345678901234567890" %rcchar 1 + set %rctmp &bind &cat %rctmp %rcchar + !if &seq &lef %rctmp 1 "[" + set %rctmp &mid %rctmp 2 &sub &len %rctmp 2 + run %rctmp + !return + !endif + !force execute-named-command %rctmp + !endm + + macro-to-key emulate-fkeys ^C + + !endif + + !if &seq $os "MSWIN" + source "mewin.cmd" + !else + toggle-fkeys + !endif + +!if &seq $os "OS2" + set $sres VGA + set $sres CGA +!endif + +store-procedure toggle-insert + !if &gre &mod $cmode 64 31 + delete-mode "over" + !else + add-mode "over" + !endif +!endm +macro-to-key toggle-insert FNC + +set $discmd TRUE diff --git a/cmd_curses/emacs.rc b/cmd_curses/emacs.rc new file mode 100644 index 0000000..b408ae8 --- /dev/null +++ b/cmd_curses/emacs.rc @@ -0,0 +1,100 @@ +; EMACS.RC: Standard MicroEMACS Startup program +; for MicroEMACS 3.13 and above +; (C)opyright 1987-99 by Daniel M Lawrence +; Last Update: 11/13/93 + +;set $discmd TRUE +write-message "[Setting up....]" +;set $debug TRUE + +; If you hate clocks or position counters, comment these +;set $timeflag TRUE +set $posflag TRUE +set $sscroll TRUE + +; Set Default Global modes + +add-global-mode "white" +add-global-mode "BLACK" + +; Bring up Online-help system + +store-procedure get-help + set $discmd FALSE + source ehelp.cmd + set $discmd TRUE +!endm + +macro-to-menu get-help "Help>MicroEmacs help" + +; Set up default modes + +add-mode "white" +add-mode "BLACK" + +store-procedure set-default-mode +; set $debug TRUE + set %rctmp &sri $cfname "." + !if &equ %rctmp 0 + !return + !endif + set %rctmp &mid $cfname &add %rctmp 1 5 + !if &or &seq %rctmp "c" &seq %rctmp "h" + add-mode "cmode" + delete-mode "theox" + set $hardtab 4 + kill-abbrevs + !endif + !if &or &seq %rctmp "cpp" &seq %rctmp "hpp" + add-mode "cmode" + delete-mode "theox" + set $hardtab 4 + kill-abbrevs + !endif + !if &seq %rctmp "b" + add-mode "cmode" + add-mode "abbrev" + delete-mode "theox" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &seq %rctmp "basic" + add-mode "cmode" + add-mode "abbrev" + add-mode "theox" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &or &seq %rctmp "mss" &seq %rctmp "txt" + add-mode "wrap" + delete-mode "cmode" + delete-mode "theox" + set $hardtab 8 + kill-abbrevs + !endif +!endm +set $readhook set-default-mode + +; ***** Rebind the Function key group + +bind-to-key search-forward FN1 +bind-to-key search-reverse FN2 +bind-to-key hunt-forward FN3 +bind-to-key hunt-backward FN4 +;bind-to-key toggle-fkeys FN5 +macro-to-key get-help FN6 +bind-to-key next-window FN7 +bind-to-key previous-window FN8 +bind-to-key exit-emacs FN9 +bind-to-key save-file FN0 + +bind-to-key menu-drop FNb + +store-procedure toggle-insert + !if &gre &mod $cmode 64 31 + delete-mode "over" + !else + add-mode "over" + !endif +!endm +macro-to-key toggle-insert FNC \ No newline at end of file diff --git a/cmd_txb/babbrevs.cmd b/cmd_txb/babbrevs.cmd new file mode 100644 index 0000000..8e4c9cc --- /dev/null +++ b/cmd_txb/babbrevs.cmd @@ -0,0 +1,15 @@ +;set $debug TRUE +add-abbrev DIR DIRECT +add-abbrev IND INDEXED +add-abbrev INP INPUT +add-abbrev LIN "LINPUT ~"~", using ~"~",a$" +add-abbrev MR "MAT READ #" +add-abbrev MRN "MAT READNEXT #" +add-abbrev MRP "MAT READPREV #" +add-abbrev MW "MAT WRITE #" +add-abbrev OTH "OTHERWISE" +add-abbrev OUT "OUTPUT" +add-abbrev SEQ "SEQUENTIAL" +add-abbrev W "WINDOW" +add-abbrev WNE "WHILE NOT EOF( +!force set $debug FALSE diff --git a/cmd_txb/emacs.rc b/cmd_txb/emacs.rc new file mode 100644 index 0000000..a9b8c63 --- /dev/null +++ b/cmd_txb/emacs.rc @@ -0,0 +1,131 @@ +; EMACS.RC: Standard MicroEMACS Startup program +; for MicroEMACS 3.13 and above +; (C)opyright 1987-99 by Daniel M Lawrence +; Last Update: 11/13/93 + +;set $discmd TRUE +write-message "[Setting up....]" +;set $debug TRUE + +; If you hate clocks or position counters, comment these +;set $timeflag TRUE +set $posflag TRUE +set $sscroll TRUE + +; Set Default Global modes + +add-global-mode "white" +add-global-mode "BLACK" + +; Bring up Online-help system + +store-procedure get-help + set $discmd FALSE + source ehelp.cmd + set $discmd TRUE +!endm + +macro-to-menu get-help "Help>MicroEmacs help" + +; Set up default modes + +add-mode "white" +add-mode "BLACK" + +store-procedure set-default-mode +; set $debug TRUE + set %rctmp &sri $cfname "." + !if &equ %rctmp 0 + !return + !endif + set %rctmp &mid $cfname &add %rctmp 1 5 + !if &or &seq %rctmp "c" &seq %rctmp "h" + add-mode "cmode" + delete-mode "theox" + set $hardtab 4 + kill-abbrevs + !endif + !if &or &seq %rctmp "cpp" &seq %rctmp "hpp" + add-mode "cmode" + delete-mode "theox" + set $hardtab 4 + kill-abbrevs + !endif + !if &seq %rctmp "b" + add-mode "cmode" + add-mode "abbrev" + delete-mode "theox" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &seq %rctmp "basic" + add-mode "cmode" + add-mode "abbrev" + add-mode "theox" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &or &seq %rctmp "mss" &seq %rctmp "txt" + add-mode "wrap" + delete-mode "cmode" + delete-mode "theox" + set $hardtab 8 + kill-abbrevs + !endif +!endm +set $readhook set-default-mode + +; ***** Rebind the Function key group + +bind-to-key search-forward FN1 +bind-to-key search-reverse FN2 +bind-to-key hunt-forward FN3 +bind-to-key hunt-backward FN4 +;bind-to-key toggle-fkeys FN5 +macro-to-key get-help FN6 +bind-to-key next-window FN7 +bind-to-key previous-window FN8 +bind-to-key exit-emacs FN9 +bind-to-key save-file FN0 + +bind-to-key menu-drop FNb + +store-procedure toggle-insert + !if &gre &mod $cmode 64 31 + delete-mode "over" + !else + add-mode "over" + !endif +!endm +macro-to-key toggle-insert FNC + +store-procedure convert-to-utf8 +; set $debug TRUE + set %cmode &band $cmode 16384 + !if &equ %cmode 16384 + unmark-buffer + filter-buffer "theoxutf" + delete-mode "theox" + !else + write-message "[File already uses Unicode character set]" + !endif + !force set $debug FALSE +!endm + +store-procedure convert-to-theox +; set $debug TRUE + set %cmode &band $cmode 16384 + !if &equ %cmode 0 + unmark-buffer + filter-buffer "utftheox" + add-mode "theox" + !else + write-message "[File already uses TheoX character set]" + !endif + !force set $debug FALSE +!endm + +macro-to-menu convert-to-utf8 "Modify>Convert to UTF-8" +macro-to-menu convert-to-theox "Modify>Convert to TheoX" + +execute-file tpage.cmd diff --git a/cmd_txb/tpage.cmd b/cmd_txb/tpage.cmd new file mode 100644 index 0000000..36009b9 --- /dev/null +++ b/cmd_txb/tpage.cmd @@ -0,0 +1,315 @@ +; TPAGE.CMD: TxBasic language MENU Page +; for MicroEMACS 3.9e and above +; + +; set up the "clean" procedure + +store-procedure clean + delete-buffer "[b-indent]" + delete-buffer "[b-indent-brace]" + delete-buffer "[b-check]" + delete-buffer "[b-compile]" + delete-buffer "[b-compile-release]" + delete-buffer "[b-compile-speed]" + delete-buffer "[b-compile-debug]" + delete-buffer "[b-compile-gdb]" + delete-buffer "[b-run]" + delete-buffer "[b-debug]" + delete-buffer "[b-gdb]" + delete-buffer "[b-new-if]" + delete-buffer "[b-new-switch]" + delete-buffer "[b-new-for]" + delete-buffer "[b-new-while]" + set $cmode %oldmode + set $gmode %oldgmode +!endm + +store-procedure b-indent +; set $debug TRUE + unmark-buffer + filter-buffer &cat "txf --unbrace --upper -i" $hardtab + !force set $debug FALSE +!endm + +store-procedure b-indent-brace +; set $debug TRUE + unmark-buffer + filter-buffer &cat "txf --brace --upper -i" $hardtab + !force set $debug FALSE +!endm + +store-procedure b-compile +; set $debug TRUE + !if %rcfkeys + !force toggle-fkeys + !endif + delete-other-windows + delete-buffer "[S-F9 prev error S-F10 next error]" + save-file + set %cfname $cfname + set %cmode &band $cmode 16384 + !if &equ %cmode 0 + !force pipe-command &cat &cat %command " --utf8 " $cfname + !else + !force pipe-command &cat %command $cfname + !endif + name-buffer "[S-F9 prev error S-F10 next error]" + end-of-file + !if &equ $curline 1 + !force delete-mode "VIEW" + insert-string &cat &cat %cfname " successfully " %work + unmark-buffer + !force 1 resize-window + add-mode "VIEW" + !force delete-mode "CMODE" + next-window + !else + beginning-of-file + !force 5 resize-window + add-mode "VIEW" + !force delete-mode "CMODE" + next-window + beginning-of-file + execute-procedure "b-next-error" + !endif + !force set $debug FALSE +!endm + +store-procedure b-check +; set $debug TRUE + set %command "mepipe txlint " + set %work "checked" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-compile-release +; set $debug TRUE + set %command "mepipe txb -T -C" + set %work "compiled" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-compile-speed +; set $debug TRUE + set %command "mepipe txb" + set %work "compiled" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-compile-debug +; set $debug TRUE + set %command "mepipe txb -d -T" + set %work "compiled" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-compile-gdb +; set $debug TRUE + set %command "mepipe txb -g -T -C" + set %work "compiled" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-run +; set $debug TRUE + set %rctmp &sri $cfname "." + set %cfname &mid $cfname 1 &sub %rctmp 1 + shell-command &cat "merun ./" %cfname + !force set $debug FALSE +!endm + +store-procedure b-gdb +; set $debug TRUE + set %rctmp &sri $cfname "." + set %cfname &mid $cfname 1 &sub %rctmp 1 + shell-command &cat "gdb -tui ./" %cfname + !force set $debug FALSE +!endm + +store-procedure b-prev-error +; set $debug TRUE + delete-other-windows + split-current-window + select-buffer "[S-F9 prev error S-F10 next error]" + add-mode "VIEW" + !force 5 resize-window + beginning-of-line + !force search-reverse ", line " + !if &seq $status FALSE + write-message "[No more error]" + previous-window + !return + !endif + 7 forward-character + set-mark + end-of-word + set %line $region + previous-window + !force %line goto-line + !force set $debug FALSE +!endm + +store-procedure b-next-error +; set $debug TRUE + delete-other-windows + split-current-window + select-buffer "[S-F9 prev error S-F10 next error]" + add-mode "VIEW" + !force 5 resize-window + !force search-forward ", line " + !if &seq $status FALSE + write-message "[No more error]" + previous-window + !return + !endif + set-mark + end-of-word + set %line $region + previous-window + !force %line goto-line + !force set $debug FALSE +!endm + +store-procedure b-new-if + set %cond @"Logical expression: " +; set $debug TRUE + insert-string &cat "IF " %cond + newline-and-indent + newline-and-indent + insert-string "ELSE" + newline-and-indent + handle-tab + newline-and-indent + insert-string "IFEND" + newline-and-indent + delete-previous-character + 4 previous-line + handle-tab + end-of-line + !force set $debug FALSE +!endm + +store-procedure b-new-select + set %cond @"Expression: " +; set $debug TRUE + insert-string &cat "SELECT " %cond + newline-and-indent + newline-and-indent + insert-string "CASE" + newline-and-indent + handle-tab + newline-and-indent + insert-string "CEND" + newline-and-indent + delete-previous-character + 6 previous-line + end-of-line + !force set $debug FALSE +!endm + +; FOR NEXT +store-procedure b-new-for + set %cond @"Variable name: " +; set $debug TRUE + insert-string &cat &cat "FOR " %cond "=" + newline-and-indent + handle-tab + newline-and-indent + insert-string &cat "NEXT " %cond + 2 previous-line + end-of-line + !force set $debug FALSE +!endm + +; +; WHILE WEND +store-procedure b-new-while + set %cond @"Logical expression: " +; set $debug TRUE + insert-string &cat "WHILE " %cond + newline-and-indent + handle-tab + newline-and-indent + insert-string "WEND" + previous-line + end-of-line + !force set $debug FALSE +!endm + +store-procedure toggle-errors + !if %rcerrors + !goto rcfoff + !endif + +; toggle errors window on + save-window + 1 next-window + !if &sequal $cbufname "emacs.hlp" + delete-window + !endif + !if ¬ &sequal $cbufname "[S-F9 prev error S-F10 next error]" + 1 split-current-window + 1 select-buffer "[S-F9 prev error S-F10 next error]" + add-mode "red" + add-mode "WHITE" + !force 5 resize-window + 1 goto-line + !endif + set %rcfkeys TRUE + !force restore-window + !if &sequal $cbufname "[S-F9 prev error S-F10 next error]" + next-window + !endif + write-message "[Errors window ON]" + !return + + ;Toggle the error window off +*rcfoff + save-window + 1 next-window + !if &sequal "[S-F9 prev error S-F10 next error]" $cbufname + delete-window + !endif + !force restore-window + write-message "[Errors window OFF]" + set %rcerrors FALSE +!endm + +macro-to-key b-indent S-FN1 +macro-to-key b-indent-brace S-FN2 +macro-to-key b-check S-FN3 +macro-to-key b-compile-release S-FN4 +macro-to-key b-compile-speed S-FN5 +macro-to-key b-compile-debug S-FN6 +macro-to-key b-compile-gdb S-FN7 +macro-to-key b-run S-FN8 +macro-to-key b-prev-error S-FN9 +macro-to-key b-next-error S-FN0 + +macro-to-menu b-indent "TxBasic>Format b" +macro-to-menu b-indent-brace "TxBasic>Format w" +macro-to-menu b-check "TxBasic>Check" +macro-to-menu b-compile-release "TxBasic>Compile r" +macro-to-menu b-compile-speed "TxBasic>Compile for s" +macro-to-menu b-compile-debug "TxBasic>Compile for T" +macro-to-menu b-compile-gdb "TxBasic>Compile for g" +macro-to-menu b-run "TxBasic>Run" +macro-to-menu b-gdb "TxBasic>Run t" +macro-to-menu b-prev-error "TxBasic>Prev" +macro-to-menu b-next-error "TxBasic>Next" +macro-to-menu b-new-if "TxBasic>IF" +macro-to-menu b-new-select "TxBasic>SELECT" +macro-to-menu b-new-for "TxBasic>FOR" +macro-to-menu b-new-while "TxBasic>WHILE" + +; Set up CMODE +add-mode CMODE +add-global-mode CMODE +set $hardtab 5 + +write-message "[TxBasic perspective loaded]" diff --git a/cygwin/Makefile b/cygwin/Makefile new file mode 100644 index 0000000..3f82406 --- /dev/null +++ b/cygwin/Makefile @@ -0,0 +1,117 @@ +# Linux makefile for +# MicroEMACS 5.00 with UTF-8 character set +# (C)Copyright 1995 by Daniel Lawrence +# all rights reserved + +# modify the following lines with the proper relative directories + +# object file directory +OBJD = . +# source file directory +SRCD = ../src +# header file directory +HDIR = ../h + +# options and arguments to the C compiler + +#CFLAGS += -I. -I$(HDIR) +CFLAGS = -g -I. -I$(HDIR) -DLINUX -D_XOPEN_SOURCE_EXTENDED=1 + +# list of header files + +HFILES = estruct.h $(HDIR)/edef.h $(HDIR)/efunc.h $(HDIR)/epath.h $(HDIR)/ebind.h $(HDIR)/eproto.h + +#list of object files + +F1 = $(OBJD)/abbrev.o $(OBJD)/basic.o $(OBJD)/bind.o $(OBJD)/buffer.o $(OBJD)/char.o +F2 = $(OBJD)/crypt.o $(OBJD)/curses.o $(OBJD)/display.o $(OBJD)/dolock.o $(OBJD)/message.o +F3 = $(OBJD)/eval.o $(OBJD)/exec.o $(OBJD)/file.o $(OBJD)/fileio.o $(OBJD)/input.o +F4 = $(OBJD)/isearch.o $(OBJD)/keyboard.o $(OBJD)/libhelp.o $(OBJD)/line.o $(OBJD)/lock.o +F5 = $(OBJD)/main.o $(OBJD)/mouse.o $(OBJD)/screen.o $(OBJD)/random.o $(OBJD)/region.o +F6 = $(OBJD)/search.o $(OBJD)/replace.o $(OBJD)/tags.o $(OBJD)/theox.o $(OBJD)/undo.o +F7 = $(OBJD)/unix.o $(OBJD)/unixterm.o $(OBJD)/utf8.o $(OBJD)/window.o $(OBJD)/word.o + +# product list + +all: emacs + +OFILES = $(F1) $(F2) $(F3) $(F4) $(F5) $(F6) $(F7) + +emacs: $(OFILES) + $(CC) $(CFLAGS) $(OFILES) -lncursesw -lc -o emacs + +$(OBJD)/abbrev.o: $(SRCD)/abbrev.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/abbrev.o $(SRCD)/abbrev.c +$(OBJD)/basic.o: $(SRCD)/basic.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/basic.o $(SRCD)/basic.c +$(OBJD)/bind.o: $(SRCD)/bind.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/bind.o $(SRCD)/bind.c +$(OBJD)/buffer.o: $(SRCD)/buffer.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/buffer.o $(SRCD)/buffer.c +$(OBJD)/char.o: $(SRCD)/char.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/char.o $(SRCD)/char.c +$(OBJD)/crypt.o: $(SRCD)/crypt.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/crypt.o $(SRCD)/crypt.c +$(OBJD)/curses.o: $(SRCD)/curses.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/curses.o $(SRCD)/curses.c +$(OBJD)/cmdfix.o: $(SRCD)/cmdfix.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/cmdfix.o $(SRCD)/cmdfix.c +$(OBJD)/display.o: $(SRCD)/display.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/display.o $(SRCD)/display.c +$(OBJD)/dolock.o: $(SRCD)/dolock.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/dolock.o $(SRCD)/dolock.c +$(OBJD)/message.o: $(SRCD)/message.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/message.o $(SRCD)/message.c +$(OBJD)/eval.o: $(SRCD)/eval.c $(HFILES) $(HDIR)/evar.h + $(CC) $(CFLAGS) -c -o $(OBJD)/eval.o $(SRCD)/eval.c +$(OBJD)/exec.o: $(SRCD)/exec.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/exec.o $(SRCD)/exec.c +$(OBJD)/file.o: $(SRCD)/file.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/file.o $(SRCD)/file.c +$(OBJD)/fileio.o: $(SRCD)/fileio.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/fileio.o $(SRCD)/fileio.c +$(OBJD)/input.o: $(SRCD)/input.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/input.o $(SRCD)/input.c +$(OBJD)/isearch.o: $(SRCD)/isearch.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/isearch.o $(SRCD)/isearch.c +$(OBJD)/keyboard.o: $(SRCD)/keyboard.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/keyboard.o $(SRCD)/keyboard.c +$(OBJD)/libhelp.o: $(SRCD)/libhelp.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/libhelp.o $(SRCD)/libhelp.c +$(OBJD)/line.o: $(SRCD)/line.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/line.o $(SRCD)/line.c +$(OBJD)/lock.o: $(SRCD)/lock.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/lock.o $(SRCD)/lock.c +$(OBJD)/main.o: $(SRCD)/main.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/main.o $(SRCD)/main.c +$(OBJD)/mouse.o: $(SRCD)/mouse.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/mouse.o $(SRCD)/mouse.c +$(OBJD)/unix.o: $(SRCD)/unix.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/unix.o $(SRCD)/unix.c +$(OBJD)/unixterm.o: $(SRCD)/unixterm.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/unixterm.o $(SRCD)/unixterm.c +$(OBJD)/utf8.o: $(SRCD)/utf8.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/utf8.o $(SRCD)/utf8.c +$(OBJD)/random.o: $(SRCD)/random.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/random.o $(SRCD)/random.c +$(OBJD)/region.o: $(SRCD)/region.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/region.o $(SRCD)/region.c +$(OBJD)/screen.o: $(SRCD)/screen.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/screen.o $(SRCD)/screen.c +$(OBJD)/search.o: $(SRCD)/search.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/search.o $(SRCD)/search.c +$(OBJD)/replace.o: $(SRCD)/replace.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/replace.o $(SRCD)/replace.c +$(OBJD)/tags.o: $(SRCD)/tags.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/tags.o $(SRCD)/tags.c +$(OBJD)/theox.o: $(SRCD)/theox.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/theox.o $(SRCD)/theox.c +$(OBJD)/undo.o: $(SRCD)/undo.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/undo.o $(SRCD)/undo.c +$(OBJD)/window.o: $(SRCD)/window.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/window.o $(SRCD)/window.c +$(OBJD)/word.o: $(SRCD)/word.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/word.o $(SRCD)/word.c + +clean: + rm -f *.o emacs diff --git a/cygwin/estruct.h b/cygwin/estruct.h new file mode 100644 index 0000000..d4c44a3 --- /dev/null +++ b/cygwin/estruct.h @@ -0,0 +1,1377 @@ +/* ESTRUCT: Structure and preprocesser defined for + MicroEMACS 4.01 + + (C)Copyright 1997 by Daniel Lawrence + written by Daniel Lawrence + based on code by Dave G. Conroy, + Steve Wilhite and George Jones + + Unicode support by Jean-Michel Dubois +*/ + +#ifdef LATTICE +#undef LATTICE /* don't use their definitions...use ours */ +#endif +#ifdef MSDOS +#undef MSDOS +#endif +#ifdef WINNT +#undef WINNT +#endif +#ifdef AMIGA +#undef AMIGA +#endif +#ifdef EGA +#undef EGA +#endif +#ifdef CTRLZ +#undef CTRLZ +#endif + +/* Program Identification..... + + PROGNAME should always be MicroEMACS for a distribution + unmodified version. People using MicroEMACS as a shell + for other products should change this to reflect their + product. Macros can query this via the $progname variable +*/ + +#define PROGNAME "MicroEMACS" +#define VERSION "5.10e" + +/* Machine/OS definitions */ +/* [Set one of these!!] */ + +#define AMIGA 0 /* AmigaDOS */ +#define AOSVS 0 /* Data General AOS/VS */ +#define AUX 0 /* Apple UNIX for Macintosh */ +#define AIX 0 /* IBM UNIX for various machines*/ +#define AVIION 0 /* Data General AViiON */ +#define BSD 0 /* UNIX BSD 4.2 and ULTRIX */ +#define FINDER 0 /* Macintosh OS */ +#define FREEBSD 0 /* FREEBSD 386 version 2 or + */ +#define HPUX8 0 /* HPUX HP 9000 ver 8 or less */ +#define HPUX9 0 /* HPUX HP 9000 ver 9 */ +#define MPE 0 /* HP MPE/XL */ +#define MSDOS 0 /* MS-DOS */ +#define WINNT 0 /* MS-Win NT */ +#define WINXP 0 /* Windows XP/Visual studio 2008*/ +#define OS2 0 /* Microsoft or IBM OS/2 */ +#define SMOS 0 /* Supermax UNIX System V */ +#define SUN 0 /* SUN v4.0 */ +#define TOS 0 /* ST520, TOS */ +#define USG 1 /* UNIX system V */ +#define VMS 0 /* VAX/VMS */ +#define WMCS 0 /* Wicat's MCS */ +#define XENIX 0 /* IBM-PC SCO XENIX */ +#define LINUX 1 /* Linux */ + +#if LINUX +#undef USG +#define USG 1 +#endif +/* Compiler definitions */ +/* [Set one of these!!] */ +#define ALCYON 0 /* ALCYON Atari ST compiler */ +#define AZTEC 0 /* Aztec C 4.00e ONLY for the amiga now... */ +#define DGC 0 /* Data General AOS/VS C... */ +#define GCC 1 /* the GNU C compiler */ +#define IC 0 /* Rational Systems Instant C */ +#define LATTICE 0 /* Lattice 2.14 through 3.0 compilers */ +#define MSC 0 /* MicroSoft C compile version 3 and up */ +#define MWC 0 /* Mark Williams C */ +#define TURBO 0 /* Turbo C and Borland C++ under MSDOS */ +#define UNIX 0 /* a standard UNIX compiler (cc) */ +#define ZTC 0 /* Zortech C/C++ 1.02 thru 2.10 under MSDOS */ + +/* Machine stack growth direction. */ +/* [Set this to 1 if your machine stack grows UP!!!] */ +/* data general mv/eclipse series stack grows up. */ +/* dec vax series stack grows down... got it??? */ + +#define STACK_GROWS_UP 0 + +/* Debugging options */ +#define RAMSIZE 0 /* dynamic RAM memory usage tracking */ +#define RAMSHOW 0 /* auto dynamic RAM reporting */ +#define RAMTRCK 0 /* send debug info to MALLOC.DAT */ +#define DEBUG_SEARCH 0 /* pop some search info on patterns */ + +/* Special keyboard/network definitions */ + +#define ATKBD 0 /* AT-style keyboard with F11, F12 & grey keys */ +#define WANGPC 0 /* WangPC - mostly escape sequences */ +#define VT100 0 /* Handle VT100 style keypad - NOT VMS. */ +#define KEYPAD 0 /* VMS - turn on and off application */ + /* keypad automatically */ +#define XONDATA 0 /* VMS - set to force /NOTTSYNC/NOHOSTSY */ +#define RMSIO 0 /* VMS - skip the rotten C runtime and */ + /* use RMS directly */ +#define OPTMEM 0 /* VMS 5.0 and up - use a less standard */ + /* but more efficient memory allocator */ + +/* Terminal Output definitions */ +/* [Set one of these!!] */ + +#define ANSI 0 /* ANSI escape sequences */ +#define CURSES 1 /* Use CURSES */ +#define DASHER 0 /* DG Dasher 2xx/4xx crts */ +#define DG10 0 /* Data General system/10 */ +#define FMR 0 /* Fujitsu FMR series driver */ +#define HP110 0 /* HP110 screen driver */ +#define HP150 0 /* HP150 screen driver */ +#define I55 0 /* IBM PS55 DOS J4.0/V */ +#define IBMPC 0 /* IBM-PC CGA/MONO/EGA/VGA drvr */ +#define MAC 0 /* Macintosh */ +#define NEC 0 /* NEC-9801VM driver */ +#define OS2NPM 0 /* OS/2 non-Presentation Mgr. */ +#define SMG 0 /* SMG library on VMS */ +#define ST52 0 /* Atari 520/1040ST screen */ +#define TERMCAP 0 /* Use TERMCAP */ +#define TIPC 0 /* TI Professional PC driver */ +#define VT52 0 /* VT52 terminal (Zenith). */ +#define NTCON 0 /* Windows NT console */ +#define XPCON 0 /* windows XP console app */ +#define XVT 0 /* XVT windowing system */ +#define Z309 0 /* Zenith 100 PC family driver */ + +/* Windowing system style (pick one) */ + +#define WINDOW_TEXT 1 /* [default] Text mode */ +#define WINDOW_MSWIN 0 /* MicroSoft Windows */ +#define WINDOW_MSWIN32 0 /* MicroSoft Windows 32 bit API */ +#define WINDOW_X 0 /* X/Unix */ + +/* Language text options (pick one) */ + +#define ENGLISH 1 /* [default] */ +#define FRENCH 0 +#define SPANISH 0 +#define GERMAN 0 +#define DUTCH 0 +#define PLATIN 0 /* Pig Latin */ +#define JAPAN 0 +#define LATIN 0 /* real Latin */ + +/* Configuration options */ + +#define TYPEAH 1 /* type ahead causes update to be skipped */ +#define LOGFLG 0 /* send all executed commands to EMACS.LOG */ +#define VISMAC 0 /* update display during keyboard macros */ +#define CTRLZ 0 /* add a ^Z at end of files under MSDOS only */ +#define CLEAN 0 /* de-alloc memory on exit */ +#define CALLED 0 /* is emacs a called subroutine? or stand alone */ + +#define REVSTA 0 /* Status line appears in reverse video */ +#define COLOR 1 /* color commands and windows */ + +#define FILOCK 1 /* file locking under unix BSD 4.2 */ +#define ISRCH 1 /* Incremental searches like ITS EMACS */ +#define FLABEL 0 /* function key label code [HP150] */ +#define CRYPT 1 /* file encryption enabled? */ +#define MAGIC 1 /* include regular expression matching? */ +#define MOUSE 1 /* Include routines for mouse actions */ +#define NOISY 1 /* Use a fancy BELL if it exists */ +#define CTAGS 1 /* include vi-like tagging? */ +#define VARARG 1 /* use varargs.h for mlwrite() */ + +#if XVT +#undef COLOR +#define COLOR 1 /* overide this to be TRUE for XVT always */ +#endif + +#define JMDEXT 1 /* enable J-M Dubois' extensions */ + +#if JMDEXT +#define BACKUP 1 /* backup previous file version */ +#define LIBHELP 1 /* online help from Mark Williams version */ +#define DYNMSGS 1 /* dynamic load of messages */ +#define THEOX 1 /* allow TheoX character set files edition */ + /* including semi-graphics entry from numeric */ + /* keypad (require UTF8) */ +#define TXBASIC 1 /* TxBasic IDE menu */ +#endif + +#if DYNMSGS +#define OQUOTE_CHAR 34 +#define CQUOTE_CHAR 34 +#endif + +/* Character set options */ +/* [Set one of these!!] */ +#define ASCII 0 /* use ASCII char sequences */ +#define EBCDIC 0 /* later IBM mainfraim versions will use EBCDIC */ +#define UTF8 1 /* use UTF-8 encoded Unicode */ + +#if UTF8 +#include "utf8.h" +#include +#else +#undef THEOX +#define THEOX 0 +#endif + +/* handle constant and voids properly */ + +#if VMS +#define CONST readonly +#define VOID void +#define NOSHARE noshare +#else +#if AOSVS +#define CONST $shared $align(1) /* fake a const */ +#define VOID +#define NOSHARE $low32k $align(1) /* attempt to optimize read/write vars. */ +#else + +#if __STDC__ || MSC || TURBO || GCC || (AMIGA && LATTICE) +#define CONST const +#define VOID void +#define NOSHARE +#else +#define CONST +#if IC +#define VOID void +#else +#define VOID +#endif +#define NOSHARE +#endif + +#endif +#endif + +/* System dependent library redefinitions, structures and includes */ + +/* multibyte character support? */ + +#if NEC || FMR || I55 +#define DBCS 1 /* double byte character sets enabled */ +#define INSDEL 1 /* use insert/delete line display optimizations */ + +/* define DBCS prefix bytes */ +#define is2char(ch) (((ch&0xff) >= 0x81 && (ch&0xff) <= 0x9f) || ((ch&0xff) >=0xe0 && (ch&0xff) <= 0xfc)) + +#else +#define DBCS 0 +#define INSDEL 0 +#endif + +/* Can we catch the SIGWINCH (the window size change signal)? */ + +#if AIX || HPUX9 || LINUX +#define HANDLE_WINCH 1 +#else +#define HANDLE_WINCH 0 +#endif + +/* Prototypes in use? */ + +#if MSC || TURBO || IC || VMS || GCC || ZTC +#define PROTO 1 +#else +#define PROTO 0 +#endif + +/* the following define allows me to initialize unions... + otherwise we make them structures (like the keybinding table) */ + +#if __STDC__ || MSC || TURBO || IC || ZTC +#define ETYPE union +#else +#define ETYPE struct +#endif + +/* Instant C can't do stat()s. Arrrg. No file locking for you */ +#if IC && MSDOS +#undef FILOCK +#define FILOCK 0 +#endif + +/* Mark Williams/Atari has no standard or varargs or directory functions */ +#if TOS & MWC +#undef VARARG +#define VARARG 0 +#undef FILOCK +#define FILOCK 0 +#endif + +/* MS-Windows */ + +#if WINNT || WINDOW_MSWIN || WINDOW_MSWIN32 +#if WINDOW_MSWIN32 +#undef WINDOW_MSWIN +#define WINDOW_MSWIN 1 +#endif +#if WINDOW_MSWIN && (WINNT || WINXP) +#undef WINDOW_MSWIN32 +#define WINDOW_MSWIN32 1 +#endif +#if 1 +#undef MAC /* Mac conflicts with a definition used by rpc.h */ +#undef VOID /* windows.h will wind up defining this when compiled as a console app */ +#include /* --------- Huge include file here !!! ---------*/ +#ifndef VOID +#define VOID void /* Redefine, incase we are compiled as a Windows app */ +#endif +#endif +#if NTCON +#include +#include +#include +#endif + +#undef NEAR +#define NEAR +#define DNEAR +#if MSC || IC +#undef CDECL +#define CDECL __cdecl +#define DUMMYSZ 1 /* dummy size for unsized extern arrays to avoid + silly DGROUP fixup */ +#else +#if TURBO +#define DUMMYSZ /* nothing */ +#else +#define CDECL _cdecl /* ZTC */ +#define DUMMYSZ /* nothing */ +#endif +#endif + +#if (WINNT || WINXP) && !WINDOW_MSWIN +#define EXPORT /* Windows NT doesn't like this */ +#endif + +#if WINDOW_MSWIN +#undef TYPEAH +#define TYPEAH 0 /* typeahead is handled at the term driver level */ +#undef CALLED +#define CALLED 1 /* under MS Windows, "main" resides in the sys driver */ +#if WINNT || WINXP +#define EXPORT /* Windows NT doesn't like this */ +#elif MSC +#define EXPORT __export +#else +#define EXPORT _export /* Fine for TURBO and ZTC */ +#endif +#endif +#else + +/* neither Windows NT nor MS-Windows */ + +#define DUMMYSZ /* nothing */ + +#if MSDOS & (TURBO | MSC | TIPC) +#define NEAR +#define DNEAR +#define pascal +#define CDECL cdecl +#else +#if MSDOS & ZTC +#define NEAR +#define DNEAR +#define _pascal +#define CDECL _cdecl +#else +#define NEAR +#define DNEAR +#define PASCAL +#define CDECL +#endif +#endif + +#endif + +#if TURBO +#include +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if IC +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if LATTICE & MSDOS +/* you may have to remove this one definition with LATTICE version + 3.2 and above */ +#define unsigned +#endif + +#if IC +#define inp inportb +#define outp outportb +#define intdos(a, b) int86(33, a, b) +#endif + +#if AZTEC +#undef putc +#undef getc +#if MSDOS +#define getc a1getc +#define int86 sysint +#define intdos(a, b) sysint(33, a, b) +#define inp inportb +#define outp outportb +#else +#define getc agetc +#endif +#define putc aputc + +struct XREG { + unsigned ax,bx,cx,dx,si,di,ds,es; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh,d1,d2,e1,e2; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; + +struct SREGS { + unsigned cs, ss, ds, es; +}; +#endif + +#if MSDOS & MWC +#include +#define int86(a, b, c) intcall(b, c, a) +#define intdos(a, b) intcall(a, b, DOSINT) +#define inp(a) in(a) +#define outp(a, b) out(a, b) +#define movmem(a, b, c) memcpy(b, a, c) + +struct XREG { + unsigned int ax,bx,cx,dx,si,di,ds,es,flags; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh; + unsigned int ds,es,flags; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; +#endif + +#if MSDOS & MSC +#include +#include +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#define movmem(a, b, c) memcpy(b, a, c) +#define _strrev(a) strrev(a) +#endif + +#if MSDOS & LATTICE +#undef CPM +#undef LATTICE +#include +#undef CPM +#endif + +/* System V doesn't name this the same as others */ +#if USG | AIX | AUX | SUN | (OS2 & MSC) +#define movmem(a, b, c) memcpy(b, a, c) +#define min(a,b) ((a)>(b)?(b):(a)) +#define max(a,b) ((a)>(b)?(a):(b)) +#endif + +/* this keeps VMS happy */ +#if VMS +#define getname xgetname +#define unlink(a) delete(a) +#endif + +/* some options for AOS/VS */ +#if AOSVS +#define ORMDNI 1 +#endif + +/* define some ability flags */ + +#if (IBMPC | Z309 | FMR | TIPC) & !(WINDOW_MSWIN | WINDOW_MSWIN32) +#define MEMMAP 1 +#else +#define MEMMAP 0 +#endif + +#if MSDOS | WINNT | WINXP | OS2 | USG | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | (TOS & MWC) | WMCS | SUN | MPE +#define ENVFUNC 1 +#else +#define ENVFUNC 0 +#endif + +#if AUX +#define RETCHAR '\n' +#else +#define RETCHAR '\r' +#endif + +#if THEOS +#define _CTYPE_NO_MACRO 1 +#define RET_CHAR '\n' +#else +#define RET_CHAR '\r' +#endif + +#if MPE +#define DIRSEPSTR "." +#define DIRSEPCHAR '.' +#else +#if TOS || MSDOS || WINNT || WINXP || OS2 +#define DIRSEPSTR "\\" +#define DIRSEPCHAR '\\' +#define DRIVESEPCHAR ':' +#else +#define DIRSEPSTR "/" +#define DIRSEPCHAR '/' +#define DRIVESEPCHAR '\0' +#endif +#endif + +#if VARARG +#if (GCC == 0) && (USG || AIX || AUX || BSD || FREEBSD || SUN || XENIX || HPUX8 || HPUX9 || AVIION || MPE) +#define VARG 1 +#define SARG 0 +#include +#else +#define VARG 0 +#define SARG 1 +#include +#endif +#endif + +#if ZTC +#include +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +/* Emacs global flag bit definitions (for gflags) */ + +#define GFREAD 1 /* read first file in at startup */ +#define GFSDRAW 2 /* suppress a screen redraw */ +#define GFEXIT 4 /* exit from emacs pending */ + +/* internal constants */ + +#define NBINDS 300 /* max # of bound keys */ +#if AOSVS | VMS | WINNT | WINXP | SUN | BSD | FREEBSD | USG | ZENIX | HPUX8 | HPUX9 | OS2 +#define NFILEN 256 +#else +#define NFILEN 80 /* # of bytes, file name */ +#endif +#define NBUFN 128 /* # of bytes, buffer name */ +#define NLINE 512 /* # of bytes, input line */ +#define NSTRING 512 /* # of bytes, string buffers */ +#define NKBDM 4096 /* # of strokes, keyboard macro */ +#define NPAT 512 /* # of bytes, pattern */ +#define HUGENUM 1000 /* Huge number */ +#define NLOCKS 256 /* max # of file locks active */ +#define NCOLORS 16 /* number of supported colors */ +#define KBLOCK 250 /* sizeof kill buffer chunks */ +#define NRING 16 /* # of buffers in kill ring */ +#define NBLOCK 16 /* line block chunk size */ +#define NVSIZE 16 /* max #chars in a var name */ +#define NMARKS 16 /* number of marks */ +#define MAXSYM 32 /* max # chars in symbol to expand */ +#define MINFLEN 3 /* min # chars to match &func */ + +#if UTF8 +#define CTRL 0x01000000 /* Control flag, or'ed in */ +#define META 0x02000000 /* Meta flag, or'ed in */ +#define CTLX 0x04000000 /* ^X flag, or'ed in */ +#define SPEC 0x08000000 /* special key (function keys) */ +#define MOUS 0x10000000 /* alternative input device (mouse) */ +#define SHFT 0x20000000 /* shifted (for function keys) */ +#define ALTD 0x40000000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ +#define CMSK 0x00FFFFFF /* Character mask */ +#define SHIFTPFX 24 /* prefix shift in unsigned int */ +#else +#define CTRL 0x0100 /* Control flag, or'ed in */ +#define META 0x0200 /* Meta flag, or'ed in */ +#define CTLX 0x0400 /* ^X flag, or'ed in */ +#define SPEC 0x0800 /* special key (function keys) */ +#define MOUS 0x1000 /* alternative input device (mouse) */ +#define SHFT 0x2000 /* shifted (for function keys) */ +#define ALTD 0x4000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ +#define CMSK 0x00FF /* Character mask */ +#define SHIFTPFX 8 /* prefix shift in unsigned int */ +#endif + +#define BINDNUL 0 /* not bound to anything */ +#define BINDFNC 1 /* key bound to a function */ +#define BINDBUF 2 /* key bound to a buffer */ + +#ifdef FALSE +#undef FALSE +#endif +#ifdef TRUE +#undef TRUE +#endif + +#define FALSE 0 /* False, no, bad, etc. */ +#define TRUE 1 /* True, yes, good, etc. */ +#define ABORT 2 /* Death, ^G, abort, etc. */ +#define FAILD 3 /* not-quite fatal false return */ + +#define STOP 0 /* keyboard macro not in use */ +#define PLAY 1 /* playing */ +#define RECORD 2 /* recording */ + +/* Completion types */ + +#define CMP_BUFFER 0 +#define CMP_COMMAND 1 +#define CMP_FILENAME 2 + +/* Directive definitions */ + +#define DIF 0 +#define DELSE 1 +#define DENDIF 2 +#define DGOTO 3 +#define DRETURN 4 +#define DENDM 5 +#define DWHILE 6 +#define DENDWHILE 7 +#define DBREAK 8 +#define DFORCE 9 + +#define NUMDIRS 10 + +/* + * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for + * routines that need directions. + */ +#define PTBEG 0 /* Leave the point at the beginning on search */ +#define PTEND 1 /* Leave the point at the end on search */ +#define FORWARD 0 /* do things in a forward direction */ +#define REVERSE 1 /* do things in a backwards direction */ + +#define FIOSUC 0 /* File I/O, success. */ +#define FIOFNF 1 /* File I/O, file not found. */ +#define FIOEOF 2 /* File I/O, end of file. */ +#define FIOERR 3 /* File I/O, error. */ +#define FIOMEM 4 /* File I/O, out of memory */ +#define FIOFUN 5 /* File I/O, eod of file/bad line*/ +#define FIODEL 6 /* Can't delete/rename file */ + +#if WINDOW_MSWIN +/* values for the fbusy flag */ +#define FREADING 1 /* file read in progress */ +#define FWRITING 2 /* file write in progress */ +/* if no file activity, the value FALSE is used */ +#endif + +#define CFCPCN 0x0001 /* Last command was C-P, C-N */ +#define CFKILL 0x0002 /* Last command was a kill */ +#define CFSRCH 0x0004 /* last command was a search */ +#define CFYANK 0x0008 /* last command was a yank */ + +#define SRNORM 0 /* end past, begin front */ +#define SRBEGIN 1 /* always at front */ +#define SREND 2 /* always one past end */ + +#define BELL 0x07 /* a bell character */ +#define TAB 0x09 /* a tab character */ + +#if USG | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | SUN | XENIX | AVIION +#define PATHCHR ':' +#else +#if WMCS || MPE +#define PATHCHR ',' +#else +#define PATHCHR ';' +#endif +#endif + +#define INTWIDTH sizeof(int) * 3 +#define LONGWIDTH sizeof(long) * 3 + +/* Macro argument token types */ + +#define TKNUL 0 /* end-of-string */ +#define TKARG 1 /* interactive argument */ +#define TKBUF 2 /* buffer argument */ +#define TKVAR 3 /* user variables */ +#define TKENV 4 /* environment variables */ +#define TKFUN 5 /* function.... */ +#define TKDIR 6 /* directive */ +#define TKLBL 7 /* line label */ +#define TKLIT 8 /* numeric literal */ +#define TKSTR 9 /* quoted string literal */ +#define TKCMD 10 /* command name */ + +/* Internal defined functions */ + +#define nextab(a) (a - (a % tabsize)) + tabsize + +/* DIFCASE represents the integer difference between upper + and lower case letters. It is an xor-able value, which is + fortunate, since the relative positions of upper to lower + case letters is the opposite of ascii in ebcdic. +*/ + +#if ASCII +#define DIFCASE 0x20 +#else +#define DIFCASE 0x40 +#endif + +/* Dynamic RAM tracking and reporting redefinitions */ + +#if RAMSIZE +#define malloc Eallocate +#define free Erelease +#else +#if VMS & OPTMEM +#define malloc VAXC$MALLOC_OPT +#define free VAXC$FREE_OPT +#define calloc VAXC$CALLOC_OPT +#define realloc VAXC$REALLOC_OPT +#define cfree VAXC$CFREE_OPT +#endif +#endif + +/* under MS Windows, we use dialog boxes to prompt the user for filenames */ +#if WINDOW_MSWIN +#define FILENAMEREPLY(p,b,nb) filenamedlg(p,b,nb,TRUE) +#else +#define FILENAMEREPLY(p,b,nb) mlreply(p,b,nb) +#endif + +/* colors respresented as parameters to WORDs and Screen positions */ + +#define CLRVAL unsigned int + +/* formal parameters to procedures are stored as a linked list + of argument names using the following simple structure: +*/ + +typedef struct PARG { + struct PARG *next; /* ptr to next linked argument */ + char name[NVSIZE+1]; /* name of the argument */ +} PARG; + +/* UNDO definitions and types */ + +typedef int OPTYPE; /* type of operation being recorded/played back */ + +#define OP_CMND 1 /* beginning of command */ +#define OP_DELC 2 /* delete a single character */ +#define OP_INSC 3 /* insert a single character */ +#define OP_DSTR 4 /* delete a string of characters */ +#define OP_ISTR 5 /* insert a string of characters */ +#define OP_REPC 6 /* replace a character */ +#define OP_CPOS 7 /* set the cursor position */ + +/* object to be undone! */ + +typedef union OBJECT { + char obj_char; /* a character */ + char obj_string[1]; /* many characters */ + char *obj_sptr; /* a ptr to a character */ +} OBJECT; + +typedef struct UNDO_OBJ { + struct UNDO_OBJ *next; /* ptr to next undo object */ + OPTYPE type; /* type of operation */ + long line_num; /* line offset from buffer beginning */ + int offset; /* offset into that line */ + long count; /* repetitions? */ + OBJECT undo_obj; /* object to be undone */ +} UNDO_OBJ; + +/* + * There is a window structure allocated for every active display window. The + * windows are kept in a big list, in top to bottom screen order, with the + * listhead at "wheadp". Each window contains its own values of dot and mark. + * The flag field contains some bits that are set by commands to guide + * redisplay. Although this is a bit of a compromise in terms of decoupling, + * the full blown redisplay is just too expensive to run for every input + * character. + */ +typedef struct EWINDOW { + struct EWINDOW *w_wndp; /* Next window */ + struct BUFFER *w_bufp; /* Buffer displayed in window */ + struct LINE *w_linep; /* Top line in the window */ + struct LINE *w_dotp; /* Line containing "." */ + short w_doto; /* Byte offset for "." */ + struct LINE *w_markp[NMARKS]; /* Line containing "mark" */ + short w_marko[NMARKS]; /* Byte offset for "mark" */ + char w_toprow; /* Origin 0 top row of window */ + char w_ntrows; /* # of rows of text in window */ + char w_force; /* If NZ, forcing row. */ + char w_flag; /* Flags. */ +#if COLOR + char w_fcolor; /* current forground color */ + char w_bcolor; /* current background color */ +#endif + int w_fcol; /* first column displayed */ +} EWINDOW; + +#define WFFORCE 0x01 /* Window needs forced reframe */ +#define WFMOVE 0x02 /* Movement from line to line */ +#define WFEDIT 0x04 /* Editing within a line */ +#define WFHARD 0x08 /* Better to a full display */ +#define WFMODE 0x10 /* Update mode line. */ +#define WFCOLR 0x20 /* Needs a color change */ + +/* This structure holds the information about each line appearing on the + * video display. The redisplay module uses an array of virtual display + * lines. On systems that do not have direct access to display memory, + * there is also an array of physical display lines used to minimize + * video updating. In most cases, these two arrays are unique. If + * WINDOW_MSWIN is 1, there is a pair of such arrays in each ESCREEN + * structure. + */ + +typedef struct VIDEO { + int v_flag; /* Flags */ +#if COLOR + int v_fcolor; /* current forground color */ + int v_bcolor; /* current background color */ + int v_rfcolor; /* requested forground color */ + int v_rbcolor; /* requested background color */ +#endif + int v_left; /* left edge of reverse video */ + int v_right; /* right right of reverse video */ +#if INSDEL && MEMMAP == 0 + int v_rline; /* requested screen line # */ +#endif +#if UTF8 + unsigned int v_text[1]; /* Screen data. */ +#else + char v_text[1]; /* Screen data. */ +#endif +} VIDEO; + +#define VFNEW 0x0001 /* contents not meaningful yet */ +#define VFCHG 0x0002 /* Changed flag */ +#define VFEXT 0x0004 /* extended (beyond column 80) */ +#define VFREV 0x0008 /* reverse video status */ +#define VFREQ 0x0010 /* reverse video request */ +#define VFCOL 0x0020 /* color change requested */ + +/* + * This structure holds the information about each separate "screen" + * within the current editing session. On a character based system, these + * screens overlay each other, and can individually be brought to front. + * On a windowing system like MicroSoft Windows 3.0, OS/2, the Macintosh, + * Intuition, Sunview or X-windows, each screen is represented in an OS + * window. The terminolgy is wrong in emacs..... + * + * EMACS The outside World + * screen window + * window pane + */ + +typedef struct ESCREEN { + struct ESCREEN *s_next_screen; /* link to next screen in list */ + EWINDOW *s_first_window; /* head of linked list of windows */ + EWINDOW *s_cur_window; /* current window in this screen */ + char *s_screen_name; /* name of the current window */ + short s_roworg; /* row origin of stored screen */ + short s_colorg; /* column origin of stored screen */ + short s_nrow; /* row width of stored screen */ + short s_ncol; /* column origin of stored screen */ +#if WINDOW_MSWIN + VIDEO **s_virtual; /* virtual screen contents */ + VIDEO **s_physical; /* physical screen contents */ + HWND s_drvhandle; /* handle for the "term" driver */ +#endif +} ESCREEN; + +/* + * Text is kept in buffers. A buffer header, described below, exists for every + * buffer in the system. The buffers are kept in a big list, so that commands + * that search for a buffer by name can find the buffer header. There is a + * safe store for the dot and mark in the header, but this is only valid if + * the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for + * the buffer is kept in a circularly linked list of lines, with a pointer to + * the header line in "b_linep". Buffers may be "Inactive" which means the + * files associated with them have not been read in yet. These get read in + * at "use buffer" time. + * Some buffers are really procedures and have a little extra information + * stored with them. + */ +typedef struct BUFFER { + struct BUFFER *b_bufp; /* Link to next BUFFER */ + struct LINE *b_dotp; /* Link to "." LINE structure */ + short b_doto; /* Offset of "." in above LINE */ + struct LINE *b_markp[NMARKS]; /* The same as the above two, */ + short b_marko[NMARKS]; /* but for the "mark" */ + int b_fcol; /* first column to display */ + struct LINE *b_linep; /* Link to the header LINE */ + struct LINE *b_topline; /* Link to narrowed top text */ + struct LINE *b_botline; /* Link to narrowed bottom text */ + char b_active; /* window activated flag */ + char b_nwnd; /* Count of windows on buffer */ + char b_exec; /* how many active executions */ + char b_flag; /* Flags */ + int b_mode; /* editor mode of this buffer */ + char b_fname[NFILEN]; /* File name */ + char b_bname[NBUFN]; /* Buffer name */ +#if CRYPT + char b_key[NPAT]; /* current encrypted key */ +#endif + int b_numargs; /* number of arguments to procedure */ + PARG *b_args; /* ptr to the first argument */ + UNDO_OBJ *undo_head; /* head of undo stack for buffer */ + long undo_count; /* # of undo operations stacked */ + long last_access; /* time of last access */ +#if UTF8 + short b_charset; /* character set */ +#endif +} BUFFER; + +#define BFINVS 0x01 /* Internal invisible buffer */ +#define BFCHG 0x02 /* Changed since last write */ +#define BFTRUNC 0x04 /* buffer was truncated when read */ +#define BFNAROW 0x08 /* buffer has been narrowed */ +#if LIBHELP +#define BFERROR 0x40 /* Error file buffer */ +#define BFHELP 0x80 /* Buffer is a help buffer */ +#endif + +#define NOTPROC -1 /* buffer is not a procedure */ + +/* mode flags */ +#if THEOX +#define NUMMODES 15 /* # of defined modes */ +#elif JMDEXT +#define NUMMODES 14 /* # of defined modes */ +#else +#define NUMMODES 11 /* # of defined modes */ +#endif + +#define MDWRAP 0x0001 /* word wrap */ +#define MDCMOD 0x0002 /* C indentation and fence match*/ +#define MDSPELL 0x0004 /* spell error parsing */ +#define MDEXACT 0x0008 /* Exact matching for searches */ +#define MDVIEW 0x0010 /* read-only buffer */ +#define MDOVER 0x0020 /* overwrite mode */ +#define MDMAGIC 0x0040 /* regular expressions in search */ +#define MDCRYPT 0x0080 /* encryption mode active */ +#define MDASAVE 0x0100 /* auto-save mode */ +#define MDREPL 0x0200 /* replace mode */ +#define MDABBR 0x0400 /* abbreviation expansion mode */ +#if JMDEXT +#define MDNOBAK 0x0800 /* no auto backup */ +#define MDSLINE 0x1000 /* single line graphics */ +#define MDDLINE 0x2000 /* double line graphics */ +#if THEOX +#define MDTHEOX 0x4000 /* TheoX character set file */ +#endif +#endif + +/* + * The starting position of a region, and the size of the region in + * characters, is kept in a region structure. Used by the region commands. + */ +typedef struct { + struct LINE *r_linep; /* Origin LINE address. */ + short r_offset; /* Origin LINE offset. */ + long r_size; /* Length in characters. */ +} REGION; + +/* + * All text is kept in circularly linked lists of "LINE" structures. These + * begin at the header line (which is the blank line beyond the end of the + * buffer). This line is pointed to by the "BUFFER". Each line contains a the + * number of bytes in the line (the "used" size), the size of the text array, + * and the text. The end of line is not stored as a byte; it's implied. + */ +typedef struct LINE { + struct LINE *l_fp; /* Link to the next line */ + struct LINE *l_bp; /* Link to the previous line */ + short l_size; /* Allocated size */ + short l_used; /* Used size */ + char l_text[1]; /* A bunch of characters. */ +} LINE; + +#define lforw(lp) ((lp)->l_fp) +#define lback(lp) ((lp)->l_bp) +#if UNIX && (SUN || HPUX8 || HPUX9 || BSD || FREEBSD) +#define lgetc(lp, n) ((unsigned char)(lp)->l_text[(n)]) +#else +#define lgetc(lp, n) ((lp)->l_text[(n)]) +#endif +#define lputc(lp, n, c) ((lp)->l_text[(n)]=(c)) +#define lused(lp) ((lp)->l_used) +#define lsize(lp) ((lp)->l_size) +#define ltext(lp) ((lp)->l_text) + +/* This structure is used to hold a user variables name and its + current value. These are used for both the global and the + local symbol tables. +*/ + +typedef struct UVAR { + char u_name[NVSIZE + 1]; /* name of user variable */ + char *u_value; /* value (string) */ +} UVAR; + +#define VT_NONE 0 /* don't declare it if not found */ +#define VT_LOCAL 1 /* local to the current procedure */ +#define VT_GLOBAL 2 /* global to all procedures */ + +/* A UTABLE is a user variable table.... containing some header + information and an array of user variable names and definitions. + They are held together in a linked list, the last member of + the list being the global user variable table. +*/ + +typedef struct UTABLE { + struct UTABLE *next; /* ptr to next user variable table */ + int size; /* max number of variables in table */ + BUFFER *bufp; /* ptr to buffer holding procedure + assosiated with this symbol table. */ + UVAR uv[1]; /* list of variable names/definitions + in this variable table */ +} UTABLE; + +/* + * The editor communicates with the display using a high level interface. A + * "TERM" structure holds useful variables, and indirect pointers to routines + * that do useful operations. The low level get and put routines are here too. + * This lets a terminal, in addition to having non standard commands, have + * funny get and put character code too. The calls might get changed to + * "termp->t_field" style in the future, to make it possible to run more than + * one terminal type. + */ +#if PROTO +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (*t_open)(void); /* Open terminal at the start.*/ + int (*t_close)(void); /* Close terminal at end. */ + int (*t_kopen)(void); /* Open keyboard */ + int (*t_kclose)(void); /* Close keyboard */ + int (*t_getchar)(void); /* Get character from keyboard. */ + int (*t_putchar)(int); /* Put character to display. */ + int (*t_flush)(void); /* Flush output buffers. */ + int (*t_move)(int, int);/* Move the cursor, origin 0. */ + int (*t_eeol)(void); /* Erase to end of line. */ + int (*t_eeop)(void); /* Erase to end of page. */ + int (*t_clrdesk)(void); /* Clear the page totally */ + int (*t_beep)(void); /* Beep. */ + int (*t_rev)(int); /* set reverse video state */ + int (*t_rez)(char *); /* change screen resolution */ +#if COLOR + int (*t_setfor)(int); /* set foreground color */ + int (*t_setback)(int); /* set background color */ +#endif +#if INSDEL + int (*t_insline)(int); /* insert a screen line */ + int (*t_delline)(int); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (*t_sleep)(int); /* go to sleep for a while */ + int (*t_newscr)(ESCREEN *); /* create new screen display */ + int (*t_delscr)(ESCREEN *); /* destroy screen display */ + int (*t_selscr)(ESCREEN *); /* select screen display */ + int (*t_sizscr)(ESCREEN *); /* resize screen display */ + int (*t_topscr)(ESCREEN *); /* bring screen to top */ +#endif +} TERM; +#else /* TERM structure, no prototyping.*/ + +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (*t_open)(); /* Open terminal at the start. */ + int (*t_close)(); /* Close terminal at end. */ + int (*t_kopen)(); /* Open keyboard */ + int (*t_kclose)(); /* close keyboard */ + int (*t_getchar)(); /* Get character from keyboard. */ + int (*t_putchar)(); /* Put character to display. */ + int (*t_flush)(); /* Flush output buffers. */ + int (*t_move)(); /* Move the cursor, origin 0. */ + int (*t_eeol)(); /* Erase to end of line. */ + int (*t_eeop)(); /* Erase to end of page. */ + int (*t_clrdesk)(); /* Clear the page totally */ + int (*t_beep)(); /* Beep. */ + int (*t_rev)(); /* set reverse video state */ + int (*t_rez)(); /* change screen resolution */ +#if COLOR + int (*t_setfor)(); /* set forground color */ + int (*t_setback)(); /* set background color */ +#endif +#if INSDEL + int (*t_insline)(); /* insert a screen line */ + int (*t_delline)(); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (*t_sleep)(); /* go to sleep for a while */ + int (*t_newscr)(); /* create new screen display */ + int (*t_delscr)(); /* destroy screen display */ + int (*t_selscr)(); /* select screen display */ + int (*t_sizscr)(); /* resize screen display */ + int (*t_topscr)(); /* bring screen to top */ +#endif +} TERM; +#endif + + +/* TEMPORARY macros for terminal I/O (to be placed in a machine + dependent place later) */ + +#define TTopen (*term.t_open) +#define TTclose (*term.t_close) +#define TTkopen (*term.t_kopen) +#define TTkclose (*term.t_kclose) +#define TTgetc (*term.t_getchar) +#define TTputc (*term.t_putchar) +#define TTflush (*term.t_flush) +#define TTmove (*term.t_move) +#define TTeeol (*term.t_eeol) +#define TTeeop (*term.t_eeop) +#define TTclrdesk (*term.t_clrdesk) +#define TTbeep (*term.t_beep) +#define TTrev (*term.t_rev) +#define TTrez (*term.t_rez) +#if COLOR +#define TTforg (*term.t_setfor) +#define TTbacg (*term.t_setback) +#endif + +/* Structure for the table of current key bindings */ + +ETYPE EPOINTER { + int (*fp)(); /* C routine to invoke */ + BUFFER *buf; /* buffer to execute */ +}; + +typedef struct { +#if UTF8 + unsigned int k_code; /* Key code */ +#else + short k_code; /* Key code */ +#endif + short k_type; /* binding type (C function or EMACS buffer) */ + ETYPE EPOINTER k_ptr; /* ptr to thing to execute */ +} KEYTAB; + +/* structure for the name binding table */ + +typedef struct { + char *n_name; /* name of function key */ + int (*n_func)(); /* function name is bound to */ +} NBIND; + +/* The editor holds deleted text chunks in the KILL buffer. The + kill buffer is logically a stream of ascii characters, however + due to its unpredicatable size, it gets implemented as a linked + list of chunks. (The d_ prefix is for "deleted" text, as k_ + was taken up by the keycode structure) +*/ + +typedef struct KILL { + struct KILL *d_next; /* link to next chunk, NULL if last */ + char d_chunk[KBLOCK]; /* deleted text */ +} KILL; + +/* When emacs's command interpetor needs to get a variable's name, + rather than it's value, it is passed back as a VDESC variable + description structure. The v_num field is a index into the + appropriate variable table. +*/ + +typedef struct VDESC { + int v_type; /* type of variable */ + int v_num; /* ordinal pointer to variable in list */ + UTABLE *v_ut; /* ptr to appropriate user table if user var */ +} VDESC; + +/* The !WHILE directive in the execution language needs to + stack references to pending whiles. These are stored linked + to each currently open procedure via a linked list of + the following structure +*/ + +typedef struct WHBLOCK { + LINE *w_begin; /* ptr to !while statement */ + LINE *w_end; /* ptr to the !endwhile statement*/ + int w_type; /* block type */ + struct WHBLOCK *w_next; /* next while */ +} WHBLOCK; + +#define BTWHILE 1 +#define BTBREAK 2 + +/* SWORDs are syntactical words to highlight in a different + foreground color. WORDSETs are named lists of these WORDs. +*/ + +typedef struct SWORD { + struct SWORD *wd_next; /* ptr to the next word in the list */ + char *wd_text; /* the actual word */ + CLRVAL wd_color; /* color to display in */ + int wd_symflag; /* TRUE = symbol overiding word boundries + FALSE = word w/ space/symbol delimiters */ +} SWORD; + +typedef struct WORDSET { + struct WORDSET *next; + int tmp; +} WORDSET; + +/* Abbreviations are short symbols that expand to longer strings + when typed into a buffer with no intervening whitespace or commands. + This structure grows dynamically as needed. +*/ + +typedef struct ABBREV { + struct ABBREV *ab_next; /* pointer to the next abbreviation */ + char ab_sym[MAXSYM + 1]; /* name to expand */ + char ab_exp[1]; /* string to expand to */ +} ABBREV; + +/* Search definitions... */ + +/* HICHAR - 1 is the largest character we will deal with. + * BMAPSIZE represents the number of bytes in the bitmap. + */ +#if UTF8 +#define HICHAR 65536 +#else +#define HICHAR 256 +#endif +#define BMAPSIZE HICHAR >> 3 + +/* + * Jump table structures. + */ +typedef struct { + int jump; + int patlen; + int delta[HICHAR]; + char patrn[NPAT]; +} DELTA; + +#if MAGIC +/* + * Defines for the metacharacters in the regular expression + * search routines. MCNIL and GROUP are used in both search + * and replace metachar-arrays. + */ +#define MCNIL 0 /* Like the '\0' for strings.*/ +#define JMPTABLE 1 +#define LITSTRING 2 /* Literal string.*/ +#define LITCHAR 3 /* Literal character.*/ +#define ANY 4 /* Any character but the .*/ +#define CCL 5 +#define NCCL 6 +#define BOL 7 +#define EOL 8 +#define BOWRD 9 +#define EOWRD 10 +#define GRPBEG 11 /* Signal start of group.*/ +#define GRPEND 12 /* Signal end of group.*/ +#define GROUP 13 /* String of group match.*/ +#define DITTO 14 /* Replacement with match string.*/ + +#define CLOSURE 0x0100 /* An or-able value for a closure modifier.*/ +#define CLOSURE_1 0x0200 /* An or-able value for a closure modifier.*/ +#define ZEROONE 0x0400 /* An or-able value for a closure modifier.*/ + +#define ALLCLOS (CLOSURE | CLOSURE_1 | ZEROONE) +#define MASKCLO (~ALLCLOS) + +#define MC_ANY '.' /* 'Any' character (except newline).*/ +#define MC_CCL '[' /* Character class.*/ +#define MC_NCCL '^' /* Negate character class.*/ +#define MC_RCCL '-' /* Range in character class.*/ +#define MC_ECCL ']' /* End of character class.*/ +#define MC_BOL '^' /* Beginning of line.*/ +#define MC_EOL '$' /* End of line.*/ +#define MC_CLOSURE '*' /* Closure - zero to many characters match.*/ +#define MC_CLOSURE_1 '+' /* Closure - one to many characters match.*/ +#define MC_ZEROONE '?' /* Closure - zero to one characters match.*/ +#define MC_DITTO '&' /* Use matched string in replacement.*/ +#define MC_GRPBEG '(' /* Start of group (begun with a backslash).*/ +#define MC_GRPEND ')' /* End of group (begun with a backslash).*/ +#define MC_BOWRD '<' /* Beginning of word (begun with a backslash).*/ +#define MC_EOWRD '>' /* End of word (begun with a backslash).*/ +#define MC_ESC '\\' /* Escape - suppress meta-meaning.*/ + +#define MAXGROUPS 10 /* 1 + maximum # of r. e. groups. */ +#define BIT(n) (1 << (n)) /* An integer with one bit set.*/ + +/* Typedefs that define the bitmap type for searching (EBITMAP), + * the meta-character structure for MAGIC mode searching (MC), + * and the meta-character structure for MAGIC mode replacment (RMC). + */ +typedef char *EBITMAP; + +typedef struct { + short int mc_type; + union { + int lchar; + int group_no; + char *lstring; + DELTA *jmptable; + EBITMAP cclmap; + } u; +} MC; + +typedef struct { + short int mc_type; + union { + int group_no; + char *rstr; + } u; +} RMC; +#endif + +/* + This is the message which should be added to any "About MicroEMACS" + boxes on any of the machines with window managers. + + + ------------------------------------------ + | | + | MicroEMACS v4.xx | + | for the ............ | + | | + | Text Editor and Corrector | + | | + | written by Daniel M. Lawrence | + | [based on code by Dave Conroy] | + | | + | Send inquiries and donations to: | + | 617 New York St | + | Lafayette, IN 47901 | + | | + ------------------------------------------ +*/ diff --git a/cygwin/mepipe b/cygwin/mepipe new file mode 100644 index 0000000..d514d8b --- /dev/null +++ b/cygwin/mepipe @@ -0,0 +1,4 @@ +# to allow non interactive command to be piped and return exit code 0 +#!/bin/bash +$* +exit 0 \ No newline at end of file diff --git a/cygwin/merun b/cygwin/merun new file mode 100644 index 0000000..be679bc --- /dev/null +++ b/cygwin/merun @@ -0,0 +1,7 @@ +# to allow non interactive command to run, pause and return exit code 0 +#!/bin/bash +clear +$* +echo "[End]" +read -n 1 +exit 0 \ No newline at end of file diff --git a/h/dutch.h b/h/dutch.h index bb80660..31b3b42 100644 --- a/h/dutch.h +++ b/h/dutch.h @@ -2,7 +2,7 @@ MicroEMACS 4.00 Translated by Paul De Bra - debra@research.att.com + debra@research.att.com (C)opyright 1995 by Daniel Lawrence */ @@ -38,7 +38,11 @@ #define TEXT27 "Pop buffer" #define TEXT28 "Buffer wordt nog getoond" #define TEXT29 "Verander buffer-naam in: " +#if JMDEXT +#define TEXT30 "ACTN Modus Grootte Buffer File" +#else #define TEXT30 "ACTN Modus Grootte Buffer File" +#endif /* ^^^The underlining will not match exactly for this line, but it's close*/ #define TEXT31 " Globale Modi" #define TEXT32 "Vergeet Veranderingen" @@ -70,7 +74,7 @@ #define TEXT57 "Kan lijst van variabelen niet tonen" #define TEXT58 "[Opbouwen lijst van variabelen]" #define TEXT59 UNUSED -#define TEXT60 "Lijn %D/%D Kolom %d/%d Kar. %D/%D (%d%%) Kar. = 0x%x" +#define TEXT60 "Lijn %D/%D Kolom %d/%d Kar. %D/%D (%d%%) Kar. = 0x%x %d" #define TEXT61 "" #define TEXT62 "Globale modus om " #define TEXT63 "Modus om " @@ -253,7 +257,26 @@ #define TEXT248 "Enter Label String: " #define TEXT249 "Global variable to declare: " #define TEXT250 "Local variable to declare: " - +#if JMDEXT +#define TEXT284 "Function not available" +#define TEXT285 "No topic" +#define TEXT286 "Searching topic \"%s\"" +#define TEXT287 "Searching keyword \"%s\"" +#define TEXT288 "Topic: " +#define TEXT289 "Keyword: " +#define TEXT290 "No help for topic \"%s\"" +#define TEXT291 "No help for keyword \"%s\"" +#define TEXT292 "Unable to open the help file %s" +#define TEXT293 "Index of " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s is not a regular file" +#endif +#if THEOS +#define TEXT298 "%s is not a sequential file" +#define TEXT299 "%s is not a library" +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Incorrect menu]" #define TEXT301 "[Too many nested popup menus]" @@ -292,4 +315,5 @@ #define TEXT335 "Change screen name to: " #define TEXT336 "[Screen name already in use]" #define TEXT337 "cannot monitor external program" +#define TEXT338 "space for help :" diff --git a/h/ebind.h b/h/ebind.h index 6b28199..4810048 100644 --- a/h/ebind.h +++ b/h/ebind.h @@ -12,192 +12,199 @@ NOSHARE KEYTAB keytab[NBINDS] = { #if MOUSE - {MOUS|'m', BINDFNC, mmove}, - {MOUS|CTRL|'m', BINDFNC, mmove}, - {MOUS|SHFT|'m', BINDFNC, mmove}, - {MOUS|CTRL|SHFT|'m', BINDFNC, mmove}, - {MOUS|'a', BINDFNC, movemd}, - {MOUS|'b', BINDFNC, movemu}, - {MOUS|'e', BINDFNC, mregdown}, - {MOUS|'f', BINDFNC, mregup}, - {MOUS|'1', BINDFNC, resizm}, - {MOUS|'2', BINDFNC, resizm2}, -#endif - - {CTRL|'A', BINDFNC, gotobol}, - {CTRL|'B', BINDFNC, backchar}, - {CTRL|'C', BINDFNC, insspace}, - {CTRL|'D', BINDFNC, forwdel}, - {CTRL|'E', BINDFNC, gotoeol}, - {CTRL|'F', BINDFNC, forwchar}, - {CTRL|'G', BINDFNC, ctrlg}, - {CTRL|'H', BINDFNC, backdel}, - {CTRL|'I', BINDFNC, tab}, - {CTRL|'J', BINDFNC, indent}, - {CTRL|'K', BINDFNC, killtext}, - {CTRL|'L', BINDFNC, refresh}, - {CTRL|'M', BINDFNC, newline}, - {CTRL|'N', BINDFNC, forwline}, - {CTRL|'O', BINDFNC, openline}, - {CTRL|'P', BINDFNC, backline}, - {CTRL|'Q', BINDFNC, quote}, - {CTRL|'R', BINDFNC, backsearch}, - {CTRL|'S', BINDFNC, forwsearch}, - {CTRL|'T', BINDFNC, twiddle}, - {CTRL|'U', BINDFNC, unarg}, - {CTRL|'V', BINDFNC, forwpage}, - {CTRL|'W', BINDFNC, killregion}, - {CTRL|'X', BINDFNC, cex}, - {CTRL|'Y', BINDFNC, yank}, - {CTRL|'Z', BINDFNC, backpage}, - {CTRL|'[', BINDFNC, meta}, - {CTRL|'\\', BINDFNC, forwsearch}, - {CTRL|'^', BINDFNC, quote}, - {CTRL|'_', BINDFNC, undo}, - {CTLX|CTRL|'A', BINDFNC, fileapp}, - {CTLX|CTRL|'B', BINDFNC, listbuffers}, - {CTLX|CTRL|'C', BINDFNC, quit}, - {CTLX|CTRL|'D', BINDFNC, detab}, - {CTLX|CTRL|'E', BINDFNC, entab}, - {CTLX|CTRL|'F', BINDFNC, filefind}, - {CTLX|CTRL|'I', BINDFNC, insfile}, - {CTLX|CTRL|'K', BINDFNC, macrotokey}, - {CTLX|CTRL|'L', BINDFNC, lowerregion}, - {CTLX|CTRL|'M', BINDFNC, delmode}, - {CTLX|CTRL|'N', BINDFNC, mvdnwind}, - {CTLX|CTRL|'O', BINDFNC, deblank}, - {CTLX|CTRL|'P', BINDFNC, mvupwind}, - {CTLX|CTRL|'R', BINDFNC, fileread}, - {CTLX|CTRL|'S', BINDFNC, filesave}, - {CTLX|CTRL|'T', BINDFNC, trim}, - {CTLX|CTRL|'U', BINDFNC, upperregion}, - {CTLX|CTRL|'V', BINDFNC, viewfile}, - {CTLX|CTRL|'W', BINDFNC, filewrite}, - {CTLX|CTRL|'X', BINDFNC, swapmark}, - {CTLX|CTRL|'Z', BINDFNC, shrinkwind}, - {CTLX|CTRL|'\\', BINDFNC, filesave}, - {CTLX|'?', BINDFNC, deskey}, - {CTLX|'!', BINDFNC, spawn}, - {CTLX|'@', BINDFNC, pipecmd}, - {CTLX|'#', BINDFNC, filter}, - {CTLX|'$', BINDFNC, execprg}, - {CTLX|'=', BINDFNC, showcpos}, - {CTLX|'(', BINDFNC, ctlxlp}, - {CTLX|')', BINDFNC, ctlxrp}, - {CTLX|'<', BINDFNC, narrow}, - {CTLX|'>', BINDFNC, widen}, - {CTLX|'^', BINDFNC, enlargewind}, - {CTLX|' ', BINDFNC, remmark}, - {CTLX|'0', BINDFNC, delwind}, - {CTLX|'1', BINDFNC, onlywind}, - {CTLX|'2', BINDFNC, splitwind}, - {CTLX|'A', BINDFNC, setvar}, - {CTLX|'B', BINDFNC, usebuffer}, - {CTLX|'C', BINDFNC, spawncli}, + {MOUS|'m', BINDFNC, { mmove } }, + {MOUS|CTRL|'m', BINDFNC, { mmove } }, + {MOUS|SHFT|'m', BINDFNC, { mmove } }, + {MOUS|CTRL|SHFT|'m', BINDFNC, { mmove } }, + {MOUS|'a', BINDFNC, { movemd } }, + {MOUS|'b', BINDFNC, { movemu } }, + {MOUS|'e', BINDFNC, { mregdown } }, + {MOUS|'f', BINDFNC, { mregup } }, + {MOUS|'1', BINDFNC, { resizm } }, + {MOUS|'2', BINDFNC, { resizm2 } }, + {MOUS|'x', BINDFNC, { menudrop } }, +#endif + {CTRL|'?', BINDFNC, { backdel } }, + {CTRL|'A', BINDFNC, { gotobol } }, + {CTRL|'B', BINDFNC, { backchar } }, + {CTRL|'C', BINDFNC, { insspace } }, + {CTRL|'D', BINDFNC, { forwdel } }, + {CTRL|'E', BINDFNC, { gotoeol } }, + {CTRL|'F', BINDFNC, { forwchar } }, + {CTRL|'G', BINDFNC, { ctrlg } }, + {CTRL|'H', BINDFNC, { backdel } }, + {CTRL|'I', BINDFNC, { uetab } }, + {CTRL|'J', BINDFNC, { indent } }, + {CTRL|'K', BINDFNC, { killtext } }, + {CTRL|'L', BINDFNC, { uerefresh } }, + {CTRL|'M', BINDFNC, { uenewline } }, + {CTRL|'N', BINDFNC, { forwline } }, + {CTRL|'O', BINDFNC, { openline } }, + {CTRL|'P', BINDFNC, { backline } }, + {CTRL|'Q', BINDFNC, { quote } }, + {CTRL|'R', BINDFNC, { backsearch } }, + {CTRL|'S', BINDFNC, { forwsearch } }, + {CTRL|'T', BINDFNC, { twiddle } }, + {CTRL|'U', BINDFNC, { unarg } }, + {CTRL|'V', BINDFNC, { forwpage } }, + {CTRL|'W', BINDFNC, { killregion } }, + {CTRL|'X', BINDFNC, { cex } }, + {CTRL|'Y', BINDFNC, { yank } }, + {CTRL|'Z', BINDFNC, { backpage } }, + {CTRL|'[', BINDFNC, { uemeta } }, + {CTRL|'\\', BINDFNC, { forwsearch } }, + {CTRL|'^', BINDFNC, { quote } }, + {CTRL|'_', BINDFNC, { undo } }, + {CTLX|CTRL|'A', BINDFNC, { fileapp } }, + {CTLX|CTRL|'B', BINDFNC, { listbuffers } }, + {CTLX|CTRL|'C', BINDFNC, { quit } }, + {CTLX|CTRL|'D', BINDFNC, { detab } }, + {CTLX|CTRL|'E', BINDFNC, { entab } }, + {CTLX|CTRL|'F', BINDFNC, { filefind } }, + {CTLX|CTRL|'I', BINDFNC, { insfile } }, + {CTLX|CTRL|'K', BINDFNC, { macrotokey } }, + {CTLX|CTRL|'L', BINDFNC, { lowerregion } }, + {CTLX|CTRL|'M', BINDFNC, { delmode } }, + {CTLX|CTRL|'N', BINDFNC, { mvdnwind } }, + {CTLX|CTRL|'O', BINDFNC, { deblank } }, + {CTLX|CTRL|'P', BINDFNC, { mvupwind } }, + {CTLX|CTRL|'R', BINDFNC, { fileread } }, + {CTLX|CTRL|'S', BINDFNC, { filesave } }, + {CTLX|CTRL|'T', BINDFNC, { trim } }, + {CTLX|CTRL|'U', BINDFNC, { upperregion } }, + {CTLX|CTRL|'V', BINDFNC, { viewfile } }, + {CTLX|CTRL|'W', BINDFNC, { filewrite } }, + {CTLX|CTRL|'X', BINDFNC, { swapmark } }, + {CTLX|CTRL|'Z', BINDFNC, { shrinkwind } }, + {CTLX|CTRL|'\\', BINDFNC, { filesave } }, + {CTLX|'?', BINDFNC, { deskey } }, + {CTLX|'!', BINDFNC, { spawn } }, + {CTLX|'@', BINDFNC, { pipecmd } }, + {CTLX|'#', BINDFNC, { uefilter } }, + {CTLX|'$', BINDFNC, { execprg } }, + {CTLX|'=', BINDFNC, { showcpos } }, + {CTLX|'(', BINDFNC, { ctlxlp } }, + {CTLX|')', BINDFNC, { ctlxrp } }, + {CTLX|'<', BINDFNC, { narrow } }, + {CTLX|'>', BINDFNC, { widen } }, + {CTLX|'^', BINDFNC, { enlargewind } }, + {CTLX|' ', BINDFNC, { remmark } }, + {CTLX|'0', BINDFNC, { delwind } }, + {CTLX|'1', BINDFNC, { onlywind } }, + {CTLX|'2', BINDFNC, { splitwind } }, + {CTLX|'A', BINDFNC, { setvar } }, + {CTLX|'B', BINDFNC, { usebuffer } }, + {CTLX|'C', BINDFNC, { spawncli } }, #if BSD || FREEBSD || VMS || SUN || HPUX8 || HPUX9 || AVIION - {CTLX|'D', BINDFNC, bktoshell}, + {CTLX|'D', BINDFNC, { bktoshell } }, #endif - {CTLX|'E', BINDFNC, ctlxe}, - {CTLX|'G', BINDFNC, dispvar}, - {CTLX|'K', BINDFNC, killbuffer}, - {CTLX|'M', BINDFNC, setmod}, - {CTLX|'N', BINDFNC, filename}, - {CTLX|'O', BINDFNC, nextwind}, - {CTLX|'P', BINDFNC, prevwind}, + {CTLX|'E', BINDFNC, { ctlxe } }, + {CTLX|'G', BINDFNC, { dispvar } }, + {CTLX|'K', BINDFNC, { killbuffer } }, + {CTLX|'M', BINDFNC, { setmod } }, + {CTLX|'N', BINDFNC, { filename } }, + {CTLX|'O', BINDFNC, { nextwind } }, + {CTLX|'P', BINDFNC, { prevwind } }, #if ISRCH - {CTLX|'R', BINDFNC, risearch}, - {CTLX|'S', BINDFNC, fisearch}, + {CTLX|'R', BINDFNC, { risearch } }, + {CTLX|'S', BINDFNC, { fisearch } }, #endif - {CTLX|'U', BINDFNC, undo_list}, - {CTLX|'W', BINDFNC, resize}, - {CTLX|'X', BINDFNC, nextbuffer}, - {CTLX|'Y', BINDFNC, cycle_ring}, - {CTLX|'Z', BINDFNC, enlargewind}, - {META|CTRL|'C', BINDFNC, wordcount}, - {META|CTRL|'E', BINDFNC, execproc}, - {META|CTRL|'F', BINDFNC, getfence}, - {META|CTRL|'G', BINDFNC, gotomark}, - {META|CTRL|'H', BINDFNC, delbword}, - {META|CTRL|'K', BINDFNC, unbindkey}, - {META|CTRL|'L', BINDFNC, reposition}, - {META|CTRL|'M', BINDFNC, delgmode}, - {META|CTRL|'N', BINDFNC, namebuffer}, - {META|CTRL|'R', BINDFNC, qreplace}, - {META|CTRL|'S', BINDFNC, execfile}, - {META|CTRL|'V', BINDFNC, nextdown}, - {META|CTRL|'U', BINDFNC, undo_delete}, - {META|CTRL|'W', BINDFNC, killpara}, - {META|CTRL|'X', BINDFNC, execcmd}, - {META|CTRL|'Y', BINDFNC, clear_ring}, - {META|CTRL|'Z', BINDFNC, nextup}, - {META|CTRL|'\\', BINDFNC, execfile}, - {META|' ', BINDFNC, setmark}, - {META|'?', BINDFNC, help}, - {META|'!', BINDFNC, reposition}, - {META|')', BINDFNC, indent_region}, - {META|'(', BINDFNC, undent_region}, - {META|'.', BINDFNC, setmark}, - {META|'>', BINDFNC, gotoeob}, - {META|'<', BINDFNC, gotobob}, - {META|'~', BINDFNC, unmark}, - {META|'A', BINDFNC, apro}, - {META|'B', BINDFNC, backword}, - {META|'C', BINDFNC, capword}, - {META|'D', BINDFNC, delfword}, + {CTLX|'U', BINDFNC, { undo_list } }, + {CTLX|'W', BINDFNC, { resize } }, + {CTLX|'X', BINDFNC, { nextbuffer } }, + {CTLX|'Y', BINDFNC, { cycle_ring } }, + {CTLX|'Z', BINDFNC, { enlargewind } }, + {META|CTRL|'?', BINDFNC, { delbword } }, + {META|CTRL|'C', BINDFNC, { wordcount } }, + {META|CTRL|'E', BINDFNC, { execproc } }, + {META|CTRL|'F', BINDFNC, { getfence } }, + {META|CTRL|'G', BINDFNC, { gotomark } }, + {META|CTRL|'H', BINDFNC, { delbword } }, + {META|CTRL|'K', BINDFNC, { unbindkey } }, + {META|CTRL|'L', BINDFNC, { reposition } }, + {META|CTRL|'M', BINDFNC, { delgmode } }, + {META|CTRL|'N', BINDFNC, { namebuffer } }, + {META|CTRL|'R', BINDFNC, { qreplace } }, + {META|CTRL|'S', BINDFNC, { execfile } }, + {META|CTRL|'V', BINDFNC, { nextdown } }, + {META|CTRL|'U', BINDFNC, { undo_delete } }, + {META|CTRL|'W', BINDFNC, { killpara } }, + {META|CTRL|'X', BINDFNC, { execcmd } }, + {META|CTRL|'Y', BINDFNC, { clear_ring } }, + {META|CTRL|'Z', BINDFNC, { nextup } }, + {META|CTRL|'\\', BINDFNC, { execfile } }, + {META|' ', BINDFNC, { setmark } }, + {META|'?', BINDFNC, { help } }, + {META|'!', BINDFNC, { reposition } }, + {META|')', BINDFNC, { indent_region } }, + {META|'(', BINDFNC, { undent_region } }, + {META|'.', BINDFNC, { setmark } }, + {META|'>', BINDFNC, { gotoeob } }, + {META|'<', BINDFNC, { gotobob } }, + {META|'~', BINDFNC, { unmark } }, + {META|'A', BINDFNC, { apro } }, + {META|'B', BINDFNC, { backword } }, + {META|'C', BINDFNC, { capword } }, + {META|'D', BINDFNC, { delfword } }, #if CRYPT - {META|'E', BINDFNC, setekey}, + {META|'E', BINDFNC, { setekey } }, #endif - {META|'F', BINDFNC, forwword}, - {META|'G', BINDFNC, gotoline}, - {META|'K', BINDFNC, bindtokey}, - {META|'L', BINDFNC, lowerword}, - {META|'M', BINDFNC, setgmode}, - {META|'N', BINDFNC, gotoeop}, - {META|'P', BINDFNC, gotobop}, - {META|'Q', BINDFNC, fillpara}, - {META|'R', BINDFNC, sreplace}, + {META|'F', BINDFNC, { forwword } }, + {META|'G', BINDFNC, { gotoline } }, +#if LIBHELP + {META|'H', BINDFNC, { lookupword } }, + {META|'I', BINDFNC, { hlpindex } }, + {META|'J', BINDFNC, { promptlook } }, +#endif + {META|'K', BINDFNC, { bindtokey } }, + {META|'L', BINDFNC, { lowerword } }, + {META|'M', BINDFNC, { setgmode } }, + {META|'N', BINDFNC, { gotoeop } }, + {META|'P', BINDFNC, { gotobop } }, + {META|'Q', BINDFNC, { fillpara } }, + {META|'R', BINDFNC, { sreplace } }, #if BSD || FREEBSD || HPUX8 || HPUX9 || VMS || SUN || AVIION - {META|'S', BINDFNC, bktoshell}, + {META|'S', BINDFNC, { bktoshell } }, #endif - {META|'U', BINDFNC, upperword}, - {META|'V', BINDFNC, backpage}, - {META|'W', BINDFNC, copyregion}, - {META|'X', BINDFNC, namedcmd}, - {META|'Y', BINDFNC, yank_pop}, - {META|'Z', BINDFNC, quickexit}, -/* {META|CTRL|'?', BINDFNC, delbword}, ??? */ + {META|'U', BINDFNC, { upperword } }, + {META|'V', BINDFNC, { backpage } }, + {META|'W', BINDFNC, { copyregion } }, + {META|'X', BINDFNC, { namedcmd } }, + {META|'Y', BINDFNC, { yank_pop } }, + {META|'Z', BINDFNC, { quickexit } }, + {META|SPEC|'D', BINDFNC, { delfword } }, - {ALTD|'B', BINDFNC, list_screens}, - {ALTD|'C', BINDFNC, cycle_screens}, - {ALTD|'D', BINDFNC, delete_screen}, - {ALTD|'F', BINDFNC, find_screen}, - {ALTD|'N', BINDFNC, rename_screen}, - {ALTD|'R', BINDFNC, backhunt}, - {ALTD|'S', BINDFNC, forwhunt}, + {ALTD|'B', BINDFNC, { list_screens } }, + {ALTD|'C', BINDFNC, { cycle_screens } }, + {ALTD|'D', BINDFNC, { delete_screen } }, + {ALTD|'F', BINDFNC, { find_screen } }, + {ALTD|'N', BINDFNC, { rename_screen } }, + {ALTD|'R', BINDFNC, { backhunt } }, + {ALTD|'S', BINDFNC, { forwhunt } }, - {SPEC|'<', BINDFNC, gotobob}, /* Home */ - {SPEC|'P', BINDFNC, backline}, /* up */ - {SPEC|'Z', BINDFNC, backpage}, /* PgUp */ - {SPEC|'B', BINDFNC, backchar}, /* left */ + {SPEC|'<', BINDFNC, { gotobob } }, /* Home */ + {SPEC|'P', BINDFNC, { backline } }, /* up */ + {SPEC|'Z', BINDFNC, { backpage } }, /* PgUp */ + {SPEC|'B', BINDFNC, { backchar } }, /* left */ - {SPEC|'L', BINDFNC, reposition}, /* NP5 */ + {SPEC|'L', BINDFNC, { reposition } }, /* NP5 */ - {SPEC|'F', BINDFNC, forwchar}, /* right */ - {SPEC|'>', BINDFNC, gotoeob}, /* End */ - {SPEC|'N', BINDFNC, forwline}, /* down */ - {SPEC|'V', BINDFNC, forwpage}, /* PgDn */ - {SPEC|'C', BINDFNC, insspace}, /* Ins */ - {SPEC|'D', BINDFNC, forwdel}, /* Del */ + {SPEC|'F', BINDFNC, { forwchar } }, /* right */ + {SPEC|'>', BINDFNC, { gotoeob } }, /* End */ + {SPEC|'N', BINDFNC, { forwline } }, /* down */ + {SPEC|'V', BINDFNC, { forwpage } }, /* PgDn */ + {SPEC|'C', BINDFNC, { insspace } }, /* Ins */ + {SPEC|'D', BINDFNC, { forwdel } }, /* Del */ - {SPEC|CTRL|'B', BINDFNC, backword}, /* ctrl left */ - {SPEC|CTRL|'F', BINDFNC, forwword}, /* ctrl right */ - {SPEC|CTRL|'Z', BINDFNC, gotobop}, /* ctrl PgUp */ - {SPEC|CTRL|'V', BINDFNC, gotoeop}, /* ctrl PgDn */ + {SPEC|CTRL|'B', BINDFNC, { backword } }, /* ctrl left */ + {SPEC|CTRL|'F', BINDFNC, { forwword } }, /* ctrl right */ + {SPEC|CTRL|'Z', BINDFNC, { gotobop } }, /* ctrl PgUp */ + {SPEC|CTRL|'V', BINDFNC, { gotoeop } }, /* ctrl PgDn */ #if WINDOW_MSWIN /* IBM-CUA clipboard bindings */ - {SPEC|CTRL|'C', BINDFNC, clipregion}, /* ctrl Ins */ - {SPEC|SHFT|'C', BINDFNC, insertclip}, /* shift Ins */ - {SPEC|SHFT|'D', BINDFNC, cutregion}, /* shift Del */ + {SPEC|CTRL|'C', BINDFNC, { clipregion } }, /* ctrl Ins */ + {SPEC|SHFT|'C', BINDFNC, { insertclip } }, /* shift Ins */ + {SPEC|SHFT|'D', BINDFNC, { cutregion } }, /* shift Del */ #endif #if ATKBD | OS2 @@ -209,72 +216,72 @@ NOSHARE KEYTAB keytab[NBINDS] = { See keyboard.c for a full list of available keys. */ - {SPEC|'a', BINDFNC, gotobob}, /* grey Home */ - {SPEC|'b', BINDFNC, backline}, /* grey up */ - {SPEC|'c', BINDFNC, backpage}, /* grey PgUp */ - {SPEC|'d', BINDFNC, backchar}, /* grey left */ - {SPEC|'e', BINDFNC, reposition}, /* grey center */ - {SPEC|'f', BINDFNC, forwchar}, /* grey right */ - {SPEC|'g', BINDFNC, gotoeob}, /* grey End */ - {SPEC|'h', BINDFNC, forwline}, /* grey down */ - {SPEC|'i', BINDFNC, forwpage}, /* grey PgDn */ - {SPEC|'j', BINDFNC, insspace}, /* grey Ins */ - {SPEC|'k', BINDFNC, forwdel}, /* grey Del */ - {SPEC|':', BINDFNC, execcmd}, /* pause */ + {SPEC|'a', BINDFNC, { gotobob } }, /* grey Home */ + {SPEC|'b', BINDFNC, { backline } }, /* grey up */ + {SPEC|'c', BINDFNC, { backpage } }, /* grey PgUp */ + {SPEC|'d', BINDFNC, { backchar } }, /* grey left */ + {SPEC|'e', BINDFNC, { reposition } }, /* grey center */ + {SPEC|'f', BINDFNC, { forwchar } }, /* grey right */ + {SPEC|'g', BINDFNC, { gotoeob } }, /* grey End */ + {SPEC|'h', BINDFNC, { forwline } }, /* grey down */ + {SPEC|'i', BINDFNC, { forwpage } }, /* grey PgDn */ + {SPEC|'j', BINDFNC, { insspace } }, /* grey Ins */ + {SPEC|'k', BINDFNC, { forwdel } }, /* grey Del */ + {SPEC|':', BINDFNC, { execcmd } }, /* pause */ - {SPEC|CTRL|'c', BINDFNC, gotobop}, /* ctrl grey PgUp */ - {SPEC|CTRL|'d', BINDFNC, backword}, /* ctrl grey left */ - {SPEC|CTRL|'f', BINDFNC, forwword}, /* ctrl grey right */ - {SPEC|CTRL|'i', BINDFNC, gotoeop}, /* ctrl grey PgDn */ + {SPEC|CTRL|'c', BINDFNC, { gotobop } }, /* ctrl grey PgUp */ + {SPEC|CTRL|'d', BINDFNC, { backword } }, /* ctrl grey left */ + {SPEC|CTRL|'f', BINDFNC, { forwword } }, /* ctrl grey right */ + {SPEC|CTRL|'i', BINDFNC, { gotoeop } }, /* ctrl grey PgDn */ #endif #if HP150 - {SPEC|32, BINDFNC, backline}, - {SPEC|33, BINDFNC, forwline}, - {SPEC|35, BINDFNC, backchar}, - {SPEC|34, BINDFNC, forwchar}, - {SPEC|44, BINDFNC, gotobob}, - {SPEC|46, BINDFNC, forwpage}, - {SPEC|47, BINDFNC, backpage}, - {SPEC|82, BINDFNC, nextwind}, - {SPEC|68, BINDFNC, openline}, - {SPEC|69, BINDFNC, killtext}, - {SPEC|65, BINDFNC, forwdel}, - {SPEC|64, BINDFNC, ctlxe}, - {SPEC|67, BINDFNC, refresh}, - {SPEC|66, BINDFNC, reposition}, - {SPEC|83, BINDFNC, help}, - {SPEC|81, BINDFNC, deskey}, + {SPEC|32, BINDFNC, { backline } }, + {SPEC|33, BINDFNC, { forwline } }, + {SPEC|35, BINDFNC, { backchar } }, + {SPEC|34, BINDFNC, { forwchar } }, + {SPEC|44, BINDFNC, { gotobob } }, + {SPEC|46, BINDFNC, { forwpage } }, + {SPEC|47, BINDFNC, { backpage } }, + {SPEC|82, BINDFNC, { nextwind } }, + {SPEC|68, BINDFNC, { openline } }, + {SPEC|69, BINDFNC, { killtext } }, + {SPEC|65, BINDFNC, { forwdel } }, + {SPEC|64, BINDFNC, { ctlxe } }, + {SPEC|67, BINDFNC, { uerefresh } }, + {SPEC|66, BINDFNC, { reposition } }, + {SPEC|83, BINDFNC, { help } }, + {SPEC|81, BINDFNC, { deskey } }, #endif #if HP110 - {SPEC|0x4b, BINDFNC, backchar}, - {SPEC|0x4d, BINDFNC, forwchar}, - {SPEC|0x48, BINDFNC, backline}, - {SPEC|0x50, BINDFNC, forwline}, - {SPEC|0x43, BINDFNC, help}, - {SPEC|0x73, BINDFNC, backword}, - {SPEC|0x74, BINDFNC, forwword}, - {SPEC|0x49, BINDFNC, backpage}, - {SPEC|0x51, BINDFNC, forwpage}, + {SPEC|0x4b, BINDFNC, { backchar } }, + {SPEC|0x4d, BINDFNC, { forwchar } }, + {SPEC|0x48, BINDFNC, { backline } }, + {SPEC|0x50, BINDFNC, { forwline } }, + {SPEC|0x43, BINDFNC, { help } }, + {SPEC|0x73, BINDFNC, { backword } }, + {SPEC|0x74, BINDFNC, { forwword } }, + {SPEC|0x49, BINDFNC, { backpage } }, + {SPEC|0x51, BINDFNC, { forwpage } }, #endif #if AMIGA - {SPEC|'?', BINDFNC, help}, - {SPEC|'A', BINDFNC, backline}, - {SPEC|'B', BINDFNC, forwline}, - {SPEC|'C', BINDFNC, forwchar}, - {SPEC|'D', BINDFNC, backchar}, - {SPEC|'T', BINDFNC, backpage}, - {SPEC|'S', BINDFNC, forwpage}, - {SPEC|'a', BINDFNC, backword}, - {SPEC|'`', BINDFNC, forwword}, - {127, BINDFNC, forwdel}, + {SPEC|'?', BINDFNC, { help } }, + {SPEC|'A', BINDFNC, { backline } }, + {SPEC|'B', BINDFNC, { forwline } }, + {SPEC|'C', BINDFNC, { forwchar } }, + {SPEC|'D', BINDFNC, { backchar } }, + {SPEC|'T', BINDFNC, { backpage } }, + {SPEC|'S', BINDFNC, { forwpage } }, + {SPEC|'a', BINDFNC, { backword } }, + {SPEC|'`', BINDFNC, { forwword } }, + {127, BINDFNC, { forwdel } }, #endif #if TOS - {SPEC|CTRL|'5', BINDFNC, help}, + {SPEC|CTRL|'5', BINDFNC, { help } }, #endif #if WANGPC @@ -341,8 +348,5 @@ NOSHARE KEYTAB keytab[NBINDS] = { SPEC|0x8F, BINDFNC, gotoline, /* GoTo */ SPEC|0x9F, BINDFNC, usebuffer, /* ^GoTo */ #endif - - {CTRL|'?', BINDFNC, backdel}, - - {0, BINDNUL, NULL} + {0, BINDNUL, { NULL } } }; diff --git a/h/edef.h b/h/edef.h index a16faef..b202055 100644 --- a/h/edef.h +++ b/h/edef.h @@ -4,6 +4,8 @@ written by Daniel Lawrence based on code by Dave G. Conroy, Steve Wilhite and George Jones + + Unicode support by Jean-Michel Dubois */ #ifdef maindef @@ -12,8 +14,22 @@ /* initialized global definitions */ +#if CURSES + +WINDOW* wmenubar; +WINDOW* wmain; +PANEL* pmenu; +PANEL* pmain; +WINDOW* wdrop = NULL; +PANEL* pdrop; +#endif + NOSHARE int DNEAR fillcol = 72; /* Current fill column */ +#if UTF8 +NOSHARE unsigned int kbdm[NKBDM]; /* Macro */ +#else NOSHARE short kbdm[NKBDM]; /* Macro */ +#endif NOSHARE char *execstr = NULL; /* pointer to string to execute */ NOSHARE char golabel[NPAT] = ""; /* current line to go to */ NOSHARE char paralead[NPAT] = " \t"; /* paragraph leadin chars */ @@ -32,12 +48,31 @@ NOSHARE int DNEAR mouse_move = 1; /* user allow tracking mouse moves? */ NOSHARE int DNEAR mmove_flag = TRUE; /* code currently allowing mmoves? */ NOSHARE int DNEAR newscreenflag = FALSE;/* Create new screen on reads? */ NOSHARE int DNEAR overlap = 2; /* overlap when paging screens */ -CONST char *modename[] = { /* name of modes */ +CONST char *modename[NUMMODES] = { /* name of modes */ "WRAP", "CMODE", "SPELL", "EXACT", "VIEW", "OVER", - "MAGIC", "CRYPT", "ASAVE", "REP", "ABBREV"}; + "MAGIC", "CRYPT", "ASAVE", "REP", "ABBREV" +#if JMDEXT + , "NOBAK", "SLINE", "DLINE" +#if THEOX + , "THEOX" /* support of TheoX character set */ +#endif +#endif + }; +#if JMDEXT +CONST char modecode[] = "WCSEVOMYARBKsl"/* letters to represent modes */ +#if THEOX + "X" +#endif + ; +#else CONST char modecode[] = "WCSEVOMYARB"; /* letters to represent modes */ +#endif NOSHARE int DNEAR numfunc = NFUNCS; /* number of bindable functions */ +#if MDTHEOX NOSHARE int DNEAR gmode = 0; /* global editor mode */ +#else +NOSHARE int DNEAR gmode = 0; /* global editor mode */ +#endif NOSHARE int DNEAR gflags = GFREAD; /* global control flag */ NOSHARE int DNEAR gfcolor = 7; /* global forgrnd color (white) */ NOSHARE int DNEAR gbcolor = 0; /* global backgrnd color (black)*/ @@ -94,7 +129,7 @@ NOSHARE CONST char *cname[] = { /* names of colors */ "MAGENTA", "CYAN", "GREY", "GRAY", "LRED", "LGREEN", "LYELLOW", "LBLUE", "LMAGENTA", "LCYAN", "WHITE"}; - + NOSHARE int kill_index; /* current index into kill ring */ NOSHARE KILL *kbufp[NRING]; /* current kill buffer chunk pointer*/ NOSHARE KILL *kbufh[NRING]; /* kill buffer header pointer */ @@ -103,8 +138,17 @@ NOSHARE int kused[NRING]; /* # of bytes used in last kill chunk*/ NOSHARE EWINDOW *swindow = NULL; /* saved window pointer */ NOSHARE int cryptflag = FALSE; /* currently encrypting? */ NOSHARE int oldcrypt = FALSE; /* using old(broken) encryption? */ +#if UTF8 +NOSHARE unsigned int *kbdptr; /* current position in keyboard buf */ +NOSHARE unsigned int *kbdend = &kbdm[0];/* ptr to end of the keyboard */ +#else NOSHARE short *kbdptr; /* current position in keyboard buf */ +#if THEOSC +NOSHARE short *kbdend = kbdm; /* ptr to end of the keyboard */ +#else NOSHARE short *kbdend = &kbdm[0]; /* ptr to end of the keyboard */ +#endif +#endif NOSHARE int DNEAR kbdmode = STOP; /* current keyboard macro mode */ NOSHARE int DNEAR kbdrep = 0; /* number of repetitions */ NOSHARE int DNEAR restflag = FALSE; /* restricted use? */ @@ -119,6 +163,7 @@ CONST char errorm[] = "ERROR"; /* error literal */ CONST char truem[] = "TRUE"; /* true literal */ CONST char falsem[] = "FALSE"; /* false litereal */ NOSHARE int DNEAR cmdstatus = TRUE; /* last command status */ +NOSHARE int schstatus = TRUE; /* last search status jmd */ NOSHARE char palstr[49] = ""; /* palette string */ NOSHARE char lastmesg[NSTRING] = ""; /* last message posted */ NOSHARE char rval[NSTRING] = "0"; /* result of last procedure/sub */ @@ -155,6 +200,9 @@ NOSHARE EWINDOW *curwp; /* Current window */ NOSHARE BUFFER *curbp; /* Current buffer */ NOSHARE EWINDOW *wheadp; /* Head of list of windows */ NOSHARE BUFFER *bheadp; /* Head of list of buffers */ +#if LIBHELP +NOSHARE BUFFER *helpbp; /* Help buffer */ +#endif NOSHARE UTABLE *uv_head; /* head of list of user variables */ NOSHARE UTABLE *uv_global; /* global variable table */ NOSHARE ABBREV *ab_head; /* head of the abbreviation list */ @@ -164,16 +212,19 @@ NOSHARE int DNEAR ab_quick; /* aggressive completion enabled? */ NOSHARE char ab_word[NSTRING]; /* current word being typed */ NOSHARE char *ab_pos; /* current place in ab_word */ NOSHARE char *ab_end; /* ptr to physical end of ab_word */ -NOSHARE SCREEN *first_screen; /* Head and current screen in list */ +NOSHARE ESCREEN *first_screen; /* Head and current screen in list */ NOSHARE BUFFER *blistp; /* Buffer for C-X C-B */ NOSHARE BUFFER *ulistp; /* Buffer for C-X U */ NOSHARE BUFFER *slistp; /* Buffer for A-B */ NOSHARE char sres[NBUFN]; /* current screen resolution */ NOSHARE char os[NBUFN]; /* what OS are we running under */ - +#if UTF8 +NOSHARE char locale[NSTRING]; /* LC_CTYPE locale backup */ +#else NOSHARE char lowcase[HICHAR]; /* lower casing map */ NOSHARE char upcase[HICHAR]; /* upper casing map */ +#endif NOSHARE unsigned char pat[NPAT]; /* Search pattern */ NOSHARE unsigned char tap[NPAT]; /* Reversed pattern array. */ @@ -214,7 +265,7 @@ NOSHARE MC tapcm[NPAT]; /* the reversed magic pattern */ NOSHARE MC mcdeltapat[2]; /* the no-magic pattern */ NOSHARE MC tapatledcm[2]; /* the reversed no-magic pattern*/ NOSHARE RMC rmcpat[NPAT]; /* the replacement magic array */ -NOSHARE char *grpmatch[MAXGROUPS]; /* holds groups found in search */ +NOSHARE char *grpmatch[MAXGROUPS]; /* holds groups found in search */ #endif @@ -253,9 +304,22 @@ int winch_flag=0; /* Window size changed flag */ /* for all the other .C files */ /* initialized global external declarations */ +#if CURSES +extern WINDOW* wmenubar; +extern WINDOW* wmain; +extern PANEL* pmenu; +extern PANEL* pmain; +extern WINDOW* wdrop; +extern PANEL* pdrop; +#endif + NOSHARE extern int DNEAR fillcol; /* Current fill column */ +#if UTF8 +NOSHARE extern unsigned int kbdm[DUMMYSZ]; /* Holds keyboard macro data */ +#else NOSHARE extern short kbdm[DUMMYSZ]; /* Holds keyboard macro data */ +#endif NOSHARE extern char *execstr; /* pointer to string to execute */ NOSHARE extern char golabel[DUMMYSZ]; /* current line to go to */ NOSHARE extern char paralead[DUMMYSZ]; /* paragraph leadin chars */ @@ -332,7 +396,7 @@ NOSHARE extern int DNEAR predef; /* " " default flag */ NOSHARE extern int DNEAR quotec; /* quote char during mlreply() */ NOSHARE extern CONST char *cname[DUMMYSZ];/* names of colors */ - + NOSHARE extern int kill_index; /* current index into kill ring */ NOSHARE extern KILL *kbufp[DUMMYSZ]; /* current kill buffer chunk pointer */ NOSHARE extern KILL *kbufh[DUMMYSZ]; /* kill buffer header pointer */ @@ -341,8 +405,13 @@ NOSHARE extern int kused[DUMMYSZ]; /* # of bytes used in kill buffer*/ NOSHARE extern EWINDOW *swindow; /* saved window pointer */ NOSHARE extern int cryptflag; /* currently encrypting? */ NOSHARE extern int oldcrypt; /* using old(broken) encryption? */ +#if UTF8 +NOSHARE extern unsigned int *kbdptr; /* current position in keyboard buf */ +NOSHARE extern unsigned int *kbdend; /* ptr to end of the keyboard */ +#else NOSHARE extern short *kbdptr; /* current position in keyboard buf */ NOSHARE extern short *kbdend; /* ptr to end of the keyboard */ +#endif NOSHARE extern int kbdmode; /* current keyboard macro mode */ NOSHARE extern int kbdrep; /* number of repetitions */ NOSHARE extern int restflag; /* restricted use? */ @@ -357,6 +426,7 @@ CONST extern char errorm[DUMMYSZ]; /* error literal */ CONST extern char truem[DUMMYSZ]; /* true literal */ CONST extern char falsem[DUMMYSZ]; /* false litereal */ NOSHARE extern int DNEAR cmdstatus; /* last command status */ +NOSHARE extern int schstatus; /* last search status jmd */ NOSHARE extern char palstr[DUMMYSZ]; /* palette string */ NOSHARE extern char lastmesg[DUMMYSZ]; /* last message posted */ NOSHARE extern char rval[DUMMYSZ]; /* result of last procedure */ @@ -393,6 +463,9 @@ NOSHARE extern EWINDOW *curwp; /* Current window */ NOSHARE extern BUFFER *curbp; /* Current buffer */ NOSHARE extern EWINDOW *wheadp; /* Head of list of windows */ NOSHARE extern BUFFER *bheadp; /* Head of list of buffers */ +#if LIBHELP +NOSHARE extern BUFFER *helpbp; /* Help buffer */ +#endif NOSHARE extern ABBREV *ab_head; /* head of the abbreviation list */ NOSHARE extern UTABLE *uv_head; /* head of list of user variables */ NOSHARE extern UTABLE *uv_global; /* global variable table */ @@ -402,17 +475,19 @@ NOSHARE extern int DNEAR ab_quick; /* aggressive completion enabled? */ NOSHARE extern char ab_word[DUMMYSZ]; /* current word being typed */ NOSHARE extern char *ab_pos; /* current place in ab_word */ NOSHARE extern char *ab_end; /* ptr to physical end of ab_word */ -NOSHARE extern SCREEN *first_screen; /* Head and current screen in list */ +NOSHARE extern ESCREEN *first_screen; /* Head and current screen in list */ NOSHARE extern BUFFER *blistp; /* Buffer for C-X C-B */ NOSHARE extern BUFFER *ulistp; /* Buffer for C-X U */ NOSHARE extern BUFFER *slistp; /* Buffer for A-B */ NOSHARE extern char sres[NBUFN]; /* current screen resolution */ NOSHARE extern char os[NBUFN]; /* what OS are we running under */ - +#if UTF8 +NOSHARE char locale[NSTRING]; /* LC_CTYPE locale backup */ +#else NOSHARE extern char lowcase[HICHAR]; /* lower casing map */ NOSHARE extern char upcase[HICHAR]; /* upper casing map */ - +#endif NOSHARE extern unsigned char pat[DUMMYSZ]; /* Search pattern */ NOSHARE extern unsigned char tap[DUMMYSZ]; /* Reversed pattern array. */ NOSHARE extern unsigned char rpat[DUMMYSZ]; /* replacement pattern */ @@ -440,7 +515,7 @@ NOSHARE extern MC tapcm[NPAT]; /* the reversed magic pattern */ NOSHARE extern MC mcdeltapat[2]; /* the no-magic pattern */ NOSHARE extern MC tapatledcm[2]; /* the reversed no-magic pattern*/ NOSHARE extern RMC rmcpat[NPAT]; /* the replacement magic array */ -NOSHARE extern char *grpmatch[MAXGROUPS]; /* holds groups found in search */ +NOSHARE extern char *grpmatch[MAXGROUPS]; /* holds groups found in search */ #endif NOSHARE extern DELTA deltapat; /* Forward pattern delta structure.*/ diff --git a/h/efunc.h b/h/efunc.h index 8127b84..770944b 100644 --- a/h/efunc.h +++ b/h/efunc.h @@ -20,24 +20,32 @@ NOSHARE NBIND names[] = { {"add-global-mode", setgmode}, #if UNIX || (VMS && SMG) || MPE {"add-keymap", addkeymap}, +#else + {"add-keymap", notavail}, #endif {"add-mode", setmod}, {"append-file", fileapp}, {"apropos", apro}, #if CTAGS {"back-from-tag-word", backtagword}, +#else + {"back-from-tag-word", notavail}, #endif {"backward-character", backchar}, {"begin-macro", ctlxlp}, {"beginning-of-file", gotobob}, {"beginning-of-line", gotobol}, {"bind-to-key", bindtokey}, -#if WINDOW_MSWIN +#if WINDOW_MSWIN || CURSES {"bind-to-menu", bindtomenu}, +#else + {"bind-to-menu", notavail}, #endif {"buffer-position", showcpos}, #if WINDOW_MSWIN {"cascade-screens", cascadescreens}, +#else + {"cascade-screens", notavail}, #endif {"case-region-lower", lowerregion}, {"case-region-upper", upperregion}, @@ -49,16 +57,20 @@ NOSHARE NBIND names[] = { {"change-screen-row", new_row_org}, {"change-screen-size", newsize}, {"change-screen-width", newwidth}, - {"clear-and-redraw", refresh}, + {"clear-and-redraw", uerefresh}, {"clear-message-line", clrmes}, #if WINDOW_MSWIN {"clip-region", clipregion}, +#else + {"clip-region", notavail}, #endif {"copy-region", copyregion}, {"count-words", wordcount}, {"ctlx-prefix", cex}, #if WINDOW_MSWIN {"cut-region", cutregion}, +#else + {"cut-region", notavail}, #endif {"cycle-ring", cycle_ring}, {"cycle-screens", cycle_screens}, @@ -99,7 +111,7 @@ NOSHARE NBIND names[] = { {"execute-program", execprg}, {"exit-emacs", quit}, {"fill-paragraph", fillpara}, - {"filter-buffer", filter}, + {"filter-buffer", uefilter}, {"find-file", filefind}, {"find-screen", find_screen}, {"forward-character", forwchar}, @@ -108,21 +120,37 @@ NOSHARE NBIND names[] = { {"goto-mark", gotomark}, {"goto-matching-fence", getfence}, {"grow-window", enlargewind}, - {"handle-tab", tab}, + {"handle-tab", uetab}, {"help", help}, #if WINDOW_MSWIN {"help-engine", helpengine}, +#else + {"help-engine", notavail}, +#endif +#if LIBHELP + {"hide-buffer", hidebuffer}, +#else + {"hide-buffer", notavail}, #endif {"hunt-backward", backhunt}, {"hunt-forward", forwhunt}, {"i-shell", spawncli}, #if ISRCH {"incremental-search", fisearch}, +#else + {"incremental-search", notavail}, #endif {"indent-region", indent_region}, +#if LIBHELP + {"index-help", hlpindex}, +#else + {"index-help", notavail}, +#endif {"insert-abbrevs", ins_abbrevs}, #if WINDOW_MSWIN {"insert-clip", insertclip}, +#else + {"insert-clip", notavail}, #endif {"insert-file", insfile}, {"insert-space", insspace}, @@ -133,22 +161,42 @@ NOSHARE NBIND names[] = { {"kill-to-end-of-line", killtext}, #if FLABEL {"label-function-key", fnclabel}, +#else + {"label-function-key", notavail}, #endif {"list-buffers", listbuffers}, -#if UNIX || (VMS && SMG) || MPE +#if UNIX || (VMS && SMG) || MPE || LINUX {"list-keymappings", listkeymaps}, +#else + {"list-keymappings", notavail}, #endif {"list-screens", list_screens}, {"list-undos", undo_list}, {"local", local_var}, +#if LIBHELP + {"look-word", lookupword}, +#else + {"look-word", notavail}, +#endif {"macro-to-key", macrotokey}, -#if WINDOW_MSWIN +#if WINDOW_MSWIN || CURSES {"macro-to-menu", macrotomenu}, +#else + {"macro-to-menu", notavail}, +#endif +#if WINDOW_MSWIN {"maximize-screen", maximizescreen}, +#else + {"maximize-screen", notavail}, +#endif +#if CURSES + {"menu-drop", menudrop}, #endif - {"meta-prefix", meta}, + {"meta-prefix", uemeta}, #if WINDOW_MSWIN {"minimize-screen", minimizescreen}, +#else + {"minimize-screen", notavail}, #endif #if MOUSE {"mouse-move", mmove}, @@ -158,12 +206,20 @@ NOSHARE NBIND names[] = { {"mouse-region-up", mregup}, {"mouse-resize-screen", resizm}, {"mouse-resize2-screen", resizm2}, +#else + {"mouse-move", notavail}, + {"mouse-move-down", notavail}, + {"mouse-move-up", notavail}, + {"mouse-region-down", notavail}, + {"mouse-region-up", notavail}, + {"mouse-resize-screen", notavail}, + {"mouse-resize2-screen", notavail}, #endif {"move-window-down", mvdnwind}, {"move-window-up", mvupwind}, {"name-buffer", namebuffer}, {"narrow-to-region", narrow}, - {"newline", newline}, + {"newline", uenewline}, {"newline-and-indent", indent}, {"next-buffer", nextbuffer}, {"next-line", forwline}, @@ -182,11 +238,18 @@ NOSHARE NBIND names[] = { {"previous-window", prevwind}, {"previous-word", backword}, {"print", writemsg}, +#if LIBHELP + {"prompt-look", promptlook}, +#else + {"prompt-look", notavail}, +#endif {"query-replace-string", qreplace}, {"quick-exit", quickexit}, {"quote-character", quote}, #if CTAGS {"re-tag-word", retagword}, +#else + {"re-tag-word", notavail}, #endif {"read-file", fileread}, {"redraw-display", reposition}, @@ -196,10 +259,14 @@ NOSHARE NBIND names[] = { {"resize-window", resize}, #if WINDOW_MSWIN {"restore-screen", restorescreen}, +#else + {"restore-screen", notavail}, #endif {"restore-window", restwnd}, #if ISRCH {"reverse-incremental-search", risearch}, +#else + {"reverse-incremental-search", notavail}, #endif {"run", execproc}, {"save-file", filesave}, @@ -212,6 +279,8 @@ NOSHARE NBIND names[] = { {"set", setvar}, #if CRYPT {"set-encryption-key", setekey}, +#else + {"set-encryption-key", notavail}, #endif {"set-mark", setmark}, {"shell-command", spawn}, @@ -222,18 +291,26 @@ NOSHARE NBIND names[] = { {"store-procedure", storeproc}, #if BSD || FREEBSD || VMS || SUN || HPUX8 || HPUX9 || AVIION {"suspend-emacs", bktoshell}, +#else + {"suspend-emacs", notavail}, #endif #if CTAGS {"tag-word", tagword}, +#else + {"tag-word", notavail}, #endif #if WINDOW_MSWIN {"tile-screens", tilescreens}, +#else + {"tile-screens", notavail}, #endif {"transpose-characters", twiddle}, {"trim-region", trim}, {"unbind-key", unbindkey}, -#if WINDOW_MSWIN +#if WINDOW_MSWIN || CURSES {"unbind-menu", unbindmenu}, +#else + {"unbind-menu", notavail}, #endif {"undent-region", undent_region}, {"undo", undo}, @@ -247,7 +324,11 @@ NOSHARE NBIND names[] = { {"write-message", writemsg}, {"yank", yank}, {"yank-pop", yank_pop}, - +#if LIBHELP + {"zap-help", zaphelp}, +#else + {"zap-help", notavail}, +#endif {"", NULL} }; diff --git a/h/elang.h b/h/elang.h index 9733748..b162f2d 100644 --- a/h/elang.h +++ b/h/elang.h @@ -3,6 +3,313 @@ (C)opyright 1995 by Daniel Lawrence */ +#if DYNMSGS +extern CONST char* ldmsg(int); +#define LANGUAGE ldmsg(0) +#define TEXT1 ldmsg(1) +#define TEXT2 ldmsg(2) +#define TEXT3 ldmsg(3) +#define TEXT4 ldmsg(4) +#define TEXT5 ldmsg(5) +#define TEXT6 ldmsg(6) +#define TEXT7 ldmsg(7) +#define TEXT8 ldmsg(8) +#define TEXT9 ldmsg(9) +#define TEXT10 ldmsg(10) +#define TEXT11 ldmsg(11) +#define TEXT12 ldmsg(12) +#define TEXT13 ldmsg(13) +#define TEXT14 ldmsg(14) +#define TEXT15 ldmsg(15) +#define TEXT16 ldmsg(16) +#define TEXT17 ldmsg(17) +#define TEXT18 ldmsg(18) +#define TEXT19 ldmsg(19) +#define TEXT20 ldmsg(20) +#define TEXT21 ldmsg(21) +#define TEXT22 ldmsg(22) +#define TEXT23 ldmsg(23) +#define TEXT24 ldmsg(24) +#define TEXT25 ldmsg(25) +#define TEXT26 ldmsg(26) +#define TEXT27 ldmsg(27) +#define TEXT28 ldmsg(28) +#define TEXT29 ldmsg(29) +#define TEXT30 ldmsg(30) +#define TEXT31 ldmsg(31) +#define TEXT32 ldmsg(32) +#define TEXT33 ldmsg(33) +#define TEXT34 ldmsg(34) +#define TEXT35 ldmsg(35) +#define TEXT36 ldmsg(36) +#define TEXT37 ldmsg(37) +#define TEXT38 ldmsg(38) +#define TEXT39 ldmsg(39) +#define TEXT40 ldmsg(40) +#define TEXT41 ldmsg(41) +#define TEXT42 ldmsg(42) +#define TEXT43 ldmsg(43) +#define TEXT44 ldmsg(44) +#define TEXT45 ldmsg(45) +#define TEXT46 ldmsg(46) +#define TEXT47 ldmsg(47) +#define TEXT48 ldmsg(48) +#define TEXT49 ldmsg(49) +#define TEXT50 ldmsg(50) +#define TEXT51 ldmsg(51) +#define TEXT52 ldmsg(52) +#define TEXT53 ldmsg(53) +#define TEXT54 ldmsg(54) +#define TEXT55 ldmsg(55) +#define TEXT56 ldmsg(56) +#define TEXT57 ldmsg(57) +#define TEXT58 ldmsg(58) +#define TEXT59 ldmsg(59) +#define TEXT60 ldmsg(60) +#define TEXT61 ldmsg(61) +#define TEXT62 ldmsg(62) +#define TEXT63 ldmsg(63) +#define TEXT64 ldmsg(64) +#define TEXT65 ldmsg(65) +#define TEXT66 ldmsg(66) +#define TEXT67 ldmsg(67) +#define TEXT68 ldmsg(68) +#define TEXT69 ldmsg(69) +#define TEXT70 ldmsg(70) +#define TEXT71 ldmsg(71) +#define TEXT72 ldmsg(72) +#define TEXT73 ldmsg(73) +#define TEXT74 ldmsg(74) +#define TEXT75 ldmsg(75) +#define TEXT76 ldmsg(76) +#define TEXT77 ldmsg(77) +#define TEXT78 ldmsg(78) +#define TEXT79 ldmsg(79) +#define TEXT80 ldmsg(80) +#define TEXT81 ldmsg(81) +#define TEXT82 ldmsg(82) +#define TEXT83 ldmsg(83) +#define TEXT84 ldmsg(84) +#define TEXT85 ldmsg(85) +#define TEXT86 ldmsg(86) +#define TEXT87 ldmsg(87) +#define TEXT88 ldmsg(88) +#define TEXT89 ldmsg(89) +#define TEXT90 ldmsg(90) +#define TEXT91 ldmsg(91) +#define TEXT92 ldmsg(92) +#define TEXT93 ldmsg(93) +#define TEXT94 ldmsg(94) +#define TEXT95 ldmsg(95) +#define TEXT96 ldmsg(96) +#define TEXT97 ldmsg(97) +#define TEXT98 ldmsg(98) +#define TEXT99 ldmsg(99) +#define TEXT100 ldmsg(100) +#define TEXT101 ldmsg(101) +#define TEXT102 ldmsg(102) +#define TEXT103 ldmsg(103) +#define TEXT104 ldmsg(104) +#define TEXT105 ldmsg(105) +#define TEXT106 ldmsg(106) +#define TEXT107 ldmsg(107) +#define TEXT108 ldmsg(108) +#define TEXT109 ldmsg(109) +#define TEXT110 ldmsg(110) +#define TEXT111 ldmsg(111) +#define TEXT112 ldmsg(112) +#define TEXT113 ldmsg(113) +#define TEXT114 ldmsg(114) +#define TEXT115 ldmsg(115) +#define TEXT116 ldmsg(116) +#define TEXT117 ldmsg(117) +#define TEXT118 ldmsg(118) +#define TEXT119 ldmsg(119) +#define TEXT120 ldmsg(120) +#define TEXT121 ldmsg(121) +#define TEXT122 ldmsg(122) +#define TEXT123 ldmsg(123) +#define TEXT124 ldmsg(124) +#define TEXT125 ldmsg(125) +#define TEXT126 ldmsg(126) +#define TEXT127 ldmsg(127) +#define TEXT128 ldmsg(128) +#define TEXT129 ldmsg(129) +#define TEXT130 ldmsg(130) +#define TEXT131 ldmsg(131) +#define TEXT132 ldmsg(132) +#define TEXT133 ldmsg(133) +#define TEXT134 ldmsg(134) +#define TEXT135 ldmsg(135) +#define TEXT136 ldmsg(136) +#define TEXT137 ldmsg(137) +#define TEXT138 ldmsg(138) +#define TEXT139 ldmsg(139) +#define TEXT140 ldmsg(140) +#define TEXT141 ldmsg(141) +#define TEXT142 ldmsg(142) +#define TEXT143 ldmsg(143) +#define TEXT144 ldmsg(144) +#define TEXT145 ldmsg(145) +#define TEXT146 ldmsg(146) +#define TEXT147 ldmsg(147) +#define TEXT148 ldmsg(148) +#define TEXT149 ldmsg(149) +#define TEXT150 ldmsg(150) +#define TEXT151 ldmsg(151) +#define TEXT152 ldmsg(152) +#define TEXT153 ldmsg(153) +#define TEXT154 ldmsg(154) +#define TEXT155 ldmsg(155) +#define TEXT156 ldmsg(156) +#define TEXT157 ldmsg(157) +#define TEXT158 ldmsg(158) +#define TEXT159 ldmsg(159) +#define TEXT160 ldmsg(160) +#define TEXT161 ldmsg(161) +#define TEXT162 ldmsg(162) +#define TEXT163 ldmsg(163) +#define TEXT164 ldmsg(164) +#define TEXT165 ldmsg(165) +#define TEXT166 ldmsg(166) +#define TEXT167 ldmsg(167) +#define TEXT168 ldmsg(168) +#define TEXT169 ldmsg(169) +#define TEXT170 ldmsg(170) +#define TEXT171 ldmsg(171) +#define TEXT172 ldmsg(172) +#define TEXT173 ldmsg(173) +#define TEXT174 ldmsg(174) +#define TEXT175 ldmsg(175) +#define TEXT176 ldmsg(176) +#define TEXT177 ldmsg(177) +#define TEXT178 ldmsg(178) +#define TEXT179 ldmsg(179) +#define TEXT180 ldmsg(180) +#define TEXT181 ldmsg(181) +#define TEXT182 ldmsg(182) +#define TEXT183 ldmsg(183) +#define TEXT184 ldmsg(184) +#define TEXT185 ldmsg(185) +#define TEXT186 ldmsg(186) +#define TEXT187 ldmsg(187) +#define TEXT188 ldmsg(188) +#define TEXT189 ldmsg(189) +#define TEXT190 ldmsg(190) +#define TEXT191 ldmsg(191) +#define TEXT192 ldmsg(192) +#define TEXT193 ldmsg(193) +#define TEXT194 ldmsg(194) +#define TEXT195 ldmsg(195) +#define TEXT196 ldmsg(196) +#define TEXT197 ldmsg(197) +#define TEXT198 ldmsg(198) +#define TEXT199 ldmsg(199) +#define TEXT200 ldmsg(200) +#define TEXT201 ldmsg(201) +#define TEXT202 ldmsg(202) +#define TEXT203 ldmsg(203) +#define TEXT204 ldmsg(204) +#define TEXT205 ldmsg(205) +#define TEXT206 ldmsg(206) +#define TEXT207 ldmsg(207) +#define TEXT208 ldmsg(208) +#define TEXT209 ldmsg(209) +#define TEXT210 ldmsg(210) +#define TEXT211 ldmsg(211) +#define TEXT212 ldmsg(212) +#define TEXT213 ldmsg(213) +#define TEXT214 ldmsg(214) +#define TEXT215 ldmsg(215) +#define TEXT216 ldmsg(216) +#define TEXT217 ldmsg(217) +#define TEXT218 ldmsg(218) +#define TEXT219 ldmsg(219) +#define TEXT220 ldmsg(220) +#define TEXT221 ldmsg(221) +#define TEXT222 ldmsg(222) +#define TEXT223 ldmsg(223) +#define TEXT224 ldmsg(224) +#define TEXT225 ldmsg(225) +#define TEXT226 ldmsg(226) +#define TEXT227 ldmsg(227) +#define TEXT228 ldmsg(228) +#define TEXT229 ldmsg(229) +#define TEXT230 ldmsg(230) +#define TEXT231 ldmsg(231) +#define TEXT232 ldmsg(232) +#define TEXT233 ldmsg(233) +#define TEXT234 ldmsg(234) +#define TEXT235 ldmsg(235) +#define TEXT236 ldmsg(236) +#define TEXT240 ldmsg(240) +#define TEXT241 ldmsg(241) +#define TEXT242 ldmsg(242) +#define TEXT243 ldmsg(243) +#define TEXT244 ldmsg(244) +#define TEXT245 ldmsg(245) +#define TEXT246 ldmsg(246) +#define TEXT247 ldmsg(247) +#define TEXT248 ldmsg(248) +#define TEXT249 ldmsg(249) +#define TEXT250 ldmsg(250) + +#define TEXT284 ldmsg(284) +#define TEXT285 ldmsg(285) +#define TEXT286 ldmsg(286) +#define TEXT287 ldmsg(287) +#define TEXT288 ldmsg(288) +#define TEXT289 ldmsg(289) +#define TEXT290 ldmsg(290) +#define TEXT291 ldmsg(291) +#define TEXT292 ldmsg(292) +#define TEXT293 ldmsg(293) +#define TEXT294 ldmsg(294) +#define TEXT295 ldmsg(295) +#define TEXT296 ldmsg(296) +#define TEXT297 ldmsg(297) +#define TEXT298 ldmsg(298) +#define TEXT299 ldmsg(299) +#define TEXT300 ldmsg(300) +#define TEXT301 ldmsg(301) +#define TEXT302 ldmsg(302) +#define TEXT303 ldmsg(303) +#define TEXT304 ldmsg(304) +#define TEXT305 ldmsg(305) +#define TEXT306 ldmsg(306) +#define TEXT307 ldmsg(307) +#define TEXT308 ldmsg(308) +#define TEXT310 ldmsg(310) +#define TEXT311 ldmsg(311) +#define TEXT312 ldmsg(312) +#define TEXT313 ldmsg(313) +#define TEXT314 ldmsg(314) +#define TEXT315 ldmsg(315) +#define TEXT316 ldmsg(316) +#define TEXT317 ldmsg(317) +#define TEXT318 ldmsg(318) +#define TEXT319 ldmsg(319) +#define TEXT320 ldmsg(320) +#define TEXT321 ldmsg(321) +#define TEXT322 ldmsg(322) +#define TEXT323 ldmsg(323) +#define TEXT324 ldmsg(324) +#define TEXT325 ldmsg(325) +#define TEXT326 ldmsg(326) +#define TEXT327 ldmsg(327) +#define CHAR328 ldmsg(328)[0] +#define TEXT329 ldmsg(329) +#define TEXT330 ldmsg(330) +#define TEXT331 ldmsg(331) +#define TEXT332 ldmsg(332) +#define TEXT333 ldmsg(333) +#define TEXT334 ldmsg(334) +#define TEXT335 ldmsg(335) +#define TEXT336 ldmsg(336) +#define TEXT337 ldmsg(337) +#define TEXT338 ldmsg(338) + +#else /* ?DYNMSGS */ #if ENGLISH #include "english.h" #define LANGUAGE "english" @@ -39,3 +346,5 @@ #include "latin.h" #define LANGUAGE "latin" #endif +#endif /* !DYNMSGS */ + diff --git a/h/english.h b/h/english.h index cb0dceb..032b7d7 100644 --- a/h/english.h +++ b/h/english.h @@ -36,7 +36,11 @@ #define TEXT27 "Pop buffer" #define TEXT28 "Buffer is being displayed" #define TEXT29 "Change buffer name to: " +#if JMDEXT +#define TEXT30 "ACTN Modes Size Buffer File" +#else #define TEXT30 "ACTN Modes Size Buffer File" +#endif #define TEXT31 " Global Modes" #define TEXT32 "Discard changes" #define TEXT33 "Encryption String: " @@ -66,7 +70,11 @@ #define TEXT57 "Can not display variable list" #define TEXT58 "[Building variable list]" #define TEXT59 UNUSED -#define TEXT60 "Line %D/%D Col %d/%d Char %D/%D (%d%%) char = 0x%x" +#if THEOX +#define TEXT60 "Line %D/%D Col %d/%d Char %D/%D (%d%%) Unicode char = 0x%x %d, TheoX char = 0x%x %d" +#else +#define TEXT60 "Line %D/%D Col %d/%d Char %D/%D (%d%%) char = 0x%x %d" +#endif #define TEXT61 "" #define TEXT62 "Global mode to " #define TEXT63 "Mode to " @@ -92,7 +100,7 @@ #define TEXT83 UNUSED #define TEXT84 "Replace " #define TEXT85 "Query replace " -#define TEXT86 "with " +#define TEXT86 "with abort, =empty, " #define TEXT87 "Replace '" #define TEXT88 "' with '" #define TEXT89 "Aborted!" @@ -242,7 +250,8 @@ #define TEXT233 "[Building Abbreviation list]" #define TEXT234 "Abbreviation list" #define TEXT235 "Can not display abbreviation list" -#define TEXT236 "Define Abbreviations in buffer" +#define TEXT236 "Define Abbreviations from buffer" + #define TEXT240 "[No such screen]" #define TEXT241 "%%Can't delete current screen" #define TEXT242 "Find Screen: " @@ -254,7 +263,26 @@ #define TEXT248 "Enter Label String: " #define TEXT249 "Global variable to declare: " #define TEXT250 "Local variable to declare: " - +#if JMDEXT +#define TEXT284 "Function not available" +#define TEXT285 "No topic" +#define TEXT286 "Searching topic \"%s\"" +#define TEXT287 "Searching keyword \"%s\"" +#define TEXT288 "Topic: " +#define TEXT289 "Keyword: " +#define TEXT290 "No help for topic \"%s\"" +#define TEXT291 "No help for keyword \"%s\"" +#define TEXT292 "Unable to open the help file %s" +#define TEXT293 "Index of " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s is not a regular file" +#endif +#if THEOS +#define TEXT298 "%s is not a sequential file" +#define TEXT299 "%s is not a library" +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Incorrect menu]" #define TEXT301 "[Too many nested popup menus]" @@ -293,4 +321,4 @@ #define TEXT335 "Change screen name to: " #define TEXT336 "[Screen name already in use]" #define TEXT337 "cannot monitor external program" - +#define TEXT338 "Internal command to execute (space for help):" diff --git a/h/epath.h b/h/epath.h index 01103bd..feb7239 100644 --- a/h/epath.h +++ b/h/epath.h @@ -1,5 +1,5 @@ /* EPATH: This file contains certain info needed to locate the - MicroEMACS files on a system dependant basis. + MicroEMACS files on a system dependent basis. */ @@ -16,6 +16,13 @@ NOSHARE CONST char *pathname[] = ":t/", ":s/" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "error.cmd", +}; +#endif #endif #if TOS @@ -27,8 +34,15 @@ NOSHARE CONST char *pathname[] = "\\util\\", "" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "error.cmd", +}; +#endif #endif - + #if FINDER { "emacs.rc", @@ -37,11 +51,22 @@ NOSHARE CONST char *pathname[] = "/sys/public", "" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "error.cmd", +}; +#endif #endif #if MSDOS || WINNT || WINXP { +#if WINDOW_MSWIN || WINDOW_MSWIN32 + "mewin.cmd", +#else "emacs.rc", +#endif "emacs.hlp", "\\sys\\public\\", "\\usr\\bin\\", @@ -49,6 +74,13 @@ NOSHARE CONST char *pathname[] = "\\", "" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "error.cmd", +}; +#endif #endif #if OS2 @@ -62,16 +94,35 @@ NOSHARE CONST char *pathname[] = "\\", "" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "error.cmd", +}; +#endif #endif #if V7 | BSD | FREEBSD | USG | AIX | SMOS | HPUX8 | HPUX9 | XENIX | SUN | AVIION { ".emacsrc", "emacs.hlp", +#if JMDEXT + "/usr/local/share/uemacs/", + "/opt/lib/uemacs/", + "/usr/lib/uemacs/", +#endif "/usr/local/", "/usr/lib/", "" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "error.cmd", +}; +#endif #endif #if VMS @@ -82,6 +133,13 @@ NOSHARE CONST char *pathname[] = "SYS$LOGIN:", "" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "error.cmd", +}; +#endif #endif #if WMCS @@ -91,6 +149,13 @@ NOSHARE CONST char *pathname[] = "", "sys$disk/syslib.users/" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "error.cmd", +}; +#endif #endif #if AOSVS @@ -104,6 +169,13 @@ NOSHARE CONST char *pathname[] = "/macros/", "/help/" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "error.cmd", +}; +#endif #endif #if MPE @@ -114,6 +186,29 @@ NOSHARE CONST char *pathname[] = ".pub.sys", "" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacsmsg", + "errorcmd", +}; +#endif #endif /* MPE */ +#if THEOS +{ + "emacs.rc", + "system.help386 ._me", + "/usr/local/lib/emacs/", + "" +}; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "error.cmd", +}; +#endif +#endif + #define NPNAMES (sizeof(pathname)/sizeof(char *)) diff --git a/h/eproto.h b/h/eproto.h index bdad979..f0f2bc6 100644 --- a/h/eproto.h +++ b/h/eproto.h @@ -6,14 +6,51 @@ Steve Wilhite and George Jones */ +#if LINUX +#include +#include +#include +#include +#include +#include +#endif +#if UTF8 +#include +#endif +#if CURSES +#undef CTRL +#if UTF8 +#include /* Curses screen output */ +#include /* Curses screen output */ +#define CTRL 0x01000000 /* Restore definition */ +#else +#include /* Curses screen output */ +#include /* Curses screen output */ +#define CTRL 0x0100 /* Restore definition */ +#endif +#endif + #if PROTO /*** global function prototypes ***/ +#if CURSES +extern int handlemenu(WINDOW* wmouse, int ypos, int xpos); +#endif + +#if CURSES +extern int bindtomenu (int f, int n); +extern int macrotomenu (int f, int n); +extern int unbindmenu (int f, int n); +extern void closedrop(void); +extern void menukey(int c); +extern int menudrop(int f, int n); +#endif + #if WINDOW_MSWIN extern char * PASCAL fullpathname (char *PathName, int Nbuf); -extern int PASCAL NEAR vtinitscr (SCREEN *sp, int nrow, int ncol); -extern int PASCAL NEAR vtsizescr (SCREEN *sp, int nrow, int ncol); +extern int PASCAL NEAR vtinitscr (ESCREEN *sp, int nrow, int ncol); +extern int PASCAL NEAR vtsizescr (ESCREEN *sp, int nrow, int ncol); extern int PASCAL cutregion (int f, int n); extern int PASCAL clipregion (int f, int n); extern int PASCAL insertclip (int f, int n); @@ -29,11 +66,19 @@ extern int PASCAL unbindmenu (int f, int n); extern int PASCAL execmenu (int f, int n); extern int PASCAL longop (int f); extern int PASCAL filenamedlg (char *prompt, char *buf, int nbuf, int fullpath); -extern int PASCAL NEAR vtfreescr (SCREEN *sp); -extern int PASCAL NEAR unlist_screen(SCREEN *sp); +extern int PASCAL NEAR vtfreescr (ESCREEN *sp); +extern int PASCAL NEAR unlist_screen(ESCREEN *sp); extern int PASCAL mlhistory(VOID); -extern int PASCAL updscrollbars (SCREEN *sp, char w_flag); -extern VOID PASCAL NEAR vtscreen (SCREEN *sp); +extern int PASCAL updscrollbars (ESCREEN *sp, char w_flag); +extern VOID PASCAL NEAR vtscreen (ESCREEN *sp); +#endif + +#if WINXP +#define ToWUpper(a) CharUpperW(a) +#define ToWLower(a) CharLowerW(a) +#else +#define ToWUpper(a) towupper(a) +#define ToWLower(a) towlower(a) #endif #if CALLED @@ -41,8 +86,13 @@ extern int emacs(int argc, char *argv[]); #endif #if HANDLE_WINCH +#if LINUX +extern VOID winch_changed(int status); +#else extern VOID winch_changed(VOID); +#endif extern VOID winch_new_size(VOID); +VOID winch_vtresize(int rows, int cols); #endif #if DEBUG_SEARCH @@ -65,74 +115,88 @@ extern int PASCAL NEAR ab_insert(char *sym, char *expansion); extern char *PASCAL NEAR ab_lookup(char *sym); extern int PASCAL NEAR ab_delete(char *sym); extern int PASCAL NEAR ab_clean(VOID); -extern BUFFER *PASCAL NEAR bfind(char *bname, int cflag, int bflag); -extern BUFFER *PASCAL NEAR getcbuf(char *prompt, char *defval, int createflag); +extern BUFFER *PASCAL NEAR bfind(CONST char *bname, int cflag, int bflag); +extern BUFFER *PASCAL NEAR getcbuf(CONST char *prompt, char *defval, int createflag); extern BUFFER *PASCAL NEAR getdefb(VOID); extern BUFFER *PASCAL NEAR getoldb(VOID); -extern SCREEN *PASCAL NEAR init_screen(char *, BUFFER *); -extern SCREEN *PASCAL NEAR lookup_screen(char *scr_name); -extern SCREEN *PASCAL NEAR index_screen(int scr_num); -extern int PASCAL NEAR screen_index(SCREEN *sp); -extern int PASCAL NEAR insert_screen(SCREEN *sp); -extern int PASCAL NEAR select_screen(SCREEN *sp, int announce); -extern int PASCAL NEAR free_screen(SCREEN *sp); +extern ESCREEN *PASCAL NEAR init_screen(char *, BUFFER *); +extern ESCREEN *PASCAL NEAR lookup_screen(char *scr_name); +extern ESCREEN *PASCAL NEAR index_screen(int scr_num); +extern int PASCAL NEAR screen_index(ESCREEN *sp); +extern int PASCAL NEAR insert_screen(ESCREEN *sp); +extern int PASCAL NEAR select_screen(ESCREEN *sp, int announce); +extern VOID PASCAL NEAR free_screen(ESCREEN *sp); extern char *Eallocate(unsigned nbytes); -extern char *dolock(char *fname); +extern char *dolock(CONST char *fname); extern char *getpath(char *filespec); extern char *gtname(char *filespec); -extern char *PASCAL NEAR bytecopy(char *dst, char *src, int maxlen); +extern char *PASCAL NEAR bytecopy(char *dst, CONST char *src, int maxlen); extern char *PASCAL NEAR cmdstr(int c, char *seq); extern char *PASCAL NEAR copystr(char *); -extern char *PASCAL NEAR complete(char *prompt, char *defval, int type, int maxlen); +extern char *PASCAL NEAR complete(CONST char *prompt, char *defval, int type, int maxlen); extern char *PASCAL NEAR envval(int i); -extern char *PASCAL NEAR fixnull(char *s); -extern char *PASCAL NEAR flook(char *fname, int hflag); +extern CONST char *PASCAL NEAR fixnull(CONST char *s); +extern CONST char *PASCAL NEAR flook(CONST char *fname, int hflag); extern char *PASCAL NEAR funval(int i); extern char *PASCAL NEAR getctext(char *rline); extern char *PASCAL NEAR getffile(char *fspec); -extern char *PASCAL NEAR getfname(KEYTAB *key); +extern CONST char *PASCAL NEAR getfname(KEYTAB *key); extern char *PASCAL NEAR getkill(VOID); extern char *PASCAL NEAR getnfile(VOID); extern char *PASCAL NEAR getreg(char *value); -extern char *PASCAL NEAR getval(char *token); +extern CONST char *PASCAL NEAR getval(char *token); extern char *PASCAL NEAR getwlist(char *buf); -extern char *PASCAL NEAR gtenv(char *vname); -extern char *PASCAL NEAR gtfilename(char *prompt); -extern char *PASCAL NEAR gtfun(char *fname); +extern CONST char *PASCAL NEAR gtenv(CONST char *vname); +extern char *PASCAL NEAR gtfilename(CONST char *prompt); +extern CONST char *PASCAL NEAR gtfun(char *fname); extern char *PASCAL NEAR gtusr(char *vname); extern char *PASCAL NEAR int_asc(int i); extern char *PASCAL NEAR long_asc(long num); -extern char *PASCAL NEAR ltos(int val); -extern char *PASCAL NEAR makename(char *bname, char *fname); +extern CONST char *PASCAL NEAR ltos(int val); +extern CONST char *PASCAL NEAR makename(char *bname, CONST char *fname); extern char *PASCAL NEAR mklower(char *str); extern char *PASCAL NEAR mkupper(char *str); extern char *PASCAL NEAR namval(int index); extern char *PASCAL NEAR timeset(VOID); extern char *PASCAL NEAR token(char *src, char *tok, int size); -extern char *PASCAL NEAR transbind(char *skey); +extern CONST char *PASCAL NEAR transbind(CONST char *skey); extern char *PASCAL NEAR trimstr(char *s); extern char *PASCAL NEAR xlat(char *source, char *lookup, char *trans); -extern char *undolock(char *fname); +extern char *undolock(CONST char *fname); extern char *PASCAL NEAR regtostr(char *buf, REGION *region); +#if UTF8 +extern unsigned int PASCAL NEAR chcase(unsigned int ch); +extern unsigned int PASCAL NEAR lowerc(unsigned int ch); +extern unsigned int PASCAL NEAR upperc(unsigned int ch); +#else +extern unsigned int PASCAL NEAR chcase(register unsigned int ch); extern int PASCAL NEAR lowerc(char ch); -extern int PASCAL NEAR cycle_ring(int f, int n); extern int PASCAL NEAR upperc(char ch); +#endif +extern int PASCAL NEAR cycle_ring(int f, int n); +extern int PASCAL NEAR setlower(char *ch, char *val); +extern int PASCAL NEAR setupper(char *ch, char *val); #if ZTC || TURBO || IC extern int (PASCAL NEAR *PASCAL NEAR fncmatch(char *fname))(int, int); extern int (PASCAL NEAR *PASCAL NEAR getname(char *prompt))(int, int); #else /* Sun (and others?) screwed up the prototyping.*/ +#if THEOSC +extern int *fncmatch(char* fname); +extern int *getname(CONST char* fname); +#else extern int (PASCAL NEAR *PASCAL NEAR fncmatch(char *fname))(VOID); -extern int (PASCAL NEAR *PASCAL NEAR getname(char *prompt))(VOID); +extern int (PASCAL NEAR *PASCAL NEAR getname(CONST char *prompt))(VOID); +#endif #endif extern int PASCAL NEAR asc_int(char *st); -extern int dolhello(VOID); +extern VOID dolhello(VOID); extern int dspram(VOID); -extern int lckerror(char *errstr); -extern int lckhello(VOID); -extern int xlock(char *fname); -extern int lockchk(char *fname); +extern VOID lckerror(char *errstr); +extern VOID lckhello(VOID); +extern int xlock(CONST char *fname); +extern int lockchk(CONST char *fname); extern int lockrel(VOID); -extern int mousehello(VOID); +extern VOID mousehello(VOID); extern int nocrypt(VOID); extern int PASCAL NEAR absv(int x); extern int PASCAL NEAR add_abbrev(int f, int n); @@ -140,20 +204,17 @@ extern int PASCAL NEAR del_abbrev(int f, int n); extern int PASCAL NEAR kill_abbrevs(int f, int n); extern int PASCAL NEAR ins_abbrevs(int f, int n); extern int PASCAL NEAR def_abbrevs(int f, int n); -extern int PASCAL NEAR addline(BUFFER *bp, char *text); -extern int PASCAL NEAR amatch(MC *mcptr, int direct, LINE **pcwline, int *pcwoff); +extern int PASCAL NEAR addline(BUFFER *bp, CONST char *text); extern int PASCAL NEAR backhunt(int f, int n); extern int PASCAL NEAR backsearch(int f, int n); -extern int PASCAL NEAR biteq(int bc, EBITMAP cclmap); extern int PASCAL NEAR bktoshell(int f, int n); extern int PASCAL NEAR boundry(LINE *curline, int curoff, int dir); -extern int PASCAL NEAR cclmake(char **ppatptr, MC *mcptr); extern int PASCAL NEAR checknext(int chr, int dir); extern int PASCAL NEAR clear_ring(int f, int n); extern int PASCAL NEAR delins(int dlength, char *instr, int use_rmc); extern int PASCAL NEAR desfunc(int f, int n); extern int PASCAL NEAR dispvar(int f, int n); -extern int PASCAL NEAR echochar(unsigned char c); +extern int PASCAL NEAR ueechochar(unsigned char c); extern int PASCAL NEAR echostring(char *, int, int); extern int PASCAL NEAR eq(register unsigned char bc, register unsigned char pc); extern long PASCAL NEAR ernd(VOID); @@ -171,7 +232,7 @@ extern int PASCAL NEAR getcwnum(VOID); extern int PASCAL NEAR getgoal(LINE *dlp); extern int PASCAL NEAR getstring(unsigned char *buf, int nbuf, int eolchar); extern int PASCAL NEAR gettwnum(VOID); -extern int PASCAL NEAR gettyp(char *token); +extern int PASCAL NEAR gettyp(CONST char *token); extern int PASCAL NEAR getkey(VOID); extern int PASCAL NEAR getwpos(VOID); extern int PASCAL NEAR get_char(VOID); @@ -179,31 +240,34 @@ extern int PASCAL NEAR global_var(int f, int n); #if DBCS extern int PASCAL NEAR is2byte(char *sp, char *cp); #endif +#if UTF8 +extern int PASCAL NEAR weq(unsigned int bc, unsigned int pc); +extern int PASCAL NEAR is_letter(unsigned int ch); +extern int PASCAL NEAR is_lower(unsigned int ch); +extern int PASCAL NEAR is_upper(unsigned int ch); +#else extern int PASCAL NEAR is_letter(char ch); extern int PASCAL NEAR is_lower(char ch); +extern int PASCAL NEAR is_upper(char ch); +#endif extern int PASCAL NEAR is_num(char *st); extern int PASCAL NEAR isearch(int dir); -extern int PASCAL NEAR is_upper(char ch); extern int PASCAL NEAR kinsert(int back, char c); extern int PASCAL NEAR ldelnewline(VOID); -extern int PASCAL NEAR linstr(char *instr); +extern int PASCAL NEAR linstr(CONST char *instr); extern int PASCAL NEAR liteq(LINE **curline, int *curpos, int direct, char *lstring); -extern int PASCAL NEAR litmake(char **ppatptr, MC *mcptr); extern int PASCAL NEAR lnewline(VOID); extern int PASCAL NEAR local_var(int f, int n); extern int PASCAL NEAR lookup_color(char *sp); -extern int PASCAL NEAR lover(char *ostr); -extern int PASCAL NEAR mceq(unsigned char bc, MC *mt); -extern int PASCAL NEAR mcscanner(MC *mcpatrn, int direct, int beg_or_end, int repeats); -extern int PASCAL NEAR mcstr(VOID); -extern int PASCAL NEAR mlprompt(char *, char *, int); +extern int PASCAL NEAR lover(CONST char *ostr); +extern int PASCAL NEAR mlprompt(CONST char *, char *, int); extern int PASCAL NEAR movelocalpoint(int n, int *pcuroff, LINE **pcurline); extern int PASCAL NEAR nextch(LINE **pcurline, int *pcuroff, int dir); extern int PASCAL NEAR pop(BUFFER *popbuffer); extern int PASCAL NEAR qreplace(int f, int n); -extern int PASCAL NEAR readpattern(char *prompt, char apat[], int srch); +extern int PASCAL NEAR readpattern(CONST char *prompt, char apat[], int srch); #if WINDOW_TEXT -extern VOID PASCAL NEAR refresh_screen(SCREEN *sp); +extern VOID PASCAL NEAR refresh_screen(ESCREEN *sp); #endif extern int PASCAL NEAR reglines(VOID); extern int PASCAL NEAR rename_screen(int f, int n); @@ -214,13 +278,20 @@ extern int PASCAL NEAR savematch(VOID); extern int PASCAL NEAR scanmore(int dir); #if MAGIC == 0 extern int PASCAL NEAR scanner(int direct, int beg_or_end, int repeats); +#else +extern int PASCAL NEAR amatch(MC *mcptr, int direct, LINE **pcwline, int *pcwoff); +extern int PASCAL NEAR biteq(int bc, EBITMAP cclmap); +extern int PASCAL NEAR cclmake(char **ppatptr, MC *mcptr); +extern int PASCAL NEAR litmake(char **ppatptr, MC *mcptr); +extern VOID PASCAL NEAR mcclear(VOID); +extern int PASCAL NEAR mceq(unsigned char bc, MC *mt); +extern int PASCAL NEAR mcscanner(MC *mcpatrn, int direct, int beg_or_end, int repeats); +extern int PASCAL NEAR mcstr(VOID); +extern VOID PASCAL NEAR setbit(int bc, EBITMAP cclmap); #endif -extern int PASCAL NEAR setlower(char *ch, char *val); -extern int PASCAL NEAR setlower(char *ch, char *val); -extern int PASCAL NEAR setupper(char *ch, char *val); -extern int PASCAL NEAR setupper(char *ch, char *val); extern int PASCAL NEAR setvar(int f, int n); -extern int PASCAL NEAR sindex(char *source, char *pattern); +extern int PASCAL NEAR sindex(CONST char *source, CONST char *pattern); +extern int PASCAL NEAR srindex(CONST char* source, CONST char* pattern); extern int PASCAL NEAR sreplace(int f, int n); extern int PASCAL NEAR stol(char *val); #if DBCS @@ -230,7 +301,7 @@ extern int PASCAL NEAR stopforw(VOID); extern int PASCAL NEAR svar(VDESC *var, char *value); extern int PASCAL NEAR tgetc(VOID); extern int PASCAL NEAR uneat(VOID); -extern int PASCAL NEAR unlist_screen(SCREEN *sp); +extern VOID PASCAL NEAR unlist_screen(ESCREEN *sp); extern int PASCAL NEAR upscreen(int f, int n); extern int PASCAL NEAR vtinit(VOID); extern int PASCAL NEAR yank(int f, int n); @@ -253,7 +324,11 @@ extern int PASCAL NEAR backline(int f, int n); extern int PASCAL NEAR backpage(register int f, register int n); extern int PASCAL NEAR backword(int f, int n); extern int PASCAL NEAR bclear(BUFFER *bp); -extern int PASCAL NEAR binary(char *key, char *(PASCAL NEAR *tval)(), int tlength, int klength); +#if THEOSC +extern int binary(); +#else +extern int PASCAL NEAR binary(CONST char *key, char *(PASCAL NEAR *tval)(), int tlength, int klength); +#endif extern int PASCAL NEAR bindtokey(int f, int n); extern int PASCAL NEAR buildlist(int type, char *mstring); extern int PASCAL NEAR capword(int f, int n); @@ -284,9 +359,9 @@ extern int PASCAL NEAR desvars(int f, int n); extern int PASCAL NEAR detab(int f, int n); extern int PASCAL NEAR dobuf(BUFFER *bp); extern int PASCAL NEAR docmd(char *cline); -extern int PASCAL NEAR dofile(char *fname); +extern int PASCAL NEAR dofile(CONST char *fname); extern int PASCAL NEAR ectoc(int c); -extern VOID PASCAL NEAR edinit(char bname[]); +extern int PASCAL NEAR edinit(char bname[]); extern int PASCAL NEAR editloop(VOID); extern int PASCAL NEAR endword(int f, int n); extern int PASCAL NEAR enlargewind(int f, int n); @@ -300,8 +375,8 @@ extern int PASCAL NEAR execute(int c, int f, int n); extern int PASCAL NEAR ffclose(VOID); extern int PASCAL NEAR ffgetline(int *nbytes); extern int PASCAL NEAR ffputline(char buf[], int nbuf); -extern int PASCAL NEAR ffropen(char *fn); -extern int PASCAL NEAR ffwopen(char *fn, char *mode); +extern int PASCAL NEAR ffropen(CONST char *fn); +extern int PASCAL NEAR ffwopen(CONST char *fn, CONST char *mode); extern int PASCAL NEAR fileapp(int f, int n); extern int PASCAL NEAR find_screen(int f, int n); extern int PASCAL NEAR filefind(int f, int n); @@ -310,7 +385,7 @@ extern int PASCAL NEAR fileread(int f, int n); extern int PASCAL NEAR filesave(int f, int n); extern int PASCAL NEAR filewrite(int f, int n); extern int PASCAL NEAR fillpara(int f, int n); -extern int PASCAL NEAR filter(int f, int n); +extern int PASCAL NEAR uefilter(int f, int n); extern VOID PASCAL NEAR findvar(char *var, VDESC *vd, int size, int scope); extern int PASCAL NEAR fmatch(char ch); extern int PASCAL NEAR forwchar(int f, int n); @@ -341,33 +416,46 @@ extern int PASCAL NEAR insfile(int f, int n); extern int PASCAL NEAR inspound(VOID); extern int PASCAL NEAR insspace(int f, int n); extern int PASCAL NEAR inword(VOID); +#if UTF8 +extern int PASCAL NEAR isinword(unsigned int c); +#else extern int PASCAL NEAR isinword(char c); +#endif extern int PASCAL NEAR ismodeline(EWINDOW *wp, int row); extern int PASCAL NEAR istring(int f, int n); extern int PASCAL NEAR killbuffer(int f, int n); extern int PASCAL NEAR killpara(int f, int n); extern int PASCAL NEAR killregion(int f, int n); extern int PASCAL NEAR killtext(int f, int n); -extern int PASCAL NEAR lchange(register int flag); +extern VOID PASCAL NEAR lchange(register int flag); extern int PASCAL NEAR ldelete(long n, int kflag); -extern int PASCAL NEAR lfree(LINE *lp); +extern VOID PASCAL NEAR lfree(LINE *lp); +#if UTF8 +extern int PASCAL NEAR ldelchar(long n, int kflag); +extern int PASCAL NEAR linsert(int n, unsigned int c); +#else extern int PASCAL NEAR linsert(int n, char c); +#endif extern int PASCAL NEAR listbuffers(int f, int n); extern int PASCAL NEAR list_screens(int f, int n); extern int PASCAL NEAR lowerregion(int f, int n); extern int PASCAL NEAR lowerword(int f, int n); -extern int PASCAL NEAR lowrite(char c); +#if UTF8 +extern int PASCAL NEAR lowrite(unsigned int c); +#else +extern int PASCAL NEAR lowrite(int c); +#endif extern int PASCAL NEAR macarg(char *tok); extern int PASCAL NEAR macrotokey(int f, int n); extern int PASCAL NEAR makelist(int iflag); extern int PASCAL NEAR movelocalpoint(); extern int PASCAL NEAR undolist(); -extern int PASCAL NEAR mouse_screen(VOID); +extern VOID PASCAL NEAR mouse_screen(VOID); extern int PASCAL NEAR screenlist(int iflag); extern int PASCAL NEAR meexit(int status); -extern int PASCAL NEAR meta(int f, int n); -extern int PASCAL NEAR mlreply(char *prompt, char *buf, int nbuf); -extern int PASCAL NEAR mlyesno(char *prompt); +extern int PASCAL NEAR uemeta(int f, int n); +extern int PASCAL NEAR mlreply(CONST char *prompt, char *buf, int nbuf); +extern int PASCAL NEAR mlyesno(CONST char *prompt); extern int PASCAL NEAR mouseoffset(EWINDOW *wp, LINE *lp, int col); extern int PASCAL NEAR movemd(int f, int n); extern int PASCAL NEAR movemu(int f, int n); @@ -379,12 +467,12 @@ extern int PASCAL NEAR mvupwind(int f, int n); extern int PASCAL NEAR namebuffer(int f, int n); extern int PASCAL NEAR namedcmd(int f, int n); extern int PASCAL NEAR narrow(int f, int n); -extern int PASCAL NEAR newline(int f, int n); +extern int PASCAL NEAR uenewline(int f, int n); extern int PASCAL NEAR new_col_org(int f, int n); extern int PASCAL NEAR new_row_org(int f, int n); extern int PASCAL NEAR newsize(int f, int n); extern int PASCAL NEAR newwidth(int f, int n); -extern int PASCAL NEAR nextarg(char *prompt, char *buffer, int size, int terminator); +extern int PASCAL NEAR nextarg(CONST char *prompt, char *buffer, int size, int terminator); extern int PASCAL NEAR nextbuffer(int f, int n); extern int PASCAL NEAR nextdown(int f, int n); extern int PASCAL NEAR nextup(int f, int n); @@ -392,8 +480,8 @@ extern int PASCAL NEAR nextwind(int f, int n); extern int PASCAL NEAR nullproc(int f, int n); extern int PASCAL NEAR onlywind(int f, int n); extern int PASCAL NEAR openline(int f, int n); -extern int PASCAL NEAR ostring(char *s); -extern int PASCAL NEAR outstring(char *s); +extern VOID PASCAL NEAR ostring(CONST char *s); +extern VOID PASCAL NEAR outstring(CONST char *s); extern int PASCAL NEAR ovstring(int f, int n); extern int PASCAL NEAR pipecmd(int f, int n); extern int PASCAL NEAR popbuffer(int f, int n); @@ -404,8 +492,8 @@ extern int PASCAL NEAR quickexit(int f, int n); extern int PASCAL NEAR quit(int f, int n); extern int PASCAL NEAR quote(int f, int n); extern int PASCAL NEAR rdonly(VOID); -extern int PASCAL NEAR readin(char fname[], int lockfl); -extern int PASCAL NEAR refresh(int f, int n); +extern int PASCAL NEAR readin(CONST char *fname, int lockfl); +extern int PASCAL NEAR uerefresh(int f, int n); extern int PASCAL NEAR remmark(int f, int n); extern int PASCAL NEAR reposition(int f, int n); extern int PASCAL NEAR resetkey(VOID); @@ -433,12 +521,12 @@ extern int PASCAL NEAR spal(char *pstr); extern int PASCAL NEAR spawn(int f, int n); extern int PASCAL NEAR spawncli(int f, int n); extern int PASCAL NEAR splitwind(int f, int n); -extern int PASCAL NEAR startup(char *sfname); +extern int PASCAL NEAR startup(CONST char *sfname); extern int PASCAL NEAR storeproc(int f, int n); extern int PASCAL NEAR strinc(char *source, char *sub); extern int PASCAL NEAR swapmark(int f, int n); extern int PASCAL NEAR swbuffer(BUFFER *bp); -extern int PASCAL NEAR tab(int f, int n); +extern int PASCAL NEAR uetab(int f, int n); extern int PASCAL NEAR trim(int f, int n); extern int PASCAL NEAR ttclose(VOID); extern int PASCAL NEAR ttflush(VOID); @@ -456,17 +544,16 @@ extern int PASCAL NEAR upperregion(int f, int n); extern int PASCAL NEAR upperword(int f, int n); extern int PASCAL NEAR usebuffer(int f, int n); extern int PASCAL NEAR viewfile(int f, int n); -extern int PASCAL NEAR vteeol(VOID); -extern int PASCAL NEAR vtmove(int row, int col); -extern int PASCAL NEAR vtputc(int c); -extern int PASCAL NEAR vttidy(VOID); +extern VOID PASCAL NEAR vteeol(VOID); +extern VOID PASCAL NEAR vtmove(int row, int col); +extern VOID PASCAL NEAR vtputc(int c); +extern VOID PASCAL NEAR vttidy(VOID); extern int PASCAL NEAR widen(int f, int n); extern int PASCAL NEAR wordcount(int f, int n); extern int PASCAL NEAR wrapword(int f, int n); extern int PASCAL NEAR writemsg(int f, int n); extern int PASCAL NEAR writeout(char *fn, char *mode); extern int PASCAL NEAR zotbuf(BUFFER *bp); -extern unsigned int PASCAL NEAR chcase(register unsigned int ch); extern unsigned int PASCAL NEAR getckey(int mflag); extern unsigned int PASCAL NEAR stock(unsigned char *keyname); #if VARARG && VARG @@ -476,7 +563,7 @@ extern VOID CDECL NEAR mlwrite(va_alist); extern VOID CDECL NEAR mlwrite(va_dcl); #endif /* GCC */ #else -extern VOID CDECL NEAR mlwrite(char *fmt, ...); +extern VOID CDECL NEAR mlwrite(CONST char *fmt, ...); #endif extern VOID PASCAL NEAR ab_init(VOID); extern VOID PASCAL NEAR ab_save(char c); @@ -490,23 +577,22 @@ extern VOID PASCAL NEAR comp_command(char *name, int *cpos); extern VOID PASCAL NEAR comp_file(char *name, int *cpos); #endif extern VOID PASCAL NEAR ecrypt(char *bptr, unsigned len); -extern VOID PASCAL NEAR errormesg(char *mesg, BUFFER *bp, LINE *lp); +extern VOID PASCAL NEAR errormesg(CONST char *mesg, BUFFER *bp, LINE *lp); extern VOID PASCAL NEAR flong_asc(char buf[], int width, long num); extern VOID PASCAL NEAR freewhile(WHBLOCK *wp); extern VOID PASCAL NEAR getdtime(char *ts); extern VOID PASCAL NEAR initchars(VOID); extern VOID PASCAL NEAR kdelete(VOID); -extern VOID PASCAL NEAR lowercase(unsigned char *cp); -extern VOID PASCAL NEAR mcclear(VOID); -extern VOID PASCAL NEAR mlabort(char *s); +extern int PASCAL NEAR lowercase(unsigned char *cp); +extern VOID PASCAL NEAR mlabort(CONST char *s); extern VOID PASCAL NEAR mlerase(VOID); extern VOID PASCAL NEAR mlferase(VOID); -extern VOID PASCAL NEAR mlforce(char *s); +extern VOID PASCAL NEAR mlforce(CONST char *s); extern VOID PASCAL NEAR mlout(int c); extern VOID PASCAL NEAR mlputf(int s); extern VOID PASCAL NEAR mlputi(int i, int r); extern VOID PASCAL NEAR mlputli(long l, int r); -extern VOID PASCAL NEAR mlputs(char *s); +extern VOID PASCAL NEAR mlputs(CONST char *s); extern VOID PASCAL NEAR mlrquery(VOID); extern VOID PASCAL NEAR modeline(EWINDOW *wp); extern VOID PASCAL NEAR movecursor(int row, int col); @@ -516,7 +602,6 @@ extern VOID PASCAL NEAR reeat(int c); extern VOID PASCAL NEAR reframe(EWINDOW *wp); extern VOID PASCAL NEAR reform(char *para); extern VOID PASCAL NEAR rmcclear(VOID); -extern VOID PASCAL NEAR setbit(int bc, EBITMAP cclmap); extern VOID PASCAL NEAR setjtable(VOID); extern VOID PASCAL NEAR unbind_buf(BUFFER *bp); extern VOID PASCAL NEAR unqname(char *name); @@ -530,7 +615,7 @@ extern VOID PASCAL NEAR updone(EWINDOW *wp); extern VOID PASCAL NEAR updpos(VOID); extern VOID PASCAL NEAR updupd(int force); extern VOID PASCAL NEAR upmode(VOID); -extern VOID PASCAL NEAR uppercase(unsigned char *cp); +extern int uppercase(unsigned char *cp); extern VOID PASCAL NEAR upwind(VOID); extern VOID PASCAL NEAR varinit(VOID); extern VOID PASCAL NEAR varclean(UTABLE *ut); @@ -543,12 +628,36 @@ extern VOID qrep(int ch); extern EWINDOW *PASCAL NEAR mousewindow(int row); extern int PASCAL NEAR wpopup(BUFFER *popbuf); +#if LIBHELP +extern int lookupword(int f, int n); /* Lookup a word... */ +extern int promptlook(int f, int n); /* Prompt for a word to look up */ +extern int zaphelp(int f, int n); /* Zap help window */ +extern int hlpindex(int f, int n); /* Help index generator */ +extern int hidebuffer(int f, int n); /* Set buffer as invisible */ +#endif + #if CTAGS extern int PASCAL NEAR tagword(int f, int n); /* vi-like tagging */ extern int PASCAL NEAR retagword(int f, int n); /* Try again (if redefined) */ extern int PASCAL NEAR backtagword(int f, int n); /* return from tagged word */ #endif +#if DYNMSGS +extern VOID msinit(VOID); +#endif + +extern int grabwait(void); +extern int grabnowait(void); + +#if THEOX +#include "theox.h" +#endif + +extern int getmline(VOID); + +#if MDSLINE +extern unsigned int tosgraph(unsigned int c); +#endif /* some library redefinitions */ #if WINXP == 0 @@ -575,7 +684,11 @@ char *realloc(char *block, int siz); #endif #endif -#else +#if JMDEXT | 1 +extern int notavail(); /* bound to unavailable functions */ +#endif + +#else /* PROTO */ /*** global function declarations ***/ #if CALLED @@ -612,9 +725,9 @@ extern BUFFER *PASCAL NEAR bfind(); extern BUFFER *PASCAL NEAR getcbuf(); extern BUFFER *PASCAL NEAR getdefb(); extern BUFFER *PASCAL NEAR getoldb(); -extern SCREEN *PASCAL NEAR init_screen(); -extern SCREEN *PASCAL NEAR lookup_screen(); -extern SCREEN *PASCAL NEAR index_screen(); +extern ESCREEN *PASCAL NEAR init_screen(); +extern ESCREEN *PASCAL NEAR lookup_screen(); +extern ESCREEN *PASCAL NEAR index_screen(); extern int PASCAL NEAR screen_index(); extern int PASCAL NEAR insert_screen(); extern int PASCAL NEAR select_screen(); @@ -659,17 +772,22 @@ extern char *undolock(); extern char *PASCAL NEAR regtostr(); extern int PASCAL NEAR lowerc(); extern int PASCAL NEAR upperc(); +#if THEOSC +extern int* fncmatch(); +extern int* getname(); +#else extern int (PASCAL NEAR *PASCAL NEAR fncmatch())(); extern int (PASCAL NEAR *PASCAL NEAR getname())(); +#endif extern int PASCAL NEAR asc_int(); -extern int dolhello(); +extern VOID dolhello(); extern int dspram(); -extern int lckerror(); -extern int lckhello(); +extern VOID lckerror(); +extern VOID lckhello(); extern int xlock(); extern int lockchk(); extern int lockrel(); -extern int mousehello(); +extern VOID mousehello(); extern int nocrypt(); extern int PASCAL NEAR absv(); extern int PASCAL NEAR add_abbrev(); @@ -693,7 +811,7 @@ extern int PASCAL NEAR cycle_ring(); extern int PASCAL NEAR delins(); extern int PASCAL NEAR desfunc(); extern int PASCAL NEAR dispvar(); -extern int PASCAL NEAR echochar(); +extern int PASCAL NEAR ueechochar(); extern int PASCAL NEAR echostring(); extern int PASCAL NEAR eq(); extern long PASCAL NEAR ernd(); @@ -755,7 +873,6 @@ extern int PASCAL NEAR scanner(); extern int PASCAL NEAR setlower(); extern int PASCAL NEAR setlower(); extern int PASCAL NEAR setupper(); -extern int PASCAL NEAR setupper(); extern int PASCAL NEAR setvar(); extern int PASCAL NEAR sindex(); extern int PASCAL NEAR sreplace(); @@ -767,7 +884,7 @@ extern int PASCAL NEAR stopforw(); extern int PASCAL NEAR svar(); extern int PASCAL NEAR tgetc(); extern int PASCAL NEAR uneat(); -extern int PASCAL NEAR unlist_screen(); +extern VOID PASCAL NEAR unlist_screen(); extern int PASCAL NEAR upscreen(); extern int PASCAL NEAR vtinit(); extern int PASCAL NEAR yank(); @@ -821,7 +938,7 @@ extern int PASCAL NEAR dobuf(); extern int PASCAL NEAR docmd(); extern int PASCAL NEAR dofile(); extern int PASCAL NEAR ectoc(); -extern VOID PASCAL NEAR edinit(); +extern int PASCAL NEAR edinit(); extern int PASCAL NEAR editloop(); extern int PASCAL NEAR endword(); extern int PASCAL NEAR enlargewind(); @@ -845,7 +962,7 @@ extern int PASCAL NEAR fileread(); extern int PASCAL NEAR filesave(); extern int PASCAL NEAR filewrite(); extern int PASCAL NEAR fillpara(); -extern int PASCAL NEAR filter(); +extern int PASCAL NEAR uefilter(); extern VOID PASCAL NEAR findvar(); extern int PASCAL NEAR fmatch(); extern int PASCAL NEAR forwchar(); @@ -883,9 +1000,10 @@ extern int PASCAL NEAR killbuffer(); extern int PASCAL NEAR killpara(); extern int PASCAL NEAR killregion(); extern int PASCAL NEAR killtext(); -extern int PASCAL NEAR lchange(); +extern VOID PASCAL NEAR lchange(); extern int PASCAL NEAR ldelete(); -extern int PASCAL NEAR lfree(); +extern VOID PASCAL NEAR lfree(); +extern int PASCAL NEAR ldelchar(); extern int PASCAL NEAR linsert(); extern int PASCAL NEAR listbuffers(); extern int PASCAL NEAR list_screens(); @@ -896,10 +1014,10 @@ extern int PASCAL NEAR macarg(); extern int PASCAL NEAR macrotokey(); extern int PASCAL NEAR makelist(); extern int PASCAL NEAR undolist(); -extern int PASCAL NEAR mouse_screen(); +extern VOID PASCAL NEAR mouse_screen(); extern int PASCAL NEAR screenlist(); extern int PASCAL NEAR meexit(); -extern int PASCAL NEAR meta(); +extern int PASCAL NEAR uemeta(); extern int PASCAL NEAR mlreply(); extern int PASCAL NEAR mlyesno(); extern int PASCAL NEAR mouseoffset(); @@ -913,7 +1031,7 @@ extern int PASCAL NEAR mvupwind(); extern int PASCAL NEAR namebuffer(); extern int PASCAL NEAR namedcmd(); extern int PASCAL NEAR narrow(); -extern int PASCAL NEAR newline(); +extern int PASCAL NEAR uenewline(); extern int PASCAL NEAR new_col_org(); extern int PASCAL NEAR new_row_org(); extern int PASCAL NEAR newsize(); @@ -926,8 +1044,8 @@ extern int PASCAL NEAR nextwind(); extern int PASCAL NEAR nullproc(); extern int PASCAL NEAR onlywind(); extern int PASCAL NEAR openline(); -extern int PASCAL NEAR ostring(); -extern int PASCAL NEAR outstring(); +extern VOID PASCAL NEAR ostring(); +extern VOID PASCAL NEAR outstring(); extern int PASCAL NEAR ovstring(); extern int PASCAL NEAR pipecmd(); extern int PASCAL NEAR popbuffer(); @@ -939,7 +1057,7 @@ extern int PASCAL NEAR quit(); extern int PASCAL NEAR quote(); extern int PASCAL NEAR rdonly(); extern int PASCAL NEAR readin(); -extern int PASCAL NEAR refresh(); +extern int PASCAL NEAR uerefresh(); extern int PASCAL NEAR remmark(); extern int PASCAL NEAR reposition(); extern int PASCAL NEAR resetkey(); @@ -970,7 +1088,7 @@ extern int PASCAL NEAR storeproc(); extern int PASCAL NEAR strinc(); extern int PASCAL NEAR swapmark(); extern int PASCAL NEAR swbuffer(); -extern int PASCAL NEAR tab(); +extern int PASCAL NEAR uetab(); extern int PASCAL NEAR trim(); extern int PASCAL NEAR ttclose(); extern int PASCAL NEAR ttflush(); @@ -988,10 +1106,10 @@ extern int PASCAL NEAR upperregion(); extern int PASCAL NEAR upperword(); extern int PASCAL NEAR usebuffer(); extern int PASCAL NEAR viewfile(); -extern int PASCAL NEAR vteeol(); -extern int PASCAL NEAR vtmove(); -extern int PASCAL NEAR vtputc(); -extern int PASCAL NEAR vttidy(); +extern VOID PASCAL NEAR vteeol(); +extern VOID PASCAL NEAR vtmove(); +extern VOID PASCAL NEAR vtputc(); +extern VOID PASCAL NEAR vttidy(); extern int PASCAL NEAR widen(); extern int PASCAL NEAR wordcount(); extern int PASCAL NEAR wrapword(); @@ -1018,7 +1136,7 @@ extern VOID PASCAL NEAR freewhile(); extern VOID PASCAL NEAR getdtime(); extern VOID PASCAL NEAR initchars(); extern VOID PASCAL NEAR kdelete(); -extern VOID PASCAL NEAR lowercase(); +extern int PASCAL NEAR lowercase(); extern VOID PASCAL NEAR mcclear(); extern VOID PASCAL NEAR mlabort(); extern VOID PASCAL NEAR mlerase(); @@ -1052,7 +1170,7 @@ extern VOID PASCAL NEAR updone(); extern VOID PASCAL NEAR updpos(); extern VOID PASCAL NEAR upmode(); extern VOID PASCAL NEAR updupd(); -extern VOID PASCAL NEAR uppercase(); +extern int PASCAL NEAR uppercase(); extern VOID PASCAL NEAR upwind(); extern VOID PASCAL NEAR varinit(); extern VOID PASCAL NEAR varclean(); @@ -1071,6 +1189,22 @@ extern int PASCAL NEAR retagword(); /* Try again (if redefined) */ extern int PASCAL NEAR backtagword(); /* return from tagged word */ #endif +#if LIBHELP +extern int lookupword(); /* Lookup a word... */ +extern int promptlook(); /* Prompt for a word to look up */ +extern int zaphelp(); /* Zap help window */ +extern int hlpindex(); /* Help index generator */ +extern int hidebuffer(); /* Set buffer as invisible */ +#endif + +#if JMDEXT +extern int notavail(); /* bound to unavailable functions */ +#endif + +#if MDSLINE +extern unsigned int tosgraph(); +#endif + /* some library redefinitions */ char *getenv(); diff --git a/h/estruct.h.template b/h/estruct.h.template new file mode 100644 index 0000000..b4f4118 --- /dev/null +++ b/h/estruct.h.template @@ -0,0 +1,1379 @@ +/* ESTRUCT: Structure and preprocesser defined for + MicroEMACS 4.01 + + (C)Copyright 1997 by Daniel Lawrence + written by Daniel Lawrence + based on code by Dave G. Conroy, + Steve Wilhite and George Jones + + Unicode support by Jean-Michel Dubois +*/ + +#ifdef LATTICE +#undef LATTICE /* don't use their definitions...use ours */ +#endif +#ifdef MSDOS +#undef MSDOS +#endif +#ifdef WINNT +#undef WINNT +#endif +#ifdef AMIGA +#undef AMIGA +#endif +#ifdef EGA +#undef EGA +#endif +#ifdef CTRLZ +#undef CTRLZ +#endif + +/* Program Identification..... + + PROGNAME should always be MicroEMACS for a distribution + unmodified version. People using MicroEMACS as a shell + for other products should change this to reflect their + product. Macros can query this via the $progname variable +*/ + +#define PROGNAME "MicroEMACS" +#define VERSION "5.10" + +/* Machine/OS definitions */ +/* [Set one of these!!] */ + +#define AMIGA 0 /* AmigaDOS */ +#define AOSVS 0 /* Data General AOS/VS */ +#define AUX 0 /* Apple UNIX for Macintosh */ +#define AIX 0 /* IBM UNIX for various machines*/ +#define AVIION 0 /* Data General AViiON */ +#define BSD 0 /* UNIX BSD 4.2 and ULTRIX */ +#define FINDER 0 /* Macintosh OS */ +#define FREEBSD 0 /* FREEBSD 386 version 2 or + */ +#define HPUX8 0 /* HPUX HP 9000 ver 8 or less */ +#define HPUX9 0 /* HPUX HP 9000 ver 9 */ +#define MPE 0 /* HP MPE/XL */ +#define MSDOS 0 /* MS-DOS */ +#define WINNT 0 /* MS-Win NT */ +#define WINXP 0 /* Windows XP/Visual studio 2008*/ +#define OS2 0 /* Microsoft or IBM OS/2 */ +#define SMOS 0 /* Supermax UNIX System V */ +#define SUN 0 /* SUN v4.0 */ +#define TOS 0 /* ST520, TOS */ +#define USG 1 /* UNIX system V */ +#define VMS 0 /* VAX/VMS */ +#define WMCS 0 /* Wicat's MCS */ +#define XENIX 0 /* IBM-PC SCO XENIX */ +#define LINUX 1 /* Linux */ + +#if LINUX +#undef USG +#define USG 1 +#endif +/* Compiler definitions */ +/* [Set one of these!!] */ +#define ALCYON 0 /* ALCYON Atari ST compiler */ +#define AZTEC 0 /* Aztec C 4.00e ONLY for the amiga now... */ +#define DGC 0 /* Data General AOS/VS C... */ +#define GCC 1 /* the GNU C compiler */ +#define IC 0 /* Rational Systems Instant C */ +#define LATTICE 0 /* Lattice 2.14 through 3.0 compilers */ +#define MSC 0 /* MicroSoft C compile version 3 and up */ +#define MWC 0 /* Mark Williams C */ +#define TURBO 0 /* Turbo C and Borland C++ under MSDOS */ +#define UNIX 0 /* a standard UNIX compiler (cc) */ +#define ZTC 0 /* Zortech C/C++ 1.02 thru 2.10 under MSDOS */ + +/* Machine stack growth direction. */ +/* [Set this to 1 if your machine stack grows UP!!!] */ +/* data general mv/eclipse series stack grows up. */ +/* dec vax series stack grows down... got it??? */ + +#define STACK_GROWS_UP 0 + +/* Debugging options */ +#define RAMSIZE 0 /* dynamic RAM memory usage tracking */ +#define RAMSHOW 0 /* auto dynamic RAM reporting */ +#define RAMTRCK 0 /* send debug info to MALLOC.DAT */ +#define DEBUG_SEARCH 0 /* pop some search info on patterns */ + +/* Special keyboard/network definitions */ + +#define ATKBD 0 /* AT-style keyboard with F11, F12 & grey keys */ +#define WANGPC 0 /* WangPC - mostly escape sequences */ +#define VT100 0 /* Handle VT100 style keypad - NOT VMS. */ +#define KEYPAD 0 /* VMS - turn on and off application */ + /* keypad automatically */ +#define XONDATA 0 /* VMS - set to force /NOTTSYNC/NOHOSTSY */ +#define RMSIO 0 /* VMS - skip the rotten C runtime and */ + /* use RMS directly */ +#define OPTMEM 0 /* VMS 5.0 and up - use a less standard */ + /* but more efficient memory allocator */ + +/* Terminal Output definitions */ +/* [Set one of these!!] */ + +#define ANSI 0 /* ANSI escape sequences */ +#define CURSES 0 /* Use CURSES (not complete) */ +#define DASHER 0 /* DG Dasher 2xx/4xx crts */ +#define DG10 0 /* Data General system/10 */ +#define FMR 0 /* Fujitsu FMR series driver */ +#define HP110 0 /* HP110 screen driver */ +#define HP150 0 /* HP150 screen driver */ +#define I55 0 /* IBM PS55 DOS J4.0/V */ +#define IBMPC 0 /* IBM-PC CGA/MONO/EGA/VGA drvr */ +#define MAC 0 /* Macintosh */ +#define NEC 0 /* NEC-9801VM driver */ +#define OS2NPM 0 /* OS/2 non-Presentation Mgr. */ +#define SMG 0 /* SMG library on VMS */ +#define ST52 0 /* Atari 520/1040ST screen */ +#define TERMCAP 1 /* Use TERMCAP */ +#define TIPC 0 /* TI Profesional PC driver */ +#define VT52 0 /* VT52 terminal (Zenith). */ +#define NTCON 0 /* Windows NT console */ +#define XPCON 0 /* windows XP console app */ +#define XVT 0 /* XVT windowing system */ +#define Z309 0 /* Zenith 100 PC family driver */ + +/* Windowing system style (pick one) */ + +#define WINDOW_TEXT 1 /* [default] Text mode */ +#define WINDOW_MSWIN 0 /* MicroSoft Windows */ +#define WINDOW_MSWIN32 0 /* MicroSoft Windows 32 bit API */ +#define WINDOW_X 0 /* X/Unix */ + +/* Language text options (pick one) */ + +#define ENGLISH 1 /* [default] */ +#define FRENCH 0 +#define SPANISH 0 +#define GERMAN 0 +#define DUTCH 0 +#define PLATIN 0 /* Pig Latin */ +#define JAPAN 0 +#define LATIN 0 /* real Latin */ + +/* Configuration options */ + +#define TYPEAH 1 /* type ahead causes update to be skipped */ +#define LOGFLG 0 /* send all executed commands to EMACS.LOG */ +#define VISMAC 0 /* update display during keyboard macros */ +#define CTRLZ 0 /* add a ^Z at end of files under MSDOS only */ +#define CLEAN 0 /* de-alloc memory on exit */ +#define CALLED 0 /* is emacs a called subroutine? or stand alone */ + +#define REVSTA 1 /* Status line appears in reverse video */ +#define COLOR 0 /* color commands and windows */ + +#define FILOCK 0 /* file locking under unix BSD 4.2 */ +#define ISRCH 1 /* Incremental searches like ITS EMACS */ +#define FLABEL 0 /* function key label code [HP150] */ +#define CRYPT 1 /* file encryption enabled? */ +#define MAGIC 1 /* include regular expression matching? */ +#define MOUSE 1 /* Include routines for mouse actions */ +#define NOISY 1 /* Use a fancy BELL if it exists */ +#define CTAGS 1 /* include vi-like tagging? */ +#define SPEECH 0 /* spoken EMACS, for the sight impared [not ready] */ +#define VARARG 1 /* use varargs.h for mlwrite() */ + +#if XVT +#undef COLOR +#define COLOR 1 /* overide this to be TRUE for XVT always */ +#endif + +#define JMDEXT 1 /* enable J-M Dubois extensions */ + +#if JMDEXT +#define BACKUP 1 /* backup previous file version */ +#define LIBHELP 1 /* online help from Mark Williams version */ +#define DYNMSGS 1 /* dynamic load of messages */ +#define THEOX 1 /* allow TheoX character set files edition */ + /* including semi-graphics entry from numeric */ + /* keypad (require UTF8) */ +#define TXBASIC 1 /* TxBasic IDE menu */ +#endif + +#if DYNMSGS +#define OQUOTE_CHAR 34 +#define CQUOTE_CHAR 34 +#endif + +/* Character set options */ +/* [Set one of these!!] */ +#define ASCII 0 /* use ASCII char sequences */ +#define EBCDIC 0 /* later IBM mainfraim versions will use EBCDIC */ +#define UTF8 1 /* use UTF-8 encoded Unicode */ + +#if UTF8 +#include "utf8.h" +#include +#else +#undef THEOX +#define THEOX 0 +#endif + +/* handle constant and voids properly */ + +#if VMS +#define CONST readonly +#define VOID void +#define NOSHARE noshare +#else +#if AOSVS +#define CONST $shared $align(1) /* fake a const */ +#define VOID +#define NOSHARE $low32k $align(1) /* attempt to optimize read/write vars. */ +#else + +#if __STDC__ || MSC || TURBO || GCC || (AMIGA && LATTICE) +#define CONST const +#define VOID void +#define NOSHARE +#else +#define CONST +#if IC +#define VOID void +#else +#define VOID +#endif +#define NOSHARE +#endif + +#endif +#endif + +/* System dependant library redefinitions, structures and includes */ + +/* multibyte character support? */ + +#if NEC || FMR || I55 +#define DBCS 1 /* double byte character sets enabled */ +#define INSDEL 1 /* use insert/delete line display optimizations */ + +/* define DBCS prefix bytes */ +#define is2char(ch) (((ch&0xff) >= 0x81 && (ch&0xff) <= 0x9f) || ((ch&0xff) >=0xe0 && (ch&0xff) <= 0xfc)) + +#else +#define DBCS 0 +#define INSDEL 0 +#endif + +/* Can we catch the SIGWINCH (the window size change signal)? */ + +#if AIX || HPUX9 || LINUX +#define HANDLE_WINCH 1 +#else +#define HANDLE_WINCH 0 +#endif + +/* Prototypes in use? */ + +#if MSC || TURBO || IC || VMS || GCC || ZTC +#define PROTO 1 +#else +#define PROTO 0 +#endif + +/* the following define allows me to initialize unions... + otherwise we make them structures (like the keybinding table) */ + +#if __STDC__ || MSC || TURBO || IC || ZTC +#define ETYPE union +#else +#define ETYPE struct +#endif + +/* Instant C can't do stat()s. Arrrg. No file locking for you */ +#if IC && MSDOS +#undef FILOCK +#define FILOCK 0 +#endif + +/* Mark Williams/Atari has no standard or varargs or directory functions */ +#if TOS & MWC +#undef VARARG +#define VARARG 0 +#undef FILOCK +#define FILOCK 0 +#endif + +/* MS-Windows */ + +#if WINNT || WINDOW_MSWIN || WINDOW_MSWIN32 +#if WINDOW_MSWIN32 +#undef WINDOW_MSWIN +#define WINDOW_MSWIN 1 +#endif +#if WINDOW_MSWIN && (WINNT || WINXP) +#undef WINDOW_MSWIN32 +#define WINDOW_MSWIN32 1 +#endif +#if 1 +#undef MAC /* Mac conflicts with a definition used by rpc.h */ +#undef VOID /* windows.h will wind up defining this when compiled as a console app */ +#include /* --------- Huge include file here !!! ---------*/ +#ifndef VOID +#define VOID void /* Redefine, incase we are compiled as a Windows app */ +#endif +#endif +#if NTCON +#include +#include +#include +#endif + +#undef NEAR +#define NEAR +#define DNEAR +#if MSC || IC +#undef CDECL +#define CDECL __cdecl +#define DUMMYSZ 1 /* dummy size for unsized extern arrays to avoid + silly DGROUP fixup */ +#else +#if TURBO +#define DUMMYSZ /* nothing */ +#else +#define CDECL _cdecl /* ZTC */ +#define DUMMYSZ /* nothing */ +#endif +#endif + +#if (WINNT || WINXP) && !WINDOW_MSWIN +#define EXPORT /* Windows NT doesn't like this */ +#endif + +#if WINDOW_MSWIN +#undef TYPEAH +#define TYPEAH 0 /* typeahead is handled at the term driver level */ +#undef CALLED +#define CALLED 1 /* under MS Windows, "main" resides in the sys driver */ +#if WINNT || WINXP +#define EXPORT /* Windows NT doesn't like this */ +#elif MSC +#define EXPORT __export +#else +#define EXPORT _export /* Fine for TURBO and ZTC */ +#endif +#endif +#else + +/* neither Windows NT nor MS-Windows */ + +#define DUMMYSZ /* nothing */ + +#if MSDOS & (TURBO | MSC | TIPC) +#define NEAR +#define DNEAR +#define pascal +#define CDECL cdecl +#else +#if MSDOS & ZTC +#define NEAR +#define DNEAR +#define _pascal +#define CDECL _cdecl +#else +#define NEAR +#define DNEAR +#define PASCAL +#define CDECL +#endif +#endif + +#endif + +#if TURBO +#include +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if IC +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if LATTICE & MSDOS +/* you may have to remove this one definition with LATTICE version + 3.2 and above */ +#define unsigned +#endif + +#if IC +#define inp inportb +#define outp outportb +#define intdos(a, b) int86(33, a, b) +#endif + +#if AZTEC +#undef putc +#undef getc +#if MSDOS +#define getc a1getc +#define int86 sysint +#define intdos(a, b) sysint(33, a, b) +#define inp inportb +#define outp outportb +#else +#define getc agetc +#endif +#define putc aputc + +struct XREG { + unsigned ax,bx,cx,dx,si,di,ds,es; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh,d1,d2,e1,e2; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; + +struct SREGS { + unsigned cs, ss, ds, es; +}; +#endif + +#if MSDOS & MWC +#include +#define int86(a, b, c) intcall(b, c, a) +#define intdos(a, b) intcall(a, b, DOSINT) +#define inp(a) in(a) +#define outp(a, b) out(a, b) +#define movmem(a, b, c) memcpy(b, a, c) + +struct XREG { + unsigned int ax,bx,cx,dx,si,di,ds,es,flags; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh; + unsigned int ds,es,flags; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; +#endif + +#if MSDOS & MSC +#include +#include +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#define movmem(a, b, c) memcpy(b, a, c) +#define _strrev(a) strrev(a) +#endif + +#if MSDOS & LATTICE +#undef CPM +#undef LATTICE +#include +#undef CPM +#endif + +/* System V doesn't name this the same as others */ +#if USG | AIX | AUX | SUN | (OS2 & MSC) +#define movmem(a, b, c) memcpy(b, a, c) +#define min(a,b) ((a)>(b)?(b):(a)) +#define max(a,b) ((a)>(b)?(a):(b)) +#endif + +/* this keeps VMS happy */ +#if VMS +#define getname xgetname +#define unlink(a) delete(a) +#endif + +/* some options for AOS/VS */ +#if AOSVS +#define ORMDNI 1 +#endif + +/* define some ability flags */ + +#if (IBMPC | Z309 | FMR | TIPC) & !(WINDOW_MSWIN | WINDOW_MSWIN32) +#define MEMMAP 1 +#else +#define MEMMAP 0 +#endif + +#if MSDOS | WINNT | WINXP | OS2 | USG | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | (TOS & MWC) | WMCS | SUN | MPE +#define ENVFUNC 1 +#else +#define ENVFUNC 0 +#endif + +#if AUX +#define RETCHAR '\n' +#else +#define RETCHAR '\r' +#endif + +#if THEOS +#define _CTYPE_NO_MACRO 1 +#define RET_CHAR '\n' +#else +#define RET_CHAR '\r' +#endif + +#if MPE +#define DIRSEPSTR "." +#define DIRSEPCHAR '.' +#else +#if TOS || MSDOS || WINNT || WINXP || OS2 +#define DIRSEPSTR "\\" +#define DIRSEPCHAR '\\' +#define DRIVESEPCHAR ':' +#else +#define DIRSEPSTR "/" +#define DIRSEPCHAR '/' +#define DRIVESEPCHAR '\0' +#endif +#endif + +#if VARARG +#if (GCC == 0) && (USG || AIX || AUX || BSD || FREEBSD || SUN || XENIX || HPUX8 || HPUX9 || AVIION || MPE) +#define VARG 1 +#define SARG 0 +#include +#else +#define VARG 0 +#define SARG 1 +#include +#endif +#endif + +#if ZTC +#include +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +/* Emacs global flag bit definitions (for gflags) */ + +#define GFREAD 1 /* read first file in at startup */ +#define GFSDRAW 2 /* suppress a screen redraw */ +#define GFEXIT 4 /* exit from emacs pending */ + +/* internal constants */ + +#define NBINDS 300 /* max # of bound keys */ +#if AOSVS | VMS | WINNT | WINXP | SUN | BSD | FREEBSD | USG | ZENIX | HPUX8 | HPUX9 | OS2 +#define NFILEN 256 +#else +#define NFILEN 80 /* # of bytes, file name */ +#endif +#define NBUFN 128 /* # of bytes, buffer name */ +#define NLINE 512 /* # of bytes, input line */ +#define NSTRING 512 /* # of bytes, string buffers */ +#define NKBDM 4096 /* # of strokes, keyboard macro */ +#define NPAT 512 /* # of bytes, pattern */ +#define HUGENUM 1000 /* Huge number */ +#define NLOCKS 256 /* max # of file locks active */ +#define NCOLORS 16 /* number of supported colors */ +#define KBLOCK 250 /* sizeof kill buffer chunks */ +#define NRING 16 /* # of buffers in kill ring */ +#define NBLOCK 16 /* line block chunk size */ +#define NVSIZE 16 /* max #chars in a var name */ +#define NMARKS 16 /* number of marks */ +#define MAXSYM 32 /* max # chars in symbol to expand */ +#define MINFLEN 3 /* min # chars to match &func */ + +#if UTF8 +#define CTRL 0x01000000 /* Control flag, or'ed in */ +#define META 0x02000000 /* Meta flag, or'ed in */ +#define CTLX 0x04000000 /* ^X flag, or'ed in */ +#define SPEC 0x08000000 /* special key (function keys) */ +#define MOUS 0x10000000 /* alternative input device (mouse) */ +#define SHFT 0x20000000 /* shifted (for function keys) */ +#define ALTD 0x40000000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ +#define CMSK 0x00FFFFFF /* Character mask */ +#define SHIFTPFX 24 /* prefix shift in unsigned int */ +#else +#define CTRL 0x0100 /* Control flag, or'ed in */ +#define META 0x0200 /* Meta flag, or'ed in */ +#define CTLX 0x0400 /* ^X flag, or'ed in */ +#define SPEC 0x0800 /* special key (function keys) */ +#define MOUS 0x1000 /* alternative input device (mouse) */ +#define SHFT 0x2000 /* shifted (for function keys) */ +#define ALTD 0x4000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ +#define CMSK 0x00FF /* Character mask */ +#define SHIFTPFX 8 /* prefix shift in unsigned int */ +#endif + +#define BINDNUL 0 /* not bound to anything */ +#define BINDFNC 1 /* key bound to a function */ +#define BINDBUF 2 /* key bound to a buffer */ + +#ifdef FALSE +#undef FALSE +#endif +#ifdef TRUE +#undef TRUE +#endif + +#define FALSE 0 /* False, no, bad, etc. */ +#define TRUE 1 /* True, yes, good, etc. */ +#define ABORT 2 /* Death, ^G, abort, etc. */ +#define FAILD 3 /* not-quite fatal false return */ + +#define STOP 0 /* keyboard macro not in use */ +#define PLAY 1 /* playing */ +#define RECORD 2 /* recording */ + +/* Completion types */ + +#define CMP_BUFFER 0 +#define CMP_COMMAND 1 +#define CMP_FILENAME 2 + +/* Directive definitions */ + +#define DIF 0 +#define DELSE 1 +#define DENDIF 2 +#define DGOTO 3 +#define DRETURN 4 +#define DENDM 5 +#define DWHILE 6 +#define DENDWHILE 7 +#define DBREAK 8 +#define DFORCE 9 + +#define NUMDIRS 10 + +/* + * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for + * routines that need directions. + */ +#define PTBEG 0 /* Leave the point at the beginning on search */ +#define PTEND 1 /* Leave the point at the end on search */ +#define FORWARD 0 /* do things in a forward direction */ +#define REVERSE 1 /* do things in a backwards direction */ + +#define FIOSUC 0 /* File I/O, success. */ +#define FIOFNF 1 /* File I/O, file not found. */ +#define FIOEOF 2 /* File I/O, end of file. */ +#define FIOERR 3 /* File I/O, error. */ +#define FIOMEM 4 /* File I/O, out of memory */ +#define FIOFUN 5 /* File I/O, eod of file/bad line*/ +#define FIODEL 6 /* Can't delete/rename file */ + +#if WINDOW_MSWIN +/* values for the fbusy flag */ +#define FREADING 1 /* file read in progress */ +#define FWRITING 2 /* file write in progress */ +/* if no file activity, the value FALSE is used */ +#endif + +#define CFCPCN 0x0001 /* Last command was C-P, C-N */ +#define CFKILL 0x0002 /* Last command was a kill */ +#define CFSRCH 0x0004 /* last command was a search */ +#define CFYANK 0x0008 /* last command was a yank */ + +#define SRNORM 0 /* end past, begin front */ +#define SRBEGIN 1 /* always at front */ +#define SREND 2 /* always one past end */ + +#define BELL 0x07 /* a bell character */ +#define TAB 0x09 /* a tab character */ + +#if USG | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | SUN | XENIX | AVIION +#define PATHCHR ':' +#else +#if WMCS || MPE +#define PATHCHR ',' +#else +#define PATHCHR ';' +#endif +#endif + +#define INTWIDTH sizeof(int) * 3 +#define LONGWIDTH sizeof(long) * 3 + +/* Macro argument token types */ + +#define TKNUL 0 /* end-of-string */ +#define TKARG 1 /* interactive argument */ +#define TKBUF 2 /* buffer argument */ +#define TKVAR 3 /* user variables */ +#define TKENV 4 /* environment variables */ +#define TKFUN 5 /* function.... */ +#define TKDIR 6 /* directive */ +#define TKLBL 7 /* line label */ +#define TKLIT 8 /* numeric literal */ +#define TKSTR 9 /* quoted string literal */ +#define TKCMD 10 /* command name */ + +/* Internal defined functions */ + +#define nextab(a) (a - (a % tabsize)) + tabsize + +/* DIFCASE represents the integer difference between upper + and lower case letters. It is an xor-able value, which is + fortunate, since the relative positions of upper to lower + case letters is the opposite of ascii in ebcdic. +*/ + +#if ASCII +#define DIFCASE 0x20 +#else +#define DIFCASE 0x40 +#endif + +/* Dynamic RAM tracking and reporting redefinitions */ + +#if RAMSIZE +#define malloc Eallocate +#define free Erelease +#else +#if VMS & OPTMEM +#define malloc VAXC$MALLOC_OPT +#define free VAXC$FREE_OPT +#define calloc VAXC$CALLOC_OPT +#define realloc VAXC$REALLOC_OPT +#define cfree VAXC$CFREE_OPT +#endif +#endif + +/* under MS Windows, we use dialog boxes to prompt the user for filenames */ +#if WINDOW_MSWIN +#define FILENAMEREPLY(p,b,nb) filenamedlg(p,b,nb,TRUE) +#else +#define FILENAMEREPLY(p,b,nb) mlreply(p,b,nb) +#endif + +/* colors respresented as parameters to WORDs and Screen positions */ + +#define CLRVAL unsigned int + +/* formal parameters to procedures are stored as a linked list + of argument names using the following simple structure: +*/ + +typedef struct PARG { + struct PARG *next; /* ptr to next linked argument */ + char name[NVSIZE+1]; /* name of the argument */ +} PARG; + +/* UNDO definitions and types */ + +typedef int OPTYPE; /* type of operation being recorded/played back */ + +#define OP_CMND 1 /* beginning of command */ +#define OP_DELC 2 /* delete a single character */ +#define OP_INSC 3 /* insert a single character */ +#define OP_DSTR 4 /* delete a string of characters */ +#define OP_ISTR 5 /* insert a string of characters */ +#define OP_REPC 6 /* replace a character */ +#define OP_CPOS 7 /* set the cursor position */ + +/* object to be undone! */ + +typedef union OBJECT { + char obj_char; /* a character */ + char obj_string[1]; /* many characters */ + char *obj_sptr; /* a ptr to a character */ +} OBJECT; + +typedef struct UNDO_OBJ { + struct UNDO_OBJ *next; /* ptr to next undo object */ + OPTYPE type; /* type of operation */ + long line_num; /* line offset from buffer beginning */ + int offset; /* offset into that line */ + long count; /* repetitions? */ + OBJECT undo_obj; /* object to be undone */ +} UNDO_OBJ; + +/* + * There is a window structure allocated for every active display window. The + * windows are kept in a big list, in top to bottom screen order, with the + * listhead at "wheadp". Each window contains its own values of dot and mark. + * The flag field contains some bits that are set by commands to guide + * redisplay. Although this is a bit of a compromise in terms of decoupling, + * the full blown redisplay is just too expensive to run for every input + * character. + */ +typedef struct EWINDOW { + struct EWINDOW *w_wndp; /* Next window */ + struct BUFFER *w_bufp; /* Buffer displayed in window */ + struct LINE *w_linep; /* Top line in the window */ + struct LINE *w_dotp; /* Line containing "." */ + short w_doto; /* Byte offset for "." */ + struct LINE *w_markp[NMARKS]; /* Line containing "mark" */ + short w_marko[NMARKS]; /* Byte offset for "mark" */ + char w_toprow; /* Origin 0 top row of window */ + char w_ntrows; /* # of rows of text in window */ + char w_force; /* If NZ, forcing row. */ + char w_flag; /* Flags. */ +#if COLOR + char w_fcolor; /* current forground color */ + char w_bcolor; /* current background color */ +#endif + int w_fcol; /* first column displayed */ +} EWINDOW; + +#define WFFORCE 0x01 /* Window needs forced reframe */ +#define WFMOVE 0x02 /* Movement from line to line */ +#define WFEDIT 0x04 /* Editing within a line */ +#define WFHARD 0x08 /* Better to a full display */ +#define WFMODE 0x10 /* Update mode line. */ +#define WFCOLR 0x20 /* Needs a color change */ + +/* This structure holds the information about each line appearing on the + * video display. The redisplay module uses an array of virtual display + * lines. On systems that do not have direct access to display memory, + * there is also an array of physical display lines used to minimize + * video updating. In most cases, these two arrays are unique. If + * WINDOW_MSWIN is 1, there is a pair of such arrays in each ESCREEN + * structure. + */ + +typedef struct VIDEO { + int v_flag; /* Flags */ +#if COLOR + int v_fcolor; /* current forground color */ + int v_bcolor; /* current background color */ + int v_rfcolor; /* requested forground color */ + int v_rbcolor; /* requested background color */ +#endif + int v_left; /* left edge of reverse video */ + int v_right; /* right right of reverse video */ +#if INSDEL && MEMMAP == 0 + int v_rline; /* requested screen line # */ +#endif +#if UTF8 + unsigned int v_text[1]; /* Screen data. */ +#else + char v_text[1]; /* Screen data. */ +#endif +} VIDEO; + +#define VFNEW 0x0001 /* contents not meaningful yet */ +#define VFCHG 0x0002 /* Changed flag */ +#define VFEXT 0x0004 /* extended (beyond column 80) */ +#define VFREV 0x0008 /* reverse video status */ +#define VFREQ 0x0010 /* reverse video request */ +#define VFCOL 0x0020 /* color change requested */ + +/* + * This structure holds the information about each separate "screen" + * within the current editing session. On a character based system, these + * screens overlay each other, and can individually be brought to front. + * On a windowing system like MicroSoft Windows 3.0, OS/2, the Macintosh, + * Intuition, Sunview or X-windows, each screen is represented in an OS + * window. The terminolgy is wrong in emacs..... + * + * EMACS The outside World + * screen window + * window pane + */ + +typedef struct ESCREEN { + struct ESCREEN *s_next_screen; /* link to next screen in list */ + EWINDOW *s_first_window; /* head of linked list of windows */ + EWINDOW *s_cur_window; /* current window in this screen */ + char *s_screen_name; /* name of the current window */ + short s_roworg; /* row origin of stored screen */ + short s_colorg; /* column origin of stored screen */ + short s_nrow; /* row width of stored screen */ + short s_ncol; /* column origin of stored screen */ +#if WINDOW_MSWIN + VIDEO **s_virtual; /* virtual screen contents */ + VIDEO **s_physical; /* physical screen contents */ + HWND s_drvhandle; /* handle for the "term" driver */ +#endif +} ESCREEN; + +/* + * Text is kept in buffers. A buffer header, described below, exists for every + * buffer in the system. The buffers are kept in a big list, so that commands + * that search for a buffer by name can find the buffer header. There is a + * safe store for the dot and mark in the header, but this is only valid if + * the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for + * the buffer is kept in a circularly linked list of lines, with a pointer to + * the header line in "b_linep". Buffers may be "Inactive" which means the + * files associated with them have not been read in yet. These get read in + * at "use buffer" time. + * Some buffers are really procedures and have a little extra information + * stored with them. + */ +typedef struct BUFFER { + struct BUFFER *b_bufp; /* Link to next BUFFER */ + struct LINE *b_dotp; /* Link to "." LINE structure */ + short b_doto; /* Offset of "." in above LINE */ + struct LINE *b_markp[NMARKS]; /* The same as the above two, */ + short b_marko[NMARKS]; /* but for the "mark" */ + int b_fcol; /* first column to display */ + struct LINE *b_linep; /* Link to the header LINE */ + struct LINE *b_topline; /* Link to narrowed top text */ + struct LINE *b_botline; /* Link to narrowed bottom text */ + char b_active; /* window activated flag */ + char b_nwnd; /* Count of windows on buffer */ + char b_exec; /* how many active executions */ + char b_flag; /* Flags */ + int b_mode; /* editor mode of this buffer */ + char b_fname[NFILEN]; /* File name */ + char b_bname[NBUFN]; /* Buffer name */ +#if CRYPT + char b_key[NPAT]; /* current encrypted key */ +#endif + int b_numargs; /* number of arguments to procedure */ + PARG *b_args; /* ptr to the first argument */ + UNDO_OBJ *undo_head; /* head of undo stack for buffer */ + long undo_count; /* # of undo operations stacked */ + long last_access; /* time of last access */ +#if UTF8 + short b_charset; /* character set */ +#endif +} BUFFER; + +#define BFINVS 0x01 /* Internal invisible buffer */ +#define BFCHG 0x02 /* Changed since last write */ +#define BFTRUNC 0x04 /* buffer was truncated when read */ +#define BFNAROW 0x08 /* buffer has been narrowed */ +#if LIBHELP +#define BFERROR 0x40 /* Error file buffer */ +#define BFHELP 0x80 /* Buffer is a help buffer */ +#endif + +#define NOTPROC -1 /* buffer is not a procedure */ + +/* mode flags */ +#if THEOX +#define NUMMODES 16 /* # of defined modes */ +#elif JMDEXT +#define NUMMODES 14 /* # of defined modes */ +#else +#define NUMMODES 11 /* # of defined modes */ +#endif + +#define MDWRAP 0x0001 /* word wrap */ +#define MDCMOD 0x0002 /* C indentation and fence match*/ +#define MDSPELL 0x0004 /* spell error parsing */ +#define MDEXACT 0x0008 /* Exact matching for searches */ +#define MDVIEW 0x0010 /* read-only buffer */ +#define MDOVER 0x0020 /* overwrite mode */ +#define MDMAGIC 0x0040 /* regular expressions in search */ +#define MDCRYPT 0x0080 /* encryption mode active */ +#define MDASAVE 0x0100 /* auto-save mode */ +#define MDREPL 0x0200 /* replace mode */ +#define MDABBR 0x0400 /* abbreviation expansion mode */ +#if JMDEXT +#define MDNOBAK 0x0800 /* no auto backup */ +#define MDSLINE 0x1000 /* single line graphics */ +#define MDDLINE 0x2000 /* double line graphics */ +#if THEOX +#define MDTHEOX 0x4000 /* TheoX character set file */ +#define MDUTF8 0x8000 /* UTF-8 character set file */ +#endif +#endif + +/* + * The starting position of a region, and the size of the region in + * characters, is kept in a region structure. Used by the region commands. + */ +typedef struct { + struct LINE *r_linep; /* Origin LINE address. */ + short r_offset; /* Origin LINE offset. */ + long r_size; /* Length in characters. */ +} REGION; + +/* + * All text is kept in circularly linked lists of "LINE" structures. These + * begin at the header line (which is the blank line beyond the end of the + * buffer). This line is pointed to by the "BUFFER". Each line contains a the + * number of bytes in the line (the "used" size), the size of the text array, + * and the text. The end of line is not stored as a byte; it's implied. + */ +typedef struct LINE { + struct LINE *l_fp; /* Link to the next line */ + struct LINE *l_bp; /* Link to the previous line */ + short l_size; /* Allocated size */ + short l_used; /* Used size */ + char l_text[1]; /* A bunch of characters. */ +} LINE; + +#define lforw(lp) ((lp)->l_fp) +#define lback(lp) ((lp)->l_bp) +#if UNIX && (SUN || HPUX8 || HPUX9 || BSD || FREEBSD) +#define lgetc(lp, n) ((unsigned char)(lp)->l_text[(n)]) +#else +#define lgetc(lp, n) ((lp)->l_text[(n)]) +#endif +#define lputc(lp, n, c) ((lp)->l_text[(n)]=(c)) +#define lused(lp) ((lp)->l_used) +#define lsize(lp) ((lp)->l_size) +#define ltext(lp) ((lp)->l_text) + +/* This structure is used to hold a user variables name and its + current value. These are used for both the global and the + local symbol tables. +*/ + +typedef struct UVAR { + char u_name[NVSIZE + 1]; /* name of user variable */ + char *u_value; /* value (string) */ +} UVAR; + +#define VT_NONE 0 /* don't declare it if not found */ +#define VT_LOCAL 1 /* local to the current procedure */ +#define VT_GLOBAL 2 /* global to all procedures */ + +/* A UTABLE is a user variable table.... containing some header + information and an array of user variable names and definitions. + They are held together in a linked list, the last member of + the list being the global user variable table. +*/ + +typedef struct UTABLE { + struct UTABLE *next; /* ptr to next user variable table */ + int size; /* max number of variables in table */ + BUFFER *bufp; /* ptr to buffer holding procedure + assosiated with this symbol table. */ + UVAR uv[1]; /* list of variable names/definitions + in this variable table */ +} UTABLE; + +/* + * The editor communicates with the display using a high level interface. A + * "TERM" structure holds useful variables, and indirect pointers to routines + * that do useful operations. The low level get and put routines are here too. + * This lets a terminal, in addition to having non standard commands, have + * funny get and put character code too. The calls might get changed to + * "termp->t_field" style in the future, to make it possible to run more than + * one terminal type. + */ +#if PROTO +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (*t_open)(void); /* Open terminal at the start.*/ + int (*t_close)(void); /* Close terminal at end. */ + int (*t_kopen)(void); /* Open keyboard */ + int (*t_kclose)(void); /* Close keyboard */ + int (*t_getchar)(void); /* Get character from keyboard. */ + int (*t_putchar)(int); /* Put character to display.*/ + int (*t_flush)(void); /* Flush output buffers. */ + int (*t_move)(int, int);/* Move the cursor, origin 0.*/ + int (*t_eeol)(void); /* Erase to end of line. */ + int (*t_eeop)(void); /* Erase to end of page. */ + int (*t_clrdesk)(void); /* Clear the page totally */ + int (*t_beep)(void); /* Beep. */ + int (*t_rev)(int); /* set reverse video state */ + int (*t_rez)(char *); /* change screen resolution */ +#if COLOR + int (*t_setfor)(int); /* set forground color */ + int (*t_setback)(int); /* set background color */ +#endif +#if INSDEL + int (*t_insline)(int); /* insert a screen line */ + int (*t_delline)(int); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (*t_sleep)(int); /* go to sleep for a while */ + int (*t_newscr)(ESCREEN *); /* create new screen display */ + int (*t_delscr)(ESCREEN *); /* destroy screen display */ + int (*t_selscr)(ESCREEN *); /* select screen display */ + int (*t_sizscr)(ESCREEN *); /* resize screen display */ + int (*t_topscr)(ESCREEN *); /* bring screen to top */ +#endif +} TERM; +#else /* TERM structure, no prototyping.*/ + +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (*t_open)(); /* Open terminal at the start. */ + int (*t_close)(); /* Close terminal at end. */ + int (*t_kopen)(); /* Open keyboard */ + int (*t_kclose)(); /* close keyboard */ + int (*t_getchar)(); /* Get character from keyboard. */ + int (*t_putchar)(); /* Put character to display. */ + int (*t_flush)(); /* Flush output buffers. */ + int (*t_move)(); /* Move the cursor, origin 0. */ + int (*t_eeol)(); /* Erase to end of line. */ + int (*t_eeop)(); /* Erase to end of page. */ + int (*t_clrdesk)(); /* Clear the page totally */ + int (*t_beep)(); /* Beep. */ + int (*t_rev)(); /* set reverse video state */ + int (*t_rez)(); /* change screen resolution */ +#if COLOR + int (*t_setfor)(); /* set forground color */ + int (*t_setback)(); /* set background color */ +#endif +#if INSDEL + int (*t_insline)(); /* insert a screen line */ + int (*t_delline)(); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (*t_sleep)(); /* go to sleep for a while */ + int (*t_newscr)(); /* create new screen display */ + int (*t_delscr)(); /* destroy screen display */ + int (*t_selscr)(); /* select screen display */ + int (*t_sizscr)(); /* resize screen display */ + int (*t_topscr)(); /* bring screen to top */ +#endif +} TERM; +#endif + + +/* TEMPORARY macros for terminal I/O (to be placed in a machine + dependant place later) */ + +#define TTopen (*term.t_open) +#define TTclose (*term.t_close) +#define TTkopen (*term.t_kopen) +#define TTkclose (*term.t_kclose) +#define TTgetc (*term.t_getchar) +#define TTputc (*term.t_putchar) +#define TTflush (*term.t_flush) +#define TTmove (*term.t_move) +#define TTeeol (*term.t_eeol) +#define TTeeop (*term.t_eeop) +#define TTclrdesk (*term.t_clrdesk) +#define TTbeep (*term.t_beep) +#define TTrev (*term.t_rev) +#define TTrez (*term.t_rez) +#if COLOR +#define TTforg (*term.t_setfor) +#define TTbacg (*term.t_setback) +#endif + +/* Structure for the table of current key bindings */ + +ETYPE EPOINTER { + int (*fp)(); /* C routine to invoke */ + BUFFER *buf; /* buffer to execute */ +}; + +typedef struct { +#if UTF8 + unsigned int k_code; /* Key code */ +#else + short k_code; /* Key code */ +#endif + short k_type; /* binding type (C function or EMACS buffer) */ + ETYPE EPOINTER k_ptr; /* ptr to thing to execute */ +} KEYTAB; + +/* structure for the name binding table */ + +typedef struct { + char *n_name; /* name of function key */ + int (*n_func)(); /* function name is bound to */ +} NBIND; + +/* The editor holds deleted text chunks in the KILL buffer. The + kill buffer is logically a stream of ascii characters, however + due to its unpredicatable size, it gets implemented as a linked + list of chunks. (The d_ prefix is for "deleted" text, as k_ + was taken up by the keycode structure) +*/ + +typedef struct KILL { + struct KILL *d_next; /* link to next chunk, NULL if last */ + char d_chunk[KBLOCK]; /* deleted text */ +} KILL; + +/* When emacs's command interpetor needs to get a variable's name, + rather than it's value, it is passed back as a VDESC variable + description structure. The v_num field is a index into the + appropriate variable table. +*/ + +typedef struct VDESC { + int v_type; /* type of variable */ + int v_num; /* ordinal pointer to variable in list */ + UTABLE *v_ut; /* ptr to appropriate user table if user var */ +} VDESC; + +/* The !WHILE directive in the execution language needs to + stack references to pending whiles. These are stored linked + to each currently open procedure via a linked list of + the following structure +*/ + +typedef struct WHBLOCK { + LINE *w_begin; /* ptr to !while statement */ + LINE *w_end; /* ptr to the !endwhile statement*/ + int w_type; /* block type */ + struct WHBLOCK *w_next; /* next while */ +} WHBLOCK; + +#define BTWHILE 1 +#define BTBREAK 2 + +/* SWORDs are syntactical words to highlight in a different + foreground color. WORDSETs are named lists of these WORDs. +*/ + +typedef struct SWORD { + struct SWORD *wd_next; /* ptr to the next word in the list */ + char *wd_text; /* the actual word */ + CLRVAL wd_color; /* color to display in */ + int wd_symflag; /* TRUE = symbol overiding word boundries + FALSE = word w/ space/symbol delimiters */ +} SWORD; + +typedef struct WORDSET { + struct WORDSET *next; + int tmp; +} WORDSET; + +/* Abbreviations are short symbols that expand to longer strings + when typed into a buffer with no intervening whitespace or commands. + This structure grows dynamically as needed. +*/ + +typedef struct ABBREV { + struct ABBREV *ab_next; /* pointer to the next abbreviation */ + char ab_sym[MAXSYM + 1]; /* name to expand */ + char ab_exp[1]; /* string to expand to */ +} ABBREV; + +/* Search definitions... */ + +/* HICHAR - 1 is the largest character we will deal with. + * BMAPSIZE represents the number of bytes in the bitmap. + */ +#if UTF8 +#define HICHAR 65536 +#else +#define HICHAR 256 +#endif +#define BMAPSIZE HICHAR >> 3 + +/* + * Jump table structures. + */ +typedef struct { + int jump; + int patlen; + int delta[HICHAR]; + char patrn[NPAT]; +} DELTA; + +#if MAGIC +/* + * Defines for the metacharacters in the regular expression + * search routines. MCNIL and GROUP are used in both search + * and replace metachar-arrays. + */ +#define MCNIL 0 /* Like the '\0' for strings.*/ +#define JMPTABLE 1 +#define LITSTRING 2 /* Literal string.*/ +#define LITCHAR 3 /* Literal character.*/ +#define ANY 4 /* Any character but the .*/ +#define CCL 5 +#define NCCL 6 +#define BOL 7 +#define EOL 8 +#define BOWRD 9 +#define EOWRD 10 +#define GRPBEG 11 /* Signal start of group.*/ +#define GRPEND 12 /* Signal end of group.*/ +#define GROUP 13 /* String of group match.*/ +#define DITTO 14 /* Replacement with match string.*/ + +#define CLOSURE 0x0100 /* An or-able value for a closure modifier.*/ +#define CLOSURE_1 0x0200 /* An or-able value for a closure modifier.*/ +#define ZEROONE 0x0400 /* An or-able value for a closure modifier.*/ + +#define ALLCLOS (CLOSURE | CLOSURE_1 | ZEROONE) +#define MASKCLO (~ALLCLOS) + +#define MC_ANY '.' /* 'Any' character (except newline).*/ +#define MC_CCL '[' /* Character class.*/ +#define MC_NCCL '^' /* Negate character class.*/ +#define MC_RCCL '-' /* Range in character class.*/ +#define MC_ECCL ']' /* End of character class.*/ +#define MC_BOL '^' /* Beginning of line.*/ +#define MC_EOL '$' /* End of line.*/ +#define MC_CLOSURE '*' /* Closure - zero to many characters match.*/ +#define MC_CLOSURE_1 '+' /* Closure - one to many characters match.*/ +#define MC_ZEROONE '?' /* Closure - zero to one characters match.*/ +#define MC_DITTO '&' /* Use matched string in replacement.*/ +#define MC_GRPBEG '(' /* Start of group (begun with a backslash).*/ +#define MC_GRPEND ')' /* End of group (begun with a backslash).*/ +#define MC_BOWRD '<' /* Beginning of word (begun with a backslash).*/ +#define MC_EOWRD '>' /* End of word (begun with a backslash).*/ +#define MC_ESC '\\' /* Escape - suppress meta-meaning.*/ + +#define MAXGROUPS 10 /* 1 + maximum # of r. e. groups. */ +#define BIT(n) (1 << (n)) /* An integer with one bit set.*/ + +/* Typedefs that define the bitmap type for searching (EBITMAP), + * the meta-character structure for MAGIC mode searching (MC), + * and the meta-character structure for MAGIC mode replacment (RMC). + */ +typedef char *EBITMAP; + +typedef struct { + short int mc_type; + union { + int lchar; + int group_no; + char *lstring; + DELTA *jmptable; + EBITMAP cclmap; + } u; +} MC; + +typedef struct { + short int mc_type; + union { + int group_no; + char *rstr; + } u; +} RMC; +#endif + +/* + This is the message which should be added to any "About MicroEMACS" + boxes on any of the machines with window managers. + + + ------------------------------------------ + | | + | MicroEMACS v4.xx | + | for the ............ | + | | + | Text Editor and Corrector | + | | + | written by Daniel M. Lawrence | + | [based on code by Dave Conroy] | + | | + | Send inquiries and donations to: | + | 617 New York St | + | Lafayette, IN 47901 | + | | + ------------------------------------------ +*/ diff --git a/h/evar.h b/h/evar.h index 6cf1053..c6d7459 100644 --- a/h/evar.h +++ b/h/evar.h @@ -4,13 +4,13 @@ written 1993 by Daniel Lawrence */ -#define MAXVARS 512 /* Maximum number of global user variables */ +#define MAXVARS 512 /* Maximum number of global user variables */ /* list of recognized environment variables */ NOSHARE char *envars[] = { "abbell", /* ring bell on abbreviation expansion? */ - "abcap", /* match capitolization in expansions */ + "abcap", /* match capitalization in expansions */ "abquick", /* quick, aggressive expansions enabled? */ "acount", /* # of chars until next auto-save */ "asave", /* # of chars between auto-saves */ @@ -18,12 +18,14 @@ NOSHARE char *envars[] = { "cbflags", /* current buffer flags */ "cbufname", /* current buffer name */ "cfname", /* current file name */ + "class", /* screen class code */ "cmdhook", /* command loop hook */ "cmode", /* mode of current buffer */ "cquote", /* close quote character */ "curchar", /* current character under the cursor */ "curcol", /* current column pos of cursor */ "curline", /* current line in file */ + "curoffs", /* current offset in line */ "curwidth", /* current screen width */ "curwind", /* current window ordinal on current screen */ "cwline", /* current screen line in window */ @@ -36,10 +38,11 @@ NOSHARE char *envars[] = { "dispundo", /* display undo depth on command line */ "exbhook", /* exit buffer switch hook */ "exithook", /* exiting emacs hook */ - "fcol", /* first displayed column in curent window */ + "fcol", /* first displayed column in current window */ "fillcol", /* current fill column */ - "flicker", /* flicker supression */ + "flicker", /* flicker suppression */ "fmtlead", /* format command lead characters */ + "found", /* last search status */ "gflags", /* global internal emacs flags */ "gmode", /* global modes */ "hardtab", /* current hard tab size */ @@ -55,7 +58,10 @@ NOSHARE char *envars[] = { "line", /* text of current line */ "lterm", /* current line terminator for writes */ "lwidth", /* width of current line */ + "margin", /* minimum margin for extended lines */ "match", /* last matched magic pattern */ + "mcol", /* mark column */ + "mline", /* mark line */ "mmove", /* mouse moves events style */ "modeflag", /* Modelines displayed flag */ "msflag", /* activate mouse? */ @@ -68,8 +74,9 @@ NOSHARE char *envars[] = { "overlap", /* line overlap when paging */ "pagelen", /* number of lines used by editor */ "palette", /* current palette string */ - "paralead", /* paragraph leadin characters */ + "paralead", /* paragraph leading characters */ "pending", /* type ahead pending flag */ + "pid", /* process id */ "popflag", /* pop-up windows active? */ "popwait", /* user wait on end of pop-up window? */ "posflag", /* display point position on modeline? */ @@ -80,6 +87,7 @@ NOSHARE char *envars[] = { "replace", /* replacement pattern */ "rval", /* child process return value */ "scrname", /* current screen name */ + "scrsiz", /* size of scroll region */ "search", /* search pattern */ "searchpnt", /* differing search styles (term point) */ "seed", /* current random number seed */ @@ -89,11 +97,13 @@ NOSHARE char *envars[] = { "sscroll", /* smooth scrolling flag */ "status", /* returns the status of the last command */ "sterm", /* search terminator character */ + "syslang", /* system language */ "target", /* target for line moves */ "time", /* date and time */ "timeflag", /* display time? */ - "tpause", /* length to pause for paren matching */ - "undoflag", /* currently processing undos */ + "tmpnam", /* temporary file name */ + "tpause", /* length to pause for fences matching */ + "undoflag", /* currently processing undoes */ "version", /* current version number */ "vscrlbar", /* vertical scroll bar flag */ "wchars", /* set of characters legal in words */ @@ -107,7 +117,7 @@ NOSHARE char *envars[] = { #define NEVARS sizeof(envars) / sizeof(char *) -/* and its preprocesor definitions */ +/* and its preprocessor definitions */ #define EVABBELL 0 #define EVABCAP 1 @@ -118,97 +128,107 @@ NOSHARE char *envars[] = { #define EVCBFLAGS 6 #define EVCBUFNAME 7 #define EVCFNAME 8 -#define EVCMDHK 9 -#define EVCMODE 10 -#define EVCQUOTE 11 -#define EVCURCHAR 12 -#define EVCURCOL 13 -#define EVCURLINE 14 -#define EVCURWIDTH 15 -#define EVCURWIND 16 -#define EVCWLINE 17 -#define EVDEBUG 18 -#define EVDESKCLR 19 -#define EVDIAGFLAG 20 -#define EVDISCMD 21 -#define EVDISINP 22 -#define EVDISPHIGH 23 -#define EVDISPUNDO 24 -#define EVEXBHOOK 25 -#define EVEXITHOOK 26 -#define EVFCOL 27 -#define EVFILLCOL 28 -#define EVFLICKER 29 -#define EVFMTLEAD 30 -#define EVGFLAGS 31 -#define EVGMODE 32 -#define EVHARDTAB 33 -#define EVHILITE 34 -#define EVHJUMP 35 -#define EVHSCRLBAR 36 -#define EVHSCROLL 37 -#define EVISTERM 38 -#define EVKILL 39 -#define EVLANG 40 -#define EVLASTKEY 41 -#define EVLASTMESG 42 -#define EVLINE 43 -#define EVLTERM 44 -#define EVLWIDTH 45 -#define EVMATCH 46 -#define EVMMOVE 47 -#define EVMODEFLAG 48 -#define EVMSFLAG 49 -#define EVNEWSCRN 50 -#define EVNUMWIND 51 -#define EVOQUOTE 52 -#define EVORGCOL 53 -#define EVORGROW 54 -#define EVOS 55 -#define EVOVERLAP 56 -#define EVPAGELEN 57 -#define EVPALETTE 58 -#define EVPARALEAD 59 -#define EVPENDING 60 -#define EVPOPFLAG 61 -#define EVPOPWAIT 62 -#define EVPOSFLAG 63 -#define EVPROGNAME 64 -#define EVRAM 65 -#define EVREADHK 66 -#define EVREGION 67 -#define EVREPLACE 68 -#define EVRVAL 69 -#define EVSCRNAME 70 -#define EVSEARCH 71 -#define EVSEARCHPNT 72 -#define EVSEED 73 -#define EVSOFTTAB 74 -#define EVSRES 75 -#define EVSSAVE 76 -#define EVSSCROLL 77 -#define EVSTATUS 78 -#define EVSTERM 79 -#define EVTARGET 80 -#define EVTIME 81 -#define EVTIMEFLAG 82 -#define EVTPAUSE 83 -#define EVUNDOFLAG 84 -#define EVVERSION 85 -#define EVVSCRLBAR 86 -#define EVWCHARS 87 -#define EVWLINE 88 -#define EVWRAPHK 89 -#define EVWRITEHK 90 -#define EVXPOS 91 -#define EVYANKFLAG 92 -#define EVYPOS 93 +#define EVCLASS 9 +#define EVCMDHK 10 +#define EVCMODE 11 +#define EVCQUOTE 12 +#define EVCURCHAR 13 +#define EVCURCOL 14 +#define EVCURLINE 15 +#define EVCUROFFS 16 +#define EVCURWIDTH 17 +#define EVCURWIND 18 +#define EVCWLINE 19 +#define EVDEBUG 20 +#define EVDESKCLR 21 +#define EVDIAGFLAG 22 +#define EVDISCMD 23 +#define EVDISINP 24 +#define EVDISPHIGH 25 +#define EVDISPUNDO 26 +#define EVEXBHOOK 27 +#define EVEXITHOOK 28 +#define EVFCOL 29 +#define EVFILLCOL 30 +#define EVFLICKER 31 +#define EVFMTLEAD 32 +#define EVFOUND 33 +#define EVGFLAGS 34 +#define EVGMODE 35 +#define EVHARDTAB 36 +#define EVHILITE 37 +#define EVHJUMP 38 +#define EVHSCRLBAR 39 +#define EVHSCROLL 40 +#define EVISTERM 41 +#define EVKILL 42 +#define EVLANG 43 +#define EVLASTKEY 44 +#define EVLASTMESG 45 +#define EVLINE 46 +#define EVLTERM 47 +#define EVLWIDTH 48 +#define EVMARGIN 49 +#define EVMATCH 50 +#define EVMCOL 51 +#define EVMLINE 52 +#define EVMMOVE 53 +#define EVMODEFLAG 54 +#define EVMSFLAG 55 +#define EVNEWSCRN 56 +#define EVNUMWIND 57 +#define EVOQUOTE 58 +#define EVORGCOL 59 +#define EVORGROW 60 +#define EVOS 61 +#define EVOVERLAP 62 +#define EVPAGELEN 63 +#define EVPALETTE 64 +#define EVPARALEAD 65 +#define EVPENDING 66 +#define EVPID 67 +#define EVPOPFLAG 68 +#define EVPOPWAIT 69 +#define EVPOSFLAG 70 +#define EVPROGNAME 71 +#define EVRAM 72 +#define EVREADHK 73 +#define EVREGION 74 +#define EVREPLACE 75 +#define EVRVAL 76 +#define EVSCRNAME 77 +#define EVSCRSIZ 78 +#define EVSEARCH 79 +#define EVSEARCHPNT 80 +#define EVSEED 81 +#define EVSOFTTAB 82 +#define EVSRES 83 +#define EVSSAVE 84 +#define EVSSCROLL 85 +#define EVSTATUS 86 +#define EVSTERM 87 +#define EVSYSLANG 88 +#define EVTARGET 89 +#define EVTIME 90 +#define EVTIMEFLAG 91 +#define EVTMPNAM 92 +#define EVTPAUSE 93 +#define EVUNDOFLAG 94 +#define EVVERSION 95 +#define EVVSCRLBAR 96 +#define EVWCHARS 97 +#define EVWLINE 98 +#define EVWRAPHK 99 +#define EVWRITEHK 100 +#define EVXPOS 101 +#define EVYANKFLAG 102 +#define EVYPOS 103 /* list of recognized user functions */ typedef struct UFUNC { char *f_name; /* name of function */ - int f_type; /* 1 = monamic, 2 = dynamic */ + int f_type; /* 1 = monamic, 2 = dynamic */ } UFUNC; #define NILNAMIC 0 @@ -217,61 +237,62 @@ typedef struct UFUNC { #define TRINAMIC 3 NOSHARE UFUNC funcs[] = { - "abbrev", MONAMIC, /* look up abbreviation */ - "abs", MONAMIC, /* absolute value of a number */ - "add", DYNAMIC, /* add two numbers together */ - "and", DYNAMIC, /* logical and */ - "ascii", MONAMIC, /* char to integer conversion */ - "band", DYNAMIC, /* bitwise and 9-10-87 jwm */ - "bind", MONAMIC, /* loopup what function name is bound to a key */ - "bnot", MONAMIC, /* bitwise not */ - "bor", DYNAMIC, /* bitwise or 9-10-87 jwm */ - "bxor", DYNAMIC, /* bitwise xor 9-10-87 jwm */ - "call", MONAMIC, /* call a procedure */ - "cat", DYNAMIC, /* concatenate string */ - "chr", MONAMIC, /* integer to char conversion */ - "divide", DYNAMIC, /* division */ - "env", MONAMIC, /* retrieve a system environment var */ - "equal", DYNAMIC, /* logical equality check */ - "exist", MONAMIC, /* check if a file exists */ - "find", MONAMIC, /* look for a file on the path... */ - "greater", DYNAMIC, /* logical greater than */ - "group", MONAMIC, /* return group match in MAGIC mode */ - "gtc", NILNAMIC, /* get 1 emacs command */ - "gtk", NILNAMIC, /* get 1 charater */ - "indirect", MONAMIC, /* evaluate indirect value */ - "isnum", MONAMIC, /* is the arg a number? */ - "left", DYNAMIC, /* left string(string, len) */ - "length", MONAMIC, /* string length */ - "less", DYNAMIC, /* logical less than */ - "lower", MONAMIC, /* lower case string */ - "mid", TRINAMIC, /* mid string(string, pos, len) */ - "mkcol", MONAMIC, /* column position of a mark */ - "mkline", MONAMIC, /* line number of a mark */ - "modulo", DYNAMIC, /* mod */ - "negate", MONAMIC, /* negate */ - "not", MONAMIC, /* logical not */ - "or", DYNAMIC, /* logical or */ - "reverse", MONAMIC, /* reverse */ - "right", DYNAMIC, /* right string(string, pos) */ - "rnd", MONAMIC, /* get a random number */ - "sequal", DYNAMIC, /* string logical equality check */ - "sgreater", DYNAMIC, /* string logical greater than */ - "sindex", DYNAMIC, /* find the index of one string in another */ - "sless", DYNAMIC, /* string logical less than */ - "slower", DYNAMIC, /* set lower to upper char translation */ - "subtract", DYNAMIC, /* subtraction */ - "supper", DYNAMIC, /* set upper to lower char translation */ - "times", DYNAMIC, /* multiplication */ - "trim", MONAMIC, /* trim whitespace off the end of a string */ - "true", MONAMIC, /* Truth of the universe logical test */ - "upper", MONAMIC, /* uppercase string */ - "xlate", TRINAMIC /* XLATE character string translation */ + { "abbrev", MONAMIC }, /* look up abbreviation */ + { "abs", MONAMIC }, /* absolute value of a number */ + { "add", DYNAMIC }, /* add two numbers together */ + { "and", DYNAMIC }, /* logical and */ + { "ascii", MONAMIC }, /* char to integer conversion */ + { "band", DYNAMIC }, /* bitwise and 9-10-87 jwm */ + { "bind", MONAMIC }, /* loopup what function name is bound to a key */ + { "bnot", MONAMIC }, /* bitwise not */ + { "bor", DYNAMIC }, /* bitwise or 9-10-87 jwm */ + { "bxor", DYNAMIC }, /* bitwise xor 9-10-87 jwm */ + { "call", MONAMIC }, /* call a procedure */ + { "cat", DYNAMIC }, /* concatenate string */ + { "chr", MONAMIC }, /* integer to char conversion */ + { "divide", DYNAMIC }, /* division */ + { "env", MONAMIC }, /* retrieve a system environment var */ + { "equal", DYNAMIC }, /* logical equality check */ + { "exist", MONAMIC }, /* check if a file exists */ + { "find", MONAMIC }, /* look for a file on the path... */ + { "greater", DYNAMIC }, /* logical greater than */ + { "group", MONAMIC }, /* return group match in MAGIC mode */ + { "gtc", NILNAMIC }, /* get 1 emacs command */ + { "gtk", NILNAMIC }, /* get 1 character */ + { "indirect", MONAMIC },/* evaluate indirect value */ + { "isnum", MONAMIC }, /* is the arg a number? */ + { "left", DYNAMIC }, /* left string(string, len) */ + { "length", MONAMIC }, /* string length */ + { "less", DYNAMIC }, /* logical less than */ + { "lower", MONAMIC }, /* lower case string */ + { "mid", TRINAMIC }, /* mid string(string, pos, len) */ + { "mkcol", MONAMIC }, /* column position of a mark */ + { "mkline", MONAMIC }, /* line number of a mark */ + { "modulo", DYNAMIC }, /* mod */ + { "negate", MONAMIC }, /* negate */ + { "not", MONAMIC }, /* logical not */ + { "or", DYNAMIC }, /* logical or */ + { "reverse", MONAMIC }, /* reverse */ + { "right", DYNAMIC }, /* right string(string, pos) */ + { "rnd", MONAMIC }, /* get a random number */ + { "sequal", DYNAMIC }, /* string logical equality check */ + { "sgreater", DYNAMIC },/* string logical greater than */ + { "sindex", DYNAMIC }, /* find the index of one string in another */ + { "sless", DYNAMIC }, /* string logical less than */ + { "slower", DYNAMIC }, /* set lower to upper char translation */ + { "srindex", DYNAMIC }, /* find the last index of one string in another */ + { "subtract", DYNAMIC },/* subtraction */ + { "supper", DYNAMIC }, /* set upper to lower char translation */ + { "times", DYNAMIC }, /* multiplication */ + { "trim", MONAMIC }, /* trim whitespace off the end of a string */ + { "true", MONAMIC }, /* Truth of the universe logical test */ + { "upper", MONAMIC }, /* uppercase string */ + { "xlate", TRINAMIC }, /* XLATE character string translation */ }; #define NFUNCS sizeof(funcs) / sizeof(UFUNC) -/* and its preprocesor definitions */ +/* and its preprocessor definitions */ #define UFABBREV 0 #define UFABS 1 @@ -316,10 +337,11 @@ NOSHARE UFUNC funcs[] = { #define UFSINDEX 40 #define UFSLESS 41 #define UFSLOWER 42 -#define UFSUB 43 -#define UFSUPPER 44 -#define UFTIMES 45 -#define UFTRIM 46 -#define UFTRUTH 47 -#define UFUPPER 48 -#define UFXLATE 49 +#define UFSRINDEX 43 +#define UFSUB 44 +#define UFSUPPER 45 +#define UFTIMES 46 +#define UFTRIM 47 +#define UFTRUTH 48 +#define UFUPPER 49 +#define UFXLATE 50 diff --git a/h/french.h b/h/french.h index 8009d26..c9fd4f9 100644 --- a/h/french.h +++ b/h/french.h @@ -4,7 +4,7 @@ (C)opyright 1995 by Daniel Lawrence Translated by Bertrand DECOUTY, 10/88 Modified 12/89 (accent...) - decouty@caroline.irisa.fr, + decouty@caroline.irisa.fr, {uunet,mcvax,inria}!irisa!decouty IRISA-INRIA, Campus de Beaulieu, F-35042 Rennes Cedex Modified 02/93 (code page 850, 8 bits chars) @@ -45,7 +45,11 @@ #define TEXT29 "Changer le nom du tampon en: " /*"Change buffer name to: "*/ /* "ACTN Modes Size Buffer File"*/ +#if JMDEXT +#define TEXT30 "ACTN Modes Taille Tampon Fichier" +#else #define TEXT30 "ACTN Modes Taille Tampon Fichier" +#endif #define TEXT31 " Modes Globaux" /*" Global Modes"*/ #define TEXT32 "Annuler les modifications" /*"Discard changes"*/ #define TEXT33 "Cha\214ne d'encryptage: " /*"Encryption String: "*/ @@ -284,7 +288,8 @@ #define TEXT233 "[Construction liste des abr\202viations]" /*"[Building Abbreviation list]"*/ #define TEXT234 "Liste des abr\202viations" /*"Abbreviation list"*/ #define TEXT235 "Impossible d'afficher la liste des abr\202viations" /*"Can not display abbreviation list"*/ -#define TEXT236 "D\202finition abr\202viations dans un tampon" /*"Define Abbreviations in buffer"*/ +#define TEXT236 "D\202finition abr\202viations depuis le tampon" /*"Define Abbreviations from buffer"*/ + #define TEXT240 "[Aucun \202cran de ce nom]" /*"[No such screen]"*/ #define TEXT241 "%%Impossible de supprimer l'\202cran courant" /*"%%Can't delete current screen"*/ #define TEXT242 "Chercher l'\202cran: " /*"Find Screen: "*/ @@ -296,7 +301,26 @@ #define TEXT248 "Entrer une \202tiquette: " /*"Enter Label String: "*/ #define TEXT249 "Variable globale \205 d\202clarer : " #define TEXT250 "Variable locale \205 d\202clarer : " - +#if JMDEXT +#define TEXT284 "Fonction non disponible" +#define TEXT285 "Aucun sujet indiqu\202" +#define TEXT286 "Recherche du sujet \"%s\"" +#define TEXT287 "Recherche du mot-cl\202 \"%s\"" +#define TEXT288 "Sujet: " +#define TEXT289 "Mot-cl\202: " +#define TEXT290 "Pas d'aide pour le sujet \"%s\"" +#define TEXT291 "Pas d'aide pour le mot-cl\202 \"%s\"" +#define TEXT292 "Ouverture du fichier d'aide %s impossible" +#define TEXT293 "Index de " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s n'est pas un fichier" +#if THEOS +#define TEXT298 "%s n'est pas un fichier s\202quentiel" +#define TEXT299 "%s n'est pas une biblioth\212que" +#endif +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Menu incorrect]" /*"[Incorrect menu]"*/ #define TEXT301 "[Trop de menus imbriqu\202s]" /*"[Too many nested popup menus]"*/ @@ -336,3 +360,4 @@ #define TEXT335 "Changer le nom de l'\202cran en: " /*"Change screen name to: "*/ #define TEXT336 "[Nom d'\202cran d\202j\205 utilis\202]" /*"[Screen name already in use]"*/ #define TEXT337 "impossible de contr\223ler un programme externe" /*"cannot monitor external program"*/ +#define TEXT338 "space for help :" diff --git a/h/frenchis.h b/h/frenchis.h index 98e0a41..929bc08 100644 --- a/h/frenchis.h +++ b/h/frenchis.h @@ -1,4 +1,4 @@ -/* FRENCHISO.H: French language text strings for +/* FRENCHISO.H: French language text ISO8859 strings for MicroEMACS 4.00 (C)opyright 1995 by Daniel Lawrence @@ -45,7 +45,11 @@ #define TEXT29 "Changer le nom du tampon en: " /*"Change buffer name to: "*/ /* "ACTN Modes Size Buffer File"*/ +#if JMDEXT +#define TEXT30 "ACTN Modes Taille Tampon Fichier" +#else #define TEXT30 "ACTN Modes Taille Tampon Fichier" +#endif #define TEXT31 " Modes Globaux" /*" Global Modes"*/ #define TEXT32 "Annuler les modifications" /*"Discard changes"*/ #define TEXT33 "Cha\356ne d'encryptage: " /*"Encryption String: "*/ @@ -77,7 +81,7 @@ #define TEXT59 UNUSED /* "Line %d/%d Col %d/%d Char %D/%D (%d%%) char = 0x%x"*/ -#define TEXT60 "Ligne %D/%D Col %d/%d Car %D/%D (%d%%) car = 0x%x" +#define TEXT60 "Ligne %D/%D Col %d/%d Car %D/%D (%d%%) car = 0x%x %d" #define TEXT61 "" /*"not used"*/ #define TEXT62 "Mode global \340 " /*"Global mode to "*/ @@ -284,7 +288,8 @@ #define TEXT233 "[Construction liste des abr\351viations]" /*"[Building Abbreviation list]"*/ #define TEXT234 "Liste des abr\351viations" /*"Abbreviation list"*/ #define TEXT235 "Impossible d'afficher la liste des abr\351viations" /*"Can not display abbreviation list"*/ -#define TEXT236 "D\351finition abr\351viations dans un tampon" /*"Define Abbreviations in buffer"*/ +#define TEXT236 "D\351finition abr\351viations depuis le tampon" /*"Define Abbreviations from buffer"*/ + #define TEXT240 "[Aucun \351cran de ce nom]" /*"[No such screen]"*/ #define TEXT241 "%%Impossible de supprimer l'\351cran courant" /*"%%Can't delete current screen"*/ #define TEXT242 "Chercher l'\351cran: " /*"Find Screen: "*/ @@ -296,7 +301,26 @@ #define TEXT248 "Entrer une \351tiquette: " /*"Enter Label String: "*/ #define TEXT249 "Variable globale \340 d\351clarer : " #define TEXT250 "Variable locale \340 d\351clarer : " - +#if JMDEXT +#define TEXT284 "Fonction non disponible" +#define TEXT285 "Aucun sujet indiqu\351" +#define TEXT286 "Recherche du sujet \"%s\"" +#define TEXT287 "Recherche du mot-cl\351 \"%s\"" +#define TEXT288 "Sujet: " +#define TEXT289 "Mot-cl\351: " +#define TEXT290 "Pas d'aide pour le sujet \"%s\"" +#define TEXT291 "Pas d'aide pour le mot-cl\351 \"%s\"" +#define TEXT292 "Impossible d'ouvrir le fichier d'aide %s" +#define TEXT293 "Index de " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#if THEOS +#define TEXT297 "%s n'est pas un fichier" +#define TEXT298 "%s n'est pas un fichier s\351quentiel" +#define TEXT299 "%s n'est pas une biblioth\350que" +#endif +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Menu incorrect]" /*"[Incorrect menu]"*/ #define TEXT301 "[Trop de menus imbriqu\351s]" /*"[Too many nested popup menus]"*/ @@ -336,3 +360,4 @@ #define TEXT335 "Changer le nom de l'\351cran en: " /*"Change screen name to: "*/ #define TEXT336 "[Nom d'\351cran d\351j\340 utilis\351]" /*"[Screen name already in use]"*/ #define TEXT337 "impossible de contr\364ler un programme externe" /*"cannot monitor external program"*/ +#define TEXT338 "space for help :" diff --git a/h/german.h b/h/german.h index 2131229..7faf5fc 100644 --- a/h/german.h +++ b/h/german.h @@ -44,7 +44,11 @@ #define TEXT27 "Pop buffer" #define TEXT28 "Buffer wird gerade angezeigt" #define TEXT29 "Aendere Buffer-Namen zu: " +#if JMDEXT #define TEXT30 "ACTN Modi Groesse Buffer Datei" +#else +#define TEXT30 "ACTN Modi Groesse Buffer Datei" +#endif /* > ^^^The spacing must match on this line. It is the header for the * buffer list. * (I extended "size" to the left to make "Groesse" fit.) @@ -81,7 +85,7 @@ #define TEXT57 "kann Variablen-Liste nicht anzeigen" #define TEXT58 "[Variablen-Liste wird aufgebaut...]" #define TEXT59 UNUSED -#define TEXT60 "Zeile %D/%D Spalte %d/%d Zeichen %D/%D (%d%%) Zeichen = 0x%x" +#define TEXT60 "Zeile %D/%D Spalte %d/%d Zeichen %D/%D (%d%%) Zeichen = 0x%x %d" #define TEXT61 "" #define TEXT62 "Globaler Modus, der " #define TEXT63 "Modus, der " @@ -286,6 +290,12 @@ #define TEXT228 "[Kill ring cleared]" #define TEXT229 " in < " #define TEXT230 "> at line " +#define TEXT231 "Abbreviation to set: " +#define TEXT232 "Abbreviation to delete: " +#define TEXT233 "[Building Abbreviation list]" +#define TEXT234 "Abbreviation list" +#define TEXT235 "Can not display abbreviation list" +#define TEXT236 "Define Abbreviations from buffer" #define TEXT240 "[No such screen]" #define TEXT241 "%%Can't delete current screen" @@ -298,7 +308,26 @@ #define TEXT248 "Enter Label String: " #define TEXT249 "Global variable to declare: " #define TEXT250 "Local variable to declare: " - +#if JMDEXT +#define TEXT284 "Function not available" +#define TEXT285 "No topic" +#define TEXT286 "Searching topic \"%s\"" +#define TEXT287 "Searching keyword \"%s\"" +#define TEXT288 "Topic: " +#define TEXT289 "Keyword: " +#define TEXT290 "No help for topic \"%s\"" +#define TEXT291 "No help for keyword \"%s\"" +#define TEXT292 "Unable to open the help file %s" +#define TEXT293 "Index of " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s n'est pas un fichier" +#if THEOS +#define TEXT298 "%s is not a sequential file" +#define TEXT299 "%s is not a library" +#endif +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Incorrect menu]" #define TEXT301 "[Too many nested popup menus]" @@ -337,4 +366,10 @@ #define TEXT335 "Change screen name to: " #define TEXT336 "[Screen name already in use]" #define TEXT337 "cannot monitor external program" +#define TEXT338 "space for help :" +#if JMDEXT +#define TEXT400 "%s is not a regular file" +#define TEXT401 "%s is not a sequential file" +#define TEXT402 "%s is not a library" +#endif diff --git a/h/japan.h b/h/japan.h index b640f2d..79322f0 100644 --- a/h/japan.h +++ b/h/japan.h @@ -37,7 +37,11 @@ #define TEXT27 "\203|\203b\203v\202\267\202\351\203o\203b\203t\203@" #define TEXT28 "\203o\203b\203t\203@\202\315\225\\\216\246\202\263\202\352\202\304\202\242\202\334\202\267" #define TEXT29 "\203o\203b\203t\203@\226\274\202\360\225\317\215X: " +#if JMDEXT +#define TEXT30 "ACTN Modes Size Buffer File" +#else #define TEXT30 "ACTN Modes Size Buffer File" +#endif #define TEXT31 " Global Modes" #define TEXT32 "\225\317\215X\223\340\227e\202\360\216\314\202\304\202\334\202\267\202\251" #define TEXT33 "\210\303\215\206\211\273\225\266\216\232\227\361: " @@ -67,7 +71,7 @@ #define TEXT57 "\225\317\220\224\203\212\203X\203g\202\252\225\\\216\246\202\305\202\253\202\334\202\271\202\361" #define TEXT58 "[\225\317\220\224\203\212\203X\203g\215\354\220\254\222\206]" #define TEXT59 UNUSED -#define TEXT60 "\215s %D/%D \214\205 %d/%d \225\266\216\232 %D/%D (%d%%) \225\266\216\232 = 0x%x" +#define TEXT60 "\215s %D/%D \214\205 %d/%d \225\266\216\232 %D/%D (%d%%) \225\266\216\232 = 0x%x %d" #define TEXT61 "" #define TEXT62 "\203O\203\215\201[\203o\203\213\201E\203\202\201[\203h" #define TEXT63 "\203\202\201[\203h" @@ -238,6 +242,12 @@ #define TEXT228 "[Kill ring cleared]" #define TEXT229 " in < " #define TEXT230 "> at line " +#define TEXT231 "Abbreviation to set: " +#define TEXT232 "Abbreviation to delete: " +#define TEXT233 "[Building Abbreviation list]" +#define TEXT234 "Abbreviation list" +#define TEXT235 "Can not display abbreviation list" +#define TEXT236 "Define Abbreviations from buffer" #define TEXT240 "[No such screen]" #define TEXT241 "%%Can't delete current screen" @@ -250,7 +260,26 @@ #define TEXT248 "Enter Label String: " #define TEXT249 "Global variable to declare: " #define TEXT250 "Local variable to declare: " - +#if JMDEXT +#define TEXT284 "Function not available" +#define TEXT285 "No topic" +#define TEXT286 "Searching topic \"%s\"" +#define TEXT287 "Searching keyword \"%s\"" +#define TEXT288 "Topic: " +#define TEXT289 "Keyword: " +#define TEXT290 "No help for topic \"%s\"" +#define TEXT291 "No help for keyword \"%s\"" +#define TEXT292 "Unable to open the help file %s" +#define TEXT293 "Index of " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s is not a regular file" +#endif +#if THEOS +#define TEXT298 "%s is not a sequential file" +#define TEXT299 "%s is not a library" +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Incorrect menu]" #define TEXT301 "[Too many nested popup menus]" @@ -289,4 +318,4 @@ #define TEXT335 "Change screen name to: " #define TEXT336 "[Screen name already in use]" #define TEXT337 "cannot monitor external program" - +#define TEXT338 "space for help :" diff --git a/h/latin.h b/h/latin.h index 10593cd..343772d 100644 --- a/h/latin.h +++ b/h/latin.h @@ -34,7 +34,11 @@ #define TEXT27 "apotheca occidenda: " #define TEXT28 "apotheca ostenditur" #define TEXT29 "mutare nomen apothecae ad: " +#if JMDEXT +#define TEXT30 "ACTN Modi Magn Apothec Filum" +#else #define TEXT30 "ACTN Modi Magn Apothec Filum" +#endif #define TEXT31 " Modi Globales" #define TEXT32 "reicere mutationes" #define TEXT33 "linum encryptionis: " @@ -64,7 +68,7 @@ #define TEXT57 "non possum variabilium ostendere tabula" #define TEXT58 "[struo tabula variabilium]" #define TEXT59 UNUSED -#define TEXT60 "Linea %D/%D Col %d/%d Char %D/%D (%d%%) char = 0x%x" +#define TEXT60 "Linea %D/%D Col %d/%d Char %D/%D (%d%%) char = 0x%x %d" #define TEXT61 "%%argumentum negativum occisionus nefas est" #define TEXT62 "modus globalis " #define TEXT63 "modus " @@ -235,6 +239,12 @@ #define TEXT228 "[Kill ring cleared]" #define TEXT229 " in < " #define TEXT230 "> at line " +#define TEXT231 "Abbreviation to set: " +#define TEXT232 "Abbreviation to delete: " +#define TEXT233 "[Building Abbreviation list]" +#define TEXT234 "Abbreviation list" +#define TEXT235 "Can not display abbreviation list" +#define TEXT236 "Define Abbreviations from buffer" #define TEXT240 "[No such screen]" #define TEXT241 "%%Can't delete current screen" @@ -247,7 +257,26 @@ #define TEXT248 "Enter Label String: " #define TEXT249 "Global variable to declare: " #define TEXT250 "Local variable to declare: " - +#if JMDEXT +#define TEXT284 "Function not available" +#define TEXT285 "No topic" +#define TEXT286 "Searching topic \"%s\"" +#define TEXT287 "Searching keyword \"%s\"" +#define TEXT288 "Topic: " +#define TEXT289 "Keyword: " +#define TEXT290 "No help for topic \"%s\"" +#define TEXT291 "No help for keyword \"%s\"" +#define TEXT292 "Unable to open the help file %s" +#define TEXT293 "Index of " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s is not a regular file" +#endif +#if THEOS +#define TEXT298 "%s is not a sequential file" +#define TEXT299 "%s is not a library" +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Incorrect menu]" #define TEXT301 "[Too many nested popup menus]" @@ -286,4 +315,4 @@ #define TEXT335 "Change screen name to: " #define TEXT336 "[Screen name already in use]" #define TEXT337 "cannot monitor external program" - +#define TEXT338 "space for help :" diff --git a/h/mswin.h b/h/mswin.h index 7cc98ca..e809022 100644 --- a/h/mswin.h +++ b/h/mswin.h @@ -55,7 +55,7 @@ #define MLSIZE NSTRING /* message line buffer size */ /* offsets for the screen windows extra bytes */ -#define GWL_SCRPTR 0 /* SCREEN structure pointer */ +#define GWL_SCRPTR 0 /* ESCREEN structure pointer */ #if WINXP #define GWW_SCRCX (GWL_SCRPTR+sizeof(LONG_PTR)) /* client area width */ #else diff --git a/h/platin.h b/h/platin.h index bbca365..d99b2ec 100644 --- a/h/platin.h +++ b/h/platin.h @@ -38,7 +38,11 @@ #define TEXT27 "Oppay ufferbay" #define TEXT28 "Ufferbay isway eingbay isplayedday" #define TEXT29 "Hangecay ufferbay amenay otay: " +#if JMDEXT +#define TEXT30 "ACTN Odesmay Izesay Ufferbay Ilefay" +#else #define TEXT30 "ACTN Odesmay Izesay Ufferbay Ilefay" +#endif #define TEXT31 " Global Modes" #define TEXT32 "Iscardday hangescay" #define TEXT33 "Encryptionway Tringsay: " @@ -68,7 +72,7 @@ #define TEXT57 "Ancay otnay isplayday ariablevay istlay" #define TEXT58 "[Uildingbay ariablevay istlay]" #define TEXT59 UNUSEDWAY -#define TEXT60 "Inelay %D/%D Olcay %d/%d Archay %D/%D (%d%%) archay = 0x%x" +#define TEXT60 "Inelay %D/%D Olcay %d/%d Archay %D/%D (%d%%) archay = 0x%x %d" #define TEXT61 "" #define TEXT62 "Lobalgay odemay otay " #define TEXT63 "Odemay otay " @@ -256,7 +260,26 @@ #define TEXT248 "Enterway Abelay Ingstray: " #define TEXT249 "Obalglay ariablevay otay eclareday: " #define TEXT250 "Ocallay ariablevay otay eclareday: " - +#if JMDEXT +#define TEXT284 "Function not available" +#define TEXT285 "No topic" +#define TEXT286 "Searching topic \"%s\"" +#define TEXT287 "Searching keyword \"%s\"" +#define TEXT288 "Topic: " +#define TEXT289 "Keyword: " +#define TEXT290 "No help for topic \"%s\"" +#define TEXT291 "No help for keyword \"%s\"" +#define TEXT292 "Unable to open the help file %s" +#define TEXT293 "Index of " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s is not a regular file" +#endif +#if THEOS +#define TEXT298 "%s is not a sequential file" +#define TEXT299 "%s is not a library" +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Incorrectway enumay]" #define TEXT301 "[Ootay anymay estednay opupay enusmay]" @@ -295,4 +318,4 @@ #define TEXT335 "Angechay eenscray amenay otay: " #define TEXT336 "[Eenscray amenay alreadyway inway useway]" #define TEXT337 "annotcay onitormay externalway ogrampray" - +#define TEXT338 "space for help :" diff --git a/h/spanish.h b/h/spanish.h index 1fa2738..c40d405 100644 --- a/h/spanish.h +++ b/h/spanish.h @@ -24,7 +24,7 @@ #define TEXT14 "No esta declarada" #define TEXT15 ": declara a esta tecla" #define TEXT16 "[Esa funccion no la hay!]" -#define TEXT17 "Tabla de declaraciones esta llena!" +#define TEXT17 "Tabla de declaraciones esta llena!" #define TEXT18 ": unbind-key " #define TEXT19 "[Tecla no declarada]" #define TEXT20 "Apropos string: " @@ -37,7 +37,11 @@ #define TEXT27 "Pop buffer" #define TEXT28 "Buffer is being displayed" #define TEXT29 "Change buffer name to: " +#if JMDEXT #define TEXT30 "ACTN Modes Size Buffer File" +#else +#define TEXT30 "ACTN Modes Size Buffer File" +#endif #define TEXT31 " Global Modes" #define TEXT32 "Discard changes" #define TEXT33 "Encryption String: " @@ -67,7 +71,7 @@ #define TEXT57 "No puedo ensenar la lista de variables" #define TEXT58 "[Creando lista de variables]" #define TEXT59 UNUSED -#define TEXT60 "Linea %D/%D Columna %d/%d Letra %D/%D (%d%%) Letra = 0x%x" +#define TEXT60 "Linea %D/%D Columna %d/%d Letra %D/%D (%d%%) Letra = 0x%x %d" #define TEXT61 "" #define TEXT62 "Modo global a" #define TEXT63 "Modo a" @@ -238,6 +242,12 @@ #define TEXT228 "[Kill ring cleared]" #define TEXT229 " in < " #define TEXT230 "> at line " +#define TEXT231 "Abbreviation to set: " +#define TEXT232 "Abbreviation to delete: " +#define TEXT233 "[Building Abbreviation list]" +#define TEXT234 "Abbreviation list" +#define TEXT235 "Can not display abbreviation list" +#define TEXT236 "Define Abbreviations from buffer" #define TEXT240 "[No such screen]" #define TEXT241 "%%Can't delete current screen" @@ -250,7 +260,26 @@ #define TEXT248 "Enter Label String: " #define TEXT249 "Global variable to declare: " #define TEXT250 "Local variable to declare: " - +#if JMDEXT +#define TEXT284 "Function not available" +#define TEXT285 "No topic" +#define TEXT286 "Searching topic \"%s\"" +#define TEXT287 "Searching keyword \"%s\"" +#define TEXT288 "Topic: " +#define TEXT289 "Keyword: " +#define TEXT290 "No help for topic \"%s\"" +#define TEXT291 "No help for keyword \"%s\"" +#define TEXT292 "Unable to open the help file %s" +#define TEXT293 "Index of " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s is not a regular file" +#endif +#if THEOS +#define TEXT298 "%s is not a sequential file" +#define TEXT299 "%s is not a library" +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Incorrect menu]" #define TEXT301 "[Too many nested popup menus]" @@ -289,4 +318,4 @@ #define TEXT335 "Change screen name to: " #define TEXT336 "[Screen name already in use]" #define TEXT337 "cannot monitor external program" - +#define TEXT338 "space for help :" diff --git a/h/theox.h b/h/theox.h new file mode 100644 index 0000000..1dd9226 --- /dev/null +++ b/h/theox.h @@ -0,0 +1,20 @@ +/* + * theox.h + * + * Created on: 20 févr. 2020 + * Author: system + */ + +#ifndef H_THEOX_H_ +#define H_THEOX_H_ + +extern unsigned char _b_wchar2theox(unsigned int wch); +extern unsigned int _b_theox2wchar(unsigned char c); +extern VOID theoxputchar(unsigned char c); +extern int _b_tolower(int ch); +extern int _b_toupper(int ch); +extern int _b_islower(int ch); +extern int _b_isupper(int ch); + + +#endif /* H_THEOX_H_ */ diff --git a/h/utf8.h b/h/utf8.h new file mode 100644 index 0000000..f50a150 --- /dev/null +++ b/h/utf8.h @@ -0,0 +1,23 @@ +/* UTF8: Unicode UTF-8 prototypes and declarations + MicroEMACS 4.00 + + written by Jean-Michel Dubois +*/ + +#ifndef UTF8_H +#define UTF8_H + +unsigned utf8_to_unicode(const char *line, unsigned index, unsigned len, unsigned int *res); +unsigned unicode_to_utf8(unsigned int c, char *utf8); + +static inline int is_beginning_utf8(unsigned char c) +{ + return (c & 0xc0) != 0x80; +} + +static inline int is_multibyte_utf8(unsigned char c) +{ + return (c & 0xc0) == 0xc0; +} + +#endif diff --git a/libhelp/b.hlp b/libhelp/b.hlp new file mode 100644 index 0000000..4e89694 --- /dev/null +++ b/libhelp/b.hlp @@ -0,0 +1,4628 @@ +@_bios_keybrd +_bios_keybrd (MSVC) Return the keyboard status or keycode +#include +#include +unsigned short _bios_keybrd(unsigned short service) +See also: mapdoskey +@_errarg +_errarg (THEOS) Variable used by error message functions +#include +extern char *_errarg; +See also: strerror +@_errnum +_errnum (THEOS) External integer for return of error status +#include +extern short _errnum; +Functions setting _errnum: access,chdir,clearerr,diropen,erase,fclear,fclose, +fcreate,fopen and derivates,getmsg,mkdir,open,remove,rename,rmdir,topen,unlink +See also: errno,fperror +@_incrmem +_incrmem (THEOS) ??? +#include +char *_incrmem(size_t len); +@_mfg_get_date +_mfg_get_date (THEOS) Copy hardware date into the nuc structure +#include +void _mfg_get_date(void); +See also: _mfg_get_time,_mfg_put_date,_mfg_put_time +@_mfg_get_time +_mfg_get_time (THEOS) Copy hardware time into the nuc structure +#include +void _mfg_get_time(void); +See also: _mfg_get_date,_mfg_put_date,_mfg_put_time +@_mfg_init +_mfg_init (THEOS) Initialise system hardware +#include +long _mfg_init(long addr,long *store); +@_mfg_put_date +_mfg_put_date (THEOS) Copy date from the nuc structure to hardware +#include +void _mfg_put_date(void); +See also: _mfg_get_date,_mfg_get_time,_mfg_put_time +@_mfg_put_time +_mfg_put_time (THEOS) Copy time from the nuc structure to hardware +#include +void _mfg_put_time(void); +See also: _mfg_get_date,_mfg_get_time,_mfg_put_date +@_mfg_reserved +_mfg_reserved (THEOS) ??? +#include +void _mfg_reserved(void) +@_monthen +_monthen (THEOS) Return the number of days in a month +#include <_time.h> +short _monthen(short year,short month); +See also: leapyear,_yday +@_msec_off +_msec_off (THEOS) Turn off millisecond timing +#include +void _msec_off(void); +See also: msec_on +@_msec_on +_msec_on (THEOS) Turn on millisecond timing +#include +void _msec_on(void); +See also: msec_off +@_read +_read (THEOS) Read data from a file into any segment +#include +size_t _read(short fd,unsigned seg,void *buf,size_t len); +See also: close,creat,filelength,flush,lseek,open,read,tell,_write,write +@_rsvmem +_rsvmem (THEOS) ??? +#include +short *_rsvmem(long addr,long len,short code); +@_sched_int +_sched_int (THEOS) Schedule interrupt +#include +void _sched_int(short num,short (*addr)()); +@_set_slice +_set_slice (THEOS) Set the user time slice +#include +void _set_slice(short msec); +@_sema_isr +_sema_isr (THEOS) ??? +#include +_sema_isr(short pid,short num,short cmd); +@_setargv +_setargv (+THEOS) Expand wild cards argument to the list of matching files +#include <_stdlib.h> +short _setargv(short *pargc, char ***pargv); +Set : errno +@_sync +_sync (THEOS) Flush the cache +#include +void _sync(short code); +@_weekday +_weekday (THEOS) Return the number of the day in the week +#include <_time.h> +See also: leapyear,_monthen,_yday +@_write +_write (THEOS) Write data to a file from another memory segment +#include +size_t _write(short fd,unsigned seg,void *buf,size_t len); +See also: close,creat,filelength,flush,lseek,open,_read,read,tell,write +@_yday +_yday (THEOS) Return the number of days since the beginning of the year +@a64l +a64l (UNIX) Convert a number from a base-64 ASCII string to a long integer +#include +long a64l(const char *s); +See also: l64a +@abort +abort (ANSI) End program immediately +#include +void abort(void); +See also: exit +@abs +abs (ANSI) Return the absolute value of an integer +#include +short abs(short n); +See also: fabs +@access +access (UNIX) Check if a file can be accessed in a given mode +#include +short access(const char *filename,short mode); +mode : 0 existence, 1 execution, 2 write, 4 read +Set : errno,_errnum +See also: fperror,strerror +@acos +acos (ANSI) Calculate arc cosine +#include +double acos(double x); +@acot +acot (THEOS) Calculate arc cotangent +#include +double acot(double x); +@acsc +acsc (THEOS) Calculate arc cosecant +#include +double acsc(double x); +Set : errno +@addb +addb (THEOS) Add a value to a byte in another memory segment +#include +void addb(void *ofs,unsigned seg,char val); +See also: Other add functions +@addcs +addcs (THEOS) Add a value to a byte in the code segment +#include +void addcs(void *ofs,char val); +See also: Other add functions +@addl +addl (THEOS) Add a value to a long in another memory segment +#include +void addl(void *ofs,unsigned seg,long val); +See also: Other add functions +@addlcs +addlcs (THEOS) Add a value to a long in the code segment +#include +void addlcs(void *ofs,long val); +See also: Other add functions +@addw +addw (THEOS) Add a value to a word in another memory segment +#include +void addw(void *ofs,unsigned seg,short val); +See also: Other add functions +@addwcs +addwcs (THEOS) Add a value to a word in the code segment +#include +void addwcs(void *ofs,short val); +See also: Other add functions +@alarm +alarm (UNIX) Start a timer in seconds generating a signal interrupt +#include +short alarm(short secs); +See also: delay,msalarm,signal +@andb +andb (THEOS) And a value to a byte in another memory segment +#include +void andb(void *ofs,unsigned seg,char mask); +See also: Other and functions +@andcs +andcs (THEOS) And a value to a byte in the code segment +#include +void andcs(void *ofs,char mask); +See also: Other and functions +@andl +andl (THEOS) And a value to a long in another memory segment +#include +void andl(void *ofs,unsigned seg,long mask); +See also: Other and functions +@andlcs +andlcs (THEOS) And a value to a long in the code segment +#include +void andlcs(void *ofs,long mask); +See also: Other and functions +@andw +andw (THEOS) And a value to a word in another memory segment +#include +void andw(void *ofs,unsigned seg,short mask); +See also: Other and functions +@andwcs +andwcs (THEOS) And a value to a word in the code segment +#include +void andwcs(void *ofs,short mask); +See also: Other and functions +@asctime +asctime (ANSI) Convert time structure to ASCII string +#include +char *asctime(const struct tm *tmp); +See also: ctime,gmtime,localtime,mktime,strftime,time +@asec +asec (THEOS) Calculate arc secant +#include +double asec(double x); +Set : errno +@asin +asin (ANSI) Calculate inverse sine +#include +double asin(double x); +Set : errno +@assert +assert (ANSI) Check assertion at run time +#include +void assert(short expression); +@assert +#assert (ANSI) Check assertion at compile time +#assert expression +@at +at (THEOS) Position the cursor on the console +#include +void at(short x,short y); +See also: putch +@atan +atan (ANSI) Calculate inverse tangent +#include +double atan(double x); +@atan2 +atan2 (ANSI) Calculate inverse tangent +#include +double atan2(double num,double den); +Set : errno +@atexit +atexit (ANSI) Specifie a routine to call at normal exit time +#include +short atexit(void (*func)(void)); +See also: exit +@atof +atof (ANSI) Convert ASCII string to floating point +#include +double atof(const char *string); +See also: ftoa,strtod +@atoi +atoi (ANSI) Convert ASCII string to integer +#include +short atoi(const char *string); +Set : errno +See also: itoa +@atol +atol (ANSI) Convert ASCII string to long integer +#include +long atol(const char *string); +Set : errno +See also: ltoa,strtol,strtoul,ultoa +@bcd2ieee +bcd2ieee (THEOS) Convert a bcd floating point to ieee floating point +#include +void bcd2ieee(double *data); +See also: ieee2bcd +@bsearch +bsearch (ANSI) Perform a binary search in a sorted array +#include +void *bsearch(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: lfind,lsearch,qsort +@c3tol +c3tol (ANSI) Convert a three byte integer to a long integer +#include +long c3tol(const void *c); +See also: l3tol,ltoc3,ltol3 +@cabs +cabs (UNIX) Complex absolute value function +#include +double cabs(struct complex z); +@callcsi +callcsi (THEOS) See system +@calloc +calloc (ANSI) Allocate dynamic memory +#include +char *calloc(size_t count,size_t size); +See also: free,malloc,memset,realloc +@cclose +cclose (+THEOS) Close a serial communication file +#include +short cclose(FILE *port) +See also: ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@ccloseall +ccloseall (+THEOS) Close all serial communication files +#include +short ccloseall(void) +See also: cclose,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@ceil +ceil (UNIX) Return the smallest integer greater than or equal to a value +#include +double ceil(double z); +See also: floor, round +@cgetc +cgetc (+THEOS) Read a character from a communication file +#include +short cgetc(FILE *port); +See also: cclose,ccloseall,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@cgets +cgets (ANSI) Accept a string from the console +#include +char *cgets(char *buffer,short len); +See also: getch,fgets,gets +@chdir +chdir (UNIX) Change the current directory +#include +short chdir(const char *path); +Set : errno,_errnum +See also: mkdir,rmdir +@chgrow +chrow (+THEOS) Set the grow factor of file +#include <_io.h> +short chgrow(char *fname,short grow); +See also: filechange +@chlen +chlen (+THEOS) Change the record length and key length of a file +#include <_io.h> +short chlen(char *fname,unsigned short reclen,unsigned short keylen); +@chmod +chmod (+UNIX) Change protections of a file +#include <_io.h> +short chmod(const char *fname,short prot); +@chorg +chorg (+THEOS) Change the organization mode of a file +#include <_io.h> +short chorg(char *fname,unsigned short filestat); +@chown +chown (+UNIX) Change the owner of a file +#include <_io.h> +short chown(const char *fname,short uid,short gid); +@clearerr +clearerr (ANSI) Clear the end-of-file and error status of a file +#include +clearerr(FILE *fp); +Set : _errnum +See also: feof,ferror +@cld +cld (THEOS) Clear direction flag +#include +void cld(void); +See also: std +@cli +cli (THEOS) Clear interrupt +#include +void cli(void); +See also: sti +@clock +clock (ANSI) Get number of clock ticks since system boot +#include +clock_t clock(void); +See also: time +@clock_t +clock_t (ANSI) Type used for the number of clock ticks since system boot +#include +typedef long clock_t; +@close +close (UNIX) Close a file +#include +short close(short fd); +See also: creat,filelength,flush,lseek,open,_read,read,tell,_write,write +@closedir +closedir (+UNIX) Close the directory search +#include +void closedir(DIR*); +See also: opendir,readdir,seekdir,telldir,rewinddir +Set : errno +@con_tran +con_tran (THEOS) Test and translate system control codes +#include +short con_tran(struct ucb *ucb,short ch,unsigned seg,void *buf); +@conmask +conmask (THEOS) Set the console control mask +#include +void conmask(const char *s); +@conin +conin (THEOS) Read character from console +See getch +@conout +conout (THEOS) Display character on the console +See putch +@conrdy +conrdy (THEOS) Test if characters are available on the console +short conrdy(void); +@cos +cos (ANSI) Calculate cosine +#include +double cos(double radian); +Set : errno +@cosh +cosh (ANSI) Calculate hyperbolic cosine +#include +double cosh(double radian); +@cot +cot (THEOS) Calculate cotangent +#include +double cot(double radian); +@coth +coth (THEOS) Calculate hyperbolic cotangent +#include +double coth(double radian); +@cprintf +cprintf (MSC) Format and print text to the console +#include +short cprintf(const char *format,...); +Note: Floating point conversions are not supported +See also: fprintf,printf,sprintf,vfprintf,vprintf,vsprintf +@cputc +cputc (+THEOS) Write a character to a communication file +#include +void cputc(FILE *port,short c); +See also: cclose,ccloseall,cgetc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@cputs +cputs (ANSI) Write a string to the console +#include +void cputs(const char *s); +See also: cprintf,fputs,printf,putch,puts +@creat +creat (UNIX) Create/truncate a file +#include +short creat(const char *filename,short mode); +See also: close,filelength,flush,lseek,open,_read,read,tell,write,_write +@crt +crt (THEOS) See putchar +@crtcolor +crtcolor (THEOS) Change the colors of subsequent displays on the console +#include +void crtcolor(short fg,short bg,short rfg,short rbg); +See also: hascolor,CLASSGEN command +@csc +csc (THEOS) Calculate cosecant +#include +double csc(double radian); +@csch +csch (THEOS) Calculate hyperbolic cosecant +#include +double csch(double radian); +@csetbuf +csetbuf (+THEOS) Allocate an i/o buffer for a user buffered file +#include +void csetbuf(FILE *port,UBUFFER *buffer); +See also: cclose,ccloseall,cgetc,cputc,csetvbuf,getrxcnt,isrxempty,istxfull +@csetvbuf +csetvbuf (+THEOS) Allocate an i/o buffer for a user buffered file +#include +short csetvbuf(FILE *port,UBUFFER *buffer,short mode,size_t size); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,getrxcnt,isrxempty,istxfull +@csi +csi (THEOS) Execute a CSI command without returning to the current program +#include +void csi(const char *command); +See also: system +@ctime +ctime (ANSI) Convert system time to an ASCII string +#include +char *ctime(const time_t *timep); +See also: asctime,localtime,mktime,strftime,time +@cuserid +cuserid (THEOS) Return the account name currently logged +#include +char *cuserid(char *account); +See also: getlogin,getuid,logname +@datehdng +datehdng (THEOS) Internal function used by testhead +@daylight +daylight (ANSI) Variable indicating if daylight time is used +#include +extern short daylight; +See also: timezone,tzset,tzname +@dec +dec (THEOS) Decrement a byte in another memory segment +#include +void dec(void *ofs,unsigned seg); +See also: Other dec functions +@deccs +deccs (THEOS) Decrement a byte in the code segment +#include +void deccs(void *ofs); +See also: Other dec functions +@deccsl +deccsl (THEOS) Decrement a long in the code segment +#include +void deccsl(void *ofs); +See also: Other dec functions +@deccsw +deccsw (THEOS) Decrement a word in the code segment +#include +void deccsw(void *ofs); +See also: Other dec functions +@decl +decl (THEOS) Decrement a long in another memory segment +#include +void decl(void *ofs,unsigned seg); +See also: Other dec functions +@decw +decw (THEOS) Decrement a word in another memory segment +#include +void decw(void *ofs,unsigned seg); +See also: Other dec functions +@define +#define (ANSI) Define a variable as manifest constant +#define constant value +@delay +delay (THEOS) Suspend operation for a given time +#include +void delay(unsigned code); +See also: alarm,msalarm,sleep +@deletek +deletek (THEOS) Delete a record from on indexed or keyed file +#include +short deletek(FILE *file,const char *key); +See also: readk,readn,readp,writek +@devname +devname (+THEOS) Return the name of a physical device +#include <_stdio.h> +char* devname(int lub); +See also: termname,ttyname,vdiname +@devopen +devopen (THEOS) Open or close a device +#include <_sc.h> +void devopen(struct ucb *ucb,short cmd); +cmd = 0 : open. cmd = 1 : close +@difftime +difftime (ANSI) Return difference between two times +#include +double difftime(time_t newtime,time_t oldtime); +@dir_mount +dir_mount (THEOS) ??? +#include <_sc.h> +void dir_mount(struct diskucb *ucb); +@dir_rd +dir_rd (THEOS) Read a sector in the directory +#include +void dir_rd(struct diskucb *ucb,long sect,void *buf); +@dirclose +dirclose (THEOS) Close the directory search +#include +void dirclose(void); +See also: diropen,dirread,find_first,find_next +@diropen +diropen (THEOS) Open the directory search for files in the current account +#include +short diropen(const char *fn); +Set : _errnum +See also: dirclose,dirread,find_first,find_next +@dirread +dirread (THEOS) Find the next file in the directory +#include +char *dirread(void); +See also: dirclose,diropen,find_first,find_next +@disk_capacity +disk_capacity (THEOS) ??? +#include <_sc.h> +short disk_capacity(short lub,void *disk_struct); +@display +display (THEOS) Display a string on the console +See cputs +@div +div (ANSI) Return the quotient and remainder of the division of two integers +#include +div_t div(short numer,short denomin); +See also: ldiv +@div_t +div_t (ANSI) Used by div +#include +typedef struct {short quot,rem;} div_t; +@dup +dup (UNIX) Duplicate a file descriptor +#include +short dup(short fd); +Set : errno +See also: close,creat,open +@elif +#elif (ANSI) Include code conditionally +#elif (expression); +@else +#else (ANSI) Include code conditionally +#else +@endif +#endif (ANSI) End conditional inclusion of code +#endif +@erase +erase (THEOS) Erase an existing file +See remove +@errbot +errbot (THEOS) Display a system message at the bottom of the console +#include +short errbot(short num,const char *arg[],short c1,short c2,short c3,short c4); +See also: errmsg,putmsg,syserr,yesno +@errmsg +errmsg (THEOS) Display a system message on stderr +#include +void errmsg(short num,const char *arg[]); +See also: errbot,perror,putmsg,strerror,syserr +@errno +errno (ANSI) External integer for return of error status +#include +extern short errno; +Functions setting errno: access,acos,acsc,asec,asin,atan2,atoi,atol,chdir,cos, +dup,erase,fgetc,fputc,fstat,locking,log,log10,log2,mkdir,open,perror,pow,remove, +rename,rmdir,signal,sin,sqrt,stat,unlink,utime +See also: _errnum,perror +@execl +execl (UNIX) Transfer control to a new program +#include +void execl(const char *program,const char *arg0,...,const char *argn,NULL) +See also: execlp,execv,execvp,forktask,system +@execlp +execlp (UNIX) Transfer control to a new program +#include +void execlp(const char *program,const char *arg0,...,const char *argn,NULL) +See also: execl,execv,execvp,forktask,system +@execv +execv (UNIX) Transfer control to a new program +#include +void execv(const char *program,const char *arg[]); +See also: execl,execlp,execvp,forktask,system +@execvp +execvp (UNIX) Transfer control to a new program +#include +void execvp(const char *program,const char *arg[]); +See also: execl,execlp,execv,forktask,system +@exit +exit (ANSI) Terminate a program +#include +void exit(short status); +See also: abort,atexit,csi +@exp +exp (ANSI) Compute exponential function +#include +double exp(double z); +@fabs +fabs (ANSI) Compute absolute value +#include +double fabs(double z); +@farcat +farcat (THEOS) Concatenate strings from different memory segments +#include +void *farcat(unsigned tseg,char *to,unsigned fseg,const char *from); +See also: strcat +@farchr +farchr (THEOS) Locate the first occurence of a byte in a string +#include +void *farchr(unsigned seg,const void *ofs,short c); +See also: memchr,strpbrk,strchr,strrchr,strstr +@farcmp +farcmp (THEOS) Compare two buffers in different memory segments +#include +short farcmp(unsigned seg1,const void *ofs1,unsigned seg2,const void *ofs2, + size_t len); +See also: fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@farcpy +farcpy (THEOS) Copy one buffer to another buffer in another memory segment +#include +short farcpy(unsigned tseg,void *to,unsigned fseg,const void *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strdup,strmake,strncpy +@fareq +fareq (THEOS) Compare two string in different memory segments for equality +#include +short fareq(unsigned seg1,const void *ofs1,unsigned seg2,const void *ofs2); +See also: farcmp,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@farlen +farlen (THEOS) Return the length of a string in another memory segment +#include +size_t farlen(unsigned seg,const char *ofs); +See also: strlen +@farset +farset (THEOS) Initialize a buffer in another memory segment +#include +void *farset(unsigned seg,void *ofs,short c,size_t len); +See also: memset,strnfill,strnset,strset +@fbuf +fbuf (THEOS) Allocate an i/o buffer for an open file +#include +void fbuf(FILE *stream,void *buffer,size_t len); +See also: setbuf,setvbuf,vbuf +@fclear +fclear (+THEOS) Clear a direct,indexed or keyed file +#include <_stdio.h> +short fclear(char *fname); +Set : _errnum +@fclose +fclose (ANSI) Close a file +#include +short fclose(FILE *fp); +Set : _errnum +See also: fcloseall,fflush,flushall +@fcloseall +fcloseall (MSC) Close all the open files +#include +short fcloseall(void); +See also: fclose,fflush,flushall +@fcntl +fcntl (UNIX) Access to file control bloc +#include +short fcntl(FILE *stream,short type,size_t value); +See also: feof,fgetpos,fopen,fsetpos,ftell +@fcreate +fcreate (THEOS) Create an indexed,keyed or direct file +#include +short fcreate(const char *fname,const char *mode,short rlen,short klen,long size); +Set : _errnum +See also: creat,fopen,makelib +@fdopen +fdopen (UNIX) Return a stream pointer to a file opened by open,creat or pipe +#include +FILE *fdopen(short fd,const char *type); +See also: creat,fileno,open,pipe +@feof +feof (ANSI) Determine if a file's current position is at end-of-file +#include +short feof(FILE *fp); +@ferror +ferror (ANSI) Test an open file for its error status +#include +short ferror(FILE *fp); +See also: clearerr,feof,file_err,fperror +@fflush +fflush (ANSI) Write any data in a file's output buffer to the file +#include +short fflush(FILE *fp); +See also: flushall,fclose +@fgetc +fgetc (ANSI) Read one character from a stream +#include +short fgetc(FILE *fp); +Set : errno +See also: fgets,getch,getchar +@fgetl +fgetl (THEOS) Read a long integer from a stream +#include +long fgetl(FILE *fp); +See also: fgetc,fgetw,fputc,fputl,fputw +@fgetpos +fgetpos (ANSI) Get a file's current position pointer +#include +short fgetpos(FILE *fp,fpos_t *pos); +See also: fsetpos,ftell +@fgets +fgets (ANSI) Read a string from a stream up to a new line +#include +char *fgets(char *s,size_t n,FILE *fp); +See also: fgetsn,gets,keyin +@fgetsn +fgetsn (THEOS) Read a buffer from a stream +#include +char *fgetsn(char *s,size_t n,FILE *fp); +See also: fgets,gets,keyin +@fgetw +fgetw (THEOS) Read an integer from a stream +#include +short fgetw(FILE *fp); +See also: fgetc,fgetl,fputc,fputl,fputw +@fgrow +fgrow (THEOS) Set the grow factor of file +#include +short fgrow(FILE *fp,short grow); +See also: filechange +@file_err +file_err (THEOS) Test an open file and exit if error +#include +void file_err(FILE *fp); +See also: clearerr,feof,ferror,fperror,syserr +@filechange +filechange (THEOS) Change a file's directory entry (date,owner,protection...) +#include +short filechange(const char *fn,short type,size_t value); +See also: access,fgrow,utime +@filelength +filelength (+MSC) Return the current filelength +#include <_io.h> +size_t filelength(short fd); +See also: close,creat,flush,lseek,open,_read,read,tell,_write,write +@filelock +filelock (THEOS) Lock a region in a file +#include +short filelock(FILE *fp,short code,unsigned long from,unsigned long to); +See also: locking,reclock,recunlock,unlock +@fileno +fileno (UNIX) Get the file number of a open file +#include +short fileno(FILE *fp); +@find_first +find_first (MSC) Find first entry matching selection in the directory +short find_first(char *mask,void *diskfind); +See also: dirclose,diropen,dirread,find_next +@find_next +find_next (MSC) Find next entry matching selection in the directory +#include <_sc.h> +short find_next(void *diskfind); +See also: dirclose,diropen,dirread,find_first +@floor +floor (ANSI) Return the largest integer less than or equal to a value +#include +double floor(double z); +See also: ceil, round +@flush +flush (THEOS) Write any data in a file's output buffer to the file +#include +short flush(short filenum); +See also: close,creat,filelength,lseek,open,_read,read,tell,_write,write +@flushall +flushall (THEOS) Flush all the files opened for output +#include +short flushall(void); +See also: fflush +@fmod +fmod (ANSI) Return the remainder of a division +#include +double fmod(double x,double y); +@fopen +fopen (ANSI) Open a file +#include +FILE *fopen(const char *name,const char *type); +Set : _errnum +See also: access,freopen +@force +force (THEOS) Force another process to execute a command +#include +void force(short pid,char *cmd); +@fork +fork (UNIX) Spawn a sub-task in a free partition +#include +short fork(void); +See also: forktask,killtask,suicide +@forktask +forktask (UNIX) Spawn a sub-task in a given partition +short forktask(short pid); +See also: fork,killtask,suicide +@formask +formask (THEOS) Display disk format parameters and query +#include +void formask(void); +See also: formclear,formincr,formparm +@formclear +formclear (THEOS) Clear the disk directory +void formclear(struct diskucb *ucb,char *label,short dirct,short trkct, + short hdct,short sectct,short density); +See also: formask,formincr,formparm +@formincr +formincr (THEOS) Set disk format sectors interleave table +void formincr(short incr,short sects,short *lacetable); +See also: formask,formclear,formparm +@formparm +formparm (THEOS) Sets disk format parameters from command line +void formparm(short argc,char **argv); +See also: formask,formclear,formincr +@fperror +fperror (THEOS) Display the system message pointed by _errnum on stderr +#include +short fperror(); +See also: errmsg,file_err,perror,syserr +@fpos_t +fpos_t (ANSI) Used to represent the position in a file +#include +typedef long fpos_t; +@fprintf +fprintf (ANSI) Print formatted output to a stream +#include +short fprintf(FILE *fp,const char *format,...); +See also: cprintf,printf,sprintf,vfprintf,vprintf,vsprintf +@fputc +fputc (ANSI) Write a character to a stream +#include +short fputc(char c,FILE *fp); +Set : errno +See also: putc,putchar +@fputl +fputl (THEOS) Write a character to a stream +#include +long fputl(long l,FILE *fp); +See also: fgetc,fgetl,fgetw,fputc,fputw +@fputs +fputs (ANSI) Write a string to a stream +#include +short fputs(const char *string,FILE *fp); +See also: fputsn,fputsnl,puts +@fputsn +fputsn (THEOS) Write a buffer to a stream +#include +char *fputsn(const char *string,FILE *fp); +See also: fputs,fputsnl,puts +@fputsnl +fputsnl (ANSI) Write a buffer to a stream and append a newline +#include +short fputsnl(const char *string,FILE *fp); +See also: fputs,fputsn,puts +@fputw +fputw (THEOS) Write an integer to a stream +#include +short fputw(short word,FILE *fp); +@fread +fread (ANSI) Read data from file stream +#include +short fread(void *buffer,size_t size,size_t nitems,FILE *fp); +See also: fgets,fgetsn,fgetc,fgetl,fgetw +@free +free (ANSI) Return dynamic memory to free memory pool +#include +void free(void *ptr); +See also: calloc,malloc,realloc +@free_sel +free_sel (THEOS) Release a memory selector +#include +void free_sel(short sel); +See also: make_sel +@freopen +freopen (ANSI) Open a stream using an existing file stream pointer +#include +FILE *freopen(const char *filename,const char *type,FILE *fp); +See also: access,fdopen,fopen +@frexp +frexp (ANSI) Break a floating point into mantissa and exponent power of two +#include +double frexp(double x,short *ep); +See also: ldexp +@fscanf +fscanf (ANSI) Format input from a file stream +#include +short fscanf(FILE *fp,const char *format,...); +See also: scanf,sscanf +@fseek +fseek (ANSI) Change a stream position pointer +#include +short fseek(FILE *fp,fpos_t pos,short base); +See also: fsetpos,rewind,seek +@fsetpos +fsetpos (ANSI) Change a stream position pointer +#include +short fsetpos(FILE *fp,fpos_t pos); +See also: fseek,rewind,seek +@fsign +fsign (THEOS) Return the sign of a floating point value +#include +short fsign(double x); +@ftell +ftell (ANSI) Return current position of stream pointer +#include +long ftell(FILE *fp); +See also: fgetpos +@ftoa +ftoa (THEOS) Convert a floating point value to a string +#include +char *ftoa(char *s,double f); +See also: itoa,ltoa,utoa +@fwrite +fwrite (ANSI) Write data to a stream +#include +short fwrite(const void *buffer,size_t size,size_t n,FILE *fp); +See also: fputc,fputl,fputs,fputsn,fputsnl,fputw,putch +@gcd +gcd (THEOS) Return the greatest common divisor of two values +#include +double gcd(double x,double y); +@get_line +get_line (THEOS) Accept an edited line from the standard input +#include +char *get_line(char *line); +See also: gets +@get_sect +get_sect (THEOS) ??? +#include +struct fdb *get_sect(char *fn,char *buf,long *sect); +@getar +getar (THEOS) Internal function used by malloc +@getbp +getbp (THEOS) Return the value of the BP register +#include +void *getbp(void); +See also: getcs,getcsa,getds,getldt,gettib +@getc +getc (ANSI) Read a character from a stream +See fgetc +@getch +getch (MSC) Read a character from the console +#include +short getch(void); +See also: getc,getchar +@getchar +getchar (ANSI) Read character from the standard input +#include +short getchar(void); +See also: getc,getch +@getclass +getclass (THEOS) Return the console or printer class code +#include +short getclass(short lub); +@getcs +getcs (THEOS) Return the value of the CS register +#include +unsigned getcs(void); +See also: getbp,getcsa,getds,getldt,gettib +@getcsa +getcsa (THEOS) Return the value of the CS register +#include +unsigned getcsa(void); +See also: getbp,getcs,getds,getldt,gettib +@getcwd +getcwd (UNIX) Return the current directory name +#include +char *getcwd(char *s,size_t len); +@getdate +getdate (THEOS) Return the current system date +#include +char *getdate(char *buffer) +See also: gettime,time +@getdev +getdev (THEOS) Return the device or lub number of an open file +#include +short getdev(FILE *fp); +@getdevn +getdevn (+THEOS) Return the device or lub number of a device name +#include <_stdlib.h> +short getdevn(char *name); +@getds +getds (THEOS) Return the value of the DS register +#include +unsigned getds(void); +See also: getbp,getcs,getcsa,getldt,gettib +@getenv +getenv (ANSI) Read environmental variable +#include +char *getenv(const char *variable); +See also: getcwd,getlang,getlib,putenv +@getenvle +getenvle (THEOS) Internal function used by putenv +@getflag +getflag (THEOS) Get processor flag register +#include +long getflag(void); +@getfn +getfn (THEOS) Return the full pathname of a file +#include +char *getfn(char *fn); +See also: locate +@getkey +getkey (THEOS) Get a system keyword token +#include +short getkey(short keynum,char *s); +See also: keyclose,matcharg +@getlang +getlang (THEOS) Return the current language code for the partition +#include +short getlang(void); +See also: getenv +@getldt +getldt (THEOS) Return the Local Descriptor Table selector +#include +unsigned getldt(void); +See also: getbp,getcs,getcsa,getds,gettib +@getlib +getlib (THEOS) Return the default library name for the partition +#include +char *getlib(void); +See also: getcwd,getenv +@getlimit +getlimit (THEOS) Return the maximum address of a memory segment +#include +size_t getlimit(unsigned seg); +See also: getmem +@getll +getll (THEOS) Return the line length of the console or a printer +#include +short getll(short lub); +See also: getpl +@getlogin +getlogin (UNIX) Return the name of the account currently logged +#include +char *getlogin(void); +See also: cuserid,getuid,logname +@getlub +getlub (THEOS) Return the ucb number associated with a logical device +#include +short getlub(short lub); +See also: getucb +@getmem +getmem (THEOS) Allocate memory from the system pool +#include +unsigned getmem(size_t size,short table); +See also: calloc,malloc,putmem,shared +@getmsec +getmsec (THEOS) Return the current time of day to the nearest millisecond +#include +char *getmsec(char *s); +See also: gettime,ctime,time +@getmsg +getmsg (THEOS) Return a system message +#include +char *getmsg(short num); +Set : _errnum +See also: errbot,errmsg,putmsg,strerror,syserr +@getmsw +getmsw (THEOS) Get Machine Status Word +#include +long getmsw(void); +@getpid +getpid (UNIX) Return the process number +#include +short getpid(void); +See also: getppid +@getpl +getpl (THEOS) Return the page length of the console or a printer +#include +short getpl(short lub); +See also: getll +@getppid +getppid (UNIX) Return the parent partition number +#include +short getppid(void); +See also: getpid +@getpriv +getpriv (THEOS) Return the privilege level +#include +short getpriv(void); +@getprty +getprty (+THEOS) Return task priority +#include <_stdlib.h> +short getprty(); +See also: setprty +@getrxcnt +getrxcnt (+THEOS) Return the number of characters in the input buffer +#include +short getrxcnt(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,isrxempty,istxfull +@gets +gets (ANSI) Read string from the standard input +#include +char *gets(char *buffer); +See also: fgets,fgetsn,get_line,keyin +@gettib +gettib (THEOS) Return the Task Information Block selector +#include +unsigned gettib(void); +See also: getbp,getcs,getcsa,getds,getldt,tib +@gettime +gettime (THEOS) Return the current system time +#include +char *gettime(char *buffer); +See also: getdate,time +@getucb +getucb (THEOS) Return the address of the UCB associated with an attached device +#include +struct ucb *getucb(short lub); +See also: getlub +@getuid +getuid (UNIX) Return the number of the account currently logged +#include +short getuid(void); +See also: getlogin +@getver +getver (THEOS) Return the version number,name,serial number +#include +void getver(short code,char *str); +See also: getenv +@getvol +getvol (THEOS) Return a disk or tape volume label +#include +char *getvol(short lub); +@getw +getw (ANSI) Read a word from a file stream +See fgetw +@gmtime +gmtime (ANSI) Convert system time to calendar structure in GMT time +#include +struct tm *gmtime(const time_t *timep); +See also: asctime,ctime,localtime,mktime,strftime,time +@has +has (THEOS) Test if the console can display a character or an attribute +#include +short has(short c); +See also: hascolor +@hascolor +hascolor (THEOS) Test if the console can display colors +#include +short hascolor(void); +See also: crtcolor,has +@hasmouse +hasmouse (+THEOS) Test if a session mouse is available +#include +int hasmouse(void); +See also: mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@hypot +hypot (UNIX) Compute the length of the hypotenuse of a right triangle +#include +double hypot(double x,double y); +@i2tol +i2tol (THEOS) Convert two integers to a long integer +long i2tol(short i[2]); +Note: Not implemented in THEOS 386 C. +@ieee2bcd +ieee2bcd (THEOS) Convert an ieee floating point to bcd floating point +#include +void ieee2bcd(double *data) +See also: bcd2ieee +@if +#if (ANSI) Include code conditionally +#if (expression); +@ifdef +#ifdef (ANSI) Include code conditionally +#ifdef identifier +@ifndef +#ifndef (ANSI) Include code conditionally +#ifndef identifier +@inb +inb (THEOS) Read a byte from a i/o port +#include +unsigned inb(unsigned port); +See also: ind,insb,insd,insw,inw +@include +#include (ANSI) Copy a header file into a program +#include +#include "file.h" +@ind +ind (THEOS) Read a long from a i/o port +#include +unsigned long ind(unsigned port); +See also: inb,insb,insd,insw,inw +@insb +insb (THEOS) Read bytes from a i/o port +#include +void insb(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insd,insw,inw +@interrupt +interrupt (THEOS) Interrupt function declarator +void interrupt isr(void); +@insd +insd (THEOS) Read longs from a i/o port +#include +void insd(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insb,insw,inw +@insw +insw (THEOS) Read words from a i/o port +#include +void insw(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insb,insd,inw +@inw +inw (THEOS) Read a word on a i/o port +#include +unsigned inw(unsigned port); +See also: ind,insb,insd,insw,inw +@ioctl +ioctl (UNIX) Perform extended I/O control on devices +#include +short ioctl(FILE *fp,struct bytecntl *action); +short ioctl(FILE *fp,struct diskcntl *action); +short ioctl(FILE *fp,struct tapecntl *action); +@ip +ip (THEOS) Return the integral part of a value +#include +double ip(double x); +See also: modf +@inc +inc (THEOS) Increment a byte in another memory segment +#include +void inc(void *ofs,unsigned seg); +See also: Other inc functions +@inccs +inccs (THEOS) Increment a byte in the code segment +#include +void inccs(void *ofs); +See also: Other inc functions +@inccsl +inccsl (THEOS) Increment a long in the code segment +#include +void inccsl(void *ofs); +See also: Other inc functions +@inccsw +inccsw (THEOS) Increment a word in the code segment +#include +void inccsw(void *ofs); +See also: Other inc functions +@incl +incl (THEOS) Increment a long in another memory segment +#include +void incl(void *ofs,unsigned seg); +See also: Other inc functions +@incw +incw (THEOS) Increment a word in another memory segment +#include +void incw(void *ofs,unsigned seg); +See also: Other inc functions +@isalnum +isalnum (ANSI) Check if a character is a number or letter +#include +short isalnum(short c); +See also: setlocale +@isalpha +isalpha (ANSI) Check if a character is a letter +#include +short isalpha(short c); +See also: setlocale +@isascii +isascii (UNIX) Check if a character is an ASCII character +#include +short isascii(short c); +See also: setlocale +@isatty +isatty (UNIX) Check if an open file is a serial communication device +#include +short isatty(FILE *stream); +@iscntrl +iscntrl (ANSI) Check if a character is a control character +#include +short iscntrl(short c); +@iscomname +iscomname (+THEOS) Test if a file name is a valid com port name +#include <_stdlib.h> +short iscomname(char *filename); +@iscon +iscon (THEOS) Check if an open file is the console +#include +short iscon(FILE *stream); +@iscsym +iscsym (THEOS) Test if a character is alphabetic or an underscore +#include +short iscsym(short c); +See also: iscsymnum +@iscsymnum +iscsymnum (THEOS) Test if a character is alphanumeric or an underscore +#include +short iscsymnum(short c); +See also: iscsym +@isdigit +isdigit (ANSI) Check if a character is a decimal diqit +#include +short isdigit(short c); +@isdisp +isdisp (THEOS) Check if a character is displayable by most terminal +#include +short isdisp(short c); +See also: isgraph,isprint +@isfnsym +isfnsym (THEOS) Check if a character is valid for a file name +#include +short isfnsym(short c); +See also: issymbol,issymnum +@isgraph +isgraph (ANSI) Check if a character is visible when printed +#include +short isgraph(short c); +See also: setlocale +@ishex +ishex (THEOS) Check if a character is a hexadecimal digit +#include +short ishex(short c); +See also: isxdigit +@isinter +isinter (+THEOS) Check if a character is an international character +#include +short isinter(short c); +See also: isalpha +@islower +islower (ANSI) Check if a character is a lower-case letter +#include +short islower(short c); +See also: setlocale +@isoctal +isoctal (THEOS) Check if a character is an octal digit +#include +short isoctal(short c); +@isprint +isprint (ANSI) Check if a character is visible or is a space +#include +short isprint(short c); +See also: setlocale +@isprtname +isprtname (+THEOS) Test if a file name is a valid printer name +#include <_stdlib.h> +short isprtname(char *filename); +@ispunct +ispunct (ANSI) Check if a character is a punctuation mark +#include +short ispunct(short c); +See also: setlocale +@isrxempty +isrxempty (+THEOS) Test if an input buffer is empty +#include +short isrxempty(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,istxfull +@issesdev +issesdev (+THEOS) Test if a device is session capable +#include <_stdlib.h> +short issesdev(FILE *fp); +@isspace +isspace (ANSI) Check if a character prints white space +#include +short isspace(short c); +@issymbol +issymbol (THEOS) Check if a character is a valid first character for a file name +#include +short issymbol(short c); +See also: issymnum +@issymnum +issymnum (THEOS) Check if a character is a valid character for a symbol +#include +short issymnum(short c); +See also: issymbol +@istapname +istapname (+THEOS) Test if a file name is a valid tape name +#include <_stdlib.h> +short istapname(char *filename); +@istxfull +istxfull (+THEOS) Test if an input buffer is empty +#include +short istxfull(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,istxfull +@isupper +isupper (ANSI) Check if a character is an upper-case letter +#include +short isupper(short c); +See also: setlocale +@isv86 +isv86 (THEOS) Test if a process is running in Virtual 86 mode +short isv86(short pid); +@isxdigit +isxdigit (ANSI) Check if a charcter is an hexadecimal digit +#include +short isxdigit(short c); +See also: ishex +@itoa +itoa (THEOS) Convert an integer into an ASCII string +#include +char *itoa(char *s,short i); +See also: ftoa,ltoa,utoa +@keyclose +keyclose (THEOS) Close the keyword file used with getkey +#include +void keyclose(void); +See also: getkey,testarg +@keyin +keyin (THEOS) See cgets +@killtask +killtask (THEOS) Kill a subtask +#include +void killtask(short pid); +See also: fork,forktask,suicide +@l3tol +l3tol (UNIX) Convert three bytes integers to longs integers +#include +void l3tol(long *l,const char *c,short cnt); +See also: c3tol,ltoc3,ltol3 +@l64a +l64a (UNIX) Convert a long integer to a base-64 ASCII string +#include +char *l64a(long x); +See also: a64l +@labs +labs (ANSI) Return the absolute value of an long integer +#include +long labs(long l); +See also: abs,fabs +@ldeletek +ldeletek (THEOS) Delete a record from a direct access file +#include +short ldeletek(FILE *fp,const long *key); +See also: lreadk,lreadn,lwritek +@ldexp +ldexp (ANSI) Combine fraction and exponent +#include +double ldexp(double x,short exp); +See also: frexp +@ldiv +ldiv (ANSI) Return the quotient and remainder of the division of two longs +#include +ldiv_t ldiv(long numer,long denom) +@ldiv_t +ldiv_t (ANSI) used by ldiv +#include +typedef struct {long quot,rem;} ldiv_t; +See also: div +@leapyear +leapyear (THEOS) Indicate if a year is a leap year +#include +short leapyear(short year); +See also: _monthen,_yday +@lfind +lfind (MSC) Perform a linear search of an array +#include +void *lfind(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,lsearch,qsort +@line +#line (ANSI) Reset line numbering +#line number +#line number filename +@linput +linput (+THEOS) Accept a data field from the keyboard like BASIC LINPUT +#include <_stdlib.h> +short linput(char *case,char *before_msg,char *after_msg,char *input_var, + char *output_var,short length,short timeout,short timeout_key); +@load +load (THEOS) Load a program into memory +#include +unsigned load(const char *program,short type); +See also: unload +@load_yn +load_yn (THEOS) Initialise the yesno function +#include +void load_yn(void); +See also: yesno +@loc1 +loc1 (THEOS) Reserved variable for regex +#include +extern char *loc1; +@localtime +localtime (ANSI) Convert system time to calendar structure +#include +struct tm *localtime(time_t *timep); +See also: asctime,ctime,gmtime,mktime,strftime,time +@locate +locate (THEOS) Find a file on disk and return a copy of its FDB +#include +struct fdb *locate(const char *filename,char *buf,short *lub); +See also: getfn +@lock_time +lock_time (THEOS) Set the maximum lock time wait +#include <_stdlib.h> +void lock_time(unsigned char seconds); +See also: timeout +@locking +locking (MSC) Lock or unlock a record in a file +#include +short locking(FILE *fp,short mode,long size); +Set : errno +See also: filelock,reclock,recunlock,unlock +@lockres +lockres (THEOS) "Unlock" a byte in memory +#include +void lockres(void *ofs,unsigned seg); +See also: lockset +@lockset +lockset (THEOS) "Lock" a byte in memory +#include +void lockset(void *ofs,unsigned seg); +See also: lockres +@log +log (ANSI) Compute natural logarithm +#include +double log(double z); +Set : errno +See also: log10,log2 +@log10 +log10 (ANSI) Compute common logarithm +#include +double log10(double z); +Set : errno +See also: log,log2 +@log2 +log2 (THEOS) Compute base 2 logarithm +#include +double log2(double z); +Set : errno +See also: log,log10 +@logname +logname (UNIX) Return the account name currently logged +#include +char *logname(void); +See also: cuserid,getlogin,getuid +@longjmp +longjmp (ANSI) Return from a non-local goto +#include +short longjmp(jmp_buf env,short rval); +See also: setjmp +@lowcase +lowcase (THEOS) See strlwr +@lprime +lprime (+THEOS) Compute the smallest prime greater than or equal to a number +#include <_stdlib.h> +unsigned long lprime(unsigned long n); +See also: prime +@lreadk +lreadk (THEOS) Read a record from a direct access file +#include +short lreadk(FILE *fp,const long *key,void *rec); +See also: ldeletek,lreadn,lwritek +@lreadn +lreadn (THEOS) Read the next record from a direct access file +#include +short lreadn(FILE *fp,long *key,void *rec); +See also: ldeletek,lreadk,lwritek +@lsearch +lsearch (UNIX) Perform a linear search of an array,insert key if non existent +#include +void *lsearch(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,lfind,qsort +@lseek +lseek (UNIX) Set read/write position +#include +long lseek(short fd,short how,long where); +See also: close,creat,filelength,flush,open,_read,read,tell,_write,write +@ltoa +ltoa (THEOS) Convert an long integer into an ASCII string +#include +char *ltoa(char *s,short l); +See also: ftoa,itoa,utoa +@ltoc3 +ltoc3 (THEOS) Convert a long integer to a three byte integer +#include +long ltoc3(void *c,long l); +See also: c3tol,l3tol,ltol3 +@ltol3 +ltol3 (UNIX) Convert long integers to three byte integers +#include +long ltol3(void *c,const long *l,short cnt); +See also: c3tol,l3tol,ltoc3 +@lwritek +lwritek (THEOS) Write a record to a direct access file +#include +short lwritek(FILE *fp,const long *key,const void *rec); +See also: ldeletek,lreadk,lreadn +@make_sel +make_sel (THEOS) Create a memory selector +#include +void make_sel(short sel,size_t limit,unsigned long base,short int); +See also: free_sel +@makelib +makelib (THEOS) Create a library file +#include +unsigned makelib(const char *filename,short size); +See also: fcreate +@malloc +malloc (ANSI) Allocate dynamic memory +#include +char *malloc(size_t size); +@match +match (THEOS) Compare a string against a format mask +#include +short match(const char *string,const char *mask); +See also: strcmp,streq +@mapdoskey +mapdoskey (+THEOS) Convert THEOS keycodes to PC keycodes +#include +#include +unsigned short mapdoskey(unsigned short key); +See also: _bios_keybrd +@matcharg +matcharg (THEOS) Compare one string with another with abbreviation capability +#include +short matcharg(const char *string,const char *keyword,short min); +See also: strcmp,streq,strncmp,testarg +@max +max (UNIX) Return the larger of two integers +#include +short max(short a,short b); +@max_alloc +max_alloc (THEOS) Return the size of the larger memory bloc available +#include +size_t max_alloc(void); +See also: calloc,free,malloc,realloc,tot_alloc +@mem_grow +mem_grow (THEOS) ??? +#include +short mem_grow(short seg,long adjust); +@mem_ovly +mem_ovly (THEOS) Adjust the size of the data used by the program +#include +void mem_ovly(size_t size); +@memccpy +memccpy (UNIX) Copy a buffer into another for 'n' bytes or up to a character +#include +void *memcpy(void *to,const void *from,short c,size_t len); +See also: farcpy,memcpy,memmove,memrcpy,strcpy,strdup,strmake,strncpy +@memchr +memchr (ANSI) Locate the first occurrence of a byte in a buffer +#include +void *memchr(const void *buffer,unsigned character,size_t len); +See also: farchr,strpbrk,strchr,strrchr,strstr +@memcmp +memcmp (ANSI) Compare two buffers +#include +short memcmp(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@memcpy +memcpy (ANSI) Copy one buffer into another +#include +void *memcpy(void *to,const void *from,size_t len); +See also: farcpy,memccpy,memmove,memrcpy,strcpy,strdup,strmake,strncpy +@memeq +memeq (THEOS) Compare two buffers for equality +#include +short memeq(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memcmp,memicmp,strcmp,streq,stricmp,strncmp,strnicmp, + strneq +@memicmp +memicmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short memicmp(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memcmp,memeq,strcmp,streq,stricmp,strncmp,strneq,strnicmp +@memmove +memmove (ANSI) Copy one buffer into another with correct handling of overlapping +void *memmove(void *to,const void *from,size_t len); +See also: farcpy,memcpy,memccpy,memrcpy,strcpy,strdup,strmake,strncpy +@memrcpy +memrcpy (THEOS) Copy one buffer into another in reverse sequence +#include +void *memrcpy(void *to,const void *from,size_t len); +See also: farcpy,memcpy,memccpy,memmove,strcpy,strdup,strmake,strncpy +@memset +memset (ANSI) Fill a buffer with a character +#include +void *memset(char *buffer,short character,size_t len); +See also: farset,strnfill,strset,strnset +@menu +menu (THEOS) Display a menu and wait for a selection +#include +short menu(const char **menu,short count); +See also: menu2 +@menu2 +menu2 (THEOS) Display a menu and wait for a selection +#include +short menu2(const char **menu,short count,short start,short display); +See also: menu +@menumsg +menumsg (+THEOS) Display a menu line a wait for a selection +#include <_stdlib.h> +short menumsg(char *msg,char *key,short timeout,short timeout_key); +@min +min (UNIX) Return the smaller of two integers +#include +short min(short a,short b); +@mkdir +mkdir (MSC) Create a directory +#include +short mkdir(const char *filename); +Set : errno,_errnum +See also: chdir,rmdir +@mktemp +mktemp (UNIX) Generate a temporary file name +#include +char *mktemp(const char *template); +See also: tmpnam,tmpfile,tmpnam +@mktime +mktime (MSC) Convert a time structure into a calendar time +#include +time_t mktime(struct tm *timeptr) +See also: asctime,ctime,gmtime,localtime,strftime,time +@modf +modf (ANSI) Separate integral and fractional part +#include +double modf(double x,double *ip); +See also: ip +@mouse +mouse (+THEOS) Compute mouse position and buttons for subsequent use +#include +short mouse(void); +See also: hasmouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousebutton +mousebutton (+THEOS) Return mouse buttons state +#include +short mousebutton(void); +See also: hasmouse, mouse, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mouseclick +mouseclick (+THEOS) Set mouse click and dclick delay +#include +void mouseclick(long click); +See also: hasmouse, mouse, mousebutton, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousedisable +mousedisable (+THEOS) Disable the mouse +#include +void mousedisable(void); +See also: hasmouse, mouse, mousebutton, mouseclick, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mouseenable +mouseenable (+THEOS) Initialise and enable the mouse +#include +void mouseenable(void); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousemove +mousemove (+THEOS) Move the mouse pointer +#include +void mousemove(short col, short row); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousescale, mouseswap, mousetell, mousexy +@mousescale +mousescale (+THEOS) Set mouse sensitivity +#include +void mousescale(short scale); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mouseswap, mousetell, mousexy +@mouseswap +mouseswap (+THEOS) Swap mouse left and right buttons +#include +void mouseswap(short flag); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mousetell, mousexy +@mousetell +mousetell (+THEOS) Read mouse swap flag and sensitivity +#include +void mousetell(long *click, short *scale); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousexy +@mousexy +mousexy (+THEOS) Read mouse position +#include +void mousexy(short *col, short *row); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell +@move +move (THEOS) Copy one buffer to another buffer in another memory segment +Obsolete function,use farcpy +@msalarm +msalarm (THEOS) Start a timer in milli seconds generating a signal interrupt +#include +long msalarm(long msecs); +See also: delay,alarm,signal +@msgclose +msgclose (THEOS) Close the system message file +#include +void msgclose(void); +See also: getmsg +@no_val +no_val (THEOS) Value of no answer +extern char yes_val; +@NULL +NULL (ANSI) Nul pointer type +#include +#define NULL ((void *)0) +@offsetof +offsetof (ANSI) Offset between the beginning of a structure and a member +#include +offsetof(nom_de_structure,nom_de_membre) +@open +open (UNIX) Open a file +#include +short open(const char *filename,short type,...); +Set : errno,_errnum +See also: close,creat,filelength,flush,lseek,_read,read,tell,_write,write +@opendir +opendir (+UNIX) Open a directory +#include +DIR* opendir(const char* fname); +See also: readdir,closedir,seekdir,telldir,rewinddir +Set : errno +@openhelp +openhelp (THEOS) Open the help file for a program +#include +FILE *openhelp(const char *name); +See also: fopen +@openmenu +openmenu (THEOS) Open the menu file for a program +#include +FILE *openmenu(const char *name); +See also: fopen +@orb +orb (THEOS) Or a byte in another memory segment +#include +void orb(void *ofs,unsigned seg,char mask); +See also: Other or functions +@orcs +orcs (THEOS) Or a byte in the code segment +#include +void orcs(void *ofs,char mask); +See also: Other or functions +@orl +orl (THEOS) Or a long in another memory segment +#include +void orl(void *ofs,unsigned seg,long mask); +See also: Other or functions +@orlcs +orlcs (THEOS) Or a long in the code segment +#include +void orlcs(void *ofs,long mask); +See also: Other or functions +@orw +orw (THEOS) Or a word in another memory segment +#include +void orw(void *ofs,unsigned seg,short mask); +See also: Other or functions +@orwcs +orwcs (THEOS) Or a word in the code segment +#include +void orwcs(void *ofs,short mask); +See also: Other or functions +@outb +outb (THEOS) Write a byte into an i/o port +#include +void outb(unsigned port,char byte); +See also: outd,outsb,outsd,outsw,outw +@outd +outd (THEOS) Write a long into an i/o port +#include +void outd(unsigned port,unsigned long dword); +See also: outb,outsb,outsd,outsw,outw +@outsb +outsb (THEOS) Write bytes into an i/o port +#include +void outsb(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsd,outsw,outw +@outsd +outsd (THEOS) Write longs into an i/o port +#include +void outsd(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsb,outsw,outw +@outsw +outsw (THEOS) Write words into an i/o port +#include +void outsw(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsb,outsd,outw +@outw +outw (THEOS) Write a word into an i/o port +#include +void outw(unsigned port,unsigned word); +See also: outb,outd,outsb,outsd,outsw +@pagewait +pagewait (THEOS) Display the wait prompt and wait the a key +#include +short pagewait(void); +See also: getpl +@pause +pause (THEOS) Wait a state change on ii/o port 61 +void pause(char count); +@pcbsc +pcbsc (THEOS) Read or write char or words in the PCB of any process +#include <_sc.h> +long pcbsc(short type,void *ofs,void *arg); +Le premier PCB commence en PCBSTART,les PCB suivant sont cons�cutifs. Le +dernier PCB est suivi par un entier � 0xFFFF. Tout acc�s � une adresse plus +�lev�e entraine un TRAP #13. + +type = 1 : lit un octet type = 2 : lit un mot de 16 bits +type = 0x8001 : �crit un octet type = 0x8002 : �crit un mot de 16 bits + +ofs pointe � l'int�rieur de la table des PCB +arg valeur � �crire si type = 0x8001 ou 0x8002 + +Lecture de l'�tat du PID 0 : status = pcbsc(1,PCBSTART,(void *) 0); +Lecture de la version de l'OS : ver = pcbsc(-1,-1,-1); +@peek +peek (THEOS) Return a byte from another memory segment +#include +unsigned peek(const void *ofs,unsigned seg); +See also: Other peek functions +@peekchar +peekchar (THEOS) ??? +#include <_sc.h> +void peekchar(short pid,short type); +@peekcs +peekcs (THEOS) Return a byte from the code segment +#include +unsigned peekcs(const void *ofs); +See also: Other peek functions +@peekfsa +peekfsa (THEOS) ??? +#include <_sc.h> +short peekfsa(void *ofs); +@peekl +peekl (THEOS) Return a long from another memory segment +#include +unsigned long peekl(const void *ofs,unsigned seg); +See also: Other peek functions +@peeklcs +peeklcs (THEOS) Return a long from the code segment +#include +unsigned long peeklcs(const void *ofs); +See also: Other peek functions +@peeklnuc +peeklnuc (THEOS) Return a long from the nucleus segment +#include +unsigned long peeklnuc(const void *ofs); +See also: Other peek functions +@peeklscr +peeklscr (THEOS) Return a long from the SCR segment +#include +unsigned long peeklscr(const void *ofs); +See also: Other peek functions +@peeknuc +peeknuc (THEOS) Return a byte from the nucleus segment +#include +unsigned peeknuc(const void *ofs); +See also: Other peek functions +@peekp +peekp (THEOS) Return a pointer from another memory segment +#include +void *peekp(const void *ofs,unsigned seg); +See also: Other peek functions +@peekpcs +peekpcs (THEOS) Return a pointer from the code segment +#include +void *peekpcs(const void *ofs); +See also: Other peek functions +@peekpnuc +peekpnuc (THEOS) Return a pointer from the nucleus segment +#include +void *peekpnuc(const void *ofs); +See also: Other peek functions +@peekpscr +peekpscr (THEOS) Return a pointer from the SCR segment +#include +void *peekpscr(const void *ofs); +See also: Other peek functions +@peekscr +peekscr (THEOS) Return a byte from the SCR segment +#include +unsigned peekscr(const void *ofs); +See also: Other peek functions +@peektib +peektib (THEOS) Get bytes in the TIB or RCR of any process +#include <_sc.h> +long peektib(short pid,void *ofs); +L'adressage du scr peut �tre indiqu� en ajoutant 0x8000 � l'offset +dans le scr. Ainsi : +peektib(pid,0x8000) �quivaut � peektib(pid,&TIB->scr.logonname[0]) +@peekw +peekw (THEOS) Return a word from another memory segment +#include +unsigned peekw(const void *ofs,unsigned seg); +See also: Other peek functions +@peekwcs +peekwcs (THEOS) Return a word from the code segment +#include +unsigned peekwcs(const void *ofs); +See also: Other peek functions +@peekwnuc +peekwnuc (THEOS) Return a word from the nucleus segment +#include +unsigned peekwnuc(const void *ofs); +See also: Other peek functions +@peekwscr +peekwscr (THEOS) Return a word from the SCR segment +#include +unsigned peekwscr(const void *ofs); +See also: Other peek functions +@perror +perror (ANSI) Display a program defined message with a message pointed by errno +#include +void perror(const char *string); +Set : errno +See also: errmsg,fperror,getmsg,strerror,syserr +@phy_addr +phy_addr (THEOS) Determine physical address of memory selector,lock and unlock +#include +unsigned long phy_addr(unsigned seg,void *offset,size_t len); +See also: getmem,putmem +@pipe +pipe (UNIX) Open an interprocess i/o channel +#include +short pipe(short filenum[2]); +See also: popen +@poke +poke (THEOS) Put a byte into another memory segment +#include +void poke(char val,void *ofs,unsigned seg); +See also: Other poke functions +@pokecs +pokecs (THEOS) Put a byte into the code segment +#include +void pokecs(char val,void *ofs); +See also: Other poke functions +@pokecsa +pokecsa (THEOS) Put a byte into the code segment +#include +void pokecsa(char val,void *ofs); +See also: Other poke functions +@pokel +pokel (THEOS) Put a long into another memory segment +#include +void pokel(long val,void *ofs,unsigned seg); +See also: Other poke functions +@pokelcs +pokelcs (THEOS) Put a long into the code segment +#include +void pokelcs(long val,void *ofs); +See also: Other poke functions +@pokelcsa +pokelcsa (THEOS) Put a long into the code segment +#include +void pokelcsa(long val,void *ofs); +See also: Other poke functions +@pokelscr +pokelscr (THEOS) Put a long into the SCR segment +#include +void pokelscr(long val,void *ofs); +See also: Other poke functions +@pokenuc +pokenuc (THEOS) Put a byte into the nucleus segment +#include +void pokenuc(short val,void *ofs); +See also: Other poke functions +@pokep +pokep (THEOS) Put a pointer into another memory segment +#include +void pokep(void *val,void *ofs,unsigned seg); +See also: Other poke functions +@pokepcs +pokepcs (THEOS) Put a pointer into the code segment +#include +void pokepcs(void *val,void *ofs); +See also: Other poke functions +@pokepcsa +pokepcsa (THEOS) Put a pointer into the code segment +#include +void pokepcsa(void *val,void *ofs); +See also: Other poke functions +@pokepscr +pokepscr (THEOS) Put a pointer into the SCR segment +#include +void pokepscr(void *val,void *ofs); +See also: Other poke functions +@pokescr +pokescr (THEOS) Put a byte into the SCR segment +#include +void pokescr(char val,void *ofs); +See also: Other poke functions +@pokeucb +pokeucb (THEOS) Put a byte into the UCB segment +#include +void pokeucb(short val,void *ofs); +See also: Other poke functions +@pokew +pokew (THEOS) Put a word into another memory segment +#include +void pokew(short val,void *ofs,unsigned seg); +See also: Other poke functions +@pokewcs +pokewcs (THEOS) Put a word into the code segment +#include +void pokewcs(short val,void *ofs); +See also: Other poke functions +@pokewcsa +pokewcsa (THEOS) Put a word into the code segment +#include +void pokewcsa(short val,void *ofs); +See also: Other poke functions +@pokewnuc +pokewnuc (THEOS) Put a word into the nucleus segment +#include +void pokewnuc(short val,void *ofs); +See also: Other poke functions +@pokewscr +pokewscr (THEOS) Put a word into the SCR segment +#include +void pokewscr(short val,void *ofs); +See also: Other poke functions +@pokewucb +pokewucb (THEOS) Put a word into the UCB segment +#include +void pokewucb(short val,void *ofs); +See also: Other poke functions +@popen +popen (UNIX) Open an interprocess i/o channel +#include +short popen(FILE **rd_pipe,FILE **wr_pipe); +See also: pipe +@popf +popf (THEOS) Pop flag register +#include +void popf(void); +See also: pushf +@pow +pow (ANSI) Compute a power of a number +#include +double pow(double z,double x); +Set : errno +@pragma +#pragma Sets compiler options +#pragma align 1 | 2 (default) | 4 +#pragma align struct | -struct (default) +#pragma char signed (default) | unsigned +#pragma field char | word (default) +#pragma float bcd | ieee (default) +#pragma float float (default) | double +#pragma int short (default) | long +#pragma library +#pragma prog version,priv[,mfg,serial][,"copyright"][,patchsize] +#pragma shift logical (default) | arithmetic +@pre_empt +pre_empt (THEOS) ??? +#include +void pre_empt(void); +@prime +prime (THEOS) Compute the smallest prime greater than or equal to a number +#include +unsigned prime(unsigned n); +See also: lprime +@printf +printf (ANSI) Format output +#include +short printf(const char *format,...); +See also: cprintf,fprintf,sprintf,vfprintf,vprintf,vsprintf +@pushf +pushf (THEOS) Push flag register +#include +void pushf(void); +@ptrdiff_t +ptrdiff_t (ANSI) Result type of the substraction of two pointers +#include +typedef long ptrdiff_t; +@putc +putc (ANSI) Write a character to a stream +#include +short putc(char c,FILE *fp); +See also: fputc,putchar +@putch +putch (MSC) Write a character to the console +#include +short putch(short c); +See also: fputc,putc,putchar +@putchar +putchar (ANSI) Write a character to standard output +#include +short putchar(short c); +@putenv +putenv (MSC) Set an environment variable +#include +short putenv(const char *s); +See also: getenv +@putmem +putmem (THEOS) Release memory allocated by getmem +#include +void putmem(unsigned seg); +See also: getmem +@putmsg +putmsg (THEOS) Display a message with parameter substitution +#include +void putmsg(const char *text,const char *arg[]); +See also: errbot,errmsg,getmsg,perror,syserr +@puts +puts (ANSI) Write a string to standard output +#include +void puts(const char *string); +See also: cputs,fputs +@putw +putw (ANSI) Write a word to a stream +#include +short putw(short word,FILE *fp); +See also: getw,fgetw,fputw +@qsort +qsort (ANSI) Sort arrays in memory +void qsort(const void **array,size_t nbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,sort +@quitoff +quitoff (THEOS) Mask the system quit key +#include +void quitoff(void); +See also: quiton +@quiton +quiton (THEOS) Re-enable the system quit key +#include +void quiton(void); +See also: quitoff +@raise +raise (ANSI) Force a signal interrupt +#include +short raise(short sig); +See also: signal +@rand +rand (ANSI) Generate pseudo-random numbers +#include +short rand(void); +See also: srand +@rbrk +rbrk (THEOS) Internal function +@read +read (ANSI) Read data from a file +#include +short read(short fd,void *buffer,size_t n); +See also: close,creat,filelength,flush,lseek,open,_read,tell,_write,write +@readdir +readdir (+UNIX) Read a directory entry +#include +struct dirent* readdir(DIR*); +See also: opendir,closedir,seekdir,telldir,rewinddir +Set : errno +@readk +readk (THEOS) Read a record from an indexed or keyed file +#include +short readk(FILE *fp,const char *key,void *rec); +See also: deletek,readn,readp,writek +@readn +readn (THEOS) Read next record from an indexed or keyed file +#include +short readn(FILE *fp,char *key,void *rec); +See also: deletek,readk,readp,writek +@readp +readp (THEOS) Read previous record from an indexed or keyed file +#include +short readp(FILE *fp,char *key,void *rec); +See also: deletek,readk,readn,writek +@realloc +realloc (ANSI) Reallocate dynamic memory +#include +char *realloc(void *ptr,size_t size); +See also: calloc,free,malloc,max_alloc,tot_alloc +@reclock +reclock (THEOS) Try to lock a record in a file stream or direct file +#include +short reclock(FILE *fp,fpos_t pos); +See also: filelock,locking,recunlock,unlock +@recunlock +recunlock (THEOS) Try to lock a record in a file stream or direct file +#include +short recunlock(FILE *fp,fpos_t pos); +See also: filelock,locking,reclock,unlock +@regcmp +regcmp (UNIX) Compile a search pattern to be used by the regex search function +#include +char *regcmp(char *pattern,...); +See also: regex,strchr,strstr +@regex +regex (UNIX) Perform a search on a string using a pattern compiled by regcmp +#include +char *regex(char *cpattern,char *object,...); +See also: regcmp,strchr,strstr +@remote +remote (THEOS) Call a function in another code segment +#include +remote(unsigned ofs,unsigned seg,...); +@remove +remove (ANSI) Erase a file +#include +short remove(const char *filename); +Set : errno,_errnum +See also: unlink +@rename +rename (ANSI) Change the name of a file +#include +short rename(const char *old,const char *new); +Set : errno,_errnum +@rewind +rewind (ANSI) Reset file pointer +#include +short rewind(FILE *fp); +See also: fseek,fsetpos,seek +@rewinddir +rewinddir (+UNIX) Sets the directory entry location to the beginning +#include +void rewinddir(DIR*); +See also: opendir,closedir,readdir,telldir,seekdir +@rmdir +rmdir (MSC) Removes a directory +#include +short rmdir(const char*dirname); +Set : errno,_errnum +See also: remove,unlink +@round +round (+THEOS) Round a value to the nearest integer +#include <_math.h> +double round(double value, int position) +See also: ceil, floor +@rsema +rsema (THEOS) Return the status of a remote semaphore +#include +short rsema(short pid,short sema_nbr); +See also: rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemaname +rsemaname (THEOS) Return the number of a remote semaphore +#include +short rsemaname(short pid,char *name); +See also: rsema,rsemares,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemares +rsemares (THEOS) Reset a remote semaphore +#include +short rsemares(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemaset +rsemaset (THEOS) Set a remote semaphore +#include +short rsemaset(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemawait +rsemawait (THEOS) Wait until a remote semaphore is set +#include +short rsemawait(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemares,sema,semaphore,semares,semaset, + semawait +@sbrk +sbrk (THEOS) Increase a program's data space +void *sbrk(short increment); +@scanf +scanf (ANSI) Accept and format input +#include +short scanf(char *format,...); +See also: fscanf,sscanf +@schedint +schedint (THEOS) Set or reset an interrupt service routine vector +#include +void schedint(long num,short (*isr)()); +@sec +sec (THEOS) Calculate secant +#include +double sec(double x); +@sech +sech (THEOS) Calculate hyperbolic secant +#include +double sech(double x); +@seek +seek (ANSI) Change a stream position pointer +#include +short seek(FILE *fp,short pos,short base); +See also: fsetpos,rewind,seek +@seekdir +seekdir (+UNIX) Sets the directory entry location +#include +void seekdir(DIR*,long); +See also: opendir,closedir,readdir,telldir,rewinddir +@sema +sema (THEOS) Return the status of a semaphore +#include +short rsema(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,semaphore,semares, + semaset,semawait +@semaphore +semaphore (THEOS) Return the number of a semaphore +#include +short semaphore(char *name); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semares,semaset, + semawait +@semares +semares (THEOS) Reset a semaphore +#include +short semares(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semaset, + semawait +@semaset +semaset (THEOS) Set a semaphore +#include +short semaset(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semares, + semawait +@semawait +semawait (THEOS) Wait until a semaphore is set +#include +short semawait(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemares,rsemawait,sema,semaphore,semares, + semaset +@setbuf +setbuf (ANSI) Allocate an i/o buffer for an open file +#include +void setbuf(FILE *fp,char *buffer); +See also: fbuf,setvbuf,vbuf +@setjmp +setjmp (ANSI) Save or restore the current execution environment for a longjmp +#include +short setjmp(jmp_buf env); +See also: longjmp +@setlocale +setlocale (ANSI) Change or return the current locale switches +#include +char *setlocale(short category,const char *locale); +See also: strcoll,strxfrm,is... and to... functions +@setprty +setprty (THEOS) Change the current process priority +#include +void setprty(short priority); +Set also: setslice,snu +@setvbuf +setvbuf (ANSI) Allocate an i/o buffer for an open file +#include +void setvbuf(FILE *fp,char *buffer,short mode,size_t len); +See also: fbuf,setbuf,vbuf +@sgetl +sgetl (THEOS) Retrieve a long integer stored with sputl +#include +long sgetl(char *buf); +See also: sputl +@shared +shared (THEOS) Define or access memory shared with other process +unsigned shared(char *name,size_t len); +See also: far...,getlimit,add...,and...,dec...,inc...,or...,peek...,poke..., + xor... +@sig_atomic_t +sig_atomic_t (ANSI) Used by signal +#include +typedef short sig_atomic_t; +@signal +signal (ANSI) Set the answer to an interrupt +#include +void *signal(short sig,void (*action()); +Set : errno +See also: alarm,msalarm,raise +@sin +sin (ANSI) Calculate sine +#include +double sin(double radian); +Set : errno +@sinh +sinh (ANSI) Calculate hyperbolic sine +#include +double sinh(double radian); +@size_t +size_t (ANSI) Result type of sizeof +#include +typedef unsigned long size_t; +@skipsp +skipsp (THEOS) Locate the next non-space character in a string +#include +char *skipsp(char *s); +See also: strpbrk +@sleep +sleep (UNIX) Suspend execution for a specified time +#include +void sleep(long msecs); +See also: alarm,clock,delay,msalarm,signal +@snu +snu (THEOS) Release any remaining time in this program's slice time +#include +void snu(void); +@sort +sort (THEOS) Sort an array in memory by rearranging an array of pointers +void sort(void **array,size_t nbr,short (*compar)(const void *,const void *)); +See also: qsort +@spawnl +spawnl (MSC) Spawn another program as a subtask +#include +short spawnl(short mode,const char *program,const char *arg,...,NULL); +Set : errno +See also: execl,execlp,execv,execvp,spawnlp,spawnv,spawnvp +@spawnlp +spawnlp (MSC) Spawn another program as a subtask +#include +short spawnlp(short mode,const char *path,const char *arg,...,NULL); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnv,spawnvp +@spawnv +spawnv (MSC) Spawn another program as a subtask +#include +short spawnv(short mode,const char *program,const char *arg[]); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnlp,spawnvp +@spawnvp +spawnvp (MSC) Spawn another program as a subtask +#include +short spawnvp(short mode,const char *program,const char *arg[]); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnlp,spawnv +@sprintf +sprintf (ANSI) Format output +#include +short sprintf(char *string,const char *format,...); +See also: cprintf,fprintf,printf,vfprintf,vprintf,vsprintf +@sputl +sputl (THEOS) Store a long in an hardware independent format +#include +long sputl(long l,char *buf); +See also: sgetl +@sqrt +sqrt (ANSI) Compute square root +#include +double sqrt(double z); +Set : errno +@srand +srand (ANSI) Seed pseudo-random number generator +#include +void srand(unsigned seed); +See also: rand +@sscanf +sscanf (ANSI) Format input from a string +#include +short sscanf(const char *string,const char *format,...); +@stat +stat (ANSI) Find file attributes +#include +short stat(char *file,struct stat *statptr); +Return : EOF or 0 +Set : errno + +struct stat { + dev_t st_dev; /* p�riph�rique */ + ino_t st_ino; /* num�ro d'Inode = 0 */ + mode_t st_mode; /* lsb = protections, msb = filestat */ + nlink_t st_nlink; /* nombre de links = 1 */ + uid_t st_uid; /* identificateur de propri�taire */ + gid_t st_gid; /* identificateur de groupe = st_uid */ + dev_t st_rdev; /* p�riph�rique physique */ + size_t st_size; /* taille du fichier en octets */ + time_t st_atime; /* date et heure de dernier acc�s ** */ + time_t st_mtime; /* date et heure de derni�re modif ** */ + time_t st_ctime; /* date et heure de cr�ation ** */ + unsigned short st_org; /* organisation : s�q, key, ind, dir, prg */ + unsigned short st_rlen; /* largeur des enregistrements */ + unsigned short st_klen; /* largeur des cl�s */ + char st_grow; /* taux d'agrandissement */ +}; + +/* ** date de derni�re modification */ +@std +std (THEOS) Set direction flag +#include +void std(void); +See also: cld +@sti +sti (THEOS) Set interrupt +#include +void sti(void); +See also: cli +@strcat +strcat (ANSI) Append one string to another +#include +char *strcat(char *to,const char *from); +See also: farcat,strncat +@strchr +strchr (ANSI) Locate the first occurence of a character in a string +#include +char *strchr(const char *string1,short c); +See also: farchr,memchr,strpbrk,strrchr,strstr +@strcmp +strcmp (ANSI) Compare two strings +#include +short strcmp(const char *string1,const char *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,streq,stricmp,strncmp,strneq, + strnicmp +@strcoll +strcoll (ANSI) Compare two strings according to the current collating sequence +#include +short strcoll(const char *s1, const char *s2); +See also: setlocale,strlwr,strupr,strxfrm +@strcpy +strcpy (ANSI) Copy one string into another +#include +char *strcpy(char *to,const char *from); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strdup,strmake,strncpy +@strcrypt +strcrypt (JMD) Crypt a string +#include <_string.h> +char *strcrypt(char *s); +@strcspn +strcspn (ANSI) Return length for which one string excludes characters in another +#include +unsigned short strcspn(const char *string1,const char *string2); +See also: strpbrk,strspn,strtok +@strdup +strdup (MSC) Makes a copy of a string in previously unallocated memory +#include +char *strdup(const char *from); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strmake,strncpy +@strend +strend (THEOS) Locate the end of a string +#include +char *strend(const char *string); +@streq +streq (THEOS) Compare two strings for equality +#include +short streq(const char *string1,const char *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,stricmp,strncmp,strneq, + strnicmp +@strerror +strerror (ANSI) Return a system message with the arguments pointed by _errarg +#include +char *strerror(short num); +See also: _errarg,errmsg,fperror,getmsg,perror,syserr +@strftime +strftime (ANSI) Convert a time structure into a formatted string +#include +size_t strftime(char *s,size_t len,const char *fmt,const struct tm *tp); +See also: asctime,ctime,gmtime,localtime,mktime,time +@stricmp +stricmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short stricmp(const void *string1,const void *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,strncmp,strneq, + strnicmp +@strlen +strlen (ANSI) Return the length of a string +#include +short strlen(const char *string); +See also: farlen,strend +@strlwr +strlwr (MSC) Convert the alphabetic characters in a string to lower case +#include +char *strlwr(char *s); +See also: strupr,tolower,setlocale +@strmake +strmake (THEOS) Copy a memory buffer to a string,adding the nul terminator +#include +char *strmake(char *to,const char *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strdup,strncpy +@strncat +strncat (ANSI) Append one string onto another +#include +char *strncat(char *to,const char *from,size_t len); +See also: farcat,strcat +@strncmp +strncmp (ANSI) Compare two strings +#include +short strncmp(const char *string1,const char *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strneq,strnicmp +@strncpy +strncpy (ANSI) Copy one string into another +#include +char *strncpy(char *to,const char *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strdup,strmake +@strneq +strneq (THEOS) Compare two strings for equality +#include +short strneq(const char *string1,const char *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp, + strnicmp +@strnfill +strnfill (THEOS) Fill a buffer with a character +#include +char *strnfill(char *buffer,size_t len,short character); +See also: farset,memset,strset,strnset +@strnicmp +strnicmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short stricmp(const void *string1,const void *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq +@strnset +strnset (MSC) Fill a string with a character +void *strnset(char *buffer,short character,size_t len); +See also: farset,memset,strnfill,strset +@strpbrk +strpbrk (ANSI) Find first occurrence in a string of any character from another +#include +char *strpbrk(const char *string1,const char *string2); +See also: farchr,memchr,strchr,strrchr,strstr +@strrchr +strrchr (ANSI) Locate the last occurence of a character in a string +#include +char *strrchr(const char *string1,short c); +See also: farchr,memchr,strpbrk,strchr,strstr +@strsave +strsave (THEOS) See strdup +@strset +strset (MSC) Fill a string with a character +void *strset(char *buffer,short character); +See also: farset,memset,strnfill,strnset +@strspn +strspn (ANSI) Return length for which one string includes characters in another +#include +unsigned short strspn(const char *string1,const char *string2); +See also: strpbrk,strcspn,strtok +@strstr +strstr (ANSI) Locate the first occurence of one string within another +#include +char *strstr(const char *string1,const char *string2); +See also: farchr,memchr,strpbrk,strchr,strrchr +@strtod +strtod (ANSI) Convert string to floating point value +#include +double strtod(const char *s,char **es); +See also: atof,ftoa +@strtok +strtok (ANSI) Extract a token from a string +#include +char *strtok(char *string,char *delim); +See also: strcspn,srtrspn +@strtol +strtol (ANSI) Convert string in a specified base a to long integer +#include +double strtol(const char *s,char **es,short base); +See also: atol,ltoa,strtoul,ultoa +@strtoul +strtoul (ANSI) Convert string in a specified base a to unsigned long integer +#include +double strtoul(const char *s,char **es,short base); +See also: atol,ltoa,strtol,ultoa +@strupr +strupr (MSC) Convert the alphabetic characters in a string to upper case +#include +char *strupr(char *s); +See also: strlwr,tolower,setlocale +@strxfrm +strxfrm (ANSI) Convert a string according to the current collating sequence +#include +size_t strxfrm(char* to,char* from,size_t maxsize); +See also: setlocale,strcoll +@subb +subb (THEOS) Substract a value to a byte in another memory segment +#include +void subb(void *ofs,unsigned seg,char val); +See also: Other sub functions +@subcs +subcs (THEOS) Substract a value to a byte in the code segment +#include +void subcs(void *ofs,char val); +See also: Other sub functions +@subl +subl (THEOS) Substract a value to a long in another memory segment +#include +void subl(void *ofs,unsigned seg,long val); +See also: Other sub functions +@sublcs +sublcs (THEOS) Substract a value to a long in the code segment +#include +void sublcs(void *ofs,long val); +See also: Other sub functions +@subw +subw (THEOS) Substract a value to a word in another memory segment +#include +void subw(void *ofs,unsigned seg,short val); +See also: Other sub functions +@subwcs +subwcs (THEOS) Substract a value to a word in the code segment +#include +void subwcs(void *ofs,short val); +See also: Other sub functions +@suicide +suicide (THEOS) Kill the current sub-task +#include +void suicide(void); +See also: killtask +@swab +swab (THEOS) Swap a pair of bytes +#include +void swab(char *src,char *dest,unsigned nb); +@syserr +syserr (THEOS) Display a system message on stderr and exit the program +#include +void syserr(short rc,short num,char *arg[]); +See also: errmsg,exit,putmsg +@system +system (ANSI) Pass a command to the CSI shell for execution +#include +short system(const char *commandline); +@tan +tan (ANSI) Calculate tangent +#include +double tan(double radian); +@tanh +tanh (ANSI) Calculate hyperbolic cosine +#include +double tanh(double radian); +@tell +tell (MSC) Return current position of file's data pointer +#include +long tell(short filenum); +See also: close,creat,filelength,flush,lseek,open,_read,read,_write,write +@telldir +telldir (+UNIX) Return the current directory entry location +#include +long telldir(DIR*); +See also: opendir,closedir,readdir,seekdir,rewinddir +@tempnam +tempnam (ANSI) Generate a unique name for a temporary file +#include +char *tempnam(const char *directory,const char *name); +@termname +termname (+THEOS) Return the class name of a terminal or printer +#include <_stdio.h> +char* termname(int class); +See also: devname,termname,ttyname +@testarg +testarg (THEOS) Compare a string to a system keyword +#include +short testarg(char *arg,short keynbr); +See also: getkey,keyclose,matcharg +@testhead +testhead (THEOS) Control page heading and page wait for stdout +#include +void testhead(char *heading); +See also: datehdng,getll,getpl,pagewait +@testwild +testwild (THEOS) Test if a string include "wild cards" +#include +short testwild(char *s); +@tetd_t +tetd_t (MWC) Type to represent file time and date format +#include +typedef unsigned long tetd_t; +@tetd_to_tm +tetd_to_tm (MWC) Convert file time and date to system calendar format +#include +tm_t *tetd_to_tm(tetd_t time); +See also: tetd_to_time,time_to_tetd,tm_to_tetd +@tetd_to_time +tetd_to_time (MWC) Convert file time and date to a number of seconds +#include +time_t tetd_to_time(tetd_t time); +See also: tetd_to_tm,time_to_tetd,tm_to_tetd +@time +time (ANSI) Get current time in seconds since 01-01-1970 00:00:00 GMT +#include +time_t time(time_t *tp); +@time_t +time_t (ANSI) Type to represent time in seconds since 01-01-1970 00:00:00 GMT +#include +typedef long time_t; +@time_to_tetd +time_to_tetd (MWC) Convert a number of seconds to file time and date format +#include +tetd_t time_to_tetd(time_t t); +See also: tetd_to_tm,tetd_to_time,tm_to_tetd +@timeout +timeout (THEOS) Test if previous read failed because of a lock timeout +#include <_stdio.h> +short timeout(); +See also: lock_time +@timer +timer (THEOS) Set a semaphore on after a given time or a defined time of day +#include +void *timer(short sema_nbr,short type,long msec); +See also: alarm,msalarm,sema,semaphore,semares,semaset,semawait +@timezone +timezone (ANSI) Difference in seconds between GMT time and local time +#include +extern long timezone; +See also: daylight,tzset,tzname +@tm_to_tetd +tm_to_tetd (MWC) Convert system calendar format to file date and time +#include +tetd_t tm_to_tetd(tm_t *time); +See also: tetd_to_tm,tetd_to_time,time_to_tetd +@tmpfile +tmpfile (ANSI) Create and open a temporary file +#include +FILE *tmpfile(void); +See also: fopen,mktemp,lempnam,tmpnam +@tmpnam +tmpnam (ANSI) Generate a unique name for a temporary file +#include +char *tmpnam(char *name); +@toascii +#include +toascii (UNIX) Convert characters to ASCII +#include +short toascii(short c); +@toibmpc +toibmpc (+THEOS) Translate THEOS character to native IBM PC extended ASCII +#include +short toibmpc(short c); +See also: totheos +@tolower +tolower (ANSI) Convert characters to lower case +#include +short tolower(short c); +@topen +topen (THEOS) ??? +#include +FILE *topen(char *fname,char *mode,unsigned reclen,size_t blklen); +Set : _errnum +@tot_alloc +tot_alloc (THEOS) Compute the total amount of available memory +#include +size_t tot_alloc(void); +See also: calloc,free,malloc,max_alloc,realloc +@totheos +totheos (+THEOS) Translate IBM PC extended ASCII character to THEOS character +#include +short totheos(short c); +See also: toibmpc +@toupper +toupper (ANSI) Convert characters to upper case +#include +short toupper(short c); +@trim +trim (THEOS) Remove leading,trailing and multiple spaces +#include +char *trim(char *s); +@ttyname +ttyname (+UNIX) Return the name of the console physical device +#include <_stdio.h> +char* ttyname(FILE* stream); +See also: devname,termname,vdiname +@tzname +tzname (ANSI) Time zones names +#include +extern char *tzname[2]; +See also: daylight,timezone,tzset +@tzset +tzset (UNIX) Determine the time zone name for local time +#include +void tzset(void); +See also: daylight,timezone,tzname +@undef +#undef (ANSI) Undefine a manifest constant +#undef variable +@ungetc +ungetc (ANSI) Return character to input stream +#include +short ungetc(short c,FILE *fp); +See also: ungetch +@ungetch +ungetc (MSC) Return character to standard input +#include +short ungetch(short c); +See also: ungetc +@unlink +unlink (ANSI) Remove a file +#include +short unlink(const char *name); +Set : errno,_errnum +See also: remove +@unload +unload (THEOS) Unload a file from memory +#include +void unload(unsigned seg); +See also: load +@unlock +unlock (THEOS) Unlock a record +#include +void unlock(FILE *file); +See also: filelock,locking,reclock,recunlock +@unwait +unwait (THEOS) Awaken a program waiting for an interrupt +#include +void unwait(short pid); +See also: wait +@upcase +upcase (THEOS) See strupr +@utime +utime (+UNIX) Change the date and time of a file +#include +short utime(const char *filename,struct utimbuf *times); +Set : errno +See also: asctime,ctime,gmtime,localtime,stat,time +@utoa +utoa (THEOS) Convert an unsigned integer into an ASCII string +#include +char *utoa(char *s,unsigned i); +See also: ftoa,itoa,ltoa +@va_arg +va_arg (ANSI) Used to access erguments in a variable argument functions +#include +.... va_arg(va_list *arg_ptr,type); +See also: va_start,va_end +@va_end +va_end (ANSI) End variable argument processing +#include +void va_end(va_list *aptr); +See also: va_arg,va_start +@va_list +va_list (ANSI) Used in variable argument processing +#include +typedef long va_list[1]; +@va_start +va_start (ANSI) Start variable argument processing +#include +void va_start(va_list *arg_ptr,void *ptr); +See also: va_arg,va_end +@vdi +vdi (THEOS) Primitive access to the Virtual Device Interface +#include +void vdi(short vidnum,VDIPB *vdipb); +See also: vdiopen +@vdialpha +vdialpha( THEOS) Switch VDI to text mode +#include +void vdialpha(VDIPB *vdipb); +See also: vdigraph,vdiopen +@vdiarc +vdiarc (THEOS) Draw an arc +#include +void vdiarc(VDIPB *vdipb,short x,short y,short radius,short angle1,short angle2); +See also: vdicircle,vdiopen,vdipie +@vdibar +vdibar (THEOS) Draw a rectangle +#include +void vdibar(VDIPB *vdipb,short llx,short lly,short urx,short ury); +See also: vdiopen +@vdicircle +vdicircle (THEOS) Draw a circle +#include +void vdicircle(VDIPB *vdipb,short x,short y,short radius); +See also: vdiarc,vdiopen,vdipie +@vdiclear +vdiclear (THEOS) Clear the graphics page or perform a form feed +#include +void vdiarc(VDIPB *vdipb); +See also: vdiopen +@vdiclose +vdiclose (THEOS) Close a VDI file +#include +void vdiclose(VDIPB *vdipb); +See also: vdiopen +@vdigraph +vdigraph (THEOS) Swith to graphics mode +#include +void vdigraph(VDIPB *vdipb); +See also: vdialpha,vdiopen +@vdiline +vdiline (THEOS) Draw a line +#include +void vdiline(VDIPB *vdipb,short x1,short y1,short x2,short y2); +See also: vdiopen +@vdimark +vdimark (THEOS) Draw a marker +#include +void vdimark(VDIPB *vdipb,short x,short y); +See also: vdiopen +@vdiname +vdiname (+THEOS) Return the name of a VDI physical device +#include <_stdio.h> +char* vdiname(int vdiclass); +See also: devname,termname,ttyname +@vdiopen +vdiopen (THEOS) Open a graphics device +#include +VDIPB *vdiopen(short num); +See also: vdiclose +@vdipie +vdipie (THEOS) Draw a pie section +#include +void vdipie(VDIPB *vdipb,short x,short y,short radius,short angle1,short angle2); +See also: vdiarc,vdicircle,vdiopen +@vdisetfc +vdisetfc (THEOS) Set fill color +#include +void vdisetfc(VDIPB *vdipb,short color); +See also: vdibar,vdicircle,vdiopen,vdipie +@vdisetfs +vdisetfs (THEOS) Set fill style +#include +void vdisetfs(VDIPB *vdipb,short style); +See also: vdibar,vdicircle,vdiopen,vdipie +@vdisetlc +vdisetlc (THEOS) Set line color +#include +void vdisetlc(VDIPB *vdipb,short color); +See also: vdiarc,vdibar,vdicircle,vdiline,vdiopen,vdipie +@vdisetlh +vdisetlh (THEOS) Set line width or height +#include +void vdisetlh(VDIPB *vdipb,short size); +See also: vdiline,vdiopen +@vdisetls +vdisetls (THEOS) Set line style +#include +void vdisetls(VDIPB *vdipb,short style); +See also: vdiarc,vdibar,vdicircle,vdiline,vdiopen,vdipie +@vdisetmc +vdisetmc (THEOS) Set marker color +#include +void vdisetmc(VDIPB *vdipb,short color); +See also: vdimark,vdiopen +@vdisetmh +vdisetmh (THEOS) Set marker size or height +#include +void vdisetmh(VDIPB *vdipb,short size); +See also: vdimark,vdiopen +@vdisetms +vdisetms (THEOS) Set marker style +#include +void vdisetms(VDIPB *vdipb,short style); +See also: vdimark,vdiopen +@vdisetta +vdisetta (THEOS) Set text angle +#include +void vdisetta(VDIPB *vdipb,short color); +See also: vdiopen,vditext +@vdisettc +vdisettc (THEOS) Set text color +#include +void vdisettc(VDIPB *vdipb,short color); +See also: vdiopen,vditext +@vdisetth +vdisetth (THEOS) Set text size or height +#include +void vdisetth(VDIPB *vdipb,short size); +See also: vdiopen,vditext +@vdisettp +vdisettp (THEOS) Set text path +#include +void vdisettp(VDIPB *vdipb,short path); +See also: vdiopen,vditext +@vdisetts +vdisetts (THEOS) Set text style +#include +void vdisetts(VDIPB *vdipb,short style); +See also: vdiopen,vditext +@vditext +vditext (THEOS) Display a text string +#include +void vditext(VDIPB *vdipb,short x,short y,char *s); +See also: vdiopen +@vfprintf +vfprintf (ANSI) Print formatted output to a stream +#include +short vfprintf(const FILE *stream,const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vprintf,vsprintf +@vprintf +vprintf (ANSI) Print formatted output to standard output +#include +short vprintf(const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vfprintf,vsprintf +@vsprintf +vsprintf (ANSI) Print formatted output to a string +#include +short vsprintf(char *s,const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vfprintf,vprintf +@wait (THEOS) Suspend a program until an interrupt occurs +#include +void wait(void); +See also: unwait +@write +write (ANSI) Write data to a file +#include +size_t write(short fd,void *buffer,size_t len); +See also: close,creat,filelength,flush,lseek,open,_read,read,tell,_write +@writek +writek (THEOS) Write a record to an indexed or keyed file +#include +short writek(FILE *fp,const char *key,const void *rec); +See also: deletek,readk,readn,readp +@xorb +xorb (THEOS) Xor a byte in another memory segment +#include +void xorb(void *ofs,unsigned seg,char mask); +See also: Other xor functions +@xorcs +xorcs (THEOS) Xor a byte in the code segment +#include +void xorcs(void *ofs,char mask); +See also: Other xor functions +@xorl +xorl (THEOS) Xor a long in another memory segment +#include +void xorl(void *ofs,unsigned seg,long mask); +See also: Other xor functions +@xorlcs +xorlcs (THEOS) Xor a long in the code segment +#include +void xorlcs(void *ofs,long mask); +See also: Other xor functions +@xorw +xorw (THEOS) Xor a word in another memory segment +#include +void xorw(void *ofs,unsigned seg,short mask); +See also: Other xor functions +@xorwcs +xorwcs (THEOS) Xor a word in the code segment +#include +void xorwcs(void *ofs,short mask); +See also: Other xor functions +#include <_time.h> +short _yday(short month,short day,short year); +See also: leapyear,_weekday +@yes_val +yes_val (THEOS) Value of yes answer +extern char yes_val; +@yesno +yesno (THEOS) Accept the answer yes or no according to the system keyword file +#include +short yesno(void); +See also: load_yn +@yield +yield (THEOS) See snu +@account +account (THEOS) Format of SYSTEM.ACCOUNT +#include +struct account { + char name[8]; /* [00] - logon id */ + char password[8]; /* [08] - password (spaces if none) */ + char id[2]; /* [10] - account number: + ascii-hex if 00-FE + else: 76543210-76543210 + *3210987 *6543210 + * = always set + if number >= 0x2000, + then synonym to account + & 0x1fff */ + char priv; /* [14] - privlege level */ + char mail_sw; /* [13] - you have mail */ + char abbrev_sw; /* [14] - CSI abbreviation switch */ + char stdsyn_sw; /* [15] - CSI synonym switch */ + char synonym[9]; /* [16] - CSI synonym fn______d */ + char rdy_sw; /* [1F] - CSI ready switch */ + char msg_sw; /* [20] - MSG switch */ + char break_chr[2]; /* [21] - break value (ascii-hex) */ + char work_drv; /* [23] - work drive code */ + char lang_code; /* [24] - default language code */ + char dec_is_comma; /* [25] - decimal is comma switch */ + char def_lib[19]; /* [26] - default library fn.ft:d */ + char mac_lib[9]; /* [39] - macro library fn______d */ + char obj_lib[9]; /* [42] - object library fn______d */ + char copy_lib[9]; /* [4B] - include library fn______d */ + char search[26]; /* [54] - search sequence */ + char cmd_lib[9]; /* [6E] - command library fn______d */ + char link_lib[9]; /* [77] - link library fn______d */ + char csi_case_sw; /* [80] - CSI lower case mode */ + char prompt[50]; /* [81] - CSI prompt */ +}; +@acb +acb (THEOS) Format of accseg in memory +#include +struct acb { + char name[8]; /* [00] - account name */ + short id; /* [08] - account number */ + char msgname[8]; /* [0A] - msg name */ +}; +@TERMINAL_FD +TERMINAL_FD (THEOS) Translate table used by international terminals +#include +struct TERMINAL_FD { + char type_code; + char terminal_name[25]; + near char *home; + near char *fon; + near char *foff; + near char *hon; + near char *hoff; + near char *right; + near char *left; + near char *down; + near char *ulon; + near char *clear; + near char *rvon; + near char *rvoff; + near char *dca; + near char *il; + near char *dl; + near char *setup; + near char *ic; + near char *dc; + near char *uloff; + near char *eol; + near char *eos; + near char *up; + near char *eu; + near char *bon; + near char *boff; + near char *mon; + near char *moff; + near char *color; + near char *koff; + near char *kon; + near char *son; + near char *soff; + near char *ISO_23; + near char *ISO_40; + near char *ISO_5B; + near char *ISO_5C; + near char *down_key; + near char *up_key; + near char *left_key; + near char *right_key; + near char *esc_key; + near char *top_key; + near char *bottom_key; + near char *delchar_key; + near char *page_fwd_key; + near char *page_bck_key; + near char *word_right_key; + near char *word_left_key; + near char *sch_fwd_key; + near char *sch_bck_key; + near char *again_key; + near char *file_key; + near char *erase_key; + near char *beg_line_key; + near char *end_line_key; + near char *case_key; + near char *save_key; + near char *quit_key; + near char *find_key; + near char *replace_key; + near char *del_left_key; + near char *transpose_key; + near char *ins_line_key; + near char *del_line_key; + near char *help_key; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; + near char *A_umlaut; + near char *a_umlaut; + near char *a_circumflex; + near char *a_grave; + near char *a_acute; + near char *E_acute; + near char *e_umlaut; + near char *e_circumflex; + near char *e_grave; + near char *e_acute; + near char *i_umlaut; + near char *i_circumflex; + near char *i_grave; + near char *i_acute; + near char *O_umlaut; + near char *o_umlaut; + near char *o_circumflex; + near char *o_grave; + near char *o_acute; + near char *U_umlaut; + near char *u_umlaut; + near char *u_circumflex; + near char *u_grave; + near char *u_acute; + near char *C_tail; + near char *c_tail; + near char *N_squiggle; + near char *n_squiggle; + near char *AE; + near char *ae; + near char *A_degree; + near char *a_degree; + near char *German_esset; + near char *invert_question; + near char *invert_exclaim; + near char *cent; + near char *english_pound; + near char *japenese_yen; + near char *spanish_pentada; + near char *dutch_guilder; + near char *one_quarter; + near char *one_half; + near char *y_umlaut; + near char *section; + near char *degree; + near char *bullet; + near char *A_umlaut_key; + near char *a_umlaut_key; + near char *a_circumflex_key; + near char *a_grave_key; + near char *a_acute_key; + near char *E_acute_key; + near char *e_umlaut_key; + near char *e_circumflex_key; + near char *e_grave_key; + near char *e_acute_key; + near char *i_umlaut_key; + near char *i_circumflex_key; + near char *i_grave_key; + near char *i_acute_key; + near char *O_umlaut_key; + near char *o_umlaut_key; + near char *o_circumflex_key; + near char *o_grave_key; + near char *o_acute_key; + near char *U_umlaut_key; + near char *u_umlaut_key; + near char *u_circumflex_key; + near char *u_grave_key; + near char *u_acute_key; + near char *C_tail_key; + near char *c_tail_key; + near char *N_squiggle_key; + near char *n_squiggle_key; + near char *AE_key; + near char *ae_key; + near char *A_degree_key; + near char *a_degree_key; + near char *German_esset_key; + near char *invert_question_key; + near char *invert_exclaim_key; + near char *cent_key; + near char *english_pound_key; + near char *japenese_yen_key; + near char *spanish_pentada_key; + near char *dutch_guilder_key; + near char *one_quarter_key; + near char *one_half_key; + near char *y_umlaut_key; + near char *section_key; + near char *degree_key; + near char *bullet_key; + near char *ISO_5D; + near char *ISO_5E; + near char *ISO_60; + near char *ISO_7B; + near char *ISO_7C; + near char *ISO_7D; + near char *ISO_7E; + near char *ISO_23_key; + near char *ISO_40_key; + near char *ISO_5B_key; + near char *ISO_5C_key; + near char *ISO_5D_key; + near char *ISO_5E_key; + near char *ISO_60_key; + near char *ISO_7B_key; + near char *ISO_7C_key; + near char *ISO_7D_key; + near char *ISO_7E_key; +}; +@TERMINAL_FE +TERMINAL_FE (THEOS) Translate table used by US terminals +#include +struct TERMINAL_FE { + char type_code; + char terminal_name[25]; + near char *home; + near char *fon; + near char *foff; + near char *hon; + near char *hoff; + near char *right; + near char *left; + near char *down; + near char *ulon; + near char *clear; + near char *rvon; + near char *rvoff; + near char *dca; + near char *il; + near char *dl; + near char *setup; + near char *ic; + near char *dc; + near char *uloff; + near char *eol; + near char *eos; + near char *up; + near char *eu; + near char *bon; + near char *boff; + near char *mon; + near char *moff; + near char *color; + near char *koff; + near char *kon; + near char *son; + near char *soff; + char filler[8]; + near char *down_key; + near char *up_key; + near char *left_key; + near char *right_key; + near char *esc_key; + near char *top_key; + near char *bottom_key; + near char *delchar_key; + near char *page_fwd_key; + near char *page_bck_key; + near char *word_right_key; + near char *word_left_key; + near char *sch_fwd_key; + near char *sch_bck_key; + near char *again_key; + near char *file_key; + near char *erase_key; + near char *beg_line_key; + near char *end_line_key; + near char *case_key; + near char *save_key; + near char *quit_key; + near char *find_key; + near char *replace_key; + near char *del_left_key; + near char *transpose_key; + near char *ins_line_key; + near char *del_line_key; + near char *help_key; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; +}; +@PRINTER_FC +PRINTER_FC (THEOS) Translate table used by printers +#include +struct PRINTER_FC { + char type_code; + char printer_name[25]; + near char *bold_on; + near char *bold_off; + near char *ul_on; + near char *ul_off; + near char *ital_on; + near char *ital_off; + near char *color_on; + near char *color_off; + near char *compress_on; + near char *compress_off; + near char *wide_on; + near char *wide_off; + near char *high_on; + near char *high_off; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; + near char *A_umlaut; + near char *a_umlaut; + near char *a_circumflex; + near char *a_grave; + near char *a_acute; + near char *E_acute; + near char *e_umlaut; + near char *e_circumflex; + near char *e_grave; + near char *e_acute; + near char *i_umlaut; + near char *i_circumflex; + near char *i_grave; + near char *i_acute; + near char *O_umlaut; + near char *o_umlaut; + near char *o_circumflex; + near char *o_grave; + near char *o_acute; + near char *U_umlaut; + near char *u_umlaut; + near char *u_circumflex; + near char *u_grave; + near char *u_acute; + near char *C_tail; + near char *c_tail; + near char *N_squiggle; + near char *n_squiggle; + near char *AE; + near char *ae; + near char *A_degree; + near char *a_degree; + near char *German_esset; + near char *invert_question; + near char *invert_exclaim; + near char *cent; + near char *english_pound; + near char *japenese_yen; + near char *spanish_pentada; + near char *dutch_guilder; + near char *one_quarter; + near char *one_half; + near char *y_umlaut; + near char *section; + near char *degree; + near char *bullet; + near char *ISO_23; + near char *ISO_40; + near char *ISO_5B; + near char *ISO_5C; + near char *ISO_5D; + near char *ISO_5E; + near char *ISO_60; + near char *ISO_7B; + near char *ISO_7C; + near char *ISO_7D; + near char *ISO_7E; +}; +@elt +elt (THEOS) Exclusive Lock Table +#include +struct elt { + void *lock_ofs; /* [00] - offset address */ + unsigned lock_seg; /* [04] - segment address */ + unsigned char lock_own; /* [06] - pid of owner */ + char lock_flag; /* [07] - set if waiting */ +}; + +#define ELT ((struct elt *)0) +#define ELTLEN 8 +#define ELTSEG 0x0078 +@fcb +fcb (THEOS) File Control Block +See FILE +@FILE +FILE (THEOS) File Control Block +#include +typedef struct fcb { + char _fst; /* [00] - 1 - file status: + 76543210 + ��������� = disk full on last write + ��������� = tape no HDR2 labels + ��������� = tape end of file + ��������� = printer needs close + ��������� = printer + ��������� = buffer has write data + ��������� = buffer allocated + ��������� = opened */ + char _flub; /* [01] - 5 - logical unit,255 = null */ + short _faccess; /* [02] - 11 - access mode: + 111111 + 5432109876543210 + ����������������� = input + ����������������� = output + ����������������� = lock + ����������������� = temp file (erase) + ����������������� = stream + ����������������� = relative + ����������������� = indexed + ����������������� = keyed + ����������������� = append mode + ����������������� = private + ����������������� = last prt FF + ����������������� = pipe file + ����������������� = printer pass-thru + ����������������� = last prt FE + ����������������� = lock writes + ����������������� = ix node rd/wr */ + short _freclen; /* [04] - 19 - record length */ + short _fkeylen; /* [06] - 27 - key length */ + char *_fbufbase; /* [08] - 801 - location of buffer */ + long _fbufsize; /* [0C] - 817 - buffer size */ + char *_fbufptr; /* [10] - 833 - next char position */ + long _fcount; /* [14] - 849 - number of chars left */ + long _floc; /* [18] - 865 - location next read or write */ + short _fsa; /* [1C] - 371 - slot number of fsa */ + char *_fnxtkey; /* [1E] - 889 - pointer to IX key storage */ + short _fnxt; /* [22] - 395 - type of IX key */ + long _fixnxt; /* [24] - 913 - disk address of IX key */ + char *_ftapefn; /* [28] - 929 - pointer to tape file name */ + char _filler[10]; /* [2C] - filler */ +} FILE; /* len of fcb = 54 bytes */ + +struct fcb_286 { + char _fst; /* [00] - 1 - file status: + 76543210 + ��������� = disk full on last write + ��������� = tape no HDR2 labels + ��������� = tape end of file + ��������� = printer needs close + ��������� = printer + ��������� = buffer has write data + ��������� = buffer allocated + ��������� = opened */ + char _flub; /* [01] - 5 - logical unit,255 = null */ + short _faccess; /* [02] - 11 - access mode: + 111111 + 5432109876543210 + ����������� = input + ����������� = output + ����������� = lock + ����������� = temp file (erase) + ����������� = stream + ����������� = relative + ����������� = indexed + ����������� = keyed + ����������� = append mode + ����������� = private */ + short _freclen; /* [04] - 19 - record length */ + short _fkeylen; /* [06] - 27 - key length */ + near char *_fbufbase; /* [08] - 35 - location of buffer */ + unsigned _fbufsize; /* [0A] - 43 - buffer size */ + near char *_fbufptr; /* [0C] - 51 - next char position */ + unsigned _fcount; /* [0E] - 59 - number of chars left */ + long _floc; /* [10] - 67 - location next read or write */ + short _fsa; /* [14] - 83 - slot number of fsa in nucleus */ +}; /* len of fcb_286 = 22 bytes */ +@fdb +fdb (THEOS) File Directory Block +#include +struct fdb { + char filename[8]; /* [00] - filename or member name */ + char filetype[8]; /* [08] - filetype */ + char filestat; /* [10] - file status: + 76543210 + 00000000 empty + 11111111 erased + 10000000 library + 01000000 sub directory + 00010000 normal stream + 00001000 relative + 00000100 keyed + 00000010 indexed + xxx00001 program + xxx = 000 8086 & 80286 real + xxx = 001 80286 protected + xxx = 010 80386 */ + unsigned short fileowner; /* [11] - owner id */ + char protect; /* [13] - protection code: + 76543210 + ��������� = read protect + ��������� = write protect + ��������� = execute protect + ��������� = erase protect + ��������� = shared read protect + ��������� = shared write protect + ��������� = shared execute protect + ��������� = shared erase protect */ + union { + struct { + year : 6; /* years since 1986 [0-31] = [1986 - 2017] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + sec : 6; /* second [0 - 59] */ + } new; + struct { + char type; /* code 0=old,!0=new */ + year : 4; /* years since 1980 [0-15] = [1980 - 1995] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + : 0; + } old; + unsigned long datetime; + } filedate; /* [14] - date & time of last write */ + long filesize; /* [18] - file size in bytes */ + unsigned short reclen; /* [1C] - record length */ + unsigned short keylen; /* [1E] - key len */ + struct { + unsigned short ext_ct; /* [20] - sector count */ + char ext_addr[3]; /* [22] - sector address */ + } extlev1[5]; /* [20] - 5 level 1 extents */ + char extlev2a[3]; /* [39] - address of sector contain 51 exts */ + char extlev2b[3]; /* [3C] - address of sector contain 51 exts */ + char filegrow; /* [3F] - extent increase amount; + 0 = dynamic,chop at close + n = filesize/n,no chop */ +}; /* (fdb len = 64) */ +@fsa +fsa (THEOS) File Save Area +#include +struct fsa { + near struct diskucb *fsa_ucb; /* [00] - file ucb */ + long fsa_sect; /* [02] - fdb sector address */ + near struct fdb *fsa_ofs; /* [06] - fdb offset within sector */ + short fsa_count; /* [08] - open fcb count */ + char fsa_lock; /* [0A] - file locked: + 76543210 + ��� deny read + ��� deny write */ + char fsa_write; /* [0B] - file modified if non zero */ + char fsa_temp; /* [0C] - erase at final close */ + char fsa_1[3]; /* [0D] - not used */ + char filestat; /* [10] - file status: + 0x10 normal stream + 0x08 direct + 0x04 keyed + 0x02 indexed */ + unsigned short fileowner; /* [11] - owner id */ + char protect; /* [13] - protection code: + 0x8? shared erase protect + 0x4? shared execute protect + 0x2? shared write protect + 0x1? shared read protect + 0x?8 erase protect + 0x?4 execute protect + 0x?2 write protect + 0x?1 read protect */ + union { + struct { + year : 6; /* years since 1986 [0 - 31] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + sec : 6; /* second [0 - 59] */ + } new; + struct { + char type; /* code 0=old,!0=new */ + year : 4; /* years since 1980 [0 - 15] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + : 0; + } old; + unsigned long datetime; + } filedate; /* [14] - date & time of last write */ + long filesize; /* [18] - file size in bytes */ + unsigned short reclen; /* [1C] - record length */ + unsigned short keylen; /* [1E] - key len */ + struct { + unsigned short ext_ct; /* [20] - sector count */ + char ext_addr[3]; /* [22] - sector address */ + } extlev1[5]; + char extlev2a[3]; /* [39] - addr of sector with 51 ext */ + char extlev2b[3]; /* [3C] - addr of sector with 51 ext */ + char filegrow; /* [3F] - extent growth factor */ +}; /* (fsa len = 64) */ + +#define FSASEG 0x0088 +@filedate +filedate (JMD) File's date and time structure +#include +typedef union filedate { /* date & time of last write */ + struct { + year : 6; /* years since 1986 [0-31] = [1986-2017] */ + month : 4; /* month [1-12] */ + day : 5; /* day [1-31] */ + hour : 5; /* hour [0-23] */ + min : 6; /* minute [0-59] */ + sec : 6; /* second [0-59] */ + } new; + struct { + type : 8; /* Type 0=old,!0=new */ + year : 4; /* years since 1980 [0-15] = [1980-1995] */ + month : 4; /* month [1-12] */ + day : 5; /* day [1-31] */ + hour : 5; /* hour [0-23] */ + min : 6; /* minute [0-59] */ + } old; + tetd_t datetime; +} FILEDATE; +@tetd_t +tetd_t (JMD) Packed file's date and time +#include +typedef unsigned long tetd_t; +@lconv +lconv (ANSI) Locale structure +#include +struct lconv { + char *decimal_point; + char *thousands_sep; + char *grouping; + char *int_curr_symbol; + char *currency_symbol; + char *mon_decimal_point; + char *mon_thousands_sep; + char *mon_grouping; + char *positive_sign; + char *negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; +}; + +#define LC_ALL 31 +#define LC_COLLATE 1 +#define LC_CTYPE 2 +#define LC_NUMERIC 4 +#define LC_TIME 8 +#define LC_MONETARY 16 +@complex +complex (UNIX) Complex number +#include +struct complex { + double x; + double y; +}; +@nuc +nuc (THEOS) Nucleus data structure +#include +struct nuc { + char pad1[4]; /* [00] filler */ + struct { + char year; /* [04] year - 1900 */ + char month; /* [05] month (1 - 12) */ + char day; /* [06] day of month (1 - 31) */ + char hour; /* [07] hour of day (0 - 23) */ + char min; /* [08] minute of hour (0 - 59) */ + char sec; /* [09] second of minute (0 - 59) */ + } time_of_day; /* [04] system date & time */ + char dateopt; /* [0A] date option: */ + #define kanji 1 /* 16 bit Japanese Kanji */ + #define extime 2 /* external clock chip */ + #define exdate 4 /* external date chip */ + #define havusr 8 /* have USER module */ + #define aform 16 /* American MM/DD/YY */ + #define eform 32 /* European DD-MM-YY */ + #define iform 64 /* International YY.MM.DD */ + #define whist 128 /* write history records */ + char curpid; /* [0B] current process number */ + char cpu[4]; /* [0C] cpu */ + near char *curpcb; /* [10] current PCB pointer */ + unsigned short slice; /* [12] slice interval (msec) */ + near char *mstick; /* [14] address of msec tick */ + near char *snutick; /* [16] address of snu tick */ + unsigned short spoolseg; /* [18] DESPOOL segment */ + char version[5]; /* [1A] version number */ + char mfgnum; /* [1F] manufacturer number */ + unsigned short sernum; /* [20] serial number */ + long csisize; /* [22] SYSTEM.THEOS386.CSI filesize */ + struct { + unsigned short size; + char addr[3]; + } csiext[4]; /* [26] SYSTEM.THEOS386.CSI extent info */ + unsigned short csistack; /* [3A] SYSTEM.THEOS386.CSI stack len */ + char errmsg[3]; /* [3C] SYSTEM.THEOS386.MESSAGE extent info */ + unsigned short pdlseg; /* [3F] segment of PDL */ + unsigned pipenum; /* [41] next pipe number */ + char npxpid; /* [43] 80287/80387 owner pid */ + char slpcnt; /* [44] number of sleepers */ + char spdrv; /* [45] SYSTEM.SPOOLER drive */ + char sppid; /* [46] spooler pid */ + char snu_val[3]; /* [47] select next user */ + long cputime; /* [4A] time of day in msec (software) */ + short cache_seg; /* [4E] directory cache head segment */ + char srlo; /* [50] SunRiver */ + char public[26]; /* [51] public drive list A-Z */ + near char *rpb; /* [6B] RPB head seg address */ + char srhi; /* [6D] SunRiver */ + near char *rlt; /* [6E] RLT head offset address */ + unsigned pipe_hd; /* [70] PIPE head segment */ + near char *teb; /* [72] TEB head offset address */ + char tz[12]; /* [74] time zone info */ + unsigned short svdeb; /* [80] DEBUG386 use */ + long csicode; /* [82] SYSTEM.THEOS386.CSI code length */ + unsigned short msgseg; /* [86] SYSTEM.THEOS386.MESSAGE segment */ + char msgnum; /* [88] SYSTEM.THEOS386.MESSAGE suffix */ + char sync_pid; /* [89] process id of sync'er */ + unsigned short keyseg; /* [8A] SYSTEM.THEOS386.KEYWORD segment */ + char keynum; /* [8C] SYSTEM.THEOS386.KEYWORD suffix */ + char mca; /* [8D] cpu flags: */ + + #define MCA_BUS 1 + #define EISA_BUS 2 + #define ISA_BUS 32 + + #define CPU_286 64 + #define CPU_386 16 + #define CPU_486 4 + + #define FPU 8 + + #define MDOS_VER 128 + + unsigned mem_size; /* [8E] memory size at bootup */ + unsigned shmemseg; /* [90] shared memory segment */ + char sysname[16]; /* [92] system identification */ + unsigned short synseg; /* [A2] SYSTEM.THEOS386.SYNONYM segment */ + char synnum; /* [A4] SYSTEM.THEOS386.SYNONYM suffix */ + unsigned short devseg; /* [A5] SYSTEM.THEOS386.DEVNAMES segment */ + unsigned short gucb; /* [A7] VDI UCB segment address */ + char dflang; /* [A9] default language code */ + short cache_delay; /* [AA] cache write delay in .1 seconds */ + unsigned short accseg; /* [AC] ACCOUNT segment address */ + unsigned short csidata; /* [AE] SYSTEM.THEOS386.CSI data length */ + unsigned short csiheap; /* [B0] SYSTEM.THEOS386.CSI heap length */ + unsigned long pdbr; /* [B2] Page Descriptor Base reg */ + unsigned short ptseg; /* [B6] Page Table Selector */ + unsigned short v86seg; /* [B8] V86 Monitor segment */ + char v86pids[32]; /* [BA] V86 pid masks */ + unsigned char v86count; /* [DA] V86 Monitor count */ + char v86_inuse; /* [DB] set while loading V86 */ + unsigned short network; /* [DC] Network phantom pid */ + unsigned short ncb_seg; /* [DE] Network socket control block segment */ + short v86reserve; /* [E0] V86 reserve I/O segment */ + unsigned short flt_seg; /* [E2] File Lock Table */ + char copyright[28]; /* [E4] copyright notice */ + char ucb[1]; /* [100] Unit control blocks */ +}; +@pcb +pcb (THEOS) Process Control Block +#include +struct pcb { + unsigned short pstat; /* [00] - process status: */ + #define WAITING 0x00ff /* if non zero,waiting,else either \ + running or ready to run */ + #define W_INT 0x0001 /* set if waiting for interrupt */ + #define W_LOCK 0x0002 /* set if waiting for resource lock */ + #define W_SCREEN 0x0004 /* waiting for screen switch */ + #define SLEEPING 0x0008 /* set if sleeping */ + #define STOPPED 0x0010 /* set if stopped */ + #define W_PAUSE 0x0020 /* set if BREAK-S */ + #define W_SEMA 0x0040 /* set if waiting for semaphore */ + #define SR_PAGE 0x0100 /* set if need cntx swtch THEO+Grafx */ + #define MUST_COMPLETE 0x0200 /* set if task cannot be context + switched away */ + + unsigned short tib; /* [02] - TSS selector */ + + unsigned short pending; /* [04] - traps pending */ + #define QUITPEND 0x0001 /* set if BREAK-Q pending */ + #define CANPEND 0x0002 /* set if BREAK-C pending */ + #define ALRMPEND 0x0004 /* set if alarm pending */ + #define OVFPEND 0x0008 /* set if overflow/underflow pending */ + #define DIV0PEND 0x0010 /* set if divide by zero pending */ + #define FUNPEND 0x0020 /* set if function error pending */ + #define BOUNDPEN 0x0040 /* set if array bounds pending */ + #define FPEPEND 0x0080 /* set if floating point exception */ + #define SESSPEND 0x0200 /* set if need to switch sessions */ + #define FORCPEND 0x1000 /* set if FORCE pending */ + #define DEBPEND 0x2000 /* set if BREAK-D pending */ + #define KILLPEND 0x4000 /* set if kill syscall pending */ + #define STAGE 0x8000 /* set if staging the trap */ + + char taskprty; /* [06] - priority level */ + char tasklev; /* [07] - task level,0 == main task */ + unsigned long cputime; /* [08] - amount of CPU time */ + unsigned long sleeptime; /* [0C] - sleep time remain */ + near struct pcb *prtylink; /* [10] - link to next PID same prty */ + unsigned char taskfath; /* [12] - PID of parent task */ + char waitsema; /* [13] - semaphore if W_SEMA */ +}; +@pdl +pdl (THEOS) Public Device List +#include +struct pdl { + char ucbnum; /* ucb index */ + char pid; /* owner pid + 1 */ + short open_ct; /* number of opens */ +}; +@pipehdr +pipehdr (THEOS) PIPE control structure +#include +struct pipehdr { + unsigned pnext; /* fwd link to next pipe */ + unsigned pprev; /* back link to prev pipe */ + char pname[16]; /* pipe name (space pad) */ + char prd_ct; /* reader count */ + char pwr_ct; /* writer count */ + char prd_pid; /* pid of read waiter */ + char pwr_pid; /* pid of write waiter */ + unsigned psize; /* size of pipe buffer (exclude header) */ + unsigned pcount; /* number of chars in buffer */ + unsigned phead; /* read offset */ + unsigned ptail; /* write offset */ + char pbuf[]; /* pipe circular buffer */ +}; +@rlt +rlt (THEOS) Rocord Lock Table +#include +struct rlt { + short fsa_num; /* [00] - fsa number */ + unsigned char lockpid; /* [02] - locking pid plus one */ + long lockad; /* [03] - byte address */ + near struct rlt *fwd_rlt; /* [07] - fwd ptr to next */ +}; /* rlt len = 9 bytes */ +@scr +scr (THEOS) System Communication Region +#include +struct scr { + char logonname[8]; /* [00] - user name */ + unsigned short usernum; /* [08] - user number */ + char logdate[3]; /* [0A] - logon date */ + char logtime[3]; /* [0D] - logon time */ + unsigned char conmask; /* [10] - console mask: + 76543210 + �������� = 1st char ctl is ok + �������� = suppress output if stack + �������� = stacked lines + �������� = no page wait + �������� = output suppress + �������� = inverted case + �������� = upper case + �������� = echo mode */ + unsigned char csisw; /* [11] - csi switch: + 76543210 + �������� = return from logon + �������� = execute csi command + �������� = from exec + �������� = nomsg + �������� = rdymsg + �������� = usersyn + �������� = stdsyn + �������� = abbrev */ + unsigned char execsw; /* [12] - exec switch: + 76543210 + �������� = CSI lower case + �������� = error + �������� = noecho + �������� = trace + �������� = ctl on */ + char pgmtime[3]; /* [13] - program start time */ + char pgmname[8]; /* [16] - program name */ + unsigned short execloc; /* [1E] - location in system.exec */ + near char *slofs; /* [20] - stacked line offset */ + unsigned short slseg; /* [22] - stacked line segment */ + near char *memhead; /* [24] - malloc head */ + char pipenr; /* [26] - next pipe number (0-25) */ + char privlev; /* [27] - privlege level */ + char lub[52]; /* [28] - lub table + unsigned short trapseg; /* [5C] - signal code segment */ + near void *quittrap; /* [5E] - break,q trap */ + near void *cantrap; /* [60] - break,c trap */ + near void *alrmtrap; /* [62] - alarm trap */ + near void *ovftrap; /* [64] - overflow/underflow trap */ + near void *div0trap; /* [66] - divide by zero trap */ + near void *funtrap; /* [68] - function argument trap */ + near void *boundtrap; /* [6A] - array bounds trap */ + near void *fpetrap; /* [6C] - floating point except trap */ + long cputimes; /* [6E] - cpu time start */ + char err_ext[3]; /* [72] - SYSTEM.THEOS.MESSAGE xtent */ + char workdrive; /* [75] - default work drive */ + char searchseq[26]; /* [76] - search sequence */ + unsigned char foreign; /* [90] - Foreign language switch + 76543210 + ����.... = language code + �������� = not used + �������� = THEOS/Z80 style modify + �������� = no quit + �������� = decimal is comma */ + char deflib[19]; /* [91] - default library */ + char cmdlib[9]; /* [A4] - cmd library */ + char maclib[9]; /* [AD] - macro library */ + char objlib[9]; /* [B6] - object library */ + char copylib[9]; /* [BF] - copy library */ + char linklib[9]; /* [C8] - link library */ + char synfile[9]; /* [D1] - synonym file */ + unsigned short comad; /* [DA] - BASIC286 common seg addr */ + char conbuf[8]; /* [DC] - console buffer (ungetch) */ + char tsb[16]; /* [E4] - tab set block */ + char cmdbuf[140]; /* [F4] - cmd storage */ + unsigned short quittraphi; /* [180] - high word */ + unsigned short cantraphi; /* [182] - high word */ + unsigned short alrmtraphi; /* [184] - high word */ + unsigned short ovftraphi; /* [186] - high word */ + unsigned short div0traphi; /* [188] - high word */ + unsigned short funtraphi; /* [18A] - high word */ + unsigned short boundtraphi; /* [18C] - high word */ + unsigned short fpetraphi; /* [18E] - high word */ + unsigned short memheadhi; /* [190] - high word */ + unsigned short cebphi; /* [192] - high word */ + unsigned short clev; /* [194] - call csi level */ + unsigned short cexec; /* [196] - execloc at call csi */ + near void *cebp; /* [198] - ebp at call csi */ + unsigned short cnlev; /* [19A] - next call csi level */ + char echo; /* [19C] - set if echoing */ + char echolub; /* [19D] - echo device */ + short echobuf; /* [19E] - buffer seg,if disk echo */ + short echofsa; /* [1A0] - fsa number */ + short echokl; /* [1A2] - offset if echo to spool */ + short echorl; /* [1A4] - page# if echo to spool */ + unsigned char echoct; /* [1A6] - buffer char ct */ + char loadtrap; /* [1A7] - debug trap on load */ + unsigned short snbseg; /* [1A8] - sema name block seg */ + char semaphor[8]; /* [1AA] - 64 semaphore bits */ + char sp_ll[4]; /* [1B2] - spool prt line len */ + char sp_pl[4]; /* [1B6] - spool prt page len */ + char sp_que[4]; /* [1BA] - spool prt que number */ + char sp_copies[4]; /* [1BE] - spool prt # copies */ + char sp_class[4]; /* [1C2] - spool prt class */ + char graphlub[4]; /* [1C6] - graphic lub number */ + unsigned short graphwork[4]; /* [1CA] - graphic work buffer */ + char graphdev[4]; /* [1D2] - graphic device number */ + char peeker; /* [1D6] - peeker pid number + 1 */ + char peekch; /* [1D7] - char to be peeked */ + char forcech; /* [1D8] - char from FORCE command */ + char cache_write_thru; /* [1D9] - set if write thru cache */ + unsigned short main_scr; /* [1DA] - alias to main task SCR */ + unsigned short main_data; /* [1DC] - alias to main task DATA */ + unsigned short atexit_ofshi; /* [1DE] - high word */ + char fill2[6]; /* [1E0] - filler */ + unsigned char lock_wait; /* [1E6] - seconds to wait for lock */ + unsigned char lock_remain; /* [1E7] - number seconds remain */ + char slave_ll; /* [1E8] - slave printer line length */ + char slave_pl; /* [1E9] - slave printer page length */ + char slave_ol; /* [1EA] - slave printer overflow */ + char slave_cl; /* [1EB] - slave printer cur line */ + char slave_cc; /* [1EC] - slave printer class code */ + unsigned short slave_seg; /* [1ED] - slave printer class seg */ + unsigned short environ_seg; /* [1EF] - segment of environment */ + near char *atexit_ofs; /* [1F1] - at exit offset */ + unsigned short atexit_seg; /* [1F3] - at exit segment */ + char csi_color[4]; /* [1F5] - normal crt color */ + unsigned cmdnum; /* [1F9] - command number */ + char fill3[5]; /* [1FB] - filler */ +}; /* length = 512 */ +@jmp_buf +jmp_buf (THEOS) Non-Local Jumps +#include +struct FarPointer { + void *ptr; + short seg; +}; + +typedef struct jmp_buf { + struct FarPointer _jmp_eip; /* return pointer */ + struct FarPointer _jmp_esp; /* stack pointer */ + void *_jmp_ebp; /* frame pointer */ + long _jmp_reg[3]; /* registers */ +} jmp_buf; +@tm +tm (ANSI) Date and time structure +#include +struct tm { + short tm_sec; /* seconds after the minute [0,60] */ + short tm_min; /* minutes after the hour [0,59] */ + short tm_hour; /* hours since midnight [0,23] */ + short tm_mday; /* day of the month [1,31] */ + short tm_mon; /* months since January [0,11] */ + short tm_year; /* years since 1900 */ + short tm_wday; /* days since Sunday [0,6] */ + short tm_yday; /* days since January 1 [0,365] */ + short tm_isdst; /* Daylight Savings Time flag */ +}; +@ucb +ucb (THEOS) Unit Control Block for character devices +#include +struct ucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short ubuf_ofs2; /* [06] - high ubuf_ofs pointer */ + char devtype; /* [08] - device type: + 76543210 + �����100 byte i/o + �������� = console + �������� = 2nd char of DCA + �������� = 3rd char of DCA + �������� = keyboard off + �������� = 2nd char of BREAK */ + char devowner; /* [09] - owner process id */ + char classnr; /* [0A] - class number */ + char ll; /* [0B] - line length */ + char pl; /* [0C] - page length */ + char ol; /* [0D] - overflow lines */ + char baud; /* [0E] - baud rate: + 76543210 + xxxx.... If Sync option bit: + 0001.... BSC + 0010.... SDLC + 0011.... HDLC + 0100.... X.25 + 0101.... SNA + 0110.... GPIB + 0111.... thru 1111.... user defined + ....xxxx ASYNC baud rates: + 0 = no software baud + 1 = 56000 + 2 = 38400 + 3 = 110 + 4 = 135 + 5 = 150 + 6 = 300 + 7 = 600 + 8 = 1200 + 9 = 1800 + 10 = 2400 + 11 = 3600 + 12 = 4800 + 13 = 7200 + 14 = 9600 + 15 = 19200 + ....xxxx SYNC baud rates: + 1 = 1200 + 2 = 2400 + 3 = 4800 + 4 = 9600 + 5 = 19200 + 6 = 38400 + 7 = 48000 + 8 = 56000 + 9 = 64000 + 10 = 100000 + 11 = 200000 + 12 = 500000 + 13 = 800000 */ + char lfdly; /* [0F] - line feed delay */ + char ffdly; /* [10] - form feed delay */ + char option; /* [11] - option byte: + 76543210 + 00...... no parity + 01...... parity zero + 10...... parity odd + 11...... parity even + ..1..... synchronous + ...1.... alf + ....1... 8 bit words + .....001 dtr enable (1) + .....010 xon/xoff enable (2) + .....011 etx/ack enable (3) + .....100 cts enable (4) + .....101 xpc (5) */ + char curline; /* [12] - current line system use */ + char curcol; /* [13] - current column system use */ + unsigned short transeg; /* [14] - translate segment addr */ + near void *ubuf_ofs; /* [16] - user buffer offset */ + unsigned short ubuf_seg; /* [18] - user buffer segment */ + char scantmp; /* [1A] - scan code temporary */ + char prot_st; /* [1B] - protocol (XON/XOFF) status */ + char scan_st; /* [1C] - scan code status: + 76543210 + ��������� = shift + ��������� = compose + ��������� = ctl + ��������� = alt + ��������� = scroll lock + ��������� = num lock + ��������� = caps lock + ��������� = Kanji mode */ + char brk_chr; /* [1D] - break character */ + short attrib; /* [1E] - system use (saves crt attribute) + 5432109876543210 + ��������������� = protect + ��������������� = format + ��������������� = reverse + ��������������� = blink + ��������������� = underline + ��������������� = takes space + ��������������� = last was attr + ��������������� = caused newline + ��������������� = slave prt attached + ��������������� = slave prt enabled + ��������������� = esc mode + ��������������� = status mode + ��������������� = status ignore + ��������������� = last was prt cr + ��������������� = line graphic mode */ + /* ucb len = 32 */ +}; +@diskucb +diskucb (THEOS) Unit Control Block for disk devices +#include +struct diskucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short iobuff2; /* [06] - i/o buffer 2 */ + char devtype; /* [08] - device type: + 76543210 + .....001 = disk + ....1001 = disk,need label + .001.... = single density + .010.... = double density + .011.... = cyl0 = single,other dbl + .100.... = cyl0,hd0=128 other 256 + .101.... = 2048 byte sects + .110.... = 1024 byte sects + .111.... = 512 byte sects (IBM PC) + 0....... = removable volume + 1....... = fixed volume */ + char devowner; /* [09] - owner process id 0xff = public */ + char volname[8]; /* [0A] - volume id */ + unsigned short dirsize; /* [12] - directory size */ + short cyls; /* [14] - number of cylinders */ + char heads; /* [16] - number of heads */ + char sects; /* [17] - number of sectors */ + char hdldly; /* [18] - head load delay */ + char stpdly; /* [19] - step delay */ + char stsdly; /* [1A] - step settle delay */ + short curcyl; /* [1B] - current cylinder */ + char diskfill[3]; /* [1D] - work space 3 bytes */ + /* diskucb len = 32 */ +}; +@tapeucb +tapeucb (THEOS) Unit Control Block for tape devices +#include +struct tapeucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short iobuff2; /* [06] - i/o buffer 2 */ + char devtype; /* [08] - device type: + 76543210 + .....010 = tape */ + char devowner; /* [09] - owner process id */ + char volname[8]; /* [0A] - volume id */ + short blocknr; /* [12] - block count */ + short filenr; /* [14] - file number */ + short volnr; /* [16] - volume number */ + char devtrack; /* [18] - tape track or channel number */ + unsigned short iostat; /* [19] - status of last I/O */ + unsigned short rdlen; /* [1B] - length of last read */ + char tapefill[3]; /* [1D] - filler,tapeucb len = 32 */ +}; +@diskcntl +diskcntl (THEOS) Extended I/O structure for disk devices +#include +struct diskcntl { + short c_cmd; /* command code: + 0 = home heads to cylinder 0 + 1 = return drive status (MFG dependent) + 2 = read sectors + 3 = write sectors + 4 = format (MFG dependent) + 99 = land heads to safe landing zone */ + long c_sect; /* sector number */ + char *c_buf; /* buffer offset */ + unsigned short c_seg; /* buffer segment */ + short c_count; /* sector count */ + short c_cyl; /* cylinder number (format) */ + short c_head; /* head number (format) */ + short c_den; /* density (format) */ +}; +@bytecntl +bytecntl (THEOS) Extended I/O structure for character devices +#include +struct bytecntl { + short c_cmd; /* command code: + 1 = buffer status: + 76543210 + ��� = TxBUF not full + ��� = RxBUF not empty + 2 = modem status: + 5432109876543210 + 111100001111����� = DSR + 111100001111����� = CTS + 111100001111����� = RI + 111100001111����� = DCD + 3 = send break + 4 = use c_seg:c_buf input buffer: + struct { + short buf_len; + short buf_count; + short next_store; + short next_fetch; + char buf[buf_len]; + }; + 5 = raise DTR modem control + 6 = drop DTR modem control + 7 = raise RTS modem control + 8 = drop RTS modem control */ + short c_word1; + short c_word2; + char *c_buf; /* offset to buffer */ + unsigned short c_seg; /* selector for buffer */ +}; +@tapecntl +tapecntl (THEOS) Extended I/O structure for tape devices +#include +struct tapecntl { + short c_cmd; /* command code: + 1 = status: + 76543210 + ������ = BOT + ������ = EOT + ������ = Write Protect + ������ = Ready + ������ = Streamer + 2 = rewind + 3 = rewind & unload + 4 = write tape mark + 7 = erase tape (format) + 8 = re-tension + 9 = get length of last read + 110 = read + 111 = write */ + unsigned short c_tseg; /* read/write segment */ + char *c_tbuf; /* read/write offset */ + unsigned short c_tlen; /* read/write length */ +}; +@utimbuf +utimbuf (UNIX) File time modification structure +#include +struct utimbuf { + time_t actime; + time_t modtime; +}; +@VDIPB +VDIPB (THEOS) Vdi Parameters Block +#include +typedef struct { + short *control; + short *intin; + short *ptsin; + short *intout; + short *ptsout; + short vdinum; + unsigned vdiseg; +} VDIPB; +@UBUFFER +UBUFFER (THEOS) User Buffering +#include <_ucb.h> +typedef struct ubuffer { + short buf_len; + volatile short buf_count; + volatile short next_store; + volatile short next_fetch; + char buf[]; +} UBUFFER; +@lub +lub (THEOS) Device Logical Unit Blocks Numbers +#include +enum lub { + ADISK,BDISK,CDISK,DDISK,EDISK,FDISK,GDISK,HDISK,IDISK,JDISK, + KDISK,LDISK,MDISK,NDISK,ODISK,PDISK,QDISK,RDISK,SDISK,TDISK, + UDISK,VDISK,WDISK,XDISK,YDISK,ZDISK, + CONI,CONO, + PRT1,PRT2,PRT3,PRT4, + COM1,COM2,COM3,COM4, + TAP1,TAP2,TAP3,TAP4, + COM5,COM6,COM7,COM8,COM9,COM10,COM11,COM12,COM13,COM14,COM15, + COM16 +}; +@ diff --git a/libhelp/c.hlp b/libhelp/c.hlp new file mode 100644 index 0000000..acbbeca --- /dev/null +++ b/libhelp/c.hlp @@ -0,0 +1,4628 @@ +@_bios_keybrd +_bios_keybrd (MSVC) Return the keyboard status or keycode +#include +#include +unsigned short _bios_keybrd(unsigned short service) +See also: mapdoskey +@_errarg +_errarg (THEOS) Variable used by error message functions +#include +extern char *_errarg; +See also: strerror +@_errnum +_errnum (THEOS) External integer for return of error status +#include +extern short _errnum; +Functions setting _errnum: access,chdir,clearerr,diropen,erase,fclear,fclose, +fcreate,fopen and derivates,getmsg,mkdir,open,remove,rename,rmdir,topen,unlink +See also: errno,fperror +@_incrmem +_incrmem (THEOS) ??? +#include +char *_incrmem(size_t len); +@_mfg_get_date +_mfg_get_date (THEOS) Copy hardware date into the nuc structure +#include +void _mfg_get_date(void); +See also: _mfg_get_time,_mfg_put_date,_mfg_put_time +@_mfg_get_time +_mfg_get_time (THEOS) Copy hardware time into the nuc structure +#include +void _mfg_get_time(void); +See also: _mfg_get_date,_mfg_put_date,_mfg_put_time +@_mfg_init +_mfg_init (THEOS) Initialise system hardware +#include +long _mfg_init(long addr,long *store); +@_mfg_put_date +_mfg_put_date (THEOS) Copy date from the nuc structure to hardware +#include +void _mfg_put_date(void); +See also: _mfg_get_date,_mfg_get_time,_mfg_put_time +@_mfg_put_time +_mfg_put_time (THEOS) Copy time from the nuc structure to hardware +#include +void _mfg_put_time(void); +See also: _mfg_get_date,_mfg_get_time,_mfg_put_date +@_mfg_reserved +_mfg_reserved (THEOS) ??? +#include +void _mfg_reserved(void) +@_monthen +_monthen (THEOS) Return the number of days in a month +#include <_time.h> +short _monthen(short year,short month); +See also: leapyear,_yday +@_msec_off +_msec_off (THEOS) Turn off millisecond timing +#include +void _msec_off(void); +See also: msec_on +@_msec_on +_msec_on (THEOS) Turn on millisecond timing +#include +void _msec_on(void); +See also: msec_off +@_read +_read (THEOS) Read data from a file into any segment +#include +size_t _read(short fd,unsigned seg,void *buf,size_t len); +See also: close,creat,filelength,flush,lseek,open,read,tell,_write,write +@_rsvmem +_rsvmem (THEOS) ??? +#include +short *_rsvmem(long addr,long len,short code); +@_sched_int +_sched_int (THEOS) Schedule interrupt +#include +void _sched_int(short num,short (*addr)()); +@_set_slice +_set_slice (THEOS) Set the user time slice +#include +void _set_slice(short msec); +@_sema_isr +_sema_isr (THEOS) ??? +#include +_sema_isr(short pid,short num,short cmd); +@_setargv +_setargv (+THEOS) Expand wild cards argument to the list of matching files +#include <_stdlib.h> +short _setargv(short *pargc, char ***pargv); +Set : errno +@_sync +_sync (THEOS) Flush the cache +#include +void _sync(short code); +@_weekday +_weekday (THEOS) Return the number of the day in the week +#include <_time.h> +See also: leapyear,_monthen,_yday +@_write +_write (THEOS) Write data to a file from another memory segment +#include +size_t _write(short fd,unsigned seg,void *buf,size_t len); +See also: close,creat,filelength,flush,lseek,open,_read,read,tell,write +@_yday +_yday (THEOS) Return the number of days since the beginning of the year +@a64l +a64l (UNIX) Convert a number from a base-64 ASCII string to a long integer +#include +long a64l(const char *s); +See also: l64a +@abort +abort (ANSI) End program immediately +#include +void abort(void); +See also: exit +@abs +abs (ANSI) Return the absolute value of an integer +#include +short abs(short n); +See also: fabs +@access +access (UNIX) Check if a file can be accessed in a given mode +#include +short access(const char *filename,short mode); +mode : 0 existence, 1 execution, 2 write, 4 read +Set : errno,_errnum +See also: fperror,strerror +@acos +acos (ANSI) Calculate arc cosine +#include +double acos(double x); +@acot +acot (THEOS) Calculate arc cotangent +#include +double acot(double x); +@acsc +acsc (THEOS) Calculate arc cosecant +#include +double acsc(double x); +Set : errno +@addb +addb (THEOS) Add a value to a byte in another memory segment +#include +void addb(void *ofs,unsigned seg,char val); +See also: Other add functions +@addcs +addcs (THEOS) Add a value to a byte in the code segment +#include +void addcs(void *ofs,char val); +See also: Other add functions +@addl +addl (THEOS) Add a value to a long in another memory segment +#include +void addl(void *ofs,unsigned seg,long val); +See also: Other add functions +@addlcs +addlcs (THEOS) Add a value to a long in the code segment +#include +void addlcs(void *ofs,long val); +See also: Other add functions +@addw +addw (THEOS) Add a value to a word in another memory segment +#include +void addw(void *ofs,unsigned seg,short val); +See also: Other add functions +@addwcs +addwcs (THEOS) Add a value to a word in the code segment +#include +void addwcs(void *ofs,short val); +See also: Other add functions +@alarm +alarm (UNIX) Start a timer in seconds generating a signal interrupt +#include +short alarm(short secs); +See also: delay,msalarm,signal +@andb +andb (THEOS) And a value to a byte in another memory segment +#include +void andb(void *ofs,unsigned seg,char mask); +See also: Other and functions +@andcs +andcs (THEOS) And a value to a byte in the code segment +#include +void andcs(void *ofs,char mask); +See also: Other and functions +@andl +andl (THEOS) And a value to a long in another memory segment +#include +void andl(void *ofs,unsigned seg,long mask); +See also: Other and functions +@andlcs +andlcs (THEOS) And a value to a long in the code segment +#include +void andlcs(void *ofs,long mask); +See also: Other and functions +@andw +andw (THEOS) And a value to a word in another memory segment +#include +void andw(void *ofs,unsigned seg,short mask); +See also: Other and functions +@andwcs +andwcs (THEOS) And a value to a word in the code segment +#include +void andwcs(void *ofs,short mask); +See also: Other and functions +@asctime +asctime (ANSI) Convert time structure to ASCII string +#include +char *asctime(const struct tm *tmp); +See also: ctime,gmtime,localtime,mktime,strftime,time +@asec +asec (THEOS) Calculate arc secant +#include +double asec(double x); +Set : errno +@asin +asin (ANSI) Calculate inverse sine +#include +double asin(double x); +Set : errno +@assert +assert (ANSI) Check assertion at run time +#include +void assert(short expression); +@assert +#assert (ANSI) Check assertion at compile time +#assert expression +@at +at (THEOS) Position the cursor on the console +#include +void at(short x,short y); +See also: putch +@atan +atan (ANSI) Calculate inverse tangent +#include +double atan(double x); +@atan2 +atan2 (ANSI) Calculate inverse tangent +#include +double atan2(double num,double den); +Set : errno +@atexit +atexit (ANSI) Specifie a routine to call at normal exit time +#include +short atexit(void (*func)(void)); +See also: exit +@atof +atof (ANSI) Convert ASCII string to floating point +#include +double atof(const char *string); +See also: ftoa,strtod +@atoi +atoi (ANSI) Convert ASCII string to integer +#include +short atoi(const char *string); +Set : errno +See also: itoa +@atol +atol (ANSI) Convert ASCII string to long integer +#include +long atol(const char *string); +Set : errno +See also: ltoa,strtol,strtoul,ultoa +@bcd2ieee +bcd2ieee (THEOS) Convert a bcd floating point to ieee floating point +#include +void bcd2ieee(double *data); +See also: ieee2bcd +@bsearch +bsearch (ANSI) Perform a binary search in a sorted array +#include +void *bsearch(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: lfind,lsearch,qsort +@c3tol +c3tol (ANSI) Convert a three byte integer to a long integer +#include +long c3tol(const void *c); +See also: l3tol,ltoc3,ltol3 +@cabs +cabs (UNIX) Complex absolute value function +#include +double cabs(struct complex z); +@callcsi +callcsi (THEOS) See system +@calloc +calloc (ANSI) Allocate dynamic memory +#include +char *calloc(size_t count,size_t size); +See also: free,malloc,memset,realloc +@cclose +cclose (+THEOS) Close a serial communication file +#include +short cclose(FILE *port) +See also: ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@ccloseall +ccloseall (+THEOS) Close all serial communication files +#include +short ccloseall(void) +See also: cclose,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@ceil +ceil (UNIX) Return the smallest integer greater than or equal to a value +#include +double ceil(double z); +See also: floor, round +@cgetc +cgetc (+THEOS) Read a character from a communication file +#include +short cgetc(FILE *port); +See also: cclose,ccloseall,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@cgets +cgets (ANSI) Accept a string from the console +#include +char *cgets(char *buffer,short len); +See also: getch,fgets,gets +@chdir +chdir (UNIX) Change the current directory +#include +short chdir(const char *path); +Set : errno,_errnum +See also: mkdir,rmdir +@chgrow +chrow (+THEOS) Set the grow factor of file +#include <_io.h> +short chgrow(char *fname,short grow); +See also: filechange +@chlen +chlen (+THEOS) Change the record length and key length of a file +#include <_io.h> +short chlen(char *fname,unsigned short reclen,unsigned short keylen); +@chmod +chmod (+UNIX) Change protections of a file +#include <_io.h> +short chmod(const char *fname,short prot); +@chorg +chorg (+THEOS) Change the organization mode of a file +#include <_io.h> +short chorg(char *fname,unsigned short filestat); +@chown +chown (+UNIX) Change the owner of a file +#include <_io.h> +short chown(const char *fname,short uid,short gid); +@clearerr +clearerr (ANSI) Clear the end-of-file and error status of a file +#include +clearerr(FILE *fp); +Set : _errnum +See also: feof,ferror +@cld +cld (THEOS) Clear direction flag +#include +void cld(void); +See also: std +@cli +cli (THEOS) Clear interrupt +#include +void cli(void); +See also: sti +@clock +clock (ANSI) Get number of clock ticks since system boot +#include +clock_t clock(void); +See also: time +@clock_t +clock_t (ANSI) Type used for the number of clock ticks since system boot +#include +typedef long clock_t; +@close +close (UNIX) Close a file +#include +short close(short fd); +See also: creat,filelength,flush,lseek,open,_read,read,tell,_write,write +@closedir +closedir (+UNIX) Close the directory search +#include +void closedir(DIR*); +See also: opendir,readdir,seekdir,telldir,rewinddir +Set : errno +@con_tran +con_tran (THEOS) Test and translate system control codes +#include +short con_tran(struct ucb *ucb,short ch,unsigned seg,void *buf); +@conmask +conmask (THEOS) Set the console control mask +#include +void conmask(const char *s); +@conin +conin (THEOS) Read character from console +See getch +@conout +conout (THEOS) Display character on the console +See putch +@conrdy +conrdy (THEOS) Test if characters are available on the console +short conrdy(void); +@cos +cos (ANSI) Calculate cosine +#include +double cos(double radian); +Set : errno +@cosh +cosh (ANSI) Calculate hyperbolic cosine +#include +double cosh(double radian); +@cot +cot (THEOS) Calculate cotangent +#include +double cot(double radian); +@coth +coth (THEOS) Calculate hyperbolic cotangent +#include +double coth(double radian); +@cprintf +cprintf (MSC) Format and print text to the console +#include +short cprintf(const char *format,...); +Note: Floating point conversions are not supported +See also: fprintf,printf,sprintf,vfprintf,vprintf,vsprintf +@cputc +cputc (+THEOS) Write a character to a communication file +#include +void cputc(FILE *port,short c); +See also: cclose,ccloseall,cgetc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@cputs +cputs (ANSI) Write a string to the console +#include +void cputs(const char *s); +See also: cprintf,fputs,printf,putch,puts +@creat +creat (UNIX) Create/truncate a file +#include +short creat(const char *filename,short mode); +See also: close,filelength,flush,lseek,open,_read,read,tell,write,_write +@crt +crt (THEOS) See putchar +@crtcolor +crtcolor (THEOS) Change the colors of subsequent displays on the console +#include +void crtcolor(short fg,short bg,short rfg,short rbg); +See also: hascolor,CLASSGEN command +@csc +csc (THEOS) Calculate cosecant +#include +double csc(double radian); +@csch +csch (THEOS) Calculate hyperbolic cosecant +#include +double csch(double radian); +@csetbuf +csetbuf (+THEOS) Allocate an i/o buffer for a user buffered file +#include +void csetbuf(FILE *port,UBUFFER *buffer); +See also: cclose,ccloseall,cgetc,cputc,csetvbuf,getrxcnt,isrxempty,istxfull +@csetvbuf +csetvbuf (+THEOS) Allocate an i/o buffer for a user buffered file +#include +short csetvbuf(FILE *port,UBUFFER *buffer,short mode,size_t size); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,getrxcnt,isrxempty,istxfull +@csi +csi (THEOS) Execute a CSI command without returning to the current program +#include +void csi(const char *command); +See also: system +@ctime +ctime (ANSI) Convert system time to an ASCII string +#include +char *ctime(const time_t *timep); +See also: asctime,localtime,mktime,strftime,time +@cuserid +cuserid (THEOS) Return the account name currently logged +#include +char *cuserid(char *account); +See also: getlogin,getuid,logname +@datehdng +datehdng (THEOS) Internal function used by testhead +@daylight +daylight (ANSI) Variable indicating if daylight time is used +#include +extern short daylight; +See also: timezone,tzset,tzname +@dec +dec (THEOS) Decrement a byte in another memory segment +#include +void dec(void *ofs,unsigned seg); +See also: Other dec functions +@deccs +deccs (THEOS) Decrement a byte in the code segment +#include +void deccs(void *ofs); +See also: Other dec functions +@deccsl +deccsl (THEOS) Decrement a long in the code segment +#include +void deccsl(void *ofs); +See also: Other dec functions +@deccsw +deccsw (THEOS) Decrement a word in the code segment +#include +void deccsw(void *ofs); +See also: Other dec functions +@decl +decl (THEOS) Decrement a long in another memory segment +#include +void decl(void *ofs,unsigned seg); +See also: Other dec functions +@decw +decw (THEOS) Decrement a word in another memory segment +#include +void decw(void *ofs,unsigned seg); +See also: Other dec functions +@define +#define (ANSI) Define a variable as manifest constant +#define constant value +@delay +delay (THEOS) Suspend operation for a given time +#include +void delay(unsigned code); +See also: alarm,msalarm,sleep +@deletek +deletek (THEOS) Delete a record from on indexed or keyed file +#include +short deletek(FILE *file,const char *key); +See also: readk,readn,readp,writek +@devname +devname (+THEOS) Return the name of a physical device +#include <_stdio.h> +char* devname(int lub); +See also: termname,ttyname,vdiname +@devopen +devopen (THEOS) Open or close a device +#include <_sc.h> +void devopen(struct ucb *ucb,short cmd); +cmd = 0 : open. cmd = 1 : close +@difftime +difftime (ANSI) Return difference between two times +#include +double difftime(time_t newtime,time_t oldtime); +@dir_mount +dir_mount (THEOS) ??? +#include <_sc.h> +void dir_mount(struct diskucb *ucb); +@dir_rd +dir_rd (THEOS) Read a sector in the directory +#include +void dir_rd(struct diskucb *ucb,long sect,void *buf); +@dirclose +dirclose (THEOS) Close the directory search +#include +void dirclose(void); +See also: diropen,dirread,find_first,find_next +@diropen +diropen (THEOS) Open the directory search for files in the current account +#include +short diropen(const char *fn); +Set : _errnum +See also: dirclose,dirread,find_first,find_next +@dirread +dirread (THEOS) Find the next file in the directory +#include +char *dirread(void); +See also: dirclose,diropen,find_first,find_next +@disk_capacity +disk_capacity (THEOS) ??? +#include <_sc.h> +short disk_capacity(short lub,void *disk_struct); +@display +display (THEOS) Display a string on the console +See cputs +@div +div (ANSI) Return the quotient and remainder of the division of two integers +#include +div_t div(short numer,short denomin); +See also: ldiv +@div_t +div_t (ANSI) Used by div +#include +typedef struct {short quot,rem;} div_t; +@dup +dup (UNIX) Duplicate a file descriptor +#include +short dup(short fd); +Set : errno +See also: close,creat,open +@elif +#elif (ANSI) Include code conditionally +#elif (expression); +@else +#else (ANSI) Include code conditionally +#else +@endif +#endif (ANSI) End conditional inclusion of code +#endif +@erase +erase (THEOS) Erase an existing file +See remove +@errbot +errbot (THEOS) Display a system message at the bottom of the console +#include +short errbot(short num,const char *arg[],short c1,short c2,short c3,short c4); +See also: errmsg,putmsg,syserr,yesno +@errmsg +errmsg (THEOS) Display a system message on stderr +#include +void errmsg(short num,const char *arg[]); +See also: errbot,perror,putmsg,strerror,syserr +@errno +errno (ANSI) External integer for return of error status +#include +extern short errno; +Functions setting errno: access,acos,acsc,asec,asin,atan2,atoi,atol,chdir,cos, +dup,erase,fgetc,fputc,fstat,locking,log,log10,log2,mkdir,open,perror,pow,remove, +rename,rmdir,signal,sin,sqrt,stat,unlink,utime +See also: _errnum,perror +@execl +execl (UNIX) Transfer control to a new program +#include +void execl(const char *program,const char *arg0,...,const char *argn,NULL) +See also: execlp,execv,execvp,forktask,system +@execlp +execlp (UNIX) Transfer control to a new program +#include +void execlp(const char *program,const char *arg0,...,const char *argn,NULL) +See also: execl,execv,execvp,forktask,system +@execv +execv (UNIX) Transfer control to a new program +#include +void execv(const char *program,const char *arg[]); +See also: execl,execlp,execvp,forktask,system +@execvp +execvp (UNIX) Transfer control to a new program +#include +void execvp(const char *program,const char *arg[]); +See also: execl,execlp,execv,forktask,system +@exit +exit (ANSI) Terminate a program +#include +void exit(short status); +See also: abort,atexit,csi +@exp +exp (ANSI) Compute exponential function +#include +double exp(double z); +@fabs +fabs (ANSI) Compute absolute value +#include +double fabs(double z); +@farcat +farcat (THEOS) Concatenate strings from different memory segments +#include +void *farcat(unsigned tseg,char *to,unsigned fseg,const char *from); +See also: strcat +@farchr +farchr (THEOS) Locate the first occurence of a byte in a string +#include +void *farchr(unsigned seg,const void *ofs,short c); +See also: memchr,strpbrk,strchr,strrchr,strstr +@farcmp +farcmp (THEOS) Compare two buffers in different memory segments +#include +short farcmp(unsigned seg1,const void *ofs1,unsigned seg2,const void *ofs2, + size_t len); +See also: fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@farcpy +farcpy (THEOS) Copy one buffer to another buffer in another memory segment +#include +short farcpy(unsigned tseg,void *to,unsigned fseg,const void *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strdup,strmake,strncpy +@fareq +fareq (THEOS) Compare two string in different memory segments for equality +#include +short fareq(unsigned seg1,const void *ofs1,unsigned seg2,const void *ofs2); +See also: farcmp,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@farlen +farlen (THEOS) Return the length of a string in another memory segment +#include +size_t farlen(unsigned seg,const char *ofs); +See also: strlen +@farset +farset (THEOS) Initialize a buffer in another memory segment +#include +void *farset(unsigned seg,void *ofs,short c,size_t len); +See also: memset,strnfill,strnset,strset +@fbuf +fbuf (THEOS) Allocate an i/o buffer for an open file +#include +void fbuf(FILE *stream,void *buffer,size_t len); +See also: setbuf,setvbuf,vbuf +@fclear +fclear (+THEOS) Clear a direct,indexed or keyed file +#include <_stdio.h> +short fclear(char *fname); +Set : _errnum +@fclose +fclose (ANSI) Close a file +#include +short fclose(FILE *fp); +Set : _errnum +See also: fcloseall,fflush,flushall +@fcloseall +fcloseall (MSC) Close all the open files +#include +short fcloseall(void); +See also: fclose,fflush,flushall +@fcntl +fcntl (UNIX) Access to file control bloc +#include +short fcntl(FILE *stream,short type,size_t value); +See also: feof,fgetpos,fopen,fsetpos,ftell +@fcreate +fcreate (THEOS) Create an indexed,keyed or direct file +#include +short fcreate(const char *fname,const char *mode,short rlen,short klen,long size); +Set : _errnum +See also: creat,fopen,makelib +@fdopen +fdopen (UNIX) Return a stream pointer to a file opened by open,creat or pipe +#include +FILE *fdopen(short fd,const char *type); +See also: creat,fileno,open,pipe +@feof +feof (ANSI) Determine if a file's current position is at end-of-file +#include +short feof(FILE *fp); +@ferror +ferror (ANSI) Test an open file for its error status +#include +short ferror(FILE *fp); +See also: clearerr,feof,file_err,fperror +@fflush +fflush (ANSI) Write any data in a file's output buffer to the file +#include +short fflush(FILE *fp); +See also: flushall,fclose +@fgetc +fgetc (ANSI) Read one character from a stream +#include +short fgetc(FILE *fp); +Set : errno +See also: fgets,getch,getchar +@fgetl +fgetl (THEOS) Read a long integer from a stream +#include +long fgetl(FILE *fp); +See also: fgetc,fgetw,fputc,fputl,fputw +@fgetpos +fgetpos (ANSI) Get a file's current position pointer +#include +short fgetpos(FILE *fp,fpos_t *pos); +See also: fsetpos,ftell +@fgets +fgets (ANSI) Read a string from a stream up to a new line +#include +char *fgets(char *s,size_t n,FILE *fp); +See also: fgetsn,gets,keyin +@fgetsn +fgetsn (THEOS) Read a buffer from a stream +#include +char *fgetsn(char *s,size_t n,FILE *fp); +See also: fgets,gets,keyin +@fgetw +fgetw (THEOS) Read an integer from a stream +#include +short fgetw(FILE *fp); +See also: fgetc,fgetl,fputc,fputl,fputw +@fgrow +fgrow (THEOS) Set the grow factor of file +#include +short fgrow(FILE *fp,short grow); +See also: filechange +@file_err +file_err (THEOS) Test an open file and exit if error +#include +void file_err(FILE *fp); +See also: clearerr,feof,ferror,fperror,syserr +@filechange +filechange (THEOS) Change a file's directory entry (date,owner,protection...) +#include +short filechange(const char *fn,short type,size_t value); +See also: access,fgrow,utime +@filelength +filelength (+MSC) Return the current filelength +#include <_io.h> +size_t filelength(short fd); +See also: close,creat,flush,lseek,open,_read,read,tell,_write,write +@filelock +filelock (THEOS) Lock a region in a file +#include +short filelock(FILE *fp,short code,unsigned long from,unsigned long to); +See also: locking,reclock,recunlock,unlock +@fileno +fileno (UNIX) Get the file number of a open file +#include +short fileno(FILE *fp); +@find_first +find_first (MSC) Find first entry matching selection in the directory +short find_first(char *mask,void *diskfind); +See also: dirclose,diropen,dirread,find_next +@find_next +find_next (MSC) Find next entry matching selection in the directory +#include <_sc.h> +short find_next(void *diskfind); +See also: dirclose,diropen,dirread,find_first +@floor +floor (ANSI) Return the largest integer less than or equal to a value +#include +double floor(double z); +See also: ceil, round +@flush +flush (THEOS) Write any data in a file's output buffer to the file +#include +short flush(short filenum); +See also: close,creat,filelength,lseek,open,_read,read,tell,_write,write +@flushall +flushall (THEOS) Flush all the files opened for output +#include +short flushall(void); +See also: fflush +@fmod +fmod (ANSI) Return the remainder of a division +#include +double fmod(double x,double y); +@fopen +fopen (ANSI) Open a file +#include +FILE *fopen(const char *name,const char *type); +Set : _errnum +See also: access,freopen +@force +force (THEOS) Force another process to execute a command +#include +void force(short pid,char *cmd); +@fork +fork (UNIX) Spawn a sub-task in a free partition +#include +short fork(void); +See also: forktask,killtask,suicide +@forktask +forktask (UNIX) Spawn a sub-task in a given partition +short forktask(short pid); +See also: fork,killtask,suicide +@formask +formask (THEOS) Display disk format parameters and query +#include +void formask(void); +See also: formclear,formincr,formparm +@formclear +formclear (THEOS) Clear the disk directory +void formclear(struct diskucb *ucb,char *label,short dirct,short trkct, + short hdct,short sectct,short density); +See also: formask,formincr,formparm +@formincr +formincr (THEOS) Set disk format sectors interleave table +void formincr(short incr,short sects,short *lacetable); +See also: formask,formclear,formparm +@formparm +formparm (THEOS) Sets disk format parameters from command line +void formparm(short argc,char **argv); +See also: formask,formclear,formincr +@fperror +fperror (THEOS) Display the system message pointed by _errnum on stderr +#include +short fperror(); +See also: errmsg,file_err,perror,syserr +@fpos_t +fpos_t (ANSI) Used to represent the position in a file +#include +typedef long fpos_t; +@fprintf +fprintf (ANSI) Print formatted output to a stream +#include +short fprintf(FILE *fp,const char *format,...); +See also: cprintf,printf,sprintf,vfprintf,vprintf,vsprintf +@fputc +fputc (ANSI) Write a character to a stream +#include +short fputc(char c,FILE *fp); +Set : errno +See also: putc,putchar +@fputl +fputl (THEOS) Write a character to a stream +#include +long fputl(long l,FILE *fp); +See also: fgetc,fgetl,fgetw,fputc,fputw +@fputs +fputs (ANSI) Write a string to a stream +#include +short fputs(const char *string,FILE *fp); +See also: fputsn,fputsnl,puts +@fputsn +fputsn (THEOS) Write a buffer to a stream +#include +char *fputsn(const char *string,FILE *fp); +See also: fputs,fputsnl,puts +@fputsnl +fputsnl (ANSI) Write a buffer to a stream and append a newline +#include +short fputsnl(const char *string,FILE *fp); +See also: fputs,fputsn,puts +@fputw +fputw (THEOS) Write an integer to a stream +#include +short fputw(short word,FILE *fp); +@fread +fread (ANSI) Read data from file stream +#include +short fread(void *buffer,size_t size,size_t nitems,FILE *fp); +See also: fgets,fgetsn,fgetc,fgetl,fgetw +@free +free (ANSI) Return dynamic memory to free memory pool +#include +void free(void *ptr); +See also: calloc,malloc,realloc +@free_sel +free_sel (THEOS) Release a memory selector +#include +void free_sel(short sel); +See also: make_sel +@freopen +freopen (ANSI) Open a stream using an existing file stream pointer +#include +FILE *freopen(const char *filename,const char *type,FILE *fp); +See also: access,fdopen,fopen +@frexp +frexp (ANSI) Break a floating point into mantissa and exponent power of two +#include +double frexp(double x,short *ep); +See also: ldexp +@fscanf +fscanf (ANSI) Format input from a file stream +#include +short fscanf(FILE *fp,const char *format,...); +See also: scanf,sscanf +@fseek +fseek (ANSI) Change a stream position pointer +#include +short fseek(FILE *fp,fpos_t pos,short base); +See also: fsetpos,rewind,seek +@fsetpos +fsetpos (ANSI) Change a stream position pointer +#include +short fsetpos(FILE *fp,fpos_t pos); +See also: fseek,rewind,seek +@fsign +fsign (THEOS) Return the sign of a floating point value +#include +short fsign(double x); +@ftell +ftell (ANSI) Return current position of stream pointer +#include +long ftell(FILE *fp); +See also: fgetpos +@ftoa +ftoa (THEOS) Convert a floating point value to a string +#include +char *ftoa(char *s,double f); +See also: itoa,ltoa,utoa +@fwrite +fwrite (ANSI) Write data to a stream +#include +short fwrite(const void *buffer,size_t size,size_t n,FILE *fp); +See also: fputc,fputl,fputs,fputsn,fputsnl,fputw,putch +@gcd +gcd (THEOS) Return the greatest common divisor of two values +#include +double gcd(double x,double y); +@get_line +get_line (THEOS) Accept an edited line from the standard input +#include +char *get_line(char *line); +See also: gets +@get_sect +get_sect (THEOS) ??? +#include +struct fdb *get_sect(char *fn,char *buf,long *sect); +@getar +getar (THEOS) Internal function used by malloc +@getbp +getbp (THEOS) Return the value of the BP register +#include +void *getbp(void); +See also: getcs,getcsa,getds,getldt,gettib +@getc +getc (ANSI) Read a character from a stream +See fgetc +@getch +getch (MSC) Read a character from the console +#include +short getch(void); +See also: getc,getchar +@getchar +getchar (ANSI) Read character from the standard input +#include +short getchar(void); +See also: getc,getch +@getclass +getclass (THEOS) Return the console or printer class code +#include +short getclass(short lub); +@getcs +getcs (THEOS) Return the value of the CS register +#include +unsigned getcs(void); +See also: getbp,getcsa,getds,getldt,gettib +@getcsa +getcsa (THEOS) Return the value of the CS register +#include +unsigned getcsa(void); +See also: getbp,getcs,getds,getldt,gettib +@getcwd +getcwd (UNIX) Return the current directory name +#include +char *getcwd(char *s,size_t len); +@getdate +getdate (THEOS) Return the current system date +#include +char *getdate(char *buffer) +See also: gettime,time +@getdev +getdev (THEOS) Return the device or lub number of an open file +#include +short getdev(FILE *fp); +@getdevn +getdevn (+THEOS) Return the device or lub number of a device name +#include <_stdlib.h> +short getdevn(char *name); +@getds +getds (THEOS) Return the value of the DS register +#include +unsigned getds(void); +See also: getbp,getcs,getcsa,getldt,gettib +@getenv +getenv (ANSI) Read environmental variable +#include +char *getenv(const char *variable); +See also: getcwd,getlang,getlib,putenv +@getenvle +getenvle (THEOS) Internal function used by putenv +@getflag +getflag (THEOS) Get processor flag register +#include +long getflag(void); +@getfn +getfn (THEOS) Return the full pathname of a file +#include +char *getfn(char *fn); +See also: locate +@getkey +getkey (THEOS) Get a system keyword token +#include +short getkey(short keynum,char *s); +See also: keyclose,matcharg +@getlang +getlang (THEOS) Return the current language code for the partition +#include +short getlang(void); +See also: getenv +@getldt +getldt (THEOS) Return the Local Descriptor Table selector +#include +unsigned getldt(void); +See also: getbp,getcs,getcsa,getds,gettib +@getlib +getlib (THEOS) Return the default library name for the partition +#include +char *getlib(void); +See also: getcwd,getenv +@getlimit +getlimit (THEOS) Return the maximum address of a memory segment +#include +size_t getlimit(unsigned seg); +See also: getmem +@getll +getll (THEOS) Return the line length of the console or a printer +#include +short getll(short lub); +See also: getpl +@getlogin +getlogin (UNIX) Return the name of the account currently logged +#include +char *getlogin(void); +See also: cuserid,getuid,logname +@getlub +getlub (THEOS) Return the ucb number associated with a logical device +#include +short getlub(short lub); +See also: getucb +@getmem +getmem (THEOS) Allocate memory from the system pool +#include +unsigned getmem(size_t size,short table); +See also: calloc,malloc,putmem,shared +@getmsec +getmsec (THEOS) Return the current time of day to the nearest millisecond +#include +char *getmsec(char *s); +See also: gettime,ctime,time +@getmsg +getmsg (THEOS) Return a system message +#include +char *getmsg(short num); +Set : _errnum +See also: errbot,errmsg,putmsg,strerror,syserr +@getmsw +getmsw (THEOS) Get Machine Status Word +#include +long getmsw(void); +@getpid +getpid (UNIX) Return the process number +#include +short getpid(void); +See also: getppid +@getpl +getpl (THEOS) Return the page length of the console or a printer +#include +short getpl(short lub); +See also: getll +@getppid +getppid (UNIX) Return the parent partition number +#include +short getppid(void); +See also: getpid +@getpriv +getpriv (THEOS) Return the privilege level +#include +short getpriv(void); +@getprty +getprty (+THEOS) Return task priority +#include <_stdlib.h> +short getprty(); +See also: setprty +@getrxcnt +getrxcnt (+THEOS) Return the number of characters in the input buffer +#include +short getrxcnt(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,isrxempty,istxfull +@gets +gets (ANSI) Read string from the standard input +#include +char *gets(char *buffer); +See also: fgets,fgetsn,get_line,keyin +@gettib +gettib (THEOS) Return the Task Information Block selector +#include +unsigned gettib(void); +See also: getbp,getcs,getcsa,getds,getldt,tib +@gettime +gettime (THEOS) Return the current system time +#include +char *gettime(char *buffer); +See also: getdate,time +@getucb +getucb (THEOS) Return the address of the UCB associated with an attached device +#include +struct ucb *getucb(short lub); +See also: getlub +@getuid +getuid (UNIX) Return the number of the account currently logged +#include +short getuid(void); +See also: getlogin +@getver +getver (THEOS) Return the version number,name,serial number +#include +void getver(short code,char *str); +See also: getenv +@getvol +getvol (THEOS) Return a disk or tape volume label +#include +char *getvol(short lub); +@getw +getw (ANSI) Read a word from a file stream +See fgetw +@gmtime +gmtime (ANSI) Convert system time to calendar structure in GMT time +#include +struct tm *gmtime(const time_t *timep); +See also: asctime,ctime,localtime,mktime,strftime,time +@has +has (THEOS) Test if the console can display a character or an attribute +#include +short has(short c); +See also: hascolor +@hascolor +hascolor (THEOS) Test if the console can display colors +#include +short hascolor(void); +See also: crtcolor,has +@hasmouse +hasmouse (+THEOS) Test if a session mouse is available +#include +int hasmouse(void); +See also: mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@hypot +hypot (UNIX) Compute the length of the hypotenuse of a right triangle +#include +double hypot(double x,double y); +@i2tol +i2tol (THEOS) Convert two integers to a long integer +long i2tol(short i[2]); +Note: Not implemented in THEOS 386 C. +@ieee2bcd +ieee2bcd (THEOS) Convert an ieee floating point to bcd floating point +#include +void ieee2bcd(double *data) +See also: bcd2ieee +@if +#if (ANSI) Include code conditionally +#if (expression); +@ifdef +#ifdef (ANSI) Include code conditionally +#ifdef identifier +@ifndef +#ifndef (ANSI) Include code conditionally +#ifndef identifier +@inb +inb (THEOS) Read a byte from a i/o port +#include +unsigned inb(unsigned port); +See also: ind,insb,insd,insw,inw +@include +#include (ANSI) Copy a header file into a program +#include +#include "file.h" +@ind +ind (THEOS) Read a long from a i/o port +#include +unsigned long ind(unsigned port); +See also: inb,insb,insd,insw,inw +@insb +insb (THEOS) Read bytes from a i/o port +#include +void insb(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insd,insw,inw +@interrupt +interrupt (THEOS) Interrupt function declarator +void interrupt isr(void); +@insd +insd (THEOS) Read longs from a i/o port +#include +void insd(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insb,insw,inw +@insw +insw (THEOS) Read words from a i/o port +#include +void insw(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insb,insd,inw +@inw +inw (THEOS) Read a word on a i/o port +#include +unsigned inw(unsigned port); +See also: ind,insb,insd,insw,inw +@ioctl +ioctl (UNIX) Perform extended I/O control on devices +#include +short ioctl(FILE *fp,struct bytecntl *action); +short ioctl(FILE *fp,struct diskcntl *action); +short ioctl(FILE *fp,struct tapecntl *action); +@ip +ip (THEOS) Return the integral part of a value +#include +double ip(double x); +See also: modf +@inc +inc (THEOS) Increment a byte in another memory segment +#include +void inc(void *ofs,unsigned seg); +See also: Other inc functions +@inccs +inccs (THEOS) Increment a byte in the code segment +#include +void inccs(void *ofs); +See also: Other inc functions +@inccsl +inccsl (THEOS) Increment a long in the code segment +#include +void inccsl(void *ofs); +See also: Other inc functions +@inccsw +inccsw (THEOS) Increment a word in the code segment +#include +void inccsw(void *ofs); +See also: Other inc functions +@incl +incl (THEOS) Increment a long in another memory segment +#include +void incl(void *ofs,unsigned seg); +See also: Other inc functions +@incw +incw (THEOS) Increment a word in another memory segment +#include +void incw(void *ofs,unsigned seg); +See also: Other inc functions +@isalnum +isalnum (ANSI) Check if a character is a number or letter +#include +short isalnum(short c); +See also: setlocale +@isalpha +isalpha (ANSI) Check if a character is a letter +#include +short isalpha(short c); +See also: setlocale +@isascii +isascii (UNIX) Check if a character is an ASCII character +#include +short isascii(short c); +See also: setlocale +@isatty +isatty (UNIX) Check if an open file is a serial communication device +#include +short isatty(FILE *stream); +@iscntrl +iscntrl (ANSI) Check if a character is a control character +#include +short iscntrl(short c); +@iscomname +iscomname (+THEOS) Test if a file name is a valid com port name +#include <_stdlib.h> +short iscomname(char *filename); +@iscon +iscon (THEOS) Check if an open file is the console +#include +short iscon(FILE *stream); +@iscsym +iscsym (THEOS) Test if a character is alphabetic or an underscore +#include +short iscsym(short c); +See also: iscsymnum +@iscsymnum +iscsymnum (THEOS) Test if a character is alphanumeric or an underscore +#include +short iscsymnum(short c); +See also: iscsym +@isdigit +isdigit (ANSI) Check if a character is a decimal diqit +#include +short isdigit(short c); +@isdisp +isdisp (THEOS) Check if a character is displayable by most terminal +#include +short isdisp(short c); +See also: isgraph,isprint +@isfnsym +isfnsym (THEOS) Check if a character is valid for a file name +#include +short isfnsym(short c); +See also: issymbol,issymnum +@isgraph +isgraph (ANSI) Check if a character is visible when printed +#include +short isgraph(short c); +See also: setlocale +@ishex +ishex (THEOS) Check if a character is a hexadecimal digit +#include +short ishex(short c); +See also: isxdigit +@isinter +isinter (+THEOS) Check if a character is an international character +#include +short isinter(short c); +See also: isalpha +@islower +islower (ANSI) Check if a character is a lower-case letter +#include +short islower(short c); +See also: setlocale +@isoctal +isoctal (THEOS) Check if a character is an octal digit +#include +short isoctal(short c); +@isprint +isprint (ANSI) Check if a character is visible or is a space +#include +short isprint(short c); +See also: setlocale +@isprtname +isprtname (+THEOS) Test if a file name is a valid printer name +#include <_stdlib.h> +short isprtname(char *filename); +@ispunct +ispunct (ANSI) Check if a character is a punctuation mark +#include +short ispunct(short c); +See also: setlocale +@isrxempty +isrxempty (+THEOS) Test if an input buffer is empty +#include +short isrxempty(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,istxfull +@issesdev +issesdev (+THEOS) Test if a device is session capable +#include <_stdlib.h> +short issesdev(FILE *fp); +@isspace +isspace (ANSI) Check if a character prints white space +#include +short isspace(short c); +@issymbol +issymbol (THEOS) Check if a character is a valid first character for a file name +#include +short issymbol(short c); +See also: issymnum +@issymnum +issymnum (THEOS) Check if a character is a valid character for a symbol +#include +short issymnum(short c); +See also: issymbol +@istapname +istapname (+THEOS) Test if a file name is a valid tape name +#include <_stdlib.h> +short istapname(char *filename); +@istxfull +istxfull (+THEOS) Test if an input buffer is empty +#include +short istxfull(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,istxfull +@isupper +isupper (ANSI) Check if a character is an upper-case letter +#include +short isupper(short c); +See also: setlocale +@isv86 +isv86 (THEOS) Test if a process is running in Virtual 86 mode +short isv86(short pid); +@isxdigit +isxdigit (ANSI) Check if a charcter is an hexadecimal digit +#include +short isxdigit(short c); +See also: ishex +@itoa +itoa (THEOS) Convert an integer into an ASCII string +#include +char *itoa(char *s,short i); +See also: ftoa,ltoa,utoa +@keyclose +keyclose (THEOS) Close the keyword file used with getkey +#include +void keyclose(void); +See also: getkey,testarg +@keyin +keyin (THEOS) See cgets +@killtask +killtask (THEOS) Kill a subtask +#include +void killtask(short pid); +See also: fork,forktask,suicide +@l3tol +l3tol (UNIX) Convert three bytes integers to longs integers +#include +void l3tol(long *l,const char *c,short cnt); +See also: c3tol,ltoc3,ltol3 +@l64a +l64a (UNIX) Convert a long integer to a base-64 ASCII string +#include +char *l64a(long x); +See also: a64l +@labs +labs (ANSI) Return the absolute value of an long integer +#include +long labs(long l); +See also: abs,fabs +@ldeletek +ldeletek (THEOS) Delete a record from a direct access file +#include +short ldeletek(FILE *fp,const long *key); +See also: lreadk,lreadn,lwritek +@ldexp +ldexp (ANSI) Combine fraction and exponent +#include +double ldexp(double x,short exp); +See also: frexp +@ldiv +ldiv (ANSI) Return the quotient and remainder of the division of two longs +#include +ldiv_t ldiv(long numer,long denom) +@ldiv_t +ldiv_t (ANSI) used by ldiv +#include +typedef struct {long quot,rem;} ldiv_t; +See also: div +@leapyear +leapyear (THEOS) Indicate if a year is a leap year +#include +short leapyear(short year); +See also: _monthen,_yday +@lfind +lfind (MSC) Perform a linear search of an array +#include +void *lfind(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,lsearch,qsort +@line +#line (ANSI) Reset line numbering +#line number +#line number filename +@linput +linput (+THEOS) Accept a data field from the keyboard like BASIC LINPUT +#include <_stdlib.h> +short linput(char *case,char *before_msg,char *after_msg,char *input_var, + char *output_var,short length,short timeout,short timeout_key); +@load +load (THEOS) Load a program into memory +#include +unsigned load(const char *program,short type); +See also: unload +@load_yn +load_yn (THEOS) Initialise the yesno function +#include +void load_yn(void); +See also: yesno +@loc1 +loc1 (THEOS) Reserved variable for regex +#include +extern char *loc1; +@localtime +localtime (ANSI) Convert system time to calendar structure +#include +struct tm *localtime(time_t *timep); +See also: asctime,ctime,gmtime,mktime,strftime,time +@locate +locate (THEOS) Find a file on disk and return a copy of its FDB +#include +struct fdb *locate(const char *filename,char *buf,short *lub); +See also: getfn +@lock_time +lock_time (THEOS) Set the maximum lock time wait +#include <_stdlib.h> +void lock_time(unsigned char seconds); +See also: timeout +@locking +locking (MSC) Lock or unlock a record in a file +#include +short locking(FILE *fp,short mode,long size); +Set : errno +See also: filelock,reclock,recunlock,unlock +@lockres +lockres (THEOS) "Unlock" a byte in memory +#include +void lockres(void *ofs,unsigned seg); +See also: lockset +@lockset +lockset (THEOS) "Lock" a byte in memory +#include +void lockset(void *ofs,unsigned seg); +See also: lockres +@log +log (ANSI) Compute natural logarithm +#include +double log(double z); +Set : errno +See also: log10,log2 +@log10 +log10 (ANSI) Compute common logarithm +#include +double log10(double z); +Set : errno +See also: log,log2 +@log2 +log2 (THEOS) Compute base 2 logarithm +#include +double log2(double z); +Set : errno +See also: log,log10 +@logname +logname (UNIX) Return the account name currently logged +#include +char *logname(void); +See also: cuserid,getlogin,getuid +@longjmp +longjmp (ANSI) Return from a non-local goto +#include +short longjmp(jmp_buf env,short rval); +See also: setjmp +@lowcase +lowcase (THEOS) See strlwr +@lprime +lprime (+THEOS) Compute the smallest prime greater than or equal to a number +#include <_stdlib.h> +unsigned long lprime(unsigned long n); +See also: prime +@lreadk +lreadk (THEOS) Read a record from a direct access file +#include +short lreadk(FILE *fp,const long *key,void *rec); +See also: ldeletek,lreadn,lwritek +@lreadn +lreadn (THEOS) Read the next record from a direct access file +#include +short lreadn(FILE *fp,long *key,void *rec); +See also: ldeletek,lreadk,lwritek +@lsearch +lsearch (UNIX) Perform a linear search of an array,insert key if non existent +#include +void *lsearch(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,lfind,qsort +@lseek +lseek (UNIX) Set read/write position +#include +long lseek(short fd,short how,long where); +See also: close,creat,filelength,flush,open,_read,read,tell,_write,write +@ltoa +ltoa (THEOS) Convert an long integer into an ASCII string +#include +char *ltoa(char *s,short l); +See also: ftoa,itoa,utoa +@ltoc3 +ltoc3 (THEOS) Convert a long integer to a three byte integer +#include +long ltoc3(void *c,long l); +See also: c3tol,l3tol,ltol3 +@ltol3 +ltol3 (UNIX) Convert long integers to three byte integers +#include +long ltol3(void *c,const long *l,short cnt); +See also: c3tol,l3tol,ltoc3 +@lwritek +lwritek (THEOS) Write a record to a direct access file +#include +short lwritek(FILE *fp,const long *key,const void *rec); +See also: ldeletek,lreadk,lreadn +@make_sel +make_sel (THEOS) Create a memory selector +#include +void make_sel(short sel,size_t limit,unsigned long base,short int); +See also: free_sel +@makelib +makelib (THEOS) Create a library file +#include +unsigned makelib(const char *filename,short size); +See also: fcreate +@malloc +malloc (ANSI) Allocate dynamic memory +#include +char *malloc(size_t size); +@match +match (THEOS) Compare a string against a format mask +#include +short match(const char *string,const char *mask); +See also: strcmp,streq +@mapdoskey +mapdoskey (+THEOS) Convert THEOS keycodes to PC keycodes +#include +#include +unsigned short mapdoskey(unsigned short key); +See also: _bios_keybrd +@matcharg +matcharg (THEOS) Compare one string with another with abbreviation capability +#include +short matcharg(const char *string,const char *keyword,short min); +See also: strcmp,streq,strncmp,testarg +@max +max (UNIX) Return the larger of two integers +#include +short max(short a,short b); +@max_alloc +max_alloc (THEOS) Return the size of the larger memory bloc available +#include +size_t max_alloc(void); +See also: calloc,free,malloc,realloc,tot_alloc +@mem_grow +mem_grow (THEOS) ??? +#include +short mem_grow(short seg,long adjust); +@mem_ovly +mem_ovly (THEOS) Adjust the size of the data used by the program +#include +void mem_ovly(size_t size); +@memccpy +memccpy (UNIX) Copy a buffer into another for 'n' bytes or up to a character +#include +void *memcpy(void *to,const void *from,short c,size_t len); +See also: farcpy,memcpy,memmove,memrcpy,strcpy,strdup,strmake,strncpy +@memchr +memchr (ANSI) Locate the first occurrence of a byte in a buffer +#include +void *memchr(const void *buffer,unsigned character,size_t len); +See also: farchr,strpbrk,strchr,strrchr,strstr +@memcmp +memcmp (ANSI) Compare two buffers +#include +short memcmp(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@memcpy +memcpy (ANSI) Copy one buffer into another +#include +void *memcpy(void *to,const void *from,size_t len); +See also: farcpy,memccpy,memmove,memrcpy,strcpy,strdup,strmake,strncpy +@memeq +memeq (THEOS) Compare two buffers for equality +#include +short memeq(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memcmp,memicmp,strcmp,streq,stricmp,strncmp,strnicmp, + strneq +@memicmp +memicmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short memicmp(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memcmp,memeq,strcmp,streq,stricmp,strncmp,strneq,strnicmp +@memmove +memmove (ANSI) Copy one buffer into another with correct handling of overlapping +void *memmove(void *to,const void *from,size_t len); +See also: farcpy,memcpy,memccpy,memrcpy,strcpy,strdup,strmake,strncpy +@memrcpy +memrcpy (THEOS) Copy one buffer into another in reverse sequence +#include +void *memrcpy(void *to,const void *from,size_t len); +See also: farcpy,memcpy,memccpy,memmove,strcpy,strdup,strmake,strncpy +@memset +memset (ANSI) Fill a buffer with a character +#include +void *memset(char *buffer,short character,size_t len); +See also: farset,strnfill,strset,strnset +@menu +menu (THEOS) Display a menu and wait for a selection +#include +short menu(const char **menu,short count); +See also: menu2 +@menu2 +menu2 (THEOS) Display a menu and wait for a selection +#include +short menu2(const char **menu,short count,short start,short display); +See also: menu +@menumsg +menumsg (+THEOS) Display a menu line a wait for a selection +#include <_stdlib.h> +short menumsg(char *msg,char *key,short timeout,short timeout_key); +@min +min (UNIX) Return the smaller of two integers +#include +short min(short a,short b); +@mkdir +mkdir (MSC) Create a directory +#include +short mkdir(const char *filename); +Set : errno,_errnum +See also: chdir,rmdir +@mktemp +mktemp (UNIX) Generate a temporary file name +#include +char *mktemp(const char *template); +See also: tmpnam,tmpfile,tmpnam +@mktime +mktime (MSC) Convert a time structure into a calendar time +#include +time_t mktime(struct tm *timeptr) +See also: asctime,ctime,gmtime,localtime,strftime,time +@modf +modf (ANSI) Separate integral and fractional part +#include +double modf(double x,double *ip); +See also: ip +@mouse +mouse (+THEOS) Compute mouse position and buttons for subsequent use +#include +short mouse(void); +See also: hasmouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousebutton +mousebutton (+THEOS) Return mouse buttons state +#include +short mousebutton(void); +See also: hasmouse, mouse, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mouseclick +mouseclick (+THEOS) Set mouse click and dclick delay +#include +void mouseclick(long click); +See also: hasmouse, mouse, mousebutton, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousedisable +mousedisable (+THEOS) Disable the mouse +#include +void mousedisable(void); +See also: hasmouse, mouse, mousebutton, mouseclick, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mouseenable +mouseenable (+THEOS) Initialise and enable the mouse +#include +void mouseenable(void); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousemove +mousemove (+THEOS) Move the mouse pointer +#include +void mousemove(short col, short row); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousescale, mouseswap, mousetell, mousexy +@mousescale +mousescale (+THEOS) Set mouse sensitivity +#include +void mousescale(short scale); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mouseswap, mousetell, mousexy +@mouseswap +mouseswap (+THEOS) Swap mouse left and right buttons +#include +void mouseswap(short flag); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mousetell, mousexy +@mousetell +mousetell (+THEOS) Read mouse swap flag and sensitivity +#include +void mousetell(long *click, short *scale); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousexy +@mousexy +mousexy (+THEOS) Read mouse position +#include +void mousexy(short *col, short *row); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell +@move +move (THEOS) Copy one buffer to another buffer in another memory segment +Obsolete function,use farcpy +@msalarm +msalarm (THEOS) Start a timer in milli seconds generating a signal interrupt +#include +long msalarm(long msecs); +See also: delay,alarm,signal +@msgclose +msgclose (THEOS) Close the system message file +#include +void msgclose(void); +See also: getmsg +@no_val +no_val (THEOS) Value of no answer +extern char yes_val; +@NULL +NULL (ANSI) Nul pointer type +#include +#define NULL ((void *)0) +@offsetof +offsetof (ANSI) Offset between the beginning of a structure and a member +#include +offsetof(nom_de_structure,nom_de_membre) +@open +open (UNIX) Open a file +#include +short open(const char *filename,short type,...); +Set : errno,_errnum +See also: close,creat,filelength,flush,lseek,_read,read,tell,_write,write +@opendir +opendir (+UNIX) Open a directory +#include +DIR* opendir(const char* fname); +See also: readdir,closedir,seekdir,telldir,rewinddir +Set : errno +@openhelp +openhelp (THEOS) Open the help file for a program +#include +FILE *openhelp(const char *name); +See also: fopen +@openmenu +openmenu (THEOS) Open the menu file for a program +#include +FILE *openmenu(const char *name); +See also: fopen +@orb +orb (THEOS) Or a byte in another memory segment +#include +void orb(void *ofs,unsigned seg,char mask); +See also: Other or functions +@orcs +orcs (THEOS) Or a byte in the code segment +#include +void orcs(void *ofs,char mask); +See also: Other or functions +@orl +orl (THEOS) Or a long in another memory segment +#include +void orl(void *ofs,unsigned seg,long mask); +See also: Other or functions +@orlcs +orlcs (THEOS) Or a long in the code segment +#include +void orlcs(void *ofs,long mask); +See also: Other or functions +@orw +orw (THEOS) Or a word in another memory segment +#include +void orw(void *ofs,unsigned seg,short mask); +See also: Other or functions +@orwcs +orwcs (THEOS) Or a word in the code segment +#include +void orwcs(void *ofs,short mask); +See also: Other or functions +@outb +outb (THEOS) Write a byte into an i/o port +#include +void outb(unsigned port,char byte); +See also: outd,outsb,outsd,outsw,outw +@outd +outd (THEOS) Write a long into an i/o port +#include +void outd(unsigned port,unsigned long dword); +See also: outb,outsb,outsd,outsw,outw +@outsb +outsb (THEOS) Write bytes into an i/o port +#include +void outsb(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsd,outsw,outw +@outsd +outsd (THEOS) Write longs into an i/o port +#include +void outsd(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsb,outsw,outw +@outsw +outsw (THEOS) Write words into an i/o port +#include +void outsw(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsb,outsd,outw +@outw +outw (THEOS) Write a word into an i/o port +#include +void outw(unsigned port,unsigned word); +See also: outb,outd,outsb,outsd,outsw +@pagewait +pagewait (THEOS) Display the wait prompt and wait the a key +#include +short pagewait(void); +See also: getpl +@pause +pause (THEOS) Wait a state change on ii/o port 61 +void pause(char count); +@pcbsc +pcbsc (THEOS) Read or write char or words in the PCB of any process +#include <_sc.h> +long pcbsc(short type,void *ofs,void *arg); +Le premier PCB commence en PCBSTART,les PCB suivant sont conscutifs. Le +dernier PCB est suivi par un entier 0xFFFF. Tout accs une adresse plus +leve entraine un TRAP #13. + +type = 1 : lit un octet type = 2 : lit un mot de 16 bits +type = 0x8001 : crit un octet type = 0x8002 : crit un mot de 16 bits + +ofs pointe l'intrieur de la table des PCB +arg valeur crire si type = 0x8001 ou 0x8002 + +Lecture de l'tat du PID 0 : status = pcbsc(1,PCBSTART,(void *) 0); +Lecture de la version de l'OS : ver = pcbsc(-1,-1,-1); +@peek +peek (THEOS) Return a byte from another memory segment +#include +unsigned peek(const void *ofs,unsigned seg); +See also: Other peek functions +@peekchar +peekchar (THEOS) ??? +#include <_sc.h> +void peekchar(short pid,short type); +@peekcs +peekcs (THEOS) Return a byte from the code segment +#include +unsigned peekcs(const void *ofs); +See also: Other peek functions +@peekfsa +peekfsa (THEOS) ??? +#include <_sc.h> +short peekfsa(void *ofs); +@peekl +peekl (THEOS) Return a long from another memory segment +#include +unsigned long peekl(const void *ofs,unsigned seg); +See also: Other peek functions +@peeklcs +peeklcs (THEOS) Return a long from the code segment +#include +unsigned long peeklcs(const void *ofs); +See also: Other peek functions +@peeklnuc +peeklnuc (THEOS) Return a long from the nucleus segment +#include +unsigned long peeklnuc(const void *ofs); +See also: Other peek functions +@peeklscr +peeklscr (THEOS) Return a long from the SCR segment +#include +unsigned long peeklscr(const void *ofs); +See also: Other peek functions +@peeknuc +peeknuc (THEOS) Return a byte from the nucleus segment +#include +unsigned peeknuc(const void *ofs); +See also: Other peek functions +@peekp +peekp (THEOS) Return a pointer from another memory segment +#include +void *peekp(const void *ofs,unsigned seg); +See also: Other peek functions +@peekpcs +peekpcs (THEOS) Return a pointer from the code segment +#include +void *peekpcs(const void *ofs); +See also: Other peek functions +@peekpnuc +peekpnuc (THEOS) Return a pointer from the nucleus segment +#include +void *peekpnuc(const void *ofs); +See also: Other peek functions +@peekpscr +peekpscr (THEOS) Return a pointer from the SCR segment +#include +void *peekpscr(const void *ofs); +See also: Other peek functions +@peekscr +peekscr (THEOS) Return a byte from the SCR segment +#include +unsigned peekscr(const void *ofs); +See also: Other peek functions +@peektib +peektib (THEOS) Get bytes in the TIB or RCR of any process +#include <_sc.h> +long peektib(short pid,void *ofs); +L'adressage du scr peut tre indiqu en ajoutant 0x8000 l'offset +dans le scr. Ainsi : +peektib(pid,0x8000) quivaut peektib(pid,&TIB->scr.logonname[0]) +@peekw +peekw (THEOS) Return a word from another memory segment +#include +unsigned peekw(const void *ofs,unsigned seg); +See also: Other peek functions +@peekwcs +peekwcs (THEOS) Return a word from the code segment +#include +unsigned peekwcs(const void *ofs); +See also: Other peek functions +@peekwnuc +peekwnuc (THEOS) Return a word from the nucleus segment +#include +unsigned peekwnuc(const void *ofs); +See also: Other peek functions +@peekwscr +peekwscr (THEOS) Return a word from the SCR segment +#include +unsigned peekwscr(const void *ofs); +See also: Other peek functions +@perror +perror (ANSI) Display a program defined message with a message pointed by errno +#include +void perror(const char *string); +Set : errno +See also: errmsg,fperror,getmsg,strerror,syserr +@phy_addr +phy_addr (THEOS) Determine physical address of memory selector,lock and unlock +#include +unsigned long phy_addr(unsigned seg,void *offset,size_t len); +See also: getmem,putmem +@pipe +pipe (UNIX) Open an interprocess i/o channel +#include +short pipe(short filenum[2]); +See also: popen +@poke +poke (THEOS) Put a byte into another memory segment +#include +void poke(char val,void *ofs,unsigned seg); +See also: Other poke functions +@pokecs +pokecs (THEOS) Put a byte into the code segment +#include +void pokecs(char val,void *ofs); +See also: Other poke functions +@pokecsa +pokecsa (THEOS) Put a byte into the code segment +#include +void pokecsa(char val,void *ofs); +See also: Other poke functions +@pokel +pokel (THEOS) Put a long into another memory segment +#include +void pokel(long val,void *ofs,unsigned seg); +See also: Other poke functions +@pokelcs +pokelcs (THEOS) Put a long into the code segment +#include +void pokelcs(long val,void *ofs); +See also: Other poke functions +@pokelcsa +pokelcsa (THEOS) Put a long into the code segment +#include +void pokelcsa(long val,void *ofs); +See also: Other poke functions +@pokelscr +pokelscr (THEOS) Put a long into the SCR segment +#include +void pokelscr(long val,void *ofs); +See also: Other poke functions +@pokenuc +pokenuc (THEOS) Put a byte into the nucleus segment +#include +void pokenuc(short val,void *ofs); +See also: Other poke functions +@pokep +pokep (THEOS) Put a pointer into another memory segment +#include +void pokep(void *val,void *ofs,unsigned seg); +See also: Other poke functions +@pokepcs +pokepcs (THEOS) Put a pointer into the code segment +#include +void pokepcs(void *val,void *ofs); +See also: Other poke functions +@pokepcsa +pokepcsa (THEOS) Put a pointer into the code segment +#include +void pokepcsa(void *val,void *ofs); +See also: Other poke functions +@pokepscr +pokepscr (THEOS) Put a pointer into the SCR segment +#include +void pokepscr(void *val,void *ofs); +See also: Other poke functions +@pokescr +pokescr (THEOS) Put a byte into the SCR segment +#include +void pokescr(char val,void *ofs); +See also: Other poke functions +@pokeucb +pokeucb (THEOS) Put a byte into the UCB segment +#include +void pokeucb(short val,void *ofs); +See also: Other poke functions +@pokew +pokew (THEOS) Put a word into another memory segment +#include +void pokew(short val,void *ofs,unsigned seg); +See also: Other poke functions +@pokewcs +pokewcs (THEOS) Put a word into the code segment +#include +void pokewcs(short val,void *ofs); +See also: Other poke functions +@pokewcsa +pokewcsa (THEOS) Put a word into the code segment +#include +void pokewcsa(short val,void *ofs); +See also: Other poke functions +@pokewnuc +pokewnuc (THEOS) Put a word into the nucleus segment +#include +void pokewnuc(short val,void *ofs); +See also: Other poke functions +@pokewscr +pokewscr (THEOS) Put a word into the SCR segment +#include +void pokewscr(short val,void *ofs); +See also: Other poke functions +@pokewucb +pokewucb (THEOS) Put a word into the UCB segment +#include +void pokewucb(short val,void *ofs); +See also: Other poke functions +@popen +popen (UNIX) Open an interprocess i/o channel +#include +short popen(FILE **rd_pipe,FILE **wr_pipe); +See also: pipe +@popf +popf (THEOS) Pop flag register +#include +void popf(void); +See also: pushf +@pow +pow (ANSI) Compute a power of a number +#include +double pow(double z,double x); +Set : errno +@pragma +#pragma Sets compiler options +#pragma align 1 | 2 (default) | 4 +#pragma align struct | -struct (default) +#pragma char signed (default) | unsigned +#pragma field char | word (default) +#pragma float bcd | ieee (default) +#pragma float float (default) | double +#pragma int short (default) | long +#pragma library +#pragma prog version,priv[,mfg,serial][,"copyright"][,patchsize] +#pragma shift logical (default) | arithmetic +@pre_empt +pre_empt (THEOS) ??? +#include +void pre_empt(void); +@prime +prime (THEOS) Compute the smallest prime greater than or equal to a number +#include +unsigned prime(unsigned n); +See also: lprime +@printf +printf (ANSI) Format output +#include +short printf(const char *format,...); +See also: cprintf,fprintf,sprintf,vfprintf,vprintf,vsprintf +@pushf +pushf (THEOS) Push flag register +#include +void pushf(void); +@ptrdiff_t +ptrdiff_t (ANSI) Result type of the substraction of two pointers +#include +typedef long ptrdiff_t; +@putc +putc (ANSI) Write a character to a stream +#include +short putc(char c,FILE *fp); +See also: fputc,putchar +@putch +putch (MSC) Write a character to the console +#include +short putch(short c); +See also: fputc,putc,putchar +@putchar +putchar (ANSI) Write a character to standard output +#include +short putchar(short c); +@putenv +putenv (MSC) Set an environment variable +#include +short putenv(const char *s); +See also: getenv +@putmem +putmem (THEOS) Release memory allocated by getmem +#include +void putmem(unsigned seg); +See also: getmem +@putmsg +putmsg (THEOS) Display a message with parameter substitution +#include +void putmsg(const char *text,const char *arg[]); +See also: errbot,errmsg,getmsg,perror,syserr +@puts +puts (ANSI) Write a string to standard output +#include +void puts(const char *string); +See also: cputs,fputs +@putw +putw (ANSI) Write a word to a stream +#include +short putw(short word,FILE *fp); +See also: getw,fgetw,fputw +@qsort +qsort (ANSI) Sort arrays in memory +void qsort(const void **array,size_t nbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,sort +@quitoff +quitoff (THEOS) Mask the system quit key +#include +void quitoff(void); +See also: quiton +@quiton +quiton (THEOS) Re-enable the system quit key +#include +void quiton(void); +See also: quitoff +@raise +raise (ANSI) Force a signal interrupt +#include +short raise(short sig); +See also: signal +@rand +rand (ANSI) Generate pseudo-random numbers +#include +short rand(void); +See also: srand +@rbrk +rbrk (THEOS) Internal function +@read +read (ANSI) Read data from a file +#include +short read(short fd,void *buffer,size_t n); +See also: close,creat,filelength,flush,lseek,open,_read,tell,_write,write +@readdir +readdir (+UNIX) Read a directory entry +#include +struct dirent* readdir(DIR*); +See also: opendir,closedir,seekdir,telldir,rewinddir +Set : errno +@readk +readk (THEOS) Read a record from an indexed or keyed file +#include +short readk(FILE *fp,const char *key,void *rec); +See also: deletek,readn,readp,writek +@readn +readn (THEOS) Read next record from an indexed or keyed file +#include +short readn(FILE *fp,char *key,void *rec); +See also: deletek,readk,readp,writek +@readp +readp (THEOS) Read previous record from an indexed or keyed file +#include +short readp(FILE *fp,char *key,void *rec); +See also: deletek,readk,readn,writek +@realloc +realloc (ANSI) Reallocate dynamic memory +#include +char *realloc(void *ptr,size_t size); +See also: calloc,free,malloc,max_alloc,tot_alloc +@reclock +reclock (THEOS) Try to lock a record in a file stream or direct file +#include +short reclock(FILE *fp,fpos_t pos); +See also: filelock,locking,recunlock,unlock +@recunlock +recunlock (THEOS) Try to lock a record in a file stream or direct file +#include +short recunlock(FILE *fp,fpos_t pos); +See also: filelock,locking,reclock,unlock +@regcmp +regcmp (UNIX) Compile a search pattern to be used by the regex search function +#include +char *regcmp(char *pattern,...); +See also: regex,strchr,strstr +@regex +regex (UNIX) Perform a search on a string using a pattern compiled by regcmp +#include +char *regex(char *cpattern,char *object,...); +See also: regcmp,strchr,strstr +@remote +remote (THEOS) Call a function in another code segment +#include +remote(unsigned ofs,unsigned seg,...); +@remove +remove (ANSI) Erase a file +#include +short remove(const char *filename); +Set : errno,_errnum +See also: unlink +@rename +rename (ANSI) Change the name of a file +#include +short rename(const char *old,const char *new); +Set : errno,_errnum +@rewind +rewind (ANSI) Reset file pointer +#include +short rewind(FILE *fp); +See also: fseek,fsetpos,seek +@rewinddir +rewinddir (+UNIX) Sets the directory entry location to the beginning +#include +void rewinddir(DIR*); +See also: opendir,closedir,readdir,telldir,seekdir +@rmdir +rmdir (MSC) Removes a directory +#include +short rmdir(const char*dirname); +Set : errno,_errnum +See also: remove,unlink +@round +round (+THEOS) Round a value to the nearest integer +#include <_math.h> +double round(double value, int position) +See also: ceil, floor +@rsema +rsema (THEOS) Return the status of a remote semaphore +#include +short rsema(short pid,short sema_nbr); +See also: rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemaname +rsemaname (THEOS) Return the number of a remote semaphore +#include +short rsemaname(short pid,char *name); +See also: rsema,rsemares,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemares +rsemares (THEOS) Reset a remote semaphore +#include +short rsemares(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemaset +rsemaset (THEOS) Set a remote semaphore +#include +short rsemaset(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemawait +rsemawait (THEOS) Wait until a remote semaphore is set +#include +short rsemawait(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemares,sema,semaphore,semares,semaset, + semawait +@sbrk +sbrk (THEOS) Increase a program's data space +void *sbrk(short increment); +@scanf +scanf (ANSI) Accept and format input +#include +short scanf(char *format,...); +See also: fscanf,sscanf +@schedint +schedint (THEOS) Set or reset an interrupt service routine vector +#include +void schedint(long num,short (*isr)()); +@sec +sec (THEOS) Calculate secant +#include +double sec(double x); +@sech +sech (THEOS) Calculate hyperbolic secant +#include +double sech(double x); +@seek +seek (ANSI) Change a stream position pointer +#include +short seek(FILE *fp,short pos,short base); +See also: fsetpos,rewind,seek +@seekdir +seekdir (+UNIX) Sets the directory entry location +#include +void seekdir(DIR*,long); +See also: opendir,closedir,readdir,telldir,rewinddir +@sema +sema (THEOS) Return the status of a semaphore +#include +short rsema(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,semaphore,semares, + semaset,semawait +@semaphore +semaphore (THEOS) Return the number of a semaphore +#include +short semaphore(char *name); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semares,semaset, + semawait +@semares +semares (THEOS) Reset a semaphore +#include +short semares(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semaset, + semawait +@semaset +semaset (THEOS) Set a semaphore +#include +short semaset(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semares, + semawait +@semawait +semawait (THEOS) Wait until a semaphore is set +#include +short semawait(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemares,rsemawait,sema,semaphore,semares, + semaset +@setbuf +setbuf (ANSI) Allocate an i/o buffer for an open file +#include +void setbuf(FILE *fp,char *buffer); +See also: fbuf,setvbuf,vbuf +@setjmp +setjmp (ANSI) Save or restore the current execution environment for a longjmp +#include +short setjmp(jmp_buf env); +See also: longjmp +@setlocale +setlocale (ANSI) Change or return the current locale switches +#include +char *setlocale(short category,const char *locale); +See also: strcoll,strxfrm,is... and to... functions +@setprty +setprty (THEOS) Change the current process priority +#include +void setprty(short priority); +Set also: setslice,snu +@setvbuf +setvbuf (ANSI) Allocate an i/o buffer for an open file +#include +void setvbuf(FILE *fp,char *buffer,short mode,size_t len); +See also: fbuf,setbuf,vbuf +@sgetl +sgetl (THEOS) Retrieve a long integer stored with sputl +#include +long sgetl(char *buf); +See also: sputl +@shared +shared (THEOS) Define or access memory shared with other process +unsigned shared(char *name,size_t len); +See also: far...,getlimit,add...,and...,dec...,inc...,or...,peek...,poke..., + xor... +@sig_atomic_t +sig_atomic_t (ANSI) Used by signal +#include +typedef short sig_atomic_t; +@signal +signal (ANSI) Set the answer to an interrupt +#include +void *signal(short sig,void (*action()); +Set : errno +See also: alarm,msalarm,raise +@sin +sin (ANSI) Calculate sine +#include +double sin(double radian); +Set : errno +@sinh +sinh (ANSI) Calculate hyperbolic sine +#include +double sinh(double radian); +@size_t +size_t (ANSI) Result type of sizeof +#include +typedef unsigned long size_t; +@skipsp +skipsp (THEOS) Locate the next non-space character in a string +#include +char *skipsp(char *s); +See also: strpbrk +@sleep +sleep (UNIX) Suspend execution for a specified time +#include +void sleep(long msecs); +See also: alarm,clock,delay,msalarm,signal +@snu +snu (THEOS) Release any remaining time in this program's slice time +#include +void snu(void); +@sort +sort (THEOS) Sort an array in memory by rearranging an array of pointers +void sort(void **array,size_t nbr,short (*compar)(const void *,const void *)); +See also: qsort +@spawnl +spawnl (MSC) Spawn another program as a subtask +#include +short spawnl(short mode,const char *program,const char *arg,...,NULL); +Set : errno +See also: execl,execlp,execv,execvp,spawnlp,spawnv,spawnvp +@spawnlp +spawnlp (MSC) Spawn another program as a subtask +#include +short spawnlp(short mode,const char *path,const char *arg,...,NULL); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnv,spawnvp +@spawnv +spawnv (MSC) Spawn another program as a subtask +#include +short spawnv(short mode,const char *program,const char *arg[]); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnlp,spawnvp +@spawnvp +spawnvp (MSC) Spawn another program as a subtask +#include +short spawnvp(short mode,const char *program,const char *arg[]); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnlp,spawnv +@sprintf +sprintf (ANSI) Format output +#include +short sprintf(char *string,const char *format,...); +See also: cprintf,fprintf,printf,vfprintf,vprintf,vsprintf +@sputl +sputl (THEOS) Store a long in an hardware independent format +#include +long sputl(long l,char *buf); +See also: sgetl +@sqrt +sqrt (ANSI) Compute square root +#include +double sqrt(double z); +Set : errno +@srand +srand (ANSI) Seed pseudo-random number generator +#include +void srand(unsigned seed); +See also: rand +@sscanf +sscanf (ANSI) Format input from a string +#include +short sscanf(const char *string,const char *format,...); +@stat +stat (ANSI) Find file attributes +#include +short stat(char *file,struct stat *statptr); +Return : EOF or 0 +Set : errno + +struct stat { + dev_t st_dev; /* priphrique */ + ino_t st_ino; /* numro d'Inode = 0 */ + mode_t st_mode; /* lsb = protections, msb = filestat */ + nlink_t st_nlink; /* nombre de links = 1 */ + uid_t st_uid; /* identificateur de propritaire */ + gid_t st_gid; /* identificateur de groupe = st_uid */ + dev_t st_rdev; /* priphrique physique */ + size_t st_size; /* taille du fichier en octets */ + time_t st_atime; /* date et heure de dernier accs ** */ + time_t st_mtime; /* date et heure de dernire modif ** */ + time_t st_ctime; /* date et heure de cration ** */ + unsigned short st_org; /* organisation : sq, key, ind, dir, prg */ + unsigned short st_rlen; /* largeur des enregistrements */ + unsigned short st_klen; /* largeur des cls */ + char st_grow; /* taux d'agrandissement */ +}; + +/* ** date de dernire modification */ +@std +std (THEOS) Set direction flag +#include +void std(void); +See also: cld +@sti +sti (THEOS) Set interrupt +#include +void sti(void); +See also: cli +@strcat +strcat (ANSI) Append one string to another +#include +char *strcat(char *to,const char *from); +See also: farcat,strncat +@strchr +strchr (ANSI) Locate the first occurence of a character in a string +#include +char *strchr(const char *string1,short c); +See also: farchr,memchr,strpbrk,strrchr,strstr +@strcmp +strcmp (ANSI) Compare two strings +#include +short strcmp(const char *string1,const char *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,streq,stricmp,strncmp,strneq, + strnicmp +@strcoll +strcoll (ANSI) Compare two strings according to the current collating sequence +#include +short strcoll(const char *s1, const char *s2); +See also: setlocale,strlwr,strupr,strxfrm +@strcpy +strcpy (ANSI) Copy one string into another +#include +char *strcpy(char *to,const char *from); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strdup,strmake,strncpy +@strcrypt +strcrypt (JMD) Crypt a string +#include <_string.h> +char *strcrypt(char *s); +@strcspn +strcspn (ANSI) Return length for which one string excludes characters in another +#include +unsigned short strcspn(const char *string1,const char *string2); +See also: strpbrk,strspn,strtok +@strdup +strdup (MSC) Makes a copy of a string in previously unallocated memory +#include +char *strdup(const char *from); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strmake,strncpy +@strend +strend (THEOS) Locate the end of a string +#include +char *strend(const char *string); +@streq +streq (THEOS) Compare two strings for equality +#include +short streq(const char *string1,const char *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,stricmp,strncmp,strneq, + strnicmp +@strerror +strerror (ANSI) Return a system message with the arguments pointed by _errarg +#include +char *strerror(short num); +See also: _errarg,errmsg,fperror,getmsg,perror,syserr +@strftime +strftime (ANSI) Convert a time structure into a formatted string +#include +size_t strftime(char *s,size_t len,const char *fmt,const struct tm *tp); +See also: asctime,ctime,gmtime,localtime,mktime,time +@stricmp +stricmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short stricmp(const void *string1,const void *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,strncmp,strneq, + strnicmp +@strlen +strlen (ANSI) Return the length of a string +#include +short strlen(const char *string); +See also: farlen,strend +@strlwr +strlwr (MSC) Convert the alphabetic characters in a string to lower case +#include +char *strlwr(char *s); +See also: strupr,tolower,setlocale +@strmake +strmake (THEOS) Copy a memory buffer to a string,adding the nul terminator +#include +char *strmake(char *to,const char *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strdup,strncpy +@strncat +strncat (ANSI) Append one string onto another +#include +char *strncat(char *to,const char *from,size_t len); +See also: farcat,strcat +@strncmp +strncmp (ANSI) Compare two strings +#include +short strncmp(const char *string1,const char *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strneq,strnicmp +@strncpy +strncpy (ANSI) Copy one string into another +#include +char *strncpy(char *to,const char *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strdup,strmake +@strneq +strneq (THEOS) Compare two strings for equality +#include +short strneq(const char *string1,const char *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp, + strnicmp +@strnfill +strnfill (THEOS) Fill a buffer with a character +#include +char *strnfill(char *buffer,size_t len,short character); +See also: farset,memset,strset,strnset +@strnicmp +strnicmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short stricmp(const void *string1,const void *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq +@strnset +strnset (MSC) Fill a string with a character +void *strnset(char *buffer,short character,size_t len); +See also: farset,memset,strnfill,strset +@strpbrk +strpbrk (ANSI) Find first occurrence in a string of any character from another +#include +char *strpbrk(const char *string1,const char *string2); +See also: farchr,memchr,strchr,strrchr,strstr +@strrchr +strrchr (ANSI) Locate the last occurence of a character in a string +#include +char *strrchr(const char *string1,short c); +See also: farchr,memchr,strpbrk,strchr,strstr +@strsave +strsave (THEOS) See strdup +@strset +strset (MSC) Fill a string with a character +void *strset(char *buffer,short character); +See also: farset,memset,strnfill,strnset +@strspn +strspn (ANSI) Return length for which one string includes characters in another +#include +unsigned short strspn(const char *string1,const char *string2); +See also: strpbrk,strcspn,strtok +@strstr +strstr (ANSI) Locate the first occurence of one string within another +#include +char *strstr(const char *string1,const char *string2); +See also: farchr,memchr,strpbrk,strchr,strrchr +@strtod +strtod (ANSI) Convert string to floating point value +#include +double strtod(const char *s,char **es); +See also: atof,ftoa +@strtok +strtok (ANSI) Extract a token from a string +#include +char *strtok(char *string,char *delim); +See also: strcspn,srtrspn +@strtol +strtol (ANSI) Convert string in a specified base a to long integer +#include +double strtol(const char *s,char **es,short base); +See also: atol,ltoa,strtoul,ultoa +@strtoul +strtoul (ANSI) Convert string in a specified base a to unsigned long integer +#include +double strtoul(const char *s,char **es,short base); +See also: atol,ltoa,strtol,ultoa +@strupr +strupr (MSC) Convert the alphabetic characters in a string to upper case +#include +char *strupr(char *s); +See also: strlwr,tolower,setlocale +@strxfrm +strxfrm (ANSI) Convert a string according to the current collating sequence +#include +size_t strxfrm(char* to,char* from,size_t maxsize); +See also: setlocale,strcoll +@subb +subb (THEOS) Substract a value to a byte in another memory segment +#include +void subb(void *ofs,unsigned seg,char val); +See also: Other sub functions +@subcs +subcs (THEOS) Substract a value to a byte in the code segment +#include +void subcs(void *ofs,char val); +See also: Other sub functions +@subl +subl (THEOS) Substract a value to a long in another memory segment +#include +void subl(void *ofs,unsigned seg,long val); +See also: Other sub functions +@sublcs +sublcs (THEOS) Substract a value to a long in the code segment +#include +void sublcs(void *ofs,long val); +See also: Other sub functions +@subw +subw (THEOS) Substract a value to a word in another memory segment +#include +void subw(void *ofs,unsigned seg,short val); +See also: Other sub functions +@subwcs +subwcs (THEOS) Substract a value to a word in the code segment +#include +void subwcs(void *ofs,short val); +See also: Other sub functions +@suicide +suicide (THEOS) Kill the current sub-task +#include +void suicide(void); +See also: killtask +@swab +swab (THEOS) Swap a pair of bytes +#include +void swab(char *src,char *dest,unsigned nb); +@syserr +syserr (THEOS) Display a system message on stderr and exit the program +#include +void syserr(short rc,short num,char *arg[]); +See also: errmsg,exit,putmsg +@system +system (ANSI) Pass a command to the CSI shell for execution +#include +short system(const char *commandline); +@tan +tan (ANSI) Calculate tangent +#include +double tan(double radian); +@tanh +tanh (ANSI) Calculate hyperbolic cosine +#include +double tanh(double radian); +@tell +tell (MSC) Return current position of file's data pointer +#include +long tell(short filenum); +See also: close,creat,filelength,flush,lseek,open,_read,read,_write,write +@telldir +telldir (+UNIX) Return the current directory entry location +#include +long telldir(DIR*); +See also: opendir,closedir,readdir,seekdir,rewinddir +@tempnam +tempnam (ANSI) Generate a unique name for a temporary file +#include +char *tempnam(const char *directory,const char *name); +@termname +termname (+THEOS) Return the class name of a terminal or printer +#include <_stdio.h> +char* termname(int class); +See also: devname,termname,ttyname +@testarg +testarg (THEOS) Compare a string to a system keyword +#include +short testarg(char *arg,short keynbr); +See also: getkey,keyclose,matcharg +@testhead +testhead (THEOS) Control page heading and page wait for stdout +#include +void testhead(char *heading); +See also: datehdng,getll,getpl,pagewait +@testwild +testwild (THEOS) Test if a string include "wild cards" +#include +short testwild(char *s); +@tetd_t +tetd_t (MWC) Type to represent file time and date format +#include +typedef unsigned long tetd_t; +@tetd_to_tm +tetd_to_tm (MWC) Convert file time and date to system calendar format +#include +tm_t *tetd_to_tm(tetd_t time); +See also: tetd_to_time,time_to_tetd,tm_to_tetd +@tetd_to_time +tetd_to_time (MWC) Convert file time and date to a number of seconds +#include +time_t tetd_to_time(tetd_t time); +See also: tetd_to_tm,time_to_tetd,tm_to_tetd +@time +time (ANSI) Get current time in seconds since 01-01-1970 00:00:00 GMT +#include +time_t time(time_t *tp); +@time_t +time_t (ANSI) Type to represent time in seconds since 01-01-1970 00:00:00 GMT +#include +typedef long time_t; +@time_to_tetd +time_to_tetd (MWC) Convert a number of seconds to file time and date format +#include +tetd_t time_to_tetd(time_t t); +See also: tetd_to_tm,tetd_to_time,tm_to_tetd +@timeout +timeout (THEOS) Test if previous read failed because of a lock timeout +#include <_stdio.h> +short timeout(); +See also: lock_time +@timer +timer (THEOS) Set a semaphore on after a given time or a defined time of day +#include +void *timer(short sema_nbr,short type,long msec); +See also: alarm,msalarm,sema,semaphore,semares,semaset,semawait +@timezone +timezone (ANSI) Difference in seconds between GMT time and local time +#include +extern long timezone; +See also: daylight,tzset,tzname +@tm_to_tetd +tm_to_tetd (MWC) Convert system calendar format to file date and time +#include +tetd_t tm_to_tetd(tm_t *time); +See also: tetd_to_tm,tetd_to_time,time_to_tetd +@tmpfile +tmpfile (ANSI) Create and open a temporary file +#include +FILE *tmpfile(void); +See also: fopen,mktemp,lempnam,tmpnam +@tmpnam +tmpnam (ANSI) Generate a unique name for a temporary file +#include +char *tmpnam(char *name); +@toascii +#include +toascii (UNIX) Convert characters to ASCII +#include +short toascii(short c); +@toibmpc +toibmpc (+THEOS) Translate THEOS character to native IBM PC extended ASCII +#include +short toibmpc(short c); +See also: totheos +@tolower +tolower (ANSI) Convert characters to lower case +#include +short tolower(short c); +@topen +topen (THEOS) ??? +#include +FILE *topen(char *fname,char *mode,unsigned reclen,size_t blklen); +Set : _errnum +@tot_alloc +tot_alloc (THEOS) Compute the total amount of available memory +#include +size_t tot_alloc(void); +See also: calloc,free,malloc,max_alloc,realloc +@totheos +totheos (+THEOS) Translate IBM PC extended ASCII character to THEOS character +#include +short totheos(short c); +See also: toibmpc +@toupper +toupper (ANSI) Convert characters to upper case +#include +short toupper(short c); +@trim +trim (THEOS) Remove leading,trailing and multiple spaces +#include +char *trim(char *s); +@ttyname +ttyname (+UNIX) Return the name of the console physical device +#include <_stdio.h> +char* ttyname(FILE* stream); +See also: devname,termname,vdiname +@tzname +tzname (ANSI) Time zones names +#include +extern char *tzname[2]; +See also: daylight,timezone,tzset +@tzset +tzset (UNIX) Determine the time zone name for local time +#include +void tzset(void); +See also: daylight,timezone,tzname +@undef +#undef (ANSI) Undefine a manifest constant +#undef variable +@ungetc +ungetc (ANSI) Return character to input stream +#include +short ungetc(short c,FILE *fp); +See also: ungetch +@ungetch +ungetc (MSC) Return character to standard input +#include +short ungetch(short c); +See also: ungetc +@unlink +unlink (ANSI) Remove a file +#include +short unlink(const char *name); +Set : errno,_errnum +See also: remove +@unload +unload (THEOS) Unload a file from memory +#include +void unload(unsigned seg); +See also: load +@unlock +unlock (THEOS) Unlock a record +#include +void unlock(FILE *file); +See also: filelock,locking,reclock,recunlock +@unwait +unwait (THEOS) Awaken a program waiting for an interrupt +#include +void unwait(short pid); +See also: wait +@upcase +upcase (THEOS) See strupr +@utime +utime (+UNIX) Change the date and time of a file +#include +short utime(const char *filename,struct utimbuf *times); +Set : errno +See also: asctime,ctime,gmtime,localtime,stat,time +@utoa +utoa (THEOS) Convert an unsigned integer into an ASCII string +#include +char *utoa(char *s,unsigned i); +See also: ftoa,itoa,ltoa +@va_arg +va_arg (ANSI) Used to access erguments in a variable argument functions +#include +.... va_arg(va_list *arg_ptr,type); +See also: va_start,va_end +@va_end +va_end (ANSI) End variable argument processing +#include +void va_end(va_list *aptr); +See also: va_arg,va_start +@va_list +va_list (ANSI) Used in variable argument processing +#include +typedef long va_list[1]; +@va_start +va_start (ANSI) Start variable argument processing +#include +void va_start(va_list *arg_ptr,void *ptr); +See also: va_arg,va_end +@vdi +vdi (THEOS) Primitive access to the Virtual Device Interface +#include +void vdi(short vidnum,VDIPB *vdipb); +See also: vdiopen +@vdialpha +vdialpha( THEOS) Switch VDI to text mode +#include +void vdialpha(VDIPB *vdipb); +See also: vdigraph,vdiopen +@vdiarc +vdiarc (THEOS) Draw an arc +#include +void vdiarc(VDIPB *vdipb,short x,short y,short radius,short angle1,short angle2); +See also: vdicircle,vdiopen,vdipie +@vdibar +vdibar (THEOS) Draw a rectangle +#include +void vdibar(VDIPB *vdipb,short llx,short lly,short urx,short ury); +See also: vdiopen +@vdicircle +vdicircle (THEOS) Draw a circle +#include +void vdicircle(VDIPB *vdipb,short x,short y,short radius); +See also: vdiarc,vdiopen,vdipie +@vdiclear +vdiclear (THEOS) Clear the graphics page or perform a form feed +#include +void vdiarc(VDIPB *vdipb); +See also: vdiopen +@vdiclose +vdiclose (THEOS) Close a VDI file +#include +void vdiclose(VDIPB *vdipb); +See also: vdiopen +@vdigraph +vdigraph (THEOS) Swith to graphics mode +#include +void vdigraph(VDIPB *vdipb); +See also: vdialpha,vdiopen +@vdiline +vdiline (THEOS) Draw a line +#include +void vdiline(VDIPB *vdipb,short x1,short y1,short x2,short y2); +See also: vdiopen +@vdimark +vdimark (THEOS) Draw a marker +#include +void vdimark(VDIPB *vdipb,short x,short y); +See also: vdiopen +@vdiname +vdiname (+THEOS) Return the name of a VDI physical device +#include <_stdio.h> +char* vdiname(int vdiclass); +See also: devname,termname,ttyname +@vdiopen +vdiopen (THEOS) Open a graphics device +#include +VDIPB *vdiopen(short num); +See also: vdiclose +@vdipie +vdipie (THEOS) Draw a pie section +#include +void vdipie(VDIPB *vdipb,short x,short y,short radius,short angle1,short angle2); +See also: vdiarc,vdicircle,vdiopen +@vdisetfc +vdisetfc (THEOS) Set fill color +#include +void vdisetfc(VDIPB *vdipb,short color); +See also: vdibar,vdicircle,vdiopen,vdipie +@vdisetfs +vdisetfs (THEOS) Set fill style +#include +void vdisetfs(VDIPB *vdipb,short style); +See also: vdibar,vdicircle,vdiopen,vdipie +@vdisetlc +vdisetlc (THEOS) Set line color +#include +void vdisetlc(VDIPB *vdipb,short color); +See also: vdiarc,vdibar,vdicircle,vdiline,vdiopen,vdipie +@vdisetlh +vdisetlh (THEOS) Set line width or height +#include +void vdisetlh(VDIPB *vdipb,short size); +See also: vdiline,vdiopen +@vdisetls +vdisetls (THEOS) Set line style +#include +void vdisetls(VDIPB *vdipb,short style); +See also: vdiarc,vdibar,vdicircle,vdiline,vdiopen,vdipie +@vdisetmc +vdisetmc (THEOS) Set marker color +#include +void vdisetmc(VDIPB *vdipb,short color); +See also: vdimark,vdiopen +@vdisetmh +vdisetmh (THEOS) Set marker size or height +#include +void vdisetmh(VDIPB *vdipb,short size); +See also: vdimark,vdiopen +@vdisetms +vdisetms (THEOS) Set marker style +#include +void vdisetms(VDIPB *vdipb,short style); +See also: vdimark,vdiopen +@vdisetta +vdisetta (THEOS) Set text angle +#include +void vdisetta(VDIPB *vdipb,short color); +See also: vdiopen,vditext +@vdisettc +vdisettc (THEOS) Set text color +#include +void vdisettc(VDIPB *vdipb,short color); +See also: vdiopen,vditext +@vdisetth +vdisetth (THEOS) Set text size or height +#include +void vdisetth(VDIPB *vdipb,short size); +See also: vdiopen,vditext +@vdisettp +vdisettp (THEOS) Set text path +#include +void vdisettp(VDIPB *vdipb,short path); +See also: vdiopen,vditext +@vdisetts +vdisetts (THEOS) Set text style +#include +void vdisetts(VDIPB *vdipb,short style); +See also: vdiopen,vditext +@vditext +vditext (THEOS) Display a text string +#include +void vditext(VDIPB *vdipb,short x,short y,char *s); +See also: vdiopen +@vfprintf +vfprintf (ANSI) Print formatted output to a stream +#include +short vfprintf(const FILE *stream,const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vprintf,vsprintf +@vprintf +vprintf (ANSI) Print formatted output to standard output +#include +short vprintf(const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vfprintf,vsprintf +@vsprintf +vsprintf (ANSI) Print formatted output to a string +#include +short vsprintf(char *s,const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vfprintf,vprintf +@wait (THEOS) Suspend a program until an interrupt occurs +#include +void wait(void); +See also: unwait +@write +write (ANSI) Write data to a file +#include +size_t write(short fd,void *buffer,size_t len); +See also: close,creat,filelength,flush,lseek,open,_read,read,tell,_write +@writek +writek (THEOS) Write a record to an indexed or keyed file +#include +short writek(FILE *fp,const char *key,const void *rec); +See also: deletek,readk,readn,readp +@xorb +xorb (THEOS) Xor a byte in another memory segment +#include +void xorb(void *ofs,unsigned seg,char mask); +See also: Other xor functions +@xorcs +xorcs (THEOS) Xor a byte in the code segment +#include +void xorcs(void *ofs,char mask); +See also: Other xor functions +@xorl +xorl (THEOS) Xor a long in another memory segment +#include +void xorl(void *ofs,unsigned seg,long mask); +See also: Other xor functions +@xorlcs +xorlcs (THEOS) Xor a long in the code segment +#include +void xorlcs(void *ofs,long mask); +See also: Other xor functions +@xorw +xorw (THEOS) Xor a word in another memory segment +#include +void xorw(void *ofs,unsigned seg,short mask); +See also: Other xor functions +@xorwcs +xorwcs (THEOS) Xor a word in the code segment +#include +void xorwcs(void *ofs,short mask); +See also: Other xor functions +#include <_time.h> +short _yday(short month,short day,short year); +See also: leapyear,_weekday +@yes_val +yes_val (THEOS) Value of yes answer +extern char yes_val; +@yesno +yesno (THEOS) Accept the answer yes or no according to the system keyword file +#include +short yesno(void); +See also: load_yn +@yield +yield (THEOS) See snu +@account +account (THEOS) Format of SYSTEM.ACCOUNT +#include +struct account { + char name[8]; /* [00] - logon id */ + char password[8]; /* [08] - password (spaces if none) */ + char id[2]; /* [10] - account number: + ascii-hex if 00-FE + else: 76543210-76543210 + *3210987 *6543210 + * = always set + if number >= 0x2000, + then synonym to account + & 0x1fff */ + char priv; /* [14] - privlege level */ + char mail_sw; /* [13] - you have mail */ + char abbrev_sw; /* [14] - CSI abbreviation switch */ + char stdsyn_sw; /* [15] - CSI synonym switch */ + char synonym[9]; /* [16] - CSI synonym fn______d */ + char rdy_sw; /* [1F] - CSI ready switch */ + char msg_sw; /* [20] - MSG switch */ + char break_chr[2]; /* [21] - break value (ascii-hex) */ + char work_drv; /* [23] - work drive code */ + char lang_code; /* [24] - default language code */ + char dec_is_comma; /* [25] - decimal is comma switch */ + char def_lib[19]; /* [26] - default library fn.ft:d */ + char mac_lib[9]; /* [39] - macro library fn______d */ + char obj_lib[9]; /* [42] - object library fn______d */ + char copy_lib[9]; /* [4B] - include library fn______d */ + char search[26]; /* [54] - search sequence */ + char cmd_lib[9]; /* [6E] - command library fn______d */ + char link_lib[9]; /* [77] - link library fn______d */ + char csi_case_sw; /* [80] - CSI lower case mode */ + char prompt[50]; /* [81] - CSI prompt */ +}; +@acb +acb (THEOS) Format of accseg in memory +#include +struct acb { + char name[8]; /* [00] - account name */ + short id; /* [08] - account number */ + char msgname[8]; /* [0A] - msg name */ +}; +@TERMINAL_FD +TERMINAL_FD (THEOS) Translate table used by international terminals +#include +struct TERMINAL_FD { + char type_code; + char terminal_name[25]; + near char *home; + near char *fon; + near char *foff; + near char *hon; + near char *hoff; + near char *right; + near char *left; + near char *down; + near char *ulon; + near char *clear; + near char *rvon; + near char *rvoff; + near char *dca; + near char *il; + near char *dl; + near char *setup; + near char *ic; + near char *dc; + near char *uloff; + near char *eol; + near char *eos; + near char *up; + near char *eu; + near char *bon; + near char *boff; + near char *mon; + near char *moff; + near char *color; + near char *koff; + near char *kon; + near char *son; + near char *soff; + near char *ISO_23; + near char *ISO_40; + near char *ISO_5B; + near char *ISO_5C; + near char *down_key; + near char *up_key; + near char *left_key; + near char *right_key; + near char *esc_key; + near char *top_key; + near char *bottom_key; + near char *delchar_key; + near char *page_fwd_key; + near char *page_bck_key; + near char *word_right_key; + near char *word_left_key; + near char *sch_fwd_key; + near char *sch_bck_key; + near char *again_key; + near char *file_key; + near char *erase_key; + near char *beg_line_key; + near char *end_line_key; + near char *case_key; + near char *save_key; + near char *quit_key; + near char *find_key; + near char *replace_key; + near char *del_left_key; + near char *transpose_key; + near char *ins_line_key; + near char *del_line_key; + near char *help_key; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; + near char *A_umlaut; + near char *a_umlaut; + near char *a_circumflex; + near char *a_grave; + near char *a_acute; + near char *E_acute; + near char *e_umlaut; + near char *e_circumflex; + near char *e_grave; + near char *e_acute; + near char *i_umlaut; + near char *i_circumflex; + near char *i_grave; + near char *i_acute; + near char *O_umlaut; + near char *o_umlaut; + near char *o_circumflex; + near char *o_grave; + near char *o_acute; + near char *U_umlaut; + near char *u_umlaut; + near char *u_circumflex; + near char *u_grave; + near char *u_acute; + near char *C_tail; + near char *c_tail; + near char *N_squiggle; + near char *n_squiggle; + near char *AE; + near char *ae; + near char *A_degree; + near char *a_degree; + near char *German_esset; + near char *invert_question; + near char *invert_exclaim; + near char *cent; + near char *english_pound; + near char *japenese_yen; + near char *spanish_pentada; + near char *dutch_guilder; + near char *one_quarter; + near char *one_half; + near char *y_umlaut; + near char *section; + near char *degree; + near char *bullet; + near char *A_umlaut_key; + near char *a_umlaut_key; + near char *a_circumflex_key; + near char *a_grave_key; + near char *a_acute_key; + near char *E_acute_key; + near char *e_umlaut_key; + near char *e_circumflex_key; + near char *e_grave_key; + near char *e_acute_key; + near char *i_umlaut_key; + near char *i_circumflex_key; + near char *i_grave_key; + near char *i_acute_key; + near char *O_umlaut_key; + near char *o_umlaut_key; + near char *o_circumflex_key; + near char *o_grave_key; + near char *o_acute_key; + near char *U_umlaut_key; + near char *u_umlaut_key; + near char *u_circumflex_key; + near char *u_grave_key; + near char *u_acute_key; + near char *C_tail_key; + near char *c_tail_key; + near char *N_squiggle_key; + near char *n_squiggle_key; + near char *AE_key; + near char *ae_key; + near char *A_degree_key; + near char *a_degree_key; + near char *German_esset_key; + near char *invert_question_key; + near char *invert_exclaim_key; + near char *cent_key; + near char *english_pound_key; + near char *japenese_yen_key; + near char *spanish_pentada_key; + near char *dutch_guilder_key; + near char *one_quarter_key; + near char *one_half_key; + near char *y_umlaut_key; + near char *section_key; + near char *degree_key; + near char *bullet_key; + near char *ISO_5D; + near char *ISO_5E; + near char *ISO_60; + near char *ISO_7B; + near char *ISO_7C; + near char *ISO_7D; + near char *ISO_7E; + near char *ISO_23_key; + near char *ISO_40_key; + near char *ISO_5B_key; + near char *ISO_5C_key; + near char *ISO_5D_key; + near char *ISO_5E_key; + near char *ISO_60_key; + near char *ISO_7B_key; + near char *ISO_7C_key; + near char *ISO_7D_key; + near char *ISO_7E_key; +}; +@TERMINAL_FE +TERMINAL_FE (THEOS) Translate table used by US terminals +#include +struct TERMINAL_FE { + char type_code; + char terminal_name[25]; + near char *home; + near char *fon; + near char *foff; + near char *hon; + near char *hoff; + near char *right; + near char *left; + near char *down; + near char *ulon; + near char *clear; + near char *rvon; + near char *rvoff; + near char *dca; + near char *il; + near char *dl; + near char *setup; + near char *ic; + near char *dc; + near char *uloff; + near char *eol; + near char *eos; + near char *up; + near char *eu; + near char *bon; + near char *boff; + near char *mon; + near char *moff; + near char *color; + near char *koff; + near char *kon; + near char *son; + near char *soff; + char filler[8]; + near char *down_key; + near char *up_key; + near char *left_key; + near char *right_key; + near char *esc_key; + near char *top_key; + near char *bottom_key; + near char *delchar_key; + near char *page_fwd_key; + near char *page_bck_key; + near char *word_right_key; + near char *word_left_key; + near char *sch_fwd_key; + near char *sch_bck_key; + near char *again_key; + near char *file_key; + near char *erase_key; + near char *beg_line_key; + near char *end_line_key; + near char *case_key; + near char *save_key; + near char *quit_key; + near char *find_key; + near char *replace_key; + near char *del_left_key; + near char *transpose_key; + near char *ins_line_key; + near char *del_line_key; + near char *help_key; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; +}; +@PRINTER_FC +PRINTER_FC (THEOS) Translate table used by printers +#include +struct PRINTER_FC { + char type_code; + char printer_name[25]; + near char *bold_on; + near char *bold_off; + near char *ul_on; + near char *ul_off; + near char *ital_on; + near char *ital_off; + near char *color_on; + near char *color_off; + near char *compress_on; + near char *compress_off; + near char *wide_on; + near char *wide_off; + near char *high_on; + near char *high_off; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; + near char *A_umlaut; + near char *a_umlaut; + near char *a_circumflex; + near char *a_grave; + near char *a_acute; + near char *E_acute; + near char *e_umlaut; + near char *e_circumflex; + near char *e_grave; + near char *e_acute; + near char *i_umlaut; + near char *i_circumflex; + near char *i_grave; + near char *i_acute; + near char *O_umlaut; + near char *o_umlaut; + near char *o_circumflex; + near char *o_grave; + near char *o_acute; + near char *U_umlaut; + near char *u_umlaut; + near char *u_circumflex; + near char *u_grave; + near char *u_acute; + near char *C_tail; + near char *c_tail; + near char *N_squiggle; + near char *n_squiggle; + near char *AE; + near char *ae; + near char *A_degree; + near char *a_degree; + near char *German_esset; + near char *invert_question; + near char *invert_exclaim; + near char *cent; + near char *english_pound; + near char *japenese_yen; + near char *spanish_pentada; + near char *dutch_guilder; + near char *one_quarter; + near char *one_half; + near char *y_umlaut; + near char *section; + near char *degree; + near char *bullet; + near char *ISO_23; + near char *ISO_40; + near char *ISO_5B; + near char *ISO_5C; + near char *ISO_5D; + near char *ISO_5E; + near char *ISO_60; + near char *ISO_7B; + near char *ISO_7C; + near char *ISO_7D; + near char *ISO_7E; +}; +@elt +elt (THEOS) Exclusive Lock Table +#include +struct elt { + void *lock_ofs; /* [00] - offset address */ + unsigned lock_seg; /* [04] - segment address */ + unsigned char lock_own; /* [06] - pid of owner */ + char lock_flag; /* [07] - set if waiting */ +}; + +#define ELT ((struct elt *)0) +#define ELTLEN 8 +#define ELTSEG 0x0078 +@fcb +fcb (THEOS) File Control Block +See FILE +@FILE +FILE (THEOS) File Control Block +#include +typedef struct fcb { + char _fst; /* [00] - 1 - file status: + 76543210 + = disk full on last write + = tape no HDR2 labels + = tape end of file + = printer needs close + = printer + = buffer has write data + = buffer allocated + = opened */ + char _flub; /* [01] - 5 - logical unit,255 = null */ + short _faccess; /* [02] - 11 - access mode: + 111111 + 5432109876543210 + = input + = output + = lock + = temp file (erase) + = stream + = relative + = indexed + = keyed + = append mode + = private + = last prt FF + = pipe file + = printer pass-thru + = last prt FE + = lock writes + = ix node rd/wr */ + short _freclen; /* [04] - 19 - record length */ + short _fkeylen; /* [06] - 27 - key length */ + char *_fbufbase; /* [08] - 801 - location of buffer */ + long _fbufsize; /* [0C] - 817 - buffer size */ + char *_fbufptr; /* [10] - 833 - next char position */ + long _fcount; /* [14] - 849 - number of chars left */ + long _floc; /* [18] - 865 - location next read or write */ + short _fsa; /* [1C] - 371 - slot number of fsa */ + char *_fnxtkey; /* [1E] - 889 - pointer to IX key storage */ + short _fnxt; /* [22] - 395 - type of IX key */ + long _fixnxt; /* [24] - 913 - disk address of IX key */ + char *_ftapefn; /* [28] - 929 - pointer to tape file name */ + char _filler[10]; /* [2C] - filler */ +} FILE; /* len of fcb = 54 bytes */ + +struct fcb_286 { + char _fst; /* [00] - 1 - file status: + 76543210 + = disk full on last write + = tape no HDR2 labels + = tape end of file + = printer needs close + = printer + = buffer has write data + = buffer allocated + = opened */ + char _flub; /* [01] - 5 - logical unit,255 = null */ + short _faccess; /* [02] - 11 - access mode: + 111111 + 5432109876543210 + = input + = output + = lock + = temp file (erase) + = stream + = relative + = indexed + = keyed + = append mode + = private */ + short _freclen; /* [04] - 19 - record length */ + short _fkeylen; /* [06] - 27 - key length */ + near char *_fbufbase; /* [08] - 35 - location of buffer */ + unsigned _fbufsize; /* [0A] - 43 - buffer size */ + near char *_fbufptr; /* [0C] - 51 - next char position */ + unsigned _fcount; /* [0E] - 59 - number of chars left */ + long _floc; /* [10] - 67 - location next read or write */ + short _fsa; /* [14] - 83 - slot number of fsa in nucleus */ +}; /* len of fcb_286 = 22 bytes */ +@fdb +fdb (THEOS) File Directory Block +#include +struct fdb { + char filename[8]; /* [00] - filename or member name */ + char filetype[8]; /* [08] - filetype */ + char filestat; /* [10] - file status: + 76543210 + 00000000 empty + 11111111 erased + 10000000 library + 01000000 sub directory + 00010000 normal stream + 00001000 relative + 00000100 keyed + 00000010 indexed + xxx00001 program + xxx = 000 8086 & 80286 real + xxx = 001 80286 protected + xxx = 010 80386 */ + unsigned short fileowner; /* [11] - owner id */ + char protect; /* [13] - protection code: + 76543210 + = read protect + = write protect + = execute protect + = erase protect + = shared read protect + = shared write protect + = shared execute protect + = shared erase protect */ + union { + struct { + year : 6; /* years since 1986 [0-31] = [1986 - 2017] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + sec : 6; /* second [0 - 59] */ + } new; + struct { + char type; /* code 0=old,!0=new */ + year : 4; /* years since 1980 [0-15] = [1980 - 1995] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + : 0; + } old; + unsigned long datetime; + } filedate; /* [14] - date & time of last write */ + long filesize; /* [18] - file size in bytes */ + unsigned short reclen; /* [1C] - record length */ + unsigned short keylen; /* [1E] - key len */ + struct { + unsigned short ext_ct; /* [20] - sector count */ + char ext_addr[3]; /* [22] - sector address */ + } extlev1[5]; /* [20] - 5 level 1 extents */ + char extlev2a[3]; /* [39] - address of sector contain 51 exts */ + char extlev2b[3]; /* [3C] - address of sector contain 51 exts */ + char filegrow; /* [3F] - extent increase amount; + 0 = dynamic,chop at close + n = filesize/n,no chop */ +}; /* (fdb len = 64) */ +@fsa +fsa (THEOS) File Save Area +#include +struct fsa { + near struct diskucb *fsa_ucb; /* [00] - file ucb */ + long fsa_sect; /* [02] - fdb sector address */ + near struct fdb *fsa_ofs; /* [06] - fdb offset within sector */ + short fsa_count; /* [08] - open fcb count */ + char fsa_lock; /* [0A] - file locked: + 76543210 + deny read + deny write */ + char fsa_write; /* [0B] - file modified if non zero */ + char fsa_temp; /* [0C] - erase at final close */ + char fsa_1[3]; /* [0D] - not used */ + char filestat; /* [10] - file status: + 0x10 normal stream + 0x08 direct + 0x04 keyed + 0x02 indexed */ + unsigned short fileowner; /* [11] - owner id */ + char protect; /* [13] - protection code: + 0x8? shared erase protect + 0x4? shared execute protect + 0x2? shared write protect + 0x1? shared read protect + 0x?8 erase protect + 0x?4 execute protect + 0x?2 write protect + 0x?1 read protect */ + union { + struct { + year : 6; /* years since 1986 [0 - 31] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + sec : 6; /* second [0 - 59] */ + } new; + struct { + char type; /* code 0=old,!0=new */ + year : 4; /* years since 1980 [0 - 15] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + : 0; + } old; + unsigned long datetime; + } filedate; /* [14] - date & time of last write */ + long filesize; /* [18] - file size in bytes */ + unsigned short reclen; /* [1C] - record length */ + unsigned short keylen; /* [1E] - key len */ + struct { + unsigned short ext_ct; /* [20] - sector count */ + char ext_addr[3]; /* [22] - sector address */ + } extlev1[5]; + char extlev2a[3]; /* [39] - addr of sector with 51 ext */ + char extlev2b[3]; /* [3C] - addr of sector with 51 ext */ + char filegrow; /* [3F] - extent growth factor */ +}; /* (fsa len = 64) */ + +#define FSASEG 0x0088 +@filedate +filedate (JMD) File's date and time structure +#include +typedef union filedate { /* date & time of last write */ + struct { + year : 6; /* years since 1986 [0-31] = [1986-2017] */ + month : 4; /* month [1-12] */ + day : 5; /* day [1-31] */ + hour : 5; /* hour [0-23] */ + min : 6; /* minute [0-59] */ + sec : 6; /* second [0-59] */ + } new; + struct { + type : 8; /* Type 0=old,!0=new */ + year : 4; /* years since 1980 [0-15] = [1980-1995] */ + month : 4; /* month [1-12] */ + day : 5; /* day [1-31] */ + hour : 5; /* hour [0-23] */ + min : 6; /* minute [0-59] */ + } old; + tetd_t datetime; +} FILEDATE; +@tetd_t +tetd_t (JMD) Packed file's date and time +#include +typedef unsigned long tetd_t; +@lconv +lconv (ANSI) Locale structure +#include +struct lconv { + char *decimal_point; + char *thousands_sep; + char *grouping; + char *int_curr_symbol; + char *currency_symbol; + char *mon_decimal_point; + char *mon_thousands_sep; + char *mon_grouping; + char *positive_sign; + char *negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; +}; + +#define LC_ALL 31 +#define LC_COLLATE 1 +#define LC_CTYPE 2 +#define LC_NUMERIC 4 +#define LC_TIME 8 +#define LC_MONETARY 16 +@complex +complex (UNIX) Complex number +#include +struct complex { + double x; + double y; +}; +@nuc +nuc (THEOS) Nucleus data structure +#include +struct nuc { + char pad1[4]; /* [00] filler */ + struct { + char year; /* [04] year - 1900 */ + char month; /* [05] month (1 - 12) */ + char day; /* [06] day of month (1 - 31) */ + char hour; /* [07] hour of day (0 - 23) */ + char min; /* [08] minute of hour (0 - 59) */ + char sec; /* [09] second of minute (0 - 59) */ + } time_of_day; /* [04] system date & time */ + char dateopt; /* [0A] date option: */ + #define kanji 1 /* 16 bit Japanese Kanji */ + #define extime 2 /* external clock chip */ + #define exdate 4 /* external date chip */ + #define havusr 8 /* have USER module */ + #define aform 16 /* American MM/DD/YY */ + #define eform 32 /* European DD-MM-YY */ + #define iform 64 /* International YY.MM.DD */ + #define whist 128 /* write history records */ + char curpid; /* [0B] current process number */ + char cpu[4]; /* [0C] cpu */ + near char *curpcb; /* [10] current PCB pointer */ + unsigned short slice; /* [12] slice interval (msec) */ + near char *mstick; /* [14] address of msec tick */ + near char *snutick; /* [16] address of snu tick */ + unsigned short spoolseg; /* [18] DESPOOL segment */ + char version[5]; /* [1A] version number */ + char mfgnum; /* [1F] manufacturer number */ + unsigned short sernum; /* [20] serial number */ + long csisize; /* [22] SYSTEM.THEOS386.CSI filesize */ + struct { + unsigned short size; + char addr[3]; + } csiext[4]; /* [26] SYSTEM.THEOS386.CSI extent info */ + unsigned short csistack; /* [3A] SYSTEM.THEOS386.CSI stack len */ + char errmsg[3]; /* [3C] SYSTEM.THEOS386.MESSAGE extent info */ + unsigned short pdlseg; /* [3F] segment of PDL */ + unsigned pipenum; /* [41] next pipe number */ + char npxpid; /* [43] 80287/80387 owner pid */ + char slpcnt; /* [44] number of sleepers */ + char spdrv; /* [45] SYSTEM.SPOOLER drive */ + char sppid; /* [46] spooler pid */ + char snu_val[3]; /* [47] select next user */ + long cputime; /* [4A] time of day in msec (software) */ + short cache_seg; /* [4E] directory cache head segment */ + char srlo; /* [50] SunRiver */ + char public[26]; /* [51] public drive list A-Z */ + near char *rpb; /* [6B] RPB head seg address */ + char srhi; /* [6D] SunRiver */ + near char *rlt; /* [6E] RLT head offset address */ + unsigned pipe_hd; /* [70] PIPE head segment */ + near char *teb; /* [72] TEB head offset address */ + char tz[12]; /* [74] time zone info */ + unsigned short svdeb; /* [80] DEBUG386 use */ + long csicode; /* [82] SYSTEM.THEOS386.CSI code length */ + unsigned short msgseg; /* [86] SYSTEM.THEOS386.MESSAGE segment */ + char msgnum; /* [88] SYSTEM.THEOS386.MESSAGE suffix */ + char sync_pid; /* [89] process id of sync'er */ + unsigned short keyseg; /* [8A] SYSTEM.THEOS386.KEYWORD segment */ + char keynum; /* [8C] SYSTEM.THEOS386.KEYWORD suffix */ + char mca; /* [8D] cpu flags: */ + + #define MCA_BUS 1 + #define EISA_BUS 2 + #define ISA_BUS 32 + + #define CPU_286 64 + #define CPU_386 16 + #define CPU_486 4 + + #define FPU 8 + + #define MDOS_VER 128 + + unsigned mem_size; /* [8E] memory size at bootup */ + unsigned shmemseg; /* [90] shared memory segment */ + char sysname[16]; /* [92] system identification */ + unsigned short synseg; /* [A2] SYSTEM.THEOS386.SYNONYM segment */ + char synnum; /* [A4] SYSTEM.THEOS386.SYNONYM suffix */ + unsigned short devseg; /* [A5] SYSTEM.THEOS386.DEVNAMES segment */ + unsigned short gucb; /* [A7] VDI UCB segment address */ + char dflang; /* [A9] default language code */ + short cache_delay; /* [AA] cache write delay in .1 seconds */ + unsigned short accseg; /* [AC] ACCOUNT segment address */ + unsigned short csidata; /* [AE] SYSTEM.THEOS386.CSI data length */ + unsigned short csiheap; /* [B0] SYSTEM.THEOS386.CSI heap length */ + unsigned long pdbr; /* [B2] Page Descriptor Base reg */ + unsigned short ptseg; /* [B6] Page Table Selector */ + unsigned short v86seg; /* [B8] V86 Monitor segment */ + char v86pids[32]; /* [BA] V86 pid masks */ + unsigned char v86count; /* [DA] V86 Monitor count */ + char v86_inuse; /* [DB] set while loading V86 */ + unsigned short network; /* [DC] Network phantom pid */ + unsigned short ncb_seg; /* [DE] Network socket control block segment */ + short v86reserve; /* [E0] V86 reserve I/O segment */ + unsigned short flt_seg; /* [E2] File Lock Table */ + char copyright[28]; /* [E4] copyright notice */ + char ucb[1]; /* [100] Unit control blocks */ +}; +@pcb +pcb (THEOS) Process Control Block +#include +struct pcb { + unsigned short pstat; /* [00] - process status: */ + #define WAITING 0x00ff /* if non zero,waiting,else either \ + running or ready to run */ + #define W_INT 0x0001 /* set if waiting for interrupt */ + #define W_LOCK 0x0002 /* set if waiting for resource lock */ + #define W_SCREEN 0x0004 /* waiting for screen switch */ + #define SLEEPING 0x0008 /* set if sleeping */ + #define STOPPED 0x0010 /* set if stopped */ + #define W_PAUSE 0x0020 /* set if BREAK-S */ + #define W_SEMA 0x0040 /* set if waiting for semaphore */ + #define SR_PAGE 0x0100 /* set if need cntx swtch THEO+Grafx */ + #define MUST_COMPLETE 0x0200 /* set if task cannot be context + switched away */ + + unsigned short tib; /* [02] - TSS selector */ + + unsigned short pending; /* [04] - traps pending */ + #define QUITPEND 0x0001 /* set if BREAK-Q pending */ + #define CANPEND 0x0002 /* set if BREAK-C pending */ + #define ALRMPEND 0x0004 /* set if alarm pending */ + #define OVFPEND 0x0008 /* set if overflow/underflow pending */ + #define DIV0PEND 0x0010 /* set if divide by zero pending */ + #define FUNPEND 0x0020 /* set if function error pending */ + #define BOUNDPEN 0x0040 /* set if array bounds pending */ + #define FPEPEND 0x0080 /* set if floating point exception */ + #define SESSPEND 0x0200 /* set if need to switch sessions */ + #define FORCPEND 0x1000 /* set if FORCE pending */ + #define DEBPEND 0x2000 /* set if BREAK-D pending */ + #define KILLPEND 0x4000 /* set if kill syscall pending */ + #define STAGE 0x8000 /* set if staging the trap */ + + char taskprty; /* [06] - priority level */ + char tasklev; /* [07] - task level,0 == main task */ + unsigned long cputime; /* [08] - amount of CPU time */ + unsigned long sleeptime; /* [0C] - sleep time remain */ + near struct pcb *prtylink; /* [10] - link to next PID same prty */ + unsigned char taskfath; /* [12] - PID of parent task */ + char waitsema; /* [13] - semaphore if W_SEMA */ +}; +@pdl +pdl (THEOS) Public Device List +#include +struct pdl { + char ucbnum; /* ucb index */ + char pid; /* owner pid + 1 */ + short open_ct; /* number of opens */ +}; +@pipehdr +pipehdr (THEOS) PIPE control structure +#include +struct pipehdr { + unsigned pnext; /* fwd link to next pipe */ + unsigned pprev; /* back link to prev pipe */ + char pname[16]; /* pipe name (space pad) */ + char prd_ct; /* reader count */ + char pwr_ct; /* writer count */ + char prd_pid; /* pid of read waiter */ + char pwr_pid; /* pid of write waiter */ + unsigned psize; /* size of pipe buffer (exclude header) */ + unsigned pcount; /* number of chars in buffer */ + unsigned phead; /* read offset */ + unsigned ptail; /* write offset */ + char pbuf[]; /* pipe circular buffer */ +}; +@rlt +rlt (THEOS) Rocord Lock Table +#include +struct rlt { + short fsa_num; /* [00] - fsa number */ + unsigned char lockpid; /* [02] - locking pid plus one */ + long lockad; /* [03] - byte address */ + near struct rlt *fwd_rlt; /* [07] - fwd ptr to next */ +}; /* rlt len = 9 bytes */ +@scr +scr (THEOS) System Communication Region +#include +struct scr { + char logonname[8]; /* [00] - user name */ + unsigned short usernum; /* [08] - user number */ + char logdate[3]; /* [0A] - logon date */ + char logtime[3]; /* [0D] - logon time */ + unsigned char conmask; /* [10] - console mask: + 76543210 + = 1st char ctl is ok + = suppress output if stack + = stacked lines + = no page wait + = output suppress + = inverted case + = upper case + = echo mode */ + unsigned char csisw; /* [11] - csi switch: + 76543210 + = return from logon + = execute csi command + = from exec + = nomsg + = rdymsg + = usersyn + = stdsyn + = abbrev */ + unsigned char execsw; /* [12] - exec switch: + 76543210 + = CSI lower case + = error + = noecho + = trace + = ctl on */ + char pgmtime[3]; /* [13] - program start time */ + char pgmname[8]; /* [16] - program name */ + unsigned short execloc; /* [1E] - location in system.exec */ + near char *slofs; /* [20] - stacked line offset */ + unsigned short slseg; /* [22] - stacked line segment */ + near char *memhead; /* [24] - malloc head */ + char pipenr; /* [26] - next pipe number (0-25) */ + char privlev; /* [27] - privlege level */ + char lub[52]; /* [28] - lub table + unsigned short trapseg; /* [5C] - signal code segment */ + near void *quittrap; /* [5E] - break,q trap */ + near void *cantrap; /* [60] - break,c trap */ + near void *alrmtrap; /* [62] - alarm trap */ + near void *ovftrap; /* [64] - overflow/underflow trap */ + near void *div0trap; /* [66] - divide by zero trap */ + near void *funtrap; /* [68] - function argument trap */ + near void *boundtrap; /* [6A] - array bounds trap */ + near void *fpetrap; /* [6C] - floating point except trap */ + long cputimes; /* [6E] - cpu time start */ + char err_ext[3]; /* [72] - SYSTEM.THEOS.MESSAGE xtent */ + char workdrive; /* [75] - default work drive */ + char searchseq[26]; /* [76] - search sequence */ + unsigned char foreign; /* [90] - Foreign language switch + 76543210 + .... = language code + = not used + = THEOS/Z80 style modify + = no quit + = decimal is comma */ + char deflib[19]; /* [91] - default library */ + char cmdlib[9]; /* [A4] - cmd library */ + char maclib[9]; /* [AD] - macro library */ + char objlib[9]; /* [B6] - object library */ + char copylib[9]; /* [BF] - copy library */ + char linklib[9]; /* [C8] - link library */ + char synfile[9]; /* [D1] - synonym file */ + unsigned short comad; /* [DA] - BASIC286 common seg addr */ + char conbuf[8]; /* [DC] - console buffer (ungetch) */ + char tsb[16]; /* [E4] - tab set block */ + char cmdbuf[140]; /* [F4] - cmd storage */ + unsigned short quittraphi; /* [180] - high word */ + unsigned short cantraphi; /* [182] - high word */ + unsigned short alrmtraphi; /* [184] - high word */ + unsigned short ovftraphi; /* [186] - high word */ + unsigned short div0traphi; /* [188] - high word */ + unsigned short funtraphi; /* [18A] - high word */ + unsigned short boundtraphi; /* [18C] - high word */ + unsigned short fpetraphi; /* [18E] - high word */ + unsigned short memheadhi; /* [190] - high word */ + unsigned short cebphi; /* [192] - high word */ + unsigned short clev; /* [194] - call csi level */ + unsigned short cexec; /* [196] - execloc at call csi */ + near void *cebp; /* [198] - ebp at call csi */ + unsigned short cnlev; /* [19A] - next call csi level */ + char echo; /* [19C] - set if echoing */ + char echolub; /* [19D] - echo device */ + short echobuf; /* [19E] - buffer seg,if disk echo */ + short echofsa; /* [1A0] - fsa number */ + short echokl; /* [1A2] - offset if echo to spool */ + short echorl; /* [1A4] - page# if echo to spool */ + unsigned char echoct; /* [1A6] - buffer char ct */ + char loadtrap; /* [1A7] - debug trap on load */ + unsigned short snbseg; /* [1A8] - sema name block seg */ + char semaphor[8]; /* [1AA] - 64 semaphore bits */ + char sp_ll[4]; /* [1B2] - spool prt line len */ + char sp_pl[4]; /* [1B6] - spool prt page len */ + char sp_que[4]; /* [1BA] - spool prt que number */ + char sp_copies[4]; /* [1BE] - spool prt # copies */ + char sp_class[4]; /* [1C2] - spool prt class */ + char graphlub[4]; /* [1C6] - graphic lub number */ + unsigned short graphwork[4]; /* [1CA] - graphic work buffer */ + char graphdev[4]; /* [1D2] - graphic device number */ + char peeker; /* [1D6] - peeker pid number + 1 */ + char peekch; /* [1D7] - char to be peeked */ + char forcech; /* [1D8] - char from FORCE command */ + char cache_write_thru; /* [1D9] - set if write thru cache */ + unsigned short main_scr; /* [1DA] - alias to main task SCR */ + unsigned short main_data; /* [1DC] - alias to main task DATA */ + unsigned short atexit_ofshi; /* [1DE] - high word */ + char fill2[6]; /* [1E0] - filler */ + unsigned char lock_wait; /* [1E6] - seconds to wait for lock */ + unsigned char lock_remain; /* [1E7] - number seconds remain */ + char slave_ll; /* [1E8] - slave printer line length */ + char slave_pl; /* [1E9] - slave printer page length */ + char slave_ol; /* [1EA] - slave printer overflow */ + char slave_cl; /* [1EB] - slave printer cur line */ + char slave_cc; /* [1EC] - slave printer class code */ + unsigned short slave_seg; /* [1ED] - slave printer class seg */ + unsigned short environ_seg; /* [1EF] - segment of environment */ + near char *atexit_ofs; /* [1F1] - at exit offset */ + unsigned short atexit_seg; /* [1F3] - at exit segment */ + char csi_color[4]; /* [1F5] - normal crt color */ + unsigned cmdnum; /* [1F9] - command number */ + char fill3[5]; /* [1FB] - filler */ +}; /* length = 512 */ +@jmp_buf +jmp_buf (THEOS) Non-Local Jumps +#include +struct FarPointer { + void *ptr; + short seg; +}; + +typedef struct jmp_buf { + struct FarPointer _jmp_eip; /* return pointer */ + struct FarPointer _jmp_esp; /* stack pointer */ + void *_jmp_ebp; /* frame pointer */ + long _jmp_reg[3]; /* registers */ +} jmp_buf; +@tm +tm (ANSI) Date and time structure +#include +struct tm { + short tm_sec; /* seconds after the minute [0,60] */ + short tm_min; /* minutes after the hour [0,59] */ + short tm_hour; /* hours since midnight [0,23] */ + short tm_mday; /* day of the month [1,31] */ + short tm_mon; /* months since January [0,11] */ + short tm_year; /* years since 1900 */ + short tm_wday; /* days since Sunday [0,6] */ + short tm_yday; /* days since January 1 [0,365] */ + short tm_isdst; /* Daylight Savings Time flag */ +}; +@ucb +ucb (THEOS) Unit Control Block for character devices +#include +struct ucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short ubuf_ofs2; /* [06] - high ubuf_ofs pointer */ + char devtype; /* [08] - device type: + 76543210 + 100 byte i/o + = console + = 2nd char of DCA + = 3rd char of DCA + = keyboard off + = 2nd char of BREAK */ + char devowner; /* [09] - owner process id */ + char classnr; /* [0A] - class number */ + char ll; /* [0B] - line length */ + char pl; /* [0C] - page length */ + char ol; /* [0D] - overflow lines */ + char baud; /* [0E] - baud rate: + 76543210 + xxxx.... If Sync option bit: + 0001.... BSC + 0010.... SDLC + 0011.... HDLC + 0100.... X.25 + 0101.... SNA + 0110.... GPIB + 0111.... thru 1111.... user defined + ....xxxx ASYNC baud rates: + 0 = no software baud + 1 = 56000 + 2 = 38400 + 3 = 110 + 4 = 135 + 5 = 150 + 6 = 300 + 7 = 600 + 8 = 1200 + 9 = 1800 + 10 = 2400 + 11 = 3600 + 12 = 4800 + 13 = 7200 + 14 = 9600 + 15 = 19200 + ....xxxx SYNC baud rates: + 1 = 1200 + 2 = 2400 + 3 = 4800 + 4 = 9600 + 5 = 19200 + 6 = 38400 + 7 = 48000 + 8 = 56000 + 9 = 64000 + 10 = 100000 + 11 = 200000 + 12 = 500000 + 13 = 800000 */ + char lfdly; /* [0F] - line feed delay */ + char ffdly; /* [10] - form feed delay */ + char option; /* [11] - option byte: + 76543210 + 00...... no parity + 01...... parity zero + 10...... parity odd + 11...... parity even + ..1..... synchronous + ...1.... alf + ....1... 8 bit words + .....001 dtr enable (1) + .....010 xon/xoff enable (2) + .....011 etx/ack enable (3) + .....100 cts enable (4) + .....101 xpc (5) */ + char curline; /* [12] - current line system use */ + char curcol; /* [13] - current column system use */ + unsigned short transeg; /* [14] - translate segment addr */ + near void *ubuf_ofs; /* [16] - user buffer offset */ + unsigned short ubuf_seg; /* [18] - user buffer segment */ + char scantmp; /* [1A] - scan code temporary */ + char prot_st; /* [1B] - protocol (XON/XOFF) status */ + char scan_st; /* [1C] - scan code status: + 76543210 + = shift + = compose + = ctl + = alt + = scroll lock + = num lock + = caps lock + = Kanji mode */ + char brk_chr; /* [1D] - break character */ + short attrib; /* [1E] - system use (saves crt attribute) + 5432109876543210 + = protect + = format + = reverse + = blink + = underline + = takes space + = last was attr + = caused newline + = slave prt attached + = slave prt enabled + = esc mode + = status mode + = status ignore + = last was prt cr + = line graphic mode */ + /* ucb len = 32 */ +}; +@diskucb +diskucb (THEOS) Unit Control Block for disk devices +#include +struct diskucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short iobuff2; /* [06] - i/o buffer 2 */ + char devtype; /* [08] - device type: + 76543210 + .....001 = disk + ....1001 = disk,need label + .001.... = single density + .010.... = double density + .011.... = cyl0 = single,other dbl + .100.... = cyl0,hd0=128 other 256 + .101.... = 2048 byte sects + .110.... = 1024 byte sects + .111.... = 512 byte sects (IBM PC) + 0....... = removable volume + 1....... = fixed volume */ + char devowner; /* [09] - owner process id 0xff = public */ + char volname[8]; /* [0A] - volume id */ + unsigned short dirsize; /* [12] - directory size */ + short cyls; /* [14] - number of cylinders */ + char heads; /* [16] - number of heads */ + char sects; /* [17] - number of sectors */ + char hdldly; /* [18] - head load delay */ + char stpdly; /* [19] - step delay */ + char stsdly; /* [1A] - step settle delay */ + short curcyl; /* [1B] - current cylinder */ + char diskfill[3]; /* [1D] - work space 3 bytes */ + /* diskucb len = 32 */ +}; +@tapeucb +tapeucb (THEOS) Unit Control Block for tape devices +#include +struct tapeucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short iobuff2; /* [06] - i/o buffer 2 */ + char devtype; /* [08] - device type: + 76543210 + .....010 = tape */ + char devowner; /* [09] - owner process id */ + char volname[8]; /* [0A] - volume id */ + short blocknr; /* [12] - block count */ + short filenr; /* [14] - file number */ + short volnr; /* [16] - volume number */ + char devtrack; /* [18] - tape track or channel number */ + unsigned short iostat; /* [19] - status of last I/O */ + unsigned short rdlen; /* [1B] - length of last read */ + char tapefill[3]; /* [1D] - filler,tapeucb len = 32 */ +}; +@diskcntl +diskcntl (THEOS) Extended I/O structure for disk devices +#include +struct diskcntl { + short c_cmd; /* command code: + 0 = home heads to cylinder 0 + 1 = return drive status (MFG dependent) + 2 = read sectors + 3 = write sectors + 4 = format (MFG dependent) + 99 = land heads to safe landing zone */ + long c_sect; /* sector number */ + char *c_buf; /* buffer offset */ + unsigned short c_seg; /* buffer segment */ + short c_count; /* sector count */ + short c_cyl; /* cylinder number (format) */ + short c_head; /* head number (format) */ + short c_den; /* density (format) */ +}; +@bytecntl +bytecntl (THEOS) Extended I/O structure for character devices +#include +struct bytecntl { + short c_cmd; /* command code: + 1 = buffer status: + 76543210 + = TxBUF not full + = RxBUF not empty + 2 = modem status: + 5432109876543210 + 111100001111 = DSR + 111100001111 = CTS + 111100001111 = RI + 111100001111 = DCD + 3 = send break + 4 = use c_seg:c_buf input buffer: + struct { + short buf_len; + short buf_count; + short next_store; + short next_fetch; + char buf[buf_len]; + }; + 5 = raise DTR modem control + 6 = drop DTR modem control + 7 = raise RTS modem control + 8 = drop RTS modem control */ + short c_word1; + short c_word2; + char *c_buf; /* offset to buffer */ + unsigned short c_seg; /* selector for buffer */ +}; +@tapecntl +tapecntl (THEOS) Extended I/O structure for tape devices +#include +struct tapecntl { + short c_cmd; /* command code: + 1 = status: + 76543210 + = BOT + = EOT + = Write Protect + = Ready + = Streamer + 2 = rewind + 3 = rewind & unload + 4 = write tape mark + 7 = erase tape (format) + 8 = re-tension + 9 = get length of last read + 110 = read + 111 = write */ + unsigned short c_tseg; /* read/write segment */ + char *c_tbuf; /* read/write offset */ + unsigned short c_tlen; /* read/write length */ +}; +@utimbuf +utimbuf (UNIX) File time modification structure +#include +struct utimbuf { + time_t actime; + time_t modtime; +}; +@VDIPB +VDIPB (THEOS) Vdi Parameters Block +#include +typedef struct { + short *control; + short *intin; + short *ptsin; + short *intout; + short *ptsout; + short vdinum; + unsigned vdiseg; +} VDIPB; +@UBUFFER +UBUFFER (THEOS) User Buffering +#include <_ucb.h> +typedef struct ubuffer { + short buf_len; + volatile short buf_count; + volatile short next_store; + volatile short next_fetch; + char buf[]; +} UBUFFER; +@lub +lub (THEOS) Device Logical Unit Blocks Numbers +#include +enum lub { + ADISK,BDISK,CDISK,DDISK,EDISK,FDISK,GDISK,HDISK,IDISK,JDISK, + KDISK,LDISK,MDISK,NDISK,ODISK,PDISK,QDISK,RDISK,SDISK,TDISK, + UDISK,VDISK,WDISK,XDISK,YDISK,ZDISK, + CONI,CONO, + PRT1,PRT2,PRT3,PRT4, + COM1,COM2,COM3,COM4, + TAP1,TAP2,TAP3,TAP4, + COM5,COM6,COM7,COM8,COM9,COM10,COM11,COM12,COM13,COM14,COM15, + COM16 +}; +@ diff --git a/libhelp/c.idx b/libhelp/c.idx new file mode 100644 index 0000000..0b6a27c Binary files /dev/null and b/libhelp/c.idx differ diff --git a/libhelp/exec.hlp b/libhelp/exec.hlp new file mode 100644 index 0000000..3d4412e --- /dev/null +++ b/libhelp/exec.hlp @@ -0,0 +1,112 @@ +@begstack +&begstack empiler des lignes dans la pile clavier +@begtype +&begtype afficher des lignes. +@break +&break sortir d'une boucle &for ou &while +@call +&call