home *** CD-ROM | disk | FTP | other *** search
- /*
- * (c) Copyright 1991, MetaWare, Inc.
- *
- * static.h: support for reentrant libraries.
- * All static variables in the runtime
- * library should be defined here.
- */
-
- #ifndef _STATIC_H
- #define _STATIC_H
- #pragma push_align_members(64);
-
- #ifdef _REENTRANT
-
- /************************************
- * *
- * definitions of static variables *
- * reentrant version *
- * *
- ************************************/
-
- #ifndef _STDIO_H
- #include <stdio.h>
- #endif
-
- #ifndef _LOCALE_H
- #include <locale.h>
- #endif
-
- #ifndef _FLOAT_H
- #include <float.h>
- #endif
-
- #ifndef _TIME_H
- #include <time.h>
- #endif
-
- #ifndef _MATH_H
- #include <math.h>
- #endif
-
- #if _HOBBIT
- #define _BASESIZE 9
- #else
- #error __FILE__: _BASESIZE not defined
- /*
- #define _BASESIZE 9
- */
- #endif
-
- /* task data */
- typedef struct {
- int errno;
- char _tmpnam_s0[L_tmpnam + 1];
- int _tmpnam_n;
- #if (_IOB_FORMAT == _IOB_LIST)
- FILE _IOB[_MIN_USER_STREAM];
- FILE *_iob_head;
- #else
- FILE _IOB[FOPEN_MAX];
- _iob_fioflag_t _iob_fioflag[FOPEN_MAX];
- _iob_unget_t _iob_unget[FOPEN_MAX];
- char *_iob_tmpnam[FOPEN_MAX];
- #endif
- int _iob_fopen_max; /* keep if _IOB_LIST? */
- int _iob_fmode;
- int _iob_pmode;
- char _doecvt_buf[LDBL_DIG + sizeof(long) * 2 + 1];
- char _asctime_buf[32];
- char _ctime_buf[32];
- int _atexit_count;
- unsigned long _malloc_base[_BASESIZE];
- unsigned long *_malloc_allocp;
- unsigned long _rand_random;
- char *_strtok_sp;
- char *_get_tz_cp;
- char _get_tz_DST_enabled;
- int _get_tz_GMT_less_local;
- struct tm _localtime_tm;
- struct tm _gmtime_tm;
- #ifndef __CPLUSPLUS__ /* struct exception isn't defined under C++ */
- int (*_matherr_handler)(struct exception *err_info);
- #endif
- } _static_t;
-
-
- /* Definition of system-dependent entry point for retrieving the pointer
- to the static data.
- */
- #if _HOBBIT
- #define _TASK_DATA_PTR OSTaskRWData
- #else
- #error _TASK_DATA_PTR not defined in static.h
- #endif
- /* retrieve task data pointer */
- extern void *_TASK_DATA_PTR();
-
- /* Initializes the static area. Must be called before "main" at runtime.
- This routine will call _TASK_DATA_PTR to get access to the data area
- needing initialization */
- extern void _static_initialize();
-
-
-
- #define _STATIC(x)(((_static_t *)_TASK_DATA_PTR())->x)
-
- /* macros used to access fields in task data */
-
- /* external variables */
- #define errno _STATIC(errno)
- #define _IOB _STATIC(_IOB)
- #if (_IOB_FORMAT == _IOB_LIST)
- #define _iob_head _STATIC(_iob_head)
- #else
- #define _iob_fioflag _STATIC(_iob_fioflag)
- #define _iob_unget _STATIC(_iob_unget)
- #define _iob_tmpnam _STATIC(_iob_tmpnam)
- #endif
- #define _fopen_max _STATIC(_iob_fopen_max)
- #define _fmode _STATIC(_iob_fmode)
- #define _pmode _STATIC(_iob_pmode)
- #define _random _STATIC(_rand_random)
- #ifndef __CPLUSPLUS__
- #define _matherr_handler _STATIC(_matherr_handler)
- #endif
-
- /* static variables */
- #define _tmpnam_s0 _STATIC(_tmpnam_s0)
- #define _tmpnam_n _STATIC(_tmpnam_n)
- #define _doecvt_buf _STATIC(_doecvt_buf)
- #define _asctime_buf _STATIC(_asctime_buf)
- #define _ctime_buf _STATIC(_ctime_buf)
- #define _atexit_count _STATIC(_atexit_count)
- #define _malloc_base _STATIC(_malloc_base)
- #define _malloc_allocp _STATIC(_malloc_allocp)
- #define _strtok_sp _STATIC(_strtok_sp)
- #define _get_tz_cp _STATIC(_get_tz_cp)
- #define _get_tz_DST_enabled _STATIC(_get_tz_DST_enabled)
- #define _get_tz_GMT_less_local _STATIC(_get_tz_GMT_less_local)
- #define _localtime_tm _STATIC(_localtime_tm)
- #define _gmtime_tm _STATIC(_gmtime_tm)
-
- #endif
- #pragma pop_align_members();
- #endif
-