|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T t
Length: 2834 (0xb12)
Types: TextFile
Names: »tai_tb.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z«
└─⟦e5a54fb17⟧
└─⟦this⟧ »pp-5.0/Lib/tai/tai_tb.c«
/* tai_tb.c: table tailoring info */
# ifndef lint
static char Rcsid[] = "@(#)$Header: /cs/research/pp/hubris/pp-beta/Lib/tai/RCS/tai_tb.c,v 5.0 90/09/20 16:16:44 pp Exp Locker: pp $";
# endif
/*
* $Header: /cs/research/pp/hubris/pp-beta/Lib/tai/RCS/tai_tb.c,v 5.0 90/09/20 16:16:44 pp Exp Locker: pp $
*
* $Log: tai_tb.c,v $
* Revision 5.0 90/09/20 16:16:44 pp
* rcsforce : 5.0 public release
*
*/
#include "util.h"
#include <isode/cmd_srch.h>
#include "table.h"
extern int tb_maxtables;
static int tb_numtables = 0;
static char tbl_str[] = "tbl";
char *tai_alloc();
#define CMDTNAME 1
#define CMDTFILE 2
#define CMDTSHOW 3
#define CMDTFLAGS 4
static CMD_TABLE tb_cmdtbl[] = {
"name", CMDTNAME,
"file", CMDTFILE,
"show", CMDTSHOW,
"flags", CMDTFLAGS,
0, -1
};
#define CMDTFLINEAR 1
#define CMDTFDBM 2
#define CMDTFNS 3
#define CMDTFDOMAIN 4
#define CMDTFCHANNEL 5
#define CMDTFROOT 6
#define CMDTFPARTIAL 7
static CMD_TABLE tb_flags[] = {
"linear", CMDTFLINEAR,
"dbm", CMDTFDBM,
"ns", CMDTFNS,
"domain", CMDTFDOMAIN,
"channel", CMDTFCHANNEL,
"root", CMDTFROOT,
"partial", CMDTFPARTIAL,
0, -1
};
/* --------------------- Begin Routines -------------------------------- */
int tbl_tai (argc, argv)
int argc;
char **argv;
{
register Table *tbptr;
char *p,
*arg;
int ind;
if (argc < 2 || lexequ (argv[0], tbl_str) != 0)
return (NOTOK);
if (tb_numtables + 1 >= tb_maxtables) {
PP_OPER (NULLCP, ("tailor: exceed table size"));
return (NOTOK);
}
argc--;
arg = tai_alloc (*++argv);
tb_all[tb_numtables++] = tbptr = (Table *) smalloc ((sizeof (Table)));
tb_all [tb_numtables] = NULLTBL;
tbptr -> tb_name = arg;
tbptr -> tb_show = arg;
tbptr -> tb_file = arg;
tbptr -> tb_fp = NULLFILE;
tbptr -> tb_flags = TB_DBM;
argv++;
argc--;
for (ind = 0 ; ind < argc ; ind++) {
if ((p = index (argv[ind], '=')) == NULLCP)
continue;
*p++ = '\0';
switch (cmd_srch (argv[ind], tb_cmdtbl)) {
case CMDTNAME:
tbptr->tb_name = tai_alloc (p);
break;
case CMDTFILE:
tbptr->tb_file = tai_alloc (p);
break;
case CMDTSHOW:
tbptr->tb_show = tai_alloc (p);
break;
case CMDTFLAGS:
switch (cmd_srch (p, tb_flags)) {
case CMDTFDBM:
tbptr->tb_flags = TB_DBM;
break;
case CMDTFLINEAR:
tbptr->tb_flags = TB_LINEAR;
break;
case CMDTFNS:
tbptr->tb_flags = TB_NS;
break;
case CMDTFDOMAIN:
case CMDTFCHANNEL:
case CMDTFROOT:
case CMDTFPARTIAL:
break;
}
break;
default:
continue;
}
}
return (OK);
}