Line 9... |
Line 9... |
extern "C" {
|
extern "C" {
|
#endif
|
#endif
|
#define _SYS_REENT_H_
|
#define _SYS_REENT_H_
|
|
|
#include <_ansi.h>
|
#include <_ansi.h>
|
|
#include <time.h>
|
|
|
|
#ifndef __Long
|
|
#if __LONG_MAX__ == 2147483647L
|
|
#define __Long long
|
|
typedef unsigned __Long __ULong;
|
|
#elif __INT_MAX__ == 2147483647
|
|
#define __Long int
|
|
typedef unsigned __Long __ULong;
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef __Long
|
|
#define __Long __int32_t
|
|
typedef __uint32_t __ULong;
|
|
#endif
|
|
|
struct _glue
|
struct _glue
|
{
|
{
|
struct _glue *_next;
|
struct _glue *_next;
|
int _niobs;
|
int _niobs;
|
Line 21... |
Line 37... |
|
|
struct _Bigint
|
struct _Bigint
|
{
|
{
|
struct _Bigint *_next;
|
struct _Bigint *_next;
|
int _k, _maxwds, _sign, _wds;
|
int _k, _maxwds, _sign, _wds;
|
unsigned long _x[1];
|
__ULong _x[1];
|
};
|
};
|
|
|
/*
|
/*
|
* atexit() support
|
* atexit() support
|
*/
|
*/
|
Line 33... |
Line 49... |
#define _ATEXIT_SIZE 32 /* must be at least 32 to guarantee ANSI conformance */
|
#define _ATEXIT_SIZE 32 /* must be at least 32 to guarantee ANSI conformance */
|
|
|
struct _atexit {
|
struct _atexit {
|
struct _atexit *_next; /* next in list */
|
struct _atexit *_next; /* next in list */
|
int _ind; /* next index in this table */
|
int _ind; /* next index in this table */
|
void (*_fns[_ATEXIT_SIZE])(); /* the table itself */
|
void (*_fns[_ATEXIT_SIZE])(void); /* the table itself */
|
};
|
};
|
|
|
/*
|
/*
|
* Stdio buffers.
|
* Stdio buffers.
|
*
|
*
|
Line 155... |
Line 171... |
|
|
/* used by some fp conversion routines */
|
/* used by some fp conversion routines */
|
int _cvtlen; /* should be size_t */
|
int _cvtlen; /* should be size_t */
|
char *_cvtbuf;
|
char *_cvtbuf;
|
|
|
|
union
|
|
{
|
|
struct
|
|
{
|
|
unsigned int _rand_next;
|
|
char * _strtok_last;
|
|
char _asctime_buf[26];
|
|
struct tm _localtime_buf;
|
|
int _gamma_signgam;
|
|
} _reent;
|
/* Two next two fields were once used by malloc. They are no longer
|
/* Two next two fields were once used by malloc. They are no longer
|
used. I'm leaving them here for now in case there really is a
|
used. They are used to preserve the space used before so as to
|
binary compatibility issue. */
|
allow addition of new reent fields and keep binary compatibility. */
|
|
struct
|
|
{
|
#define _N_LISTS 30
|
#define _N_LISTS 30
|
unsigned char * _nextf[_N_LISTS];
|
unsigned char * _nextf[_N_LISTS];
|
unsigned int _nmalloc[_N_LISTS];
|
unsigned int _nmalloc[_N_LISTS];
|
|
} _unused;
|
|
} _new;
|
|
|
/* atexit stuff */
|
/* atexit stuff */
|
struct _atexit *_atexit; /* points to head of LIFO stack */
|
struct _atexit *_atexit; /* points to head of LIFO stack */
|
struct _atexit _atexit0; /* one guaranteed table, required by ANSI */
|
struct _atexit _atexit0; /* one guaranteed table, required by ANSI */
|
|
|
/* signal info */
|
/* signal info */
|
void (**(_sig_func))();
|
void (**(_sig_func))(int);
|
|
|
/* These are here last so that __sFILE can grow without changing the offsets
|
/* These are here last so that __sFILE can grow without changing the offsets
|
of the above members (on the off chance that future binary compatibility
|
of the above members (on the off chance that future binary compatibility
|
would be broken otherwise). */
|
would be broken otherwise). */
|
struct _glue __sglue; /* root of glue chain */
|
struct _glue __sglue; /* root of glue chain */
|
struct __sFILE __sf[3]; /* first three file descriptors */
|
struct __sFILE __sf[3]; /* first three file descriptors */
|
};
|
};
|
|
|
#define _REENT_INIT(var) \
|
#define _REENT_INIT(var) \
|
{ 0, &var.__sf[0], &var.__sf[1], &var.__sf[2], 0, "", 0, "C" }
|
{ 0, &var.__sf[0], &var.__sf[1], &var.__sf[2], 0, "", 0, "C", \
|
|
0, NULL, NULL, 0, NULL, NULL, 0, NULL, { {1, NULL, "", \
|
|
{ 0,0,0,0,0,0,0,0}, 0 } } }
|
|
|
/*
|
/*
|
* All references to struct _reent are via this pointer.
|
* All references to struct _reent are via this pointer.
|
* Internally, newlib routines that need to reference it should use _REENT.
|
* Internally, newlib routines that need to reference it should use _REENT.
|
*/
|
*/
|