added 4 changesets to branch 'refs/remotes/mmadia-github/separate-build-environment' old head: 26852663eef26cbabc588092bc639f5f7a4f5202 new head: c68b3e166cc264bf229b7a136ee4c1980adb8bc7 ---------------------------------------------------------------------------- 8dada69: Corrected a missing _HAIKU_BUILD_DECLARE_FUNCTION() for readdir() 30d5440: Added target_utime.h 74f7396: Add target_time.h c68b3e1: Add [target_]fs_attr.h [ Matt Madia <mattmadia@xxxxxxxxx> ] ---------------------------------------------------------------------------- 5 files changed, 177 insertions(+), 40 deletions(-) headers/build/os/kernel/fs_attr.h | 43 +-------- headers/build/os_target/kernel/target_fs_attr.h | 52 ++++++++++ headers/build/posix_target/sys/target_time.h | 96 +++++++++++++++++++ headers/build/posix_target/target_dirent.h | 2 +- headers/build/posix_target/target_utime.h | 24 +++++ ############################################################################ Commit: 8dada69389043af01d292dae20395b74b0598018 Author: Matt Madia <mattmadia@xxxxxxxxx> Date: Fri Aug 10 15:53:41 2012 UTC Corrected a missing _HAIKU_BUILD_DECLARE_FUNCTION() for readdir() ---------------------------------------------------------------------------- diff --git a/headers/build/posix_target/target_dirent.h b/headers/build/posix_target/target_dirent.h index 3e0cb7c..a1833d8 100644 --- a/headers/build/posix_target/target_dirent.h +++ b/headers/build/posix_target/target_dirent.h @@ -44,7 +44,7 @@ extern "C" { _HAIKU_BUILD_DECLARE_FUNCTION(DIR*, fdopendir, (int fd)) _HAIKU_BUILD_DECLARE_FUNCTION(DIR*, opendir, (const char* dirName)) -struct _HAIKU_BUILD_IDENTIFIER(dirent_t)* readdir(DIR* dir); +_HAIKU_BUILD_DECLARE_FUNCTION(struct _HAIKU_BUILD_IDENTIFIER(dirent_t)*, readdir, (DIR* dir)) _HAIKU_BUILD_DECLARE_FUNCTION(int, readdir_r, (DIR* dir, struct _HAIKU_BUILD_IDENTIFIER(dirent_t)* entry, struct _HAIKU_BUILD_IDENTIFIER(dirent_t)** _result)) _HAIKU_BUILD_DECLARE_FUNCTION(int, closedir, (DIR* dir)) ############################################################################ Commit: 30d544005828071b12e50cfcab52a711afa51ad4 Author: Matt Madia <mattmadia@xxxxxxxxx> Date: Fri Aug 10 15:58:27 2012 UTC Added target_utime.h ---------------------------------------------------------------------------- diff --git a/headers/build/posix_target/target_utime.h b/headers/build/posix_target/target_utime.h new file mode 100644 index 0000000..6b42ad7 --- /dev/null +++ b/headers/build/posix_target/target_utime.h @@ -0,0 +1,24 @@ +/* + * Copyright 2002-2012 Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _UTIME_H_ +#define _UTIME_H_ + + +#include <sys/target_types.h> + + +struct _HAIKU_BUILD_IDENTIFIER(utimbuf) { + _HAIKU_BUILD_IDENTIFIER(time_t) actime; /* access time */ + _HAIKU_BUILD_IDENTIFIER(time_t) modtime; /* modification time */ +}; + + +extern +#ifdef __cplusplus +"C" +#endif +_HAIKU_BUILD_DECLARE_FUNCTION(int, utime, (const char *path, const struct _HAIKU_BUILD_IDENTIFIER(utimbuf) *buffer)) + +#endif /* _UTIME_H_ */ ############################################################################ Commit: 74f73964ada1e83f339d089122486b51792c1598 Author: Matt Madia <mattmadia@xxxxxxxxx> Date: Fri Aug 10 16:04:01 2012 UTC Add target_time.h ---------------------------------------------------------------------------- diff --git a/headers/build/posix_target/sys/target_time.h b/headers/build/posix_target/sys/target_time.h new file mode 100644 index 0000000..47b2c15 --- /dev/null +++ b/headers/build/posix_target/sys/target_time.h @@ -0,0 +1,96 @@ +/* + * Copyright 2002-2012 Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _SYS_TIME_H +#define _SYS_TIME_H + + +#include <sys/target_types.h> + + +struct _HAIKU_BUILD_IDENTIFIER(timeval) { + _HAIKU_BUILD_IDENTIFIER(time_t) tv_sec; /* seconds */ + _HAIKU_BUILD_IDENTIFIER(suseconds_t) tv_usec; /* microseconds */ +}; + +#include <sys/target_select.h> + /* circular dependency: fd_set needs to be defined and the + * select prototype exported by this file, but <sys/select.h> + * needs struct timeval. + */ + +struct _HAIKU_BUILD_IDENTIFIER(timezone) { + int tz_minuteswest; + int tz_dsttime; +}; + +struct _HAIKU_BUILD_IDENTIFIER(itimerval) { + struct _HAIKU_BUILD_IDENTIFIER(timeval) it_interval; + struct _HAIKU_BUILD_IDENTIFIER(timeval) it_value; +}; + +#define _HAIKU_BUILD_ITIMER_REAL 1 /* real time */ +#define _HAIKU_BUILD_ITIMER_VIRTUAL 2 /* process virtual time */ +#define _HAIKU_BUILD_ITIMER_PROF 3 /* both */ + + +#ifdef __cplusplus +extern "C" { +#endif + +_HAIKU_BUILD_DECLARE_FUNCTION(int, getitimer, (int which, + struct _HAIKU_BUILD_IDENTIFIER(timerval) *value)) +_HAIKU_BUILD_DECLARE_FUNCTION(int, setitimer, (int which, + const struct _HAIKU_BUILD_IDENTIFIER(itimerval) *value, + struct _HAIKU_BUILD_IDENTIFIER(itimerval) *oldValue)) +_HAIKU_BUILD_DECLARE_FUNCTION(int, gettimeofday, + (struct _HAIKU_BUILD_IDENTIFIER(timeval) *tv, void *tz)) + +_HAIKU_BUILD_DECLARE_FUNCTION(int, utimes, (const char *name, + const struct _HAIKU_BUILD_IDENTIFIER(timeval) times[2])) + /* legacy */ + +#ifdef __cplusplus +} +#endif + +/* BSDish macros operating on timeval structs */ +#define _haiku_build_timeradd(a, b, res) \ + do { \ + (res)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ + (res)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ + if ((res)->tv_usec >= 1000000) { \ + (res)->tv_usec -= 1000000; \ + (res)->tv_sec++; \ + } \ + } while (0) +#define _haiku_build_timersub(a, b, res) \ + do { \ + (res)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ + (res)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ + if ((res)->tv_usec < 0) { \ + (res)->tv_usec += 1000000; \ + (res)->tv_sec--; \ + } \ + } while (0) +#define _haiku_build_timerclear(a) ((a)->tv_sec = (a)->tv_usec = 0) +#define _haiku_build_timerisset(a) ((a)->tv_sec != 0 || (a)->tv_usec != 0) +#define _haiku_build_timercmp(a, b, cmp) ((a)->tv_sec == (b)->tv_sec \ + ? (a)->tv_usec cmp (b)->tv_usec : (a)->tv_sec cmp (b)->tv_sec) + +#ifndef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER +# define ITIMER_REAL _HAIKU_BUILD_ITIMER_REAL /* real time */ +# define ITIMER_VIRTUAL _HAIKU_BUILD_ITIMER_VIRTUAL /* process virtual time */ +# define ITIMER_PROF _HAIKU_BUILD_ITIMER_PROF /* both */ + + /* BSDish macros operating on timeval structs */ +# define timeradd(a, b, res) _haiku_build_timeradd(a, b, res) +# define timersub(a, b, res) _haiku_build_timersub(a, b, res) +# define timerclear(a) _haiku_build_timerclear(a) +# define timerisset(a) _haiku_build_timerisset(a) +# define timercmp(a, b, cmp) _haiku_build_timercmp(a, b, cmp) + +#endif /* _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER */ + +#endif /* _SYS_TIME_H */ ############################################################################ Commit: c68b3e166cc264bf229b7a136ee4c1980adb8bc7 Author: Matt Madia <mattmadia@xxxxxxxxx> Date: Fri Aug 10 16:16:21 2012 UTC Add [target_]fs_attr.h ---------------------------------------------------------------------------- diff --git a/headers/build/os/kernel/fs_attr.h b/headers/build/os/kernel/fs_attr.h index 3f24985..dc53c90 100644 --- a/headers/build/os/kernel/fs_attr.h +++ b/headers/build/os/kernel/fs_attr.h @@ -1,47 +1,12 @@ /* - * Copyright 2002-2009, Haiku Inc. All Rights Reserved. + * Copyright 2002-2012, Haiku Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ -#ifndef _FS_ATTR_H -#define _FS_ATTR_H +#ifndef _HAIKU_BUILD_FS_ATTR_H +#define _HAIKU_BUILD_FS_ATTR_H -#include <OS.h> -#include <dirent.h> +#include "os_target/kernel/target_fs_attr.h" -typedef struct attr_info { - uint32 type; - off_t size; -} attr_info; - - -#ifdef __cplusplus -extern "C" { -#endif - -extern ssize_t fs_read_attr(int fd, const char *attribute, uint32 type, - off_t pos, void *buffer, size_t readBytes); -extern ssize_t fs_write_attr(int fd, const char *attribute, uint32 type, - off_t pos, const void *buffer, size_t readBytes); -extern int fs_remove_attr(int fd, const char *attribute); -extern int fs_stat_attr(int fd, const char *attribute, - struct attr_info *attrInfo); - -extern int fs_open_attr(const char *path, const char *attribute, - uint32 type, int openMode); -extern int fs_fopen_attr(int fd, const char *attribute, uint32 type, - int openMode); -extern int fs_close_attr(int fd); - -extern DIR *fs_open_attr_dir(const char *path); -extern DIR *fs_fopen_attr_dir(int fd); -extern int fs_close_attr_dir(DIR *dir); -extern struct dirent *fs_read_attr_dir(DIR *dir); -extern void fs_rewind_attr_dir(DIR *dir); - -#ifdef __cplusplus -} #endif - -#endif /* _FS_ATTR_H */ diff --git a/headers/build/os_target/kernel/target_fs_attr.h b/headers/build/os_target/kernel/target_fs_attr.h new file mode 100644 index 0000000..fd8a768 --- /dev/null +++ b/headers/build/os_target/kernel/target_fs_attr.h @@ -0,0 +1,52 @@ +/* + * Copyright 2002-2011, Haiku Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _FS_ATTR_H +#define _FS_ATTR_H + + +#include <target_OS.h> +#include <target_dirent.h> + + +typedef struct _HAIKU_BUILD_IDENTIFIER(attr_info) { + _haiku_build_uint32 type; + _haiku_build_off_t size; +} _HAIKU_BUILD_IDENTIFIER(attr_info); + + +#ifdef __cplusplus +extern "C" { +#endif + +_HAIKU_BUILD_DECLARE_FUNCTION(ssize_t, fs_read_attr, (int fd, + const char *attribute, _haiku_build_uint32 type, _haiku_build_off_t pos, + void *buffer, size_t readBytes) +_HAIKU_BUILD_DECLARE_FUNCTION(ssize_t, fs_write_attr, (int fd, + const char *attribute, _haiku_build_uint32 type, haiku_build_off_t pos, + const void *buffer, size_t readBytes)) +_HAIKU_BUILD_DECLARE_FUNCTION(int, fs_remove_attr(int fd, const char *attribute)) +_HAIKU_BUILD_DECLARE_FUNCTION(int, fs_stat_attr(int fd, const char *attribute, + struct attr_info *attrInfo); + +_HAIKU_BUILD_DECLARE_FUNCTION(int, fs_open_attr(const char *path, + const char *attribute, _haiku_build_uint32 type, int openMode)) +_HAIKU_BUILD_DECLARE_FUNCTION(int, fs_fopen_attr(int fd, + const char *attribute, _haiku_build_uint32 type, int openMode)) +_HAIKU_BUILD_DECLARE_FUNCTION(int, fs_close_attr(int fd)) + +_HAIKU_BUILD_DECLARE_FUNCTION(DIR*, fs_open_attr_dir, (const char *path)) +_HAIKU_BUILD_DECLARE_FUNCTION(DIR*, fs_lopen_attr_dir, (const char *path)) +_HAIKU_BUILD_DECLARE_FUNCTION(DIR*, fs_fopen_attr_dir, (int fd)) +_HAIKU_BUILD_DECLARE_FUNCTION(int, fs_close_attr_dir, (DIR *dir)) +_HAIKU_BUILD_DECLARE_FUNCTION(struct _HAIKU_BUILD_IDENTIFIER(dirent)*, + fs_read_attr_dir, (DIR *dir)) +_HAIKU_BUILD_DECLARE_FUNCTION(void, fs_rewind_attr_dir, (DIR *dir)) + +#ifdef __cplusplus +} +#endif + + +#endif /* _FS_ATTR_H */