home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume1 / pcurses / part05 < prev    next >
Encoding:
Internet Message Format  |  1986-11-30  |  54.1 KB

  1. Subject:  Terminfo/Curses Part 5 of 11
  2.  
  3. : Run this shell script with "sh" not "csh"
  4. PATH=:/bin:/usr/bin:/usr/ucb
  5. export PATH
  6. if test ! -d =src
  7. then
  8.     echo 'Making directory "=src"'
  9.     mkdir =src
  10. fi
  11. echo 'x - =src/MKcaptab.awk'
  12. sed 's/^X//' <<'//go.sysin dd *' >=src/MKcaptab.awk
  13. #*********************************************************************
  14. #                         COPYRIGHT NOTICE                           *
  15. #*********************************************************************
  16. #        This software is copyright (C) 1982 by Pavel Curtis         *
  17. #                                                                    *
  18. #        Permission is granted to reproduce and distribute           *
  19. #        this file by any means so long as no fee is charged         *
  20. #        above a nominal handling fee and so long as this            *
  21. #        notice is always included in the copies.                    *
  22. #                                                                    *
  23. #        Other rights are reserved except as explicitly granted      *
  24. #        by written permission of the author.                        *
  25. #                Pavel Curtis                                        *
  26. #                Computer Science Dept.                              *
  27. #                405 Upson Hall                                      *
  28. #                Cornell University                                  *
  29. #                Ithaca, NY 14853                                    *
  30. #                                                                    *
  31. #                Ph- (607) 256-4934                                  *
  32. #                                                                    *
  33. #                Pavel.Cornell@Udel-Relay   (ARPAnet)                *
  34. #                decvax!cornell!pavel       (UUCPnet)                *
  35. #********************************************************************/
  36.  
  37. #
  38. #  $Header:   RCS/MKcaptab.v  Revision 2.1  82/10/25  14:45:02  pavel  Exp$
  39. #
  40.  
  41.  
  42. BEGIN    {
  43.         print  "/*"
  44.         print  " *    comp_captab.c -- The names of the capabilities in a form ready for"
  45.         print  " *                 the making of a hash table for the compiler."
  46.         print  " *"
  47.         print  " */"
  48.         print  ""
  49.         print  ""
  50.         print  "#include \"compiler.h\""
  51.         print  "#include \"term.h\""
  52.         print  ""
  53.         print  ""
  54.         print  "struct name_table_entry    cap_table[] ="
  55.         print  "{"
  56.     }
  57.  
  58.  
  59. $3 == "bool"    {
  60.             printf "\t0,%15s,\tBOOLEAN,\t%3d,\n", $2, BoolCount++
  61.         }
  62.  
  63.  
  64. $3 == "number"    {
  65.             printf "\t0,%15s,\tNUMBER,\t\t%3d,\n", $2, NumCount++
  66.         }
  67.  
  68.  
  69. $3 == "str"    {
  70.             printf "\t0,%15s,\tSTRING,\t\t%3d,\n", $2, StrCount++
  71.         }
  72.  
  73.  
  74. END    {
  75.         print  "};"
  76.         print  ""
  77.         printf "struct name_table_entry *cap_hash_table[%d];\n",\
  78.                     (BoolCount + NumCount + StrCount) * 2
  79.         print  ""
  80.         printf "int    Hashtabsize = %d;\n",\
  81.                     (BoolCount + NumCount + StrCount) * 2
  82.         printf "int    Captabsize = %d;\n", BoolCount + NumCount + StrCount
  83.         print  ""
  84.         print  ""
  85.         printf "#if (BOOLCOUNT!=%d)||(NUMCOUNT!=%d)||(STRCOUNT!=%d)\n",\
  86.                         BoolCount, NumCount, StrCount
  87.         print  "    --> term.h and comp_captab.c disagree about the <--"
  88.         print  "    --> numbers of booleans, numbers and/or strings <--"
  89.         print  "#endif"
  90.     }
  91. //go.sysin dd *
  92. echo 'x - =src/MKnames.awk'
  93. sed 's/^X//' <<'//go.sysin dd *' >=src/MKnames.awk
  94. #*********************************************************************
  95. #                         COPYRIGHT NOTICE                           *
  96. #*********************************************************************
  97. #        This software is copyright (C) 1982 by Pavel Curtis         *
  98. #                                                                    *
  99. #        Permission is granted to reproduce and distribute           *
  100. #        this file by any means so long as no fee is charged         *
  101. #        above a nominal handling fee and so long as this            *
  102. #        notice is always included in the copies.                    *
  103. #                                                                    *
  104. #        Other rights are reserved except as explicitly granted      *
  105. #        by written permission of the author.                        *
  106. #                Pavel Curtis                                        *
  107. #                Computer Science Dept.                              *
  108. #                405 Upson Hall                                      *
  109. #                Cornell University                                  *
  110. #                Ithaca, NY 14853                                    *
  111. #                                                                    *
  112. #                Ph- (607) 256-4934                                  *
  113. #                                                                    *
  114. #                Pavel.Cornell@Udel-Relay   (ARPAnet)                *
  115. #                decvax!cornell!pavel       (UUCPnet)                *
  116. #********************************************************************/
  117.  
  118. #
  119. #  $Header:   RCS/MKnames.v  Revision 2.1  82/10/25  14:45:06  pavel  Exp$
  120. #
  121.  
  122. BEGIN        {
  123.             print  "/*" > "boolnames"
  124.             print  " *    dump_names.c - Arrays of capability names for use by the" > "boolnames"
  125.             print  " *            dump program." > "boolnames"
  126.             print  " *" > "boolnames"
  127.             print  " */" > "boolnames"
  128.             print  "" > "boolnames"
  129.             print  "" > "boolnames"
  130.             print  "char    *BoolNames[] = {" > "boolnames"
  131.             print  "char    *NumNames[] = {" > "numnames"
  132.             print  "char    *StrNames[] = {" > "strnames"
  133.         }
  134.  
  135. $3 == "bool"    {
  136.             printf "\t\t%s,\n", $2 > "boolnames"
  137.         }
  138.  
  139. $3 == "number"    {
  140.             printf "\t\t%s,\n", $2 > "numnames"
  141.         }
  142.  
  143. $3 == "str"    {
  144.             printf "\t\t%s,\n", $2 > "strnames"
  145.         }
  146.  
  147. END        {
  148.             print  "};" > "boolnames"
  149.             print  "" > "boolnames"
  150.             print  "};" > "numnames"
  151.             print  "" > "numnames"
  152.             print  "};" > "strnames"
  153.         }
  154. //go.sysin dd *
  155. echo 'x - =src/MKterm.h.awk'
  156. sed 's/^X//' <<'//go.sysin dd *' >=src/MKterm.h.awk
  157. #*********************************************************************
  158. #                         COPYRIGHT NOTICE                           *
  159. #*********************************************************************
  160. #        This software is copyright (C) 1982 by Pavel Curtis         *
  161. #                                                                    *
  162. #        Permission is granted to reproduce and distribute           *
  163. #        this file by any means so long as no fee is charged         *
  164. #        above a nominal handling fee and so long as this            *
  165. #        notice is always included in the copies.                    *
  166. #                                                                    *
  167. #        Other rights are reserved except as explicitly granted      *
  168. #        by written permission of the author.                        *
  169. #                Pavel Curtis                                        *
  170. #                Computer Science Dept.                              *
  171. #                405 Upson Hall                                      *
  172. #                Cornell University                                  *
  173. #                Ithaca, NY 14853                                    *
  174. #                                                                    *
  175. #                Ph- (607) 256-4934                                  *
  176. #                                                                    *
  177. #                Pavel.Cornell@Udel-Relay   (ARPAnet)                *
  178. #                decvax!cornell!pavel       (UUCPnet)                *
  179. #********************************************************************/
  180.  
  181. #
  182. # $Header:   RCS/MKterm.h.v  Revision 2.1  82/10/25  14:45:11  pavel  Exp$
  183. #
  184.  
  185. BEGIN        {
  186.             print "/*"
  187.             print "**    term.h -- Definition of struct term"
  188.             print "*/"
  189.             print ""
  190.             print "#ifndef SGTTY"
  191.             print "#    include \"curses.h\""
  192.             print "#endif"
  193.             print ""
  194.             print "#ifdef SINGLE"
  195.             print "#    define CUR _first_term."
  196.             print "#else"
  197.             print "#    define CUR cur_term->"
  198.             print "#endif"
  199.             print ""
  200.             print ""
  201.         }
  202.  
  203.  
  204. $3 == "bool"    {
  205.             printf "#define %-30s CUR Booleans[%d]\n", $1, BoolCount++
  206.         }
  207.  
  208. $3 == "number"    {
  209.             printf "#define %-30s CUR Numbers[%d]\n", $1, NumberCount++
  210.         }
  211.  
  212. $3 == "str"    {
  213.             printf "#define %-30s CUR Strings[%d]\n", $1, StringCount++
  214.         }
  215.  
  216.  
  217. END        {
  218.             print  ""
  219.             print  ""
  220.             print  "struct term"
  221.             print  "{"
  222.             print  "   char     *term_names;    /* offset in str_table of terminal names */"
  223.             print  "   char     *str_table;    /* pointer to string table */"
  224.             print  "   short Filedes;    /* file description being written to */"
  225.             print  "   SGTTY Ottyb,        /* original state of the terminal */"
  226.             print  "     Nttyb;        /* current state of the terminal */"
  227.             print  ""
  228.             printf "   char         Booleans[%d];\n", BoolCount
  229.             printf "   short     Numbers[%d];\n", NumberCount
  230.             printf "   char         *Strings[%d];\n", StringCount
  231.             print  "};"
  232.             print  ""
  233.             print  "struct term    _first_term;"
  234.             print  "struct term    *cur_term;"
  235.             print  ""
  236.             printf "#define BOOLCOUNT %d\n", BoolCount
  237.             printf "#define NUMCOUNT  %d\n", NumberCount
  238.             printf "#define STRCOUNT  %d\n", StringCount
  239.         }
  240. //go.sysin dd *
  241. echo 'x - =src/Makefile'
  242. sed 's/^X//' <<'//go.sysin dd *' >=src/Makefile
  243. #*********************************************************************
  244. #                         COPYRIGHT NOTICE                           *
  245. #*********************************************************************
  246. #        This software is copyright (C) 1982 by Pavel Curtis         *
  247. #                                                                    *
  248. #        Permission is granted to reproduce and distribute           *
  249. #        this file by any means so long as no fee is charged         *
  250. #        above a nominal handling fee and so long as this            *
  251. #        notice is always included in the copies.                    *
  252. #                                                                    *
  253. #        Other rights are reserved except as explicitly granted      *
  254. #        by written permission of the author.                        *
  255. #                Pavel Curtis                                        *
  256. #                Computer Science Dept.                              *
  257. #                405 Upson Hall                                      *
  258. #                Cornell University                                  *
  259. #                Ithaca, NY 14853                                    *
  260. #                                                                    *
  261. #                Ph- (607) 256-4934                                  *
  262. #                                                                    *
  263. #                Pavel.Cornell@Udel-Relay   (ARPAnet)                *
  264. #                decvax!cornell!pavel       (UUCPnet)                *
  265. #********************************************************************/
  266.  
  267. # RCSid: $Header:   RCS/Makefile.v  Revision 2.2  82/10/25  15:28:23  pavel  Exp$
  268.  
  269. SRCDIR= /etc/term
  270. CFLAGS= -O -DSRCDIR='"$(SRCDIR)"'
  271. DFLAGS= -g -DTRACE -DSRCDIR='"$(SRCDIR)"'
  272.  
  273. SRCS=    comp_main.c comp_hash.c comp_captab.c comp_scan.c comp_error.c \
  274.     comp_parse.c read_entry.c \
  275.     dump.c dump_names.c  \
  276.     lib_setup.c lib_fixterm.c lib_tparm.c lib_tputs.c \
  277.     lib_unctrl.c lib_raw.c lib_vidattr.c lib_trace.c lib_data.c \
  278.     lib_beep.c lib_doupdate.c lib_refresh.c lib_initscr.c lib_newwin.c \
  279.     lib_addch.c lib_addstr.c lib_scroll.c lib_clreol.c lib_touchwin.c \
  280.     lib_mvcur.c lib_delwin.c lib_endwin.c lib_clrbot.c lib_move.c \
  281.     lib_printw.c lib_scanw.c lib_erase.c lib_getch.c lib_options.c \
  282.     lib_box.c lib_clear.c lib_delch.c lib_deleteln.c lib_insch.c \
  283.     lib_insertln.c lib_getstr.c lib_mvwin.c lib_longname.c lib_tstp.c \
  284.     lib_newterm.c lib_set_term.c lib_overlay.c lib_scrreg.c
  285.  
  286. #
  287. # Normal, optimised object files
  288. #
  289. LIBOBJS= lib_setup.o lib_fixterm.o lib_tparm.o read_entry.o lib_tputs.o \
  290.     lib_unctrl.o lib_raw.o lib_vidattr.o lib_trace.o lib_data.o lib_beep.o \
  291.     lib_doupdate.o lib_refresh.o lib_initscr.o lib_newwin.o lib_addch.o \
  292.     lib_addstr.o lib_scroll.o lib_clreol.o lib_touchwin.o lib_mvcur.o \
  293.     lib_delwin.o lib_endwin.o lib_clrbot.o lib_move.o lib_printw.o \
  294.     lib_scanw.o lib_erase.o lib_getch.o lib_options.o \
  295.     lib_box.o lib_clear.o lib_delch.o lib_deleteln.o lib_insch.o \
  296.     lib_insertln.o lib_getstr.o lib_mvwin.o lib_longname.o lib_tstp.o \
  297.     lib_newterm.o lib_set_term.o lib_overlay.o lib_scrreg.o
  298.  
  299. #
  300. # Debugging (tracing) object files
  301. #
  302. DLIBOBJS= lib_setup.d lib_fixterm.d lib_tparm.d read_entry.d lib_tputs.d \
  303.     lib_unctrl.d lib_raw.d lib_vidattr.d lib_trace.d lib_data.d lib_beep.d \
  304.     lib_doupdate.d lib_refresh.d lib_initscr.d lib_newwin.d lib_addch.d \
  305.     lib_addstr.d lib_scroll.d lib_clreol.d lib_touchwin.d lib_mvcur.d \
  306.     lib_delwin.d lib_endwin.d lib_clrbot.d lib_move.d lib_printw.d \
  307.     lib_scanw.d lib_erase.d lib_getch.d lib_options.d \
  308.     lib_box.d lib_clear.d lib_delch.d lib_deleteln.d lib_insch.d \
  309.     lib_insertln.d lib_getstr.d lib_mvwin.d lib_longname.d lib_tstp.d \
  310.     lib_newterm.d lib_set_term.d lib_overlay.d lib_scrreg.d
  311.  
  312. #
  313. # Profiled Optimised object files
  314. #
  315. PLIBOBJS= lib_setup.p lib_fixterm.p lib_tparm.p read_entry.p lib_tputs.p \
  316.     lib_unctrl.p lib_raw.p lib_vidattr.p lib_trace.p lib_data.p lib_beep.p \
  317.     lib_doupdate.p lib_refresh.p lib_initscr.p lib_newwin.p lib_addch.p \
  318.     lib_addstr.p lib_scroll.p lib_clreol.p lib_touchwin.p lib_mvcur.p \
  319.     lib_delwin.p lib_endwin.p lib_clrbot.p lib_move.p lib_printw.p \
  320.     lib_scanw.p lib_erase.p lib_getch.p lib_options.p \
  321.     lib_box.p lib_clear.p lib_delch.p lib_deleteln.p lib_insch.p \
  322.     lib_insertln.p lib_getstr.p lib_mvwin.p lib_longname.p lib_tstp.p \
  323.     lib_newterm.p lib_set_term.p lib_overlay.p lib_scrreg.p
  324.  
  325. COMPOBJS= comp_main.o comp_hash.o comp_captab.o comp_scan.o comp_error.o \
  326.     comp_parse.o read_entry.o
  327.  
  328. X.SUFFIXES: .d .p
  329.  
  330. X.c.d:
  331.     -mv $*.o $*.O
  332.     cc -c $(DFLAGS) $*.c
  333.     mv $*.o $*.d
  334.     -mv $*.O $*.o
  335.  
  336. X.c.p:
  337.     -mv $*.o $*.O
  338.     cc -pg -c $(CFLAGS) $*.c
  339.     mv $*.o $*.p
  340.     -mv $*.O $*.o
  341.  
  342. all:    compile dump lib dlib
  343.  
  344. install: all
  345.     sed -e 's/clude *"curses.h" *$$/clude <ncurses.h>/' term.h > /usr/include/term.h
  346.     sed -e 's/^#include *"terminfo.h" *$$/#include <terminfo.h>/' curses.h > /usr/include/ncurses.h
  347.     cp terminfo.h /usr/include/terminfo.h
  348.     cp unctrl.h /usr/include/unctrl.h
  349.     cp compile $(SRCDIR)/compile
  350.     cp dump $(SRCDIR)/dump
  351.     cp libcurses.a /usr/lib/libncurses.a
  352.     cp libdcurses.a /usr/lib/libdcurses.a
  353.     ranlib /usr/lib/libncurses.a
  354.     ranlib /usr/lib/libdcurses.a
  355.  
  356. lib:    libcurses.a    
  357. libcurses.a:    ${LIBOBJS}
  358.     ar rv libcurses.a ${LIBOBJS}
  359.     ranlib libcurses.a
  360.  
  361. dlib:    libdcurses.a    
  362. libdcurses.a:    ${DLIBOBJS}
  363.     ar rv libdcurses.a ${DLIBOBJS}
  364.     ranlib libdcurses.a
  365.  
  366. plib:    libpcurses.a    
  367. libpcurses.a:    ${PLIBOBJS}
  368.     ar rv libpcurses.a ${PLIBOBJS}
  369.     ranlib libpcurses.a
  370.  
  371. compile: ${COMPOBJS}
  372.     cc -o compile ${COMPOBJS}
  373.  
  374. dump: dump.o dump_names.o read_entry.o
  375.     cc -o dump dump.o dump_names.o read_entry.o
  376.  
  377. lint: ${SRCS}
  378.     lint ${DFLAGS} ${SRCS} > lint.out
  379.  
  380. term.h: Caps MKterm.h.awk
  381.     awk -f MKterm.h.awk Caps > term.h
  382.  
  383. comp_captab.c: Caps MKcaptab.awk
  384.     awk -f MKcaptab.awk Caps > comp_captab.c
  385.  
  386. dump.o: dump.c term.h compiler.h
  387.  
  388. dump_names.c: Caps MKnames.awk
  389.     awk -f MKnames.awk Caps
  390.     cat boolnames numnames strnames > dump_names.c
  391.     -rm -f boolnames numnames strnames
  392.  
  393. clean:
  394.     -rm -f *.[od] term.h comp_captab.c tags dump_names.c
  395.  
  396. tags:    *.c *.h
  397.     ctags *.c *.h
  398.  
  399. depend:    ${SRCS}
  400.     grep "^#include" ${SRCS} \
  401.         | sed 's/\([^:]*\).c:[^"]*"\([^"]*\)".*/\1.o: \2/' \
  402.         | sed '/#include/d' > makedep
  403.     echo '/^# DO NOT DELETE THIS LINE/+2,$$d' > eddep
  404.     echo '$$r makedep' >> eddep
  405.     echo '/^# DO NOT DELETE THIS LINE/+2,$$s/\.o/.d/' >> eddep
  406.     echo '$$r makedep' >> eddep
  407.     echo 'w' >> eddep
  408.     cp Makefile Makefile.bak
  409.     ex - Makefile < eddep
  410.     rm makedep eddep
  411.     echo >> Makefile
  412.     echo "# DEPENDENCIES MUST END AT END OF FILE" >> Makefile
  413.     echo "# IF YOU PUT STUFF HERE, IT WILL GO AWAY" >> Makefile
  414.     echo "# See make depend, above" >> Makefile
  415.  
  416. # DO NOT DELETE THIS LINE - make depend needs it
  417.  
  418. comp_main.d: compiler.h
  419. comp_hash.d: compiler.h
  420. comp_hash.d: term.h
  421. comp_captab.d: compiler.h
  422. comp_captab.d: term.h
  423. comp_scan.d: compiler.h
  424. comp_error.d: compiler.h
  425. comp_parse.d: compiler.h
  426. comp_parse.d: term.h
  427. comp_parse.d: object.h
  428. read_entry.d: term.h
  429. read_entry.d: object.h
  430. dump.d: compiler.h
  431. dump.d: term.h
  432. lib_setup.d: curses.h
  433. lib_setup.d: curses.priv.h
  434. lib_setup.d: term.h
  435. lib_fixterm.d: curses.h
  436. lib_fixterm.d: curses.priv.h
  437. lib_fixterm.d: term.h
  438. lib_tparm.d: curses.h
  439. lib_tparm.d: curses.priv.h
  440. lib_tparm.d: term.h
  441. lib_tputs.d: curses.h
  442. lib_tputs.d: curses.priv.h
  443. lib_tputs.d: term.h
  444. lib_raw.d: curses.h
  445. lib_raw.d: curses.priv.h
  446. lib_raw.d: term.h
  447. lib_vidattr.d: curses.h
  448. lib_vidattr.d: curses.priv.h
  449. lib_vidattr.d: term.h
  450. lib_trace.d: term.h
  451. lib_trace.d: curses.h
  452. lib_trace.d: curses.priv.h
  453. lib_data.d: curses.priv.h
  454. lib_data.d: curses.h
  455. lib_data.d: term.h
  456. lib_beep.d: curses.h
  457. lib_beep.d: curses.priv.h
  458. lib_beep.d: term.h
  459. lib_doupdate.d: curses.h
  460. lib_doupdate.d: curses.priv.h
  461. lib_doupdate.d: term.h
  462. lib_refresh.d: curses.h
  463. lib_refresh.d: curses.priv.h
  464. lib_initscr.d: curses.h
  465. lib_initscr.d: curses.priv.h
  466. lib_newwin.d: term.h
  467. lib_newwin.d: curses.h
  468. lib_newwin.d: curses.priv.h
  469. lib_addch.d: curses.h
  470. lib_addch.d: curses.priv.h
  471. lib_addch.d: unctrl.h
  472. lib_addstr.d: curses.h
  473. lib_addstr.d: curses.priv.h
  474. lib_scroll.d: curses.h
  475. lib_scroll.d: curses.priv.h
  476. lib_clreol.d: curses.h
  477. lib_clreol.d: curses.priv.h
  478. lib_touchwin.d: curses.h
  479. lib_touchwin.d: curses.priv.h
  480. lib_mvcur.d: term.h
  481. lib_mvcur.d: curses.h
  482. lib_mvcur.d: curses.priv.h
  483. lib_delwin.d: curses.h
  484. lib_delwin.d: curses.priv.h
  485. lib_endwin.d: term.h
  486. lib_endwin.d: curses.h
  487. lib_endwin.d: curses.priv.h
  488. lib_clrbot.d: curses.h
  489. lib_clrbot.d: curses.priv.h
  490. lib_move.d: curses.h
  491. lib_move.d: curses.priv.h
  492. lib_printw.d: curses.h
  493. lib_printw.d: curses.priv.h
  494. lib_scanw.d: curses.h
  495. lib_scanw.d: curses.priv.h
  496. lib_erase.d: curses.h
  497. lib_erase.d: curses.priv.h
  498. lib_getch.d: curses.h
  499. lib_getch.d: curses.priv.h
  500. lib_options.d: term.h
  501. lib_options.d: curses.h
  502. lib_options.d: curses.priv.h
  503. lib_box.d: curses.h
  504. lib_box.d: curses.priv.h
  505. lib_clear.d: curses.h
  506. lib_clear.d: curses.priv.h
  507. lib_delch.d: curses.h
  508. lib_delch.d: curses.priv.h
  509. lib_delch.d: term.h
  510. lib_deleteln.d: curses.h
  511. lib_deleteln.d: curses.priv.h
  512. lib_insch.d: curses.h
  513. lib_insch.d: curses.priv.h
  514. lib_insertln.d: curses.h
  515. lib_insertln.d: curses.priv.h
  516. lib_getstr.d: curses.h
  517. lib_getstr.d: curses.priv.h
  518. lib_getstr.d: unctrl.h
  519. lib_mvwin.d: curses.h
  520. lib_mvwin.d: curses.priv.h
  521. lib_longname.d: curses.h
  522. lib_longname.d: curses.priv.h
  523. lib_tstp.d: term.h
  524. lib_tstp.d: curses.h
  525. lib_tstp.d: curses.priv.h
  526. lib_newterm.d: curses.h
  527. lib_newterm.d: term.h
  528. lib_newterm.d: curses.priv.h
  529. lib_set_term.d: curses.h
  530. lib_set_term.d: curses.priv.h
  531. lib_set_term.d: term.h
  532. lib_overlay.d: curses.h
  533. lib_overlay.d: curses.priv.h
  534. lib_scrreg.d: curses.h
  535. lib_scrreg.d: curses.priv.h
  536. comp_main.o: compiler.h
  537. comp_hash.o: compiler.h
  538. comp_hash.o: term.h
  539. comp_captab.o: compiler.h
  540. comp_captab.o: term.h
  541. comp_scan.o: compiler.h
  542. comp_error.o: compiler.h
  543. comp_parse.o: compiler.h
  544. comp_parse.o: term.h
  545. comp_parse.o: object.h
  546. read_entry.o: term.h
  547. read_entry.o: object.h
  548. dump.o: compiler.h
  549. dump.o: term.h
  550. lib_setup.o: curses.h
  551. lib_setup.o: curses.priv.h
  552. lib_setup.o: term.h
  553. lib_fixterm.o: curses.h
  554. lib_fixterm.o: curses.priv.h
  555. lib_fixterm.o: term.h
  556. lib_tparm.o: curses.h
  557. lib_tparm.o: curses.priv.h
  558. lib_tparm.o: term.h
  559. lib_tputs.o: curses.h
  560. lib_tputs.o: curses.priv.h
  561. lib_tputs.o: term.h
  562. lib_raw.o: curses.h
  563. lib_raw.o: curses.priv.h
  564. lib_raw.o: term.h
  565. lib_vidattr.o: curses.h
  566. lib_vidattr.o: curses.priv.h
  567. lib_vidattr.o: term.h
  568. lib_trace.o: term.h
  569. lib_trace.o: curses.h
  570. lib_trace.o: curses.priv.h
  571. lib_data.o: curses.priv.h
  572. lib_data.o: curses.h
  573. lib_data.o: term.h
  574. lib_beep.o: curses.h
  575. lib_beep.o: curses.priv.h
  576. lib_beep.o: term.h
  577. lib_doupdate.o: curses.h
  578. lib_doupdate.o: curses.priv.h
  579. lib_doupdate.o: term.h
  580. lib_refresh.o: curses.h
  581. lib_refresh.o: curses.priv.h
  582. lib_initscr.o: curses.h
  583. lib_initscr.o: curses.priv.h
  584. lib_newwin.o: term.h
  585. lib_newwin.o: curses.h
  586. lib_newwin.o: curses.priv.h
  587. lib_addch.o: curses.h
  588. lib_addch.o: curses.priv.h
  589. lib_addch.o: unctrl.h
  590. lib_addstr.o: curses.h
  591. lib_addstr.o: curses.priv.h
  592. lib_scroll.o: curses.h
  593. lib_scroll.o: curses.priv.h
  594. lib_clreol.o: curses.h
  595. lib_clreol.o: curses.priv.h
  596. lib_touchwin.o: curses.h
  597. lib_touchwin.o: curses.priv.h
  598. lib_mvcur.o: term.h
  599. lib_mvcur.o: curses.h
  600. lib_mvcur.o: curses.priv.h
  601. lib_delwin.o: curses.h
  602. lib_delwin.o: curses.priv.h
  603. lib_endwin.o: term.h
  604. lib_endwin.o: curses.h
  605. lib_endwin.o: curses.priv.h
  606. lib_clrbot.o: curses.h
  607. lib_clrbot.o: curses.priv.h
  608. lib_move.o: curses.h
  609. lib_move.o: curses.priv.h
  610. lib_printw.o: curses.h
  611. lib_printw.o: curses.priv.h
  612. lib_scanw.o: curses.h
  613. lib_scanw.o: curses.priv.h
  614. lib_erase.o: curses.h
  615. lib_erase.o: curses.priv.h
  616. lib_getch.o: curses.h
  617. lib_getch.o: curses.priv.h
  618. lib_options.o: term.h
  619. lib_options.o: curses.h
  620. lib_options.o: curses.priv.h
  621. lib_box.o: curses.h
  622. lib_box.o: curses.priv.h
  623. lib_clear.o: curses.h
  624. lib_clear.o: curses.priv.h
  625. lib_delch.o: curses.h
  626. lib_delch.o: curses.priv.h
  627. lib_delch.o: term.h
  628. lib_deleteln.o: curses.h
  629. lib_deleteln.o: curses.priv.h
  630. lib_insch.o: curses.h
  631. lib_insch.o: curses.priv.h
  632. lib_insertln.o: curses.h
  633. lib_insertln.o: curses.priv.h
  634. lib_getstr.o: curses.h
  635. lib_getstr.o: curses.priv.h
  636. lib_getstr.o: unctrl.h
  637. lib_mvwin.o: curses.h
  638. lib_mvwin.o: curses.priv.h
  639. lib_longname.o: curses.h
  640. lib_longname.o: curses.priv.h
  641. lib_tstp.o: term.h
  642. lib_tstp.o: curses.h
  643. lib_tstp.o: curses.priv.h
  644. lib_newterm.o: curses.h
  645. lib_newterm.o: term.h
  646. lib_newterm.o: curses.priv.h
  647. lib_set_term.o: curses.h
  648. lib_set_term.o: curses.priv.h
  649. lib_set_term.o: term.h
  650. lib_overlay.o: curses.h
  651. lib_overlay.o: curses.priv.h
  652. lib_scrreg.o: curses.h
  653. lib_scrreg.o: curses.priv.h
  654.  
  655. # DEPENDENCIES MUST END AT END OF FILE
  656. # IF YOU PUT STUFF HERE, IT WILL GO AWAY
  657. # See make depend, above
  658. //go.sysin dd *
  659. echo 'x - =src/curses.h'
  660. sed 's/^X//' <<'//go.sysin dd *' >=src/curses.h
  661. X/*********************************************************************
  662. *                         COPYRIGHT NOTICE                           *
  663. **********************************************************************
  664. *        This software is copyright (C) 1982 by Pavel Curtis         *
  665. *                                                                    *
  666. *        Permission is granted to reproduce and distribute           *
  667. *        this file by any means so long as no fee is charged         *
  668. *        above a nominal handling fee and so long as this            *
  669. *        notice is always included in the copies.                    *
  670. *                                                                    *
  671. *        Other rights are reserved except as explicitly granted      *
  672. *        by written permission of the author.                        *
  673. *                Pavel Curtis                                        *
  674. *                Computer Science Dept.                              *
  675. *                405 Upson Hall                                      *
  676. *                Cornell University                                  *
  677. *                Ithaca, NY 14853                                    *
  678. *                                                                    *
  679. *                Ph- (607) 256-4934                                  *
  680. *                                                                    *
  681. *                Pavel.Cornell@Udel-Relay   (ARPAnet)                *
  682. *                decvax!cornell!pavel       (UUCPnet)                *
  683. *********************************************************************/
  684.  
  685. X/*
  686.  *      curses.h - Main header file for the curses package
  687.  *
  688.  *  $Header:   RCS/curses.v  Revision 2.1  82/10/25  14:46:08  pavel  Exp$
  689.  *
  690.  *  $Log:    RCS/curses.v $
  691. Revision 2.1  82/10/25  14:46:08  pavel
  692. Added Copyright Notice
  693.  
  694. Revision 2.0  82/10/24  15:17:22  pavel
  695. Beta-one Test Release
  696.  
  697. Revision 1.4  82/08/23  22:30:13  pavel
  698. The REAL Alpha-one Release Version
  699.  
  700. Revision 1.3  82/08/20  16:52:46  pavel
  701. XFixed <terminfo.h> bug
  702.  
  703. Revision 1.2  82/08/19  19:10:13  pavel
  704. Alpha Test Release One
  705.  
  706. Revision 1.1  82/08/12  18:38:57  pavel
  707. Initial revision
  708.  
  709.  *
  710.  */
  711.  
  712. #ifndef WINDOW
  713.  
  714. #include "terminfo.h"
  715.  
  716.  
  717. #define bool    char
  718.  
  719.  
  720. #ifndef MINICURSES
  721.     typedef unsigned short  chtype;
  722. #else
  723.     typedef unsigned char   chtype;
  724. #endif  MINICURSES
  725.  
  726.  
  727. #ifndef TRUE
  728. #  define TRUE    (1)
  729. #  define FALSE   (0)
  730. #endif
  731.  
  732. #define ERR     (0)
  733. #define OK      (1)
  734.  
  735. #define _SUBWIN         01
  736. #define _ENDLINE        02
  737. #define _FULLWIN        04
  738. #define _SCROLLWIN      010
  739.  
  740. #define _NOCHANGE       -1
  741.  
  742. struct _win_st {
  743.     short   _cury, _curx;
  744.     short   _maxy, _maxx;
  745.     short   _begy, _begx;
  746.     short   _flags;
  747.     chtype  _attrs;
  748.     bool    _clear;
  749.     bool    _leave;
  750.     bool    _scroll;
  751.     bool    _idlok;
  752.     bool    _use_keypad;    /* 0=no, 1=yes, 2=yes/timeout */
  753.     bool    _use_meta;      /* T=use the meta key */
  754.     bool    _nodelay;       /* T=don't wait for tty input */
  755.     chtype  **_line;
  756.     short   *_firstchar;    /* First changed character in the line */
  757.     short   *_lastchar;     /* Last changed character in the line */
  758.     short   *_numchngd;     /* Number of changes made in the line */
  759.     short    _regtop;    /* Top and bottom of scrolling region */
  760.     short    _regbottom;
  761. };
  762.  
  763. #define WINDOW  struct _win_st
  764.  
  765. WINDOW    *stdscr, *curscr;
  766.  
  767. int    LINES, COLS;
  768.  
  769. WINDOW  *initscr(), *newwin(), *subwin();
  770. char    *longname();
  771. struct  screen  *newterm(), *set_term();
  772.  
  773.  
  774. X/*
  775.  * psuedo functions
  776.  */
  777.  
  778. #define getyx(win,y,x)   (y = (win)->_cury, x = (win)->_curx)
  779.  
  780. #define inch()               winch(stdscr)
  781. #define standout()          wstandout(stdscr)
  782. #define standend()          wstandend(stdscr)
  783. #define attron(at)          wattron(stdscr,at)
  784. #define attroff(at)         wattroff(stdscr,at)
  785. #define attrset(at)         wattrset(stdscr,at)
  786.  
  787. #define winch(win)           ((win)->_line[(win)->_cury][(win)->_curx])
  788. #define wstandout(win)          (wattrset(win,A_STANDOUT))
  789. #define wstandend(win)          (wattrset(win,A_NORMAL))
  790. #define wattron(win,at)         ((win)->_attrs |= (at))
  791. #define wattroff(win,at)        ((win)->_attrs &= ~(at))
  792. #define wattrset(win,at)        ((win)->_attrs = (at))
  793.  
  794.  
  795. #ifndef MINICURSES
  796.     /*
  797.      * psuedo functions for standard screen
  798.      */
  799. #  define addch(ch)       waddch(stdscr, ch)
  800. #  define getch()         wgetch(stdscr)
  801. #  define addstr(str)     waddstr(stdscr, str)
  802. #  define getstr(str)     wgetstr(stdscr, str)
  803. #  define move(y, x)      wmove(stdscr, y, x)
  804. #  define clear()         wclear(stdscr)
  805. #  define erase()         werase(stdscr)
  806. #  define clrtobot()      wclrtobot(stdscr)
  807. #  define clrtoeol()      wclrtoeol(stdscr)
  808. #  define insertln()      winsertln(stdscr)
  809. #  define deleteln()      wdeleteln(stdscr)
  810. #  define refresh()       wrefresh(stdscr)
  811. #  define insch(c)        winsch(stdscr,c)
  812. #  define delch()         wdelch(stdscr)
  813. #  define setscrreg(t,b)  wsetscrreg(stdscr,t,b)
  814.  
  815.         /*
  816.          * mv functions
  817.          */
  818. #  define mvwaddch(win,y,x,ch)    (wmove(win,y,x) == ERR ? ERR : waddch(win,ch))
  819. #  define mvwgetch(win,y,x)       (wmove(win,y,x) == ERR ? ERR : wgetch(win))
  820. #  define mvwaddstr(win,y,x,str)  (wmove(win,y,x) == ERR ? ERR \
  821.                              : waddstr(win,str))
  822. #  define mvwgetstr(win,y,x)      (wmove(win,y,x) == ERR ? ERR : wgetstr(win))
  823. #  define mvwinch(win,y,x)        (wmove(win,y,x) == ERR ? ERR : winch(win))
  824. #  define mvwdelch(win,y,x)       (wmove(win,y,x) == ERR ? ERR : wdelch(win))
  825. #  define mvwinsch(win,y,x,c)     (wmove(win,y,x) == ERR ? ERR : winsch(win,c))
  826. #  define mvaddch(y,x,ch)         mvwaddch(stdscr,y,x,ch)
  827. #  define mvgetch(y,x)            mvwgetch(stdscr,y,x)
  828. #  define mvaddstr(y,x,str)       mvwaddstr(stdscr,y,x,str)
  829. #  define mvgetstr(y,x)           mvwgetstr(stdscr,y,x)
  830. #  define mvinch(y,x)             mvwinch(stdscr,y,x)
  831. #  define mvdelch(y,x)            mvwdelch(stdscr,y,x)
  832. #  define mvinsch(y,x,c)          mvwinsch(stdscr,y,x,c)
  833.   
  834. #else MINICURSES
  835.  
  836. #  define addch              m_addch
  837. #  define addstr                  m_addstr
  838. #  define erase                   m_erase
  839. #  define clear                   m_clear
  840. #  define refresh                 m_refresh
  841. #  define initscr                 m_initscr
  842. #  define newterm                 m_newterm
  843. #  define mvaddch(y,x,ch)         (move(y,x) == ERR ? ERR : addch(ch))
  844. #  define mvaddstr(y,x,str)       (move(y,x) == ERR ? ERR : addstr(str))
  845.  
  846. X/*
  847.  * These functions don't exist in minicurses, so we define them
  848.  * to nonexistent functions to help the user catch the error.
  849.  */
  850. #  define box             no_box
  851. #  define clrtobot        no_clrtobot
  852. #  define clrtoeol        no_clrtoeol
  853. #  define delch           no_delch
  854. #  define deleteln        no_deleteln
  855. #  define delwin          no_delwin
  856. #  define getch           no_getch
  857. #  define getstr          no_getstr
  858. #  define insch           no_insch
  859. #  define insertln        no_insertln
  860. #  define longname        no_longname
  861. #  define mvprintw        no_mvprintw
  862. #  define mvscanw         no_mvscanw
  863. #  define mvwin           no_mvwin
  864. #  define mvwprintw       no_mvwprintw
  865. #  define mvwscanw        no_mvwscanw
  866. #  define newwin          no_newwin
  867. #  define overlay         no_overlay
  868. #  define overwrite       no_overwrite
  869. #  define printw          no_printw
  870. #  define putp            no_putp
  871. #  define scanw           no_scanw
  872. #  define scroll          no_scroll
  873. #  define setscrreg       no_setscrreg
  874. #  define subwin          no_subwin
  875. #  define touchwin        no_touchwin
  876. #  define tstp            no_tstp
  877. #  define vidattr         no_vidattr
  878. #  define waddch          no_waddch
  879. #  define waddstr         no_waddstr
  880. #  define wclear          no_wclear
  881. #  define wclrtobot       no_wclrtobot
  882. #  define wclrtoeol       no_wclrtoeol
  883. #  define wdelch          no_wdelch
  884. #  define wdeleteln       no_wdeleteln
  885. #  define werase          no_werase
  886. #  define wgetch          no_wgetch
  887. #  define wgetstr         no_wgetstr
  888. #  define winsch          no_winsch
  889. #  define winsertln       no_winsertln
  890. #  define wmove           no_wmove
  891. #  define wprintw         no_wprintw
  892. #  define wrefresh        no_wrefresh
  893. #  define wscanw          no_wscanw
  894. #  define wsetscrreg      no_wsetscrreg
  895.  
  896. X/* mv functions that aren't valid */
  897. #  define mvdelch         no_mvwdelch
  898. #  define mvgetch         no_mvwgetch
  899. #  define mvgetstr        no_mvwgetstr
  900. #  define mvinch          no_mvwinch
  901. #  define mvinsch         no_mvwinsch
  902. #  define mvwaddch        no_mvwaddch
  903. #  define mvwaddstr       no_mvaddstr
  904. #  define mvwdelch        no_mvwdelch
  905. #  define mvwgetch        no_mvwgetch
  906. #  define mvwgetstr       no_mvwgetstr
  907. #  define mvwinch         no_mvwinch
  908. #  define mvwinsch        no_mvwinsch
  909.  
  910. #endif MINICURSES
  911.  
  912.  
  913. #ifndef MINICURSES
  914. X/* Funny "characters" enabled for various special function keys for input */
  915. #define KEY_BREAK       0401            /* break key (unreliable) */
  916. #define KEY_DOWN        0402            /* The four arrow keys ... */
  917. #define KEY_UP          0403
  918. #define KEY_LEFT        0404
  919. #define KEY_RIGHT       0405            /* ... */
  920. #define KEY_HOME        0406            /* Home key (upward+left arrow) */
  921. #define KEY_BACKSPACE   0407            /* backspace (unreliable) */
  922. #define KEY_F0          0410            /* Function keys.  Space for 64 */
  923. #define KEY_F(n)        (KEY_F0+(n))    /* keys is reserved. */
  924. #define KEY_DL          0510            /* Delete line */
  925. #define KEY_IL          0511            /* Insert line */
  926. #define KEY_DC          0512            /* Delete character */
  927. #define KEY_IC          0513            /* Insert char or enter insert mode */
  928. #define KEY_EIC         0514            /* Exit insert char mode */
  929. #define KEY_CLEAR       0515            /* Clear screen */
  930. #define KEY_EOS         0516            /* Clear to end of screen */
  931. #define KEY_EOL         0517            /* Clear to end of line */
  932. #define KEY_SF          0520            /* Scroll 1 line forward */
  933. #define KEY_SR          0521            /* Scroll 1 line backwards (reverse) */
  934. #define KEY_NPAGE       0522            /* Next page */
  935. #define KEY_PPAGE       0523            /* Previous page */
  936. #define KEY_STAB        0524            /* Set tab */
  937. #define KEY_CTAB        0525            /* Clear tab */
  938. #define KEY_CATAB       0526            /* Clear all tabs */
  939. #define KEY_ENTER       0527            /* Enter or send (unreliable) */
  940. #define KEY_SRESET      0530            /* soft (partial) reset (unreliable) */
  941. #define KEY_RESET       0531            /* reset or hard reset (unreliable) */
  942. #define KEY_PRINT       0532            /* print or copy */
  943. #define KEY_LL          0533            /* home down or bottom (lower left) */
  944.  
  945. #endif MINICURSES
  946.  
  947. #endif WINDOW
  948. //go.sysin dd *
  949. echo 'x - =src/curses.priv.h'
  950. sed 's/^X//' <<'//go.sysin dd *' >=src/curses.priv.h
  951. X/*********************************************************************
  952. *                         COPYRIGHT NOTICE                           *
  953. **********************************************************************
  954. *        This software is copyright (C) 1982 by Pavel Curtis         *
  955. *                                                                    *
  956. *        Permission is granted to reproduce and distribute           *
  957. *        this file by any means so long as no fee is charged         *
  958. *        above a nominal handling fee and so long as this            *
  959. *        notice is always included in the copies.                    *
  960. *                                                                    *
  961. *        Other rights are reserved except as explicitly granted      *
  962. *        by written permission of the author.                        *
  963. *                Pavel Curtis                                        *
  964. *                Computer Science Dept.                              *
  965. *                405 Upson Hall                                      *
  966. *                Cornell University                                  *
  967. *                Ithaca, NY 14853                                    *
  968. *                                                                    *
  969. *                Ph- (607) 256-4934                                  *
  970. *                                                                    *
  971. *                Pavel.Cornell@Udel-Relay   (ARPAnet)                *
  972. *                decvax!cornell!pavel       (UUCPnet)                *
  973. *********************************************************************/
  974.  
  975. X/*
  976.  *    curses.priv.h
  977.  *
  978.  *    Header file for curses library objects which are private to
  979.  *    the library.
  980.  *
  981.  *  $Log:    RCS/curses.priv.v $
  982. Revision 2.1  82/10/25  14:46:17  pavel
  983. Added Copyright Notice
  984.  
  985. Revision 2.0  82/10/25  13:50:25  pavel
  986. Beta-one Test Release
  987.  
  988.  *
  989.  */
  990.  
  991.  
  992. #include <stdio.h>
  993. #include "curses.h"
  994.  
  995. #define min(a,b)    ((a) > (b)  ?  (b)  :  (a))
  996. #define max(a,b)    ((a) < (b)  ?  (b)  :  (a))
  997.  
  998. #define CHANGED     -1
  999.  
  1000. WINDOW    *newscr;
  1001.  
  1002. extern int  _tracing;
  1003.  
  1004.  
  1005. struct try
  1006. {
  1007.         struct try      *child;     /* ptr to child.  NULL if none          */
  1008.         struct try      *sibling;   /* ptr to sibling.  NULL if none        */
  1009.         char            ch;         /* character at this node               */
  1010.         short           value;      /* code of string so far.  NULL if none */
  1011. };
  1012.  
  1013.  
  1014. struct screen
  1015. {
  1016.         FILE        *_ifp;        /* input file ptr for this terminal     */
  1017.         FILE        *_ofp;        /* output file ptr for this terminal    */
  1018.     struct term    *_term;        /* used by terminfo stuff               */
  1019.     WINDOW        *_curscr;   /* windows specific to a given terminal */
  1020.     WINDOW        *_newscr;
  1021.         struct try      *_keytry;   /* "Try" for use with keypad mode       */
  1022.     char            _backbuf[10]; /* Buffer for pushed back characters  */
  1023.     int             _backcnt;   /* How many characters in _backbuf?     */
  1024.         int             _cursrow;   /* Row and column of physical cursor    */
  1025.         int             _curscol;
  1026.     bool        _nl;        /* True if terminal has CRMOD bit on    */
  1027.     bool        _raw;        /* True if in raw mode                  */
  1028.     bool        _cbreak;    /* True if in cbreak mode               */
  1029.     bool        _echo;        /* True if echo on                      */
  1030.     bool        _nlmapping; /* True if terminal is really doing     */
  1031.                     /* NL mapping (fn of raw and nl)        */
  1032.     int        _costs[9];  /* costs of cursor movements for mvcur  */
  1033.     int        _costinit;  /* set if _costs[] is initialized       */
  1034. };
  1035.  
  1036. struct screen    *SP;
  1037.  
  1038. #define MAXCOLUMNS    135
  1039. #define MAXLINES      66
  1040. #define UNINITIALISED ((struct try * ) -1)
  1041. //go.sysin dd *
  1042. echo 'x - =src/object.h'
  1043. sed 's/^X//' <<'//go.sysin dd *' >=src/object.h
  1044. X/*********************************************************************
  1045. *                         COPYRIGHT NOTICE                           *
  1046. **********************************************************************
  1047. *        This software is copyright (C) 1982 by Pavel Curtis         *
  1048. *                                                                    *
  1049. *        Permission is granted to reproduce and distribute           *
  1050. *        this file by any means so long as no fee is charged         *
  1051. *        above a nominal handling fee and so long as this            *
  1052. *        notice is always included in the copies.                    *
  1053. *                                                                    *
  1054. *        Other rights are reserved except as explicitly granted      *
  1055. *        by written permission of the author.                        *
  1056. *                Pavel Curtis                                        *
  1057. *                Computer Science Dept.                              *
  1058. *                405 Upson Hall                                      *
  1059. *                Cornell University                                  *
  1060. *                Ithaca, NY 14853                                    *
  1061. *                                                                    *
  1062. *                Ph- (607) 256-4934                                  *
  1063. *                                                                    *
  1064. *                Pavel.Cornell@Udel-Relay   (ARPAnet)                *
  1065. *                decvax!cornell!pavel       (UUCPnet)                *
  1066. *********************************************************************/
  1067.  
  1068. X/*
  1069. ** $Header:   RCS/object.v  Revision 2.1  82/10/25  14:49:50  pavel  Exp$
  1070. **
  1071. **    object.h - Format of compiled terminfo files
  1072. **
  1073. **        Header (12 bytes), containing information given below
  1074. **        Names Section, containing the names of the terminal
  1075. **        Boolean Section, containing the values of all of the
  1076. **                boolean capabilities
  1077. **                A null byte may be inserted here to make
  1078. **                sure that the Number Section begins on an
  1079. **                even word boundary.
  1080. **        Number Section, containing the values of all of the numeric
  1081. **                capabilities, each as a short integer
  1082. **        String Section, containing short integer offsets into the
  1083. **                String Table, one per string capability
  1084. **        String Table, containing the actual characters of the string
  1085. **                capabilities.
  1086. **
  1087. **    NOTE that all short integers in the file are stored using VAX/PDP-style
  1088. **    byte-swapping, i.e., least-significant byte first.  The code in
  1089. **    read_entry() automatically fixes this up on machines which don't use
  1090. **    this system (I hope).
  1091. **
  1092. **  $Log:    RCS/object.v $
  1093. Revision 2.1  82/10/25  14:49:50  pavel
  1094. Added Copyright Notice
  1095.  
  1096. Revision 2.0  82/10/24  15:18:19  pavel
  1097. Beta-one Test Release
  1098.  
  1099. Revision 1.3  82/08/23  22:31:12  pavel
  1100. The REAL Alpha-one Release Version
  1101.  
  1102. Revision 1.2  82/08/19  19:10:18  pavel
  1103. Alpha Test Release One
  1104.  
  1105. Revision 1.1  82/08/12  18:48:55  pavel
  1106. Initial revision
  1107.  
  1108. **
  1109. */
  1110.  
  1111.  
  1112. #define MAGIC    0432
  1113.  
  1114. struct header
  1115. {
  1116.     short    magic;        /* Magic Number (0432)            */
  1117.     short    name_size;    /* Size of names section        */
  1118.     short    bool_count;    /* Number of booleans            */
  1119.     short    num_count;    /* Number of numbers            */
  1120.     short    str_count;    /* Number of strings            */
  1121.     short    str_size;    /* Size of string table            */
  1122. };
  1123. //go.sysin dd *
  1124. echo 'x - =src/term.h'
  1125. sed 's/^X//' <<'//go.sysin dd *' >=src/term.h
  1126. X/*
  1127. **    term.h -- Definition of struct term
  1128. */
  1129.  
  1130. #ifndef SGTTY
  1131. #    include "curses.h"
  1132. #endif
  1133.  
  1134. #ifdef SINGLE
  1135. #    define CUR _first_term.
  1136. #else
  1137. #    define CUR cur_term->
  1138. #endif
  1139.  
  1140.  
  1141. #define auto_left_margin               CUR Booleans[0]
  1142. #define auto_right_margin              CUR Booleans[1]
  1143. #define beehive_glitch                 CUR Booleans[2]
  1144. #define ceol_standout_glitch           CUR Booleans[3]
  1145. #define eat_newline_glitch             CUR Booleans[4]
  1146. #define erase_overstrike               CUR Booleans[5]
  1147. #define generic_type                   CUR Booleans[6]
  1148. #define hard_copy                      CUR Booleans[7]
  1149. #define has_meta_key                   CUR Booleans[8]
  1150. #define has_status_line                CUR Booleans[9]
  1151. #define insert_null_glitch             CUR Booleans[10]
  1152. #define memory_above                   CUR Booleans[11]
  1153. #define memory_below                   CUR Booleans[12]
  1154. #define move_insert_mode               CUR Booleans[13]
  1155. #define move_standout_mode             CUR Booleans[14]
  1156. #define over_strike                    CUR Booleans[15]
  1157. #define status_line_esc_ok             CUR Booleans[16]
  1158. #define teleray_glitch                 CUR Booleans[17]
  1159. #define tilde_glitch                   CUR Booleans[18]
  1160. #define transparent_underline          CUR Booleans[19]
  1161. #define xon_xoff                       CUR Booleans[20]
  1162. #define columns                        CUR Numbers[0]
  1163. #define init_tabs                      CUR Numbers[1]
  1164. #define lines                          CUR Numbers[2]
  1165. #define lines_of_memory                CUR Numbers[3]
  1166. #define magic_cookie_glitch            CUR Numbers[4]
  1167. #define padding_baud_rate              CUR Numbers[5]
  1168. #define virtual_terminal               CUR Numbers[6]
  1169. #define width_status_line              CUR Numbers[7]
  1170. #define num_labels                     CUR Numbers[8]
  1171. #define label_height                   CUR Numbers[9]
  1172. #define label_width                    CUR Numbers[10]
  1173. #define back_tab                       CUR Strings[0]
  1174. #define bell                           CUR Strings[1]
  1175. #define carriage_return                CUR Strings[2]
  1176. #define change_scroll_region           CUR Strings[3]
  1177. #define clear_all_tabs                 CUR Strings[4]
  1178. #define clear_screen                   CUR Strings[5]
  1179. #define clr_eol                        CUR Strings[6]
  1180. #define clr_eos                        CUR Strings[7]
  1181. #define column_address                 CUR Strings[8]
  1182. #define command_character              CUR Strings[9]
  1183. #define cursor_address                 CUR Strings[10]
  1184. #define cursor_down                    CUR Strings[11]
  1185. #define cursor_home                    CUR Strings[12]
  1186. #define cursor_invisible               CUR Strings[13]
  1187. #define cursor_left                    CUR Strings[14]
  1188. #define cursor_mem_address             CUR Strings[15]
  1189. #define cursor_normal                  CUR Strings[16]
  1190. #define cursor_right                   CUR Strings[17]
  1191. #define cursor_to_ll                   CUR Strings[18]
  1192. #define cursor_up                      CUR Strings[19]
  1193. #define cursor_visible                 CUR Strings[20]
  1194. #define delete_character               CUR Strings[21]
  1195. #define delete_line                    CUR Strings[22]
  1196. #define dis_status_line                CUR Strings[23]
  1197. #define down_half_line                 CUR Strings[24]
  1198. #define enter_alt_charset_mode         CUR Strings[25]
  1199. #define enter_blink_mode               CUR Strings[26]
  1200. #define enter_bold_mode                CUR Strings[27]
  1201. #define enter_ca_mode                  CUR Strings[28]
  1202. #define enter_delete_mode              CUR Strings[29]
  1203. #define enter_dim_mode                 CUR Strings[30]
  1204. #define enter_insert_mode              CUR Strings[31]
  1205. #define enter_secure_mode              CUR Strings[32]
  1206. #define enter_protected_mode           CUR Strings[33]
  1207. #define enter_reverse_mode             CUR Strings[34]
  1208. #define enter_standout_mode            CUR Strings[35]
  1209. #define enter_underline_mode           CUR Strings[36]
  1210. #define erase_chars                    CUR Strings[37]
  1211. #define exit_alt_charset_mode          CUR Strings[38]
  1212. #define exit_attribute_mode            CUR Strings[39]
  1213. #define exit_ca_mode                   CUR Strings[40]
  1214. #define exit_delete_mode               CUR Strings[41]
  1215. #define exit_insert_mode               CUR Strings[42]
  1216. #define exit_standout_mode             CUR Strings[43]
  1217. #define exit_underline_mode            CUR Strings[44]
  1218. #define flash_screen                   CUR Strings[45]
  1219. #define form_feed                      CUR Strings[46]
  1220. #define from_status_line               CUR Strings[47]
  1221. #define init_1string                   CUR Strings[48]
  1222. #define init_2string                   CUR Strings[49]
  1223. #define init_3string                   CUR Strings[50]
  1224. #define init_file                      CUR Strings[51]
  1225. #define insert_character               CUR Strings[52]
  1226. #define insert_line                    CUR Strings[53]
  1227. #define insert_padding                 CUR Strings[54]
  1228. #define key_backspace                  CUR Strings[55]
  1229. #define key_catab                      CUR Strings[56]
  1230. #define key_clear                      CUR Strings[57]
  1231. #define key_ctab                       CUR Strings[58]
  1232. #define key_dc                         CUR Strings[59]
  1233. #define key_dl                         CUR Strings[60]
  1234. #define key_down                       CUR Strings[61]
  1235. #define key_eic                        CUR Strings[62]
  1236. #define key_eol                        CUR Strings[63]
  1237. #define key_eos                        CUR Strings[64]
  1238. #define key_f0                         CUR Strings[65]
  1239. #define key_f1                         CUR Strings[66]
  1240. #define key_f10                        CUR Strings[67]
  1241. #define key_f2                         CUR Strings[68]
  1242. #define key_f3                         CUR Strings[69]
  1243. #define key_f4                         CUR Strings[70]
  1244. #define key_f5                         CUR Strings[71]
  1245. #define key_f6                         CUR Strings[72]
  1246. #define key_f7                         CUR Strings[73]
  1247. #define key_f8                         CUR Strings[74]
  1248. #define key_f9                         CUR Strings[75]
  1249. #define key_home                       CUR Strings[76]
  1250. #define key_ic                         CUR Strings[77]
  1251. #define key_il                         CUR Strings[78]
  1252. #define key_left                       CUR Strings[79]
  1253. #define key_ll                         CUR Strings[80]
  1254. #define key_npage                      CUR Strings[81]
  1255. #define key_ppage                      CUR Strings[82]
  1256. #define key_right                      CUR Strings[83]
  1257. #define key_sf                         CUR Strings[84]
  1258. #define key_sr                         CUR Strings[85]
  1259. #define key_stab                       CUR Strings[86]
  1260. #define key_up                         CUR Strings[87]
  1261. #define keypad_local                   CUR Strings[88]
  1262. #define keypad_xmit                    CUR Strings[89]
  1263. #define lab_f0                         CUR Strings[90]
  1264. #define lab_f1                         CUR Strings[91]
  1265. #define lab_f10                        CUR Strings[92]
  1266. #define lab_f2                         CUR Strings[93]
  1267. #define lab_f3                         CUR Strings[94]
  1268. #define lab_f4                         CUR Strings[95]
  1269. #define lab_f5                         CUR Strings[96]
  1270. #define lab_f6                         CUR Strings[97]
  1271. #define lab_f7                         CUR Strings[98]
  1272. #define lab_f8                         CUR Strings[99]
  1273. #define lab_f9                         CUR Strings[100]
  1274. #define meta_off                       CUR Strings[101]
  1275. #define meta_on                        CUR Strings[102]
  1276. #define newline                        CUR Strings[103]
  1277. #define pad_char                       CUR Strings[104]
  1278. #define parm_dch                       CUR Strings[105]
  1279. #define parm_delete_line               CUR Strings[106]
  1280. #define parm_down_cursor               CUR Strings[107]
  1281. #define parm_ich                       CUR Strings[108]
  1282. #define parm_index                     CUR Strings[109]
  1283. #define parm_insert_line               CUR Strings[110]
  1284. #define parm_left_cursor               CUR Strings[111]
  1285. #define parm_right_cursor              CUR Strings[112]
  1286. #define parm_rindex                    CUR Strings[113]
  1287. #define parm_up_cursor                 CUR Strings[114]
  1288. #define pkey_key                       CUR Strings[115]
  1289. #define pkey_local                     CUR Strings[116]
  1290. #define pkey_xmit                      CUR Strings[117]
  1291. #define print_screen                   CUR Strings[118]
  1292. #define prtr_off                       CUR Strings[119]
  1293. #define prtr_on                        CUR Strings[120]
  1294. #define repeat_char                    CUR Strings[121]
  1295. #define reset_1string                  CUR Strings[122]
  1296. #define reset_2string                  CUR Strings[123]
  1297. #define reset_3string                  CUR Strings[124]
  1298. #define reset_file                     CUR Strings[125]
  1299. #define restore_cursor                 CUR Strings[126]
  1300. #define row_address                    CUR Strings[127]
  1301. #define save_cursor                    CUR Strings[128]
  1302. #define scroll_forward                 CUR Strings[129]
  1303. #define scroll_reverse                 CUR Strings[130]
  1304. #define set_attributes                 CUR Strings[131]
  1305. #define set_tab                        CUR Strings[132]
  1306. #define set_window                     CUR Strings[133]
  1307. #define tab                            CUR Strings[134]
  1308. #define to_status_line                 CUR Strings[135]
  1309. #define underline_char                 CUR Strings[136]
  1310. #define up_half_line                   CUR Strings[137]
  1311. #define init_prog                      CUR Strings[138]
  1312. #define key_a1                         CUR Strings[139]
  1313. #define key_a3                         CUR Strings[140]
  1314. #define key_b2                         CUR Strings[141]
  1315. #define key_c1                         CUR Strings[142]
  1316. #define key_c3                         CUR Strings[143]
  1317. #define prtr_non                       CUR Strings[144]
  1318. #define char_padding                   CUR Strings[145]
  1319. #define acs_chars                      CUR Strings[146]
  1320. #define plab_norm                      CUR Strings[147]
  1321.  
  1322.  
  1323. struct term
  1324. {
  1325.    char     *term_names;    /* offset in str_table of terminal names */
  1326.    char     *str_table;    /* pointer to string table */
  1327.    short Filedes;    /* file description being written to */
  1328.    SGTTY Ottyb,        /* original state of the terminal */
  1329.      Nttyb;        /* current state of the terminal */
  1330.  
  1331.    char         Booleans[21];
  1332.    short     Numbers[11];
  1333.    char         *Strings[148];
  1334. };
  1335.  
  1336. struct term    _first_term;
  1337. struct term    *cur_term;
  1338.  
  1339. #define BOOLCOUNT 21
  1340. #define NUMCOUNT  11
  1341. #define STRCOUNT  148
  1342. //go.sysin dd *
  1343. echo 'x - =src/terminfo.h'
  1344. sed 's/^X//' <<'//go.sysin dd *' >=src/terminfo.h
  1345. X/*********************************************************************
  1346. *                         COPYRIGHT NOTICE                           *
  1347. **********************************************************************
  1348. *        This software is copyright (C) 1982 by Pavel Curtis         *
  1349. *                                                                    *
  1350. *        Permission is granted to reproduce and distribute           *
  1351. *        this file by any means so long as no fee is charged         *
  1352. *        above a nominal handling fee and so long as this            *
  1353. *        notice is always included in the copies.                    *
  1354. *                                                                    *
  1355. *        Other rights are reserved except as explicitly granted      *
  1356. *        by written permission of the author.                        *
  1357. *                Pavel Curtis                                        *
  1358. *                Computer Science Dept.                              *
  1359. *                405 Upson Hall                                      *
  1360. *                Cornell University                                  *
  1361. *                Ithaca, NY 14853                                    *
  1362. *                                                                    *
  1363. *                Ph- (607) 256-4934                                  *
  1364. *                                                                    *
  1365. *                Pavel.Cornell@Udel-Relay   (ARPAnet)                *
  1366. *                decvax!cornell!pavel       (UUCPnet)                *
  1367. *********************************************************************/
  1368.  
  1369. X/*
  1370.  *  $Header:   RCS/terminfo.v  Revision 2.1  82/10/25  14:49:59  pavel  Exp$
  1371.  *
  1372.  *    terminfo.h - those things needed for programs runnning at the
  1373.  *            terminfo level.
  1374.  *
  1375.  *  $Log:    RCS/terminfo.v $
  1376. Revision 2.1  82/10/25  14:49:59  pavel
  1377. Added Copyright Notice
  1378.  
  1379. Revision 2.0  82/10/24  15:18:26  pavel
  1380. Beta-one Test Release
  1381.  
  1382. Revision 1.4  82/08/23  22:31:21  pavel
  1383. The REAL Alpha-one Release Version
  1384.  
  1385. Revision 1.3  82/08/19  19:24:11  pavel
  1386. Alpha Test Release One
  1387.  
  1388. Revision 1.2  82/08/19  19:10:56  pavel
  1389. Alpha Test Release One
  1390.  
  1391. Revision 1.1  82/08/15  16:42:20  pavel
  1392. Initial revision
  1393.  
  1394.  *
  1395.  */
  1396.  
  1397. #ifndef A_STANDOUT
  1398.  
  1399. #include <stdio.h>
  1400. #include <sgtty.h>
  1401.  
  1402. #define SGTTY    struct sgttyb
  1403.  
  1404.     /* Video attributes */
  1405. #define A_NORMAL    0000000
  1406. #define A_ATTRIBUTES    0377600
  1407. #define A_CHARTEXT    0000177
  1408.  
  1409. #define A_STANDOUT    0000200
  1410. #define A_UNDERLINE    0000400
  1411.  
  1412. #ifndef MINICURSES
  1413. #  define A_REVERSE    0001000
  1414. #  define A_BLINK    0002000
  1415. #  define A_DIM        0004000
  1416. #  define A_BOLD    0010000
  1417. #  define A_INVIS    0020000
  1418. #  define A_PROTECT    0040000
  1419. #  define A_ALTCHARSET    0100000
  1420. #endif MINICURSES
  1421.  
  1422. extern char    ttytype[];
  1423. #define NAMESIZE    256
  1424. #endif
  1425. //go.sysin dd *
  1426. echo 'x - =src/unctrl.h'
  1427. sed 's/^X//' <<'//go.sysin dd *' >=src/unctrl.h
  1428. X/*********************************************************************
  1429. *                         COPYRIGHT NOTICE                           *
  1430. **********************************************************************
  1431. *        This software is copyright (C) 1982 by Pavel Curtis         *
  1432. *                                                                    *
  1433. *        Permission is granted to reproduce and distribute           *
  1434. *        this file by any means so long as no fee is charged         *
  1435. *        above a nominal handling fee and so long as this            *
  1436. *        notice is always included in the copies.                    *
  1437. *                                                                    *
  1438. *        Other rights are reserved except as explicitly granted      *
  1439. *        by written permission of the author.                        *
  1440. *                Pavel Curtis                                        *
  1441. *                Computer Science Dept.                              *
  1442. *                405 Upson Hall                                      *
  1443. *                Cornell University                                  *
  1444. *                Ithaca, NY 14853                                    *
  1445. *                                                                    *
  1446. *                Ph- (607) 256-4934                                  *
  1447. *                                                                    *
  1448. *                Pavel.Cornell@Udel-Relay   (ARPAnet)                *
  1449. *                decvax!cornell!pavel       (UUCPnet)                *
  1450. *********************************************************************/
  1451.  
  1452. X/*
  1453.  * unctrl.h
  1454.  *
  1455.  * $Header:   RCS/unctrl.v  Revision 2.1  82/10/25  14:50:04  pavel  Exp$
  1456.  *
  1457.  * $Log:    RCS/unctrl.v $
  1458. Revision 2.1  82/10/25  14:50:04  pavel
  1459. Added Copyright Notice
  1460.  
  1461. Revision 2.0  82/10/24  15:18:28  pavel
  1462. Beta-one Test Release
  1463.  
  1464. Revision 1.3  82/08/23  22:31:24  pavel
  1465. The REAL Alpha-one Release Version
  1466.  
  1467. Revision 1.2  82/08/19  19:10:59  pavel
  1468. Alpha Test Release One
  1469.  
  1470. Revision 1.1  82/08/19  19:04:26  pavel
  1471. Initial revision
  1472.  
  1473.  */
  1474.  
  1475. extern char    *_unctrl[];
  1476.  
  1477. # define    unctrl(ch)    (_unctrl[(unsigned) ch])
  1478. //go.sysin dd *
  1479. exit
  1480.