home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 313_01 / stevie.h < prev    next >
C/C++ Source or Header  |  1990-04-22  |  5KB  |  245 lines

  1. /*
  2.  * $Header: /nw2/tony/src/stevie/src/RCS/stevie.h,v 1.20 89/08/31 10:01:07 tony Exp $
  3.  *
  4.  * Main header file included by all source files.
  5.  */
  6.  
  7. #include "env.h"    /* defines to establish the compile-time environment */
  8.  
  9. #include <stdio.h>
  10. #include <ctype.h>
  11.  
  12. #ifdef    BSD
  13.  
  14. #include <strings.h>
  15. #define strchr index
  16.  
  17. #else
  18.  
  19. #ifdef    MINIX
  20.  
  21. extern    char    *strchr();
  22. extern    char    *strrchr();
  23. extern    char    *strcpy();
  24. extern    char    *strcat();
  25. extern    int    strlen();
  26.  
  27. #else
  28. #include <string.h>
  29. #endif
  30.  
  31. #endif
  32.  
  33. #include "ascii.h"
  34. #include "keymap.h"
  35. #include "param.h"
  36. #include "term.h"
  37.  
  38. extern    char    *strchr();
  39.  
  40. #define NORMAL 0
  41. #define CMDLINE 1
  42. #define INSERT 2
  43. #define REPLACE 3
  44. #define FORWARD 4
  45. #define BACKWARD 5
  46.  
  47. /*
  48.  * Boolean type definition and constants
  49.  */
  50. typedef    short    bool_t;
  51.  
  52. #ifndef    TRUE
  53. #define    FALSE    (0)
  54. #define    TRUE    (1)
  55. #endif
  56.  
  57. /*
  58.  * SLOP is the amount of extra space we get for text on a line during
  59.  * editing operations that need more space. This keeps us from calling
  60.  * malloc every time we get a character during insert mode. No extra
  61.  * space is allocated when the file is initially read.
  62.  */
  63. #define    SLOP    10
  64.  
  65. /*
  66.  * LINEINC is the gap we leave between the artificial line numbers. This
  67.  * helps to avoid renumbering all the lines every time a new line is
  68.  * inserted.
  69.  */
  70. #define    LINEINC    10
  71.  
  72. #define CHANGED        Changed=TRUE
  73. #define UNCHANGED    Changed=FALSE
  74.  
  75. struct    line {
  76.     struct    line    *prev, *next;    /* previous and next lines */
  77.     char    *s;            /* text for this line */
  78.     int    size;            /* actual size of space at 's' */
  79.     unsigned long    num;        /* line "number" */
  80. };
  81.  
  82. #define    LINEOF(x)    ((x)->linep->num)
  83.  
  84. struct    lptr {
  85.     struct    line    *linep;        /* line we're referencing */
  86.     int    index;            /* position within that line */
  87. };
  88.  
  89. typedef    struct line    LINE;
  90. typedef    struct lptr    LPTR;
  91.  
  92. struct charinfo {
  93.     char ch_size;
  94.     char *ch_str;
  95. };
  96.  
  97. extern struct charinfo chars[];
  98.  
  99. extern    int    State;
  100. extern    int    Rows;
  101. extern    int    Columns;
  102. extern    char    *Realscreen;
  103. extern    char    *Nextscreen;
  104. extern    char    *Filename;
  105. extern    LPTR    *Filemem;
  106. extern    LPTR    *Filetop;
  107. extern    LPTR    *Fileend;
  108. extern    LPTR    *Topchar;
  109. extern    LPTR    *Botchar;
  110. extern    LPTR    *Curschar;
  111. extern    LPTR    *Insstart;
  112. extern    int    Cursrow, Curscol, Cursvcol, Curswant;
  113. extern    bool_t    set_want_col;
  114. extern    int    Prenum;
  115. extern    bool_t    Changed;
  116. extern    char    Redobuff[], Insbuff[];
  117. extern    char    *Insptr;
  118. extern    int    Ninsert;
  119. extern    bool_t    got_int;
  120.  
  121. extern    char    *malloc(), *strcpy();
  122.  
  123. /*
  124.  * alloc.c
  125.  */
  126. char    *alloc(), *strsave(), *mkstr();
  127. void    screenalloc(), filealloc(), freeall();
  128. LINE    *newline();
  129. bool_t    bufempty(), buf1line(), lineempty(), endofline(), canincrease();
  130.  
  131. /*
  132.  * cmdline.c
  133.  */
  134. void    docmdln(), dotag(), msg(), emsg(), smsg(), gotocmd(), wait_return();
  135. char    *getcmdln();
  136.  
  137. /*
  138.  * edit.c
  139.  */
  140. void    edit(), insertchar(), getout(), scrollup(), scrolldown(), beginline();
  141. bool_t    oneright(), oneleft(), oneup(), onedown();
  142.  
  143. /*
  144.  * fileio.c
  145.  */
  146. void    filemess(), renum();
  147. bool_t    readfile(), writeit();
  148.  
  149. /*
  150.  * help.c
  151.  */
  152. bool_t    help();
  153.  
  154. /*
  155.  * linefunc.c
  156.  */
  157. LPTR    *nextline(), *prevline(), *coladvance();
  158.  
  159. /*
  160.  * main.c
  161.  */
  162. void    stuffin(), stuffnum();
  163. void    do_mlines();
  164. int    vgetc();
  165. bool_t    anyinput();
  166.  
  167. /*
  168.  * mark.c
  169.  */
  170. void    setpcmark(), clrall(), clrmark();
  171. bool_t    setmark();
  172. LPTR    *getmark();
  173.  
  174. /*
  175.  * misccmds.c
  176.  */
  177. void    opencmd(), fileinfo(), inschar(), delline();
  178. bool_t    delchar();
  179. int    cntllines(), plines();
  180. LPTR    *gotoline();
  181.  
  182. /*
  183.  * normal.c
  184.  */
  185. void    normal();
  186.  
  187. /*
  188.  * param.c
  189.  */
  190. void    doset();
  191.  
  192. /*
  193.  * ptrfunc.c
  194.  */
  195. int    inc(), dec();
  196. int    gchar();
  197. void    pchar(), pswap();
  198. bool_t    lt(), equal(), ltoreq();
  199. #if 0
  200. /* not currently used */
  201. bool_t    gtoreq(), gt();
  202. #endif
  203.  
  204. /*
  205.  * screen.c
  206.  */
  207. void    updatescreen(), updateline();
  208. void    screenclear(), cursupdate();
  209. void    s_ins(), s_del();
  210. void    prt_line();
  211.  
  212. /*
  213.  * search.c
  214.  */
  215. void    dosub(), doglob();
  216. bool_t    searchc(), crepsearch(), findfunc(), dosearch(), repsearch();
  217. LPTR    *showmatch();
  218. LPTR    *fwd_word(), *bck_word(), *end_word();
  219.  
  220. /*
  221.  * undo.c
  222.  */
  223. void    u_save(), u_saveline(), u_clear();
  224. void    u_lcheck(), u_lundo();
  225. void    u_undo();
  226.  
  227. /*
  228.  * Machine-dependent routines.
  229.  */
  230. int    inchar();
  231. void    flushbuf();
  232. void    outchar(), outstr(), beep();
  233. #ifdef    TERMCAP
  234. void    outcstr();
  235. #endif
  236. char    *fixname();
  237. #ifndef    OS2
  238. #ifndef    DOS
  239. void    remove(), rename();
  240. #endif
  241. #endif
  242. void    windinit(), windexit(), windgoto();
  243. void    delay();
  244. void    doshell();
  245.