| 8 |
|
*/ |
| 9 |
|
|
| 10 |
|
#include <stdio.h> |
| 11 |
– |
|
| 11 |
|
#include <stdlib.h> |
| 12 |
+ |
#include <string.h> |
| 13 |
|
|
| 14 |
+ |
#include "rterror.h" |
| 15 |
+ |
#include "rtio.h" |
| 16 |
|
#include "trans.h" |
| 17 |
|
|
| 18 |
+ |
static int idcmp(ID *id1, ID *id2); |
| 19 |
+ |
static void fputidlist(IDLIST *qp, FILE *fp); |
| 20 |
+ |
static int qtype(char *qnm, register QLIST *qlp); |
| 21 |
|
|
| 22 |
< |
fgetid(idp, dls, fp) /* read an id up to char in dls from fp */ |
| 23 |
< |
ID *idp; |
| 24 |
< |
char *dls; |
| 25 |
< |
register FILE *fp; |
| 22 |
> |
extern int |
| 23 |
> |
fgetid( /* read an id up to char in dls from fp */ |
| 24 |
> |
ID *idp, |
| 25 |
> |
char *dls, |
| 26 |
> |
register FILE *fp |
| 27 |
> |
) |
| 28 |
|
{ |
| 29 |
|
char dset[256/8]; |
| 30 |
|
char buf[MAXSTR]; |
| 67 |
|
} |
| 68 |
|
|
| 69 |
|
|
| 70 |
< |
int |
| 71 |
< |
findid(idl, idp, insert) /* find (or insert) id in list */ |
| 72 |
< |
register IDLIST *idl; |
| 73 |
< |
ID *idp; |
| 74 |
< |
int insert; |
| 70 |
> |
extern int |
| 71 |
> |
findid( /* find (or insert) id in list */ |
| 72 |
> |
register IDLIST *idl, |
| 73 |
> |
ID *idp, |
| 74 |
> |
int insert |
| 75 |
> |
) |
| 76 |
|
{ |
| 77 |
|
int upper, lower; |
| 78 |
|
register int cm, i; |
| 96 |
|
if (idl->id == NULL) |
| 97 |
|
goto memerr; |
| 98 |
|
} else { /* grow old list */ |
| 99 |
< |
idl->id = (ID *)realloc((char *)idl->id,(idl->nids+1)*sizeof(ID)); |
| 99 |
> |
idl->id = (ID *)realloc((void *)idl->id,(idl->nids+1)*sizeof(ID)); |
| 100 |
|
if (idl->id == NULL) |
| 101 |
|
goto memerr; |
| 102 |
|
for (i = idl->nids; i > upper; i--) { |
| 114 |
|
memerr: |
| 115 |
|
eputs("Out of memory in findid\n"); |
| 116 |
|
quit(1); |
| 117 |
+ |
return -1; /* pro forma return */ |
| 118 |
|
} |
| 119 |
|
|
| 120 |
|
|
| 121 |
< |
int |
| 122 |
< |
idcmp(id1, id2) /* compare two identifiers */ |
| 123 |
< |
register ID *id1, *id2; |
| 121 |
> |
static int |
| 122 |
> |
idcmp( /* compare two identifiers */ |
| 123 |
> |
register ID *id1, |
| 124 |
> |
register ID *id2 |
| 125 |
> |
) |
| 126 |
|
{ |
| 127 |
|
/* names are greater than numbers */ |
| 128 |
|
if (id1->name == NULL) |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
|
| 141 |
< |
write_quals(qlp, idl, fp) /* write out qualifier lists */ |
| 142 |
< |
QLIST *qlp; |
| 143 |
< |
IDLIST idl[]; |
| 144 |
< |
FILE *fp; |
| 141 |
> |
extern void |
| 142 |
> |
write_quals( /* write out qualifier lists */ |
| 143 |
> |
QLIST *qlp, |
| 144 |
> |
IDLIST idl[], |
| 145 |
> |
FILE *fp |
| 146 |
> |
) |
| 147 |
|
{ |
| 148 |
|
int i; |
| 149 |
|
|
| 156 |
|
} |
| 157 |
|
|
| 158 |
|
|
| 159 |
< |
fputidlist(qp, fp) /* put id list out to fp */ |
| 160 |
< |
IDLIST *qp; |
| 161 |
< |
FILE *fp; |
| 159 |
> |
static void |
| 160 |
> |
fputidlist( /* put id list out to fp */ |
| 161 |
> |
IDLIST *qp, |
| 162 |
> |
FILE *fp |
| 163 |
> |
) |
| 164 |
|
{ |
| 165 |
|
int fi; |
| 166 |
|
register int i; |
| 186 |
|
|
| 187 |
|
|
| 188 |
|
RULEHD * |
| 189 |
< |
getmapping(file, qlp) /* read in mapping file */ |
| 190 |
< |
char *file; |
| 191 |
< |
QLIST *qlp; |
| 189 |
> |
getmapping( /* read in mapping file */ |
| 190 |
> |
char *file, |
| 191 |
> |
QLIST *qlp |
| 192 |
> |
) |
| 193 |
|
{ |
| 194 |
|
char *err; |
| 195 |
|
register int c; |
| 281 |
|
memerr: |
| 282 |
|
eputs("Out of memory in getmapping\n"); |
| 283 |
|
quit(1); |
| 284 |
+ |
return NULL; /* pro forma return */ |
| 285 |
|
} |
| 286 |
|
|
| 287 |
|
|
| 288 |
< |
int |
| 289 |
< |
qtype(qnm, qlp) /* return number for qualifier name */ |
| 290 |
< |
char *qnm; |
| 291 |
< |
register QLIST *qlp; |
| 288 |
> |
static int |
| 289 |
> |
qtype( /* return number for qualifier name */ |
| 290 |
> |
char *qnm, |
| 291 |
> |
register QLIST *qlp |
| 292 |
> |
) |
| 293 |
|
{ |
| 294 |
|
register int i; |
| 295 |
|
|
| 300 |
|
} |
| 301 |
|
|
| 302 |
|
|
| 303 |
< |
matchid(it, im) /* see if we match an id */ |
| 304 |
< |
register ID *it; |
| 305 |
< |
register IDMATCH *im; |
| 303 |
> |
extern int |
| 304 |
> |
matchid( /* see if we match an id */ |
| 305 |
> |
register ID *it, |
| 306 |
> |
register IDMATCH *im |
| 307 |
> |
) |
| 308 |
|
{ |
| 309 |
|
if (it->name == NULL) { |
| 310 |
|
if (im->nam != NULL) |