2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * WARNING: All identifiers here must begin with an underscore. This file is
16 * included by stdio.h and others and we therefore must only use identifiers
17 * in the namespace allotted to us.
42 #include <sys/stdio_t.h> /* _sFILE type */
43 #include <time.h> /* for struct tm */
49 struct __sFILE *_iobs;
55 #define _ATEXIT_SIZE 32 /* must be at least 32 to guarantee ANSI conformance */
58 struct _atexit *_next; /* next in list */
59 int _ind; /* next index in this table */
60 void (*_fns[_ATEXIT_SIZE])(void); /* the table itself */
67 This structure contains *all* globals needed by the library.
68 It's raison d'etre is to facilitate threads by making all library routines
69 reentrant. IE: All state information is contained here.
72 #define _ASCTIME_SIZE (26+8) /* 26 min, plus caution factor! */
73 #define _MINNARROWBUFSIZE 100
76 #pragma warn_padding off
81 /* local copy of errno */
83 struct __sFILE _sf[3]; /* first three file descriptors: stdin, stdout, stderr */
85 char *_scanpoint; /* used by strtok */
86 char _asctime[_ASCTIME_SIZE]; /* used by asctime */
87 struct tm _struct_tm; /* used by gmtime */
88 long _next[2]; /* used by rand/srand (64-bit seed for EPOC32) */
89 int _inc; /* used by tmpnam */
90 char _tmpnam[37]; /* used by tmpnam & inet_ntoa */
91 wchar_t _wtmpnam[37]; /* used by tmpnam & inet_ntoa */
92 void *_netdb; /* used by gethostbyaddr and similar netdb functions */
94 int _current_category; /* used by setlocale */
95 const char *_current_locale;
97 int __sdidinit; /* 1 means stdio has been init'd */
99 void (*__cleanup)(struct _reent *);
102 struct _atexit *_atexit; /* points to head of LIFO stack */
103 struct _atexit _atexit0; /* one guaranteed table, required by ANSI */
106 void (**(_sig_func))();
108 struct _glue __sglue; /* root of glue chain for additional sFILE structures */
113 char* _pNarrowEnvBuffer;
116 void *_system; /* Pointer to a C++ POSIX System object - Hands off! */
120 The struct _reent is managed on a per-thread basis by EPOC32, so there is no global
121 variable _impure_pointer and everyone has to use _REENT (panics in the event of an
122 error) or REENT2 (which returns a NULL pointer in the event of an error).
124 IMPORT_C void _reclaim_reent (struct _reent*);
125 IMPORT_C void _REENT_INIT (struct _reent*);
126 IMPORT_C struct _reent* ImpurePtr (void);
127 IMPORT_C struct _reent* ImpurePtr2 (void);
128 IMPORT_C void _init_reent (struct _reent*,void*);
131 Support for explicit release of all STDLIB resources belonging to this thread
133 IMPORT_C void CloseSTDLIB();
135 #define _REENT (ImpurePtr())
136 #define _REENT2 (ImpurePtr2())
137 #define __errno_r(ptr) ((ptr)->_errno)
143 #endif /* _SYS_REENT_H_ */