#include "long-options.h"
#include "error.h"
-char *basename ();
+char *basename __P ((char *));
void strip_trailing_slashes ();
-static void remove_suffix ();
+static void remove_suffix __P ((register char *name, register char *suffix));
/* The name this program was run with. */
char *program_name;
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
char *name;
consists entirely of SUFFIX. */
static void
-remove_suffix (name, suffix)
- register char *name, *suffix;
+remove_suffix (register char *name, register char *suffix)
{
register char *np, *sp;
time_t get_date ();
time_t posixtime ();
-static void show_date ();
-static void usage ();
+static void show_date __P ((const char *format, time_t when));
+static void usage __P (int status));
/* The name this program was run with, for error messages. */
char *program_name;
If any line cannot be parsed, return nonzero; otherwise return zero. */
static int
-batch_convert (input_filename, format)
- const char *input_filename;
- const char *format;
+batch_convert (const char *input_filename, const char *format)
{
int status;
FILE *in_stream;
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int optc;
const char *datestr = NULL;
standard output format (ctime style but with a timezone inserted). */
static void
-show_date (format, when)
- const char *format;
- time_t when;
+show_date (const char *format, time_t when)
{
struct tm *tm;
char *out = NULL;
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
char *program_name;
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
register char *path;
register char *slash;
char *program_name;
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
`-n', then don't print a trailing newline. We also support the
echo syntax from Version 9 unix systems. */
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int display_return = 1, do_v9 = 0;
int putenv ();
-static void usage ();
+static void usage __P ((int status));
extern char **environ;
};
void
-main (argc, argv, envp)
- register int argc;
- register char **argv;
- char **envp;
+main (register int argc, register char **argv, char **envp)
{
char *dummy_environ[1];
int optc;
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
char *strstr ();
char *xmalloc ();
-static VALUE *docolon ();
-static VALUE *eval ();
-static VALUE *int_value ();
-static VALUE *str_value ();
-static int isstring ();
-static int nextarg ();
-static int nomoreargs ();
-static int null ();
-static int toarith ();
-static void freev ();
-static void printv ();
-static void tostring ();
+static VALUE *docolon __P ((VALUE *sv, VALUE *pv));
+static VALUE *eval __P ((void));
+static VALUE *int_value __P ((int i));
+static VALUE *str_value __P ((char *s));
+static int isstring __P ((VALUE *v));
+static int nextarg __P ((char *str));
+static int nomoreargs __P ((void));
+static int null __P ((VALUE *v));
+static int toarith __P ((VALUE *v));
+static void freev __P ((VALUE *v));
+static void printv __P ((VALUE *v));
+static void tostring __P ((VALUE *v));
#ifdef EVAL_TRACE
static void trace ();
#endif
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
VALUE *v;
/* Return a VALUE for I. */
static VALUE *
-int_value (i)
- int i;
+int_value (int i)
{
VALUE *v;
/* Return a VALUE for S. */
static VALUE *
-str_value (s)
- char *s;
+str_value (char *s)
{
VALUE *v;
/* Free VALUE V, including structure components. */
static void
-freev (v)
- VALUE *v;
+freev (VALUE *v)
{
if (v->type == string)
free (v->u.s);
/* Print VALUE V. */
static void
-printv (v)
- VALUE *v;
+printv (VALUE *v)
{
switch (v->type)
{
/* Return nonzero if V is a null-string or zero-number. */
static int
-null (v)
- VALUE *v;
+null (VALUE *v)
{
switch (v->type)
{
/* Return nonzero if V is a string value. */
static int
-isstring (v)
- VALUE *v;
+isstring (VALUE *v)
{
return v->type == string;
}
/* Coerce V to a string value (can't fail). */
static void
-tostring (v)
- VALUE *v;
+tostring (VALUE *v)
{
char *temp;
/* Coerce V to an integer value. Return 1 on success, 0 on failure. */
static int
-toarith (v)
- VALUE *v;
+toarith (VALUE *v)
{
int i;
int neg;
STR must not be NULL. */
static int
-nextarg (str)
- char *str;
+nextarg (char *str)
{
if (*args == NULL)
return 0;
/* Return nonzero if there no more tokens. */
static int
-nomoreargs ()
+nomoreargs (void)
{
return *args == 0;
}
PV is the VALUE for the rhs (the pattern). */
static VALUE *
-docolon (sv, pv)
- VALUE *sv;
- VALUE *pv;
+docolon (VALUE *sv, VALUE *pv)
{
VALUE *v;
const char *errmsg;
/* Handle bare operands and ( expr ) syntax. */
static VALUE *
-eval7 ()
+eval7 (void)
{
VALUE *v;
/* Handle match, substr, index, and length keywords. */
static VALUE *
-eval6 ()
+eval6 (void)
{
VALUE *l;
VALUE *r;
Calls docolon to do the real work. */
static VALUE *
-eval5 ()
+eval5 (void)
{
VALUE *l;
VALUE *r;
/* Handle *, /, % operators. */
static VALUE *
-eval4 ()
+eval4 (void)
{
VALUE *l;
VALUE *r;
/* Handle +, - operators. */
static VALUE *
-eval3 ()
+eval3 (void)
{
VALUE *l;
VALUE *r;
/* Handle comparisons. */
static VALUE *
-eval2 ()
+eval2 (void)
{
VALUE *l;
VALUE *r;
/* Handle &. */
static VALUE *
-eval1 ()
+eval1 (void)
{
VALUE *l;
VALUE *r;
/* Handle |. */
static VALUE *
-eval ()
+eval (void)
{
VALUE *l;
VALUE *r;
char *program_name;
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
}
static int
-factor (n0, max_n_factors, factors)
- unsigned long n0;
- int max_n_factors;
- unsigned long *factors;
+factor (long unsigned int n0, int max_n_factors, long unsigned int *factors)
{
register unsigned long n = n0, d;
int n_factors = 0;
}
static void
-print_factors (n)
- unsigned long int n;
+print_factors (long unsigned int n)
{
unsigned long int factors[MAX_N_FACTORS];
int n_factors;
}
static void
-do_stdin ()
+do_stdin (void)
{
token_buffer tokenbuffer;
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
program_name = argv[0];
char *program_name;
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
char *hostname;
char *xmalloc ();
int getugroups ();
-static void print_user ();
-static void print_group ();
-static void print_group_list ();
-static void print_full_info ();
-static void usage ();
+static void print_user __P ((int uid));
+static void print_group __P ((int gid));
+static void print_group_list __P ((char *username));
+static void print_full_info __P ((char *username));
+static void usage __P ((int status));
/* The name this program was run with. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int optc;
/* Print the name or value of user ID UID. */
static void
-print_user (uid)
- int uid;
+print_user (int uid)
{
struct passwd *pwd = NULL;
/* Print the name or value of group ID GID. */
static void
-print_group (gid)
- int gid;
+print_group (int gid)
{
struct group *grp = NULL;
/* Print all of the distinct groups the user is in . */
static void
-print_group_list (username)
- char *username;
+print_group_list (char *username)
{
print_group (rgid);
if (egid != rgid)
/* Print all of the info about the user's user and group IDs. */
static void
-print_full_info (username)
- char *username;
+print_full_info (char *username)
{
struct passwd *pwd;
struct group *grp;
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
};
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
register char *cp;
int c;
#define GET_PRIORITY() getpriority (PRIO_PROCESS, 0)
#endif
-static int isinteger ();
-static void usage ();
+static int isinteger __P ((char *s));
+static void usage __P ((int status));
/* The name this program was run with. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int current_priority;
int adjustment = 0;
zero if not. */
static int
-isinteger (s)
- char *s;
+isinteger (char *s)
{
if (*s == '-' || *s == '+')
++s;
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
char *xstrdup ();
-static int validate_path ();
-static void usage ();
+static int validate_path __P ((char *path, int portability));
+static void usage __P ((int status));
/* The name this program was run with. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int exit_status = 0;
int check_portability = 0;
/* If PATH contains only portable characters, return 1, else 0. */
static int
-portable_chars_only (path)
- const char *path;
+portable_chars_only (const char *path)
{
const char *p;
2 if it doesn't exist. */
static int
-dir_ok (path)
- const char *path;
+dir_ok (const char *path)
{
struct stat stats;
Return 0 if all of these tests are successful, 1 if any fail. */
static int
-validate_path (path, portability)
- char *path;
- int portability;
+validate_path (char *path, int portability)
{
int path_max;
int last_elem; /* Nonzero if checking last element of path. */
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
extern char **environ;
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
char **env;
char *ep, *ap;
char *xmalloc ();
-static double xstrtod ();
-static int print_esc ();
-static int print_formatted ();
-static long xstrtol ();
-static unsigned long xstrtoul ();
-static void print_direc ();
-static void print_esc_char ();
-static void print_esc_string ();
-static void verify ();
+static double xstrtod __P ((char *s));
+static int print_esc __P ((char *escstart));
+static int print_formatted __P ((char *format, int argc, char **argv));
+static long xstrtol __P ((char *s));
+static unsigned long xstrtoul __P ((char *s));
+static void print_direc __P ((char *start, size_t length, int field_width, int precision, char *argument));
+static void print_esc_char __P ((char c));
+static void print_esc_string __P ((char *str));
+static void verify __P ((char *s, char *end));
/* The value to return to the calling program. */
static int exit_status;
char *program_name;
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
char *format;
int args_used;
Return the number of elements of ARGV used. */
static int
-print_formatted (format, argc, argv)
- char *format;
- int argc;
- char **argv;
+print_formatted (char *format, int argc, char **argv)
{
int save_argc = argc; /* Preserve original value. */
char *f; /* Pointer into `format'. */
besides the backslash. */
static int
-print_esc (escstart)
- char *escstart;
+print_esc (char *escstart)
{
register char *p = escstart + 1;
int esc_value = 0; /* Value of \nnn escape. */
/* Output a single-character \ escape. */
static void
-print_esc_char (c)
- char c;
+print_esc_char (char c)
{
switch (c)
{
/* Print string STR, evaluating \ escapes. */
static void
-print_esc_string (str)
- char *str;
+print_esc_string (char *str)
{
for (; *str; str++)
if (*str == '\\')
'*' values in those fields. */
static void
-print_direc (start, length, field_width, precision, argument)
- char *start;
- size_t length;
- int field_width;
- int precision;
- char *argument;
+print_direc (char *start, size_t length, int field_width, int precision, char *argument)
{
char *p; /* Null-terminated copy of % directive. */
}
static unsigned long
-xstrtoul (s)
- char *s;
+xstrtoul (char *s)
{
char *end;
unsigned long val;
}
static long
-xstrtol (s)
- char *s;
+xstrtol (char *s)
{
char *end;
long val;
}
static double
-xstrtod (s)
- char *s;
+xstrtod (char *s)
{
char *end;
double val;
}
static void
-verify (s, end)
- char *s, *end;
+verify (char *s, char *end)
{
if (errno)
{
char *program_name;
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
char *wd;
#include "error.h"
#include "version.h"
-static double scan_double_arg ();
-static int check_format ();
-static char *get_width_format ();
-static int print_numbers ();
+static double scan_double_arg __P ((char *arg));
+static int check_format __P ((char *format_string));
+static char *get_width_format __P ((void));
+static int print_numbers __P ((char *format_str));
/* If nonzero print all number with equal width. */
static int equal_width;
};
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
(void) fprintf (stderr, _("Try `%s --help' for more information.\n"),
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int errs;
int optc;
Return if the string is correct else signal error. */
static double
-scan_double_arg (arg)
- char *arg;
+scan_double_arg (char *arg)
{
char *end_ptr;
double ret_val;
Return 0 if not, 1 if correct. */
static int
-check_format (format_string)
- char *format_string;
+check_format (char *format_string)
{
while (*format_string != '\0')
{
#else /* one of the math functions rint, modf, floor is missing. */
static char *
-get_width_format ()
+get_width_format (void)
{
/* We cannot compute the needed information to determine the correct
answer. So we simply return a value that works for all cases. */
/* Actually print the sequence of numbers in the specified range, with the
given or default stepping and format. */
static int
-print_numbers (format_str)
- char *format_str;
+print_numbers (char *format_str)
{
if (from > last)
{
#include "system.h"
#include "error.h"
-static long argdecode ();
+static long argdecode __P ((char *s));
/* The name by which this program was run. */
char *program_name;
};
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int i;
unsigned seconds = 0;
}
static long
-argdecode (s)
- char *s;
+argdecode (char *s)
{
long value;
register char *p = s;
char *xmalloc ();
int full_write ();
-static int tee ();
+static int tee __P ((int nfiles, const char **files));
/* If nonzero, append to output files rather than truncating them. */
static int append;
};
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int errs;
int optc;
Return 0 if successful, 1 if any errors occur. */
static int
-tee (nfiles, files)
- int nfiles;
- const char **files;
+tee (int nfiles, const char **files)
{
int *descriptors;
char buffer[BUFSIZ];
# define member(c, s) ((c) ? (strchr ((s), (c)) ? 1 : 0) : 0)
#endif /* !member */
-extern gid_t getgid (), getegid ();
-extern uid_t geteuid ();
+extern gid_t getgid (void), getegid (void);
+extern uid_t geteuid (void);
#if !defined (R_OK)
#define R_OK 4
static int argc; /* The number of arguments present in ARGV. */
static char **argv; /* The argument list. */
-static int unop ();
-static int binop ();
-static int unary_operator ();
-static int binary_operator ();
-static int two_arguments ();
-static int three_arguments ();
-static int posixtest ();
+static int unop __P ((int op));
+static int binop __P ((char *s));
+static int unary_operator __P ((void));
+static int binary_operator __P ((void));
+static int two_arguments __P ((void));
+static int three_arguments __P ((void));
+static int posixtest __P ((void));
-static int expr ();
-static int term ();
-static int and ();
-static int or ();
+static int expr __P ((void));
+static int term __P ((void));
+static int and __P ((void));
+static int or __P ((void));
#if __GNUC__ >= 2 && defined (__GNUC_MINOR__) \
&& __GNUC_MINOR__ >= 5 && !defined (__STRICT_ANSI__)
#define NO_RETURN_ATTRIBUTE /* empty */
#endif
-static void test_syntax_error () NO_RETURN_ATTRIBUTE;
-static void beyond () NO_RETURN_ATTRIBUTE;
+static void test_syntax_error (char *format, char *arg) NO_RETURN_ATTRIBUTE;
+static void beyond (void) NO_RETURN_ATTRIBUTE;
static void
-test_syntax_error (format, arg)
- char *format, *arg;
+test_syntax_error (char *format, char *arg)
{
fprintf (stderr, "%s: ", argv[0]);
fprintf (stderr, format, arg);
/* A wrapper for stat () which disallows pathnames that are empty strings. */
static int
-test_stat (path, finfo)
- char *path;
- struct stat *finfo;
+test_stat (char *path, struct stat *finfo)
{
if (*path == '\0')
{
and don't make the mistake of telling root that any file is executable.
But this loses when the containing filesystem is mounted e.g. read-only. */
static int
-eaccess (path, mode)
- char *path;
- int mode;
+eaccess (char *path, int mode)
{
struct stat st;
static int euid = -1;
* error condition)
*/
static void
-beyond ()
+beyond (void)
{
test_syntax_error (_("argument expected\n"), NULL);
}
/* Syntax error for when an integer argument was expected, but
something else was found. */
static void
-integer_expected_error (pch)
- char *pch;
+integer_expected_error (char *pch)
{
test_syntax_error (_("integer expression expected %s\n"), pch);
}
valid number. Stuff the converted number into RESULT if RESULT is
a non-null pointer to a long. */
static int
-isint (string, result)
- register char *string;
- long *result;
+isint (register char *string, long int *result)
{
int sign;
long value;
/* Find the modification time of FILE, and stuff it into AGE, a pointer
to a long. Return nonzero if successful, else zero. */
static int
-age_of (filename, age)
- char *filename;
- long *age;
+age_of (char *filename, long int *age)
{
struct stat finfo;
* positive and negative integers
*/
static int
-term ()
+term (void)
{
int value;
}
static int
-binary_operator ()
+binary_operator (void)
{
register int op;
struct stat stat_buf, stat_spare;
}
static int
-unary_operator ()
+unary_operator (void)
{
long r, value;
struct stat stat_buf;
* term '-a' and
*/
static int
-and ()
+and (void)
{
int value;
* and '-o' or
*/
static int
-or ()
+or (void)
{
int value;
* or
*/
static int
-expr ()
+expr (void)
{
if (pos >= argc)
beyond ();
/* Return TRUE if S is one of the test command's binary operators. */
static int
-binop (s)
- char *s;
+binop (char *s)
{
return ((STREQ (s, "=")) || (STREQ (s, "!=")) || (STREQ (s, "-nt")) ||
(STREQ (s, "-ot")) || (STREQ (s, "-ef")) || (STREQ (s, "-eq")) ||
/* Return nonzero if OP is one of the test command's unary operators. */
static int
-unop (op)
- int op;
+unop (int op)
{
return (member (op, "abcdefgkLhprsStuwxOGnz"));
}
static int
-two_arguments ()
+two_arguments (void)
{
int value;
}
static int
-three_arguments ()
+three_arguments (void)
{
int value;
/* This is an implementation of a Posix.2 proposal by David Korn. */
static int
-posixtest ()
+posixtest (void)
{
int value;
#include "long-options.h"
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
#include "version.h"
#include "error.h"
-static void usage ();
+static void usage __P ((int status));
/* The name under which this program was run. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
char *tty;
int optc;
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
#include "version.h"
#include "error.h"
-static void print_element ();
-static void usage ();
+static void print_element __P ((unsigned char mask, char *element));
+static void usage __P ((int status));
/* Values that are bitwise or'd into `toprint'. */
/* Operating system name. */
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
struct utsname name;
int c;
be printed, in which case print a newline. */
static void
-print_element (mask, element)
- unsigned char mask;
- char *element;
+print_element (unsigned char mask, char *element)
{
if (toprint & mask)
{
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
};
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
}
void
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char **argv)
{
register struct passwd *pw;
register uid_t uid;
char *program_name;
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
program_name = argv[0];