]> andersk Git - moira.git/blob - server/query.h
SQL Version prior to beginning synchronization with opssrc version.
[moira.git] / server / query.h
1 /* $Header$
2  *
3  * Structures and constants used in the query dispatch table
4  */
5
6 /* Query Types */
7 enum query_type {RETRIEVE, UPDATE, APPEND, DELETE, SPECIAL};
8
9 /* Query Definition Structure */
10 struct query
11 {
12     char *name;                 /* query name */
13     char *shortname;            /* abbreviated query name (must be 4 chars) */
14     enum query_type type;       /* query type */
15     char *rvar;                 /* range variable */
16     char *rtable;               /* range table */
17     char *tlist;                /* target list */
18     char **fields;              /* input and output variable names (for help) */
19     int  vcnt;                  /* variable count */
20     char *qual;                 /* format string for "where" clause */
21     int  argc;                  /* number of args for qualifier */
22     struct validate *validate;  /* validation support */
23     int  acl;                   /* hint as to query ACL for this query */
24     int  everybody;             /* is the default user on this ACL? */
25 };
26
27 /* Query Validation Structure */
28 struct validate
29 {
30     /* object validation (e.g., user, filesys, type) */
31     struct valobj *valobj;      /* array of object validation descriptors */
32     int objcnt;                 /* size of array */
33     /* row validation - retrieve (exists = any(rvar.field where qual)) */
34     char *field;                /* field to check for */
35     char *qual;                 /* format string for "where" clause */
36     int  argc;                  /* number of args used in qual */
37     /* values field containing current max object id */
38     char *object_id;
39     /* routine to verify access permission on objects */
40     int (*acs_rtn)();
41     /* pre-processing routine (var setup only) */
42     int (*pre_rtn)();
43     /* post-processing routine */
44     int (*post_rtn)();
45 };
46         
47 /* Validated Object Types */
48 enum vo_type {V_NAME, V_ID, V_TYPE, V_TYPEDATA, V_DATE, 
49               V_SORT, V_RENAME, V_CHAR, V_LOCK, V_WILD, V_UPWILD};
50
51 /* Validated Object Definition */
52 struct valobj
53 {
54     enum vo_type type;
55     int index;                  /* index of object to validate */
56     char *table;                /* table containing object */
57     char *namefield;            /* table's fieldname for object */
58     char *idfield;              /* table's corresponding id field (if any) */
59     int error;
60 };
61
62 /* Used to setup static argv, maximum argc and argument lengths */
63 #define QMAXARGS        20
64 #define QMAXARGSIZE     513
65
This page took 0.056771 seconds and 5 git commands to generate.