Reformat code to KNF

This commit is contained in:
Guillem Jover 2010-01-10 11:02:13 +01:00
parent 2872bfa151
commit abe0a4a7e6
4 changed files with 35 additions and 34 deletions

View File

@ -29,13 +29,12 @@
int optreset = 0; int optreset = 0;
int int
bsd_getopt (int argc, char **argv, char *shortopts) bsd_getopt(int argc, char **argv, char *shortopts)
{ {
if (optreset == 1) if (optreset == 1) {
{ optreset = 0;
optreset = 0; optind = 0;
optind = 0; }
}
return getopt (argc, argv, shortopts); return getopt(argc, argv, shortopts);
} }

View File

@ -29,44 +29,46 @@
#include <stdarg.h> #include <stdarg.h>
void void
warnc (int code, const char *format, ...) warnc(int code, const char *format, ...)
{ {
int tmp = errno; int tmp = errno;
va_list ap; va_list ap;
va_start (ap, format);
errno = code; va_start(ap, format);
warn (format, ap);
errno = tmp;
va_end (ap); errno = code;
warn(format, ap);
errno = tmp;
va_end(ap);
} }
void void
vwarnc (int code, const char *format, va_list ap) vwarnc(int code, const char *format, va_list ap)
{ {
int tmp = errno; int tmp = errno;
errno = code; errno = code;
vwarn (format, ap); vwarn(format, ap);
errno = tmp; errno = tmp;
} }
void void
errc (int status, int code, const char *format, ...) errc(int status, int code, const char *format, ...)
{ {
va_list ap; va_list ap;
va_start (ap, format);
errno = code; va_start(ap, format);
err (status, format, ap);
va_end (ap); errno = code;
err(status, format, ap);
va_end(ap);
} }
void void
verrc (int status, int code, const char *format, va_list ap) verrc(int status, int code, const char *format, va_list ap)
{ {
errno = code; errno = code;
verr (status, format, ap); verr(status, format, ap);
} }

View File

@ -32,7 +32,7 @@
#ifdef __GLIBC__ #ifdef __GLIBC__
char * char *
fgetln (FILE *stream, size_t *len) fgetln(FILE *stream, size_t *len)
{ {
static char *line = NULL; static char *line = NULL;
static size_t line_len = 0; static size_t line_len = 0;

View File

@ -33,13 +33,13 @@
static char *__progname = NULL; static char *__progname = NULL;
char * char *
getprogname () getprogname()
{ {
return __progname; return __progname;
} }
void void
setprogname (char *new) setprogname(char *new)
{ {
__progname = new; __progname = new;
} }