From: ceriel Date: Mon, 17 Dec 1990 12:52:41 +0000 (+0000) Subject: print some info in comment in tables.c X-Git-Tag: release-5-5~1341 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=4fbd256d14f6b35412622f52e52f3dcc07d87566;p=ack.git print some info in comment in tables.c --- diff --git a/util/ncgg/output.c b/util/ncgg/output.c index e8238c71e..d51de88f6 100644 --- a/util/ncgg/output.c +++ b/util/ncgg/output.c @@ -374,6 +374,22 @@ typeconv(n) { return(0); } +outfmt(p) +register char *p; +{ + register int c; + fprintf(ctable,"\""); + while ((c= (*p++&0377))!=0) { + if (! isascii(c) || iscntrl(c)) { + fprintf(ctable,"\\%c%c%c", + ((c&~0300)>>6) + '0', ((c&070)>>3)+'0', + (c&07)+'0'); + } + else fprintf(ctable, "%c",c); + } + fprintf(ctable,"\""); +} + outtokens() { register tokno,i; register token_p tp; @@ -381,11 +397,13 @@ outtokens() { fprintf(ctable,"tkdef_t tokens[] = {{0},\n"); for (tokno=1;toknotk_size, tp->tk_cost.ct_space, tp->tk_cost.ct_time); for(i=0;itk_att[i].ta_type)); - fprintf(ctable,"},%d},\n",tp->tk_format); + fprintf(ctable,"},%d},\t/* ",tp->tk_format); + outfmt(l_strings[tp->tk_format]); + fprintf(ctable," */\n"); } fprintf(ctable,"{0}};\n\n"); } @@ -412,8 +430,9 @@ outstrings() { fprintf(ctable,"char *tablename = \"%s\";\n",filename); fprintf(ctable,"string codestrings[] = {\n"); for(i=0;iset_size); + fprintf(ctable,"/* %3ld */ {%3d,{",(long)(sp-l_sets),sp->set_size); for (i=0;iset_val[i]&0xFFFF); fprintf(ctable,"}},\n");