Some header work to make it more posix compliant.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3080 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#ifndef _ALLOCA_H
|
||||
#define _ALLOCA_H
|
||||
/*
|
||||
** Distributed under the terms of the OpenBeOS License.
|
||||
*/
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
#undef __alloca
|
||||
#undef alloca
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void * __alloca (size_t __size);
|
||||
extern void * alloca (size_t __size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define __alloca(size) __builtin_alloca (size)
|
||||
#define alloca(size) __alloca (size)
|
||||
|
||||
#endif /* _ALLOCA_H */
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef _ICONV_H_
|
||||
#define _ICONV_H_
|
||||
/*
|
||||
** Distributed under the terms of the OpenBeOS License.
|
||||
*/
|
||||
|
||||
|
||||
typedef void *iconv_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern iconv_t iconv_open(const char *toCode, const char *fromCode);
|
||||
extern int iconv_close(iconv_t cd);
|
||||
extern size_t iconv(iconv_t cd, char **inBuffer, size_t *inBytesLeft,
|
||||
char **outBuffer, size_t *outBytesLeft);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _ICONV_H_ */
|
||||
@@ -5,15 +5,29 @@
|
||||
*/
|
||||
|
||||
|
||||
typedef signed char int8_t;
|
||||
typedef signed short int int16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef signed long long int64_t;
|
||||
#include <stdint.h>
|
||||
|
||||
typedef unsigned char u_int8_t;
|
||||
typedef unsigned short int u_int16_t;
|
||||
typedef unsigned int u_int32_t;
|
||||
typedef unsigned long long u_int64_t;
|
||||
|
||||
typedef struct {
|
||||
intmax_t quot; /* quotient */
|
||||
intmax_t rem; /* remainder */
|
||||
} imaxdiv_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern intmax_t imaxabs(intmax_t num);
|
||||
extern imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
|
||||
|
||||
extern intmax_t strtoimax(const char *, char **, int);
|
||||
extern uintmax_t strtoumax(const char *, char **, int);
|
||||
//extern intmax_t wcstoimax(const __wchar_t *, __wchar_t **, int);
|
||||
//extern uintmax_t wcstoumax(const __wchar_t *, __wchar_t **, int);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _INTTYPES_H_ */
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef _NL_TYPES_H_
|
||||
#define _NL_TYPES_H_
|
||||
/*
|
||||
** Distributed under the terms of the OpenBeOS License.
|
||||
*/
|
||||
|
||||
|
||||
#define NL_SETD 0
|
||||
#define NL_CAT_LOCALE 1
|
||||
|
||||
typedef int nl_item;
|
||||
typedef void *nl_catd;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern nl_catd catopen(const char *name, int oflag);
|
||||
extern char *catgets(nl_catd cat, int setID, int msgID, const char *defaultMessage);
|
||||
extern int catclose(nl_catd cat);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _NL_TYPES_H_ */
|
||||
@@ -3,6 +3,7 @@
|
||||
// XXX Doesn't belong into posix, should be replaced as soon as possible
|
||||
|
||||
#include <size_t.h>
|
||||
#include <wchar_t.h>
|
||||
|
||||
#if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
|
||||
&& !defined(__STDDEF_H__)) \
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef _STDINT_H_
|
||||
#define _STDINT_H_
|
||||
/*
|
||||
** Distributed under the terms of the OpenBeOS License.
|
||||
*/
|
||||
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed char int8_t;
|
||||
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed short int16_t;
|
||||
|
||||
typedef unsigned long uint32_t;
|
||||
typedef signed long int32_t;
|
||||
|
||||
typedef unsigned long long uint64_t;
|
||||
typedef signed long long int64_t;
|
||||
|
||||
typedef unsigned long long uintmax_t;
|
||||
typedef signed long long intmax_t;
|
||||
|
||||
// ToDo: add "least" and "fast" types
|
||||
|
||||
/* BSD compatibility */
|
||||
typedef uint8_t u_int8_t;
|
||||
typedef uint16_t u_int16_t;
|
||||
typedef uint32_t u_int32_t;
|
||||
typedef uint64_t u_int64_t;
|
||||
|
||||
#endif /* _STDINT_H_ */
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <wchar_t.h>
|
||||
#include <stddef.h>
|
||||
#include <limits.h>
|
||||
#include <alloca.h>
|
||||
|
||||
|
||||
#define RAND_MAX 0x7fffffff
|
||||
|
||||
@@ -17,6 +17,7 @@ struct stat {
|
||||
gid_t st_gid; /* group id of the owner of this file */
|
||||
off_t st_size; /* size in bytes of this file */
|
||||
// ToDo: st_type is new for OpenBeOS - it replaces the unused st_rdev field
|
||||
// we might also define special types for files and TTYs
|
||||
unsigned int st_type; /* attribute/index type */
|
||||
//dev_t st_rdev; /* device type (not used) */
|
||||
size_t st_blksize; /* preferred block size for i/o */
|
||||
|
||||
+10
-1
@@ -9,4 +9,13 @@
|
||||
|
||||
typedef unsigned short wchar_t;
|
||||
|
||||
#endif
|
||||
#define _WINT_T
|
||||
typedef unsigned int wint_t;
|
||||
|
||||
typedef struct {
|
||||
int __count;
|
||||
wint_t __value;
|
||||
} mbstate_t;
|
||||
|
||||
#endif /* _WCHAR_T_H */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user