*/
/* Query Types */
-enum query_type {RETRIEVE, UPDATE, APPEND, DELETE, SPECIAL};
+enum query_type {MR_Q_RETRIEVE, MR_Q_UPDATE, MR_Q_APPEND, MR_Q_DELETE, MR_Q_SPECIAL};
/* Query Definition Structure */
struct query
{
char *name; /* query name */
char *shortname; /* abbreviated query name (must be 4 chars) */
+ int version; /* query version */
enum query_type type; /* query type */
char *rvar; /* range variable */
enum tables rtable; /* range table */
int vcnt; /* variable count */
char *qual; /* format string for "where" clause */
int argc; /* number of args for qualifier */
+ char *sort; /* fields to sort on */
struct validate *validate; /* validation support */
int acl; /* hint as to query ACL for this query */
int everybody; /* is the default user on this ACL? */
};
/* Validated Object Types */
-enum vo_type {V_NAME, V_ID, V_TYPE, V_TYPEDATA,
- V_SORT, V_RENAME, V_CHAR, V_LOCK, V_WILD, V_UPWILD,
- V_RLOCK, V_LEN};
+enum vo_type {V_NAME, V_ID, V_TYPE, V_TYPEDATA, V_RENAME, V_CHAR,
+ V_LEN, V_NUM};
/* Validated Object Definition */
struct valobj
int error;
};
-
-/* prototypes from cache.dc */
-void flush_cache(void);
-int name_to_id(char *name, enum tables type, int *id);
-int id_to_name(int id, enum tables type, char **name);
-int cache_entry(char *name, enum tables type, int id);
-void flush_name(char *name, enum tables type);
-void cache_commit(void);
-void cache_abort(void);
-
/* prototypes from increment.dc */
void incremental_before(enum tables table, char *qualx, char **argv);
void incremental_clear_before(void);
/* prototypes from qrtn.dc */
int check_query_access(struct query *q, char *argv[], client *cl);
int set_next_object_id(char *objectx, enum tables table, int limit);
+int name_to_id(char *name, enum tables type, int *id);
+int id_to_name(int id, enum tables type, char **name);
/* prototypes from qsubs.c */
-void list_queries(int (*action)(int, char *[], void *),
+void list_queries(client *cl, int (*action)(int, char *[], void *),
void *actarg);
void help_query(struct query *q, int (*action)(int, char *[], void *),
void *actarg);
-struct query *get_query_by_name(char *name);
+struct query *get_query_by_name(char *name, int version);