]>
Commit | Line | Data |
---|---|---|
0236bb42 | 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, | |
741abed8 | 49 | V_SORT, V_RENAME, V_CHAR, V_LOCK, V_WILD, V_UPWILD, |
50 | V_RLOCK}; | |
0236bb42 | 51 | |
52 | /* Validated Object Definition */ | |
53 | struct valobj | |
54 | { | |
55 | enum vo_type type; | |
56 | int index; /* index of object to validate */ | |
57 | char *table; /* table containing object */ | |
58 | char *namefield; /* table's fieldname for object */ | |
59 | char *idfield; /* table's corresponding id field (if any) */ | |
60 | int error; | |
61 | }; |