Upgrade to today's gnulib.

This commit is contained in:
Paul Eggert
2003-06-16 19:41:07 +00:00
parent 671881d12d
commit e9665d1605
13 changed files with 53 additions and 37 deletions

View File

@@ -1,5 +1,5 @@
/* dirname.c -- return all but the last element in a path
Copyright 1990, 1998, 2000, 2001 Free Software Foundation, Inc.
Copyright 1990, 1998, 2000, 2001, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -67,9 +67,13 @@ dir_name (char const *path)
Run the test like this (expect no output):
gcc -DHAVE_CONFIG_H -DTEST_DIRNAME -I.. -O -Wall \
basename.c dirname.c xmalloc.c
basename.c dirname.c xmalloc.c error.c
sed -n '/^BEGIN-DATA$/,/^END-DATA$/p' dirname.c|grep -v DATA|./a.out
If it's been built on a DOS or Windows platforms, run another test like
this (again, expect no output):
sed -n '/^BEGIN-DOS-DATA$/,/^END-DOS-DATA$/p' dirname.c|grep -v DATA|./a.out
BEGIN-DATA
foo//// .
bar/foo//// bar
@@ -79,16 +83,28 @@ foo/ .
a .
END-DATA
BEGIN-DOS-DATA
c:///// c:/
c:/ c:/
c:/. c:/
c:foo c:.
c:foo/bar c:foo
END-DOS-DATA
*/
# define MAX_BUFF_LEN 1024
# include <stdio.h>
char *program_name;
int
main ()
main (int argc, char *argv[])
{
char buff[MAX_BUFF_LEN + 1];
program_name = argv[0];
buff[MAX_BUFF_LEN] = 0;
while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0])
{

View File

@@ -17,6 +17,8 @@
#ifndef DIRNAME_H_
# define DIRNAME_H_ 1
# include <stddef.h>
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args

View File

@@ -31,6 +31,7 @@
# include <stdlib.h>
#endif
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
@@ -403,9 +404,6 @@ hash_do_for_each (const Hash_table *table, Hash_processor processor,
unsigned
hash_string (const char *string, unsigned n_buckets)
{
# ifndef CHAR_BIT
# define CHAR_BIT 8
# endif
# define ROTATE_LEFT(Value, Shift) \
((Value) << (Shift) | (Value) >> ((sizeof (unsigned) * CHAR_BIT) - (Shift)))
# define HASH_ONE_CHAR(Value, Byte) \

View File

@@ -24,6 +24,8 @@
#ifndef HASH_H_
# define HASH_H_
# include <stdio.h>
# ifndef PARAMS
# if PROTOTYPES || __STDC__
# define PARAMS(Args) Args

View File

@@ -22,7 +22,7 @@
#endif
#undef malloc
#include <sys/types.h>
#include <stddef.h>
char *malloc ();

View File

@@ -372,12 +372,12 @@ extern int obstack_exit_failure;
# define obstack_object_size(OBSTACK) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
({ struct obstack const *__o = (OBSTACK); \
(unsigned) (__o->next_free - __o->object_base); })
# define obstack_room(OBSTACK) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
({ struct obstack const *__o = (OBSTACK); \
(unsigned) (__o->chunk_limit - __o->next_free); })
# define obstack_make_room(OBSTACK,length) \
@@ -390,7 +390,7 @@ __extension__ \
# define obstack_empty_p(OBSTACK) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
({ struct obstack const *__o = (OBSTACK); \
(__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
# define obstack_grow(OBSTACK,where,length) \

View File

@@ -1,5 +1,5 @@
/* quote.c - quote arguments for output
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,23 +21,19 @@
# include <config.h>
#endif
#if HAVE_STDDEF_H
# include <stddef.h> /* For the definition of size_t on windows w/MSVC. */
#endif
#include <sys/types.h>
#include "quotearg.h"
#include "quote.h"
/* Return an unambiguous printable representated, allocated in slot N,
for NAME, suitable for diagnostics. */
/* Return an unambiguous printable representation of NAME,
allocated in slot N, suitable for diagnostics. */
char const *
quote_n (int n, char const *name)
{
return quotearg_n_style (n, locale_quoting_style, name);
}
/* Return an unambiguous printable representation of NAME, suitable
for diagnostics. */
/* Return an unambiguous printable representation of NAME,
suitable for diagnostics. */
char const *
quote (char const *name)
{

View File

@@ -22,7 +22,7 @@
#endif
#undef realloc
#include <sys/types.h>
#include <stddef.h>
char *malloc ();
char *realloc ();

View File

@@ -29,7 +29,7 @@
# define LENGTH_LIMIT_EXPR(Expr) 0
#endif
#include <sys/types.h>
#include <stddef.h>
#include <ctype.h>
#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))

View File

@@ -18,6 +18,8 @@
#ifndef XALLOC_H_
# define XALLOC_H_
# include <stddef.h>
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args