X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/59e0d9fe772464b93d835d2a2964457702469a43..HEAD:/include/ndbm.h diff --git a/include/ndbm.h b/include/ndbm.h index d7c8e22..b400c62 100644 --- a/include/ndbm.h +++ b/include/ndbm.h @@ -3,8 +3,6 @@ * * @APPLE_LICENSE_HEADER_START@ * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. - * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -63,20 +61,11 @@ #ifndef _NDBM_H_ #define _NDBM_H_ -#include #include <_types.h> +#include +#include -#ifndef _MODE_T_DECLARED -typedef __osx_mode_t mode_t; -#define _MODE_T_DECLARED -#endif - -#ifndef _BSD_SIZE_T_DEFINED_ -#define _BSD_SIZE_T_DEFINED_ -typedef __osx_size_t size_t; -#endif - -#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) /* Map dbm interface onto db(3). */ #include #define DBM_RDONLY O_RDONLY @@ -86,7 +75,7 @@ typedef __osx_size_t size_t; #define DBM_INSERT 0 #define DBM_REPLACE 1 -#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) /* * The db(3) support for ndbm(3) always appends this suffix to the * file name to avoid overwriting the user's original database. @@ -99,8 +88,14 @@ typedef struct { size_t dsize; } datum; -typedef struct __db DBM; -#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) +#ifndef _DBM +#define _DBM +typedef struct { + char __opaque[sizeof(int) + 8 * sizeof(void *)]; +} DBM; +#endif /* _DBM */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) #define dbm_pagfno(a) DBM_PAGFNO_NOT_AVAILABLE #endif @@ -108,13 +103,13 @@ __BEGIN_DECLS int dbm_clearerr( DBM *); void dbm_close(DBM *); int dbm_delete(DBM *, datum); -#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) int dbm_dirfno(DBM *); #endif int dbm_error( DBM *); datum dbm_fetch(DBM *, datum); datum dbm_firstkey(DBM *); -#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) long dbm_forder(DBM *, datum); #endif datum dbm_nextkey(DBM *);