home *** CD-ROM | disk | FTP | other *** search
- #ifdef applec
- #pragma segment SegC
- #endif
- /******************************************************************************/
- /* C88 call to environ() replaced with call to (non-ANSI) getenv(). */
- /******************************************************************************/
- /* Traceend and tracegi: changed HITS to %08x. */
- /* TO DO: Revise all pointer formats (%04x) to work with far pointers also. */
- /******************************************************************************/
- #include "sgmlincl.h" /* #INCLUDE statements for SGML parser. */
- /******************************************************************************/
- /*lint -library Ignore failure to use library functions. */
- #include <stdio.h> /* Stream I/O functions. */
- /*lint -restore End of library function declarations. */
- /******************************************************************************/
- /* Trace variables.
- */
- int trace = 0; /* Switch: 1=trace state transitions; 0=don't. */
- int atrace = 0; /* Switch: 1=trace attribute activity; 0=don't. */
- int ctrace = 0; /* Switch: 1=trace context checking; 0=don't. */
- int dtrace = 0; /* Switch: 1=trace declaration parsing; 0=don't.*/
- int etrace = 0; /* Switch: 1=trace entity activity; 0=don't.*/
- int gtrace = 0; /* Switch: 1=trace group creations; 0=don't. */
- int itrace = 0; /* Switch: 1=trace ID activity; 0=don't. */
- int mtrace = 0; /* Switch: 1=trace MS activity; 0=don't. */
- int ntrace = 0; /* Switch: 1=trace notation activity; 0=don't. */
- UNCH emd[] = "EMD"; /* For "EMD" parameter type in dtrace calls. */
- UNCH estype1[] = /* For estore values in trace messages. */
- " TMMMSEIXCNFPDLK";
- UNCH estype2[] = /* For estore values in trace messages. */
- " DS ";
- #ifdef THINK_C
- int TCgetenv(char *envv); /* Mac THINK C trace toggling */
- int compar(const void *v1,const void *v2);
- #endif
- /******************************************************************************/
- #ifdef THINK_C
- #define TESTENV(name) (TCgetenv(name)!=0)
- #else
- #define TESTENV(name) (getenv(name)!=0)
- #endif
- /******************************************************************************/
- /* TRACESET: Set switches for tracing body of document.
- If any environment value has been
- set for a switch, the switch is set to 1.
- */
- void traceset()
- {
- trace = TESTENV("T");
- atrace = TESTENV("A");
- ctrace = TESTENV("C");
- dtrace = TESTENV("D");
- etrace = TESTENV("E");
- gtrace = TESTENV("G");
- itrace = TESTENV("I");
- mtrace = TESTENV("M");
- ntrace = TESTENV("N");
-
- if (trace||atrace||ctrace||dtrace||etrace||gtrace||itrace||mtrace||ntrace)
- printf(
- "\nTRACESET: state=%d;att=%d;con=%d;dcl=%d;ent=%d;grp=%d;id=%d;ms=%d;dcn=%d.",
- trace, atrace,ctrace,dtrace,etrace,gtrace,itrace,mtrace,ntrace);
- }
- /******************************************************************************/
- /* TRACEPRO: Set switches for tracing prolog. If any environment value has been
- set for a switch, the switch is set to 1.
- */
- void tracepro()
- {
- trace = TESTENV("PT");
- atrace = TESTENV("PA");
- dtrace = TESTENV("PD");
- etrace = TESTENV("PE");
- gtrace = TESTENV("PG");
- mtrace = TESTENV("PM");
- ntrace = TESTENV("PN");
-
- if (trace||atrace||dtrace||etrace||gtrace||mtrace||ntrace) printf(
- "\nTRACEPRO: state=%d; att=%d; dcl=%d; ent=%d; grp=%d; ms=%d; dcn=%d.",
- trace, atrace, dtrace, etrace, gtrace, mtrace, ntrace);
- }
- /******************************************************************************/
- /* TRACEPCB: Trace character just parsed and other pcb data.
- */
- void tracepcb(pcb)
- struct parse *pcb;
- {
- int i;
-
- i = RSCC+FPOS+1-FBUF;
- printf ("\n%-8s %2u-%2u-%2u-%2u from %c [%3d] in %s, %d:%d.",
- (char *)pcb->pname, pcb->state, pcb->input, pcb->action,
- pcb->newstate, ZAPEOL(*FPOS), *FPOS, (char *)ENTITY+1, RCNT,
- i);
- }
- /******************************************************************************/
- /* TRACETKN: Trace character just read during token parse.
- */
- void tracetkn(scope, lextoke)
- int scope;
- UNCH lextoke[]; /* Lexical table for token and name parses. */
- {
- int i;
-
- i = RSCC+FPOS+1-FBUF;
- printf("\nTOKEN %2d-%2d from %c [%3d] in %s, %d:%d.",
- scope, lextoke[*FPOS],
- ZAPEOL(*FPOS), *FPOS, (char *)(ENTITY+1), RCNT,
- i);
- }
- /******************************************************************************/
- /* TRACEGML: Trace state of main SGML driver routine.
- */
- void tracegml(scb, pss, conactsw, conact)
- struct restate *scb;
- int pss, conactsw, conact;
- {
- printf("\nSGML%02d %2d-%2d-%2d-%2d in main driver; conactsw=%d; conact=%d.",
- pss, scb[pss].sstate, scb[pss].sinput, scb[pss].saction,
- scb[pss].snext, conactsw, conact);
- }
- /******************************************************************************/
- /* TRACEVAL: Trace parse of an attribute value that is a token list.
- */
- void traceval(pcb, atype, aval, tokencnt)
- struct parse *pcb;
- UNS atype; /* Type of token list expected. */
- UNCH *aval; /* Value string to be parsed as token list. */
- int tokencnt; /* Number of tokens found in attribute value. */
- {
- printf("\n%-8s %2d-%2d-%2d-%2d at %04x, atype=%02x, tokencnt=%d: ",
- (char *)pcb->pname, pcb->state, pcb->input, pcb->action,
- pcb->newstate, aval, atype, tokencnt);
- printf("%s", (char *)aval);
- }
- /******************************************************************************/
- /* TRACESTK: Trace entry just placed on tag stack.
- */
- void tracestk(pts, ts2, etictr)
- struct tag *pts; /* Stack entry for this tag. */
- int ts2; /* Stack depth. */
- int etictr; /* Number of "netok" tags on stack. */
- {
- char *st2;
-
- printf("\nSTACK %s begun; stack depth %d; tflag=%02x; etictr=%d",
- (char *)(pts->tetd->etdgi+1), ts2, pts->tflags, etictr);
-
- if (pts->tsrm != SRMNULL)
- st2 = (char *)(pts->tsrm[0]->ename+1);
- else
- st2 = "#EMPTY";
-
- printf(" srm=%s.", st2);
- }
- /******************************************************************************/
- /* TRACEDSK: Trace entry just removed from tag stack.
- */
- void tracedsk(pts, ptso, ts3, etictr)
- struct tag *pts; /* Stack entry for new open tag. */
- struct tag *ptso; /* Stack entry for tag just ended. */
- int ts3; /* Stack depth. */
- int etictr; /* Number of "netok" tags on stack. */
- {
- char *st2;
-
- printf(
- "\nDESTACK %s ended; otflag=%02x; %s resumed; depth=%d; tflag=%02x; etictr=%d",
- (char *)(ptso->tetd->etdgi+1), ptso->tflags,
- pts->tetd->etdgi+1, ts3, pts->tflags, etictr);
-
- if (pts->tsrm != SRMNULL)
- st2 = (char *)(pts->tsrm[0]->ename+1);
- else
- st2 = "#EMPTY";
-
- printf(" srm=%s.", st2);
- }
- /******************************************************************************/
- /* TRACECON: Trace interactions between content parse and stag/context
- processing.
- */
- void tracecon(etagimct, dostag, datarc, pcb, conrefsw, didreq)
- int etagimct; /* Implicitly ended elements left on stack. */
- int dostag; /* 1=retry newetd instead of parsing; 0=parse. */
- int datarc; /* Return code for data: DAF_ or REF_ or zero. */
- struct parse *pcb; /* Parse control block for this parse. */
- int conrefsw; /* 1=content reference att specified; 0=no. */
- int didreq; /* 1=required implied empty tag processed; 0=no.*/
- {
- printf("\nCONTENT etagimct=%d dostag=%d datarc=%d pname=%s action=%d \
- conrefsw=%d didreq=%d",
- etagimct, dostag, datarc, pcb->pname, pcb->action, conrefsw, didreq);
- }
- /******************************************************************************/
- /* TRACESTG: Trace start-tag context validation input and results.
- */
- void tracestg(curetd, dataret, rc, nextetd, mexts)
- struct etd *curetd; /* The etd for this tag. */
- int dataret; /* Data pending: DAF_ REF_ 0=not #PCDATA. */
- int rc; /* Return code from context or other test. */
- struct etd *nextetd; /* The etd for a forced start-tag (if rc==2). */
- int mexts; /* >0=stack level of minus grp; -1=plus; 0=none.*/
- {
- printf("\nSTARTTAG newetd=%08lx; dataret=%d; rc=%d; nextetd=%08lx; mexts=%d.",
- curetd, dataret, rc, nextetd, mexts);
- }
- /******************************************************************************/
- /* TRACEETG: Trace end-tag matching test on stack.
- */
- void traceetg(pts, curetd, tsl, etagimct)
- struct tag *pts; /* Stack entry for this tag. */
- struct etd *curetd; /* The etd for this tag. */
- int tsl; /* Temporary stack level for looping. */
- int etagimct; /* Num of implicitly ended tags left on stack. */
- {
- printf(
- "\nENDTAG tsl=%d; newetd=%08lx; stacketd=%08lx; tflags=%02x; etagimct=%d.",
- tsl, curetd, pts->tetd, pts->tflags, etagimct);
- }
- /******************************************************************************/
- /* TRACEECB: Trace entity control block activity.
- */
- void traceecb(action, p)
- UNCH *action;
- struct entity *p;
- {
- char *st2;
-
- printf("\n%-8s (es=%d) type %c%c entity %s at %08lx containing ",
- action, es, estype1[p->estore], estype2[p->estore], (char *)(p->ename+1), p);
- if (p->estore==ESS || p->estore==ESE) {
- if (p->etx.e == ETDNULL)
- st2 = "null";
- else
- st2 = (char *)(p->etx.e->etdgi+1);
- printf("%s tag.", st2);
- } else if (p->estore==ESN && strcmp((char *)action, "ENTDEF")) traceesn(p->etx.n);
- else if (p->etx.x==0) printf("[NOTHING]");
- else {
- if (*(p->etx.c+1))
- st2 = (char *)(p->etx.c+1);
- else
- st2 = "[EMPTY]";
- printf("%s", st2);
- }
- }
- /******************************************************************************/
- /* TRACEDCN: Trace data content notation activity.
- */
- void tracedcn(p)
- struct dcncb *p;
- {
- char *st1;
-
- if (p->dcnid != 0)
- st1 = (char *)((UNCH *)p->dcnid+1);
- else
- st1 = "[UNDEFINED]";
-
- printf(
- "\nDCN dcn=%08lx; adl=%04x; notation is %s=>%s",
- p, p->adl, (char *)(p->ename+1), st1);
- if (p->adl) traceadl(p->adl);
- }
- /******************************************************************************/
- /* TRACEESN: Print a data entity control block.
- */
- void traceesn(p)
- PNE p;
- {
- char *st1, *st2, *st3;
-
- if (NEENAME(p) != 0)
- st1 = (char *)(((STRING)NEENAME(p))+1);
- else
- st1 = "[UNDEFINED]";
-
- if (NEXTYPE(p) == 1)
- st2 = "CDATA";
- else if (NEXTYPE(p) == 2)
- st2 = "NDATA";
- else
- st2 = "SDATA";
-
- if (NEID(p) != 0)
- st3 = (char *)(((STRING)NEID(p))+1);
- else
- st3 = "[UNDEFINED]";
-
- printf("\nESN Entity name is %s; entity type is %s.", st1, st2);
- printf("\n System ID is %s", st3);
- if (p->nedcn!=0) tracedcn(p->nedcn);
- }
- /******************************************************************************/
- /* TRACESRM: Print the members of a short reference map.
- */
- void tracesrm(action, pg, gi)
- UNCH *action;
- TECB pg;
- UNCH *gi;
- {
- char *st2;
- int i = 0; /* Loop counter. */
-
-
-
- if (pg==SRMNULL) printf("\n%-8s SHORTREF table empty for %s.", action, gi);
- else {
- st2 = gi ? (char *)gi : "definition";
- printf("\n%-8s %s at %08lx mapped for %s.",
- action, (char *)(pg[0]->ename+1), (unsigned long)pg, st2);
- while (++i<=lex.s.dtb[0].mapdata)
- if (pg[i]) {
- printf("\n%14s%02u %08lx %s", "SR", i, (unsigned long)pg[i],
- (char *)(pg[i]->ename+1));
- }
- }
- }
- /******************************************************************************/
- /* TRACEADL: Print an attribute definition list.
- */
- void traceadl(al)
- struct ad al[];
- {
- char *st1, *st2;
- unsigned long addr1, addr2, addr3;
- int v1;
- unsigned int u1;
- int i=0;
-
- if (AN == 1)
- st1 = "e";
- else
- st1 = "es";
- if (ADN == 1)
- st2 = "r";
- else
- st2 = "rs";
- addr1 = (unsigned long)al;
- printf("\nADLIST %08lx %d membe%s; %d attribut%s",
- addr1, ADN, st2, AN, st1);
- while (++i<=ADN) {
- if (BITOFF(ADFLAGS(i), AGROUP) && ADTYPE(i)<=ANOTEGRP)
- st1 = "\n %08lx %-8s %02x %02x %2d %02x %08lx %08lx";
- else
- st1 = "\n %08lx %-8s %02x %02x %2d %02x %08lx %08lx ";
- st2 = (char *)ADNAME(i);
- addr3 = (unsigned long)&al[i];
- addr1 = (unsigned long)ADVAL(i);
- addr2 = (unsigned long)ADDATA(i).x;
- u1 = ADLEN(i);
- printf(st1,
- addr3, st2, ADFLAGS(i), ADTYPE(i), ADNUM(i), u1, addr1, addr2);
- if (ADVAL(i)) {
- /* write(stdout, ADVAL(i)+1, *ADVAL(i)-2); */
- v1 = (unsigned char)*ADVAL(i)-2;
- printf("%*s", v1, (char *)(ADVAL(i)+1));
- if (ADTYPE(i)==AENTITY && ADDATA(i).n!=0) {
- printf("=>");
- traceesn(ADDATA(i).n);
- } else if (ADTYPE(i)==ANOTEGRP) {
- if (ADDATA(i).x!=0)
- st1 = (char *)(((STRING)ADDATA(i).x)+1);
- else
- st1 = "[UNDEFINED]";
- printf("=>%s", st1);
- }
- } else {
- if (GET(ADFLAGS(i), AREQ))
- st1 = "REQUIRED";
- else if (GET(ADFLAGS(i), ACURRENT))
- st1 = "CURRENT";
- else
- st1 = "NULL";
- printf("[%s]",st1);
- }
- }
- printf("\n");
- }
- /******************************************************************************/
- /* TRACEMOD: Print the members of a model.
- */
- void tracemod(pg)
- struct thdr pg[];
- {
- int i=0;
-
- printf("\nMODEL %08lx %02x %d", (unsigned long)&pg[0], (int)&pg[0].ttype, (int)pg[0].tu.tnum);
- while (++i <= pg[0].tu.tnum) {
- if (GET(pg[i].ttype, TTMASK)==TTETD) {
- printf("\n %08lx %02x %s",
- (unsigned long)&pg[i], (int)(pg[i].ttype),
- (char *)(pg[i].tu.thetd->etdgi+1));
- } else if (GET(pg[i].ttype, TTMASK)==TTCHARS) {
- printf("\n %08lx %02x %s", (unsigned long)&pg[i],
- (int)pg[i].ttype, "#PCDATA");
- } else {
- printf("\n %08lx %02x %d", (unsigned long)&pg[i],
- (int)pg[i].ttype, (int)pg[i].tu.tnum);
- }
- }
- printf("\n");
- }
- /******************************************************************************/
- /* TRACEGRP: Print the members of a name (i.e., etd) group.
- */
- void tracegrp(pg)
- struct etd *pg[];
- {
- int i = -1; /* Loop counter. */
-
- printf("\nETDGRP %08lx", (unsigned long)pg);
- while (pg[++i]!=0) {
- printf("\n %08lx %s", (unsigned long)pg[i], (char *)(pg[i]->etdgi+1));
- }
- }
- /******************************************************************************/
- /* TRACENGR: Print the members of a notation (i.e., dcncb) group.
- */
- void tracengr(pg)
- struct dcncb *pg[];
- {
- int i = -1; /* Loop counter. */
-
- printf("\nDCNGRP %08lx", pg);
- while (pg[++i]!=0) {
- printf("\n %08lx %s", pg[i], (char *)(pg[i]->ename+1));
- }
- }
- /******************************************************************************/
- /* TRACEETD: Print an element type definition.
- */
- void traceetd(p)
- struct etd *p; /* Pointer to an etd. */
- {
- char *stp2;
-
- if (p->etdsrm == SRMNULL)
- stp2 = "#EMPTY";
- else if (p->etdsrm != 0)
- stp2 = (char *)(p->etdsrm[0]->ename+1);
- else
- stp2 = "#CURRENT";
-
- printf(
- "\nETD etd=%08lx %s min=%04x cmod=%08lx ttype=%02x mex=%08lx,\n",
- (unsigned long)p, (char *)(p->etdgi+1), (unsigned int)p->etdmin,
- (unsigned long)p->etdmod, (int)p->etdmod->ttype, (unsigned long)p->etdmex);
- printf(" pex=%08lx, adl=%08lx, srm=%s.", (unsigned long)p->etdpex,
- (unsigned long)p->adl, stp2);
- }
- /******************************************************************************/
- /* TRACEID: Print an ID control block.
- */
- void traceid(action, p)
- UNCH *action;
- struct id *p; /* Pointer to an ID. */
- {
-
- printf("\n%-8s %s at %08lx is ", action, (char *)(p->idname+1), p);
- if (p->idl) {
- printf("ID of %s in %s, %d:%d; ", (char *)(p->idl->letdgi+1),
- (char *)(p->idl->lename+1), p->idl->lrcnt, p->idl->lccnt);
- } else
- printf("an undefined ID; ");
- printf("hits=%08lx last ref=%04x", idrefl, p->idrl);
- }
- /******************************************************************************/
- /* TRACEMD: Trace a markup declaration parameter.
- */
- void tracemd(parmid)
- UNCH *parmid; /* Parameter identifier. */
- {
- char *st2;
-
- if (subdcl)
- st2 = (char *)subdcl;
- else
- st2 = "[NONE]";
-
- printf("\nMDPARM %-8s for %-8s, token %02d, type %02u, %s.",
- (char *)mdname, st2, parmno, pcbmd.action, (char *)parmid);
- }
- /******************************************************************************/
- /* TRACEMAP: Trace a map search.
- */
- void tracemap(mapnm, key, data)
- UNCH *mapnm; /* Name in map being searched. */
- UNCH *key; /* Search key. */
- int data; /* Data associated with key in map. */
- {
- printf("\nMAPSRCH %s == %-8s=>%d", key, mapnm, data);
- }
- /******************************************************************************/
- /* TRACEMS: Trace marked section activity.
- */
- void tracems(action, code, mslevel, msplevel)
- int action; /* 1=began new level; 0=resumed previous. */
- int code;
- int mslevel; /* Nesting level of marked sections. */
- int msplevel; /* Nested MS levels subject to special parse. */
- {
- printf("\nMS%c %2d %s nesting level %d (msp %d).",
- (action ? ' ' : 'E'), code, (action ? "began" : "resumed"),
- mslevel, msplevel);
- }
- /******************************************************************************/
- #define STATUX tags[ts].status/* Token status: RCHIT RCMISS RCEND RCREQ RCNREQ*/
- #define M pos[0].g /* Index of current token in model. */
- #define P pos[0].t /* Index of current group in pos. */
- #define G pos[P].g /* Index of current group in model. */
- #define T pos[P].t /* Index of current token in its group. */
- #define H pos[P].h /* Hit bits for current group's tokens (1=hit). */
- #define GHDR mod[G] /* Current group header. */
- #define TOKEN mod[M] /* Current token. */
- #define TTYPE (GET(TOKEN.ttype, TTMASK)) /* Token type of current token. */
- #define TOCC (GET(TOKEN.ttype, TOREP)) /* Occurrence for current token. */
- #define GTYPE (GET(GHDR.ttype, TTMASK)) /* Token type of current group. */
- #define GOCC (GET(GHDR.ttype, TOREP)) /* Occurrence for current group. */
- #define GNUM GHDR.tu.tnum /* Number of tokens in current grp. */
- /******************************************************************************/
- /* TRACEGI: Trace GI testing stages in CONTEXT.C processing.
- */
- void tracegi(stagenm, gi, mod, pos, Tstart)
- UNCH *stagenm;
- struct etd *gi; /* ETD of new GI. */
- struct thdr mod[]; /* Model of current open element. */
- struct mpos pos[]; /* Position in open element's model. */
- int Tstart; /* Initial T for this group. */
- {
- char *st2, *st3;
- int i = 0; /* Loop counter. */
-
- printf("\n%-10s %d:", (char *)stagenm, P);
- while (++i<=P) printf(" %d-%d", pos[i].g, pos[i].t);
- printf(" (%u) gocc=%02x gtype=%02x gnum=%d H=%08lx status=%d Tstart=%d",
- M, GOCC, GTYPE, GNUM, (unsigned long)H, STATUX, Tstart);
- if (TTYPE)
- if (TTYPE==TTETD)
- st2 = (char *)(TOKEN.tu.thetd->etdgi+1);
- else
- st2 = "#GROUP";
- else
- st2 = "#PCDATA";
- if (gi==ETDCDATA)
- st3 = "#PCDATA";
- else
- st3 = (char *)(gi->etdgi+1);
- printf("\n=>%-8s tocc=%02x ttype=%02x thetd=%08lx (%s) gietd=%08lx (%s)",
- (char *)(tags[ts].tetd->etdgi+1), TOCC, TTYPE, (unsigned long)TOKEN.tu.thetd,
- st2, (unsigned long)gi, st3);
- }
- /******************************************************************************/
- /* TRACEEND: Trace testing for end of group in CONTEXT.C processing.
- */
- void traceend(stagenm, mod, pos, rc, opt, Tstart)
- UNCH *stagenm;
- struct thdr mod[]; /* Model of current open element. */
- struct mpos pos[]; /* Position in open element's model. */
- int rc; /* Return code: RCNREQ RCHIT RCMISS RCEND */
- int opt; /* ALLHIT parm: 1=test optionals; 0=ignore. */
- int Tstart; /* Initial T for this group. */
- {
- char *st2;
- int i = 0; /* Loop counter. */
-
- printf("\n%-10s %d:", stagenm, P);
- while (++i<=P) printf(" %d-%d", pos[i].g, pos[i].t);
- printf(" (%u) gocc=%02x gtype=%02x gnum=%d H=%08lx status=%d Tstart=%d",
- M, GOCC, GTYPE, GNUM, (unsigned long)H, STATUX, Tstart);
- if (TTYPE) {
- if (TTYPE==TTETD)
- st2 = (char *)(TOKEN.tu.thetd->etdgi+1);
- else
- st2 = "#GROUP";
- } else
- st2 = "#PCDATA";
- printf("\n=>%-8s tocc=%02x ttype=%02x thetd=%08lx (%s)",
- (char *)(tags[ts].tetd->etdgi+1), TOCC, TTYPE, (unsigned long)TOKEN.tu.thetd,
- st2);
- printf(" rc=%d offbitT=%d allhit=%d",
- rc, (int)offbit(H, (int)T, GNUM), (int)allhit(&GHDR, H, 0, opt));
- }
- /******************************************************************************/
- #ifdef THINK_C
- /* Routines to toggle tracing in THINK C environment for Macintosh */
- struct tvs {
- char *tvname;
- int tvval;
- } tvs[] = {
- "A", 1,
- "C", 1,
- "D", 1,
- "E", 1,
- "G", 1,
- "I", 1,
- "M", 1,
- "N", 1,
- "PA", 1,
- "PD", 1,
- "PE", 1,
- "PG", 1,
- "PM", 1,
- "PN", 1,
- "PT", 1,
- "T", 1
- };
-
- int TCgetenv(char *envv)
- {
- struct tvs *bp;
-
- if ((bp = bsearch(envv, &tvs[0], 16, (size_t)sizeof(struct tvs), compar)) == NULL)
- return 0;
- else
- return bp->tvval;
-
- return 1; /* Comment out preceding 6 lines to turn on everything. WW */
- }
-
- int compar(const void *v1,const void *v2)
- {
- char *t1 = (char *)v1;
- struct tvs *t2 = (struct tvs *)v2;
- return strcmp(t1, t2->tvname);
- }
- #endif