beforetable = table;
if (!strcmp(table, "users")) {
-/*
- * retrieve (barg0 = u.login, barg1 = text(u.uid),
- * barg2 = u.shell, barg3 = u.last, barg4 = u.first,
- * barg5 = u.middle, barg6 = text(u.status),
- * barg7 = u.mit_id, barg8 = u.mit_year)
- * where qual
- */
EXEC SQL SELECT login, CHAR(uid), shell, last, first, middle,
CHAR(status), clearid, type
INTO :barg0, :barg1, :barg2, :barg3, :barg4, :barg5, :barg6,
FROM users WHERE :qual;
beforec = 9;
} else if (!strcmp(table, "machine")) {
-/*
- * retrieve (barg0 = m.name, barg1 = m.type) where qual
- */
EXEC SQL SELECT name, type INTO :barg0, :barg1 FROM machine
WHERE :qual;
beforec = 2;
} else if (!strcmp(table, "cluster")) {
-/*
- * retrieve (barg0 = c.name, barg1 = c.desc, barg2 = c.location)
- * where qual
- */
EXEC SQL SELECT name, description, location
INTO :barg0, :barg1, :barg2
FROM cluster WHERE :qual;
strcpy(barg2, argv[2]);
beforec = 3;
} else if (!strcmp(table, "filesys")) {
-/*
- * range of fs is filesys
- * retrieve (barg0 = fs.label, barg1 = fs.type, barg2 = text(fs.mach_id),
- * barg3 = fs.name, barg4 = fs.mount, barg5 = fs.access,
- * barg6 = fs.comments, barg7 = text(fs.owner),
- * barg8 = text(fs.owners), barg9 = text(fs.createflg),
- * barg10 = fs.lockertype)
- * where qual
- */
EXEC SQL SELECT label, type, CHAR(mach_id), name, mount, access,
- comments, CHAR(owner), CHAR(owners), CHAR(createflag), lockertype
+ comments, CHAR(owner), CHAR(owners), CHAR(createflg), lockertype
INTO :barg0, :barg1, :barg2, :barg3, :barg4, :barg5, :barg6,
:barg7, :barg8, :barg9, :barg10
FROM filesys WHERE :qual;
strcpy(barg2, "?");
sprintf(buffer, "%s and fs.filsys_id = q.filsys_id", qual);
qual = buffer;
-/*
- * range of q is quota
- * retrieve (barg3 = text(q.quota), barg4 = filesys.name) where qual
- */
EXEC SQL SELECT q.quota, fs.name INTO :barg3, :barg4
FROM quota q, filesys fs WHERE :qual;
beforec = 5;
} else if (!strcmp(table, "list")) {
-/*
- * retrieve (barg0 = l.name, barg1 = text(l.active),
- * barg2 = text(l.public), barg3 = text(l.hidden),
- * barg4 = text(l.maillist), barg5 = text(l.group),
- * barg6 = text(l.gid), barg7 = l.acl_type,
- * barg8 = text(l.acl_id), barg9 = l.desc)
- * where qual
- */
EXEC SQL SELECT name, CHAR(active), CHAR(publicflg), CHAR(hidden),
CHAR(maillist), CHAR(grouplist), CHAR(gid), acl_type,
CHAR(acl_id), description
beforec = 10;
} else if (!strcmp(table, "members")) {
id = (int) argv[0];
-/*
- * retrieve (barg3 = text(list.group)) where list.list_id = id
- */
EXEC SQL SELECT CHAR(grouplist) INTO :barg3 FROM list
WHERE list_id = :id;
name = malloc(0);
char **copy_argv();
if (!strcmp(table, "users")) {
-/*
- * retrieve (aarg0 = u.login, aarg1 = text(u.uid),
- * aarg2 = u.shell, aarg3 = u.last, aarg4 = u.first,
- * aarg5 = u.middle, aarg6 = text(u.status),
- * aarg7 = u.mit_id, aarg8 = u.mit_year)
- * where qual
- */
EXEC SQL SELECT login, CHAR(uid), shell, last, first, middle,
CHAR(status), clearid, type
INTO :aarg0, :aarg1, :aarg2, :aarg3, :aarg4, :aarg5,
FROM users WHERE :qual;
afterc = 9;
} else if (!strcmp(table, "machine")) {
-/*
- * retrieve (aarg0 = m.name, aarg1 = m.type) where qual
- */
EXEC SQL SELECT name, type INTO :aarg0, :aarg1
FROM machine WHERE :qual;
afterc = 2;
} else if (!strcmp(table, "cluster")) {
-/*
- * retrieve (aarg0 = c.name, aarg1 = c.desc, aarg2 = c.location)
- * where qual
- */
EXEC SQL SELECT name, description, location
INTO :aarg0, :aarg1, :aarg2
FROM cluster WHERE :qual;
strcpy(aarg2, argv[2]);
afterc = 3;
} else if (!strcmp(table, "filesys")) {
-/*
- * range of fs is filesys
- * retrieve (aarg0 = fs.label, aarg1 = fs.type,
- * aarg2 = text(fs.mach_id),
- * aarg3 = fs.name, aarg4 = fs.mount, aarg5 = fs.access,
- * aarg6 = fs.comments, aarg7 = text(fs.owner),
- * aarg8 = text(fs.owners), aarg9 = text(fs.createflg),
- * aarg10 = fs.lockertype)
- * where qual
- */
- EXEC SQL SELECT label, type, CHAR(mach_id), name, mount, access,
- comments, CHAR(owner), CHAR(owners), CHAR(createflag), lockertype
+ EXEC SQL SELECT CHAR(label), type, CHAR(mach_id), name, mount, access,
+ comments, CHAR(owner), CHAR(owners), CHAR(createflg), lockertype
INTO :aarg0, :aarg1, :aarg2, :aarg3, :aarg4, :aarg5, :aarg6,
:aarg7, :aarg8, :aarg9, :aarg10
FROM filesys fs WHERE :qual;
strcpy(aarg2, "?");
sprintf(buffer, "%s and fs.filsys_id = q.filsys_id", qual);
qual = buffer;
-/*
- * range of q is quota
- * retrieve (aarg3 = text(q.quota), aarg4 = filesys.name) where qual
- */
EXEC SQL SELECT CHAR(q.quota), fs.name INTO :aarg3, :aarg4
FROM quota q, filesys fs WHERE :qual;
afterc = 5;
} else if (!strcmp(table, "list")) {
-/*
- * retrieve (aarg0 = l.name, aarg1 = text(l.active),
- * aarg2 = text(l.public), aarg3 = text(l.hidden),
- * aarg4 = text(l.maillist), aarg5 = text(l.group),
- * aarg6 = text(l.gid), aarg7 = l.acl_type,
- * aarg8 = text(l.acl_id), aarg9 = l.desc)
- * where qual
- */
EXEC SQL SELECT name, CHAR(active), CHAR(publicflg), CHAR(hidden),
CHAR(maillist), CHAR(grouplist), CHAR(gid), acl_type,
CHAR(acl_id), description
afterc = 10;
} else if (!strcmp(table, "members")) {
id = (int) argv[0];
-/*
- * retrieve (aarg3 = text(list.group)) where list.list_id = id
- */
EXEC SQL SELECT CHAR(grouplist) INTO :aarg3 FROM list
WHERE list_id = :id;
name = malloc(0);