1 1.25 dholland /* $NetBSD: rpc_hout.c,v 1.25 2016/01/23 02:33:09 dholland Exp $ */ 2 1.1 glass /* 3 1.1 glass * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 4 1.1 glass * unrestricted use provided that this legend is included on all tape 5 1.1 glass * media and as a part of the software program in whole or part. Users 6 1.1 glass * may copy or modify Sun RPC without charge, but are not authorized 7 1.1 glass * to license or distribute it to anyone else except as part of a product or 8 1.4 pk * program developed by the user or with the express written consent of 9 1.4 pk * Sun Microsystems, Inc. 10 1.4 pk * 11 1.1 glass * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 12 1.1 glass * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 13 1.1 glass * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 14 1.4 pk * 15 1.1 glass * Sun RPC is provided with no support and without any obligation on the 16 1.1 glass * part of Sun Microsystems, Inc. to assist in its use, correction, 17 1.1 glass * modification or enhancement. 18 1.4 pk * 19 1.1 glass * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 20 1.1 glass * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 21 1.1 glass * OR ANY PART THEREOF. 22 1.4 pk * 23 1.1 glass * In no event will Sun Microsystems, Inc. be liable for any lost revenue 24 1.1 glass * or profits or other special, indirect and consequential damages, even if 25 1.1 glass * Sun has been advised of the possibility of such damages. 26 1.4 pk * 27 1.1 glass * Sun Microsystems, Inc. 28 1.1 glass * 2550 Garcia Avenue 29 1.1 glass * Mountain View, California 94043 30 1.1 glass */ 31 1.4 pk 32 1.20 jmc #if HAVE_NBTOOL_CONFIG_H 33 1.20 jmc #include "nbtool_config.h" 34 1.20 jmc #endif 35 1.20 jmc 36 1.6 christos #include <sys/cdefs.h> 37 1.17 tv #if defined(__RCSID) && !defined(lint) 38 1.6 christos #if 0 39 1.4 pk static char sccsid[] = "@(#)rpc_hout.c 1.12 89/02/22 (C) 1987 SMI"; 40 1.6 christos #else 41 1.25 dholland __RCSID("$NetBSD: rpc_hout.c,v 1.25 2016/01/23 02:33:09 dholland Exp $"); 42 1.6 christos #endif 43 1.1 glass #endif 44 1.1 glass 45 1.1 glass /* 46 1.7 lukem * rpc_hout.c, Header file outputter for the RPC protocol compiler 47 1.1 glass */ 48 1.17 tv #include <ctype.h> 49 1.17 tv #include <err.h> 50 1.1 glass #include <stdio.h> 51 1.6 christos #include "rpc_scan.h" 52 1.4 pk #include "rpc_parse.h" 53 1.1 glass #include "rpc_util.h" 54 1.1 glass 55 1.22 christos static void pconstdef(definition *); 56 1.22 christos static void pargdef(definition *); 57 1.22 christos static void pstructdef(definition *); 58 1.22 christos static void puniondef(definition *); 59 1.22 christos static void pdefine(const char *, const char *); 60 1.22 christos static void puldefine(const char *, const char *); 61 1.22 christos static int define_printed(proc_list *, version_list *); 62 1.22 christos static void pprogramdef(definition *); 63 1.22 christos static void penumdef(definition *); 64 1.22 christos static void ptypedef(definition *); 65 1.22 christos static int undefined2(const char *, const char *); 66 1.22 christos static void cplusplusstart(void); 67 1.22 christos static void cplusplusend(void); 68 1.1 glass 69 1.1 glass /* 70 1.7 lukem * Print the C-version of an xdr definition 71 1.1 glass */ 72 1.1 glass void 73 1.21 dholland print_datadef(definition *def) 74 1.1 glass { 75 1.4 pk 76 1.7 lukem if (def->def_kind == DEF_PROGRAM) /* handle data only */ 77 1.7 lukem return; 78 1.4 pk 79 1.1 glass if (def->def_kind != DEF_CONST) { 80 1.1 glass f_print(fout, "\n"); 81 1.1 glass } 82 1.1 glass switch (def->def_kind) { 83 1.1 glass case DEF_STRUCT: 84 1.1 glass pstructdef(def); 85 1.1 glass break; 86 1.1 glass case DEF_UNION: 87 1.1 glass puniondef(def); 88 1.1 glass break; 89 1.1 glass case DEF_ENUM: 90 1.1 glass penumdef(def); 91 1.1 glass break; 92 1.1 glass case DEF_TYPEDEF: 93 1.1 glass ptypedef(def); 94 1.1 glass break; 95 1.1 glass case DEF_PROGRAM: 96 1.1 glass pprogramdef(def); 97 1.1 glass break; 98 1.1 glass case DEF_CONST: 99 1.1 glass pconstdef(def); 100 1.1 glass break; 101 1.1 glass } 102 1.4 pk } 103 1.4 pk 104 1.4 pk void 105 1.22 christos print_progdef(definition *def) 106 1.4 pk { 107 1.4 pk switch (def->def_kind) { 108 1.4 pk case DEF_PROGRAM: 109 1.1 glass f_print(fout, "\n"); 110 1.4 pk pprogramdef(def); 111 1.4 pk break; 112 1.6 christos case DEF_CONST: 113 1.6 christos case DEF_TYPEDEF: 114 1.6 christos case DEF_ENUM: 115 1.6 christos case DEF_UNION: 116 1.6 christos case DEF_STRUCT: 117 1.6 christos break; 118 1.7 lukem } 119 1.4 pk } 120 1.4 pk 121 1.6 christos void 122 1.22 christos print_funcdef(definition *def, int *did) 123 1.22 christos { 124 1.22 christos switch (def->def_kind) { 125 1.22 christos case DEF_PROGRAM: 126 1.22 christos case DEF_CONST: 127 1.22 christos break; 128 1.22 christos case DEF_TYPEDEF: 129 1.22 christos case DEF_ENUM: 130 1.22 christos case DEF_UNION: 131 1.22 christos case DEF_STRUCT: 132 1.22 christos if (!*did) { 133 1.22 christos f_print(fout, "\n"); 134 1.22 christos cplusplusstart(); 135 1.22 christos *did = 1; 136 1.22 christos } 137 1.22 christos pxdrfuncdecl(def->def_name, 138 1.22 christos def->def_kind != DEF_TYPEDEF || 139 1.22 christos !isvectordef(def->def.ty.old_type, def->def.ty.rel)); 140 1.22 christos break; 141 1.22 christos } 142 1.22 christos } 143 1.22 christos 144 1.22 christos void 145 1.22 christos print_funcend(int did) { 146 1.22 christos if (did) { 147 1.22 christos cplusplusend(); 148 1.22 christos } 149 1.22 christos } 150 1.22 christos 151 1.22 christos void 152 1.21 dholland pxdrfuncdecl(const char *name, int pointerp) 153 1.7 lukem { 154 1.7 lukem 155 1.22 christos f_print(fout, "bool_t xdr_%s(XDR *, %s%s);\n", name, 156 1.13 lukem name, pointerp ? (" *") : ""); 157 1.1 glass } 158 1.1 glass 159 1.4 pk 160 1.6 christos static void 161 1.21 dholland pconstdef(definition *def) 162 1.1 glass { 163 1.1 glass pdefine(def->def_name, def->def.co); 164 1.1 glass } 165 1.21 dholland 166 1.7 lukem /* print out the definitions for the arguments of functions in the 167 1.7 lukem header file 168 1.4 pk */ 169 1.7 lukem static void 170 1.21 dholland pargdef(definition *def) 171 1.4 pk { 172 1.4 pk decl_list *l; 173 1.4 pk version_list *vers; 174 1.7 lukem char *name; 175 1.4 pk proc_list *plist; 176 1.22 christos int did; 177 1.4 pk 178 1.7 lukem 179 1.4 pk for (vers = def->def.pr.versions; vers != NULL; vers = vers->next) { 180 1.22 christos for (plist = vers->procs; plist != NULL; plist = plist->next) { 181 1.7 lukem if (!newstyle || plist->arg_num < 2) { 182 1.7 lukem continue; /* old style or single args */ 183 1.7 lukem } 184 1.7 lukem name = plist->args.argname; 185 1.7 lukem f_print(fout, "struct %s {\n", name); 186 1.7 lukem for (l = plist->args.decls; 187 1.7 lukem l != NULL; l = l->next) { 188 1.7 lukem pdeclaration(name, &l->decl, 1, ";\n"); 189 1.4 pk } 190 1.7 lukem f_print(fout, "};\n"); 191 1.7 lukem f_print(fout, "typedef struct %s %s;\n", name, name); 192 1.4 pk } 193 1.7 lukem } 194 1.22 christos did = 0; 195 1.22 christos for (vers = def->def.pr.versions; vers != NULL; vers = vers->next) { 196 1.22 christos for (plist = vers->procs; plist != NULL; plist = plist->next) { 197 1.24 kamil if (!newstyle || plist->arg_num < 2) { 198 1.24 kamil continue; /* old style or single args */ 199 1.24 kamil } 200 1.24 kamil 201 1.22 christos if (!did) { 202 1.22 christos cplusplusstart(); 203 1.22 christos did = 1; 204 1.22 christos } 205 1.22 christos pxdrfuncdecl(plist->args.argname, 1); 206 1.22 christos } 207 1.22 christos } 208 1.22 christos if (did) { 209 1.22 christos cplusplusend(); 210 1.22 christos } 211 1.4 pk 212 1.4 pk } 213 1.4 pk 214 1.4 pk 215 1.7 lukem static void 216 1.21 dholland pstructdef(definition *def) 217 1.1 glass { 218 1.1 glass decl_list *l; 219 1.21 dholland const char *name = def->def_name; 220 1.1 glass 221 1.1 glass f_print(fout, "struct %s {\n", name); 222 1.1 glass for (l = def->def.st.decls; l != NULL; l = l->next) { 223 1.4 pk pdeclaration(name, &l->decl, 1, ";\n"); 224 1.1 glass } 225 1.1 glass f_print(fout, "};\n"); 226 1.1 glass f_print(fout, "typedef struct %s %s;\n", name, name); 227 1.1 glass } 228 1.1 glass 229 1.6 christos static void 230 1.21 dholland puniondef(definition *def) 231 1.1 glass { 232 1.1 glass case_list *l; 233 1.21 dholland const char *name = def->def_name; 234 1.1 glass declaration *decl; 235 1.1 glass 236 1.1 glass f_print(fout, "struct %s {\n", name); 237 1.1 glass decl = &def->def.un.enum_decl; 238 1.1 glass if (streq(decl->type, "bool")) { 239 1.1 glass f_print(fout, "\tbool_t %s;\n", decl->name); 240 1.1 glass } else { 241 1.1 glass f_print(fout, "\t%s %s;\n", decl->type, decl->name); 242 1.1 glass } 243 1.1 glass f_print(fout, "\tunion {\n"); 244 1.1 glass for (l = def->def.un.cases; l != NULL; l = l->next) { 245 1.7 lukem if (l->contflag == 0) 246 1.7 lukem pdeclaration(name, &l->case_decl, 2, ";\n"); 247 1.1 glass } 248 1.1 glass decl = def->def.un.default_decl; 249 1.1 glass if (decl && !streq(decl->type, "void")) { 250 1.7 lukem pdeclaration(name, decl, 2, ";\n"); 251 1.1 glass } 252 1.1 glass f_print(fout, "\t} %s_u;\n", name); 253 1.1 glass f_print(fout, "};\n"); 254 1.1 glass f_print(fout, "typedef struct %s %s;\n", name, name); 255 1.1 glass } 256 1.1 glass 257 1.6 christos static void 258 1.21 dholland pdefine(const char *name, const char *num) 259 1.1 glass { 260 1.1 glass f_print(fout, "#define %s %s\n", name, num); 261 1.1 glass } 262 1.1 glass 263 1.6 christos static void 264 1.21 dholland puldefine(const char *name, const char *num) 265 1.1 glass { 266 1.12 fvdl f_print(fout, "#define %s %s\n", name, num); 267 1.1 glass } 268 1.1 glass 269 1.6 christos static int 270 1.21 dholland define_printed(proc_list *stop, version_list *start) 271 1.1 glass { 272 1.1 glass version_list *vers; 273 1.1 glass proc_list *proc; 274 1.1 glass 275 1.1 glass for (vers = start; vers != NULL; vers = vers->next) { 276 1.1 glass for (proc = vers->procs; proc != NULL; proc = proc->next) { 277 1.1 glass if (proc == stop) { 278 1.1 glass return (0); 279 1.7 lukem } else 280 1.7 lukem if (streq(proc->proc_name, stop->proc_name)) { 281 1.7 lukem return (1); 282 1.7 lukem } 283 1.1 glass } 284 1.1 glass } 285 1.23 dholland errx(1, "Internal error at %s:%d: procedure not found", 286 1.6 christos __FILE__, __LINE__); 287 1.1 glass /* NOTREACHED */ 288 1.1 glass } 289 1.1 glass 290 1.6 christos static void 291 1.22 christos cplusplusstart(void) 292 1.22 christos { 293 1.22 christos if (BSDflag) 294 1.22 christos f_print(fout, "__BEGIN_DECLS\n"); 295 1.22 christos else 296 1.22 christos f_print(fout, "#ifdef __cplusplus\nextern \"C\" {\n#endif\n"); 297 1.22 christos } 298 1.22 christos 299 1.22 christos static void 300 1.22 christos cplusplusend(void) 301 1.22 christos { 302 1.22 christos if (BSDflag) 303 1.22 christos f_print(fout, "__END_DECLS\n"); 304 1.22 christos else 305 1.22 christos f_print(fout, "#ifdef __cplusplus\n};\n#endif\n"); 306 1.22 christos } 307 1.22 christos 308 1.22 christos static void 309 1.21 dholland pprogramdef(definition *def) 310 1.1 glass { 311 1.1 glass version_list *vers; 312 1.1 glass proc_list *proc; 313 1.7 lukem 314 1.4 pk pargdef(def); 315 1.1 glass 316 1.1 glass puldefine(def->def_name, def->def.pr.prog_num); 317 1.1 glass for (vers = def->def.pr.versions; vers != NULL; vers = vers->next) { 318 1.4 pk if (tblflag) { 319 1.4 pk f_print(fout, "extern struct rpcgen_table %s_%s_table[];\n", 320 1.7 lukem locase(def->def_name), vers->vers_num); 321 1.4 pk f_print(fout, "extern %s_%s_nproc;\n", 322 1.7 lukem locase(def->def_name), vers->vers_num); 323 1.4 pk } 324 1.1 glass puldefine(vers->vers_name, vers->vers_num); 325 1.22 christos for (proc = vers->procs; proc != NULL; proc = proc->next) { 326 1.22 christos if (!define_printed(proc, def->def.pr.versions)) { 327 1.22 christos puldefine(proc->proc_name, proc->proc_num); 328 1.1 glass } 329 1.22 christos } 330 1.22 christos } 331 1.4 pk 332 1.22 christos /* 333 1.22 christos * Print out 3 definitions, one for ANSI-C, another for C++, a 334 1.22 christos * third for old style C 335 1.22 christos */ 336 1.22 christos f_print(fout, "\n"); 337 1.22 christos cplusplusstart(); 338 1.22 christos for (vers = def->def.pr.versions; vers != NULL; vers = vers->next) { 339 1.22 christos for (proc = vers->procs; proc != NULL; proc = proc->next) { 340 1.22 christos pprocdef(proc, vers, "CLIENT *", 0); 341 1.22 christos pprocdef(proc, vers, "struct svc_req *", 1); 342 1.1 glass } 343 1.1 glass } 344 1.22 christos cplusplusend(); 345 1.1 glass } 346 1.1 glass 347 1.6 christos void 348 1.21 dholland pprocdef(proc_list *proc, version_list *vp, const char *addargtype, 349 1.22 christos int server_p) 350 1.4 pk { 351 1.15 mycroft decl_list *dl; 352 1.4 pk 353 1.15 mycroft if (Mflag) { 354 1.15 mycroft if (server_p) 355 1.15 mycroft f_print(fout, "bool_t "); 356 1.15 mycroft else 357 1.15 mycroft f_print(fout, "enum clnt_stat "); 358 1.15 mycroft } else { 359 1.15 mycroft ptype(proc->res_prefix, proc->res_type, 1); 360 1.15 mycroft f_print(fout, "*"); 361 1.15 mycroft } 362 1.7 lukem if (server_p) 363 1.4 pk pvname_svc(proc->proc_name, vp->vers_num); 364 1.4 pk else 365 1.4 pk pvname(proc->proc_name, vp->vers_num); 366 1.4 pk 367 1.22 christos f_print(fout, "("); 368 1.22 christos if (proc->arg_num < 2 && newstyle && 369 1.22 christos streq(proc->args.decls->decl.type, "void")) { 370 1.22 christos /* 0 argument in new style: do nothing */ 371 1.22 christos } else { 372 1.22 christos for (dl = proc->args.decls; dl != NULL; dl = dl->next) { 373 1.22 christos ptype(dl->decl.prefix, dl->decl.type, 1); 374 1.22 christos if (!newstyle) 375 1.15 mycroft f_print(fout, "*"); 376 1.15 mycroft f_print(fout, ", "); 377 1.15 mycroft } 378 1.15 mycroft } 379 1.22 christos if (Mflag) { 380 1.22 christos if (streq(proc->res_type, "void")) 381 1.22 christos f_print(fout, "char"); 382 1.22 christos else 383 1.22 christos ptype(proc->res_prefix, proc->res_type, 0); 384 1.22 christos if (!isvectordef(proc->res_type, REL_ALIAS)) 385 1.22 christos f_print(fout, "*"); 386 1.22 christos f_print(fout, ", "); 387 1.22 christos } 388 1.22 christos f_print(fout, "%s);\n", addargtype); 389 1.4 pk } 390 1.4 pk 391 1.1 glass 392 1.6 christos static void 393 1.21 dholland penumdef(definition *def) 394 1.1 glass { 395 1.21 dholland const char *name = def->def_name; 396 1.1 glass enumval_list *l; 397 1.21 dholland const char *last = NULL; 398 1.21 dholland int count = 0; 399 1.21 dholland const char *first = ""; 400 1.1 glass 401 1.1 glass f_print(fout, "enum %s {\n", name); 402 1.1 glass for (l = def->def.en.vals; l != NULL; l = l->next) { 403 1.18 christos f_print(fout, "%s\t%s", first, l->name); 404 1.1 glass if (l->assignment) { 405 1.1 glass f_print(fout, " = %s", l->assignment); 406 1.1 glass last = l->assignment; 407 1.1 glass count = 1; 408 1.1 glass } else { 409 1.1 glass if (last == NULL) { 410 1.1 glass f_print(fout, " = %d", count++); 411 1.1 glass } else { 412 1.1 glass f_print(fout, " = %s + %d", last, count++); 413 1.1 glass } 414 1.1 glass } 415 1.18 christos first = ",\n"; 416 1.1 glass } 417 1.18 christos f_print(fout, "\n};\n"); 418 1.1 glass f_print(fout, "typedef enum %s %s;\n", name, name); 419 1.1 glass } 420 1.1 glass 421 1.6 christos static void 422 1.21 dholland ptypedef(definition *def) 423 1.1 glass { 424 1.21 dholland const char *name = def->def_name; 425 1.21 dholland const char *old = def->def.ty.old_type; 426 1.7 lukem char prefix[8]; /* enough to contain "struct ", including NUL */ 427 1.1 glass relation rel = def->def.ty.rel; 428 1.1 glass 429 1.1 glass 430 1.1 glass if (!streq(name, old)) { 431 1.1 glass if (streq(old, "string")) { 432 1.1 glass old = "char"; 433 1.1 glass rel = REL_POINTER; 434 1.7 lukem } else 435 1.7 lukem if (streq(old, "opaque")) { 436 1.7 lukem old = "char"; 437 1.7 lukem } else 438 1.7 lukem if (streq(old, "bool")) { 439 1.7 lukem old = "bool_t"; 440 1.7 lukem } 441 1.1 glass if (undefined2(old, name) && def->def.ty.old_prefix) { 442 1.1 glass s_print(prefix, "%s ", def->def.ty.old_prefix); 443 1.1 glass } else { 444 1.1 glass prefix[0] = 0; 445 1.1 glass } 446 1.1 glass f_print(fout, "typedef "); 447 1.1 glass switch (rel) { 448 1.1 glass case REL_ARRAY: 449 1.1 glass f_print(fout, "struct {\n"); 450 1.25 dholland f_print(fout, "\tunsigned int %s_len;\n", name); 451 1.1 glass f_print(fout, "\t%s%s *%s_val;\n", prefix, old, name); 452 1.1 glass f_print(fout, "} %s", name); 453 1.1 glass break; 454 1.1 glass case REL_POINTER: 455 1.1 glass f_print(fout, "%s%s *%s", prefix, old, name); 456 1.1 glass break; 457 1.1 glass case REL_VECTOR: 458 1.1 glass f_print(fout, "%s%s %s[%s]", prefix, old, name, 459 1.7 lukem def->def.ty.array_max); 460 1.1 glass break; 461 1.1 glass case REL_ALIAS: 462 1.4 pk f_print(fout, "%s%s %s", prefix, old, name); 463 1.1 glass break; 464 1.1 glass } 465 1.1 glass f_print(fout, ";\n"); 466 1.1 glass } 467 1.1 glass } 468 1.1 glass 469 1.6 christos void 470 1.21 dholland pdeclaration(const char *name, declaration *dec, int tab, 471 1.21 dholland const char *separator) 472 1.1 glass { 473 1.7 lukem char buf[8]; /* enough to hold "struct ", include NUL */ 474 1.21 dholland const char *prefix; 475 1.21 dholland const char *type; 476 1.1 glass 477 1.1 glass if (streq(dec->type, "void")) { 478 1.1 glass return; 479 1.1 glass } 480 1.1 glass tabify(fout, tab); 481 1.1 glass if (streq(dec->type, name) && !dec->prefix) { 482 1.1 glass f_print(fout, "struct "); 483 1.1 glass } 484 1.1 glass if (streq(dec->type, "string")) { 485 1.1 glass f_print(fout, "char *%s", dec->name); 486 1.1 glass } else { 487 1.1 glass prefix = ""; 488 1.1 glass if (streq(dec->type, "bool")) { 489 1.1 glass type = "bool_t"; 490 1.7 lukem } else 491 1.7 lukem if (streq(dec->type, "opaque")) { 492 1.7 lukem type = "char"; 493 1.7 lukem } else { 494 1.7 lukem if (dec->prefix) { 495 1.7 lukem s_print(buf, "%s ", dec->prefix); 496 1.7 lukem prefix = buf; 497 1.7 lukem } 498 1.7 lukem type = dec->type; 499 1.1 glass } 500 1.1 glass switch (dec->rel) { 501 1.1 glass case REL_ALIAS: 502 1.1 glass f_print(fout, "%s%s %s", prefix, type, dec->name); 503 1.1 glass break; 504 1.1 glass case REL_VECTOR: 505 1.1 glass f_print(fout, "%s%s %s[%s]", prefix, type, dec->name, 506 1.7 lukem dec->array_max); 507 1.1 glass break; 508 1.1 glass case REL_POINTER: 509 1.1 glass f_print(fout, "%s%s *%s", prefix, type, dec->name); 510 1.1 glass break; 511 1.1 glass case REL_ARRAY: 512 1.1 glass f_print(fout, "struct {\n"); 513 1.1 glass tabify(fout, tab); 514 1.25 dholland f_print(fout, "\tunsigned int %s_len;\n", dec->name); 515 1.1 glass tabify(fout, tab); 516 1.1 glass f_print(fout, "\t%s%s *%s_val;\n", prefix, type, dec->name); 517 1.1 glass tabify(fout, tab); 518 1.1 glass f_print(fout, "} %s", dec->name); 519 1.1 glass break; 520 1.1 glass } 521 1.1 glass } 522 1.14 is f_print(fout, "%s", separator); 523 1.1 glass } 524 1.1 glass 525 1.6 christos static int 526 1.21 dholland undefined2(const char *type, const char *stop) 527 1.1 glass { 528 1.7 lukem list *l; 529 1.1 glass definition *def; 530 1.1 glass 531 1.1 glass for (l = defined; l != NULL; l = l->next) { 532 1.1 glass def = (definition *) l->val; 533 1.1 glass if (def->def_kind != DEF_PROGRAM) { 534 1.1 glass if (streq(def->def_name, stop)) { 535 1.1 glass return (1); 536 1.7 lukem } else 537 1.7 lukem if (streq(def->def_name, type)) { 538 1.7 lukem return (0); 539 1.7 lukem } 540 1.1 glass } 541 1.1 glass } 542 1.1 glass return (1); 543 1.1 glass } 544