#ifndef _INCL_TRANS_H
/*
Basic structs for the DB transaction engine.
*/
/* This holds a datum for any of the transaction types */
typedef union {
char *name; /* Name of an object to delete */
/* Or link to */
struct {
Obj *obj; /* Object to insert */
char *name; /* its name */
} object;
struct {
char *this; /* Name of thing to insert/remove */
char *there; /* from here. */
}insdel;
struct {
char *to;
char *from;
char *who; /* from here. */
} linkchk;
} tr_opdata;
/* String these together to make a program for tr_exec() */
typedef struct tr_op {
int (*handler)();
tr_opdata parm;
struct tr_op *next;
} tr_op;
/* This points to a list of tr_ops, of course. Geez. */
typedef struct {
tr_op *first; /* First operation of the program */
tr_op *last; /* Last operation of the program */
} tr_prog;
/* Flags for the various transaction handlers. */
#define TR_VALIDATE 0
#define TR_EXEC 1
#define TR_ABORT 2
/* The functions YOU use to get at transact.c */
extern tr_prog *tr_newprog();
extern void tr_addop();
extern int tr_exec();
extern int tr_abort();
/* The handlers for the various DB transactions */
extern int tr_newobj();
extern int tr_delobj();
extern int tr_zeroobj();
extern int tr_insply();
extern int tr_remply();
extern int tr_addlink();
#define _INCL_TRANS_H
#endif