/*
 * 5799-WZQ (C) COPYRIGHT = NONE
 * LICENSED MATERIALS - PROPERTY OF IBM
 */
/* $Header:rpc_util.h 12.0$ */
/* $ACIS:rpc_util.h 12.0$ */
/* $Source: /ibm/acis/usr/src/nfs/usr.bin/rpcgen/RCS/rpc_util.h,v $ */

#if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
static char *rcsidrpc_util = "$Header:rpc_util.h 12.0$";
#endif

#include <sys/nfs_defines.h>

/* 87/07/27 @(#)rpc_util.h	1.1 3.2/4.3 NFSSRC */

/*
 * rpc_util.h, Useful definitions for the RPC protocol compiler
 * Copyright (C) 1986, Sun Microsystems, Inc.
 */

extern char *malloc();
extern char *sprintf();
#define alloc(size)		malloc((unsigned)(size))
#define ALLOC(object)   (object *) malloc(sizeof(object)) 

#define OFF 0
#define ON 1

struct list {
	char *val;
	struct list *next;
};
typedef struct list list;

/*
 * Global variables
 */
#define MAXLINESIZE 1024
extern char curline[MAXLINESIZE];
extern char *where;
extern int linenum;

extern char *outfile;
extern char *outfile2;
extern char *infile;
extern FILE *fout;
extern FILE *fin;

extern list *printed;
extern list *defined;


/*
 * rpc_util routines
 */
void storeval();
#define STOREVAL(list,item)	\
	storeval(list,(char *)item)

char *findval();
#define FINDVAL(list,item,finder) \
	findval(list, (char *) item, finder)

int streq();
void error();
void expected1();
void expected2();
void expected3();

/*
 * rpc_cout routines
 */
void cprint();
void emit();

/*
 * rpc_hout routines
 */
void print_datadef();
void print_funcdefs();

/*
 * rpc_svcout routines
 */
void write_most();
void write_register();
void write_rest();

