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
Defined typedef's
Defined macros
xCTR1
defined in line
47; used 26 times
- in /usr/ingres/source/ctlmod/call.c line
90,
126,
141,
192
- in /usr/ingres/source/ctlmod/call_fn.c line
58,
122
- in /usr/ingres/source/ctlmod/do_seq.c line
82,
108
- in /usr/ingres/source/ctlmod/do_st.c line
53,
93
- in /usr/ingres/source/ctlmod/error.c line
43
- in /usr/ingres/source/ctlmod/initp.c line
40
- in /usr/ingres/source/ctlmod/pb_read.c line
50,
57,
65
- in /usr/ingres/source/ctlmod/pb_write.c line
31,
57
- in /usr/ingres/source/ctlmod/readinput.c line
54,
111
- in /usr/ingres/source/ctlmod/readqry.c line
42,
159
- in /usr/ingres/source/ctlmod/resetp.c line
34,
64
- in /usr/ingres/source/ctlmod/send_off.c line
46,
84
- in /usr/ingres/source/ctlmod/setp.c line
96
xCTR2
defined in line
48; used 13 times
xCTR3
defined in line
49; used 2 times
Usage of this include