home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 103_01 / edit.inc < prev    next >
Text File  |  1985-03-10  |  3KB  |  105 lines

  1. /*    This is the standard include file for the edit function */
  2. #define YES 1
  3. #define NO 0
  4. #define NONE 0
  5. #define NOPE -2
  6. #define MAX_FILES 4
  7. #define BOOL int
  8. #define FLAG int
  9. #define DEF_PROMPT YES
  10. #define DEFAULT_PRINT_LINE_NUMBER YES
  11. #define MAX_LINE 132
  12. #define SIZE_LINE 60
  13. #define ERROR -1
  14. #define EOL '\0'
  15. #define DELETE '\177'
  16. #define LF '\n'
  17. #define CR '\015'
  18. #define COMMA ','
  19. #define TAB '\011'
  20. #define BS '\010'
  21. #define QUOTE 0x22
  22. #define CNTRL_Z '\032'
  23. #define CNTRL_X '\030'
  24. #define CNTRL_R '\022'
  25. #define CNTRL_P '\020'
  26. #define SPACE ' '
  27. #define ESCAPE '\033'
  28. #define NOT_SYMBOL '~'
  29. #define MANY_SYMBOL '*'
  30. #define BEGIN_SYMBOL '^'
  31. #define END_SYMBOL '$'
  32. #define ANY_SYMBOL '.'
  33. #define REPLACE_SYMBOL '&'
  34. #define FORCE_SYMBOL '\\'
  35. #define REP_SYM '\200'
  36. #define XOR ^
  37. #define AND &&
  38. #define OR ||
  39. #define NOT !
  40. #define SYNTAX_ERROR {goto oops;}
  41. /*    In any reasonable C, I could say {int i;for (i=0;i<78;i++)
  42.     printf("-");printf("\n");}, but not this C */
  43. #define HIGH_LIGHT printf("------------------------------------------------------------------------------\n");
  44. #define STOP_HIGH_LIGHT HIGH_LIGHT
  45. #define BUFF_SIZE 512
  46. #define CPM_SIZE 128
  47. #define READ_SIZE (BUFF_SIZE/CPM_SIZE)
  48. #define MOVE_FILE "edit2.tmp"
  49. #define NO_PARSELS 400    /* these point to sets of lines  */
  50. #define NO_MEMORIES 37    /* these are pointed at and hold lines */
  51. #define EOF 3276
  52. #define IN_MEM 5373
  53. #define IN_TEMP_FILE -4836
  54. #define TEMP_FILE "edit.tmp"
  55. #define NO_SEARCH 30
  56.  
  57. int number1, number2, number3, dot, dollar;
  58. BOOL modified_file;
  59. char deflt_file[MAX_LINE];
  60. int num_num, parse;
  61. int push_point;
  62. struct {char random[200];}
  63.     iobuf[MAX_FILES];
  64. BOOL user_command;
  65. BOOL global, found_line, search_true;
  66. BOOL print_line_number, prompt_enabled;
  67. BOOL g_mode, p_mode;
  68. char line[MAX_LINE+2];
  69. char user_string[MAX_LINE];
  70. char temp_buff[2*BUFF_SIZE];
  71. #define temp2_buff (temp_buff+BUFF_SIZE)
  72. char  *t;
  73. BOOL stuffed_file;
  74. int fd, u, filed;
  75. char temp3_buff[BUFF_SIZE+1], temp4_buff[CPM_SIZE];
  76. BOOL temp_used;
  77. int split, line_split, split_at;
  78. int used_search;
  79. int *last_block;
  80. char deflt_line[MAX_LINE+1];
  81. BOOL start_begin, end_end;
  82.  
  83. struct {
  84.     char test_char;
  85.     int epsilon, if_found, if_not;
  86.     } data_search[NO_SEARCH];
  87. struct george {
  88.     FLAG type;
  89.     int where;
  90.     int line_no;
  91.     } parsels[NO_PARSELS];
  92.  
  93. struct kathy {
  94.     BOOL used;
  95.     int parsel_no;
  96.     int lru;
  97.     char buffer[BUFF_SIZE+1];
  98.     } memory[NO_MEMORIES];
  99.  
  100. char tline[MAX_LINE];
  101. int printer_echo;
  102. 
  103.     int parsel_no;
  104.     int lru;
  105.     cha