diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2006-01-06 18:53:07 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2006-01-06 18:53:07 +0000 |
commit | 4f6f4abee953638d3409775c050227c9537c9e8c (patch) | |
tree | 38d3a984a5a051627704f25d9151930244be39c5 | |
parent | a835e97a88caf4a2d77874683640dd0e6c0225d1 (diff) |
Adapt things to use __type_t instead of _BSD_TYPE_T_
Add new sys/_types.h header
Include machine/_types.h or sys/_types.h where applicable
53 files changed, 480 insertions, 339 deletions
diff --git a/include/bsd_auth.h b/include/bsd_auth.h index 800ec13ccfb..31cb5af8d5f 100644 --- a/include/bsd_auth.h +++ b/include/bsd_auth.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bsd_auth.h,v 1.8 2002/08/30 08:50:01 espie Exp $ */ +/* $OpenBSD: bsd_auth.h,v 1.9 2006/01/06 18:53:04 millert Exp $ */ /*- * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved. @@ -37,6 +37,8 @@ #ifndef _BSD_AUTH_H_ #define _BSD_AUTH_H_ +#include <machine/_types.h> /* for __va_list */ + typedef struct auth_session_t auth_session_t; typedef enum { @@ -84,7 +86,7 @@ int auth_call(auth_session_t *, char *, ...) int auth_setdata(auth_session_t *, void *, size_t); int auth_setoption(auth_session_t *, char *, char *); int auth_setpwd(auth_session_t *, struct passwd *pwd); -void auth_set_va_list(auth_session_t *, _BSD_VA_LIST_); +void auth_set_va_list(auth_session_t *, __va_list); struct passwd *auth_getpwd(auth_session_t *); diff --git a/include/err.h b/include/err.h index 4878b7ea764..56d3b2881ad 100644 --- a/include/err.h +++ b/include/err.h @@ -1,4 +1,4 @@ -/* $OpenBSD: err.h,v 1.9 2003/06/02 19:34:12 millert Exp $ */ +/* $OpenBSD: err.h,v 1.10 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: err.h,v 1.11 1994/10/26 00:55:52 cgd Exp $ */ /*- @@ -40,28 +40,28 @@ * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one * of them here we may collide with the utility's includes. It's unreasonable * for utilities to have to include one of them to include err.h, so we get - * _BSD_VA_LIST_ from <machine/ansi.h> and use it. + * __va_list from <machine/_types.h> and use it. */ -#include <machine/ansi.h> #include <sys/cdefs.h> +#include <machine/_types.h> __BEGIN_DECLS __dead void err(int, const char *, ...) __attribute__((__format__ (printf, 2, 3))); -__dead void verr(int, const char *, _BSD_VA_LIST_) +__dead void verr(int, const char *, __va_list) __attribute__((__format__ (printf, 2, 0))); __dead void errx(int, const char *, ...) __attribute__((__format__ (printf, 2, 3))); -__dead void verrx(int, const char *, _BSD_VA_LIST_) +__dead void verrx(int, const char *, __va_list) __attribute__((__format__ (printf, 2, 0))); void warn(const char *, ...) __attribute__((__format__ (printf, 1, 2))); -void vwarn(const char *, _BSD_VA_LIST_) +void vwarn(const char *, __va_list) __attribute__((__format__ (printf, 1, 0))); void warnx(const char *, ...) __attribute__((__format__ (printf, 1, 2))); -void vwarnx(const char *, _BSD_VA_LIST_) +void vwarnx(const char *, __va_list) __attribute__((__format__ (printf, 1, 0))); /* @@ -70,19 +70,19 @@ void vwarnx(const char *, _BSD_VA_LIST_) */ __dead void _err(int, const char *, ...) __attribute__((__format__ (printf, 2, 3))); -__dead void _verr(int, const char *, _BSD_VA_LIST_) +__dead void _verr(int, const char *, __va_list) __attribute__((__format__ (printf, 2, 0))); __dead void _errx(int, const char *, ...) __attribute__((__format__ (printf, 2, 3))); -__dead void _verrx(int, const char *, _BSD_VA_LIST_) +__dead void _verrx(int, const char *, __va_list) __attribute__((__format__ (printf, 2, 0))); void _warn(const char *, ...) __attribute__((__format__ (printf, 1, 2))); -void _vwarn(const char *, _BSD_VA_LIST_) +void _vwarn(const char *, __va_list) __attribute__((__format__ (printf, 1, 0))); void _warnx(const char *, ...) __attribute__((__format__ (printf, 1, 2))); -void _vwarnx(const char *, _BSD_VA_LIST_) +void _vwarnx(const char *, __va_list) __attribute__((__format__ (printf, 1, 0))); __END_DECLS diff --git a/include/search.h b/include/search.h index 80a60db562d..4d596dad384 100644 --- a/include/search.h +++ b/include/search.h @@ -1,4 +1,4 @@ -/* $OpenBSD: search.h,v 1.7 2004/07/08 21:15:11 millert Exp $ */ +/* $OpenBSD: search.h,v 1.8 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: search.h,v 1.9 1995/08/08 21:14:45 jtc Exp $ */ /* @@ -10,11 +10,11 @@ #define _SEARCH_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif typedef struct entry { diff --git a/include/stddef.h b/include/stddef.h index 467a51edeb8..a2ec869e267 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stddef.h,v 1.8 2005/05/11 18:44:12 espie Exp $ */ +/* $OpenBSD: stddef.h,v 1.9 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: stddef.h,v 1.4 1994/10/26 00:56:26 cgd Exp $ */ /*- @@ -35,31 +35,33 @@ #ifndef _STDDEF_H_ #define _STDDEF_H_ -#include <machine/ansi.h> +#include <sys/cdefs.h> +#include <sys/_types.h> -typedef _BSD_PTRDIFF_T_ ptrdiff_t; +#ifndef _PTRDIFF_T_DEFINED_ +#define _PTRDIFF_T_DEFINED_ +typedef __ptrdiff_t ptrdiff_t; +#endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif -#ifdef _BSD_WCHAR_T_ /* in C++, wchar_t is a built-in type */ -#ifndef __cplusplus -typedef _BSD_WCHAR_T_ wchar_t; -#undef _BSD_WCHAR_T_ -#endif +#if !defined(_WCHAR_T_DEFINED_) && !defined(__cplusplus) +#define _WCHAR_T_DEFINED_ +typedef __wchar_t wchar_t; #endif -#ifdef _BSD_WINT_T_ -typedef _BSD_WINT_T_ wint_t; -#undef _BSD_WINT_T_ +#ifndef _WINT_T_DEFINED_ +#define _WINT_T_DEFINED_ +typedef __wint_t wint_t; #endif -#ifdef _BSD_MBSTATE_T_ -typedef _BSD_MBSTATE_T_ mbstate_t; -#undef _BSD_MBSTATE_T_ +#ifndef _MBSTATE_T_DEFINED_ +#define _MBSTATE_T_DEFINED_ +typedef __mbstate_t mbstate_t; #endif #ifndef NULL diff --git a/include/stdio.h b/include/stdio.h index 26d2f40cd04..daae349f18a 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdio.h,v 1.33 2005/12/13 00:35:22 millert Exp $ */ +/* $OpenBSD: stdio.h,v 1.34 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */ /*- @@ -39,21 +39,20 @@ #define _STDIO_H_ #include <sys/cdefs.h> +#include <sys/_types.h> #if __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE -#include <sys/types.h> +#include <sys/types.h> /* XXX should be removed */ #endif -#include <machine/ansi.h> - -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif -#ifdef _BSD_OFF_T_ -typedef _BSD_OFF_T_ off_t; -#undef _BSD_OFF_T_ +#ifndef _OFF_T_DEFINED_ +#define _OFF_T_DEFINED_ +typedef __off_t off_t; #endif #ifndef NULL @@ -258,26 +257,26 @@ int sscanf(const char *, const char *, ...); FILE *tmpfile(void); char *tmpnam(char *); int ungetc(int, FILE *); -int vfprintf(FILE *, const char *, _BSD_VA_LIST_); -int vprintf(const char *, _BSD_VA_LIST_); -int vsprintf(char *, const char *, _BSD_VA_LIST_); +int vfprintf(FILE *, const char *, __va_list); +int vprintf(const char *, __va_list); +int vsprintf(char *, const char *, __va_list); #if __ISO_C_VISIBLE >= 1999 || __BSD_VISIBLE int snprintf(char *, size_t, const char *, ...) __attribute__((__format__ (printf, 3, 4))) __attribute__((__nonnull__ (3))) __attribute__((__bounded__ (__string__,1,2))); -int vfscanf(FILE *, const char *, _BSD_VA_LIST_) +int vfscanf(FILE *, const char *, __va_list) __attribute__((__format__ (scanf, 2, 0))) __attribute__((__nonnull__ (2))); -int vscanf(const char *, _BSD_VA_LIST_) +int vscanf(const char *, __va_list) __attribute__((__format__ (scanf, 1, 0))) __attribute__((__nonnull__ (1))); -int vsnprintf(char *, size_t, const char *, _BSD_VA_LIST_) +int vsnprintf(char *, size_t, const char *, __va_list) __attribute__((__format__ (printf, 3, 0))) __attribute__((__nonnull__ (3))) __attribute__((__bounded__(__string__,1,2))); -int vsscanf(const char *, const char *, _BSD_VA_LIST_) +int vsscanf(const char *, const char *, __va_list) __attribute__((__format__ (scanf, 2, 0))) __attribute__((__nonnull__ (2))); #endif /* __ISO_C_VISIBLE >= 1999 || __BSD_VISIBLE */ @@ -346,7 +345,7 @@ int getw(FILE *); int putw(int, FILE *); void setbuffer(FILE *, char *, int); int setlinebuf(FILE *); -int vasprintf(char **, const char *, _BSD_VA_LIST_) +int vasprintf(char **, const char *, __va_list) __attribute__((__format__ (printf, 2, 0))) __attribute__((__nonnull__ (2))); __END_DECLS diff --git a/include/stdlib.h b/include/stdlib.h index ea714e429a7..5edd8236f73 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdlib.h,v 1.35 2005/12/13 00:35:22 millert Exp $ */ +/* $OpenBSD: stdlib.h,v 1.36 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */ /*- @@ -34,24 +34,22 @@ #ifndef _STDLIB_H_ #define _STDLIB_H_ -#include <machine/ansi.h> #include <sys/cdefs.h> -#if __BSD_VISIBLE /* for quad_t, etc. */ +#include <machine/_types.h> +#if __BSD_VISIBLE /* for quad_t, etc. (XXX - use protected types) */ #include <sys/types.h> #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif -#ifdef _BSD_WCHAR_T_ /* in C++, wchar_t is a built-in type */ -#ifndef __cplusplus -typedef _BSD_WCHAR_T_ wchar_t; -#endif -#undef _BSD_WCHAR_T_ +#if !defined(_WCHAR_T_DEFINED_) && !defined(__cplusplus) +#define _WCHAR_T_DEFINED_ +typedef __wchar_t wchar_t; #endif typedef struct { diff --git a/include/string.h b/include/string.h index 7a3c533702b..0c42e57a14c 100644 --- a/include/string.h +++ b/include/string.h @@ -1,4 +1,4 @@ -/* $OpenBSD: string.h,v 1.16 2005/12/13 00:35:22 millert Exp $ */ +/* $OpenBSD: string.h,v 1.17 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $ */ /*- @@ -36,11 +36,11 @@ #define _STRING_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif #ifndef NULL diff --git a/include/time.h b/include/time.h index 41ebba4a73a..dfaffabe1d7 100644 --- a/include/time.h +++ b/include/time.h @@ -1,4 +1,4 @@ -/* $OpenBSD: time.h,v 1.17 2005/12/13 00:35:22 millert Exp $ */ +/* $OpenBSD: time.h,v 1.18 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */ /* @@ -42,7 +42,7 @@ #define _TIME_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> #ifndef NULL #ifdef __GNUG__ @@ -52,19 +52,19 @@ #endif #endif -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ +#ifndef _CLOCK_T_DEFINED_ +#define _CLOCK_T_DEFINED_ +typedef __clock_t clock_t; #endif -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _TIME_T_DEFINED_ +#define _TIME_T_DEFINED_ +typedef __time_t time_t; #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif #if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE diff --git a/include/utime.h b/include/utime.h index 3b85ff5902d..9fab94f8c16 100644 --- a/include/utime.h +++ b/include/utime.h @@ -1,4 +1,4 @@ -/* $OpenBSD: utime.h,v 1.5 2003/06/02 19:34:12 millert Exp $ */ +/* $OpenBSD: utime.h,v 1.6 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: utime.h,v 1.3 1994/10/26 00:56:39 cgd Exp $ */ /*- @@ -35,11 +35,12 @@ #ifndef _UTIME_H_ #define _UTIME_H_ -#include <machine/ansi.h> +#include <sys/cdefs.h> +#include <machine/_types.h> -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _TIME_T_DEFINED_ +#define _TIME_T_DEFINED_ +typedef __time_t time_t; #endif struct utimbuf { @@ -47,8 +48,6 @@ struct utimbuf { time_t modtime; /* Modification time */ }; -#include <sys/cdefs.h> - __BEGIN_DECLS int utime(const char *, const struct utimbuf *); __END_DECLS diff --git a/include/wchar.h b/include/wchar.h index b1a651e590b..90dbce5dada 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wchar.h,v 1.7 2005/12/19 17:05:20 millert Exp $ */ +/* $OpenBSD: wchar.h,v 1.8 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: wchar.h,v 1.16 2003/03/07 07:11:35 tshiozak Exp $ */ /*- @@ -67,7 +67,7 @@ #define _WCHAR_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <sys/_types.h> #ifndef NULL #ifdef __GNUG__ @@ -79,26 +79,24 @@ #include <stdio.h> /* for FILE* */ -#ifdef _BSD_WCHAR_T_ -# ifndef __cplusplus -typedef _BSD_WCHAR_T_ wchar_t; -# endif -#undef _BSD_WCHAR_T_ +#if !defined(_WCHAR_T_DEFINED_) && !defined(__cplusplus) +#define _WCHAR_T_DEFINED_ +typedef __wchar_t wchar_t; #endif -#ifdef _BSD_MBSTATE_T_ -typedef _BSD_MBSTATE_T_ mbstate_t; -#undef _BSD_MBSTATE_T_ +#ifndef _MBSTATE_T_DEFINED_ +#define _MBSTATE_T_DEFINED_ +typedef __mbstate_t mbstate_t; #endif -#ifdef _BSD_WINT_T_ -typedef _BSD_WINT_T_ wint_t; -#undef _BSD_WINT_T_ +#ifndef _WINT_T_DEFINED_ +#define _WINT_T_DEFINED_ +typedef __wint_t wint_t; #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif #ifndef WEOF diff --git a/include/wctype.h b/include/wctype.h index 051c2730a1b..5d4e55738e5 100644 --- a/include/wctype.h +++ b/include/wctype.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wctype.h,v 1.4 2005/07/01 08:59:27 espie Exp $ */ +/* $OpenBSD: wctype.h,v 1.5 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: wctype.h,v 1.5 2003/03/02 22:18:11 tshiozak Exp $ */ /*- @@ -33,21 +33,21 @@ #define _WCTYPE_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -#ifdef _BSD_WINT_T_ -typedef _BSD_WINT_T_ wint_t; -#undef _BSD_WINT_T_ +#ifndef _WINT_T_DEFINED_ +#define _WINT_T_DEFINED_ +typedef __wint_t wint_t; #endif -#ifdef _BSD_WCTRANS_T_ -typedef _BSD_WCTRANS_T_ wctrans_t; -#undef _BSD_WCTRANS_T_ +#ifndef _WCTRANS_T_DEFINED_ +#define _WCTRANS_T_DEFINED_ +typedef __wctrans_t wctrans_t; #endif -#ifdef _BSD_WCTYPE_T_ -typedef _BSD_WCTYPE_T_ wctype_t; -#undef _BSD_WCTYPE_T_ +#ifndef _WCTYPE_T_DEFINED_ +#define _WCTYPE_T_DEFINED_ +typedef __wctype_t wctype_t; #endif #ifndef WEOF diff --git a/lib/libc/stdio/vasprintf.c b/lib/libc/stdio/vasprintf.c index 7b56e507fbb..c3280c9fcd3 100644 --- a/lib/libc/stdio/vasprintf.c +++ b/lib/libc/stdio/vasprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vasprintf.c,v 1.12 2005/10/10 12:00:52 espie Exp $ */ +/* $OpenBSD: vasprintf.c,v 1.13 2006/01/06 18:53:04 millert Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -23,7 +23,7 @@ #include "local.h" int -vasprintf(char **str, const char *fmt, _BSD_VA_LIST_ ap) +vasprintf(char **str, const char *fmt, __va_list ap) { int ret; FILE f; diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index 57893187c9a..84e80889049 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfprintf.c,v 1.35 2005/12/19 19:43:01 millert Exp $ */ +/* $OpenBSD: vfprintf.c,v 1.36 2006/01/06 18:53:04 millert Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -150,7 +150,7 @@ static int exponent(char *, int, int); #define CHARINT 0x800 /* 8 bit integer */ int -vfprintf(FILE *fp, const char *fmt0, _BSD_VA_LIST_ ap) +vfprintf(FILE *fp, const char *fmt0, __va_list ap) { char *fmt; /* format string */ int ch; /* character from fmt */ diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c index fa3815d59ee..731a892f41f 100644 --- a/lib/libc/stdio/vfscanf.c +++ b/lib/libc/stdio/vfscanf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfscanf.c,v 1.17 2006/01/03 00:57:45 millert Exp $ */ +/* $OpenBSD: vfscanf.c,v 1.18 2006/01/06 18:53:04 millert Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -92,7 +92,7 @@ static u_char *__sccl(char *, u_char *); * vfscanf */ int -VFSCANF(FILE *fp, const char *fmt0, _BSD_VA_LIST_ ap) +VFSCANF(FILE *fp, const char *fmt0, __va_list ap) { u_char *fmt = (u_char *)fmt0; int c; /* character from format, or conversion */ diff --git a/lib/libc/stdio/vprintf.c b/lib/libc/stdio/vprintf.c index 42e01eaf5f1..fcc622ca799 100644 --- a/lib/libc/stdio/vprintf.c +++ b/lib/libc/stdio/vprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vprintf.c,v 1.7 2005/08/08 08:05:36 espie Exp $ */ +/* $OpenBSD: vprintf.c,v 1.8 2006/01/06 18:53:04 millert Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -34,7 +34,7 @@ #include <stdio.h> int -vprintf(const char *fmt, _BSD_VA_LIST_ ap) +vprintf(const char *fmt, __va_list ap) { return (vfprintf(stdout, fmt, ap)); } diff --git a/lib/libc/stdio/vscanf.c b/lib/libc/stdio/vscanf.c index c14ed80b692..228498e75cc 100644 --- a/lib/libc/stdio/vscanf.c +++ b/lib/libc/stdio/vscanf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vscanf.c,v 1.7 2005/08/08 08:05:36 espie Exp $ */ +/* $OpenBSD: vscanf.c,v 1.8 2006/01/06 18:53:04 millert Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -34,7 +34,7 @@ #include <stdio.h> int -vscanf(const char *fmt, _BSD_VA_LIST_ ap) +vscanf(const char *fmt, __va_list ap) { return (vfscanf(stdin, fmt, ap)); diff --git a/lib/libc/stdio/vsnprintf.c b/lib/libc/stdio/vsnprintf.c index 9064571c4d7..e6dd009d106 100644 --- a/lib/libc/stdio/vsnprintf.c +++ b/lib/libc/stdio/vsnprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vsnprintf.c,v 1.11 2005/10/10 12:00:52 espie Exp $ */ +/* $OpenBSD: vsnprintf.c,v 1.12 2006/01/06 18:53:04 millert Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -37,7 +37,7 @@ #include "local.h" int -vsnprintf(char *str, size_t n, const char *fmt, _BSD_VA_LIST_ ap) +vsnprintf(char *str, size_t n, const char *fmt, __va_list ap) { int ret; char dummy; diff --git a/lib/libc/stdio/vsprintf.c b/lib/libc/stdio/vsprintf.c index 0e3be8d7427..67a53a1bd5d 100644 --- a/lib/libc/stdio/vsprintf.c +++ b/lib/libc/stdio/vsprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vsprintf.c,v 1.12 2005/10/10 12:00:52 espie Exp $ */ +/* $OpenBSD: vsprintf.c,v 1.13 2006/01/06 18:53:04 millert Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -42,7 +42,7 @@ __warn_references(vsprintf, #endif int -vsprintf(char *str, const char *fmt, _BSD_VA_LIST_ ap) +vsprintf(char *str, const char *fmt, __va_list ap) { int ret; FILE f; diff --git a/lib/libc/stdio/vsscanf.c b/lib/libc/stdio/vsscanf.c index 52b241751c7..47c1ae61d73 100644 --- a/lib/libc/stdio/vsscanf.c +++ b/lib/libc/stdio/vsscanf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vsscanf.c,v 1.10 2005/08/08 08:05:36 espie Exp $ */ +/* $OpenBSD: vsscanf.c,v 1.11 2006/01/06 18:53:04 millert Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -44,7 +44,7 @@ eofread(void *cookie, char *buf, int len) } int -vsscanf(const char *str, const char *fmt, _BSD_VA_LIST_ ap) +vsscanf(const char *str, const char *fmt, __va_list ap) { FILE f; struct __sfileext fext; diff --git a/lib/libocurses/curses.h b/lib/libocurses/curses.h index b486b1b6fd1..4146c35bb5d 100644 --- a/lib/libocurses/curses.h +++ b/lib/libocurses/curses.h @@ -267,8 +267,8 @@ int suspendwin(void); int touchline(WINDOW *, int, int, int); int touchoverlap(WINDOW *, WINDOW *); int touchwin(WINDOW *); -int vwprintw(WINDOW *, const char *, _BSD_VA_LIST_); -int vwscanw(WINDOW *, const char *, _BSD_VA_LIST_); +int vwprintw(WINDOW *, const char *, __va_list); +int vwscanw(WINDOW *, const char *, __va_list); int waddch(WINDOW *, int); int waddnstr(WINDOW *, const char *, int); int wclear(WINDOW *); @@ -287,7 +287,7 @@ int wrefresh(WINDOW *); int wscanw(WINDOW *, const char *, ...); int wstandend(WINDOW *); int wstandout(WINDOW *); -int vwprintw(WINDOW *, const char *, _BSD_VA_LIST_); +int vwprintw(WINDOW *, const char *, __va_list); /* Private functions that are needed for user programs prototypes. */ void __cputchar(int); diff --git a/lib/libpthread/uthread/pthread_private.h b/lib/libpthread/uthread/pthread_private.h index bfb038aa671..83d87db2292 100644 --- a/lib/libpthread/uthread/pthread_private.h +++ b/lib/libpthread/uthread/pthread_private.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pthread_private.h,v 1.54 2005/10/30 03:37:34 brad Exp $ */ +/* $OpenBSD: pthread_private.h,v 1.55 2006/01/06 18:53:04 millert Exp $ */ /* * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>. * All rights reserved. @@ -1236,12 +1236,12 @@ int _thread_sys_snprintf(char *, size_t, const char *, ...); int _thread_sys_sprintf(char *, const char *, ...); int _thread_sys_sscanf(const char *, const char *, ...); int _thread_sys_ungetc(int, FILE *); -int _thread_sys_vfprintf(FILE *, const char *, _BSD_VA_LIST_); -int _thread_sys_vprintf(const char *, _BSD_VA_LIST_); -int _thread_sys_vscanf(const char *, _BSD_VA_LIST_); -int _thread_sys_vsnprintf(char *, size_t, const char *, _BSD_VA_LIST_); -int _thread_sys_vsprintf(char *, const char *, _BSD_VA_LIST_); -int _thread_sys_vsscanf(const char *, const char *, _BSD_VA_LIST_); +int _thread_sys_vfprintf(FILE *, const char *, __va_list); +int _thread_sys_vprintf(const char *, __va_list); +int _thread_sys_vscanf(const char *, __va_list); +int _thread_sys_vsnprintf(char *, size_t, const char *, __va_list); +int _thread_sys_vsprintf(char *, const char *, __va_list); +int _thread_sys_vsscanf(const char *, const char *, __va_list); long _thread_sys_ftell(FILE *); size_t _thread_sys_fread(void *, size_t, size_t, FILE *); size_t _thread_sys_fwrite(const void *, size_t, size_t, FILE *); diff --git a/lib/libpthread/uthread/uthread_stack.c b/lib/libpthread/uthread/uthread_stack.c index 6e359b970fb..003ca2beb2a 100644 --- a/lib/libpthread/uthread/uthread_stack.c +++ b/lib/libpthread/uthread/uthread_stack.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_stack.c,v 1.7 2000/03/22 02:06:05 d Exp $ */ +/* $OpenBSD: uthread_stack.c,v 1.8 2006/01/06 18:53:04 millert Exp $ */ /* * Copyright 1999, David Leonard. All rights reserved. * <insert BSD-style license&disclaimer> @@ -70,19 +70,19 @@ _thread_stack_alloc(base, size) /* * Compute the location of the red zone. - * Use _BSD_PTRDIFF_T_ to convert the storage base pointer + * Use __ptrdiff_t to convert the storage base pointer * into an integer so that page alignment can be done with * integer arithmetic. */ #if defined(MACHINE_STACK_GROWS_UP) /* Red zone is the last page of the storage: */ - stack->redzone = (void *)(((_BSD_PTRDIFF_T_)stack->storage + + stack->redzone = (void *)(((__ptrdiff_t)stack->storage + size + nbpg - 1) & ~(nbpg - 1)); stack->base = (caddr_t)stack->storage; stack->size = size; #else /* Red zone is the first page of the storage: */ - stack->redzone = (void *)(((_BSD_PTRDIFF_T_)stack->storage + + stack->redzone = (void *)(((__ptrdiff_t)stack->storage + nbpg - 1) & ~(nbpg - 1)); stack->base = (caddr_t)stack->redzone + nbpg; stack->size = size; diff --git a/sys/arch/alpha/include/stdarg.h b/sys/arch/alpha/include/stdarg.h index 3d64c0fb39e..03b50b40166 100644 --- a/sys/arch/alpha/include/stdarg.h +++ b/sys/arch/alpha/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.8 2005/12/14 23:51:32 deraadt Exp $ */ +/* $OpenBSD: stdarg.h,v 1.9 2006/01/06 18:53:04 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.4 1996/10/09 21:13:05 cgd Exp $ */ /*- @@ -36,9 +36,9 @@ #define _ALPHA_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #define __va_size(type) \ (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) diff --git a/sys/arch/amd64/include/stdarg.h b/sys/arch/amd64/include/stdarg.h index 370b624166f..feeb97970a7 100644 --- a/sys/arch/amd64/include/stdarg.h +++ b/sys/arch/amd64/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.3 2005/12/14 21:46:30 millert Exp $ */ +/* $OpenBSD: stdarg.h,v 1.4 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.2 2003/04/28 23:16:17 bjh21 Exp $ */ /*- @@ -36,17 +36,28 @@ #define _AMD64_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> /* for __va_list */ -typedef _BSD_VA_LIST_ va_list; +/* + * NOTE: this file is only used by lint and non-GNU compilers + */ + +typedef __va_list va_list; + +#define __va_size(type) \ + (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) -#define va_start(ap, last) __builtin_stdarg_start((ap), (last)) -#define va_arg __builtin_va_arg -#define va_end(ap) __builtin_va_end(ap) -#define __va_copy(dest, src) __builtin_va_copy((dest), (src)) +#define va_start(ap, last) \ + ((ap) = (va_list)&(last) + __va_size(last)) + +#define va_arg(ap, type) \ + (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) #if __ISO_C_VISIBLE >= 1999 -#define va_copy(dest, src) __va_copy((dest), (src)) +#define va_copy(dest, src) \ + ((dest) = (src)) #endif +#define va_end(ap) + #endif /* !_AMD64_STDARG_H_ */ diff --git a/sys/arch/arm/include/stdarg.h b/sys/arch/arm/include/stdarg.h index 4af3e313bb8..ad025c06942 100644 --- a/sys/arch/arm/include/stdarg.h +++ b/sys/arch/arm/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.4 2005/12/14 21:46:30 millert Exp $ */ +/* $OpenBSD: stdarg.h,v 1.5 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.7 2003/08/07 16:26:53 agc Exp $ */ /* @@ -36,9 +36,9 @@ #define _ARM32_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #ifdef __lint__ #define __builtin_next_arg(t) ((t) ? 0 : 0) #define __builtin_stdarg_start(a, l) ((a) = ((l) ? 0 : 0)) diff --git a/sys/arch/hppa/hppa/genassym.cf b/sys/arch/hppa/hppa/genassym.cf index 3942e2971fa..842af4daa32 100644 --- a/sys/arch/hppa/hppa/genassym.cf +++ b/sys/arch/hppa/hppa/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.27 2005/04/21 04:39:35 mickey Exp $ +# $OpenBSD: genassym.cf,v 1.28 2006/01/06 18:53:05 millert Exp $ # # Copyright (c) 1982, 1990, 1993 @@ -42,7 +42,6 @@ include <sys/user.h> include <uvm/uvm.h> -include <machine/types.h> include <machine/cpu.h> include <machine/psl.h> include <machine/reg.h> diff --git a/sys/arch/hppa/include/stdarg.h b/sys/arch/hppa/include/stdarg.h index 3bfcc43f46c..712395bdcb5 100644 --- a/sys/arch/hppa/include/stdarg.h +++ b/sys/arch/hppa/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.6 2005/12/14 23:51:32 deraadt Exp $ */ +/* $OpenBSD: stdarg.h,v 1.7 2006/01/06 18:53:05 millert Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -35,8 +35,9 @@ #define _MACHINE_STDARG_H_ #include <sys/cdefs.h> +#include <machine/_types.h> -typedef double *va_list; +typedef __va_list va_list; #ifdef __GNUC__ #define va_start(ap,lastarg) ((ap) = (va_list)__builtin_saveregs()) diff --git a/sys/arch/hppa64/include/stdarg.h b/sys/arch/hppa64/include/stdarg.h index e8de77c5e4f..697d41a8b9f 100644 --- a/sys/arch/hppa64/include/stdarg.h +++ b/sys/arch/hppa64/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.3 2005/12/14 23:51:32 deraadt Exp $ */ +/* $OpenBSD: stdarg.h,v 1.4 2006/01/06 18:53:05 millert Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -35,8 +35,9 @@ #define _MACHINE_STDARG_H_ #include <sys/cdefs.h> +#include <machine/_types.h> -typedef double *va_list; +typedef __va_list va_list; #ifdef __GNUC__ #define va_start(ap,lastarg) ((ap) = (va_list)__builtin_saveregs()) diff --git a/sys/arch/i386/include/stdarg.h b/sys/arch/i386/include/stdarg.h index 473b059b105..4df981d3d9a 100644 --- a/sys/arch/i386/include/stdarg.h +++ b/sys/arch/i386/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.8 2005/12/14 23:51:32 deraadt Exp $ */ +/* $OpenBSD: stdarg.h,v 1.9 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.12 1995/12/25 23:15:31 mycroft Exp $ */ /*- @@ -36,9 +36,9 @@ #define _I386_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #define __va_size(type) \ (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) diff --git a/sys/arch/m68k/include/stdarg.h b/sys/arch/m68k/include/stdarg.h index cb457c20574..b6bc860cbb5 100644 --- a/sys/arch/m68k/include/stdarg.h +++ b/sys/arch/m68k/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.8 2005/12/14 23:51:32 deraadt Exp $ */ +/* $OpenBSD: stdarg.h,v 1.9 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.14 1995/12/25 23:15:33 mycroft Exp $ */ /*- @@ -36,9 +36,9 @@ #define _M68K_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #define __va_size(type) \ (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) diff --git a/sys/arch/m88k/include/stdarg.h b/sys/arch/m88k/include/stdarg.h index 2c918f9fe95..1b42ef6d009 100644 --- a/sys/arch/m88k/include/stdarg.h +++ b/sys/arch/m88k/include/stdarg.h @@ -1,9 +1,9 @@ -/* $OpenBSD: stdarg.h,v 1.1 2004/04/26 12:34:05 miod Exp $ */ +/* $OpenBSD: stdarg.h,v 1.2 2006/01/06 18:53:05 millert Exp $ */ #ifndef _M88K_STDARGS_H_ #define _M88K_STDARGS_H_ -#include <machine/ansi.h> +#include <machine/_types.h> #ifndef _STDARG_H #define _STDARG_H @@ -11,6 +11,6 @@ #include <machine/va-m88k.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #endif /* _M88K_STDARGS_H_ */ diff --git a/sys/arch/m88k/include/va-m88k.h b/sys/arch/m88k/include/va-m88k.h index 1920fdd8410..3b9665803c0 100644 --- a/sys/arch/m88k/include/va-m88k.h +++ b/sys/arch/m88k/include/va-m88k.h @@ -1,4 +1,4 @@ -/* $OpenBSD: va-m88k.h,v 1.7 2005/12/20 14:42:05 millert Exp $ */ +/* $OpenBSD: va-m88k.h,v 1.8 2006/01/06 18:53:05 millert Exp $ */ /* Define __gnuc_va_list. */ @@ -11,7 +11,7 @@ typedef struct __va_list_tag { unsigned int __va_arg; /* argument number */ unsigned int *__va_stk; /* start of args passed on stack */ unsigned int *__va_reg; /* start of args passed in regs */ -} __va_list[1], __gnuc_va_list[1]; +} __gnuc_va_list[1]; #endif /* not __GNUC_VA_LIST */ diff --git a/sys/arch/m88k/include/varargs.h b/sys/arch/m88k/include/varargs.h index 85a3d759cd0..a399f55b2a2 100644 --- a/sys/arch/m88k/include/varargs.h +++ b/sys/arch/m88k/include/varargs.h @@ -1,13 +1,13 @@ -/* $OpenBSD: varargs.h,v 1.1 2004/04/26 12:34:05 miod Exp $ */ +/* $OpenBSD: varargs.h,v 1.2 2006/01/06 18:53:05 millert Exp $ */ #ifndef _M88K_VARARGS_H_ #define _M88K_VARARGS_H_ #define _VARARGS_H -#include <machine/ansi.h> +#include <machine/_types.h> #include <machine/va-m88k.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #endif /* _M88K_VARARGS_H_ */ diff --git a/sys/arch/mips64/include/stdarg.h b/sys/arch/mips64/include/stdarg.h index 60e066da7d9..94450d105c0 100644 --- a/sys/arch/mips64/include/stdarg.h +++ b/sys/arch/mips64/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.4 2005/12/14 23:51:33 deraadt Exp $ */ +/* $OpenBSD: stdarg.h,v 1.5 2006/01/06 18:53:05 millert Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -35,9 +35,9 @@ #define _MIPS_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #ifndef __GNUC_VA_LIST #define __GNUC_VA_LIST diff --git a/sys/arch/powerpc/include/frame.h b/sys/arch/powerpc/include/frame.h index 674f7c2e9fa..4eda8735ee7 100644 --- a/sys/arch/powerpc/include/frame.h +++ b/sys/arch/powerpc/include/frame.h @@ -1,4 +1,4 @@ -/* $OpenBSD: frame.h,v 1.6 2005/08/02 21:02:49 drahn Exp $ */ +/* $OpenBSD: frame.h,v 1.7 2006/01/06 18:53:05 millert Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -33,8 +33,6 @@ #ifndef _POWERPC_FRAME_H_ #define _POWERPC_FRAME_H_ -#include <machine/types.h> - /* * This is to ensure alignment of the stackpointer */ diff --git a/sys/arch/powerpc/include/signal.h b/sys/arch/powerpc/include/signal.h index d25ec5e6fe6..89f2bb0dc84 100644 --- a/sys/arch/powerpc/include/signal.h +++ b/sys/arch/powerpc/include/signal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: signal.h,v 1.5 2005/12/14 21:46:31 millert Exp $ */ +/* $OpenBSD: signal.h,v 1.6 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: signal.h,v 1.1 1996/09/30 16:34:34 ws Exp $ */ /* @@ -39,7 +39,7 @@ typedef int sig_atomic_t; #if __BSD_VISIBLE -#include <machine/types.h> +#include <machine/_types.h> /* * We have to save all registers on every trap, because @@ -51,16 +51,16 @@ typedef int sig_atomic_t; * */ struct trapframe { - u_int32_t fixreg[32]; - u_int32_t lr; - u_int32_t cr; - u_int32_t xer; - u_int32_t ctr; + __register_t fixreg[32]; + __register_t lr; + __register_t cr; + __register_t xer; + __register_t ctr; int srr0; int srr1; int dar; /* dar & dsisr are only filled on a DSI trap */ int dsisr; - u_int32_t exc; + __register_t exc; }; struct sigcontext { diff --git a/sys/arch/powerpc/include/stdarg.h b/sys/arch/powerpc/include/stdarg.h index 9c23da50f7e..76e3cda1d08 100644 --- a/sys/arch/powerpc/include/stdarg.h +++ b/sys/arch/powerpc/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.5 2003/06/02 23:27:53 millert Exp $ */ +/* $OpenBSD: stdarg.h,v 1.6 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.1 1996/09/30 16:34:35 ws Exp $ */ /*- @@ -35,13 +35,13 @@ #ifndef _POWERPC_STDARG_H_ #define _POWERPC_STDARG_H_ -#include <machine/ansi.h> +#include <machine/_types.h> #ifndef _STDARG_H #define _STDARG_H #endif #include <machine/va-ppc.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #endif /* !_POWERPC_STDARG_H_ */ diff --git a/sys/arch/powerpc/include/va-ppc.h b/sys/arch/powerpc/include/va-ppc.h index 028bae06382..86353c6b2ef 100644 --- a/sys/arch/powerpc/include/va-ppc.h +++ b/sys/arch/powerpc/include/va-ppc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: va-ppc.h,v 1.11 2005/12/14 21:46:31 millert Exp $ */ +/* $OpenBSD: va-ppc.h,v 1.12 2006/01/06 18:53:05 millert Exp $ */ /* GNU C varargs support for the PowerPC with either the V.4 or Windows NT calling sequences */ #include <sys/cdefs.h> @@ -29,7 +29,7 @@ typedef struct __va_list_tag { char *overflow_arg_area; /* location on stack that holds the next overflow argument */ char *reg_save_area; /* where r3:r10 and f1:f8, if saved are stored */ -} __va_list[1], __gnuc_va_list[1]; +} __gnuc_va_list[1]; #else /* _SYS_VA_LIST */ diff --git a/sys/arch/powerpc/include/varargs.h b/sys/arch/powerpc/include/varargs.h index 4330af8f837..e17efff0df7 100644 --- a/sys/arch/powerpc/include/varargs.h +++ b/sys/arch/powerpc/include/varargs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: varargs.h,v 1.4 2003/06/02 23:27:53 millert Exp $ */ +/* $OpenBSD: varargs.h,v 1.5 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: varargs.h,v 1.1 1996/09/30 16:34:37 ws Exp $ */ /*- @@ -42,9 +42,9 @@ #define _VARARGS_H -#include <machine/ansi.h> +#include <machine/_types.h> #include <machine/va-ppc.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #endif /* !_POWERPC_VARARGS_H_ */ diff --git a/sys/arch/sparc/include/stdarg.h b/sys/arch/sparc/include/stdarg.h index bbddc6e4914..fe878fec5d4 100644 --- a/sys/arch/sparc/include/stdarg.h +++ b/sys/arch/sparc/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.11 2005/12/15 13:44:52 millert Exp $ */ +/* $OpenBSD: stdarg.h,v 1.12 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.10 1996/12/27 20:55:28 pk Exp $ */ /* @@ -45,13 +45,13 @@ #define _SPARC_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> #ifdef __lint__ #define __builtin_classify_type(t) (0) #endif -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #define __va_size(type) \ (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) diff --git a/sys/arch/sparc64/include/bus.h b/sys/arch/sparc64/include/bus.h index 14f61133f02..38ab7a81f64 100644 --- a/sys/arch/sparc64/include/bus.h +++ b/sys/arch/sparc64/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.17 2005/07/10 00:23:11 brad Exp $ */ +/* $OpenBSD: bus.h,v 1.18 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: bus.h,v 1.31 2001/09/21 15:30:41 wiz Exp $ */ /*- @@ -73,7 +73,6 @@ #ifndef _SPARC_BUS_H_ #define _SPARC_BUS_H_ -#include <machine/types.h> #include <machine/ctlreg.h> /* diff --git a/sys/arch/sparc64/include/stdarg.h b/sys/arch/sparc64/include/stdarg.h index 58e56a19799..cd01cc9b967 100644 --- a/sys/arch/sparc64/include/stdarg.h +++ b/sys/arch/sparc64/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.4 2005/12/14 21:46:31 millert Exp $ */ +/* $OpenBSD: stdarg.h,v 1.5 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.11 2000/07/23 21:36:56 mycroft Exp $ */ /* @@ -45,7 +45,7 @@ #define _SPARC64_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> #ifdef __lint__ #define __builtin_saveregs(t) (0) @@ -53,7 +53,7 @@ #define __builtin_next_arg(t) ((t) ? 0 : 0) #endif -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #define va_start(ap, last) \ (__builtin_next_arg(last), (ap) = (va_list)__builtin_saveregs()) diff --git a/sys/arch/vax/include/stdarg.h b/sys/arch/vax/include/stdarg.h index 2ebf9dc7f26..b3aca7c0a8a 100644 --- a/sys/arch/vax/include/stdarg.h +++ b/sys/arch/vax/include/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.7 2005/12/14 21:46:31 millert Exp $ */ +/* $OpenBSD: stdarg.h,v 1.8 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stdarg.h,v 1.11 1999/05/03 16:30:34 christos Exp $ */ /*- @@ -36,9 +36,9 @@ #define _VAX_STDARG_H_ #include <sys/cdefs.h> -#include <machine/ansi.h> +#include <machine/_types.h> -typedef _BSD_VA_LIST_ va_list; +typedef __va_list va_list; #ifdef __lint__ #define __builtin_next_arg(t) ((t) ? 0 : 0) diff --git a/sys/lib/libsa/stand.h b/sys/lib/libsa/stand.h index e6522686309..92f9d3efa0f 100644 --- a/sys/lib/libsa/stand.h +++ b/sys/lib/libsa/stand.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stand.h,v 1.43 2004/01/03 14:08:53 espie Exp $ */ +/* $OpenBSD: stand.h,v 1.44 2006/01/06 18:53:05 millert Exp $ */ /* $NetBSD: stand.h,v 1.18 1996/11/30 04:35:51 gwr Exp $ */ /*- @@ -136,7 +136,7 @@ u_int dkcksum(struct disklabel *); void printf(const char *, ...); int snprintf(char *, size_t, const char *, ...); -void vprintf(const char *, _BSD_VA_LIST_); +void vprintf(const char *, __va_list); void twiddle(void); void gets(char *); __dead void panic(const char *, ...) __attribute__((noreturn)); diff --git a/sys/sys/_types.h b/sys/sys/_types.h new file mode 100644 index 00000000000..7a91283339b --- /dev/null +++ b/sys/sys/_types.h @@ -0,0 +1,69 @@ +/* $OpenBSD: _types.h,v 1.1 2006/01/06 18:53:05 millert Exp $ */ + +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)types.h 8.3 (Berkeley) 1/5/94 + */ + +#ifndef _SYS__TYPES_H_ +#define _SYS__TYPES_H_ + +#include <machine/_types.h> + +typedef unsigned long __cpuid_t; /* CPU id */ +typedef __int32_t __dev_t; /* device number */ +typedef __uint32_t __fixpt_t; /* fixed point number */ +typedef __uint32_t __gid_t; /* group id */ +typedef __uint32_t __id_t; /* may contain pid, uid or gid */ +typedef __uint32_t __in_addr_t; /* base type for internet address */ +typedef __uint16_t __in_port_t; /* IP port type */ +typedef __uint32_t __ino_t; /* inode number */ +typedef long __key_t; /* IPC key (for Sys V IPC) */ +typedef __uint32_t __mode_t; /* permissions */ +typedef __uint32_t __nlink_t; /* link count */ +typedef __int32_t __pid_t; /* process id */ +typedef __uint64_t __rlim_t; /* resource limit */ +typedef __uint8_t __sa_family_t; /* sockaddr address family type */ +typedef __int32_t __segsz_t; /* segment size */ +typedef __uint32_t __socklen_t; /* length type for network syscalls */ +typedef __int32_t __swblk_t; /* swap offset */ +typedef __uint32_t __uid_t; /* user id */ +typedef __uint32_t __useconds_t; /* microseconds */ +typedef __int32_t __suseconds_t; /* microseconds (signed) */ + +/* + * mbstate_t is an opaque object to keep conversion state, during multibyte + * stream conversions. The content must not be referenced by user programs. + */ +typedef union { + char __mbstate8[128]; + __int64_t __mbstateL; /* for alignment */ +} __mbstate_t; + +#endif /* !_SYS__TYPES_H_ */ diff --git a/sys/sys/endian.h b/sys/sys/endian.h index 5b3efae7554..14d79a68087 100644 --- a/sys/sys/endian.h +++ b/sys/sys/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.16 2005/12/14 18:28:40 millert Exp $ */ +/* $OpenBSD: endian.h,v 1.17 2006/01/06 18:53:05 millert Exp $ */ /*- * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. @@ -52,25 +52,25 @@ #ifdef __GNUC__ #define __swap16gen(x) __statement({ \ - u_int16_t __swap16gen_x = (x); \ + __uint16_t __swap16gen_x = (x); \ \ - (u_int16_t)((__swap16gen_x & 0xff) << 8 | \ + (__uint16_t)((__swap16gen_x & 0xff) << 8 | \ (__swap16gen_x & 0xff00) >> 8); \ }) #define __swap32gen(x) __statement({ \ - u_int32_t __swap32gen_x = (x); \ + __uint32_t __swap32gen_x = (x); \ \ - (u_int32_t)((__swap32gen_x & 0xff) << 24 | \ + (__uint32_t)((__swap32gen_x & 0xff) << 24 | \ (__swap32gen_x & 0xff00) << 8 | \ (__swap32gen_x & 0xff0000) >> 8 | \ (__swap32gen_x & 0xff000000) >> 24); \ }) #define __swap64gen(x) __statement({ \ - u_int64_t __swap64gen_x = (x); \ + __uint64_t __swap64gen_x = (x); \ \ - (u_int64_t)((__swap64gen_x & 0xff) << 56 | \ + (__uint64_t)((__swap64gen_x & 0xff) << 56 | \ (__swap64gen_x & 0xff00ULL) << 40 | \ (__swap64gen_x & 0xff0000ULL) << 24 | \ (__swap64gen_x & 0xff000000ULL) << 8 | \ @@ -84,22 +84,22 @@ /* Note that these macros evaluate their arguments several times. */ #define __swap16gen(x) \ - (u_int16_t)(((u_int16_t)(x) & 0xff) << 8 | ((u_int16_t)(x) & 0xff00) >> 8) + (__uint16_t)(((__uint16_t)(x) & 0xff) << 8 | ((__uint16_t)(x) & 0xff00) >> 8) #define __swap32gen(x) \ - (u_int32_t)(((u_int32_t)(x) & 0xff) << 24 | \ - ((u_int32_t)(x) & 0xff00) << 8 | ((u_int32_t)(x) & 0xff0000) >> 8 | \ - ((u_int32_t)(x) & 0xff000000) >> 24) + (__uint32_t)(((__uint32_t)(x) & 0xff) << 24 | \ + ((__uint32_t)(x) & 0xff00) << 8 | ((__uint32_t)(x) & 0xff0000) >> 8 |\ + ((__uint32_t)(x) & 0xff000000) >> 24) #define __swap64gen(x) \ - (u_int64_t)((((u_int64_t)(x) & 0xff) << 56) | \ - ((u_int64_t)(x) & 0xff00ULL) << 40 | \ - ((u_int64_t)(x) & 0xff0000ULL) << 24 | \ - ((u_int64_t)(x) & 0xff000000ULL) << 8 | \ - ((u_int64_t)(x) & 0xff00000000ULL) >> 8 | \ - ((u_int64_t)(x) & 0xff0000000000ULL) >> 24 | \ - ((u_int64_t)(x) & 0xff000000000000ULL) >> 40 | \ - ((u_int64_t)(x) & 0xff00000000000000ULL) >> 56) + (__uint64_t)((((__uint64_t)(x) & 0xff) << 56) | \ + ((__uint64_t)(x) & 0xff00ULL) << 40 | \ + ((__uint64_t)(x) & 0xff0000ULL) << 24 | \ + ((__uint64_t)(x) & 0xff000000ULL) << 8 | \ + ((__uint64_t)(x) & 0xff00000000ULL) >> 8 | \ + ((__uint64_t)(x) & 0xff0000000000ULL) >> 24 | \ + ((__uint64_t)(x) & 0xff000000000000ULL) >> 40 | \ + ((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) #endif /* __GNUC__ */ @@ -113,21 +113,21 @@ #if __GNUC__ #define __swap16(x) __statement({ \ - u_int16_t __swap16_x = (x); \ + __uint16_t __swap16_x = (x); \ \ __builtin_constant_p(x) ? __swap16gen(__swap16_x) : \ __swap16md(__swap16_x); \ }) #define __swap32(x) __statement({ \ - u_int32_t __swap32_x = (x); \ + __uint32_t __swap32_x = (x); \ \ __builtin_constant_p(x) ? __swap32gen(__swap32_x) : \ __swap32md(__swap32_x); \ }) #define __swap64(x) __statement({ \ - u_int64_t __swap64_x = (x); \ + __uint64_t __swap64_x = (x); \ \ __builtin_constant_p(x) ? __swap64gen(__swap64_x) : \ __swap64md(__swap64_x); \ @@ -142,8 +142,8 @@ #endif /* MD_SWAP */ #define __swap16_multi(v, n) do { \ - size_t __swap16_multi_n = (n); \ - u_int16_t *__swap16_multi_v = (v); \ + __size_t __swap16_multi_n = (n); \ + __uint16_t *__swap16_multi_v = (v); \ \ while (__swap16_multi_n) { \ *__swap16_multi_v = swap16(*__swap16_multi_v); \ @@ -159,19 +159,19 @@ #define swap16_multi __swap16_multi __BEGIN_DECLS -u_int64_t htobe64(u_int64_t); -u_int32_t htobe32(u_int32_t); -u_int16_t htobe16(u_int16_t); -u_int64_t betoh64(u_int64_t); -u_int32_t betoh32(u_int32_t); -u_int16_t betoh16(u_int16_t); - -u_int64_t htole64(u_int64_t); -u_int32_t htole32(u_int32_t); -u_int16_t htole16(u_int16_t); -u_int64_t letoh64(u_int64_t); -u_int32_t letoh32(u_int32_t); -u_int16_t letoh16(u_int16_t); +__uint64_t htobe64(__uint64_t); +__uint32_t htobe32(__uint32_t); +__uint16_t htobe16(__uint16_t); +__uint64_t betoh64(__uint64_t); +__uint32_t betoh32(__uint32_t); +__uint16_t betoh16(__uint16_t); + +__uint64_t htole64(__uint64_t); +__uint32_t htole32(__uint32_t); +__uint16_t htole16(__uint16_t); +__uint64_t letoh64(__uint64_t); +__uint32_t letoh32(__uint32_t); +__uint16_t letoh16(__uint16_t); __END_DECLS #endif /* __BSD_VISIBLE */ diff --git a/sys/sys/exec_elf.h b/sys/sys/exec_elf.h index a2974761461..f72f81e145e 100644 --- a/sys/sys/exec_elf.h +++ b/sys/sys/exec_elf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.h,v 1.40 2004/10/10 15:02:18 kettenis Exp $ */ +/* $OpenBSD: exec_elf.h,v 1.41 2006/01/06 18:53:05 millert Exp $ */ /* * Copyright (c) 1995, 1996 Erik Theisen. All rights reserved. * @@ -33,34 +33,34 @@ #ifndef _SYS_EXEC_ELF_H_ #define _SYS_EXEC_ELF_H_ -#include <machine/types.h> +#include <machine/_types.h> #include <machine/exec.h> -typedef u_int8_t Elf_Byte; +typedef __uint8_t Elf_Byte; -typedef u_int32_t Elf32_Addr; /* Unsigned program address */ -typedef u_int32_t Elf32_Off; /* Unsigned file offset */ -typedef int32_t Elf32_Sword; /* Signed large integer */ -typedef u_int32_t Elf32_Word; /* Unsigned large integer */ -typedef u_int16_t Elf32_Half; /* Unsigned medium integer */ +typedef __uint32_t Elf32_Addr; /* Unsigned program address */ +typedef __uint32_t Elf32_Off; /* Unsigned file offset */ +typedef __int32_t Elf32_Sword; /* Signed large integer */ +typedef __uint32_t Elf32_Word; /* Unsigned large integer */ +typedef __uint16_t Elf32_Half; /* Unsigned medium integer */ -typedef u_int64_t Elf64_Addr; -typedef u_int64_t Elf64_Off; -typedef int32_t Elf64_Shalf; +typedef __uint64_t Elf64_Addr; +typedef __uint64_t Elf64_Off; +typedef __int32_t Elf64_Shalf; #ifdef __alpha__ -typedef int64_t Elf64_Sword; -typedef u_int64_t Elf64_Word; +typedef __int64_t Elf64_Sword; +typedef __uint64_t Elf64_Word; #else -typedef int32_t Elf64_Sword; -typedef u_int32_t Elf64_Word; +typedef __int32_t Elf64_Sword; +typedef __uint32_t Elf64_Word; #endif -typedef int64_t Elf64_Sxword; -typedef u_int64_t Elf64_Xword; +typedef __int64_t Elf64_Sxword; +typedef __uint64_t Elf64_Xword; -typedef u_int32_t Elf64_Half; -typedef u_int16_t Elf64_Quarter; +typedef __uint32_t Elf64_Half; +typedef __uint16_t Elf64_Quarter; /* * e_ident[] identification indexes @@ -367,7 +367,7 @@ typedef struct { #define ELF64_R_SYM(info) ((info) >> 32) #define ELF64_R_TYPE(info) ((info) & 0xFFFFFFFF) -#define ELF64_R_INFO(s,t) (((s) << 32) + (u_int32_t)(t)) +#define ELF64_R_INFO(s,t) (((s) << 32) + (__uint32_t)(t)) /* Program Header */ typedef struct { @@ -492,7 +492,7 @@ typedef struct { Elf32_Word au_v; /* 32-bit value */ } Aux32Info; -#define ELF64_NO_ADDR ((u_int64_t) ~0)/* Indicates addr. not yet filled in */ +#define ELF64_NO_ADDR ((__uint64_t) ~0)/* Indicates addr. not yet filled in */ #define ELF64_AUX_ENTRIES 8 /* Size of aux array passed to loader */ typedef struct { diff --git a/sys/sys/stdarg.h b/sys/sys/stdarg.h index 40d3a82e6df..f1d3bc13d39 100644 --- a/sys/sys/stdarg.h +++ b/sys/sys/stdarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdarg.h,v 1.3 2004/02/26 17:21:59 drahn Exp $ */ +/* $OpenBSD: stdarg.h,v 1.4 2006/01/06 18:53:06 millert Exp $ */ /* * Copyright (c) 2003, 2004 Marc espie <espie@openbsd.org> * @@ -19,7 +19,6 @@ #define _STDARG_H_ #if defined(__GNUC__) && __GNUC__ >= 3 -#include <machine/ansi.h> /* Define __gnuc_va_list. */ diff --git a/sys/sys/syslog.h b/sys/sys/syslog.h index 8b003e9a831..5445227bec8 100644 --- a/sys/sys/syslog.h +++ b/sys/sys/syslog.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syslog.h,v 1.11 2003/08/24 01:27:07 avsm Exp $ */ +/* $OpenBSD: syslog.h,v 1.12 2006/01/06 18:53:06 millert Exp $ */ /* $NetBSD: syslog.h,v 1.14 1996/04/03 20:46:44 christos Exp $ */ /* @@ -187,10 +187,10 @@ struct syslog_data { * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one * of them here we may collide with the utility's includes. It's unreasonable * for utilities to have to include one of them to include syslog.h, so we get - * _BSD_VA_LIST_ from <machine/ansi.h> and use it. + * __va_list from <machine/_types.h> and use it. */ -#include <machine/ansi.h> #include <sys/cdefs.h> +#include <machine/_types.h> __BEGIN_DECLS void closelog(void); @@ -198,14 +198,13 @@ void openlog(const char *, int, int); int setlogmask(int); void syslog(int, const char *, ...) __attribute__((__format__(__syslog__,2,3))); -void vsyslog(int, const char *, _BSD_VA_LIST_); +void vsyslog(int, const char *, __va_list); void closelog_r(struct syslog_data *); void openlog_r(const char *, int, int, struct syslog_data *); int setlogmask_r(int, struct syslog_data *); void syslog_r(int, struct syslog_data *, const char *, ...) __attribute__((__format__(__syslog__,3,4))); -void vsyslog_r(int, struct syslog_data *, const char *, - _BSD_VA_LIST_); +void vsyslog_r(int, struct syslog_data *, const char *, __va_list); __END_DECLS #else /* !_KERNEL */ diff --git a/sys/sys/times.h b/sys/sys/times.h index 2edbb2f327f..7d7a47ba481 100644 --- a/sys/sys/times.h +++ b/sys/sys/times.h @@ -1,4 +1,4 @@ -/* $OpenBSD: times.h,v 1.4 2003/06/02 23:28:22 millert Exp $ */ +/* $OpenBSD: times.h,v 1.5 2006/01/06 18:53:06 millert Exp $ */ /* $NetBSD: times.h,v 1.8 1995/03/26 20:24:54 jtc Exp $ */ /*- @@ -40,11 +40,12 @@ #ifndef _SYS_TIMES_H_ #define _SYS_TIMES_H_ -#include <machine/ansi.h> +#include <sys/cdefs.h> +#include <machine/_types.h> -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ +#ifndef _CLOCK_T_DEFINED_ +#define _CLOCK_T_DEFINED_ +typedef __clock_t clock_t; #endif struct tms { @@ -55,8 +56,6 @@ struct tms { }; #ifndef _KERNEL -#include <sys/cdefs.h> - __BEGIN_DECLS clock_t times(struct tms *); __END_DECLS diff --git a/sys/sys/types.h b/sys/sys/types.h index c71e948e6b6..404697e2104 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: types.h,v 1.28 2005/12/13 00:35:23 millert Exp $ */ +/* $OpenBSD: types.h,v 1.29 2006/01/06 18:53:06 millert Exp $ */ /* $NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $ */ /*- @@ -41,8 +41,7 @@ #define _SYS_TYPES_H_ #include <sys/cdefs.h> -#include <machine/types.h> -#include <machine/ansi.h> +#include <sys/_types.h> #include <machine/endian.h> #if __BSD_VISIBLE @@ -56,76 +55,145 @@ typedef unsigned short ushort; /* Sys V compatibility */ typedef unsigned int uint; /* Sys V compatibility */ typedef unsigned long ulong; /* Sys V compatibility */ -typedef unsigned long cpuid_t; +typedef __cpuid_t cpuid_t; /* CPU id */ +typedef __register_t register_t; /* register-sized type */ +#endif /* __BSD_VISIBLE */ + +/* + * XXX The exact-width bit types should only be exposed if __BSD_VISIBLE + * but the rest of the includes are not ready for that yet. + */ +#ifndef __BIT_TYPES_DEFINED__ +#define __BIT_TYPES_DEFINED__ +#endif + +#ifndef _INT8_T_DEFINED_ +#define _INT8_T_DEFINED_ +typedef __int8_t int8_t; +#endif + +#ifndef _UINT8_T_DEFINED_ +#define _UINT8_T_DEFINED_ +typedef __uint8_t uint8_t; +#endif + +#ifndef _INT16_T_DEFINED_ +#define _INT16_T_DEFINED_ +typedef __int16_t int16_t; #endif -typedef u_int64_t u_quad_t; /* quads */ -typedef int64_t quad_t; +#ifndef _UINT16_T_DEFINED_ +#define _UINT16_T_DEFINED_ +typedef __uint16_t uint16_t; +#endif + +#ifndef _INT32_T_DEFINED_ +#define _INT32_T_DEFINED_ +typedef __int32_t int32_t; +#endif + +#ifndef _UINT32_T_DEFINED_ +#define _UINT32_T_DEFINED_ +typedef __uint32_t uint32_t; +#endif + +#ifndef _INT64_T_DEFINED_ +#define _INT64_T_DEFINED_ +typedef __int64_t int64_t; +#endif + +#ifndef _UINT64_T_DEFINED_ +#define _UINT64_T_DEFINED_ +typedef __uint64_t uint64_t; +#endif + +/* BSD-style unsigned bits types */ +typedef __uint8_t u_int8_t; +typedef __uint16_t u_int16_t; +typedef __uint32_t u_int32_t; +typedef __uint64_t u_int64_t; + +/* quads, deprecated in favor of 64 bit int types */ +typedef __int64_t quad_t; +typedef __uint64_t u_quad_t; typedef quad_t * qaddr_t; +#if __BSD_VISIBLE +/* VM system types */ +typedef __vaddr_t vaddr_t; +typedef __paddr_t paddr_t; +typedef __vsize_t vsize_t; +typedef __psize_t psize_t; +#endif /* __BSD_VISIBLE */ + +/* Standard system types */ typedef char * caddr_t; /* core address */ -typedef int32_t daddr_t; /* disk address */ -typedef int32_t dev_t; /* device number */ -typedef u_int32_t fixpt_t; /* fixed point number */ -typedef u_int32_t gid_t; /* group id */ -typedef u_int32_t id_t; /* may contain pid, uid or gid */ -typedef u_int32_t ino_t; /* inode number */ -typedef long key_t; /* IPC key (for Sys V IPC) */ -typedef u_int32_t mode_t; /* permissions */ -typedef u_int32_t nlink_t; /* link count */ -typedef int32_t pid_t; /* process id */ -typedef u_quad_t rlim_t; /* resource limit */ -typedef int32_t segsz_t; /* segment size */ -typedef int32_t swblk_t; /* swap offset */ -typedef u_int32_t uid_t; /* user id */ -typedef u_int32_t useconds_t; /* microseconds */ -typedef int32_t suseconds_t; /* microseconds (signed) */ +typedef __int32_t daddr_t; /* disk address */ +typedef __dev_t dev_t; /* device number */ +typedef __fixpt_t fixpt_t; /* fixed point number */ +typedef __gid_t gid_t; /* group id */ +typedef __id_t id_t; /* may contain pid, uid or gid */ +typedef __ino_t ino_t; /* inode number */ +typedef __key_t key_t; /* IPC key (for Sys V IPC) */ +typedef __mode_t mode_t; /* permissions */ +typedef __nlink_t nlink_t; /* link count */ +typedef __pid_t pid_t; /* process id */ +typedef __rlim_t rlim_t; /* resource limit */ +typedef __segsz_t segsz_t; /* segment size */ +typedef __swblk_t swblk_t; /* swap offset */ +typedef __uid_t uid_t; /* user id */ +typedef __useconds_t useconds_t; /* microseconds */ +typedef __suseconds_t suseconds_t; /* microseconds (signed) */ /* * XPG4.2 states that inclusion of <netinet/in.h> must pull these * in and that inclusion of <sys/socket.h> must pull in sa_family_t. * We put these here because there are other headers that require * these types and <sys/socket.h> and <netinet/in.h> will indirectly - * include <sys/types.h>. Thus we are compliant without too many hoops. + * include <sys/types.h>. + * XXX - now that we have protected versions these should move. */ -typedef u_int32_t in_addr_t; /* base type for internet address */ -typedef u_int16_t in_port_t; /* IP port type */ -typedef u_int8_t sa_family_t; /* sockaddr address family type */ -typedef u_int32_t socklen_t; /* length type for network syscalls */ +typedef __in_addr_t in_addr_t; /* base type for internet address */ +typedef __in_port_t in_port_t; /* IP port type */ +typedef __sa_family_t sa_family_t; /* sockaddr address family type */ +typedef __socklen_t socklen_t; /* length type for network syscalls */ -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ +/* + * The following types may be defined in multiple header files. + */ +#ifndef _CLOCK_T_DEFINED_ +#define _CLOCK_T_DEFINED_ +typedef __clock_t clock_t; #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _CLOCKID_T_DEFINED_ +#define _CLOCKID_T_DEFINED_ +typedef __clockid_t clockid_t; #endif -#ifdef _BSD_SSIZE_T_ -typedef _BSD_SSIZE_T_ ssize_t; -#undef _BSD_SSIZE_T_ +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; #endif -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _SSIZE_T_DEFINED_ +#define _SSIZE_T_DEFINED_ +typedef __ssize_t ssize_t; #endif -#ifdef _BSD_CLOCKID_T_ -typedef _BSD_CLOCKID_T_ clockid_t; -#undef _BSD_CLOCKID_T_ +#ifndef _TIME_T_DEFINED_ +#define _TIME_T_DEFINED_ +typedef __time_t time_t; #endif -#ifdef _BSD_TIMER_T_ -typedef _BSD_TIMER_T_ timer_t; -#undef _BSD_TIMER_T_ +#ifndef _TIMER_T_DEFINED_ +#define _TIMER_T_DEFINED_ +typedef __timer_t timer_t; #endif -#ifdef _BSD_OFF_T_ -typedef _BSD_OFF_T_ off_t; -#undef _BSD_OFF_T_ +#ifndef _OFF_T_DEFINED_ +#define _OFF_T_DEFINED_ +typedef __off_t off_t; #endif /* diff --git a/usr.bin/mail/extern.h b/usr.bin/mail/extern.h index 672a059b0fc..f1e682f2887 100644 --- a/usr.bin/mail/extern.h +++ b/usr.bin/mail/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.23 2004/09/15 22:21:40 deraadt Exp $ */ +/* $OpenBSD: extern.h,v 1.24 2006/01/06 18:53:06 millert Exp $ */ /* $NetBSD: extern.h,v 1.7 1997/07/09 05:22:00 mikel Exp $ */ /*- @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)extern.h 8.2 (Berkeley) 4/20/95 - * $OpenBSD: extern.h,v 1.23 2004/09/15 22:21:40 deraadt Exp $ + * $OpenBSD: extern.h,v 1.24 2006/01/06 18:53:06 millert Exp $ */ struct name; @@ -238,7 +238,7 @@ int spool_unlock(void); void spreserve(void); void sreset(void); pid_t start_command(char *cmd, sigset_t *nset, int infd, int outfd, ...); -pid_t start_commandv(char *, sigset_t *, int, int, _BSD_VA_LIST_); +pid_t start_commandv(char *, sigset_t *, int, int, __va_list); int statusput(struct message *, FILE *, char *); void stop(int); int stouch(void *); diff --git a/usr.sbin/ypserv/common/yplog.h b/usr.sbin/ypserv/common/yplog.h index 670388570ef..4a9c15e90eb 100644 --- a/usr.sbin/ypserv/common/yplog.h +++ b/usr.sbin/ypserv/common/yplog.h @@ -1,4 +1,4 @@ -/* $OpenBSD: yplog.h,v 1.5 2003/06/02 21:58:26 maja Exp $ */ +/* $OpenBSD: yplog.h,v 1.6 2006/01/06 18:53:06 millert Exp $ */ /* * Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se> @@ -31,7 +31,7 @@ __BEGIN_DECLS void yplog(const char *, ...); -void vyplog(const char *, _BSD_VA_LIST_); +void vyplog(const char *, __va_list); void ypopenlog(void); void ypcloselog(void); __END_DECLS |