: Run this shell script with "sh" not "csh" PATH=:/bin:/usr/bin:/usr/ucb export PATH if test ! -d =src then echo 'Making directory "=src"' mkdir =src fi echo 'x - =src/Caps' sed 's/^X//' <<'//go.sysin dd *' >=src/Caps #********************************************************************* # COPYRIGHT NOTICE * #********************************************************************* # This software is copyright (C) 1982 by Pavel Curtis * # * # Permission is granted to reproduce and distribute * # this file by any means so long as no fee is charged * # above a nominal handling fee and so long as this * # notice is always included in the copies. * # * # Other rights are reserved except as explicitly granted * # by written permission of the author. * # Pavel Curtis * # Computer Science Dept. * # 405 Upson Hall * # Cornell University * # Ithaca, NY 14853 * # * # Ph- (607) 256-4934 * # * # Pavel.Cornell@Udel-Relay (ARPAnet) * # decvax!cornell!pavel (UUCPnet) * #********************************************************************/ # $Header: RCS/Caps.v Revision 2.1 82/10/25 14:45:23 pavel Exp$ # # Format for the Caps file: # variable_name "capname" type Comment # # where variable_name is the name of the variable used by a # programmer capname is the name used inside the /etc/terminfo # file type is one of bool, number or str and Comment is the text # of the comment which will go in term.h. # # All blank lines and lines beginning with '#' are ignored. # # >> NOTE!!! New capabilities \must/ be placed at the end of # >>>> the appropriate list (e.g. bools, numbers, strings). # >>>> This allows previous versions of programs to still function # >> \without/ recompilation. # auto_left_margin "bw" bool cub1 wraps from column 0 to last column auto_right_margin "am" bool Terminal has automatic margins beehive_glitch "xsb" bool Beehive (f1=escape, f2=ctrl C) ceol_standout_glitch "xhp" bool Standout not erased by overwriting (hp) eat_newline_glitch "xenl" bool newline ignored after 80 cols (Concept) erase_overstrike "eo" bool Can erase overstrikes with a blank generic_type "gn" bool Generic line type (e.g. dialup, switch). hard_copy "hc" bool Hardcopy terminal has_meta_key "km" bool Has a meta key (shift, sets parity bit) has_status_line "hs" bool Has extra "status line" insert_null_glitch "in" bool Insert mode distinguishes nulls memory_above "da" bool Display may be retained above the screen memory_below "db" bool Display may be retained below the screen move_insert_mode "mir" bool Safe to move while in insert mode move_standout_mode "msgr" bool Safe to move in standout modes over_strike "os" bool Terminal overstrikes status_line_esc_ok "eslok" bool Escape can be used on the status line teleray_glitch "xt" bool Tabs destructive, magic so char (Teleray 1061) tilde_glitch "hz" bool Hazeltine; can't print ~'s transparent_underline "ul" bool underline character overstrikes xon_xoff "xon" bool Terminal uses xon/xoff handshaking columns "cols" number Number of columns in a line init_tabs "it" number Tabs initially every # spaces lines "lines" number Number of lines on screen or page lines_of_memory "lm" number Lines of memory if > lines. 0 means varies magic_cookie_glitch "xmc" number Number of blank chars left by smso or rmso padding_baud_rate "pb" number Lowest baud rate where cr/nl padding needed virtual_terminal "vt" number Virtual terminal number (CB/Unix) width_status_line "wsl" number No. columns in status line num_labels "nlab" number No. of labels on screen (start at 1) label_height "lh" number No. rows in each label label_width "lw" number No. cols in each label back_tab "cbt" str Back tab (P) bell "bel" str Audible signal (bell) (P) carriage_return "cr" str Carriage return (P*) change_scroll_region "csr" str change to lines #1 through #2 (vt100) (PG) clear_all_tabs "tbc" str Clear all tab stops. (P) clear_screen "clear" str Clear screen (P*) clr_eol "el" str Clear to end of line (P) clr_eos "ed" str Clear to end of display (P*) column_address "hpa" str Set cursor column (PG) command_character "CC" str Term. settable cmd char in prototype cursor_address "cup" str Cursor motion to row #1 col #2 (PG) cursor_down "cud1" str Down one line cursor_home "home" str Home cursor (if no cup) cursor_invisible "civis" str Make cursor invisible cursor_left "cub1" str Move cursor left one space. cursor_mem_address "mrcup" str Memory relative cursor addressing. cursor_normal "cnorm" str Make cursor appear normal (undo vs/vi) cursor_right "cuf1" str Non-destructive space (cursor right) cursor_to_ll "ll" str Last line, first column (if no cup) cursor_up "cuu1" str Upline (cursor up) cursor_visible "cvvis" str Make cursor very visible delete_character "dch1" str Delete character (P*) delete_line "dl1" str Delete line (P*) dis_status_line "dsl" str Disable status line down_half_line "hd" str Half-line down (forward 1/2 linefeed) enter_alt_charset_mode "smacs" str Start alternate character set (P) enter_blink_mode "blink" str Turn on blinking enter_bold_mode "bold" str Turn on bold (extra bright) mode enter_ca_mode "smcup" str String to end programs that use cup enter_delete_mode "smdc" str Delete mode (enter) enter_dim_mode "dim" str Turn on half-bright mode enter_insert_mode "smir" str Insert mode (enter); enter_secure_mode "invis" str Turn on blank mode (chars invisible) enter_protected_mode "prot" str Turn on protected mode enter_reverse_mode "rev" str Turn on reverse video mode enter_standout_mode "smso" str Begin stand out mode enter_underline_mode "smul" str Start underscore mode erase_chars "ech" str Erase #1 characters (PG) exit_alt_charset_mode "rmacs" str End alternate character set (P) exit_attribute_mode "sgr0" str Turn off all attributes exit_ca_mode "rmcup" str String to begin programs that use cup exit_delete_mode "rmdc" str End delete mode exit_insert_mode "rmir" str End insert mode; exit_standout_mode "rmso" str End stand out mode exit_underline_mode "rmul" str End underscore mode flash_screen "flash" str Visible bell (may not move cursor) form_feed "ff" str Hardcopy terminal page eject (P*) from_status_line "fsl" str Return from status line init_1string "is1" str Terminal initialization string init_2string "is2" str Terminal initialization string init_3string "is3" str Terminal initialization string init_file "if" str Name of file containing is insert_character "ich1" str Insert character (P) insert_line "il1" str Add new blank line (P*) insert_padding "ip" str Insert pad after character inserted (P*) key_backspace "kbs" str Sent by backspace key key_catab "ktbc" str Sent by clear-all-tabs key. key_clear "kclr" str Sent by clear screen or erase key. key_ctab "kctab" str Sent by clear-tab key key_dc "kdch1" str Sent by delete character key. key_dl "kdl1" str Sent by delete line key. key_down "kcud1" str Sent by terminal down arrow key key_eic "krmir" str Sent by rmir or smir in insert mode. key_eol "kel" str Sent by clear-to-end-of-line key. key_eos "ked" str Sent by clear-to-end-of-screen key. key_f0 "kf0" str Sent by function key f0. key_f1 "kf1" str Sent by function key f1. key_f10 "kf10" str Sent by function key f10. key_f2 "kf2" str Sent by function key f2. key_f3 "kf3" str Sent by function key f3. key_f4 "kf4" str Sent by function key f4. key_f5 "kf5" str Sent by function key f5. key_f6 "kf6" str Sent by function key f6. key_f7 "kf7" str Sent by function key f7. key_f8 "kf8" str Sent by function key f8. key_f9 "kf9" str Sent by function key f9. key_home "khome" str Sent by home key. key_ic "kich1" str Sent by ins char/enter ins mode key. key_il "kil1" str Sent by insert line. key_left "kcub1" str Sent by terminal left arrow key key_ll "kll" str Sent by "home down" key (lower left) key_npage "knp" str Sent by next-page key key_ppage "kpp" str Sent by previous-page key key_right "kcuf1" str Sent by terminal right arrow key key_sf "kind" str Sent by scroll-forward/down key key_sr "kri" str Sent by scroll-backward/up key key_stab "khts" str Sent by set-tab key key_up "kcuu1" str Sent by terminal up arrow key keypad_local "rmkx" str Out of "keypad transmit" mode keypad_xmit "smkx" str Put terminal in "keypad transmit" mode lab_f0 "lf0" str Labels on function key f0 if not f0 lab_f1 "lf1" str Labels on function key f1 if not f1 lab_f10 "lf10" str Labels on function key f10 if not f10 lab_f2 "lf2" str Labels on function key f2 if not f2 lab_f3 "lf3" str Labels on function key f3 if not f3 lab_f4 "lf4" str Labels on function key f4 if not f4 lab_f5 "lf5" str Labels on function key f5 if not f5 lab_f6 "lf6" str Labels on function key f6 if not f6 lab_f7 "lf7" str Labels on function key f7 if not f7 lab_f8 "lf8" str Labels on function key f8 if not f8 lab_f9 "lf9" str Labels on function key f9 if not f9 meta_off "rmm" str Turn off "meta mode" meta_on "smm" str Turn on "meta mode" (8th bit) newline "nel" str Newline (behaves like cr followed by lf) pad_char "pad" str Pad character (rather than null) parm_dch "dch" str Delete #1 chars (PG*) parm_delete_line "dl" str Delete #1 lines (PG*) parm_down_cursor "cud" str Move cursor down #1 lines. (PG*) parm_ich "ich" str Insert #1 blank chars (PG*) parm_index "indn" str Scroll forward #1 lines (PG) parm_insert_line "il" str Add #1 new blank lines (PG*) parm_left_cursor "cub" str Move cursor left #1 spaces (PG) parm_right_cursor "cuf" str Move cursor right #1 spaces. (PG*) parm_rindex "rin" str Scroll backward #1 lines (PG) parm_up_cursor "cuu" str Move cursor up #1 lines. (PG*) pkey_key "pfkey" str Prog funct key #1 to type string #2 pkey_local "pfloc" str Prog funct key #1 to execute string #2 pkey_xmit "pfx" str Prog funct key #1 to xmit string #2 print_screen "mc0" str Print contents of the screen prtr_off "mc4" str Turn off the printer prtr_on "mc5" str Turn on the printer repeat_char "rep" str Repeat char #1 #2 times. (PG*) reset_1string "rs1" str Reset terminal completely to sane modes. reset_2string "rs2" str Reset terminal completely to sane modes. reset_3string "rs3" str Reset terminal completely to sane modes. reset_file "rf" str Name of file containing reset string. restore_cursor "rc" str Restore cursor to position of last sc. row_address "vpa" str Like hpa but sets row. (PG) save_cursor "sc" str Save cursor position. (P) scroll_forward "ind" str Scroll text up (P) scroll_reverse "ri" str Scroll text down (P) set_attributes "sgr" str Define the video attributes (PG9) set_tab "hts" str Set a tab in all rows, current column. set_window "wind" str Current window is lines #1-#2 cols #3-#4 tab "ht" str Tab to next 8 space hardware tab stop. to_status_line "tsl" str Go to status line underline_char "uc" str Underscore one char and move past it up_half_line "hu" str Half-line up (reverse 1/2 linefeed) init_prog "iprog" str Path name of program for init key_a1 "ka1" str Upper left of keypad key_a3 "ka3" str Upper right of keypad key_b2 "kb2" str Center of keypad key_c1 "kc1" str Lower left of keypad key_c3 "kc3" str Lower right of keypad prtr_non "mc5p" str Turn on the printer for #1 bytes. char_padding "rmp" str Like ip but when in replace mode acs_chars "acsc" str Graphics char set pairs aAbBcC - defn=vt100 plab_norm "pln" str Prog label #1 to show string #2 //go.sysin dd * echo 'x - =src/dump.c' sed 's/^X//' <<'//go.sysin dd *' >=src/dump.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* * dump.c - dump the contents of a compiled terminfo file in a * human-readable format. * * $Log: RCS/dump.v $ * Revision 2.1 82/10/25 14:46:20 pavel * Added Copyright Notice * * Revision 2.0 82/10/24 15:17:29 pavel * Beta-one Test Release * * Revision 1.3 82/08/23 22:30:18 pavel * The REAL Alpha-one Release Version * * Revision 1.2 82/08/19 19:12:50 pavel * Alpha Test Release One * * Revision 1.1 82/08/12 18:39:19 pavel * Initial revision * * */ static char RCSid[] = "$Header: RCS/dump.v Revision 2.1 82/10/25 14:46:20 pavel Exp$"; #include "compiler.h" #include "term.h" char *BoolNames[], *NumNames[], *StrNames[]; main(argc, argv) int argc; char *argv[]; { int i, j; int cur_column; char buffer[1024]; for (j=1; j < argc; j++) { if (read_entry(argv[j], &_first_term) < 0) { fprintf(stderr, "read_entry bombed on %s\n", argv[j]); abort(); } printf("%s,\n", _first_term.term_names); putchar('\t'); cur_column = 9; for (i=0; i < BOOLCOUNT; i++) { if (_first_term.Booleans[i] == TRUE) { if (cur_column > 9 && cur_column + strlen(BoolNames[i]) + 2 > 79) { printf("\n\t"); cur_column = 9; } printf("%s, ", BoolNames[i]); cur_column += strlen(BoolNames[i]) + 2; } } for (i=0; i < NUMCOUNT; i++) { if (_first_term.Numbers[i] != -1) { if (cur_column > 9 && cur_column + strlen(NumNames[i]) + 5 > 79) { printf("\n\t"); cur_column = 9; } printf("%s#%d, ", NumNames[i], _first_term.Numbers[i]); cur_column += strlen(NumNames[i]) + 5; } } for (i=0; i < STRCOUNT; i++) { if (_first_term.Strings[i]) { sprintf(buffer, "%s=%s, ", StrNames[i], _first_term.Strings[i]); expand(buffer); if (cur_column > 9 && cur_column + strlen(buffer) > 79) { printf("\n\t"); cur_column = 9; } printf("%s", buffer); cur_column += strlen(buffer); } } putchar('\n'); } } typedef unsigned char uchar; expand(str) uchar *str; { char buffer[1024]; int bufp; uchar *ptr; bufp = 0; ptr = str; while (*str) { if (*str < ' ') { buffer[bufp++] = '^'; buffer[bufp++] = *str + '@'; } else if (*str < '\177') buffer[bufp++] = *str; else { sprintf(&buffer[bufp], "\\%03o", *str); bufp += 4; } str++; } buffer[bufp] = '\0'; strcpy(ptr, buffer); } //go.sysin dd * echo 'x - =src/lib_addch.c' sed 's/^X//' <<'//go.sysin dd *' >=src/lib_addch.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* ** lib_addch.c ** ** The routine waddch(). ** ** $Log: RCS/lib_addch.v $ * Revision 2.1 82/10/25 14:46:23 pavel * Added Copyright Notice * * Revision 2.0 82/10/24 15:19:46 pavel * Beta-one Test Release * ** */ static char RCSid[] = "$Header: RCS/lib_addch.v Revision 2.1 82/10/25 14:46:23 pavel Exp$"; #include "curses.h" #include "curses.priv.h" #include "unctrl.h" waddch(win, c) WINDOW *win; char c; { int x, y; int newx; chtype ch = c; #ifdef UNDEFINED if (_tracing) _tracef("waddch(%o,%c) called", win, ch); #endif x = win->_curx; y = win->_cury; if (y > win->_maxy || x > win->_maxx || y < 0 || x < 0) return(ERR); switch (ch) { case '\t': for (newx = x + (8 - (x & 07)); x < newx; x++) if (waddch(win, ' ') == ERR) return(ERR); return(OK); case '\n': wclrtoeol(win); if (SP->_nl) x = 0; goto newline; case '\r': x = 0; break; case '\b': if (--x < 0) x = 0; break; default: if (ch < ' ') return(waddstr(win, unctrl(ch))); ch |= win->_attrs; if (win->_line[y][x] != ch) { if (win->_firstchar[y] == _NOCHANGE) win->_firstchar[y] = win->_lastchar[y] = x; else if (x < win->_firstchar[y]) win->_firstchar[y] = x; else if (x > win->_lastchar[y]) win->_lastchar[y] = x; win->_numchngd[y]++; } win->_line[y][x++] = ch; if (x > win->_maxx) { x = 0; newline: y++; if (y > win->_regbottom) { y--; if (win->_scroll) scroll(win); else return ERR; } } break; } win->_curx = x; win->_cury = y; return(OK); } //go.sysin dd * echo 'x - =src/lib_addstr.c' sed 's/^X//' <<'//go.sysin dd *' >=src/lib_addstr.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* ** lib_addstr.c * ** The routine waddstr(). ** ** $Log: RCS/lib_addstr.v $ * Revision 2.1 82/10/25 14:46:26 pavel * Added Copyright Notice * * Revision 2.0 82/10/24 15:19:59 pavel * Beta-one Test Release * ** */ static char RCSid[] = "$Header: RCS/lib_addstr.v Revision 2.1 82/10/25 14:46:26 pavel Exp$"; #include "curses.h" #include "curses.priv.h" waddstr(win, str) WINDOW *win; char *str; { #ifdef TRACE if (_tracing) _tracef("waddstr(%o,%o) called", win, str); #endif while (*str) { if (waddch(win, *str++) == ERR) return(ERR); } return(OK); } //go.sysin dd * echo 'x - =src/lib_beep.c' sed 's/^X//' <<'//go.sysin dd *' >=src/lib_beep.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* * beep.c * * Routines beep() and flash() * * $Log: RCS/lib_beep.v $ * Revision 2.1 82/10/25 14:46:29 pavel * Added Copyright Notice * * Revision 2.0 82/10/24 15:17:31 pavel * Beta-one Test Release * * Revision 1.3 82/08/23 22:30:22 pavel * The REAL Alpha-one Release Version * * Revision 1.2 82/08/19 19:11:02 pavel * Alpha Test Release One * * Revision 1.1 82/08/12 18:40:14 pavel * Initial revision * * */ static char RCSid[] = "$Header: RCS/lib_beep.v Revision 2.1 82/10/25 14:46:29 pavel Exp$"; #include "curses.h" #include "curses.priv.h" #include "term.h" static outc(ch) char ch; { putc(ch, SP->_ofp); } X/* * beep() * * Sound the current terminal's audible bell if it has one. If not, * flash the screen if possible. * */ beep() { #ifdef TRACE if (_tracing) _tracef("beep() called"); #endif if (bell) tputs(bell, 1, outc); else if (flash_screen) tputs(flash_screen, 1, outc); } X/* * flash() * * Flash the current terminal's screen if possible. If not, * sound the audible bell if one exists. * */ flash() { #ifdef TRACE if (_tracing) _tracef("flash() called"); #endif if (flash_screen) tputs(flash_screen, 1, outc); else if (bell) tputs(bell, 1, outc); } //go.sysin dd * echo 'x - =src/lib_box.c' sed 's/^X//' <<'//go.sysin dd *' >=src/lib_box.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* ** lib_box.c ** ** The routine box(). ** ** $Log: RCS/lib_box.v $ * Revision 2.1 82/10/25 14:46:31 pavel * Added Copyright Notice * * Revision 2.0 82/10/24 15:20:07 pavel * Beta-one Test Release * ** */ static char RCSid[] = "$Header: RCS/lib_box.v Revision 2.1 82/10/25 14:46:31 pavel Exp$"; #include "curses.h" #include "curses.priv.h" box(win, vert, hor) WINDOW *win; char vert, hor; { int i; int endy, endx; chtype *fp, *lp; #ifdef TRACE if (_tracing) _tracef("box(%o,%c,%c) called", win, vert, hor); #endif endx = win->_maxx; endy = win->_maxy; fp = win->_line[0]; lp = win->_line[endy]; for (i = 0; i <= endx; i++) fp[i] = lp[i] = hor; for (i = 0; i <= endy; i++) { win->_line[i][0] = (win->_line[i][endx] = vert); win->_firstchar[i] = 0; win->_lastchar[i] = endx; win->_numchngd[i] += 2; } win->_numchngd[0] = win->_numchngd[endy] = endx; if (! win->_scroll && (win->_flags & _SCROLLWIN)) fp[0] = fp[endx] = lp[0] = lp[endx] = ' '; } //go.sysin dd * echo 'x - =src/lib_clear.c' sed 's/^X//' <<'//go.sysin dd *' >=src/lib_clear.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* ** lib_clear.c ** ** The routine wclear(). ** ** $Log: RCS/lib_clear.v $ * Revision 2.1 82/10/25 14:46:34 pavel * Added Copyright Notice * * Revision 2.0 82/10/24 15:20:17 pavel * Beta-one Test Release * ** */ static char RCSid[] = "$Header: RCS/lib_clear.v Revision 2.1 82/10/25 14:46:34 pavel Exp$"; #include "curses.h" #include "curses.priv.h" wclear(win) WINDOW *win; { #ifdef TRACE if (_tracing) _tracef("wclear(%o) called", win); #endif werase(win); win->_clear = TRUE; return; } //go.sysin dd * echo 'x - =src/lib_clrbot.c' sed 's/^X//' <<'//go.sysin dd *' >=src/lib_clrbot.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* ** lib_clrbot.c ** ** The routine wclrtobot(). ** ** $Log: RCS/lib_clrbot.v $ * Revision 2.1 82/10/25 14:46:37 pavel * Added Copyright Notice * * Revision 2.0 82/10/24 15:20:24 pavel * Beta-one Test Release * ** */ static char RCSid[] = "$Header: RCS/lib_clrbot.v Revision 2.1 82/10/25 14:46:37 pavel Exp$"; #include "curses.h" #include "curses.priv.h" wclrtobot(win) WINDOW *win; { chtype *ptr, *end, *maxx; int y, startx, minx; chtype blank = ' ' | win->_attrs; #ifdef TRACE if (_tracing) _tracef("wclrtobot(%o) called", win); #endif startx = win->_curx; for (y = win->_cury; y <= win->_regbottom; y++) { minx = _NOCHANGE; end = &win->_line[y][win->_maxx]; for (ptr = &win->_line[y][startx]; ptr <= end; ptr++) { if (*ptr != blank) { maxx = ptr; if (minx == _NOCHANGE) minx = ptr - win->_line[y]; *ptr = blank; } } if (minx != _NOCHANGE) { if (win->_firstchar[y] > minx || win->_firstchar[y] == _NOCHANGE) win->_firstchar[y] = minx; if (win->_lastchar[y] < maxx - win->_line[y]) win->_lastchar[y] = maxx - win->_line[y]; } startx = 0; } } //go.sysin dd * echo 'x - =src/lib_clreol.c' sed 's/^X//' <<'//go.sysin dd *' >=src/lib_clreol.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* ** lib_clreol.c ** ** The routine wclrtoeol(). ** ** $Log: RCS/lib_clreol.v $ * Revision 2.1 82/10/25 14:46:42 pavel * Added Copyright Notice * * Revision 2.0 82/10/24 15:20:38 pavel * Beta-one Test Release * ** */ static char RCSid[] = "$Header: RCS/lib_clreol.v Revision 2.1 82/10/25 14:46:42 pavel Exp$"; #include "curses.h" #include "curses.priv.h" wclrtoeol(win) WINDOW *win; { chtype *maxx, *ptr, *end; int y, x, minx; chtype blank = ' ' | win->_attrs; #ifdef TRACE if (_tracing) _tracef("wclrtoeol(%o) called", win); #endif y = win->_cury; x = win->_curx; end = &win->_line[y][win->_maxx]; minx = _NOCHANGE; maxx = &win->_line[y][x]; for (ptr = maxx; ptr < end; ptr++) { if (*ptr != blank) { maxx = ptr; if (minx == _NOCHANGE) minx = ptr - win->_line[y]; *ptr = blank; win->_numchngd[y] += 1; } } if (minx != _NOCHANGE) { if (win->_firstchar[y] > minx || win->_firstchar[y] == _NOCHANGE) win->_firstchar[y] = minx; if (win->_lastchar[y] < maxx - win->_line[y]) win->_lastchar[y] = maxx - win->_line[y]; } } //go.sysin dd * echo 'x - =src/lib_data.c' sed 's/^X//' <<'//go.sysin dd *' >=src/lib_data.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* * lib_data.c - Global data definitions and initialisations * */ #include "curses.priv.h" #include "curses.h" #include "term.h" char ttytype[NAMESIZE]; #ifdef TRACE int _tracing = 1; #else int _tracing = 0; #endif struct screen *SP = 0; //go.sysin dd * echo 'x - =src/lib_delch.c' sed 's/^X//' <<'//go.sysin dd *' >=src/lib_delch.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* ** lib_delch.c ** ** The routine wdelch(). ** ** $Log: RCS/lib_delch.v $ * Revision 2.1 82/10/25 14:46:52 pavel * Added Copyright Notice * * Revision 2.0 82/10/24 15:20:47 pavel * Beta-one Test Release * ** */ static char RCSid[] = "$Header: RCS/lib_delch.v Revision 2.1 82/10/25 14:46:52 pavel Exp$"; #include "curses.h" #include "curses.priv.h" #include "term.h" wdelch(win) WINDOW *win; { chtype *temp1, *temp2; chtype *end; #ifdef TRACE if (_tracing) _tracef("wdelch(%o) called", win); #endif end = &win->_line[win->_cury][win->_maxx]; temp2 = &win->_line[win->_cury][win->_curx + 1]; temp1 = temp2 - 1; while (temp1 < end) *temp1++ = *temp2++; *temp1 = ' ' | win->_attrs; win->_lastchar[win->_cury] = win->_maxx; if (win->_firstchar[win->_cury] == _NOCHANGE || win->_firstchar[win->_cury] > win->_curx) win->_firstchar[win->_cury] = win->_curx; if (delete_character) win->_numchngd += 1; else win->_numchngd += win->_maxx - win->_curx + 1; } //go.sysin dd * echo 'x - =src/lib_deleteln.c' sed 's/^X//' <<'//go.sysin dd *' >=src/lib_deleteln.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* ** lib_deleteln.c ** ** The routine wdeleteln(). ** ** $Log: RCS/lib_deleteln.v $ * Revision 2.1 82/10/25 14:46:55 pavel * Added Copyright Notice * * Revision 2.0 82/10/25 13:44:03 pavel * Beta-one Test Release * ** */ static char RCSid[] = "$Header: RCS/lib_deleteln.v Revision 2.1 82/10/25 14:46:55 pavel Exp$"; #include "curses.h" #include "curses.priv.h" wdeleteln(win) WINDOW *win; { chtype *end, *temp; int y; #ifdef TRACE if (_tracing) _tracef("wdeleteln(%o) called", win); #endif temp = win->_line[win->_cury]; for (y = win->_cury; y < win->_regbottom; y++) { win->_line[y] = win->_line[y+1]; win->_firstchar[y] = 0; win->_lastchar[y] = win->_maxx; win->_numchngd[y] = win->_maxx; } win->_line[win->_regbottom] = temp; for (end = &(temp[win->_maxx]); temp <= end; ) *temp++ = ' ' | win->_attrs; } //go.sysin dd * echo 'x - =src/lib_delwin.c' sed 's/^X//' <<'//go.sysin dd *' >=src/lib_delwin.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* ** lib_delwin.c ** ** The routine delwin(). ** ** $Log: RCS/lib_delwin.v $ * Revision 2.1 82/10/25 14:47:01 pavel * Added Copyright Notice * * Revision 2.0 82/10/25 13:44:21 pavel * Beta-one Test Release * ** */ static char RCSid[] = "$Header: RCS/lib_delwin.v Revision 2.1 82/10/25 14:47:01 pavel Exp$"; #include "curses.h" #include "curses.priv.h" delwin(win) WINDOW *win; { int i; #ifdef TRACE if (_tracing) _tracef("delwin(%o) called", win); #endif if (! (win->_flags & _SUBWIN)) { for (i = 0; i <= win->_maxy && win->_line[i]; i++) cfree(win->_line[i]); } cfree(win->_numchngd); cfree(win->_firstchar); cfree(win->_lastchar); cfree(win->_line); cfree(win); } //go.sysin dd * echo 'x - =src/lib_endwin.c' sed 's/^X//' <<'//go.sysin dd *' >=src/lib_endwin.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* ** lib_endwin.c ** ** The routine endwin(). ** ** $Log: RCS/lib_endwin.v $ * Revision 2.1 82/10/25 14:47:13 pavel * Added Copyright Notice * * Revision 2.0 82/10/25 13:45:05 pavel * Beta-one Test Release * ** */ static char RCSid[] = "$Header: RCS/lib_endwin.v Revision 2.1 82/10/25 14:47:13 pavel Exp$"; #include "term.h" #include "curses.h" #include "curses.priv.h" static outc(ch) char ch; { putc(ch, SP->_ofp); } endwin() { #ifdef TRACE if (_tracing) _tracef("endwin() called"); #endif resetterm(); mvcur(-1, -1, LINES - 1, 0); if (exit_ca_mode) tputs(exit_ca_mode, 1, outc); if (curscr && (curscr->_attrs != A_NORMAL)) { vidputs(A_NORMAL, outc); curscr->_attrs = A_NORMAL; } fflush(SP->_ofp); } //go.sysin dd * echo 'x - =src/lib_erase.c' sed 's/^X//' <<'//go.sysin dd *' >=src/lib_erase.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* ** lib_erase.c ** ** The routine werase(). ** ** $Log: RCS/lib_erase.v $ * Revision 2.2 82/11/03 12:27:41 pavel * Fixed off-by-one error... If only I had used an invariant... * * Revision 2.1 82/10/25 14:47:17 pavel * Added Copyright Notice * * Revision 2.0 82/10/25 13:45:12 pavel * Beta-one Test Release * ** */ static char RCSid[] = "$Header: RCS/lib_erase.v Revision 2.2 82/11/03 12:27:41 pavel Exp$"; #include "curses.h" #include "curses.priv.h" werase(win) WINDOW *win; { int y; chtype *sp, *end, *start, *maxx; int minx; chtype blank = ' ' | win->_attrs; #ifdef TRACE if (_tracing) _tracef("werase(%o) called", win); #endif for (y = win->_regtop; y <= win->_regbottom; y++) { minx = _NOCHANGE; start = win->_line[y]; end = &start[win->_maxx]; for (sp = start; sp <= end; sp++) { if (*sp != blank) { maxx = sp; if (minx == _NOCHANGE) minx = sp - start; *sp = blank; win->_numchngd[y] += 1; } } if (minx != _NOCHANGE) { if (win->_firstchar[y] > minx || win->_firstchar[y] == _NOCHANGE) win->_firstchar[y] = minx; if (win->_lastchar[y] < maxx - win->_line[y]) win->_lastchar[y] = maxx - win->_line[y]; } } win->_curx = win->_cury = 0; } //go.sysin dd * echo 'x - =src/lib_fixterm.c' sed 's/^X//' <<'//go.sysin dd *' >=src/lib_fixterm.c X/********************************************************************* * COPYRIGHT NOTICE * ********************************************************************** * This software is copyright (C) 1982 by Pavel Curtis * * * * Permission is granted to reproduce and distribute * * this file by any means so long as no fee is charged * * above a nominal handling fee and so long as this * * notice is always included in the copies. * * * * Other rights are reserved except as explicitly granted * * by written permission of the author. * * Pavel Curtis * * Computer Science Dept. * * 405 Upson Hall * * Cornell University * * Ithaca, NY 14853 * * * * Ph- (607) 256-4934 * * * * Pavel.Cornell@Udel-Relay (ARPAnet) * * decvax!cornell!pavel (UUCPnet) * *********************************************************************/ X/* * fixterm.c * * Routines: * fixterm() * resetterm() * saveterm() * gettmode() * setterm() * baudrate() * erasechar() * killchar() * flushinp() * savetty() * resetty() * * $Log: RCS/lib_fixterm.v $ * Revision 2.1 82/10/25 14:47:22 pavel * Added Copyright Notice * * Revision 2.0 82/10/24 15:17:36 pavel * Beta-one Test Release * * Revision 1.3 82/08/23 22:30:27 pavel * The REAL Alpha-one Release Version * * Revision 1.2 82/08/19 19:11:21 pavel * Alpha Test Release One * * Revision 1.1 82/08/12 18:40:30 pavel * Initial revision * * */ static char RCSid[] = "$Header: RCS/lib_fixterm.v Revision 2.1 82/10/25 14:47:22 pavel Exp$"; #include #include "curses.h" #include "curses.priv.h" #include "term.h" X/* * fixterm() * resetterm() * * fixterm() establishes the tty modes contained in cur_term->Nttyb. * resetterm() establishes those in cur_term->Ottyb. * */ fixterm() { #ifdef TRACE if (_tracing) _tracef("fixterm() called"); #endif stty(cur_term->Filedes, &cur_term->Nttyb); } resetterm() { #ifdef TRACE if (_tracing) _tracef("resetterm() called"); #endif stty(cur_term->Filedes, &cur_term->Ottyb); } saveterm() { #ifdef TRACE if (_tracing) _tracef("saveterm() called"); #endif gtty(cur_term->Filedes, &cur_term->Nttyb); } X/* * gettmode() * setterm(type) * * These are kept around for backward compatibilty. gettmode() does * nothing. setterm() results in a proper call to setupterm() * */ gettmode() { #ifdef TRACE if (_tracing) _tracef("gettmode() called"); #endif } setterm(type) char *type; { #ifdef TRACE if (_tracing) _tracef("setterm() called"); #endif setupterm(type, 1, 0); } X/* * erasechar() * * Return erase character as given in cur_term->Ottyb. * */ char erasechar() { #ifdef TRACE if (_tracing) _tracef("erasechar() called"); #endif return(cur_term->Ottyb.sg_erase); } X/* * killchar() * * Return kill character as given in cur_term->Ottyb. * */ char killchar() { #ifdef TRACE if (_tracing) _tracef("killchar() called"); #endif return(cur_term->Ottyb.sg_kill); } X/* * flushinp() * * Flush any input on cur_term->Filedes * */ flushinp() { #ifdef TRACE if (_tracing) _tracef("flushinp() called"); #endif ioctl(cur_term->Filedes, TIOCFLUSH, 0); if (SP) SP->_backcnt = 0; } X/* * int * baudrate() * * Returns the current terminal's baud rate. * */ static int speeds[] = { 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400 }; int baudrate() { #ifdef UNDEFINED if (_tracing) _tracef("baudrate() called"); #endif return(speeds[cur_term->Nttyb.sg_ospeed]); } X/* ** savetty() and resetty() ** ** Kept around for compatibility. ** */ static struct sgttyb sgbuf; savetty() { #ifdef TRACE if (_tracing) _tracef("savetty() called"); #endif gtty(cur_term->Filedes, &sgbuf); } resetty() { #ifdef TRACE if (_tracing) _tracef("resetty() called"); #endif stty(cur_term->Filedes, &sgbuf); } //go.sysin dd * exit