]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/Include/stdio.h
Add Socket Libraries.
[mirror_edk2.git] / StdLib / Include / stdio.h
index 7a60a290acb905cc2676e1be0ae4cec6f4e483c7..7c3586c9abf19fb7622c19f81fbfbc339c030392 100644 (file)
@@ -36,7 +36,7 @@
 #ifndef _STDIO_H_\r
 #define _STDIO_H_\r
 \r
-#include  <sys/EfiCdefs.h>\r
+#include  <stdarg.h>\r
 #include  <limits.h>\r
 #include  <sys/ansi.h>\r
 #include  <machine/ansi.h>\r
@@ -475,14 +475,14 @@ int       setvbuf (FILE * __restrict, char * __restrict, int, size_t);
 int       sscanf  (const char * __restrict, const char * __restrict, ...);\r
 FILE     *tmpfile (void);\r
 int       ungetc  (int, FILE *);\r
-int       vfprintf(FILE * __restrict, const char * __restrict, _BSD_VA_LIST_);\r
-int       vprintf (const char * __restrict, _BSD_VA_LIST_);\r
+int       vfprintf(FILE * __restrict, const char * __restrict, va_list);\r
+int       vprintf (const char * __restrict, va_list);\r
 \r
 #ifndef __AUDIT__\r
 char     *gets    (char *);\r
 int       sprintf (char * __restrict, const char * __restrict, ...);\r
 char     *tmpnam  (char *);\r
-int       vsprintf(char * __restrict, const char * __restrict, _BSD_VA_LIST_);\r
+int       vsprintf(char * __restrict, const char * __restrict, va_list);\r
 #endif\r
 \r
 #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)\r
@@ -531,46 +531,33 @@ __END_DECLS
 /*\r
  * Functions defined in POSIX 1003.2 and XPG2 or later.\r
  */\r
-#if (_POSIX_C_SOURCE - 0) >= 2 || (_XOPEN_SOURCE - 0) >= 2 || \\r
-    defined(_NETBSD_SOURCE)\r
-  __BEGIN_DECLS\r
+__BEGIN_DECLS\r
   int     pclose  (FILE *);\r
   FILE   *popen   (const char *, const char *);\r
-  __END_DECLS\r
-#endif\r
+__END_DECLS\r
 \r
 /*\r
  * Functions defined in ISO XPG4.2, ISO C99, POSIX 1003.1-2001 or later.\r
  */\r
-#if ((__STDC_VERSION__ - 0) >= 199901L) || \\r
-    ((_POSIX_C_SOURCE - 0) >= 200112L) || \\r
-    (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \\r
-    ((_XOPEN_SOURCE - 0) >= 500) || \\r
-    defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)\r
-  __BEGIN_DECLS\r
+__BEGIN_DECLS\r
   int     snprintf (char * __restrict, size_t, const char * __restrict, ...)\r
           __attribute__((__format__(__printf__, 3, 4)));\r
-  int     vsnprintf(char * __restrict, size_t, const char * __restrict, _BSD_VA_LIST_)\r
+  int     vsnprintf(char * __restrict, size_t, const char * __restrict, va_list)\r
           __attribute__((__format__(__printf__, 3, 0)));\r
-  __END_DECLS\r
-#endif\r
+__END_DECLS\r
 \r
 /*\r
  * Functions defined in XPG4.2.\r
  */\r
-#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)\r
-  __BEGIN_DECLS\r
+__BEGIN_DECLS\r
   int   getw(FILE *);\r
   int   putw(int, FILE *);\r
   char *mkdtemp(char *);\r
   int   mkstemp(char *);\r
   char *mktemp(char *);\r
 \r
-  #ifndef __AUDIT__\r
     char *tempnam(const char *, const char *);\r
-  #endif\r
-  __END_DECLS\r
-#endif\r
+__END_DECLS\r
 \r
 /*\r
  * X/Open CAE Specification Issue 5 Version 2\r
@@ -588,15 +575,13 @@ __END_DECLS
 /*\r
  * Routines that are purely local.\r
  */\r
-#if defined(_NETBSD_SOURCE)\r
-\r
-  #define FPARSELN_UNESCESC 0x01\r
-  #define FPARSELN_UNESCCONT  0x02\r
-  #define FPARSELN_UNESCCOMM  0x04\r
-  #define FPARSELN_UNESCREST  0x08\r
-  #define FPARSELN_UNESCALL 0x0f\r
+#define FPARSELN_UNESCESC 0x01\r
+#define FPARSELN_UNESCCONT  0x02\r
+#define FPARSELN_UNESCCOMM  0x04\r
+#define FPARSELN_UNESCREST  0x08\r
+#define FPARSELN_UNESCALL 0x0f\r
 \r
