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
bsd_getopt (int argc, char **argv, char *shortopts)
bsd_getopt(int argc, char **argv, char *shortopts)
{
if (optreset == 1)
{
optreset = 0;
optind = 0;
}
if (optreset == 1) {
optreset = 0;
optind = 0;
}
return getopt (argc, argv, shortopts);
return getopt(argc, argv, shortopts);
}

View File

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

View File

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

View File

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