home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / drdobbs / c_spec / poole_cp / cpheader.h < prev    next >
Text File  |  1989-11-21  |  5KB  |  195 lines

  1. /*********************************************************************
  2.                   cpheader.h
  3.  *********************************************************************/
  4. #define MSDOS 0    /* Set the appropriate constant */
  5. #define VMS 1       /* to one (1) before compiling. */
  6. #define UNIX 0       /* All others are zero (0)       */
  7.  
  8. #if MSDOS
  9. #include <malloc.h>
  10. #include <conio.h>
  11. #include <stdlib.h>
  12. #endif
  13.  
  14. #include <ctype.h>  /* this is for the 'tolower' and 'islower' functions */
  15. #include <stdio.h>
  16. #include <string.h>
  17.  
  18. #define  Max_unget_buffer     20000
  19. #define  Max_general_buffers     3000
  20. #define  MAX_functions         5000
  21. /* #define  Max_functions        4000 */
  22. #define  Max_defined_functions     1400
  23. #define  Max_files         1400
  24. #define  Max_Recursion         50
  25.  
  26. #define  LEN_INFILE  256
  27. #define  false         0
  28. #define  true         1
  29. #define  completed   2
  30.  
  31. #define  Escape      0x1b
  32. #define  Control_z   0x1a
  33.  
  34. /*********************************************************************/
  35. typedef struct the_Pages
  36.    {
  37.    int             on_this_page;
  38.    struct the_Pages  *next_page_ptr;
  39.    }linked_pages_list;
  40. /**********************************************************************/
  41. typedef struct
  42.    {
  43.    char          *functions_name;
  44.    char          *its_filename;
  45.    int             is_referenced;
  46.    int             static_function;
  47.    }function_type;
  48. /**********************************************************************/
  49. typedef struct
  50.    {
  51.    char          *source_filename;
  52.    char          *source_file_comment;
  53.    unsigned int      line_count;
  54.    long          size;
  55.    }file_record_type;
  56. /**********************************************************************/
  57. typedef struct             /* this is the main data base record */
  58.    {
  59.    file_record_type  *file_record_ptr;
  60.    char          *defined_function;
  61.    function_type     *ptr_to_function_table;
  62.    int             number_of_function_calls;
  63.    linked_pages_list *ptr_to_page_list;
  64.    int             number_of_references;
  65.    int             static_definition;
  66.    int             overlay_number;
  67.    }data_base_record_type;
  68. /**********************************************************************/
  69.  
  70. #if MAIN != 0
  71. /***********************************************************************/
  72.  
  73. function_type           /* 6 */
  74.    **sorted_called_list_ptrs,
  75.    *function_list,
  76.    *function_list_ptr;
  77. int
  78.    Max_functions,
  79.    count_of_functions = 0;
  80. /********************************/
  81. file_record_type       /* 14 */
  82.    *file_record_array,
  83.    *file_record_array_ptr;
  84. int
  85.    count_of_source_files = 0;
  86. /********************************/
  87. data_base_record_type       /* 20 */
  88.    *data_base_array,
  89.    *data_base_array_ptr,
  90.    **array_of_unused_ptrs_to_records,
  91.    **array_of_ptrs_to_records;
  92. int
  93.    count_of_valid_records = 0;
  94. /********************************/
  95.  
  96. char *recursion_array[ Max_Recursion ];
  97. int recursion_depth = 0;
  98.  
  99. char nesting_display_buffer[ Max_general_buffers ];
  100.  
  101. char target[ 40 ] = "main";
  102. FILE *output = NULL;
  103.  
  104. char push_buffer[ Max_unget_buffer ] = { 0, 0, 0, 0 };
  105. char *push_buffer_ptr;
  106.  
  107. char file_comment_buffer[ Max_general_buffers ];
  108. int first_comment;
  109.  
  110. int effective_width;
  111.  
  112. int
  113.    page = 1,
  114.    line = 0,
  115.    defined_page_width =    80,
  116.    defined_page_length =   60,
  117.    defined_left_margin =   1,
  118.    defined_right_margin =  1,
  119.    defined_box_width = 40,
  120.    stats_only =      false,
  121.    g_lib_flag =      false,
  122.    g_comment_flag =  false,
  123.    g_dec_def_flag =  false,
  124.    g_help_flag =     false,
  125.    ibm_flag =         true,
  126.    g_quiet_flag =    false,
  127.    g_tech_flag =     false,
  128.    g_ov_flag =         false,
  129.    g_un_flag =         false,
  130.    target_flag =     false;
  131. int top_of_form_done;
  132. char title[] =
  133. /*     mm/dd/yy0 hh:mm:ss0 */
  134.       { "                    C PRINTER - (c) 1987, 1988 rev. 1.3" };
  135.  
  136. /********************************************************************/
  137.  
  138. #else
  139. /*********************************************************************/
  140.  
  141. extern function_type
  142.    **sorted_called_list_ptrs,
  143.    *function_list,
  144.    *function_list_ptr;
  145. extern file_record_type
  146.    *file_record_array,
  147.    *file_record_array_ptr;
  148. extern data_base_record_type
  149.    *data_base_array,
  150.    *data_base_array_ptr,
  151.    **array_of_unused_ptrs_to_records,
  152.    **array_of_ptrs_to_records;
  153. extern char *recursion_array[ ];
  154. extern int
  155.    count_of_valid_records,
  156.    Max_functions,
  157.    count_of_functions,
  158.    count_of_source_files;
  159. extern int page, line, recursion_depth;
  160. extern int first_comment;
  161. extern char nesting_display_buffer[ ];
  162. extern char top_bottom_line_of_box[ ];
  163. extern FILE *output;
  164. extern char push_buffer[ ];
  165. extern char *push_buffer_ptr;
  166. extern char file_comment_buffer[ ];
  167. extern int defined_page_width;
  168. extern int defined_page_length;
  169. extern int defined_left_margin;
  170. extern int defined_right_margin;
  171. extern int defined_box_width;
  172. extern int effective_width;
  173. extern char target[ ];
  174. extern int
  175.    stats_only,
  176.    g_lib_flag,
  177.    g_comment_flag,
  178.    g_dec_def_flag,
  179.    g_help_flag,
  180.    ibm_flag,
  181.    g_quiet_flag,
  182.    g_tech_flag,
  183.    g_ov_flag,
  184.    g_un_flag,
  185.    target_flag;
  186. extern int top_of_form_done;
  187. extern char title[];
  188. /*********************************************************************/
  189.  
  190. #endif
  191. /**********************************************************************/
  192. ***************************************/
  193.  
  194. #endif
  195. /************