/* strdup() that fails fatally on allocation failures. */
extern char *xstrdup(const char *);
-/* Returns a dynamically allocated copy of a (potentially) unsigned string. */
-extern unsigned char *copy_unsigned_string PROTO ((unsigned char *));
-
/* Compare two characters for use by qsort with '\0' sorting last. */
extern int cclcmp PROTO ((const void *, const void *));
}
-/* copy_unsigned_string -
- * returns a dynamically allocated copy of a (potentially) unsigned string
- */
-
-unsigned char *copy_unsigned_string (unsigned char *str)
-{
- unsigned char *c;
- unsigned char *copy;
-
- /* find length */
- for (c = str; *c; ++c) ;
-
- copy = allocate_Character_array (c - str + 1);
-
- for (c = copy; (*c++ = *str++) != 0;) ;
-
- return copy;
-}
-
-
/* cclcmp - compares two characters for use by qsort with '\0' sorting last. */
int cclcmp (const void *a, const void *b)
* called unless the symbol is new.
*/
- (void) addsym ((char *) copy_unsigned_string (ccltxt),
+ (void) addsym (xstrdup(ccltxt),
(char *) 0, cclnum, ccltab, CCL_HASH_SIZE);
}
{
if (addsym (xstrdup(name),
- (char *) copy_unsigned_string (definition), 0,
+ xstrdup(definition), 0,
ndtbl, NAME_TABLE_HASH_SIZE))
synerr (_("name defined twice"));
}
/* Replace upper-case letter to lower-case. */
extern Char clower PROTO((int));
-/* Returns a dynamically allocated copy of a (potentially) unsigned string. */
-extern Char *copy_unsigned_string PROTO((register Char *));
-
/* Shell sort a character array. */
extern void cshell PROTO((wchar_t[], int, int));
}
-/* copy_unsigned_string -
- * returns a dynamically allocated copy of a (potentially) unsigned string
- */
-
-Char *copy_unsigned_string( str )
-register Char *str;
- {
- register Char *c;
- Char *copy;
-
- /* find length */
- for ( c = str; *c; ++c )
- ;
-
- copy = allocate_Character_array( c - str + 1 );
-
- for ( c = copy; (*c++ = *str++) != 0; )
- ;
-
- return copy;
- }
-
-
/* cshell - shell sort a character array in increasing order
*
* synopsis