Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

241 lines
4.9 KiB

  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. #include "env.h" /* defines to establish the compile-time environment */
  7. #include <excpt.h>
  8. #include <ntdef.h>
  9. #include <stdio.h>
  10. #include <ctype.h>
  11. #include <stdlib.h>
  12. #include <string.h>
  13. #include "ascii.h"
  14. #include "keymap.h"
  15. #include "param.h"
  16. #define NORMAL 0
  17. #define CMDLINE 1
  18. #define INSERT 2
  19. #define REPLACE 3
  20. #define FORWARD 4
  21. #define BACKWARD 5
  22. /*
  23. * Boolean type definition and constants
  24. */
  25. typedef unsigned bool_t;
  26. #ifndef TRUE
  27. #define FALSE (0)
  28. #define TRUE (1)
  29. #endif
  30. /*
  31. * SLOP is the amount of extra space we get for text on a line during
  32. * editing operations that need more space. This keeps us from calling
  33. * malloc every time we get a character during insert mode. No extra
  34. * space is allocated when the file is initially read.
  35. */
  36. #define SLOP 10
  37. #define INSERTSLOP 1024 // for insert buffer
  38. #define REDOBUFFMIN 100 // minimum size of redo buffer
  39. /*
  40. * LINEINC is the gap we leave between the artificial line numbers. This
  41. * helps to avoid renumbering all the lines every time a new line is
  42. * inserted.
  43. */
  44. #define LINEINC 10
  45. #define CHANGED Changed=TRUE
  46. #define UNCHANGED Changed=FALSE
  47. struct line {
  48. struct line *prev, *next; /* previous and next lines */
  49. char *s; /* text for this line */
  50. int size; /* actual size of space at 's' */
  51. unsigned long num; /* line "number" */
  52. };
  53. #define LINEOF(x) ((x)->linep->num)
  54. struct LNPTR {
  55. struct line *linep; /* line we're referencing */
  56. int index; /* position within that line */
  57. };
  58. typedef struct line LINE;
  59. typedef struct LNPTR LNPTR;
  60. struct charinfo {
  61. char ch_size;
  62. char *ch_str;
  63. };
  64. extern struct charinfo chars[];
  65. extern int State;
  66. extern int Rows;
  67. extern int Columns;
  68. extern char *Realscreen;
  69. extern char *Nextscreen;
  70. extern char *Filename;
  71. extern char *Appname;
  72. extern LNPTR *Filemem;
  73. extern LNPTR *Filetop;
  74. extern LNPTR *Fileend;
  75. extern LNPTR *Topchar;
  76. extern LNPTR *Botchar;
  77. extern LNPTR *Curschar;
  78. extern LNPTR *Insstart;
  79. extern int Cursrow, Curscol, Cursvcol, Curswant;
  80. extern bool_t set_want_col;
  81. extern int Prenum,namedbuff;
  82. extern bool_t Changed;
  83. extern char *Redobuff, *Insbuff;
  84. extern int InsbuffSize;
  85. extern char *Insptr;
  86. extern int Ninsert;
  87. extern bool_t got_int;
  88. /*
  89. * alloc.c
  90. */
  91. char *alloc(), *strsave(), *mkstr();
  92. char *ralloc(char *,unsigned);
  93. void screenalloc(), filealloc(), freeall();
  94. LINE *newline();
  95. bool_t bufempty(), buf1line(), lineempty(), endofline(), canincrease();
  96. /*
  97. * cmdline.c
  98. */
  99. void doxit(),docmdln(), dotag(), msg(), emsg();
  100. void smsg(), gotocmd(), wait_return();
  101. int wait_return0();
  102. void dosource(char *,bool_t);
  103. char *getcmdln();
  104. /*
  105. * edit.c
  106. */
  107. void edit(), insertchar(), getout(), scrollup(), scrolldown(), beginline();
  108. bool_t oneright(), oneleft(), oneup(), onedown();
  109. /*
  110. * fileio.c
  111. */
  112. void filemess(), renum();
  113. bool_t readfile(), writeit();
  114. /*
  115. * help.c
  116. */
  117. bool_t help();
  118. /*
  119. * linefunc.c
  120. */
  121. LNPTR *nextline(), *prevline(), *coladvance();
  122. /*
  123. * main.c
  124. */
  125. void stuffin(), stuffnum();
  126. void do_mlines();
  127. int vgetc();
  128. bool_t anyinput();
  129. /*
  130. * mark.c
  131. */
  132. void setpcmark(), clrall(), clrmark();
  133. bool_t setmark();
  134. LNPTR *getmark();
  135. /*
  136. * misccmds.c
  137. */
  138. void opencmd(), fileinfo(), inschar(), delline();
  139. bool_t delchar();
  140. int cntllines(), plines();
  141. LNPTR *gotoline();
  142. /*
  143. * normal.c
  144. */
  145. void normal();
  146. /*
  147. * ops.c
  148. */
  149. void inityank();
  150. /*
  151. * param.c
  152. */
  153. void doset();
  154. /*
  155. * ptrfunc.c
  156. */
  157. int inc(), dec();
  158. int gchar();
  159. void pchar(), pswap();
  160. bool_t lt(), equal(), ltoreq();
  161. #if 0
  162. /* not currently used */
  163. bool_t gtoreq(), gt();
  164. #endif
  165. /*
  166. * screen.c
  167. */
  168. void updatescreen(), updateline();
  169. void screenclear(), cursupdate();
  170. void s_ins(), s_del();
  171. void prt_line();
  172. /*
  173. * search.c
  174. */
  175. void dosub(), doglob();
  176. bool_t searchc(), crepsearch(), findfunc(), dosearch(), repsearch();
  177. LNPTR *showmatch();
  178. LNPTR *fwd_word(), *bck_word(), *end_word();
  179. /*
  180. * undo.c
  181. */
  182. void u_save(), u_saveline(), u_clear();
  183. void u_lcheck(), u_lundo();
  184. void u_undo();
  185. /*
  186. * Machine-dependent routines.
  187. */
  188. int inchar();
  189. void flushbuf();
  190. void outchar(), outstr(), beep();
  191. char *fixname();
  192. void windinit(), windexit(), windgoto();
  193. void delay();
  194. void doshell();
  195. void sleep(int);
  196. void setviconsoletitle();
  197. void dochdir();
  198. void Scroll(int t,int l,int b,int r,int Row,int Col);
  199. void EraseLine(void);
  200. void EraseNLinesAtRow(int n,int row);
  201. void InsertLine(void);
  202. void SaveCursor(void);
  203. void RestoreCursor(void);
  204. void ClearDisplay(void);
  205. void InvisibleCursor(void);
  206. void VisibleCursor(void);