00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <_ansi.h>
00026 #include <stdarg.h>
00027 #include <reent.h>
00028 #include <unistd.h>
00029
00030 extern int _EXFUN(__svfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list));
00031 extern FILE *_EXFUN(__sfp,(struct _reent *));
00032 extern int _EXFUN(__sflags,(struct _reent *,_CONST char*, int*));
00033 extern int _EXFUN(__srefill,(FILE *));
00034 extern _READ_WRITE_RETURN_TYPE _EXFUN(__sread,(void *, char *, int));
00035 extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite,(void *, char const *, int));
00036 extern _fpos_t _EXFUN(__sseek,(void *, _fpos_t, int));
00037 extern int _EXFUN(__sclose,(void *));
00038 extern int _EXFUN(__stextmode,(int));
00039 extern void _EXFUN(__sinit,(struct _reent *));
00040 extern void _EXFUN(_cleanup_r,(struct _reent *));
00041 extern void _EXFUN(__smakebuf,(FILE *));
00042 extern int _EXFUN(_fwalk,(struct _reent *, int (*)(FILE *)));
00043 struct _glue * _EXFUN(__sfmoreglue,(struct _reent *,int n));
00044 extern int _EXFUN(__srefill,(FILE *fp));
00045
00046
00047
00048 #define CHECK_INIT(fp) \
00049 do \
00050 { \
00051 if (!_REENT->__sdidinit) \
00052 __sinit (_REENT); \
00053 } \
00054 while (0)
00055
00056
00057
00058 #define cantwrite(fp) \
00059 ((((fp)->_flags & __SWR) == 0 || (fp)->_bf._base == NULL) && \
00060 __swsetup(fp))
00061
00062
00063
00064
00065 #define HASUB(fp) ((fp)->_ub._base != NULL)
00066 #define FREEUB(fp) { \
00067 if ((fp)->_ub._base != (fp)->_ubuf) \
00068 _free_r(_REENT, (char *)(fp)->_ub._base); \
00069 (fp)->_ub._base = NULL; \
00070 }
00071
00072
00073
00074 #define HASLB(fp) ((fp)->_lb._base != NULL)
00075 #define FREELB(fp) { _free_r(_REENT,(char *)(fp)->_lb._base); (fp)->_lb._base = NULL; }
00076
00077
00078
00079 char *_EXFUN(_dcvt,(struct _reent *, char *, double, int, int, char, int));
00080 char *_EXFUN(_sicvt,(char *, short, char));
00081 char *_EXFUN(_icvt,(char *, int, char));
00082 char *_EXFUN(_licvt,(char *, long, char));
00083 #ifdef __GNUC__
00084 char *_EXFUN(_llicvt,(char *, long long, char));
00085 #endif
00086
00087 #define CVT_BUF_SIZE 128
00088
00089 #define NDYNAMIC 4