/*
 * This header defines all the thread-specific globals shared among multiple
 * libraries.
 * This is NOT a shipping header file.
 */
#ifndef _TYPES_H
#	include <types.h>
#endif

#if defined(_OS9000)

#  ifndef _REGS_H
#    include <regs.h>
#  endif

typedef struct {
	void (*rout)();
	void *gp;
#  if _PROC_HAS_CP
	void *cp;
#  endif
} _os_usr_rout_t;

#endif /* _OS9000 */

/* thread local "global" variables */

#if defined(_OS9THREAD)

#  ifndef _PTHREAD_H
#    include <pthread.h>
#  endif

#define	_os_usr_rout (*(_os_usr_rout_t **)_pthread_local_slot(_PTHREAD_OS_USR_ROUT))
#define	_signal_inited (*(u_int32 *)_pthread_local_slot(_PTHREAD_SIGNAL_INITED))

#else

#  if defined(_OS9000) && _PROC_HAS_CP
extern _os_usr_rout_t *_os_usr_rout;
extern _os_usr_rout_t _os_usr_rout_data;
#  else
extern void (*_os_usr_rout)();
#  endif

extern u_int32 _signal_inited;

#endif /* !_OS9000 */

/*
 * These are prototypes for functions that are not published in
 * our documentation but are needed by published functions.
 */

#  ifndef _STDARG_H
#    include <stdarg.h>
#  endif /* _STDARG_H */
#  ifndef _STDDEF_H
#    include <stddef.h>
#  endif /* _STDDEF_H */

int _vsnprintf(char *buf, size_t size, _CONST char *fmt, va_list ap);
