home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / STVI369G.ZIP / STEVIE.H < prev    next >
C/C++ Source or Header  |  1991-10-08  |  5KB  |  243 lines

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