+2002-11-13 Bruno Haible <bruno@clisp.org>
+
+ Assume ANSI C.
+ * configure.in: Remove AC_C_BACKSLASH_A call.
+ * os2/configure.awk: Remove HAVE_C_BACKSLASH_A setting.
+
2002-11-07 Bruno Haible <bruno@clisp.org>
* ltmain.sh: Upgrade to libtool-1.4.3.
AC_C_CONST
AC_C_INLINE
bh_C_SIGNED
-AC_C_BACKSLASH_A
jm_AC_TYPE_UNSIGNED_LONG_LONG
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
+2002-11-13 Bruno Haible <bruno@clisp.org>
+
+ Assume ANSI C.
+ * libstdarg.h: Remove file.
+ * Makefile.am (LIBADD_SOURCE): Remove libstdarg.h.
+ * addext.c (addext): Use ANSI C function declarations.
+ * alloca.c (alloca): Likewise.
+ * argmatch.h (PARAMS): Remove macro.
+ (argmatch, argmatch_exit_fn, argmatch_invalid, argmatch_valid,
+ __xargmatch_internal, argmatch_to_argument): Use ANSI C function
+ declarations.
+ * argmatch.c (argmatch, argmatch_invalid, argmatch_valid,
+ __xargmatch_internal, argmatch_to_argument): Likewise.
+ * backupfile.h (PARAMS): Remove macro.
+ (find_backup_file_name, get_version, xget_version, addext): Use ANSI C
+ function declarations.
+ * backupfile.c (find_backup_file_name, max_backup_version,
+ version_number, get_version, xget_version): Likewise.
+ * basename.h (gnu_basename): Likewise.
+ * basename.c (basename): Likewise.
+ * c-ctype.h (PARAMS): Remove macro.
+ (c_isascii, c_isalnum, c_isalpha, c_isblank, c_iscntrl, c_isdigit,
+ c_islower, c_isgraph, c_isprint, c_ispunct, c_isspace, c_isupper,
+ c_isxdigit, c_tolower, c_toupper): Use ANSI C function declarations.
+ * c-ctype.c (c_isascii, c_isalnum, c_isalpha, c_isblank, c_iscntrl,
+ c_isdigit, c_islower, c_isgraph, c_isprint, c_ispunct, c_isspace,
+ c_isupper, c_isxdigit, c_tolower, c_toupper): Likewise.
+ * classpath.c (new_classpath, set_classpath, reset_classpath):
+ Likewise.
+ * concatpath.c (concatenated_pathname): Likewise.
+ * copy-file.h (copy_file): Likewise.
+ * copy-file.c (copy_file): Likewise.
+ * execute.h (execute): Likewise.
+ * execute.c (nonintr_close, nonintr_open, execute): Likewise.
+ * findprog.h (find_in_path): Likewise.
+ * findprog.c (find_in_path): Likewise.
+ * fstrcmp.h (fstrcmp): Likewise.
+ * fstrcmp.c (diag, compareseq, fstrcmp): Likewise.
+ * full-write.h (full_write): Likewise.
+ * full-write.c (full_write): Likewise.
+ * gcd.h (PARAMS): Remove macro.
+ (gcd): Use ANSI C function declarations.
+ * gcd.c (gcd): Likewise.
+ * getline.h (PARAMS): Remove macro.
+ (getline, getdelim): Use ANSI C function declarations.
+ * getline.c (getstr, getline, getdelim): Likewise.
+ * hash.h (PARAMS): Remove macro.
+ (init_hash, delete_hash, insert_entry, find_entry, iterate_table,
+ next_prime): Use ANSI C function declarations.
+ * hash.c (init_hash, delete_hash, insert_entry, insert_entry_2,
+ find_entry, iterate_table, lookup, compute_hashval, next_prime,
+ is_prime): Likewise.
+ * javacomp.h (compile_java_class): Likewise.
+ * javacomp.c (compile_java_class): Likewise.
+ * javaexec.h (execute_fn, execute_java_class): Likewise.
+ * javaexec.c (execute_java_class): Likewise.
+ * linebreak.h (PARAMS): Remove macro.
+ (locale_charset, uc_width, u8_width, u16_width, u32_width,
+ u8_possible_linebreaks, u16_possible_linebreaks,
+ u32_possible_linebreaks, mbs_possible_linebreaks, u8_width_linebreaks,
+ u16_width_linebreaks, u32_width_linebreaks, mbs_width_linebreaks): Use
+ ANSI C function declarations.
+ * linebreak.c (u32_mbtouc, is_cjk_encoding, is_utf8_encoding,
+ uc_width, u8_width, u16_width, u32_width, lbrkprop_lookup,
+ u8_possible_linebreaks, u16_possible_linebreaks,
+ u32_possible_linebreaks, u8_width_linebreaks, u16_width_linebreaks,
+ u32_width_linebreaks, read_file, main, iconv_string_length,
+ iconv_string_keeping_offsets, is_all_ascii, mbs_possible_linebreaks,
+ mbs_width_linebreaks, read_file, main): Likewise.
+ * mbswidth.h (PARAMS): Remove macro.
+ (mbswidth, mbsnwidth): Use ANSI C function declarations.
+ * mbswidth.c (mbswidth, mbsnwidth): Likewise.
+ * memmove.c (memmove): Likewise.
+ * memset.c (memset): Likewise.
+ * mkdtemp.h (PARAMS): Remove macro.
+ (mkdtemp): Use ANSI C function declarations.
+ * mkdtemp.c (gen_tempname, mkdtemp): Likewise.
+ * pathname.h (PARAMS): Remove macro.
+ (concatenated_pathname): Use ANSI C function declarations.
+ * pfnmatch.h (PARAMS): Remove macro.
+ (fnmatch): Use ANSI C function declarations.
+ * pfnmatch.c (fnmatch): Likewise.
+ * pipe.h (create_pipe_out, create_pipe_in, create_pipe_bidi):
+ Likewise.
+ * pipe-bidi.c (nonintr_close, create_pipe_bidi): Likewise.
+ * pipe-in.c (nonintr_close, nonintr_open, create_pipe_in): Likewise.
+ * pipe-out.c (nonintr_close, nonintr_open, create_pipe_out): Likewise.
+ * progname.h (set_program_name, maybe_print_progname): Likewise.
+ * progname.c (set_program_name): Likewise.
+ * safe-read.h (safe_read): Likewise.
+ * safe-read.c (safe_read): Likewise.
+ * setenv.h (PARAMS): Remove macro.
+ (setenv, unsetenv): Use ANSI C function declarations.
+ * setenv.c (compar_fn_t, __add_to_environ, setenv): Likewise.
+ * sh-quote.h (shell_quote_length, shell_quote_copy, shell_quote,
+ shell_quote_argv): Likewise.
+ * sh-quote.c (shell_quote_length, shell_quote_copy, shell_quote,
+ shell_quote_argv): Likewise.
+ * stpcpy.h (PARAMS): Remove macro.
+ (stpcpy): Use ANSI C function declarations.
+ * stpcpy.c (__stpcpy): Likewise.
+ * stpncpy.h (PARAMS): Remove macro.
+ (gnu_stpncpy): Use ANSI C function declarations.
+ * stpncpy.c (__stpncpy): Likewise.
+ * strcase.h (PARAMS): Remove macro.
+ (strcasecmp, strncasecmp): Use ANSI C function declarations.
+ * strcasecmp.c (__strcasecmp): Likewise.
+ * strncasecmp.c (__strncasecmp): Likewise.
+ * strcspn.c (strcspn): Likewise.
+ * strpbrk.h (PARAMS): Remove macro.
+ (strpbrk): Use ANSI C function declarations.
+ * strpbrk.c (strpbrk): Likewise.
+ * strstr.h (PARAMS): Remove macro.
+ (strstr): Use ANSI C function declarations.
+ * strstr.c (strstr): Likewise.
+ * tmpdir.h (PARAMS): Remove macro.
+ (path_search): Use ANSI C function declarations.
+ * tmpdir.c (direxists, path_search): Likewise.
+ * ucs4-utf8.h (u8_uctomb_aux, u8_uctomb): Likewise.
+ * ucs4-utf16.h (u16_uctomb_aux, u16_uctomb): Likewise.
+ * unsetenv.c (unsetenv): Likewise.
+ * utf8-ucs4.h (u8_mbtouc_aux, u8_mbtouc): Likewise.
+ * utf16-ucs4.h (u16_mbtouc_aux, u16_mbtouc): Likewise.
+ * vasprintf.h (PARAMS): Remove macro.
+ Include <stdarg.h> instead of libstdarg.h.
+ (asprintf, vasprintf): Use ANSI C function declarations.
+ * vasprintf.c: Include <stdarg.h> instead of libstdarg.h.
+ (int_vasprintf, asprintf, checkit): Use ANSI C function declarations.
+ Use va_start instead of VA_START.
+ * wait-process.h (wait_subprocess): Likewise.
+ * wait-process.c (wait_subprocess): Likewise.
+ * xerror.h (xasprintf, multiline_warning, multiline_error): Likewise.
+ * xerror.c: Include <stdarg.h> instead of libstdarg.h.
+ (xasprintf, multiline_warning, multiline_error): Use ANSI C function
+ declarations. Use va_start instead of VA_START.
+ * xgetcwd.h (PARAMS): Remove macro.
+ (xgetcwd): Use ANSI C function declarations.
+ * xmalloc.h (xmalloc, xcalloc, xrealloc, xstrdup): Likewise.
+ * xmalloc.c (fixup_null_alloc, xmalloc, xcalloc, xrealloc): Likewise.
+ * xsetenv.h (xsetenv): Likewise.
+ * xsetenv.c (xsetenv): Likewise.
+ * xstrdup.c (xstrdup): Likewise.
+
2002-11-05 Bruno Haible <bruno@clisp.org>
* argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
mkdtemp.h mkdtemp.c \
pfnmatch.h pfnmatch.c \
setenv.h setenv.c unsetenv.c \
- libstdarg.h \
stpcpy.h stpcpy.c \
strcase.h strcasecmp.c strncasecmp.c \
strcspn.c \
/* addext.c -- add an extension to a file name
- Copyright (C) 1990, 1997-1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1997-1999, 2001-2002 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
in which case just append the character E. */
void
-addext (filename, ext, e)
- char *filename;
- char const *ext;
- int e;
+addext (char *filename, char const *ext, char e)
{
char *s = basename (filename);
size_t slen = strlen (s), extlen = strlen (ext);
pointer
#ifdef EMACS_WANTS_C_ALLOCA
-c_alloca (size)
+c_alloca (unsigned size)
#else
-alloca (size)
+alloca (unsigned size)
#endif
- unsigned size;
{
auto char probe; /* Probes stack depth: */
register char *depth = ADDRESS_FUNCTION (probe);
#endif
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void __argmatch_die PARAMS ((void));
-
-
static void
__argmatch_die ()
{
"y" is a valid argument, for `0', and "n" for `1'. */
int
-argmatch (arg, arglist, vallist, valsize)
- const char *arg;
- const char *const *arglist;
- const char *vallist;
- size_t valsize;
+argmatch (const char *arg, const char *const *arglist,
+ const char *vallist, size_t valsize)
{
int i; /* Temporary index in ARGLIST. */
size_t arglen; /* Length of ARG. */
PROBLEM is the return value from argmatch. */
void
-argmatch_invalid (context, value, problem)
- const char *context;
- const char *value;
- int problem;
+argmatch_invalid (const char *context, const char *value, int problem)
{
char const *format = (problem == -1
? _("invalid argument `%s' for `%s'")
VALLIST is a pointer to an array of values.
VALSIZE is the size of the elements of VALLIST */
void
-argmatch_valid (arglist, vallist, valsize)
- const char *const *arglist;
- const char *vallist;
- size_t valsize;
+argmatch_valid (const char *const *arglist,
+ const char *vallist, size_t valsize)
{
int i;
const char *last_val = NULL;
calls the (supposed never to return) function EXIT_FN. */
int
-__xargmatch_internal (context, arg, arglist, vallist, valsize, exit_fn)
- const char *context;
- const char *arg;
- const char *const *arglist;
- const char *vallist;
- size_t valsize;
- argmatch_exit_fn exit_fn;
+__xargmatch_internal (const char *context,
+ const char *arg, const char *const *arglist,
+ const char *vallist, size_t valsize,
+ argmatch_exit_fn exit_fn)
{
int res = argmatch (arg, arglist, vallist, valsize);
if (res >= 0)
/* Look for VALUE in VALLIST, an array of objects of size VALSIZE and
return the first corresponding argument in ARGLIST */
const char *
-argmatch_to_argument (value, arglist, vallist, valsize)
- const char *value;
- const char *const *arglist;
- const char *vallist;
- size_t valsize;
+argmatch_to_argument (const char *value,
+ const char *const *arglist,
+ const char *vallist, size_t valsize)
{
int i;
/* argmatch.h -- definitions and prototypes for argmatch.c
- Copyright (C) 1990, 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1998, 1999, 2001, 2002 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
# include <sys/types.h>
-# ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif /* ANSI C. */
-# endif /* Not PARAMS. */
-
/* Assert there are as many real arguments as there are values
(argument list ends with a NULL guard). There is no execution
cost, since it will be statically evalauted to `assert (0)' or
false ambiguities (i.e., different matches of ARG but corresponding
to the same values in VALLIST). */
-int argmatch
- PARAMS ((const char *arg, const char *const *arglist,
- const char *vallist, size_t valsize));
+int argmatch (const char *arg, const char *const *arglist,
+ const char *vallist, size_t valsize);
# define ARGMATCH(Arg, Arglist, Vallist) \
argmatch ((Arg), (Arglist), (const char *) (Vallist), sizeof (*(Vallist)))
/* xargmatch calls this function when it fails. This function should not
return. By default, this is a function that calls ARGMATCH_DIE which
in turn defaults to `exit (EXIT_FAILURE)'. */
-typedef void (*argmatch_exit_fn) PARAMS ((void));
+typedef void (*argmatch_exit_fn) (void);
extern argmatch_exit_fn argmatch_die;
/* Report on stderr why argmatch failed. Report correct values. */
-void argmatch_invalid
- PARAMS ((const char *context, const char *value, int problem));
+void argmatch_invalid (const char *context, const char *value, int problem);
/* Left for compatibility with the old name invalid_arg */
/* Report on stderr the list of possible arguments. */
-void argmatch_valid
- PARAMS ((const char *const *arglist,
- const char *vallist, size_t valsize));
+void argmatch_valid (const char *const *arglist,
+ const char *vallist, size_t valsize);
# define ARGMATCH_VALID(Arglist, Vallist) \
argmatch_valid (Arglist, (const char *) Vallist, sizeof (*(Vallist)))
/* Same as argmatch, but upon failure, reports a explanation on the
failure, and exits using the function EXIT_FN. */
-int __xargmatch_internal
- PARAMS ((const char *context,
- const char *arg, const char *const *arglist,
- const char *vallist, size_t valsize,
- argmatch_exit_fn exit_fn));
+int __xargmatch_internal (const char *context,
+ const char *arg, const char *const *arglist,
+ const char *vallist, size_t valsize,
+ argmatch_exit_fn exit_fn);
/* Programmer friendly interface to __xargmatch_internal. */
/* Convert a value into a corresponding argument. */
-const char *argmatch_to_argument
- PARAMS ((char const *value, const char *const *arglist,
- const char *vallist, size_t valsize));
+const char *argmatch_to_argument (char const *value,
+ const char *const *arglist,
+ const char *vallist, size_t valsize);
# define ARGMATCH_TO_ARGUMENT(Value, Arglist, Vallist) \
argmatch_to_argument ((char const *) &(Value), (Arglist), \
/* backupfile.c -- make Emacs style backup file names
- Copyright (C) 1990-1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1990-1999, 2000-2002 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
const char *simple_backup_suffix = "~";
#if HAVE_DIR
-static int max_backup_version PARAMS ((const char *, const char *));
-static int version_number PARAMS ((const char *, const char *, size_t));
+static int max_backup_version (const char *, const char *);
+static int version_number (const char *, const char *, size_t);
#endif
/* Return the name of the new backup file for file FILE,
Do not call this function if backup_type == none. */
char *
-find_backup_file_name (file, backup_type)
- const char *file;
- enum backup_type backup_type;
+find_backup_file_name (const char *file, enum backup_type backup_type)
{
size_t backup_suffix_size_max;
size_t file_len = strlen (file);
*/
static int
-max_backup_version (file, dir)
- const char *file;
- const char *dir;
+max_backup_version (const char *file, const char *dir)
{
DIR *dirp;
struct dirent *dp;
*/
static int
-version_number (base, backup, base_length)
- const char *base;
- const char *backup;
- size_t base_length;
+version_number (const char *base, const char *backup, size_t base_length)
{
int version;
const char *p;
for the specified CONTEXT. Unambiguous abbreviations are accepted. */
enum backup_type
-get_version (context, version)
- const char *context;
- const char *version;
+get_version (const char *context, const char *version)
{
if (version == 0 || *version == 0)
return numbered_existing;
Unambiguous abbreviations are accepted. */
enum backup_type
-xget_version (context, version)
- const char *context;
- const char *version;
+xget_version (const char *context, const char *version)
{
if (version && *version)
return get_version (context, version);
/* backupfile.h -- declarations for making Emacs style backup file names
- Copyright (C) 1990-1992, 1997-1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1990-1992, 1997-1999, 2001-2002 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
extern char const *simple_backup_suffix;
-# ifndef PARAMS
-# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-# endif
-
-extern char *find_backup_file_name PARAMS ((char const *file,
- enum backup_type backup_type));
-extern enum backup_type get_version PARAMS ((char const *context,
- char const *arg));
-extern enum backup_type xget_version PARAMS ((char const *context,
- char const *arg));
-extern void addext PARAMS ((char *, char const *, int));
+extern char *find_backup_file_name (char const *file,
+ enum backup_type backup_type);
+extern enum backup_type get_version (char const *context, char const *arg);
+extern enum backup_type xget_version (char const *context, char const *arg);
+extern void addext (char *filename, char const *ext, char e);
#endif /* ! BACKUPFILE_H_ */
If NAME is all slashes, be sure to return `/'. */
char *
-basename (name)
- char const *name;
+basename (char const *name)
{
char const *base = name += FILESYSTEM_PREFIX_LEN (name);
int all_slashes = 1;
#if !(__GLIBC__ >= 2)
/* When not using the GNU libc we use the basename implementation we
provide here. */
-extern char *gnu_basename PARAMS ((const char *));
+extern char *gnu_basename (const char *);
#define basename(Arg) gnu_basename (Arg)
#endif
/* The function isascii is not locale dependent. Its use in EBCDIC is
questionable. */
bool
-c_isascii (c)
- int c;
+c_isascii (int c)
{
return ((c & ~0x7f) == 0);
}
bool
-c_isalnum (c)
- int c;
+c_isalnum (int c)
{
#if C_CTYPE_CONSECUTIVE_DIGITS \
&& C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
}
bool
-c_isalpha (c)
- int c;
+c_isalpha (int c)
{
#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
}
bool
-c_isblank (c)
- int c;
+c_isblank (int c)
{
return (c == ' ' || c == '\t');
}
bool
-c_iscntrl (c)
- int c;
+c_iscntrl (int c)
{
#if C_CTYPE_ASCII
return ((c & ~0x1f) == 0 || c == 0x7f);
}
bool
-c_isdigit (c)
- int c;
+c_isdigit (int c)
{
#if C_CTYPE_CONSECUTIVE_DIGITS
return (c >= '0' && c <= '9');
}
bool
-c_islower (c)
- int c;
+c_islower (int c)
{
#if C_CTYPE_CONSECUTIVE_LOWERCASE
return (c >= 'a' && c <= 'z');
}
bool
-c_isgraph (c)
- int c;
+c_isgraph (int c)
{
#if C_CTYPE_ASCII
return (c >= '!' && c <= '~');
}
bool
-c_isprint (c)
- int c;
+c_isprint (int c)
{
#if C_CTYPE_ASCII
return (c >= ' ' && c <= '~');
}
bool
-c_ispunct (c)
- int c;
+c_ispunct (int c)
{
#if C_CTYPE_ASCII
return ((c >= '!' && c <= '~')
}
bool
-c_isspace (c)
- int c;
+c_isspace (int c)
{
return (c == ' ' || c == '\t'
|| c == '\n' || c == '\v' || c == '\f' || c == '\r');
}
bool
-c_isupper (c)
- int c;
+c_isupper (int c)
{
#if C_CTYPE_CONSECUTIVE_UPPERCASE
return (c >= 'A' && c <= 'Z');
}
bool
-c_isxdigit (c)
- int c;
+c_isxdigit (int c)
{
#if C_CTYPE_CONSECUTIVE_DIGITS \
&& C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
}
int
-c_tolower (c)
- int c;
+c_tolower (int c)
{
#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
return (c >= 'A' && c <= 'Z' ? c - 'A' + 'a' : c);
}
int
-c_toupper (c)
- int c;
+c_toupper (int c)
{
#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
return (c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c);
#ifndef C_CTYPE_H
#define C_CTYPE_H
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif
-#endif
-
#include <stdbool.h>
/* Function declarations. */
-extern bool c_isascii PARAMS ((int c)); /* not locale dependent */
-
-extern bool c_isalnum PARAMS ((int c));
-extern bool c_isalpha PARAMS ((int c));
-extern bool c_isblank PARAMS ((int c));
-extern bool c_iscntrl PARAMS ((int c));
-extern bool c_isdigit PARAMS ((int c));
-extern bool c_islower PARAMS ((int c));
-extern bool c_isgraph PARAMS ((int c));
-extern bool c_isprint PARAMS ((int c));
-extern bool c_ispunct PARAMS ((int c));
-extern bool c_isspace PARAMS ((int c));
-extern bool c_isupper PARAMS ((int c));
-extern bool c_isxdigit PARAMS ((int c));
-
-extern int c_tolower PARAMS ((int c));
-extern int c_toupper PARAMS ((int c));
+extern bool c_isascii (int c); /* not locale dependent */
+
+extern bool c_isalnum (int c);
+extern bool c_isalpha (int c);
+extern bool c_isblank (int c);
+extern bool c_iscntrl (int c);
+extern bool c_isdigit (int c);
+extern bool c_islower (int c);
+extern bool c_isgraph (int c);
+extern bool c_isprint (int c);
+extern bool c_ispunct (int c);
+extern bool c_isspace (int c);
+extern bool c_isupper (int c);
+extern bool c_isxdigit (int c);
+
+extern int c_tolower (int c);
+extern int c_toupper (int c);
#if defined __GNUC__ && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__
/* Java CLASSPATH handling.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#endif
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static char * new_classpath PARAMS ((const char * const *classpaths,
- unsigned int classpaths_count,
- bool use_minimal_classpath));
-static char * set_classpath PARAMS ((const char * const *classpaths,
- unsigned int classpaths_count,
- bool use_minimal_classpath,
- bool verbose));
-static void reset_classpath PARAMS ((char *old_classpath));
-
-
/* Return the new CLASSPATH value. The given classpaths are prepended to
the current CLASSPATH value. If use_minimal_classpath, the current
CLASSPATH is ignored. */
static char *
-new_classpath (classpaths, classpaths_count, use_minimal_classpath)
- const char * const *classpaths;
- unsigned int classpaths_count;
- bool use_minimal_classpath;
+new_classpath (const char * const *classpaths, unsigned int classpaths_count,
+ bool use_minimal_classpath)
{
const char *old_classpath;
unsigned int length;
/* Set CLASSPATH and returns a safe copy of its old value. */
static char *
-set_classpath (classpaths, classpaths_count, use_minimal_classpath, verbose)
- const char * const *classpaths;
- unsigned int classpaths_count;
- bool use_minimal_classpath;
- bool verbose;
+set_classpath (const char * const *classpaths, unsigned int classpaths_count,
+ bool use_minimal_classpath, bool verbose)
{
const char *old_CLASSPATH = getenv ("CLASSPATH");
char *result = (old_CLASSPATH != NULL ? xstrdup (old_CLASSPATH) : NULL);
/* Restore CLASSPATH to its previous value. */
static void
-reset_classpath (old_classpath)
- char *old_classpath;
+reset_classpath (char *old_classpath)
{
if (old_classpath != NULL)
{
/* Construct a full pathname from a directory and a filename.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 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 the
argument may not start with the directory separator (it is relative).
Return a freshly allocated pathname. */
char *
-concatenated_pathname (directory, filename, suffix)
- const char *directory;
- const char *filename;
- const char *suffix;
+concatenated_pathname (const char *directory, const char *filename,
+ const char *suffix)
{
char *result;
char *p;
/* Copying of files.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#define _(str) gettext (str)
void
-copy_file (src_filename, dest_filename)
- const char *src_filename;
- const char *dest_filename;
+copy_file (const char *src_filename, const char *dest_filename)
{
int src_fd;
struct stat statbuf;
/* Copying of files.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
/* Copy a regular file: from src_filename to dest_filename.
The destination file is assumed to be a backup file.
Exit upon failure. */
-extern void copy_file PARAMS ((const char *src_filename,
- const char *dest_filename));
+extern void copy_file (const char *src_filename, const char *dest_filename);
/* Creation of autonomous subprocesses.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#define _(str) gettext (str)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-#ifdef EINTR
-static inline int nonintr_close PARAMS ((int fd));
-# ifdef __GNUC__
-static inline int nonintr_open PARAMS ((const char *pathname, int oflag,
- mode_t mode));
-# endif
-#endif
-
-
#ifdef EINTR
/* EINTR handling for close(), open().
signal handlers set up, namely when we get interrupted via SIGSTOP. */
static inline int
-nonintr_close (fd)
- int fd;
+nonintr_close (int fd)
{
int retval;
#define close nonintr_close
static inline int
-nonintr_open (pathname, oflag, mode)
- const char *pathname;
- int oflag;
- mode_t mode;
+nonintr_open (const char *pathname, int oflag, mode_t mode)
{
int retval;
If it didn't terminate correctly, exit if exit_on_error is true, otherwise
return 127. */
int
-execute (progname, prog_path, prog_argv, null_stdin, null_stdout, null_stderr, exit_on_error)
- const char *progname;
- const char *prog_path;
- char **prog_argv;
- bool null_stdin;
- bool null_stdout;
- bool null_stderr;
- bool exit_on_error;
+execute (const char *progname,
+ const char *prog_path, char **prog_argv,
+ bool null_stdin, bool null_stdout, bool null_stderr,
+ bool exit_on_error)
{
/* Note about 127: Some errors during posix_spawnp() cause the function
posix_spawnp() to return an error code; some other errors cause the
/* Creation of autonomous subprocesses.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
descriptors to /dev/null. Return its exit code.
If it didn't terminate correctly, exit if exit_on_error is true, otherwise
return 127. */
-extern int execute PARAMS ((const char *progname,
- const char *prog_path, char **prog_argv,
- bool null_stdin,
- bool null_stdout, bool null_stderr,
- bool exit_on_error));
+extern int execute (const char *progname,
+ const char *prog_path, char **prog_argv,
+ bool null_stdin, bool null_stdout, bool null_stderr,
+ bool exit_on_error);
#endif /* _EXECUTE_H */
/* Locating a program in PATH.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
const char *
-find_in_path (progname)
- const char *progname;
+find_in_path (const char *progname)
{
#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
/* Win32, OS/2, DOS */
/* Locating a program in PATH.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
of PROGNAME. If successful, return a pathname containing a slash
(either absolute or relative to the current directory). Otherwise,
return PROGNAME unmodified. */
-extern const char *find_in_path PARAMS ((const char *progname));
+extern const char *find_in_path (const char *progname);
/* Functions to make fuzzy comparisons between strings
- Copyright (C) 1988-1989, 1992-1993, 1995, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1988-1989, 1992-1993, 1995, 2001-2002 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
cause suboptimal diff output. It cannot cause incorrect diff
output. */
-static int diag PARAMS ((int, int, int, int, int, struct partition *));
-
static int
-diag (xoff, xlim, yoff, ylim, minimal, part)
- int xoff;
- int xlim;
- int yoff;
- int ylim;
- int minimal;
- struct partition *part;
+diag (int xoff, int xlim, int yoff, int ylim, int minimal,
+ struct partition *part)
{
int *const fd = fdiag; /* Give the compiler a chance. */
int *const bd = bdiag; /* Additional help for the compiler. */
If MINIMAL is nonzero, find a minimal difference no matter how
expensive it is. */
-static void compareseq PARAMS ((int, int, int, int, int));
-
static void
-compareseq (xoff, xlim, yoff, ylim, minimal)
- int xoff;
- int xlim;
- int yoff;
- int ylim;
- int minimal;
+compareseq (int xoff, int xlim, int yoff, int ylim, int minimal)
{
const char *const xv = string[0].data; /* Help the compiler. */
const char *const yv = string[1].data;
similar. */
double
-fstrcmp (string1, string2)
- const char *string1;
- const char *string2;
+fstrcmp (const char *string1, const char *string2)
{
int i;
/* GNU gettext - internationalization aids
- Copyright (C) 1995, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2000, 2002 Free Software Foundation, Inc.
This file was written by Peter Miller <pmiller@agso.gov.au>
#ifndef _FSTRCMP_H
#define _FSTRCMP_H
-extern double fstrcmp PARAMS ((const char *__s1, const char *__s2));
+extern double fstrcmp (const char *__s1, const char *__s2);
#endif
/* full-write.c -- an interface to write that retries after interrupts
- Copyright (C) 1993-1994, 1997-1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1993-1994, 1997-1998, 2000-2002 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
Return LEN upon success, write's (negative) error code otherwise. */
ssize_t
-full_write (desc, ptr, len)
- int desc;
- const char *ptr;
- size_t len;
+full_write (int desc, const char *ptr, size_t len)
{
int total_written;
/* write() wrapper.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
/* Write LEN bytes at PTR to descriptor DESC, retrying if interrupted.
Return LEN upon success, write's (negative) error code otherwise. */
-extern ssize_t full_write PARAMS ((int desc, const char *ptr, size_t len));
+extern ssize_t full_write (int desc, const char *ptr, size_t len);
/* Arithmetic.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
/* Return the greatest common divisor of a > 0 and b > 0. */
unsigned int
-gcd (a, b)
- unsigned int a;
- unsigned int b;
+gcd (unsigned int a, unsigned int b)
{
/* Why no division, as in Euclid's algorithm? Because in Euclid's algorithm
the division result floor(a/b) or floor(b/a) is very often = 1 or = 2,
/* Arithmetic.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#ifndef _GCD_H
#define _GCD_H
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif
-#endif
-
/* Return the greatest common divisor of a > 0 and b > 0. */
-extern unsigned int gcd PARAMS ((unsigned int a, unsigned int b));
+extern unsigned int gcd (unsigned int a, unsigned int b);
#endif /* _GCD_H */
#if defined __GNU_LIBRARY__ && HAVE_GETDELIM
int
-getline (lineptr, n, stream)
- char **lineptr;
- size_t *n;
- FILE *stream;
+getline (char **lineptr, size_t *n, FILE *stream)
{
return getdelim (lineptr, n, '\n', stream);
}
NOTE: There is another getstr() function declared in <curses.h>. */
static int
-getstr (lineptr, n, stream, terminator, offset)
- char **lineptr;
- size_t *n;
- FILE *stream;
- char terminator;
- size_t offset;
+getstr (char **lineptr, size_t *n, FILE *stream, char terminator,
+ size_t offset)
{
int nchars_avail; /* Allocated but unused chars in *LINEPTR. */
char *read_pos; /* Where we're reading into *LINEPTR. */
}
int
-getline (lineptr, n, stream)
- char **lineptr;
- size_t *n;
- FILE *stream;
+getline (char **lineptr, size_t *n, FILE *stream)
{
return getstr (lineptr, n, stream, '\n', 0);
}
int
-getdelim (lineptr, n, delimiter, stream)
- char **lineptr;
- size_t *n;
- int delimiter;
- FILE *stream;
+getdelim (char **lineptr, size_t *n, int delimiter, FILE *stream)
{
return getstr (lineptr, n, stream, delimiter, 0);
}
-/* Copyright (C) 1995, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 2000-2002 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
# include <stddef.h>
# include <stdio.h>
-# ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif
-# endif
-
/* glibc2 has these functions declared in <stdio.h>. Avoid redeclarations. */
# if __GLIBC__ < 2
int
-getline PARAMS ((char **_lineptr, size_t *_n, FILE *_stream));
+getline (char **_lineptr, size_t *_n, FILE *_stream);
int
-getdelim PARAMS ((char **_lineptr, size_t *_n, int _delimiter, FILE *_stream));
+getdelim (char **_lineptr, size_t *_n, int _delimiter, FILE *_stream);
# endif
/* hash - implement simple hashing table with string based keys.
- Copyright (C) 1994, 1995, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1994-1995, 2000-2002 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, October 1994.
This program is free software; you can redistribute it and/or modify
}
hash_entry;
-/* Prototypes for local functions. */
-static void insert_entry_2 PARAMS ((hash_table *htab,
- const void *key, size_t keylen,
- unsigned long int hval, size_t idx,
- void *data));
-static size_t lookup PARAMS ((hash_table *htab,
- const void *key, size_t keylen,
- unsigned long int hval));
-static unsigned long compute_hashval PARAMS ((const void *key, size_t keylen));
-static int is_prime PARAMS ((unsigned long int candidate));
+/* Forward declaration of local functions. */
+static void insert_entry_2 (hash_table *htab,
+ const void *key, size_t keylen,
+ unsigned long int hval, size_t idx, void *data);
+static size_t lookup (hash_table *htab,
+ const void *key, size_t keylen,
+ unsigned long int hval);
+static unsigned long compute_hashval (const void *key, size_t keylen);
+static int is_prime (unsigned long int candidate);
int
-init_hash (htab, init_size)
- hash_table *htab;
- unsigned long int init_size;
+init_hash (hash_table *htab, unsigned long int init_size)
{
/* We need the size to be a prime. */
init_size = next_prime (init_size);
int
-delete_hash (htab)
- hash_table *htab;
+delete_hash (hash_table *htab)
{
free (htab->table);
obstack_free (&htab->mem_pool, NULL);
int
-insert_entry (htab, key, keylen, data)
- hash_table *htab;
- const void *key;
- size_t keylen;
- void *data;
+insert_entry (hash_table *htab, const void *key, size_t keylen, void *data)
{
unsigned long int hval = compute_hashval (key, keylen);
hash_entry *table = (hash_entry *) htab->table;
}
static void
-insert_entry_2 (htab, key, keylen, hval, idx, data)
- hash_table *htab;
- const void *key;
- size_t keylen;
- unsigned long int hval;
- size_t idx;
- void *data;
+insert_entry_2 (hash_table *htab,
+ const void *key, size_t keylen,
+ unsigned long int hval, size_t idx, void *data)
{
hash_entry *table = (hash_entry *) htab->table;
int
-find_entry (htab, key, keylen, result)
- hash_table *htab;
- const void *key;
- size_t keylen;
- void **result;
+find_entry (hash_table *htab, const void *key, size_t keylen, void **result)
{
hash_entry *table = (hash_entry *) htab->table;
size_t idx = lookup (htab, key, keylen, compute_hashval (key, keylen));
int
-iterate_table (htab, ptr, key, keylen, data)
- hash_table *htab;
- void **ptr;
- const void **key;
- size_t *keylen;
- void **data;
+iterate_table (hash_table *htab, void **ptr, const void **key, size_t *keylen,
+ void **data)
{
if (*ptr == NULL)
{
[Knuth] The Art of Computer Programming, part3 (6.4) */
static size_t
-lookup (htab, key, keylen, hval)
- hash_table *htab;
- const void *key;
- size_t keylen;
- unsigned long int hval;
+lookup (hash_table *htab,
+ const void *key, size_t keylen,
+ unsigned long int hval)
{
unsigned long int hash;
size_t idx;
static unsigned long
-compute_hashval (key, keylen)
- const void *key;
- size_t keylen;
+compute_hashval (const void *key, size_t keylen)
{
size_t cnt;
unsigned long int hval;
unsigned long
-next_prime (seed)
- unsigned long int seed;
+next_prime (unsigned long int seed)
{
/* Make it definitely odd. */
seed |= 1;
static int
-is_prime (candidate)
- unsigned long int candidate;
+is_prime (unsigned long int candidate)
{
/* No even number and none less than 10 will be passed here. */
unsigned long int divn = 3;
-/* Copyright (C) 1995, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 2000-2002 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
}
hash_table;
-# ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-# endif
-
-extern int init_hash PARAMS ((hash_table *htab, unsigned long int init_size));
-extern int delete_hash PARAMS ((hash_table *htab));
-extern int insert_entry PARAMS ((hash_table *htab,
- const void *key, size_t keylen,
- void *data));
-extern int find_entry PARAMS ((hash_table *htab,
- const void *key, size_t keylen,
- void **result));
-
-extern int iterate_table PARAMS ((hash_table *htab, void **ptr,
- const void **key, size_t *keylen,
- void **data));
-
-extern unsigned long int next_prime PARAMS ((unsigned long int seed));
+extern int init_hash (hash_table *htab, unsigned long int init_size);
+extern int delete_hash (hash_table *htab);
+extern int insert_entry (hash_table *htab,
+ const void *key, size_t keylen,
+ void *data);
+extern int find_entry (hash_table *htab,
+ const void *key, size_t keylen,
+ void **result);
+
+extern int iterate_table (hash_table *htab, void **ptr,
+ const void **key, size_t *keylen,
+ void **data);
+
+extern unsigned long int next_prime (unsigned long int seed);
#endif /* not _HASH_H */
*/
bool
-compile_java_class (java_sources, java_sources_count,
- classpaths, classpaths_count,
- directory, optimize, debug, use_minimal_classpath, verbose)
- const char * const *java_sources;
- unsigned int java_sources_count;
- const char * const *classpaths;
- unsigned int classpaths_count;
- const char *directory;
- bool optimize;
- bool debug;
- bool use_minimal_classpath;
- bool verbose;
+compile_java_class (const char * const *java_sources,
+ unsigned int java_sources_count,
+ const char * const *classpaths,
+ unsigned int classpaths_count,
+ const char *directory,
+ bool optimize, bool debug,
+ bool use_minimal_classpath,
+ bool verbose)
{
bool err = false;
char *old_JAVA_HOME;
/* Compile a Java program.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
Java version.
If verbose, the command to be executed will be printed.
Return false if OK, true on error. */
-extern bool compile_java_class PARAMS ((const char * const *java_sources,
- unsigned int java_sources_count,
- const char * const *classpaths,
- unsigned int classpaths_count,
- const char *directory,
- bool optimize, bool debug,
- bool use_minimal_classpath,
- bool verbose));
+extern bool compile_java_class (const char * const *java_sources,
+ unsigned int java_sources_count,
+ const char * const *classpaths,
+ unsigned int classpaths_count,
+ const char *directory,
+ bool optimize, bool debug,
+ bool use_minimal_classpath,
+ bool verbose);
#endif /* _JAVACOMP_H */
*/
bool
-execute_java_class (class_name,
- classpaths, classpaths_count, use_minimal_classpath,
- exe_dir,
- args,
- verbose, quiet,
- executer, private_data)
- const char *class_name;
- const char * const *classpaths;
- unsigned int classpaths_count;
- bool use_minimal_classpath;
- const char *exe_dir;
- const char * const *args;
- bool verbose;
- bool quiet;
- execute_fn *executer;
- void *private_data;
+execute_java_class (const char *class_name,
+ const char * const *classpaths,
+ unsigned int classpaths_count,
+ bool use_minimal_classpath,
+ const char *exe_dir,
+ const char * const *args,
+ bool verbose, bool quiet,
+ execute_fn *executer, void *private_data)
{
bool err = false;
unsigned int nargs;
#include <stdbool.h>
-typedef bool execute_fn PARAMS ((const char *progname,
- const char *prog_path, char **prog_argv,
- void *private_data));
+typedef bool execute_fn (const char *progname,
+ const char *prog_path, char **prog_argv,
+ void *private_data);
/* Execute a Java class.
class_name is the Java class name to be executed.
private_data argument. This function returns false if OK, true on error.
Return false if OK, true on error.
If quiet, error messages will not be printed. */
-extern bool execute_java_class PARAMS ((const char *class_name,
- const char * const *classpaths,
- unsigned int classpaths_count,
- bool use_minimal_classpath,
- const char *exe_dir,
- const char * const *args,
- bool verbose, bool quiet,
- execute_fn *executer,
- void *private_data));
+extern bool execute_java_class (const char *class_name,
+ const char * const *classpaths,
+ unsigned int classpaths_count,
+ bool use_minimal_classpath,
+ const char *exe_dir,
+ const char * const *args,
+ bool verbose, bool quiet,
+ execute_fn *executer, void *private_data);
#endif /* _JAVAEXEC_H */
+++ /dev/null
-/* <stdarg.h> with fallback on <varargs.h> for old platforms.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU Library General Public License as published
- by the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-#ifndef _LIBSTDARG_H
-#define _LIBSTDARG_H
-
-#if __STDC__ || defined __SUNPRO_C || defined __cplusplus
-# include <stdarg.h>
-# define VA_START(args, lastarg) va_start (args, lastarg)
-# define VA_PARAMS(stdc_params, oldc_params) stdc_params
-#else
-# include <varargs.h>
-# define VA_START(args, lastarg) va_start (args)
-# define VA_PARAMS(stdc_params, oldc_params) oldc_params
-#endif
-
-#endif /* _LIBSTDARG_H */
#include "utf16-ucs4.h"
static inline int
-u32_mbtouc (puc, s, n)
- unsigned int *puc;
- const unsigned int *s;
- size_t n;
+u32_mbtouc (unsigned int *puc, const unsigned int *s, size_t n)
{
*puc = *s;
return 1;
static int
-is_cjk_encoding (encoding)
- const char *encoding;
+is_cjk_encoding (const char *encoding)
{
if (0
/* Legacy Japanese encodings */
}
static int
-is_utf8_encoding (encoding)
- const char *encoding;
+is_utf8_encoding (const char *encoding)
{
if (STREQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0 ,0))
return 1;
/* Determine number of column positions required for UC. */
-int uc_width PARAMS ((unsigned int uc, const char *encoding));
+int uc_width (unsigned int uc, const char *encoding);
/*
* Non-spacing attribute table.
/* Determine number of column positions required for UC. */
int
-uc_width (uc, encoding)
- unsigned int uc;
- const char *encoding;
+uc_width (unsigned int uc, const char *encoding)
{
/* Test for non-spacing or control character. */
if ((uc >> 9) < 240)
(or fewer if S ends before this) in S. */
int
-u8_width (s, n, encoding)
- const unsigned char *s;
- size_t n;
- const char *encoding;
+u8_width (const unsigned char *s, size_t n, const char *encoding)
{
const unsigned char *s_end = s + n;
int width = 0;
}
int
-u16_width (s, n, encoding)
- const unsigned short *s;
- size_t n;
- const char *encoding;
+u16_width (const unsigned short *s, size_t n, const char *encoding)
{
const unsigned short *s_end = s + n;
int width = 0;
}
int
-u32_width (s, n, encoding)
- const unsigned int *s;
- size_t n;
- const char *encoding;
+u32_width (const unsigned int *s, size_t n, const char *encoding)
{
const unsigned int *s_end = s + n;
int width = 0;
#include "lbrkprop.h"
static inline unsigned char
-lbrkprop_lookup (uc)
- unsigned int uc;
+lbrkprop_lookup (unsigned int uc)
{
unsigned int index1 = uc >> lbrkprop_header_0;
if (index1 < lbrkprop_header_1)
/* Note: The (PR,ID) entry should probably be D instead of I. */
void
-u8_possible_linebreaks (s, n, encoding, p)
- const unsigned char *s;
- size_t n;
- const char *encoding;
- char *p;
+u8_possible_linebreaks (const unsigned char *s, size_t n, const char *encoding, char *p)
{
int LBP_AI_REPLACEMENT = (is_cjk_encoding (encoding) ? LBP_ID : LBP_AL);
const unsigned char *s_end = s + n;
#ifdef unused
void
-u16_possible_linebreaks (s, n, encoding, p)
- const unsigned short *s;
- size_t n;
- const char *encoding;
- char *p;
+u16_possible_linebreaks (const unsigned short *s, size_t n, const char *encoding, char *p)
{
int LBP_AI_REPLACEMENT = (is_cjk_encoding (encoding) ? LBP_ID : LBP_AL);
const unsigned short *s_end = s + n;
}
void
-u32_possible_linebreaks (s, n, encoding, p)
- const unsigned int *s;
- size_t n;
- const char *encoding;
- char *p;
+u32_possible_linebreaks (const unsigned int *s, size_t n, const char *encoding, char *p)
{
int LBP_AI_REPLACEMENT = (is_cjk_encoding (encoding) ? LBP_ID : LBP_AL);
const unsigned int *s_end = s + n;
Return the column after the end of the string. */
int
-u8_width_linebreaks (s, n, width, start_column, at_end_columns, o, encoding, p)
- const unsigned char *s;
- size_t n;
- int width;
- int start_column;
- int at_end_columns;
- const char *o;
- const char *encoding;
- char *p;
+u8_width_linebreaks (const unsigned char *s, size_t n,
+ int width, int start_column, int at_end_columns,
+ const char *o, const char *encoding,
+ char *p)
{
const unsigned char *s_end;
char *last_p;
#ifdef unused
int
-u16_width_linebreaks (s, n, width, start_column, at_end_columns, o, encoding, p)
- const unsigned short *s;
- size_t n;
- int width;
- int start_column;
- int at_end_columns;
- const char *o;
- const char *encoding;
- char *p;
+u16_width_linebreaks (const unsigned short *s, size_t n,
+ int width, int start_column, int at_end_columns,
+ const char *o, const char *encoding,
+ char *p)
{
const unsigned short *s_end;
char *last_p;
}
int
-u32_width_linebreaks (s, n, width, start_column, at_end_columns, o, encoding, p)
- const unsigned int *s;
- size_t n;
- int width;
- int start_column;
- int at_end_columns;
- const char *o;
- const char *encoding;
- char *p;
+u32_width_linebreaks (const unsigned int *s, size_t n,
+ int width, int start_column, int at_end_columns,
+ const char *o, const char *encoding,
+ char *p)
{
const unsigned int *s_end;
char *last_p;
/* Read the contents of an input stream, and return it, terminated with a NUL
byte. */
char *
-read_file (stream)
- FILE *stream;
+read_file (FILE *stream)
{
#define BUFSIZE 4096
char *buf = NULL;
}
int
-main (argc, argv)
- int argc;
- char * argv[];
+main (int argc, char * argv[])
{
if (argc == 1)
{
/* Return the length of a string after conversion through an iconv_t. */
static size_t
-iconv_string_length (cd, s, n)
- iconv_t cd;
- const char *s;
- size_t n;
+iconv_string_length (iconv_t cd, const char *s, size_t n)
{
#define TMPBUFSIZE 4096
size_t count = 0;
}
static void
-iconv_string_keeping_offsets (cd, s, n, offtable, t, m)
- iconv_t cd;
- const char *s;
- size_t n;
- size_t *offtable;
- char *t;
- size_t m;
+iconv_string_keeping_offsets (iconv_t cd, const char *s, size_t n,
+ size_t *offtable, char *t, size_t m)
{
size_t i;
const char *s_end;
/* Tests whether a string is entirely ASCII. Returns 1 if yes.
Returns 0 if the string is in an 8-bit encoding or an ISO-2022 encoding. */
static int
-is_all_ascii (s, n)
- const char *s;
- size_t n;
+is_all_ascii (const char *s, size_t n)
{
for (; n > 0; s++, n--)
{
#if defined unused || defined TEST2
void
-mbs_possible_linebreaks (s, n, encoding, p)
- const char *s;
- size_t n;
- const char *encoding;
- char *p;
+mbs_possible_linebreaks (const char *s, size_t n, const char *encoding,
+ char *p)
{
if (is_utf8_encoding (encoding))
u8_possible_linebreaks ((const unsigned char *) s, n, encoding, p);
#endif
int
-mbs_width_linebreaks (s, n, width, start_column, at_end_columns, o, encoding, p)
- const char *s;
- size_t n;
- int width;
- int start_column;
- int at_end_columns;
- const char *o;
- const char *encoding;
- char *p;
+mbs_width_linebreaks (const char *s, size_t n,
+ int width, int start_column, int at_end_columns,
+ const char *o, const char *encoding,
+ char *p)
{
if (is_utf8_encoding (encoding))
return u8_width_linebreaks ((const unsigned char *) s, n, width, start_column, at_end_columns, o, encoding, p);
/* Read the contents of an input stream, and return it, terminated with a NUL
byte. */
char *
-read_file (stream)
- FILE *stream;
+read_file (FILE *stream)
{
#define BUFSIZE 4096
char *buf = NULL;
}
int
-main (argc, argv)
- int argc;
- char * argv[];
+main (int argc, char * argv[])
{
setlocale (LC_CTYPE, "");
if (argc == 1)
/* linebreak.h - line breaking of Unicode strings
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#ifndef _LINEBREAK_H
#define _LINEBREAK_H
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif
-#endif
-
/* Get size_t. */
#include <stddef.h>
the encoding (e.g. "ISO-8859-2" for Polish). */
/* Return the encoding of the current locale. */
-extern const char * locale_charset PARAMS ((void));
+extern const char * locale_charset (void);
/* Determine number of column positions required for UC. */
-extern int uc_width PARAMS ((unsigned int uc, const char *encoding));
+extern int uc_width (unsigned int uc, const char *encoding);
/* Determine number of column positions required for first N units
(or fewer if S ends before this) in S. */
-extern int u8_width PARAMS ((const unsigned char *s, size_t n, const char *encoding));
-extern int u16_width PARAMS ((const unsigned short *s, size_t n, const char *encoding));
-extern int u32_width PARAMS ((const unsigned int *s, size_t n, const char *encoding));
+extern int u8_width (const unsigned char *s, size_t n, const char *encoding);
+extern int u16_width (const unsigned short *s, size_t n, const char *encoding);
+extern int u32_width (const unsigned int *s, size_t n, const char *encoding);
/* Line breaking. */
hyphenation rules.
p[i] = UC_BREAK_PROHIBITED means that s[i-1] and s[i] must not be separated.
*/
-extern void u8_possible_linebreaks PARAMS ((const unsigned char *s, size_t n, const char *encoding, char *p));
-extern void u16_possible_linebreaks PARAMS ((const unsigned short *s, size_t n, const char *encoding, char *p));
-extern void u32_possible_linebreaks PARAMS ((const unsigned int *s, size_t n, const char *encoding, char *p));
-extern void mbs_possible_linebreaks PARAMS ((const char *s, size_t n, const char *encoding, char *p));
+extern void u8_possible_linebreaks (const unsigned char *s, size_t n, const char *encoding, char *p);
+extern void u16_possible_linebreaks (const unsigned short *s, size_t n, const char *encoding, char *p);
+extern void u32_possible_linebreaks (const unsigned int *s, size_t n, const char *encoding, char *p);
+extern void mbs_possible_linebreaks (const char *s, size_t n, const char *encoding, char *p);
/* Choose the best line breaks, assuming the uc_width function.
Return the column after the end of the string.
o is an optional override; if o[i] != UC_BREAK_UNDEFINED, o[i] takes
precedence over p[i] as returned by the *_possible_linebreaks function.
*/
-extern int u8_width_linebreaks PARAMS ((const unsigned char *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p));
-extern int u16_width_linebreaks PARAMS ((const unsigned short *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p));
-extern int u32_width_linebreaks PARAMS ((const unsigned int *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p));
-extern int mbs_width_linebreaks PARAMS ((const char *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p));
+extern int u8_width_linebreaks (const unsigned char *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p);
+extern int u16_width_linebreaks (const unsigned short *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p);
+extern int u32_width_linebreaks (const unsigned int *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p);
+extern int mbs_width_linebreaks (const char *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p);
#endif /* _LINEBREAK_H */
/* Determine the number of screen columns needed for a string.
- Copyright (C) 2000-2001 Free Software Foundation, Inc.
+ Copyright (C) 2000-2002 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
With flags = MBSW_REJECT_INVALID | MBSW_REJECT_UNPRINTABLE, this is
the multibyte analogon of the wcswidth function. */
int
-mbswidth (string, flags)
- const char *string;
- int flags;
+mbswidth (const char *string, int flags)
{
return mbsnwidth (string, strlen (string), flags);
}
non-printable character occurs, and MBSW_REJECT_UNPRINTABLE is
specified, -1 is returned. */
int
-mbsnwidth (string, nbytes, flags)
- const char *string;
- size_t nbytes;
- int flags;
+mbsnwidth (const char *string, size_t nbytes, int flags)
{
const char *p = string;
const char *plimit = p + nbytes;
/* Determine the number of screen columns needed for a string.
- Copyright (C) 2000-2001 Free Software Foundation, Inc.
+ Copyright (C) 2000-2002 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
#include <stddef.h>
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
-
/* Optional flags to influence mbswidth/mbsnwidth behavior. */
/* If this bit is set, return -1 upon finding an invalid or incomplete
/* Returns the number of screen columns needed for STRING. */
#define mbswidth gnu_mbswidth /* avoid clash with UnixWare 7.1.1 function */
-extern int mbswidth PARAMS ((const char *string, int flags));
+extern int mbswidth (const char *string, int flags);
/* Returns the number of screen columns needed for the NBYTES bytes
starting at BUF. */
-extern int mbsnwidth PARAMS ((const char *buf, size_t nbytes, int flags));
+extern int mbsnwidth (const char *buf, size_t nbytes, int flags);
#endif
void *
-memmove (dest, source, length)
- char *dest;
- const char *source;
- unsigned length;
+memmove (char *dest, const char *source, unsigned length)
{
char *d0 = dest;
if (source < dest)
/* memset.c -- set an area of memory to a given value
- Copyright (C) 1991 Free Software Foundation, Inc.
+ Copyright (C) 1991, 2002 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
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
char *
-memset (str, c, len)
- char *str;
- int c;
- unsigned len;
+memset (char *str, int c, unsigned len)
{
register char *st = str;
We use a clever algorithm to get hard-to-predict names. */
static int
-gen_tempname (tmpl)
- char *tmpl;
+gen_tempname (char *tmpl)
{
int len;
char *XXXXXX;
The directory is created, mode 700, and its name is returned.
(This function comes from OpenBSD.) */
char *
-mkdtemp (template)
- char *template;
+mkdtemp (char *template)
{
if (gen_tempname (template))
return NULL;
/* Creating a private temporary directory.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 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
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
-
#if HAVE_MKDTEMP
/* Get mkdtemp() declaration. */
they are replaced with a string that makes the directory name unique.
Returns TEMPLATE, or a null pointer if it cannot get a unique name.
The directory is created mode 700. */
-extern char * mkdtemp PARAMS ((char *template));
+extern char * mkdtemp (char *template);
#endif
/* Pathname support.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 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
#ifndef _PATHNAME_H
#define _PATHNAME_H
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif
-#endif
-
/* Pathname support.
ISSLASH(C) tests whether C is a directory separator character.
IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not,
/* Concatenate a directory pathname, a relative pathname and an optional
suffix. Return a freshly allocated pathname. */
-extern char *concatenated_pathname PARAMS ((const char *directory,
- const char *filename,
- const char *suffix));
+extern char *concatenated_pathname (const char *directory,
+ const char *filename, const char *suffix);
#endif /* _PATHNAME_H */
/* POSIX fnmatch().
- Copyright 1991-1993, 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1991-1993, 1996-1997, 2000-2002 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
/* Match STRING against the filename pattern PATTERN, returning zero if
it matches, nonzero if not. */
int
-fnmatch (pattern, string, flags)
- const char *pattern;
- const char *string;
- int flags;
+fnmatch (const char *pattern, const char *string, int flags)
{
register const char *p = pattern, *n = string;
register char c;
/* POSIX <fnmatch.h>.
- Copyright (C) 1991-1993, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1991-1993, 2001-2002 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 the
extern "C" {
#endif
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
-
/* We #undef these before defining them because some losing systems
(HP-UX A.08.07 for example) define these in <unistd.h>. */
/* Match STRING against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */
-extern int fnmatch PARAMS ((const char *__pattern, const char *__string,
- int __flags));
+extern int fnmatch (const char *__pattern, const char *__string, int __flags);
#ifdef __cplusplus
}
/* Creation of subprocesses, communicating via pipes.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#define _(str) gettext (str)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-#ifdef EINTR
-static inline int nonintr_close PARAMS ((int fd));
-#endif
-
-
#ifdef EINTR
/* EINTR handling for close().
signal handlers set up, namely when we get interrupted via SIGSTOP. */
static inline int
-nonintr_close (fd)
- int fd;
+nonintr_close (int fd)
{
int retval;
*
*/
pid_t
-create_pipe_bidi (progname, prog_path, prog_argv, null_stderr, exit_on_error, fd)
- const char *progname;
- const char *prog_path;
- char **prog_argv;
- bool null_stderr;
- bool exit_on_error;
- int fd[2];
+create_pipe_bidi (const char *progname,
+ const char *prog_path, char **prog_argv,
+ bool null_stderr,
+ bool exit_on_error,
+ int fd[2])
{
int ifd[2];
int ofd[2];
/* Creation of subprocesses, communicating via pipes.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#define _(str) gettext (str)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-#ifdef EINTR
-static inline int nonintr_close PARAMS ((int fd));
-# ifdef __GNUC__
-static inline int nonintr_open PARAMS ((const char *pathname, int oflag,
- mode_t mode));
-# endif
-#endif
-
-
#ifdef EINTR
/* EINTR handling for close(), open().
signal handlers set up, namely when we get interrupted via SIGSTOP. */
static inline int
-nonintr_close (fd)
- int fd;
+nonintr_close (int fd)
{
int retval;
#define close nonintr_close
static inline int
-nonintr_open (pathname, oflag, mode)
- const char *pathname;
- int oflag;
- mode_t mode;
+nonintr_open (const char *pathname, int oflag, mode_t mode)
{
int retval;
*
*/
pid_t
-create_pipe_in (progname, prog_path, prog_argv, prog_stdin, null_stderr, exit_on_error, fd)
- const char *progname;
- const char *prog_path;
- char **prog_argv;
- const char *prog_stdin;
- bool null_stderr;
- bool exit_on_error;
- int fd[1];
+create_pipe_in (const char *progname,
+ const char *prog_path, char **prog_argv,
+ const char *prog_stdin, bool null_stderr,
+ bool exit_on_error,
+ int fd[1])
{
int ifd[2];
#if HAVE_POSIX_SPAWN
/* Creation of subprocesses, communicating via pipes.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#define _(str) gettext (str)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-#ifdef EINTR
-static inline int nonintr_close PARAMS ((int fd));
-# ifdef __GNUC__
-static inline int nonintr_open PARAMS ((const char *pathname, int oflag,
- mode_t mode));
-# endif
-#endif
-
-
#ifdef EINTR
/* EINTR handling for close(), open().
signal handlers set up, namely when we get interrupted via SIGSTOP. */
static inline int
-nonintr_close (fd)
- int fd;
+nonintr_close (int fd)
{
int retval;
#define close nonintr_close
static inline int
-nonintr_open (pathname, oflag, mode)
- const char *pathname;
- int oflag;
- mode_t mode;
+nonintr_open (const char *pathname, int oflag, mode_t mode)
{
int retval;
*
*/
pid_t
-create_pipe_out (progname, prog_path, prog_argv, prog_stdout, null_stderr, exit_on_error, fd)
- const char *progname;
- const char *prog_path;
- char **prog_argv;
- const char *prog_stdout;
- bool null_stderr;
- bool exit_on_error;
- int fd[1];
+create_pipe_out (const char *progname,
+ const char *prog_path, char **prog_argv,
+ const char *prog_stdout, bool null_stderr,
+ bool exit_on_error,
+ int fd[1])
{
int ofd[2];
#if HAVE_POSIX_SPAWN
/* Creation of subprocesses, communicating via pipes.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
* parent -> fd[0] -> STDIN_FILENO -> child
*
*/
-extern pid_t create_pipe_out PARAMS ((const char *progname,
- const char *prog_path, char **prog_argv,
- const char *prog_stdout, bool null_stderr,
- bool exit_on_error,
- int fd[1]));
+extern pid_t create_pipe_out (const char *progname,
+ const char *prog_path, char **prog_argv,
+ const char *prog_stdout, bool null_stderr,
+ bool exit_on_error,
+ int fd[1]);
/* Open a pipe for input from a child process.
* The child's stdin comes from a file.
* parent <- fd[0] <- STDOUT_FILENO <- child
*
*/
-extern pid_t create_pipe_in PARAMS ((const char *progname,
- const char *prog_path, char **prog_argv,
- const char *prog_stdin, bool null_stderr,
- bool exit_on_error,
- int fd[1]));
+extern pid_t create_pipe_in (const char *progname,
+ const char *prog_path, char **prog_argv,
+ const char *prog_stdin, bool null_stderr,
+ bool exit_on_error,
+ int fd[1]);
/* Open a bidirectional pipe.
*
* read system write
*
*/
-extern pid_t create_pipe_bidi PARAMS ((const char *progname,
- const char *prog_path, char **prog_argv,
- bool null_stderr,
- bool exit_on_error,
- int fd[2]));
+extern pid_t create_pipe_bidi (const char *progname,
+ const char *prog_path, char **prog_argv,
+ bool null_stderr,
+ bool exit_on_error,
+ int fd[2]);
#endif /* _PIPE_H */
/* Program name management.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
/* Set program_name, based on argv[0]. */
void
-set_program_name (argv0)
- const char *argv0;
+set_program_name (const char *argv0)
{
/* libtool creates a temporary executable whose name is prefixed with
"lt-". Remove this prefix here. */
/* Program name management.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
extern const char *program_name;
/* Set program_name, based on argv[0]. */
-extern void set_program_name PARAMS ((const char *argv0));
+extern void set_program_name (const char *argv0);
/* Indicates whether errors and warnings get prefixed with program_name.
Default is true.
/* Print program_name prefix on stderr if and only if error_with_progname
is true. */
-extern void maybe_print_progname PARAMS ((void));
+extern void maybe_print_progname (void);
#endif /* _PROGNAME_H */
/* safe-read.c -- an interface to read that retries after interrupts
- Copyright (C) 1993-1994, 1998, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1993-1994, 1998, 2001-2002 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
for an error. */
ssize_t
-safe_read (desc, ptr, len)
- int desc;
- void *ptr;
- size_t len;
+safe_read (int desc, void *ptr, size_t len)
{
ssize_t n_chars;
/* read() wrapper.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
/* Read LEN bytes at PTR from descriptor DESC, retrying if interrupted.
Return the actual number of bytes read, zero for EOF, or negative
for an error. */
-extern ssize_t safe_read PARAMS ((int desc, void *ptr, size_t len));
+extern ssize_t safe_read (int desc, void *ptr, size_t len);
&& defined __GNUC__)
# define USE_TSEARCH 1
# include <search.h>
-typedef int (*compar_fn_t) PARAMS ((const void *, const void *));
+typedef int (*compar_fn_t) (const void *, const void *);
/* This is a pointer to the root of the search tree with the known
values. */
to reuse values once generated for a `setenv' call since we can never
free the strings. */
int
-__add_to_environ (name, value, combined, replace)
- const char *name;
- const char *value;
- const char *combined;
- int replace;
+__add_to_environ (const char *name, const char *value, const char *combined,
+ int replace)
{
register char **ep;
register size_t size;
}
int
-setenv (name, value, replace)
- const char *name;
- const char *value;
- int replace;
+setenv (const char *name, const char *value, int replace)
{
return __add_to_environ (name, value, NULL, replace);
}
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
-
#if HAVE_SETENV || HAVE_UNSETENV
/* Get setenv(), unsetenv() declarations. */
/* Set NAME to VALUE in the environment.
If REPLACE is nonzero, overwrite an existing value. */
-extern int setenv PARAMS ((const char *name, const char *value, int replace));
+extern int setenv (const char *name, const char *value, int replace);
#endif
#if !HAVE_UNSETENV
/* Remove the variable NAME from the environment. */
-extern int unsetenv PARAMS ((const char *name));
+extern int unsetenv (const char *name);
#endif
/* Shell quoting.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
/* Returns the number of bytes needed for the quoted string. */
size_t
-shell_quote_length (string)
- const char *string;
+shell_quote_length (const char *string)
{
if (strpbrk (string, SHELL_SPECIAL_CHARS) == NULL)
return strlen (string);
/* Copies the quoted string to p and returns the incremented p. */
char *
-shell_quote_copy (p, string)
- char *p;
- const char *string;
+shell_quote_copy (char *p, const char *string)
{
if (strpbrk (string, SHELL_SPECIAL_CHARS) == NULL)
{
/* Returns the freshly allocated quoted string. */
char *
-shell_quote (string)
- const char *string;
+shell_quote (const char *string)
{
size_t length = shell_quote_length (string);
char *quoted = (char *) xmalloc (length + 1);
/* Returns a freshly allocated string containing all argument strings, quoted,
separated through spaces. */
char *
-shell_quote_argv (argv)
- char **argv;
+shell_quote_argv (char **argv)
{
if (*argv != NULL)
{
/* Shell quoting.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#include <stddef.h>
/* Returns the number of bytes needed for the quoted string. */
-extern size_t shell_quote_length PARAMS ((const char *string));
+extern size_t shell_quote_length (const char *string);
/* Copies the quoted string to p and returns the incremented p. */
-extern char * shell_quote_copy PARAMS ((char *p, const char *string));
+extern char * shell_quote_copy (char *p, const char *string);
/* Returns the freshly allocated quoted string. */
-extern char * shell_quote PARAMS ((const char *string));
+extern char * shell_quote (const char *string);
/* Returns a freshly allocated string containing all argument strings, quoted,
separated through spaces. */
-extern char * shell_quote_argv PARAMS ((char **argv));
+extern char * shell_quote_argv (char **argv);
-/* Copyright (C) 1992, 1995, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1997, 2002 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */
char *
-__stpcpy (dest, src)
- char *dest;
- const char *src;
+__stpcpy (char *dest, const char *src)
{
register char *d = dest;
register const char *s = src;
/* String copying.
- Copyright (C) 1995, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2002 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
#ifndef _STPCPY_H
#define _STPCPY_H
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif
-#endif
-
#if HAVE_STPCPY
/* Get stpcpy() declaration. */
#else
-extern char *stpcpy PARAMS ((char *__dst, const char *__src));
+extern char *stpcpy (char *__dst, const char *__src);
#endif
/* Copy no more than N characters of SRC to DEST, returning the address of
the terminating '\0' in DEST, if any, or else DEST + N. */
char *
-__stpncpy (dest, src, n)
- char *dest;
- const char *src;
- size_t n;
+__stpncpy (char *dest, const char *src, size_t n)
{
char c;
char *s = dest;
#ifndef _STPNCPY_H
#define _STPNCPY_H
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif
-#endif
-
#include <string.h>
#ifndef __GNU_LIBRARY__
/* When not using the GNU libc we use the stpncpy implementation we
provide here. */
-extern char *gnu_stpncpy PARAMS ((char *__dst, const char *__src, size_t __n));
+extern char *gnu_stpncpy (char *__dst, const char *__src, size_t __n);
#define stpncpy(Dst, Src, N) gnu_stpncpy (Dst, Src, N)
#endif
/* Case-insensitive string comparison functions.
- Copyright (C) 1995-1996, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 2001-2002 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
#include <stddef.h>
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif
-#endif
-
-extern int strcasecmp PARAMS ((const char *__s1, const char *__s2));
-extern int strncasecmp PARAMS ((const char *__s1, const char *__s2,
- size_t __n));
+extern int strcasecmp (const char *__s1, const char *__s2);
+extern int strncasecmp (const char *__s1, const char *__s2, size_t __n);
#endif /* _STRCASE_H */
-/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1992, 1995-1997, 2002 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
#endif
#ifdef USE_IN_EXTENDED_LOCALE_MODEL
-# define LOCALE_PARAM , loc
-# define LOCALE_PARAM_DECL __locale_t loc;
+# define LOCALE_PARAM , __locale_t loc
#else
# define LOCALE_PARAM
-# define LOCALE_PARAM_DECL
#endif
/* Compare S1 and S2, ignoring case, returning less than, equal to or
greater than zero if S1 is lexicographically less than,
equal to or greater than S2. */
int
-__strcasecmp (s1, s2 LOCALE_PARAM)
- const char *s1;
- const char *s2;
- LOCALE_PARAM_DECL
+__strcasecmp (const char *s1, const char *s2 LOCALE_PARAM)
{
const unsigned char *p1 = (const unsigned char *) s1;
const unsigned char *p2 = (const unsigned char *) s2;
-/* Copyright (C) 1991, 1994, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 1996-1997, 2002 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
/* Return the length of the maximum initial segment of S
which contains no characters from REJECT. */
size_t
-strcspn (s, reject)
- const char *s;
- const char *reject;
+strcspn (const char *s, const char *reject)
{
size_t count = 0;
/* Compare at most N characters of two strings without taking care for
the case.
- Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1996-1997, 2002 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
#endif
#ifdef USE_IN_EXTENDED_LOCALE_MODEL
-# define LOCALE_PARAM , loc
-# define LOCALE_PARAM_DECL __locale_t loc;
+# define LOCALE_PARAM , __locale_t loc
#else
# define LOCALE_PARAM
-# define LOCALE_PARAM_DECL
#endif
/* Compare no more than N characters of S1 and S2,
greater than zero if S1 is lexicographically less
than, equal to or greater than S2. */
int
-__strncasecmp (s1, s2, n LOCALE_PARAM)
- const char *s1;
- const char *s2;
- size_t n;
- LOCALE_PARAM_DECL
+__strncasecmp (const char *s1, const char *s2, size_t n LOCALE_PARAM)
{
const unsigned char *p1 = (const unsigned char *) s1;
const unsigned char *p2 = (const unsigned char *) s2;
-/* Copyright (C) 1991, 1994, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 1996-1997, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
/* Find the first occurrence in S of any character in ACCEPT. */
char *
-strpbrk (s, accept)
- const char *s;
- const char *accept;
+strpbrk (const char *s, const char *accept)
{
while (*s != '\0')
{
/* Searching in a string.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 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
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
-
#if HAVE_STRPBRK
/* Get strpbrk() declaration. */
#else
/* Find the first occurrence in S of any character in ACCEPT. */
-extern char *strpbrk PARAMS ((const char *s, const char *accept));
+extern char *strpbrk (const char *s, const char *accept);
#endif
/* Return the offset of one string within another.
- Copyright (C) 1994, 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
#undef strstr
char *
-strstr (phaystack, pneedle)
- const char *phaystack;
- const char *pneedle;
+strstr (const char *phaystack, const char *pneedle)
{
register const unsigned char *haystack, *needle;
register chartype b, c;
/* Searching in a string.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002 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
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
-
#if HAVE_STRSTR
/* Get strstr() declaration. */
#else
/* Find the first occurrence of NEEDLE in HAYSTACK. */
-extern char *strstr PARAMS ((const char *haystack, const char *needle));
+extern char *strstr (const char *haystack, const char *needle);
#endif
#endif
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static bool direxists PARAMS ((const char *dir));
-
-
/* Return nonzero if DIR is an existent directory. */
static bool
-direxists (dir)
- const char *dir;
+direxists (const char *dir)
{
struct_stat64 buf;
return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode);
doesn't exist, none of the searched dirs exists, or there's not
enough space in TMPL. */
int
-path_search (tmpl, tmpl_len, dir, pfx, try_tmpdir)
- char *tmpl;
- size_t tmpl_len;
- const char *dir;
- const char *pfx;
- bool try_tmpdir;
+path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
+ bool try_tmpdir)
{
const char *d;
size_t dlen, plen;
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
-
#include <stdbool.h>
#include <stddef.h>
for use with mk[s]temp. Will fail (-1) if DIR is non-null and
doesn't exist, none of the searched dirs exists, or there's not
enough space in TMPL. */
-extern int path_search PARAMS ((char *tmpl, size_t tmpl_len, const char *dir, const char *pfx, bool try_tmpdir));
+extern int path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx, bool try_tmpdir);
#include <stddef.h>
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int
-u16_uctomb_aux PARAMS ((unsigned short *s, unsigned int uc, int n));
-static inline int
-u16_uctomb PARAMS ((unsigned short *s, unsigned int uc, int n));
-
/* Return the length (number of units) of the UTF-16 representation of uc,
after storing it at S. Return -1 upon failure, -2 if the number of
available units, N, is too small. */
static int
-u16_uctomb_aux (s, uc, n)
- unsigned short *s;
- unsigned int uc;
- int n;
+u16_uctomb_aux (unsigned short *s, unsigned int uc, int n)
{
if (uc >= 0x10000)
{
}
static inline int
-u16_uctomb (s, uc, n)
- unsigned short *s;
- unsigned int uc;
- int n;
+u16_uctomb (unsigned short *s, unsigned int uc, int n)
{
if (uc < 0x10000 && n > 0)
{
#include <stddef.h>
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int
-u8_uctomb_aux PARAMS ((unsigned char *s, unsigned int uc, int n));
-static inline int
-u8_uctomb PARAMS ((unsigned char *s, unsigned int uc, int n));
-
/* Return the length (number of units) of the UTF-8 representation of uc,
after storing it at S. Return -1 upon failure, -2 if the number of
available units, N, is too small. */
static int
-u8_uctomb_aux (s, uc, n)
- unsigned char *s;
- unsigned int uc;
- int n;
+u8_uctomb_aux (unsigned char *s, unsigned int uc, int n)
{
int count;
}
static inline int
-u8_uctomb (s, uc, n)
- unsigned char *s;
- unsigned int uc;
- int n;
+u8_uctomb (unsigned char *s, unsigned int uc, int n)
{
if (uc < 0x80 && n > 0)
{
int
-unsetenv (name)
- const char *name;
+unsetenv (const char *name)
{
size_t len;
char **ep;
/* Conversion UTF-16 to UCS-4.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#include <stddef.h>
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int
-u16_mbtouc_aux PARAMS ((unsigned int *puc, const unsigned short *s, size_t n));
-static inline int
-u16_mbtouc PARAMS ((unsigned int *puc, const unsigned short *s, size_t n));
-
/* Return the length (number of units) of the first character in S, putting
its 'ucs4_t' representation in *PUC. */
static int
-u16_mbtouc_aux (puc, s, n)
- unsigned int *puc;
- const unsigned short *s;
- size_t n;
+u16_mbtouc_aux (unsigned int *puc, const unsigned short *s, size_t n)
{
unsigned short c = *s;
return 1;
}
static inline int
-u16_mbtouc (puc, s, n)
- unsigned int *puc;
- const unsigned short *s;
- size_t n;
+u16_mbtouc (unsigned int *puc, const unsigned short *s, size_t n)
{
unsigned short c = *s;
#include <stddef.h>
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int
-u8_mbtouc_aux PARAMS ((unsigned int *puc, const unsigned char *s, size_t n));
-static inline int
-u8_mbtouc PARAMS ((unsigned int *puc, const unsigned char *s, size_t n));
-
/* Return the length (number of units) of the first character in S, putting
its 'ucs4_t' representation in *PUC. */
static int
-u8_mbtouc_aux (puc, s, n)
- unsigned int *puc;
- const unsigned char *s;
- size_t n;
+u8_mbtouc_aux (unsigned int *puc, const unsigned char *s, size_t n)
{
unsigned char c = *s;
return 1;
}
static inline int
-u8_mbtouc (puc, s, n)
- unsigned int *puc;
- const unsigned char *s;
- size_t n;
+u8_mbtouc (unsigned int *puc, const unsigned char *s, size_t n)
{
unsigned char c = *s;
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <stdarg.h>
#include <math.h>
-#include "libstdarg.h"
-
#ifdef TEST
size_t global_total_width;
#endif
static int
-int_vasprintf (result, format, args)
- char **result;
- const char *format;
- va_list *args;
+int_vasprintf (char **result, const char *format, va_list *args)
{
const char *p = format;
/* Add one to make sure that it is never zero, which might cause malloc
}
int
-vasprintf (result, format, args)
- char **result;
- const char *format;
- va_list args;
+vasprintf (char **result, const char *format, va_list args)
{
return int_vasprintf (result, format, &args);
}
int
-asprintf VA_PARAMS ((char **result, const char *format, ...),
- (result, format, va_alist)
- char **result;
- const char *format;
- va_dcl)
+asprintf (char **result, const char *format, ...)
{
va_list args;
int done;
- VA_START (args, format);
+ va_start (args, format);
done = vasprintf (result, format, args);
va_end (args);
#include <float.h>
void
-checkit VA_PARAMS ((const char* format, ...),
- (format, va_alist)
- const char *format;
- va_dcl)
+checkit (const char* format, ...)
{
va_list args;
char *result;
- VA_START (args, format);
+ va_start (args, format);
vasprintf (&result, format, args);
if (strlen (result) < global_total_width)
printf ("PASS: ");
#ifndef _VASPRINTF_H
#define _VASPRINTF_H
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
-
#if HAVE_VASPRINTF
/* Get asprintf(), vasprintf() declarations. */
#else
/* Get va_list. */
-#if __STDC__ || defined __cplusplus
-# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
+#include <stdarg.h>
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
extern "C" {
#endif
-extern int asprintf PARAMS ((char **result, const char *format, ...))
+extern int asprintf (char **result, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
-extern int vasprintf PARAMS ((char **result, const char *format, va_list args))
+extern int vasprintf (char **result, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)));
#ifdef __cplusplus
int
-wait_subprocess (child, progname, exit_on_error)
- pid_t child;
- const char *progname;
- bool exit_on_error;
+wait_subprocess (pid_t child, const char *progname, bool exit_on_error)
{
/* waitpid() is just as portable as wait() nowadays. */
WAIT_T status;
/* Waiting for a subprocess to finish.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
/* Wait for a subprocess to finish. Return its exit code.
If it didn't terminate correctly, exit if exit_on_error is true, otherwise
return 127. */
-extern int wait_subprocess PARAMS ((pid_t child, const char *progname,
- bool exit_on_error));
+extern int wait_subprocess (pid_t child, const char *progname,
+ bool exit_on_error);
#endif /* _WAIT_PROCESS_H */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdarg.h>
#include "error.h"
#include "progname.h"
#include "exit.h"
#include "mbswidth.h"
#include "vasprintf.h"
-#include "libstdarg.h"
#include "gettext.h"
#define _(str) gettext (str)
/* Format a message and return the freshly allocated resulting string. */
char *
-xasprintf VA_PARAMS ((const char *format, ...),
- (format, va_alist)
- const char *format;
- va_dcl)
+xasprintf (const char *format, ...)
{
va_list args;
char *result;
- VA_START (args, format);
+ va_start (args, format);
if (vasprintf (&result, format, args) < 0)
error (EXIT_FAILURE, 0, _("memory exhausted"));
va_end (args);
the same amount of spaces. Reuse the spaces of the previous call if
PREFIX is NULL. Free the PREFIX and MESSAGE when done. */
void
-multiline_warning (prefix, message)
- char *prefix;
- char *message;
+multiline_warning (char *prefix, char *message)
{
static int width;
const char *cp;
the same amount of spaces. Reuse the spaces of the previous call if
PREFIX is NULL. Free the PREFIX and MESSAGE when done. */
void
-multiline_error (prefix, message)
- char *prefix;
- char *message;
+multiline_error (char *prefix, char *message)
{
if (prefix != NULL)
++error_message_count;
/* Multiline error-reporting functions.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#include "error.h"
/* Format a message and return the freshly allocated resulting string. */
-#if defined (__STDC__) && __STDC__
extern char *xasprintf (const char *format, ...)
__attribute__ ((__format__ (__printf__, 1, 2)));
-#else
-extern char *xasprintf ();
-#endif
/* Emit a multiline warning to stderr, consisting of MESSAGE, with the
first line prefixed with PREFIX and the remaining lines prefixed with
the same amount of spaces. Reuse the spaces of the previous call if
PREFIX is NULL. Free the PREFIX and MESSAGE when done. */
-extern void multiline_warning PARAMS ((char *prefix, char *message));
+extern void multiline_warning (char *prefix, char *message);
/* Emit a multiline error to stderr, consisting of MESSAGE, with the
first line prefixed with PREFIX and the remaining lines prefixed with
the same amount of spaces. Reuse the spaces of the previous call if
PREFIX is NULL. Free the PREFIX and MESSAGE when done. */
-extern void multiline_error PARAMS ((char *prefix, char *message));
+extern void multiline_error (char *prefix, char *message);
#endif /* _XERROR_H */
/* xgetcwd -- return current directory with unlimited length
- Copyright (C) 1995, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2001-2002 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
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif
-#endif
-
/* Wrapper function with error checking for standard function. */
-extern char *xgetcwd PARAMS ((void));
+extern char *xgetcwd (void);
/* xmalloc.c -- malloc with out of memory checking
- Copyright (C) 1990-1996, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1990-1996, 2000-2002 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
#define _(str) gettext (str)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void *fixup_null_alloc PARAMS ((size_t n));
-
-
/* Exit value when the requested amount of memory is not available.
The caller may set it to some other value. */
int xmalloc_exit_failure = EXIT_FAILURE;
static void *
-fixup_null_alloc (n)
- size_t n;
+fixup_null_alloc (size_t n)
{
void *p;
/* Allocate N bytes of memory dynamically, with error checking. */
void *
-xmalloc (n)
- size_t n;
+xmalloc (size_t n)
{
void *p;
/* Allocate memory for N elements of S bytes, with error checking. */
void *
-xcalloc (n, s)
- size_t n, s;
+xcalloc (size_t n, size_t s)
{
void *p;
If P is NULL, run xmalloc. */
void *
-xrealloc (p, n)
- void *p;
- size_t n;
+xrealloc (void *p, size_t n)
{
if (p == NULL)
return xmalloc (n);
/* malloc with out of memory checking.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
/* Defined in xmalloc.c. */
/* Allocate SIZE bytes of memory dynamically, with error checking. */
-extern void *xmalloc PARAMS ((size_t size));
+extern void *xmalloc (size_t size);
/* Allocate memory for NMEMB elements of SIZE bytes, with error checking. */
-extern void *xcalloc PARAMS ((size_t nmemb, size_t size));
+extern void *xcalloc (size_t nmemb, size_t size);
/* Change the size of an allocated block of memory PTR to SIZE bytes,
with error checking. If PTR is NULL, run xmalloc. */
-extern void *xrealloc PARAMS ((void *ptr, size_t size));
+extern void *xrealloc (void *ptr, size_t size);
/* Defined in xstrdup.c. */
/* Return a newly allocated copy of STRING. */
-extern char *xstrdup PARAMS ((const char *string));
+extern char *xstrdup (const char *string);
#endif /* _XMALLOC_H */
/* Setting environment variables, with out-of-memory checking.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 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
If REPLACE is nonzero, overwrite an existing value.
With error checking. */
void
-xsetenv (name, value, replace)
- const char *name;
- const char *value;
- int replace;
+xsetenv (const char *name, const char *value, int replace)
{
if (setenv (name, value, replace) < 0)
error (EXIT_FAILURE, 0, _("memory exhausted"));
/* Set NAME to VALUE in the environment.
If REPLACE is nonzero, overwrite an existing value.
With error checking. */
-extern void xsetenv PARAMS ((const char *name, const char *value, int replace));
+extern void xsetenv (const char *name, const char *value, int replace);
#ifdef __cplusplus
}
/* xstrdup.c -- copy a string with out of memory checking
- Copyright (C) 1990, 1996, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1996, 2000-2002 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
/* Return a newly allocated copy of STRING. */
char *
-xstrdup (string)
- const char *string;
+xstrdup (const char *string)
{
return strcpy (xmalloc (strlen (string) + 1), string);
}
+2002-11-13 Bruno Haible <bruno@clisp.org>
+
+ Assume ANSI C.
+ * libstdarg.h: Remove file.
+ * Makefile.am (lib_asprintf_EXTRASOURCES): Remove libstdarg.h.
+ * asnprintf.c: Include <stdarg.h> instead of libstdarg.h.
+ (asnprintf): Use ANSI C function declarations. Use va_start instead of
+ VA_START.
+ * asprintf.c: Include <stdarg.h> instead of libstdarg.h.
+ (asnprintf): Use ANSI C function declarations. Use va_start instead of
+ VA_START.
+ * printf-args.h (PARAMS): Remove macro.
+ (printf_fetchargs): Use ANSI C function declarations.
+ * printf-args.c (printf_fetchargs): Likewise.
+ * printf-parse.h (printf_parse): Likewise.
+ * printf-parse.c (printf_parse): Likewise.
+ * vasnprintf.h (PARAMS): Remove macro.
+ (asnprintf, vasnprintf): Use ANSI C function declarations.
+ * vasnprintf.c (vasnprintf): Likewise.
+ * vasprintf.h (PARAMS): Remove macro.
+ (asprintf, vasprintf): Use ANSI C function declarations.
+ * vasprintf.c (vasprintf): Likewise.
+
2002-10-27 Bruno Haible <bruno@clisp.org>
* printf-args.h, printf-args.c: New files.
printf-parse.h printf-parse.c \
vasnprintf.h vasnprintf.c asnprintf.c \
vasprintf.h vasprintf.c asprintf.c \
- liballoca.h \
- libstdarg.h
+ liballoca.h
lib-asprintf.lo: $(lib_asprintf_EXTRASOURCES)
/* Specification. */
#include "vasnprintf.h"
-#include "libstdarg.h"
+#include <stdarg.h>
char *
-asnprintf VA_PARAMS ((char *resultbuf, size_t *lengthp, const char *format, ...),
- (resultbuf, lengthp, format, va_alist)
- char *resultbuf;
- size_t *lengthp;
- const char *format;
- va_dcl)
+asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
{
va_list args;
char *result;
- VA_START (args, format);
+ va_start (args, format);
result = vasnprintf (resultbuf, lengthp, format, args);
va_end (args);
return result;
/* Specification. */
#include "vasprintf.h"
-#include "libstdarg.h"
+#include <stdarg.h>
int
-asprintf VA_PARAMS ((char **resultp, const char *format, ...),
- (resultp, format, va_alist)
- char **resultp;
- const char *format;
- va_dcl)
+asprintf (char **resultp, const char *format, ...)
{
va_list args;
int result;
- VA_START (args, format);
+ va_start (args, format);
result = vasprintf (resultp, format, args);
va_end (args);
return result;
+++ /dev/null
-/* <stdarg.h> with fallback on <varargs.h> for old platforms.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU Library General Public License as published
- by the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-#ifndef _LIBSTDARG_H
-#define _LIBSTDARG_H
-
-#if __STDC__ || defined __SUNPRO_C || defined __cplusplus
-# include <stdarg.h>
-# define VA_START(args, lastarg) va_start (args, lastarg)
-# define VA_PARAMS(stdc_params, oldc_params) stdc_params
-#else
-# include <varargs.h>
-# define VA_START(args, lastarg) va_start (args)
-# define VA_PARAMS(stdc_params, oldc_params) oldc_params
-#endif
-
-#endif /* _LIBSTDARG_H */
STATIC
#endif
int
-printf_fetchargs (args, a)
- va_list args;
- arguments *a;
+printf_fetchargs (va_list args, arguments *a)
{
unsigned int i;
argument *ap;
#endif
/* Get va_list. */
-#if __STDC__ || defined __SUNPRO_C || defined __cplusplus
-# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
-
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
+#include <stdarg.h>
/* Argument types */
#else
extern
#endif
-int printf_fetchargs PARAMS ((va_list args, arguments *a));
+int printf_fetchargs (va_list args, arguments *a);
#endif /* _PRINTF_ARGS_H */
STATIC
#endif
int
-printf_parse (format, d, a)
- const char *format;
- char_directives *d;
- arguments *a;
+printf_parse (const char *format, char_directives *d, arguments *a)
{
const char *cp = format; /* pointer into format */
int arg_posn = 0; /* number of regular arguments consumed */
#else
extern
#endif
-int printf_parse PARAMS ((const char *format, char_directives *d,
- arguments *a));
+int printf_parse (const char *format, char_directives *d, arguments *a);
#endif /* _PRINTF_PARSE_H */
#endif
char *
-vasnprintf (resultbuf, lengthp, format, args)
- char *resultbuf;
- size_t *lengthp;
- const char *format;
- va_list args;
+vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
{
char_directives d;
arguments a;
#ifndef _VASNPRINTF_H
#define _VASNPRINTF_H
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
-
/* Get va_list. */
-#if __STDC__ || defined __SUNPRO_C || defined __cplusplus
-# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
+#include <stdarg.h>
/* Get size_t. */
#include <stddef.h>
extern "C" {
#endif
-extern char * asnprintf PARAMS ((char *resultbuf, size_t *lengthp, const char *format, ...))
+extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
-extern char * vasnprintf PARAMS ((char *resultbuf, size_t *lengthp, const char *format, va_list args))
+extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 3, 0)));
#ifdef __cplusplus
#include "vasnprintf.h"
int
-vasprintf (resultp, format, args)
- char **resultp;
- const char *format;
- va_list args;
+vasprintf (char **resultp, const char *format, va_list args)
{
size_t length;
char *result = vasnprintf (NULL, &length, format, args);
#ifndef _VASPRINTF_H
#define _VASPRINTF_H
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
-
/* Get va_list. */
-#if __STDC__ || defined __SUNPRO_C || defined __cplusplus
-# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
+#include <stdarg.h>
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
extern "C" {
#endif
-extern int asprintf PARAMS ((char **result, const char *format, ...))
+extern int asprintf (char **result, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
-extern int vasprintf PARAMS ((char **result, const char *format, va_list args))
+extern int vasprintf (char **result, const char *format, va_list args)
__attribute__ ((__format__ (__printf__, 2, 0)));
#ifdef __cplusplus
+2002-11-13 Bruno Haible <bruno@clisp.org>
+
+ Assume ANSI C.
+ * uniname.h (PARAMS): Remove macro.
+ (unicode_character_name, unicode_name_character): Use ANSI C function
+ declarations.
+ * uniname.c (unicode_name_word, unicode_name_word_lookup,
+ unicode_character_name, unicode_name_character): Likewise.
+ * test-names.c (getfield, fill_names, main): Likewise.
+
2002-08-06 Bruno Haible <bruno@clisp.org>
* gettext-0.11.5 released.
Reads up to (but excluding) DELIM.
Returns 1 when a field was successfully read, otherwise 0. */
static int
-getfield (stream, buffer, delim)
- FILE *stream;
- char *buffer;
- int delim;
+getfield (FILE *stream, char *buffer, int delim)
{
int count = 0;
int c;
/* Stores in unicode_names[] the relevant contents of the UnicodeData.txt
file. */
static void
-fill_names (unicodedata_filename)
- const char *unicodedata_filename;
+fill_names (const char *unicodedata_filename)
{
unsigned int i;
FILE *stream;
}
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
int error = 0;
#define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static const char * unicode_name_word PARAMS ((unsigned int index, unsigned int *lengthp));
-static int unicode_name_word_lookup PARAMS ((const char *word, unsigned int length));
-
-
/* Table of Unicode character names, derived from UnicodeData.txt. */
#define uint16_t unsigned short
#define uint32_t unsigned int
/* Returns the word with a given index. */
static const char *
-unicode_name_word (index, lengthp)
- unsigned int index;
- unsigned int *lengthp;
+unicode_name_word (unsigned int index, unsigned int *lengthp)
{
unsigned int i1;
unsigned int i2;
/* Looks up the index of a word. */
static int
-unicode_name_word_lookup (word, length)
- const char *word;
- unsigned int length;
+unicode_name_word_lookup (const char *word, unsigned int length)
{
if (length > 0 && length < SIZEOF (unicode_name_by_length) - 1)
{
/* Looks up the name of a Unicode character, in uppercase ASCII.
Returns the filled buf, or NULL if the character does not have a name. */
char *
-unicode_character_name (c, buf)
- unsigned int c;
- char *buf;
+unicode_character_name (unsigned int c, char *buf)
{
if (c >= 0xAC00 && c <= 0xD7A3)
{
/* Looks up the Unicode character with a given name, in upper- or lowercase
ASCII. Returns the character if found, or UNINAME_INVALID if not found. */
unsigned int
-unicode_name_character (name)
- const char *name;
+unicode_name_character (const char *name)
{
unsigned int len = strlen (name);
if (len > 1 && len <= UNICODE_CHARNAME_MAX_LENGTH)
#ifndef _UNINAME_H
#define _UNINAME_H
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
-
/* Required size of buffer for a Unicode character name. */
#define UNINAME_MAX 256
/* Looks up the name of a Unicode character, in uppercase ASCII.
Returns the filled buf, or NULL if the character does not have a name. */
-extern char * unicode_character_name PARAMS ((unsigned int uc, char *buf));
+extern char * unicode_character_name (unsigned int uc, char *buf);
/* Looks up the Unicode character with a given name, in upper- or lowercase
ASCII. Returns the character if found, or UNINAME_INVALID if not found. */
-extern unsigned int unicode_name_character PARAMS ((const char *name));
+extern unsigned int unicode_name_character (const char *name);
#define UNINAME_INVALID ((unsigned int) 0xFFFF)
#endif /* _UNINAME_H */
+2002-11-13 Bruno Haible <bruno@clisp.org>
+
+ Assume ANSI C.
+ * c-bs-a.m4: Remove file.
+ * Makefile.am (EXTRA_DIST): Remove it.
+
2002-11-08 Bruno Haible <bruno@clisp.org>
* progtest.m4 (AM_PATH_PROG_WITH_TEST): Portability to OS/2.
# find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \
# |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
EXTRA_DIST = README \
-backupfile.m4 c-bs-a.m4 codeset.m4 error.m4 flex.m4 fnmatch.m4 gcj.m4 \
+backupfile.m4 codeset.m4 error.m4 flex.m4 fnmatch.m4 gcj.m4 \
getline.m4 gettext.m4 glibc21.m4 hostname.m4 iconv.m4 intdiv0.m4 intmax.m4 \
inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 javacomp.m4 \
javaexec.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 libtool.m4 \
+++ /dev/null
-# c-bs-a.m4 serial 4 (fileutils-4.1.3)
-dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License. As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Paul Eggert.
-
-AC_DEFUN([AC_C_BACKSLASH_A],
-[
- AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
- [AC_TRY_COMPILE([],
- [
-#if '\a' == 'a'
- syntax error;
-#endif
- char buf['\a' == 'a' ? -1 : 1];
- buf[0] = '\a';
- return buf[0] != "\a"[0];
- ],
- ac_cv_c_backslash_a=yes,
- ac_cv_c_backslash_a=no)])
- if test $ac_cv_c_backslash_a = yes; then
- AC_DEFINE(HAVE_C_BACKSLASH_A, 1,
- [Define if backslash-a works in C strings.])
- fi
-])
+2002-11-13 Bruno Haible <bruno@clisp.org>
+
+ Assume ANSI C.
+ * tcl_gettext.c (tcl_gettext, tcl_textdomain, tcl_bindtextdomain):
+ Use ANSI C function declarations.
+
2002-10-25 Karl Eichwalder <ke@suse.de>
* po-compat.el (po-find-file-coding-system-guts): Provide the old
/* tcl_gettext - Module implementing gettext interface for Tcl.
- Copyright (C) 1995, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1998, 2002 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, December 1995.
This program is free software; you can redistribute it and/or modify
/* Data for Tcl interpreter interface. */
#include "tcl.h"
-/* Prototypes for local functions. */
-static int
-tcl_gettext (ClientData client_data, Tcl_Interp *interp, int argc,
- char *argv[]);
-static int
-tcl_textdomain (ClientData client_data, Tcl_Interp *interp, int argc,
- char *argv[]);
-static int
-tcl_bindtextdomain (ClientData client_data, Tcl_Interp *interp, int argc,
- char *argv[]);
-
-
-/* Initialization functions. Called from the tclAppInit.c/tkAppInit.c
- or while the dynamic loading with Tcl7.x, x>= 5. */
-int
-Gettext_Init (interp)
- Tcl_Interp *interp;
-{
- Tcl_CreateCommand (interp, "gettext", tcl_gettext, (ClientData) 0,
- (Tcl_CmdDeleteProc *) NULL);
- Tcl_CreateCommand (interp, "textdomain", tcl_textdomain, (ClientData) 0,
- (Tcl_CmdDeleteProc *) NULL);
- Tcl_CreateCommand (interp, "bindtextdomain", tcl_bindtextdomain,
- (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
-
- return TCL_OK;
-}
-
static int
-tcl_gettext (client_data, interp, argc, argv)
- ClientData client_data;
- Tcl_Interp *interp;
- int argc;
- char *argv[];
+tcl_gettext (ClientData client_data, Tcl_Interp *interp,
+ int argc, char *argv[])
{
const char *domainname = NULL;
int category = LC_MESSAGES;
static int
-tcl_textdomain (client_data, interp, argc, argv)
- ClientData client_data;
- Tcl_Interp *interp;
- int argc;
- char *argv[];
+tcl_textdomain (ClientData client_data, Tcl_Interp *interp,
+ int argc, char *argv[])
{
if (argc != 2)
{
static int
-tcl_bindtextdomain (client_data, interp, argc, argv)
- ClientData client_data;
- Tcl_Interp *interp;
- int argc;
- char *argv[];
+tcl_bindtextdomain (ClientData client_data, Tcl_Interp *interp,
+ int argc, char *argv[])
{
if (argc != 3)
{
return bindtextdomain (argv[1], argv[2]) == NULL ? TCL_ERROR : TCL_OK;
}
+
+
+/* Initialization functions. Called from the tclAppInit.c/tkAppInit.c
+ or while the dynamic loading with Tcl7.x, x>= 5. */
+int
+Gettext_Init (Tcl_Interp *interp)
+{
+ Tcl_CreateCommand (interp, "gettext", tcl_gettext, (ClientData) 0,
+ (Tcl_CmdDeleteProc *) NULL);
+ Tcl_CreateCommand (interp, "textdomain", tcl_textdomain, (ClientData) 0,
+ (Tcl_CmdDeleteProc *) NULL);
+ Tcl_CreateCommand (interp, "bindtextdomain", tcl_bindtextdomain,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+
+ return TCL_OK;
+}
cfg["HAVE_ICONV"] = 1;
cfg["ICONV_CONST"] = "const";
cfg["_GNU_SOURCE"] = 1;
- cfg["HAVE_C_BACKSLASH_A"] = 1;
cfg["HAVE_UNSIGNED_LONG_LONG"] = 1;
cfg["HAVE_PTRDIFF_T"] = 1;
cfg["vfork"] = "fork";
+2002-11-13 Bruno Haible <bruno@clisp.org>
+
+ Assume ANSI C.
+ * dir-list.h (dir_list_append, dir_list_nth, dir_list_save_reset,
+ dir_list_restore): Use ANSI C function declarations.
+ * dir-list.c (dir_list_append, dir_list_nth, dir_list_restore):
+ Likewise.
+ * file-list.h (read_names_from_file): Likewise.
+ * file-list.c (read_names_from_file): Likewise.
+ * format.h (struct formatstring_parser, get_c99_format_directives):
+ Likewise.
+ * format-awk.c (numbered_arg_compare, format_parse, format_free,
+ format_get_number_of_directives, format_check, format_print): Likewise.
+ * format-c.c (numbered_arg_compare, format_parse, format_free,
+ format_get_number_of_directives, format_check,
+ get_c99_format_directives, format_print): Likewise.
+ * format-elisp.c (numbered_arg_compare, format_parse, format_free,
+ format_get_number_of_directives, format_check, format_print): Likewise.
+ * format-java.c (message_format_parse, date_format_parse,
+ number_format_parse, choice_format_parse, numbered_arg_compare,
+ format_parse, format_free, format_get_number_of_directives,
+ format_check, format_print): Likewise.
+ * format-librep.c (numbered_arg_compare, format_parse, format_free,
+ format_get_number_of_directives, format_check, format_print): Likewise.
+ * format-lisp.c (verify_element, verify_list, free_element, free_list,
+ copy_element, copy_list, equal_element, equal_list,
+ ensure_initial_alloc, grow_initial_alloc, ensure_repeated_alloc,
+ grow_repeated_alloc, normalize_outermost_list, normalize_list,
+ is_empty_list, unfold_loop, rotate_loop, initial_splitelement,
+ initial_unshare, shift_list, make_intersected_element,
+ append_repeated_to_initial, backtrack_in_initial,
+ make_intersected_list, make_intersection_with_empty_list,
+ intersection, make_union_element, make_union_list,
+ make_union_with_empty_list, union, is_required,
+ add_required_constraint, add_end_constraint, add_type_constraint,
+ add_listtype_constraint, add_req_type_constraint,
+ add_req_listtype_constraint, make_repeated_list_of_lists,
+ make_repeated_list, check_params, nocheck_params, parse_upto,
+ format_parse, format_free, format_get_number_of_directives,
+ format_check, print_element, print_list, format_print): Likewise.
+ * format-pascal.c (numbered_arg_compare, format_parse, format_free,
+ format_get_number_of_directives, format_check, format_print): Likewise.
+ * format-php.c (numbered_arg_compare, format_parse, format_free,
+ format_get_number_of_directives, format_check, format_print): Likewise.
+ * format-python.c (named_arg_compare, format_parse, format_free,
+ format_get_number_of_directives, format_check, format_print): Likewise.
+ * format-tcl.c (numbered_arg_compare, format_parse, format_free,
+ format_get_number_of_directives, format_check, format_print): Likewise.
+ * format-ycp.c (format_parse, format_free,
+ format_get_number_of_directives, format_check, format_print): Likewise.
+ * gettext.c (main, usage, expand_escape): Likewise.
+ * hostname.c (main, usage): Likewise.
+ * message.h (possible_format_p, message_alloc, message_free,
+ message_comment_append, message_comment_dot_append,
+ message_comment_filepos, message_copy, message_list_alloc,
+ message_list_free, message_list_append, message_list_prepend,
+ message_list_delete_nth, message_predicate_ty,
+ message_list_remove_if_not, message_list_search,
+ message_list_search_fuzzy, message_list_list_alloc,
+ message_list_list_free, message_list_list_append,
+ message_list_list_append_list, message_list_list_search,
+ message_list_list_search_fuzzy, msgdomain_alloc, msgdomain_free,
+ msgdomain_list_alloc, msgdomain_list_free, msgdomain_list_append,
+ msgdomain_list_append_list, msgdomain_list_sublist,
+ msgdomain_list_search, msgdomain_list_search_fuzzy): Likewise.
+ * message.c (possible_format_p, message_alloc, message_free,
+ message_comment_append, message_comment_dot_append,
+ message_comment_filepos, message_copy, message_list_alloc,
+ message_list_free, message_list_append, message_list_prepend,
+ message_list_delete_nth, message_list_remove_if_not,
+ message_list_search, message_list_search_fuzzy_inner,
+ message_list_search_fuzzy, message_list_list_free,
+ message_list_list_append, message_list_list_append_list,
+ message_list_list_search, message_list_list_search_fuzzy,
+ msgdomain_alloc, msgdomain_free, msgdomain_list_alloc,
+ msgdomain_list_free, msgdomain_list_append,
+ msgdomain_list_append_list, msgdomain_list_sublist,
+ msgdomain_list_search, msgdomain_list_search_fuzzy): Likewise.
+ * msgattrib.c (main, usage, is_message_selected, process_message_list,
+ process_msgdomain_list): Likewise.
+ * msgcat.c (main, usage): Likewise.
+ * msgcmp.c (main, usage, is_message_selected, remove_obsoletes,
+ match_domain, compare): Likewise.
+ * msgcomm.c (main, usage): Likewise.
+ * msgconv.c (locale_charset, main, usage): Likewise.
+ * msgen.c (main, usage): Likewise.
+ * msgexec.c (main, usage, nonintr_close, process_string,
+ process_message, process_message_list, process_msgdomain_list):
+ Likewise.
+ * msgfilter.c (main, usage, nonintr_close, nonintr_read, nonintr_write,
+ nonintr_select, process_string, process_message, process_message_list,
+ process_msgdomain_list): Likewise.
+ * msgfmt.c (main, usage, add_mo_suffix, new_domain, is_nonobsolete,
+ sigfpe_handler, check_plural_eval, check_plural, check_pair,
+ check_header_entry, format_constructor, format_debrief,
+ format_directive_domain, format_directive_message,
+ format_comment_special, read_po_file): Likewise.
+ * msggrep.c (main, no_pass, usage, filename_list_match, nonintr_close,
+ is_string_selected, is_message_selected, process_message_list,
+ process_msgdomain_list): Likewise.
+ * msginit.c (locale_charset, _nl_locale_name, _nl_expand_alias, main,
+ usage, catalogname_for_locale, language_of_locale, po_revision_date,
+ content_type, fields, get_field, put_field, subst_string,
+ subst_string_list, fill_header): Likewise.
+ * msgl-ascii.h (is_ascii_string, is_ascii_string_list,
+ is_ascii_message, is_ascii_message_list): Likewise.
+ * msgl-ascii.c (is_ascii_string, is_ascii_string_list,
+ is_ascii_message, is_ascii_message_list): Likewise.
+ * msgl-cat.h (catenate_msgdomain_list): Likewise.
+ * msgl-cat.c (is_message_selected, is_message_needed,
+ is_message_first_needed, catenate_msgdomain_list): Likewise.
+ * msgl-charset.h (compare_po_locale_charsets): Likewise.
+ * msgl-charset.c (locale_charset, compare_po_locale_charsets):
+ Likewise.
+ * msgl-english.h (msgdomain_list_english): Likewise.
+ * msgl-english.c (msgdomain_list_english): Likewise.
+ * msgl-equal.h (string_list_equal, message_equal, message_list_equal,
+ msgdomain_list_equal): Likewise.
+ * msgl-equal.c (msgstr_equal, msgstr_equal_ignoring_potcdate,
+ pos_equal, string_list_equal, message_equal, message_list_equal,
+ msgdomain_equal, msgdomain_list_equal): Likewise.
+ * msgl-iconv.h (convert_string, iconv_message_list,
+ iconv_msgdomain_list): Likewise.
+ * msgl-iconv.c (iconv_string, convert_string, convert_string_list,
+ convert_msgid, convert_msgstr, iconv_message_list,
+ iconv_msgdomain_list): Likewise.
+ * msgmerge.c (main, usage, compendium, msgfmt_check_pair_fails,
+ message_merge, match_domain, merge): Likewise.
+ * msgunfmt.c (main, usage): Likewise.
+ * msguniq.c (main, usage): Likewise.
+ * ngettext.c (main, usage, expand_escape): Likewise.
+ * open-po.h (open_po_file): Likewise.
+ * open-po.c (open_po_file): Likewise.
+ * po-charset.h (po_charset_canonicalize, po_charset_ascii_compatible,
+ po_is_charset_weird, po_is_charset_weird_cjk, po_lex_charset_init,
+ po_lex_charset_set, po_lex_charset_close): Likewise.
+ * po-charset.c (po_charset_canonicalize, po_charset_ascii_compatible,
+ po_is_charset_weird, po_is_charset_weird_cjk, po_lex_charset_set):
+ Likewise.
+ * po-gram.h (po_gram_parse): Likewise.
+ * po-hash-gen.y (yyerror, yylex, po_hash): Likewise.
+ * po-hash.h (po_hash): Likewise.
+ * po-lex.h (lex_start, lex_end, lex_open, lex_close, po_gram_lex,
+ po_lex_pass_comments, po_lex_pass_obsolete_entries, po_gram_error,
+ po_gram_error_at_line): Likewise.
+ * po-lex.c: Include <stdarg.h> instead of libstdarg.h.
+ (ALERT_CHAR): Remove macro.
+ (po_gram_error, po_gram_error_at_line): Use ANSI C function
+ declarations. Use va_start instead of VA_START.
+ (memcpy_small, mb_iseof, mb_ptr, mb_len, mb_iseq, mb_isnul, mb_cmp,
+ mb_equal, mb_isascii, mb_width, mb_putc, mb_setascii, mb_copy,
+ mbfile_init, mbfile_getc, mbfile_ungetc, lex_start, lex_open,
+ lex_getc, lex_ungetc, keyword_p, po_lex_pass_comments,
+ po_lex_pass_obsolete_entries): Use ANSI C function declarations.
+ * po-time.h (po_strftime): Likewise.
+ * po-time.c (difftm, po_strftime): Likewise.
+ * po.h (struct po_method_ty, po_alloc, po_scan, po_scan_file, po_free,
+ po_callback_domain, po_callback_message, po_callback_comment,
+ po_callback_comment_dot, po_callback_comment_filepos,
+ po_parse_comment_special): Likewise.
+ * po.c (po_alloc, po_free, po_parse_brief, po_parse_debrief, po_scan,
+ po_scan_file, po_directive_domain, po_callback_domain,
+ po_directive_message, po_callback_message, po_comment_special,
+ po_comment, po_comment_dot, po_callback_comment, po_comment_filepos,
+ po_callback_comment_filepos, po_parse_comment_special): Likewise.
+ * read-java.h (msgdomain_read_java): Likewise.
+ * read-java.c (execute_and_read_po_output, msgdomain_read_java):
+ Likewise.
+ * read-mo.h (read_mo_file): Likewise.
+ * read-mo.c (read_binary_mo_file, get_uint32, get_string,
+ get_sysdep_string, read_mo_file): Likewise.
+ * read-po.h (read_po, read_po_file): Likewise.
+ * read-po.c (readall_constructor, readall_destructor,
+ readall_directive_domain, readall_directive_message,
+ readall_parse_brief, readall_comment, readall_comment_dot,
+ readall_comment_special, readall_comment_filepos, read_po,
+ read_po_file): Likewise.
+ * read-tcl.h (msgdomain_read_tcl): Likewise.
+ * read-tcl.c (msgdomain_read_tcl): Likewise.
+ * str-list.h (string_list_init, string_list_alloc, string_list_append,
+ string_list_append_unique, string_list_destroy, string_list_free,
+ string_list_concat, string_list_concat_destroy, string_list_join,
+ string_list_member): Likewise.
+ * str-list.c (string_list_init, string_list_append,
+ string_list_append_unique, string_list_destroy, string_list_free,
+ string_list_concat, string_list_concat_destroy, string_list_join,
+ string_list_member): Likewise.
+ * urlget.c (main, usage, cat_file, execute_it, fetch): Likewise.
+ * write-java.h (msgdomain_write_java): Likewise.
+ * write-java.c (check_resource_name, string_hashcode,
+ compute_hashsize, compare_index, compute_table_items,
+ write_java_string, write_java_msgstr, write_lookup_code,
+ is_expression_boolean, write_java_expression, write_java_code,
+ cleanup, msgdomain_write_java): Likewise.
+ * write-mo.h (msgdomain_write_mo): Likewise.
+ * write-mo.c (compare_id, write_table, msgdomain_write_mo): Likewise.
+ * write-po.h (message_page_width_set, message_page_width_ignore,
+ message_print_style_indent, message_print_style_uniforum,
+ message_print_style_escape, msgdomain_list_print,
+ msgdomain_list_sort_by_msgid, msgdomain_list_sort_by_filepos):
+ Likewise.
+ * write-po.c (message_page_width_set, message_print_style_escape,
+ make_format_description_string, significant_format_p,
+ has_significant_format_p, make_c_width_description_string,
+ memcpy_small, wrap, print_blank_line, message_print,
+ message_print_obsolete, msgdomain_list_print, cmp_by_msgid,
+ msgdomain_list_sort_by_msgid, cmp_filepos,
+ msgdomain_list_sort_filepos, cmp_by_filepos,
+ msgdomain_list_sort_by_filepos): Likewise.
+ * write-tcl.h (msgdomain_write_tcl): Likewise.
+ * write-tcl.c (write_tcl_string, write_msg, msgdomain_write_tcl):
+ Likewise.
+ * x-awk.h (extract_awk, x_awk_keyword, x_awk_extract_all): Likewise.
+ * x-awk.c (ALERT_CHAR): Remove macro.
+ (x_awk_keyword, phase1_ungetc, phase2_ungetc, free_token, x_awk_lex,
+ extract_parenthesized, extract_awk): Use ANSI C function declarations.
+ * x-c.h (extract_c, x_c_extract_all, x_c_keyword, x_c_any_keywords,
+ x_c_trigraphs): Likewise.
+ * x-c.c (ALERT_CHAR): Remove macro.
+ (x_c_keyword, phase1_ungetc, phase2_ungetc, phase3_ungetc,
+ comment_add, comment_line_end, phase4_ungetc, phase7_ungetc,
+ free_token, phase5_get, phaseX_get, phase6_get, phase6_unget,
+ is_inttypes_macro, phase8a_get, phase8a_unget, phase8_get, x_c_lex,
+ extract_parenthesized, extract_c): Use ANSI C function declarations.
+ * x-elisp.h (extract_elisp, x_elisp_extract_all, x_elisp_keyword):
+ Likewise.
+ * x-elisp.c (ALERT_CHAR): Remove macro.
+ (x_elisp_keyword, do_ungetc, init_token, free_token, grow_token,
+ is_integer, is_float, read_token, comment_add, comment_line_end,
+ free_object, string_of_object, do_getc_escaped, read_object,
+ extract_elisp): Use ANSI C function declarations.
+ * x-glade.h (extract_glade, x_glade_extract_all, x_glade_keyword):
+ Likewise.
+ * x-glade.c (x_glade_keyword, XML_StartElementHandler,
+ XML_EndElementHandler, XML_CharacterDataHandler, XML_CommentHandler,
+ p_XML_ParserCreate, p_XML_SetElementHandler,
+ p_XML_SetCharacterDataHandler, p_XML_SetCommentHandler, p_XML_Parse,
+ p_XML_GetErrorCode, p_XML_GetCurrentLineNumber,
+ p_XML_GetCurrentColumnNumber, p_XML_ParserFree, p_XML_ErrorString,
+ ensure_stack_size, start_element_handler, end_element_handler,
+ character_data_handler, comment_handler, do_extract_glade,
+ extract_glade): Likewise.
+ * x-java.h (extract_java, x_java_keyword, x_java_extract_all):
+ Likewise.
+ * x-java.l (append_char_buf, get_string, destroy_charbuf,
+ update_line_no, strip_ending_spaces, append_strings, isplus, isdot,
+ translate_esc, object_list_destroy, get_num_objects, get_object,
+ add_object, alloc_keyword, tailcmp, do_compare, is_keyword,
+ x_java_keyword, extract_java): Likewise.
+ * x-librep.h (extract_librep, x_librep_extract_all, x_librep_keyword):
+ Likewise.
+ * x-librep.c (ALERT_CHAR): Remove macro.
+ (x_librep_keyword, do_ungetc, init_token, free_token, grow_token,
+ read_token, comment_add, comment_line_end, free_object,
+ string_of_object, do_getc_escaped, read_object, extract_librep): Use
+ ANSI C function declarations.
+ * x-lisp.h (extract_lisp, x_lisp_extract_all, x_lisp_keyword):
+ Likewise.
+ * x-lisp.c (x_lisp_keyword, do_ungetc, syntax_code_of,
+ read_char_syntax, attribute_of, init_token, free_token, grow_token,
+ read_token, has_a_dot, all_a_number, a_letter_to_digit, has_a_digit,
+ has_adjacent_letters, is_potential_number, is_number, upcase_token,
+ downcase_token, case_convert_token, comment_add, comment_line_end,
+ free_object, string_of_object, read_object, extract_lisp): Likewise.
+ * x-php.h (extract_php, x_php_keyword, x_php_extract_all): Likewise.
+ * x-php.c (x_php_keyword, phase1_ungetc, phase2_ungetc, comment_add,
+ comment_line_end, phase3_ungetc, free_token, x_php_lex,
+ extract_parenthesized, extract_php): Likewise.
+ * x-po.h (extract_po): Likewise.
+ * x-po.c (extract_constructor, extract_directive_domain,
+ extract_directive_message, extract_parse_brief, extract_comment,
+ extract_comment_dot, extract_comment_filepos, extract_comment_special,
+ extract_po): Likewise.
+ * x-python.h (extract_python, x_python_keyword, x_python_extract_all):
+ Likewise.
+ * x-python.c (ALERT_CHAR): Remove macro.
+ (x_python_keyword, phase1_ungetc, comment_add, phase2_ungetc,
+ phase7_getuc, phase5_get, phase5_unget, x_python_lex,
+ extract_parenthesized, extract_python): Use ANSI C function
+ declarations.
+ * x-rst.h (extract_rst): Likewise.
+ * x-rst.c (extract_rst): Likewise.
+ * x-smalltalk.h (extract_smalltalk): Likewise.
+ * x-smalltalk.c (phase1_ungetc, comment_add, phase2_get, phase2_unget,
+ x_smalltalk_lex, extract_smalltalk): Likewise.
+ * x-tcl.h (extract_tcl, x_tcl_extract_all, x_tcl_keyword): Likewise.
+ * x-tcl.c (ALERT_CHAR): Remove macro.
+ (x_tcl_keyword, do_ungetc, phase1_ungetc, phase2_pop, phase2_ungetc,
+ init_token, free_token, grow_token, comment_add, free_word,
+ string_of_word, accumulate_word, read_word, read_command,
+ read_command_list, extract_tcl): Use ANSI C function declarations.
+ * x-ycp.h (extract_ycp): Likewise.
+ * x-ycp.c (phase1_ungetc, phase2_ungetc, x_ycp_lex, extract_ycp):
+ Likewise.
+ * xgettext.h (split_keywordspec, xgettext_comment_add,
+ xgettext_comment, xgettext_comment_reset, remember_a_message,
+ remember_a_message_plural): Likewise.
+ * xgettext.c (extractor_func, main, usage, exclude_directive_domain,
+ exclude_directive_message, read_exclusion_file, split_keywordspec,
+ xgettext_comment_add, xgettext_comment, xgettext_open,
+ extract_from_file, remember_a_message, remember_a_message_plural,
+ finalize_header, language_to_extractor, extension_to_language):
+ Likewise.
+
2002-11-05 Bruno Haible <bruno@clisp.org>
Allow non-ASCII msgids in POT files.
/* Append a directory to the end of the list of directories. */
void
-dir_list_append (s)
- const char *s;
+dir_list_append (const char *s)
{
if (directory == NULL)
directory = string_list_alloc ();
/* Return the nth directory, or NULL of n is out of range. */
const char *
-dir_list_nth (n)
- int n;
+dir_list_nth (int n)
{
/* The default value of the list consists of the single directory ".". */
if (directory == NULL)
/* Restore a previously saved list of directories. */
void
-dir_list_restore (saved_value)
- void *saved_value;
+dir_list_restore (void *saved_value)
{
/* Don't free the contained strings, because they may have been returned
by dir_list_nth and may still be in use. */
list consists of the single directory ".". */
/* Append a directory to the end of the list of directories. */
-extern void dir_list_append PARAMS ((const char *directory));
+extern void dir_list_append (const char *directory);
/* Return the nth directory, or NULL of n is out of range. */
-extern const char *dir_list_nth PARAMS ((int n));
+extern const char *dir_list_nth (int n);
/* Return the current list of directories, for later use with dir_list_restore.
Reset the list to empty. */
-extern void *dir_list_save_reset PARAMS ((void));
+extern void *dir_list_save_reset (void);
/* Restore a previously saved list of directories. */
-extern void dir_list_restore PARAMS ((void *saved_value));
+extern void dir_list_restore (void *saved_value);
#endif /* _DIR_LIST_H */
/* Reading file lists.
- Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2002 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
/* Read list of filenames from a file. */
string_list_ty *
-read_names_from_file (file_name)
- const char *file_name;
+read_names_from_file (const char *file_name)
{
size_t line_len = 0;
char *line_buf = NULL;
/* Reading file lists.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
/* Read list of filenames from a file.
One filename per line. Lines starting with # and whitespace lines are
ignored. Trailing whitespace is removed. */
-extern string_list_ty *read_names_from_file PARAMS ((const char *file_name));
+extern string_list_ty *read_names_from_file (const char *file_name);
#endif /* _FILE_LIST_H */
#define isdigit(c) ((unsigned int) ((c) - '0') < 10)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int numbered_arg_compare PARAMS ((const void *p1, const void *p2));
-static void *format_parse PARAMS ((const char *format));
-static void format_free PARAMS ((void *descr));
-static int format_get_number_of_directives PARAMS ((void *descr));
-static bool format_check PARAMS ((const lex_pos_ty *pos,
- void *msgid_descr, void *msgstr_descr,
- bool equality,
- bool noisy, const char *pretty_msgstr));
-
-
static int
-numbered_arg_compare (p1, p2)
- const void *p1;
- const void *p2;
+numbered_arg_compare (const void *p1, const void *p2)
{
unsigned int n1 = ((const struct numbered_arg *) p1)->number;
unsigned int n2 = ((const struct numbered_arg *) p2)->number;
}
static void *
-format_parse (format)
- const char *format;
+format_parse (const char *format)
{
struct spec spec;
unsigned int unnumbered_arg_count;
}
static void
-format_free (descr)
- void *descr;
+format_free (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static int
-format_get_number_of_directives (descr)
- void *descr;
+format_get_number_of_directives (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static bool
-format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr)
- const lex_pos_ty *pos;
- void *msgid_descr;
- void *msgstr_descr;
- bool equality;
- bool noisy;
- const char *pretty_msgstr;
+format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
+ bool equality, bool noisy, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
#include "getline.h"
static void
-format_print (descr)
- void *descr;
+format_print (void *descr)
{
struct spec *spec = (struct spec *) descr;
unsigned int last;
#define isdigit(c) ((unsigned int) ((c) - '0') < 10)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int numbered_arg_compare PARAMS ((const void *p1, const void *p2));
-static void *format_parse PARAMS ((const char *format));
-static void format_free PARAMS ((void *descr));
-static int format_get_number_of_directives PARAMS ((void *descr));
-static bool format_check PARAMS ((const lex_pos_ty *pos,
- void *msgid_descr, void *msgstr_descr,
- bool equality,
- bool noisy, const char *pretty_msgstr));
-
-
static int
-numbered_arg_compare (p1, p2)
- const void *p1;
- const void *p2;
+numbered_arg_compare (const void *p1, const void *p2)
{
unsigned int n1 = ((const struct numbered_arg *) p1)->number;
unsigned int n2 = ((const struct numbered_arg *) p2)->number;
}
static void *
-format_parse (format)
- const char *format;
+format_parse (const char *format)
{
struct spec spec;
unsigned int numbered_arg_count;
}
static void
-format_free (descr)
- void *descr;
+format_free (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static int
-format_get_number_of_directives (descr)
- void *descr;
+format_get_number_of_directives (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static bool
-format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr)
- const lex_pos_ty *pos;
- void *msgid_descr;
- void *msgstr_descr;
- bool equality;
- bool noisy;
- const char *pretty_msgstr;
+format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
+ bool equality, bool noisy, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
void
-get_c99_format_directives (string, intervalsp, lengthp)
- const char *string;
- struct interval **intervalsp;
- size_t *lengthp;
+get_c99_format_directives (const char *string,
+ struct interval **intervalsp, size_t *lengthp)
{
struct spec *descr = (struct spec *) format_parse (string);
#include "getline.h"
static void
-format_print (descr)
- void *descr;
+format_print (void *descr)
{
struct spec *spec = (struct spec *) descr;
unsigned int i;
#define isdigit(c) ((unsigned int) ((c) - '0') < 10)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int numbered_arg_compare PARAMS ((const void *p1, const void *p2));
-static void *format_parse PARAMS ((const char *format));
-static void format_free PARAMS ((void *descr));
-static int format_get_number_of_directives PARAMS ((void *descr));
-static bool format_check PARAMS ((const lex_pos_ty *pos,
- void *msgid_descr, void *msgstr_descr,
- bool equality,
- bool noisy, const char *pretty_msgstr));
-
-
static int
-numbered_arg_compare (p1, p2)
- const void *p1;
- const void *p2;
+numbered_arg_compare (const void *p1, const void *p2)
{
unsigned int n1 = ((const struct numbered_arg *) p1)->number;
unsigned int n2 = ((const struct numbered_arg *) p2)->number;
}
static void *
-format_parse (format)
- const char *format;
+format_parse (const char *format)
{
struct spec spec;
struct spec *result;
}
static void
-format_free (descr)
- void *descr;
+format_free (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static int
-format_get_number_of_directives (descr)
- void *descr;
+format_get_number_of_directives (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static bool
-format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr)
- const lex_pos_ty *pos;
- void *msgid_descr;
- void *msgstr_descr;
- bool equality;
- bool noisy;
- const char *pretty_msgstr;
+format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
+ bool equality, bool noisy, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
#include "getline.h"
static void
-format_print (descr)
- void *descr;
+format_print (void *descr)
{
struct spec *spec = (struct spec *) descr;
unsigned int last;
/* Java format strings.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static bool message_format_parse PARAMS ((const char *format,
- struct spec *spec));
-static bool date_format_parse PARAMS ((const char *format));
-static bool number_format_parse PARAMS ((const char *format));
-static bool choice_format_parse PARAMS ((const char *format,
- struct spec *spec));
-static int numbered_arg_compare PARAMS ((const void *p1, const void *p2));
-static void *format_parse PARAMS ((const char *format));
-static void format_free PARAMS ((void *descr));
-static int format_get_number_of_directives PARAMS ((void *descr));
-static bool format_check PARAMS ((const lex_pos_ty *pos,
- void *msgid_descr, void *msgstr_descr,
- bool equality,
- bool noisy, const char *pretty_msgstr));
+/* Forward declaration of local functions. */
+static bool date_format_parse (const char *format);
+static bool number_format_parse (const char *format);
+static bool choice_format_parse (const char *format, struct spec *spec);
/* Quote handling:
/* Return true if a format is a valid messageFormatPattern.
Extracts argument type information into spec. */
static bool
-message_format_parse (format, spec)
- const char *format;
- struct spec *spec;
+message_format_parse (const char *format, struct spec *spec)
{
bool quoting = false;
/* Return true if a format is a valid dateFormatPattern. */
static bool
-date_format_parse (format)
- const char *format;
+date_format_parse (const char *format)
{
/* Any string is valid. Single-quote starts a quoted section, to be
terminated at the next single-quote or string end. Double single-quote
/* Return true if a format is a valid numberFormatPattern. */
static bool
-number_format_parse (format)
- const char *format;
+number_format_parse (const char *format)
{
/* Pattern Syntax:
pattern := pos_pattern{';' neg_pattern}
/* Return true if a format is a valid choiceFormatPattern.
Extracts argument type information into spec. */
static bool
-choice_format_parse (format, spec)
- const char *format;
- struct spec *spec;
+choice_format_parse (const char *format, struct spec *spec)
{
/* Pattern syntax:
pattern := | choice | choice '|' pattern
}
static int
-numbered_arg_compare (p1, p2)
- const void *p1;
- const void *p2;
+numbered_arg_compare (const void *p1, const void *p2)
{
unsigned int n1 = ((const struct numbered_arg *) p1)->number;
unsigned int n2 = ((const struct numbered_arg *) p2)->number;
}
static void *
-format_parse (format)
- const char *format;
+format_parse (const char *format)
{
struct spec spec;
struct spec *result;
}
static void
-format_free (descr)
- void *descr;
+format_free (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static int
-format_get_number_of_directives (descr)
- void *descr;
+format_get_number_of_directives (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static bool
-format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr)
- const lex_pos_ty *pos;
- void *msgid_descr;
- void *msgstr_descr;
- bool equality;
- bool noisy;
- const char *pretty_msgstr;
+format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
+ bool equality, bool noisy, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
#include "getline.h"
static void
-format_print (descr)
- void *descr;
+format_print (void *descr)
{
struct spec *spec = (struct spec *) descr;
unsigned int last;
#define isdigit(c) ((unsigned int) ((c) - '0') < 10)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int numbered_arg_compare PARAMS ((const void *p1, const void *p2));
-static void *format_parse PARAMS ((const char *format));
-static void format_free PARAMS ((void *descr));
-static int format_get_number_of_directives PARAMS ((void *descr));
-static bool format_check PARAMS ((const lex_pos_ty *pos,
- void *msgid_descr, void *msgstr_descr,
- bool equality,
- bool noisy, const char *pretty_msgstr));
-
-
static int
-numbered_arg_compare (p1, p2)
- const void *p1;
- const void *p2;
+numbered_arg_compare (const void *p1, const void *p2)
{
unsigned int n1 = ((const struct numbered_arg *) p1)->number;
unsigned int n2 = ((const struct numbered_arg *) p2)->number;
}
static void *
-format_parse (format)
- const char *format;
+format_parse (const char *format)
{
struct spec spec;
struct spec *result;
}
static void
-format_free (descr)
- void *descr;
+format_free (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static int
-format_get_number_of_directives (descr)
- void *descr;
+format_get_number_of_directives (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static bool
-format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr)
- const lex_pos_ty *pos;
- void *msgid_descr;
- void *msgstr_descr;
- bool equality;
- bool noisy;
- const char *pretty_msgstr;
+format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
+ bool equality, bool noisy, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
#include "getline.h"
static void
-format_print (descr)
- void *descr;
+format_print (void *descr)
{
struct spec *spec = (struct spec *) descr;
unsigned int last;
/* Lisp format strings.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
+/* Forward declaration of local functions. */
#define union make_union
-static void verify_element PARAMS ((const struct format_arg * e));
-static void verify_list PARAMS ((const struct format_arg_list *list));
-static inline void free_element PARAMS ((struct format_arg *element));
-static void free_list PARAMS ((struct format_arg_list *list));
-static inline void copy_element PARAMS ((struct format_arg *newelement,
- const struct format_arg *oldelement));
-static struct format_arg_list * copy_list
- PARAMS ((const struct format_arg_list *list));
-static bool equal_element PARAMS ((const struct format_arg * e1,
- const struct format_arg * e2));
-static bool equal_list PARAMS ((const struct format_arg_list *list1,
- const struct format_arg_list *list2));
-static inline void ensure_initial_alloc PARAMS ((struct format_arg_list *list,
- unsigned int newcount));
-static inline void grow_initial_alloc PARAMS ((struct format_arg_list *list));
-static inline void ensure_repeated_alloc PARAMS ((struct format_arg_list *list,
- unsigned int newcount));
-static inline void grow_repeated_alloc PARAMS ((struct format_arg_list *list));
-static void normalize_outermost_list PARAMS ((struct format_arg_list *list));
-static void normalize_list PARAMS ((struct format_arg_list *list));
-static struct format_arg_list * make_unconstrained_list PARAMS ((void));
-static struct format_arg_list * make_empty_list PARAMS ((void));
-static bool is_empty_list PARAMS ((const struct format_arg_list *list));
-static void unfold_loop PARAMS ((struct format_arg_list *list, unsigned int m));
-static void rotate_loop PARAMS ((struct format_arg_list *list, unsigned int m));
-static unsigned int initial_splitelement PARAMS ((struct format_arg_list *list,
- unsigned int n));
-static unsigned int initial_unshare PARAMS ((struct format_arg_list *list,
- unsigned int n));
-static void shift_list PARAMS ((struct format_arg_list *list, unsigned int n));
-static bool make_intersected_element PARAMS ((struct format_arg *re,
- const struct format_arg * e1,
- const struct format_arg * e2));
-static void append_repeated_to_initial PARAMS ((struct format_arg_list *list));
-static struct format_arg_list * backtrack_in_initial
- PARAMS ((struct format_arg_list *list));
+static void verify_list (const struct format_arg_list *list);
+static void free_list (struct format_arg_list *list);
+static struct format_arg_list * copy_list (const struct format_arg_list *list);
+static bool equal_list (const struct format_arg_list *list1,
+ const struct format_arg_list *list2);
static struct format_arg_list * make_intersected_list
- PARAMS ((struct format_arg_list *list1,
- struct format_arg_list *list2));
+ (struct format_arg_list *list1,
+ struct format_arg_list *list2);
static struct format_arg_list * make_intersection_with_empty_list
- PARAMS ((struct format_arg_list *list));
-#ifdef unused
-static struct format_arg_list * intersection
- PARAMS ((struct format_arg_list *list1,
- struct format_arg_list *list2));
-#endif
-static void make_union_element PARAMS ((struct format_arg *re,
- const struct format_arg * e1,
- const struct format_arg * e2));
+ (struct format_arg_list *list);
static struct format_arg_list * make_union_list
- PARAMS ((struct format_arg_list *list1,
- struct format_arg_list *list2));
-static struct format_arg_list * make_union_with_empty_list
- PARAMS ((struct format_arg_list *list));
-static struct format_arg_list * union PARAMS ((struct format_arg_list *list1,
- struct format_arg_list *list2));
-static bool is_required PARAMS ((const struct format_arg_list *list,
- unsigned int n));
-static struct format_arg_list * add_required_constraint
- PARAMS ((struct format_arg_list *list,
- unsigned int n));
-static struct format_arg_list * add_end_constraint
- PARAMS ((struct format_arg_list *list, unsigned int n));
-static struct format_arg_list * add_type_constraint
- PARAMS ((struct format_arg_list *list, unsigned int n,
- enum format_arg_type type));
-static struct format_arg_list * add_listtype_constraint
- PARAMS ((struct format_arg_list *list, unsigned int n,
- enum format_arg_type type,
- struct format_arg_list *sublist));
-static void add_req_type_constraint
- PARAMS ((struct format_arg_list **listp,
- unsigned int position,
- enum format_arg_type type));
-static void add_req_listtype_constraint
- PARAMS ((struct format_arg_list **listp,
- unsigned int position,
- enum format_arg_type type,
- struct format_arg_list *sublist));
-static struct format_arg_list * make_repeated_list_of_lists
- PARAMS ((struct format_arg_list *sublist));
-static struct format_arg_list * make_repeated_list
- PARAMS ((struct format_arg_list *sublist,
- unsigned int period));
-static bool check_params PARAMS ((struct format_arg_list **listp,
- unsigned int paramcount,
- struct param *params, unsigned int t_count,
- const enum format_arg_type *t_types));
-static bool nocheck_params PARAMS ((struct format_arg_list **listp,
- unsigned int paramcount,
- struct param *params));
-static bool parse_upto PARAMS ((const char **formatp, int *positionp,
- struct format_arg_list **listp,
- struct format_arg_list **escapep,
- int *separatorp, struct spec *spec,
- /*promote: char*/ int terminator,
- bool separator));
-static void *format_parse PARAMS ((const char *format));
-static void format_free PARAMS ((void *descr));
-static int format_get_number_of_directives PARAMS ((void *descr));
-static bool format_check PARAMS ((const lex_pos_ty *pos,
- void *msgid_descr, void *msgstr_descr,
- bool equality,
- bool noisy, const char *pretty_msgstr));
+ (struct format_arg_list *list1,
+ struct format_arg_list *list2);
/* ======================= Verify a format_arg_list ======================= */
/* Verify some invariants. */
static void
-verify_element (e)
- const struct format_arg * e;
+verify_element (const struct format_arg * e)
{
ASSERT (e->repcount > 0);
if (e->type == FAT_LIST)
/* Verify some invariants. */
/* Memory effects: none. */
static void
-verify_list (list)
- const struct format_arg_list *list;
+verify_list (const struct format_arg_list *list)
{
unsigned int i;
unsigned int total_repcount;
/* Free the data belonging to an argument list element. */
static inline void
-free_element (element)
- struct format_arg *element;
+free_element (struct format_arg *element)
{
if (element->type == FAT_LIST)
free_list (element->list);
/* Free an argument list. */
/* Memory effects: Frees list. */
static void
-free_list (list)
- struct format_arg_list *list;
+free_list (struct format_arg_list *list)
{
unsigned int i;
/* Copy the data belonging to an argument list element. */
static inline void
-copy_element (newelement, oldelement)
- struct format_arg *newelement;
- const struct format_arg *oldelement;
+copy_element (struct format_arg *newelement,
+ const struct format_arg *oldelement)
{
newelement->repcount = oldelement->repcount;
newelement->presence = oldelement->presence;
/* Copy an argument list. */
/* Memory effects: Freshly allocated result. */
static struct format_arg_list *
-copy_list (list)
- const struct format_arg_list *list;
+copy_list (const struct format_arg_list *list)
{
struct format_arg_list *newlist;
unsigned int length;
/* Tests whether two normalized argument constraints are equivalent,
ignoring the repcount. */
static bool
-equal_element (e1, e2)
- const struct format_arg * e1;
- const struct format_arg * e2;
+equal_element (const struct format_arg * e1, const struct format_arg * e2)
{
return (e1->presence == e2->presence
&& e1->type == e2->type
/* Tests whether two normalized argument list constraints are equivalent. */
/* Memory effects: none. */
static bool
-equal_list (list1, list2)
- const struct format_arg_list *list1;
- const struct format_arg_list *list2;
+equal_list (const struct format_arg_list *list1,
+ const struct format_arg_list *list2)
{
unsigned int n, i;
/* Ensure list->initial.allocated >= newcount. */
static inline void
-ensure_initial_alloc (list, newcount)
- struct format_arg_list *list;
- unsigned int newcount;
+ensure_initial_alloc (struct format_arg_list *list, unsigned int newcount)
{
if (newcount > list->initial.allocated)
{
/* Ensure list->initial.allocated > list->initial.count. */
static inline void
-grow_initial_alloc (list)
- struct format_arg_list *list;
+grow_initial_alloc (struct format_arg_list *list)
{
if (list->initial.count >= list->initial.allocated)
{
/* Ensure list->repeated.allocated >= newcount. */
static inline void
-ensure_repeated_alloc (list, newcount)
- struct format_arg_list *list;
- unsigned int newcount;
+ensure_repeated_alloc (struct format_arg_list *list, unsigned int newcount)
{
if (newcount > list->repeated.allocated)
{
/* Ensure list->repeated.allocated > list->repeated.count. */
static inline void
-grow_repeated_alloc (list)
- struct format_arg_list *list;
+grow_repeated_alloc (struct format_arg_list *list)
{
if (list->repeated.count >= list->repeated.allocated)
{
normalized. */
/* Memory effects: Destructively modifies list. */
static void
-normalize_outermost_list (list)
- struct format_arg_list *list;
+normalize_outermost_list (struct format_arg_list *list)
{
unsigned int n, i, j;
/* Normalize an argument list constraint. */
/* Memory effects: Destructively modifies list. */
static void
-normalize_list (list)
- struct format_arg_list *list;
+normalize_list (struct format_arg_list *list)
{
unsigned int n, i;
/* Test for an empty list. */
/* Memory effects: none. */
static bool
-is_empty_list (list)
- const struct format_arg_list *list;
+is_empty_list (const struct format_arg_list *list)
{
return (list->initial.count == 0 && list->repeated.count == 0);
}
Assumes list->repeated.count > 0. */
/* Memory effects: list is destructively modified. */
static void
-unfold_loop (list, m)
- struct format_arg_list *list;
- unsigned int m;
+unfold_loop (struct format_arg_list *list, unsigned int m)
{
unsigned int i, j, k;
Assumes list->repeated.count > 0. */
/* Memory effects: list is destructively modified. */
static void
-rotate_loop (list, m)
- struct format_arg_list *list;
- unsigned int m;
+rotate_loop (struct format_arg_list *list, unsigned int m)
{
if (m == list->initial.length)
return;
different adjacent elements. */
/* Memory effects: list is destructively modified. */
static unsigned int
-initial_splitelement (list, n)
- struct format_arg_list *list;
- unsigned int n;
+initial_splitelement (struct format_arg_list *list, unsigned int n)
{
unsigned int s;
unsigned int t;
/* Ensure index n in the initial segment is not shared. Return its index. */
/* Memory effects: list is destructively modified. */
static unsigned int
-initial_unshare (list, n)
- struct format_arg_list *list;
- unsigned int n;
+initial_unshare (struct format_arg_list *list, unsigned int n)
{
/* This does the same side effects as
initial_splitelement (list, n);
/* Add n unconstrained elements at the front of the list. */
/* Memory effects: list is destructively modified. */
static void
-shift_list (list, n)
- struct format_arg_list *list;
- unsigned int n;
+shift_list (struct format_arg_list *list, unsigned int n)
{
VERIFY_LIST (list);
two constraints give a contradiction. */
/* Memory effects: Freshly allocated element's sublist. */
static bool
-make_intersected_element (re, e1, e2)
- struct format_arg *re;
- const struct format_arg * e1;
- const struct format_arg * e2;
+make_intersected_element (struct format_arg *re,
+ const struct format_arg * e1,
+ const struct format_arg * e2)
{
/* Intersect the cdr types. */
if (e1->presence == FCT_REQUIRED || e2->presence == FCT_REQUIRED)
/* Append list->repeated to list->initial, and clear list->repeated. */
/* Memory effects: list is destructively modified. */
static void
-append_repeated_to_initial (list)
- struct format_arg_list *list;
+append_repeated_to_initial (struct format_arg_list *list)
{
if (list->repeated.count > 0)
{
/* Memory effects: list is destructively modified. If NULL is returned,
list is freed. */
static struct format_arg_list *
-backtrack_in_initial (list)
- struct format_arg_list *list;
+backtrack_in_initial (struct format_arg_list *list)
{
ASSERT (list->repeated.count == 0);
/* Memory effects: list1 and list2 are freed. The result, if non-NULL, is
freshly allocated. */
static struct format_arg_list *
-make_intersected_list (list1, list2)
- struct format_arg_list *list1;
- struct format_arg_list *list2;
+make_intersected_list (struct format_arg_list *list1,
+ struct format_arg_list *list2)
{
struct format_arg_list *result;
Return NULL if the intersection is empty. */
/* Memory effects: The result, if non-NULL, is freshly allocated. */
static struct format_arg_list *
-make_intersection_with_empty_list (list)
- struct format_arg_list *list;
+make_intersection_with_empty_list (struct format_arg_list *list)
{
#if 0 /* equivalent but slower */
return make_intersected_list (copy_list (list), make_empty_list ());
/* Memory effects: list1 and list2 are freed if non-NULL. The result,
if non-NULL, is freshly allocated. */
static struct format_arg_list *
-intersection (list1, list2)
- struct format_arg_list *list1;
- struct format_arg_list *list2;
+intersection (struct format_arg_list *list1, struct format_arg_list *list2)
{
if (list1 != NULL)
{
/* Create the union (i.e. alternative constraints) of two argument
constraints. */
static void
-make_union_element (re, e1, e2)
- struct format_arg *re;
- const struct format_arg * e1;
- const struct format_arg * e2;
+make_union_element (struct format_arg *re,
+ const struct format_arg * e1,
+ const struct format_arg * e2)
{
/* Union of the cdr types. */
if (e1->presence == FCT_REQUIRED && e2->presence == FCT_REQUIRED)
/* Memory effects: list1 and list2 are freed. The result is freshly
allocated. */
static struct format_arg_list *
-make_union_list (list1, list2)
- struct format_arg_list *list1;
- struct format_arg_list *list2;
+make_union_list (struct format_arg_list *list1, struct format_arg_list *list2)
{
struct format_arg_list *result;
/* Create the union of an argument list and the empty list. */
/* Memory effects: list is freed. The result is freshly allocated. */
static struct format_arg_list *
-make_union_with_empty_list (list)
- struct format_arg_list *list;
+make_union_with_empty_list (struct format_arg_list *list)
{
#if 0 /* equivalent but slower */
return make_union_list (list, make_empty_list ());
/* Memory effects: list1 and list2 are freed if non-NULL. The result,
if non-NULL, is freshly allocated. */
static struct format_arg_list *
-union (list1, list2)
- struct format_arg_list *list1;
- struct format_arg_list *list2;
+union (struct format_arg_list *list1, struct format_arg_list *list2)
{
if (list1 != NULL)
{
/* Test whether arguments 0..n are required arguments in a list. */
static bool
-is_required (list, n)
- const struct format_arg_list *list;
- unsigned int n;
+is_required (const struct format_arg_list *list, unsigned int n)
{
unsigned int s;
unsigned int t;
present. NULL stands for an impossible situation, i.e. a contradiction. */
/* Memory effects: list is freed. The result is freshly allocated. */
static struct format_arg_list *
-add_required_constraint (list, n)
- struct format_arg_list *list;
- unsigned int n;
+add_required_constraint (struct format_arg_list *list, unsigned int n)
{
unsigned int i, rest;
contradiction. */
/* Memory effects: list is freed. The result is freshly allocated. */
static struct format_arg_list *
-add_end_constraint (list, n)
- struct format_arg_list *list;
- unsigned int n;
+add_end_constraint (struct format_arg_list *list, unsigned int n)
{
unsigned int s, i;
enum format_cdr_type n_presence;
contradiction. Assumes a preceding add_required_constraint (list, n). */
/* Memory effects: list is freed. The result is freshly allocated. */
static struct format_arg_list *
-add_type_constraint (list, n, type)
- struct format_arg_list *list;
- unsigned int n;
- enum format_arg_type type;
+add_type_constraint (struct format_arg_list *list, unsigned int n,
+ enum format_arg_type type)
{
unsigned int s;
struct format_arg newconstraint;
contradiction. Assumes a preceding add_required_constraint (list, n). */
/* Memory effects: list is freed. The result is freshly allocated. */
static struct format_arg_list *
-add_listtype_constraint (list, n, type, sublist)
- struct format_arg_list *list;
- unsigned int n;
- enum format_arg_type type;
- struct format_arg_list *sublist;
+add_listtype_constraint (struct format_arg_list *list, unsigned int n,
+ enum format_arg_type type,
+ struct format_arg_list *sublist)
{
unsigned int s;
struct format_arg newconstraint;
/* ============= Subroutines used by the format string parser ============= */
static void
-add_req_type_constraint (listp, position, type)
- struct format_arg_list **listp;
- unsigned int position;
- enum format_arg_type type;
+add_req_type_constraint (struct format_arg_list **listp,
+ unsigned int position, enum format_arg_type type)
{
*listp = add_required_constraint (*listp, position);
*listp = add_type_constraint (*listp, position, type);
static void
-add_req_listtype_constraint (listp, position, type, sublist)
- struct format_arg_list **listp;
- unsigned int position;
- enum format_arg_type type;
- struct format_arg_list *sublist;
+add_req_listtype_constraint (struct format_arg_list **listp,
+ unsigned int position, enum format_arg_type type,
+ struct format_arg_list *sublist)
{
*listp = add_required_constraint (*listp, position);
*listp = add_listtype_constraint (*listp, position, type, sublist);
by sublist. */
/* Memory effects: sublist is freed. The result is freshly allocated. */
static struct format_arg_list *
-make_repeated_list_of_lists (sublist)
- struct format_arg_list *sublist;
+make_repeated_list_of_lists (struct format_arg_list *sublist)
{
if (sublist == NULL)
/* The list cannot have a single element. */
*/
/* Memory effects: sublist is freed. The result is freshly allocated. */
static struct format_arg_list *
-make_repeated_list (sublist, period)
- struct format_arg_list *sublist;
- unsigned int period;
+make_repeated_list (struct format_arg_list *sublist, unsigned int period)
{
struct segment tmp;
struct segment *srcseg;
/* Check the parameters. For V params, add the constraint to the argument
list. Return false if the format string is invalid. */
static bool
-check_params (listp, paramcount, params, t_count, t_types)
- struct format_arg_list **listp;
- unsigned int paramcount;
- struct param *params;
- unsigned int t_count;
- const enum format_arg_type *t_types;
+check_params (struct format_arg_list **listp,
+ unsigned int paramcount, struct param *params,
+ unsigned int t_count, const enum format_arg_type *t_types)
{
for (; paramcount > 0 && t_count > 0;
params++, paramcount--, t_types++, t_count--)
For V params, add the constraint to the argument list.
Return false if the format string is invalid. */
static bool
-nocheck_params (listp, paramcount, params)
- struct format_arg_list **listp;
- unsigned int paramcount;
- struct param *params;
+nocheck_params (struct format_arg_list **listp,
+ unsigned int paramcount, struct param *params)
{
for (; paramcount > 0; params++, paramcount--)
if (params->type == PT_V)
separator specifies if ~; separators are allowed.
If the format string is invalid, false is returned. */
static bool
-parse_upto (formatp, positionp, listp, escapep,
- separatorp, spec, terminator, separator)
- const char **formatp;
- int *positionp;
- struct format_arg_list **listp;
- struct format_arg_list **escapep;
- int *separatorp;
- struct spec *spec;
- char terminator;
- bool separator;
+parse_upto (const char **formatp,
+ int *positionp, struct format_arg_list **listp,
+ struct format_arg_list **escapep, int *separatorp,
+ struct spec *spec, char terminator, bool separator)
{
const char *format = *formatp;
int position = *positionp;
/* ============== Top level format string handling functions ============== */
static void *
-format_parse (format)
- const char *format;
+format_parse (const char *format)
{
struct spec spec;
struct spec *result;
}
static void
-format_free (descr)
- void *descr;
+format_free (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static int
-format_get_number_of_directives (descr)
- void *descr;
+format_get_number_of_directives (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static bool
-format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr)
- const lex_pos_ty *pos;
- void *msgid_descr;
- void *msgstr_descr;
- bool equality;
- bool noisy;
- const char *pretty_msgstr;
+format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
+ bool equality, bool noisy, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
#include <stdio.h>
#include "getline.h"
-static void print_list PARAMS ((struct format_arg_list *list));
+static void print_list (struct format_arg_list *list);
static void
-print_element (element)
- struct format_arg *element;
+print_element (struct format_arg *element)
{
switch (element->presence)
{
}
static void
-print_list (list)
- struct format_arg_list *list;
+print_list (struct format_arg_list *list)
{
unsigned int i, j;
}
static void
-format_print (descr)
- void *descr;
+format_print (void *descr)
{
struct spec *spec = (struct spec *) descr;
#define isdigit(c) ((unsigned int) ((c) - '0') < 10)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int numbered_arg_compare PARAMS ((const void *p1, const void *p2));
-static void *format_parse PARAMS ((const char *format));
-static void format_free PARAMS ((void *descr));
-static int format_get_number_of_directives PARAMS ((void *descr));
-static bool format_check PARAMS ((const lex_pos_ty *pos,
- void *msgid_descr, void *msgstr_descr,
- bool equality,
- bool noisy, const char *pretty_msgstr));
-
-
static int
-numbered_arg_compare (p1, p2)
- const void *p1;
- const void *p2;
+numbered_arg_compare (const void *p1, const void *p2)
{
unsigned int n1 = ((const struct numbered_arg *) p1)->number;
unsigned int n2 = ((const struct numbered_arg *) p2)->number;
}
static void *
-format_parse (format)
- const char *format;
+format_parse (const char *format)
{
unsigned int directives;
unsigned int numbered_arg_count;
}
static void
-format_free (descr)
- void *descr;
+format_free (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static int
-format_get_number_of_directives (descr)
- void *descr;
+format_get_number_of_directives (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static bool
-format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr)
- const lex_pos_ty *pos;
- void *msgid_descr;
- void *msgstr_descr;
- bool equality;
- bool noisy;
- const char *pretty_msgstr;
+format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
+ bool equality, bool noisy, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
#include "getline.h"
static void
-format_print (descr)
- void *descr;
+format_print (void *descr)
{
struct spec *spec = (struct spec *) descr;
unsigned int last;
#define isdigit(c) ((unsigned int) ((c) - '0') < 10)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int numbered_arg_compare PARAMS ((const void *p1, const void *p2));
-static void *format_parse PARAMS ((const char *format));
-static void format_free PARAMS ((void *descr));
-static int format_get_number_of_directives PARAMS ((void *descr));
-static bool format_check PARAMS ((const lex_pos_ty *pos,
- void *msgid_descr, void *msgstr_descr,
- bool equality,
- bool noisy, const char *pretty_msgstr));
-
-
static int
-numbered_arg_compare (p1, p2)
- const void *p1;
- const void *p2;
+numbered_arg_compare (const void *p1, const void *p2)
{
unsigned int n1 = ((const struct numbered_arg *) p1)->number;
unsigned int n2 = ((const struct numbered_arg *) p2)->number;
}
static void *
-format_parse (format)
- const char *format;
+format_parse (const char *format)
{
unsigned int directives;
unsigned int numbered_arg_count;
}
static void
-format_free (descr)
- void *descr;
+format_free (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static int
-format_get_number_of_directives (descr)
- void *descr;
+format_get_number_of_directives (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static bool
-format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr)
- const lex_pos_ty *pos;
- void *msgid_descr;
- void *msgstr_descr;
- bool equality;
- bool noisy;
- const char *pretty_msgstr;
+format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
+ bool equality, bool noisy, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
#include "getline.h"
static void
-format_print (descr)
- void *descr;
+format_print (void *descr)
{
struct spec *spec = (struct spec *) descr;
unsigned int last;
/* Python format strings.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#define isdigit(c) ((unsigned int) ((c) - '0') < 10)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int named_arg_compare PARAMS ((const void *p1, const void *p2));
-static void *format_parse PARAMS ((const char *format));
-static void format_free PARAMS ((void *descr));
-static int format_get_number_of_directives PARAMS ((void *descr));
-static bool format_check PARAMS ((const lex_pos_ty *pos,
- void *msgid_descr, void *msgstr_descr,
- bool equality,
- bool noisy, const char *pretty_msgstr));
-
-
static int
-named_arg_compare (p1, p2)
- const void *p1;
- const void *p2;
+named_arg_compare (const void *p1, const void *p2)
{
return strcmp (((const struct named_arg *) p1)->name,
((const struct named_arg *) p2)->name);
}
static void *
-format_parse (format)
- const char *format;
+format_parse (const char *format)
{
struct spec spec;
struct spec *result;
}
static void
-format_free (descr)
- void *descr;
+format_free (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static int
-format_get_number_of_directives (descr)
- void *descr;
+format_get_number_of_directives (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static bool
-format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr)
- const lex_pos_ty *pos;
- void *msgid_descr;
- void *msgstr_descr;
- bool equality;
- bool noisy;
- const char *pretty_msgstr;
+format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
+ bool equality, bool noisy, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
#include "getline.h"
static void
-format_print (descr)
- void *descr;
+format_print (void *descr)
{
struct spec *spec = (struct spec *) descr;
unsigned int i;
#define isdigit(c) ((unsigned int) ((c) - '0') < 10)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int numbered_arg_compare PARAMS ((const void *p1, const void *p2));
-static void *format_parse PARAMS ((const char *format));
-static void format_free PARAMS ((void *descr));
-static int format_get_number_of_directives PARAMS ((void *descr));
-static bool format_check PARAMS ((const lex_pos_ty *pos,
- void *msgid_descr, void *msgstr_descr,
- bool equality,
- bool noisy, const char *pretty_msgstr));
-
-
static int
-numbered_arg_compare (p1, p2)
- const void *p1;
- const void *p2;
+numbered_arg_compare (const void *p1, const void *p2)
{
unsigned int n1 = ((const struct numbered_arg *) p1)->number;
unsigned int n2 = ((const struct numbered_arg *) p2)->number;
}
static void *
-format_parse (format)
- const char *format;
+format_parse (const char *format)
{
struct spec spec;
struct spec *result;
}
static void
-format_free (descr)
- void *descr;
+format_free (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static int
-format_get_number_of_directives (descr)
- void *descr;
+format_get_number_of_directives (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static bool
-format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr)
- const lex_pos_ty *pos;
- void *msgid_descr;
- void *msgstr_descr;
- bool equality;
- bool noisy;
- const char *pretty_msgstr;
+format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
+ bool equality, bool noisy, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
#include "getline.h"
static void
-format_print (descr)
- void *descr;
+format_print (void *descr)
{
struct spec *spec = (struct spec *) descr;
unsigned int last;
/* YCP and Smalltalk format strings.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void *format_parse PARAMS ((const char *format));
-static void format_free PARAMS ((void *descr));
-static int format_get_number_of_directives PARAMS ((void *descr));
-static bool format_check PARAMS ((const lex_pos_ty *pos,
- void *msgid_descr, void *msgstr_descr,
- bool equality,
- bool noisy, const char *pretty_msgstr));
-
-
static void *
-format_parse (format)
- const char *format;
+format_parse (const char *format)
{
struct spec spec;
struct spec *result;
}
static void
-format_free (descr)
- void *descr;
+format_free (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static int
-format_get_number_of_directives (descr)
- void *descr;
+format_get_number_of_directives (void *descr)
{
struct spec *spec = (struct spec *) descr;
}
static bool
-format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr)
- const lex_pos_ty *pos;
- void *msgid_descr;
- void *msgstr_descr;
- bool equality;
- bool noisy;
- const char *pretty_msgstr;
+format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
+ bool equality, bool noisy, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
#include "getline.h"
static void
-format_print (descr)
- void *descr;
+format_print (void *descr)
{
struct spec *spec = (struct spec *) descr;
unsigned int i;
1. the argument types/names needed for the format string,
2. the total number of format directives.
Return NULL if the string is not a valid format string. */
- void * (*parse) PARAMS ((const char *string));
+ void * (*parse) (const char *string);
/* Free a format string descriptor, returned by parse(). */
- void (*free) PARAMS ((void *descr));
+ void (*free) (void *descr);
/* Return the number of format directives.
A string that can be output literally has 0 format directives. */
- int (*get_number_of_directives) PARAMS ((void *descr));
+ int (*get_number_of_directives) (void *descr);
/* Verify that the argument types/names in msgid_descr and those in
msgstr_descr are the same (if equality=true), or (if equality=false)
error_at_line (0, 0, pos->file_name, pos->line_number, ...);
error_with_progname = true;
(but only if noisy=true) and return true. Otherwise return false. */
- bool (*check) PARAMS ((const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, bool equality, bool noisy, const char *pretty_msgstr));
+ bool (*check) (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, bool equality, bool noisy, const char *pretty_msgstr);
};
/* Format string parsers, each defined in its own file. */
size_t startpos;
size_t endpos;
};
-extern void get_c99_format_directives PARAMS ((const char *string, struct interval **intervalsp, size_t *lengthp));
+extern void get_c99_format_directives (const char *string, struct interval **intervalsp, size_t *lengthp);
#endif /* _FORMAT_H */
{ NULL, 0, NULL, 0 }
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status))
+/* Forward declaration of local functions. */
+static void usage (int status)
#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
__attribute__ ((noreturn))
#endif
;
-static const char *expand_escape PARAMS ((const char *str));
+static const char *expand_escape (const char *str);
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
int optchar;
const char *msgid;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
/* Expand some escape sequences found in the argument string. */
static const char *
-expand_escape (str)
- const char *str;
+expand_escape (const char *str)
{
char *retval, *rp;
const char *cp = str;
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status))
+/* Forward declaration of local functions. */
+static void usage (int status)
#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
__attribute__ ((noreturn))
#endif
;
-static char * xgethostname PARAMS ((void));
-static void print_hostname PARAMS ((void));
+static void print_hostname (void);
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
int optchar;
bool do_help;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
#include "xmalloc.h"
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static message_ty *message_list_search_fuzzy_inner PARAMS ((
- message_list_ty *mlp, const char *msgid, double *best_weight_p));
-
-
const char *const format_language[NFORMATS] =
{
/* format_c */ "c",
bool
-possible_format_p (is_format)
- enum is_format is_format;
+possible_format_p (enum is_format is_format)
{
return is_format == possible || is_format == yes;
}
message_ty *
-message_alloc (msgid, msgid_plural, msgstr, msgstr_len, pp)
- const char *msgid;
- const char *msgid_plural;
- const char *msgstr;
- size_t msgstr_len;
- const lex_pos_ty *pp;
+message_alloc (const char *msgid, const char *msgid_plural,
+ const char *msgstr, size_t msgstr_len,
+ const lex_pos_ty *pp)
{
message_ty *mp;
size_t i;
void
-message_free (mp)
- message_ty *mp;
+message_free (message_ty *mp)
{
size_t j;
void
-message_comment_append (mp, s)
- message_ty *mp;
- const char *s;
+message_comment_append (message_ty *mp, const char *s)
{
if (mp->comment == NULL)
mp->comment = string_list_alloc ();
void
-message_comment_dot_append (mp, s)
- message_ty *mp;
- const char *s;
+message_comment_dot_append (message_ty *mp, const char *s)
{
if (mp->comment_dot == NULL)
mp->comment_dot = string_list_alloc ();
void
-message_comment_filepos (mp, name, line)
- message_ty *mp;
- const char *name;
- size_t line;
+message_comment_filepos (message_ty *mp, const char *name, size_t line)
{
size_t j;
size_t nbytes;
message_ty *
-message_copy (mp)
- message_ty *mp;
+message_copy (message_ty *mp)
{
message_ty *result;
size_t j, i;
message_list_ty *
-message_list_alloc (use_hashtable)
- bool use_hashtable;
+message_list_alloc (bool use_hashtable)
{
message_list_ty *mlp;
void
-message_list_free (mlp)
- message_list_ty *mlp;
+message_list_free (message_list_ty *mlp)
{
size_t j;
void
-message_list_append (mlp, mp)
- message_list_ty *mlp;
- message_ty *mp;
+message_list_append (message_list_ty *mlp, message_ty *mp)
{
if (mlp->nitems >= mlp->nitems_max)
{
void
-message_list_prepend (mlp, mp)
- message_list_ty *mlp;
- message_ty *mp;
+message_list_prepend (message_list_ty *mlp, message_ty *mp)
{
size_t j;
#if 0 /* unused */
void
-message_list_delete_nth (mlp, n)
- message_list_ty *mlp;
- size_t n;
+message_list_delete_nth (message_list_ty *mlp, size_t n)
{
size_t j;
void
-message_list_remove_if_not (mlp, predicate)
- message_list_ty *mlp;
- message_predicate_ty *predicate;
+message_list_remove_if_not (message_list_ty *mlp,
+ message_predicate_ty *predicate)
{
size_t i, j;
message_ty *
-message_list_search (mlp, msgid)
- message_list_ty *mlp;
- const char *msgid;
+message_list_search (message_list_ty *mlp, const char *msgid)
{
if (mlp->use_hashtable)
{
static message_ty *
-message_list_search_fuzzy_inner (mlp, msgid, best_weight_p)
- message_list_ty *mlp;
- const char *msgid;
- double *best_weight_p;
+message_list_search_fuzzy_inner (message_list_ty *mlp, const char *msgid,
+ double *best_weight_p)
{
size_t j;
message_ty *best_mp;
message_ty *
-message_list_search_fuzzy (mlp, msgid)
- message_list_ty *mlp;
- const char *msgid;
+message_list_search_fuzzy (message_list_ty *mlp, const char *msgid)
{
double best_weight;
#if 0 /* unused */
void
-message_list_list_free (mllp)
- message_list_list_ty *mllp;
+message_list_list_free (message_list_list_ty *mllp)
{
size_t j;
void
-message_list_list_append (mllp, mlp)
- message_list_list_ty *mllp;
- message_list_ty *mlp;
+message_list_list_append (message_list_list_ty *mllp, message_list_ty *mlp)
{
if (mllp->nitems >= mllp->nitems_max)
{
void
-message_list_list_append_list (mllp, mllp2)
- message_list_list_ty *mllp;
- message_list_list_ty *mllp2;
+message_list_list_append_list (message_list_list_ty *mllp,
+ message_list_list_ty *mllp2)
{
size_t j;
message_ty *
-message_list_list_search (mllp, msgid)
- message_list_list_ty *mllp;
- const char *msgid;
+message_list_list_search (message_list_list_ty *mllp, const char *msgid)
{
message_ty *best_mp;
int best_weight; /* 0: not found, 1: found without msgstr, 2: translated */
message_ty *
-message_list_list_search_fuzzy (mllp, msgid)
- message_list_list_ty *mllp;
- const char *msgid;
+message_list_list_search_fuzzy (message_list_list_ty *mllp, const char *msgid)
{
size_t j;
double best_weight;
msgdomain_ty*
-msgdomain_alloc (domain, use_hashtable)
- const char *domain;
- bool use_hashtable;
+msgdomain_alloc (const char *domain, bool use_hashtable)
{
msgdomain_ty *mdp;
void
-msgdomain_free (mdp)
- msgdomain_ty *mdp;
+msgdomain_free (msgdomain_ty *mdp)
{
message_list_free (mdp->messages);
free (mdp);
msgdomain_list_ty *
-msgdomain_list_alloc (use_hashtable)
- bool use_hashtable;
+msgdomain_list_alloc (bool use_hashtable)
{
msgdomain_list_ty *mdlp;
#if 0 /* unused */
void
-msgdomain_list_free (mdlp)
- msgdomain_list_ty *mdlp;
+msgdomain_list_free (msgdomain_list_ty *mdlp)
{
size_t j;
void
-msgdomain_list_append (mdlp, mdp)
- msgdomain_list_ty *mdlp;
- msgdomain_ty *mdp;
+msgdomain_list_append (msgdomain_list_ty *mdlp, msgdomain_ty *mdp)
{
if (mdlp->nitems >= mdlp->nitems_max)
{
#if 0 /* unused */
void
-msgdomain_list_append_list (mdlp, mdlp2)
- msgdomain_list_ty *mdlp;
- msgdomain_list_ty *mdlp2;
+msgdomain_list_append_list (msgdomain_list_ty *mdlp, msgdomain_list_ty *mdlp2)
{
size_t j;
message_list_ty *
-msgdomain_list_sublist (mdlp, domain, create)
- msgdomain_list_ty *mdlp;
- const char *domain;
- bool create;
+msgdomain_list_sublist (msgdomain_list_ty *mdlp, const char *domain,
+ bool create)
{
size_t j;
#if 0 /* unused */
message_ty *
-msgdomain_list_search (mdlp, msgid)
- msgdomain_list_ty *mdlp;
- const char *msgid;
+msgdomain_list_search (msgdomain_list_ty *mdlp, const char *msgid)
{
size_t j;
#if 0 /* unused */
message_ty *
-msgdomain_list_search_fuzzy (mdlp, msgid)
- msgdomain_list_ty *mdlp;
- const char *msgid;
+msgdomain_list_search_fuzzy (msgdomain_list_ty *mdlp, const char *msgid)
{
size_t j;
double best_weight;
};
extern bool
- possible_format_p PARAMS ((enum is_format));
+ possible_format_p (enum is_format);
/* Is current msgid wrappable? */
};
extern message_ty *
- message_alloc PARAMS ((const char *msgid, const char *msgid_plural,
- const char *msgstr, size_t msgstr_len,
- const lex_pos_ty *pp));
+ message_alloc (const char *msgid, const char *msgid_plural,
+ const char *msgstr, size_t msgstr_len,
+ const lex_pos_ty *pp);
extern void
- message_free PARAMS ((message_ty *mp));
+ message_free (message_ty *mp);
extern void
- message_comment_append PARAMS ((message_ty *mp, const char *comment));
+ message_comment_append (message_ty *mp, const char *comment);
extern void
- message_comment_dot_append PARAMS ((message_ty *mp,
- const char *comment));
+ message_comment_dot_append (message_ty *mp, const char *comment);
extern void
- message_comment_filepos PARAMS ((message_ty *mp,
- const char *name, size_t line));
+ message_comment_filepos (message_ty *mp, const char *name, size_t line);
extern message_ty *
- message_copy PARAMS ((message_ty *mp));
+ message_copy (message_ty *mp);
typedef struct message_list_ty message_list_ty;
message_list_search(). USE_HASHTABLE can only be set to true if it is
known that the message list will not contain duplicate msgids. */
extern message_list_ty *
- message_list_alloc PARAMS ((bool use_hashtable));
+ message_list_alloc (bool use_hashtable);
extern void
- message_list_free PARAMS ((message_list_ty *mlp));
+ message_list_free (message_list_ty *mlp);
extern void
- message_list_append PARAMS ((message_list_ty *mlp, message_ty *mp));
+ message_list_append (message_list_ty *mlp, message_ty *mp);
extern void
- message_list_prepend PARAMS ((message_list_ty *mlp, message_ty *mp));
+ message_list_prepend (message_list_ty *mlp, message_ty *mp);
extern void
- message_list_delete_nth PARAMS ((message_list_ty *mlp, size_t n));
-typedef bool message_predicate_ty PARAMS ((const message_ty *mp));
+ message_list_delete_nth (message_list_ty *mlp, size_t n);
+typedef bool message_predicate_ty (const message_ty *mp);
extern void
- message_list_remove_if_not PARAMS ((message_list_ty *mlp,
- message_predicate_ty *predicate));
+ message_list_remove_if_not (message_list_ty *mlp,
+ message_predicate_ty *predicate);
extern message_ty *
- message_list_search PARAMS ((message_list_ty *mlp, const char *msgid));
+ message_list_search (message_list_ty *mlp, const char *msgid);
extern message_ty *
- message_list_search_fuzzy PARAMS ((message_list_ty *mlp,
- const char *msgid));
+ message_list_search_fuzzy (message_list_ty *mlp, const char *msgid);
typedef struct message_list_list_ty message_list_list_ty;
};
extern message_list_list_ty *
- message_list_list_alloc PARAMS ((void));
+ message_list_list_alloc (void);
extern void
- message_list_list_free PARAMS ((message_list_list_ty *mllp));
+ message_list_list_free (message_list_list_ty *mllp);
extern void
- message_list_list_append PARAMS ((message_list_list_ty *mllp,
- message_list_ty *mlp));
+ message_list_list_append (message_list_list_ty *mllp,
+ message_list_ty *mlp);
extern void
- message_list_list_append_list PARAMS ((message_list_list_ty *mllp,
- message_list_list_ty *mllp2));
+ message_list_list_append_list (message_list_list_ty *mllp,
+ message_list_list_ty *mllp2);
extern message_ty *
- message_list_list_search PARAMS ((message_list_list_ty *mllp,
- const char *msgid));
+ message_list_list_search (message_list_list_ty *mllp,
+ const char *msgid);
extern message_ty *
- message_list_list_search_fuzzy PARAMS ((message_list_list_ty *mllp,
- const char *msgid));
+ message_list_list_search_fuzzy (message_list_list_ty *mllp,
+ const char *msgid);
typedef struct msgdomain_ty msgdomain_ty;
};
extern msgdomain_ty *
- msgdomain_alloc PARAMS ((const char *domain, bool use_hashtable));
+ msgdomain_alloc (const char *domain, bool use_hashtable);
extern void
- msgdomain_free PARAMS ((msgdomain_ty *mdp));
+ msgdomain_free (msgdomain_ty *mdp);
typedef struct msgdomain_list_ty msgdomain_list_ty;
};
extern msgdomain_list_ty *
- msgdomain_list_alloc PARAMS ((bool use_hashtable));
+ msgdomain_list_alloc (bool use_hashtable);
extern void
- msgdomain_list_free PARAMS ((msgdomain_list_ty *mdlp));
+ msgdomain_list_free (msgdomain_list_ty *mdlp);
extern void
- msgdomain_list_append PARAMS ((msgdomain_list_ty *mdlp,
- msgdomain_ty *mdp));
+ msgdomain_list_append (msgdomain_list_ty *mdlp, msgdomain_ty *mdp);
extern void
- msgdomain_list_append_list PARAMS ((msgdomain_list_ty *mdlp,
- msgdomain_list_ty *mdlp2));
+ msgdomain_list_append_list (msgdomain_list_ty *mdlp,
+ msgdomain_list_ty *mdlp2);
extern message_list_ty *
- msgdomain_list_sublist PARAMS ((msgdomain_list_ty *mdlp,
- const char *domain, bool create));
+ msgdomain_list_sublist (msgdomain_list_ty *mdlp, const char *domain,
+ bool create);
extern message_ty *
- msgdomain_list_search PARAMS ((msgdomain_list_ty *mdlp,
- const char *msgid));
+ msgdomain_list_search (msgdomain_list_ty *mdlp, const char *msgid);
extern message_ty *
- msgdomain_list_search_fuzzy PARAMS ((msgdomain_list_ty *mdlp,
- const char *msgid));
+ msgdomain_list_search_fuzzy (msgdomain_list_ty *mdlp, const char *msgid);
#endif /* message.h */
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status));
-static bool is_message_selected PARAMS ((const message_ty *mp));
-static void process_message_list PARAMS ((message_list_ty *mlp));
-static msgdomain_list_ty *
- process_msgdomain_list PARAMS ((msgdomain_list_ty *mdlp));
+/* Forward declaration of local functions. */
+static void usage (int status)
+#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
+ __attribute__ ((noreturn))
+#endif
+;
+static msgdomain_list_ty *process_msgdomain_list (msgdomain_list_ty *mdlp);
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int optchar;
bool do_help;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
/* Return true if a message should be kept. */
static bool
-is_message_selected (mp)
- const message_ty *mp;
+is_message_selected (const message_ty *mp)
{
/* Always keep the header entry. */
if (mp->msgid[0] == '\0')
static void
-process_message_list (mlp)
- message_list_ty *mlp;
+process_message_list (message_list_ty *mlp)
{
/* Keep only the selected messages. */
message_list_remove_if_not (mlp, is_message_selected);
static msgdomain_list_ty *
-process_msgdomain_list (mdlp)
- msgdomain_list_ty *mdlp;
+process_msgdomain_list (msgdomain_list_ty *mdlp)
{
size_t k;
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status));
+/* Forward declaration of local functions. */
+static void usage (int status)
+#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
+ __attribute__ ((noreturn))
+#endif
+;
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int cnt;
int optchar;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status));
-static bool is_message_selected PARAMS ((const message_ty *mp));
-static msgdomain_list_ty * remove_obsoletes PARAMS ((msgdomain_list_ty *mdlp));
-static void match_domain PARAMS ((const char *fn1, const char *fn2,
- message_list_ty *defmlp,
- message_list_ty *refmlp, int *nerrors));
-static void compare PARAMS ((const char *, const char *));
+/* Forward declaration of local functions. */
+static void usage (int status)
+#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
+ __attribute__ ((noreturn))
+#endif
+;
+static void compare (const char *fn1, const char *fn2);
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
int optchar;
bool do_help;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
/* Return true if a message should be kept. */
static bool
-is_message_selected (mp)
- const message_ty *mp;
+is_message_selected (const message_ty *mp)
{
/* Always keep the header entry. */
if (mp->msgid[0] == '\0')
/* Remove obsolete messages from a message list. Return the modified list. */
static msgdomain_list_ty *
-remove_obsoletes (mdlp)
- msgdomain_list_ty *mdlp;
+remove_obsoletes (msgdomain_list_ty *mdlp)
{
size_t k;
static void
-match_domain (fn1, fn2, defmlp, refmlp, nerrors)
- const char *fn1;
- const char *fn2;
- message_list_ty *defmlp;
- message_list_ty *refmlp;
- int *nerrors;
+match_domain (const char *fn1, const char *fn2,
+ message_list_ty *defmlp, message_list_ty *refmlp,
+ int *nerrors)
{
size_t j;
static void
-compare (fn1, fn2)
- const char *fn1;
- const char *fn2;
+compare (const char *fn1, const char *fn2)
{
msgdomain_list_ty *def;
msgdomain_list_ty *ref;
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status))
+/* Forward declaration of local functions. */
+static void usage (int status)
#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ > 4) || __GNUC__ > 2)
__attribute__ ((noreturn))
#endif
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
int cnt;
int optchar;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
#define _(str) gettext (str)
-extern const char * locale_charset PARAMS ((void));
+extern const char * locale_charset (void);
/* Force output of PO file even if empty. */
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status));
+/* Forward declaration of local functions. */
+static void usage (int status)
+#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
+ __attribute__ ((noreturn))
+#endif
+;
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int opt;
bool do_help;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status));
+/* Forward declaration of local functions. */
+static void usage (int status)
+#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
+ __attribute__ ((noreturn))
+#endif
+;
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int opt;
bool do_help;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status));
-#ifdef EINTR
-static inline int nonintr_close PARAMS ((int fd));
+/* Forward declaration of local functions. */
+static void usage (int status)
+#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
+ __attribute__ ((noreturn))
#endif
-static void process_string PARAMS ((const message_ty *mp,
- const char *str, size_t len));
-static void process_message PARAMS ((const message_ty *mp));
-static void process_message_list PARAMS ((const message_list_ty *mlp));
-static void process_msgdomain_list PARAMS ((const msgdomain_list_ty *mdlp));
+;
+static void process_msgdomain_list (const msgdomain_list_ty *mdlp);
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int opt;
bool do_help;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
signal handlers set up, namely when we get interrupted via SIGSTOP. */
static inline int
-nonintr_close (fd)
- int fd;
+nonintr_close (int fd)
{
int retval;
/* Pipe a string STR of size LEN bytes to the subprogram.
The byte after STR is known to be a '\0' byte. */
static void
-process_string (mp, str, len)
- const message_ty *mp;
- const char *str;
- size_t len;
+process_string (const message_ty *mp, const char *str, size_t len)
{
ssize_t nwritten;
static void
-process_message (mp)
- const message_ty *mp;
+process_message (const message_ty *mp)
{
const char *msgstr = mp->msgstr;
size_t msgstr_len = mp->msgstr_len;
static void
-process_message_list (mlp)
- const message_list_ty *mlp;
+process_message_list (const message_list_ty *mlp)
{
size_t j;
static void
-process_msgdomain_list (mdlp)
- const msgdomain_list_ty *mdlp;
+process_msgdomain_list (const msgdomain_list_ty *mdlp)
{
size_t k;
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status));
-#ifdef EINTR
-static inline int nonintr_close PARAMS ((int fd));
-static inline ssize_t nonintr_read PARAMS ((int fd, void *buf, size_t count));
-static inline ssize_t nonintr_write PARAMS ((int fd, const void *buf,
- size_t count));
-#if HAVE_SELECT
-static inline int nonintr_select PARAMS ((int n, fd_set *readfds,
- fd_set *writefds, fd_set *exceptfds,
- struct timeval *timeout));
+/* Forward declaration of local functions. */
+static void usage (int status)
+#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
+ __attribute__ ((noreturn))
#endif
-#endif
-static void process_string PARAMS ((const char *str, size_t len,
- char **resultp, size_t *lengthp));
-static void process_message PARAMS ((message_ty *mp));
-static void process_message_list PARAMS ((message_list_ty *mlp));
-static msgdomain_list_ty *
- process_msgdomain_list PARAMS ((msgdomain_list_ty *mdlp));
+;
+static msgdomain_list_ty *process_msgdomain_list (msgdomain_list_ty *mdlp);
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int opt;
bool do_help;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
signal handlers set up, namely when we get interrupted via SIGSTOP. */
static inline int
-nonintr_close (fd)
- int fd;
+nonintr_close (int fd)
{
int retval;
#define close nonintr_close
static inline ssize_t
-nonintr_read (fd, buf, count)
- int fd;
- void *buf;
- size_t count;
+nonintr_read (int fd, void *buf, size_t count)
{
ssize_t retval;
#define read nonintr_read
static inline ssize_t
-nonintr_write (fd, buf, count)
- int fd;
- const void *buf;
- size_t count;
+nonintr_write (int fd, const void *buf, size_t count)
{
ssize_t retval;
# if HAVE_SELECT
static inline int
-nonintr_select (n, readfds, writefds, exceptfds, timeout)
- int n;
- fd_set *readfds;
- fd_set *writefds;
- fd_set *exceptfds;
- struct timeval *timeout;
+nonintr_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+ struct timeval *timeout)
{
int retval;
Store the freshly allocated result at *RESULTP and its length at *LENGTHP.
*/
static void
-process_string (str, len, resultp, lengthp)
- const char *str;
- size_t len;
- char **resultp;
- size_t *lengthp;
+process_string (const char *str, size_t len, char **resultp, size_t *lengthp)
{
pid_t child;
int fd[2];
static void
-process_message (mp)
- message_ty *mp;
+process_message (message_ty *mp)
{
const char *msgstr = mp->msgstr;
size_t msgstr_len = mp->msgstr_len;
static void
-process_message_list (mlp)
- message_list_ty *mlp;
+process_message_list (message_list_ty *mlp)
{
size_t j;
static msgdomain_list_ty *
-process_msgdomain_list (mdlp)
- msgdomain_list_ty *mdlp;
+process_msgdomain_list (msgdomain_list_ty *mdlp)
{
size_t k;
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status))
+/* Forward declaration of local functions. */
+static void usage (int status)
#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
__attribute__ ((noreturn))
#endif
;
-static const char *add_mo_suffix PARAMS ((const char *));
-static struct msg_domain *new_domain PARAMS ((const char *name,
- const char *file_name));
-static bool is_nonobsolete PARAMS ((const message_ty *mp));
-#if USE_SIGINFO
-static void sigfpe_handler PARAMS ((int sig, siginfo_t *sip, void *scp));
-#else
-static void sigfpe_handler PARAMS ((int sig));
-#endif
-static void install_sigfpe_handler PARAMS ((void));
-static void uninstall_sigfpe_handler PARAMS ((void));
-static void check_plural_eval PARAMS ((struct expression *plural_expr,
- unsigned long nplurals_value,
- const lex_pos_ty *header_pos));
-static void check_plural PARAMS ((message_list_ty *mlp));
-static void check_pair PARAMS ((const char *msgid, const lex_pos_ty *msgid_pos,
- const char *msgid_plural,
- const char *msgstr, size_t msgstr_len,
- const lex_pos_ty *msgstr_pos,
- enum is_format is_format[NFORMATS]));
-static void check_header_entry PARAMS ((const char *msgstr_string));
-static void format_constructor PARAMS ((po_ty *that));
-static void format_debrief PARAMS ((po_ty *));
-static void format_directive_domain PARAMS ((po_ty *pop, char *name));
-static void format_directive_message PARAMS ((po_ty *pop, char *msgid,
- lex_pos_ty *msgid_pos,
- char *msgid_plural,
- char *msgstr, size_t msgstr_len,
- lex_pos_ty *msgstr_pos,
- bool obsolete));
-static void format_comment_special PARAMS ((po_ty *pop, const char *s));
-static void read_po_file PARAMS ((char *filename));
+static const char *add_mo_suffix (const char *);
+static struct msg_domain *new_domain (const char *name, const char *file_name);
+static bool is_nonobsolete (const message_ty *mp);
+static void check_plural (message_list_ty *mlp);
+static void read_po_file (char *filename);
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
int opt;
bool do_help = false;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
static const char *
-add_mo_suffix (fname)
- const char *fname;
+add_mo_suffix (const char *fname)
{
size_t len;
char *result;
static struct msg_domain *
-new_domain (name, file_name)
- const char *name;
- const char *file_name;
+new_domain (const char *name, const char *file_name)
{
struct msg_domain **p_dom = &domain_list;
static bool
-is_nonobsolete (mp)
- const message_ty *mp;
+is_nonobsolete (const message_ty *mp)
{
return !mp->obsolete;
}
/* Signal handler called in case of arithmetic exception (e.g. division
by zero) during plural_eval. */
static void
-sigfpe_handler (sig, sip, scp)
- int sig;
- siginfo_t *sip;
- void *scp;
+sigfpe_handler (int sig, siginfo_t *sip, void *scp)
{
sigfpe_code = sip->si_code;
siglongjmp (sigfpe_exit, 1);
/* Signal handler called in case of arithmetic exception (e.g. division
by zero) during plural_eval. */
static void
-sigfpe_handler (sig)
- int sig;
+sigfpe_handler (int sig)
{
siglongjmp (sigfpe_exit, 1);
}
/* Check the values returned by plural_eval. */
static void
-check_plural_eval (plural_expr, nplurals_value, header_pos)
- struct expression *plural_expr;
- unsigned long nplurals_value;
- const lex_pos_ty *header_pos;
+check_plural_eval (struct expression *plural_expr,
+ unsigned long nplurals_value,
+ const lex_pos_ty *header_pos)
{
if (sigsetjmp (sigfpe_exit, 1) == 0)
{
/* Perform plural expression checking. */
static void
-check_plural (mlp)
- message_list_ty *mlp;
+check_plural (message_list_ty *mlp)
{
const lex_pos_ty *has_plural;
unsigned long min_nplurals;
/* Perform miscellaneous checks on a message. */
static void
-check_pair (msgid, msgid_pos, msgid_plural, msgstr, msgstr_len, msgstr_pos,
- is_format)
- const char *msgid;
- const lex_pos_ty *msgid_pos;
- const char *msgid_plural;
- const char *msgstr;
- size_t msgstr_len;
- const lex_pos_ty *msgstr_pos;
- enum is_format is_format[NFORMATS];
+check_pair (const char *msgid,
+ const lex_pos_ty *msgid_pos,
+ const char *msgid_plural,
+ const char *msgstr, size_t msgstr_len,
+ const lex_pos_ty *msgstr_pos, enum is_format is_format[NFORMATS])
{
int has_newline;
size_t i;
/* Perform miscellaneous checks on a header entry. */
static void
-check_header_entry (msgstr_string)
- const char *msgstr_string;
+check_header_entry (const char *msgstr_string)
{
static const char *required_fields[] =
{
/* Prepare for first message. */
static void
-format_constructor (that)
- po_ty *that;
+format_constructor (po_ty *that)
{
msgfmt_class_ty *this = (msgfmt_class_ty *) that;
size_t i;
/* Some checks after whole file is read. */
static void
-format_debrief (that)
- po_ty *that;
+format_debrief (po_ty *that)
{
msgfmt_class_ty *this = (msgfmt_class_ty *) that;
/* Process `domain' directive from .po file. */
static void
-format_directive_domain (pop, name)
- po_ty *pop;
- char *name;
+format_directive_domain (po_ty *pop, char *name)
{
/* If no output file was given, we change it with each `domain'
directive. */
/* Process `msgid'/`msgstr' pair from .po file. */
static void
-format_directive_message (that, msgid_string, msgid_pos, msgid_plural,
- msgstr_string, msgstr_len, msgstr_pos, obsolete)
- po_ty *that;
- char *msgid_string;
- lex_pos_ty *msgid_pos;
- char *msgid_plural;
- char *msgstr_string;
- size_t msgstr_len;
- lex_pos_ty *msgstr_pos;
- bool obsolete;
+format_directive_message (po_ty *that,
+ char *msgid_string,
+ lex_pos_ty *msgid_pos,
+ char *msgid_plural,
+ char *msgstr_string, size_t msgstr_len,
+ lex_pos_ty *msgstr_pos,
+ bool obsolete)
{
msgfmt_class_ty *this = (msgfmt_class_ty *) that;
message_ty *mp;
/* Test for `#, fuzzy' comments and warn. */
static void
-format_comment_special (that, s)
- po_ty *that;
- const char *s;
+format_comment_special (po_ty *that, const char *s)
{
msgfmt_class_ty *this = (msgfmt_class_ty *) that;
bool fuzzy;
/* Read .po file FILENAME and store translation pairs. */
static void
-read_po_file (filename)
- char *filename;
+read_po_file (char *filename)
{
po_ty *pop;
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void no_pass PARAMS ((int opt));
-static void usage PARAMS ((int status));
-static bool filename_list_match PARAMS ((const string_list_ty *slp,
- const char *filename));
-#ifdef EINTR
-static inline int nonintr_close PARAMS ((int fd));
+/* Forward declaration of local functions. */
+static void no_pass (int opt)
+#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
+ __attribute__ ((noreturn))
#endif
-static bool is_string_selected PARAMS ((int grep_pass, const char *str,
- size_t len));
-static bool is_message_selected PARAMS ((const message_ty *mp));
-static void process_message_list PARAMS ((const char *domain,
- message_list_ty *mlp));
-static msgdomain_list_ty *
- process_msgdomain_list PARAMS ((msgdomain_list_ty *mdlp));
+;
+static void usage (int status)
+#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
+ __attribute__ ((noreturn))
+#endif
+;
+static msgdomain_list_ty *process_msgdomain_list (msgdomain_list_ty *mdlp);
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int opt;
bool do_help;
static void
-no_pass (opt)
- int opt;
+no_pass (int opt)
{
error (EXIT_SUCCESS, 0,
_("option '%c' cannot be used before 'K' or 'T' has been specified"),
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
/* Return 1 if FILENAME is contained in a list of filename patterns,
0 otherwise. */
static bool
-filename_list_match (slp, filename)
- const string_list_ty *slp;
- const char *filename;
+filename_list_match (const string_list_ty *slp, const char *filename)
{
size_t j;
signal handlers set up, namely when we get interrupted via SIGSTOP. */
static inline int
-nonintr_close (fd)
- int fd;
+nonintr_close (int fd)
{
int retval;
/* Process a string STR of size LEN bytes through grep, and return true
if it matches. */
static bool
-is_string_selected (grep_pass, str, len)
- int grep_pass;
- const char *str;
- size_t len;
+is_string_selected (int grep_pass, const char *str, size_t len)
{
if (grep_args[grep_pass]->nitems > 0)
{
/* Return true if a message matches. */
static bool
-is_message_selected (mp)
- const message_ty *mp;
+is_message_selected (const message_ty *mp)
{
size_t i;
const char *msgstr;
static void
-process_message_list (domain, mlp)
- const char *domain;
- message_list_ty *mlp;
+process_message_list (const char *domain, message_list_ty *mlp)
{
if (string_list_member (domain_names, domain))
/* Keep all the messages in the list. */
static msgdomain_list_ty *
-process_msgdomain_list (mdlp)
- msgdomain_list_ty *mdlp;
+process_msgdomain_list (msgdomain_list_ty *mdlp)
{
size_t k;
#define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
-extern const char * locale_charset PARAMS ((void));
-extern const char * _nl_locale_name PARAMS ((int category,
- const char *categoryname));
-extern const char * _nl_expand_alias PARAMS ((const char *name));
+extern const char * locale_charset (void);
+extern const char * _nl_locale_name (int category, const char *categoryname);
+extern const char * _nl_expand_alias (const char *name);
/* Locale name. */
static const char *locale;
{ NULL, 0, NULL, 0 }
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status))
+/* Forward declaration of local functions. */
+static void usage (int status)
#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
__attribute__ ((noreturn))
#endif
;
-static const char *find_pot PARAMS ((void));
-static const char *catalogname_for_locale PARAMS ((const char *locale));
-static const char *language_of_locale PARAMS ((const char *locale));
-static const char *canonical_locale_charset PARAMS ((void));
-static const char *englishname_of_language PARAMS ((void));
-static const char *project_id PARAMS ((void));
-static const char *project_id_version PARAMS ((void));
-static const char *po_revision_date PARAMS ((const char *header));
-static struct passwd *get_user_pwd PARAMS ((void));
-static const char *get_user_fullname PARAMS ((void));
-static const char *get_user_email PARAMS ((void));
-static const char *last_translator PARAMS ((void));
-static const char *language_team_address PARAMS ((void));
-static const char *language_team PARAMS ((void));
-static const char *mime_version PARAMS ((void));
-static const char *content_type PARAMS ((const char *header));
-static const char *content_transfer_encoding PARAMS ((void));
-static const char *plural_forms PARAMS ((void));
-static char *get_field PARAMS ((const char *header, const char *field));
-static char *put_field PARAMS ((const char *old_header, const char *field,
- const char *value));
-static const char *get_title PARAMS ((void));
-static const char *subst_string PARAMS ((const char *str,
- unsigned int nsubst,
- const char *(*subst)[2]));
-static void subst_string_list PARAMS ((string_list_ty *slp,
- unsigned int nsubst,
- const char *(*subst)[2]));
-static msgdomain_list_ty *fill_header PARAMS ((msgdomain_list_ty *mdlp));
+static const char *find_pot (void);
+static const char *catalogname_for_locale (const char *locale);
+static const char *language_of_locale (const char *locale);
+static char *get_field (const char *header, const char *field);
+static msgdomain_list_ty *fill_header (msgdomain_list_ty *mdlp);
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int opt;
bool do_help;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
because the resulting catalog can be used as a default for all "de_XX",
such as "de_AT". */
static const char *
-catalogname_for_locale (locale)
- const char *locale;
+catalogname_for_locale (const char *locale)
{
static const char *locales_with_principal_territory[] = {
/* Language Main territory */
/* Return the language of a locale. */
static const char *
-language_of_locale (locale)
- const char *locale;
+language_of_locale (const char *locale)
{
const char *language_end;
/* Construct the value for the PO-Revision-Date field. */
static const char *
-po_revision_date (header)
- const char *header;
+po_revision_date (const char *header)
{
if (no_translator)
/* Because the PO file is automatically generated, we use the
/* Construct the value for the Content-Type field. */
static const char *
-content_type (header)
- const char *header;
+content_type (const char *header)
{
bool was_utf8;
const char *old_field;
static struct
{
const char *name;
- const char * (*getter0) PARAMS ((void));
- const char * (*getter1) PARAMS ((const char *header));
+ const char * (*getter0) (void);
+ const char * (*getter1) (const char *header);
}
fields[] =
{
/* Retrieve a freshly allocated copy of a field's value. */
static char *
-get_field (header, field)
- const char *header;
- const char *field;
+get_field (const char *header, const char *field)
{
size_t len = strlen (field);
const char *line;
/* Add a field with value to a header, and return the new header. */
static char *
-put_field (old_header, field, value)
- const char *old_header;
- const char *field;
- const char *value;
+put_field (const char *old_header, const char *field, const char *value)
{
size_t len = strlen (field);
const char *line;
string. When subst[j][0] found, it is replaced with subst[j][1].
subst[j][0] must not be the empty string. */
static const char *
-subst_string (str, nsubst, subst)
- const char *str;
- unsigned int nsubst;
- const char *(*subst)[2];
+subst_string (const char *str,
+ unsigned int nsubst, const char *(*subst)[2])
{
if (nsubst > 0)
{
When subst[j][0] found, it is replaced with subst[j][1]. subst[j][0]
must not be the empty string. */
static void
-subst_string_list (slp, nsubst, subst)
- string_list_ty *slp;
- unsigned int nsubst;
- const char *(*subst)[2];
+subst_string_list (string_list_ty *slp,
+ unsigned int nsubst, const char *(*subst)[2])
{
size_t j;
/* Fill the templates in all fields of the header entry. */
static msgdomain_list_ty *
-fill_header (mdlp)
- msgdomain_list_ty *mdlp;
+fill_header (msgdomain_list_ty *mdlp)
{
/* Cache the strings filled in, for use when there are multiple domains
and a header entry for each domain. */
bool
-is_ascii_string (string)
- const char *string;
+is_ascii_string (const char *string)
{
for (; *string; string++)
if (!c_isascii ((unsigned char) *string))
}
bool
-is_ascii_string_list (slp)
- string_list_ty *slp;
+is_ascii_string_list (string_list_ty *slp)
{
size_t i;
}
bool
-is_ascii_message (mp)
- message_ty *mp;
+is_ascii_message (message_ty *mp)
{
const char *p = mp->msgstr;
const char *p_end = p + mp->msgstr_len;
}
bool
-is_ascii_message_list (mlp)
- message_list_ty *mlp;
+is_ascii_message_list (message_list_ty *mlp)
{
size_t j;
/* Message list test for ASCII character set.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#include <stdbool.h>
extern bool
- is_ascii_string PARAMS ((const char *string));
+ is_ascii_string (const char *string);
extern bool
- is_ascii_string_list PARAMS ((string_list_ty *slp));
+ is_ascii_string_list (string_list_ty *slp);
extern bool
- is_ascii_message PARAMS ((message_ty *mp));
+ is_ascii_message (message_ty *mp);
extern bool
- is_ascii_message_list PARAMS ((message_list_ty *mlp));
+ is_ascii_message_list (message_list_ty *mlp);
#endif /* _MSGL_ASCII_H */
bool omit_header = false;
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static bool is_message_selected PARAMS ((const message_ty *tmp));
-static bool is_message_needed PARAMS ((const message_ty *tmp));
-static bool is_message_first_needed PARAMS ((const message_ty *tmp));
-
-
static bool
-is_message_selected (tmp)
- const message_ty *tmp;
+is_message_selected (const message_ty *tmp)
{
int used = (tmp->used >= 0 ? tmp->used : - tmp->used);
static bool
-is_message_needed (mp)
- const message_ty *mp;
+is_message_needed (const message_ty *mp)
{
if (!msgcomm_mode
&& ((mp->msgid[0] != '\0' && mp->is_fuzzy) || mp->msgstr[0] == '\0'))
/* The use_first logic. */
static bool
-is_message_first_needed (mp)
- const message_ty *mp;
+is_message_first_needed (const message_ty *mp)
{
if (mp->tmp->obsolete && is_message_needed (mp))
{
msgdomain_list_ty *
-catenate_msgdomain_list (file_list, to_code)
- string_list_ty *file_list;
- const char *to_code;
+catenate_msgdomain_list (string_list_ty *file_list, const char *to_code)
{
const char * const *files = file_list->item;
size_t nfiles = file_list->nitems;
/* Message list concatenation and duplicate handling.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
extern bool omit_header;
extern msgdomain_list_ty *
- catenate_msgdomain_list PARAMS ((string_list_ty *file_list,
- const char *to_code));
+ catenate_msgdomain_list (string_list_ty *file_list,
+ const char *to_code);
#endif /* _MSGL_CAT_H */
/* Message list charset and locale charset handling.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#define _(str) gettext (str)
-extern const char * locale_charset PARAMS ((void));
+extern const char * locale_charset (void);
void
-compare_po_locale_charsets (mdlp)
- const msgdomain_list_ty *mdlp;
+compare_po_locale_charsets (const msgdomain_list_ty *mdlp)
{
const char *locale_code;
const char *canon_locale_code;
/* Message list charset and locale charset handling.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#include "message.h"
extern void
- compare_po_locale_charsets PARAMS ((const msgdomain_list_ty *mdlp));
+ compare_po_locale_charsets (const msgdomain_list_ty *mdlp);
#endif /* _MSGL_CHARSET_H */
/* Message translation initialization for English.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
msgdomain_list_ty *
-msgdomain_list_english (mdlp)
- msgdomain_list_ty *mdlp;
+msgdomain_list_english (msgdomain_list_ty *mdlp)
{
size_t j, k;
/* Message translation initialization for English.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#include "message.h"
extern msgdomain_list_ty *
- msgdomain_list_english PARAMS ((msgdomain_list_ty *mdlp));
+ msgdomain_list_english (msgdomain_list_ty *mdlp);
#endif /* _MSGL_ENGLISH_H */
#include <string.h>
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static inline bool msgstr_equal PARAMS ((const char *msgstr1,
- size_t msgstr1_len,
- const char *msgstr2,
- size_t msgstr2_len));
-static inline bool msgstr_equal_ignoring_potcdate PARAMS ((const char *msgstr1,
- size_t msgstr1_len,
- const char *msgstr2,
- size_t msgstr2_len));
-static inline bool pos_equal PARAMS ((const lex_pos_ty *pos1,
- const lex_pos_ty *pos2));
-static inline bool msgdomain_equal PARAMS ((const msgdomain_ty *mdp1,
- const msgdomain_ty *mdp2,
- bool ignore_potcdate));
-
-
static inline bool
-msgstr_equal (msgstr1, msgstr1_len, msgstr2, msgstr2_len)
- const char *msgstr1;
- size_t msgstr1_len;
- const char *msgstr2;
- size_t msgstr2_len;
+msgstr_equal (const char *msgstr1, size_t msgstr1_len,
+ const char *msgstr2, size_t msgstr2_len)
{
return (msgstr1_len == msgstr2_len
&& memcmp (msgstr1, msgstr2, msgstr1_len) == 0);
}
static bool
-msgstr_equal_ignoring_potcdate (msgstr1, msgstr1_len, msgstr2, msgstr2_len)
- const char *msgstr1;
- size_t msgstr1_len;
- const char *msgstr2;
- size_t msgstr2_len;
+msgstr_equal_ignoring_potcdate (const char *msgstr1, size_t msgstr1_len,
+ const char *msgstr2, size_t msgstr2_len)
{
const char *msgstr1_end = msgstr1 + msgstr1_len;
const char *msgstr2_end = msgstr2 + msgstr2_len;
}
static inline bool
-pos_equal (pos1, pos2)
- const lex_pos_ty *pos1;
- const lex_pos_ty *pos2;
+pos_equal (const lex_pos_ty *pos1, const lex_pos_ty *pos2)
{
return ((pos1->file_name == pos2->file_name
|| strcmp (pos1->file_name, pos2->file_name) == 0)
}
bool
-string_list_equal (slp1, slp2)
- const string_list_ty *slp1;
- const string_list_ty *slp2;
+string_list_equal (const string_list_ty *slp1, const string_list_ty *slp2)
{
size_t i, i1, i2;
}
bool
-message_equal (mp1, mp2, ignore_potcdate)
- const message_ty *mp1;
- const message_ty *mp2;
- bool ignore_potcdate;
+message_equal (const message_ty *mp1, const message_ty *mp2,
+ bool ignore_potcdate)
{
size_t i, i1, i2;
}
bool
-message_list_equal (mlp1, mlp2, ignore_potcdate)
- const message_list_ty *mlp1;
- const message_list_ty *mlp2;
- bool ignore_potcdate;
+message_list_equal (const message_list_ty *mlp1, const message_list_ty *mlp2,
+ bool ignore_potcdate)
{
size_t i, i1, i2;
}
static inline bool
-msgdomain_equal (mdp1, mdp2, ignore_potcdate)
- const msgdomain_ty *mdp1;
- const msgdomain_ty *mdp2;
- bool ignore_potcdate;
+msgdomain_equal (const msgdomain_ty *mdp1, const msgdomain_ty *mdp2,
+ bool ignore_potcdate)
{
return (strcmp (mdp1->domain, mdp2->domain) == 0
&& message_list_equal (mdp1->messages, mdp2->messages,
}
bool
-msgdomain_list_equal (mdlp1, mdlp2, ignore_potcdate)
- const msgdomain_list_ty *mdlp1;
- const msgdomain_list_ty *mdlp2;
- bool ignore_potcdate;
+msgdomain_list_equal (const msgdomain_list_ty *mdlp1,
+ const msgdomain_list_ty *mdlp2,
+ bool ignore_potcdate)
{
size_t i, i1, i2;
#include <stdbool.h>
extern bool
- string_list_equal PARAMS ((const string_list_ty *slp1,
- const string_list_ty *slp2));
+ string_list_equal (const string_list_ty *slp1,
+ const string_list_ty *slp2);
/* Test whether the written representation of two messages / message lists
would be the same. */
extern bool
- message_equal PARAMS ((const message_ty *mp1, const message_ty *mp2,
- bool ignore_potcdate));
+ message_equal (const message_ty *mp1, const message_ty *mp2,
+ bool ignore_potcdate);
extern bool
- message_list_equal PARAMS ((const message_list_ty *mlp1,
- const message_list_ty *mlp2,
- bool ignore_potcdate));
+ message_list_equal (const message_list_ty *mlp1,
+ const message_list_ty *mlp2,
+ bool ignore_potcdate);
extern bool
- msgdomain_list_equal PARAMS ((const msgdomain_list_ty *mdlp1,
- const msgdomain_list_ty *mdlp2,
- bool ignore_potcdate));
+ msgdomain_list_equal (const msgdomain_list_ty *mdlp1,
+ const msgdomain_list_ty *mdlp2,
+ bool ignore_potcdate);
#endif /* _MSGL_EQUAL_H */
#define _(str) gettext (str)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-#if HAVE_ICONV
-static int iconv_string PARAMS ((iconv_t cd,
- const char *start, const char *end,
- char **resultp, size_t *lengthp));
-static void convert_string_list PARAMS ((iconv_t cd, string_list_ty *slp));
-static void convert_msgid PARAMS ((iconv_t cd, message_ty *mp));
-static void convert_msgstr PARAMS ((iconv_t cd, message_ty *mp));
-#endif
-
-
#if HAVE_ICONV
/* Converts an entire string from one encoding to another, using iconv.
Return value: 0 if successful, otherwise -1 and errno set. */
static int
-iconv_string (cd, start, end, resultp, lengthp)
- iconv_t cd;
- const char *start;
- const char *end;
- char **resultp;
- size_t *lengthp;
+iconv_string (iconv_t cd, const char *start, const char *end,
+ char **resultp, size_t *lengthp)
{
#define tmpbufsize 4096
size_t length;
}
char *
-convert_string (cd, string)
- iconv_t cd;
- const char *string;
+convert_string (iconv_t cd, const char *string)
{
size_t len = strlen (string) + 1;
char *result = NULL;
}
static void
-convert_string_list (cd, slp)
- iconv_t cd;
- string_list_ty *slp;
+convert_string_list (iconv_t cd, string_list_ty *slp)
{
size_t i;
}
static void
-convert_msgid (cd, mp)
- iconv_t cd;
- message_ty *mp;
+convert_msgid (iconv_t cd, message_ty *mp)
{
mp->msgid = convert_string (cd, mp->msgid);
if (mp->msgid_plural != NULL)
}
static void
-convert_msgstr (cd, mp)
- iconv_t cd;
- message_ty *mp;
+convert_msgstr (iconv_t cd, message_ty *mp)
{
char *result = NULL;
size_t resultlen;
void
-iconv_message_list (mlp, canon_from_code, canon_to_code, from_filename)
- message_list_ty *mlp;
- const char *canon_from_code;
- const char *canon_to_code;
- const char *from_filename;
+iconv_message_list (message_list_ty *mlp,
+ const char *canon_from_code, const char *canon_to_code,
+ const char *from_filename)
{
bool canon_from_code_overridden = (canon_from_code != NULL);
size_t j;
}
msgdomain_list_ty *
-iconv_msgdomain_list (mdlp, to_code, from_filename)
- msgdomain_list_ty *mdlp;
- const char *to_code;
- const char *from_filename;
+iconv_msgdomain_list (msgdomain_list_ty *mdlp,
+ const char *to_code,
+ const char *from_filename)
{
const char *canon_to_code;
size_t k;
#if HAVE_ICONV
/* Converts the STRING through the conversion descriptor CD. */
-extern char *convert_string PARAMS ((iconv_t cd, const char *string));
+extern char *convert_string (iconv_t cd, const char *string);
#endif
/* Converts the message list MLP to the (already canonicalized) encoding
can be passed as CANON_FROM_CODE; if NULL is passed instead, the
encoding is looked up in the header entry. */
extern void
- iconv_message_list PARAMS ((message_list_ty *mlp,
- const char *canon_from_code,
- const char *canon_to_code,
- const char *from_filename));
+ iconv_message_list (message_list_ty *mlp,
+ const char *canon_from_code,
+ const char *canon_to_code,
+ const char *from_filename);
/* Converts all the message lists in MDLP to the encoding TO_CODE. */
extern msgdomain_list_ty *
- iconv_msgdomain_list PARAMS ((msgdomain_list_ty *mdlp,
- const char *to_code,
- const char *from_filename));
+ iconv_msgdomain_list (msgdomain_list_ty *mdlp,
+ const char *to_code,
+ const char *from_filename);
#endif /* _MSGL_ICONV_H */
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status));
-static void compendium PARAMS ((const char *filename));
-static bool msgfmt_check_pair_fails PARAMS ((const lex_pos_ty *pos,
- const char *msgid,
- const char *msgid_plural,
- const char *msgstr,
- size_t msgstr_len, size_t fmt));
-static message_ty *message_merge PARAMS ((message_ty *def, message_ty *ref));
-static void match_domain PARAMS ((const char *fn1, const char *fn2,
- message_list_list_ty *definitions,
- message_list_ty *refmlp,
- message_list_ty *resultmlp,
- struct statistics *stats,
- unsigned int *processed));
-static msgdomain_list_ty *merge PARAMS ((const char *fn1, const char *fn2,
- msgdomain_list_ty **defp));
+/* Forward declaration of local functions. */
+static void usage (int status)
+#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
+ __attribute__ ((noreturn))
+#endif
+;
+static void compendium (const char *filename);
+static msgdomain_list_ty *merge (const char *fn1, const char *fn2,
+ msgdomain_list_ty **defp);
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int opt;
bool do_help;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
static void
-compendium (filename)
- const char *filename;
+compendium (const char *filename)
{
msgdomain_list_ty *mdlp;
size_t k;
static bool
-msgfmt_check_pair_fails (pos, msgid, msgid_plural, msgstr, msgstr_len, fmt)
- const lex_pos_ty *pos;
- const char *msgid;
- const char *msgid_plural;
- const char *msgstr;
- size_t msgstr_len;
- size_t fmt;
+msgfmt_check_pair_fails (const lex_pos_ty *pos,
+ const char *msgid, const char *msgid_plural,
+ const char *msgstr, size_t msgstr_len,
+ size_t fmt)
{
bool failure;
struct formatstring_parser *parser = formatstring_parsers[fmt];
static message_ty *
-message_merge (def, ref)
- message_ty *def;
- message_ty *ref;
+message_merge (message_ty *def, message_ty *ref)
{
const char *msgstr;
size_t msgstr_len;
#define DOT_FREQUENCY 10
static void
-match_domain (fn1, fn2, definitions, refmlp, resultmlp, stats, processed)
- const char *fn1;
- const char *fn2;
- message_list_list_ty *definitions;
- message_list_ty *refmlp;
- message_list_ty *resultmlp;
- struct statistics *stats;
- unsigned int *processed;
+match_domain (const char *fn1, const char *fn2,
+ message_list_list_ty *definitions, message_list_ty *refmlp,
+ message_list_ty *resultmlp,
+ struct statistics *stats, unsigned int *processed)
{
size_t j;
}
static msgdomain_list_ty *
-merge (fn1, fn2, defp)
- const char *fn1; /* definitions */
- const char *fn2; /* references */
- msgdomain_list_ty **defp; /* return definition list */
+merge (const char *fn1, const char *fn2, msgdomain_list_ty **defp)
{
msgdomain_list_ty *def;
msgdomain_list_ty *ref;
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status));
+/* Forward declaration of local functions. */
+static void usage (int status)
+#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
+ __attribute__ ((noreturn))
+#endif
+;
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int optchar;
bool do_help = false;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status));
+/* Forward declaration of local functions. */
+static void usage (int status)
+#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
+ __attribute__ ((noreturn))
+#endif
+;
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int optchar;
bool do_help;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
{ NULL, 0, NULL, 0 }
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status))
+/* Forward declaration of local functions. */
+static void usage (int status)
#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
__attribute__ ((noreturn))
#endif
;
-static const char *expand_escape PARAMS ((const char *str));
+static const char *expand_escape (const char *str);
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
int optchar;
const char *msgid;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
/* Expand some escape sequences found in the argument string. */
static const char *
-expand_escape (str)
- const char *str;
+expand_escape (const char *str)
{
char *retval, *rp;
const char *cp = str;
file's pathname is returned in *REAL_FILE_NAME_P, for error message
purposes. */
FILE *
-open_po_file (input_name, real_file_name_p)
- const char *input_name;
- char **real_file_name_p;
+open_po_file (const char *input_name, char **real_file_name_p)
{
static const char *extension[] = { "", ".po", ".pot", };
char *file_name;
/* Opening PO files.
- Copyright (C) 1995, 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1997, 2000-2002 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
not found, the list of directories in "dir-list.h" is searched. The
file's pathname is returned in *REAL_FILE_NAME_P, for error message
purposes. */
-extern FILE *open_po_file PARAMS ((const char *input_name,
- char **real_file_name_p));
+extern FILE *open_po_file (const char *input_name, char **real_file_name_p);
#endif /* _OPEN_PO_H */
/* Canonicalize an encoding name. */
const char *
-po_charset_canonicalize (charset)
- const char *charset;
+po_charset_canonicalize (const char *charset)
{
/* The list of charsets supported by glibc's iconv() and by the portable
iconv() across platforms. Taken from intl/config.charset. */
/* Test for ASCII compatibility. */
bool
-po_charset_ascii_compatible (canon_charset)
- const char *canon_charset;
+po_charset_ascii_compatible (const char *canon_charset)
{
/* There are only a few exceptions to ASCII compatibility. */
if (strcmp (canon_charset, "SHIFT_JIS") == 0
/* Test for a weird encoding, i.e. an encoding which has double-byte
characters ending in 0x5C. */
-bool po_is_charset_weird (canon_charset)
- const char *canon_charset;
+bool po_is_charset_weird (const char *canon_charset)
{
static const char *weird_charsets[] =
{
An encoding has CJK structure if every valid character stream is composed
of single bytes in the range 0x{00..7F} and of byte pairs in the range
0x{80..FF}{30..FF}. */
-bool po_is_charset_weird_cjk (canon_charset)
- const char *canon_charset;
+bool po_is_charset_weird_cjk (const char *canon_charset)
{
static const char *weird_cjk_charsets[] =
{ /* single bytes double bytes */
}
void
-po_lex_charset_set (header_entry, filename)
- const char *header_entry;
- const char *filename;
+po_lex_charset_set (const char *header_entry, const char *filename)
{
/* Verify the validity of CHARSET. It is necessary
1. for the correct treatment of multibyte characters containing
/* Canonicalize an encoding name.
The results of this function are statically allocated and can be
compared using ==. */
-extern const char *po_charset_canonicalize PARAMS ((const char *charset));
+extern const char *po_charset_canonicalize (const char *charset);
/* The canonicalized encoding name for ASCII. */
extern const char *po_charset_ascii;
extern const char *po_charset_utf8;
/* Test for ASCII compatibility. */
-extern bool po_charset_ascii_compatible PARAMS ((const char *canon_charset));
+extern bool po_charset_ascii_compatible (const char *canon_charset);
/* Test for a weird encoding, i.e. an encoding which has double-byte
characters ending in 0x5C. */
-extern bool po_is_charset_weird PARAMS ((const char *canon_charset));
+extern bool po_is_charset_weird (const char *canon_charset);
/* Test for a weird CJK encoding, i.e. a weird encoding with CJK structure.
An encoding has CJK structure if every valid character stream is composed
of single bytes in the range 0x{00..7F} and of byte pairs in the range
0x{80..FF}{30..FF}. */
-extern bool po_is_charset_weird_cjk PARAMS ((const char *canon_charset));
+extern bool po_is_charset_weird_cjk (const char *canon_charset);
/* The PO file's encoding, as specified in the header entry. */
extern bool po_lex_weird_cjk;
/* Initialize the PO file's encoding. */
-extern void po_lex_charset_init PARAMS ((void));
+extern void po_lex_charset_init (void);
/* Set the PO file's encoding from the header entry. */
-extern void po_lex_charset_set PARAMS ((const char *header_entry,
- const char *filename));
+extern void po_lex_charset_set (const char *header_entry,
+ const char *filename);
/* Finish up with the PO file's encoding. */
-extern void po_lex_charset_close PARAMS ((void));
+extern void po_lex_charset_close (void);
#endif /* _PO_CHARSET_H */
/* GNU gettext - internationalization aids
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2002 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
/* Include some fundamental headers. */
#include <sys/types.h>
-extern int po_gram_parse PARAMS ((void));
+extern int po_gram_parse (void);
#endif
/* GNU gettext - internationalization aids
- Copyright (C) 1995, 1996, 1998, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 1998, 2001-2002 Free Software Foundation, Inc.
This file was written by Peter Miller <pmiller@agso.gov.au>
static const char *cur;
-void yyerror PARAMS ((char *));
-int yylex PARAMS ((void));
+void yyerror (char *);
+int yylex (void);
int
-po_hash (s)
- const char *s;
+po_hash (const char *s)
{
- extern int yyparse PARAMS ((void));
+ extern int yyparse (void);
cur = s;
return yyparse ();
void
-yyerror (s)
- char *s;
+yyerror (char *s)
{
/* Do nothing, the grammar is used as a recogniser. */
}
/* GNU gettext - internationalization aids
- Copyright (C) 1995, 1996, 1998, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 1998, 2001-2002 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
#ifndef _PO_HASH_H
#define _PO_HASH_H
-extern int po_hash PARAMS ((const char *string));
+extern int po_hash (const char *string);
#endif /* _PO_HASH_H */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdarg.h>
#if HAVE_ICONV
# include <iconv.h>
#include "c-ctype.h"
#include "linebreak.h"
#include "vasprintf.h"
-#include "libstdarg.h"
#include "gettext.h"
#include "po-charset.h"
#include "xmalloc.h"
# define getc getc_unlocked
#endif
-#if HAVE_C_BACKSLASH_A
-# define ALERT_CHAR '\a'
-#else
-# define ALERT_CHAR '\7'
-#endif
-
/* Current position within the PO file. */
lex_pos_ty gram_pos;
/* VARARGS1 */
void
-po_gram_error VA_PARAMS ((const char *fmt, ...),
- (fmt, va_alist)
- const char *fmt;
- va_dcl)
+po_gram_error (const char *fmt, ...)
{
va_list ap;
char *buffer;
- VA_START (ap, fmt);
+ va_start (ap, fmt);
if (vasprintf (&buffer, fmt, ap) < 0)
error (EXIT_FAILURE, 0, _("memory exhausted"));
va_end (ap);
/* VARARGS2 */
void
-po_gram_error_at_line VA_PARAMS ((const lex_pos_ty *pp, const char *fmt, ...),
- (pp, fmt, va_alist)
- const lex_pos_ty *pp;
- const char *fmt;
- va_dcl)
+po_gram_error_at_line (const lex_pos_ty *pp, const char *fmt, ...)
{
va_list ap;
char *buffer;
- VA_START (ap, fmt);
+ va_start (ap, fmt);
if (vasprintf (&buffer, fmt, ap) < 0)
error (EXIT_FAILURE, 0, _("memory exhausted"));
va_end (ap);
therefore we use an array type. */
typedef struct mbchar mbchar_t[1];
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static inline void memcpy_small PARAMS ((void *dst, const void *src, size_t n));
-static inline bool mb_iseof PARAMS ((const mbchar_t mbc));
-static inline const char *mb_ptr PARAMS ((const mbchar_t mbc));
-static inline size_t mb_len PARAMS ((const mbchar_t mbc));
-static inline bool mb_iseq PARAMS ((const mbchar_t mbc,
- /*promote: char*/ int sc));
-static inline bool mb_isnul PARAMS ((const mbchar_t mbc));
-static inline int mb_cmp PARAMS ((const mbchar_t mbc1, const mbchar_t mbc2));
-static inline bool mb_equal PARAMS ((const mbchar_t mbc1, const mbchar_t mbc2));
-static inline bool mb_isascii PARAMS ((const mbchar_t mbc));
-static int mb_width PARAMS ((const mbchar_t mbc));
-static inline void mb_putc PARAMS ((const mbchar_t mbc, FILE *stream));
-static inline void mb_setascii PARAMS ((mbchar_t mbc,
- /*promote: char*/ int sc));
-static inline void mb_copy PARAMS ((mbchar_t new, const mbchar_t old));
-
/* A version of memcpy optimized for the case n <= 1. */
static inline void
-memcpy_small (dst, src, n)
- void *dst;
- const void *src;
- size_t n;
+memcpy_small (void *dst, const void *src, size_t n)
{
if (n > 0)
{
/* EOF (not a real character) is represented with bytes = 0 and
uc_valid = false. */
static inline bool
-mb_iseof (mbc)
- const mbchar_t mbc;
+mb_iseof (const mbchar_t mbc)
{
return (mbc->bytes == 0);
}
/* Access the current character. */
static inline const char *
-mb_ptr (mbc)
- const mbchar_t mbc;
+mb_ptr (const mbchar_t mbc)
{
return mbc->buf;
}
static inline size_t
-mb_len (mbc)
- const mbchar_t mbc;
+mb_len (const mbchar_t mbc)
{
return mbc->bytes;
}
/* Comparison of characters. */
static inline bool
-mb_iseq (mbc, sc)
- const mbchar_t mbc;
- char sc;
+mb_iseq (const mbchar_t mbc, char sc)
{
/* Note: It is wrong to compare only mbc->uc, because when the encoding is
SHIFT_JIS, mbc->buf[0] == '\\' corresponds to mbc->uc == 0x00A5, but we
}
static inline bool
-mb_isnul (mbc)
- const mbchar_t mbc;
+mb_isnul (const mbchar_t mbc)
{
#if HAVE_ICONV
if (mbc->uc_valid)
}
static inline int
-mb_cmp (mbc1, mbc2)
- const mbchar_t mbc1;
- const mbchar_t mbc2;
+mb_cmp (const mbchar_t mbc1, const mbchar_t mbc2)
{
#if HAVE_ICONV
if (mbc1->uc_valid && mbc2->uc_valid)
}
static inline bool
-mb_equal (mbc1, mbc2)
- const mbchar_t mbc1;
- const mbchar_t mbc2;
+mb_equal (const mbchar_t mbc1, const mbchar_t mbc2)
{
#if HAVE_ICONV
if (mbc1->uc_valid && mbc2->uc_valid)
/* <ctype.h>, <wctype.h> classification. */
static inline bool
-mb_isascii (mbc)
- const mbchar_t mbc;
+mb_isascii (const mbchar_t mbc)
{
#if HAVE_ICONV
if (mbc->uc_valid)
#define MB_UNPRINTABLE_WIDTH 1
static int
-mb_width (mbc)
- const mbchar_t mbc;
+mb_width (const mbchar_t mbc)
{
#if HAVE_ICONV
if (mbc->uc_valid)
/* Output. */
static inline void
-mb_putc (mbc, stream)
- const mbchar_t mbc;
- FILE *stream;
+mb_putc (const mbchar_t mbc, FILE *stream)
{
fwrite (mbc->buf, 1, mbc->bytes, stream);
}
/* Assignment. */
static inline void
-mb_setascii (mbc, sc)
- mbchar_t mbc;
- char sc;
+mb_setascii (mbchar_t mbc, char sc)
{
mbc->bytes = 1;
#if HAVE_ICONV
/* Copying a character. */
static inline void
-mb_copy (new, old)
- mbchar_t new;
- const mbchar_t old;
+mb_copy (mbchar_t new, const mbchar_t old)
{
memcpy_small (&new->buf[0], &old->buf[0], old->bytes);
new->bytes = old->bytes;
or silently tolerated. */
static bool signal_eilseq;
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static inline void mbfile_init PARAMS ((mbfile_t mbf, FILE *stream));
-static void mbfile_getc PARAMS ((mbchar_t mbc, mbfile_t mbf));
-static void mbfile_ungetc PARAMS ((const mbchar_t mbc, mbfile_t mbf));
-
static inline void
-mbfile_init (mbf, stream)
- mbfile_t mbf;
- FILE *stream;
+mbfile_init (mbfile_t mbf, FILE *stream)
{
mbf->fp = stream;
mbf->eof_seen = false;
}
static void
-mbfile_getc (mbc, mbf)
- mbchar_t mbc;
- mbfile_t mbf;
+mbfile_getc (mbchar_t mbc, mbfile_t mbf)
{
size_t bytes;
}
static void
-mbfile_ungetc (mbc, mbf)
- const mbchar_t mbc;
- mbfile_t mbf;
+mbfile_ungetc (const mbchar_t mbc, mbfile_t mbf)
{
if (mbf->have_pushback >= NPUSHBACK)
abort ();
bool pass_obsolete_entries = false;
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void lex_getc PARAMS ((mbchar_t mbc));
-static void lex_ungetc PARAMS ((const mbchar_t mbc));
-static int keyword_p PARAMS ((const char *s));
-static int control_sequence PARAMS ((void));
-
-
/* Prepare lexical analysis. */
void
-lex_start (fp, real_filename, logical_filename)
- FILE *fp;
- const char *real_filename;
- const char *logical_filename;
+lex_start (FILE *fp, const char *real_filename, const char *logical_filename)
{
/* Ignore the logical_filename, because PO file entries already have
their file names attached. But use real_filename for error messages. */
/* Open the PO file FNAME and prepare its lexical analysis. */
void
-lex_open (fname)
- const char *fname;
+lex_open (const char *fname)
{
char *real_filename;
FILE *fp = open_po_file (fname, &real_filename);
/* Read a single character, dealing with backslash-newline.
Also keep track of the current line number and column number. */
static void
-lex_getc (mbc)
- mbchar_t mbc;
+lex_getc (mbchar_t mbc)
{
for (;;)
{
static void
-lex_ungetc (mbc)
- const mbchar_t mbc;
+lex_ungetc (const mbchar_t mbc)
{
if (!mb_iseof (mbc))
{
static int
-keyword_p (s)
- const char *s;
+keyword_p (const char *s)
{
if (!strcmp (s, "domain"))
return DOMAIN;
return '\v';
case 'a':
- return ALERT_CHAR;
+ return '\a';
case '\\':
case '"':
/* po_gram_lex() can return comments as COMMENT. Switch this on or off. */
void
-po_lex_pass_comments (flag)
- bool flag;
+po_lex_pass_comments (bool flag)
{
pass_comments = flag;
}
/* po_gram_lex() can return obsolete entries as if they were normal entries.
Switch this on or off. */
void
-po_lex_pass_obsolete_entries (flag)
- bool flag;
+po_lex_pass_obsolete_entries (bool flag)
{
pass_obsolete_entries = flag;
}
/* Prepare lexical analysis. */
-extern void lex_start PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename));
+extern void lex_start (FILE *fp, const char *real_filename,
+ const char *logical_filename);
/* Terminate lexical analysis. */
-extern FILE *lex_end PARAMS ((void));
+extern FILE *lex_end (void);
/* Open the PO file FNAME and prepare its lexical analysis. */
-extern void lex_open PARAMS ((const char *fname));
+extern void lex_open (const char *fname);
/* Terminate lexical analysis and close the current PO file. */
-extern void lex_close PARAMS ((void));
+extern void lex_close (void);
/* Return the next token in the PO file. The return codes are defined
in "po-gram-gen2.h". Associated data is put in 'po_gram_lval. */
-extern int po_gram_lex PARAMS ((void));
+extern int po_gram_lex (void);
/* po_gram_lex() can return comments as COMMENT. Switch this on or off. */
-extern void po_lex_pass_comments PARAMS ((bool flag));
+extern void po_lex_pass_comments (bool flag);
/* po_gram_lex() can return obsolete entries as if they were normal entries.
Switch this on or off. */
-extern void po_lex_pass_obsolete_entries PARAMS ((bool flag));
+extern void po_lex_pass_obsolete_entries (bool flag);
/* ISO C 99 is smart enough to allow optimizations like this. */
} while (0)
#else
-extern void po_gram_error PARAMS ((const char *fmt, ...));
-extern void po_gram_error_at_line PARAMS ((const lex_pos_ty *pos,
- const char *fmt, ...));
+extern void po_gram_error (const char *fmt, ...);
+extern void po_gram_error_at_line (const lex_pos_ty *pos, const char *fmt, ...);
#endif
/* PO/POT file timestamps.
- Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, April 1995.
This program is free software; you can redistribute it and/or modify
#include "xerror.h"
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static long difftm PARAMS ((const struct tm *a, const struct tm *b));
-
-
#define TM_YEAR_ORIGIN 1900
/* Yield A - B, measured in seconds. */
static long
-difftm (a, b)
- const struct tm *a;
- const struct tm *b;
+difftm (const struct tm *a, const struct tm *b)
{
int ay = a->tm_year + TM_YEAR_ORIGIN - 1;
int by = b->tm_year + TM_YEAR_ORIGIN - 1;
char *
-po_strftime (tp)
- const time_t *tp;
+po_strftime (const time_t *tp)
{
struct tm local_time;
char tz_sign;
/* PO/POT file timestamps.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
/* Return a freshly allocated string containing the given time in the
format YYYY-MM-DD HH:MM+TZOFF. */
-extern char *po_strftime PARAMS ((const time_t *tp));
+extern char *po_strftime (const time_t *tp);
#endif /* _PO_TIME_H */
/* GNU gettext - internationalization aids
- Copyright (C) 1995-1996, 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 1998, 2000-2002 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
#include <string.h>
#include "po-charset.h"
+#include "po-gram.h"
#include "po-hash.h"
#include "xmalloc.h"
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void po_parse_brief PARAMS ((po_ty *pop));
-static void po_parse_debrief PARAMS ((po_ty *pop));
-
-/* Methods used indirectly by po_scan. */
-static void po_directive_domain PARAMS ((po_ty *pop, char *name));
-static void po_directive_message PARAMS ((po_ty *pop, char *msgid,
- lex_pos_ty *msgid_pos,
- char *msgid_plural,
- char *msgstr, size_t msgstr_len,
- lex_pos_ty *msgstr_pos,
- bool obsolete));
-static void po_comment PARAMS ((po_ty *pop, const char *s));
-static void po_comment_dot PARAMS ((po_ty *pop, const char *s));
-static void po_comment_filepos PARAMS ((po_ty *pop, const char *name,
- size_t line));
-static void po_comment_special PARAMS ((po_ty *pop, const char *s));
-
/* Local variables. */
static po_ty *callback_arg;
po_ty *
-po_alloc (pomp)
- po_method_ty *pomp;
+po_alloc (po_method_ty *pomp)
{
po_ty *pop;
void
-po_free (pop)
- po_ty *pop;
+po_free (po_ty *pop)
{
if (pop->method->destructor)
pop->method->destructor (pop);
}
-void
-po_scan (pop, fp, real_filename, logical_filename)
- po_ty *pop;
- FILE *fp;
- const char *real_filename;
- const char *logical_filename;
+static void
+po_parse_brief (po_ty *pop)
+{
+ if (pop->method->parse_brief)
+ pop->method->parse_brief (pop);
+}
+
+
+static void
+po_parse_debrief (po_ty *pop)
{
- extern int po_gram_parse PARAMS ((void));
+ if (pop->method->parse_debrief)
+ pop->method->parse_debrief (pop);
+}
+
+void
+po_scan (po_ty *pop, FILE *fp,
+ const char *real_filename, const char *logical_filename)
+{
/* The parse will call the po_callback_... functions (see below)
when the various directive are recognised. The callback_arg
variable is used to tell these functions which instance is to
void
-po_scan_file (pop, filename)
- po_ty *pop;
- const char *filename;
+po_scan_file (po_ty *pop, const char *filename)
{
- extern int po_gram_parse PARAMS ((void));
-
/* The parse will call the po_callback_... functions (see below)
when the various directive are recognised. The callback_arg
variable is used to tell these functions which instance is to
static void
-po_parse_brief (pop)
- po_ty *pop;
-{
- if (pop->method->parse_brief)
- pop->method->parse_brief (pop);
-}
-
-
-static void
-po_parse_debrief (pop)
- po_ty *pop;
-{
- if (pop->method->parse_debrief)
- pop->method->parse_debrief (pop);
-}
-
-
-static void
-po_directive_domain (pop, name)
- po_ty *pop;
- char *name;
+po_directive_domain (po_ty *pop, char *name)
{
if (pop->method->directive_domain)
pop->method->directive_domain (pop, name);
void
-po_callback_domain (name)
- char *name;
+po_callback_domain (char *name)
{
/* assert(callback_arg); */
po_directive_domain (callback_arg, name);
static void
-po_directive_message (pop, msgid, msgid_pos, msgid_plural,
- msgstr, msgstr_len, msgstr_pos, obsolete)
- po_ty *pop;
- char *msgid;
- lex_pos_ty *msgid_pos;
- char *msgid_plural;
- char *msgstr;
- size_t msgstr_len;
- lex_pos_ty *msgstr_pos;
- bool obsolete;
+po_directive_message (po_ty *pop,
+ char *msgid,
+ lex_pos_ty *msgid_pos,
+ char *msgid_plural,
+ char *msgstr, size_t msgstr_len,
+ lex_pos_ty *msgstr_pos,
+ bool obsolete)
{
if (pop->method->directive_message)
pop->method->directive_message (pop, msgid, msgid_pos, msgid_plural,
void
-po_callback_message (msgid, msgid_pos, msgid_plural,
- msgstr, msgstr_len, msgstr_pos,
- obsolete)
- char *msgid;
- lex_pos_ty *msgid_pos;
- char *msgid_plural;
- char *msgstr;
- size_t msgstr_len;
- lex_pos_ty *msgstr_pos;
- bool obsolete;
+po_callback_message (char *msgid, lex_pos_ty *msgid_pos, char *msgid_plural,
+ char *msgstr, size_t msgstr_len, lex_pos_ty *msgstr_pos,
+ bool obsolete)
{
/* assert(callback_arg); */
static void
-po_comment_special (pop, s)
- po_ty *pop;
- const char *s;
+po_comment_special (po_ty *pop, const char *s)
{
if (pop->method->comment_special != NULL)
pop->method->comment_special (pop, s);
static void
-po_comment (pop, s)
- po_ty *pop;
- const char *s;
+po_comment (po_ty *pop, const char *s)
{
if (pop->method->comment != NULL)
pop->method->comment (pop, s);
static void
-po_comment_dot (pop, s)
- po_ty *pop;
- const char *s;
+po_comment_dot (po_ty *pop, const char *s)
{
if (pop->method->comment_dot != NULL)
pop->method->comment_dot (pop, s);
seen. It analyzes the comment to see what sort it is, and then
dispatces it to the appropriate method. */
void
-po_callback_comment (s)
- const char *s;
+po_callback_comment (const char *s)
{
/* assert(callback_arg); */
if (*s == '.')
static void
-po_comment_filepos (pop, name, line)
- po_ty *pop;
- const char *name;
- size_t line;
+po_comment_filepos (po_ty *pop, const char *name, size_t line)
{
if (pop->method->comment_filepos)
pop->method->comment_filepos (pop, name, line);
void
-po_callback_comment_filepos (name, line)
- const char *name;
- size_t line;
+po_callback_comment_filepos (const char *name, size_t line)
{
/* assert(callback_arg); */
po_comment_filepos (callback_arg, name, line);
/* Parse a special comment and put the result in *fuzzyp, formatp, *wrapp. */
void
-po_parse_comment_special (s, fuzzyp, formatp, wrapp)
- const char *s;
- bool *fuzzyp;
- enum is_format formatp[NFORMATS];
- enum is_wrap *wrapp;
+po_parse_comment_special (const char *s,
+ bool *fuzzyp, enum is_format formatp[NFORMATS],
+ enum is_wrap *wrapp)
{
size_t i;
/* GNU gettext - internationalization aids
- Copyright (C) 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 1998, 2000-2002 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
size_t size;
/* what to do immediately after the instance is malloc()ed */
- void (*constructor) PARAMS ((struct po_ty *pop));
+ void (*constructor) (struct po_ty *pop);
/* what to do immediately before the instance is free()ed */
- void (*destructor) PARAMS ((struct po_ty *pop));
+ void (*destructor) (struct po_ty *pop);
/* what to do with a domain directive */
- void (*directive_domain) PARAMS ((struct po_ty *pop, char *name));
+ void (*directive_domain) (struct po_ty *pop, char *name);
/* what to do with a message directive */
- void (*directive_message) PARAMS ((struct po_ty *pop,
- char *msgid, lex_pos_ty *msgid_pos,
- char *msgid_plural,
- char *msgstr, size_t msgstr_len,
- lex_pos_ty *msgstr_pos,
- bool obsolete));
+ void (*directive_message) (struct po_ty *pop,
+ char *msgid, lex_pos_ty *msgid_pos,
+ char *msgid_plural,
+ char *msgstr, size_t msgstr_len,
+ lex_pos_ty *msgstr_pos,
+ bool obsolete);
/* This method is invoked before the parse, but after the file is
opened by the lexer. */
- void (*parse_brief) PARAMS ((struct po_ty *pop));
+ void (*parse_brief) (struct po_ty *pop);
/* This method is invoked after the parse, but before the file is
closed by the lexer. The intention is to make consistency checks
against the file here, and emit the errors through the lex_error*
functions. */
- void (*parse_debrief) PARAMS ((struct po_ty *pop));
+ void (*parse_debrief) (struct po_ty *pop);
/* What to do with a plain-vanilla comment - the expectation is that
they will be accumulated, and added to the next message
definition seen. Or completely ignored. */
- void (*comment) PARAMS ((struct po_ty *pop, const char *s));
+ void (*comment) (struct po_ty *pop, const char *s);
/* What to do with a comment that starts with a dot (i.e. extracted
by xgettext) - the expectation is that they will be accumulated,
and added to the next message definition seen. Or completely
ignored. */
- void (*comment_dot) PARAMS ((struct po_ty *pop, const char *s));
+ void (*comment_dot) (struct po_ty *pop, const char *s);
/* What to do with a file position seen in a comment (i.e. a message
location comment extracted by xgettext) - the expectation is that
they will be accumulated, and added to the next message
definition seen. Or completely ignored. */
- void (*comment_filepos) PARAMS ((struct po_ty *pop, const char *s,
- size_t line));
+ void (*comment_filepos) (struct po_ty *pop, const char *s, size_t line);
/* What to do with a comment that starts with a `!' - this is a
special comment. One of the possible uses is to indicate a
inexact translation. */
- void (*comment_special) PARAMS ((struct po_ty *pop, const char *s));
+ void (*comment_special) (struct po_ty *pop, const char *s);
};
/* Allocate a fresh po_ty (or derived class) instance and call its
constructor. */
-extern po_ty *po_alloc PARAMS ((po_method_ty *jtable));
+extern po_ty *po_alloc (po_method_ty *jtable);
/* Read a PO file from a stream, and dispatch to the various po_method_ty
methods. */
-extern void po_scan PARAMS ((po_ty *pop, FILE *fp, const char *real_filename,
- const char *logical_filename));
+extern void po_scan (po_ty *pop, FILE *fp, const char *real_filename,
+ const char *logical_filename);
/* Locate a PO file, open it, read it, dispatching to the various po_method_ty
methods, and close it. */
-extern void po_scan_file PARAMS ((po_ty *pop, const char *filename));
+extern void po_scan_file (po_ty *pop, const char *filename);
/* Call the destructor and deallocate a po_ty (or derived class)
instance. */
-extern void po_free PARAMS ((po_ty *pop));
+extern void po_free (po_ty *pop);
/* Callbacks used by po-gram.y or po-hash.y or po-lex.c, indirectly
from po_scan. */
-extern void po_callback_domain PARAMS ((char *name));
-extern void po_callback_message PARAMS ((char *msgid, lex_pos_ty *msgid_pos,
- char *msgid_plural,
- char *msgstr, size_t msgstr_len,
- lex_pos_ty *msgstr_pos,
- bool obsolete));
-extern void po_callback_comment PARAMS ((const char *s));
-extern void po_callback_comment_dot PARAMS ((const char *s));
-extern void po_callback_comment_filepos PARAMS ((const char *s, size_t line));
+extern void po_callback_domain (char *name);
+extern void po_callback_message (char *msgid, lex_pos_ty *msgid_pos,
+ char *msgid_plural,
+ char *msgstr, size_t msgstr_len,
+ lex_pos_ty *msgstr_pos,
+ bool obsolete);
+extern void po_callback_comment (const char *s);
+extern void po_callback_comment_dot (const char *s);
+extern void po_callback_comment_filepos (const char *s, size_t line);
/* Parse a special comment and put the result in *fuzzyp, formatp, *wrapp. */
-extern void po_parse_comment_special PARAMS ((const char *s, bool *fuzzyp,
- enum is_format formatp[NFORMATS],
- enum is_wrap *wrapp));
+extern void po_parse_comment_special (const char *s, bool *fuzzyp,
+ enum is_format formatp[NFORMATS],
+ enum is_wrap *wrapp);
#endif /* _PO_H */
#define _(str) gettext (str)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static bool execute_and_read_po_output PARAMS ((const char *progname,
- const char *prog_path,
- char **prog_argv,
- void *private_data));
-
-
/* A Java resource name can only be manipulated by a Java virtual machine.
So we start a JVM to execute the DumpResource program, and read its
output, which is .po format without comments. */
};
static bool
-execute_and_read_po_output (progname, prog_path, prog_argv, private_data)
- const char *progname;
- const char *prog_path;
- char **prog_argv;
- void *private_data;
+execute_and_read_po_output (const char *progname,
+ const char *prog_path, char **prog_argv,
+ void *private_data)
{
struct locals *l = (struct locals *) private_data;
pid_t child;
msgdomain_list_ty *
-msgdomain_read_java (resource_name, locale_name)
- const char *resource_name;
- const char *locale_name;
+msgdomain_read_java (const char *resource_name, const char *locale_name)
{
const char *class_name = "gnu.gettext.DumpResource";
const char *gettextjexedir;
/* Reading Java ResourceBundles.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
/* Read the Java resource given by resource_name and locale_name.
Returns a list of messages. */
extern msgdomain_list_ty *
- msgdomain_read_java PARAMS ((const char *resource_name,
- const char *locale_name));
+ msgdomain_read_java (const char *resource_name,
+ const char *locale_name);
#endif /* _READ_JAVA_H */
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void read_binary_mo_file PARAMS ((struct binary_mo_file *bfp,
- FILE *fp, const char *filename));
-static nls_uint32 get_uint32 PARAMS ((const struct binary_mo_file *bfp,
- size_t offset));
-static char * get_string PARAMS ((const struct binary_mo_file *bfp,
- size_t offset, size_t *lengthp));
-static char * get_sysdep_string PARAMS ((const struct binary_mo_file *bfp,
- size_t offset,
- const struct mo_file_header *header,
- size_t *lengthp));
-
-
/* Read the contents of the given input stream. */
static void
-read_binary_mo_file (bfp, fp, filename)
- struct binary_mo_file *bfp;
- FILE *fp;
- const char *filename;
+read_binary_mo_file (struct binary_mo_file *bfp,
+ FILE *fp, const char *filename)
{
char *buf = NULL;
size_t alloc = 0;
/* Get a 32-bit number from the file, at the given file position. */
static nls_uint32
-get_uint32 (bfp, offset)
- const struct binary_mo_file *bfp;
- size_t offset;
+get_uint32 (const struct binary_mo_file *bfp, size_t offset)
{
nls_uint32 b0, b1, b2, b3;
/* Get a static string from the file, at the given file position. */
static char *
-get_string (bfp, offset, lengthp)
- const struct binary_mo_file *bfp;
- size_t offset;
- size_t *lengthp;
+get_string (const struct binary_mo_file *bfp, size_t offset, size_t *lengthp)
{
/* See 'struct string_desc'. */
nls_uint32 s_length = get_uint32 (bfp, offset);
/* Get a system dependent string from the file, at the given file position. */
static char *
-get_sysdep_string (bfp, offset, header, lengthp)
- const struct binary_mo_file *bfp;
- size_t offset;
- const struct mo_file_header *header;
- size_t *lengthp;
+get_sysdep_string (const struct binary_mo_file *bfp, size_t offset,
+ const struct mo_file_header *header, size_t *lengthp)
{
/* See 'struct sysdep_string'. */
size_t length;
/* Reads an existing .mo file and adds the messages to mlp. */
void
-read_mo_file (mlp, fn)
- message_list_ty *mlp;
- const char *fn;
+read_mo_file (message_list_ty *mlp, const char *fn)
{
FILE *fp;
struct binary_mo_file bf;
/* Reading binary .mo files.
- Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, April 1995.
This program is free software; you can redistribute it and/or modify
#include "message.h"
/* Reads an existing .mo file and adds the messages to mlp. */
-extern void read_mo_file PARAMS ((message_list_ty *mlp, const char *fn));
+extern void read_mo_file (message_list_ty *mlp, const char *fn);
#endif /* _READ_MO_H */
/* Reading PO files.
- Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
This program is free software; you can redistribute it and/or modify
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void readall_constructor PARAMS ((po_ty *that));
-static void readall_destructor PARAMS ((po_ty *that));
-static void readall_directive_domain PARAMS ((po_ty *that, char *name));
-static void readall_directive_message PARAMS ((po_ty *that, char *msgid,
- lex_pos_ty *msgid_pos,
- char *msgid_plural,
- char *msgstr, size_t msgstr_len,
- lex_pos_ty *msgstr_pos,
- bool obsolete));
-static void readall_parse_brief PARAMS ((po_ty *that));
-static void readall_comment PARAMS ((po_ty *that, const char *s));
-static void readall_comment_dot PARAMS ((po_ty *that, const char *s));
-static void readall_comment_special PARAMS ((po_ty *that, const char *s));
-static void readall_comment_filepos PARAMS ((po_ty *that, const char *name,
- size_t line));
-
-
/* Prepare for first message. */
static void
-readall_constructor (that)
- po_ty *that;
+readall_constructor (po_ty *that)
{
readall_class_ty *this = (readall_class_ty *) that;
size_t i;
static void
-readall_destructor (that)
- po_ty *that;
+readall_destructor (po_ty *that)
{
readall_class_ty *this = (readall_class_ty *) that;
size_t j;
/* Process 'domain' directive from .po file. */
static void
-readall_directive_domain (that, name)
- po_ty *that;
- char *name;
+readall_directive_domain (po_ty *that, char *name)
{
size_t j;
/* Process 'msgid'/'msgstr' pair from .po file. */
static void
-readall_directive_message (that, msgid, msgid_pos, msgid_plural,
- msgstr, msgstr_len, msgstr_pos, obsolete)
- po_ty *that;
- char *msgid;
- lex_pos_ty *msgid_pos;
- char *msgid_plural;
- char *msgstr;
- size_t msgstr_len;
- lex_pos_ty *msgstr_pos;
- bool obsolete;
+readall_directive_message (po_ty *that,
+ char *msgid,
+ lex_pos_ty *msgid_pos,
+ char *msgid_plural,
+ char *msgstr, size_t msgstr_len,
+ lex_pos_ty *msgstr_pos,
+ bool obsolete)
{
readall_class_ty *this = (readall_class_ty *) that;
message_ty *mp;
static void
-readall_parse_brief (that)
- po_ty *that;
+readall_parse_brief (po_ty *that)
{
po_lex_pass_comments (true);
}
static void
-readall_comment (that, s)
- po_ty *that;
- const char *s;
+readall_comment (po_ty *that, const char *s)
{
readall_class_ty *this = (readall_class_ty *) that;
static void
-readall_comment_dot (that, s)
- po_ty *that;
- const char *s;
+readall_comment_dot (po_ty *that, const char *s)
{
readall_class_ty *this = (readall_class_ty *) that;
/* Test for '#, fuzzy' comments and warn. */
static void
-readall_comment_special (that, s)
- po_ty *that;
- const char *s;
+readall_comment_special (po_ty *that, const char *s)
{
readall_class_ty *this = (readall_class_ty *) that;
static void
-readall_comment_filepos (that, name, line)
- po_ty *that;
- const char *name;
- size_t line;
+readall_comment_filepos (po_ty *that, const char *name, size_t line)
{
readall_class_ty *this = (readall_class_ty *) that;
size_t nbytes;
msgdomain_list_ty *
-read_po (fp, real_filename, logical_filename)
- FILE *fp;
- const char *real_filename;
- const char *logical_filename;
+read_po (FILE *fp, const char *real_filename, const char *logical_filename)
{
po_ty *pop;
msgdomain_list_ty *mdlp;
msgdomain_list_ty *
-read_po_file (filename)
- const char *filename;
+read_po_file (const char *filename)
{
po_ty *pop;
msgdomain_list_ty *mdlp;
/* Reading PO files.
- Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
This file was written by Bruno Haible <haible@clisp.cons.org>.
This program is free software; you can redistribute it and/or modify
extern bool allow_duplicates;
/* Read the input file from a stream. Returns a list of messages. */
-extern msgdomain_list_ty *read_po PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename));
+extern msgdomain_list_ty *read_po (FILE *fp, const char *real_filename,
+ const char *logical_filename);
/* Read the input file with the name INPUT_NAME. The ending .po is added
if necessary. If INPUT_NAME is not an absolute file name and the file is
not found, the list of directories in "dir-list.h" is searched. Returns
a list of messages. */
-extern msgdomain_list_ty *read_po_file PARAMS ((const char *input_name));
+extern msgdomain_list_ty *read_po_file (const char *input_name);
#endif /* _READ_PO_H */
the msgid/msgstr pair to us, instead of storing it in the hash table. */
msgdomain_list_ty *
-msgdomain_read_tcl (locale_name, directory)
- const char *locale_name;
- const char *directory;
+msgdomain_read_tcl (const char *locale_name, const char *directory)
{
const char *gettextdatadir;
char *tclscript;
/* Read the Tcl msg file given by locale_name and directory.
Returns a list of messages. */
extern msgdomain_list_ty *
- msgdomain_read_tcl PARAMS ((const char *locale_name,
- const char *directory));
+ msgdomain_read_tcl (const char *locale_name, const char *directory);
#endif /* _READ_TCL_H */
/* GNU gettext - internationalization aids
- Copyright (C) 1995, 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1998, 2000-2002 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
/* Initialize an empty list of strings. */
void
-string_list_init (slp)
- string_list_ty *slp;
+string_list_init (string_list_ty *slp)
{
slp->item = NULL;
slp->nitems = 0;
/* Append a single string to the end of a list of strings. */
void
-string_list_append (slp, s)
- string_list_ty *slp;
- const char *s;
+string_list_append (string_list_ty *slp, const char *s)
{
/* Grow the list. */
if (slp->nitems >= slp->nitems_max)
/* Append a single string to the end of a list of strings, unless it is
already contained in the list. */
void
-string_list_append_unique (slp, s)
- string_list_ty *slp;
- const char *s;
+string_list_append_unique (string_list_ty *slp, const char *s)
{
size_t j;
/* Destroy a list of strings. */
void
-string_list_destroy (slp)
- string_list_ty *slp;
+string_list_destroy (string_list_ty *slp)
{
size_t j;
/* Free a list of strings. */
void
-string_list_free (slp)
- string_list_ty *slp;
+string_list_free (string_list_ty *slp)
{
size_t j;
/* Return a freshly allocated string obtained by concatenating all the
strings in the list. */
char *
-string_list_concat (slp)
- const string_list_ty *slp;
+string_list_concat (const string_list_ty *slp)
{
size_t len;
size_t j;
/* Return a freshly allocated string obtained by concatenating all the
strings in the list, and destroy the list. */
char *
-string_list_concat_destroy (slp)
- string_list_ty *slp;
+string_list_concat_destroy (string_list_ty *slp)
{
char *result;
/* Return a freshly allocated string obtained by concatenating all the
strings in the list, separated by spaces. */
char *
-string_list_join (slp)
- const string_list_ty *slp;
+string_list_join (const string_list_ty *slp)
{
size_t len;
size_t j;
/* Return 1 if s is contained in the list of strings, 0 otherwise. */
bool
-string_list_member (slp, s)
- const string_list_ty *slp;
- const char *s;
+string_list_member (const string_list_ty *slp, const char *s)
{
size_t j;
/* GNU gettext - internationalization aids
- Copyright (C) 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 1998, 2000-2002 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
};
/* Initialize an empty list of strings. */
-extern void string_list_init PARAMS ((string_list_ty *slp));
+extern void string_list_init (string_list_ty *slp);
/* Return a fresh, empty list of strings. */
-extern string_list_ty *string_list_alloc PARAMS ((void));
+extern string_list_ty *string_list_alloc (void);
/* Append a single string to the end of a list of strings. */
-extern void string_list_append PARAMS ((string_list_ty *slp, const char *s));
+extern void string_list_append (string_list_ty *slp, const char *s);
/* Append a single string to the end of a list of strings, unless it is
already contained in the list. */
-extern void string_list_append_unique PARAMS ((string_list_ty *slp,
- const char *s));
+extern void string_list_append_unique (string_list_ty *slp, const char *s);
/* Destroy a list of strings. */
-extern void string_list_destroy PARAMS ((string_list_ty *slp));
+extern void string_list_destroy (string_list_ty *slp);
/* Free a list of strings. */
-extern void string_list_free PARAMS ((string_list_ty *slp));
+extern void string_list_free (string_list_ty *slp);
/* Return a freshly allocated string obtained by concatenating all the
strings in the list. */
-extern char *string_list_concat PARAMS ((const string_list_ty *slp));
+extern char *string_list_concat (const string_list_ty *slp);
/* Return a freshly allocated string obtained by concatenating all the
strings in the list, and destroy the list. */
-extern char *string_list_concat_destroy PARAMS ((string_list_ty *slp));
+extern char *string_list_concat_destroy (string_list_ty *slp);
/* Return a freshly allocated string obtained by concatenating all the
strings in the list, separated by spaces. */
-extern char *string_list_join PARAMS ((const string_list_ty *slp));
+extern char *string_list_join (const string_list_ty *slp);
/* Return 1 if s is contained in the list of strings, 0 otherwise. */
-extern bool string_list_member PARAMS ((const string_list_ty *slp,
- const char *s));
+extern bool string_list_member (const string_list_ty *slp, const char *s);
#endif /* _STR_LIST_H */
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status))
+/* Forward declaration of local functions. */
+static void usage (int status)
#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
__attribute__ ((noreturn))
#endif
;
-static void cat_file PARAMS ((const char *src_filename));
-static bool execute_it PARAMS ((const char *progname,
- const char *prog_path, char **prog_argv,
- void *private_data));
-static void fetch PARAMS ((const char *url, const char *file));
+static void fetch (const char *url, const char *file);
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
int optchar;
bool do_help;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
/* Copy a file's contents to stdout. */
static void
-cat_file (src_filename)
- const char *src_filename;
+cat_file (const char *src_filename)
{
int src_fd;
char buf[4096];
}
static bool
-execute_it (progname, prog_path, prog_argv, private_data)
- const char *progname;
- const char *prog_path;
- char **prog_argv;
- void *private_data;
+execute_it (const char *progname,
+ const char *prog_path, char **prog_argv,
+ void *private_data)
{
(void) private_data;
/* Fetch the URL. Upon error, use the FILE as fallback. */
static void
-fetch (url, file)
- const char *url;
- const char *file;
+fetch (const char *url, const char *file)
{
/* First try: using Java. */
{
#define _(str) gettext (str)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int check_resource_name PARAMS ((const char *name));
-static unsigned int string_hashcode PARAMS ((const char *str));
-static unsigned int compute_hashsize PARAMS ((message_list_ty *mlp,
- bool *collisionp));
-static int compare_index PARAMS ((const void *pval1, const void *pval2));
-static struct table_item * compute_table_items PARAMS ((message_list_ty *mlp,
- unsigned int hashsize));
-static void write_java_string PARAMS ((FILE *stream, const char *str));
-static void write_java_msgstr PARAMS ((FILE *stream, message_ty *mp));
-static void write_lookup_code PARAMS ((FILE *stream, unsigned int hashsize,
- bool collisions));
-static bool is_expression_boolean PARAMS ((struct expression *exp));
-static void write_java_expression PARAMS ((FILE *stream,
- struct expression *exp,
- bool as_boolean));
-static void write_java_code PARAMS ((FILE *stream, const char *class_name,
- message_list_ty *mlp, bool assume_java2));
-static void uninstall_handlers PARAMS ((void));
-static void cleanup PARAMS ((int sig));
-static void install_handlers PARAMS ((void));
-#if HAVE_POSIX_SIGNALBLOCKING
-static void init_signal_set PARAMS ((void));
-static void block PARAMS ((void));
-static void unblock PARAMS ((void));
-#endif
-
-
/* Check that the resource name is a valid Java class name. To simplify
things, we allow only ASCII characters in the class name.
Return the number of dots in the class name, or -1 if not OK. */
static int
-check_resource_name (name)
- const char *name;
+check_resource_name (const char *name)
{
int ndots = 0;
const char *p = name;
this removes one bit but greatly simplifies the following "mod hash_size"
and "mod (hash_size - 2)" operations. */
static unsigned int
-string_hashcode (str)
- const char *str;
+string_hashcode (const char *str)
{
const char *str_limit = str + strlen (str);
int hash = 0;
/* Compute a good hash table size for the given set of msgids. */
static unsigned int
-compute_hashsize (mlp, collisionp)
- message_list_ty *mlp;
- bool *collisionp;
+compute_hashsize (message_list_ty *mlp, bool *collisionp)
{
/* This is an O(n^2) algorithm, but should be sufficient because few
programs have more than 1000 messages in a single domain. */
struct table_item { unsigned int index; message_ty *mp; };
static int
-compare_index (pval1, pval2)
- const void *pval1;
- const void *pval2;
+compare_index (const void *pval1, const void *pval2)
{
return (int)((const struct table_item *) pval1)->index
- (int)((const struct table_item *) pval2)->index;
/* Compute the list of messages and table indices, sorted according to the
indices. */
static struct table_item *
-compute_table_items (mlp, hashsize)
- message_list_ty *mlp;
- unsigned int hashsize;
+compute_table_items (message_list_ty *mlp, unsigned int hashsize)
{
unsigned int n = mlp->nitems;
struct table_item *arr =
/* Write a string in Java Unicode notation to the given stream. */
static void
-write_java_string (stream, str)
- FILE *stream;
- const char *str;
+write_java_string (FILE *stream, const char *str)
{
static const char hexdigit[] = "0123456789abcdef";
const char *str_limit = str + strlen (str);
has plural forms, it is an expression of type String[], otherwise it is
an expression of type String. */
static void
-write_java_msgstr (stream, mp)
- FILE *stream;
- message_ty *mp;
+write_java_msgstr (FILE *stream, message_ty *mp)
{
if (mp->msgid_plural != NULL)
{
/* Writes the body of the function which returns the local value for a key
named 'msgid'. */
static void
-write_lookup_code (stream, hashsize, collisions)
- FILE *stream;
- unsigned int hashsize;
- bool collisions;
+write_lookup_code (FILE *stream, unsigned int hashsize, bool collisions)
{
fprintf (stream, " int hash_val = msgid.hashCode() & 0x7fffffff;\n");
fprintf (stream, " int idx = (hash_val %% %d) << 1;\n", hashsize);
/* Tests whether a plural expression, evaluated according to the C rules,
can only produce the values 0 and 1. */
static bool
-is_expression_boolean (exp)
- struct expression *exp;
+is_expression_boolean (struct expression *exp)
{
switch (exp->operation)
{
/* Write Java code that evaluates a plural expression according to the C rules.
The variable is called 'n'. */
static void
-write_java_expression (stream, exp, as_boolean)
- FILE *stream;
- struct expression *exp;
- bool as_boolean;
+write_java_expression (FILE *stream, struct expression *exp, bool as_boolean)
{
/* We use parentheses everywhere. This frees us from tracking the priority
of arithmetic operators. */
because applications can have their own classes called X.Y.ResourceBundle
or X.Y.String. */
static void
-write_java_code (stream, class_name, mlp, assume_java2)
- FILE *stream;
- const char *class_name;
- message_list_ty *mlp;
- bool assume_java2;
+write_java_code (FILE *stream, const char *class_name, message_list_ty *mlp,
+ bool assume_java2)
{
const char *last_dot;
unsigned int plurals;
/* The signal handler. It gets called asynchronously. */
static void
-cleanup (sig)
- int sig;
+cleanup (int sig)
{
unsigned int i;
int
-msgdomain_write_java (mlp, resource_name, locale_name, directory, assume_java2)
- message_list_ty *mlp;
- const char *resource_name;
- const char *locale_name;
- const char *directory;
- bool assume_java2;
+msgdomain_write_java (message_list_ty *mlp,
+ const char *resource_name, const char *locale_name,
+ const char *directory,
+ bool assume_java2)
{
int retval;
char *template;
/* Writing Java ResourceBundles.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
separators) or NULL, directory is the base directory.
Return 0 if ok, nonzero on error. */
extern int
- msgdomain_write_java PARAMS ((message_list_ty *mlp,
- const char *resource_name,
- const char *locale_name,
- const char *directory,
- bool assume_java2));
+ msgdomain_write_java (message_list_ty *mlp,
+ const char *resource_name,
+ const char *locale_name,
+ const char *directory,
+ bool assume_java2);
#endif /* _WRITE_JAVA_H */
bool no_hash_table;
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int compare_id PARAMS ((const void *pval1, const void *pval2));
-static void write_table PARAMS ((FILE *output_file, message_list_ty *mlp));
-
-
/* Indices into the strings contained in 'struct pre_message' and
'struct pre_sysdep_message'. */
enum
};
static int
-compare_id (pval1, pval2)
- const void *pval1;
- const void *pval2;
+compare_id (const void *pval1, const void *pval2)
{
return strcmp (((struct pre_message *) pval1)->str[M_ID].pointer,
((struct pre_message *) pval2)->str[M_ID].pointer);
/* Write the message list to the given open file. */
static void
-write_table (output_file, mlp)
- FILE *output_file;
- message_list_ty *mlp;
+write_table (FILE *output_file, message_list_ty *mlp)
{
size_t nstrings;
struct pre_message *msg_arr;
int
-msgdomain_write_mo (mlp, domain_name, file_name)
- message_list_ty *mlp;
- const char *domain_name;
- const char *file_name;
+msgdomain_write_mo (message_list_ty *mlp,
+ const char *domain_name,
+ const char *file_name)
{
FILE *output_file;
/* Writing binary .mo files.
- Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, April 1995.
This program is free software; you can redistribute it and/or modify
domain_name is the domain name, file_name is the desired file name.
Return 0 if ok, nonzero on error. */
extern int
- msgdomain_write_mo PARAMS ((message_list_ty *mlp,
- const char *domain_name,
- const char *file_name));
+ msgdomain_write_mo (message_list_ty *mlp,
+ const char *domain_name,
+ const char *file_name);
#endif /* _WRITE_MO_H */
#endif
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static const char *make_format_description_string PARAMS ((enum is_format,
- const char *lang,
- bool debug));
-static bool significant_format_p PARAMS ((enum is_format is_format));
-static bool has_significant_format_p
- PARAMS ((const enum is_format is_format[NFORMATS]));
-static const char *make_c_width_description_string PARAMS ((enum is_wrap));
-static inline void memcpy_small PARAMS ((void *dst, const void *src, size_t n));
-static void wrap PARAMS ((FILE *fp, const char *line_prefix, const char *name,
- const char *value, enum is_wrap do_wrap,
- const char *charset));
-static void print_blank_line PARAMS ((FILE *fp));
-static void message_print PARAMS ((const message_ty *mp, FILE *fp,
- const char *charset, bool blank_line,
- bool debug));
-static void message_print_obsolete PARAMS ((const message_ty *mp, FILE *fp,
- const char *charset,
- bool blank_line));
-static int cmp_by_msgid PARAMS ((const void *va, const void *vb));
-static int cmp_filepos PARAMS ((const void *va, const void *vb));
-static void msgdomain_list_sort_filepos PARAMS ((msgdomain_list_ty *mdlp));
-static int cmp_by_filepos PARAMS ((const void *va, const void *vb));
-
-
/* This variable controls the page width when printing messages.
Defaults to PAGE_WIDTH if not set. Zero (0) given to message_page_-
width_set will result in no wrapping being performed. */
static size_t page_width = PAGE_WIDTH;
void
-message_page_width_set (n)
- size_t n;
+message_page_width_set (size_t n)
{
if (n == 0)
{
}
void
-message_print_style_escape (flag)
- bool flag;
+message_print_style_escape (bool flag)
{
escape = flag;
}
static const char *
-make_format_description_string (is_format, lang, debug)
- enum is_format is_format;
- const char *lang;
- bool debug;
+make_format_description_string (enum is_format is_format, const char *lang,
+ bool debug)
{
static char result[100];
static bool
-significant_format_p (is_format)
- enum is_format is_format;
+significant_format_p (enum is_format is_format)
{
return is_format != undecided && is_format != impossible;
}
static bool
-has_significant_format_p (is_format)
- const enum is_format is_format[NFORMATS];
+has_significant_format_p (const enum is_format is_format[NFORMATS])
{
size_t i;
static const char *
-make_c_width_description_string (do_wrap)
- enum is_wrap do_wrap;
+make_c_width_description_string (enum is_wrap do_wrap)
{
const char *result = NULL;
/* A version of memcpy optimized for the case n <= 1. */
static inline void
-memcpy_small (dst, src, n)
- void *dst;
- const void *src;
- size_t n;
+memcpy_small (void *dst, const void *src, size_t n)
{
if (n > 0)
{
static void
-wrap (fp, line_prefix, name, value, do_wrap, charset)
- FILE *fp;
- const char *line_prefix;
- const char *name;
- const char *value;
- enum is_wrap do_wrap;
- const char *charset;
+wrap (FILE *fp, const char *line_prefix, const char *name, const char *value,
+ enum is_wrap do_wrap, const char *charset)
{
const char *canon_charset;
const char *s;
static void
-print_blank_line (fp)
- FILE *fp;
+print_blank_line (FILE *fp)
{
if (uniforum)
fputs ("#\n", fp);
}
static void
-message_print (mp, fp, charset, blank_line, debug)
- const message_ty *mp;
- FILE *fp;
- const char *charset;
- bool blank_line;
- bool debug;
+message_print (const message_ty *mp, FILE *fp, const char *charset,
+ bool blank_line, bool debug)
{
size_t j;
static void
-message_print_obsolete (mp, fp, charset, blank_line)
- const message_ty *mp;
- FILE *fp;
- const char *charset;
- bool blank_line;
+message_print_obsolete (const message_ty *mp, FILE *fp, const char *charset,
+ bool blank_line)
{
size_t j;
void
-msgdomain_list_print (mdlp, filename, force, debug)
- msgdomain_list_ty *mdlp;
- const char *filename;
- bool force;
- bool debug;
+msgdomain_list_print (msgdomain_list_ty *mdlp, const char *filename,
+ bool force, bool debug)
{
FILE *fp;
size_t j, k;
static int
-cmp_by_msgid (va, vb)
- const void *va;
- const void *vb;
+cmp_by_msgid (const void *va, const void *vb)
{
const message_ty *a = *(const message_ty **) va;
const message_ty *b = *(const message_ty **) vb;
void
-msgdomain_list_sort_by_msgid (mdlp)
- msgdomain_list_ty *mdlp;
+msgdomain_list_sort_by_msgid (msgdomain_list_ty *mdlp)
{
size_t k;
/* Sort the file positions of every message. */
static int
-cmp_filepos (va, vb)
- const void *va;
- const void *vb;
+cmp_filepos (const void *va, const void *vb)
{
const lex_pos_ty *a = (const lex_pos_ty *) va;
const lex_pos_ty *b = (const lex_pos_ty *) vb;
}
static void
-msgdomain_list_sort_filepos (mdlp)
- msgdomain_list_ty *mdlp;
+msgdomain_list_sort_filepos (msgdomain_list_ty *mdlp)
{
size_t j, k;
/* Sort the messages according to the file position. */
static int
-cmp_by_filepos (va, vb)
- const void *va;
- const void *vb;
+cmp_by_filepos (const void *va, const void *vb)
{
const message_ty *a = *(const message_ty **) va;
const message_ty *b = *(const message_ty **) vb;
void
-msgdomain_list_sort_by_filepos (mdlp)
- msgdomain_list_ty *mdlp;
+msgdomain_list_sort_by_filepos (msgdomain_list_ty *mdlp)
{
size_t k;
#include <stdbool.h>
extern void
- message_page_width_set PARAMS ((size_t width));
+ message_page_width_set (size_t width);
extern void
- message_page_width_ignore PARAMS ((void));
+ message_page_width_ignore (void);
extern void
- message_print_style_indent PARAMS ((void));
+ message_print_style_indent (void);
extern void
- message_print_style_uniforum PARAMS ((void));
+ message_print_style_uniforum (void);
extern void
- message_print_style_escape PARAMS ((bool flag));
+ message_print_style_escape (bool flag);
extern void
- msgdomain_list_print PARAMS ((msgdomain_list_ty *mdlp,
- const char *filename,
- bool force, bool debug));
+ msgdomain_list_print (msgdomain_list_ty *mdlp,
+ const char *filename,
+ bool force, bool debug);
extern void
- msgdomain_list_sort_by_msgid PARAMS ((msgdomain_list_ty *mdlp));
+ msgdomain_list_sort_by_msgid (msgdomain_list_ty *mdlp);
extern void
- msgdomain_list_sort_by_filepos PARAMS ((msgdomain_list_ty *mdlp));
+ msgdomain_list_sort_by_filepos (msgdomain_list_ty *mdlp);
#endif /* _WRITE_PO_H */
#define _(str) gettext (str)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void write_tcl_string PARAMS ((FILE *stream, const char *str));
-static void write_msg PARAMS ((FILE *output_file, message_list_ty *mlp,
- const char *locale_name));
-
-
/* Write a string in Tcl Unicode notation to the given stream.
Tcl 8 uses Unicode for its internal string representation.
In tcl-8.3.3, the .msg files are read in using the locale dependent
form is the \unnnn notation. Newer tcl versions have this fixed:
they read the .msg files in UTF-8 encoding. */
static void
-write_tcl_string (stream, str)
- FILE *stream;
- const char *str;
+write_tcl_string (FILE *stream, const char *str)
{
static const char hexdigit[] = "0123456789abcdef";
const char *str_limit = str + strlen (str);
static void
-write_msg (output_file, mlp, locale_name)
- FILE *output_file;
- message_list_ty *mlp;
- const char *locale_name;
+write_msg (FILE *output_file, message_list_ty *mlp, const char *locale_name)
{
size_t j;
}
int
-msgdomain_write_tcl (mlp, locale_name, directory)
- message_list_ty *mlp;
- const char *locale_name;
- const char *directory;
+msgdomain_write_tcl (message_list_ty *mlp,
+ const char *locale_name,
+ const char *directory)
{
/* If no entry for this domain don't even create the file. */
if (mlp->nitems == 0)
the base directory.
Return 0 if ok, nonzero on error. */
extern int
- msgdomain_write_tcl PARAMS ((message_list_ty *mlp,
- const char *locale_name,
- const char *directory));
+ msgdomain_write_tcl (message_list_ty *mlp,
+ const char *locale_name,
+ const char *directory);
#endif /* _WRITE_TCL_H */
#define _(s) gettext(s)
-#if HAVE_C_BACKSLASH_A
-# define ALERT_CHAR '\a'
-#else
-# define ALERT_CHAR '\7'
-#endif
-
/* The awk syntax is defined in the gawk manual page and documentation.
See also gawk/awkgram.y. */
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void init_keywords PARAMS ((void));
-static int phase1_getc PARAMS ((void));
-static void phase1_ungetc PARAMS ((int c));
-static int phase2_getc PARAMS ((void));
-static void phase2_ungetc PARAMS ((int c));
-static int phase7_getc PARAMS ((void));
-static inline void free_token PARAMS ((token_ty *tp));
-static void x_awk_lex PARAMS ((token_ty *tp));
-static bool extract_parenthesized PARAMS ((message_list_ty *mlp,
- int commas_to_skip,
- int plural_commas));
-
-
/* ====================== Keyword set customization. ====================== */
/* If true extract all strings. */
void
-x_awk_keyword (name)
- const char *name;
+x_awk_keyword (const char *name)
{
if (name == NULL)
default_keywords = false;
}
static void
-phase1_ungetc (c)
- int c;
+phase1_ungetc (int c)
{
if (c != EOF)
{
}
static void
-phase2_ungetc (c)
- int c;
+phase2_ungetc (int c)
{
if (c != EOF)
phase1_ungetc (c);
switch (c)
{
case 'a':
- return ALERT_CHAR;
+ return '\a';
case 'b':
return '\b';
case 'f':
/* Free the memory pointed to by a 'struct token_ty'. */
static inline void
-free_token (tp)
- token_ty *tp;
+free_token (token_ty *tp)
{
switch (tp->type)
{
static bool prefer_division_over_regexp;
static void
-x_awk_lex (tp)
- token_ty *tp;
+x_awk_lex (token_ty *tp)
{
static char *buffer;
static int bufmax;
When no specific argument shall be extracted, COMMAS_TO_SKIP < 0.
Return true upon eof, false upon closing parenthesis. */
static bool
-extract_parenthesized (mlp, commas_to_skip, plural_commas)
- message_list_ty *mlp;
- int commas_to_skip;
- int plural_commas;
+extract_parenthesized (message_list_ty *mlp,
+ int commas_to_skip, int plural_commas)
{
/* Remember the message containing the msgid, for msgid_plural. */
message_ty *plural_mp = NULL;
void
-extract_awk (f, real_filename, logical_filename, mdlp)
- FILE *f;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+extract_awk (FILE *f,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
message_list_ty *mlp = mdlp->item[0]->messages;
{ "awk", extract_awk, &formatstring_awk }, \
/* Scan an awk file and add its translatable strings to mdlp. */
-extern void extract_awk PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+extern void extract_awk (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
-extern void x_awk_keyword PARAMS ((const char *keyword));
-extern void x_awk_extract_all PARAMS ((void));
+extern void x_awk_keyword (const char *keyword);
+extern void x_awk_extract_all (void);
#define _(s) gettext(s)
-#if HAVE_C_BACKSLASH_A
-# define ALERT_CHAR '\a'
-#else
-# define ALERT_CHAR '\7'
-#endif
-
/* The ANSI C standard defines several phases of translation:
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void init_keywords PARAMS ((void));
-static int phase1_getc PARAMS ((void));
-static void phase1_ungetc PARAMS ((int c));
-static int phase2_getc PARAMS ((void));
-static void phase2_ungetc PARAMS ((int c));
-static int phase3_getc PARAMS ((void));
-static void phase3_ungetc PARAMS ((int c));
-static inline void comment_start PARAMS ((void));
-static inline void comment_add PARAMS ((int c));
-static inline void comment_line_end PARAMS ((size_t chars_to_remove));
-static int phase4_getc PARAMS ((void));
-static void phase4_ungetc PARAMS ((int c));
-static int phase7_getc PARAMS ((void));
-static void phase7_ungetc PARAMS ((int c));
-static inline void free_token PARAMS ((token_ty *tp));
-static void phase5_get PARAMS ((token_ty *tp));
-static void phase5_unget PARAMS ((token_ty *tp));
-static void phaseX_get PARAMS ((token_ty *tp));
-static void phase6_get PARAMS ((token_ty *tp));
-static void phase6_unget PARAMS ((token_ty *tp));
-static bool is_inttypes_macro PARAMS ((const char *name));
-static void phase8a_get PARAMS ((token_ty *tp));
-static void phase8a_unget PARAMS ((token_ty *tp));
-static void phase8_get PARAMS ((token_ty *tp));
-static void x_c_lex PARAMS ((xgettext_token_ty *tp));
-static bool extract_parenthesized PARAMS ((message_list_ty *mlp,
- int commas_to_skip,
- int plural_commas));
-
-
/* ========================= Lexer customization. ========================= */
static bool trigraphs = false;
void
-x_c_keyword (name)
- const char *name;
+x_c_keyword (const char *name)
{
if (name == NULL)
default_keywords = false;
static void
-phase1_ungetc (c)
- int c;
+phase1_ungetc (int c)
{
switch (c)
{
static void
-phase2_ungetc (c)
- int c;
+phase2_ungetc (int c)
{
if (c != EOF)
phase2_pushback[phase2_pushback_length++] = c;
static void
-phase3_ungetc (c)
- int c;
+phase3_ungetc (int c)
{
if (c != EOF)
phase3_pushback[phase3_pushback_length++] = c;
}
static inline void
-comment_add (c)
- int c;
+comment_add (int c)
{
if (buflen >= bufmax)
{
}
static inline void
-comment_line_end (chars_to_remove)
- size_t chars_to_remove;
+comment_line_end (size_t chars_to_remove)
{
buflen -= chars_to_remove;
while (buflen >= 1
static void
-phase4_ungetc (c)
- int c;
+phase4_ungetc (int c)
{
phase3_ungetc (c);
}
return c;
case 'a':
- return ALERT_CHAR;
+ return '\a';
case 'b':
return '\b';
static void
-phase7_ungetc (c)
- int c;
+phase7_ungetc (int c)
{
phase3_ungetc (c);
}
/* Free the memory pointed to by a 'struct token_ty'. */
static inline void
-free_token (tp)
- token_ty *tp;
+free_token (token_ty *tp)
{
if (tp->type == token_type_name || tp->type == token_type_string_literal)
free (tp->string);
static void
-phase5_get (tp)
- token_ty *tp;
+phase5_get (token_ty *tp)
{
static char *buffer;
static int bufmax;
static void
-phase5_unget (tp)
- token_ty *tp;
+phase5_unget (token_ty *tp)
{
if (tp->type != token_type_eof)
phase5_pushback[phase5_pushback_length++] = *tp;
makes the phase 6 easier. */
static void
-phaseX_get (tp)
- token_ty *tp;
+phaseX_get (token_ty *tp)
{
static bool middle; /* false at the beginning of a line, true otherwise. */
static void
-phase6_get (tp)
- token_ty *tp;
+phase6_get (token_ty *tp)
{
static token_ty *buf;
static int bufmax;
static void
-phase6_unget (tp)
- token_ty *tp;
+phase6_unget (token_ty *tp)
{
if (tp->type != token_type_eof)
phase6_pushback[phase6_pushback_length++] = *tp;
/* Test for an ISO C 99 section 7.8.1 format string directive. */
static bool
-is_inttypes_macro (name)
- const char *name;
+is_inttypes_macro (const char *name)
{
/* Syntax:
P R I { d | i | o | u | x | X }
}
static void
-phase8a_get (tp)
- token_ty *tp;
+phase8a_get (token_ty *tp)
{
phase6_get (tp);
if (tp->type == token_type_name && is_inttypes_macro (tp->string))
}
static void
-phase8a_unget (tp)
- token_ty *tp;
+phase8a_unget (token_ty *tp)
{
phase6_unget (tp);
}
will miss). */
static void
-phase8_get (tp)
- token_ty *tp;
+phase8_get (token_ty *tp)
{
phase8a_get (tp);
if (tp->type != token_type_string_literal)
discards any white space from the translation unit. */
static void
-x_c_lex (tp)
- xgettext_token_ty *tp;
+x_c_lex (xgettext_token_ty *tp)
{
for (;;)
{
When no specific argument shall be extracted, COMMAS_TO_SKIP < 0.
Return true upon eof, false upon closing parenthesis. */
static bool
-extract_parenthesized (mlp, commas_to_skip, plural_commas)
- message_list_ty *mlp;
- int commas_to_skip;
- int plural_commas;
+extract_parenthesized (message_list_ty *mlp,
+ int commas_to_skip, int plural_commas)
{
/* Remember the message containing the msgid, for msgid_plural. */
message_ty *plural_mp = NULL;
void
-extract_c (f, real_filename, logical_filename, mdlp)
- FILE *f;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+extract_c (FILE *f,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
message_list_ty *mlp = mdlp->item[0]->messages;
/* xgettext C/C++/ObjectiveC backend.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
{ "ObjectiveC", extract_c, &formatstring_c }, \
/* Scan a C/C++/ObjectiveC file and add its translatable strings to mdlp. */
-extern void extract_c PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+extern void extract_c (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
/* Handling of options specific to this language. */
-extern void x_c_extract_all PARAMS ((void));
+extern void x_c_extract_all (void);
-extern void x_c_keyword PARAMS ((const char *name));
-extern bool x_c_any_keywords PARAMS ((void));
+extern void x_c_keyword (const char *name);
+extern bool x_c_any_keywords (void);
-extern void x_c_trigraphs PARAMS ((void));
+extern void x_c_trigraphs (void);
#define _(s) gettext(s)
-#if HAVE_C_BACKSLASH_A
-# define ALERT_CHAR '\a'
-#else
-# define ALERT_CHAR '\7'
-#endif
-
/* Summary of Emacs Lisp syntax:
- ';' starts a comment until end of line.
The reader is implemented in emacs-21.1/src/lread.c. */
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-struct token;
-struct object;
-static void init_keywords PARAMS ((void));
-static int do_getc PARAMS ((void));
-static void do_ungetc PARAMS ((int c));
-static inline void init_token PARAMS ((struct token *tp));
-static inline void free_token PARAMS ((struct token *tp));
-static inline void grow_token PARAMS ((struct token *tp));
-static inline bool is_integer PARAMS ((const char *p));
-static inline bool is_float PARAMS ((const char *p));
-static bool read_token PARAMS ((struct token *tp, int first));
-static inline void comment_start PARAMS ((void));
-static inline void comment_add PARAMS ((int c));
-static inline void comment_line_end PARAMS ((size_t chars_to_remove));
-static inline void free_object PARAMS ((struct object *op));
-static char * string_of_object PARAMS ((const struct object *op));
-static int do_getc_escaped PARAMS ((int c, bool in_string));
-static void read_object PARAMS ((struct object *op,
- bool first_in_list, bool new_backquote_flag));
-
-
/* ====================== Keyword set customization. ====================== */
/* If true extract all strings. */
void
-x_elisp_keyword (name)
- const char *name;
+x_elisp_keyword (const char *name)
{
if (name == NULL)
default_keywords = false;
/* Put back the last fetched character, not EOF. */
static void
-do_ungetc (c)
- int c;
+do_ungetc (int c)
{
if (c == '\n')
line_number--;
/* Initialize a 'struct token'. */
static inline void
-init_token (tp)
- struct token *tp;
+init_token (struct token *tp)
{
tp->allocated = 10;
tp->chars = (char *) xmalloc (tp->allocated * sizeof (char));
/* Free the memory pointed to by a 'struct token'. */
static inline void
-free_token (tp)
- struct token *tp;
+free_token (struct token *tp)
{
free (tp->chars);
}
/* Ensure there is enough room in the token for one more character. */
static inline void
-grow_token (tp)
- struct token *tp;
+grow_token (struct token *tp)
{
if (tp->charcount == tp->allocated)
{
/* Test whether a token has integer syntax. */
static inline bool
-is_integer (p)
- const char *p;
+is_integer (const char *p)
{
/* NB: Yes, '+.' and '-.' both designate the integer 0. */
const char *p_start = p;
/* Test whether a token has float syntax. */
static inline bool
-is_float (p)
- const char *p;
+is_float (const char *p)
{
enum { LEAD_INT = 1, DOT_CHAR = 2, TRAIL_INT = 4, E_CHAR = 8, EXP_INT = 16 };
int state;
/* Read the next token. 'first' is the first character, which has already
been read. Returns true for a symbol, false for a number. */
static bool
-read_token (tp, first)
- struct token *tp;
- int first;
+read_token (struct token *tp, int first)
{
int c;
bool quoted = false;
}
static inline void
-comment_add (c)
- int c;
+comment_add (int c)
{
if (buflen >= bufmax)
{
}
static inline void
-comment_line_end (chars_to_remove)
- size_t chars_to_remove;
+comment_line_end (size_t chars_to_remove)
{
buflen -= chars_to_remove;
while (buflen >= 1
/* Free the memory pointed to by a 'struct object'. */
static inline void
-free_object (op)
- struct object *op;
+free_object (struct object *op)
{
if (op->type == t_symbol || op->type == t_string)
{
/* Convert a t_symbol/t_string token to a char*. */
static char *
-string_of_object (op)
- const struct object *op;
+string_of_object (const struct object *op)
{
char *str;
int n;
/* Returns the character represented by an escape sequence. */
#define IGNORABLE_ESCAPE (EOF - 1)
static int
-do_getc_escaped (c, in_string)
- int c;
- bool in_string;
+do_getc_escaped (int c, bool in_string)
{
switch (c)
{
case 'a':
- return ALERT_CHAR;
+ return '\a';
case 'b':
return '\b';
case 'd':
'first_in_list' and 'new_backquote_flag' are used for reading old
backquote syntax and new backquote syntax. */
static void
-read_object (op, first_in_list, new_backquote_flag)
- struct object *op;
- bool first_in_list;
- bool new_backquote_flag;
+read_object (struct object *op, bool first_in_list, bool new_backquote_flag)
{
for (;;)
{
void
-extract_elisp (f, real_filename, logical_filename, mdlp)
- FILE *f;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+extract_elisp (FILE *f,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
mlp = mdlp->item[0]->messages;
{ "EmacsLisp", extract_elisp, &formatstring_elisp }, \
/* Scan an Emacs Lisp file and add its translatable strings to mdlp. */
-extern void extract_elisp PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+extern void extract_elisp (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
/* Handling of options specific to this language. */
-extern void x_elisp_extract_all PARAMS ((void));
-extern void x_elisp_keyword PARAMS ((const char *name));
+extern void x_elisp_extract_all (void);
+extern void x_elisp_keyword (const char *name);
libglade-0.16. */
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void init_keywords PARAMS ((void));
-
-
/* ====================== Keyword set customization. ====================== */
/* If true extract all strings. */
void
-x_glade_keyword (name)
- const char *name;
+x_glade_keyword (const char *name)
{
if (name == NULL)
default_keywords = false;
#if DYNLOAD_LIBEXPAT
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static bool load_libexpat PARAMS ((void));
-
typedef void *XML_Parser;
typedef char XML_Char;
typedef char XML_LChar;
enum XML_Error { XML_ERROR_NONE };
-typedef void (*XML_StartElementHandler) PARAMS ((void *userData, const XML_Char *name, const XML_Char **atts));
-typedef void (*XML_EndElementHandler) PARAMS ((void *userData, const XML_Char *name));
-typedef void (*XML_CharacterDataHandler) PARAMS ((void *userData, const XML_Char *s, int len));
-typedef void (*XML_CommentHandler) PARAMS ((void *userData, const XML_Char *data));
-
-static XML_Parser (*p_XML_ParserCreate) PARAMS ((const XML_Char *encoding));
-static void (*p_XML_SetElementHandler) PARAMS ((XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end));
-static void (*p_XML_SetCharacterDataHandler) PARAMS ((XML_Parser parser, XML_CharacterDataHandler handler));
-static void (*p_XML_SetCommentHandler) PARAMS ((XML_Parser parser, XML_CommentHandler handler));
-static int (*p_XML_Parse) PARAMS ((XML_Parser parser, const char *s, int len, int isFinal));
-static enum XML_Error (*p_XML_GetErrorCode) PARAMS ((XML_Parser parser));
-static int (*p_XML_GetCurrentLineNumber) PARAMS ((XML_Parser parser));
-static int (*p_XML_GetCurrentColumnNumber) PARAMS ((XML_Parser parser));
-static void (*p_XML_ParserFree) PARAMS ((XML_Parser parser));
-static const XML_LChar * (*p_XML_ErrorString) PARAMS ((int code));
+typedef void (*XML_StartElementHandler) (void *userData, const XML_Char *name, const XML_Char **atts);
+typedef void (*XML_EndElementHandler) (void *userData, const XML_Char *name);
+typedef void (*XML_CharacterDataHandler) (void *userData, const XML_Char *s, int len);
+typedef void (*XML_CommentHandler) (void *userData, const XML_Char *data);
+
+static XML_Parser (*p_XML_ParserCreate) (const XML_Char *encoding);
+static void (*p_XML_SetElementHandler) (XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end);
+static void (*p_XML_SetCharacterDataHandler) (XML_Parser parser, XML_CharacterDataHandler handler);
+static void (*p_XML_SetCommentHandler) (XML_Parser parser, XML_CommentHandler handler);
+static int (*p_XML_Parse) (XML_Parser parser, const char *s, int len, int isFinal);
+static enum XML_Error (*p_XML_GetErrorCode) (XML_Parser parser);
+static int (*p_XML_GetCurrentLineNumber) (XML_Parser parser);
+static int (*p_XML_GetCurrentColumnNumber) (XML_Parser parser);
+static void (*p_XML_ParserFree) (XML_Parser parser);
+static const XML_LChar * (*p_XML_ErrorString) (int code);
#define XML_ParserCreate (*p_XML_ParserCreate)
#define XML_SetElementHandler (*p_XML_SetElementHandler)
#if DYNLOAD_LIBEXPAT || HAVE_LIBEXPAT
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void ensure_stack_size PARAMS ((size_t size));
-static void start_element_handler PARAMS ((void *userData, const char *name,
- const char **attributes));
-static void end_element_handler PARAMS ((void *userData, const char *name));
-static void character_data_handler PARAMS ((void *userData, const char *s,
- int len));
-static void comment_handler PARAMS ((void *userData, const char *data));
-static void do_extract_glade PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
-
-
/* Accumulator for the extracted messages. */
static message_list_ty *mlp;
/* Ensures stack_size >= size. */
static void
-ensure_stack_size (size)
- size_t size;
+ensure_stack_size (size_t size)
{
if (size > stack_size)
{
/* Callback called when <element> is seen. */
static void
-start_element_handler (userData, name, attributes)
- void *userData;
- const char *name;
- const char **attributes;
+start_element_handler (void *userData, const char *name,
+ const char **attributes)
{
struct element_state *p;
void *hash_result;
/* Callback called when </element> is seen. */
static void
-end_element_handler (userData, name)
- void *userData;
- const char *name;
+end_element_handler (void *userData, const char *name)
{
struct element_state *p = &stack[stack_depth];
/* Callback called when some text is seen. */
static void
-character_data_handler (userData, s, len)
- void *userData;
- const char *s;
- int len;
+character_data_handler (void *userData, const char *s, int len)
{
struct element_state *p = &stack[stack_depth];
/* Callback called when some comment text is seen. */
static void
-comment_handler (userData, data)
- void *userData;
- const char *data;
+comment_handler (void *userData, const char *data)
{
/* Split multiline comment into lines, and remove leading and trailing
whitespace. */
static void
-do_extract_glade (fp, real_filename, logical_filename, mdlp)
- FILE *fp;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+do_extract_glade (FILE *fp,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
mlp = mdlp->item[0]->messages;
#endif
void
-extract_glade (fp, real_filename, logical_filename, mdlp)
- FILE *fp;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+extract_glade (FILE *fp,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
#if DYNLOAD_LIBEXPAT || HAVE_LIBEXPAT
if (LIBEXPAT_AVAILABLE ())
{ "glade", extract_glade, NULL }, \
/* Scan a glade XML file and add its translatable strings to mdlp. */
-extern void extract_glade PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+extern void extract_glade (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
/* Handling of options specific to this language. */
-extern void x_glade_extract_all PARAMS ((void));
-extern void x_glade_keyword PARAMS ((const char *name));
+extern void x_glade_extract_all (void);
+extern void x_glade_keyword (const char *name);
/* xgettext Java backend.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Tommy Johansson <tommy.johansson@kanalen.org>, 2001.
This program is free software; you can redistribute it and/or modify
#define SCANNERS_JAVA \
{ "Java", extract_java, &formatstring_java }, \
-extern void extract_java PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+extern void extract_java (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
-extern void x_java_keyword PARAMS ((const char *keyword));
-extern void x_java_extract_all PARAMS ((void));
+extern void x_java_keyword (const char *keyword);
+extern void x_java_extract_all (void);
} java_keyword;
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static char_buf *create_char_buf PARAMS ((void));
-static void append_char_buf PARAMS ((char_buf *b, int c));
-static char *get_string PARAMS ((char_buf *b));
-static void destroy_charbuf PARAMS ((char_buf *b));
-static void update_line_no PARAMS ((int c));
-static void strip_ending_spaces PARAMS ((char *str));
-static char *append_strings PARAMS ((char *a, char *b));
-static inline bool isplus PARAMS ((char *s));
-static inline bool isdot PARAMS ((char *s));
-static char *translate_esc PARAMS ((char *s));
-static object_list * object_list_alloc PARAMS ((void));
-static void object_list_destroy PARAMS ((object_list *list));
-static int get_num_objects PARAMS ((const object_list *list));
-static void * get_object PARAMS ((const object_list *list, int i));
-static void add_object PARAMS ((object_list *list, void *object));
-static java_keyword * alloc_keyword PARAMS ((const char *keyword,
- int arg1, int arg2));
-static bool tailcmp PARAMS ((const char *s1, const char *s2));
-static bool do_compare PARAMS ((const char *s1, const char *s2));
-static java_keyword *is_keyword PARAMS ((const char *s));
-static void free_global PARAMS ((void));
-
-
#define INITIAL_CHARBUF_SIZE 500
#define CHARBUF_GROWTH 100
static char_buf *
}
static void
-append_char_buf (b, c)
- char_buf *b;
- int c;
+append_char_buf (char_buf *b, int c)
{
if (b->len >= b->maxlen - 1)
{
}
static char *
-get_string (b)
- char_buf *b;
+get_string (char_buf *b)
{
return xstrdup (b->data);
}
static void
-destroy_charbuf (b)
- char_buf *b;
+destroy_charbuf (char_buf *b)
{
free (b->data);
free (b);
}
static void
-update_line_no (c)
- int c;
+update_line_no (int c)
{
if (c == '\n')
parser_global->line_no++;
}
static void
-strip_ending_spaces (str)
- char *str;
+strip_ending_spaces (char *str)
{
int len = strlen (str);
%%
static char *
-append_strings (a, b)
- char *a;
- char *b;
+append_strings (char *a, char *b)
{
int total_size = strlen (a) + strlen (b) + 1;
char *new_string = (char *) xmalloc (total_size);
}
static inline bool
-isplus (s)
- char *s;
+isplus (char *s)
{
return *s == '+';
}
static inline bool
-isdot (s)
- char *s;
+isdot (char *s)
{
return *s == '.';
}
static char *
-translate_esc (s)
- char *s;
+translate_esc (char *s)
{
char *n = (char *) xmalloc (strlen (s) + 1);
size_t i;
}
static void
-object_list_destroy (list)
- object_list *list;
+object_list_destroy (object_list *list)
{
free (list->objects);
free (list);
}
static int
-get_num_objects (list)
- const object_list *list;
+get_num_objects (const object_list *list)
{
return list->num_obj;
}
static void *
-get_object (list, i)
- const object_list *list;
- int i;
+get_object (const object_list *list, int i)
{
return list->objects[i];
}
static void
-add_object (list, object)
- object_list *list;
- void *object;
+add_object (object_list *list, void *object)
{
if (list->num_obj + 1 >= list->max_num_obj)
{
static java_keyword *
-alloc_keyword (keyword, arg1, arg2)
- const char *keyword;
- int arg1;
- int arg2;
+alloc_keyword (const char *keyword, int arg1, int arg2)
{
java_keyword *jk = xmalloc (sizeof (java_keyword));
jk->keyword = xstrdup (keyword);
* Backwards substring match.
*/
static bool
-tailcmp (s1, s2)
- const char *s1;
- const char *s2;
+tailcmp (const char *s1, const char *s2)
{
int len1 = strlen (s1);
int len2 = strlen (s2);
* true substring match is used.
*/
static bool
-do_compare (s1, s2)
- const char *s1;
- const char *s2;
+do_compare (const char *s1, const char *s2)
{
if (substring_match)
return strstr (s1, s2) != NULL;
* Check if a string is a keyword or not.
*/
static java_keyword *
-is_keyword (s)
- const char *s;
+is_keyword (const char *s)
{
int i;
int num_keywords = get_num_objects (java_keywords);
* Add a keyword to the list of possible keywords.
*/
void
-x_java_keyword (keyword)
- const char *keyword;
+x_java_keyword (const char *keyword)
{
const char *keyword_end;
int arg1;
* Main java keyword extract function.
*/
void
-extract_java (f, real_filename, logical_filename, mdlp)
- FILE *f;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+extract_java (FILE *f,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
char *logical_file_name = xstrdup (logical_filename);
int token;
#define _(s) gettext(s)
-#if HAVE_C_BACKSLASH_A
-# define ALERT_CHAR '\a'
-#else
-# define ALERT_CHAR '\7'
-#endif
-
/* Summary of librep syntax:
- ';' starts a comment until end of line.
The reader is implemented in librep-0.14/src/lisp.c. */
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-struct token;
-struct object;
-static void init_keywords PARAMS ((void));
-static int do_getc PARAMS ((void));
-static void do_ungetc PARAMS ((int c));
-static inline void init_token PARAMS ((struct token *tp));
-static inline void free_token PARAMS ((struct token *tp));
-static inline void grow_token PARAMS ((struct token *tp));
-static bool read_token PARAMS ((struct token *tp, const int *first));
-static inline void comment_start PARAMS ((void));
-static inline void comment_add PARAMS ((int c));
-static inline void comment_line_end PARAMS ((size_t chars_to_remove));
-static inline void free_object PARAMS ((struct object *op));
-static char * string_of_object PARAMS ((const struct object *op));
-static int do_getc_escaped PARAMS ((int c));
-static void read_object PARAMS ((struct object *op));
-
-
/* ====================== Keyword set customization. ====================== */
/* If true extract all strings. */
void
-x_librep_keyword (name)
- const char *name;
+x_librep_keyword (const char *name)
{
if (name == NULL)
default_keywords = false;
/* Put back the last fetched character, not EOF. */
static void
-do_ungetc (c)
- int c;
+do_ungetc (int c)
{
if (c == '\n')
line_number--;
/* Initialize a 'struct token'. */
static inline void
-init_token (tp)
- struct token *tp;
+init_token (struct token *tp)
{
tp->allocated = 10;
tp->chars = (char *) xmalloc (tp->allocated * sizeof (char));
/* Free the memory pointed to by a 'struct token'. */
static inline void
-free_token (tp)
- struct token *tp;
+free_token (struct token *tp)
{
free (tp->chars);
}
/* Ensure there is enough room in the token for one more character. */
static inline void
-grow_token (tp)
- struct token *tp;
+grow_token (struct token *tp)
{
if (tp->charcount == tp->allocated)
{
character, which has already been read. Returns true for a symbol,
false for a number. */
static bool
-read_token (tp, first)
- struct token *tp;
- const int *first;
+read_token (struct token *tp, const int *first)
{
int c;
/* Variables for speculative number parsing: */
}
static inline void
-comment_add (c)
- int c;
+comment_add (int c)
{
if (buflen >= bufmax)
{
}
static inline void
-comment_line_end (chars_to_remove)
- size_t chars_to_remove;
+comment_line_end (size_t chars_to_remove)
{
buflen -= chars_to_remove;
while (buflen >= 1
/* Free the memory pointed to by a 'struct object'. */
static inline void
-free_object (op)
- struct object *op;
+free_object (struct object *op)
{
if (op->type == t_symbol || op->type == t_string)
{
/* Convert a t_symbol/t_string token to a char*. */
static char *
-string_of_object (op)
- const struct object *op;
+string_of_object (const struct object *op)
{
char *str;
int n;
/* Returns the character represented by an escape sequence. */
static int
-do_getc_escaped (c)
- int c;
+do_getc_escaped (int c)
{
switch (c)
{
case 'v':
return '\v';
case 'a':
- return ALERT_CHAR;
+ return '\a';
case '^':
c = do_getc ();
if (c == EOF)
/* Read the next object. */
static void
-read_object (op)
- struct object *op;
+read_object (struct object *op)
{
for (;;)
{
void
-extract_librep (f, real_filename, logical_filename, mdlp)
- FILE *f;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+extract_librep (FILE *f,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
mlp = mdlp->item[0]->messages;
/* xgettext librep backend.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
{ "librep", extract_librep, &formatstring_librep }, \
/* Scan a librep file and add its translatable strings to mdlp. */
-extern void extract_librep PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+extern void extract_librep (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
/* Handling of options specific to this language. */
-extern void x_librep_extract_all PARAMS ((void));
-extern void x_librep_keyword PARAMS ((const char *name));
+extern void x_librep_extract_all (void);
+extern void x_librep_keyword (const char *name);
*/
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-struct char_syntax;
-struct token;
-struct object;
-static void init_keywords PARAMS ((void));
-static int do_getc PARAMS ((void));
-static void do_ungetc PARAMS ((int c));
-static inline void init_token PARAMS ((struct token *tp));
-static inline void free_token PARAMS ((struct token *tp));
-static inline void grow_token PARAMS ((struct token *tp));
-static void read_token PARAMS ((struct token *tp,
- const struct char_syntax *first));
-static inline bool has_a_dot PARAMS ((const struct token *tp));
-static inline bool all_a_number PARAMS ((const struct token *tp));
-static inline void a_letter_to_digit PARAMS ((const struct token *tp,
- int base));
-static inline bool has_a_digit PARAMS ((const struct token *tp));
-static inline bool has_adjacent_letters PARAMS ((const struct token *tp));
-static bool is_potential_number PARAMS ((const struct token *tp, int *basep));
-static void upcase_token PARAMS ((struct token *tp));
-static void downcase_token PARAMS ((struct token *tp));
-static void case_convert_token PARAMS ((struct token *tp));
-static inline void comment_start PARAMS ((void));
-static inline void comment_add PARAMS ((int c));
-static inline void comment_line_end PARAMS ((size_t chars_to_remove));
-static inline void free_object PARAMS ((struct object *op));
-static char * string_of_object PARAMS ((const struct object *op));
-static void read_object PARAMS ((struct object *op));
-
-
/* ========================= Lexer customization. ========================= */
/* 'readtable_case' is the case conversion that is applied to non-escaped
void
-x_lisp_keyword (name)
- const char *name;
+x_lisp_keyword (const char *name)
{
if (name == NULL)
default_keywords = false;
/* Put back the last fetched character, not EOF. */
static void
-do_ungetc (c)
- int c;
+do_ungetc (int c)
{
if (c == '\n')
line_number--;
syntax_nt_macro /* '#' (non-terminating macro) */
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static enum syntax_code
- syntax_code_of PARAMS ((/*promote: unsigned char*/ int c));
-static void read_char_syntax PARAMS ((struct char_syntax *p));
-
/* Returns the syntax code of a character. */
static enum syntax_code
-syntax_code_of (c)
- unsigned char c;
+syntax_code_of (unsigned char c)
{
switch (c)
{
/* Returns the next character and its syntax code. */
static void
-read_char_syntax (p)
- struct char_syntax *p;
+read_char_syntax (struct char_syntax *p)
{
int c = do_getc ();
#define is_letter_attribute(a) ((a) >= a_letter)
#define is_number_attribute(a) ((a) >= a_ratio)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static enum attribute attribute_of PARAMS ((/*promote: unsigned char*/ int c));
-
/* Returns the attribute of a character, assuming base 10. */
static enum attribute
-attribute_of (c)
- unsigned char c;
+attribute_of (unsigned char c)
{
switch (c)
{
/* Initialize a 'struct token'. */
static inline void
-init_token (tp)
- struct token *tp;
+init_token (struct token *tp)
{
tp->allocated = 10;
tp->chars =
/* Free the memory pointed to by a 'struct token'. */
static inline void
-free_token (tp)
- struct token *tp;
+free_token (struct token *tp)
{
free (tp->chars);
}
/* Ensure there is enough room in the token for one more character. */
static inline void
-grow_token (tp)
- struct token *tp;
+grow_token (struct token *tp)
{
if (tp->charcount == tp->allocated)
{
character, which has already been read.
The algorithm follows CLHS 2.2 "Reader Algorithm". */
static void
-read_token (tp, first)
- struct token *tp;
- const struct char_syntax *first;
+read_token (struct token *tp, const struct char_syntax *first)
{
bool multiple_escape_flag;
struct char_syntax curr;
*/
static inline bool
-has_a_dot (tp)
- const struct token *tp;
+has_a_dot (const struct token *tp)
{
int n = tp->charcount;
int i;
}
static inline bool
-all_a_number (tp)
- const struct token *tp;
+all_a_number (const struct token *tp)
{
int n = tp->charcount;
int i;
}
static inline void
-a_letter_to_digit (tp, base)
- const struct token *tp;
- int base;
+a_letter_to_digit (const struct token *tp, int base)
{
int n = tp->charcount;
int i;
}
static inline bool
-has_a_digit (tp)
- const struct token *tp;
+has_a_digit (const struct token *tp)
{
int n = tp->charcount;
int i;
}
static inline bool
-has_adjacent_letters (tp)
- const struct token *tp;
+has_adjacent_letters (const struct token *tp)
{
int n = tp->charcount;
int i;
}
static bool
-is_potential_number (tp, basep)
- const struct token *tp;
- int *basep;
+is_potential_number (const struct token *tp, int *basep)
{
/* CLHS 2.3.1.1.1:
"A potential number cannot contain any escape characters." */
n_float
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static enum number_type is_number PARAMS ((const struct token *tp, int *basep));
-
static enum number_type
-is_number (tp, basep)
- const struct token *tp;
- int *basep;
+is_number (const struct token *tp, int *basep)
{
struct token_char *ptr_limit;
struct token_char *ptr1;
For portability, we convert only ASCII characters here. */
static void
-upcase_token (tp)
- struct token *tp;
+upcase_token (struct token *tp)
{
int n = tp->charcount;
int i;
}
static void
-downcase_token (tp)
- struct token *tp;
+downcase_token (struct token *tp)
{
int n = tp->charcount;
int i;
}
static void
-case_convert_token (tp)
- struct token *tp;
+case_convert_token (struct token *tp)
{
int n = tp->charcount;
int i;
}
static inline void
-comment_add (c)
- int c;
+comment_add (int c)
{
if (buflen >= bufmax)
{
}
static inline void
-comment_line_end (chars_to_remove)
- size_t chars_to_remove;
+comment_line_end (size_t chars_to_remove)
{
buflen -= chars_to_remove;
while (buflen >= 1
/* Free the memory pointed to by a 'struct object'. */
static inline void
-free_object (op)
- struct object *op;
+free_object (struct object *op)
{
if (op->type == t_symbol || op->type == t_string)
{
/* Convert a t_symbol/t_string token to a char*. */
static char *
-string_of_object (op)
- const struct object *op;
+string_of_object (const struct object *op)
{
char *str;
const struct token_char *p;
/* Read the next object. */
static void
-read_object (op)
- struct object *op;
+read_object (struct object *op)
{
for (;;)
{
void
-extract_lisp (f, real_filename, logical_filename, mdlp)
- FILE *f;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+extract_lisp (FILE *f,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
mlp = mdlp->item[0]->messages;
/* xgettext Lisp backend.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
{ "Lisp", extract_lisp, &formatstring_lisp }, \
/* Scan a Lisp file and add its translatable strings to mdlp. */
-extern void extract_lisp PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+extern void extract_lisp (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
/* Handling of options specific to this language. */
-extern void x_lisp_extract_all PARAMS ((void));
-extern void x_lisp_keyword PARAMS ((const char *name));
+extern void x_lisp_extract_all (void);
+extern void x_lisp_keyword (const char *name);
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void init_keywords PARAMS ((void));
-static int phase1_getc PARAMS ((void));
-static void phase1_ungetc PARAMS ((int c));
-static void skip_html PARAMS ((void));
-#if 0
-static int phase2_getc PARAMS ((void));
-static void phase2_ungetc PARAMS ((int c));
-#endif
-static inline void comment_start PARAMS ((void));
-static inline void comment_add PARAMS ((int c));
-static inline void comment_line_end PARAMS ((size_t chars_to_remove));
-static int phase3_getc PARAMS ((void));
-static void phase3_ungetc PARAMS ((int c));
-static inline void free_token PARAMS ((token_ty *tp));
-static void x_php_lex PARAMS ((token_ty *tp));
-static bool extract_parenthesized PARAMS ((message_list_ty *mlp,
- int commas_to_skip,
- int plural_commas));
-
-
/* ====================== Keyword set customization. ====================== */
/* If true extract all strings. */
void
-x_php_keyword (name)
- const char *name;
+x_php_keyword (const char *name)
{
if (name == NULL)
default_keywords = false;
}
static void
-phase1_ungetc (c)
- int c;
+phase1_ungetc (int c)
{
if (c != EOF)
{
}
static void
-phase2_ungetc (c)
- int c;
+phase2_ungetc (int c)
{
if (c != EOF)
phase2_pushback[phase2_pushback_length++] = c;
}
static inline void
-comment_add (c)
- int c;
+comment_add (int c)
{
if (buflen >= bufmax)
{
}
static inline void
-comment_line_end (chars_to_remove)
- size_t chars_to_remove;
+comment_line_end (size_t chars_to_remove)
{
buflen -= chars_to_remove;
while (buflen >= 1
}
static void
-phase3_ungetc (c)
- int c;
+phase3_ungetc (int c)
{
if (c != EOF)
phase3_pushback[phase3_pushback_length++] = c;
/* Free the memory pointed to by a 'struct token_ty'. */
static inline void
-free_token (tp)
- token_ty *tp;
+free_token (token_ty *tp)
{
if (tp->type == token_type_string_literal || tp->type == token_type_symbol)
free (tp->string);
/* 4. Combine characters into tokens. Discard whitespace. */
static void
-x_php_lex (tp)
- token_ty *tp;
+x_php_lex (token_ty *tp)
{
static char *buffer;
static int bufmax;
When no specific argument shall be extracted, COMMAS_TO_SKIP < 0.
Return true upon eof, false upon closing parenthesis. */
static bool
-extract_parenthesized (mlp, commas_to_skip, plural_commas)
- message_list_ty *mlp;
- int commas_to_skip;
- int plural_commas;
+extract_parenthesized (message_list_ty *mlp,
+ int commas_to_skip, int plural_commas)
{
/* Remember the message containing the msgid, for msgid_plural. */
message_ty *plural_mp = NULL;
void
-extract_php (f, real_filename, logical_filename, mdlp)
- FILE *f;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+extract_php (FILE *f,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
message_list_ty *mlp = mdlp->item[0]->messages;
{ "PHP", extract_php, &formatstring_php }, \
/* Scan a PHP file and add its translatable strings to mdlp. */
-extern void extract_php PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+extern void extract_php (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
-extern void x_php_keyword PARAMS ((const char *keyword));
-extern void x_php_extract_all PARAMS ((void));
+extern void x_php_keyword (const char *keyword);
+extern void x_php_extract_all (void);
/* xgettext PO backend.
- Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
#define _(str) gettext (str)
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void extract_constructor PARAMS ((po_ty *that));
-static void extract_directive_domain PARAMS ((po_ty *that, char *name));
-static void extract_directive_message PARAMS ((po_ty *that, char *msgid,
- lex_pos_ty *msgid_pos,
- char *msgid_plural,
- char *msgstr, size_t msgstr_len,
- lex_pos_ty *msgstr_pos,
- bool obsolete));
-static void extract_parse_brief PARAMS ((po_ty *that));
-static void extract_comment PARAMS ((po_ty *that, const char *s));
-static void extract_comment_dot PARAMS ((po_ty *that, const char *s));
-static void extract_comment_filepos PARAMS ((po_ty *that, const char *name,
- size_t line));
-static void extract_comment_special PARAMS ((po_ty *that, const char *s));
-
-
typedef struct extract_class_ty extract_class_ty;
struct extract_class_ty
{
static void
-extract_constructor (that)
- po_ty *that;
+extract_constructor (po_ty *that)
{
extract_class_ty *this = (extract_class_ty *) that;
size_t i;
static void
-extract_directive_domain (that, name)
- po_ty *that;
- char *name;
+extract_directive_domain (po_ty *that, char *name)
{
po_gram_error_at_line (&gram_pos,
_("this file may not contain domain directives"));
static void
-extract_directive_message (that, msgid, msgid_pos, msgid_plural,
- msgstr, msgstr_len, msgstr_pos, obsolete)
- po_ty *that;
- char *msgid;
- lex_pos_ty *msgid_pos;
- char *msgid_plural;
- char *msgstr;
- size_t msgstr_len;
- lex_pos_ty *msgstr_pos;
- bool obsolete;
+extract_directive_message (po_ty *that,
+ char *msgid,
+ lex_pos_ty *msgid_pos,
+ char *msgid_plural,
+ char *msgstr, size_t msgstr_len,
+ lex_pos_ty *msgstr_pos,
+ bool obsolete)
{
extract_class_ty *this = (extract_class_ty *)that;
message_ty *mp;
static void
-extract_parse_brief (that)
- po_ty *that;
+extract_parse_brief (po_ty *that)
{
po_lex_pass_comments (true);
}
static void
-extract_comment (that, s)
- po_ty *that;
- const char *s;
+extract_comment (po_ty *that, const char *s)
{
extract_class_ty *this = (extract_class_ty *) that;
static void
-extract_comment_dot (that, s)
- po_ty *that;
- const char *s;
+extract_comment_dot (po_ty *that, const char *s)
{
extract_class_ty *this = (extract_class_ty *) that;
static void
-extract_comment_filepos (that, name, line)
- po_ty *that;
- const char *name;
- size_t line;
+extract_comment_filepos (po_ty *that, const char *name, size_t line)
{
extract_class_ty *this = (extract_class_ty *) that;
size_t nbytes;
static void
-extract_comment_special (that, s)
- po_ty *that;
- const char *s;
+extract_comment_special (po_ty *that, const char *s)
{
extract_class_ty *this = (extract_class_ty *) that;
void
-extract_po (fp, real_filename, logical_filename, mdlp)
- FILE *fp;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+extract_po (FILE *fp,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
po_ty *pop = po_alloc (&extract_methods);
((extract_class_ty *) pop)->mlp = mdlp->item[0]->messages;
/* xgettext PO backend.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
{ "PO", extract_po, NULL }, \
/* Scan a PO file and add its translatable strings to mdlp. */
-extern void extract_po PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+extern void extract_po (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
#define _(s) gettext(s)
-#if HAVE_C_BACKSLASH_A
-# define ALERT_CHAR '\a'
-#else
-# define ALERT_CHAR '\7'
-#endif
-
/* The Python syntax is defined in the Python Reference Manual
/usr/share/doc/packages/python/html/ref/index.html.
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void init_keywords PARAMS ((void));
-static int phase1_getc PARAMS ((void));
-static void phase1_ungetc PARAMS ((int c));
-static inline void comment_start PARAMS ((void));
-static inline void comment_add PARAMS ((int c));
-static inline void comment_line_end PARAMS ((void));
-static int phase2_getc PARAMS ((void));
-static void phase2_ungetc PARAMS ((int c));
-static int phase7_getuc PARAMS ((int quote_char, bool triple,
- bool interpret_ansic, bool interpret_unicode,
- unsigned int *backslash_counter));
-static void phase5_get PARAMS ((token_ty *tp));
-static void phase5_unget PARAMS ((token_ty *tp));
-static void x_python_lex PARAMS ((token_ty *tp));
-static bool extract_parenthesized PARAMS ((message_list_ty *mlp,
- int commas_to_skip,
- int plural_commas));
-
-
/* ====================== Keyword set customization. ====================== */
/* If true extract all strings. */
void
-x_python_keyword (name)
- const char *name;
+x_python_keyword (const char *name)
{
if (name == NULL)
default_keywords = false;
}
static void
-phase1_ungetc (c)
- int c;
+phase1_ungetc (int c)
{
if (c != EOF)
{
}
static inline void
-comment_add (c)
- int c;
+comment_add (int c)
{
/* We assume the program source is in ISO-8859-1 (for consistency with
Python's \ooo and \xnn syntax inside strings), but we produce a POT
}
static void
-phase2_ungetc (c)
- int c;
+phase2_ungetc (int c)
{
phase1_ungetc (c);
}
#define P7_STRING_END (-2)
static int
-phase7_getuc (quote_char, triple, interpret_ansic, interpret_unicode, backslash_counter)
- int quote_char;
- bool triple;
- bool interpret_ansic;
- bool interpret_unicode;
- unsigned int *backslash_counter;
+phase7_getuc (int quote_char,
+ bool triple, bool interpret_ansic, bool interpret_unicode,
+ unsigned int *backslash_counter)
{
int c;
return c;
case 'a':
*backslash_counter = 0;
- return ALERT_CHAR;
+ return '\a';
case 'b':
*backslash_counter = 0;
return '\b';
static int phase5_pushback_length;
static void
-phase5_get (tp)
- token_ty *tp;
+phase5_get (token_ty *tp)
{
int c;
}
static void
-phase5_unget (tp)
- token_ty *tp;
+phase5_unget (token_ty *tp)
{
if (tp->type != token_type_eof)
phase5_pushback[phase5_pushback_length++] = *tp;
belong to different logical lines will not be concatenated. */
static void
-x_python_lex (tp)
- token_ty *tp;
+x_python_lex (token_ty *tp)
{
phase5_get (tp);
if (tp->type != token_type_string)
When no specific argument shall be extracted, COMMAS_TO_SKIP < 0.
Return true upon eof, false upon closing parenthesis. */
static bool
-extract_parenthesized (mlp, commas_to_skip, plural_commas)
- message_list_ty *mlp;
- int commas_to_skip;
- int plural_commas;
+extract_parenthesized (message_list_ty *mlp,
+ int commas_to_skip, int plural_commas)
{
/* Remember the message containing the msgid, for msgid_plural. */
message_ty *plural_mp = NULL;
void
-extract_python (f, real_filename, logical_filename, mdlp)
- FILE *f;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+extract_python (FILE *f,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
message_list_ty *mlp = mdlp->item[0]->messages;
{ "Python", extract_python, &formatstring_python }, \
/* Scan a Python file and add its translatable strings to mdlp. */
-extern void extract_python PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+extern void extract_python (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
-extern void x_python_keyword PARAMS ((const char *keyword));
-extern void x_python_extract_all PARAMS ((void));
+extern void x_python_keyword (const char *keyword);
+extern void x_python_extract_all (void);
/* xgettext RST backend.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
This file was written by Bruno Haible <haible@clisp.cons.org>, 2001.
*/
void
-extract_rst (f, real_filename, logical_filename, mdlp)
- FILE *f;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+extract_rst (FILE *f,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
static char *buffer;
static int bufmax;
/* xgettext RST backend.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
{ "RST", extract_rst, &formatstring_pascal }, \
/* Scan an RST file and add its translatable strings to mdlp. */
-extern void extract_rst PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+extern void extract_rst (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int phase1_getc PARAMS ((void));
-static void phase1_ungetc PARAMS ((int c));
-static inline void comment_start PARAMS ((void));
-static inline void comment_add PARAMS ((int c));
-static inline void comment_line_end PARAMS ((void));
-static void phase2_get PARAMS ((token_ty *tp));
-static void phase2_unget PARAMS ((token_ty *tp));
-static void x_smalltalk_lex PARAMS ((token_ty *tp));
-
-
/* ======================== Reading of characters. ======================== */
}
static void
-phase1_ungetc (c)
- int c;
+phase1_ungetc (int c)
{
if (c != EOF)
{
}
static inline void
-comment_add (c)
- int c;
+comment_add (int c)
{
if (buflen >= bufmax)
{
static int phase2_pushback_length;
static void
-phase2_get (tp)
- token_ty *tp;
+phase2_get (token_ty *tp)
{
static char *buffer;
static int bufmax;
}
static void
-phase2_unget (tp)
- token_ty *tp;
+phase2_unget (token_ty *tp)
{
if (tp->type != token_type_eof)
phase2_pushback[phase2_pushback_length++] = *tp;
/* 3. Combine "# string_literal" and "# symbol" to a single token. */
static void
-x_smalltalk_lex (tp)
- token_ty *tp;
+x_smalltalk_lex (token_ty *tp)
{
phase2_get (tp);
if (tp->type == token_type_uniq)
*/
void
-extract_smalltalk (f, real_filename, logical_filename, mdlp)
- FILE *f;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+extract_smalltalk (FILE *f,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
message_list_ty *mlp = mdlp->item[0]->messages;
{ "Smalltalk", extract_smalltalk, &formatstring_smalltalk }, \
/* Scan a Smalltalk file and add its translatable strings to mdlp. */
-extern void extract_smalltalk PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+extern void extract_smalltalk (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
#define _(s) gettext(s)
-#if HAVE_C_BACKSLASH_A
-# define ALERT_CHAR '\a'
-#else
-# define ALERT_CHAR '\7'
-#endif
-
/* The Tcl syntax is defined in the Tcl.n manual page.
Summary of Tcl syntax:
The parser is implemented in tcl8.3.3/generic/tclParse.c. */
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-struct token;
-struct word;
-static void init_keywords PARAMS ((void));
-static int do_getc PARAMS ((void));
-static void do_ungetc PARAMS ((int c));
-static int phase1_getc PARAMS ((void));
-static void phase1_ungetc PARAMS ((int c));
-static int phase2_push PARAMS ((void));
-static void phase2_pop PARAMS ((int previous_depth));
-static int phase2_getc PARAMS ((void));
-static void phase2_ungetc PARAMS ((int c));
-static inline void init_token PARAMS ((struct token *tp));
-static inline void free_token PARAMS ((struct token *tp));
-static inline void grow_token PARAMS ((struct token *tp));
-static inline void comment_start PARAMS ((void));
-static inline void comment_add PARAMS ((int c));
-static inline void comment_line_end PARAMS ((void));
-static inline void free_word PARAMS ((struct word *wp));
-static char * string_of_word PARAMS ((const struct word *wp));
-static int do_getc_escaped PARAMS ((void));
-
-
/* ====================== Keyword set customization. ====================== */
/* If true extract all strings. */
void
-x_tcl_keyword (name)
- const char *name;
+x_tcl_keyword (const char *name)
{
if (name == NULL)
default_keywords = false;
/* Put back the last fetched character, not EOF. */
static void
-do_ungetc (c)
- int c;
+do_ungetc (int c)
{
if (c == '\n')
line_number--;
}
static void
-phase1_ungetc (c)
- int c;
+phase1_ungetc (int c)
{
switch (c)
{
}
static void
-phase2_pop (previous_depth)
- int previous_depth;
+phase2_pop (int previous_depth)
{
brace_depth = previous_depth;
}
}
static void
-phase2_ungetc (c)
- int c;
+phase2_ungetc (int c)
{
if (c != EOF)
{
/* Initialize a 'struct token'. */
static inline void
-init_token (tp)
- struct token *tp;
+init_token (struct token *tp)
{
tp->allocated = 10;
tp->chars = (char *) xmalloc (tp->allocated * sizeof (char));
/* Free the memory pointed to by a 'struct token'. */
static inline void
-free_token (tp)
- struct token *tp;
+free_token (struct token *tp)
{
free (tp->chars);
}
/* Ensure there is enough room in the token for one more character. */
static inline void
-grow_token (tp)
- struct token *tp;
+grow_token (struct token *tp)
{
if (tp->charcount == tp->allocated)
{
}
static inline void
-comment_add (c)
- int c;
+comment_add (int c)
{
if (buflen >= bufmax)
{
/* Free the memory pointed to by a 'struct word'. */
static inline void
-free_word (wp)
- struct word *wp;
+free_word (struct word *wp)
{
if (wp->type == t_string)
{
/* Convert a t_string token to a char*. */
static char *
-string_of_word (wp)
- const struct word *wp;
+string_of_word (const struct word *wp)
{
char *str;
int n;
case EOF:
return '\\';
case 'a':
- return ALERT_CHAR;
+ return '\a';
case 'b':
return '\b';
case 'f':
te_quote /* looking for '"' */
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int accumulate_word PARAMS ((struct word *wp,
- enum terminator looking_for));
-static void read_word PARAMS ((struct word *wp, int looking_for));
-static enum word_type read_command PARAMS ((int looking_for));
-static enum word_type read_command_list PARAMS ((int looking_for));
+/* Forward declaration of local functions. */
+static enum word_type read_command_list (int looking_for);
/* Accumulate tokens into the given word.
'looking_for' denotes a parse terminator combination. */
static int
-accumulate_word (wp, looking_for)
- struct word *wp;
- enum terminator looking_for;
+accumulate_word (struct word *wp, enum terminator looking_for)
{
int c;
/* Read the next word.
'looking_for' denotes a parse terminator, either ']' or '\0'. */
static void
-read_word (wp, looking_for)
- struct word *wp;
- int looking_for;
+read_word (struct word *wp, int looking_for)
{
int c;
Returns the type of the word that terminated the command: t_separator or
t_bracket (only if looking_for is ']') or t_brace or t_eof. */
static enum word_type
-read_command (looking_for)
- int looking_for;
+read_command (int looking_for)
{
int c;
Returns the type of the word that terminated the command list:
t_bracket (only if looking_for is ']') or t_brace or t_eof. */
static enum word_type
-read_command_list (looking_for)
- int looking_for;
+read_command_list (int looking_for)
{
for (;;)
{
void
-extract_tcl (f, real_filename, logical_filename, mdlp)
- FILE *f;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+extract_tcl (FILE *f,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
mlp = mdlp->item[0]->messages;
{ "Tcl", extract_tcl, &formatstring_tcl }, \
/* Scan a Tcl file and add its translatable strings to mdlp. */
-extern void extract_tcl PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+extern void extract_tcl (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
/* Handling of options specific to this language. */
-extern void x_tcl_extract_all PARAMS ((void));
-extern void x_tcl_keyword PARAMS ((const char *name));
+extern void x_tcl_extract_all (void);
+extern void x_tcl_keyword (const char *name);
static int last_non_comment_line;
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static int phase1_getc PARAMS ((void));
-static void phase1_ungetc PARAMS ((int c));
-static int phase2_getc PARAMS ((void));
-static void phase2_ungetc PARAMS ((int c));
-static int phase7_getc PARAMS ((void));
-static void x_ycp_lex PARAMS ((token_ty *tp));
-
-
/* 1. line_number handling. */
static int
}
static void
-phase1_ungetc (c)
- int c;
+phase1_ungetc (int c)
{
if (c != EOF)
{
}
static void
-phase2_ungetc (c)
- int c;
+phase2_ungetc (int c)
{
if (c != EOF)
phase2_pushback[phase2_pushback_length++] = c;
/* Combine characters into tokens. Discard whitespace. */
static void
-x_ycp_lex (tp)
- token_ty *tp;
+x_ycp_lex (token_ty *tp)
{
static char *buffer;
static int bufmax;
void
-extract_ycp (f, real_filename, logical_filename, mdlp)
- FILE *f;
- const char *real_filename;
- const char *logical_filename;
- msgdomain_list_ty *mdlp;
+extract_ycp (FILE *f,
+ const char *real_filename, const char *logical_filename,
+ msgdomain_list_ty *mdlp)
{
message_list_ty *mlp = mdlp->item[0]->messages;
int state;
/* xgettext YCP backend.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
{ "YCP", extract_ycp, &formatstring_ycp }, \
/* Scan an YCP file and add its translatable strings to mdlp. */
-extern void extract_ycp PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+extern void extract_ycp (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
/* The extractors must all be functions returning void and taking three
arguments designating the input stream and one message domain list argument
in which to add the messages. */
-typedef void (*extractor_func) PARAMS ((FILE *fp, const char *real_filename,
- const char *logical_filename,
- msgdomain_list_ty *mdlp));
+typedef void (*extractor_func) (FILE *fp, const char *real_filename,
+ const char *logical_filename,
+ msgdomain_list_ty *mdlp);
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status))
+/* Forward declaration of local functions. */
+static void usage (int status)
#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ > 4) || __GNUC__ > 2)
__attribute__ ((noreturn))
#endif
;
-static void exclude_directive_domain PARAMS ((po_ty *pop, char *name));
-static void exclude_directive_message PARAMS ((po_ty *pop, char *msgid,
- lex_pos_ty *msgid_pos,
- char *msgid_plural,
- char *msgstr, size_t msgstr_len,
- lex_pos_ty *msgstr_pos,
- bool obsolete));
-static void read_exclusion_file PARAMS ((char *file_name));
-static FILE *xgettext_open PARAMS ((const char *fn, char **logical_file_name_p,
- char **real_file_name_p));
-static void extract_from_file PARAMS ((const char *file_name,
- extractor_func extractor,
- msgdomain_list_ty *mdlp));
-static message_ty *construct_header PARAMS ((void));
-static void finalize_header PARAMS ((msgdomain_list_ty *mdlp));
-static extractor_func language_to_extractor PARAMS ((const char *name));
-static const char *extension_to_language PARAMS ((const char *extension));
+static void read_exclusion_file (char *file_name);
+static void extract_from_file (const char *file_name, extractor_func extractor,
+ msgdomain_list_ty *mdlp);
+static message_ty *construct_header (void);
+static void finalize_header (msgdomain_list_ty *mdlp);
+static extractor_func language_to_extractor (const char *name);
+static const char *extension_to_language (const char *extension);
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
int cnt;
int optchar;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
static void
-exclude_directive_domain (pop, name)
- po_ty *pop;
- char *name;
+exclude_directive_domain (po_ty *pop, char *name)
{
po_gram_error_at_line (&gram_pos,
_("this file may not contain domain directives"));
static void
-exclude_directive_message (pop, msgid, msgid_pos, msgid_plural,
- msgstr, msgstr_len, msgstr_pos, obsolete)
- po_ty *pop;
- char *msgid;
- lex_pos_ty *msgid_pos;
- char *msgid_plural;
- char *msgstr;
- size_t msgstr_len;
- lex_pos_ty *msgstr_pos;
- bool obsolete;
+exclude_directive_message (po_ty *pop,
+ char *msgid,
+ lex_pos_ty *msgid_pos,
+ char *msgid_plural,
+ char *msgstr, size_t msgstr_len,
+ lex_pos_ty *msgstr_pos,
+ bool obsolete)
{
message_ty *mp;
static void
-read_exclusion_file (file_name)
- char *file_name;
+read_exclusion_file (char *file_name)
{
po_ty *pop;
void
-split_keywordspec (spec, endp, argnum1p, argnum2p)
- const char *spec;
- const char **endp;
- int *argnum1p;
- int *argnum2p;
+split_keywordspec (const char *spec,
+ const char **endp, int *argnum1p, int *argnum2p)
{
const char *p;
static string_list_ty *comment;
void
-xgettext_comment_add (str)
- const char *str;
+xgettext_comment_add (const char *str)
{
if (comment == NULL)
comment = string_list_alloc ();
}
const char *
-xgettext_comment (n)
- size_t n;
+xgettext_comment (size_t n)
{
if (comment == NULL || n >= comment->nitems)
return NULL;
static FILE *
-xgettext_open (fn, logical_file_name_p, real_file_name_p)
- const char *fn;
- char **logical_file_name_p;
- char **real_file_name_p;
+xgettext_open (const char *fn,
+ char **logical_file_name_p, char **real_file_name_p)
{
FILE *fp;
char *new_name;
static void
-extract_from_file (file_name, extractor, mdlp)
- const char *file_name;
- extractor_func extractor;
- msgdomain_list_ty *mdlp;
+extract_from_file (const char *file_name, extractor_func extractor,
+ msgdomain_list_ty *mdlp)
{
char *logical_file_name;
char *real_file_name;
message_ty *
-remember_a_message (mlp, string, pos)
- message_list_ty *mlp;
- char *string;
- lex_pos_ty *pos;
+remember_a_message (message_list_ty *mlp, char *string, lex_pos_ty *pos)
{
enum is_format is_format[NFORMATS];
enum is_wrap do_wrap;
void
-remember_a_message_plural (mp, string, pos)
- message_ty *mp;
- char *string;
- lex_pos_ty *pos;
+remember_a_message_plural (message_ty *mp, char *string, lex_pos_ty *pos)
{
char *msgid_plural;
char *msgstr1;
}
static void
-finalize_header (mdlp)
- msgdomain_list_ty *mdlp;
+finalize_header (msgdomain_list_ty *mdlp)
{
/* If the generated PO file has plural forms, add a Plural-Forms template
to the constructed header. */
static extractor_func
-language_to_extractor (name)
- const char *name;
+language_to_extractor (const char *name)
{
typedef struct table_ty table_ty;
struct table_ty
static const char *
-extension_to_language (extension)
- const char *extension;
+extension_to_language (const char *extension)
{
typedef struct table_ty table_ty;
struct table_ty
extern bool substring_match;
/* Split keyword spec into keyword, argnum1, argnum2. */
-extern void split_keywordspec PARAMS ((const char *spec, const char **endp,
- int *argnum1p, int *argnum2p));
+extern void split_keywordspec (const char *spec, const char **endp,
+ int *argnum1p, int *argnum2p);
/* Canonicalized encoding name for all input files. */
extern const char *xgettext_global_source_encoding;
/* Comment handling: There is a list of automatic comments that may be appended
to the next message. Used by remember_a_message(). */
-extern void xgettext_comment_add PARAMS ((const char *str));
-extern const char *xgettext_comment PARAMS ((size_t n));
-extern void xgettext_comment_reset PARAMS ((void));
+extern void xgettext_comment_add (const char *str);
+extern const char *xgettext_comment (size_t n);
+extern void xgettext_comment_reset (void);
/* Add a message to the list of extracted messages.
string must be malloc()ed string; its ownership is passed to the callee.
pos->file_name must be allocated with indefinite extent. */
-extern message_ty *remember_a_message PARAMS ((message_list_ty *mlp,
- char *string, lex_pos_ty *pos));
+extern message_ty *remember_a_message (message_list_ty *mlp,
+ char *string, lex_pos_ty *pos);
/* Add an msgid_plural to a message previously returned by
remember_a_message.
string must be malloc()ed string; its ownership is passed to the callee.
pos->file_name must be allocated with indefinite extent. */
-extern void remember_a_message_plural PARAMS ((message_ty *mp,
- char *string, lex_pos_ty *pos));
+extern void remember_a_message_plural (message_ty *mp,
+ char *string, lex_pos_ty *pos);
#endif /* _XGETTEXT_H */
+2002-11-13 Bruno Haible <bruno@clisp.org>
+
+ Assume ANSI C.
+ * format-c-3-prg.c (main): Use ANSI C function declarations and
+ preprocessor string concatenation.
+ * format-c-3: Don't test for return code 77.
+ * format-c-4-prg.c (main): Use ANSI C function declarations and
+ preprocessor string concatenation.
+ * format-c-4: Don't test for return code 77.
+ * plural-1-prg.c (main): Use ANSI C function declarations.
+ * setlocale.c (category_to_name, setlocale): Likewise.
+ * tstgettext.c (main, usage, expand_escape): Likewise.
+ * tstngettext.c (main, usage): Likewise.
+ * rpathlx/usex.c (rpathx_value): Likewise.
+ * rpathly/usey.c (rpathy_value): Likewise.
+ * rpathlyx/usey.c (rpathy_value): Likewise.
+ * rpathlz/usez.c (rpathz_value): Likewise.
+ * rpathlzyx/usez.c (rpathz_value): Likewise.
+ * rpathy/rpathy.c (rpathx_value): Likewise.
+ * rpathz/rpathz.c (rpathx_value, rpathy_value): Likewise.
+
2002-11-11 Bruno Haible <bruno@clisp.org>
* tstgettext.c (program_name): Declare as external.
LANGUAGE= ./fc3 de_DE
result=$?
-if test $result = 77; then
- echo "SKIP: format-c-3"
-fi
-
rm -fr $tmpfiles
exit $result
# define PRId8 "d"
#endif
-int main (argc, argv)
- int argc;
- char *argv[];
+int
+main (int argc, char *argv[])
{
-/* This test requires ANSI C string concatenation. */
-#ifdef __STDC__
unsigned char n = 5;
const char *s;
const char *c1;
exit (1);
}
return 0;
-#else
- exit (77);
-#endif
}
LANGUAGE= ./fc4 de_DE
result=$?
-if test $result = 77; then
- echo "SKIP: format-c-4"
-fi
-
rm -fr $tmpfiles
exit $result
# define PRId8 "d"
#endif
-int main (argc, argv)
- int argc;
- char *argv[];
+int
+main (int argc, char *argv[])
{
-/* This test requires ANSI C string concatenation. */
-#ifdef __STDC__
unsigned char n = 5;
const char *s;
const char *c1;
exit (1);
}
return 0;
-#else
- exit (77);
-#endif
}
#undef _LIBINTL_H
#include "libgnuintl.h"
-int main (argc, argv)
- int argc;
- char *argv[];
+int
+main (int argc, char *argv[])
{
int n = atoi (argv[2]);
-extern int rpathx_value ();
+extern int rpathx_value (void);
int main () { return !(rpathx_value () == 5); }
-extern int rpathy_value ();
+extern int rpathy_value (void);
int main () { return !(rpathy_value () == 57); }
-extern int rpathy_value ();
+extern int rpathy_value (void);
int main () { return !(rpathy_value () == 57); }
-extern int rpathz_value ();
+extern int rpathz_value (void);
int main () { return !(rpathz_value () == 5171); }
-extern int rpathz_value ();
+extern int rpathz_value (void);
int main () { return !(rpathz_value () == 5171); }
-extern int rpathx_value ();
+extern int rpathx_value (void);
int rpathy_value () { return 10 * rpathx_value () + 7; }
-extern int rpathx_value ();
-extern int rpathy_value ();
+extern int rpathx_value (void);
+extern int rpathy_value (void);
int rpathz_value () { return 1000 * rpathx_value () + 3 * rpathy_value (); }
/* Fake setlocale - platform independent, for testing purposes.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002 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
/* Return string representation of locale CATEGORY. */
static const char *
-category_to_name (category)
- int category;
+category_to_name (int category)
{
const char *retval;
actually change the behaviour of locale dependent functions.
Assumes setenv()/putenv() is not called. */
char *
-setlocale (category, locale)
- int category;
- SETLOCALE_CONST char *locale;
+setlocale (int category, SETLOCALE_CONST char *locale)
{
static char C_string[] = "C";
static char *current_locale = C_string;
{ NULL, 0, NULL, 0 }
};
-/* Prototypes for local functions. Needed to ensure compiler checking of
- function argument counts despite of K&R C function definition syntax. */
-static void usage PARAMS ((int status))
+/* Forward declaration of local functions. */
+static void usage (int status)
#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
__attribute__ ((noreturn))
#endif
;
-static const char *expand_escape PARAMS ((const char *str));
+static const char *expand_escape (const char *str);
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
int optchar;
const char *msgid;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
/* Expand some escape sequences found in the argument string. */
static const char *
-expand_escape (str)
- const char *str;
+expand_escape (const char *str)
{
char *retval, *rp;
const char *cp = str;
{ NULL, 0, NULL, 0 }
};
-/* Prototypes for local functions. */
-static void usage PARAMS ((int __status))
+/* Forward declaration of local functions. */
+static void usage (int __status)
#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2)
__attribute__ ((noreturn))
#endif
;
int
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char *argv[])
{
int optchar;
const char *msgid;
/* Display usage information and exit. */
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),