#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
-#ifdef HAVE_STRING_H
#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
#define EXTEND 1 /* alias for TRUE */
struct commandline {
+ int ansic_flag;
int cflag;
int hflag;
int lflag;
int dflag;
int xflag;
int yflag;
+ int uflag;
char *infile;
char *outfile;
};
int nincludes = 0;
char *OutFileFlag = "";
char OutFile[256];
-char Sflag = 0, Cflag = 0, hflag = 0, cflag = 0, kflag = 0;
+char Sflag = 0, Cflag = 0, hflag = 0, cflag = 0, kflag = 0, uflag = 0;
+char ansic_flag = 0; /* If set, build ANSI C style prototypes */
char zflag = 0; /* If set, abort server stub if rpc call returns non-zero */
char xflag = 0; /* if set, add stats code to stubs */
char yflag = 0; /* if set, only emit function name arrays to xdr file */
int debug = 0;
static char *cmdname;
-#ifdef AFS_SUN5_ENV
-static char CPP[] = "/usr/ccs/lib/cpp";
-#elif defined(AFS_XBSD_ENV) || defined(AFS_DARWIN60_ENV)
-static char CPP[] = "/usr/bin/cpp";
-#elif defined(AFS_NT40_ENV)
-static char CPP[MAXCMDLINE];
-#elif defined(AFS_DARWIN_ENV)
-static char CPP[] = "cc -E";
+#ifdef PATH_CPP
+static char CPP[] = PATH_CPP;
#else
static char CPP[] = "/lib/cpp";
#endif
if (!parseargs(argc, argv, &cmd)) {
f_print(stderr, "usage: %s infile\n", cmdname);
f_print(stderr,
- " %s [-c | -h | -l | -m | -C | -S | -r | -k | -R | -p | -d | -z] [-Pprefix] [-Idir] [-o outfile] [infile]\n",
+ " %s [-c | -h | -l | -m | -C | -S | -r | -k | -R | -p | -d | -z | -u] [-Pprefix] [-Idir] [-o outfile] [infile]\n",
cmdname);
f_print(stderr, " %s [-s udp|tcp]* [-o outfile] [infile]\n",
cmdname);
if (xflag) {
f_print(fout, "#include \"rx/rx_globals.h\"\n");
}
+ if (uflag)
+ f_print(fout, "#include <ubik.h>\n");
f_print(fout, "#else /* UKERNEL */\n");
f_print(fout, "#include \"h/types.h\"\n");
f_print(fout, "#ifndef SOCK_DGRAM /* XXXXX */\n");
f_print(fout, "#include \"h/socket.h\"\n");
f_print(fout, "#endif\n");
+ f_print(fout, "struct ubik_client;\n");
f_print(fout, "#ifndef DTYPE_SOCKET /* XXXXX */\n");
- f_print(fout, "#ifdef AFS_DEC_ENV\n");
- f_print(fout, "#include \"h/smp_lock.h\"\n");
- f_print(fout, "#endif\n");
f_print(fout, "#ifndef AFS_LINUX22_ENV\n");
f_print(fout, "#include \"h/file.h\"\n");
f_print(fout, "#endif\n");
f_print(fout, "#include <rx/rx_globals.h>\n");
}
f_print(fout, "#include <afs/rxgen_consts.h>\n");
+ if (uflag)
+ f_print(fout, "#include <ubik.h>\n");
f_print(fout, "#endif /* KERNEL */\n\n");
f_print(fout, "#ifdef AFS_NT40_ENV\n");
f_print(fout, "#ifndef AFS_RXGEN_EXPORT\n");
{
static char max_size[100];
char *pnt;
- int len = strlen(str);
+ int len = (int)strlen(str);
for (pnt = max_size; len > 0; len--, str++) {
*pnt++ = (islower(*str) ? toupper(*str) : *str);
int i;
int j;
char c;
- char flag[(1 << 8 * sizeof(char))];
+ char flag[(1 << (8 * sizeof(char)))];
int nflags;
cmdname = argv[0];
for (j = 1; argv[i][j] != 0; j++) {
c = argv[i][j];
switch (c) {
+ case 'A':
case 'c':
case 'h':
case 'l':
case 'k':
case 'p':
case 'd':
+ case 'u':
case 'x':
case 'y':
case 'z':
;
}
}
+ cmd->ansic_flag = ansic_flag = flag['A'];
cmd->cflag = cflag = flag['c'];
cmd->hflag = hflag = flag['h'];
cmd->sflag = flag['s'];
cmd->Cflag = Cflag = flag['C'];
cmd->Sflag = Sflag = flag['S'];
cmd->rflag = flag['r'];
+ cmd->uflag = uflag = flag['u'];
cmd->kflag = kflag = flag['k'];
cmd->pflag = flag['p'];
cmd->dflag = debug = flag['d'];