rpc_cout.c (17142) | rpc_cout.c (27935) |
---|---|
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 * --- 16 unchanged lines hidden (view full) --- 25 * Sun Microsystems, Inc. 26 * 2550 Garcia Avenue 27 * Mountain View, California 94043 28 */ 29 30#ident "@(#)rpc_cout.c 1.14 93/07/05 SMI" 31 32#ifndef lint | 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 * --- 16 unchanged lines hidden (view full) --- 25 * Sun Microsystems, Inc. 26 * 2550 Garcia Avenue 27 * Mountain View, California 94043 28 */ 29 30#ident "@(#)rpc_cout.c 1.14 93/07/05 SMI" 31 32#ifndef lint |
33#if 0 |
|
33static char sccsid[] = "@(#)rpc_cout.c 1.13 89/02/22 (C) 1987 SMI"; 34#endif | 34static char sccsid[] = "@(#)rpc_cout.c 1.13 89/02/22 (C) 1987 SMI"; 35#endif |
36static const char rcsid[] = 37 "$Id$"; 38#endif |
|
35 36/* 37 * rpc_cout.c, XDR routine outputter for the RPC protocol compiler 38 * Copyright (C) 1987, Sun Microsystems, Inc. 39 */ | 39 40/* 41 * rpc_cout.c, XDR routine outputter for the RPC protocol compiler 42 * Copyright (C) 1987, Sun Microsystems, Inc. 43 */ |
44#include <err.h> 45#include <ctype.h> |
|
40#include <stdio.h> 41#include <string.h> | 46#include <stdio.h> 47#include <string.h> |
42#include <ctype.h> | |
43#include "rpc_parse.h" 44#include "rpc_util.h" 45 46static void print_header __P(( definition * )); 47static void print_trailer __P(( void )); 48static void print_stat __P(( int , declaration * )); 49static void emit_enum __P(( definition * )); 50static void emit_program __P(( definition * )); --- 397 unchanged lines hidden (view full) --- 448 /* now concatenate to sizestr !!!! */ 449 if (sizestr == NULL) 450 sizestr = strdup(ptemp); 451 else{ 452 sizestr = realloc(sizestr, 453 strlen(sizestr) 454 +strlen(ptemp)+1); 455 if (sizestr == NULL){ | 48#include "rpc_parse.h" 49#include "rpc_util.h" 50 51static void print_header __P(( definition * )); 52static void print_trailer __P(( void )); 53static void print_stat __P(( int , declaration * )); 54static void emit_enum __P(( definition * )); 55static void emit_program __P(( definition * )); --- 397 unchanged lines hidden (view full) --- 453 /* now concatenate to sizestr !!!! */ 454 if (sizestr == NULL) 455 sizestr = strdup(ptemp); 456 else{ 457 sizestr = realloc(sizestr, 458 strlen(sizestr) 459 +strlen(ptemp)+1); 460 if (sizestr == NULL){ |
456 f_print(stderr, 457 "Fatal error : no memory\n"); | 461 warnx("fatal error: no memory"); |
458 crash(); 459 }; 460 sizestr = strcat(sizestr, ptemp); 461 /* build up length of array */ 462 } 463 } 464 } else { 465 if (i > 0) --- 273 unchanged lines hidden (view full) --- 739 740char *upcase(str) 741char *str; 742{ 743 char *ptr, *hptr; 744 745 ptr = (char *)malloc(strlen(str)+1); 746 if (ptr == (char *) NULL) | 462 crash(); 463 }; 464 sizestr = strcat(sizestr, ptemp); 465 /* build up length of array */ 466 } 467 } 468 } else { 469 if (i > 0) --- 273 unchanged lines hidden (view full) --- 743 744char *upcase(str) 745char *str; 746{ 747 char *ptr, *hptr; 748 749 ptr = (char *)malloc(strlen(str)+1); 750 if (ptr == (char *) NULL) |
747 { 748 f_print(stderr, "malloc failed\n"); 749 exit(1); 750 }; | 751 errx(1, "malloc failed"); |
751 752 hptr = ptr; 753 while (*str != '\0') 754 *ptr++ = toupper(*str++); 755 756 *ptr = '\0'; 757 return (hptr); 758} | 752 753 hptr = ptr; 754 while (*str != '\0') 755 *ptr++ = toupper(*str++); 756 757 *ptr = '\0'; 758 return (hptr); 759} |