1: /*
   2: **  CTLMOD.H -- control module header file
   3: **
   4: **	This header file defines all the internal data structures
   5: **	used by the control module.
   6: **
   7: **	If something other than the control module or the initializer
   8: **	has to include this, something is wrong!
   9: **
  10: **	Compilation Flags:
  11: **		xCM_DEBUG -- if set, certain code is compiled in that
  12: **			does consistancy checks on the data structures
  13: **			at opportune times.
  14: **		xMONITOR -- if set, turns on performance evaluation
  15: **			code.
  16: **		xCTR1, xCTR2, xCTR3 -- if set, turns on various levels
  17: **			of trace information.  These must be properly
  18: **			nested; if xCTR2 is set, xCTR1 *MUST* be set.
  19: **
  20: **	Version:
  21: **		@(#)ctlmod.h	8.1	12/31/84
  22: */
  23: 
  24: 
  25: 
  26: 
  27: 
  28: 
  29: /* include some other files */
  30: # include   "state.h"
  31: # include   "proc.h"
  32: # include   <pv.h>
  33: # include   "pipes.h"
  34: # include   <func.h>
  35: # include   <pmon.h>
  36: # include   <setjmp.h>
  37: 
  38: /* basic constants */
  39: # include   <useful.h>
  40: 
  41: 
  42: /*
  43: **  Trace Flag settings.
  44: */
  45: 
  46: # include   <trace.h>
  47: # define    xCTR1       1
  48: # define    xCTR2       1
  49: # define    xCTR3       1
  50: # define    xCM_DEBUG   1
  51: # define    xMONITOR    1
  52: 
  53: /*
  54: **  STRUCT CM -- the configuration structure.
  55: */
  56: 
  57: struct _cm_t
  58: {
  59:     char    cm_myname[12];      /* my process name */
  60:     state_t cm_state[CM_MAXST]; /* the state descriptions */
  61:     proc_t  cm_proc[CM_MAXPROC];    /* the process descriptions */
  62:     int cm_myproc;      /* my process id */
  63:     char    cm_input;       /* the current input file */
  64:     char    cm_rinput;      /* the reset input file */
  65: };
  66: 
  67: /*
  68: **  STRUCT CTX -- the context structure.
  69: **
  70: **	There is one of these around for every currently known
  71: **	context.  There is a pipe block associated with the
  72: **	context, defined in call() or main(); only a pointer
  73: **	is kept here so that the pipe block can be more efficiently
  74: **	allocated off the stack.
  75: **
  76: **	Some of the fields describe the NEXT block in the sequence.
  77: **	These are: ctx_size, ctx_link.
  78: **
  79: **	Ctx_cmark is useful ONLY when this block is not currently
  80: **	active.
  81: **
  82: **	Ctx_qt should be of type 'struct qthdr *'; it is 'char *' to
  83: **	avoid including qtree.h.  It points to the saved query
  84: **	tree header after the first qt is read in.
  85: **
  86: **	Ctx_pv MUST be last.
  87: */
  88: 
  89: typedef struct _ctx_t
  90: {
  91:     char        *ctx_name;  /* the printname of this proc */
  92:     pb_t        *ctx_ppb;   /* the pb associated w/ this ctx */
  93:     short       *ctx_tvect; /* the trace vect for this ctx */
  94:     int     (*ctx_errfn)(); /* the error handling function */
  95:     char        *ctx_qt;    /* pointer to saved Qt struct */
  96:     struct fn_def   *ctx_fn;    /* pointer to fn descriptor */
  97:     char        *ctx_glob;  /* ptr to saved global area */
  98:     struct _ctx_t   *ctx_link;  /* a link to the next ctx */
  99:     struct monitor  *ctx_mon;   /* ptr to monitor struct */
 100:     short       ctx_size;   /* the size of the next ctx */
 101:     bool        ctx_init;   /* set if between initp & call */
 102:     bool        ctx_new;    /* set if this is a new context */
 103:     char        ctx_resp;   /* process to respond to */
 104:     int     ctx_cmark;  /* the Qbuf context mark */
 105:     int     ctx_pmark;  /* the Qbuf parameter mark */
 106:     jmp_buf     ctx_jbuf;   /* longjmp point on fatal error */
 107:     long        ctx_ofiles; /* files that should be kept open */
 108:     int     ctx_pc;     /* the parm count */
 109:     PARM        ctx_pv[PV_MAXPC+1]; /* the parm vector */
 110: }  ctx_t;
 111: 
 112: extern ctx_t    Ctx;        /* the current context */
 113: extern char Qbuf[];     /* the free space buffer */
 114: extern int  QbufSize;   /* the size of Qbuf */
 115: extern struct _cm_t Cm; /* the system configuration */
 116: extern int  Syncs[CM_MAXPROC];  /* the number of SYNCs expected */
 117: 
 118: 
 119: /*
 120: **  ERROR NUMBERS
 121: */
 122: 
 123: # define    ERR_QBUF    100 /* Qbuf overflow */

Defined struct's

_cm_t defined in line 57; used 4 times
_ctx_t defined in line 89; used 4 times

Defined typedef's

Defined macros

Usage of this include

Last modified: 1986-04-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 804
Valid CSS Valid XHTML 1.0 Strict