From d427d09204c97df14607149e94a1da9beddd76ab Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 21 Jun 2002 18:29:23 +0000 Subject: 2002-06-21 Jeff Johnston * libc/include/stdio.h (__getline, __getdelim): New prototypes. * libc/include/time.h [HAVE_GETDATE](getdate, getdate_r): Ditto. [HAVE_GETDATE](getdate_err): New error code. * libc/stdio/Makefile.am: Add support for getline.c and getdelim.c. * libc/stdio/Makefile.in: Regenerated. * libc/stdio/getdelim.c: New file. * libc/stdio/getline.c: Ditto. * libc/sys/linux/Makefile.am: Add support for getdate.c, getdate_err.c and ntp_gettime.c. Also add AM_CFLAGS to point to libc/stdio. * libc/sys/linux/Makefile.in: Regenerated. * libc/sys/linux/getdate.c: New file. * libc/sys/linux/getdate_err.c: Ditto. * libc/sys/linux/ntp_gettime.c: Ditto. * libc/sys/linux/time.c (adjtimex, ntp_adjtime): New functions. * libc/sys/linux/sys/stdio.h (getline, getdelim): New macros. --- newlib/libc/include/stdio.h | 9 ++++++--- newlib/libc/include/time.h | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) (limited to 'newlib/libc/include') diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h index 73204cb72..51403a352 100644 --- a/newlib/libc/include/stdio.h +++ b/newlib/libc/include/stdio.h @@ -46,13 +46,13 @@ extern "C" { */ #include - -#include +#include typedef _fpos_t fpos_t; - typedef struct __sFILE FILE; +#include + #define __SLBF 0x0001 /* line buffered */ #define __SNBF 0x0002 /* unbuffered */ #define __SRD 0x0004 /* OK to read */ @@ -271,6 +271,9 @@ int _EXFUN(_vfscanf_r, (struct _reent *, FILE *, const char *, __VALIST)); int _EXFUN(_vscanf_r, (struct _reent *, const char *, __VALIST)); int _EXFUN(_vsscanf_r, (struct _reent *, const char *, const char *, __VALIST)); +ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *)); +ssize_t _EXFUN(__getline, (char **, size_t *, FILE *)); + /* * Routines internal to the implementation. */ diff --git a/newlib/libc/include/time.h b/newlib/libc/include/time.h index c45be5484..9b164170c 100644 --- a/newlib/libc/include/time.h +++ b/newlib/libc/include/time.h @@ -67,6 +67,29 @@ char *_EXFUN(strptime, (const char *, const char *, struct tm *)); _VOID _EXFUN(tzset, (_VOID)); _VOID _EXFUN(_tzset_r, (struct _reent *)); +/* getdate functions */ + +#ifdef HAVE_GETDATE +#ifndef _REENT_ONLY +#define getdate_err (*__getdate_err()) +int *_EXFUN(__getdate_err,(_VOID)); + +struct tm * _EXFUN(getdate, (const char *)); +/* getdate_err is set to one of the following values to indicate the error. + 1 the DATEMSK environment variable is null or undefined, + 2 the template file cannot be opened for reading, + 3 failed to get file status information, + 4 the template file is not a regular file, + 5 an error is encountered while reading the template file, + 6 memory allication failed (not enough memory available), + 7 there is no line in the template that matches the input, + 8 invalid input specification */ +#endif /* !_REENT_ONLY */ + +/* getdate_r returns the error code as above */ +int _EXFUN(getdate_r, (const char *, struct tm *)); +#endif /* HAVE_GETDATE */ + /* defines for the opengroup specifications Derived from Issue 1 of the SVID. */ extern __IMPORT time_t _timezone; extern __IMPORT int _daylight; -- cgit v1.2.3