rpc_main.c (201382) | rpc_main.c (229403) |
---|---|
1/* 2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 3 * unrestricted use provided that this legend is included on all tape 4 * media and as a part of the software program in whole or part. Users 5 * may copy or modify Sun RPC without charge, but are not authorized 6 * to license or distribute it to anyone else except as part of a product or 7 * program developed by the user. 8 * --- 22 unchanged lines hidden (view full) --- 31#if 0 32#ifndef lint 33#ident "@(#)rpc_main.c 1.21 94/04/25 SMI" 34static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI"; 35#endif 36#endif 37 38#include <sys/cdefs.h> | 1/* 2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 3 * unrestricted use provided that this legend is included on all tape 4 * media and as a part of the software program in whole or part. Users 5 * may copy or modify Sun RPC without charge, but are not authorized 6 * to license or distribute it to anyone else except as part of a product or 7 * program developed by the user. 8 * --- 22 unchanged lines hidden (view full) --- 31#if 0 32#ifndef lint 33#ident "@(#)rpc_main.c 1.21 94/04/25 SMI" 34static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI"; 35#endif 36#endif 37 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/usr.bin/rpcgen/rpc_main.c 201382 2010-01-02 10:09:20Z ed $"); | 39__FBSDID("$FreeBSD: head/usr.bin/rpcgen/rpc_main.c 229403 2012-01-03 18:51:58Z ed $"); |
40 41/* 42 * rpc_main.c, Top level of the RPC protocol compiler. 43 * Copyright (C) 1987, Sun Microsystems, Inc. 44 */ 45 46#include <err.h> 47#include <ctype.h> --- 11 unchanged lines hidden (view full) --- 59static void c_output(const char *, const char *, int, const char *); 60static void h_output(const char *, const char *, int, const char *, int); 61static void l_output(const char *, const char *, int, const char *); 62static void t_output(const char *, const char *, int, const char *); 63static void clnt_output(const char *, const char *, int, const char * ); 64static char *generate_guard(const char *); 65static void c_initialize(void); 66 | 40 41/* 42 * rpc_main.c, Top level of the RPC protocol compiler. 43 * Copyright (C) 1987, Sun Microsystems, Inc. 44 */ 45 46#include <err.h> 47#include <ctype.h> --- 11 unchanged lines hidden (view full) --- 59static void c_output(const char *, const char *, int, const char *); 60static void h_output(const char *, const char *, int, const char *, int); 61static void l_output(const char *, const char *, int, const char *); 62static void t_output(const char *, const char *, int, const char *); 63static void clnt_output(const char *, const char *, int, const char * ); 64static char *generate_guard(const char *); 65static void c_initialize(void); 66 |
67#if !defined(__FreeBSD__) && !defined(__NetBSD__) 68char * rindex(); 69#endif 70 | |
71static void usage(void); 72static void options_usage(void); 73static int do_registers(int, const char **); 74static int parseargs(int, const char **, struct commandline *); 75static void svc_output(const char *, const char *, int, const char *); 76static void mkfile_output(struct commandline *); 77static void s_output(int, const char **, const char *, const char *, int, const char *, int, int); 78 --- 149 unchanged lines hidden (view full) --- 228 */ 229static char * 230extendfile(const char *path, const char *ext) 231{ 232 char *res; 233 const char *p; 234 const char *file; 235 | 67static void usage(void); 68static void options_usage(void); 69static int do_registers(int, const char **); 70static int parseargs(int, const char **, struct commandline *); 71static void svc_output(const char *, const char *, int, const char *); 72static void mkfile_output(struct commandline *); 73static void s_output(int, const char **, const char *, const char *, int, const char *, int, int); 74 --- 149 unchanged lines hidden (view full) --- 224 */ 225static char * 226extendfile(const char *path, const char *ext) 227{ 228 char *res; 229 const char *p; 230 const char *file; 231 |
236 if ((file = rindex(path, '/')) == NULL) | 232 if ((file = strrchr(path, '/')) == NULL) |
237 file = path; 238 else 239 file++; 240 res = xmalloc(strlen(file) + strlen(ext) + 1); 241 p = strrchr(file, '.'); 242 if (p == NULL) { 243 p = file + strlen(file); 244 } --- 571 unchanged lines hidden (view full) --- 816 clientname = " "; 817 } 818 servprogname = extendfile(cmd->infile, "_server"); 819 clntprogname = extendfile(cmd->infile, "_client"); 820 821 if (allfiles){ 822 mkftemp = xmalloc(strlen("makefile.") + 823 strlen(cmd->infile) + 1); | 233 file = path; 234 else 235 file++; 236 res = xmalloc(strlen(file) + strlen(ext) + 1); 237 p = strrchr(file, '.'); 238 if (p == NULL) { 239 p = file + strlen(file); 240 } --- 571 unchanged lines hidden (view full) --- 812 clientname = " "; 813 } 814 servprogname = extendfile(cmd->infile, "_server"); 815 clntprogname = extendfile(cmd->infile, "_client"); 816 817 if (allfiles){ 818 mkftemp = xmalloc(strlen("makefile.") + 819 strlen(cmd->infile) + 1); |
824 temp = (char *)rindex(cmd->infile, '.'); | 820 temp = strrchr(cmd->infile, '.'); |
825 strcpy(mkftemp, "makefile."); 826 (void) strncat(mkftemp, cmd->infile, 827 (temp - cmd->infile)); 828 mkfilename = mkftemp; 829 } else 830 mkfilename = cmd->outfile; 831 832 --- 426 unchanged lines hidden --- | 821 strcpy(mkftemp, "makefile."); 822 (void) strncat(mkftemp, cmd->infile, 823 (temp - cmd->infile)); 824 mkfilename = mkftemp; 825 } else 826 mkfilename = cmd->outfile; 827 828 --- 426 unchanged lines hidden --- |