-  __BEGIN_DECLS\r
+__BEGIN_DECLS\r
   //int     asprintf(char ** __restrict, const char * __restrict, ...)\r
   //      __attribute__((__format__(__printf__, 2, 3)));\r
   char   *fgetln(FILE * __restrict, size_t * __restrict);\r
@@ -605,33 +590,32 @@ __END_DECLS
   void    setbuffer(FILE *, char *, int);\r
   int     setlinebuf(FILE *);\r
   int     vasprintf(char ** __restrict, const char * __restrict,\r
-        _BSD_VA_LIST_)\r
+        va_list)\r
         __attribute__((__format__(__printf__, 2, 0)));\r
-  int     vscanf(const char * __restrict, _BSD_VA_LIST_)\r
+  int     vscanf(const char * __restrict, va_list)\r
         __attribute__((__format__(__scanf__, 1, 0)));\r
   int     vfscanf(FILE * __restrict, const char * __restrict,\r
-        _BSD_VA_LIST_)\r
+        va_list)\r
         __attribute__((__format__(__scanf__, 2, 0)));\r
   int     vsscanf(const char * __restrict, const char * __restrict,\r
-        _BSD_VA_LIST_)\r
+        va_list)\r
         __attribute__((__format__(__scanf__, 2, 0)));\r
   const char *fmtcheck(const char *, const char *)\r
         __attribute__((__format_arg__(2)));\r
-  __END_DECLS\r
+__END_DECLS\r
 \r
   /*\r
    * Stdio function-access interface.\r
    */\r
-  __BEGIN_DECLS\r
+__BEGIN_DECLS\r
   FILE  *funopen(const void *,\r
       int (*)(void *, char *, int),\r
       int (*)(void *, const char *, int),\r
       fpos_t (*)(void *, fpos_t, int),\r
       int (*)(void *));\r
-  __END_DECLS\r
+__END_DECLS\r
   //#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)\r
   //#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)\r
-#endif /* _NETBSD_SOURCE */\r
 \r
 /*\r
  * Functions internal to the implementation.\r
@@ -646,6 +630,7 @@ __END_DECLS
  * define function versions in the C library.\r
  */\r
 #define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))\r
+\r
 #if defined(__GNUC__) && defined(__STDC__)\r
   static __inline int __sputc(int _c, FILE *_p) {\r
     if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))\r
@@ -673,33 +658,23 @@ __END_DECLS
 #define __sfileno(p)    ((p)->_file)\r
 \r
 #ifndef __lint__\r
-  #if !defined(_REENTRANT) && !defined(_PTHREADS)\r
     #define feof(p)     __sfeof(p)\r
     #define ferror(p)   __sferror(p)\r
     #define clearerr(p) __sclearerr(p)\r
 \r
     #define getc(fp)    __sgetc(fp)\r
     #define putc(x, fp) __sputc(x, fp)\r
-  #endif /* !_REENTRANT && !_PTHREADS */\r
 #endif /* __lint__ */\r
 \r
 #define getchar()   getc(stdin)\r
 #define putchar(x)  putc(x, stdout)\r
 \r
-#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \\r
-    defined(_NETBSD_SOURCE)\r
-  #if !defined(_REENTRANT) && !defined(_PTHREADS)\r
-    #define fileno(p) __sfileno(p)\r
-  #endif /* !_REENTRANT && !_PTHREADS */\r
-#endif /* !_ANSI_SOURCE */\r
+#define fileno(p) __sfileno(p)\r
 \r
-#if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \\r
-    defined(_REENTRANT) || defined(_NETBSD_SOURCE)\r
-  #define getc_unlocked(fp) __sgetc(fp)\r
-  #define putc_unlocked(x, fp)  __sputc(x, fp)\r
+#define getc_unlocked(fp) __sgetc(fp)\r
+#define putc_unlocked(x, fp)  __sputc(x, fp)\r
 \r
-  #define getchar_unlocked()  getc_unlocked(stdin)\r
-  #define putchar_unlocked(x) putc_unlocked(x, stdout)\r
-#endif /* _POSIX_C_SOURCE >= 199506 || _XOPEN_SOURCE >= 500 || _REENTRANT... */\r
+#define getchar_unlocked()  getc_unlocked(stdin)\r
+#define putchar_unlocked(x) putc_unlocked(x, stdout)\r
 \r
 #endif /* _STDIO_H_ */\r