/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
#include <errno.h>
#include <stdio.h>
main(argc, argv)
char **argv;
{
- register add, del, opts;
- register c;
+ int add, del, opts;
+ int c;
char *file;
mid_t kmid;
struct cfg_load cload;
#ifdef AFS_AIX32_ENV
/*
- * The following signal action for AIX is necessary so that in case of a
- * crash (i.e. core is generated) we can include the user's data section
+ * The following signal action for AIX is necessary so that in case of a
+ * crash (i.e. core is generated) we can include the user's data section
* in the core dump. Unfortunately, by default, only a partial core is
* generated which, in many cases, isn't too useful.
*/
if (syms == NULL)
sys_error("syms is NULL");
- fp = fopen(syms, "r");
+ fp = fopen(syms, "r");
if (fp == NULL)
sys_error(syms);
if (debug)
printf("nsyms = %d\n", nsyms);
- x_symtab = (struct syment *)malloc(nsyms * SYMESZ);
+ x_symtab = malloc(nsyms * SYMESZ);
if (!x_symtab)
error("no memory for symbol table");
/*
* we will need no more than `nxsyms' symbols.
*/
- k_symtab = (sym_t *) malloc(nxsyms * sizeof(sym_t));
+ k_symtab = malloc(nxsyms * sizeof(sym_t));
if (!k_symtab)
error("no memory for EXPORT symbol table");
* strp - ^ to ^ to EXPORT string table
* szp - ^ to EXPORT string table size
*/
-#define SYMBUFSIZE 262144
+#define SYMBUFSIZE 1048576
xlate_xtok(xp, kp, strp, szp)
- register struct syment *xp;
- register sym_t *kp;
+ struct syment *xp;
+ sym_t *kp;
char **strp;
uint *szp;
{
- register len;
+ int len;
static char *export_strings = NULL, *prev = "";
static left, offset, sz;
*/
len = strlen(xstrings + xp->n_offset) + 1;
while (len >= left) {
+ fprintf(stderr, "cfgexport: Out of memory. Increase SYMBUFSIZE and recompile\n");
+ exit(1);
+#if 0
+ /* Something is broken with this code, after being here
+ cfgexport segfaults */
export_strings = (char *)realloc(*strp, sz += SYMBUFSIZE);
if (!export_strings)
error("no memory for EXPORT string table");
*strp = export_strings;
left += SYMBUFSIZE;
prev = ""; /* lazy */
+#endif
}
strcpy(prev = *strp + offset, xstrings + xp->n_offset);
*/
len = strlen(xp->n_nptr) + 1;
while (len >= left) {
- export_strings = (char *)realloc(*strp, sz += SYMBUFSIZE);
+ export_strings = realloc(*strp, sz += SYMBUFSIZE);
if (!export_strings)
error("no memory for EXPORT string table");
*strp = export_strings;
if (debug)
dump_ksym(kp, *strp);
}
-\f
+
/*
* find_suffix - look for a string that arg string is suffix of
*
* This is rather inefficient.
*/
find_suffix(p, strings, max, offp)
- register char *p, *strings;
+ char *p, *strings;
uint *offp;
{
- register char *q, *e;
- register len = strlen(p) - 1;
+ char *q, *e;
+ int len = strlen(p) - 1;
strings += sizeof(uint);
max -= sizeof(uint);
return 0;
}
-\f
+
/*
* xsym_compar - compare two XCOFF symbol table entries
*
* C_EXT < C_HIDEXT;
*/
xsym_compar(xp, xq)
- register struct syment *xp, *xq;
+ struct syment *xp, *xq;
{
- register char *p, *q;
- register compar;
+ char *p, *q;
+ int compar;
#ifndef __XCOFF64__
p = (xp->n_zeroes ? xp->n_name : xp->n_nptr);
return compar;
}
-\f
+
/*
* dump_xsym - print to XCOFF symbol
*/