diff options
author | luther <luther@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-05-23 23:01:45 +0000 |
---|---|---|
committer | luther <luther@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-05-23 23:01:45 +0000 |
commit | 748498b3f7f338a86c498cc91fed84189701769f (patch) | |
tree | dfdfefe9b1d468e9f7539427113bad774848bfc0 /PACE | |
parent | 2a862ea6713ab9995655892e77571cf14a502eb3 (diff) | |
download | ATCD-748498b3f7f338a86c498cc91fed84189701769f.tar.gz |
Tue May 23 17:55:40 2000 Luther J Baker <luther@cs.wustl.edu>
Diffstat (limited to 'PACE')
99 files changed, 6924 insertions, 0 deletions
diff --git a/PACE/ChangeLog b/PACE/ChangeLog new file mode 100644 index 00000000000..3b96c6313da --- /dev/null +++ b/PACE/ChangeLog @@ -0,0 +1,14 @@ +Tue May 23 17:59:06 2000 Luther J Baker <luther@cs.wustl.edu> + + * docs/todo.txt: + Currently, all .o files appear in the + ACE_wrappers/pace/pace directory (e.g.: nested + files such as pace/pace/sys/socket.c generate + pace/pace/socket.o. See pace/docs/todo.txt. + + * ACE_wrappers/pace/pace: + Source files added. + + + + diff --git a/PACE/docs/todo.txt b/PACE/docs/todo.txt new file mode 100644 index 00000000000..ca7fce41207 --- /dev/null +++ b/PACE/docs/todo.txt @@ -0,0 +1,7 @@ +Tue May 23 17:55:40 2000 Luther J Baker <luther@cs.wustl.edu> + + * When compiling pace/pace/* files, all .o files all currently + appear in the pace/pace directory. E.G.: pace/pace/sys/socket.c + generates pace/pace/socket.o. This needs to be addressed + concurrently as we build the pacelib and link to the rest of + ace. diff --git a/PACE/pace/aio.c b/PACE/pace/aio.c new file mode 100644 index 00000000000..18c7cb7b480 --- /dev/null +++ b/PACE/pace/aio.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * aio.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/aio.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/aio.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/aio.h b/PACE/pace/aio.h new file mode 100644 index 00000000000..7155bd25acc --- /dev/null +++ b/PACE/pace/aio.h @@ -0,0 +1,59 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * aio.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_AIO_H +#define PACE_AIO_H + + +#include "pace/defines.h" +#include <aio.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE int pace_aio_cancel (int fildes, struct aiocb * aiocb); + + PACE_INLINE int pace_aio_error (const struct aiocb * aiocbp); + + PACE_INLINE int pace_aio_fsync (int op, struct aiocb * aiocbp); + + PACE_INLINE int pace_aio_read (struct aiocb * aiocbp); + + PACE_INLINE int pace_aio_return (struct aiocb * aiocbp); + + PACE_INLINE int pace_aio_suspend (const struct aiocb * const list[], + int nent, + const struct timespec * timeout); + + PACE_INLINE int pace_aio_write (struct aiocb * aiocbp); + + PACE_INLINE int pace_lio_listio (int mode, + struct aiocb * const list[], + int nent, + struct sigevent * sig); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/aio.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_AIO_H */ diff --git a/PACE/pace/aio.inl b/PACE/pace/aio.inl new file mode 100644 index 00000000000..c7c89d7e621 --- /dev/null +++ b/PACE/pace/aio.inl @@ -0,0 +1,76 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * aio.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +int +pace_io_cancel (int fildes, struct aiocb * aiocbp) +{ + return aio_cancel (fildes, aiocbp); +} + +PACE_INLINE +int +pace_io_error (const struct aiocb * aiocbp) +{ + return aio_error (aiocbp); +} + +PACE_INLINE +int +pace_io_fsync (int op, struct aiocb * aiocbp) +{ + return aio_fsync (op, aiocbp); +} + +PACE_INLINE +int +pace_io_read (struct aiocb * aiocbp) +{ + return aio_read (aiocbp); +} + +PACE_INLINE +int +pace_io_return (struct aiocb * aiocbp) +{ + return aio_return (aiocbp); +} + +PACE_INLINE +int +pace_io_suspend (const struct aiocb * const list[], + int nent, + const struct timespec * timeout) +{ + return aio_suspend (list, nent, timeout); +} + +PACE_INLINE +int +pace_io_write (struct aiocb * aiocbp) +{ + return aio_write (aiocbp); +} + +PACE_INLINE +int +pace_lio_listio (int mode, + struct aiocb * const list[], + int nent, + struct sigevent * sig) +{ + return lio_listio (mode, list, nent, sig); +} diff --git a/PACE/pace/arpa/inet.c b/PACE/pace/arpa/inet.c new file mode 100644 index 00000000000..437603d8232 --- /dev/null +++ b/PACE/pace/arpa/inet.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * inet.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/arpa/inet.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/arpa/inet.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/arpa/inet.h b/PACE/pace/arpa/inet.h new file mode 100644 index 00000000000..5c8ff0b4db1 --- /dev/null +++ b/PACE/pace/arpa/inet.h @@ -0,0 +1,51 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * inet.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_ARPA_INET_H +#define PACE_ARPA_INET_H + + +#include "pace/defines.h" +#include <arpa/inet.h> + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE unsigned long pace_inet_addr (const char * cp); + + PACE_INLINE unsigned long pace_inet_network (const char * cp); + + PACE_INLINE struct in_addr pace_inet_makeaddr (const int net, const int lna); + + PACE_INLINE int pace_inet_lnaof (const struct in_addr in); + + PACE_INLINE int pace_inet_netof (const struct in_addr in); + + PACE_INLINE char * pace_inet_ntoa (const struct in_addr in); + + PACE_INLINE int pace_inet_aton (const char * str, struct in_addr * addr); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/arpa/inet.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_ARPA_INET_H */ diff --git a/PACE/pace/arpa/inet.inl b/PACE/pace/arpa/inet.inl new file mode 100644 index 00000000000..4df3dc42144 --- /dev/null +++ b/PACE/pace/arpa/inet.inl @@ -0,0 +1,69 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * inet.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/sys/socket.h" +#include "pace/sys/types.h" +#include "pace/netinet/in.h" + + +PACE_INLINE +unsigned long +pace_inet_addr (const char * cp) +{ + return inet_addr (cp); +} + +PACE_INLINE +unsigned long +pace_inet_network (const char * cp) +{ + return inet_network (cp); +} + +PACE_INLINE +struct in_addr +pace_inet_makeaddr (const int net, const int lna) +{ + return inet_makeaddr (net, lna); +} + +PACE_INLINE +int +pace_inet_lnaof (const struct in_addr in) +{ + return inet_lnaof (in); +} + +PACE_INLINE +int +pace_inet_netof (const struct in_addr in) +{ + return inet_netof (in); +} + +PACE_INLINE +char * +pace_inet_ntoa (const struct in_addr in) +{ + return inet_ntoa (in); +} + +PACE_INLINE +int +pace_inet_aton (const char * str, struct in_addr * addr) +{ + return inet_aton (str, addr); +} diff --git a/PACE/pace/config/codes.h b/PACE/pace/config/codes.h new file mode 100644 index 00000000000..f50952aad30 --- /dev/null +++ b/PACE/pace/config/codes.h @@ -0,0 +1,31 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * codes.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_CONFIG_CODES_H +#define PACE_CONFIG_CODES_H + + +/* Generic lack of support. */ +# define PACE_NO_PLATFORM_SUPPORT -5000 + +/* Specific lack of support. */ +# define PACE_ERRNO_LACKS_REENTRANT -5001 +# define PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS -5002 +# define PACE_ERRNO_LACKS_POSIX_C_SOURCE -5003 +# define PACE_ERRNO_LACKS_RT -5004 + + +#endif /* PACE_CONFIG_CODES_H */ diff --git a/PACE/pace/config/compiler.h b/PACE/pace/config/compiler.h new file mode 100644 index 00000000000..c5a446a1762 --- /dev/null +++ b/PACE/pace/config/compiler.h @@ -0,0 +1,228 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * compiler.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_CONFIG_COMPILER_H +#define PACE_CONFIG_COMPILER_H + + +#include <errno.h> +int errno; + + +# if defined (_POSIX_C_SOURCE) +# define PACE_POSIX_C_SOURCE _POSIX_C_SOURCE +# endif /* _POSIX_C_SOURCE */ + +# if defined (__cplusplus) +# define PACE_INLINE inline +# define PACE_HAS_INLINE +# define PACE_HAS_CPLUSPLUS +# else /* ! __cplusplus */ +# define PACE_INLINE static +# endif /* ! __cplusplus */ + +# define PACE_RETURN_NO_SUPPORT(X) \ +do { \ + errno = ENOTSUP; \ + return -1; \ +} while (0) + +# define PACE_SET_ERRNO(X) \ +errno=X + + + + + + + + + + + + + + + +/* From ACE_OS ------------------------------------------------------------- */ + +# if defined (PACE_LACKS_INLINE_FUNCTIONS) && !defined (PACE_NO_INLINE) +# define PACE_NO_INLINE +# endif /* defined (PACE_LACKS_INLINE_FUNCTIONS) && !defined (PACE_NO_INLINE) */ + +# if defined (PACE_NO_INLINE) +/* PACE inlining has been explicitly disabled. Implement + * internally within PACE by undefining __PACE_INLINE__. + */ +# undef __PACE_INLINE__ +# endif /* ! PACE_NO_INLINE */ + +# if !defined (PACE_NOT_POSIX) +# if !defined (PACE_LACKS_PRAGMA_ONCE) +# pragma once +# endif /* PACE_LACKS_PRAGMA_ONCE */ +# endif /* ! PACE_NOT_POSIX */ + +# if !defined (PACE_HAS_POSITION_INDEPENDENT_POINTERS) +# define PACE_HAS_POSITION_INDEPENDENT_POINTERS 1 +# endif /* PACE_HAS_POSITION_INDEPENDENT_POINTERS */ + +# if defined (PACE_HAS_ANSI_CASTS) + +# define PACE_sap_any_cast(TYPE) reinterpret_cast<TYPE> (const_cast<PACE_Addr &> (PACE_Addr::sap_any)) + +# define PACE_static_cast(TYPE, EXPR) static_cast<TYPE> (EXPR) +# define PACE_static_cast_1_ptr(TYPE, T1, EXPR) static_cast<TYPE<T1> *> (EXPR) +# define PACE_static_cast_2_ptr(TYPE, T1, T2, EXPR) static_cast<TYPE<T1, T2> *> (EXPR) +# define PACE_static_cast_3_ptr(TYPE, T1, T2, T3, EXPR) static_cast<TYPE<T1, T2, T3> *> (EXPR) +# define PACE_static_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) static_cast<TYPE<T1, T2, T3, T4> *> (EXPR) +# define PACE_static_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) static_cast<TYPE<T1, T2, T3, T4, T5> *> (EXPR) +# define PACE_static_cast_1_ref(TYPE, T1, EXPR) static_cast<TYPE<T1> &> (EXPR) +# define PACE_static_cast_2_ref(TYPE, T1, T2, EXPR) static_cast<TYPE<T1, T2> &> (EXPR) +# define PACE_static_cast_3_ref(TYPE, T1, T2, T3, EXPR) static_cast<TYPE<T1, T2, T3> &> (EXPR) +# define PACE_static_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) static_cast<TYPE<T1, T2, T3, T4> &> (EXPR) +# define PACE_static_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) static_cast<TYPE<T1, T2, T3, T4, T5> &> (EXPR) + +# define PACE_const_cast(TYPE, EXPR) const_cast<TYPE> (EXPR) +# define PACE_const_cast_1_ptr(TYPE, T1, EXPR) const_cast<TYPE<T1> *> (EXPR) +# define PACE_const_cast_2_ptr(TYPE, T1, T2, EXPR) const_cast<TYPE<T1, T2> *> (EXPR) +# define PACE_const_cast_3_ptr(TYPE, T1, T2, T3, EXPR) const_cast<TYPE<T1, T2, T3> *> (EXPR) +# define PACE_const_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) const_cast<TYPE<T1, T2, T3, T4> *> (EXPR) +# define PACE_const_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) const_cast<TYPE<T1, T2, T3, T4, T5> *> (EXPR) +# define PACE_const_cast_1_ref(TYPE, T1, EXPR) const_cast<TYPE<T1> &> (EXPR) +# define PACE_const_cast_2_ref(TYPE, T1, T2, EXPR) const_cast<TYPE<T1, T2> &> (EXPR) +# define PACE_const_cast_3_ref(TYPE, T1, T2, T3, EXPR) const_cast<TYPE<T1, T2, T3> &> (EXPR) +# define PACE_const_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) const_cast<TYPE<T1, T2, T3, T4> &> (EXPR) +# define PACE_const_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) const_cast<TYPE<T1, T2, T3, T4, T5> &> (EXPR) + +# define PACE_reinterpret_cast(TYPE, EXPR) reinterpret_cast<TYPE> (EXPR) +# define PACE_reinterpret_cast_1_ptr(TYPE, T1, EXPR) reinterpret_cast<TYPE<T1> *> (EXPR) +# define PACE_reinterpret_cast_2_ptr(TYPE, T1, T2, EXPR) reinterpret_cast<TYPE<T1, T2> *> (EXPR) +# define PACE_reinterpret_cast_3_ptr(TYPE, T1, T2, T3, EXPR) reinterpret_cast<TYPE<T1, T2, T3> *> (EXPR) +# define PACE_reinterpret_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) reinterpret_cast<TYPE<T1, T2, T3, T4> *> (EXPR) +# define PACE_reinterpret_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) reinterpret_cast<TYPE<T1, T2, T3, T4, T5> *> (EXPR) +# define PACE_reinterpret_cast_1_ref(TYPE, T1, EXPR) reinterpret_cast<TYPE<T1> &> (EXPR) +# define PACE_reinterpret_cast_2_ref(TYPE, T1, T2, EXPR) reinterpret_cast<TYPE<T1, T2> &> (EXPR) +# define PACE_reinterpret_cast_3_ref(TYPE, T1, T2, T3, EXPR) reinterpret_cast<TYPE<T1, T2, T3> &> (EXPR) +# define PACE_reinterpret_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) reinterpret_cast<TYPE<T1, T2, T3, T4> &> (EXPR) +# define PACE_reinterpret_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) reinterpret_cast<TYPE<T1, T2, T3, T4, T5> &> (EXPR) + +# if defined (PACE_LACKS_RTTI) +# define PACE_dynamic_cast(TYPE, EXPR) static_cast<TYPE> (EXPR) +# define PACE_dynamic_cast_1_ptr(TYPE, T1, EXPR) static_cast<TYPE<T1> *> (EXPR) +# define PACE_dynamic_cast_2_ptr(TYPE, T1, T2, EXPR) static_cast<TYPE<T1, T2> *> (EXPR) +# define PACE_dynamic_cast_3_ptr(TYPE, T1, T2, T3, EXPR) static_cast<TYPE<T1, T2, T3> *> (EXPR) +# define PACE_dynamic_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) static_cast<TYPE<T1, T2, T3, T4> *> (EXPR) +# define PACE_dynamic_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) static_cast<TYPE<T1, T2, T3, T4, T5> *> (EXPR) +# define PACE_dynamic_cast_1_ref(TYPE, T1, EXPR) static_cast<TYPE<T1> &> (EXPR) +# define PACE_dynamic_cast_2_ref(TYPE, T1, T2, EXPR) static_cast<TYPE<T1, T2> &> (EXPR) +# define PACE_dynamic_cast_3_ref(TYPE, T1, T2, T3, EXPR) static_cast<TYPE<T1, T2, T3> &> (EXPR) +# define PACE_dynamic_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) static_cast<TYPE<T1, T2, T3, T4> &> (EXPR) +# define PACE_dynamic_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) static_cast<TYPE<T1, T2, T3, T4, T5> &> (EXPR) +# else /* ! PACE_LACKS_RTTI */ +# define PACE_dynamic_cast(TYPE, EXPR) dynamic_cast<TYPE> (EXPR) +# define PACE_dynamic_cast_1_ptr(TYPE, T1, EXPR) dynamic_cast<TYPE<T1> *> (EXPR) +# define PACE_dynamic_cast_2_ptr(TYPE, T1, T2, EXPR) dynamic_cast<TYPE<T1, T2> *> (EXPR) +# define PACE_dynamic_cast_3_ptr(TYPE, T1, T2, T3, EXPR) dynamic_cast<TYPE<T1, T2, T3> *> (EXPR) +# define PACE_dynamic_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) dynamic_cast<TYPE<T1, T2, T3, T4> *> (EXPR) +# define PACE_dynamic_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) dynamic_cast<TYPE<T1, T2, T3, T4, T5> *> (EXPR) +# define PACE_dynamic_cast_1_ref(TYPE, T1, EXPR) dynamic_cast<TYPE<T1> &> (EXPR) +# define PACE_dynamic_cast_2_ref(TYPE, T1, T2, EXPR) dynamic_cast<TYPE<T1, T2> &> (EXPR) +# define PACE_dynamic_cast_3_ref(TYPE, T1, T2, T3, EXPR) dynamic_cast<TYPE<T1, T2, T3> &> (EXPR) +# define PACE_dynamic_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) dynamic_cast<TYPE<T1, T2, T3, T4> &> (EXPR) +# define PACE_dynamic_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) dynamic_cast<TYPE<T1, T2, T3, T4, T5> &> (EXPR) +# endif /* ! PACE_LACKS_RTTI */ + +# else + +# define PACE_sap_any_cast(TYPE) ((TYPE) (PACE_Addr::sap_any)) + +# define PACE_static_cast(TYPE, EXPR) ((TYPE) (EXPR)) +# define PACE_static_cast_1_ptr(TYPE, T1, EXPR) ((TYPE<T1> *) (EXPR)) +# define PACE_static_cast_2_ptr(TYPE, T1, T2, EXPR) ((TYPE<T1, T2> *) (EXPR)) +# define PACE_static_cast_3_ptr(TYPE, T1, T2, T3, EXPR) ((TYPE<T1, T2, T3> *) (EXPR)) +# define PACE_static_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) ((TYPE<T1, T2, T3, T4> *) (EXPR)) +# define PACE_static_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) ((TYPE<T1, T2, T3, T4, T5> *) (EXPR)) +# define PACE_static_cast_1_ref(TYPE, T1, EXPR) ((TYPE<T1> &) (EXPR)) +# define PACE_static_cast_2_ref(TYPE, T1, T2, EXPR) ((TYPE<T1, T2> &) (EXPR)) +# define PACE_static_cast_3_ref(TYPE, T1, T2, T3, EXPR) ((TYPE<T1, T2, T3> &) (EXPR)) +# define PACE_static_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) ((TYPE<T1, T2, T3, T4> &) (EXPR)) +# define PACE_static_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) ((TYPE<T1, T2, T3, T4, T5> &) (EXPR)) + +# define PACE_const_cast(TYPE, EXPR) ((TYPE) (EXPR)) +# define PACE_const_cast_1_ptr(TYPE, T1, EXPR) ((TYPE<T1> *) (EXPR)) +# define PACE_const_cast_2_ptr(TYPE, T1, T2, EXPR) ((TYPE<T1, T2> *) (EXPR)) +# define PACE_const_cast_3_ptr(TYPE, T1, T2, T3, EXPR) ((TYPE<T1, T2, T3> *) (EXPR)) +# define PACE_const_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) ((TYPE<T1, T2, T3, T4> *) (EXPR)) +# define PACE_const_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) ((TYPE<T1, T2, T3, T4, T5> *) (EXPR)) +# define PACE_const_cast_1_ref(TYPE, T1, EXPR) ((TYPE<T1> &) (EXPR)) +# define PACE_const_cast_2_ref(TYPE, T1, T2, EXPR) ((TYPE<T1, T2> &) (EXPR)) +# define PACE_const_cast_3_ref(TYPE, T1, T2, T3, EXPR) ((TYPE<T1, T2, T3> &) (EXPR)) +# define PACE_const_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) ((TYPE<T1, T2, T3, T4> &) (EXPR)) +# define PACE_const_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) ((TYPE<T1, T2, T3, T4, T5> &) (EXPR)) + +# define PACE_reinterpret_cast(TYPE, EXPR) ((TYPE) (EXPR)) +# define PACE_reinterpret_cast_1_ptr(TYPE, T1, EXPR) ((TYPE<T1> *) (EXPR)) +# define PACE_reinterpret_cast_2_ptr(TYPE, T1, T2, EXPR) ((TYPE<T1, T2> *) (EXPR)) +# define PACE_reinterpret_cast_3_ptr(TYPE, T1, T2, T3, EXPR) ((TYPE<T1, T2, T3> *) (EXPR)) +# define PACE_reinterpret_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) ((TYPE<T1, T2, T3, T4> *) (EXPR)) +# define PACE_reinterpret_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) ((TYPE<T1, T2, T3, T4, T5> *) (EXPR)) +# define PACE_reinterpret_cast_1_ref(TYPE, T1, EXPR) ((TYPE<T1> &) (EXPR)) +# define PACE_reinterpret_cast_2_ref(TYPE, T1, T2, EXPR) ((TYPE<T1, T2> &) (EXPR)) +# define PACE_reinterpret_cast_3_ref(TYPE, T1, T2, T3, EXPR) ((TYPE<T1, T2, T3> &) (EXPR)) +# define PACE_reinterpret_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) ((TYPE<T1, T2, T3, T4> &) (EXPR)) +# define PACE_reinterpret_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) ((TYPE<T1, T2, T3, T4, T5> &) (EXPR)) + +# define PACE_dynamic_cast(TYPE, EXPR) ((TYPE) (EXPR)) +# define PACE_dynamic_cast_1_ptr(TYPE, T1, EXPR) ((TYPE<T1> *) (EXPR)) +# define PACE_dynamic_cast_2_ptr(TYPE, T1, T2, EXPR) ((TYPE<T1, T2> *) (EXPR)) +# define PACE_dynamic_cast_3_ptr(TYPE, T1, T2, T3, EXPR) ((TYPE<T1, T2, T3> *) (EXPR)) +# define PACE_dynamic_cast_4_ptr(TYPE, T1, T2, T3, T4, EXPR) ((TYPE<T1, T2, T3, T4> *) (EXPR)) +# define PACE_dynamic_cast_5_ptr(TYPE, T1, T2, T3, T4, T5, EXPR) ((TYPE<T1, T2, T3, T4, T5> *) (EXPR)) +# define PACE_dynamic_cast_1_ref(TYPE, T1, EXPR) ((TYPE<T1> &) (EXPR)) +# define PACE_dynamic_cast_2_ref(TYPE, T1, T2, EXPR) ((TYPE<T1, T2> &) (EXPR)) +# define PACE_dynamic_cast_3_ref(TYPE, T1, T2, T3, EXPR) ((TYPE<T1, T2, T3> &) (EXPR)) +# define PACE_dynamic_cast_4_ref(TYPE, T1, T2, T3, T4, EXPR) ((TYPE<T1, T2, T3, T4> &) (EXPR)) +# define PACE_dynamic_cast_5_ref(TYPE, T1, T2, T3, T4, T5, EXPR) ((TYPE<T1, T2, T3, T4, T5> &) (EXPR)) +# endif /* PACE_HAS_ANSI_CASTS */ + +# if !defined (PACE_CAST_CONST) +/* Sun CC 4.2, for example, requires const in reinterpret casts of + * data members in const member functions. But, other compilers + * complain about the useless const. This keeps everyone happy. + */ +# if defined (__SUNPRO_CC) +# define PACE_CAST_CONST const +# else /* ! __SUNPRO_CC */ +# define PACE_CAST_CONST +# endif /* ! __SUNPRO_CC */ +# endif /* ! PACE_CAST_CONST */ + +/* Deal with MSVC++ insanity for CORBA... */ +# if defined (PACE_HAS_BROKEN_NAMESPPACES) +# define PACE_CORBA_1(NAME) CORBA_##NAME +# define PACE_CORBA_2(TYPE, NAME) CORBA_##TYPE##_##NAME +# define PACE_CORBA_3(TYPE, NAME) CORBA_##TYPE::NAME +# define PACE_NESTED_CLASS(TYPE, NAME) NAME +# else /* ! PACE_HAS_BROKEN_NAMESPPACES */ +# define PACE_CORBA_1(NAME) CORBA::NAME +# define PACE_CORBA_2(TYPE, NAME) CORBA::TYPE::NAME +# define PACE_CORBA_3(TYPE, NAME) CORBA::TYPE::NAME +# define PACE_NESTED_CLASS(TYPE, NAME) TYPE::NAME +# endif /* ! PACE_HAS_BROKEN_NAMESPPACES */ + + +#endif /* PACE_CONFIG_COMPILER_H */ diff --git a/PACE/pace/config/config.h b/PACE/pace/config/config.h new file mode 100644 index 00000000000..bd5632896a0 --- /dev/null +++ b/PACE/pace/config/config.h @@ -0,0 +1,27 @@ +/* + * $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * config.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_CONFIG_CONFIG_H +#define PACE_CONFIG_CONFIG_H + + +#include "pace/config/config_sunos_5.7.h" + + +#endif /* PACE_CONFIG_CONFIG_H */ + + diff --git a/PACE/pace/config/config_sunos_5.7.h b/PACE/pace/config/config_sunos_5.7.h new file mode 100644 index 00000000000..fd8c1be2754 --- /dev/null +++ b/PACE/pace/config/config_sunos_5.7.h @@ -0,0 +1,48 @@ +/* + * $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace (posix ace) + * + * = FILENAME + * PACE_CONFIG_SUNOS_5.7.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef CONFIG_PACE_CONFIG_SUNOS_5_7_H +#define CONFIG_PACE_CONFIG_SUNOS_5_7_H + + +# define __EXTENSIONS__ +# define PACE_EXTENSIONS + +# define _REENTRANT +# define PACE_HAS_REENTRANT + +# define _POSIX_PTHREAD_SEMANTICS +# define PACE_HAS_POSIX_PTHREAD_SEMANTICS + +/* OS/PACE_mqueue.h */ +# define PACE_HAS_RT + +/* No wchar_t support. */ +# if defined PACE_HAS_WCHAR +# undef PACE_HAS_WCHAR +# endif /* No wchar_t support. */ + +/* Sun has no wchar_t support. */ +# if defined PACE_USES_WCHAR +# undef PACE_USES_WCHAR +# endif /* No wchar_t support. */ + +/* !PACE_HAS_SIN_LEN */ +/* # define PACE_HAS_SIN_LEN */ + + +#endif /* CONFIG_PACE_CONFIG_SUNOS_5_7_H */ diff --git a/PACE/pace/config/constants.h b/PACE/pace/config/constants.h new file mode 100644 index 00000000000..50d51577eb7 --- /dev/null +++ b/PACE/pace/config/constants.h @@ -0,0 +1,57 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * constants.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_CONFIG_CONSTANTS_H +#define PACE_CONFIG_CONSTANTS_H + + +/* States of a recyclable object.*/ +enum ACE_Recyclable_State +{ + ACE_RECYCLABLE_IDLE_AND_PURGABLE, + /* Idle and can be purged.*/ + + ACE_RECYCLABLE_IDLE_BUT_NOT_PURGABLE, + /* Idle but cannot be purged. */ + + ACE_RECYCLABLE_PURGABLE_BUT_NOT_IDLE, + /* Can be purged, but is not idle (mostly for debugging). */ + + ACE_RECYCLABLE_BUSY, + /* Busy (i.e., cannot be recycled or purged). */ + + ACE_RECYCLABLE_CLOSED, + /* Closed. */ + + ACE_RECYCLABLE_UNKNOWN + /* Unknown state. */ +}; + +/* Do not change these values wantonly since GPERF depends on them.. */ +#define PACE_ASCII_SIZE 128 +#define PACE_EBCDIC_SIZE 256 + +/* The maximum length for a fully qualified Internet name. */ +# if !defined (PACE_MAX_FULLY_QUALIFIED_NAME_LEN) +# define PACE_MAX_FULLY_QUALIFIED_NAME_LEN 256 +# endif /* PACE_MAX_FULLY_QUALIFIED_NAME_LEN */ + +/* Maximum host namelength. */ +# if !defined(PACE_MAX_HOST_NAME_LEN) +# define PACE_MAX_HOST_NAME_LEN 256 +# endif /* PACE_MAXHOSTNAMELEN */ + +#endif /* PACE_CONFIG_CONSTANTS_H */ diff --git a/PACE/pace/config/defaults.h b/PACE/pace/config/defaults.h new file mode 100644 index 00000000000..1c7450583b1 --- /dev/null +++ b/PACE/pace/config/defaults.h @@ -0,0 +1,301 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * defaults.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_CONFIG_DEFAULTS_H +#define PACE_CONFIG_DEFAULTS_H + + +/* Define the default constants for PACE. Many of these are used for + * the PACE tests and applications. You can change these values by + * defining the macros in your config.h file. */ + +# if !defined (PACE_DEFAULT_TIMEOUT) +# define PACE_DEFAULT_TIMEOUT 5 +# endif /* PACE_DEFAULT_TIMEOUT */ + +# if !defined (PACE_DEFAULT_BACKLOG) +# define PACE_DEFAULT_BACKLOG 5 +# endif /* PACE_DEFAULT_BACKLOG */ + +# if !defined (PACE_DEFAULT_THREADS) +# define PACE_DEFAULT_THREADS 1 +# endif /* PACE_DEFAULT_THREADS */ + +/* The following 3 defines are used in the IP multicast and broadcast tests. */ +# if !defined (PACE_DEFAULT_BROADCAST_PORT) +# define PACE_DEFAULT_BROADCAST_PORT 10000 +# endif /* PACE_DEFAULT_BROADCAST_PORT */ + +# if !defined (PACE_DEFAULT_MULTICAST_PORT) +# define PACE_DEFAULT_MULTICAST_PORT 10001 +# endif /* PACE_DEFAULT_MULTICAST_PORT */ + +# if !defined (PACE_DEFAULT_MULTICAST_ADDR) +/* This address MUST be within the range for host group addresses: + * 224.0.0.0 to 239.255.255.255. */ +# define PACE_DEFAULT_MULTICAST_ADDR "224.9.9.2" +# endif /* PACE_DEFAULT_MULTICAST_ADDR */ + +/* Default port number for HTTP. */ +# if !defined (PACE_DEFAULT_HTTP_SERVER_PORT) +# define PACE_DEFAULT_HTTP_SERVER_PORT 80 +# endif /* PACE_DEFAULT_HTTP_SERVER_PORT */ + +/* Used in many IPC_SAP tests */ +# if !defined (PACE_DEFAULT_SERVER_PORT) +# define PACE_DEFAULT_SERVER_PORT 10002 +# endif /* PACE_DEFAULT_SERVER_PORT */ + +# if !defined (PACE_DEFAULT_HTTP_PORT) +# define PACE_DEFAULT_HTTP_PORT 80 +# endif /* PACE_DEFAULT_HTTP_PORT */ + +# if !defined (PACE_DEFAULT_MAX_SOCKET_BUFSIZ) +# define PACE_DEFAULT_MAX_SOCKET_BUFSIZ 65536 +# endif /* PACE_DEFAULT_MAX_SOCKET_BUFSIZ */ + +# if !defined (PACE_DEFAULT_SERVER_PORT_STR) +# define PACE_DEFAULT_SERVER_PORT_STR "10002" +# endif /* PACE_DEFAULT_SERVER_PORT_STR */ + +/* Used for the Service_Directory test */ +# if !defined (PACE_DEFAULT_SERVICE_PORT) +# define PACE_DEFAULT_SERVICE_PORT 10003 +# endif /* PACE_DEFAULT_SERVICE_PORT */ + +/* Used for the PACE_Thread_Spawn test */ +# if !defined (PACE_DEFAULT_THR_PORT ) +# define PACE_DEFAULT_THR_PORT 10004 +# endif /* PACE_DEFAULT_THR_PORT */ + +/* Used for <SOCK_Connect::connect> tests */ +# if !defined (PACE_DEFAULT_LOCAL_PORT) +# define PACE_DEFAULT_LOCAL_PORT 10005 +# endif /* PACE_DEFAULT_LOCAL_PORT */ + +/* Used for Connector tests */ +# if !defined (PACE_DEFAULT_LOCAL_PORT_STR) +# define PACE_DEFAULT_LOCAL_PORT_STR "10005" +# endif /* PACE_DEFAULT_LOCAL_PORT_STR */ + +/* Used for the name server. */ +# if !defined (PACE_DEFAULT_NAME_SERVER_PORT) +# define PACE_DEFAULT_NAME_SERVER_PORT 10006 +# endif /* PACE_DEFAULT_NAME_SERVER_PORT */ + +# if !defined (PACE_DEFAULT_NAME_SERVER_PORT_STR) +# define PACE_DEFAULT_NAME_SERVER_PORT_STR "10006" +# endif /* PACE_DEFAULT_NAME_SERVER_PORT_STR */ + +/* Used for the token server. */ +# if !defined (PACE_DEFAULT_TOKEN_SERVER_PORT) +# define PACE_DEFAULT_TOKEN_SERVER_PORT 10007 +# endif /* PACE_DEFAULT_TOKEN_SERVER_PORT */ + +# if !defined (PACE_DEFAULT_TOKEN_SERVER_PORT_STR) +# define PACE_DEFAULT_TOKEN_SERVER_PORT_STR "10007" +# endif /* PACE_DEFAULT_TOKEN_SERVER_PORT_STR */ + +/* Used for the logging server. */ +# if !defined (PACE_DEFAULT_LOGGING_SERVER_PORT) +# define PACE_DEFAULT_LOGGING_SERVER_PORT 10008 +# endif /* PACE_DEFAULT_LOGGING_SERVER_PORT */ + +# if !defined (PACE_DEFAULT_LOGGING_SERVER_PORT_STR) +# define PACE_DEFAULT_LOGGING_SERVER_PORT_STR "10008" +# endif /* PACE_DEFAULT_LOGGING_SERVER_PORT_STR */ + +/* Used for the logging server. */ +# if !defined (PACE_DEFAULT_THR_LOGGING_SERVER_PORT) +# define PACE_DEFAULT_THR_LOGGING_SERVER_PORT 10008 +# endif /* PACE_DEFAULT_THR_LOGGING_SERVER_PORT */ + +# if !defined (PACE_DEFAULT_THR_LOGGING_SERVER_PORT_STR) +# define PACE_DEFAULT_THR_LOGGING_SERVER_PORT_STR "10008" +# endif /* PACE_DEFAULT_THR_LOGGING_SERVER_PORT_STR */ + +/* Used for the time server. */ +# if !defined (PACE_DEFAULT_TIME_SERVER_PORT) +# define PACE_DEFAULT_TIME_SERVER_PORT 10009 +# endif /* PACE_DEFAULT_TIME_SERVER_PORT */ + +# if !defined (PACE_DEFAULT_TIME_SERVER_PORT_STR) +# define PACE_DEFAULT_TIME_SERVER_PORT_STR "10009" +# endif /* PACE_DEFAULT_TIME_SERVER_PORT_STR */ + +# if !defined (PACE_DEFAULT_TIME_SERVER_STR) +# define PACE_DEFAULT_TIME_SERVER_STR "PACE_TS_TIME" +# endif /* PACE_DEFAULT_TIME_SERVER_STR */ + +/* Used by the FIFO tests and the Client_Logging_Handler netsvc. */ +# if !defined (PACE_DEFAULT_RENDEZVOUS) +# if defined (PACE_HAS_STREAM_PIPES) +# define PACE_DEFAULT_RENDEZVOUS "/tmp/fifo.PACE" +# else +# define PACE_DEFAULT_RENDEZVOUS "localhost:10010" +# endif /* PACE_HAS_STREAM_PIPES */ +# endif /* PACE_DEFAULT_RENDEZVOUS */ + +# if !defined (PACE_DEFAULT_LOGGER_KEY) +# if defined (PACE_HAS_UNICODE) && defined (UNICODE) +# if defined (PACE_HAS_STREAM_PIPES) +# define PACE_DEFAULT_LOGGER_KEY L"/tmp/server_daemon" +# else +# define PACE_DEFAULT_LOGGER_KEY L"localhost:10012" +# endif /* PACE_HAS_STREAM_PIPES */ +# else /* PACE_HAS_UNICODE */ +# if defined (PACE_HAS_STREAM_PIPES) +# define PACE_DEFAULT_LOGGER_KEY "/tmp/server_daemon" +# else +# define PACE_DEFAULT_LOGGER_KEY "localhost:10012" +# endif /* PACE_HAS_STREAM_PIPES */ +# endif /* PACE_HAS_UNICODE && UNICODE */ +# endif /* PACE_DEFAULT_LOGGER_KEY */ + +/* The way to specify the local host for loopback IP. This is usually + * "localhost" but it may need changing on some platforms. */ +# if !defined (PACE_LOCALHOST) +# define PACE_LOCALHOST ASYS_TEXT("localhost") +# endif + +# if !defined (PACE_DEFAULT_SERVER_HOST) +# define PACE_DEFAULT_SERVER_HOST PACE_LOCALHOST +# endif /* PACE_DEFAULT_SERVER_HOST */ + +/* Default shared memory key */ +# if !defined (PACE_DEFAULT_SHM_KEY) +# define PACE_DEFAULT_SHM_KEY 1234 +# endif /* PACE_DEFAULT_SHM_KEY */ + +/* Default segment size used by SYSV shared memory (128 K) */ +# if !defined (PACE_DEFAULT_SEGMENT_SIZE) +# define PACE_DEFAULT_SEGMENT_SIZE 1024 * 128 +# endif /* PACE_DEFAULT_SEGMENT_SIZE */ + +/* Maximum number of SYSV shared memory segments + * (does anyone know how to figure out the right values?!) */ +# if !defined (PACE_DEFAULT_MAX_SEGMENTS) +# define PACE_DEFAULT_MAX_SEGMENTS 6 +# endif /* PACE_DEFAULT_MAX_SEGMENTS */ + +/* Name of the map that's stored in shared memory. */ +# if !defined (PACE_NAME_SERVER_MAP) +# define PACE_NAME_SERVER_MAP "Name Server Map" +# endif /* PACE_NAME_SERVER_MAP */ + +/* Default file permissions. */ +# if !defined (PACE_DEFAULT_FILE_PERMS) +# define PACE_DEFAULT_FILE_PERMS 0666 +# endif /* PACE_DEFAULT_FILE_PERMS */ + +/* Default directory permissions. */ +# if !defined (PACE_DEFAULT_DIR_PERMS) +# define PACE_DEFAULT_DIR_PERMS 0777 +# endif /* PACE_DEFAULT_DIR_PERMS */ + +/* Default size of the PACE Reactor. */ +# if !defined (PACE_DEFAULT_SELECT_REACTOR_SIZE) +# define PACE_DEFAULT_SELECT_REACTOR_SIZE FD_SETSIZE +# endif /* PACE_DEFAULT_SELECT_REACTOR_SIZE */ + +# if !defined (PACE_DEFAULT_TIMEPROBE_TABLE_SIZE) +# define PACE_DEFAULT_TIMEPROBE_TABLE_SIZE 8 * 1024 +# endif /* PACE_DEFAULT_TIMEPROBE_TABLE_SIZE */ + +/* Default size of the PACE Map_Manager. */ +# if !defined (PACE_DEFAULT_MAP_SIZE) +# define PACE_DEFAULT_MAP_SIZE 1024 +# endif /* PACE_DEFAULT_MAP_SIZE */ + +/* Defaults for PACE Timer Wheel */ +# if !defined (PACE_DEFAULT_TIMER_WHEEL_SIZE) +# define PACE_DEFAULT_TIMER_WHEEL_SIZE 1024 +# endif /* PACE_DEFAULT_TIMER_WHEEL_SIZE */ + +# if !defined (PACE_DEFAULT_TIMER_WHEEL_RESOLUTION) +# define PACE_DEFAULT_TIMER_WHEEL_RESOLUTION 100 +# endif /* PACE_DEFAULT_TIMER_WHEEL_RESOLUTION */ + +/* Default size for PACE Timer Hash table */ +# if !defined (PACE_DEFAULT_TIMER_HASH_TABLE_SIZE) +# define PACE_DEFAULT_TIMER_HASH_TABLE_SIZE 1024 +# endif /* PACE_DEFAULT_TIMER_HASH_TABLE_SIZE */ + +/* Defaults for the PACE Free List */ +# if !defined (PACE_DEFAULT_FREE_LIST_PREALLOC) +# define PACE_DEFAULT_FREE_LIST_PREALLOC 0 +# endif /* PACE_DEFAULT_FREE_LIST_PREALLOC */ + +# if !defined (PACE_DEFAULT_FREE_LIST_LWM) +# define PACE_DEFAULT_FREE_LIST_LWM 0 +# endif /* PACE_DEFAULT_FREE_LIST_LWM */ + +# if !defined (PACE_DEFAULT_FREE_LIST_HWM) +# define PACE_DEFAULT_FREE_LIST_HWM 25000 +# endif /* PACE_DEFAULT_FREE_LIST_HWM */ + +# if !defined (PACE_DEFAULT_FREE_LIST_INC) +# define PACE_DEFAULT_FREE_LIST_INC 100 +# endif /* PACE_DEFAULT_FREE_LIST_INC */ + +# if !defined (PACE_UNIQUE_NAME_LEN) +# define PACE_UNIQUE_NAME_LEN 100 +# endif /* PACE_UNIQUE_NAME_LEN */ + +# if !defined (PACE_MAX_DGRAM_SIZE) + /* This is just a guess. 8k is the normal limit on + * most machines because that's what NFS expects. */ +# define PACE_MAX_DGRAM_SIZE 8192 +# endif /* PACE_MAX_DGRAM_SIZE */ + +# if !defined (PACE_DEFAULT_ARGV_BUFSIZ) +# define PACE_DEFAULT_ARGV_BUFSIZ 1024 * 4 +# endif /* PACE_DEFAULT_ARGV_BUFSIZ */ + +# if !defined (PACE_DEFAULT_PAGEFILE_POOL_BASE) +# define PACE_DEFAULT_PAGEFILE_POOL_BASE (void *) 0 +# endif /* PACE_DEFAULT_PAGEFILE_POOL_BASE */ + +# if !defined (PACE_DEFAULT_PAGEFILE_POOL_SIZE) +# define PACE_DEFAULT_PAGEFILE_POOL_SIZE (size_t) 0x01000000 +# endif /* PACE_DEFAULT_PAGEFILE_POOL_SIZE */ + +# if !defined (PACE_DEFAULT_PAGEFILE_POOL_CHUNK) +# define PACE_DEFAULT_PAGEFILE_POOL_CHUNK (size_t) 0x00010000 +# endif /* PACE_DEFAULT_PAGEFILE_POOL_CHUNK */ + +# if !defined (PACE_DEFAULT_PAGEFILE_POOL_NAME) +# define PACE_DEFAULT_PAGEFILE_POOL_NAME ACE_TEXT ("Default_ACE_Pagefile_Memory_Pool") +# endif /* PACE_DEFAULT_PAGEFILE_POOL_NAME */ + +# if !defined (PACE_DEFAULT_MESSAGE_BLOCK_PRIORITY) +# define PACE_DEFAULT_MESSAGE_BLOCK_PRIORITY 0 +# endif /* PACE_DEFAULT_MESSAGE_BLOCK_PRIORITY */ + +# if !defined (PACE_DEFAULT_SERVICE_REPOSITORY_SIZE) +# define PACE_DEFAULT_SERVICE_REPOSITORY_SIZE 1024 +# endif /* PACE_DEFAULT_SERVICE_REPOSITORY_SIZE */ + +# if !defined (PACE_REACTOR_NOTIFICATION_ARRAY_SIZE) +# define PACE_REACTOR_NOTIFICATION_ARRAY_SIZE 1024 +# endif /* PACE_REACTOR_NOTIFICATION_ARRAY_SIZE */ + +# if !defined (PACE_DEFAULT_CLOSE_ALL_HANDLES) +# define PACE_DEFAULT_CLOSE_ALL_HANDLES 1 +# endif /* PACE_DEFAULT_CLOSE_ALL_HANDLES */ + + +#endif /* PACE_CONFIG_DEFAULTS_H */ diff --git a/PACE/pace/config/platform.h b/PACE/pace/config/platform.h new file mode 100644 index 00000000000..cdd0a5d176f --- /dev/null +++ b/PACE/pace/config/platform.h @@ -0,0 +1,78 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * platform.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_CONFIG_PLATFORM_H +#define PACE_CONFIG_PLATFORM_H + + +/* Added this because Linux does not support the pragma directive. */ +# if defined (linux) +# define PACE_NOT_POSIX + +/* I don't think this is correct <luther@cs.wustl.edu> May 16, 2000, +# elif defined PACE_NOT_POSIX +# undef PACE_NOT_POSIX +*/ + +# endif /* linux */ + +/* WHAT? <luther@cs.wustl.edu> May 16, 2000, +# if !defined PACE_NOT_POSIX +# define PACE_LACKS_PRAGMA_ONCE +# endif +*/ + +/* SEE THE ABOVE COMMENTED OUT? <luther@cs.wustl.edu> May 16, 2000, */ +# if defined PACE_NOT_POSIX +# define PACE_LACKS_PRAGMA_ONCE +# endif + + + + + + + +# if !defined (PACE_MALLOC_ALIGN) +# define PACE_MALLOC_ALIGN ((int) sizeof (long)) +# endif /* PACE_MALLOC_ALIGN */ + +# if 'a' < 'A' +# define PACE_HAS_EBCDIC +# define PACE_STANDARD_CHARACTER_SET_SIZE 256 +# else +# define PACE_HAS_ASCII +# define PACE_STANDARD_CHARACTER_SET_SIZE 128 +# endif /* 'a' < 'A' */ + +# if defined (PACE_HAS_MOSTLY_UNICODE_APIS) && !defined (UNICODE) +# error UNICODE must be defined when using ACE_HAS_MOSTLY_UNICODE_APIS, check your compiler document on how to enable UNICODE. +# endif /* PACE_HAS_MOSTLY_UNICODE_APIS && !UNICODE */ + +# if defined (PACE_HAS_4_4BSD_SENDMSG_RECVMSG) + // Control message size to pass a file descriptor. +# define PACE_BSD_CONTROL_MSG_LEN sizeof (struct cmsghdr) + sizeof (PACE_HANDLE) +# if defined (PACE_LACKS_CMSG_DATA_MACRO) +# if defined (PACE_LACKS_CMSG_DATA_MEMBER) +# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) +# else +# define CMSG_DATA(cmsg) ((cmsg)->cmsg_data) +# endif /* PACE_LACKS_CMSG_DATA_MEMBER */ +# endif /* PACE_LACKS_CMSG_DATA_MACRO */ +# endif /* PACE_HAS_4_4BSD_SENDMSG_RECVMSG */ + + +#endif /* PACE_CONFIG_PLATFORM_H */ diff --git a/PACE/pace/config/temp.h b/PACE/pace/config/temp.h new file mode 100644 index 00000000000..a41de332349 --- /dev/null +++ b/PACE/pace/config/temp.h @@ -0,0 +1,101 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * temp.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_CONFIG_TEMP_H +#define PACE_CONFIG_TEMP_H + + +/* Temporary MACROS. Correct them later. Will probably be in OS.h or ACE.h. */ + + +#include "pace/sys/types.h" +#include "pace/stdio.h" + +/* Need for NT */ +# define PACE_Export +# define PACE_BUILD_DLL + +/* Tracing */ +# define PACE_TRACE(X) fprintf (stderr, X) +# define PACE_DEBUG(X) +# define PACE_LM_DEBUG PACE_stderr +# define PACE_BEGIN_DUMP +# define PACE_END_DUMP + +/* Identification for PACE.h */ +# define PACE_RCSID(X,Y,Z) + +/* Hooks */ +/* Dummy values */ +# define PACE_ALLOC_HOOK_DECLARE int declare_hook +# define PACE_ALLOC_HOOK_DEFINE(X) + +/* Signals / ioctl / fcntl - dummy values */ +# define PACE_SIGURG 1 +# define PACE_NONBLOCK 2 +# define PACE_CLOEXEC 3 + +/* Flags */ +/* Will not be a macro, dummy values */ +# define PACE_set_flags(X,Y) 1 +# define PACE_clr_flags(X,Y) 1 + +/* Log Error */ +# define PACE_ERROR(X) + +/* Host Entries */ +# if defined (PACE_HAS_STRUCT_NETDB_DATA) +typedef char PACE_HOSTENT_DATA[sizeof(struct hostent_data)]; +typedef char PACE_SERVENT_DATA[sizeof(struct servent_data)]; +typedef char PACE_PROTOENT_DATA[sizeof(struct protoent_data)]; +# else +# if !defined PACE_HOSTENT_DATA_SIZE +# define PACE_HOSTENT_DATA_SIZE (4*1024) +# endif /* PACE_HOSTENT_DATA_SIZE */ +# if !defined PACE_SERVENT_DATA_SIZE +# define PACE_SERVENT_DATA_SIZE (4*1024) +# endif /*PACE_SERVENT_DATA_SIZE */ +# if !defined PACE_PROTOENT_DATA_SIZE +# define PACE_PROTOENT_DATA_SIZE (2*1024) +# endif /*PACE_PROTOENT_DATA_SIZE */ +typedef char PACE_HOSTENT_DATA[PACE_HOSTENT_DATA_SIZE]; +typedef char PACE_SERVENT_DATA[PACE_SERVENT_DATA_SIZE]; +typedef char PACE_PROTOENT_DATA[PACE_PROTOENT_DATA_SIZE]; +# endif /* PACE_HAS_STRUCT_NETDB_DATA */ + +/* PACE_HAS_SIN_LEN */ + +/* PACE_UNUSED_ARG */ +# define PACE_UNUSED_ARG(X) + +/* PACE_FREE */ +/* adjust later to use macros to decide how to free */ +# define PACE_FREE(X,Y) \ +X Y + +# define AF_ANY -1 + +/* PACE CATCHALL */ +/* FIONREAD is used in PACE_SOCK_IO::recvv */ +/* PACE_HAS_ALLOCA is used in PACE_SOCK_IO::recvv */ + +/* Define some helpful constants. */ +/* Not type-safe, and signed. For backward compatibility. */ +#define PACE_ONE_SECOND_IN_MSECS 1000L +#define PACE_ONE_SECOND_IN_USECS 1000000L +#define PACE_ONE_SECOND_IN_NSECS 1000000000L + +#endif /* PACE_CONFIG_TEMP_H */ diff --git a/PACE/pace/config/utility.h b/PACE/pace/config/utility.h new file mode 100644 index 00000000000..233602f52c5 --- /dev/null +++ b/PACE/pace/config/utility.h @@ -0,0 +1,21 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * utility.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_CONFIG_UTILITY_H +#define PACE_CONFIG_UTILITY_H + + +#endif /* PACE_CONFIG_UTILITY_H */ diff --git a/PACE/pace/defines.h b/PACE/pace/defines.h new file mode 100644 index 00000000000..414204c9d2f --- /dev/null +++ b/PACE/pace/defines.h @@ -0,0 +1,33 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * defines.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_DEFINES_H +#define PACE_DEFINES_H + + +#include "pace/config/config.h" +#include "pace/config/platform.h" +#include "pace/config/compiler.h" +#include "pace/config/codes.h" +#include "pace/config/constants.h" +#include "pace/config/defaults.h" +#include "pace/config/utility.h" + +/* Temporary <luther@cs.wustl.edu> */ +#include "pace/config/temp.h" + + +#endif /* PACE_DEFINES_H */ diff --git a/PACE/pace/dirent.c b/PACE/pace/dirent.c new file mode 100644 index 00000000000..7442410cf78 --- /dev/null +++ b/PACE/pace/dirent.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * dirent.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/dirent.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/dirent.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/dirent.h b/PACE/pace/dirent.h new file mode 100644 index 00000000000..44ed2ea5e76 --- /dev/null +++ b/PACE/pace/dirent.h @@ -0,0 +1,51 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * dirent.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_DIRENT_H +#define PACE_DIRENT_H + + +#include "pace/defines.h" +#include "pace/sys/types.h" +#include <dirent.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE DIR * pace_opendir (const char * dirname); + + PACE_INLINE struct dirent * pace_readdir (DIR * dirp); + + PACE_INLINE int pace_readdir_r (DIR * dirp, struct dirent * entry, + struct dirent ** result); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE void pace_rewinddir (DIR * dirp); + + PACE_INLINE int pace_closedir (DIR * dirp); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/dirent.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_DIRENT_H */ diff --git a/PACE/pace/dirent.inl b/PACE/pace/dirent.inl new file mode 100644 index 00000000000..fe06d9b9533 --- /dev/null +++ b/PACE/pace/dirent.inl @@ -0,0 +1,56 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * dirent.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +DIR * +pace_opendir (const char * dirname) +{ + return opendir (dirname); +} + +PACE_INLINE +struct dirent * +pace_readdir (DIR * dirp) +{ + return readdir (dirp); +} + +PACE_INLINE +int +pace_readdir_r (DIR * dirp, struct dirent * entry, + struct dirent ** result) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return readdir_r (dirp, entry, result); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +void +pace_rewinddir (DIR * dirp) +{ + rewinddir (dirp); + return; +} + +PACE_INLINE +int +pace_closedir (DIR * dirp) +{ + return closedir (dirp); +} diff --git a/PACE/pace/fcntl.c b/PACE/pace/fcntl.c new file mode 100644 index 00000000000..b16560ed251 --- /dev/null +++ b/PACE/pace/fcntl.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * fcntl.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/fcntl.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/fcntl.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/fcntl.h b/PACE/pace/fcntl.h new file mode 100644 index 00000000000..6c38d350115 --- /dev/null +++ b/PACE/pace/fcntl.h @@ -0,0 +1,60 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * fnctl.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_FCNTL_H +#define PACE_FCNTL_H + + +#include "pace/defines.h" +#include "pace/sys/types.h" +#include "pace/unistd.h" +#include <sys/stat.h> +#include <fcntl.h> + + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE int pace_creat (const char * path, mode_t mode); + + # define pace_fcntl(X) fcntl X + /* int fcntl (int fildes, int cmd, *//* arg *//* ... ); + * + * PLEASE PAY SPECIAL ATTENTION HERE! + * This is a macro and requires an additional set of parenthesis + * surrounding the arguments. + */ + + # define pace_open(X) open X + /* int open (const char *path, int oflag, *//* mode_t mode *//* ... ); + * + * PLEASE PAY SPECIAL ATTENTION HERE! + * This is a macro and requires an additional set of parenthesis + * surrounding the arguments. + */ + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/fcntl.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_FCNTL_H */ diff --git a/PACE/pace/fcntl.inl b/PACE/pace/fcntl.inl new file mode 100644 index 00000000000..c2365994a2a --- /dev/null +++ b/PACE/pace/fcntl.inl @@ -0,0 +1,22 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * fcntl.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +int +pace_creat (const char * path, mode_t mode) +{ + return creat (path, mode); +} diff --git a/PACE/pace/grp.c b/PACE/pace/grp.c new file mode 100644 index 00000000000..4c7f075e4bc --- /dev/null +++ b/PACE/pace/grp.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * grp.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/grp.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/grp.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/grp.h b/PACE/pace/grp.h new file mode 100644 index 00000000000..c77e9e0d105 --- /dev/null +++ b/PACE/pace/grp.h @@ -0,0 +1,63 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace (posix ace) + * + * = FILENAME + * grp.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_GRP_H +#define PACE_GRP_H + + +#include "pace/defines.h" +#include <grp.h> + +/* Linux wants to use sys/types.h to define gid_t. + * Sun is happy with grp.h. */ +# if defined (linux) +#include "pace/sys/types.h" +# endif /* linux */ + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE struct group * pace_getgrgid (gid_t gid); + + PACE_INLINE int pace_getgrgid_r (gid_t gid, + struct group * grp, + char * buffer, + size_t bufsize, + struct group ** result); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE struct group * pace_getgrnam (const char * name); + + PACE_INLINE int pace_getgrnam_r (const char * name, + struct group * grp, + char * buffer, + size_t bufsize, + struct group ** result); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/grp.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_GRP_H */ diff --git a/PACE/pace/grp.inl b/PACE/pace/grp.inl new file mode 100644 index 00000000000..765f3e0bf03 --- /dev/null +++ b/PACE/pace/grp.inl @@ -0,0 +1,59 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * grp.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +struct group * +pace_getgrgid (gid_t gid) +{ + return getgrgid (gid); +} + +PACE_INLINE +int +pace_getgrgid_r (gid_t gid, + struct group * grp, + char * buffer, + size_t bufsize, + struct group ** result) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return getgrgid_r (gid, grp, buffer, bufsize, result); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +struct group * +pace_getgrnam (const char * name) +{ + return getgrnam (name); +} + +PACE_INLINE +int +pace_getgrnam_r (const char * name, + struct group * grp, + char * buffer, + size_t bufsize, + struct group ** result) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return getgrnam_r (name, grp, buffer, bufsize, result); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} diff --git a/PACE/pace/limits.h b/PACE/pace/limits.h new file mode 100644 index 00000000000..2ff607e0a54 --- /dev/null +++ b/PACE/pace/limits.h @@ -0,0 +1,35 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace (posix ace) + * + * = FILENAME + * limits.h + * + * = AUTHOR + * Joe Hoffert + * + * ============================================================================ */ + + +#ifndef PACE_LIMITS_H +#define PACE_LIMITS_H + + +#include "pace/defines.h" +#include <limits.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* (PACE_HAS_CPLUSPLUS) */ + + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + + +#endif /* PACE_LIMITS_H */ diff --git a/PACE/pace/mqueue.c b/PACE/pace/mqueue.c new file mode 100644 index 00000000000..7cadb63412a --- /dev/null +++ b/PACE/pace/mqueue.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace (posix ace) + * + * = FILENAME + * mqueue.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/mqueue.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/mqueue.inl" +# endif /* PACE_HAS_INLINE */ diff --git a/PACE/pace/mqueue.h b/PACE/pace/mqueue.h new file mode 100644 index 00000000000..e1ec3df740c --- /dev/null +++ b/PACE/pace/mqueue.h @@ -0,0 +1,80 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * mqueue.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_MQUEUE_H +#define PACE_MQUEUE_H + + +#include "pace/defines.h" + +/* Linux doesn't support this file at all. We will allow the interface, but + all return values will be PACE_ERRNO_LACKS_RT. */ +# if defined (linux) +typedef unsigned int mqd_t; +struct mq_attr { }; +struct sigevent { }; +#include "pace/unistd.h" +# else /* !linux */ +#include <mqueue.h> +#endif /* !linux */ + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE int pace_mq_close (mqd_t mqdes); + + PACE_INLINE int pace_mq_getattr (mqd_t mqdes, + struct mq_attr * mqstat); + + PACE_INLINE int pace_mq_notify (mqd_t mqdes, + const struct sigevent * notification); + + # define pace_mq_open(X) mq_open X + /* mqd_t mq_open (const char *name, int oflag, (*//* args *//*) ... ); + * + * PLEASE PAY SPECIAL ATTENTION HERE! + * This is a macro and requires an additional set of parenthesis + * surrounding the arguments. + */ + + PACE_INLINE ssize_t pace_mq_receive (mqd_t mqdes, + char * msg_ptr, + size_t msg_len, + unsigned int * nmsg_prio); + + PACE_INLINE int pace_mq_send (mqd_t mqdes, + const char * mst_ptr, + size_t msg_len, + unsigned int psg_prio); + + PACE_INLINE int pace_mq_setattr (mqd_t mqdes, + const struct mq_attr * mqstat, + struct mq_attr * omqstat); + + PACE_INLINE int pace_mq_unlink (const char * name); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/mqueue.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_MQUEUE_H */ diff --git a/PACE/pace/mqueue.inl b/PACE/pace/mqueue.inl new file mode 100644 index 00000000000..27fceac1a94 --- /dev/null +++ b/PACE/pace/mqueue.inl @@ -0,0 +1,102 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * mqueue.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +int +pace_mq_close (mqd_t mqdes) +{ +# if defined (PACE_HAS_RT) + return mq_close (mqdes); +# else /* !PACE_HAS_RT */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_RT); +# endif /* !PACE_HAS_RT */ +} + +PACE_INLINE +int +pace_mq_getattr (mqd_t mqdes, + struct mq_attr * mqstat) +{ +# if defined (PACE_HAS_RT) + return mq_getattr (mqdes, mqstat); +# else /* !PACE_HAS_RT */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_RT); +# endif /* !PACE_HAS_RT */ +} + +PACE_INLINE +int +pace_mq_notify (mqd_t mqdes, + const struct sigevent * notification) +{ +# if defined (PACE_HAS_RT) + return mq_notify (mqdes, notification); +# else /* !PACE_HAS_RT */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_RT); +# endif /* !PACE_HAS_RT */ +} + +PACE_INLINE +ssize_t +pace_mq_receive (mqd_t mqdes, + char * msg_ptr, + size_t msg_len, + unsigned int * msg_prio) +{ +# if defined (PACE_HAS_RT) + return mq_receive (mqdes, msg_ptr, msg_len, msg_prio); +# else /* !PACE_HAS_RT */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_RT); +# endif /* !PACE_HAS_RT */ +} + +PACE_INLINE +int +pace_mq_send (mqd_t mqdes, + const char * msg_ptr, + size_t msg_len, + unsigned int msg_prio) +{ +# if defined (PACE_HAS_RT) + return mq_send (mqdes, msg_ptr, msg_len, msg_prio); +# else /* !PACE_HAS_RT */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_RT); +# endif /* !PACE_HAS_RT */ +} + +PACE_INLINE +int +pace_mq_setattr (mqd_t mqdes, + const struct mq_attr * mqstat, + struct mq_attr * omqstat) +{ +# if defined (PACE_HAS_RT) + return mq_setattr (mqdes, mqstat, omqstat); +# else /* !PACE_HAS_RT */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_RT); +# endif /* !PACE_HAS_RT */ +} + +PACE_INLINE +int +pace_mq_unlink (const char * name) +{ +# if defined (PACE_HAS_RT) + return mq_unlink (name); +# else /* !PACE_HAS_RT */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_RT); +# endif /* !PACE_HAS_RT */ +} diff --git a/PACE/pace/netdb.c b/PACE/pace/netdb.c new file mode 100644 index 00000000000..5bc3f8a64fe --- /dev/null +++ b/PACE/pace/netdb.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * netdb.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/netdb.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/netdb.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/netdb.h b/PACE/pace/netdb.h new file mode 100644 index 00000000000..c7239a65ef7 --- /dev/null +++ b/PACE/pace/netdb.h @@ -0,0 +1,97 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * netdb.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_NETDB_H +#define PACE_NETDB_H + + +#include "pace/defines.h" +#include <netdb.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE struct hostent * pace_gethostbyaddr (const char * addr, + int len, + int type); + + PACE_INLINE struct hostent * pace_gethostbyaddr_r (const char * addr, + int length, + int type, + struct hostent * result, + char * buffer, + int buflen, + int * h_errnop); + + PACE_INLINE struct hostent * pace_gethostbyname (const char * name); + + PACE_INLINE struct hostent * pace_gethostbyname_r (const char * name, + struct hostent *result, + char * buffer, + int buflen, + int * h_errnop); + + PACE_INLINE struct hostent * pace_gethostent (); + + PACE_INLINE struct hostent * pace_gethostent_r (struct hostent * result, + char * buffer, + int buflen, + int * h_errnop); + + PACE_INLINE int pace_sethostent (int stayopen); + + PACE_INLINE int pace_endhostent (); + + PACE_INLINE struct servent * pace_getservbyname (const char * name, + const char * proto); + + PACE_INLINE struct servent * pace_getservbyname_r (const char * name, + const char * proto, + struct servent * result, + char * buffer, + int buflen); + + PACE_INLINE struct servent * pace_getservbyport (int port, + const char * proto); + + PACE_INLINE struct servent * pace_getservbyport_r (int port, + const char *proto, + struct servent *result, + char *buffer, + int buflen); + + PACE_INLINE struct servent * pace_getservent (); + + PACE_INLINE struct servent * pace_getservent_r (struct servent * result, + char * buffer, + int buflen); + + PACE_INLINE int pace_setservent (int stayopen); + + PACE_INLINE int pace_endservent (); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/netdb.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_NETDB_H */ diff --git a/PACE/pace/netdb.inl b/PACE/pace/netdb.inl new file mode 100644 index 00000000000..4bcf4d84fe4 --- /dev/null +++ b/PACE/pace/netdb.inl @@ -0,0 +1,156 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * netdb.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/unistd.h" + + +PACE_INLINE +struct hostent * +pace_gethostbyaddr (const char * addr, + int len, + int type) +{ + return gethostbyaddr (addr, len, type); +} + +PACE_INLINE +struct hostent * +pace_gethostbyaddr_r (const char * addr, + int length, + int type, + struct hostent * result, + char * buffer, + int buflen, + int * h_errnop) +{ + return gethostbyaddr_r (addr, length, type, result, buffer, buflen, h_errnop); +} + +PACE_INLINE +struct hostent * +pace_gethostbyname (const char * name) +{ + return gethostbyname (name); +} + +PACE_INLINE +struct hostent * +pace_gethostbyname_r (const char * name, + struct hostent *result, + char * buffer, + int buflen, + int * h_errnop) +{ + return gethostbyname_r (name, result, buffer, buflen, h_errnop); +} + +PACE_INLINE +struct hostent * +pace_gethostent () +{ + return gethostent (); +} + +PACE_INLINE +struct hostent * +pace_gethostent_r (struct hostent * result, + char * buffer, + int buflen, + int * h_errnop) +{ + return gethostent_r (result, buffer, buflen, h_errnop); +} + +PACE_INLINE +int +pace_sethostent (int stayopen) +{ + return sethostent (stayopen); +} + +PACE_INLINE +int +pace_endhostent () +{ + return endhostent (); +} + +PACE_INLINE +struct servent * +pace_getservbyname (const char * name, + const char * proto) +{ + return getservbyname (name, proto); +} + +PACE_INLINE +struct servent * +pace_getservbyname_r (const char * name, + const char * proto, + struct servent * result, + char *buffer, + int buflen) +{ + return getservbyname_r (name, proto, result, buffer, buflen); +} + +PACE_INLINE +struct servent * +pace_getservbyport (int port, const char * proto) +{ + return getservbyport (port, proto); +} + +PACE_INLINE +struct servent * +pace_getservbyport_r (int port, + const char * proto, + struct servent * result, + char * buffer, + int buflen) +{ + return getservbyport_r (port, proto, result, buffer, buflen); +} + +PACE_INLINE +struct servent * +pace_getservent () +{ + return getservent (); +} + +PACE_INLINE +struct servent * +pace_getservent_r (struct servent * result, + char * buffer, + int buflen) +{ + return getservent_r (result, buffer, buflen); +} + +PACE_INLINE +int +pace_setservent (int stayopen) +{ + return setservent (stayopen); +} + +PACE_INLINE +int +pace_endservent () +{ + return endservent (); +} diff --git a/PACE/pace/netinet/in.c b/PACE/pace/netinet/in.c new file mode 100644 index 00000000000..910bf1c1948 --- /dev/null +++ b/PACE/pace/netinet/in.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * in.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/netinet/in.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/netinet/in.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/netinet/in.h b/PACE/pace/netinet/in.h new file mode 100644 index 00000000000..bd3ae9115ce --- /dev/null +++ b/PACE/pace/netinet/in.h @@ -0,0 +1,46 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * in.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_NETINET_IN_H +#define PACE_NETINET_IN_H + + +#include "pace/defines.h" +#include "pace/sys/types.h" + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE PACE_UINT32 pace_htonl (PACE_UINT32 hostlong); + + PACE_INLINE PACE_UINT16 pace_htons (PACE_UINT16 hostshort); + + PACE_INLINE PACE_UINT32 pace_ntohl (PACE_UINT32 netlong); + + PACE_INLINE PACE_UINT16 pace_ntohs (PACE_UINT16 netshort); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/netinet/in.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_NETINET_IN_H */ diff --git a/PACE/pace/netinet/in.inl b/PACE/pace/netinet/in.inl new file mode 100644 index 00000000000..072944e4f26 --- /dev/null +++ b/PACE/pace/netinet/in.inl @@ -0,0 +1,46 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * in.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include <netinet/in.h> + + +PACE_INLINE +PACE_UINT32 +pace_htonl (PACE_UINT32 hostlong) +{ + return htonl (hostlong); +} + +PACE_INLINE +PACE_UINT16 +pace_htons (PACE_UINT16 hostshort) +{ + return htons (hostshort); +} + +PACE_INLINE +PACE_UINT32 +pace_ntohl (PACE_UINT32 netlong) +{ + return ntohl (netlong); +} + +PACE_INLINE +PACE_UINT16 +pace_ntohs (PACE_UINT16 netshort) +{ + return ntohs (netshort); +} diff --git a/PACE/pace/pthread.c b/PACE/pace/pthread.c new file mode 100644 index 00000000000..46a240d5aa9 --- /dev/null +++ b/PACE/pace/pthread.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * pthread.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/pthread.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/pthread.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/pthread.h b/PACE/pace/pthread.h new file mode 100644 index 00000000000..9495d06d465 --- /dev/null +++ b/PACE/pace/pthread.h @@ -0,0 +1,216 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * pthread.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_PTHREAD_H +#define PACE_PTHREAD_H + + +#include "pace/defines.h" +#include "pace/sys/types.h" +#include "pace/signal.h" +#include <pthread.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE int pace_pthread_atfork (void (*prepare) (), + void (*parent) (), + void (*child) ()); + + PACE_INLINE int pace_pthread_attr_destroy (pthread_attr_t * attr); + + PACE_INLINE int pace_pthread_attr_getdetachstate (const pthread_attr_t * attr, + int * detachstate); + + PACE_INLINE int pace_pthread_attr_getinheritsched (const pthread_attr_t * attr, + int * inheritsched); + + PACE_INLINE int pace_pthread_attr_getschedparam (const pthread_attr_t * attr, + struct sched_param * param); + + PACE_INLINE int pace_pthread_attr_getschedpolicy (const pthread_attr_t * attr, + int * policy); + + PACE_INLINE int pace_pthread_attr_getscope (const pthread_attr_t * attr, + int * contentionscope); + + PACE_INLINE int pace_pthread_attr_getstackaddr (const pthread_attr_t * attr, + void ** stackaddr); + + PACE_INLINE int pace_pthread_attr_getstacksize (const pthread_attr_t * attr, + size_t * stacksize); + + PACE_INLINE int pace_pthread_attr_init (pthread_attr_t * attr); + + PACE_INLINE int pace_pthread_attr_setdetachstate (pthread_attr_t * attr, + int detachstate); + + PACE_INLINE int pace_pthread_attr_setinheritsched (pthread_attr_t * attr, + int inheritsched); + + PACE_INLINE int pace_pthread_attr_setschedparam (pthread_attr_t * attr, + const struct + sched_param * param); + + PACE_INLINE int pace_pthread_attr_setschedpolicy (pthread_attr_t * attr, + int policy); + + PACE_INLINE int pace_pthread_attr_setscope (pthread_attr_t * attr, + int contentionscope); + + PACE_INLINE int pace_pthread_attr_setstackaddr (pthread_attr_t * attr, + void * stackaddr); + + PACE_INLINE int pace_pthread_attr_setstacksize (pthread_attr_t * attr, + size_t stacksize); + + PACE_INLINE int pace_pthread_cancel (pthread_t thread); + + PACE_INLINE void pace_cleanup_pop (int execute); + + PACE_INLINE void pace_pthread_cleanup_push (void (*routine)(void*), void * arg); + + # define PACE_PTHREAD_COND_INITIALIZER PTHREAD_COND_INITIALIZER + + PACE_INLINE int pace_pthread_cond_broadcast (pthread_cond_t * cond); + + PACE_INLINE int pace_pthread_cond_destroy (pthread_cond_t * cond); + + PACE_INLINE int pace_pthread_cond_init (pthread_cond_t * cond, + const pthread_condattr_t * attr); + + PACE_INLINE int pace_pthread_cond_signal (pthread_cond_t * cond); + + PACE_INLINE int pace_pthread_cond_timedwait (pthread_cond_t * cond, + pthread_mutex_t * mutex, + const struct timespec * abstime); + + PACE_INLINE int pace_pthread_cond_wait (pthread_cond_t * cond, + pthread_mutex_t * mutex); + + PACE_INLINE int pace_pthread_condattr_destroy (pthread_condattr_t * attr); + + PACE_INLINE int pace_pthread_condattr_getpshared (const pthread_condattr_t * attr, + int * pshared); + + PACE_INLINE int pace_pthead_condattr_init (pthread_condattr_t * attr); + + PACE_INLINE int pace_pthread_condattr_setpshared (pthread_condattr_t * attr, + int pshared); + + PACE_INLINE int pace_pthread_create (pthread_t * thread, + const pthread_attr_t * attr, + void * (*start_routine) (void*), + void * arg); + + PACE_INLINE int pace_pthread_detach (pthread_t thread); + + PACE_INLINE int pace_pthread_equal (pthread_t t1, pthread_t t2); + + PACE_INLINE void pace_pthread_exit (void * value_ptr); + + PACE_INLINE int pace_pthread_getschedparam (pthread_t thread, + int * policy, + struct sched_param * param); + + PACE_INLINE void * pace_pthread_getspecific (pthread_key_t key); + + PACE_INLINE int pace_pthread_join (pthread_t thread, void ** value_ptr); + + PACE_INLINE int pace_pthread_key_create (pthread_key_t * key, + void (*destructor)(void*)); + + PACE_INLINE int pace_pthread_key_delete (pthread_key_t key); + + PACE_INLINE int pace_pthread_kill (pthread_t thread, int sig); + + # define PACE_PTHREAD_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER + + PACE_INLINE int pace_pthread_mutex_destroy (pthread_mutex_t * mutex); + + PACE_INLINE int pace_pthread_mutex_getprioceiling (pthread_mutex_t * mutex, + int * prioceiling); + + PACE_INLINE int pace_pthread_mutex_init (pthread_mutex_t * mutex, + const pthread_mutexattr_t * attr); + + PACE_INLINE int pace_pthread_mutex_lock (pthread_mutex_t * mutex); + + PACE_INLINE int pace_pthread_mutex_setprioceiling (pthread_mutex_t * mutex, + int prioceiling, + int * old_ceiling); + + PACE_INLINE int pace_pthread_mutex_trylock (pthread_mutex_t * mutex); + + PACE_INLINE int pace_pthread_mutex_unlock (pthread_mutex_t * mutex); + + PACE_INLINE int pace_pthread_mutexattr_destroy (pthread_mutexattr_t * sttr); + + PACE_INLINE int pace_pthread_mutexattr_getprioceiling (pthread_mutexattr_t * attr, + int * prioceiling); + + PACE_INLINE int pace_pthread_mutexattr_getprotocol + (const pthread_mutexattr_t * attr, int * protocol); + + PACE_INLINE int pace_pthread_mutexattr_setprioceiling (pthread_mutexattr_t * attr, + int prioceiling); + + PACE_INLINE int pace_pthread_mutexattr_setprotocol (pthread_mutexattr_t * attr, + int protocol); + PACE_INLINE int + pace_pthread_mutexattr_getpshared (const pthread_mutexattr_t * attr, + int * pshared); + + PACE_INLINE int pace_pthread_mutexattr_init (pthread_mutexattr_t * attr); + + PACE_INLINE int pace_pthread_mutexattr_setpshared (pthread_mutexattr_t * attr, + int pshared); + + PACE_INLINE int pace_pthread_once (pthread_once_t * once_control, + void (*void_routine) ()); + + # define PACE_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT + + PACE_INLINE pthread_t pace_pthread_self (); + + PACE_INLINE int pace_pthread_setcancelstate (int state, int * oldstate); + + PACE_INLINE int pace_pthread_setcanceltype (int type, int * oldtype); + + PACE_INLINE int pace_pthread_setschedparam (pthread_t thread, + int policy, + const struct sched_param * param); + + PACE_INLINE int pace_pthread_setspecific (pthread_key_t key, const void * value); + + PACE_INLINE int pace_pthread_sigmask (int how, + const sigset_t * set, + sigset_t * oset); + + PACE_INLINE void pace_pthread_testcancel (); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/pthread.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_PTHREAD_H */ diff --git a/PACE/pace/pthread.inl b/PACE/pace/pthread.inl new file mode 100644 index 00000000000..3d791b55544 --- /dev/null +++ b/PACE/pace/pthread.inl @@ -0,0 +1,490 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * pthread.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/unistd.h" + + +PACE_INLINE +int +pace_pthread_atfork (void (*prepare) (), + void (*parent) (), + void (*child) ()) +{ + return pthread_atfork (prepare, parent, child); +} + +PACE_INLINE +int +pace_pthread_attr_destroy (pthread_attr_t * attr) +{ + return pthread_attr_destroy (attr); +} + +PACE_INLINE +int +pace_pthread_attr_getdetachstate (const pthread_attr_t * attr, + int * detachstate) +{ + return pthread_attr_getdetachstate (attr, detachstate); +} + +PACE_INLINE +int +pace_pthread_attr_getinheritsched (const pthread_attr_t * attr, + int * inheritsched) +{ + return pthread_attr_getinheritsched (attr, inheritsched); +} + +PACE_INLINE +int +pace_pthread_attr_getschedparam (const pthread_attr_t * attr, + struct sched_param * param) +{ + return pthread_attr_getschedparam (attr, param); +} + +PACE_INLINE +int +pace_pthread_attr_getschedpolicy (const pthread_attr_t * attr, + int * policy) +{ + return pthread_attr_getschedpolicy (attr, policy); +} + +PACE_INLINE +int +pace_pthread_attr_getscope (const pthread_attr_t * attr, + int * contentionscope) +{ + return pthread_attr_getscope (attr, contentionscope); +} + +PACE_INLINE +int +pace_pthread_attr_getstackaddr (const pthread_attr_t * attr, + void ** stackaddr) +{ + return pthread_attr_getstackaddr (attr, stackaddr); +} + +PACE_INLINE +int +pace_pthread_attr_getstacksize (const pthread_attr_t * attr, + size_t * stacksize) +{ + return pthread_attr_getstacksize (attr, stacksize); +} + +PACE_INLINE +int +pace_pthread_attr_init (pthread_attr_t * attr) +{ + return pthread_attr_init (attr); +} + +PACE_INLINE +int +pace_pthread_attr_setdetachstate (pthread_attr_t * attr, + int detachstate) +{ + return pthread_attr_setdetachstate (attr, detachstate); +} + +PACE_INLINE +int +pace_pthread_attr_setinheritsched (pthread_attr_t * attr, + int inheritsched) +{ + return pthread_attr_setinheritsched (attr, inheritsched); +} + +PACE_INLINE +int +pace_pthread_attr_setschedparam (pthread_attr_t * attr, + const struct sched_param * param) +{ + return pthread_attr_setschedparam (attr, param); +} + +PACE_INLINE +int +pace_pthread_attr_setschedpolicy (pthread_attr_t * attr, + int policy) +{ + return pthread_attr_setschedpolicy (attr, policy); +} + +PACE_INLINE +int +pace_pthread_attr_setscope (pthread_attr_t * attr, + int contentionscope) +{ + return pthread_attr_setscope (attr, contentionscope); +} + +PACE_INLINE +int +pace_pthread_attr_setstackaddr (pthread_attr_t * attr, + void * stackaddr) +{ + return pthread_attr_setstackaddr (attr, stackaddr); +} + +PACE_INLINE +int +pace_pthread_attr_setstacksize (pthread_attr_t * attr, + size_t stacksize) +{ + return pthread_attr_setstacksize (attr, stacksize); +} + +PACE_INLINE +int +pace_pthread_cancel (pthread_t thread) +{ + return pthread_cancel (thread); +} + +PACE_INLINE +int +pace_pthread_cond_broadcast (pthread_cond_t * cond) +{ + return pthread_cond_broadcast (cond); +} + +PACE_INLINE +int +pace_pthread_cond_destroy (pthread_cond_t * cond) +{ + return pthread_cond_destroy (cond); +} + +PACE_INLINE +int +pace_pthread_cond_init (pthread_cond_t * cond, + const pthread_condattr_t * attr) +{ + return pthread_cond_init (cond, attr); +} + +PACE_INLINE +int +pace_pthread_cond_signal (pthread_cond_t * cond) +{ + return pthread_cond_signal (cond); +} + +PACE_INLINE +int +pace_pthread_cond_timedwait (pthread_cond_t * cond, + pthread_mutex_t * mutex, + const struct timespec * abstime) +{ + return pthread_cond_timedwait (cond, mutex, abstime); +} + +PACE_INLINE +int +pace_pthread_cond_wait (pthread_cond_t * cond, + pthread_mutex_t * mutex) +{ + return pthread_cond_wait (cond, mutex); +} + +PACE_INLINE +int +pace_pthread_condattr_destroy (pthread_condattr_t * attr) +{ + return pthread_condattr_destroy (attr); +} + +PACE_INLINE +int +pace_pthread_condattr_getpshared (const pthread_condattr_t * attr, + int * pshared) +{ + return pthread_condattr_getpshared (attr, pshared); +} + +PACE_INLINE +int +pace_pthead_condattr_init (pthread_condattr_t * attr) +{ + return pthread_condattr_init (attr); +} + +PACE_INLINE +int +pace_pthread_condattr_setpshared (pthread_condattr_t * attr, + int pshared) +{ + return pthread_condattr_setpshared (attr, pshared); +} + +PACE_INLINE +int +pace_pthread_create (pthread_t * thread, + const pthread_attr_t * attr, + void * (*start_routine) (void*), + void * arg) +{ + return pthread_create (thread, attr, start_routine, arg); +} + +PACE_INLINE +int +pace_pthread_detach (pthread_t thread) +{ + return pthread_detach (thread); +} + +PACE_INLINE +int +pace_pthread_equal (pthread_t t1, pthread_t t2) +{ + return pthread_equal (t1, t2); +} + +PACE_INLINE +void +pace_pthread_exit (void * value_ptr) +{ + pthread_exit (value_ptr); + return; +} + +PACE_INLINE +int +pace_pthread_getschedparam (pthread_t thread, + int * policy, + struct sched_param * param) +{ + return pthread_getschedparam (thread, policy, param); +} + +PACE_INLINE +void * +pace_pthread_getspecific (pthread_key_t key) +{ + return pthread_getspecific (key); +} + +PACE_INLINE +int +pace_pthread_join (pthread_t thread, void ** value_ptr) +{ + return pthread_join (thread, value_ptr); +} + +PACE_INLINE +int +pace_pthread_key_create (pthread_key_t * key, + void (*destructor)(void*)) +{ + return pthread_key_create (key, destructor); +} + +PACE_INLINE +int +pace_pthread_key_delete (pthread_key_t key) +{ + return pthread_key_delete (key); +} + +PACE_INLINE +int +pace_pthread_kill (pthread_t thread, int sig) +{ + return pthread_kill (thread, sig); +} + +PACE_INLINE +int +pace_pthread_mutex_destroy (pthread_mutex_t * mutex) +{ + return pthread_mutex_destroy (mutex); +} + +PACE_INLINE +int +pace_pthread_mutex_getprioceiling (pthread_mutex_t * mutex, + int * prioceiling) +{ + return pthread_mutex_getprioceiling (mutex, prioceiling); +} + +PACE_INLINE +int +pace_pthread_mutex_init (pthread_mutex_t * mutex, + const pthread_mutexattr_t * attr) +{ + return pthread_mutex_init (mutex, attr); +} + +PACE_INLINE +int +pace_pthread_mutex_lock (pthread_mutex_t * mutex) +{ + return pthread_mutex_lock (mutex); +} + +PACE_INLINE +int +pace_pthread_mutex_setprioceiling (pthread_mutex_t * mutex, + int prioceiling, + int * old_ceiling) +{ + return pthread_mutex_setprioceiling (mutex, prioceiling, old_ceiling); +} + +PACE_INLINE +int +pace_pthread_mutex_trylock (pthread_mutex_t * mutex) +{ + return pthread_mutex_trylock (mutex); +} + +PACE_INLINE +int +pace_pthread_mutex_unlock (pthread_mutex_t * mutex) +{ + return pthread_mutex_unlock (mutex); +} + +PACE_INLINE +int +pace_pthread_mutexattr_destroy (pthread_mutexattr_t * attr) +{ + return pthread_mutexattr_destroy (attr); +} + +PACE_INLINE +int +pace_pthread_mutexattr_getprioceiling (pthread_mutexattr_t * attr, + int * prioceiling) +{ + return pthread_mutexattr_getprioceiling (attr, prioceiling); +} + +PACE_INLINE +int +pace_pthread_mutexattr_getprotocol (const pthread_mutexattr_t * attr, + int * protocol) +{ + return pthread_mutexattr_getprotocol (attr, protocol); +} + +PACE_INLINE +int +pace_pthread_mutexattr_setprioceiling (pthread_mutexattr_t * attr, + int prioceiling) +{ + return pthread_mutexattr_setprioceiling (attr, prioceiling); +} + +PACE_INLINE +int +pace_pthread_mutexattr_setprotocol (pthread_mutexattr_t * attr, + int protocol) +{ + return pthread_mutexattr_setprotocol (attr, protocol); +} + +PACE_INLINE +int +pace_pthread_mutexattr_getpshared (const pthread_mutexattr_t * attr, + int * pshared) +{ + return pthread_mutexattr_getpshared (attr, pshared); +} + +PACE_INLINE +int +pace_pthread_mutexattr_init (pthread_mutexattr_t * attr) +{ + return pthread_mutexattr_init (attr); +} + +PACE_INLINE +int +pace_pthread_mutexattr_setpshared (pthread_mutexattr_t * attr, + int pshared) +{ + return pthread_mutexattr_setpshared (attr, pshared); +} + +PACE_INLINE +int +pace_pthread_once (pthread_once_t * once_control, + void (*void_routine) ()) +{ + return pthread_once (once_control, void_routine); +} + +PACE_INLINE +pthread_t +pace_pthread_self () +{ + return pthread_self (); +} + +PACE_INLINE +int +pace_pthread_setcancelstate (int state, int * oldstate) +{ + return pthread_setcancelstate (state, oldstate); +} + +PACE_INLINE +int +pace_pthread_setcanceltype (int type, int * oldtype) +{ + return pthread_setcanceltype (type, oldtype); +} + + +PACE_INLINE +int +pace_pthread_setschedparam (pthread_t thread, + int policy, + const struct sched_param * param) +{ + return pthread_setschedparam (thread, policy, param); +} + +PACE_INLINE +int +pace_pthread_setspecific (pthread_key_t key, const void * value) +{ + return pthread_setspecific (key, value); +} + +PACE_INLINE +int +pace_pthread_sigmask (int how, const sigset_t * set, + sigset_t * oset) +{ + return pthread_sigmask (how, set, oset); +} + +PACE_INLINE +void +pace_pthread_testcancel () +{ + pthread_testcancel (); + return; +} diff --git a/PACE/pace/pwd.c b/PACE/pace/pwd.c new file mode 100644 index 00000000000..1faa163f5c9 --- /dev/null +++ b/PACE/pace/pwd.c @@ -0,0 +1,22 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * pwd.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/pwd.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/pwd.inl" +# endif /* PACE_HAS_INLINE */ diff --git a/PACE/pace/pwd.h b/PACE/pace/pwd.h new file mode 100644 index 00000000000..4f806614cf3 --- /dev/null +++ b/PACE/pace/pwd.h @@ -0,0 +1,63 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * pwd.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_PWD_H +#define PACE_PWD_H + + +#include "pace/defines.h" +#include <pwd.h> + +/* Linux wants to use sys/types.h to define uid_t. + * Sun is happy with pwd.h. + */ +# if defined (linux) +# include "pace/sys/types.h" +# endif /* linux */ + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE struct passwd * pace_getpwuid (uid_t uid); + + PACE_INLINE int pace_getpwuid_r (uid_t uid, + struct passwd * pwd, + char * buffer, + size_t bufsize, + struct passwd ** result); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE struct passwd * pace_getpwnam (const char * name); + + PACE_INLINE int pace_getpwnam_r (const char * name, + struct passwd * pwd, + char * buffer, + size_t bufsize, + struct passwd ** result); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/pwd.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_PWD_H */ diff --git a/PACE/pace/pwd.inl b/PACE/pace/pwd.inl new file mode 100644 index 00000000000..ec933b661ab --- /dev/null +++ b/PACE/pace/pwd.inl @@ -0,0 +1,59 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * pwd.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +struct passwd * +pace_getpwuid (uid_t uid) +{ + return getpwuid (uid); +} + +PACE_INLINE +int +pace_getpwuid_r (uid_t uid, + struct passwd * pwd, + char * buffer, + size_t bufsize, + struct passwd ** result) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return getpwuid_r (uid, pwd, buffer, bufsize, result); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +struct passwd * +pace_getpwnam (const char * name) +{ + return getpwnam (name); +} + +PACE_INLINE +int +pace_getpwnam_r (const char * name, + struct passwd * pwd, + char * buffer, + size_t bufsize, + struct passwd ** result) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return getpwnam_r (name, pwd, buffer, bufsize, result); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} diff --git a/PACE/pace/sched.c b/PACE/pace/sched.c new file mode 100644 index 00000000000..d12a787f2ba --- /dev/null +++ b/PACE/pace/sched.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * sched.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/sched.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/sched.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/sched.h b/PACE/pace/sched.h new file mode 100644 index 00000000000..173c3949578 --- /dev/null +++ b/PACE/pace/sched.h @@ -0,0 +1,66 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * sched.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_SCHED_H +#define PACE_SCHED_H + + +#include "pace/defines.h" +#include <sched.h> + +/* Linux wants to use sys/types.h to define pid_t. + * Sun is happy with sched.h. + */ +# if defined (linux) +#include "pace/sys/types.h" +#endif + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE int pace_sched_get_priority_max (int policy); + + PACE_INLINE int pace_sched_get_priority_min (int policy); + + PACE_INLINE int pace_sched_getparam (pid_t pid, + struct sched_param * param); + + PACE_INLINE int pace_sched_rr_get_interval (pid_t pid, + struct timespec * interval); + + PACE_INLINE int pace_sched_setparam (pid_t pid, + const struct sched_param * param); + + PACE_INLINE int pace_sched_getscheduler (pid_t pid); + + PACE_INLINE int pace_sched_setscheduler (pid_t pid, + int policy, + const struct sched_param * param); + + PACE_INLINE int pace_sched_yield (); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/sched.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_SCHED_H */ diff --git a/PACE/pace/sched.inl b/PACE/pace/sched.inl new file mode 100644 index 00000000000..0ea08f134bb --- /dev/null +++ b/PACE/pace/sched.inl @@ -0,0 +1,76 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * sched.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +int +pace_sched_get_priority_max (int policy) +{ + return sched_get_priority_max (policy); +} + +PACE_INLINE +int +pace_sched_get_priority_min (int policy) +{ + return sched_get_priority_min (policy); +} + +PACE_INLINE +int +pace_sched_getparam (pid_t pid, + struct sched_param * param) +{ + return sched_getparam (pid, param); +} + +PACE_INLINE +int +pace_sched_rr_get_interval (pid_t pid, + struct timespec * interval) +{ + return sched_rr_get_interval (pid, interval); +} + +PACE_INLINE +int +pace_sched_setparam (pid_t pid, + const struct sched_param * param) +{ + return sched_setparam (pid, param); +} + +PACE_INLINE +int +pace_sched_getscheduler (pid_t pid) +{ + return sched_getscheduler (pid); +} + +PACE_INLINE +int +pace_sched_setscheduler (pid_t pid, + int policy, + const struct sched_param * param) +{ + return sched_setscheduler (pid, policy, param); +} + +PACE_INLINE +int +pace_sched_yield () +{ + return sched_yield (); +} diff --git a/PACE/pace/semaphore.c b/PACE/pace/semaphore.c new file mode 100644 index 00000000000..8975acd0da3 --- /dev/null +++ b/PACE/pace/semaphore.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * semaphore.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/semaphore.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/semaphore.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/semaphore.h b/PACE/pace/semaphore.h new file mode 100644 index 00000000000..3938944aed1 --- /dev/null +++ b/PACE/pace/semaphore.h @@ -0,0 +1,62 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * semaphore.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_SEMAPHORE_H +#define PACE_SEMAPHORE_H + + +#include "pace/defines.h" +#include <semaphore.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE int pace_sem_close (sem_t * sem); + + PACE_INLINE int pace_sem_destroy (sem_t * sem); + + PACE_INLINE int pace_sem_getvalue (sem_t * sem, int * sval); + + PACE_INLINE int pace_sem_init (sem_t * sem, int pshared, unsigned int value); + + # define pace_sem_open(X) sem_open X + /* int fprintf (FILE *stream, const char *format, (*//* args *//*) ... ); + * + * PLEASE PAY SPECIAL ATTENTION HERE! + * This is a macro and requires an additional set of parenthesis + * surrounding the arguments. + */ + + PACE_INLINE int pace_sem_post (sem_t * sem); + + PACE_INLINE int pace_sem_trywait (sem_t * sem); + + PACE_INLINE int pace_sem_unlink (const char * name); + + PACE_INLINE int pace_sem_wait (sem_t * sem); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/semaphore.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_SEMAPHORE_H */ diff --git a/PACE/pace/semaphore.inl b/PACE/pace/semaphore.inl new file mode 100644 index 00000000000..89dbfabdc5c --- /dev/null +++ b/PACE/pace/semaphore.inl @@ -0,0 +1,71 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * semaphore.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +int +pace_sem_close (sem_t * sem) +{ + return sem_close (sem); +} + +PACE_INLINE +int +pace_sem_destroy (sem_t * sem) +{ + return sem_destroy (sem); +} + +PACE_INLINE +int +pace_sem_getvalue (sem_t * sem, int * sval) +{ + return sem_getvalue (sem, sval); +} + +PACE_INLINE +int +pace_sem_init (sem_t * sem, int pshared, unsigned int value) +{ + return sem_init (sem, pshared, value); +} + +PACE_INLINE +int +pace_sem_post (sem_t * sem) +{ + return sem_post (sem); +} + +PACE_INLINE +int +pace_sem_trywait (sem_t * sem) +{ + return sem_trywait (sem); +} + +PACE_INLINE +int +pace_sem_unlink (const char * name) +{ + return sem_unlink (name); +} + +PACE_INLINE +int +pace_sem_wait (sem_t * sem) +{ + return sem_wait (sem); +} diff --git a/PACE/pace/setjmp.c b/PACE/pace/setjmp.c new file mode 100644 index 00000000000..329024ac2db --- /dev/null +++ b/PACE/pace/setjmp.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * setjmp.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/setjmp.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/setjmp.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/setjmp.h b/PACE/pace/setjmp.h new file mode 100644 index 00000000000..190bcbb937f --- /dev/null +++ b/PACE/pace/setjmp.h @@ -0,0 +1,42 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * setjmp.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_SETJMP_H +#define PACE_SETJMP_H + + +#include "pace/defines.h" +#include <setjmp.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE int pace_sigsetjmp (sigjmp_buf env, int savemask); + + PACE_INLINE void pace_siglongjmp (sigjmp_buf env, int val); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/setjmp.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_SETJMP_H */ diff --git a/PACE/pace/setjmp.inl b/PACE/pace/setjmp.inl new file mode 100644 index 00000000000..0b28a9a0a4b --- /dev/null +++ b/PACE/pace/setjmp.inl @@ -0,0 +1,30 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * setjmp.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +int +pace_sigsetjmp (sigjmp_buf env, int savemask) +{ + return sigsetjmp (env, savemask); +} + +PACE_INLINE +void +pace_siglongjmp (sigjmp_buf env, int val) +{ + siglongjmp (env, val); + return; +} diff --git a/PACE/pace/signal.c b/PACE/pace/signal.c new file mode 100644 index 00000000000..a08b68b9d74 --- /dev/null +++ b/PACE/pace/signal.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * signal.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/signal.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/signal.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/signal.h b/PACE/pace/signal.h new file mode 100644 index 00000000000..146818ea7a0 --- /dev/null +++ b/PACE/pace/signal.h @@ -0,0 +1,76 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * signal.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#ifndef PACE_SIGNAL_H +#define PACE_SIGNAL_H + + +#include "pace/defines.h" +#include "pace/sys/types.h" +#include <signal.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE int pace_kill (pid_t pid, int sig); + + PACE_INLINE int pace_sigaction (int sig, + const struct sigaction * act, + struct sigaction * oact); + + PACE_INLINE int pace_sigaddset (sigset_t * set, int signo); + + PACE_INLINE int pace_sigemptyset (sigset_t * set); + + PACE_INLINE int pace_sigdelset (sigset_t * set, int signo); + + PACE_INLINE int pace_sigfillset (sigset_t * set); + + PACE_INLINE int pace_sigismember (const sigset_t * set, int signo); + + PACE_INLINE int pace_sigpending (sigset_t * set); + + PACE_INLINE int pace_sigprocmask (int how, + const sigset_t * set, + sigset_t * oset); + + PACE_INLINE int pace_sigqueue (pid_t pid, + int signo, + const union sigval value); + + PACE_INLINE int pace_sigsuspend (const sigset_t * sigmask); + + PACE_INLINE int pace_sigtimedwait (const sigset_t * set, + siginfo_t * info, + const struct timespec * timeout); + + PACE_INLINE int pace_sigwait (const sigset_t * set, int * sig); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE int pace_sigwaitinfo (const sigset_t * set, siginfo_t * info); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/signal.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_SIGNAL_H */ diff --git a/PACE/pace/signal.inl b/PACE/pace/signal.inl new file mode 100644 index 00000000000..a52cb3ac7b4 --- /dev/null +++ b/PACE/pace/signal.inl @@ -0,0 +1,121 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * signal.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +int +pace_kill (pid_t pid, int sig) +{ + return kill (pid, sig); +} + +PACE_INLINE +int +pace_sigaction (int sig, const struct sigaction * act, + struct sigaction * oact) +{ + return sigaction (sig, act, oact); +} + +PACE_INLINE +int +pace_sigaddset (sigset_t * set, int signo) +{ + return sigaddset (set, signo); +} + +PACE_INLINE +int +pace_sigemptyset (sigset_t * set) +{ + return sigemptyset (set); +} + +PACE_INLINE +int +pace_sigdelset (sigset_t * set, int signo) +{ + return sigdelset (set, signo); +} + +PACE_INLINE +int +pace_sigfillset (sigset_t * set) +{ + return sigfillset (set); +} + +PACE_INLINE +int +pace_sigismember (const sigset_t * set, int signo) +{ + return sigismember (set, signo); +} + +PACE_INLINE +int +pace_sigpending (sigset_t * set) +{ + return sigpending (set); +} + +PACE_INLINE +int +pace_sigprocmask (int how, const sigset_t * set, + sigset_t * oset) +{ + return sigprocmask (how, set, oset); +} + +PACE_INLINE +int +pace_sigqueue (pid_t pid, int signo, + const union sigval value) +{ + return sigqueue (pid, signo, value); +} + +PACE_INLINE +int +pace_sigsuspend (const sigset_t * sigmask) +{ + return sigsuspend (sigmask); +} + +PACE_INLINE +int +pace_sigtimedwait (const sigset_t * set, siginfo_t * info, + const struct timespec * timeout) +{ + return sigtimedwait (set, info, timeout); +} + +PACE_INLINE +int +pace_sigwait (const sigset_t * set, int * sig) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return sigwait (set, sig); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +int +pace_sigwaitinfo (const sigset_t *set, siginfo_t *info) +{ + return sigwaitinfo (set, info); +} diff --git a/PACE/pace/stdio.c b/PACE/pace/stdio.c new file mode 100644 index 00000000000..bb5a8d9b88b --- /dev/null +++ b/PACE/pace/stdio.c @@ -0,0 +1,21 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * stdio.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/stdio.h" + +# if !defined (PACE_HAS_INLINE) +# include "pace/stdio.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/stdio.h b/PACE/pace/stdio.h new file mode 100644 index 00000000000..7db1381bef4 --- /dev/null +++ b/PACE/pace/stdio.h @@ -0,0 +1,191 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * stdio.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_STDIO_H +#define PACE_STDIO_H + + +#include "pace/defines.h" +#include <stdio.h> +#include <stdarg.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + #define pace_stderr stderr; + + #define pace_stdout stdout; + + #define pace_stdin stdin; + + PACE_INLINE char * pace_ctermid (char * s); + + PACE_INLINE int pace_fclose (FILE * stream); + + PACE_INLINE FILE * pace_fdopen (int fildes, const char * type); + + PACE_INLINE int pace_fflush (FILE * stream); + + PACE_INLINE int pace_fileno (FILE * stream); + + PACE_INLINE int pace_fgetc (FILE * stream); + + PACE_INLINE char * pace_fgets (char * s, int n, FILE * stream); + + PACE_INLINE void pace_flockfile (FILE * file); + /* Requires PACE_HAS_REENTRANT. */ + + PACE_INLINE FILE * pace_fopen (const char * filename, const char * mode); + + #define pace_fprintf(X) fprintf X + /* int fprintf (FILE *stream, const char *format, (*//* args *//*) ... ); + * + * PLEASE PAY SPECIAL ATTENTION HERE! + * This is a macro and requires an additional set of parenthesis + * surrounding the arguments. + */ + + PACE_INLINE int pace_fputc (int c, FILE * stream); + + PACE_INLINE int pace_fputs (const char * s, FILE * stream); + + PACE_INLINE size_t pace_fread (void * ptr, + size_t size, + size_t number_of_items, + FILE * stream); + + PACE_INLINE FILE * pace_freopen (const char * filename, + const char * mode, + FILE * stream); + + #define pace_fscanf(X) fscanf X + /* int fscanf (FILE*stream, const char *format, ... ); + * + * PLEASE PAY SPECIAL ATTENTION HERE! + * This is a macro and requires an additional set of parenthesis + * surrounding the arguments. + */ + + PACE_INLINE int pace_fseek (FILE * stream, long offset, int whence); + + PACE_INLINE int pace_fseek (FILE * stream, off_t offset, int whence); + /* Not in POSIX spec. */ + + PACE_INLINE long pace_ftell (FILE * stream); + + PACE_INLINE off_t pace_ftello (FILE * stream); + /* Not in POSIX spec. */ + + PACE_INLINE size_t pace_fwrite (const void * ptr, + /* Not in POSIX spec. */ size_t size, + size_t number_of_items, + FILE * stream); + + PACE_INLINE int pace_trylockfile (FILE * file); + /* Requires PACE_HAS_REENTRANT. */ + + PACE_INLINE void pace_funlockfile (FILE * file); + /* Requires PACE_HAS_REENTRANT. */ + + PACE_INLINE int pace_getc (FILE * stream); + + PACE_INLINE int pace_getc_unlocked (FILE * stream); + /* Requires PACE_HAS_REENTRANT. */ + + PACE_INLINE int pace_getchar (); + + PACE_INLINE int pace_getchar_unlocked (); + /* Requires PACE_HAS_REENTRANT. */ + + PACE_INLINE char *PACE_gets (char * s); + + PACE_INLINE int pace_getw (FILE * stream); + /* Not in POSIX spec. */ + + PACE_INLINE void pace_perror (const char * s); + + #define pace_printf(X) printf X + /* int printf (const char *format, (*//* args*//*) ... ); + * + * PLEASE PAY SPECIAL ATTENTION HERE! + * This is a macro and requires an additional set of parenthesis + * surrounding the arguments. + */ + + PACE_INLINE int pace_putc (int c, FILE * stream); + + PACE_INLINE int pace_putc_unlocked (int c, FILE * stream); + /* Requires PACE_HAS_REENTRANT. */ + + PACE_INLINE int pace_putchar (int c); + + PACE_INLINE int pace_putchar_unlocked (int c); + /* Requires PACE_HAS_REENTRANT. */ + + PACE_INLINE int pace_puts (const char * s); + + PACE_INLINE int pace_putw (int w, FILE * stream); + /* Not in POSIX spec. */ + + PACE_INLINE int pace_rename (const char * old_name, + const char * new_name); + + PACE_INLINE void pace_rewind (FILE * stream); + + PACE_INLINE int pace_sprintf (char * buf, const char * format, ... ); + + #define pace_scanf(X) scanf X + /* int scanf (const char *format, ... ); + * + * PLEASE PAY SPECIAL ATTENTION HERE! + * This is a macro and requires an additional set of parenthesis + * surrounding the arguments. + */ + + #define pace_sscanf(X) sscanf X + /* int sscanf (const char *s, const char *format, ... ); + * + * PLEASE PAY SPECIAL ATTENTION HERE! + * This is a macro and requires an additional set of parenthesis + * surrounding the arguments. + */ + + #define pace_snprintf(X) snprintf X + /* int snprintf (char *s, size_t n, const char *format, (*//* args*//*) ... ); + * + * PLEASE PAY SPECIAL ATTENTION HERE! + * This is a macro and requires an additional set of parenthesis + * surrounding the arguments. + */ + + PACE_INLINE int pace_vsprintf (char * buffer, + const char * format, + va_list argptr); + + PACE_INLINE FILE * pace_tmpfile (); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/stdio.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_STDIO_H */ diff --git a/PACE/pace/stdio.inl b/PACE/pace/stdio.inl new file mode 100644 index 00000000000..35dc2d3fe0e --- /dev/null +++ b/PACE/pace/stdio.inl @@ -0,0 +1,328 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * stdio.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +char * +pace_ctermid (char * s) +{ + return ctermid (s); +} + +PACE_INLINE +int +pace_fclose (FILE * stream) +{ + return fclose (stream); +} + +PACE_INLINE +FILE * +pace_fdopen (int fildes, const char * type) +{ + return fdopen (fildes, type); +} + +PACE_INLINE +int +pace_fflush (FILE * stream) +{ + return fflush (stream); +} + +PACE_INLINE +int +pace_fileno (FILE * stream) +{ + return fileno (stream); +} + +PACE_INLINE +int +pace_fgetc (FILE * stream) +{ + return fgetc (stream); +} + +PACE_INLINE +char * +pace_fgets (char * s, int n, FILE * stream) +{ + return fgets (s, n, stream); +} + +PACE_INLINE +void +pace_flockfile (FILE * file) +{ +# if defined (PACE_HAS_REENTRANT) + flockfile (file); +# else /* !PACE_HAS_REENTRANT */ + PACE_SET_ERRNO (PACE_ERRNO_LACKS_REENTRANT); +# endif /* !PACE_HAS_REENTRANT */ + return; +} + +PACE_INLINE +FILE * +pace_fopen (const char * filename, const char * mode) +{ + return fopen (filename, mode); +} + +PACE_INLINE +int +pace_fputc (int c, FILE * stream) +{ + return fputc (c, stream); +} + +PACE_INLINE +int +pace_fputs (const char * s, FILE * stream) +{ + return fputs (s, stream); +} + +PACE_INLINE +size_t +pace_fread (void * ptr, + size_t size, + size_t number_of_items, + FILE * stream) +{ + return fread (ptr, size, number_of_items, stream); +} + +PACE_INLINE +FILE * +pace_freopen (const char * filename, + const char * mode, + FILE * stream) +{ + return freopen (filename, mode, stream); +} + +PACE_INLINE +int +pace_fseek (FILE * stream, long offset, int whence) +{ + return fseek (stream, offset, whence); +} + +PACE_INLINE +int +pace_fseeko (FILE * stream, off_t offset, int whence) +{ + return fseeko (stream, offset, whence); +} + +PACE_INLINE +long +pace_ftell (FILE * stream) +{ + return ftell (stream); +} + +PACE_INLINE +off_t +pace_ftello (FILE * stream) +{ + return ftello (stream); +} + +PACE_INLINE +int +pace_ftrylockfile (FILE * file) +{ +# if defined (PACE_HAS_REENTRANT) + return ftrylockfile (file); +# else /* !PACE_HAS_REENTRANT */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_REENTRANT); +# endif /* !PACE_HAS_REENTRANT */ +} + +PACE_INLINE +void +pace_funlockfile (FILE * file) +{ +# if defined (PACE_HAS_REENTRANT) + funlockfile (file); +# else /* !PACE_HAS_REENTRANT */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_REENTRANT); +# endif /* !PACE_HAS_REENTRANT */ + return; +} + +PACE_INLINE +size_t +pace_fwrite (const void * ptr, + size_t size, + size_t number_of_items, + FILE * stream) +{ + return fwrite (ptr, size, number_of_items, stream); +} + +PACE_INLINE +int +pace_getc (FILE * stream) +{ + return getc (stream); +} + +PACE_INLINE +int +pace_getc_unlocked (FILE * stream) +{ +# if defined (PACE_HAS_REENTRANT) + return getc_unlocked (stream); +# else /* !PACE_HAS_POSIX */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_REENTRANT); +# endif /* !PACE_HAS_POSIX */ +} + +PACE_INLINE +int +pace_getchar () +{ + return getchar (); +} + +PACE_INLINE +int +pace_getchar_unlocked () +{ +# if defined (PACE_HAS_REENTRANT) + return getchar_unlocked (); +# else /* !PACE_HAS_REENTRANT */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_REENTRANT); +# endif /* !PACE_HAS_REENTRANT */ +} + +PACE_INLINE +char * +pace_gets (char * s) +{ + return gets (s); +} + +PACE_INLINE +int +pace_getw (FILE * stream) +{ + return getw (stream); +} + +PACE_INLINE +void +pace_perror (const char * s) +{ + perror (s); + return; +} + +PACE_INLINE +int +pace_putc (int c, FILE * stream) +{ + return putc (c, stream); +} + +PACE_INLINE +int +pace_putc_unlocked (int c, FILE * stream) +{ +# if defined (PACE_HAS_REENTRANT) + return putc_unlocked (c, stream); +# else /* !PACE_HAS_REENTRANT */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_REENTRANT); +# endif /* !PACE_HAS_REENTRANT */ +} + +PACE_INLINE +int +pace_putchar (int c) +{ + return putchar (c); +} + +PACE_INLINE +int +pace_putchar_unlocked (int c) +{ +# if defined (PACE_HAS_REENTRANT) + return putchar_unlocked (c); +# else /* !PACE_HAS_REENTRANT */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_REENTRANT); +# endif /* !PACE_HAS_REENTRANT */ +} + +PACE_INLINE +int +pace_puts (const char * s) +{ + return puts (s); +} + +PACE_INLINE +int +pace_putw (int w, FILE * stream) +{ + return putw (w, stream); +} + +PACE_INLINE +int +pace_rename (const char * old_name, const char * new_name) +{ + return rename (old_name, new_name); +} + +PACE_INLINE +void +pace_rewind (FILE * stream) +{ + rewind (stream); + return; +} + +PACE_INLINE +int +pace_sprintf (char * buf, const char * format, ... ) +{ + va_list ap; + va_start (ap, format); + vsprintf (buf, format, ap); + va_end (ap); + return 0; +} + +PACE_INLINE +FILE * +pace_tmpfile () +{ + return tmpfile (); +} + +PACE_INLINE +int +pace_vsprintf (char * buffer, const char * format, va_list argptr) +{ + return vsprintf (buffer, format, argptr); +} + + + diff --git a/PACE/pace/stdlib.c b/PACE/pace/stdlib.c new file mode 100644 index 00000000000..7e425b5e9e0 --- /dev/null +++ b/PACE/pace/stdlib.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * stdlib.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/stdlib.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/stdlib.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/stdlib.h b/PACE/pace/stdlib.h new file mode 100644 index 00000000000..e1280a49571 --- /dev/null +++ b/PACE/pace/stdlib.h @@ -0,0 +1,74 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * stdlib.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_STDLIB_H +#define PACE_STDLIB_H + + +#include "pace/defines.h" +#include "pace/unistd.h" + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE void pace_abort (); + + PACE_INLINE int pace_atoi (const char * str); + + PACE_INLINE long pace_atol (const char * str); + + PACE_INLINE long long pace_atoll (const char * str); + + PACE_INLINE void pace_exit (int status); + + PACE_INLINE char * pace_getenv (const char * name); + + PACE_INLINE char * pace_lltostr (long longvalue, char * endptr); + + PACE_INLINE int pace_rand_r (unsigned int * seed); + + PACE_INLINE long pace_strtol (const char * str, char ** endptr, int base); + + PACE_INLINE long long pace_strtoll (const char * str, char ** endptr, int base); + + PACE_INLINE char * pace_ulltostr (unsigned long longvalue, char * endptr); + + /* Memory Management. */ + + PACE_INLINE void * pace_malloc (size_t size); + + PACE_INLINE void * pace_calloc (size_t nelem, size_t elsize); + + PACE_INLINE void pace_free (void * ptr); + + PACE_INLINE void * pace_memalign (size_t alignment, size_t size); + + PACE_INLINE void * pace_realloc (void * ptr, size_t size); + + PACE_INLINE void * pace_valloc (size_t size); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/stdlib.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_STDLIB_H */ diff --git a/PACE/pace/stdlib.inl b/PACE/pace/stdlib.inl new file mode 100644 index 00000000000..9b798783192 --- /dev/null +++ b/PACE/pace/stdlib.inl @@ -0,0 +1,143 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * stdlib.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include <stdlib.h> + + +PACE_INLINE +void +pace_abort () +{ + abort (); + return; +} + +PACE_INLINE +int +pace_atoi (const char * str) +{ + return atoi (str); +} + +PACE_INLINE +long +pace_atol (const char * str) +{ + return atol (str); +} + +PACE_INLINE +long long +pace_atoll (const char * str) +{ + return atoll (str); +} + +PACE_INLINE +void +pace_exit (int status) +{ + exit (status); + return; +} + +PACE_INLINE +char * +pace_getenv (const char * name) +{ + return getenv (name); +} + +PACE_INLINE +char * +pace_lltostr (long longvalue, char * endptr) +{ + return lltostr (longvalue, endptr); +} + +PACE_INLINE +int +pace_rand_r (unsigned int *seed) +{ + return rand_r (seed); +} + +PACE_INLINE +long +pace_strtol (const char * str, char ** endptr, int base) +{ + return strtol (str, endptr, base); +} + +PACE_INLINE +long long +pace_strtoll (const char * str, char ** endptr, int base) +{ + return strtoll (str, endptr, base); +} + +PACE_INLINE +char * +pace_ulltostr (unsigned long longvalue, char * endptr) +{ + return ulltostr (longvalue, endptr); +} + +/* Memory Management. */ + +PACE_INLINE +void * +pace_malloc (size_t size) +{ + return malloc (size); +} + +PACE_INLINE +void * +pace_calloc (size_t nelem, size_t elsize) +{ + return calloc (nelem, elsize); +} + +PACE_INLINE +void +pace_free (void * ptr) +{ + free (ptr); + return; +} + +PACE_INLINE +void * +pace_memalign (size_t alignment, size_t size) +{ + return memalign (alignment, size); +} + +PACE_INLINE +void * +pace_realloc (void * ptr, size_t size) +{ + return realloc (ptr, size); +} + +PACE_INLINE +void * +pace_valloc (size_t size) +{ + return valloc (size); +} + diff --git a/PACE/pace/string.c b/PACE/pace/string.c new file mode 100644 index 00000000000..8de5574cd51 --- /dev/null +++ b/PACE/pace/string.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * string.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/string.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/string.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/string.h b/PACE/pace/string.h new file mode 100644 index 00000000000..b82f097ca31 --- /dev/null +++ b/PACE/pace/string.h @@ -0,0 +1,87 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * string.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_STRING_H +#define PACE_STRING_H + + +#include "pace/defines.h" +#include "pace/unistd.h" + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE void * pace_memccpy (void * s1, const void * s2, int c, size_t n); + + PACE_INLINE const void * pace_memchr (const void * s, int c, size_t n); + + PACE_INLINE int pace_memcmp (const void * s1, const void * s2, size_t n); + + PACE_INLINE void * pace_memcpy (void * s1, const void * s2, size_t n); + + PACE_INLINE void * pace_memmove (void * s1, const void * s2, size_t n); + + PACE_INLINE void * pace_memset (void * s, int c, size_t n); + + PACE_INLINE char * pace_strcat (char * s1, const char * s2); + + PACE_INLINE char * pace_strncat (char * s1, const char * s2, size_t n); + + PACE_INLINE const char * pace_strchr (const char * s, int c); + + PACE_INLINE const char * pace_strrchr (const char * s, int c); + + PACE_INLINE int pace_strcmp (const char * s1, const char * s2); + + PACE_INLINE int pace_strncmp (const char * s1, const char * s2, size_t n); + + PACE_INLINE char * pace_strcpy (char * s1, const char * s2); + + PACE_INLINE char * pace_strncpy (char * s1, const char * s2, size_t n); + + PACE_INLINE size_t pace_strcspn (const char * s1, const char * s2); + + PACE_INLINE size_t pace_strspn (const char * s1, const char * s2); + + PACE_INLINE char * pace_strdup (const char * s1); + + PACE_INLINE size_t pace_strlen (const char * s); + + PACE_INLINE const char * pace_strpbrk (const char * s1, const char * s2); + + PACE_INLINE const char * pace_strstr (const char * s1, const char * s2); + + PACE_INLINE char * pace_strtok (char * s1, const char * s2); + + PACE_INLINE char * pace_strtok_r (char * s, + const char * sep, + char ** lasts); + /* Requires PACE_HAS_REENTRANT. */ + + + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/string.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_STRING_H */ diff --git a/PACE/pace/string.inl b/PACE/pace/string.inl new file mode 100644 index 00000000000..7ca97d94677 --- /dev/null +++ b/PACE/pace/string.inl @@ -0,0 +1,179 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * string.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include <string.h> + + +PACE_INLINE +void * +pace_memccpy (void * s1, const void * s2, int c, size_t n) +{ + return memccpy (s1, s2, c, n); +} + +PACE_INLINE +const void * +pace_memchr (const void * s, int c, size_t n) +{ + return memchr (s, c, n); +} + +PACE_INLINE +int +pace_memcmp (const void * s1, const void * s2, size_t n) +{ + return memcmp (s1, s2, n); +} + +PACE_INLINE +void * +pace_memcpy (void * s1, const void * s2, size_t n) +{ + return memcpy (s1, s2, n); +} + +PACE_INLINE +void * +pace_memmove (void * s1, const void * s2, size_t n) +{ + return memmove (s1, s2, n); +} + +PACE_INLINE +void * +pace_memset (void * s, int c, size_t n) +{ + return memset (s, c, n); +} + +PACE_INLINE +char * +pace_strcat (char * s1, const char * s2) +{ + return strcat (s1, s2); +} + +PACE_INLINE +char * +pace_strncat (char * s1, const char * s2, size_t n) +{ + return strncat (s1, s2, n); +} + +PACE_INLINE +const char * +pace_strchr (const char * s, int c) +{ + return strchr (s, c); +} + +PACE_INLINE +const char * +pace_strrchr (const char * s, int c) +{ + return strrchr (s, c); +} + +PACE_INLINE +int +pace_strcmp (const char * s1, const char * s2) +{ + return strcmp (s1, s2); +} + +PACE_INLINE +int +pace_strncmp (const char * s1, const char * s2, size_t n) +{ + return strncmp (s1, s2, n); +} + +PACE_INLINE +char * +pace_strcpy (char * s1, const char * s2) +{ + return strcpy (s1, s2); +} + +PACE_INLINE +char * +pace_strncpy (char * s1, const char * s2, size_t n) +{ + return strncpy (s1, s2, n); +} + +PACE_INLINE +size_t +pace_strcspn (const char * s1, const char * s2) +{ + return strcspn (s1, s2); +} + +PACE_INLINE +size_t +pace_strspn (const char * s1, const char * s2) +{ + return strspn (s1, s2); +} + +PACE_INLINE +char * +pace_strdup (const char * s1) +{ + return strdup (s1); +} + +PACE_INLINE +size_t +pace_strlen (const char * s) +{ + return strlen (s); +} + +PACE_INLINE +const char * +pace_strpbrk (const char * s1, const char * s2) +{ + return strpbrk (s1, s2); +} + +PACE_INLINE +const char * +pace_strstr (const char * s1, const char * s2) +{ + return strstr (s1, s2); +} + +PACE_INLINE +char * +pace_strtok (char * s1, const char * s2) +{ + return strtok (s1, s2); +} + +PACE_INLINE +char * +pace_strtok_r (char * s, const char * sep, char ** lasts) +{ +# if defined (PACE_HAS_REENTRANT) + return strtok_r (s, sep, lasts); +# else /* !PACE_HAS_REENTRANT */ + PACE_SET_ERRNO (PACE_ERRNO_LACKS_POSIX_C_SOURCE); + return 0; +# endif /* !PACE_HAS_REENTRANT */ +} + + diff --git a/PACE/pace/strings.c b/PACE/pace/strings.c new file mode 100644 index 00000000000..b836cd68a85 --- /dev/null +++ b/PACE/pace/strings.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * strings.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/strings.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/strings.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/strings.h b/PACE/pace/strings.h new file mode 100644 index 00000000000..0e7781e66c0 --- /dev/null +++ b/PACE/pace/strings.h @@ -0,0 +1,45 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * strings.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_STRINGS_H +#define PACE_STRINGS_H + + +#include "pace/defines.h" +#include "pace/unistd.h" + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE int pace_strcasecmp (const char * s1, + const char * s2); + + PACE_INLINE int pace_strncasecmp (const char * s1, + const char * s2, + size_t n); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/strings.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_STRINGS_H */ diff --git a/PACE/pace/strings.inl b/PACE/pace/strings.inl new file mode 100644 index 00000000000..c0afa77d513 --- /dev/null +++ b/PACE/pace/strings.inl @@ -0,0 +1,35 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * strings.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include <strings.h> + + +PACE_INLINE +int +pace_strcasecmp (const char * s1, + const char * s2) +{ + return strcasecmp (s1, s2); +} + +PACE_INLINE +int +pace_strncasecmp (const char * s1, + const char * s2, + size_t n) +{ + return strncasecmp (s1, s2, n); +} diff --git a/PACE/pace/sys/mman.c b/PACE/pace/sys/mman.c new file mode 100644 index 00000000000..aeffd95e65b --- /dev/null +++ b/PACE/pace/sys/mman.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * mman.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/sys/mman.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/sys/mman.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/sys/mman.h b/PACE/pace/sys/mman.h new file mode 100644 index 00000000000..dcd5df48c27 --- /dev/null +++ b/PACE/pace/sys/mman.h @@ -0,0 +1,78 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * mman.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_SYS_MMAN_H +#define PACE_SYS_MMAN_H + + +#include "pace/defines.h" +#include <sys/mman.h> + +/* Linux wants to use sys/types.h to define off_t. + * Sun is happy with sys/mman.h. + */ +# if defined (linux) +#include "pace/sys/types.h" +# endif /* linux */ + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE int pace_mlock (const void * addr, size_t len); + + PACE_INLINE int pace_mlockall (int flags); + + PACE_INLINE void * pace_mmap (void * addr, + size_t len, + int prot, + int flags, + int fildes, + off_t off); + + PACE_INLINE int pace_mprotect (const void * addr, + size_t len, + int prot); + + PACE_INLINE int pace_msync (void * addr, + size_t len, + int flags); + + PACE_INLINE int pace_munlock (const void * addr, size_t len); + + PACE_INLINE int pace_munlockall (); + + PACE_INLINE int pace_munmap (void *addr, size_t len); + + PACE_INLINE int pace_shm_open (const char * name, + int oflag, + mode_t mode); + /* Requires PACE_POSIX_C_SOURCE > 2. */ + + PACE_INLINE int pace_shm_unlink (const char * name); + /* Requires PACE_POSIX_C_SOURCE > 2. */ + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/sys/mman.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_SYS_MMAN_H */ diff --git a/PACE/pace/sys/mman.inl b/PACE/pace/sys/mman.inl new file mode 100644 index 00000000000..bbd396427a1 --- /dev/null +++ b/PACE/pace/sys/mman.inl @@ -0,0 +1,111 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * mman.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +int +pace_mlock (const void * addr, size_t len) +{ + return mlock (((char*)addr), len); +} + +PACE_INLINE +int +pace_mlockall (int flags) +{ + return mlockall (flags); +} + +PACE_INLINE +void * +pace_mmap (void * addr, + size_t len, + int prot, + int flags, + int fildes, + off_t off) +{ + return mmap ((char *) addr, len, prot, flags, fildes, off); +} + +PACE_INLINE +int +pace_munlock (const void * addr, size_t len) +{ + return munlock (((char*)addr), len); +} + +PACE_INLINE +int +pace_mprotect (const void * addr, + size_t len, + int prot) +{ + return PACE_mprotect (addr, len, prot); +} + +PACE_INLINE +int +pace_msync (void * addr, + size_t len, + int flags) +{ + return PACE_msync (addr, len, flags); +} + +PACE_INLINE +int +pace_munlockall () +{ + return munlockall (); +} + +PACE_INLINE +int +pace_munmap (void * addr, size_t len) +{ + return munmap ((char *) addr, len); +} + +PACE_INLINE +int +pace_shm_open (const char * name, + int oflag, + mode_t mode) +{ +# if (PACE_POSIX_C_SOURCE > 2) + return shm_open (name, oflag, mode); +# else /* !PACE_POSIX_C_SOURCE */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_C_SOURCE); +# endif /* !PACE_POSIX_C_SOURCE */ +} + +PACE_INLINE +int +pace_shm_unlink (const char * name) +{ +# if (PACE_POSIX_C_SOURCE > 2) + return shm_unlink (name); +# else /* !PACE_POSIX_C_SOURCE */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_C_SOURCE); +# endif /* !PACE_POSIX_C_SOURCE */ +} + + + + + + + diff --git a/PACE/pace/sys/socket.c b/PACE/pace/sys/socket.c new file mode 100644 index 00000000000..e846bbe1c1b --- /dev/null +++ b/PACE/pace/sys/socket.c @@ -0,0 +1,21 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * socket.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/sys/socket.h" + +# if !defined (PACE_HAS_INLINE) +# include "pace/sys/socket.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/sys/socket.h b/PACE/pace/sys/socket.h new file mode 100644 index 00000000000..03c945eb9e5 --- /dev/null +++ b/PACE/pace/sys/socket.h @@ -0,0 +1,65 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * socket.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_SYS_SOCKET_H +#define PACE_SYS_SOCKET_H + + +#include "pace/defines.h" +#include "pace/sys/types.h" +#include <sys/socket.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE int pace_closesocket (PACE_HANDLE handle); + + PACE_INLINE int pace_getpeername (int s, + struct sockaddr * name, + socklen_t * namelen); + + PACE_INLINE int pace_getsockname (int s, + struct sockaddr * name, + socklen_t * namelen); + + PACE_INLINE int pace_getsockopt (int s, + int level, + int optname, + void * optval, + socklen_t * optlen); + + PACE_INLINE int pace_setsockopt (int s, + int level, + int optname, + const void * optval, + socklen_t optlen); + + PACE_INLINE int pace_socket (int domain, + int type, + int protocol); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/sys/socket.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_SYS_SOCKET_H */ diff --git a/PACE/pace/sys/socket.inl b/PACE/pace/sys/socket.inl new file mode 100644 index 00000000000..fff47b26bc2 --- /dev/null +++ b/PACE/pace/sys/socket.inl @@ -0,0 +1,74 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * socket.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include <unistd.h> + + +PACE_INLINE +int +pace_closesocket (PACE_HANDLE handle) +{ + return close (handle); +} + +PACE_INLINE +int +pace_getpeername (int s, + struct sockaddr * name, + socklen_t * namelen) +{ + return getpeername (s, name, namelen); +} + +PACE_INLINE +int +pace_getsockname (int s, + struct sockaddr * name, + socklen_t * namelen) +{ + return getsockname (s, name, namelen); +} + +PACE_INLINE +int +pace_getsockopt (int s, + int level, + int optname, + void * optval, + socklen_t * optlen) +{ + return getsockopt (s, level, optname, optval, optlen); +} + +PACE_INLINE +int +pace_setsockopt (int s, + int level, + int optname, + const void * optval, + socklen_t optlen) +{ + return setsockopt (s, level, optname, optval, optlen); +} + +PACE_INLINE +int +pace_socket (int domain, + int type, + int protocol) +{ + return socket (domain, type, protocol); +} diff --git a/PACE/pace/sys/stat.c b/PACE/pace/sys/stat.c new file mode 100644 index 00000000000..57ee25af135 --- /dev/null +++ b/PACE/pace/sys/stat.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * stat.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/sys/stat.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/sys/stat.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/sys/stat.h b/PACE/pace/sys/stat.h new file mode 100644 index 00000000000..652ced3917f --- /dev/null +++ b/PACE/pace/sys/stat.h @@ -0,0 +1,53 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * stat.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_SYS_STAT_H +#define PACE_SYS_STAT_H + + +#include "pace/defines.h" +#include "pace/sys/types.h" +#include <sys/stat.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE int pace_chmod (const char * path, mode_t mode); + + PACE_INLINE int pace_fchmod (int fildes, mode_t mode); + + PACE_INLINE int pace_fstat (int fildes, struct stat * buf); + + PACE_INLINE int pace_mkdir (const char * path, mode_t mode); + + PACE_INLINE int pace_mkfifo (const char * path, mode_t mode); + + PACE_INLINE int pace_stat (const char * path, struct stat * buf); + + PACE_INLINE mode_t pace_umask (mode_t cmask); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/sys/stat.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_SYS_STAT_H */ diff --git a/PACE/pace/sys/stat.inl b/PACE/pace/sys/stat.inl new file mode 100644 index 00000000000..e44ceedda61 --- /dev/null +++ b/PACE/pace/sys/stat.inl @@ -0,0 +1,64 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * stat.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +int +pace_chmod (const char * path, mode_t mode) +{ + return chmod (path, mode); +} + +PACE_INLINE +int +pace_fchmod (int fildes, mode_t mode) +{ + return fchmod (fildes, mode); +} + +PACE_INLINE +int +pace_fstat (int fildes, struct stat * buf) +{ + return fstat (fildes, buf); +} + +PACE_INLINE +int +pace_mkdir (const char * path, mode_t mode) +{ + return mkdir (path, mode); +} + +PACE_INLINE +int +pace_mkfifo (const char * path, mode_t mode) +{ + return mkfifo (path, mode); +} + +PACE_INLINE +int +pace_stat (const char * path, struct stat * buf) +{ + return stat (path, buf); +} + +PACE_INLINE +mode_t +pace_umask (mode_t cmask) +{ + return umask (cmask); +} diff --git a/PACE/pace/sys/termios.c b/PACE/pace/sys/termios.c new file mode 100644 index 00000000000..eaa7a268359 --- /dev/null +++ b/PACE/pace/sys/termios.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * termios.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/sys/termios.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/sys/termios.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/sys/termios.h b/PACE/pace/sys/termios.h new file mode 100644 index 00000000000..dc39999f216 --- /dev/null +++ b/PACE/pace/sys/termios.h @@ -0,0 +1,65 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * termios.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_SYS_TERMIOS_H +#define PACE_SYS_TERMIOS_H + + +#include "pace/defines.h" +#include "pace/sys/types.h" +#include <termios.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS) */ + + PACE_INLINE speed_t pace_cfgetospeed (const struct termios * termiosp); + + PACE_INLINE int pace_cfsetospeed (struct termios * termios_p, speed_t speed); + + PACE_INLINE speed_t pace_cfgetispeed (const struct termios * termios_p); + + PACE_INLINE int pace_cfsetispeed (struct termios * termios_p, speed_t speed); + + PACE_INLINE int pace_tcdrain (int fildes); + + PACE_INLINE int pace_tcflow (int fildes, int action); + + PACE_INLINE int pace_tcflush (int fildes, int queue_selector); + + PACE_INLINE int pace_tcgetattr (int fildes, struct termios * termios_p); + + PACE_INLINE pid_t pace_tcgetpgrp (int fildes); + + PACE_INLINE int pace_tcsendbreak (int fildes, int duration); + + PACE_INLINE int pace_tcsetattr (int fildes, + int optional_actions, + const struct termios * termios_p); + + PACE_INLINE int pace_tcsetpgrp (int fildes, pid_t pgrp_id); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/sys/termios.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_SYS_TERMIOS_H */ diff --git a/PACE/pace/sys/termios.inl b/PACE/pace/sys/termios.inl new file mode 100644 index 00000000000..8df184f3540 --- /dev/null +++ b/PACE/pace/sys/termios.inl @@ -0,0 +1,107 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * termios.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include <unistd.h> + + +PACE_INLINE +speed_t +pace_cfgetospeed (const struct termios *termiosp) +{ + return cfgetospeed (termiosp); +} + +PACE_INLINE +int +pace_cfsetospeed (struct termios *termios_p, speed_t speed) +{ + return cfsetospeed (termios_p, speed); +} + +PACE_INLINE +speed_t +pace_cfgetispeed (const struct termios *termios_p) +{ + return cfgetispeed (termios_p); +} + +PACE_INLINE +int +pace_cfsetispeed (struct termios *termios_p, speed_t speed) +{ + return cfsetispeed (termios_p, speed); +} + +PACE_INLINE +int +pace_tcdrain (int fildes) +{ + return tcdrain (fildes); +} + +PACE_INLINE +int +pace_tcgetattr (int fildes, struct termios *termios_p) +{ + return tcgetattr (fildes, termios_p); +} + +PACE_INLINE +int +pace_tcflow (int fildes, int action) +{ + return tcflow (fildes, action); +} + +PACE_INLINE +int +pace_tcflush (int fildes, int queue_selector) +{ + return tcflush (fildes, queue_selector); +} + +PACE_INLINE +pid_t +pace_tcgetpgrp (int fildes) +{ + return tcgetpgrp (fildes); +} + +PACE_INLINE +int +pace_tcsendbreak (int fildes, int duration) +{ + return tcsendbreak (fildes, duration); +} + +PACE_INLINE +int +pace_tcsetattr (int fildes, + int optional_actions, + const struct termios *termios_p) +{ + return tcsetattr (fildes, optional_actions, termios_p); +} + +PACE_INLINE +int +pace_tcsetpgrp (int fildes, pid_t pgrp_id) +{ + return tcsetpgrp (fildes, pgrp_id); +} + + + diff --git a/PACE/pace/sys/times.c b/PACE/pace/sys/times.c new file mode 100644 index 00000000000..94919a6bc16 --- /dev/null +++ b/PACE/pace/sys/times.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * times.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/sys/times.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/sys/times.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/sys/times.h b/PACE/pace/sys/times.h new file mode 100644 index 00000000000..d7d54be9baf --- /dev/null +++ b/PACE/pace/sys/times.h @@ -0,0 +1,40 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * times.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_SYS_TIMES_H +#define PACE_SYS_TIMES_H + + +#include "pace/defines.h" +#include <sys/times.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE clock_t pace_times (struct tms * buffer); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/sys/times.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_SYS_TIMES_H */ diff --git a/PACE/pace/sys/times.inl b/PACE/pace/sys/times.inl new file mode 100644 index 00000000000..f1e6761dd20 --- /dev/null +++ b/PACE/pace/sys/times.inl @@ -0,0 +1,22 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * times.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +clock_t +pace_times (struct tms * buffer) +{ + return times (buffer); +} diff --git a/PACE/pace/sys/types.h b/PACE/pace/sys/types.h new file mode 100644 index 00000000000..fe48799e3b1 --- /dev/null +++ b/PACE/pace/sys/types.h @@ -0,0 +1,60 @@ +/* -*- C -*- + * $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * types.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_SYS_TYPES_H +#define PACE_SYS_TYPES_H + + +#include <sys/types.h> + +/* specific to SunOS 5.7 ace.cs <luther@cs.wustl.edu> */ +#include <inttypes.h> + + +/* Wrap a handle. */ +# define PACE_HANDLE int +# define PACE_INVALID_HANDLE -1 + +# if defined (PACE_PSOS_TM) +typedef long long longlong_t; +typedef long id_t; +# endif /* PACE_PSOS_TM */ + +# define PACE_UINT32 uint32_t +# define PACE_UINT16 uint16_t + +# if defined PACE_HAS_WCHAR +# if defined PACE_USES_WCHAR +# define PACE_TCHAR wchar +# define PACE_TEXT(X) X +# endif /* PACE_USES_WCHAR */ +# else /* !PACE_HAS_WCHAR */ +# define PACE_TCHAR char +# define PACE_TEXT(X) X +# endif /* PACE_HAS_WCHAR */ + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* (PACE_HAS_CPLUSPLUS) */ + + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + + +#endif /* PACE_SYS_TYPES_H */ diff --git a/PACE/pace/sys/utsname.c b/PACE/pace/sys/utsname.c new file mode 100644 index 00000000000..7483d7ca22f --- /dev/null +++ b/PACE/pace/sys/utsname.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * utsname.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/sys/utsname.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/sys/utsname.inl" +# endif /* PACE_HAS_INLINE */ diff --git a/PACE/pace/sys/utsname.h b/PACE/pace/sys/utsname.h new file mode 100644 index 00000000000..60a5de85886 --- /dev/null +++ b/PACE/pace/sys/utsname.h @@ -0,0 +1,40 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * utsname.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_SYS_UTSNAME_H +#define PACE_SYS_UTSNAME_H + + +#include "pace/defines.h" +#include <sys/utsname.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE int pace_uname (struct utsname * name); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/sys/utsname.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_SYS_UTSNAME_H */ diff --git a/PACE/pace/sys/utsname.inl b/PACE/pace/sys/utsname.inl new file mode 100644 index 00000000000..0fe39f13276 --- /dev/null +++ b/PACE/pace/sys/utsname.inl @@ -0,0 +1,22 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * utsname.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +int +pace_uname (struct utsname * name) +{ + return uname (name); +} diff --git a/PACE/pace/thread.h b/PACE/pace/thread.h new file mode 100644 index 00000000000..167d82c5f02 --- /dev/null +++ b/PACE/pace/thread.h @@ -0,0 +1,24 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * thread.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#ifndef PACE_THREAD_H +#define PACE_THREAD_H + + +#include "pace/defines.h" + + +#endif /* PACE_THREAD_H */ diff --git a/PACE/pace/time.c b/PACE/pace/time.c new file mode 100644 index 00000000000..6d9eb1e5fb3 --- /dev/null +++ b/PACE/pace/time.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * time.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/time.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/time.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/time.h b/PACE/pace/time.h new file mode 100644 index 00000000000..4dd0bed6b2b --- /dev/null +++ b/PACE/pace/time.h @@ -0,0 +1,109 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * time.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_TIME_H +#define PACE_TIME_H + + +#include "pace/defines.h" + +/* Linux doesn't support this file at all. + * Need these typedefs to just allow compilation. + */ +# if defined (linux) +typedef unsigned int clockid_t; +typedef unsigned int timerid_t; +typedef unsigned int timer_t; +struct tm { }; +struct sigevent { }; +struct itimerspec { }; +#include "pace/unistd.h" +# else /* !linux */ +#include <time.h> +#endif /* ! linux */ + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE char * pace_asctime_r (const struct tm * tm, char * buf); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE int pace_clock_getres (clockid_t clock_id, + struct timespec * res); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE int pace_clock_gettime (clockid_t clock_id, + struct timespec * tp); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE int pace_clock_settime (clockid_t clock_id, + const struct timespec * tp); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE char * pace_ctime_r (const time_t * clock, char * buf); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE struct tm * pace_gmtime_r (const time_t * clock, + struct tm * result); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE struct tm * pace_localtime_r (const time_t * clock, + struct tm * result); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE int pace_nanosleep (const struct timespec * rqtp, + struct timespec * rmtp); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE int pace_time (time_t *tloc); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE int pace_timer_create (clockid_t clock_id, + struct sigevent * evp, + timer_t * timerid); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE int pace_timer_delete (timer_t timerid); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE int pace_timer_getoverrun (timer_t timerid); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE int pace_timer_gettime (timer_t timerid, + struct itimerspec * value); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE int pace_timer_settime (timer_t timerid, + int flags, + const struct itimerspec * value, + struct itimerspec * ovalue); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE void pace_tzset (); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/time.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_TIME_H */ diff --git a/PACE/pace/time.inl b/PACE/pace/time.inl new file mode 100644 index 00000000000..12c5625606c --- /dev/null +++ b/PACE/pace/time.inl @@ -0,0 +1,199 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * time.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include <errno.h> +extern int errno; + + +PACE_INLINE +char * +pace_asctime_r (const struct tm * time, char * buf) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return asctime_r (time, buf); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_SET_ERRNO (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); + return 0; +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +int +pace_clock_getres (clockid_t clock_id, + struct timespec * res) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return clock_getres (clock_id, res); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +int +pace_clock_gettime (clockid_t clock_id, + struct timespec * tp) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return clock_gettime (clock_id, tp); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +int +pace_clock_settime (clockid_t clock_id, + const struct timespec * tp) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return clock_settime (clock_id, tp); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +char * +pace_ctime_r (const time_t * clock, char * buf) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return ctime_r (clock, buf); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_SETERNNO (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); + return 0; +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +struct tm * +pace_gmtime_r (const time_t * clock, struct tm * result) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return gmtime_r (clock, result); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_SET_ERRNO (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); + return 0; +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +struct tm * +pace_localtime_r (const time_t * clock, struct tm * result) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return localtime_r (clock, result); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_SET_ERRNO (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); + return 0; +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +int +pace_nanosleep (const struct timespec * rqtp, + struct timespec * rmtp) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return nanosleep (rqtp, rmtp); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +int +pace_time (time_t * tloc) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return time (tloc); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +int +pace_timer_create (clockid_t clock_id, + struct sigevent *evp, + timer_t *timerid) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return timer_create (clock_id, evp, timerid); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +int +pace_timer_delete (timer_t timerid) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return timer_delete (timerid); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +int +pace_timer_getoverrun (timer_t timerid) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return timer_getoverrun (timerid); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +int +pace_timer_gettime (timer_t timerid, + struct itimerspec * value) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return timer_gettime (timerid, value); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +int +pace_timer_settime (timer_t timerid, + int flags, + const struct itimerspec * value, + struct itimerspec * ovalue) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return timer_settime (timerid, flags, value, ovalue); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +void +pace_tzset () +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + tzset (); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_SET_ERRNO (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + return; +} diff --git a/PACE/pace/unistd.c b/PACE/pace/unistd.c new file mode 100644 index 00000000000..b21cc2005ac --- /dev/null +++ b/PACE/pace/unistd.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * unistd.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/unistd.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/unistd.inl" +# endif /* !PACE_HAS_INLINE */ diff --git a/PACE/pace/unistd.h b/PACE/pace/unistd.h new file mode 100644 index 00000000000..a8e1cd30864 --- /dev/null +++ b/PACE/pace/unistd.h @@ -0,0 +1,156 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * unistd.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_UNISTD_H +#define PACE_UNISTD_H + + +#include "pace/defines.h" +#include "pace/sys/types.h" +#include <stropts.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE void pace__exit (int status); + + PACE_INLINE unsigned int pace_alarm (unsigned int seconds); + + PACE_INLINE int pace_access (const char * path, int amode); + + PACE_INLINE int pace_chdir (const char * path); + + PACE_INLINE int pace_chown (const char * path, uid_t owner, gid_t group); + + PACE_INLINE int pace_close (int fildes); + + PACE_INLINE int pace_dup (int fildes); + + PACE_INLINE int pace_dup2 (int fildes, int fildes2); + + #define pace_execl(X) execl X + #define pace_execle(X) execle X + #define pace_execlp(X) execlp X + /* int execl (const char *path, const char *arg0, ..., + * const char *argn, char * (*//*NULL*//*) ); + * int execle (const char *path, char *const arg0[], ..., + * const char *argn, char * (*//*NULL*//*), char *const envp[]); + * int execlp (const char *file, const char *arg0, ..., + * const char *argn, char * (*//*NULL*//*)); + * + * PLEASE PAY SPECIAL ATTENTION HERE! + * This is a macro and requires an additional set of parenthesis + * surrounding the arguments. + */ + + PACE_INLINE int pace_execv (const char * path, char * const argv[]); + + PACE_INLINE int pace_execve (const char * path, char * const argv[], + char * const envp[]); + + PACE_INLINE int pace_execvp (const char * file, char * const argv[]); + + PACE_INLINE int pace_fdatasync (int fildes); + + PACE_INLINE pid_t pace_fork (); + + PACE_INLINE long pace_fpathconf (int fildes, int name); + + PACE_INLINE int pace_fsync (int fildes); + + PACE_INLINE int pace_ftruncate (int fildes, off_t length); + + PACE_INLINE char * pace_getcwd (char * buf, size_t size); + + PACE_INLINE uid_t pace_getegid (); + + PACE_INLINE uid_t pace_geteuid (); + + PACE_INLINE uid_t pace_getgid (); + + PACE_INLINE int pace_getgroups (int gidsetsize, gid_t grouplist[]); + + PACE_INLINE char * pace_getlogin (); + + PACE_INLINE int pace_getlogin_r (char * name, size_t namesize); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE pid_t pace_getpgrp (); + + PACE_INLINE pid_t pace_getpid (); + + PACE_INLINE pid_t pace_getppid (); + + PACE_INLINE uid_t pace_getuid (); + + #define pace_ioctl(X) ioctl X + /* int ioctl (int fildes, int request, (*//* args *//*)) + * + * PLEASE PAY SPECIAL ATTENTION HERE! + * This is a macro and requires an additional set of parenthesis + * surrounding the arguments. + */ + + + PACE_INLINE int pace_isatty (int fildes); + + PACE_INLINE int pace_link (const char * existing, const char * new_link); + + PACE_INLINE off_t pace_lseek (int fildes, off_t offset, int whence); + + PACE_INLINE long pace_pathconf (const char * path, int name); + + PACE_INLINE int pace_pause (); + + PACE_INLINE int pace_pipe (int fildes[2]); + + PACE_INLINE ssize_t pace_read (int fildes, void * buf, size_t nbyte); + + PACE_INLINE int pace_rmdir (const char * path); + + PACE_INLINE int pace_setgid (gid_t gid); + + PACE_INLINE int pace_setpgid (pid_t pid, pid_t pgid); + + PACE_INLINE pid_t pace_setsid (); + + PACE_INLINE int pace_setuid (uid_t uid); + + PACE_INLINE unsigned pace_sleep (unsigned int seconds); + + PACE_INLINE long pace_sysconf (int name); + + PACE_INLINE char * pace_ttyname (int fildes); + + PACE_INLINE int pace_ttyname_r (int fildes, char * name, size_t namesize); + /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */ + + PACE_INLINE int pace_unlink (const char * path); + + PACE_INLINE ssize_t pace_write (int fildes, const void * buf, size_t nbyte); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/unistd.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_UNISTD_H */ diff --git a/PACE/pace/unistd.inl b/PACE/pace/unistd.inl new file mode 100644 index 00000000000..76e57b3abe7 --- /dev/null +++ b/PACE/pace/unistd.inl @@ -0,0 +1,352 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * unistd.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include <unistd.h> + + +PACE_INLINE +void +pace__exit (int status) +{ + _exit (status); + return; +} + +PACE_INLINE +int +pace_access (const char * path, int amode) +{ + return access (path, amode); +} + +PACE_INLINE +unsigned int +pace_alarm (unsigned int seconds) +{ + return alarm (seconds); +} + +PACE_INLINE +int +pace_chdir (const char * path) +{ + return chdir (path); +} + +PACE_INLINE +int +pace_chown (const char * path, uid_t owner, gid_t group) +{ + return chown (path, owner, group); +} + +PACE_INLINE +int +pace_close (int fildes) +{ + return close (fildes); +} + +PACE_INLINE +int +pace_dup (int fildes) +{ + return dup (fildes); +} + +PACE_INLINE +int +pace_dup2 (int fildes, int fildes2) +{ + return dup2 (fildes, fildes2); +} + +PACE_INLINE +int +pace_execv (const char * path, + char * const argv[]) +{ + return execv (path, argv); + /* if successful, this operation does NOT return */ +} + +PACE_INLINE +int +pace_execve (const char * path, + char * const argv[], + char * const envp[]) +{ + return execve (path, argv, envp); + /* if successful, this operation does NOT return */ +} + +PACE_INLINE +int +pace_execvp (const char * file, + char * const argv[]) +{ + return execvp (file, argv); + /* if successful, this operation does NOT return */ +} + +PACE_INLINE +int +pace_fdatasync (int fildes) +{ + return fdatasync (fildes); +} + +PACE_INLINE +pid_t +pace_fork () +{ + return fork (); +} + +PACE_INLINE +long +pace_fpathconf (int fildes, int name) +{ + return fpathconf (fildes, name); +} + +PACE_INLINE +int +pace_fsync (int fildes) +{ + return fildes; +} + +PACE_INLINE +int +pace_ftruncate (int fildes, off_t length) +{ + return ftruncate (fildes, length); +} + +PACE_INLINE +char * +pace_getcwd (char * buf, size_t size) +{ + return getcwd (buf, size); +} + +PACE_INLINE +uid_t +pace_getegid () +{ + return getegid (); +} + +PACE_INLINE +uid_t +pace_geteuid () +{ + return geteuid (); +} + +PACE_INLINE +int +pace_getgroups (int gidsetsize, gid_t grouplist[]) +{ + return getgroups (gidsetsize, grouplist); +} + +PACE_INLINE +uid_t +pace_getgid () +{ + return getgid (); +} + +PACE_INLINE +char* +pace_getlogin () +{ + return getlogin (); +} + +PACE_INLINE +int +pace_getlogin_r (char * name, size_t namesize) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return getlogin_r (name, namesize); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LAKCS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + + +PACE_INLINE +pid_t +pace_getpgrp () +{ + return getpgrp (); +} + +PACE_INLINE +pid_t +pace_getpid () +{ + return getpid (); +} + +PACE_INLINE +pid_t +pace_getppid () +{ + return getppid (); +} + +PACE_INLINE +uid_t +pace_getuid () +{ + return getuid (); +} + +PACE_INLINE +int +pace_isatty (int fildes) +{ + return isatty (fildes); +} + +PACE_INLINE +int +pace_link (const char * existing, const char * new_link) +{ + return link (existing, new_link); +} + +PACE_INLINE +off_t +pace_lseek (int fildes, off_t offset, int whence) +{ + return lseek (fildes, offset, whence); +} + +PACE_INLINE +int +pace_pause () +{ + return pause (); +} + +PACE_INLINE +long +pace_pathconf (const char * path, int name) +{ + return pathconf (path, name); +} + +PACE_INLINE +int +pace_pipe (int fildes[2]) +{ + return pipe (fildes); +} + +PACE_INLINE +ssize_t +pace_read (int fildes, void * buf, size_t nbyte) +{ + return read (fildes, buf, nbyte); +} + +PACE_INLINE +int +pace_rmdir (const char * path) +{ + return rmdir (path); +} + +PACE_INLINE +int +pace_setgid (gid_t gid) +{ + return setgid (gid); +} + +PACE_INLINE +int +pace_setpgid (pid_t pid, pid_t pgid) +{ + return setpgid (pid, pgid); +} + +PACE_INLINE +pid_t +pace_setsid () +{ + return setsid (); +} + +PACE_INLINE +int +pace_setuid (uid_t uid) +{ + return setuid (uid); +} + +PACE_INLINE +unsigned int +pace_sleep (unsigned int seconds) +{ + return sleep (seconds); +} + +PACE_INLINE +long +pace_sysconf (int name) +{ + return sysconf (name); +} + +PACE_INLINE +char * +pace_ttyname (int fildes) +{ + return ttyname (fildes); +} + +PACE_INLINE +int +pace_ttyname_r (int fildes, + char * name, + size_t namesize) +{ +# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) + return ttyname_r (fildes, name, namesize); +# else /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + PACE_RETURN_NO_SUPPORT (PACE_ERRNO_LACKS_POSIX_PTHREAD_SEMANTICS); +# endif /* !PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +} + +PACE_INLINE +int +pace_unlink (const char * path) +{ + return unlink (path); +} + +PACE_INLINE +ssize_t +pace_write (int fildes, const void * buf, size_t nbyte) +{ + return write (fildes, buf, nbyte); +} diff --git a/PACE/pace/utime.c b/PACE/pace/utime.c new file mode 100644 index 00000000000..a265d970d52 --- /dev/null +++ b/PACE/pace/utime.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * utime.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/utime.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/utime.inl" +# endif /* PACE_HAS_INLINE */ diff --git a/PACE/pace/utime.h b/PACE/pace/utime.h new file mode 100644 index 00000000000..172cfb7a799 --- /dev/null +++ b/PACE/pace/utime.h @@ -0,0 +1,42 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * utime.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_UTIME_H +#define PACE_UTIME_H + + +#include "pace/defines.h" +#include "pace/sys/types.h" +#include <utime.h> + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE int pace_utime (const char * path, + const struct utimbuf * times); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/utime.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_UTIME_H */ diff --git a/PACE/pace/utime.inl b/PACE/pace/utime.inl new file mode 100644 index 00000000000..3f643130b04 --- /dev/null +++ b/PACE/pace/utime.inl @@ -0,0 +1,23 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * utime.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +PACE_INLINE +int +pace_utime (const char * path, + const struct utimbuf * times) +{ + return utime (path, times); +} diff --git a/PACE/pace/wait.c b/PACE/pace/wait.c new file mode 100644 index 00000000000..2a5b252930e --- /dev/null +++ b/PACE/pace/wait.c @@ -0,0 +1,22 @@ +/* $Id$ + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * wait.c + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include "pace/wait.h" + + +# if !defined (PACE_HAS_INLINE) +# include "pace/wait.inl" +# endif /* PACE_HAS_INLINE */ diff --git a/PACE/pace/wait.h b/PACE/pace/wait.h new file mode 100644 index 00000000000..56483428859 --- /dev/null +++ b/PACE/pace/wait.h @@ -0,0 +1,44 @@ +/* $Id$ + + * ============================================================================ + * + * = LIBRARY + * pace + * + * = FILENAME + * wait.h + * + * = AUTHOR + * Luther Baker + * + * ============================================================================ */ + + +#ifndef PACE_WAIT_H +#define PACE_WAIT_H + + +#include "pace/defines.h" +#include "pace/sys/types.h" + + +# if defined (PACE_HAS_CPLUSPLUS) +extern "C" { +# endif /* PACE_HAS_CPLUSPLUS */ + + PACE_INLINE pid_t pace_wait (int * statloc); + + PACE_INLINE pid_t pace_waitpid (pid_t pid, + int * statloc, + int options); + +# if defined (PACE_HAS_CPLUSPLUS) +} +# endif /* PACE_HAS_CPLUSPLUS */ + +# if defined (PACE_HAS_INLINE) +# include "pace/wait.inl" +# endif /* PACE_HAS_INLINE */ + + +#endif /* PACE_WAIT_H */ diff --git a/PACE/pace/wait.inl b/PACE/pace/wait.inl new file mode 100644 index 00000000000..a255a53cce3 --- /dev/null +++ b/PACE/pace/wait.inl @@ -0,0 +1,32 @@ +/* $Id$ -*- C -*- + + * ============================================================================= + * + * = LIBRARY + * pace + * + * = FILENAME + * wait.inl + * + * = AUTHOR + * Luther Baker + * + * ============================================================================= */ + + +#include <sys/wait.h> + + +PACE_INLINE +pid_t +pace_wait (int * statloc) +{ + return wait (statloc); +} + +PACE_INLINE +pid_t +pace_waitpid (pid_t pid, int * statloc, int options) +{ + return waitpid (pid, statloc, options); +} |