implementations of C, for example under Gould's UTX/32. */
pointer
-alloca (size)
- unsigned size;
+alloca (unsigned size)
{
auto char probe; /* Probes stack depth: */
register char *depth = ADDRESS_FUNCTION (probe);
/* FIXME: describe. */
int
-rpl_chown (file, uid, gid)
- const char *file;
- uid_t uid;
- gid_t gid;
+rpl_chown (const char *file, uid_t uid, gid_t gid)
{
if (gid == (gid_t) -1 || uid == (uid_t) -1)
{
removed. */
char *
-dirname (path)
- char *path;
+dirname (char *path)
{
char *newpath;
char *slash;
/* euidaccess -- check if effective user id can access file
- Copyright (C) 1990, 1991, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1991, 1995, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
filesystem, text busy, etc. */
int
-euidaccess (path, mode)
- const char *path;
- int mode;
+euidaccess (const char *path, int mode)
{
struct stat stats;
int granted;
/* Return the number of 512-byte blocks in a file of SIZE bytes. */
off_t
-st_blocks (size)
- off_t size;
+st_blocks (off_t size)
{
off_t datablks = size / 512 + (size % 512 != 0);
off_t indrblks = 0;
/* 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;
ERRNO is either a system error value, or zero if DISK is NULL
on a system that requires a non-NULL value. */
int
-get_fs_usage (path, disk, fsp)
- const char *path;
- const char *disk;
- struct fs_usage *fsp;
+get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp)
{
#ifdef STAT_STATFS3_OSF1
/* AIX PS/2 does not supply statfs. */
int
-statfs (path, fsb)
- char *path;
- struct statfs *fsb;
+statfs (char *path, struct statfs *fsb)
{
struct stat stats;
struct dustat fsd;
#ifdef F_CHSIZE
int
-ftruncate (fd, length)
- int fd;
- off_t length;
+ftruncate (int fd, off_t length)
{
return fcntl (fd, F_CHSIZE, length);
}
# endif
int
-ftruncate (fd, length)
- int fd;
- off_t length;
+ftruncate (int fd, off_t length)
{
struct flock fl;
struct stat filebuf;
# if HAVE_CHSIZE
int
-ftruncate (fd, length)
- int fd;
- off_t length;
+ftruncate (int fd, off_t length)
{
return chsize (fd, length);
}
# endif
int
-ftruncate (fd, length)
- int fd;
- off_t length;
+ftruncate (int fd, off_t length)
{
errno = EIO;
return -1;
/* getline.c -- Replacement for GNU C library function getline
-Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
+Copyright (C) 1993, 1996, 1997, 1998 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
#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);
}
null terminator), or -1 on error or EOF. */
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);
}
/* getversion.c -- select backup filename type
- Copyright (C) 1990 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1998 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
Unique abbreviations are accepted. */
enum backup_type
-get_version (version)
- char *version;
+get_version (const char *version)
{
int i;
return nonzero, else 0. */
int
-isdir (path)
- char *path;
+isdir (const char *path)
{
struct stat stats;
/* Work around bug on some systems where malloc (0) fails.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998 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 N is zero, allocate a 1-byte block. */
char *
-rpl_malloc (n)
- size_t n;
+rpl_malloc (size_t n)
{
if (n == 0)
n = 1;
__inline
# endif
static int
-memcmp_bytes (a, b)
- op_t a, b;
+memcmp_bytes (long unsigned int a, long unsigned int b)
{
long int srcp1 = (long int) &a;
long int srcp2 = (long int) &b;
__inline
#endif
static int
-memcmp_common_alignment (srcp1, srcp2, len)
- long int srcp1;
- long int srcp2;
- size_t len;
+memcmp_common_alignment (long int srcp1, long int srcp2, size_t len)
{
op_t a0, a1;
op_t b0, b1;
__inline
#endif
static int
-memcmp_not_common_alignment (srcp1, srcp2, len)
- long int srcp1;
- long int srcp2;
- size_t len;
+memcmp_not_common_alignment (long int srcp1, long int srcp2, size_t len)
{
op_t a0, a1, a2, a3;
op_t b0, b1, b2, b3;
}
int
-rpl_memcmp (s1, s2, len)
- const __ptr_t s1;
- const __ptr_t s2;
- size_t len;
+rpl_memcmp (const void *s1, const void *s2, size_t len)
{
op_t a0;
op_t b0;
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 int len)
{
register char *st = str;
/* BSD compatible make directory function for System V
- Copyright (C) 1988, 1990 Free Software Foundation, Inc.
+ Copyright (C) 1988, 1990, 1998 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
subroutine didn't return EEXIST. It does now. */
int
-mkdir (dpath, dmode)
- char *dpath;
- int dmode;
+mkdir (const char *dpath, int dmode)
{
int cpid, status;
struct stat statbuf;
are buggy. */
static struct tm *my_mktime_localtime_r __P ((const time_t *, struct tm *));
static struct tm *
-my_mktime_localtime_r (t, tp)
- const time_t *t;
- struct tm *tp;
+my_mktime_localtime_r (const time_t *t, struct tm *tp)
{
struct tm *l = localtime (t);
if (! l)
If TP is null, return a nonzero value.
If overflow occurs, yield the low order bits of the correct answer. */
static time_t
-ydhms_tm_diff (year, yday, hour, min, sec, tp)
- int year, yday, hour, min, sec;
- const struct tm *tp;
+ydhms_tm_diff (int year, int yday, int hour, int min, int sec,
+ const struct tm *tp)
{
if (!tp)
return 1;
/* Convert *TP to a time_t value. */
time_t
-mktime (tp)
- struct tm *tp;
+mktime (struct tm *tp)
{
#ifdef _LIBC
/* POSIX.1 8.1.1 requires that whenever mktime() is called, the
If *T is out of range for conversion, adjust it so that
it is the nearest in-range value and then convert that. */
static struct tm *
-ranged_convert (convert, t, tp)
- struct tm *(*convert) __P ((const time_t *, struct tm *));
- time_t *t;
- struct tm *tp;
+ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
+ time_t *t, struct tm *tp)
{
struct tm *r;
compared to what the result would be for UTC without leap seconds.
If *OFFSET's guess is correct, only one CONVERT call is needed. */
time_t
-__mktime_internal (tp, convert, offset)
- struct tm *tp;
- struct tm *(*convert) __P ((const time_t *, struct tm *));
- time_t *offset;
+__mktime_internal (struct tm *tp,
+ struct tm *(*convert) (const time_t *, struct tm *),
+ time_t *offset)
{
time_t t, dt, t0, t1, t2;
struct tm tm;
BASE in the returned concatenation. */
char *
-path_concat (dir, base, base_in_result)
- const char *dir;
- const char *base;
- char **base_in_result;
+path_concat (const char *dir, const char *base, char **base_in_result)
{
char *p;
char *p_concat;
Return 0 if successful, -1 if not. */
int
-rename (from, to)
- char *from;
- char *to;
+rename (char *from, char *to)
{
struct stat from_stats, to_stats;
int pid, status;
#endif
static int
-try (response, pattern, match, nomatch, lastp, re)
- const char *response;
- const char *pattern;
- const int match;
- const int nomatch;
- const char **lastp;
- regex_t *re;
+try (const char *response, const char *pattern, const int match, const int nomatch, const char **lastp, regex_t *re)
{
if (pattern != *lastp)
{
int
-rpmatch (response)
- const char *response;
+rpmatch (const char *response)
{
/* Match against one of the response patterns, compiling the pattern
first if necessary. */
called, but doing so is ok. Otherwise, return zero. */
int
-save_cwd (cwd)
- struct saved_cwd *cwd;
+save_cwd (struct saved_cwd *cwd)
{
static int have_working_fchdir = 1;
*/
int
-restore_cwd (cwd, dest, from)
- const struct saved_cwd *cwd;
- const char *dest;
- const char *from;
+restore_cwd (const struct saved_cwd *cwd, const char *dest, const char *from)
{
int fail = 0;
if (cwd->desc >= 0)
}
void
-free_cwd (cwd)
- struct saved_cwd *cwd;
+free_cwd (struct saved_cwd *cwd)
{
if (cwd->desc >= 0)
close (cwd->desc);
Return NULL if DIR cannot be opened or if out of memory. */
char *
-savedir (dir, name_size)
- const char *dir;
- unsigned int name_size;
+savedir (const char *dir, unsigned int name_size)
{
DIR *dirp;
struct dirent *dp;
/* 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;
or 0 if out of memory. */
char *
-strdup (str)
- const char *str;
+strdup (const char *str)
{
char *newstr;
# if ! HAVE_TM_GMTOFF
static struct tm *my_strftime_gmtime_r __P ((const time_t *, struct tm *));
static struct tm *
-my_strftime_gmtime_r (t, tp)
- const time_t *t;
- struct tm *tp;
+my_strftime_gmtime_r (const time_t *t, struct tm *tp)
{
struct tm *l = gmtime (t);
if (! l)
static struct tm *my_strftime_localtime_r __P ((const time_t *, struct tm *));
static struct tm *
-my_strftime_localtime_r (t, tp)
- const time_t *t;
- struct tm *tp;
+my_strftime_localtime_r (const time_t *t, struct tm *tp)
{
struct tm *l = localtime (t);
if (! l)
static char *memcpy_lowcase __P ((char *dest, const char *src, size_t len));
static char *
-memcpy_lowcase (dest, src, len)
- char *dest;
- const char *src;
- size_t len;
+memcpy_lowcase (char *dest, const char *src, size_t len)
{
while (len-- > 0)
dest[len] = TOLOWER ((unsigned char) src[len]);
static char *memcpy_uppcase __P ((char *dest, const char *src, size_t len));
static char *
-memcpy_uppcase (dest, src, len)
- char *dest;
- const char *src;
- size_t len;
+memcpy_uppcase (char *dest, const char *src, size_t len)
{
while (len-- > 0)
dest[len] = TOUPPER ((unsigned char) src[len]);
# define tm_diff ftime_tm_diff
static int tm_diff __P ((const struct tm *, const struct tm *));
static int
-tm_diff (a, b)
- const struct tm *a;
- const struct tm *b;
+tm_diff (const struct tm *a, const struct tm *b)
{
/* Compute intervening leap days correctly even if year is negative.
Take care to avoid int overflow in leap day calculations,
__inline__
#endif
static int
-iso_week_days (yday, wday)
- int yday;
- int wday;
+iso_week_days (int yday, int wday)
{
/* Add enough to the first operand of % to make it nonnegative. */
int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7;
anywhere, so to determine how many characters would be
written, use NULL for S and (size_t) UINT_MAX for MAXSIZE. */
size_t
-my_strftime (s, maxsize, format, tp ut_argument)
- char *s;
- size_t maxsize;
- const char *format;
- const struct tm *tp;
- ut_argument_spec
+my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
+ ut_argument_spec)
{
int hour12 = tp->tm_hour;
#ifdef _NL_CURRENT
when given a path that ends in "/" (except for the root directory). */
void
-strip_trailing_slashes (path)
- char *path;
+strip_trailing_slashes (char *path)
{
int last;
/* Duplicate S, returning an identical malloc'd string. */
char *
-strndup (s, n)
- const char *s;
- size_t n;
+strndup (const char *s, size_t n)
{
char *new = malloc (n + 1);
typedef unsigned chartype;
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;
*/
int
-strverscmp (s1, s2)
- const char *s1;
- const char *s2;
+strverscmp (const char *s1, const char *s2)
{
const unsigned char *p1 = (const unsigned char *) s1;
const unsigned char *p2 = (const unsigned char *) s2;
otherwise return 0. */
static int
-is_number (str)
- const char *str;
+is_number (const char *str)
{
for (; *str; str++)
if (!isdigit (*str))
Return NULL if successful, a static error message string if not. */
const char *
-parse_user_spec (spec_arg, uid, gid, username_arg, groupname_arg)
- const char *spec_arg;
- uid_t *uid;
- gid_t *gid;
- char **username_arg, **groupname_arg;
+parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid, char **username_arg, char **groupname_arg)
{
static const char *tired = "virtual memory exhausted";
const char *error_msg;
/* xmalloc.c -- malloc with out of memory checking
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
+ Copyright (C) 1990-1997, 98 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
#endif
static void
-xalloc_fail ()
+xalloc_fail (void)
{
if (xalloc_fail_func)
(*xalloc_fail_func) ();
/* Allocate N bytes of memory dynamically, with error checking. */
void *
-xmalloc (n)
- size_t n;
+xmalloc (size_t n)
{
void *p;
If P is NULL, run xmalloc. */
void *
-xrealloc (p, n)
- void *p;
- size_t n;
+xrealloc (void *p, size_t n)
{
p = realloc (p, n);
if (p == 0)
/* 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;