]> git.ipfire.org Git - thirdparty/glibc.git/blame - sunrpc/rpc_util.h
elf: Refuse to dlopen PIE objects [BZ #24323]
[thirdparty/glibc.git] / sunrpc / rpc_util.h
CommitLineData
a7ab6ec8
UD
1/* @(#)rpc_util.h 1.5 90/08/29 */
2
28f540f4 3/*
a7ab6ec8
UD
4 * Copyright (c) 2010, Oracle America, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
0d204b0a 8 *
a7ab6ec8
UD
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following
13 * disclaimer in the documentation and/or other materials
14 * provided with the distribution.
15 * * Neither the name of the "Oracle America, Inc." nor the names of its
16 * contributors may be used to endorse or promote products derived
17 * from this software without specific prior written permission.
0d204b0a 18 *
a7ab6ec8
UD
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
26 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0d204b0a 31 *
880f421f 32 * rpc_util.h, Useful definitions for the RPC protocol compiler
28f540f4 33 */
0d204b0a
UD
34
35#include <stdlib.h>
28f540f4
RM
36
37#define alloc(size) malloc((unsigned)(size))
38#define ALLOC(object) (object *) malloc(sizeof(object))
39
28f540f4
RM
40#define s_print (void) sprintf
41#define f_print (void) fprintf
42
43struct list {
0d204b0a 44 definition *val;
28f540f4
RM
45 struct list *next;
46};
47typedef struct list list;
48
880f421f 49struct xdrfunc {
a7ab6ec8
UD
50 char *name;
51 int pointerp;
52 struct xdrfunc *next;
880f421f
UD
53};
54typedef struct xdrfunc xdrfunc;
55
0d204b0a
UD
56#define PUT 1
57#define GET 2
58
28f540f4 59/*
880f421f 60 * Global variables
28f540f4
RM
61 */
62#define MAXLINESIZE 1024
63extern char curline[MAXLINESIZE];
0d204b0a 64extern const char *where;
28f540f4
RM
65extern int linenum;
66
0d204b0a 67extern const char *infilename;
28f540f4
RM
68extern FILE *fout;
69extern FILE *fin;
70
71extern list *defined;
72
0d204b0a
UD
73extern bas_type *typ_list_h;
74extern bas_type *typ_list_t;
880f421f 75extern xdrfunc *xdrfunc_head, *xdrfunc_tail;
0d204b0a 76
28f540f4 77/*
0d204b0a 78 * All the option flags
28f540f4 79 */
0d204b0a 80extern int inetdflag;
880f421f 81extern int pmflag;
0d204b0a
UD
82extern int tblflag;
83extern int logflag;
84extern int newstyle;
880f421f
UD
85extern int Cflag; /* C++ flag */
86extern int CCflag; /* C++ flag */
87extern int tirpcflag; /* flag for generating tirpc code */
0d204b0a 88extern int inlineflag; /* if this is 0, then do not generate inline code */
880f421f 89extern int mtflag;
28f540f4 90
0d204b0a
UD
91/*
92 * Other flags related with inetd jumpstart.
93 */
94extern int indefinitewait;
95extern int exitnow;
96extern int timerflag;
28f540f4 97
0d204b0a 98extern int nonfatalerrors;
28f540f4 99
0d204b0a 100/*
880f421f 101 * rpc_util routines
0d204b0a
UD
102 */
103void storeval(list **lstp, definition *val);
104#define STOREVAL(list,item) storeval(list,item)
105
880f421f 106definition *findval(list *lst, const char *val,
0d204b0a
UD
107 int (*cmp)(const definition *, const char *));
108#define FINDVAL(list,item,finder) findval(list, item, finder)
109
110const char *fixtype(const char *type);
111const char *stringfix(const char *type);
112char *locase(const char *str);
113void pvname_svc(const char *pname, const char *vnum);
114void pvname(const char *pname, const char *vnum);
115void ptype(const char *prefix, const char *type, int follow);
116int isvectordef(const char *type, relation rel);
117int streq(const char *a, const char *b);
118void error(const char *msg);
119void tabify(FILE *f, int tab);
120void record_open(const char *file);
121bas_type *find_type(const char *type);
28f540f4 122
28f540f4
RM
123
124/*
880f421f 125 * rpc_cout routines
28f540f4 126 */
0d204b0a 127void emit(definition *def);
28f540f4
RM
128
129/*
880f421f 130 * rpc_hout routines
28f540f4 131 */
0d204b0a
UD
132void print_datadef(definition *def);
133void print_funcdef(definition *def);
28f540f4
RM
134
135/*
880f421f 136 * rpc_svcout routines
28f540f4 137 */
0d204b0a
UD
138void write_most(const char *infile, int netflag, int nomain);
139void write_register(void);
140void write_rest(void);
141void write_programs(const char *storage);
142void write_svc_aux(int nomain);
143void write_inetd_register(const char *transp);
144void write_netid_register(const char *);
145void write_nettype_register(const char *);
28f540f4
RM
146/*
147 * rpc_clntout routines
148 */
0d204b0a
UD
149void write_stubs(void);
150
151/*
152 * rpc_tblout routines
153 */
154void write_tables(void);