-/* Flags for representing mode (see fopen()). Note these must fit the same
- status field as the _IO?BF flags in <stdio.h> and the internal flags below.
-*/
-#define _PDCLIB_FREAD 8u
-#define _PDCLIB_FWRITE 16u
-#define _PDCLIB_FAPPEND 32u
-#define _PDCLIB_FRW 64u
-#define _PDCLIB_FBIN 128u
-
-/* Internal flags, made to fit the same status field as the flags above. */
-#define _PDCLIB_LIBBUFFER 512u
-#define _PDCLIB_VIRGINSTR 1024u
-#define _PDCLIB_ERRORFLAG 2048u
-#define _PDCLIB_EOFFLAG 4096u
-#define _PDCLIB_WIDESTREAM 8192u
-#define _PDCLIB_BYTESTREAM 16384u
-
-struct _PDCLIB_file_t
-{
- _PDCLIB_fd_t handle; /* OS-specific file descriptor */
- _PDCLIB_fpos_t position; /* file position indicator */
- char * buffer; /* file buffer */
- _PDCLIB_size_t bufsize; /* size of buffer */
- _PDCLIB_size_t bufidx; /* index to point of action in buffer */
- _PDCLIB_size_t bufend; /* index to end of pre-read buffer */
- unsigned int status; /* misc. status bits */
- char * filename; /* name used in fopen() / freopen() */
- struct _PDCLIB_file_t * next; /* provisions for linked list handling */
-};
+typedef _PDCLIB_time _PDCLIB_time_t;
+typedef _PDCLIB_clock _PDCLIB_clock_t;
+
+#if !defined(_PDCLIB_DEFINE_STRUCT_TIMESPEC)
+#define _PDCLIB_DEFINE_STRUCT_TIMESPEC() \
+ struct timespec { \
+ time_t tv_sec; \
+ long tv_nsec; \
+ };
+#endif
+
+#if !defined(_PDCLIB_DEFINE_STRUCT_TM)
+#define _PDCLIB_DEFINE_STRUCT_TM() \
+ struct tm { \
+ int tm_sec; \
+ int tm_min; \
+ int tm_hour; \
+ int tm_mday; \
+ int tm_mon; \
+ int tm_year; \
+ int tm_wday; \
+ int tm_yday; \
+ int tm_isdst; \
+ };
+#endif