version 1.5, 2001/01/21 22:02:52 |
version 1.6, 2001/07/17 02:23:59 |
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
|
#include <ctype.h> |
#include <sys/types.h> |
#include <sys/types.h> |
#ifdef __TURBOC__ |
#ifdef __TURBOC__ |
#define MAXPATHLEN 80 |
#define MAXPATHLEN 80 |
#include <process.h> |
#include <process.h> |
#include <dir.h> |
#include <dir.h> |
#else |
#else |
|
#include <unistd.h> |
#include <sys/param.h> |
#include <sys/param.h> |
#include <sys/file.h> |
#include <sys/file.h> |
#endif |
#endif |
|
|
static char *dos_cppfile = NULL; |
static char *dos_cppfile = NULL; |
#endif |
#endif |
|
|
static c_output __P((char *, char *, int, char *)); |
static char *extendfile __P((char *, char *)); |
static h_output __P((char *, char *, int, char *)); |
static void open_output __P((char *, char *)); |
static s_output __P((int, char **, char *, char *, int, char *, int, int)); |
static void add_warning __P((void)); |
static l_output __P((char *, char *, int, char *)); |
static void clear_args __P((void)); |
static t_output __P((char *, char *, int, char *)); |
static void find_cpp __P((void)); |
static svc_output __P((char *, char *, int, char *)); |
static void open_input __P((char *, char *)); |
static clnt_output __P((char *, char *, int, char *)); |
static int check_nettype __P((char *, char *[])); |
static do_registers __P((int, char **)); |
static void c_output __P((char *, char *, int, char *)); |
|
static void c_initialize __P((void)); |
|
static char *generate_guard __P((char *)); |
|
static void h_output __P((char *, char *, int, char *)); |
|
static void s_output __P((int, char *[], char *, char *, int, char *, int, int)); |
|
static void l_output __P((char *, char *, int, char *)); |
|
static void t_output __P((char *, char *, int, char *)); |
|
static void svc_output __P((char *, char *, int, char *)); |
|
static void clnt_output __P((char *, char *, int, char *)); |
|
static int do_registers __P((int, char *[])); |
static void addarg __P((char *)); |
static void addarg __P((char *)); |
static void putarg __P((int, char *)); |
static void putarg __P((int, char *)); |
static void clear_args __P((void)); |
|
static void checkfiles __P((char *, char *)); |
static void checkfiles __P((char *, char *)); |
static int parseargs __P((int, char **, struct commandline *)); |
static int parseargs __P((int, char *[], struct commandline *)); |
static usage __P((void)); |
static void usage __P((void)); |
static options_usage __P((void)); |
static void options_usage __P((void)); |
|
|
|
int |
|
|
main(argc, argv) |
main(argc, argv) |
int argc; |
int argc; |
char *argv[]; |
char *argv[]; |
|
|
/* |
/* |
* Open output file with given extension |
* Open output file with given extension |
*/ |
*/ |
static |
static void |
open_output(infile, outfile) |
open_output(infile, outfile) |
char *infile; |
char *infile; |
char *outfile; |
char *outfile; |
|
|
|
|
} |
} |
|
|
static |
static void |
add_warning() |
add_warning() |
{ |
{ |
f_print(fout, "/*\n"); |
f_print(fout, "/*\n"); |
|
|
/* |
/* |
* Open input file with given define for C-preprocessor |
* Open input file with given define for C-preprocessor |
*/ |
*/ |
static |
static void |
open_input(infile, define) |
open_input(infile, define) |
char *infile; |
char *infile; |
char *define; |
char *define; |
|
|
* Compile into an XDR routine output file |
* Compile into an XDR routine output file |
*/ |
*/ |
|
|
static |
static void |
c_output(infile, define, extend, outfile) |
c_output(infile, define, extend, outfile) |
char *infile; |
char *infile; |
char *define; |
char *define; |
|
|
} |
} |
|
|
|
|
|
static void |
c_initialize() |
c_initialize() |
{ |
{ |
|
|
|
|
* Compile into an XDR header file |
* Compile into an XDR header file |
*/ |
*/ |
|
|
static |
static void |
h_output(infile, define, extend, outfile) |
h_output(infile, define, extend, outfile) |
char *infile; |
char *infile; |
char *define; |
char *define; |
|
|
/* |
/* |
* Compile into an RPC service |
* Compile into an RPC service |
*/ |
*/ |
static |
static void |
s_output(argc, argv, infile, define, extend, outfile, nomain, netflag) |
s_output(argc, argv, infile, define, extend, outfile, nomain, netflag) |
int argc; |
int argc; |
char *argv[]; |
char *argv[]; |
|
|
/* |
/* |
* generate client side stubs |
* generate client side stubs |
*/ |
*/ |
static |
static void |
l_output(infile, define, extend, outfile) |
l_output(infile, define, extend, outfile) |
char *infile; |
char *infile; |
char *define; |
char *define; |
|
|
/* |
/* |
* generate the dispatch table |
* generate the dispatch table |
*/ |
*/ |
static |
static void |
t_output(infile, define, extend, outfile) |
t_output(infile, define, extend, outfile) |
char *infile; |
char *infile; |
char *define; |
char *define; |
|
|
} |
} |
|
|
/* sample routine for the server template */ |
/* sample routine for the server template */ |
static |
static void |
svc_output(infile, define, extend, outfile) |
svc_output(infile, define, extend, outfile) |
char *infile; |
char *infile; |
char *define; |
char *define; |
|
|
|
|
|
|
/* sample main routine for client */ |
/* sample main routine for client */ |
static |
static void |
clnt_output(infile, define, extend, outfile) |
clnt_output(infile, define, extend, outfile) |
char *infile; |
char *infile; |
char *define; |
char *define; |
|
|
* Perform registrations for service output |
* Perform registrations for service output |
* Return 0 if failed; 1 otherwise. |
* Return 0 if failed; 1 otherwise. |
*/ |
*/ |
static |
static int |
int do_registers(argc, argv) |
do_registers(argc, argv) |
int argc; |
int argc; |
char *argv[]; |
char *argv[]; |
{ |
{ |
|
|
|
|
static void |
static void |
checkfiles(infile, outfile) |
checkfiles(infile, outfile) |
char *infile; |
char *infile; |
char *outfile; |
char *outfile; |
{ |
{ |
|
|
struct stat buf; |
struct stat buf; |
|
|
{ |
{ |
int i; |
int i; |
int j; |
int j; |
char c; |
int c; |
char flag[(1 << 8 * sizeof(char))]; |
char flag[(1 << 8 * sizeof(char))]; |
int nflags; |
int nflags; |
|
|
|
|
return (1); |
return (1); |
} |
} |
|
|
static |
static void |
usage() |
usage() |
{ |
{ |
f_print(stderr, "usage: %s infile\n", cmdname); |
f_print(stderr, "usage: %s infile\n", cmdname); |
|
|
exit(1); |
exit(1); |
} |
} |
|
|
static |
static void |
options_usage() |
options_usage() |
{ |
{ |
f_print(stderr, "options:\n"); |
f_print(stderr, "options:\n"); |