Deleted Added
full compact
1d0
< /* @(#)rpc_util.c 2.1 88/08/01 4.0 RPCSRC */
9c8
< *
---
> *
13c12
< *
---
> *
17c16
< *
---
> *
21c20
< *
---
> *
25c24
< *
---
> *
29a29,31
>
> #ident "@(#)rpc_util.c 1.14 93/07/05 SMI"
>
31,32c33
< /*static char sccsid[] = "from: @(#)rpc_util.c 1.5 87/06/24 (C) 1987 SMI";*/
< static char rcsid[] = "$Id: rpc_util.c,v 1.1 1994/08/07 18:01:37 wollman Exp $";
---
> static char sccsid[] = "@(#)rpc_util.c 1.11 89/02/22 (C) 1987 SMI";
37c38
< * Copyright (C) 1987, Sun Microsystems, Inc.
---
> * Copyright (C) 1989, Sun Microsystems, Inc.
39a41
> #include <ctype.h>
43a46,47
> #define ARGEXT "argument"
>
45,46c49,50
< char *where = curline; /* current point in line */
< int linenum = 0; /* current line number */
---
> char *where = curline; /* current point in line */
> int linenum = 0; /* current line number */
48c52
< char *infilename; /* input filename */
---
> char *infilename; /* input filename */
50,51c54,55
< #define NFILES 4
< char *outfiles[NFILES]; /* output file names */
---
> #define NFILES 7
> char *outfiles[NFILES]; /* output file names */
54,55c58,59
< FILE *fout; /* file pointer of current output */
< FILE *fin; /* file pointer of current input */
---
> FILE *fout; /* file pointer of current output */
> FILE *fin; /* file pointer of current input */
57c61
< list *defined; /* list of defined things */
---
> list *defined; /* list of defined things */
59c63
< static int printwhere();
---
> static int printwhere __P(( void ));
66c70
< bzero(curline, MAXLINESIZE);
---
> memset(curline, 0, MAXLINESIZE);
85c89
< char *
---
> definition *
106c110
< char *val;
---
> definition *val;
118d121
<
127d129
<
141c143,147
< return (def->def.ty.old_type);
---
> if (streq(def->def.ty.old_type, "opaque"))
> return ("char");
> else
> return (def->def.ty.old_type);
>
189d194
<
227,228c232
<
< static char *
---
> char *
242a247,253
> void
> pvname_svc(pname, vnum)
> char *pname;
> char *vnum;
> {
> f_print(fout, "%s_%s_svc", locase(pname), vnum);
> }
252d262
<
280d289
<
346d354
<
348,381c356,389
< {TOK_IDENT, "identifier"},
< {TOK_CONST, "const"},
< {TOK_RPAREN, ")"},
< {TOK_LPAREN, "("},
< {TOK_RBRACE, "}"},
< {TOK_LBRACE, "{"},
< {TOK_LBRACKET, "["},
< {TOK_RBRACKET, "]"},
< {TOK_STAR, "*"},
< {TOK_COMMA, ","},
< {TOK_EQUAL, "="},
< {TOK_COLON, ":"},
< {TOK_SEMICOLON, ";"},
< {TOK_UNION, "union"},
< {TOK_STRUCT, "struct"},
< {TOK_SWITCH, "switch"},
< {TOK_CASE, "case"},
< {TOK_DEFAULT, "default"},
< {TOK_ENUM, "enum"},
< {TOK_TYPEDEF, "typedef"},
< {TOK_INT, "int"},
< {TOK_SHORT, "short"},
< {TOK_LONG, "long"},
< {TOK_UNSIGNED, "unsigned"},
< {TOK_DOUBLE, "double"},
< {TOK_FLOAT, "float"},
< {TOK_CHAR, "char"},
< {TOK_STRING, "string"},
< {TOK_OPAQUE, "opaque"},
< {TOK_BOOL, "bool"},
< {TOK_VOID, "void"},
< {TOK_PROGRAM, "program"},
< {TOK_VERSION, "version"},
< {TOK_EOF, "??????"}
---
> {TOK_IDENT, "identifier"},
> {TOK_CONST, "const"},
> {TOK_RPAREN, ")"},
> {TOK_LPAREN, "("},
> {TOK_RBRACE, "}"},
> {TOK_LBRACE, "{"},
> {TOK_LBRACKET, "["},
> {TOK_RBRACKET, "]"},
> {TOK_STAR, "*"},
> {TOK_COMMA, ","},
> {TOK_EQUAL, "="},
> {TOK_COLON, ":"},
> {TOK_SEMICOLON, ";"},
> {TOK_UNION, "union"},
> {TOK_STRUCT, "struct"},
> {TOK_SWITCH, "switch"},
> {TOK_CASE, "case"},
> {TOK_DEFAULT, "default"},
> {TOK_ENUM, "enum"},
> {TOK_TYPEDEF, "typedef"},
> {TOK_INT, "int"},
> {TOK_SHORT, "short"},
> {TOK_LONG, "long"},
> {TOK_UNSIGNED, "unsigned"},
> {TOK_DOUBLE, "double"},
> {TOK_FLOAT, "float"},
> {TOK_CHAR, "char"},
> {TOK_STRING, "string"},
> {TOK_OPAQUE, "opaque"},
> {TOK_BOOL, "bool"},
> {TOK_VOID, "void"},
> {TOK_PROGRAM, "program"},
> {TOK_VERSION, "version"},
> {TOK_EOF, "??????"}
394,395d401
<
<
418d423
<
439a445,508
>
> char *
> make_argname(pname, vname)
> char *pname;
> char *vname;
> {
> char *name;
>
> name = malloc(strlen(pname) + strlen(vname) + strlen(ARGEXT) + 3);
> if (!name) {
> fprintf(stderr, "failed in malloc");
> exit(1);
> }
> sprintf(name, "%s_%s_%s", locase(pname), vname, ARGEXT);
> return (name);
> }
>
> bas_type *typ_list_h;
> bas_type *typ_list_t;
>
> add_type(len, type)
> int len;
> char *type;
> {
> bas_type *ptr;
>
> if ((ptr = (bas_type *) malloc(sizeof (bas_type))) ==
> (bas_type *)NULL) {
> fprintf(stderr, "failed in malloc");
> exit(1);
> }
>
> ptr->name = type;
> ptr->length = len;
> ptr->next = NULL;
> if (typ_list_t == NULL)
> {
>
> typ_list_t = ptr;
> typ_list_h = ptr;
> }
> else
> {
> typ_list_t->next = ptr;
> typ_list_t = ptr;
> };
> }
>
>
> bas_type *find_type(type)
> char *type;
> {
> bas_type * ptr;
>
> ptr = typ_list_h;
> while (ptr != NULL)
> {
> if (strcmp(ptr->name, type) == 0)
> return (ptr);
> else
> ptr = ptr->next;
> };
> return (NULL);
> }