* returns -1 (out of memory).
*/
int
-#ifdef __STDC__
easprintf(char **ret, const char *fmt, ...)
-#else
-easprintf(ret, fmt, va_alist)
- char **ret;
- const char *fmt;
- va_dcl
-#endif
{
int len;
va_list ap;
-#ifdef __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
len = vasprintf(ret, fmt, ap);
va_end(ap);
# include <stdlib.h>
# endif
#endif /* STDC_HEADERS */
-#ifdef __STDC__
-# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
+#include <stdarg.h>
#include "compat.h"
#include "logging.h"
#endif
void
-#ifdef __STDC__
audit_success(char **exec_args)
-#else
-audit_success(exec_args)
- const char **exec_args;
-#endif
{
#ifdef HAVE_BSM_AUDIT
bsm_audit_success(exec_args);
}
void
-#ifdef __STDC__
audit_failure(char **exec_args, char const *const fmt, ...)
-#else
-audit_failure(exec_args, fmt, va_alist)
- const char **exec_args;
- char const *const fmt;
- va_dcl
-#endif
{
va_list ap;
-#ifdef __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
#ifdef HAVE_BSM_AUDIT
bsm_audit_failure(exec_args, fmt, ap);
#endif
#include <compat.h>
#include "error.h"
-static void _warning __P((int, const char *, va_list));
- void cleanup __P((int));
+static void _warning(int, const char *, va_list);
+ void cleanup(int);
void
-#ifdef __STDC__
error(int eval, const char *fmt, ...)
-#else
-error(eval, fmt, va_alist)
- int eval;
- const char *fmt;
- va_dcl
-#endif
{
va_list ap;
-#ifdef __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
_warning(1, fmt, ap);
va_end(ap);
cleanup(0);
}
void
-#ifdef __STDC__
errorx(int eval, const char *fmt, ...)
-#else
-errorx(eval, fmt, va_alist)
- int eval;
- const char *fmt;
- va_dcl
-#endif
{
va_list ap;
-#ifdef __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
_warning(0, fmt, ap);
va_end(ap);
cleanup(0);
}
void
-#ifdef __STDC__
warning(const char *fmt, ...)
-#else
-warning(fmt, va_alist)
- const char *fmt;
- va_dcl
-#endif
{
va_list ap;
-#ifdef __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
_warning(1, fmt, ap);
va_end(ap);
}
void
-#ifdef __STDC__
warningx(const char *fmt, ...)
-#else
-warningx(fmt, va_alist)
- const char *fmt;
- va_dcl
-#endif
{
va_list ap;
-#ifdef __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
_warning(0, fmt, ap);
va_end(ap);
}
* Append strings to the buffer, expanding it as needed.
*/
void
-#ifdef __STDC__
lbuf_append_quoted(struct lbuf *lbuf, const char *set, ...)
-#else
-lbuf_append_quoted(lbuf, set, va_alist)
- struct lbuf *lbuf;
- const char *set;
- va_dcl
-#endif
{
va_list ap;
int len = 0;
char *cp, *s;
-#ifdef __STDC__
va_start(ap, set);
-#else
- va_start(ap);
-#endif
while ((s = va_arg(ap, char *)) != NULL) {
len += strlen(s);
for (cp = s; (cp = strpbrk(cp, set)) != NULL; cp++)
lbuf->buf = erealloc(lbuf->buf, lbuf->size);
}
-#ifdef __STDC__
va_start(ap, set);
-#else
- va_start(ap);
-#endif
/* Append each string. */
while ((s = va_arg(ap, char *)) != NULL) {
while ((cp = strpbrk(s, set)) != NULL) {
* Append strings to the buffer, expanding it as needed.
*/
void
-#ifdef __STDC__
lbuf_append(struct lbuf *lbuf, ...)
-#else
-lbuf_append(lbuf, va_alist)
- struct lbuf *lbuf;
- va_dcl
-#endif
{
va_list ap;
int len = 0;
char *s;
-#ifdef __STDC__
va_start(ap, lbuf);
-#else
- va_start(ap);
-#endif
while ((s = va_arg(ap, char *)) != NULL)
len += strlen(s);
va_end(ap);
lbuf->buf = erealloc(lbuf->buf, lbuf->size);
}
-#ifdef __STDC__
va_start(ap, lbuf);
-#else
- va_start(ap);
-#endif
/* Append each string. */
while ((s = va_arg(ap, char *)) != NULL) {
len = strlen(s);
#ifndef HAVE_TIMESPEC
# include <time.h>
#endif
-#ifdef __STDC__
-# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
+#include <stdarg.h>
#include <compat.h>
return(-1); \
}
-#ifdef __STDC__
-
#define DUMMY2(fn, t1, t2) \
int \
fn(t1 a1, t2 a2) \
fn(t1 a1, t2 a2, ...) \
DUMMY_BODY
-#else /* !__STDC__ */
-
-#define DUMMY2(fn, t1, t2) \
-int \
-fn(a1, a2) \
-t1 a1; t2 a2; \
-DUMMY_BODY
-
-#define DUMMY3(fn, t1, t2, t3) \
-int \
-fn(a1, a2, a3) \
-t1 a1; t2 a2; t3 a3; \
-DUMMY_BODY
-
-#define DUMMY_VA(fn, t1, t2) \
-int \
-fn(a1, a2, va_alist) \
-t1 a1; t2 a2; va_dcl \
-DUMMY_BODY
-
-#endif /* !__STDC__ */
-
DUMMY_VA(execl, const char *, const char *)
DUMMY_VA(_execl, const char *, const char *)
DUMMY_VA(__execl, const char *, const char *)