home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / cpm68k / utils.lbr / INDNTGLO.HQ / INDNTGLO.H
Encoding:
Text File  |  1986-05-22  |  5.4 KB  |  160 lines

  1. #
  2. /*
  3.  
  4.               Copyright (C) 1976
  5.                 by the
  6.               Board of Trustees
  7.                 of the
  8.             University of Illinois
  9.  
  10.              All rights reserved
  11.  
  12. FILE NAME:
  13.     indntglob.h
  14.  
  15. PURPOSE:
  16.     This include file contains the declarations for all global variables
  17.     used in indent.
  18.  
  19. GLOBALS:
  20.     The names of all of the variables will not be repeated here.  The 
  21.     declarations start on the next page.
  22.  
  23. FUNCTIONS:
  24.     None
  25.  
  26. MODIFICATION HISTORY:
  27.     WHN 10/30/83  Changed d_max_col from 75 to 80 for VAX/VMS
  28.  
  29. */
  30. #define bufsize 600/* size of internal buffers */
  31. #define inp_bufs 512
  32.            /* size of input buffer */
  33. #define sc_size 5000
  34.            /* size of save_com buffer */
  35. #define label_offset 2
  36.            /* number of levels a label is placed to left of code 
  37.            */
  38.  
  39. #define d_ljust 0  /* default for ljust_decl */
  40. #define d_max_col 80
  41.            /* default for max_col */
  42. #define d_com_ind 33
  43.            /* default com_ind */
  44. #define d_ind_size 4
  45.            /* default ind_size */
  46. #define d_verbose 0/* default verbose */
  47. #define d_unindent 1
  48.            /* default value for unindent_displace */
  49. #define d_leave_comma 0
  50.            /* default value for leave_comma */
  51. #define d_btype_2 1/* default value for btype_2 */
  52.  
  53. #define tabsize 8  /* the size of a tab */
  54. #define tabmask 0177770
  55.            /* mask used when figuring length of lines with tabs */
  56.  
  57.  
  58. #define false 0
  59. #define true  1
  60.  
  61.  
  62. int     input;     /* the fid for the input file */
  63. int     output;    /* the fid for the output file */
  64.  
  65. char    labbuf[bufsize];
  66.            /* buffer for label */
  67. char   *s_lab;     /* start ... */
  68. char   *e_lab;     /* .. and end of stored label */
  69.  
  70. char    codebuf[bufsize];
  71.            /* buffer for code section */
  72. char   *s_code;    /* start ... */
  73. char   *e_code;    /* .. and end of stored code */
  74.  
  75. char    combuf[bufsize];
  76.            /* buffer for comments */
  77. char   *s_com;     /* start ... */
  78. char   *e_com;     /* ... and end of stored comments */
  79.  
  80. char    in_buffer[inp_bufs];
  81.            /* input buffer */
  82. char   *buf_ptr;   /* ptr to next character to be taken from in_buffer */
  83. char   *buf_end;   /* ptr to first after last char in in_buffer */
  84.  
  85. char    save_com[sc_size];
  86.            /* input text is saved here when looking for the brace
  87.               after an if, while, etc */
  88. char   *sc_end;    /* pointer into save_com buffer */
  89.  
  90. char   *bp_save;   /* saved value of buf_ptr when taking input from
  91.               save_com */
  92. char   *be_save;   /* similarly saved value of buf_end */
  93.  
  94. char    token[bufsize];
  95.            /* the last token scanned */
  96.  
  97.  
  98.  
  99.  
  100. int     bl_line;   /* set to 1 by dump_line if the line is blank */
  101. int     break_comma;
  102.            /* when true and not in parens, break after a comma */
  103. int     btype_2;   /* when true, brace should be on same line as if,
  104.               while, etc */
  105. int     case_ind;  /* indentation level to be used for a "case n:" */
  106. int     code_lines;/* count of lines with code */
  107. int     col_1;     /* set to true if the last token started in column 1 */
  108. int     com_col;   /* this is the column in which the current coment
  109.               should start */
  110. int     com_ind;   /* the column in which comments to the right of code
  111.               should start */
  112. int     com_lines; /* the number of lines with comments, set by dump_line 
  113.            */
  114. int     dec_nest;  /* current nesting level for structure or init */
  115. int     decl_com_ind;
  116.            /* the column in which comments after declarations
  117.               should be put */
  118. int     decl_on_line;
  119.            /* set to true if this line of code has part of a
  120.               declaration on it */
  121. int     had_eof;   /* set to true when input is exhausted */
  122. int     i_l_follow;/* the level to which ind_level should be set after the
  123.               current line is printed */
  124. int     in_decl;   /* set to true when we are in a declaration stmt.  The
  125.               processing of braces is then slightly different */
  126. int     in_stmt;   /* set to 1 while in a stmt */
  127. int     ind_level; /* the current indentation level */
  128. int     ind_size;  /* the size of one indentation level */
  129. int     ind_stmt;  /* set to 1 if next line should have an extra
  130.               indentation level because we are in the middle of a
  131.               stmt */
  132. int     last_u_d;  /* set to true after scanning a token which forces a
  133.               following operator to be unary */
  134. int     leave_comma;
  135.            /* if true, never break declarations after commas */
  136. int     line_no;   /* the current line number. */
  137. int     ljust_decl;/* true if declarations should be left justified */
  138. int     max_col;   /* the maximum allowable line length */
  139. int     out_coms;  /* the number of comments processed, set by pr_comment 
  140.            */
  141. int     out_lines; /* the number of lines written, set by dump_line */
  142. int     p_l_follow;/* used to remember how to indent following statement 
  143.            */
  144. int     paren_level;
  145.            /* parenthesization level. used to indent within stmts 
  146.            */
  147. int     pcase;     /* set to 1 if the current line label is a case.  It is
  148.               printed differently from  a regular label */
  149. int     search_brace;
  150.            /* set to true by parse when it is necessary to buffer
  151.               up all info up to the start of a stmt after an if,
  152.               while, etc */
  153. int     unindent_displace;
  154.            /* comments not to the right of code will be placed
  155.               this many indentation levels to the left of code */
  156. int     use_ff;    /* set to one if the current line should be terminated
  157.               with a form feed */
  158. int     verbose;   /* when true, non-essential error messages are printed 
  159.            */
  160.