#pragma diag_push #pragma CHECK_MISRA("-20.1") #pragma CHECK_MISRA("-20.2") #pragma CHECK_MISRA("-19.7") #pragma CHECK_MISRA("-19.10") namespace std { typedef char *va_list; } #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::va_list; #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.4") #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::va_list; #pragma diag_pop extern "C" namespace std { typedef unsigned size_t; typedef struct { int fd; unsigned char* buf; unsigned char* pos; unsigned char* bufend; unsigned char* buff_stop; unsigned int flags; } FILE; typedef int fpos_t; extern __far FILE _ftable[20]; extern __far char __TI_tmpnams[20][16]; extern int remove(const char *_file); extern int rename(const char *_old, const char *_new); extern FILE *tmpfile(void); extern char *tmpnam(char *_s); extern int fclose(FILE *_fp); extern FILE *fopen(const char *_fname, const char *_mode); extern FILE *freopen(const char *_fname, const char *_mode, register FILE *_fp); extern void setbuf(register FILE *_fp, char *_buf); extern int setvbuf(register FILE *_fp, register char *_buf, register int _type, register size_t _size); extern int fflush(register FILE *_fp); extern int fprintf(FILE *_fp, const char *_format, ...) __attribute__((__format__ (__printf__, 2, 3))); extern int fscanf(FILE *_fp, const char *_fmt, ...) __attribute__((__format__ (__scanf__, 2, 3))); extern int printf(const char *_format, ...) __attribute__((__format__ (__printf__, 1, 2))); extern int scanf(const char *_fmt, ...) __attribute__((__format__ (__scanf__, 1, 2))); extern int sprintf(char *_string, const char *_format, ...) __attribute__((__format__ (__printf__, 2, 3))); extern int snprintf(char *_string, size_t _n, const char *_format, ...) __attribute__((__format__ (__printf__, 3, 4))); extern int sscanf(const char *_str, const char *_fmt, ...) __attribute__((__format__ (__scanf__, 2, 3))); extern int vfprintf(FILE *_fp, const char *_format, va_list _ap) __attribute__((__format__ (__printf__, 2, 0))); extern int vfscanf(FILE *_fp, const char *_fmt, va_list _ap) __attribute__((__format__ (__scanf__, 2, 0))); extern int vprintf(const char *_format, va_list _ap) __attribute__((__format__ (__printf__, 1, 0))); extern int vscanf(const char *_format, va_list _ap) __attribute__((__format__ (__scanf__, 1, 0))); extern int vsprintf(char *_string, const char *_format, va_list _ap) __attribute__((__format__ (__printf__, 2, 0))); extern int vsnprintf(char *_string, size_t _n, const char *_format, va_list _ap) __attribute__((__format__ (__printf__, 3, 0))); extern int vsscanf(const char *_str, const char *_fmt, va_list _ap) __attribute__((__format__ (__scanf__, 2, 0))); extern int fgetc(register FILE *_fp); extern char *fgets(char *_ptr, register int _size, register FILE *_fp); extern int fputc(int _c, register FILE *_fp); extern int fputs(const char *_ptr, register FILE *_fp); extern int getc(FILE *_p); extern int getchar(void); extern char *gets(char *_ptr); extern int putc(int _x, FILE *_fp); extern int putchar(int _x); extern int puts(const char *_ptr); extern int ungetc(int _c, register FILE *_fp); extern size_t fread(void *_ptr, size_t _size, size_t _count, FILE *_fp); extern size_t fwrite(const void *_ptr, size_t _size, size_t _count, register FILE *_fp); extern int fgetpos(FILE *_fp, fpos_t *_pos); extern int fseek(register FILE *_fp, long _offset, int _ptrname); extern int fsetpos(FILE *_fp, const fpos_t *_pos); extern long ftell(FILE *_fp); extern void rewind(register FILE *_fp); extern void clearerr(FILE *_fp); extern int feof(FILE *_fp); extern int ferror(FILE *_fp); extern void perror(const char *_s); } using std::size_t; using std::FILE; using std::fpos_t; using std::_ftable; using std::__TI_tmpnams; using std::remove; using std::rename; using std::tmpfile; using std::tmpnam; using std::fclose; using std::fopen; using std::freopen; using std::setbuf; using std::setvbuf; using std::fflush; using std::fprintf; using std::fscanf; using std::printf; using std::scanf; using std::sprintf; using std::snprintf; using std::sscanf; using std::vfprintf; using std::vprintf; using std::vsprintf; using std::vsnprintf; using std::fgetc; using std::fgets; using std::fputc; using std::fputs; using std::getc; using std::getchar; using std::gets; using std::putc; using std::putchar; using std::puts; using std::ungetc; using std::fread; using std::fwrite; using std::fgetpos; using std::fseek; using std::fsetpos; using std::ftell; using std::rewind; using std::clearerr; using std::feof; using std::ferror; using std::perror; #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::va_list; #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.7") #pragma CHECK_MISRA("-20.1") #pragma CHECK_MISRA("-20.2") extern "C" namespace std { typedef int ptrdiff_t; #pragma diag_push #pragma CHECK_MISRA("-19.10") } #pragma diag_pop using std::ptrdiff_t; using std::size_t; #pragma diag_push #pragma CHECK_MISRA("-19.15") #pragma diag_pop typedef char xdc_Char; typedef unsigned char xdc_UChar; typedef short xdc_Short; typedef unsigned short xdc_UShort; typedef int xdc_Int; typedef unsigned int xdc_UInt; typedef long xdc_Long; typedef unsigned long xdc_ULong; typedef float xdc_Float; typedef double xdc_Double; typedef long double xdc_LDouble; typedef size_t xdc_SizeT; typedef va_list xdc_VaList; typedef unsigned short xdc_Bool; typedef void *xdc_Ptr; typedef const void *xdc_CPtr; typedef char *xdc_String; typedef const char *xdc_CString; typedef int (*xdc_Fxn)(); typedef signed char int8_t; typedef unsigned char uint8_t; typedef short int16_t; typedef unsigned short uint16_t; typedef int int32_t; typedef unsigned int uint32_t; typedef __int40_t int40_t; typedef unsigned __int40_t uint40_t; typedef long long int64_t; typedef unsigned long long uint64_t; typedef int8_t int_least8_t; typedef uint8_t uint_least8_t; typedef int16_t int_least16_t; typedef uint16_t uint_least16_t; typedef int32_t int_least32_t; typedef uint32_t uint_least32_t; typedef int40_t int_least40_t; typedef uint40_t uint_least40_t; typedef int64_t int_least64_t; typedef uint64_t uint_least64_t; typedef int32_t int_fast8_t; typedef uint32_t uint_fast8_t; typedef int32_t int_fast16_t; typedef uint32_t uint_fast16_t; typedef int32_t int_fast32_t; typedef uint32_t uint_fast32_t; typedef int40_t int_fast40_t; typedef uint40_t uint_fast40_t; typedef int64_t int_fast64_t; typedef uint64_t uint_fast64_t; typedef int intptr_t; typedef unsigned int uintptr_t; typedef long long intmax_t; typedef unsigned long long uintmax_t; typedef int xdc_Arg; typedef int_least8_t xdc_Int8; typedef uint_least8_t xdc_UInt8; typedef int_least16_t xdc_Int16; typedef uint_least16_t xdc_UInt16; typedef int_least32_t xdc_Int32; typedef uint_least32_t xdc_UInt32; typedef int_least64_t xdc_Int64; typedef uint_least64_t xdc_UInt64; typedef int_least40_t xdc_Int40; typedef uint_least40_t xdc_UInt40; typedef xdc_Int40 Int40; typedef xdc_UInt40 UInt40; typedef uint8_t xdc_Bits8; typedef uint16_t xdc_Bits16; typedef uint32_t xdc_Bits32; typedef uint64_t xdc_Bits64; typedef intptr_t xdc_IArg; typedef uintptr_t xdc_UArg; typedef long long xdc_LLong; typedef unsigned long long xdc_ULLong; static xdc_Ptr xdc_iargToPtr(xdc_IArg a); static xdc_Ptr xdc_uargToPtr(xdc_UArg a); static inline xdc_Ptr xdc_iargToPtr(xdc_IArg a) { return ((xdc_Ptr)a); } static inline xdc_Ptr xdc_uargToPtr(xdc_UArg a) { return ((xdc_Ptr)a); } static xdc_Fxn xdc_iargToFxn(xdc_IArg a); static xdc_Fxn xdc_uargToFxn(xdc_UArg a); static inline xdc_Fxn xdc_iargToFxn(xdc_IArg a) { return ((xdc_Fxn)a); } static inline xdc_Fxn xdc_uargToFxn(xdc_UArg a) { return ((xdc_Fxn)a); } typedef union { xdc_Float f; xdc_IArg a; } xdc_FloatData; static xdc_IArg xdc_floatToArg(xdc_Float f); static inline xdc_IArg xdc_floatToArg(xdc_Float f) { xdc_FloatData u; u.f = f; return (u.a); } static xdc_Float xdc_argToFloat(xdc_IArg a); static inline xdc_Float xdc_argToFloat(xdc_IArg a) { xdc_FloatData u; u.a = a; return (u.f); } typedef xdc_Char Char; typedef xdc_UChar UChar; typedef xdc_Short Short; typedef xdc_UShort UShort; typedef xdc_Int Int; typedef xdc_UInt UInt; typedef xdc_Long Long; typedef xdc_ULong ULong; typedef xdc_LLong LLong; typedef xdc_ULLong ULLong; typedef xdc_Float Float; typedef xdc_Double Double; typedef xdc_LDouble LDouble; typedef xdc_SizeT SizeT; typedef xdc_VaList VaList; typedef xdc_IArg IArg; typedef xdc_UArg UArg; typedef xdc_Bool Bool; typedef xdc_Int8 Int8; typedef xdc_Int16 Int16; typedef xdc_Int32 Int32; typedef xdc_Fxn Fxn; typedef xdc_Ptr Ptr; typedef xdc_CPtr CPtr; typedef xdc_String String; typedef xdc_CString CString; typedef xdc_UInt8 UInt8; typedef xdc_UInt16 UInt16; typedef xdc_UInt32 UInt32; typedef xdc_Arg Arg; typedef xdc_UInt8 Uint8; typedef xdc_UInt16 Uint16; typedef xdc_UInt32 Uint32; typedef xdc_UInt Uns; typedef xdc_Int64 Int64; typedef xdc_UInt64 UInt64; typedef xdc_Bits8 Bits8; typedef xdc_Bits16 Bits16; typedef xdc_Bits32 Bits32; typedef xdc_Bits64 Bits64; typedef struct xdc_runtime_IModule_Fxns__ xdc_runtime_IModule_Fxns__; typedef const struct xdc_runtime_IModule_Fxns__* xdc_runtime_IModule_Module; typedef struct xdc_runtime_Core_ObjDesc xdc_runtime_Core_ObjDesc; typedef struct xdc_runtime_Diags_DictElem xdc_runtime_Diags_DictElem; typedef struct xdc_runtime_Error_Data xdc_runtime_Error_Data; typedef struct xdc_runtime_Error_Block xdc_runtime_Error_Block; typedef struct xdc_runtime_Error_Module_State xdc_runtime_Error_Module_State; typedef struct xdc_runtime_IGateProvider_Fxns__ xdc_runtime_IGateProvider_Fxns__; typedef const struct xdc_runtime_IGateProvider_Fxns__* xdc_runtime_IGateProvider_Module; typedef struct xdc_runtime_IGateProvider_Params xdc_runtime_IGateProvider_Params; typedef struct xdc_runtime_IGateProvider___Object { xdc_runtime_IGateProvider_Fxns__* __fxns; xdc_Bits32 __label; } *xdc_runtime_IGateProvider_Handle; typedef struct xdc_runtime_GateNull_Fxns__ xdc_runtime_GateNull_Fxns__; typedef const struct xdc_runtime_GateNull_Fxns__* xdc_runtime_GateNull_Module; typedef struct xdc_runtime_GateNull_Params xdc_runtime_GateNull_Params; typedef struct xdc_runtime_GateNull_Object xdc_runtime_GateNull_Object; typedef struct xdc_runtime_GateNull_Struct xdc_runtime_GateNull_Struct; typedef xdc_runtime_GateNull_Object* xdc_runtime_GateNull_Handle; typedef struct xdc_runtime_GateNull_Object__ xdc_runtime_GateNull_Instance_State; typedef xdc_runtime_GateNull_Object* xdc_runtime_GateNull_Instance; typedef struct xdc_runtime_Log_EventRec xdc_runtime_Log_EventRec; typedef struct xdc_runtime_ILogger_Fxns__ xdc_runtime_ILogger_Fxns__; typedef const struct xdc_runtime_ILogger_Fxns__* xdc_runtime_ILogger_Module; typedef struct xdc_runtime_ILogger_Params xdc_runtime_ILogger_Params; typedef struct xdc_runtime_ILogger___Object { xdc_runtime_ILogger_Fxns__* __fxns; xdc_Bits32 __label; } *xdc_runtime_ILogger_Handle; typedef struct xdc_runtime_IFilterLogger_Fxns__ xdc_runtime_IFilterLogger_Fxns__; typedef const struct xdc_runtime_IFilterLogger_Fxns__* xdc_runtime_IFilterLogger_Module; typedef struct xdc_runtime_IFilterLogger_Params xdc_runtime_IFilterLogger_Params; typedef struct xdc_runtime_IFilterLogger___Object { xdc_runtime_IFilterLogger_Fxns__* __fxns; xdc_Bits32 __label; } *xdc_runtime_IFilterLogger_Handle; typedef struct xdc_runtime_LoggerBuf_Entry xdc_runtime_LoggerBuf_Entry; typedef struct xdc_runtime_LoggerBuf_Module_State xdc_runtime_LoggerBuf_Module_State; typedef struct xdc_runtime_LoggerBuf_Fxns__ xdc_runtime_LoggerBuf_Fxns__; typedef const struct xdc_runtime_LoggerBuf_Fxns__* xdc_runtime_LoggerBuf_Module; typedef struct xdc_runtime_LoggerBuf_Params xdc_runtime_LoggerBuf_Params; typedef struct xdc_runtime_LoggerBuf_Object xdc_runtime_LoggerBuf_Object; typedef struct xdc_runtime_LoggerBuf_Struct xdc_runtime_LoggerBuf_Struct; typedef xdc_runtime_LoggerBuf_Object* xdc_runtime_LoggerBuf_Handle; typedef struct xdc_runtime_LoggerBuf_Object__ xdc_runtime_LoggerBuf_Instance_State; typedef xdc_runtime_LoggerBuf_Object* xdc_runtime_LoggerBuf_Instance; typedef struct xdc_runtime_LoggerCallback_Fxns__ xdc_runtime_LoggerCallback_Fxns__; typedef const struct xdc_runtime_LoggerCallback_Fxns__* xdc_runtime_LoggerCallback_Module; typedef struct xdc_runtime_LoggerCallback_Params xdc_runtime_LoggerCallback_Params; typedef struct xdc_runtime_LoggerCallback_Object xdc_runtime_LoggerCallback_Object; typedef struct xdc_runtime_LoggerCallback_Struct xdc_runtime_LoggerCallback_Struct; typedef xdc_runtime_LoggerCallback_Object* xdc_runtime_LoggerCallback_Handle; typedef struct xdc_runtime_LoggerCallback_Object__ xdc_runtime_LoggerCallback_Instance_State; typedef xdc_runtime_LoggerCallback_Object* xdc_runtime_LoggerCallback_Instance; typedef struct xdc_runtime_LoggerSys_Fxns__ xdc_runtime_LoggerSys_Fxns__; typedef const struct xdc_runtime_LoggerSys_Fxns__* xdc_runtime_LoggerSys_Module; typedef struct xdc_runtime_LoggerSys_Params xdc_runtime_LoggerSys_Params; typedef struct xdc_runtime_LoggerSys_Object xdc_runtime_LoggerSys_Object; typedef struct xdc_runtime_LoggerSys_Struct xdc_runtime_LoggerSys_Struct; typedef xdc_runtime_LoggerSys_Object* xdc_runtime_LoggerSys_Handle; typedef struct xdc_runtime_LoggerSys_Object__ xdc_runtime_LoggerSys_Instance_State; typedef xdc_runtime_LoggerSys_Object* xdc_runtime_LoggerSys_Instance; typedef struct xdc_runtime_Memory_Stats xdc_runtime_Memory_Stats; typedef struct xdc_runtime_Memory_Module_State xdc_runtime_Memory_Module_State; typedef struct xdc_runtime_IHeap_Fxns__ xdc_runtime_IHeap_Fxns__; typedef const struct xdc_runtime_IHeap_Fxns__* xdc_runtime_IHeap_Module; typedef struct xdc_runtime_IHeap_Params xdc_runtime_IHeap_Params; typedef struct xdc_runtime_IHeap___Object { xdc_runtime_IHeap_Fxns__* __fxns; xdc_Bits32 __label; } *xdc_runtime_IHeap_Handle; typedef struct xdc_runtime_HeapMin_Fxns__ xdc_runtime_HeapMin_Fxns__; typedef const struct xdc_runtime_HeapMin_Fxns__* xdc_runtime_HeapMin_Module; typedef struct xdc_runtime_HeapMin_Params xdc_runtime_HeapMin_Params; typedef struct xdc_runtime_HeapMin_Object xdc_runtime_HeapMin_Object; typedef struct xdc_runtime_HeapMin_Struct xdc_runtime_HeapMin_Struct; typedef xdc_runtime_HeapMin_Object* xdc_runtime_HeapMin_Handle; typedef struct xdc_runtime_HeapMin_Object__ xdc_runtime_HeapMin_Instance_State; typedef xdc_runtime_HeapMin_Object* xdc_runtime_HeapMin_Instance; typedef struct xdc_runtime_HeapStd_Module_State xdc_runtime_HeapStd_Module_State; typedef struct xdc_runtime_HeapStd_Fxns__ xdc_runtime_HeapStd_Fxns__; typedef const struct xdc_runtime_HeapStd_Fxns__* xdc_runtime_HeapStd_Module; typedef struct xdc_runtime_HeapStd_Params xdc_runtime_HeapStd_Params; typedef struct xdc_runtime_HeapStd_Object xdc_runtime_HeapStd_Object; typedef struct xdc_runtime_HeapStd_Struct xdc_runtime_HeapStd_Struct; typedef xdc_runtime_HeapStd_Object* xdc_runtime_HeapStd_Handle; typedef struct xdc_runtime_HeapStd_Object__ xdc_runtime_HeapStd_Instance_State; typedef xdc_runtime_HeapStd_Object* xdc_runtime_HeapStd_Instance; typedef struct xdc_runtime_Registry_Module_State xdc_runtime_Registry_Module_State; typedef struct xdc_runtime_Rta_CommandPacket xdc_runtime_Rta_CommandPacket; typedef struct xdc_runtime_Rta_ResponsePacket xdc_runtime_Rta_ResponsePacket; typedef struct xdc_runtime_Startup_IdMap xdc_runtime_Startup_IdMap; typedef struct xdc_runtime_Startup_Module_State xdc_runtime_Startup_Module_State; typedef struct xdc_runtime_System_ParseData xdc_runtime_System_ParseData; typedef struct xdc_runtime_System_Module_State xdc_runtime_System_Module_State; typedef struct xdc_runtime_ISystemSupport_Fxns__ xdc_runtime_ISystemSupport_Fxns__; typedef const struct xdc_runtime_ISystemSupport_Fxns__* xdc_runtime_ISystemSupport_Module; typedef struct xdc_runtime_SysCallback_Fxns__ xdc_runtime_SysCallback_Fxns__; typedef const struct xdc_runtime_SysCallback_Fxns__* xdc_runtime_SysCallback_Module; typedef struct xdc_runtime_SysMin_Module_State xdc_runtime_SysMin_Module_State; typedef struct xdc_runtime_SysMin_Fxns__ xdc_runtime_SysMin_Fxns__; typedef const struct xdc_runtime_SysMin_Fxns__* xdc_runtime_SysMin_Module; typedef struct xdc_runtime_SysStd_Fxns__ xdc_runtime_SysStd_Fxns__; typedef const struct xdc_runtime_SysStd_Fxns__* xdc_runtime_SysStd_Module; typedef struct xdc_runtime_Text_Node xdc_runtime_Text_Node; typedef struct xdc_runtime_Text_MatchVisState xdc_runtime_Text_MatchVisState; typedef struct xdc_runtime_Text_PrintVisState xdc_runtime_Text_PrintVisState; typedef struct xdc_runtime_Text_Module_State xdc_runtime_Text_Module_State; typedef struct xdc_runtime_ITimestampClient_Fxns__ xdc_runtime_ITimestampClient_Fxns__; typedef const struct xdc_runtime_ITimestampClient_Fxns__* xdc_runtime_ITimestampClient_Module; typedef struct xdc_runtime_Timestamp_Fxns__ xdc_runtime_Timestamp_Fxns__; typedef const struct xdc_runtime_Timestamp_Fxns__* xdc_runtime_Timestamp_Module; typedef struct xdc_runtime_ITimestampProvider_Fxns__ xdc_runtime_ITimestampProvider_Fxns__; typedef const struct xdc_runtime_ITimestampProvider_Fxns__* xdc_runtime_ITimestampProvider_Module; typedef struct xdc_runtime_TimestampNull_Fxns__ xdc_runtime_TimestampNull_Fxns__; typedef const struct xdc_runtime_TimestampNull_Fxns__* xdc_runtime_TimestampNull_Module; typedef struct xdc_runtime_TimestampStd_Fxns__ xdc_runtime_TimestampStd_Fxns__; typedef const struct xdc_runtime_TimestampStd_Fxns__* xdc_runtime_TimestampStd_Module; typedef struct xdc_runtime_Types_CordAddr__ xdc_runtime_Types_CordAddr__; typedef struct xdc_runtime_Types_GateRef__ xdc_runtime_Types_GateRef__; typedef struct xdc_runtime_Types_Label xdc_runtime_Types_Label; typedef struct xdc_runtime_Types_Site xdc_runtime_Types_Site; typedef struct xdc_runtime_Types_Timestamp64 xdc_runtime_Types_Timestamp64; typedef struct xdc_runtime_Types_FreqHz xdc_runtime_Types_FreqHz; typedef struct xdc_runtime_Types_RegDesc xdc_runtime_Types_RegDesc; typedef struct xdc_runtime_Types_Vec xdc_runtime_Types_Vec; typedef struct xdc_runtime_Types_Link xdc_runtime_Types_Link; typedef struct xdc_runtime_Types_InstHdr xdc_runtime_Types_InstHdr; typedef struct xdc_runtime_Types_PrmsHdr xdc_runtime_Types_PrmsHdr; typedef struct xdc_runtime_Types_Base xdc_runtime_Types_Base; typedef struct xdc_runtime_Types_SysFxns xdc_runtime_Types_SysFxns; typedef struct xdc_runtime_Types_SysFxns2 xdc_runtime_Types_SysFxns2; typedef struct xdc_runtime_IInstance_Fxns__ xdc_runtime_IInstance_Fxns__; typedef const struct xdc_runtime_IInstance_Fxns__* xdc_runtime_IInstance_Module; typedef struct xdc_runtime_IInstance_Params xdc_runtime_IInstance_Params; typedef struct xdc_runtime_IInstance___Object { xdc_runtime_IInstance_Fxns__* __fxns; xdc_Bits32 __label; } *xdc_runtime_IInstance_Handle; typedef struct xdc_runtime_LoggerBuf_TimestampProxy_Fxns__ xdc_runtime_LoggerBuf_TimestampProxy_Fxns__; typedef const struct xdc_runtime_LoggerBuf_TimestampProxy_Fxns__* xdc_runtime_LoggerBuf_TimestampProxy_Module; typedef struct xdc_runtime_LoggerBuf_Module_GateProxy_Fxns__ xdc_runtime_LoggerBuf_Module_GateProxy_Fxns__; typedef const struct xdc_runtime_LoggerBuf_Module_GateProxy_Fxns__* xdc_runtime_LoggerBuf_Module_GateProxy_Module; typedef struct xdc_runtime_LoggerBuf_Module_GateProxy_Params xdc_runtime_LoggerBuf_Module_GateProxy_Params; typedef struct xdc_runtime_IGateProvider___Object *xdc_runtime_LoggerBuf_Module_GateProxy_Handle; typedef struct xdc_runtime_LoggerSys_TimestampProxy_Fxns__ xdc_runtime_LoggerSys_TimestampProxy_Fxns__; typedef const struct xdc_runtime_LoggerSys_TimestampProxy_Fxns__* xdc_runtime_LoggerSys_TimestampProxy_Module; typedef struct xdc_runtime_Main_Module_GateProxy_Fxns__ xdc_runtime_Main_Module_GateProxy_Fxns__; typedef const struct xdc_runtime_Main_Module_GateProxy_Fxns__* xdc_runtime_Main_Module_GateProxy_Module; typedef struct xdc_runtime_Main_Module_GateProxy_Params xdc_runtime_Main_Module_GateProxy_Params; typedef struct xdc_runtime_IGateProvider___Object *xdc_runtime_Main_Module_GateProxy_Handle; typedef struct xdc_runtime_Memory_HeapProxy_Fxns__ xdc_runtime_Memory_HeapProxy_Fxns__; typedef const struct xdc_runtime_Memory_HeapProxy_Fxns__* xdc_runtime_Memory_HeapProxy_Module; typedef struct xdc_runtime_Memory_HeapProxy_Params xdc_runtime_Memory_HeapProxy_Params; typedef struct xdc_runtime_IHeap___Object *xdc_runtime_Memory_HeapProxy_Handle; typedef struct xdc_runtime_System_SupportProxy_Fxns__ xdc_runtime_System_SupportProxy_Fxns__; typedef const struct xdc_runtime_System_SupportProxy_Fxns__* xdc_runtime_System_SupportProxy_Module; typedef struct xdc_runtime_System_Module_GateProxy_Fxns__ xdc_runtime_System_Module_GateProxy_Fxns__; typedef const struct xdc_runtime_System_Module_GateProxy_Fxns__* xdc_runtime_System_Module_GateProxy_Module; typedef struct xdc_runtime_System_Module_GateProxy_Params xdc_runtime_System_Module_GateProxy_Params; typedef struct xdc_runtime_IGateProvider___Object *xdc_runtime_System_Module_GateProxy_Handle; typedef struct xdc_runtime_Timestamp_SupportProxy_Fxns__ xdc_runtime_Timestamp_SupportProxy_Fxns__; typedef const struct xdc_runtime_Timestamp_SupportProxy_Fxns__* xdc_runtime_Timestamp_SupportProxy_Module; typedef xdc_Bits16 xdc_runtime_Types_ModuleId; typedef xdc_Bits16 xdc_runtime_Types_DiagsMask; typedef xdc_Bits32 xdc_runtime_Types_Event; typedef xdc_runtime_Types_Event xdc_runtime_Types_EventId; struct xdc_runtime_Types_CordAddr__; typedef xdc_runtime_Types_CordAddr__ *xdc_runtime_Types_CordAddr; struct xdc_runtime_Types_GateRef__; typedef xdc_runtime_Types_GateRef__ *xdc_runtime_Types_GateRef; typedef xdc_Bits16 xdc_runtime_Types_RopeId; enum xdc_runtime_Types_CreatePolicy { xdc_runtime_Types_STATIC_POLICY, xdc_runtime_Types_CREATE_POLICY, xdc_runtime_Types_DELETE_POLICY }; typedef enum xdc_runtime_Types_CreatePolicy xdc_runtime_Types_CreatePolicy; enum xdc_runtime_Types_OutputPolicy { xdc_runtime_Types_COMMON_FILE, xdc_runtime_Types_SEPARATE_FILE, xdc_runtime_Types_NO_FILE }; typedef enum xdc_runtime_Types_OutputPolicy xdc_runtime_Types_OutputPolicy; struct xdc_runtime_Types_Label { xdc_Ptr handle; xdc_runtime_Types_ModuleId modId; xdc_String iname; xdc_Bool named; }; struct xdc_runtime_Types_Site { xdc_runtime_Types_ModuleId mod; xdc_CString file; xdc_Int line; }; struct xdc_runtime_Types_Timestamp64 { xdc_Bits32 hi; xdc_Bits32 lo; }; struct xdc_runtime_Types_FreqHz { xdc_Bits32 hi; xdc_Bits32 lo; }; struct xdc_runtime_Types_RegDesc { xdc_runtime_Types_RegDesc *next; xdc_CString modName; xdc_runtime_Types_ModuleId id; xdc_runtime_Types_DiagsMask mask; }; typedef xdc_Bits32 xdc_runtime_Types_LogEvent; typedef void (*xdc_runtime_Types_LoggerFxn0)(xdc_Ptr, xdc_runtime_Types_LogEvent, xdc_runtime_Types_ModuleId); typedef void (*xdc_runtime_Types_LoggerFxn1)(xdc_Ptr, xdc_runtime_Types_LogEvent, xdc_runtime_Types_ModuleId, xdc_IArg); typedef void (*xdc_runtime_Types_LoggerFxn2)(xdc_Ptr, xdc_runtime_Types_LogEvent, xdc_runtime_Types_ModuleId, xdc_IArg, xdc_IArg); typedef void (*xdc_runtime_Types_LoggerFxn4)(xdc_Ptr, xdc_runtime_Types_LogEvent, xdc_runtime_Types_ModuleId, xdc_IArg, xdc_IArg, xdc_IArg, xdc_IArg); typedef void (*xdc_runtime_Types_LoggerFxn8)(xdc_Ptr, xdc_runtime_Types_LogEvent, xdc_runtime_Types_ModuleId, xdc_IArg, xdc_IArg, xdc_IArg, xdc_IArg, xdc_IArg, xdc_IArg, xdc_IArg, xdc_IArg); struct xdc_runtime_Types_Vec { xdc_Int len; xdc_Ptr arr; }; struct xdc_runtime_Types_Link { xdc_runtime_Types_Link *next; xdc_runtime_Types_Link *prev; }; struct xdc_runtime_Types_InstHdr { xdc_runtime_Types_Link link; }; struct xdc_runtime_Types_PrmsHdr { xdc_SizeT size; xdc_Ptr self; xdc_Ptr modFxns; xdc_Ptr instPrms; }; struct xdc_runtime_Types_Base { xdc_runtime_Types_Base *base; }; struct xdc_runtime_Types_SysFxns { xdc_Ptr (*__create)(xdc_Ptr, xdc_SizeT, xdc_Ptr, const xdc_Ptr, xdc_SizeT, xdc_runtime_Error_Block*); void (*__delete)(xdc_Ptr); xdc_runtime_Types_Label *(*__label)(xdc_Ptr, xdc_runtime_Types_Label*); xdc_runtime_Types_ModuleId __mid; }; struct xdc_runtime_Types_SysFxns2 { xdc_Ptr (*__create)(xdc_Ptr, xdc_SizeT, xdc_Ptr, const xdc_UChar*, xdc_SizeT, xdc_runtime_Error_Block*); void (*__delete)(xdc_Ptr); xdc_runtime_Types_Label *(*__label)(xdc_Ptr, xdc_runtime_Types_Label*); xdc_runtime_Types_ModuleId __mid; }; typedef xdc_Bits32 CT__xdc_runtime_Types_Module__diagsEnabled; extern "C" far const CT__xdc_runtime_Types_Module__diagsEnabled xdc_runtime_Types_Module__diagsEnabled__C; typedef xdc_Bits32 CT__xdc_runtime_Types_Module__diagsIncluded; extern "C" far const CT__xdc_runtime_Types_Module__diagsIncluded xdc_runtime_Types_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__xdc_runtime_Types_Module__diagsMask; extern "C" far const CT__xdc_runtime_Types_Module__diagsMask xdc_runtime_Types_Module__diagsMask__C; typedef xdc_Ptr CT__xdc_runtime_Types_Module__gateObj; extern "C" far const CT__xdc_runtime_Types_Module__gateObj xdc_runtime_Types_Module__gateObj__C; typedef xdc_Ptr CT__xdc_runtime_Types_Module__gatePrms; extern "C" far const CT__xdc_runtime_Types_Module__gatePrms xdc_runtime_Types_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__xdc_runtime_Types_Module__id; extern "C" far const CT__xdc_runtime_Types_Module__id xdc_runtime_Types_Module__id__C; typedef xdc_Bool CT__xdc_runtime_Types_Module__loggerDefined; extern "C" far const CT__xdc_runtime_Types_Module__loggerDefined xdc_runtime_Types_Module__loggerDefined__C; typedef xdc_Ptr CT__xdc_runtime_Types_Module__loggerObj; extern "C" far const CT__xdc_runtime_Types_Module__loggerObj xdc_runtime_Types_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__xdc_runtime_Types_Module__loggerFxn0; extern "C" far const CT__xdc_runtime_Types_Module__loggerFxn0 xdc_runtime_Types_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__xdc_runtime_Types_Module__loggerFxn1; extern "C" far const CT__xdc_runtime_Types_Module__loggerFxn1 xdc_runtime_Types_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__xdc_runtime_Types_Module__loggerFxn2; extern "C" far const CT__xdc_runtime_Types_Module__loggerFxn2 xdc_runtime_Types_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__xdc_runtime_Types_Module__loggerFxn4; extern "C" far const CT__xdc_runtime_Types_Module__loggerFxn4 xdc_runtime_Types_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__xdc_runtime_Types_Module__loggerFxn8; extern "C" far const CT__xdc_runtime_Types_Module__loggerFxn8 xdc_runtime_Types_Module__loggerFxn8__C; typedef xdc_Bool (*CT__xdc_runtime_Types_Module__startupDoneFxn)(void); extern "C" far const CT__xdc_runtime_Types_Module__startupDoneFxn xdc_runtime_Types_Module__startupDoneFxn__C; typedef xdc_Int CT__xdc_runtime_Types_Object__count; extern "C" far const CT__xdc_runtime_Types_Object__count xdc_runtime_Types_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_Types_Object__heap; extern "C" far const CT__xdc_runtime_Types_Object__heap xdc_runtime_Types_Object__heap__C; typedef xdc_SizeT CT__xdc_runtime_Types_Object__sizeof; extern "C" far const CT__xdc_runtime_Types_Object__sizeof xdc_runtime_Types_Object__sizeof__C; typedef xdc_Ptr CT__xdc_runtime_Types_Object__table; extern "C" far const CT__xdc_runtime_Types_Object__table xdc_runtime_Types_Object__table__C; extern "C" xdc_Bool xdc_runtime_Types_Module__startupDone__S( void ); static inline CT__xdc_runtime_Types_Module__id xdc_runtime_Types_Module_id( void ) { return xdc_runtime_Types_Module__id__C; } static inline xdc_Bool xdc_runtime_Types_Module_hasMask( void ) { return (xdc_Bool)(xdc_runtime_Types_Module__diagsMask__C != 0); } static inline xdc_Bits16 xdc_runtime_Types_Module_getMask( void ) { return xdc_runtime_Types_Module__diagsMask__C != 0 ? *xdc_runtime_Types_Module__diagsMask__C : (xdc_Bits16)0; } static inline void xdc_runtime_Types_Module_setMask( xdc_Bits16 mask ) { if (xdc_runtime_Types_Module__diagsMask__C != 0) { *xdc_runtime_Types_Module__diagsMask__C = mask; } } struct xdc_runtime_IInstance_Params { size_t __size; xdc_String name; }; struct xdc_runtime_IInstance_Fxns__ { xdc_runtime_Types_Base* __base; const xdc_runtime_Types_SysFxns2* __sysp; xdc_runtime_Types_SysFxns2 __sfxns; }; extern "C" const xdc_runtime_Types_Base xdc_runtime_IInstance_Interface__BASE__C; extern "C" xdc_runtime_IInstance_Handle xdc_runtime_IInstance_create(xdc_runtime_IInstance_Module, const xdc_runtime_IInstance_Params *, xdc_runtime_Error_Block *__eb); extern "C" void xdc_runtime_IInstance_delete(xdc_runtime_IInstance_Handle *); static inline xdc_runtime_IInstance_Module xdc_runtime_IInstance_Handle_to_Module( xdc_runtime_IInstance_Handle inst ) { return inst->__fxns; } static inline xdc_runtime_Types_Label *xdc_runtime_IInstance_Handle_label( xdc_runtime_IInstance_Handle inst, xdc_runtime_Types_Label *lab ) { return inst->__fxns->__sysp->__label(inst, lab); } static inline xdc_runtime_Types_ModuleId xdc_runtime_IInstance_Module_id( xdc_runtime_IInstance_Module mod ) { return mod->__sysp->__mid; } struct xdc_runtime_IGateProvider_Params { size_t __size; const void *__self; void *__fxns; xdc_runtime_IInstance_Params *instance; }; struct xdc_runtime_IGateProvider_Fxns__ { xdc_runtime_Types_Base* __base; const xdc_runtime_Types_SysFxns2* __sysp; xdc_Bool (*query)(xdc_Int); xdc_IArg (*enter)(void*); void (*leave)(void*, xdc_IArg); xdc_runtime_Types_SysFxns2 __sfxns; }; extern "C" const xdc_runtime_Types_Base xdc_runtime_IGateProvider_Interface__BASE__C; extern "C" xdc_runtime_IGateProvider_Handle xdc_runtime_IGateProvider_create(xdc_runtime_IGateProvider_Module, const xdc_runtime_IGateProvider_Params *, xdc_runtime_Error_Block *__eb); extern "C" void xdc_runtime_IGateProvider_delete(xdc_runtime_IGateProvider_Handle *); static inline xdc_runtime_IGateProvider_Module xdc_runtime_IGateProvider_Handle_to_Module( xdc_runtime_IGateProvider_Handle inst ) { return inst->__fxns; } static inline xdc_runtime_Types_Label *xdc_runtime_IGateProvider_Handle_label( xdc_runtime_IGateProvider_Handle inst, xdc_runtime_Types_Label *lab ) { return inst->__fxns->__sysp->__label(inst, lab); } static inline xdc_runtime_Types_ModuleId xdc_runtime_IGateProvider_Module_id( xdc_runtime_IGateProvider_Module mod ) { return mod->__sysp->__mid; } static inline xdc_Bool xdc_runtime_IGateProvider_query( xdc_runtime_IGateProvider_Module __inst, xdc_Int qual ) { return __inst->query(qual); } static inline xdc_IArg xdc_runtime_IGateProvider_enter( xdc_runtime_IGateProvider_Handle __inst ) { return __inst->__fxns->enter((void*)__inst); } static inline void xdc_runtime_IGateProvider_leave( xdc_runtime_IGateProvider_Handle __inst, xdc_IArg key ) { __inst->__fxns->leave((void*)__inst, key); } typedef xdc_Bool (*xdc_runtime_IGateProvider_query_FxnT)(xdc_Int); static inline xdc_runtime_IGateProvider_query_FxnT xdc_runtime_IGateProvider_query_fxnP( xdc_runtime_IGateProvider_Module __inst ) { return (xdc_runtime_IGateProvider_query_FxnT)__inst->query; } typedef xdc_IArg (*xdc_runtime_IGateProvider_enter_FxnT)(void *); static inline xdc_runtime_IGateProvider_enter_FxnT xdc_runtime_IGateProvider_enter_fxnP( xdc_runtime_IGateProvider_Handle __inst ) { return (xdc_runtime_IGateProvider_enter_FxnT)__inst->__fxns->enter; } typedef void (*xdc_runtime_IGateProvider_leave_FxnT)(void *, xdc_IArg); static inline xdc_runtime_IGateProvider_leave_FxnT xdc_runtime_IGateProvider_leave_fxnP( xdc_runtime_IGateProvider_Handle __inst ) { return (xdc_runtime_IGateProvider_leave_FxnT)__inst->__fxns->leave; } typedef xdc_Bits32 CT__xdc_runtime_Main_Module_GateProxy_Module__diagsEnabled; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Module__diagsEnabled xdc_runtime_Main_Module_GateProxy_Module__diagsEnabled__C; typedef xdc_Bits32 CT__xdc_runtime_Main_Module_GateProxy_Module__diagsIncluded; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Module__diagsIncluded xdc_runtime_Main_Module_GateProxy_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__xdc_runtime_Main_Module_GateProxy_Module__diagsMask; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Module__diagsMask xdc_runtime_Main_Module_GateProxy_Module__diagsMask__C; typedef xdc_Ptr CT__xdc_runtime_Main_Module_GateProxy_Module__gateObj; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Module__gateObj xdc_runtime_Main_Module_GateProxy_Module__gateObj__C; typedef xdc_Ptr CT__xdc_runtime_Main_Module_GateProxy_Module__gatePrms; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Module__gatePrms xdc_runtime_Main_Module_GateProxy_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__xdc_runtime_Main_Module_GateProxy_Module__id; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Module__id xdc_runtime_Main_Module_GateProxy_Module__id__C; typedef xdc_Bool CT__xdc_runtime_Main_Module_GateProxy_Module__loggerDefined; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Module__loggerDefined xdc_runtime_Main_Module_GateProxy_Module__loggerDefined__C; typedef xdc_Ptr CT__xdc_runtime_Main_Module_GateProxy_Module__loggerObj; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Module__loggerObj xdc_runtime_Main_Module_GateProxy_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__xdc_runtime_Main_Module_GateProxy_Module__loggerFxn0; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Module__loggerFxn0 xdc_runtime_Main_Module_GateProxy_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__xdc_runtime_Main_Module_GateProxy_Module__loggerFxn1; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Module__loggerFxn1 xdc_runtime_Main_Module_GateProxy_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__xdc_runtime_Main_Module_GateProxy_Module__loggerFxn2; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Module__loggerFxn2 xdc_runtime_Main_Module_GateProxy_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__xdc_runtime_Main_Module_GateProxy_Module__loggerFxn4; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Module__loggerFxn4 xdc_runtime_Main_Module_GateProxy_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__xdc_runtime_Main_Module_GateProxy_Module__loggerFxn8; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Module__loggerFxn8 xdc_runtime_Main_Module_GateProxy_Module__loggerFxn8__C; typedef xdc_Bool (*CT__xdc_runtime_Main_Module_GateProxy_Module__startupDoneFxn)(void); extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Module__startupDoneFxn xdc_runtime_Main_Module_GateProxy_Module__startupDoneFxn__C; typedef xdc_Int CT__xdc_runtime_Main_Module_GateProxy_Object__count; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Object__count xdc_runtime_Main_Module_GateProxy_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_Main_Module_GateProxy_Object__heap; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Object__heap xdc_runtime_Main_Module_GateProxy_Object__heap__C; typedef xdc_SizeT CT__xdc_runtime_Main_Module_GateProxy_Object__sizeof; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Object__sizeof xdc_runtime_Main_Module_GateProxy_Object__sizeof__C; typedef xdc_Ptr CT__xdc_runtime_Main_Module_GateProxy_Object__table; extern "C" far const CT__xdc_runtime_Main_Module_GateProxy_Object__table xdc_runtime_Main_Module_GateProxy_Object__table__C; struct xdc_runtime_Main_Module_GateProxy_Params { size_t __size; const void *__self; void *__fxns; xdc_runtime_IInstance_Params *instance; xdc_runtime_IInstance_Params __iprms; }; struct xdc_runtime_Main_Module_GateProxy_Struct { const xdc_runtime_Main_Module_GateProxy_Fxns__ *__fxns; xdc_runtime_Types_CordAddr __name; }; struct xdc_runtime_Main_Module_GateProxy_Fxns__ { xdc_runtime_Types_Base* __base; const xdc_runtime_Types_SysFxns2* __sysp; xdc_Bool (*query)(xdc_Int); xdc_IArg (*enter)(xdc_runtime_Main_Module_GateProxy_Handle); void (*leave)(xdc_runtime_Main_Module_GateProxy_Handle, xdc_IArg); xdc_runtime_Types_SysFxns2 __sfxns; }; extern "C" const xdc_runtime_Main_Module_GateProxy_Fxns__ xdc_runtime_Main_Module_GateProxy_Module__FXNS__C; extern "C" xdc_runtime_Types_Label *xdc_runtime_Main_Module_GateProxy_Handle__label__S( xdc_Ptr obj, xdc_runtime_Types_Label *lab ); extern "C" xdc_Bool xdc_runtime_Main_Module_GateProxy_Module__startupDone__S( void ); extern "C" xdc_Ptr xdc_runtime_Main_Module_GateProxy_Object__create__S( xdc_Ptr __oa, xdc_SizeT __osz, xdc_Ptr __aa, const xdc_UChar *__pa, xdc_SizeT __psz, xdc_runtime_Error_Block *__eb ); extern "C" xdc_runtime_Main_Module_GateProxy_Handle xdc_runtime_Main_Module_GateProxy_create( const xdc_runtime_Main_Module_GateProxy_Params *__prms, xdc_runtime_Error_Block *__eb ); extern "C" void xdc_runtime_Main_Module_GateProxy_Object__delete__S( xdc_Ptr instp ); extern "C" void xdc_runtime_Main_Module_GateProxy_delete(xdc_runtime_Main_Module_GateProxy_Handle *instp); extern "C" void xdc_runtime_Main_Module_GateProxy_Object__destruct__S( xdc_Ptr objp ); extern "C" xdc_Ptr xdc_runtime_Main_Module_GateProxy_Object__get__S( xdc_Ptr oarr, xdc_Int i ); extern "C" xdc_Ptr xdc_runtime_Main_Module_GateProxy_Object__first__S( void ); extern "C" xdc_Ptr xdc_runtime_Main_Module_GateProxy_Object__next__S( xdc_Ptr obj ); extern "C" void xdc_runtime_Main_Module_GateProxy_Params__init__S( xdc_Ptr dst, const void *src, xdc_SizeT psz, xdc_SizeT isz ); extern "C" xdc_Bool xdc_runtime_Main_Module_GateProxy_Proxy__abstract__S( void ); extern "C" xdc_Ptr xdc_runtime_Main_Module_GateProxy_Proxy__delegate__S( void ); extern "C" xdc_Bool xdc_runtime_Main_Module_GateProxy_query__E( xdc_Int qual ); extern "C" xdc_IArg xdc_runtime_Main_Module_GateProxy_enter__E( xdc_runtime_Main_Module_GateProxy_Handle __inst ); extern "C" void xdc_runtime_Main_Module_GateProxy_leave__E( xdc_runtime_Main_Module_GateProxy_Handle __inst, xdc_IArg key ); static inline xdc_runtime_IGateProvider_Module xdc_runtime_Main_Module_GateProxy_Module_upCast( void ) { return (xdc_runtime_IGateProvider_Module)xdc_runtime_Main_Module_GateProxy_Proxy__delegate__S(); } static inline xdc_runtime_IGateProvider_Handle xdc_runtime_Main_Module_GateProxy_Handle_upCast( xdc_runtime_Main_Module_GateProxy_Handle i ) { return (xdc_runtime_IGateProvider_Handle)i; } static inline xdc_runtime_Main_Module_GateProxy_Handle xdc_runtime_Main_Module_GateProxy_Handle_downCast( xdc_runtime_IGateProvider_Handle i ) { xdc_runtime_IGateProvider_Handle i2 = (xdc_runtime_IGateProvider_Handle)i; if (xdc_runtime_Main_Module_GateProxy_Proxy__abstract__S()) { return (xdc_runtime_Main_Module_GateProxy_Handle)i; } return (const void*)i2->__fxns == (const void*)xdc_runtime_Main_Module_GateProxy_Proxy__delegate__S() ? (xdc_runtime_Main_Module_GateProxy_Handle)i : (xdc_runtime_Main_Module_GateProxy_Handle)0; } static inline CT__xdc_runtime_Main_Module_GateProxy_Module__id xdc_runtime_Main_Module_GateProxy_Module_id( void ) { return xdc_runtime_Main_Module_GateProxy_Module__id__C; } static inline void xdc_runtime_Main_Module_GateProxy_Params_init( xdc_runtime_Main_Module_GateProxy_Params *prms ) { if (prms) { xdc_runtime_Main_Module_GateProxy_Params__init__S(prms, 0, sizeof(xdc_runtime_Main_Module_GateProxy_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline void xdc_runtime_Main_Module_GateProxy_Params_copy(xdc_runtime_Main_Module_GateProxy_Params *dst, const xdc_runtime_Main_Module_GateProxy_Params *src) { if (dst) { xdc_runtime_Main_Module_GateProxy_Params__init__S(dst, (const void *)src, sizeof(xdc_runtime_Main_Module_GateProxy_Params), sizeof(xdc_runtime_IInstance_Params)); } } typedef xdc_Bits32 CT__xdc_runtime_Main_Module__diagsEnabled; extern "C" far const CT__xdc_runtime_Main_Module__diagsEnabled xdc_runtime_Main_Module__diagsEnabled__C; typedef xdc_Bits32 CT__xdc_runtime_Main_Module__diagsIncluded; extern "C" far const CT__xdc_runtime_Main_Module__diagsIncluded xdc_runtime_Main_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__xdc_runtime_Main_Module__diagsMask; extern "C" far const CT__xdc_runtime_Main_Module__diagsMask xdc_runtime_Main_Module__diagsMask__C; typedef xdc_Ptr CT__xdc_runtime_Main_Module__gateObj; extern "C" far const CT__xdc_runtime_Main_Module__gateObj xdc_runtime_Main_Module__gateObj__C; typedef xdc_Ptr CT__xdc_runtime_Main_Module__gatePrms; extern "C" far const CT__xdc_runtime_Main_Module__gatePrms xdc_runtime_Main_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__xdc_runtime_Main_Module__id; extern "C" far const CT__xdc_runtime_Main_Module__id xdc_runtime_Main_Module__id__C; typedef xdc_Bool CT__xdc_runtime_Main_Module__loggerDefined; extern "C" far const CT__xdc_runtime_Main_Module__loggerDefined xdc_runtime_Main_Module__loggerDefined__C; typedef xdc_Ptr CT__xdc_runtime_Main_Module__loggerObj; extern "C" far const CT__xdc_runtime_Main_Module__loggerObj xdc_runtime_Main_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__xdc_runtime_Main_Module__loggerFxn0; extern "C" far const CT__xdc_runtime_Main_Module__loggerFxn0 xdc_runtime_Main_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__xdc_runtime_Main_Module__loggerFxn1; extern "C" far const CT__xdc_runtime_Main_Module__loggerFxn1 xdc_runtime_Main_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__xdc_runtime_Main_Module__loggerFxn2; extern "C" far const CT__xdc_runtime_Main_Module__loggerFxn2 xdc_runtime_Main_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__xdc_runtime_Main_Module__loggerFxn4; extern "C" far const CT__xdc_runtime_Main_Module__loggerFxn4 xdc_runtime_Main_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__xdc_runtime_Main_Module__loggerFxn8; extern "C" far const CT__xdc_runtime_Main_Module__loggerFxn8 xdc_runtime_Main_Module__loggerFxn8__C; typedef xdc_Bool (*CT__xdc_runtime_Main_Module__startupDoneFxn)(void); extern "C" far const CT__xdc_runtime_Main_Module__startupDoneFxn xdc_runtime_Main_Module__startupDoneFxn__C; typedef xdc_Int CT__xdc_runtime_Main_Object__count; extern "C" far const CT__xdc_runtime_Main_Object__count xdc_runtime_Main_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_Main_Object__heap; extern "C" far const CT__xdc_runtime_Main_Object__heap xdc_runtime_Main_Object__heap__C; typedef xdc_SizeT CT__xdc_runtime_Main_Object__sizeof; extern "C" far const CT__xdc_runtime_Main_Object__sizeof xdc_runtime_Main_Object__sizeof__C; typedef xdc_Ptr CT__xdc_runtime_Main_Object__table; extern "C" far const CT__xdc_runtime_Main_Object__table xdc_runtime_Main_Object__table__C; extern "C" xdc_Bool xdc_runtime_Main_Module__startupDone__S( void ); static inline CT__xdc_runtime_Main_Module__id xdc_runtime_Main_Module_id( void ) { return xdc_runtime_Main_Module__id__C; } static inline xdc_Bool xdc_runtime_Main_Module_hasMask( void ) { return (xdc_Bool)(xdc_runtime_Main_Module__diagsMask__C != 0); } static inline xdc_Bits16 xdc_runtime_Main_Module_getMask( void ) { return xdc_runtime_Main_Module__diagsMask__C != 0 ? *xdc_runtime_Main_Module__diagsMask__C : (xdc_Bits16)0; } static inline void xdc_runtime_Main_Module_setMask( xdc_Bits16 mask ) { if (xdc_runtime_Main_Module__diagsMask__C != 0) { *xdc_runtime_Main_Module__diagsMask__C = mask; } } typedef xdc_Bits32 xdc_runtime_Error_Id; namespace xdc_runtime { namespace Error { typedef xdc_runtime_Error_Id Id; }} enum xdc_runtime_Error_Policy { xdc_runtime_Error_TERMINATE, xdc_runtime_Error_UNWIND }; typedef enum xdc_runtime_Error_Policy xdc_runtime_Error_Policy; typedef void (*xdc_runtime_Error_HookFxn)(xdc_runtime_Error_Block*); typedef xdc_IArg __T1_xdc_runtime_Error_Data__arg; typedef xdc_IArg __ARRAY1_xdc_runtime_Error_Data__arg[2]; typedef __ARRAY1_xdc_runtime_Error_Data__arg __TA_xdc_runtime_Error_Data__arg; struct xdc_runtime_Error_Data { __TA_xdc_runtime_Error_Data__arg arg; }; typedef xdc_IArg __T1_xdc_runtime_Error_Block__xtra; typedef xdc_IArg __ARRAY1_xdc_runtime_Error_Block__xtra[4]; typedef __ARRAY1_xdc_runtime_Error_Block__xtra __TA_xdc_runtime_Error_Block__xtra; struct xdc_runtime_Error_Block { xdc_UInt16 unused; xdc_runtime_Error_Data data; xdc_runtime_Error_Id id; xdc_String msg; xdc_runtime_Types_Site site; __TA_xdc_runtime_Error_Block__xtra xtra; }; typedef void (*xdc_runtime_Error_PolicyFxn)(xdc_runtime_Error_Block*, xdc_runtime_Types_ModuleId, xdc_CString, xdc_Int, xdc_runtime_Error_Id, xdc_IArg, xdc_IArg); typedef xdc_Bits32 CT__xdc_runtime_Error_Module__diagsEnabled; extern "C" far const CT__xdc_runtime_Error_Module__diagsEnabled xdc_runtime_Error_Module__diagsEnabled__C; typedef xdc_Bits32 CT__xdc_runtime_Error_Module__diagsIncluded; extern "C" far const CT__xdc_runtime_Error_Module__diagsIncluded xdc_runtime_Error_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__xdc_runtime_Error_Module__diagsMask; extern "C" far const CT__xdc_runtime_Error_Module__diagsMask xdc_runtime_Error_Module__diagsMask__C; typedef xdc_Ptr CT__xdc_runtime_Error_Module__gateObj; extern "C" far const CT__xdc_runtime_Error_Module__gateObj xdc_runtime_Error_Module__gateObj__C; typedef xdc_Ptr CT__xdc_runtime_Error_Module__gatePrms; extern "C" far const CT__xdc_runtime_Error_Module__gatePrms xdc_runtime_Error_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__xdc_runtime_Error_Module__id; extern "C" far const CT__xdc_runtime_Error_Module__id xdc_runtime_Error_Module__id__C; typedef xdc_Bool CT__xdc_runtime_Error_Module__loggerDefined; extern "C" far const CT__xdc_runtime_Error_Module__loggerDefined xdc_runtime_Error_Module__loggerDefined__C; typedef xdc_Ptr CT__xdc_runtime_Error_Module__loggerObj; extern "C" far const CT__xdc_runtime_Error_Module__loggerObj xdc_runtime_Error_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__xdc_runtime_Error_Module__loggerFxn0; extern "C" far const CT__xdc_runtime_Error_Module__loggerFxn0 xdc_runtime_Error_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__xdc_runtime_Error_Module__loggerFxn1; extern "C" far const CT__xdc_runtime_Error_Module__loggerFxn1 xdc_runtime_Error_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__xdc_runtime_Error_Module__loggerFxn2; extern "C" far const CT__xdc_runtime_Error_Module__loggerFxn2 xdc_runtime_Error_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__xdc_runtime_Error_Module__loggerFxn4; extern "C" far const CT__xdc_runtime_Error_Module__loggerFxn4 xdc_runtime_Error_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__xdc_runtime_Error_Module__loggerFxn8; extern "C" far const CT__xdc_runtime_Error_Module__loggerFxn8 xdc_runtime_Error_Module__loggerFxn8__C; typedef xdc_Bool (*CT__xdc_runtime_Error_Module__startupDoneFxn)(void); extern "C" far const CT__xdc_runtime_Error_Module__startupDoneFxn xdc_runtime_Error_Module__startupDoneFxn__C; typedef xdc_Int CT__xdc_runtime_Error_Object__count; extern "C" far const CT__xdc_runtime_Error_Object__count xdc_runtime_Error_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_Error_Object__heap; extern "C" far const CT__xdc_runtime_Error_Object__heap xdc_runtime_Error_Object__heap__C; typedef xdc_SizeT CT__xdc_runtime_Error_Object__sizeof; extern "C" far const CT__xdc_runtime_Error_Object__sizeof xdc_runtime_Error_Object__sizeof__C; typedef xdc_Ptr CT__xdc_runtime_Error_Object__table; extern "C" far const CT__xdc_runtime_Error_Object__table xdc_runtime_Error_Object__table__C; typedef xdc_runtime_Error_PolicyFxn CT__xdc_runtime_Error_policyFxn; extern "C" far const CT__xdc_runtime_Error_policyFxn xdc_runtime_Error_policyFxn__C; typedef xdc_runtime_Error_Id CT__xdc_runtime_Error_E_generic; extern "C" far const CT__xdc_runtime_Error_E_generic xdc_runtime_Error_E_generic__C; typedef xdc_runtime_Error_Id CT__xdc_runtime_Error_E_memory; extern "C" far const CT__xdc_runtime_Error_E_memory xdc_runtime_Error_E_memory__C; typedef xdc_runtime_Error_Id CT__xdc_runtime_Error_E_msgCode; extern "C" far const CT__xdc_runtime_Error_E_msgCode xdc_runtime_Error_E_msgCode__C; typedef xdc_runtime_Error_Policy CT__xdc_runtime_Error_policy; extern "C" far const CT__xdc_runtime_Error_policy xdc_runtime_Error_policy__C; typedef xdc_runtime_Error_HookFxn CT__xdc_runtime_Error_raiseHook; extern "C" far const CT__xdc_runtime_Error_raiseHook xdc_runtime_Error_raiseHook__C; typedef xdc_UInt16 CT__xdc_runtime_Error_maxDepth; extern "C" far const CT__xdc_runtime_Error_maxDepth xdc_runtime_Error_maxDepth__C; extern "C" xdc_Bool xdc_runtime_Error_Module__startupDone__S( void ); extern "C" xdc_Bool xdc_runtime_Error_check__E( xdc_runtime_Error_Block *eb ); extern "C" xdc_runtime_Error_Data *xdc_runtime_Error_getData__E( xdc_runtime_Error_Block *eb ); extern "C" xdc_UInt16 xdc_runtime_Error_getCode__E( xdc_runtime_Error_Block *eb ); extern "C" xdc_runtime_Error_Id xdc_runtime_Error_getId__E( xdc_runtime_Error_Block *eb ); extern "C" xdc_String xdc_runtime_Error_getMsg__E( xdc_runtime_Error_Block *eb ); extern "C" xdc_runtime_Types_Site *xdc_runtime_Error_getSite__E( xdc_runtime_Error_Block *eb ); extern "C" void xdc_runtime_Error_init__E( xdc_runtime_Error_Block *eb ); extern "C" void xdc_runtime_Error_print__E( xdc_runtime_Error_Block *eb ); extern "C" void xdc_runtime_Error_policyDefault__E( xdc_runtime_Error_Block *eb, xdc_runtime_Types_ModuleId mod, xdc_CString file, xdc_Int line, xdc_runtime_Error_Id id, xdc_IArg arg1, xdc_IArg arg2 ); extern "C" void xdc_runtime_Error_policySpin__E( xdc_runtime_Error_Block *eb, xdc_runtime_Types_ModuleId mod, xdc_CString file, xdc_Int line, xdc_runtime_Error_Id id, xdc_IArg arg1, xdc_IArg arg2 ); extern "C" void xdc_runtime_Error_raiseX__E( xdc_runtime_Error_Block *eb, xdc_runtime_Types_ModuleId mod, xdc_CString file, xdc_Int line, xdc_runtime_Error_Id id, xdc_IArg arg1, xdc_IArg arg2 ); extern "C" void xdc_runtime_Error_setX__E( xdc_runtime_Error_Block *eb, xdc_runtime_Types_ModuleId mod, xdc_CString file, xdc_Int line, xdc_runtime_Error_Id id, xdc_IArg arg1, xdc_IArg arg2 ); static inline CT__xdc_runtime_Error_Module__id xdc_runtime_Error_Module_id( void ) { return xdc_runtime_Error_Module__id__C; } static inline xdc_Bool xdc_runtime_Error_Module_hasMask( void ) { return (xdc_Bool)(xdc_runtime_Error_Module__diagsMask__C != 0); } static inline xdc_Bits16 xdc_runtime_Error_Module_getMask( void ) { return xdc_runtime_Error_Module__diagsMask__C != 0 ? *xdc_runtime_Error_Module__diagsMask__C : (xdc_Bits16)0; } static inline void xdc_runtime_Error_Module_setMask( xdc_Bits16 mask ) { if (xdc_runtime_Error_Module__diagsMask__C != 0) { *xdc_runtime_Error_Module__diagsMask__C = mask; } } typedef xdc_Bits32 CT__xdc_runtime_Memory_HeapProxy_Module__diagsEnabled; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Module__diagsEnabled xdc_runtime_Memory_HeapProxy_Module__diagsEnabled__C; typedef xdc_Bits32 CT__xdc_runtime_Memory_HeapProxy_Module__diagsIncluded; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Module__diagsIncluded xdc_runtime_Memory_HeapProxy_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__xdc_runtime_Memory_HeapProxy_Module__diagsMask; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Module__diagsMask xdc_runtime_Memory_HeapProxy_Module__diagsMask__C; typedef xdc_Ptr CT__xdc_runtime_Memory_HeapProxy_Module__gateObj; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Module__gateObj xdc_runtime_Memory_HeapProxy_Module__gateObj__C; typedef xdc_Ptr CT__xdc_runtime_Memory_HeapProxy_Module__gatePrms; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Module__gatePrms xdc_runtime_Memory_HeapProxy_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__xdc_runtime_Memory_HeapProxy_Module__id; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Module__id xdc_runtime_Memory_HeapProxy_Module__id__C; typedef xdc_Bool CT__xdc_runtime_Memory_HeapProxy_Module__loggerDefined; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Module__loggerDefined xdc_runtime_Memory_HeapProxy_Module__loggerDefined__C; typedef xdc_Ptr CT__xdc_runtime_Memory_HeapProxy_Module__loggerObj; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Module__loggerObj xdc_runtime_Memory_HeapProxy_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__xdc_runtime_Memory_HeapProxy_Module__loggerFxn0; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Module__loggerFxn0 xdc_runtime_Memory_HeapProxy_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__xdc_runtime_Memory_HeapProxy_Module__loggerFxn1; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Module__loggerFxn1 xdc_runtime_Memory_HeapProxy_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__xdc_runtime_Memory_HeapProxy_Module__loggerFxn2; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Module__loggerFxn2 xdc_runtime_Memory_HeapProxy_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__xdc_runtime_Memory_HeapProxy_Module__loggerFxn4; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Module__loggerFxn4 xdc_runtime_Memory_HeapProxy_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__xdc_runtime_Memory_HeapProxy_Module__loggerFxn8; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Module__loggerFxn8 xdc_runtime_Memory_HeapProxy_Module__loggerFxn8__C; typedef xdc_Bool (*CT__xdc_runtime_Memory_HeapProxy_Module__startupDoneFxn)(void); extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Module__startupDoneFxn xdc_runtime_Memory_HeapProxy_Module__startupDoneFxn__C; typedef xdc_Int CT__xdc_runtime_Memory_HeapProxy_Object__count; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Object__count xdc_runtime_Memory_HeapProxy_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_Memory_HeapProxy_Object__heap; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Object__heap xdc_runtime_Memory_HeapProxy_Object__heap__C; typedef xdc_SizeT CT__xdc_runtime_Memory_HeapProxy_Object__sizeof; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Object__sizeof xdc_runtime_Memory_HeapProxy_Object__sizeof__C; typedef xdc_Ptr CT__xdc_runtime_Memory_HeapProxy_Object__table; extern "C" far const CT__xdc_runtime_Memory_HeapProxy_Object__table xdc_runtime_Memory_HeapProxy_Object__table__C; struct xdc_runtime_Memory_HeapProxy_Params { size_t __size; const void *__self; void *__fxns; xdc_runtime_IInstance_Params *instance; xdc_runtime_IInstance_Params __iprms; }; struct xdc_runtime_Memory_HeapProxy_Struct { const xdc_runtime_Memory_HeapProxy_Fxns__ *__fxns; xdc_runtime_Types_CordAddr __name; }; struct xdc_runtime_Memory_HeapProxy_Fxns__ { xdc_runtime_Types_Base* __base; const xdc_runtime_Types_SysFxns2* __sysp; xdc_Ptr (*alloc)(xdc_runtime_Memory_HeapProxy_Handle, xdc_SizeT, xdc_SizeT, xdc_runtime_Error_Block*); void (*free)(xdc_runtime_Memory_HeapProxy_Handle, xdc_Ptr, xdc_SizeT); xdc_Bool (*isBlocking)(xdc_runtime_Memory_HeapProxy_Handle); void (*getStats)(xdc_runtime_Memory_HeapProxy_Handle, xdc_runtime_Memory_Stats*); xdc_runtime_Types_SysFxns2 __sfxns; }; extern "C" const xdc_runtime_Memory_HeapProxy_Fxns__ xdc_runtime_Memory_HeapProxy_Module__FXNS__C; extern "C" xdc_runtime_Types_Label *xdc_runtime_Memory_HeapProxy_Handle__label__S( xdc_Ptr obj, xdc_runtime_Types_Label *lab ); extern "C" xdc_Bool xdc_runtime_Memory_HeapProxy_Module__startupDone__S( void ); extern "C" xdc_Ptr xdc_runtime_Memory_HeapProxy_Object__create__S( xdc_Ptr __oa, xdc_SizeT __osz, xdc_Ptr __aa, const xdc_UChar *__pa, xdc_SizeT __psz, xdc_runtime_Error_Block *__eb ); extern "C" xdc_runtime_Memory_HeapProxy_Handle xdc_runtime_Memory_HeapProxy_create( const xdc_runtime_Memory_HeapProxy_Params *__prms, xdc_runtime_Error_Block *__eb ); extern "C" void xdc_runtime_Memory_HeapProxy_Object__delete__S( xdc_Ptr instp ); extern "C" void xdc_runtime_Memory_HeapProxy_delete(xdc_runtime_Memory_HeapProxy_Handle *instp); extern "C" void xdc_runtime_Memory_HeapProxy_Object__destruct__S( xdc_Ptr objp ); extern "C" xdc_Ptr xdc_runtime_Memory_HeapProxy_Object__get__S( xdc_Ptr oarr, xdc_Int i ); extern "C" xdc_Ptr xdc_runtime_Memory_HeapProxy_Object__first__S( void ); extern "C" xdc_Ptr xdc_runtime_Memory_HeapProxy_Object__next__S( xdc_Ptr obj ); extern "C" void xdc_runtime_Memory_HeapProxy_Params__init__S( xdc_Ptr dst, const void *src, xdc_SizeT psz, xdc_SizeT isz ); extern "C" xdc_Bool xdc_runtime_Memory_HeapProxy_Proxy__abstract__S( void ); extern "C" xdc_Ptr xdc_runtime_Memory_HeapProxy_Proxy__delegate__S( void ); extern "C" xdc_Ptr xdc_runtime_Memory_HeapProxy_alloc__E( xdc_runtime_Memory_HeapProxy_Handle __inst, xdc_SizeT size, xdc_SizeT align, xdc_runtime_Error_Block *eb ); extern "C" void xdc_runtime_Memory_HeapProxy_free__E( xdc_runtime_Memory_HeapProxy_Handle __inst, xdc_Ptr block, xdc_SizeT size ); extern "C" xdc_Bool xdc_runtime_Memory_HeapProxy_isBlocking__E( xdc_runtime_Memory_HeapProxy_Handle __inst ); extern "C" void xdc_runtime_Memory_HeapProxy_getStats__E( xdc_runtime_Memory_HeapProxy_Handle __inst, xdc_runtime_Memory_Stats *stats ); static inline xdc_runtime_IHeap_Module xdc_runtime_Memory_HeapProxy_Module_upCast( void ) { return (xdc_runtime_IHeap_Module)xdc_runtime_Memory_HeapProxy_Proxy__delegate__S(); } static inline xdc_runtime_IHeap_Handle xdc_runtime_Memory_HeapProxy_Handle_upCast( xdc_runtime_Memory_HeapProxy_Handle i ) { return (xdc_runtime_IHeap_Handle)i; } static inline xdc_runtime_Memory_HeapProxy_Handle xdc_runtime_Memory_HeapProxy_Handle_downCast( xdc_runtime_IHeap_Handle i ) { xdc_runtime_IHeap_Handle i2 = (xdc_runtime_IHeap_Handle)i; if (xdc_runtime_Memory_HeapProxy_Proxy__abstract__S()) { return (xdc_runtime_Memory_HeapProxy_Handle)i; } return (const void*)i2->__fxns == (const void*)xdc_runtime_Memory_HeapProxy_Proxy__delegate__S() ? (xdc_runtime_Memory_HeapProxy_Handle)i : (xdc_runtime_Memory_HeapProxy_Handle)0; } static inline CT__xdc_runtime_Memory_HeapProxy_Module__id xdc_runtime_Memory_HeapProxy_Module_id( void ) { return xdc_runtime_Memory_HeapProxy_Module__id__C; } static inline void xdc_runtime_Memory_HeapProxy_Params_init( xdc_runtime_Memory_HeapProxy_Params *prms ) { if (prms) { xdc_runtime_Memory_HeapProxy_Params__init__S(prms, 0, sizeof(xdc_runtime_Memory_HeapProxy_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline void xdc_runtime_Memory_HeapProxy_Params_copy(xdc_runtime_Memory_HeapProxy_Params *dst, const xdc_runtime_Memory_HeapProxy_Params *src) { if (dst) { xdc_runtime_Memory_HeapProxy_Params__init__S(dst, (const void *)src, sizeof(xdc_runtime_Memory_HeapProxy_Params), sizeof(xdc_runtime_IInstance_Params)); } } typedef xdc_UArg xdc_runtime_Memory_Size; struct xdc_runtime_Memory_Stats { xdc_runtime_Memory_Size totalSize; xdc_runtime_Memory_Size totalFreeSize; xdc_runtime_Memory_Size largestFreeSize; }; typedef xdc_Bits32 CT__xdc_runtime_Memory_Module__diagsEnabled; extern "C" far const CT__xdc_runtime_Memory_Module__diagsEnabled xdc_runtime_Memory_Module__diagsEnabled__C; typedef xdc_Bits32 CT__xdc_runtime_Memory_Module__diagsIncluded; extern "C" far const CT__xdc_runtime_Memory_Module__diagsIncluded xdc_runtime_Memory_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__xdc_runtime_Memory_Module__diagsMask; extern "C" far const CT__xdc_runtime_Memory_Module__diagsMask xdc_runtime_Memory_Module__diagsMask__C; typedef xdc_Ptr CT__xdc_runtime_Memory_Module__gateObj; extern "C" far const CT__xdc_runtime_Memory_Module__gateObj xdc_runtime_Memory_Module__gateObj__C; typedef xdc_Ptr CT__xdc_runtime_Memory_Module__gatePrms; extern "C" far const CT__xdc_runtime_Memory_Module__gatePrms xdc_runtime_Memory_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__xdc_runtime_Memory_Module__id; extern "C" far const CT__xdc_runtime_Memory_Module__id xdc_runtime_Memory_Module__id__C; typedef xdc_Bool CT__xdc_runtime_Memory_Module__loggerDefined; extern "C" far const CT__xdc_runtime_Memory_Module__loggerDefined xdc_runtime_Memory_Module__loggerDefined__C; typedef xdc_Ptr CT__xdc_runtime_Memory_Module__loggerObj; extern "C" far const CT__xdc_runtime_Memory_Module__loggerObj xdc_runtime_Memory_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__xdc_runtime_Memory_Module__loggerFxn0; extern "C" far const CT__xdc_runtime_Memory_Module__loggerFxn0 xdc_runtime_Memory_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__xdc_runtime_Memory_Module__loggerFxn1; extern "C" far const CT__xdc_runtime_Memory_Module__loggerFxn1 xdc_runtime_Memory_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__xdc_runtime_Memory_Module__loggerFxn2; extern "C" far const CT__xdc_runtime_Memory_Module__loggerFxn2 xdc_runtime_Memory_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__xdc_runtime_Memory_Module__loggerFxn4; extern "C" far const CT__xdc_runtime_Memory_Module__loggerFxn4 xdc_runtime_Memory_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__xdc_runtime_Memory_Module__loggerFxn8; extern "C" far const CT__xdc_runtime_Memory_Module__loggerFxn8 xdc_runtime_Memory_Module__loggerFxn8__C; typedef xdc_Bool (*CT__xdc_runtime_Memory_Module__startupDoneFxn)(void); extern "C" far const CT__xdc_runtime_Memory_Module__startupDoneFxn xdc_runtime_Memory_Module__startupDoneFxn__C; typedef xdc_Int CT__xdc_runtime_Memory_Object__count; extern "C" far const CT__xdc_runtime_Memory_Object__count xdc_runtime_Memory_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_Memory_Object__heap; extern "C" far const CT__xdc_runtime_Memory_Object__heap xdc_runtime_Memory_Object__heap__C; typedef xdc_SizeT CT__xdc_runtime_Memory_Object__sizeof; extern "C" far const CT__xdc_runtime_Memory_Object__sizeof xdc_runtime_Memory_Object__sizeof__C; typedef xdc_Ptr CT__xdc_runtime_Memory_Object__table; extern "C" far const CT__xdc_runtime_Memory_Object__table xdc_runtime_Memory_Object__table__C; typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_Memory_defaultHeapInstance; extern "C" far const CT__xdc_runtime_Memory_defaultHeapInstance xdc_runtime_Memory_defaultHeapInstance__C; extern "C" xdc_Bool xdc_runtime_Memory_Module__startupDone__S( void ); extern "C" xdc_Ptr xdc_runtime_Memory_alloc__E( xdc_runtime_IHeap_Handle heap, xdc_SizeT size, xdc_SizeT align, xdc_runtime_Error_Block *eb ); extern "C" xdc_Ptr xdc_runtime_Memory_calloc__E( xdc_runtime_IHeap_Handle heap, xdc_SizeT size, xdc_SizeT align, xdc_runtime_Error_Block *eb ); extern "C" void xdc_runtime_Memory_free__E( xdc_runtime_IHeap_Handle heap, xdc_Ptr block, xdc_SizeT size ); extern "C" void xdc_runtime_Memory_getStats__E( xdc_runtime_IHeap_Handle heap, xdc_runtime_Memory_Stats *stats ); extern "C" xdc_Bool xdc_runtime_Memory_query__E( xdc_runtime_IHeap_Handle heap, xdc_Int qual ); extern "C" xdc_SizeT xdc_runtime_Memory_getMaxDefaultTypeAlign__E( void ); extern "C" xdc_Ptr xdc_runtime_Memory_valloc__E( xdc_runtime_IHeap_Handle heap, xdc_SizeT size, xdc_SizeT align, xdc_Char value, xdc_runtime_Error_Block *eb ); static inline CT__xdc_runtime_Memory_Module__id xdc_runtime_Memory_Module_id( void ) { return xdc_runtime_Memory_Module__id__C; } static inline xdc_Bool xdc_runtime_Memory_Module_hasMask( void ) { return (xdc_Bool)(xdc_runtime_Memory_Module__diagsMask__C != 0); } static inline xdc_Bits16 xdc_runtime_Memory_Module_getMask( void ) { return xdc_runtime_Memory_Module__diagsMask__C != 0 ? *xdc_runtime_Memory_Module__diagsMask__C : (xdc_Bits16)0; } static inline void xdc_runtime_Memory_Module_setMask( xdc_Bits16 mask ) { if (xdc_runtime_Memory_Module__diagsMask__C != 0) { *xdc_runtime_Memory_Module__diagsMask__C = mask; } } struct xdc_runtime_IHeap_Params { size_t __size; const void *__self; void *__fxns; xdc_runtime_IInstance_Params *instance; }; struct xdc_runtime_IHeap_Fxns__ { xdc_runtime_Types_Base* __base; const xdc_runtime_Types_SysFxns2* __sysp; xdc_Ptr (*alloc)(void*, xdc_SizeT, xdc_SizeT, xdc_runtime_Error_Block*); void (*free)(void*, xdc_Ptr, xdc_SizeT); xdc_Bool (*isBlocking)(void*); void (*getStats)(void*, xdc_runtime_Memory_Stats*); xdc_runtime_Types_SysFxns2 __sfxns; }; extern "C" const xdc_runtime_Types_Base xdc_runtime_IHeap_Interface__BASE__C; extern "C" xdc_runtime_IHeap_Handle xdc_runtime_IHeap_create(xdc_runtime_IHeap_Module, const xdc_runtime_IHeap_Params *, xdc_runtime_Error_Block *__eb); extern "C" void xdc_runtime_IHeap_delete(xdc_runtime_IHeap_Handle *); static inline xdc_runtime_IHeap_Module xdc_runtime_IHeap_Handle_to_Module( xdc_runtime_IHeap_Handle inst ) { return inst->__fxns; } static inline xdc_runtime_Types_Label *xdc_runtime_IHeap_Handle_label( xdc_runtime_IHeap_Handle inst, xdc_runtime_Types_Label *lab ) { return inst->__fxns->__sysp->__label(inst, lab); } static inline xdc_runtime_Types_ModuleId xdc_runtime_IHeap_Module_id( xdc_runtime_IHeap_Module mod ) { return mod->__sysp->__mid; } static inline xdc_Ptr xdc_runtime_IHeap_alloc( xdc_runtime_IHeap_Handle __inst, xdc_SizeT size, xdc_SizeT align, xdc_runtime_Error_Block *eb ) { return __inst->__fxns->alloc((void*)__inst, size, align, eb); } static inline void xdc_runtime_IHeap_free( xdc_runtime_IHeap_Handle __inst, xdc_Ptr block, xdc_SizeT size ) { __inst->__fxns->free((void*)__inst, block, size); } static inline xdc_Bool xdc_runtime_IHeap_isBlocking( xdc_runtime_IHeap_Handle __inst ) { return __inst->__fxns->isBlocking((void*)__inst); } static inline void xdc_runtime_IHeap_getStats( xdc_runtime_IHeap_Handle __inst, xdc_runtime_Memory_Stats *stats ) { __inst->__fxns->getStats((void*)__inst, stats); } typedef xdc_Ptr (*xdc_runtime_IHeap_alloc_FxnT)(void *, xdc_SizeT, xdc_SizeT, xdc_runtime_Error_Block*); static inline xdc_runtime_IHeap_alloc_FxnT xdc_runtime_IHeap_alloc_fxnP( xdc_runtime_IHeap_Handle __inst ) { return (xdc_runtime_IHeap_alloc_FxnT)__inst->__fxns->alloc; } typedef void (*xdc_runtime_IHeap_free_FxnT)(void *, xdc_Ptr, xdc_SizeT); static inline xdc_runtime_IHeap_free_FxnT xdc_runtime_IHeap_free_fxnP( xdc_runtime_IHeap_Handle __inst ) { return (xdc_runtime_IHeap_free_FxnT)__inst->__fxns->free; } typedef xdc_Bool (*xdc_runtime_IHeap_isBlocking_FxnT)(void *); static inline xdc_runtime_IHeap_isBlocking_FxnT xdc_runtime_IHeap_isBlocking_fxnP( xdc_runtime_IHeap_Handle __inst ) { return (xdc_runtime_IHeap_isBlocking_FxnT)__inst->__fxns->isBlocking; } typedef void (*xdc_runtime_IHeap_getStats_FxnT)(void *, xdc_runtime_Memory_Stats*); static inline xdc_runtime_IHeap_getStats_FxnT xdc_runtime_IHeap_getStats_fxnP( xdc_runtime_IHeap_Handle __inst ) { return (xdc_runtime_IHeap_getStats_FxnT)__inst->__fxns->getStats; } struct xdc_runtime_IModule_Fxns__ { xdc_runtime_Types_Base* __base; const xdc_runtime_Types_SysFxns2* __sysp; xdc_runtime_Types_SysFxns2 __sfxns; }; extern "C" const xdc_runtime_Types_Base xdc_runtime_IModule_Interface__BASE__C; static inline xdc_runtime_Types_ModuleId xdc_runtime_IModule_Module_id( xdc_runtime_IModule_Module mod ) { return mod->__sysp->__mid; } typedef xdc_runtime_Types_DiagsMask xdc_runtime_Diags_Mask; enum xdc_runtime_Diags_EventLevel { xdc_runtime_Diags_LEVEL1 = 0x0, xdc_runtime_Diags_LEVEL2 = 0x20, xdc_runtime_Diags_LEVEL3 = 0x40, xdc_runtime_Diags_LEVEL4 = 0x60 }; typedef enum xdc_runtime_Diags_EventLevel xdc_runtime_Diags_EventLevel; struct xdc_runtime_Diags_DictElem { xdc_runtime_Types_ModuleId modId; xdc_runtime_Diags_Mask *maskAddr; }; typedef xdc_Bits32 CT__xdc_runtime_Diags_Module__diagsEnabled; extern "C" far const CT__xdc_runtime_Diags_Module__diagsEnabled xdc_runtime_Diags_Module__diagsEnabled__C; typedef xdc_Bits32 CT__xdc_runtime_Diags_Module__diagsIncluded; extern "C" far const CT__xdc_runtime_Diags_Module__diagsIncluded xdc_runtime_Diags_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__xdc_runtime_Diags_Module__diagsMask; extern "C" far const CT__xdc_runtime_Diags_Module__diagsMask xdc_runtime_Diags_Module__diagsMask__C; typedef xdc_Ptr CT__xdc_runtime_Diags_Module__gateObj; extern "C" far const CT__xdc_runtime_Diags_Module__gateObj xdc_runtime_Diags_Module__gateObj__C; typedef xdc_Ptr CT__xdc_runtime_Diags_Module__gatePrms; extern "C" far const CT__xdc_runtime_Diags_Module__gatePrms xdc_runtime_Diags_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__xdc_runtime_Diags_Module__id; extern "C" far const CT__xdc_runtime_Diags_Module__id xdc_runtime_Diags_Module__id__C; typedef xdc_Bool CT__xdc_runtime_Diags_Module__loggerDefined; extern "C" far const CT__xdc_runtime_Diags_Module__loggerDefined xdc_runtime_Diags_Module__loggerDefined__C; typedef xdc_Ptr CT__xdc_runtime_Diags_Module__loggerObj; extern "C" far const CT__xdc_runtime_Diags_Module__loggerObj xdc_runtime_Diags_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__xdc_runtime_Diags_Module__loggerFxn0; extern "C" far const CT__xdc_runtime_Diags_Module__loggerFxn0 xdc_runtime_Diags_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__xdc_runtime_Diags_Module__loggerFxn1; extern "C" far const CT__xdc_runtime_Diags_Module__loggerFxn1 xdc_runtime_Diags_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__xdc_runtime_Diags_Module__loggerFxn2; extern "C" far const CT__xdc_runtime_Diags_Module__loggerFxn2 xdc_runtime_Diags_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__xdc_runtime_Diags_Module__loggerFxn4; extern "C" far const CT__xdc_runtime_Diags_Module__loggerFxn4 xdc_runtime_Diags_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__xdc_runtime_Diags_Module__loggerFxn8; extern "C" far const CT__xdc_runtime_Diags_Module__loggerFxn8 xdc_runtime_Diags_Module__loggerFxn8__C; typedef xdc_Bool (*CT__xdc_runtime_Diags_Module__startupDoneFxn)(void); extern "C" far const CT__xdc_runtime_Diags_Module__startupDoneFxn xdc_runtime_Diags_Module__startupDoneFxn__C; typedef xdc_Int CT__xdc_runtime_Diags_Object__count; extern "C" far const CT__xdc_runtime_Diags_Object__count xdc_runtime_Diags_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_Diags_Object__heap; extern "C" far const CT__xdc_runtime_Diags_Object__heap xdc_runtime_Diags_Object__heap__C; typedef xdc_SizeT CT__xdc_runtime_Diags_Object__sizeof; extern "C" far const CT__xdc_runtime_Diags_Object__sizeof xdc_runtime_Diags_Object__sizeof__C; typedef xdc_Ptr CT__xdc_runtime_Diags_Object__table; extern "C" far const CT__xdc_runtime_Diags_Object__table xdc_runtime_Diags_Object__table__C; typedef xdc_Bool CT__xdc_runtime_Diags_setMaskEnabled; extern "C" far const CT__xdc_runtime_Diags_setMaskEnabled xdc_runtime_Diags_setMaskEnabled__C; typedef xdc_runtime_Diags_DictElem *CT__xdc_runtime_Diags_dictBase; extern "C" far const CT__xdc_runtime_Diags_dictBase xdc_runtime_Diags_dictBase__C; extern "C" xdc_Bool xdc_runtime_Diags_Module__startupDone__S( void ); extern "C" void xdc_runtime_Diags_setMask__E( xdc_CString control ); static inline CT__xdc_runtime_Diags_Module__id xdc_runtime_Diags_Module_id( void ) { return xdc_runtime_Diags_Module__id__C; } static inline xdc_Bool xdc_runtime_Diags_Module_hasMask( void ) { return (xdc_Bool)(xdc_runtime_Diags_Module__diagsMask__C != 0); } static inline xdc_Bits16 xdc_runtime_Diags_Module_getMask( void ) { return xdc_runtime_Diags_Module__diagsMask__C != 0 ? *xdc_runtime_Diags_Module__diagsMask__C : (xdc_Bits16)0; } static inline void xdc_runtime_Diags_Module_setMask( xdc_Bits16 mask ) { if (xdc_runtime_Diags_Module__diagsMask__C != 0) { *xdc_runtime_Diags_Module__diagsMask__C = mask; } } typedef xdc_Bits32 xdc_runtime_Assert_Id; typedef xdc_Bits32 CT__xdc_runtime_Assert_Module__diagsEnabled; extern "C" far const CT__xdc_runtime_Assert_Module__diagsEnabled xdc_runtime_Assert_Module__diagsEnabled__C; typedef xdc_Bits32 CT__xdc_runtime_Assert_Module__diagsIncluded; extern "C" far const CT__xdc_runtime_Assert_Module__diagsIncluded xdc_runtime_Assert_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__xdc_runtime_Assert_Module__diagsMask; extern "C" far const CT__xdc_runtime_Assert_Module__diagsMask xdc_runtime_Assert_Module__diagsMask__C; typedef xdc_Ptr CT__xdc_runtime_Assert_Module__gateObj; extern "C" far const CT__xdc_runtime_Assert_Module__gateObj xdc_runtime_Assert_Module__gateObj__C; typedef xdc_Ptr CT__xdc_runtime_Assert_Module__gatePrms; extern "C" far const CT__xdc_runtime_Assert_Module__gatePrms xdc_runtime_Assert_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__xdc_runtime_Assert_Module__id; extern "C" far const CT__xdc_runtime_Assert_Module__id xdc_runtime_Assert_Module__id__C; typedef xdc_Bool CT__xdc_runtime_Assert_Module__loggerDefined; extern "C" far const CT__xdc_runtime_Assert_Module__loggerDefined xdc_runtime_Assert_Module__loggerDefined__C; typedef xdc_Ptr CT__xdc_runtime_Assert_Module__loggerObj; extern "C" far const CT__xdc_runtime_Assert_Module__loggerObj xdc_runtime_Assert_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__xdc_runtime_Assert_Module__loggerFxn0; extern "C" far const CT__xdc_runtime_Assert_Module__loggerFxn0 xdc_runtime_Assert_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__xdc_runtime_Assert_Module__loggerFxn1; extern "C" far const CT__xdc_runtime_Assert_Module__loggerFxn1 xdc_runtime_Assert_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__xdc_runtime_Assert_Module__loggerFxn2; extern "C" far const CT__xdc_runtime_Assert_Module__loggerFxn2 xdc_runtime_Assert_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__xdc_runtime_Assert_Module__loggerFxn4; extern "C" far const CT__xdc_runtime_Assert_Module__loggerFxn4 xdc_runtime_Assert_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__xdc_runtime_Assert_Module__loggerFxn8; extern "C" far const CT__xdc_runtime_Assert_Module__loggerFxn8 xdc_runtime_Assert_Module__loggerFxn8__C; typedef xdc_Bool (*CT__xdc_runtime_Assert_Module__startupDoneFxn)(void); extern "C" far const CT__xdc_runtime_Assert_Module__startupDoneFxn xdc_runtime_Assert_Module__startupDoneFxn__C; typedef xdc_Int CT__xdc_runtime_Assert_Object__count; extern "C" far const CT__xdc_runtime_Assert_Object__count xdc_runtime_Assert_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_Assert_Object__heap; extern "C" far const CT__xdc_runtime_Assert_Object__heap xdc_runtime_Assert_Object__heap__C; typedef xdc_SizeT CT__xdc_runtime_Assert_Object__sizeof; extern "C" far const CT__xdc_runtime_Assert_Object__sizeof xdc_runtime_Assert_Object__sizeof__C; typedef xdc_Ptr CT__xdc_runtime_Assert_Object__table; extern "C" far const CT__xdc_runtime_Assert_Object__table xdc_runtime_Assert_Object__table__C; typedef xdc_runtime_Error_Id CT__xdc_runtime_Assert_E_assertFailed; extern "C" far const CT__xdc_runtime_Assert_E_assertFailed xdc_runtime_Assert_E_assertFailed__C; extern "C" xdc_Bool xdc_runtime_Assert_Module__startupDone__S( void ); extern "C" void xdc_runtime_Assert_raise__I( xdc_runtime_Types_ModuleId mod, xdc_CString file, xdc_Int line, xdc_runtime_Assert_Id id ); static inline CT__xdc_runtime_Assert_Module__id xdc_runtime_Assert_Module_id( void ) { return xdc_runtime_Assert_Module__id__C; } static inline xdc_Bool xdc_runtime_Assert_Module_hasMask( void ) { return (xdc_Bool)(xdc_runtime_Assert_Module__diagsMask__C != 0); } static inline xdc_Bits16 xdc_runtime_Assert_Module_getMask( void ) { return xdc_runtime_Assert_Module__diagsMask__C != 0 ? *xdc_runtime_Assert_Module__diagsMask__C : (xdc_Bits16)0; } static inline void xdc_runtime_Assert_Module_setMask( xdc_Bits16 mask ) { if (xdc_runtime_Assert_Module__diagsMask__C != 0) { *xdc_runtime_Assert_Module__diagsMask__C = mask; } } struct xdc_runtime_ISystemSupport_Fxns__ { xdc_runtime_Types_Base* __base; const xdc_runtime_Types_SysFxns2* __sysp; void (*abort)(xdc_CString); void (*exit)(xdc_Int); void (*flush)(void); void (*putch)(xdc_Char); xdc_Bool (*ready)(void); xdc_runtime_Types_SysFxns2 __sfxns; }; extern "C" const xdc_runtime_Types_Base xdc_runtime_ISystemSupport_Interface__BASE__C; static inline xdc_runtime_Types_ModuleId xdc_runtime_ISystemSupport_Module_id( xdc_runtime_ISystemSupport_Module mod ) { return mod->__sysp->__mid; } static inline void xdc_runtime_ISystemSupport_abort( xdc_runtime_ISystemSupport_Module __inst, xdc_CString str ) { __inst->abort(str); } static inline void xdc_runtime_ISystemSupport_exit( xdc_runtime_ISystemSupport_Module __inst, xdc_Int stat ) { __inst->exit(stat); } static inline void xdc_runtime_ISystemSupport_flush( xdc_runtime_ISystemSupport_Module __inst ) { __inst->flush(); } static inline void xdc_runtime_ISystemSupport_putch( xdc_runtime_ISystemSupport_Module __inst, xdc_Char ch ) { __inst->putch(ch); } static inline xdc_Bool xdc_runtime_ISystemSupport_ready( xdc_runtime_ISystemSupport_Module __inst ) { return __inst->ready(); } typedef void (*xdc_runtime_ISystemSupport_abort_FxnT)(xdc_CString); static inline xdc_runtime_ISystemSupport_abort_FxnT xdc_runtime_ISystemSupport_abort_fxnP( xdc_runtime_ISystemSupport_Module __inst ) { return (xdc_runtime_ISystemSupport_abort_FxnT)__inst->abort; } typedef void (*xdc_runtime_ISystemSupport_exit_FxnT)(xdc_Int); static inline xdc_runtime_ISystemSupport_exit_FxnT xdc_runtime_ISystemSupport_exit_fxnP( xdc_runtime_ISystemSupport_Module __inst ) { return (xdc_runtime_ISystemSupport_exit_FxnT)__inst->exit; } typedef void (*xdc_runtime_ISystemSupport_flush_FxnT)(void); static inline xdc_runtime_ISystemSupport_flush_FxnT xdc_runtime_ISystemSupport_flush_fxnP( xdc_runtime_ISystemSupport_Module __inst ) { return (xdc_runtime_ISystemSupport_flush_FxnT)__inst->flush; } typedef void (*xdc_runtime_ISystemSupport_putch_FxnT)(xdc_Char); static inline xdc_runtime_ISystemSupport_putch_FxnT xdc_runtime_ISystemSupport_putch_fxnP( xdc_runtime_ISystemSupport_Module __inst ) { return (xdc_runtime_ISystemSupport_putch_FxnT)__inst->putch; } typedef xdc_Bool (*xdc_runtime_ISystemSupport_ready_FxnT)(void); static inline xdc_runtime_ISystemSupport_ready_FxnT xdc_runtime_ISystemSupport_ready_fxnP( xdc_runtime_ISystemSupport_Module __inst ) { return (xdc_runtime_ISystemSupport_ready_FxnT)__inst->ready; } typedef xdc_Bits32 CT__xdc_runtime_System_SupportProxy_Module__diagsEnabled; extern "C" far const CT__xdc_runtime_System_SupportProxy_Module__diagsEnabled xdc_runtime_System_SupportProxy_Module__diagsEnabled__C; typedef xdc_Bits32 CT__xdc_runtime_System_SupportProxy_Module__diagsIncluded; extern "C" far const CT__xdc_runtime_System_SupportProxy_Module__diagsIncluded xdc_runtime_System_SupportProxy_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__xdc_runtime_System_SupportProxy_Module__diagsMask; extern "C" far const CT__xdc_runtime_System_SupportProxy_Module__diagsMask xdc_runtime_System_SupportProxy_Module__diagsMask__C; typedef xdc_Ptr CT__xdc_runtime_System_SupportProxy_Module__gateObj; extern "C" far const CT__xdc_runtime_System_SupportProxy_Module__gateObj xdc_runtime_System_SupportProxy_Module__gateObj__C; typedef xdc_Ptr CT__xdc_runtime_System_SupportProxy_Module__gatePrms; extern "C" far const CT__xdc_runtime_System_SupportProxy_Module__gatePrms xdc_runtime_System_SupportProxy_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__xdc_runtime_System_SupportProxy_Module__id; extern "C" far const CT__xdc_runtime_System_SupportProxy_Module__id xdc_runtime_System_SupportProxy_Module__id__C; typedef xdc_Bool CT__xdc_runtime_System_SupportProxy_Module__loggerDefined; extern "C" far const CT__xdc_runtime_System_SupportProxy_Module__loggerDefined xdc_runtime_System_SupportProxy_Module__loggerDefined__C; typedef xdc_Ptr CT__xdc_runtime_System_SupportProxy_Module__loggerObj; extern "C" far const CT__xdc_runtime_System_SupportProxy_Module__loggerObj xdc_runtime_System_SupportProxy_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__xdc_runtime_System_SupportProxy_Module__loggerFxn0; extern "C" far const CT__xdc_runtime_System_SupportProxy_Module__loggerFxn0 xdc_runtime_System_SupportProxy_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__xdc_runtime_System_SupportProxy_Module__loggerFxn1; extern "C" far const CT__xdc_runtime_System_SupportProxy_Module__loggerFxn1 xdc_runtime_System_SupportProxy_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__xdc_runtime_System_SupportProxy_Module__loggerFxn2; extern "C" far const CT__xdc_runtime_System_SupportProxy_Module__loggerFxn2 xdc_runtime_System_SupportProxy_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__xdc_runtime_System_SupportProxy_Module__loggerFxn4; extern "C" far const CT__xdc_runtime_System_SupportProxy_Module__loggerFxn4 xdc_runtime_System_SupportProxy_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__xdc_runtime_System_SupportProxy_Module__loggerFxn8; extern "C" far const CT__xdc_runtime_System_SupportProxy_Module__loggerFxn8 xdc_runtime_System_SupportProxy_Module__loggerFxn8__C; typedef xdc_Bool (*CT__xdc_runtime_System_SupportProxy_Module__startupDoneFxn)(void); extern "C" far const CT__xdc_runtime_System_SupportProxy_Module__startupDoneFxn xdc_runtime_System_SupportProxy_Module__startupDoneFxn__C; typedef xdc_Int CT__xdc_runtime_System_SupportProxy_Object__count; extern "C" far const CT__xdc_runtime_System_SupportProxy_Object__count xdc_runtime_System_SupportProxy_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_System_SupportProxy_Object__heap; extern "C" far const CT__xdc_runtime_System_SupportProxy_Object__heap xdc_runtime_System_SupportProxy_Object__heap__C; typedef xdc_SizeT CT__xdc_runtime_System_SupportProxy_Object__sizeof; extern "C" far const CT__xdc_runtime_System_SupportProxy_Object__sizeof xdc_runtime_System_SupportProxy_Object__sizeof__C; typedef xdc_Ptr CT__xdc_runtime_System_SupportProxy_Object__table; extern "C" far const CT__xdc_runtime_System_SupportProxy_Object__table xdc_runtime_System_SupportProxy_Object__table__C; struct xdc_runtime_System_SupportProxy_Fxns__ { xdc_runtime_Types_Base* __base; const xdc_runtime_Types_SysFxns2* __sysp; void (*abort)(xdc_CString); void (*exit)(xdc_Int); void (*flush)(void); void (*putch)(xdc_Char); xdc_Bool (*ready)(void); xdc_runtime_Types_SysFxns2 __sfxns; }; extern "C" const xdc_runtime_System_SupportProxy_Fxns__ xdc_runtime_System_SupportProxy_Module__FXNS__C; extern "C" xdc_runtime_Types_Label *xdc_runtime_System_SupportProxy_Handle__label__S( xdc_Ptr obj, xdc_runtime_Types_Label *lab ); extern "C" xdc_Bool xdc_runtime_System_SupportProxy_Module__startupDone__S( void ); extern "C" xdc_Ptr xdc_runtime_System_SupportProxy_Object__create__S( xdc_Ptr __oa, xdc_SizeT __osz, xdc_Ptr __aa, const xdc_UChar *__pa, xdc_SizeT __psz, xdc_runtime_Error_Block *__eb ); extern "C" void xdc_runtime_System_SupportProxy_Object__delete__S( xdc_Ptr instp ); extern "C" void xdc_runtime_System_SupportProxy_Object__destruct__S( xdc_Ptr objp ); extern "C" xdc_Ptr xdc_runtime_System_SupportProxy_Object__get__S( xdc_Ptr oarr, xdc_Int i ); extern "C" xdc_Ptr xdc_runtime_System_SupportProxy_Object__first__S( void ); extern "C" xdc_Ptr xdc_runtime_System_SupportProxy_Object__next__S( xdc_Ptr obj ); extern "C" void xdc_runtime_System_SupportProxy_Params__init__S( xdc_Ptr dst, const void *src, xdc_SizeT psz, xdc_SizeT isz ); extern "C" xdc_Bool xdc_runtime_System_SupportProxy_Proxy__abstract__S( void ); extern "C" xdc_Ptr xdc_runtime_System_SupportProxy_Proxy__delegate__S( void ); extern "C" void xdc_runtime_System_SupportProxy_abort__E( xdc_CString str ); extern "C" void xdc_runtime_System_SupportProxy_exit__E( xdc_Int stat ); extern "C" void xdc_runtime_System_SupportProxy_flush__E( void ); extern "C" void xdc_runtime_System_SupportProxy_putch__E( xdc_Char ch ); extern "C" xdc_Bool xdc_runtime_System_SupportProxy_ready__E( void ); static inline xdc_runtime_ISystemSupport_Module xdc_runtime_System_SupportProxy_Module_upCast( void ) { return (xdc_runtime_ISystemSupport_Module)xdc_runtime_System_SupportProxy_Proxy__delegate__S(); } static inline CT__xdc_runtime_System_SupportProxy_Module__id xdc_runtime_System_SupportProxy_Module_id( void ) { return xdc_runtime_System_SupportProxy_Module__id__C; } typedef xdc_Bits32 CT__xdc_runtime_System_Module_GateProxy_Module__diagsEnabled; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Module__diagsEnabled xdc_runtime_System_Module_GateProxy_Module__diagsEnabled__C; typedef xdc_Bits32 CT__xdc_runtime_System_Module_GateProxy_Module__diagsIncluded; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Module__diagsIncluded xdc_runtime_System_Module_GateProxy_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__xdc_runtime_System_Module_GateProxy_Module__diagsMask; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Module__diagsMask xdc_runtime_System_Module_GateProxy_Module__diagsMask__C; typedef xdc_Ptr CT__xdc_runtime_System_Module_GateProxy_Module__gateObj; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Module__gateObj xdc_runtime_System_Module_GateProxy_Module__gateObj__C; typedef xdc_Ptr CT__xdc_runtime_System_Module_GateProxy_Module__gatePrms; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Module__gatePrms xdc_runtime_System_Module_GateProxy_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__xdc_runtime_System_Module_GateProxy_Module__id; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Module__id xdc_runtime_System_Module_GateProxy_Module__id__C; typedef xdc_Bool CT__xdc_runtime_System_Module_GateProxy_Module__loggerDefined; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Module__loggerDefined xdc_runtime_System_Module_GateProxy_Module__loggerDefined__C; typedef xdc_Ptr CT__xdc_runtime_System_Module_GateProxy_Module__loggerObj; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Module__loggerObj xdc_runtime_System_Module_GateProxy_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__xdc_runtime_System_Module_GateProxy_Module__loggerFxn0; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Module__loggerFxn0 xdc_runtime_System_Module_GateProxy_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__xdc_runtime_System_Module_GateProxy_Module__loggerFxn1; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Module__loggerFxn1 xdc_runtime_System_Module_GateProxy_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__xdc_runtime_System_Module_GateProxy_Module__loggerFxn2; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Module__loggerFxn2 xdc_runtime_System_Module_GateProxy_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__xdc_runtime_System_Module_GateProxy_Module__loggerFxn4; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Module__loggerFxn4 xdc_runtime_System_Module_GateProxy_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__xdc_runtime_System_Module_GateProxy_Module__loggerFxn8; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Module__loggerFxn8 xdc_runtime_System_Module_GateProxy_Module__loggerFxn8__C; typedef xdc_Bool (*CT__xdc_runtime_System_Module_GateProxy_Module__startupDoneFxn)(void); extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Module__startupDoneFxn xdc_runtime_System_Module_GateProxy_Module__startupDoneFxn__C; typedef xdc_Int CT__xdc_runtime_System_Module_GateProxy_Object__count; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Object__count xdc_runtime_System_Module_GateProxy_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_System_Module_GateProxy_Object__heap; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Object__heap xdc_runtime_System_Module_GateProxy_Object__heap__C; typedef xdc_SizeT CT__xdc_runtime_System_Module_GateProxy_Object__sizeof; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Object__sizeof xdc_runtime_System_Module_GateProxy_Object__sizeof__C; typedef xdc_Ptr CT__xdc_runtime_System_Module_GateProxy_Object__table; extern "C" far const CT__xdc_runtime_System_Module_GateProxy_Object__table xdc_runtime_System_Module_GateProxy_Object__table__C; struct xdc_runtime_System_Module_GateProxy_Params { size_t __size; const void *__self; void *__fxns; xdc_runtime_IInstance_Params *instance; xdc_runtime_IInstance_Params __iprms; }; struct xdc_runtime_System_Module_GateProxy_Struct { const xdc_runtime_System_Module_GateProxy_Fxns__ *__fxns; xdc_runtime_Types_CordAddr __name; }; struct xdc_runtime_System_Module_GateProxy_Fxns__ { xdc_runtime_Types_Base* __base; const xdc_runtime_Types_SysFxns2* __sysp; xdc_Bool (*query)(xdc_Int); xdc_IArg (*enter)(xdc_runtime_System_Module_GateProxy_Handle); void (*leave)(xdc_runtime_System_Module_GateProxy_Handle, xdc_IArg); xdc_runtime_Types_SysFxns2 __sfxns; }; extern "C" const xdc_runtime_System_Module_GateProxy_Fxns__ xdc_runtime_System_Module_GateProxy_Module__FXNS__C; extern "C" xdc_runtime_Types_Label *xdc_runtime_System_Module_GateProxy_Handle__label__S( xdc_Ptr obj, xdc_runtime_Types_Label *lab ); extern "C" xdc_Bool xdc_runtime_System_Module_GateProxy_Module__startupDone__S( void ); extern "C" xdc_Ptr xdc_runtime_System_Module_GateProxy_Object__create__S( xdc_Ptr __oa, xdc_SizeT __osz, xdc_Ptr __aa, const xdc_UChar *__pa, xdc_SizeT __psz, xdc_runtime_Error_Block *__eb ); extern "C" xdc_runtime_System_Module_GateProxy_Handle xdc_runtime_System_Module_GateProxy_create( const xdc_runtime_System_Module_GateProxy_Params *__prms, xdc_runtime_Error_Block *__eb ); extern "C" void xdc_runtime_System_Module_GateProxy_Object__delete__S( xdc_Ptr instp ); extern "C" void xdc_runtime_System_Module_GateProxy_delete(xdc_runtime_System_Module_GateProxy_Handle *instp); extern "C" void xdc_runtime_System_Module_GateProxy_Object__destruct__S( xdc_Ptr objp ); extern "C" xdc_Ptr xdc_runtime_System_Module_GateProxy_Object__get__S( xdc_Ptr oarr, xdc_Int i ); extern "C" xdc_Ptr xdc_runtime_System_Module_GateProxy_Object__first__S( void ); extern "C" xdc_Ptr xdc_runtime_System_Module_GateProxy_Object__next__S( xdc_Ptr obj ); extern "C" void xdc_runtime_System_Module_GateProxy_Params__init__S( xdc_Ptr dst, const void *src, xdc_SizeT psz, xdc_SizeT isz ); extern "C" xdc_Bool xdc_runtime_System_Module_GateProxy_Proxy__abstract__S( void ); extern "C" xdc_Ptr xdc_runtime_System_Module_GateProxy_Proxy__delegate__S( void ); extern "C" xdc_Bool xdc_runtime_System_Module_GateProxy_query__E( xdc_Int qual ); extern "C" xdc_IArg xdc_runtime_System_Module_GateProxy_enter__E( xdc_runtime_System_Module_GateProxy_Handle __inst ); extern "C" void xdc_runtime_System_Module_GateProxy_leave__E( xdc_runtime_System_Module_GateProxy_Handle __inst, xdc_IArg key ); static inline xdc_runtime_IGateProvider_Module xdc_runtime_System_Module_GateProxy_Module_upCast( void ) { return (xdc_runtime_IGateProvider_Module)xdc_runtime_System_Module_GateProxy_Proxy__delegate__S(); } static inline xdc_runtime_IGateProvider_Handle xdc_runtime_System_Module_GateProxy_Handle_upCast( xdc_runtime_System_Module_GateProxy_Handle i ) { return (xdc_runtime_IGateProvider_Handle)i; } static inline xdc_runtime_System_Module_GateProxy_Handle xdc_runtime_System_Module_GateProxy_Handle_downCast( xdc_runtime_IGateProvider_Handle i ) { xdc_runtime_IGateProvider_Handle i2 = (xdc_runtime_IGateProvider_Handle)i; if (xdc_runtime_System_Module_GateProxy_Proxy__abstract__S()) { return (xdc_runtime_System_Module_GateProxy_Handle)i; } return (const void*)i2->__fxns == (const void*)xdc_runtime_System_Module_GateProxy_Proxy__delegate__S() ? (xdc_runtime_System_Module_GateProxy_Handle)i : (xdc_runtime_System_Module_GateProxy_Handle)0; } static inline CT__xdc_runtime_System_Module_GateProxy_Module__id xdc_runtime_System_Module_GateProxy_Module_id( void ) { return xdc_runtime_System_Module_GateProxy_Module__id__C; } static inline void xdc_runtime_System_Module_GateProxy_Params_init( xdc_runtime_System_Module_GateProxy_Params *prms ) { if (prms) { xdc_runtime_System_Module_GateProxy_Params__init__S(prms, 0, sizeof(xdc_runtime_System_Module_GateProxy_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline void xdc_runtime_System_Module_GateProxy_Params_copy(xdc_runtime_System_Module_GateProxy_Params *dst, const xdc_runtime_System_Module_GateProxy_Params *src) { if (dst) { xdc_runtime_System_Module_GateProxy_Params__init__S(dst, (const void *)src, sizeof(xdc_runtime_System_Module_GateProxy_Params), sizeof(xdc_runtime_IInstance_Params)); } } typedef void (*xdc_runtime_System_AtexitHandler)(xdc_Int); typedef void (*xdc_runtime_System_AbortFxn)(void); typedef void (*xdc_runtime_System_ExitFxn)(xdc_Int); struct xdc_runtime_System_ParseData { xdc_Int width; xdc_Bool lFlag; xdc_Bool lJust; xdc_Int precis; xdc_Int len; xdc_Int zpad; xdc_Char *end; xdc_Bool aFlag; xdc_Char *ptr; }; typedef xdc_Int (*xdc_runtime_System_ExtendFxn)(xdc_Char**, xdc_CString*, xdc_VaList*, xdc_runtime_System_ParseData*); typedef xdc_runtime_System_AtexitHandler __T1_xdc_runtime_System_Module_State__atexitHandlers; typedef xdc_runtime_System_AtexitHandler *__ARRAY1_xdc_runtime_System_Module_State__atexitHandlers; typedef __ARRAY1_xdc_runtime_System_Module_State__atexitHandlers __TA_xdc_runtime_System_Module_State__atexitHandlers; typedef xdc_Bits32 CT__xdc_runtime_System_Module__diagsEnabled; extern "C" far const CT__xdc_runtime_System_Module__diagsEnabled xdc_runtime_System_Module__diagsEnabled__C; typedef xdc_Bits32 CT__xdc_runtime_System_Module__diagsIncluded; extern "C" far const CT__xdc_runtime_System_Module__diagsIncluded xdc_runtime_System_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__xdc_runtime_System_Module__diagsMask; extern "C" far const CT__xdc_runtime_System_Module__diagsMask xdc_runtime_System_Module__diagsMask__C; typedef xdc_Ptr CT__xdc_runtime_System_Module__gateObj; extern "C" far const CT__xdc_runtime_System_Module__gateObj xdc_runtime_System_Module__gateObj__C; typedef xdc_Ptr CT__xdc_runtime_System_Module__gatePrms; extern "C" far const CT__xdc_runtime_System_Module__gatePrms xdc_runtime_System_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__xdc_runtime_System_Module__id; extern "C" far const CT__xdc_runtime_System_Module__id xdc_runtime_System_Module__id__C; typedef xdc_Bool CT__xdc_runtime_System_Module__loggerDefined; extern "C" far const CT__xdc_runtime_System_Module__loggerDefined xdc_runtime_System_Module__loggerDefined__C; typedef xdc_Ptr CT__xdc_runtime_System_Module__loggerObj; extern "C" far const CT__xdc_runtime_System_Module__loggerObj xdc_runtime_System_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__xdc_runtime_System_Module__loggerFxn0; extern "C" far const CT__xdc_runtime_System_Module__loggerFxn0 xdc_runtime_System_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__xdc_runtime_System_Module__loggerFxn1; extern "C" far const CT__xdc_runtime_System_Module__loggerFxn1 xdc_runtime_System_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__xdc_runtime_System_Module__loggerFxn2; extern "C" far const CT__xdc_runtime_System_Module__loggerFxn2 xdc_runtime_System_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__xdc_runtime_System_Module__loggerFxn4; extern "C" far const CT__xdc_runtime_System_Module__loggerFxn4 xdc_runtime_System_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__xdc_runtime_System_Module__loggerFxn8; extern "C" far const CT__xdc_runtime_System_Module__loggerFxn8 xdc_runtime_System_Module__loggerFxn8__C; typedef xdc_Bool (*CT__xdc_runtime_System_Module__startupDoneFxn)(void); extern "C" far const CT__xdc_runtime_System_Module__startupDoneFxn xdc_runtime_System_Module__startupDoneFxn__C; typedef xdc_Int CT__xdc_runtime_System_Object__count; extern "C" far const CT__xdc_runtime_System_Object__count xdc_runtime_System_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_System_Object__heap; extern "C" far const CT__xdc_runtime_System_Object__heap xdc_runtime_System_Object__heap__C; typedef xdc_SizeT CT__xdc_runtime_System_Object__sizeof; extern "C" far const CT__xdc_runtime_System_Object__sizeof xdc_runtime_System_Object__sizeof__C; typedef xdc_Ptr CT__xdc_runtime_System_Object__table; extern "C" far const CT__xdc_runtime_System_Object__table xdc_runtime_System_Object__table__C; typedef xdc_runtime_Assert_Id CT__xdc_runtime_System_A_cannotFitIntoArg; extern "C" far const CT__xdc_runtime_System_A_cannotFitIntoArg xdc_runtime_System_A_cannotFitIntoArg__C; typedef xdc_Int CT__xdc_runtime_System_maxAtexitHandlers; extern "C" far const CT__xdc_runtime_System_maxAtexitHandlers xdc_runtime_System_maxAtexitHandlers__C; typedef xdc_runtime_System_AbortFxn CT__xdc_runtime_System_abortFxn; extern "C" far const CT__xdc_runtime_System_abortFxn xdc_runtime_System_abortFxn__C; typedef xdc_runtime_System_ExitFxn CT__xdc_runtime_System_exitFxn; extern "C" far const CT__xdc_runtime_System_exitFxn xdc_runtime_System_exitFxn__C; typedef xdc_runtime_System_ExtendFxn CT__xdc_runtime_System_extendFxn; extern "C" far const CT__xdc_runtime_System_extendFxn xdc_runtime_System_extendFxn__C; extern "C" xdc_Int xdc_runtime_System_Module_startup__E( xdc_Int state ); extern "C" xdc_Int xdc_runtime_System_Module_startup__F( xdc_Int state ); extern "C" xdc_Bool xdc_runtime_System_Module__startupDone__S( void ); extern "C" void xdc_runtime_System_abort__E( xdc_CString str ); extern "C" void xdc_runtime_System_abortStd__E( void ); extern "C" void xdc_runtime_System_abortSpin__E( void ); extern "C" xdc_Bool xdc_runtime_System_atexit__E( xdc_runtime_System_AtexitHandler handler ); extern "C" void xdc_runtime_System_exit__E( xdc_Int stat ); extern "C" void xdc_runtime_System_exitStd__E( xdc_Int stat ); extern "C" void xdc_runtime_System_exitSpin__E( xdc_Int stat ); extern "C" void xdc_runtime_System_processAtExit__E( xdc_Int stat ); extern "C" void xdc_runtime_System_putch__E( xdc_Char ch ); extern "C" void xdc_runtime_System_flush__E( void ); extern "C" xdc_Int xdc_runtime_System_printf__E( xdc_CString fmt, ... ); extern "C" xdc_Int xdc_runtime_System_printf_va__E( xdc_CString fmt, va_list _va ); extern "C" xdc_Int xdc_runtime_System_printf_va__F( xdc_CString fmt, va_list _va ); extern "C" xdc_Int xdc_runtime_System_aprintf__E( xdc_CString fmt, ... ); extern "C" xdc_Int xdc_runtime_System_aprintf_va__E( xdc_CString fmt, va_list _va ); extern "C" xdc_Int xdc_runtime_System_aprintf_va__F( xdc_CString fmt, va_list _va ); extern "C" xdc_Int xdc_runtime_System_sprintf__E( xdc_Char buf[], xdc_CString fmt, ... ); extern "C" xdc_Int xdc_runtime_System_sprintf_va__E( xdc_Char buf[], xdc_CString fmt, va_list _va ); extern "C" xdc_Int xdc_runtime_System_sprintf_va__F( xdc_Char buf[], xdc_CString fmt, va_list _va ); extern "C" xdc_Int xdc_runtime_System_asprintf__E( xdc_Char buf[], xdc_CString fmt, ... ); extern "C" xdc_Int xdc_runtime_System_asprintf_va__E( xdc_Char buf[], xdc_CString fmt, va_list _va ); extern "C" xdc_Int xdc_runtime_System_asprintf_va__F( xdc_Char buf[], xdc_CString fmt, va_list _va ); extern "C" xdc_Int xdc_runtime_System_vprintf__E( xdc_CString fmt, xdc_VaList va ); extern "C" xdc_Int xdc_runtime_System_avprintf__E( xdc_CString fmt, xdc_VaList va ); extern "C" xdc_Int xdc_runtime_System_vsprintf__E( xdc_Char buf[], xdc_CString fmt, xdc_VaList va ); extern "C" xdc_Int xdc_runtime_System_avsprintf__E( xdc_Char buf[], xdc_CString fmt, xdc_VaList va ); extern "C" xdc_Int xdc_runtime_System_snprintf__E( xdc_Char buf[], xdc_SizeT n, xdc_CString fmt, ... ); extern "C" xdc_Int xdc_runtime_System_snprintf_va__E( xdc_Char buf[], xdc_SizeT n, xdc_CString fmt, va_list _va ); extern "C" xdc_Int xdc_runtime_System_snprintf_va__F( xdc_Char buf[], xdc_SizeT n, xdc_CString fmt, va_list _va ); extern "C" xdc_Int xdc_runtime_System_vsnprintf__E( xdc_Char buf[], xdc_SizeT n, xdc_CString fmt, xdc_VaList va ); extern "C" xdc_Int xdc_runtime_System_printfExtend__I( xdc_Char **bufp, xdc_CString *fmt, xdc_VaList *va, xdc_runtime_System_ParseData *parse ); extern "C" xdc_Int xdc_runtime_System_doPrint__I( xdc_Char buf[], xdc_SizeT n, xdc_CString fmt, xdc_VaList *pva, xdc_Bool aFlag ); extern "C" void xdc_runtime_System_lastFxn__I( void ); extern "C" void xdc_runtime_System_putchar__I( xdc_Char **bufp, xdc_Char ch, xdc_SizeT *n ); extern "C" void xdc_runtime_System_rtsExit__I( void ); extern "C" xdc_Bool xdc_runtime_System_atexitDone__I( void ); static inline CT__xdc_runtime_System_Module__id xdc_runtime_System_Module_id( void ) { return xdc_runtime_System_Module__id__C; } static inline xdc_Bool xdc_runtime_System_Module_hasMask( void ) { return (xdc_Bool)(xdc_runtime_System_Module__diagsMask__C != 0); } static inline xdc_Bits16 xdc_runtime_System_Module_getMask( void ) { return xdc_runtime_System_Module__diagsMask__C != 0 ? *xdc_runtime_System_Module__diagsMask__C : (xdc_Bits16)0; } static inline void xdc_runtime_System_Module_setMask( xdc_Bits16 mask ) { if (xdc_runtime_System_Module__diagsMask__C != 0) { *xdc_runtime_System_Module__diagsMask__C = mask; } } #pragma diag_push #pragma CHECK_MISRA("-6.3") #pragma CHECK_MISRA("-19.1") #pragma CHECK_MISRA("-20.1") #pragma CHECK_MISRA("-20.2") extern "C" namespace std { #pragma diag_push #pragma CHECK_MISRA("-19.4") #pragma diag_pop extern "C" size_t strlen(const char *string); extern "C" char *strcpy(char *dest, const char *src); extern "C" char *strncpy(char *dest, const char *src, size_t n); extern "C" char *strcat(char *string1, const char *string2); extern "C" char *strncat(char *dest, const char *src, size_t n); extern "C" char *strchr(const char *string, int c); extern "C" char *strrchr(const char *string, int c); extern "C" int strcmp(const char *string1, const char *string2); extern "C" int strncmp(const char *string1, const char *string2, size_t n); int strcoll(const char *string1, const char *_string2); size_t strxfrm(char *to, const char *from, size_t n); char *strpbrk(const char *string, const char *chs); size_t strspn(const char *string, const char *chs); size_t strcspn(const char *string, const char *chs); char *strstr(const char *string1, const char *string2); char *strtok(char *str1, const char *str2); char *strerror(int _errno); char *strdup(const char *string); void *memmove(void *s1, const void *s2, size_t n); #pragma diag_push #pragma CHECK_MISRA("-16.4") void *memcpy(void *s1, const void *s2, size_t n); #pragma diag_pop extern "C" int memcmp(const void *cs, const void *ct, size_t n); extern "C" void *memchr(const void *cs, int c, size_t n); void *memset(void *mem, int ch, size_t length); } #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::size_t; using std::strlen; using std::strcpy; using std::strncpy; using std::strcat; using std::strncat; using std::strchr; using std::strrchr; using std::strcmp; using std::strncmp; using std::strcoll; using std::strxfrm; using std::strpbrk; using std::strspn; using std::strcspn; using std::strstr; using std::strtok; using std::strerror; using std::strdup; using std::memmove; using std::memcpy; using std::memcmp; using std::memchr; using std::memset; #pragma diag_pop #pragma pack(push) #pragma pack(1) typedef int int32; typedef char int8; typedef char* int8p; typedef char* charp; typedef double real64; typedef long long int64; typedef unsigned long long uint64; typedef short int16; typedef unsigned int uint32; typedef unsigned short uint16; typedef unsigned char uint8; typedef unsigned char* uint8p; typedef float real32; typedef float* real32p; typedef unsigned short* uint16p; typedef unsigned int* uint32p; typedef short* int16p; typedef int * int32p; typedef double* real64p; typedef void* voidp; typedef uint8 byte; enum FovEnu { fovWide = 0, fovNarrow = 1, fovWide2Narrow = 2, fovNarrow2Wide = 3 }; enum ActiveFovEnu { activeFovWide = 0, activeFovNarrow = 1 }; enum VideoSourceEnu { vidIr = 0, vidTv = 1, vidLL = 2 }; enum TrkModeCmdEnu { trkModeSingle = 0, trkModeMulti = 1 }; enum TrkAlgorithmEnu { trkObj = 0, trkArea = 1 }; enum TrkCommandEnu { trkCmdNoChange = 0, trkCmdAcquire = 1, trkCmdDrop = 2, }; enum TrkTargetStatusEnu { trkStatusOff = 0, trkStatusAcquire = 1, trkStatusTrack = 2, trkStatusCoast = 3, trkStatusFOVChanging = 4, trkStatusReserved = 5 }; enum TrkPolarityEnu { trkPolarityWhite = 0, trkPolarityBlack = 1 }; typedef enum { CoreEnu_systemManager = 0, CoreEnu_symbolgy = 1, CoreEnu_sightlineManager = 2, CoreEnu_stabilization = 3, CoreEnu_passiveTrack = 4, CoreEnu_activeTrack1 = 5, CoreEnu_activeTrack2 = 6, CoreEnu_reservedCore = 7, CoreEnu_coreInvalid = -1 } CoreNameEnuType; typedef enum { LruEnu_PowerUnit = 0, LruEnu_SafetyUnit = 1, LruEnu_Lab = 2, LruEnu_Laser = 3, LruEnu_IMU = 4, LruEnu_IrCam = 5, LruEnu_PrecisionCam = 6, LruEnu_Telescope = 7, LruEnu_FsmDriver = 8, LruEnu_AzimuthEncoder = 9, LruEnu_AzimuthDriver = 10 } LRUEnuType; typedef enum { SystemModeCmdEnu_NoChange = 0, SystemModeCmdEnu_StandBy = 1, SystemModeCmdEnu_Operational = 2, SystemModeCmdEnu_IBIT = 3, SystemModeCmdEnu_Maintenance = 4, SystemModeCmdEnu_ShutDown = 5 } SystemModeCmdEnuType; typedef enum { SystemModeStatusEnu_StandBy = 1, SystemModeStatusEnu_Operational = 2, SystemModeStatusEnu_Initialization = 3, SystemModeStatusEnu_Ibit = 4, SystemModeStatusEnu_Maintenance = 5, SystemModeStatusEnu_ShuttingDown = 6 } SystemModeStatusEnuType; typedef enum { SystemSubModeEnu_NoChange = 0, SystemSubModeEnu_NA = 0, SystemSubModeEnu_Manual = 1, SystemSubModeEnu_Auto = 2, SystemSubModeEnu_PasTrk = 3, SystemSubModeEnu_ActTrk = 4 } SystemSubModeEnuType; typedef enum { TrkEnu_NoChange = 0, TrkEnu_AqStart = 1, TrkEnu_Drp = 2 } TrkEnuType; typedef enum { LosModeCmdEnu_NoChange = 0, LosModeCmdEnu_Park = 1, LosModeCmdEnu_SlavePos = 2, LosModeCmdEnu_Forward = 3, LosModeCmdEnu_CuedPoint = 4, LosModeCmdEnu_FirstLocation = 5, LosModeCmdEnu_SecondLocation = 6, LosModeCmdEnu_ThirdLocation = 7, LosModeCmdEnu_FirstDirection = 8, LosModeCmdEnu_SecondDirection = 9, LosModeCmdEnu_ThirdDirection = 10 } LosModeCmdEnuType; typedef enum { LosStatusEnu_Park = 0, LosStatusEnu_SlaveRate = 1, LosStatusEnu_SlavePos = 2, LosStatusEnu_Forward = 3, LosStatusEnu_CuedPoint = 6, LosStatusEnu_TargetTrack = 7 } LosStatusEnuType; struct Data256 { uint8 data[256]; }; typedef struct { uint32 SystemManager[5]; uint32 symbology[1]; uint32 slm[5]; uint32 IrTrk[1]; uint32 NirTrk[1]; } BitBinaryListStruct; #pragma pack(pop) struct SwVersionStruct { char date[12]; char time[9]; uint16 major; uint16 minor; char svnRevision[20]; }; struct SYS_SYM_MsgStruct { struct { uint8 Status; uint8 LosMode; uint8 EUTemperatureFail; uint8 DeclutterLevel; uint32 LruFail; }System; struct { uint8 NorthIndicatorEnable; uint8 Reserved1; uint16 Reserved2; }Navigation; struct { uint8 ExternalCommunicationError; uint8 NTPWarning; uint16 Reserved; }Communication; struct { uint8 Freezed; uint8 AutoFocus; uint8 VideoMode; uint8 Polarity; uint8 TrackOffset; uint8 FOV; uint8 Cooling; uint8 Reserved; }IRCam; struct { uint8 Freezed; uint8 AutoFocus; uint8 VideoMode; uint8 Polarity; uint8 TrackOffset; uint8 FOV; uint16 Reserved; }NIRCam; struct { uint16 DateYear; uint8 DateMonth; uint8 DateDay; uint8 TimeHour; uint8 TimeMin; uint8 TimeSec; uint8 Reserved; }Time; struct { uint8 LrfStatus; uint8 LiuStatus; uint8 HplStatus; uint8 Reserved; }Lasers; SYS_SYM_MsgStruct() { memset(this, 0, sizeof(*this)); } }; struct Slm2SmMsgStruct { SwVersionStruct version; Slm2SmMsgStruct() { memset(this, 0, sizeof(*this)); } }; struct SYM_SYS_MsgStruct { uint8 DeclutterLevel; uint8 Reserved; uint32 BITResults; SwVersionStruct swversion; SYM_SYS_MsgStruct() { memset(this, 0, sizeof(*this)); }; }; struct IRTRK_SYM_MsgStruct { uint8 TrackStatus; uint8 TrackQuality; uint16 Reserved; uint16 TrackWindowWidth; uint16 TrackWindowHeight; int16 TrackCenterX; int16 TrackCenterY; SwVersionStruct version; IRTRK_SYM_MsgStruct() { memset(this, 0, sizeof(*this)); } }; struct NIRTRK_SYM_MsgStruct { uint8 TrackStatus; uint8 TrackQuality; uint16 Reserved; uint16 TrackWindowWidth; uint16 TrackWindowHeight; int16 TrackCenterX; int16 TrackCenterY; SwVersionStruct version; NIRTRK_SYM_MsgStruct() { memset(this, 0, sizeof(*this)); } }; struct SLM_SYM_MsgStruct { real32 AzimuthAngle; real32 ElevationAngle; real32 PlatformHeading; real32 PlatformPitch; uint16 TargetRange; uint8 TargetRangeType; uint8 Reserved; SLM_SYM_MsgStruct() { memset(this, 0, sizeof(*this)); } }; struct SYS_IRTRK_MsgStruct { uint8 TrackCommands; uint8 FOVStatus; uint8 FOVAngleInteger; uint8 FOVAngleFraction; uint8 VideoPolarity; uint8 TrackPolarity; uint8 TrackAlgorithm; uint8 Reserved1; uint16 VarianceThreshold; uint16 Reserved2; uint16 TargetLocX; uint16 TargetLocY; uint16 TargetSizeX; uint16 TargetSizeY; SYS_IRTRK_MsgStruct() { memset(this, 0, sizeof(*this)); }; }; struct IRTRK_SYS_MsgStruct { uint8 FOVStatus; uint8 FOVAngleInteger; uint8 FOVAngleFraction; uint8 VideoPolarity; uint8 TrackPolarity; uint8 TrackStatus; uint8 TargetValidity; uint8 TrackAlgorithm; uint8 SwVer; uint8 SwRev; uint16 Reserved; uint16 TrackWindowWidth; uint16 TrackWindowHeight; int16 TrackCenterX; int16 TrackCenterY; real32 Variance; real32 TrackQuality; uint32 BITResults; SwVersionStruct version; IRTRK_SYS_MsgStruct() { memset(this, 0, sizeof(*this)); } }; struct SYS_NIRTRK_MsgStruct { uint8 TrackCommands; uint8 FOVStatus; uint8 FOVAngleInteger; uint8 FOVAngleFraction; uint8 VideoPolarity; uint8 TrackPolarity; uint8 TrackAlgorithm; uint16 Reserved; uint16 VarianceThreshold; uint16 TargetLocX; uint16 TargetLocY; uint16 TargetSizeX; uint16 TargetSizeY; SYS_NIRTRK_MsgStruct() { memset(this, 0, sizeof(*this)); }; }; struct IRTRK_SLM_MsgStruct { uint8 TrackStatus; uint8 FOVStatus; uint8 FOVAngleInteger; uint8 FOVAngleFraction; uint16 TrackWindowWidth; uint16 TrackWindowHeight; int16 TrackCenterX; int16 TrackCenterY; IRTRK_SLM_MsgStruct() { memset(this, 0, sizeof(*this)); } }; struct NIRTRK_SYS_MsgStruct { uint8 FOVStatus; uint8 TrackAlgorithm; uint8 FOVAngleInteger; uint8 FOVAngleFraction; uint8 TrackStatus; uint8 TrackQuality; uint8 TargetValidity; uint16 TrackWindowWidth; uint16 TrackWindowHeight; int16 TrackCenterX; int16 TrackCenterY; SwVersionStruct Trk1SwInfo; SwVersionStruct Trk2SwInfo; NIRTRK_SYS_MsgStruct() { memset(this, 0, sizeof(*this)); } }; struct NIRTRK_SLM_MsgStruct { uint8 TrackStatus; uint8 FOVStatus; uint8 FOVAngleInteger; uint8 FOVAngleFraction; uint16 TrackWindowWidth; uint16 TrackWindowHeight; int16 TrackCenterX; int16 TrackCenterY; NIRTRK_SLM_MsgStruct() { memset(this, 0, sizeof(*this)); } }; struct SLM_IRTRK_MsgStruct { real32 ExpectedOffsetPerSecondAzimuth; real32 ExpectedOffsetPerSecondElevation; real32 ExpectedOffsetPerSecondRoll; real32 RollRate; SLM_IRTRK_MsgStruct() { memset(this, 0, sizeof(*this)); } }; struct SLM_NIRTRK_MsgStruct { real32 ExpectedOffsetPerSecondAzimuth; real32 ExpectedOffsetPerSecondElevation; real32 ExpectedOffsetPerSecondRoll; real32 RollRate; SLM_NIRTRK_MsgStruct() { memset(this, 0, sizeof(*this)); } }; struct NIR_IRTRK_MsgStruct { uint32 messageCnt; NIR_IRTRK_MsgStruct() { memset(this, 0, sizeof(*this)); } }; struct IRTRK_NIR_MsgStruct { uint32 messageCnt; IRTRK_NIR_MsgStruct() { memset(this, 0, sizeof(*this)); } }; struct SYS_SLM_MsgStruct { struct { uint8 GimbalStatus; uint8 Mode; uint8 Submode; uint8 LosMode; uint8 IBITPhase; uint8 BoresightPhase; uint8 ActiveCam; uint8 PositionCommandsValidity; uint8 RateCommandsValidity; uint8 CuedTargetDataValidity; uint8 Reserved1; uint8 Reserved2; real32 AzimuthPositionCommand; real32 ElevationPositionCommand; int16 AzimuthRateCommand; int16 ElevationRateCommand; int16 FSMAzimuthRateCommand; int16 FSMElevationRateCommand; real32 CuedPointTargetRangeCommand; real32 CuedPointTargetBearingCommand; real32 CuedPointTargetElevationCommand; real32 CuedTargetVelocityX; real32 CuedTargetVelocityY; real32 CuedTargetVelocityZ; }System; struct { uint8 TrackOffsetStatus; uint8 FOVStatus; uint16 Reserved; }IRCam; struct { uint8 TrackOffsetStatus; uint8 FOVStatus; uint16 Reserved; }NIRCam; SYS_SLM_MsgStruct() { memset(this, 0, sizeof(*this)); } }; struct SYS_SLM_InitMsgStruct { real64 AzimuthResolverOffset; real64 ElevationResolverOffset; real64 AzimuthTachometerOffset; real64 ElevationTachometerOffset; real64 TTSInstallationAnglesRoll; real64 TTSInstallationAnglesPitch; real64 TTSInstallationAnglesYaw; real64 BearingCorrection; real64 ElevationCorrection; real64 TiltRoll; real64 TiltPitch; real64 ParallaxX; real64 ParallaxY; real64 ParallaxZ; SYS_SLM_InitMsgStruct() { memset(this, 0, sizeof(*this)); } }; typedef struct ti_sysbios_knl_Clock_Module_State ti_sysbios_knl_Clock_Module_State; typedef struct ti_sysbios_knl_Clock_Params ti_sysbios_knl_Clock_Params; typedef struct ti_sysbios_knl_Clock_Object ti_sysbios_knl_Clock_Object; typedef struct ti_sysbios_knl_Clock_Struct ti_sysbios_knl_Clock_Struct; typedef ti_sysbios_knl_Clock_Object* ti_sysbios_knl_Clock_Handle; typedef struct ti_sysbios_knl_Clock_Object__ ti_sysbios_knl_Clock_Instance_State; typedef ti_sysbios_knl_Clock_Object* ti_sysbios_knl_Clock_Instance; typedef struct ti_sysbios_knl_Intrinsics_Fxns__ ti_sysbios_knl_Intrinsics_Fxns__; typedef const ti_sysbios_knl_Intrinsics_Fxns__* ti_sysbios_knl_Intrinsics_Module; typedef struct ti_sysbios_knl_Event_PendElem ti_sysbios_knl_Event_PendElem; typedef struct ti_sysbios_knl_Event_Params ti_sysbios_knl_Event_Params; typedef struct ti_sysbios_knl_Event_Object ti_sysbios_knl_Event_Object; typedef struct ti_sysbios_knl_Event_Struct ti_sysbios_knl_Event_Struct; typedef ti_sysbios_knl_Event_Object* ti_sysbios_knl_Event_Handle; typedef struct ti_sysbios_knl_Event_Object__ ti_sysbios_knl_Event_Instance_State; typedef ti_sysbios_knl_Event_Object* ti_sysbios_knl_Event_Instance; typedef struct ti_sysbios_knl_Mailbox_MbxElem ti_sysbios_knl_Mailbox_MbxElem; typedef struct ti_sysbios_knl_Mailbox_Params ti_sysbios_knl_Mailbox_Params; typedef struct ti_sysbios_knl_Mailbox_Object ti_sysbios_knl_Mailbox_Object; typedef struct ti_sysbios_knl_Mailbox_Struct ti_sysbios_knl_Mailbox_Struct; typedef ti_sysbios_knl_Mailbox_Object* ti_sysbios_knl_Mailbox_Handle; typedef struct ti_sysbios_knl_Mailbox_Object__ ti_sysbios_knl_Mailbox_Instance_State; typedef ti_sysbios_knl_Mailbox_Object* ti_sysbios_knl_Mailbox_Instance; typedef struct ti_sysbios_knl_Queue_Elem ti_sysbios_knl_Queue_Elem; typedef struct ti_sysbios_knl_Queue_Params ti_sysbios_knl_Queue_Params; typedef struct ti_sysbios_knl_Queue_Object ti_sysbios_knl_Queue_Object; typedef struct ti_sysbios_knl_Queue_Struct ti_sysbios_knl_Queue_Struct; typedef ti_sysbios_knl_Queue_Object* ti_sysbios_knl_Queue_Handle; typedef struct ti_sysbios_knl_Queue_Object__ ti_sysbios_knl_Queue_Instance_State; typedef ti_sysbios_knl_Queue_Object* ti_sysbios_knl_Queue_Instance; typedef struct ti_sysbios_knl_Semaphore_PendElem ti_sysbios_knl_Semaphore_PendElem; typedef struct ti_sysbios_knl_Semaphore_Params ti_sysbios_knl_Semaphore_Params; typedef struct ti_sysbios_knl_Semaphore_Object ti_sysbios_knl_Semaphore_Object; typedef struct ti_sysbios_knl_Semaphore_Struct ti_sysbios_knl_Semaphore_Struct; typedef ti_sysbios_knl_Semaphore_Object* ti_sysbios_knl_Semaphore_Handle; typedef struct ti_sysbios_knl_Semaphore_Object__ ti_sysbios_knl_Semaphore_Instance_State; typedef ti_sysbios_knl_Semaphore_Object* ti_sysbios_knl_Semaphore_Instance; typedef struct ti_sysbios_knl_Swi_HookSet ti_sysbios_knl_Swi_HookSet; typedef struct ti_sysbios_knl_Swi_Module_State ti_sysbios_knl_Swi_Module_State; typedef struct ti_sysbios_knl_Swi_Params ti_sysbios_knl_Swi_Params; typedef struct ti_sysbios_knl_Swi_Object ti_sysbios_knl_Swi_Object; typedef struct ti_sysbios_knl_Swi_Struct ti_sysbios_knl_Swi_Struct; typedef ti_sysbios_knl_Swi_Object* ti_sysbios_knl_Swi_Handle; typedef struct ti_sysbios_knl_Swi_Object__ ti_sysbios_knl_Swi_Instance_State; typedef ti_sysbios_knl_Swi_Object* ti_sysbios_knl_Swi_Instance; typedef struct ti_sysbios_knl_Task_Stat ti_sysbios_knl_Task_Stat; typedef struct ti_sysbios_knl_Task_HookSet ti_sysbios_knl_Task_HookSet; typedef struct ti_sysbios_knl_Task_PendElem ti_sysbios_knl_Task_PendElem; typedef struct ti_sysbios_knl_Task_Module_State ti_sysbios_knl_Task_Module_State; typedef struct ti_sysbios_knl_Task_RunQEntry ti_sysbios_knl_Task_RunQEntry; typedef struct ti_sysbios_knl_Task_Module_StateSmp ti_sysbios_knl_Task_Module_StateSmp; typedef struct ti_sysbios_knl_Task_Params ti_sysbios_knl_Task_Params; typedef struct ti_sysbios_knl_Task_Object ti_sysbios_knl_Task_Object; typedef struct ti_sysbios_knl_Task_Struct ti_sysbios_knl_Task_Struct; typedef ti_sysbios_knl_Task_Object* ti_sysbios_knl_Task_Handle; typedef struct ti_sysbios_knl_Task_Object__ ti_sysbios_knl_Task_Instance_State; typedef ti_sysbios_knl_Task_Object* ti_sysbios_knl_Task_Instance; typedef struct ti_sysbios_knl_Clock_TimerProxy_Fxns__ ti_sysbios_knl_Clock_TimerProxy_Fxns__; typedef const ti_sysbios_knl_Clock_TimerProxy_Fxns__* ti_sysbios_knl_Clock_TimerProxy_Module; typedef struct ti_sysbios_knl_Clock_TimerProxy_Params ti_sysbios_knl_Clock_TimerProxy_Params; typedef struct ti_sysbios_interfaces_ITimer___Object *ti_sysbios_knl_Clock_TimerProxy_Handle; typedef struct ti_sysbios_knl_Intrinsics_SupportProxy_Fxns__ ti_sysbios_knl_Intrinsics_SupportProxy_Fxns__; typedef const ti_sysbios_knl_Intrinsics_SupportProxy_Fxns__* ti_sysbios_knl_Intrinsics_SupportProxy_Module; typedef struct ti_sysbios_knl_Task_SupportProxy_Fxns__ ti_sysbios_knl_Task_SupportProxy_Fxns__; typedef const ti_sysbios_knl_Task_SupportProxy_Fxns__* ti_sysbios_knl_Task_SupportProxy_Module; typedef xdc_Bits32 xdc_runtime_Log_Event; typedef xdc_runtime_Types_CordAddr xdc_runtime_Text_CordAddr; typedef xdc_runtime_Types_Label xdc_runtime_Text_Label; typedef xdc_runtime_Types_RopeId xdc_runtime_Text_RopeId; struct xdc_runtime_Text_Node { xdc_runtime_Types_RopeId left; xdc_runtime_Types_RopeId right; }; typedef xdc_Bool (*xdc_runtime_Text_RopeVisitor)(xdc_Ptr, xdc_String); struct xdc_runtime_Text_MatchVisState { xdc_CString pat; xdc_Int *lenp; xdc_Int res; }; struct xdc_runtime_Text_PrintVisState { xdc_Char **bufp; xdc_Int len; xdc_Int res; }; typedef void (*xdc_runtime_Text_VisitRopeFxn)(xdc_runtime_Text_RopeId, xdc_Fxn, xdc_Ptr); typedef void (*xdc_runtime_Text_VisitRopeFxn2)(xdc_runtime_Text_RopeId, xdc_Fxn, xdc_Ptr, xdc_String[]); typedef xdc_Bits32 CT__xdc_runtime_Text_Module__diagsEnabled; extern "C" far const CT__xdc_runtime_Text_Module__diagsEnabled xdc_runtime_Text_Module__diagsEnabled__C; typedef xdc_Bits32 CT__xdc_runtime_Text_Module__diagsIncluded; extern "C" far const CT__xdc_runtime_Text_Module__diagsIncluded xdc_runtime_Text_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__xdc_runtime_Text_Module__diagsMask; extern "C" far const CT__xdc_runtime_Text_Module__diagsMask xdc_runtime_Text_Module__diagsMask__C; typedef xdc_Ptr CT__xdc_runtime_Text_Module__gateObj; extern "C" far const CT__xdc_runtime_Text_Module__gateObj xdc_runtime_Text_Module__gateObj__C; typedef xdc_Ptr CT__xdc_runtime_Text_Module__gatePrms; extern "C" far const CT__xdc_runtime_Text_Module__gatePrms xdc_runtime_Text_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__xdc_runtime_Text_Module__id; extern "C" far const CT__xdc_runtime_Text_Module__id xdc_runtime_Text_Module__id__C; typedef xdc_Bool CT__xdc_runtime_Text_Module__loggerDefined; extern "C" far const CT__xdc_runtime_Text_Module__loggerDefined xdc_runtime_Text_Module__loggerDefined__C; typedef xdc_Ptr CT__xdc_runtime_Text_Module__loggerObj; extern "C" far const CT__xdc_runtime_Text_Module__loggerObj xdc_runtime_Text_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__xdc_runtime_Text_Module__loggerFxn0; extern "C" far const CT__xdc_runtime_Text_Module__loggerFxn0 xdc_runtime_Text_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__xdc_runtime_Text_Module__loggerFxn1; extern "C" far const CT__xdc_runtime_Text_Module__loggerFxn1 xdc_runtime_Text_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__xdc_runtime_Text_Module__loggerFxn2; extern "C" far const CT__xdc_runtime_Text_Module__loggerFxn2 xdc_runtime_Text_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__xdc_runtime_Text_Module__loggerFxn4; extern "C" far const CT__xdc_runtime_Text_Module__loggerFxn4 xdc_runtime_Text_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__xdc_runtime_Text_Module__loggerFxn8; extern "C" far const CT__xdc_runtime_Text_Module__loggerFxn8 xdc_runtime_Text_Module__loggerFxn8__C; typedef xdc_Bool (*CT__xdc_runtime_Text_Module__startupDoneFxn)(void); extern "C" far const CT__xdc_runtime_Text_Module__startupDoneFxn xdc_runtime_Text_Module__startupDoneFxn__C; typedef xdc_Int CT__xdc_runtime_Text_Object__count; extern "C" far const CT__xdc_runtime_Text_Object__count xdc_runtime_Text_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_Text_Object__heap; extern "C" far const CT__xdc_runtime_Text_Object__heap xdc_runtime_Text_Object__heap__C; typedef xdc_SizeT CT__xdc_runtime_Text_Object__sizeof; extern "C" far const CT__xdc_runtime_Text_Object__sizeof xdc_runtime_Text_Object__sizeof__C; typedef xdc_Ptr CT__xdc_runtime_Text_Object__table; extern "C" far const CT__xdc_runtime_Text_Object__table xdc_runtime_Text_Object__table__C; typedef xdc_String CT__xdc_runtime_Text_nameUnknown; extern "C" far const CT__xdc_runtime_Text_nameUnknown xdc_runtime_Text_nameUnknown__C; typedef xdc_String CT__xdc_runtime_Text_nameEmpty; extern "C" far const CT__xdc_runtime_Text_nameEmpty xdc_runtime_Text_nameEmpty__C; typedef xdc_String CT__xdc_runtime_Text_nameStatic; extern "C" far const CT__xdc_runtime_Text_nameStatic xdc_runtime_Text_nameStatic__C; typedef xdc_Bool CT__xdc_runtime_Text_isLoaded; extern "C" far const CT__xdc_runtime_Text_isLoaded xdc_runtime_Text_isLoaded__C; typedef xdc_Char __T1_xdc_runtime_Text_charTab; typedef xdc_Char *__ARRAY1_xdc_runtime_Text_charTab; typedef __ARRAY1_xdc_runtime_Text_charTab __TA_xdc_runtime_Text_charTab; typedef __TA_xdc_runtime_Text_charTab CT__xdc_runtime_Text_charTab; extern "C" far const CT__xdc_runtime_Text_charTab xdc_runtime_Text_charTab__C; typedef xdc_runtime_Text_Node __T1_xdc_runtime_Text_nodeTab; typedef xdc_runtime_Text_Node *__ARRAY1_xdc_runtime_Text_nodeTab; typedef __ARRAY1_xdc_runtime_Text_nodeTab __TA_xdc_runtime_Text_nodeTab; typedef __TA_xdc_runtime_Text_nodeTab CT__xdc_runtime_Text_nodeTab; extern "C" far const CT__xdc_runtime_Text_nodeTab xdc_runtime_Text_nodeTab__C; typedef xdc_Int16 CT__xdc_runtime_Text_charCnt; extern "C" far const CT__xdc_runtime_Text_charCnt xdc_runtime_Text_charCnt__C; typedef xdc_Int16 CT__xdc_runtime_Text_nodeCnt; extern "C" far const CT__xdc_runtime_Text_nodeCnt xdc_runtime_Text_nodeCnt__C; typedef xdc_UInt16 CT__xdc_runtime_Text_unnamedModsLastId; extern "C" far const CT__xdc_runtime_Text_unnamedModsLastId xdc_runtime_Text_unnamedModsLastId__C; typedef xdc_UInt16 CT__xdc_runtime_Text_registryModsLastId; extern "C" far const CT__xdc_runtime_Text_registryModsLastId xdc_runtime_Text_registryModsLastId__C; typedef xdc_runtime_Text_VisitRopeFxn CT__xdc_runtime_Text_visitRopeFxn; extern "C" far const CT__xdc_runtime_Text_visitRopeFxn xdc_runtime_Text_visitRopeFxn__C; typedef xdc_runtime_Text_VisitRopeFxn2 CT__xdc_runtime_Text_visitRopeFxn2; extern "C" far const CT__xdc_runtime_Text_visitRopeFxn2 xdc_runtime_Text_visitRopeFxn2__C; extern "C" xdc_Bool xdc_runtime_Text_Module__startupDone__S( void ); extern "C" xdc_String xdc_runtime_Text_cordText__E( xdc_runtime_Text_CordAddr cord ); extern "C" xdc_String xdc_runtime_Text_ropeText__E( xdc_runtime_Text_RopeId rope ); extern "C" xdc_Int xdc_runtime_Text_matchRope__E( xdc_runtime_Text_RopeId rope, xdc_CString pat, xdc_Int *lenp ); extern "C" xdc_Int xdc_runtime_Text_putLab__E( xdc_runtime_Types_Label *lab, xdc_Char **bufp, xdc_Int len ); extern "C" xdc_Int xdc_runtime_Text_putMod__E( xdc_runtime_Types_ModuleId mid, xdc_Char **bufp, xdc_Int len ); extern "C" xdc_Int xdc_runtime_Text_putSite__E( xdc_runtime_Types_Site *site, xdc_Char **bufp, xdc_Int len ); extern "C" xdc_Bool xdc_runtime_Text_matchVisFxn__I( xdc_Ptr p, xdc_CString s ); extern "C" xdc_Bool xdc_runtime_Text_printVisFxn__I( xdc_Ptr p, xdc_CString s ); extern "C" void xdc_runtime_Text_visitRope__I( xdc_runtime_Text_RopeId rope, xdc_Fxn visFxn, xdc_Ptr visState ); extern "C" void xdc_runtime_Text_visitRope2__I( xdc_runtime_Text_RopeId rope, xdc_Fxn visFxn, xdc_Ptr visState, xdc_String stack[] ); extern "C" xdc_Int xdc_runtime_Text_xprintf__I( xdc_Char **bufp, xdc_SizeT len, xdc_CString fmt, ... ); static inline CT__xdc_runtime_Text_Module__id xdc_runtime_Text_Module_id( void ) { return xdc_runtime_Text_Module__id__C; } static inline xdc_Bool xdc_runtime_Text_Module_hasMask( void ) { return (xdc_Bool)(xdc_runtime_Text_Module__diagsMask__C != 0); } static inline xdc_Bits16 xdc_runtime_Text_Module_getMask( void ) { return xdc_runtime_Text_Module__diagsMask__C != 0 ? *xdc_runtime_Text_Module__diagsMask__C : (xdc_Bits16)0; } static inline void xdc_runtime_Text_Module_setMask( xdc_Bits16 mask ) { if (xdc_runtime_Text_Module__diagsMask__C != 0) { *xdc_runtime_Text_Module__diagsMask__C = mask; } } typedef xdc_IArg __T1_xdc_runtime_Log_EventRec__arg; typedef xdc_IArg __ARRAY1_xdc_runtime_Log_EventRec__arg[8]; typedef __ARRAY1_xdc_runtime_Log_EventRec__arg __TA_xdc_runtime_Log_EventRec__arg; struct xdc_runtime_Log_EventRec { xdc_runtime_Types_Timestamp64 tstamp; xdc_Bits32 serial; xdc_runtime_Types_Event evt; __TA_xdc_runtime_Log_EventRec__arg arg; }; typedef xdc_runtime_Types_RopeId xdc_runtime_Log_EventId; typedef xdc_Bits32 CT__xdc_runtime_Log_Module__diagsEnabled; extern "C" far const CT__xdc_runtime_Log_Module__diagsEnabled xdc_runtime_Log_Module__diagsEnabled__C; typedef xdc_Bits32 CT__xdc_runtime_Log_Module__diagsIncluded; extern "C" far const CT__xdc_runtime_Log_Module__diagsIncluded xdc_runtime_Log_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__xdc_runtime_Log_Module__diagsMask; extern "C" far const CT__xdc_runtime_Log_Module__diagsMask xdc_runtime_Log_Module__diagsMask__C; typedef xdc_Ptr CT__xdc_runtime_Log_Module__gateObj; extern "C" far const CT__xdc_runtime_Log_Module__gateObj xdc_runtime_Log_Module__gateObj__C; typedef xdc_Ptr CT__xdc_runtime_Log_Module__gatePrms; extern "C" far const CT__xdc_runtime_Log_Module__gatePrms xdc_runtime_Log_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__xdc_runtime_Log_Module__id; extern "C" far const CT__xdc_runtime_Log_Module__id xdc_runtime_Log_Module__id__C; typedef xdc_Bool CT__xdc_runtime_Log_Module__loggerDefined; extern "C" far const CT__xdc_runtime_Log_Module__loggerDefined xdc_runtime_Log_Module__loggerDefined__C; typedef xdc_Ptr CT__xdc_runtime_Log_Module__loggerObj; extern "C" far const CT__xdc_runtime_Log_Module__loggerObj xdc_runtime_Log_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__xdc_runtime_Log_Module__loggerFxn0; extern "C" far const CT__xdc_runtime_Log_Module__loggerFxn0 xdc_runtime_Log_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__xdc_runtime_Log_Module__loggerFxn1; extern "C" far const CT__xdc_runtime_Log_Module__loggerFxn1 xdc_runtime_Log_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__xdc_runtime_Log_Module__loggerFxn2; extern "C" far const CT__xdc_runtime_Log_Module__loggerFxn2 xdc_runtime_Log_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__xdc_runtime_Log_Module__loggerFxn4; extern "C" far const CT__xdc_runtime_Log_Module__loggerFxn4 xdc_runtime_Log_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__xdc_runtime_Log_Module__loggerFxn8; extern "C" far const CT__xdc_runtime_Log_Module__loggerFxn8 xdc_runtime_Log_Module__loggerFxn8__C; typedef xdc_Bool (*CT__xdc_runtime_Log_Module__startupDoneFxn)(void); extern "C" far const CT__xdc_runtime_Log_Module__startupDoneFxn xdc_runtime_Log_Module__startupDoneFxn__C; typedef xdc_Int CT__xdc_runtime_Log_Object__count; extern "C" far const CT__xdc_runtime_Log_Object__count xdc_runtime_Log_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_Log_Object__heap; extern "C" far const CT__xdc_runtime_Log_Object__heap xdc_runtime_Log_Object__heap__C; typedef xdc_SizeT CT__xdc_runtime_Log_Object__sizeof; extern "C" far const CT__xdc_runtime_Log_Object__sizeof xdc_runtime_Log_Object__sizeof__C; typedef xdc_Ptr CT__xdc_runtime_Log_Object__table; extern "C" far const CT__xdc_runtime_Log_Object__table xdc_runtime_Log_Object__table__C; typedef xdc_runtime_Log_Event CT__xdc_runtime_Log_L_construct; extern "C" far const CT__xdc_runtime_Log_L_construct xdc_runtime_Log_L_construct__C; typedef xdc_runtime_Log_Event CT__xdc_runtime_Log_L_create; extern "C" far const CT__xdc_runtime_Log_L_create xdc_runtime_Log_L_create__C; typedef xdc_runtime_Log_Event CT__xdc_runtime_Log_L_destruct; extern "C" far const CT__xdc_runtime_Log_L_destruct xdc_runtime_Log_L_destruct__C; typedef xdc_runtime_Log_Event CT__xdc_runtime_Log_L_delete; extern "C" far const CT__xdc_runtime_Log_L_delete xdc_runtime_Log_L_delete__C; typedef xdc_runtime_Log_Event CT__xdc_runtime_Log_L_error; extern "C" far const CT__xdc_runtime_Log_L_error xdc_runtime_Log_L_error__C; typedef xdc_runtime_Log_Event CT__xdc_runtime_Log_L_warning; extern "C" far const CT__xdc_runtime_Log_L_warning xdc_runtime_Log_L_warning__C; typedef xdc_runtime_Log_Event CT__xdc_runtime_Log_L_info; extern "C" far const CT__xdc_runtime_Log_L_info xdc_runtime_Log_L_info__C; typedef xdc_runtime_Log_Event CT__xdc_runtime_Log_L_start; extern "C" far const CT__xdc_runtime_Log_L_start xdc_runtime_Log_L_start__C; typedef xdc_runtime_Log_Event CT__xdc_runtime_Log_L_stop; extern "C" far const CT__xdc_runtime_Log_L_stop xdc_runtime_Log_L_stop__C; typedef xdc_runtime_Log_Event CT__xdc_runtime_Log_L_startInstance; extern "C" far const CT__xdc_runtime_Log_L_startInstance xdc_runtime_Log_L_startInstance__C; typedef xdc_runtime_Log_Event CT__xdc_runtime_Log_L_stopInstance; extern "C" far const CT__xdc_runtime_Log_L_stopInstance xdc_runtime_Log_L_stopInstance__C; extern "C" xdc_Bool xdc_runtime_Log_Module__startupDone__S( void ); extern "C" void xdc_runtime_Log_doPrint__E( xdc_runtime_Log_EventRec *evRec ); static inline CT__xdc_runtime_Log_Module__id xdc_runtime_Log_Module_id( void ) { return xdc_runtime_Log_Module__id__C; } static inline xdc_Bool xdc_runtime_Log_Module_hasMask( void ) { return (xdc_Bool)(xdc_runtime_Log_Module__diagsMask__C != 0); } static inline xdc_Bits16 xdc_runtime_Log_Module_getMask( void ) { return xdc_runtime_Log_Module__diagsMask__C != 0 ? *xdc_runtime_Log_Module__diagsMask__C : (xdc_Bits16)0; } static inline void xdc_runtime_Log_Module_setMask( xdc_Bits16 mask ) { if (xdc_runtime_Log_Module__diagsMask__C != 0) { *xdc_runtime_Log_Module__diagsMask__C = mask; } } struct ti_sysbios_knl_Queue_Elem { ti_sysbios_knl_Queue_Elem *volatile next; ti_sysbios_knl_Queue_Elem *volatile prev; }; typedef xdc_Bits32 CT__ti_sysbios_knl_Queue_Module__diagsEnabled; extern "C" far const CT__ti_sysbios_knl_Queue_Module__diagsEnabled ti_sysbios_knl_Queue_Module__diagsEnabled__C; typedef xdc_Bits32 CT__ti_sysbios_knl_Queue_Module__diagsIncluded; extern "C" far const CT__ti_sysbios_knl_Queue_Module__diagsIncluded ti_sysbios_knl_Queue_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__ti_sysbios_knl_Queue_Module__diagsMask; extern "C" far const CT__ti_sysbios_knl_Queue_Module__diagsMask ti_sysbios_knl_Queue_Module__diagsMask__C; typedef xdc_Ptr CT__ti_sysbios_knl_Queue_Module__gateObj; extern "C" far const CT__ti_sysbios_knl_Queue_Module__gateObj ti_sysbios_knl_Queue_Module__gateObj__C; typedef xdc_Ptr CT__ti_sysbios_knl_Queue_Module__gatePrms; extern "C" far const CT__ti_sysbios_knl_Queue_Module__gatePrms ti_sysbios_knl_Queue_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__ti_sysbios_knl_Queue_Module__id; extern "C" far const CT__ti_sysbios_knl_Queue_Module__id ti_sysbios_knl_Queue_Module__id__C; typedef xdc_Bool CT__ti_sysbios_knl_Queue_Module__loggerDefined; extern "C" far const CT__ti_sysbios_knl_Queue_Module__loggerDefined ti_sysbios_knl_Queue_Module__loggerDefined__C; typedef xdc_Ptr CT__ti_sysbios_knl_Queue_Module__loggerObj; extern "C" far const CT__ti_sysbios_knl_Queue_Module__loggerObj ti_sysbios_knl_Queue_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__ti_sysbios_knl_Queue_Module__loggerFxn0; extern "C" far const CT__ti_sysbios_knl_Queue_Module__loggerFxn0 ti_sysbios_knl_Queue_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__ti_sysbios_knl_Queue_Module__loggerFxn1; extern "C" far const CT__ti_sysbios_knl_Queue_Module__loggerFxn1 ti_sysbios_knl_Queue_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__ti_sysbios_knl_Queue_Module__loggerFxn2; extern "C" far const CT__ti_sysbios_knl_Queue_Module__loggerFxn2 ti_sysbios_knl_Queue_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__ti_sysbios_knl_Queue_Module__loggerFxn4; extern "C" far const CT__ti_sysbios_knl_Queue_Module__loggerFxn4 ti_sysbios_knl_Queue_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__ti_sysbios_knl_Queue_Module__loggerFxn8; extern "C" far const CT__ti_sysbios_knl_Queue_Module__loggerFxn8 ti_sysbios_knl_Queue_Module__loggerFxn8__C; typedef xdc_Bool (*CT__ti_sysbios_knl_Queue_Module__startupDoneFxn)(void); extern "C" far const CT__ti_sysbios_knl_Queue_Module__startupDoneFxn ti_sysbios_knl_Queue_Module__startupDoneFxn__C; typedef xdc_Int CT__ti_sysbios_knl_Queue_Object__count; extern "C" far const CT__ti_sysbios_knl_Queue_Object__count ti_sysbios_knl_Queue_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__ti_sysbios_knl_Queue_Object__heap; extern "C" far const CT__ti_sysbios_knl_Queue_Object__heap ti_sysbios_knl_Queue_Object__heap__C; typedef xdc_SizeT CT__ti_sysbios_knl_Queue_Object__sizeof; extern "C" far const CT__ti_sysbios_knl_Queue_Object__sizeof ti_sysbios_knl_Queue_Object__sizeof__C; typedef xdc_Ptr CT__ti_sysbios_knl_Queue_Object__table; extern "C" far const CT__ti_sysbios_knl_Queue_Object__table ti_sysbios_knl_Queue_Object__table__C; struct ti_sysbios_knl_Queue_Params { size_t __size; const void *__self; void *__fxns; xdc_runtime_IInstance_Params *instance; xdc_runtime_IInstance_Params __iprms; }; struct ti_sysbios_knl_Queue_Struct { ti_sysbios_knl_Queue_Elem __f0; xdc_runtime_Types_CordAddr __name; }; extern "C" void ti_sysbios_knl_Queue_Instance_init__E(ti_sysbios_knl_Queue_Object *, const ti_sysbios_knl_Queue_Params *); extern "C" xdc_runtime_Types_Label *ti_sysbios_knl_Queue_Handle__label__S( xdc_Ptr obj, xdc_runtime_Types_Label *lab ); extern "C" xdc_Bool ti_sysbios_knl_Queue_Module__startupDone__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Queue_Object__create__S( xdc_Ptr __oa, xdc_SizeT __osz, xdc_Ptr __aa, const xdc_UChar *__pa, xdc_SizeT __psz, xdc_runtime_Error_Block *__eb ); extern "C" ti_sysbios_knl_Queue_Handle ti_sysbios_knl_Queue_create( const ti_sysbios_knl_Queue_Params *__prms, xdc_runtime_Error_Block *__eb ); extern "C" void ti_sysbios_knl_Queue_construct( ti_sysbios_knl_Queue_Struct *__obj, const ti_sysbios_knl_Queue_Params *__prms ); extern "C" void ti_sysbios_knl_Queue_Object__delete__S( xdc_Ptr instp ); extern "C" void ti_sysbios_knl_Queue_delete(ti_sysbios_knl_Queue_Handle *instp); extern "C" void ti_sysbios_knl_Queue_Object__destruct__S( xdc_Ptr objp ); extern "C" void ti_sysbios_knl_Queue_destruct(ti_sysbios_knl_Queue_Struct *obj); extern "C" xdc_Ptr ti_sysbios_knl_Queue_Object__get__S( xdc_Ptr oarr, xdc_Int i ); extern "C" xdc_Ptr ti_sysbios_knl_Queue_Object__first__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Queue_Object__next__S( xdc_Ptr obj ); extern "C" void ti_sysbios_knl_Queue_Params__init__S( xdc_Ptr dst, const void *src, xdc_SizeT psz, xdc_SizeT isz ); extern "C" void ti_sysbios_knl_Queue_elemClear__E( ti_sysbios_knl_Queue_Elem *qelem ); extern "C" void ti_sysbios_knl_Queue_insert__E( ti_sysbios_knl_Queue_Elem *qelem, ti_sysbios_knl_Queue_Elem *elem ); extern "C" xdc_Ptr ti_sysbios_knl_Queue_next__E( ti_sysbios_knl_Queue_Elem *qelem ); extern "C" xdc_Ptr ti_sysbios_knl_Queue_prev__E( ti_sysbios_knl_Queue_Elem *qelem ); extern "C" void ti_sysbios_knl_Queue_remove__E( ti_sysbios_knl_Queue_Elem *qelem ); extern "C" xdc_Bool ti_sysbios_knl_Queue_isQueued__E( ti_sysbios_knl_Queue_Elem *qelem ); extern "C" xdc_Ptr ti_sysbios_knl_Queue_dequeue__E( ti_sysbios_knl_Queue_Handle __inst ); extern "C" xdc_Bool ti_sysbios_knl_Queue_empty__E( ti_sysbios_knl_Queue_Handle __inst ); extern "C" void ti_sysbios_knl_Queue_enqueue__E( ti_sysbios_knl_Queue_Handle __inst, ti_sysbios_knl_Queue_Elem *elem ); extern "C" xdc_Ptr ti_sysbios_knl_Queue_get__E( ti_sysbios_knl_Queue_Handle __inst ); extern "C" xdc_Ptr ti_sysbios_knl_Queue_getTail__E( ti_sysbios_knl_Queue_Handle __inst ); extern "C" xdc_Ptr ti_sysbios_knl_Queue_head__E( ti_sysbios_knl_Queue_Handle __inst ); extern "C" void ti_sysbios_knl_Queue_put__E( ti_sysbios_knl_Queue_Handle __inst, ti_sysbios_knl_Queue_Elem *elem ); extern "C" void ti_sysbios_knl_Queue_putHead__E( ti_sysbios_knl_Queue_Handle __inst, ti_sysbios_knl_Queue_Elem *elem ); static inline CT__ti_sysbios_knl_Queue_Module__id ti_sysbios_knl_Queue_Module_id( void ) { return ti_sysbios_knl_Queue_Module__id__C; } static inline xdc_Bool ti_sysbios_knl_Queue_Module_hasMask( void ) { return ti_sysbios_knl_Queue_Module__diagsMask__C != 0; } static inline xdc_Bits16 ti_sysbios_knl_Queue_Module_getMask( void ) { return ti_sysbios_knl_Queue_Module__diagsMask__C != 0 ? *ti_sysbios_knl_Queue_Module__diagsMask__C : 0; } static inline void ti_sysbios_knl_Queue_Module_setMask( xdc_Bits16 mask ) { if (ti_sysbios_knl_Queue_Module__diagsMask__C != 0) *ti_sysbios_knl_Queue_Module__diagsMask__C = mask; } static inline void ti_sysbios_knl_Queue_Params_init( ti_sysbios_knl_Queue_Params *prms ) { if (prms) { ti_sysbios_knl_Queue_Params__init__S(prms, 0, sizeof(ti_sysbios_knl_Queue_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline void ti_sysbios_knl_Queue_Params_copy(ti_sysbios_knl_Queue_Params *dst, const ti_sysbios_knl_Queue_Params *src) { if (dst) { ti_sysbios_knl_Queue_Params__init__S(dst, (const void *)src, sizeof(ti_sysbios_knl_Queue_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline ti_sysbios_knl_Queue_Handle ti_sysbios_knl_Queue_Object_get(ti_sysbios_knl_Queue_Instance_State *oarr, int i) { return (ti_sysbios_knl_Queue_Handle)ti_sysbios_knl_Queue_Object__get__S(oarr, i); } static inline ti_sysbios_knl_Queue_Handle ti_sysbios_knl_Queue_Object_first( void ) { return (ti_sysbios_knl_Queue_Handle)ti_sysbios_knl_Queue_Object__first__S(); } static inline ti_sysbios_knl_Queue_Handle ti_sysbios_knl_Queue_Object_next( ti_sysbios_knl_Queue_Object *obj ) { return (ti_sysbios_knl_Queue_Handle)ti_sysbios_knl_Queue_Object__next__S(obj); } static inline xdc_runtime_Types_Label *ti_sysbios_knl_Queue_Handle_label( ti_sysbios_knl_Queue_Handle inst, xdc_runtime_Types_Label *lab ) { return ti_sysbios_knl_Queue_Handle__label__S(inst, lab); } static inline xdc_String ti_sysbios_knl_Queue_Handle_name( ti_sysbios_knl_Queue_Handle inst ) { xdc_runtime_Types_Label lab; return ti_sysbios_knl_Queue_Handle__label__S(inst, &lab)->iname; } static inline ti_sysbios_knl_Queue_Handle ti_sysbios_knl_Queue_handle( ti_sysbios_knl_Queue_Struct *str ) { return (ti_sysbios_knl_Queue_Handle)str; } static inline ti_sysbios_knl_Queue_Struct *ti_sysbios_knl_Queue_struct( ti_sysbios_knl_Queue_Handle inst ) { return (ti_sysbios_knl_Queue_Struct*)inst; } typedef struct ti_sysbios_interfaces_ICore_Fxns__ ti_sysbios_interfaces_ICore_Fxns__; typedef const ti_sysbios_interfaces_ICore_Fxns__* ti_sysbios_interfaces_ICore_Module; typedef struct ti_sysbios_interfaces_IHwi_HookSet ti_sysbios_interfaces_IHwi_HookSet; typedef struct ti_sysbios_interfaces_IHwi_StackInfo ti_sysbios_interfaces_IHwi_StackInfo; typedef struct ti_sysbios_interfaces_IHwi_Fxns__ ti_sysbios_interfaces_IHwi_Fxns__; typedef const ti_sysbios_interfaces_IHwi_Fxns__* ti_sysbios_interfaces_IHwi_Module; typedef struct ti_sysbios_interfaces_IHwi_Params ti_sysbios_interfaces_IHwi_Params; typedef struct ti_sysbios_interfaces_IHwi___Object { ti_sysbios_interfaces_IHwi_Fxns__* __fxns; xdc_Bits32 __label; } *ti_sysbios_interfaces_IHwi_Handle; typedef struct ti_sysbios_interfaces_ITaskSupport_Fxns__ ti_sysbios_interfaces_ITaskSupport_Fxns__; typedef const ti_sysbios_interfaces_ITaskSupport_Fxns__* ti_sysbios_interfaces_ITaskSupport_Module; typedef struct ti_sysbios_interfaces_ITimer_Fxns__ ti_sysbios_interfaces_ITimer_Fxns__; typedef const ti_sysbios_interfaces_ITimer_Fxns__* ti_sysbios_interfaces_ITimer_Module; typedef struct ti_sysbios_interfaces_ITimer_Params ti_sysbios_interfaces_ITimer_Params; typedef struct ti_sysbios_interfaces_ITimer___Object { ti_sysbios_interfaces_ITimer_Fxns__* __fxns; xdc_Bits32 __label; } *ti_sysbios_interfaces_ITimer_Handle; typedef struct ti_sysbios_interfaces_ITimerSupport_Fxns__ ti_sysbios_interfaces_ITimerSupport_Fxns__; typedef const ti_sysbios_interfaces_ITimerSupport_Fxns__* ti_sysbios_interfaces_ITimerSupport_Module; typedef struct ti_sysbios_interfaces_ITimestamp_Fxns__ ti_sysbios_interfaces_ITimestamp_Fxns__; typedef const ti_sysbios_interfaces_ITimestamp_Fxns__* ti_sysbios_interfaces_ITimestamp_Module; typedef struct ti_sysbios_interfaces_IIntrinsicsSupport_Fxns__ ti_sysbios_interfaces_IIntrinsicsSupport_Fxns__; typedef const ti_sysbios_interfaces_IIntrinsicsSupport_Fxns__* ti_sysbios_interfaces_IIntrinsicsSupport_Module; typedef struct ti_sysbios_interfaces_ICache_Fxns__ ti_sysbios_interfaces_ICache_Fxns__; typedef const ti_sysbios_interfaces_ICache_Fxns__* ti_sysbios_interfaces_ICache_Module; typedef struct ti_sysbios_interfaces_IPower_Fxns__ ti_sysbios_interfaces_IPower_Fxns__; typedef const ti_sysbios_interfaces_IPower_Fxns__* ti_sysbios_interfaces_IPower_Module; typedef struct ti_sysbios_interfaces_IRomDevice_Fxns__ ti_sysbios_interfaces_IRomDevice_Fxns__; typedef const ti_sysbios_interfaces_IRomDevice_Fxns__* ti_sysbios_interfaces_IRomDevice_Module; typedef struct ti_sysbios_interfaces_ISeconds_Time ti_sysbios_interfaces_ISeconds_Time; typedef struct ti_sysbios_interfaces_ISeconds_Fxns__ ti_sysbios_interfaces_ISeconds_Fxns__; typedef const ti_sysbios_interfaces_ISeconds_Fxns__* ti_sysbios_interfaces_ISeconds_Module; typedef void (*ti_sysbios_interfaces_ITaskSupport_FuncPtr)(void); struct ti_sysbios_interfaces_ITaskSupport_Fxns__ { xdc_runtime_Types_Base* __base; const xdc_runtime_Types_SysFxns2 *__sysp; xdc_Ptr (*start)(xdc_Ptr, ti_sysbios_interfaces_ITaskSupport_FuncPtr, ti_sysbios_interfaces_ITaskSupport_FuncPtr, xdc_runtime_Error_Block*); void (*swap)(xdc_Ptr*, xdc_Ptr*); xdc_Bool (*checkStack)(xdc_Char*, xdc_SizeT); xdc_SizeT (*stackUsed)(xdc_Char*, xdc_SizeT); xdc_UInt (*getStackAlignment)(void); xdc_SizeT (*getDefaultStackSize)(void); xdc_Ptr (*getCheckValueAddr)(xdc_Ptr); xdc_runtime_Types_SysFxns2 __sfxns; }; extern "C" const xdc_runtime_Types_Base ti_sysbios_interfaces_ITaskSupport_Interface__BASE__C; static inline xdc_runtime_Types_ModuleId ti_sysbios_interfaces_ITaskSupport_Module_id( ti_sysbios_interfaces_ITaskSupport_Module mod ) { return mod->__sysp->__mid; } static inline xdc_Ptr ti_sysbios_interfaces_ITaskSupport_start( ti_sysbios_interfaces_ITaskSupport_Module __inst, xdc_Ptr curTask, ti_sysbios_interfaces_ITaskSupport_FuncPtr enter, ti_sysbios_interfaces_ITaskSupport_FuncPtr exit, xdc_runtime_Error_Block *eb ) { return __inst->start(curTask, enter, exit, eb); } static inline void ti_sysbios_interfaces_ITaskSupport_swap( ti_sysbios_interfaces_ITaskSupport_Module __inst, xdc_Ptr *oldtskContext, xdc_Ptr *newtskContext ) { __inst->swap(oldtskContext, newtskContext); } static inline xdc_Bool ti_sysbios_interfaces_ITaskSupport_checkStack( ti_sysbios_interfaces_ITaskSupport_Module __inst, xdc_Char *stack, xdc_SizeT size ) { return __inst->checkStack(stack, size); } static inline xdc_SizeT ti_sysbios_interfaces_ITaskSupport_stackUsed( ti_sysbios_interfaces_ITaskSupport_Module __inst, xdc_Char *stack, xdc_SizeT size ) { return __inst->stackUsed(stack, size); } static inline xdc_UInt ti_sysbios_interfaces_ITaskSupport_getStackAlignment( ti_sysbios_interfaces_ITaskSupport_Module __inst ) { return __inst->getStackAlignment(); } static inline xdc_SizeT ti_sysbios_interfaces_ITaskSupport_getDefaultStackSize( ti_sysbios_interfaces_ITaskSupport_Module __inst ) { return __inst->getDefaultStackSize(); } static inline xdc_Ptr ti_sysbios_interfaces_ITaskSupport_getCheckValueAddr( ti_sysbios_interfaces_ITaskSupport_Module __inst, xdc_Ptr curTask ) { return __inst->getCheckValueAddr(curTask); } typedef xdc_Ptr (*ti_sysbios_interfaces_ITaskSupport_start_FxnT)(xdc_Ptr, ti_sysbios_interfaces_ITaskSupport_FuncPtr, ti_sysbios_interfaces_ITaskSupport_FuncPtr, xdc_runtime_Error_Block*); static inline ti_sysbios_interfaces_ITaskSupport_start_FxnT ti_sysbios_interfaces_ITaskSupport_start_fxnP( ti_sysbios_interfaces_ITaskSupport_Module __inst ) { return (ti_sysbios_interfaces_ITaskSupport_start_FxnT)__inst->start; } typedef void (*ti_sysbios_interfaces_ITaskSupport_swap_FxnT)(xdc_Ptr*, xdc_Ptr*); static inline ti_sysbios_interfaces_ITaskSupport_swap_FxnT ti_sysbios_interfaces_ITaskSupport_swap_fxnP( ti_sysbios_interfaces_ITaskSupport_Module __inst ) { return (ti_sysbios_interfaces_ITaskSupport_swap_FxnT)__inst->swap; } typedef xdc_Bool (*ti_sysbios_interfaces_ITaskSupport_checkStack_FxnT)(xdc_Char*, xdc_SizeT); static inline ti_sysbios_interfaces_ITaskSupport_checkStack_FxnT ti_sysbios_interfaces_ITaskSupport_checkStack_fxnP( ti_sysbios_interfaces_ITaskSupport_Module __inst ) { return (ti_sysbios_interfaces_ITaskSupport_checkStack_FxnT)__inst->checkStack; } typedef xdc_SizeT (*ti_sysbios_interfaces_ITaskSupport_stackUsed_FxnT)(xdc_Char*, xdc_SizeT); static inline ti_sysbios_interfaces_ITaskSupport_stackUsed_FxnT ti_sysbios_interfaces_ITaskSupport_stackUsed_fxnP( ti_sysbios_interfaces_ITaskSupport_Module __inst ) { return (ti_sysbios_interfaces_ITaskSupport_stackUsed_FxnT)__inst->stackUsed; } typedef xdc_UInt (*ti_sysbios_interfaces_ITaskSupport_getStackAlignment_FxnT)(void); static inline ti_sysbios_interfaces_ITaskSupport_getStackAlignment_FxnT ti_sysbios_interfaces_ITaskSupport_getStackAlignment_fxnP( ti_sysbios_interfaces_ITaskSupport_Module __inst ) { return (ti_sysbios_interfaces_ITaskSupport_getStackAlignment_FxnT)__inst->getStackAlignment; } typedef xdc_SizeT (*ti_sysbios_interfaces_ITaskSupport_getDefaultStackSize_FxnT)(void); static inline ti_sysbios_interfaces_ITaskSupport_getDefaultStackSize_FxnT ti_sysbios_interfaces_ITaskSupport_getDefaultStackSize_fxnP( ti_sysbios_interfaces_ITaskSupport_Module __inst ) { return (ti_sysbios_interfaces_ITaskSupport_getDefaultStackSize_FxnT)__inst->getDefaultStackSize; } typedef xdc_Ptr (*ti_sysbios_interfaces_ITaskSupport_getCheckValueAddr_FxnT)(xdc_Ptr); static inline ti_sysbios_interfaces_ITaskSupport_getCheckValueAddr_FxnT ti_sysbios_interfaces_ITaskSupport_getCheckValueAddr_fxnP( ti_sysbios_interfaces_ITaskSupport_Module __inst ) { return (ti_sysbios_interfaces_ITaskSupport_getCheckValueAddr_FxnT)__inst->getCheckValueAddr; } typedef void (*ti_sysbios_interfaces_ITimer_FuncPtr)(xdc_UArg); enum ti_sysbios_interfaces_ITimer_StartMode { ti_sysbios_interfaces_ITimer_StartMode_AUTO, ti_sysbios_interfaces_ITimer_StartMode_USER }; typedef enum ti_sysbios_interfaces_ITimer_StartMode ti_sysbios_interfaces_ITimer_StartMode; enum ti_sysbios_interfaces_ITimer_RunMode { ti_sysbios_interfaces_ITimer_RunMode_CONTINUOUS, ti_sysbios_interfaces_ITimer_RunMode_ONESHOT, ti_sysbios_interfaces_ITimer_RunMode_DYNAMIC }; typedef enum ti_sysbios_interfaces_ITimer_RunMode ti_sysbios_interfaces_ITimer_RunMode; enum ti_sysbios_interfaces_ITimer_Status { ti_sysbios_interfaces_ITimer_Status_INUSE, ti_sysbios_interfaces_ITimer_Status_FREE }; typedef enum ti_sysbios_interfaces_ITimer_Status ti_sysbios_interfaces_ITimer_Status; enum ti_sysbios_interfaces_ITimer_PeriodType { ti_sysbios_interfaces_ITimer_PeriodType_MICROSECS, ti_sysbios_interfaces_ITimer_PeriodType_COUNTS }; typedef enum ti_sysbios_interfaces_ITimer_PeriodType ti_sysbios_interfaces_ITimer_PeriodType; typedef struct ti_sysbios_interfaces_ITimer_Args__create { xdc_Int id; ti_sysbios_interfaces_ITimer_FuncPtr tickFxn; } ti_sysbios_interfaces_ITimer_Args__create; struct ti_sysbios_interfaces_ITimer_Params { size_t __size; const void *__self; void *__fxns; xdc_runtime_IInstance_Params *instance; ti_sysbios_interfaces_ITimer_RunMode runMode; ti_sysbios_interfaces_ITimer_StartMode startMode; xdc_UArg arg; xdc_UInt32 period; ti_sysbios_interfaces_ITimer_PeriodType periodType; xdc_runtime_Types_FreqHz extFreq; }; struct ti_sysbios_interfaces_ITimer_Fxns__ { xdc_runtime_Types_Base* __base; const xdc_runtime_Types_SysFxns2 *__sysp; xdc_UInt (*getNumTimers)(void); ti_sysbios_interfaces_ITimer_Status (*getStatus)(xdc_UInt); void (*startup)(void); xdc_UInt32 (*getMaxTicks)(void*); void (*setNextTick)(void*, xdc_UInt32); void (*start)(void*); void (*stop)(void*); void (*setPeriod)(void*, xdc_UInt32); xdc_Bool (*setPeriodMicroSecs)(void*, xdc_UInt32); xdc_UInt32 (*getPeriod)(void*); xdc_UInt32 (*getCount)(void*); void (*getFreq)(void*, xdc_runtime_Types_FreqHz*); ti_sysbios_interfaces_ITimer_FuncPtr (*getFunc)(void*, xdc_UArg*); void (*setFunc)(void*, ti_sysbios_interfaces_ITimer_FuncPtr, xdc_UArg); void (*trigger)(void*, xdc_UInt32); xdc_UInt32 (*getExpiredCounts)(void*); xdc_UInt32 (*getExpiredTicks)(void*, xdc_UInt32); xdc_UInt32 (*getCurrentTick)(void*, xdc_Bool); xdc_runtime_Types_SysFxns2 __sfxns; }; extern "C" const xdc_runtime_Types_Base ti_sysbios_interfaces_ITimer_Interface__BASE__C; extern "C" ti_sysbios_interfaces_ITimer_Handle ti_sysbios_interfaces_ITimer_create(ti_sysbios_interfaces_ITimer_Module, xdc_Int id, ti_sysbios_interfaces_ITimer_FuncPtr tickFxn, const ti_sysbios_interfaces_ITimer_Params *, xdc_runtime_Error_Block *__eb); extern "C" void ti_sysbios_interfaces_ITimer_delete(ti_sysbios_interfaces_ITimer_Handle *); static inline ti_sysbios_interfaces_ITimer_Module ti_sysbios_interfaces_ITimer_Handle_to_Module( ti_sysbios_interfaces_ITimer_Handle inst ) { return inst->__fxns; } static inline xdc_runtime_Types_Label *ti_sysbios_interfaces_ITimer_Handle_label( ti_sysbios_interfaces_ITimer_Handle inst, xdc_runtime_Types_Label *lab ) { return inst->__fxns->__sysp->__label(inst, lab); } static inline xdc_runtime_Types_ModuleId ti_sysbios_interfaces_ITimer_Module_id( ti_sysbios_interfaces_ITimer_Module mod ) { return mod->__sysp->__mid; } static inline xdc_UInt ti_sysbios_interfaces_ITimer_getNumTimers( ti_sysbios_interfaces_ITimer_Module __inst ) { return __inst->getNumTimers(); } static inline ti_sysbios_interfaces_ITimer_Status ti_sysbios_interfaces_ITimer_getStatus( ti_sysbios_interfaces_ITimer_Module __inst, xdc_UInt id ) { return __inst->getStatus(id); } static inline void ti_sysbios_interfaces_ITimer_startup( ti_sysbios_interfaces_ITimer_Module __inst ) { __inst->startup(); } static inline xdc_UInt32 ti_sysbios_interfaces_ITimer_getMaxTicks( ti_sysbios_interfaces_ITimer_Handle __inst ) { return __inst->__fxns->getMaxTicks((void*)__inst); } static inline void ti_sysbios_interfaces_ITimer_setNextTick( ti_sysbios_interfaces_ITimer_Handle __inst, xdc_UInt32 ticks ) { __inst->__fxns->setNextTick((void*)__inst, ticks); } static inline void ti_sysbios_interfaces_ITimer_start( ti_sysbios_interfaces_ITimer_Handle __inst ) { __inst->__fxns->start((void*)__inst); } static inline void ti_sysbios_interfaces_ITimer_stop( ti_sysbios_interfaces_ITimer_Handle __inst ) { __inst->__fxns->stop((void*)__inst); } static inline void ti_sysbios_interfaces_ITimer_setPeriod( ti_sysbios_interfaces_ITimer_Handle __inst, xdc_UInt32 period ) { __inst->__fxns->setPeriod((void*)__inst, period); } static inline xdc_Bool ti_sysbios_interfaces_ITimer_setPeriodMicroSecs( ti_sysbios_interfaces_ITimer_Handle __inst, xdc_UInt32 microsecs ) { return __inst->__fxns->setPeriodMicroSecs((void*)__inst, microsecs); } static inline xdc_UInt32 ti_sysbios_interfaces_ITimer_getPeriod( ti_sysbios_interfaces_ITimer_Handle __inst ) { return __inst->__fxns->getPeriod((void*)__inst); } static inline xdc_UInt32 ti_sysbios_interfaces_ITimer_getCount( ti_sysbios_interfaces_ITimer_Handle __inst ) { return __inst->__fxns->getCount((void*)__inst); } static inline void ti_sysbios_interfaces_ITimer_getFreq( ti_sysbios_interfaces_ITimer_Handle __inst, xdc_runtime_Types_FreqHz *freq ) { __inst->__fxns->getFreq((void*)__inst, freq); } static inline ti_sysbios_interfaces_ITimer_FuncPtr ti_sysbios_interfaces_ITimer_getFunc( ti_sysbios_interfaces_ITimer_Handle __inst, xdc_UArg *arg ) { return __inst->__fxns->getFunc((void*)__inst, arg); } static inline void ti_sysbios_interfaces_ITimer_setFunc( ti_sysbios_interfaces_ITimer_Handle __inst, ti_sysbios_interfaces_ITimer_FuncPtr fxn, xdc_UArg arg ) { __inst->__fxns->setFunc((void*)__inst, fxn, arg); } static inline void ti_sysbios_interfaces_ITimer_trigger( ti_sysbios_interfaces_ITimer_Handle __inst, xdc_UInt32 cycles ) { __inst->__fxns->trigger((void*)__inst, cycles); } static inline xdc_UInt32 ti_sysbios_interfaces_ITimer_getExpiredCounts( ti_sysbios_interfaces_ITimer_Handle __inst ) { return __inst->__fxns->getExpiredCounts((void*)__inst); } static inline xdc_UInt32 ti_sysbios_interfaces_ITimer_getExpiredTicks( ti_sysbios_interfaces_ITimer_Handle __inst, xdc_UInt32 tickPeriod ) { return __inst->__fxns->getExpiredTicks((void*)__inst, tickPeriod); } static inline xdc_UInt32 ti_sysbios_interfaces_ITimer_getCurrentTick( ti_sysbios_interfaces_ITimer_Handle __inst, xdc_Bool save ) { return __inst->__fxns->getCurrentTick((void*)__inst, save); } typedef xdc_UInt (*ti_sysbios_interfaces_ITimer_getNumTimers_FxnT)(void); static inline ti_sysbios_interfaces_ITimer_getNumTimers_FxnT ti_sysbios_interfaces_ITimer_getNumTimers_fxnP( ti_sysbios_interfaces_ITimer_Module __inst ) { return (ti_sysbios_interfaces_ITimer_getNumTimers_FxnT)__inst->getNumTimers; } typedef ti_sysbios_interfaces_ITimer_Status (*ti_sysbios_interfaces_ITimer_getStatus_FxnT)(xdc_UInt); static inline ti_sysbios_interfaces_ITimer_getStatus_FxnT ti_sysbios_interfaces_ITimer_getStatus_fxnP( ti_sysbios_interfaces_ITimer_Module __inst ) { return (ti_sysbios_interfaces_ITimer_getStatus_FxnT)__inst->getStatus; } typedef void (*ti_sysbios_interfaces_ITimer_startup_FxnT)(void); static inline ti_sysbios_interfaces_ITimer_startup_FxnT ti_sysbios_interfaces_ITimer_startup_fxnP( ti_sysbios_interfaces_ITimer_Module __inst ) { return (ti_sysbios_interfaces_ITimer_startup_FxnT)__inst->startup; } typedef xdc_UInt32 (*ti_sysbios_interfaces_ITimer_getMaxTicks_FxnT)(void *); static inline ti_sysbios_interfaces_ITimer_getMaxTicks_FxnT ti_sysbios_interfaces_ITimer_getMaxTicks_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_getMaxTicks_FxnT)__inst->__fxns->getMaxTicks; } typedef void (*ti_sysbios_interfaces_ITimer_setNextTick_FxnT)(void *, xdc_UInt32); static inline ti_sysbios_interfaces_ITimer_setNextTick_FxnT ti_sysbios_interfaces_ITimer_setNextTick_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_setNextTick_FxnT)__inst->__fxns->setNextTick; } typedef void (*ti_sysbios_interfaces_ITimer_start_FxnT)(void *); static inline ti_sysbios_interfaces_ITimer_start_FxnT ti_sysbios_interfaces_ITimer_start_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_start_FxnT)__inst->__fxns->start; } typedef void (*ti_sysbios_interfaces_ITimer_stop_FxnT)(void *); static inline ti_sysbios_interfaces_ITimer_stop_FxnT ti_sysbios_interfaces_ITimer_stop_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_stop_FxnT)__inst->__fxns->stop; } typedef void (*ti_sysbios_interfaces_ITimer_setPeriod_FxnT)(void *, xdc_UInt32); static inline ti_sysbios_interfaces_ITimer_setPeriod_FxnT ti_sysbios_interfaces_ITimer_setPeriod_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_setPeriod_FxnT)__inst->__fxns->setPeriod; } typedef xdc_Bool (*ti_sysbios_interfaces_ITimer_setPeriodMicroSecs_FxnT)(void *, xdc_UInt32); static inline ti_sysbios_interfaces_ITimer_setPeriodMicroSecs_FxnT ti_sysbios_interfaces_ITimer_setPeriodMicroSecs_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_setPeriodMicroSecs_FxnT)__inst->__fxns->setPeriodMicroSecs; } typedef xdc_UInt32 (*ti_sysbios_interfaces_ITimer_getPeriod_FxnT)(void *); static inline ti_sysbios_interfaces_ITimer_getPeriod_FxnT ti_sysbios_interfaces_ITimer_getPeriod_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_getPeriod_FxnT)__inst->__fxns->getPeriod; } typedef xdc_UInt32 (*ti_sysbios_interfaces_ITimer_getCount_FxnT)(void *); static inline ti_sysbios_interfaces_ITimer_getCount_FxnT ti_sysbios_interfaces_ITimer_getCount_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_getCount_FxnT)__inst->__fxns->getCount; } typedef void (*ti_sysbios_interfaces_ITimer_getFreq_FxnT)(void *, xdc_runtime_Types_FreqHz*); static inline ti_sysbios_interfaces_ITimer_getFreq_FxnT ti_sysbios_interfaces_ITimer_getFreq_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_getFreq_FxnT)__inst->__fxns->getFreq; } typedef ti_sysbios_interfaces_ITimer_FuncPtr (*ti_sysbios_interfaces_ITimer_getFunc_FxnT)(void *, xdc_UArg*); static inline ti_sysbios_interfaces_ITimer_getFunc_FxnT ti_sysbios_interfaces_ITimer_getFunc_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_getFunc_FxnT)__inst->__fxns->getFunc; } typedef void (*ti_sysbios_interfaces_ITimer_setFunc_FxnT)(void *, ti_sysbios_interfaces_ITimer_FuncPtr, xdc_UArg); static inline ti_sysbios_interfaces_ITimer_setFunc_FxnT ti_sysbios_interfaces_ITimer_setFunc_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_setFunc_FxnT)__inst->__fxns->setFunc; } typedef void (*ti_sysbios_interfaces_ITimer_trigger_FxnT)(void *, xdc_UInt32); static inline ti_sysbios_interfaces_ITimer_trigger_FxnT ti_sysbios_interfaces_ITimer_trigger_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_trigger_FxnT)__inst->__fxns->trigger; } typedef xdc_UInt32 (*ti_sysbios_interfaces_ITimer_getExpiredCounts_FxnT)(void *); static inline ti_sysbios_interfaces_ITimer_getExpiredCounts_FxnT ti_sysbios_interfaces_ITimer_getExpiredCounts_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_getExpiredCounts_FxnT)__inst->__fxns->getExpiredCounts; } typedef xdc_UInt32 (*ti_sysbios_interfaces_ITimer_getExpiredTicks_FxnT)(void *, xdc_UInt32); static inline ti_sysbios_interfaces_ITimer_getExpiredTicks_FxnT ti_sysbios_interfaces_ITimer_getExpiredTicks_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_getExpiredTicks_FxnT)__inst->__fxns->getExpiredTicks; } typedef xdc_UInt32 (*ti_sysbios_interfaces_ITimer_getCurrentTick_FxnT)(void *, xdc_Bool); static inline ti_sysbios_interfaces_ITimer_getCurrentTick_FxnT ti_sysbios_interfaces_ITimer_getCurrentTick_fxnP( ti_sysbios_interfaces_ITimer_Handle __inst ) { return (ti_sysbios_interfaces_ITimer_getCurrentTick_FxnT)__inst->__fxns->getCurrentTick; } typedef void (*ti_sysbios_knl_Swi_FuncPtr)(xdc_UArg, xdc_UArg); struct ti_sysbios_knl_Swi_HookSet { void (*registerFxn)(xdc_Int); void (*createFxn)(ti_sysbios_knl_Swi_Handle, xdc_runtime_Error_Block*); void (*readyFxn)(ti_sysbios_knl_Swi_Handle); void (*beginFxn)(ti_sysbios_knl_Swi_Handle); void (*endFxn)(ti_sysbios_knl_Swi_Handle); void (*deleteFxn)(ti_sysbios_knl_Swi_Handle); }; typedef struct ti_sysbios_knl_Swi_Args__create { ti_sysbios_knl_Swi_FuncPtr swiFxn; } ti_sysbios_knl_Swi_Args__create; typedef xdc_Ptr __T1_ti_sysbios_knl_Swi_Instance_State__hookEnv; typedef xdc_Ptr *__ARRAY1_ti_sysbios_knl_Swi_Instance_State__hookEnv; typedef __ARRAY1_ti_sysbios_knl_Swi_Instance_State__hookEnv __TA_ti_sysbios_knl_Swi_Instance_State__hookEnv; typedef ti_sysbios_knl_Queue_Instance_State __T1_ti_sysbios_knl_Swi_Module_State__readyQ; typedef ti_sysbios_knl_Queue_Instance_State *__ARRAY1_ti_sysbios_knl_Swi_Module_State__readyQ; typedef __ARRAY1_ti_sysbios_knl_Swi_Module_State__readyQ __TA_ti_sysbios_knl_Swi_Module_State__readyQ; typedef ti_sysbios_knl_Swi_Handle __T1_ti_sysbios_knl_Swi_Module_State__constructedSwis; typedef ti_sysbios_knl_Swi_Handle *__ARRAY1_ti_sysbios_knl_Swi_Module_State__constructedSwis; typedef __ARRAY1_ti_sysbios_knl_Swi_Module_State__constructedSwis __TA_ti_sysbios_knl_Swi_Module_State__constructedSwis; typedef xdc_Bits32 CT__ti_sysbios_knl_Swi_Module__diagsEnabled; extern "C" far const CT__ti_sysbios_knl_Swi_Module__diagsEnabled ti_sysbios_knl_Swi_Module__diagsEnabled__C; typedef xdc_Bits32 CT__ti_sysbios_knl_Swi_Module__diagsIncluded; extern "C" far const CT__ti_sysbios_knl_Swi_Module__diagsIncluded ti_sysbios_knl_Swi_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__ti_sysbios_knl_Swi_Module__diagsMask; extern "C" far const CT__ti_sysbios_knl_Swi_Module__diagsMask ti_sysbios_knl_Swi_Module__diagsMask__C; typedef xdc_Ptr CT__ti_sysbios_knl_Swi_Module__gateObj; extern "C" far const CT__ti_sysbios_knl_Swi_Module__gateObj ti_sysbios_knl_Swi_Module__gateObj__C; typedef xdc_Ptr CT__ti_sysbios_knl_Swi_Module__gatePrms; extern "C" far const CT__ti_sysbios_knl_Swi_Module__gatePrms ti_sysbios_knl_Swi_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__ti_sysbios_knl_Swi_Module__id; extern "C" far const CT__ti_sysbios_knl_Swi_Module__id ti_sysbios_knl_Swi_Module__id__C; typedef xdc_Bool CT__ti_sysbios_knl_Swi_Module__loggerDefined; extern "C" far const CT__ti_sysbios_knl_Swi_Module__loggerDefined ti_sysbios_knl_Swi_Module__loggerDefined__C; typedef xdc_Ptr CT__ti_sysbios_knl_Swi_Module__loggerObj; extern "C" far const CT__ti_sysbios_knl_Swi_Module__loggerObj ti_sysbios_knl_Swi_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__ti_sysbios_knl_Swi_Module__loggerFxn0; extern "C" far const CT__ti_sysbios_knl_Swi_Module__loggerFxn0 ti_sysbios_knl_Swi_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__ti_sysbios_knl_Swi_Module__loggerFxn1; extern "C" far const CT__ti_sysbios_knl_Swi_Module__loggerFxn1 ti_sysbios_knl_Swi_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__ti_sysbios_knl_Swi_Module__loggerFxn2; extern "C" far const CT__ti_sysbios_knl_Swi_Module__loggerFxn2 ti_sysbios_knl_Swi_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__ti_sysbios_knl_Swi_Module__loggerFxn4; extern "C" far const CT__ti_sysbios_knl_Swi_Module__loggerFxn4 ti_sysbios_knl_Swi_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__ti_sysbios_knl_Swi_Module__loggerFxn8; extern "C" far const CT__ti_sysbios_knl_Swi_Module__loggerFxn8 ti_sysbios_knl_Swi_Module__loggerFxn8__C; typedef xdc_Bool (*CT__ti_sysbios_knl_Swi_Module__startupDoneFxn)(void); extern "C" far const CT__ti_sysbios_knl_Swi_Module__startupDoneFxn ti_sysbios_knl_Swi_Module__startupDoneFxn__C; typedef xdc_Int CT__ti_sysbios_knl_Swi_Object__count; extern "C" far const CT__ti_sysbios_knl_Swi_Object__count ti_sysbios_knl_Swi_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__ti_sysbios_knl_Swi_Object__heap; extern "C" far const CT__ti_sysbios_knl_Swi_Object__heap ti_sysbios_knl_Swi_Object__heap__C; typedef xdc_SizeT CT__ti_sysbios_knl_Swi_Object__sizeof; extern "C" far const CT__ti_sysbios_knl_Swi_Object__sizeof ti_sysbios_knl_Swi_Object__sizeof__C; typedef xdc_Ptr CT__ti_sysbios_knl_Swi_Object__table; extern "C" far const CT__ti_sysbios_knl_Swi_Object__table ti_sysbios_knl_Swi_Object__table__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Swi_LM_begin; extern "C" far const CT__ti_sysbios_knl_Swi_LM_begin ti_sysbios_knl_Swi_LM_begin__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Swi_LD_end; extern "C" far const CT__ti_sysbios_knl_Swi_LD_end ti_sysbios_knl_Swi_LD_end__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Swi_LM_post; extern "C" far const CT__ti_sysbios_knl_Swi_LM_post ti_sysbios_knl_Swi_LM_post__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Swi_A_swiDisabled; extern "C" far const CT__ti_sysbios_knl_Swi_A_swiDisabled ti_sysbios_knl_Swi_A_swiDisabled__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Swi_A_badPriority; extern "C" far const CT__ti_sysbios_knl_Swi_A_badPriority ti_sysbios_knl_Swi_A_badPriority__C; typedef xdc_UInt CT__ti_sysbios_knl_Swi_numPriorities; extern "C" far const CT__ti_sysbios_knl_Swi_numPriorities ti_sysbios_knl_Swi_numPriorities__C; typedef ti_sysbios_knl_Swi_HookSet __T1_ti_sysbios_knl_Swi_hooks; typedef struct { int length; ti_sysbios_knl_Swi_HookSet *elem; } __ARRAY1_ti_sysbios_knl_Swi_hooks; typedef __ARRAY1_ti_sysbios_knl_Swi_hooks __TA_ti_sysbios_knl_Swi_hooks; typedef __TA_ti_sysbios_knl_Swi_hooks CT__ti_sysbios_knl_Swi_hooks; extern "C" far const CT__ti_sysbios_knl_Swi_hooks ti_sysbios_knl_Swi_hooks__C; typedef xdc_UInt (*CT__ti_sysbios_knl_Swi_taskDisable)(void); extern "C" far const CT__ti_sysbios_knl_Swi_taskDisable ti_sysbios_knl_Swi_taskDisable__C; typedef void (*CT__ti_sysbios_knl_Swi_taskRestore)(xdc_UInt); extern "C" far const CT__ti_sysbios_knl_Swi_taskRestore ti_sysbios_knl_Swi_taskRestore__C; typedef xdc_UInt CT__ti_sysbios_knl_Swi_numConstructedSwis; extern "C" far const CT__ti_sysbios_knl_Swi_numConstructedSwis ti_sysbios_knl_Swi_numConstructedSwis__C; struct ti_sysbios_knl_Swi_Params { size_t __size; const void *__self; void *__fxns; xdc_runtime_IInstance_Params *instance; xdc_UArg arg0; xdc_UArg arg1; xdc_UInt priority; xdc_UInt trigger; xdc_runtime_IInstance_Params __iprms; }; struct ti_sysbios_knl_Swi_Struct { ti_sysbios_knl_Queue_Elem __f0; ti_sysbios_knl_Swi_FuncPtr __f1; xdc_UArg __f2; xdc_UArg __f3; xdc_UInt __f4; xdc_UInt __f5; xdc_Bool __f6; xdc_UInt __f7; xdc_UInt __f8; ti_sysbios_knl_Queue_Handle __f9; __TA_ti_sysbios_knl_Swi_Instance_State__hookEnv __f10; xdc_runtime_Types_CordAddr __name; }; extern "C" xdc_Int ti_sysbios_knl_Swi_Module_startup__E( xdc_Int state ); extern "C" xdc_Int ti_sysbios_knl_Swi_Module_startup__F( xdc_Int state ); extern "C" xdc_Int ti_sysbios_knl_Swi_Instance_init__E(ti_sysbios_knl_Swi_Object *, ti_sysbios_knl_Swi_FuncPtr swiFxn, const ti_sysbios_knl_Swi_Params *, xdc_runtime_Error_Block *); extern "C" void ti_sysbios_knl_Swi_Instance_finalize__E( ti_sysbios_knl_Swi_Object* , int ); extern "C" xdc_runtime_Types_Label *ti_sysbios_knl_Swi_Handle__label__S( xdc_Ptr obj, xdc_runtime_Types_Label *lab ); extern "C" xdc_Bool ti_sysbios_knl_Swi_Module__startupDone__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Swi_Object__create__S( xdc_Ptr __oa, xdc_SizeT __osz, xdc_Ptr __aa, const xdc_UChar *__pa, xdc_SizeT __psz, xdc_runtime_Error_Block *__eb ); extern "C" ti_sysbios_knl_Swi_Handle ti_sysbios_knl_Swi_create( ti_sysbios_knl_Swi_FuncPtr swiFxn, const ti_sysbios_knl_Swi_Params *__prms, xdc_runtime_Error_Block *__eb ); extern "C" void ti_sysbios_knl_Swi_construct( ti_sysbios_knl_Swi_Struct *__obj, ti_sysbios_knl_Swi_FuncPtr swiFxn, const ti_sysbios_knl_Swi_Params *__prms, xdc_runtime_Error_Block *__eb ); extern "C" void ti_sysbios_knl_Swi_Object__delete__S( xdc_Ptr instp ); extern "C" void ti_sysbios_knl_Swi_delete(ti_sysbios_knl_Swi_Handle *instp); extern "C" void ti_sysbios_knl_Swi_Object__destruct__S( xdc_Ptr objp ); extern "C" void ti_sysbios_knl_Swi_destruct(ti_sysbios_knl_Swi_Struct *obj); extern "C" xdc_Ptr ti_sysbios_knl_Swi_Object__get__S( xdc_Ptr oarr, xdc_Int i ); extern "C" xdc_Ptr ti_sysbios_knl_Swi_Object__first__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Swi_Object__next__S( xdc_Ptr obj ); extern "C" void ti_sysbios_knl_Swi_Params__init__S( xdc_Ptr dst, const void *src, xdc_SizeT psz, xdc_SizeT isz ); extern "C" void ti_sysbios_knl_Swi_startup__E( void ); extern "C" xdc_Bool ti_sysbios_knl_Swi_enabled__E( void ); extern "C" void ti_sysbios_knl_Swi_unlockSched__E( void ); extern "C" xdc_UInt ti_sysbios_knl_Swi_disable__E( void ); extern "C" void ti_sysbios_knl_Swi_enable__E( void ); extern "C" void ti_sysbios_knl_Swi_restore__E( xdc_UInt key ); extern "C" void ti_sysbios_knl_Swi_restoreHwi__E( xdc_UInt key ); extern "C" ti_sysbios_knl_Swi_Handle ti_sysbios_knl_Swi_self__E( void ); extern "C" xdc_UInt ti_sysbios_knl_Swi_getTrigger__E( void ); extern "C" xdc_UInt ti_sysbios_knl_Swi_raisePri__E( xdc_UInt priority ); extern "C" void ti_sysbios_knl_Swi_restorePri__E( xdc_UInt key ); extern "C" void ti_sysbios_knl_Swi_andn__E( ti_sysbios_knl_Swi_Handle __inst, xdc_UInt mask ); extern "C" void ti_sysbios_knl_Swi_dec__E( ti_sysbios_knl_Swi_Handle __inst ); extern "C" xdc_Ptr ti_sysbios_knl_Swi_getHookContext__E( ti_sysbios_knl_Swi_Handle __inst, xdc_Int id ); extern "C" void ti_sysbios_knl_Swi_setHookContext__E( ti_sysbios_knl_Swi_Handle __inst, xdc_Int id, xdc_Ptr hookContext ); extern "C" xdc_UInt ti_sysbios_knl_Swi_getPri__E( ti_sysbios_knl_Swi_Handle __inst ); extern "C" ti_sysbios_knl_Swi_FuncPtr ti_sysbios_knl_Swi_getFunc__E( ti_sysbios_knl_Swi_Handle __inst, xdc_UArg *arg0, xdc_UArg *arg1 ); extern "C" void ti_sysbios_knl_Swi_getAttrs__E( ti_sysbios_knl_Swi_Handle __inst, ti_sysbios_knl_Swi_FuncPtr *swiFxn, ti_sysbios_knl_Swi_Params *params ); extern "C" void ti_sysbios_knl_Swi_setAttrs__E( ti_sysbios_knl_Swi_Handle __inst, ti_sysbios_knl_Swi_FuncPtr swiFxn, ti_sysbios_knl_Swi_Params *params ); extern "C" void ti_sysbios_knl_Swi_inc__E( ti_sysbios_knl_Swi_Handle __inst ); extern "C" void ti_sysbios_knl_Swi_or__E( ti_sysbios_knl_Swi_Handle __inst, xdc_UInt mask ); extern "C" void ti_sysbios_knl_Swi_post__E( ti_sysbios_knl_Swi_Handle __inst ); extern "C" void ti_sysbios_knl_Swi_schedule__I( void ); extern "C" void ti_sysbios_knl_Swi_runLoop__I( void ); extern "C" void ti_sysbios_knl_Swi_run__I( ti_sysbios_knl_Swi_Object *swi ); extern "C" xdc_Int ti_sysbios_knl_Swi_postInit__I( ti_sysbios_knl_Swi_Object *swi, xdc_runtime_Error_Block *eb ); extern "C" void ti_sysbios_knl_Swi_restoreSMP__I( void ); static inline CT__ti_sysbios_knl_Swi_Module__id ti_sysbios_knl_Swi_Module_id( void ) { return ti_sysbios_knl_Swi_Module__id__C; } static inline xdc_Bool ti_sysbios_knl_Swi_Module_hasMask( void ) { return ti_sysbios_knl_Swi_Module__diagsMask__C != 0; } static inline xdc_Bits16 ti_sysbios_knl_Swi_Module_getMask( void ) { return ti_sysbios_knl_Swi_Module__diagsMask__C != 0 ? *ti_sysbios_knl_Swi_Module__diagsMask__C : 0; } static inline void ti_sysbios_knl_Swi_Module_setMask( xdc_Bits16 mask ) { if (ti_sysbios_knl_Swi_Module__diagsMask__C != 0) *ti_sysbios_knl_Swi_Module__diagsMask__C = mask; } static inline void ti_sysbios_knl_Swi_Params_init( ti_sysbios_knl_Swi_Params *prms ) { if (prms) { ti_sysbios_knl_Swi_Params__init__S(prms, 0, sizeof(ti_sysbios_knl_Swi_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline void ti_sysbios_knl_Swi_Params_copy(ti_sysbios_knl_Swi_Params *dst, const ti_sysbios_knl_Swi_Params *src) { if (dst) { ti_sysbios_knl_Swi_Params__init__S(dst, (const void *)src, sizeof(ti_sysbios_knl_Swi_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline ti_sysbios_knl_Swi_Handle ti_sysbios_knl_Swi_Object_get(ti_sysbios_knl_Swi_Instance_State *oarr, int i) { return (ti_sysbios_knl_Swi_Handle)ti_sysbios_knl_Swi_Object__get__S(oarr, i); } static inline ti_sysbios_knl_Swi_Handle ti_sysbios_knl_Swi_Object_first( void ) { return (ti_sysbios_knl_Swi_Handle)ti_sysbios_knl_Swi_Object__first__S(); } static inline ti_sysbios_knl_Swi_Handle ti_sysbios_knl_Swi_Object_next( ti_sysbios_knl_Swi_Object *obj ) { return (ti_sysbios_knl_Swi_Handle)ti_sysbios_knl_Swi_Object__next__S(obj); } static inline xdc_runtime_Types_Label *ti_sysbios_knl_Swi_Handle_label( ti_sysbios_knl_Swi_Handle inst, xdc_runtime_Types_Label *lab ) { return ti_sysbios_knl_Swi_Handle__label__S(inst, lab); } static inline xdc_String ti_sysbios_knl_Swi_Handle_name( ti_sysbios_knl_Swi_Handle inst ) { xdc_runtime_Types_Label lab; return ti_sysbios_knl_Swi_Handle__label__S(inst, &lab)->iname; } static inline ti_sysbios_knl_Swi_Handle ti_sysbios_knl_Swi_handle( ti_sysbios_knl_Swi_Struct *str ) { return (ti_sysbios_knl_Swi_Handle)str; } static inline ti_sysbios_knl_Swi_Struct *ti_sysbios_knl_Swi_struct( ti_sysbios_knl_Swi_Handle inst ) { return (ti_sysbios_knl_Swi_Struct*)inst; } typedef ti_sysbios_interfaces_ITimer_FuncPtr ti_sysbios_knl_Clock_TimerProxy_FuncPtr; typedef ti_sysbios_interfaces_ITimer_StartMode ti_sysbios_knl_Clock_TimerProxy_StartMode; typedef ti_sysbios_interfaces_ITimer_RunMode ti_sysbios_knl_Clock_TimerProxy_RunMode; typedef ti_sysbios_interfaces_ITimer_Status ti_sysbios_knl_Clock_TimerProxy_Status; typedef ti_sysbios_interfaces_ITimer_PeriodType ti_sysbios_knl_Clock_TimerProxy_PeriodType; typedef struct ti_sysbios_knl_Clock_TimerProxy_Args__create { xdc_Int id; ti_sysbios_interfaces_ITimer_FuncPtr tickFxn; } ti_sysbios_knl_Clock_TimerProxy_Args__create; typedef xdc_Bits32 CT__ti_sysbios_knl_Clock_TimerProxy_Module__diagsEnabled; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Module__diagsEnabled ti_sysbios_knl_Clock_TimerProxy_Module__diagsEnabled__C; typedef xdc_Bits32 CT__ti_sysbios_knl_Clock_TimerProxy_Module__diagsIncluded; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Module__diagsIncluded ti_sysbios_knl_Clock_TimerProxy_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__ti_sysbios_knl_Clock_TimerProxy_Module__diagsMask; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Module__diagsMask ti_sysbios_knl_Clock_TimerProxy_Module__diagsMask__C; typedef xdc_Ptr CT__ti_sysbios_knl_Clock_TimerProxy_Module__gateObj; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Module__gateObj ti_sysbios_knl_Clock_TimerProxy_Module__gateObj__C; typedef xdc_Ptr CT__ti_sysbios_knl_Clock_TimerProxy_Module__gatePrms; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Module__gatePrms ti_sysbios_knl_Clock_TimerProxy_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__ti_sysbios_knl_Clock_TimerProxy_Module__id; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Module__id ti_sysbios_knl_Clock_TimerProxy_Module__id__C; typedef xdc_Bool CT__ti_sysbios_knl_Clock_TimerProxy_Module__loggerDefined; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Module__loggerDefined ti_sysbios_knl_Clock_TimerProxy_Module__loggerDefined__C; typedef xdc_Ptr CT__ti_sysbios_knl_Clock_TimerProxy_Module__loggerObj; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Module__loggerObj ti_sysbios_knl_Clock_TimerProxy_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn0; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn0 ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn1; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn1 ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn2; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn2 ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn4; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn4 ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn8; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn8 ti_sysbios_knl_Clock_TimerProxy_Module__loggerFxn8__C; typedef xdc_Bool (*CT__ti_sysbios_knl_Clock_TimerProxy_Module__startupDoneFxn)(void); extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Module__startupDoneFxn ti_sysbios_knl_Clock_TimerProxy_Module__startupDoneFxn__C; typedef xdc_Int CT__ti_sysbios_knl_Clock_TimerProxy_Object__count; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Object__count ti_sysbios_knl_Clock_TimerProxy_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__ti_sysbios_knl_Clock_TimerProxy_Object__heap; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Object__heap ti_sysbios_knl_Clock_TimerProxy_Object__heap__C; typedef xdc_SizeT CT__ti_sysbios_knl_Clock_TimerProxy_Object__sizeof; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Object__sizeof ti_sysbios_knl_Clock_TimerProxy_Object__sizeof__C; typedef xdc_Ptr CT__ti_sysbios_knl_Clock_TimerProxy_Object__table; extern "C" far const CT__ti_sysbios_knl_Clock_TimerProxy_Object__table ti_sysbios_knl_Clock_TimerProxy_Object__table__C; struct ti_sysbios_knl_Clock_TimerProxy_Params { size_t __size; const void *__self; void *__fxns; xdc_runtime_IInstance_Params *instance; ti_sysbios_interfaces_ITimer_RunMode runMode; ti_sysbios_interfaces_ITimer_StartMode startMode; xdc_UArg arg; xdc_UInt32 period; ti_sysbios_interfaces_ITimer_PeriodType periodType; xdc_runtime_Types_FreqHz extFreq; xdc_runtime_IInstance_Params __iprms; }; struct ti_sysbios_knl_Clock_TimerProxy_Struct { const ti_sysbios_knl_Clock_TimerProxy_Fxns__ *__fxns; xdc_runtime_Types_CordAddr __name; }; struct ti_sysbios_knl_Clock_TimerProxy_Fxns__ { xdc_runtime_Types_Base* __base; const xdc_runtime_Types_SysFxns2 *__sysp; xdc_UInt (*getNumTimers)(void); ti_sysbios_interfaces_ITimer_Status (*getStatus)(xdc_UInt); void (*startup)(void); xdc_UInt32 (*getMaxTicks)(ti_sysbios_knl_Clock_TimerProxy_Handle); void (*setNextTick)(ti_sysbios_knl_Clock_TimerProxy_Handle, xdc_UInt32); void (*start)(ti_sysbios_knl_Clock_TimerProxy_Handle); void (*stop)(ti_sysbios_knl_Clock_TimerProxy_Handle); void (*setPeriod)(ti_sysbios_knl_Clock_TimerProxy_Handle, xdc_UInt32); xdc_Bool (*setPeriodMicroSecs)(ti_sysbios_knl_Clock_TimerProxy_Handle, xdc_UInt32); xdc_UInt32 (*getPeriod)(ti_sysbios_knl_Clock_TimerProxy_Handle); xdc_UInt32 (*getCount)(ti_sysbios_knl_Clock_TimerProxy_Handle); void (*getFreq)(ti_sysbios_knl_Clock_TimerProxy_Handle, xdc_runtime_Types_FreqHz*); ti_sysbios_interfaces_ITimer_FuncPtr (*getFunc)(ti_sysbios_knl_Clock_TimerProxy_Handle, xdc_UArg*); void (*setFunc)(ti_sysbios_knl_Clock_TimerProxy_Handle, ti_sysbios_interfaces_ITimer_FuncPtr, xdc_UArg); void (*trigger)(ti_sysbios_knl_Clock_TimerProxy_Handle, xdc_UInt32); xdc_UInt32 (*getExpiredCounts)(ti_sysbios_knl_Clock_TimerProxy_Handle); xdc_UInt32 (*getExpiredTicks)(ti_sysbios_knl_Clock_TimerProxy_Handle, xdc_UInt32); xdc_UInt32 (*getCurrentTick)(ti_sysbios_knl_Clock_TimerProxy_Handle, xdc_Bool); xdc_runtime_Types_SysFxns2 __sfxns; }; extern "C" const ti_sysbios_knl_Clock_TimerProxy_Fxns__ ti_sysbios_knl_Clock_TimerProxy_Module__FXNS__C; extern "C" xdc_runtime_Types_Label *ti_sysbios_knl_Clock_TimerProxy_Handle__label__S( xdc_Ptr obj, xdc_runtime_Types_Label *lab ); extern "C" xdc_Bool ti_sysbios_knl_Clock_TimerProxy_Module__startupDone__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Clock_TimerProxy_Object__create__S( xdc_Ptr __oa, xdc_SizeT __osz, xdc_Ptr __aa, const xdc_UChar *__pa, xdc_SizeT __psz, xdc_runtime_Error_Block *__eb ); extern "C" ti_sysbios_knl_Clock_TimerProxy_Handle ti_sysbios_knl_Clock_TimerProxy_create( xdc_Int id, ti_sysbios_interfaces_ITimer_FuncPtr tickFxn, const ti_sysbios_knl_Clock_TimerProxy_Params *__prms, xdc_runtime_Error_Block *__eb ); extern "C" void ti_sysbios_knl_Clock_TimerProxy_Object__delete__S( xdc_Ptr instp ); extern "C" void ti_sysbios_knl_Clock_TimerProxy_delete(ti_sysbios_knl_Clock_TimerProxy_Handle *instp); extern "C" void ti_sysbios_knl_Clock_TimerProxy_Object__destruct__S( xdc_Ptr objp ); extern "C" xdc_Ptr ti_sysbios_knl_Clock_TimerProxy_Object__get__S( xdc_Ptr oarr, xdc_Int i ); extern "C" xdc_Ptr ti_sysbios_knl_Clock_TimerProxy_Object__first__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Clock_TimerProxy_Object__next__S( xdc_Ptr obj ); extern "C" void ti_sysbios_knl_Clock_TimerProxy_Params__init__S( xdc_Ptr dst, const void *src, xdc_SizeT psz, xdc_SizeT isz ); extern "C" xdc_Bool ti_sysbios_knl_Clock_TimerProxy_Proxy__abstract__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Clock_TimerProxy_Proxy__delegate__S( void ); extern "C" xdc_UInt ti_sysbios_knl_Clock_TimerProxy_getNumTimers__E( void ); extern "C" ti_sysbios_interfaces_ITimer_Status ti_sysbios_knl_Clock_TimerProxy_getStatus__E( xdc_UInt id ); extern "C" void ti_sysbios_knl_Clock_TimerProxy_startup__E( void ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_TimerProxy_getMaxTicks__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst ); extern "C" void ti_sysbios_knl_Clock_TimerProxy_setNextTick__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst, xdc_UInt32 ticks ); extern "C" void ti_sysbios_knl_Clock_TimerProxy_start__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst ); extern "C" void ti_sysbios_knl_Clock_TimerProxy_stop__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst ); extern "C" void ti_sysbios_knl_Clock_TimerProxy_setPeriod__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst, xdc_UInt32 period ); extern "C" xdc_Bool ti_sysbios_knl_Clock_TimerProxy_setPeriodMicroSecs__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst, xdc_UInt32 microsecs ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_TimerProxy_getPeriod__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_TimerProxy_getCount__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst ); extern "C" void ti_sysbios_knl_Clock_TimerProxy_getFreq__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst, xdc_runtime_Types_FreqHz *freq ); extern "C" ti_sysbios_interfaces_ITimer_FuncPtr ti_sysbios_knl_Clock_TimerProxy_getFunc__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst, xdc_UArg *arg ); extern "C" void ti_sysbios_knl_Clock_TimerProxy_setFunc__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst, ti_sysbios_interfaces_ITimer_FuncPtr fxn, xdc_UArg arg ); extern "C" void ti_sysbios_knl_Clock_TimerProxy_trigger__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst, xdc_UInt32 cycles ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_TimerProxy_getExpiredCounts__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_TimerProxy_getExpiredTicks__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst, xdc_UInt32 tickPeriod ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_TimerProxy_getCurrentTick__E( ti_sysbios_knl_Clock_TimerProxy_Handle __inst, xdc_Bool save ); static inline ti_sysbios_interfaces_ITimer_Module ti_sysbios_knl_Clock_TimerProxy_Module_upCast( void ) { return (ti_sysbios_interfaces_ITimer_Module)ti_sysbios_knl_Clock_TimerProxy_Proxy__delegate__S(); } static inline ti_sysbios_interfaces_ITimer_Handle ti_sysbios_knl_Clock_TimerProxy_Handle_upCast( ti_sysbios_knl_Clock_TimerProxy_Handle i ) { return (ti_sysbios_interfaces_ITimer_Handle)i; } static inline ti_sysbios_knl_Clock_TimerProxy_Handle ti_sysbios_knl_Clock_TimerProxy_Handle_downCast( ti_sysbios_interfaces_ITimer_Handle i ) { ti_sysbios_interfaces_ITimer_Handle i2 = (ti_sysbios_interfaces_ITimer_Handle)i; if (ti_sysbios_knl_Clock_TimerProxy_Proxy__abstract__S()) return (ti_sysbios_knl_Clock_TimerProxy_Handle)i; return (void*)i2->__fxns == (void*)ti_sysbios_knl_Clock_TimerProxy_Proxy__delegate__S() ? (ti_sysbios_knl_Clock_TimerProxy_Handle)i : 0; } static inline CT__ti_sysbios_knl_Clock_TimerProxy_Module__id ti_sysbios_knl_Clock_TimerProxy_Module_id( void ) { return ti_sysbios_knl_Clock_TimerProxy_Module__id__C; } static inline void ti_sysbios_knl_Clock_TimerProxy_Params_init( ti_sysbios_knl_Clock_TimerProxy_Params *prms ) { if (prms) { ti_sysbios_knl_Clock_TimerProxy_Params__init__S(prms, 0, sizeof(ti_sysbios_knl_Clock_TimerProxy_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline void ti_sysbios_knl_Clock_TimerProxy_Params_copy(ti_sysbios_knl_Clock_TimerProxy_Params *dst, const ti_sysbios_knl_Clock_TimerProxy_Params *src) { if (dst) { ti_sysbios_knl_Clock_TimerProxy_Params__init__S(dst, (const void *)src, sizeof(ti_sysbios_knl_Clock_TimerProxy_Params), sizeof(xdc_runtime_IInstance_Params)); } } enum ti_sysbios_knl_Clock_TickSource { ti_sysbios_knl_Clock_TickSource_TIMER, ti_sysbios_knl_Clock_TickSource_USER, ti_sysbios_knl_Clock_TickSource_NULL }; typedef enum ti_sysbios_knl_Clock_TickSource ti_sysbios_knl_Clock_TickSource; enum ti_sysbios_knl_Clock_TickMode { ti_sysbios_knl_Clock_TickMode_PERIODIC, ti_sysbios_knl_Clock_TickMode_DYNAMIC }; typedef enum ti_sysbios_knl_Clock_TickMode ti_sysbios_knl_Clock_TickMode; typedef void (*ti_sysbios_knl_Clock_FuncPtr)(xdc_UArg); typedef struct ti_sysbios_knl_Clock_Args__create { ti_sysbios_knl_Clock_FuncPtr clockFxn; xdc_UInt timeout; } ti_sysbios_knl_Clock_Args__create; typedef xdc_Bits32 CT__ti_sysbios_knl_Clock_Module__diagsEnabled; extern "C" far const CT__ti_sysbios_knl_Clock_Module__diagsEnabled ti_sysbios_knl_Clock_Module__diagsEnabled__C; typedef xdc_Bits32 CT__ti_sysbios_knl_Clock_Module__diagsIncluded; extern "C" far const CT__ti_sysbios_knl_Clock_Module__diagsIncluded ti_sysbios_knl_Clock_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__ti_sysbios_knl_Clock_Module__diagsMask; extern "C" far const CT__ti_sysbios_knl_Clock_Module__diagsMask ti_sysbios_knl_Clock_Module__diagsMask__C; typedef xdc_Ptr CT__ti_sysbios_knl_Clock_Module__gateObj; extern "C" far const CT__ti_sysbios_knl_Clock_Module__gateObj ti_sysbios_knl_Clock_Module__gateObj__C; typedef xdc_Ptr CT__ti_sysbios_knl_Clock_Module__gatePrms; extern "C" far const CT__ti_sysbios_knl_Clock_Module__gatePrms ti_sysbios_knl_Clock_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__ti_sysbios_knl_Clock_Module__id; extern "C" far const CT__ti_sysbios_knl_Clock_Module__id ti_sysbios_knl_Clock_Module__id__C; typedef xdc_Bool CT__ti_sysbios_knl_Clock_Module__loggerDefined; extern "C" far const CT__ti_sysbios_knl_Clock_Module__loggerDefined ti_sysbios_knl_Clock_Module__loggerDefined__C; typedef xdc_Ptr CT__ti_sysbios_knl_Clock_Module__loggerObj; extern "C" far const CT__ti_sysbios_knl_Clock_Module__loggerObj ti_sysbios_knl_Clock_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__ti_sysbios_knl_Clock_Module__loggerFxn0; extern "C" far const CT__ti_sysbios_knl_Clock_Module__loggerFxn0 ti_sysbios_knl_Clock_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__ti_sysbios_knl_Clock_Module__loggerFxn1; extern "C" far const CT__ti_sysbios_knl_Clock_Module__loggerFxn1 ti_sysbios_knl_Clock_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__ti_sysbios_knl_Clock_Module__loggerFxn2; extern "C" far const CT__ti_sysbios_knl_Clock_Module__loggerFxn2 ti_sysbios_knl_Clock_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__ti_sysbios_knl_Clock_Module__loggerFxn4; extern "C" far const CT__ti_sysbios_knl_Clock_Module__loggerFxn4 ti_sysbios_knl_Clock_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__ti_sysbios_knl_Clock_Module__loggerFxn8; extern "C" far const CT__ti_sysbios_knl_Clock_Module__loggerFxn8 ti_sysbios_knl_Clock_Module__loggerFxn8__C; typedef xdc_Bool (*CT__ti_sysbios_knl_Clock_Module__startupDoneFxn)(void); extern "C" far const CT__ti_sysbios_knl_Clock_Module__startupDoneFxn ti_sysbios_knl_Clock_Module__startupDoneFxn__C; typedef xdc_Int CT__ti_sysbios_knl_Clock_Object__count; extern "C" far const CT__ti_sysbios_knl_Clock_Object__count ti_sysbios_knl_Clock_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__ti_sysbios_knl_Clock_Object__heap; extern "C" far const CT__ti_sysbios_knl_Clock_Object__heap ti_sysbios_knl_Clock_Object__heap__C; typedef xdc_SizeT CT__ti_sysbios_knl_Clock_Object__sizeof; extern "C" far const CT__ti_sysbios_knl_Clock_Object__sizeof ti_sysbios_knl_Clock_Object__sizeof__C; typedef xdc_Ptr CT__ti_sysbios_knl_Clock_Object__table; extern "C" far const CT__ti_sysbios_knl_Clock_Object__table ti_sysbios_knl_Clock_Object__table__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Clock_LW_delayed; extern "C" far const CT__ti_sysbios_knl_Clock_LW_delayed ti_sysbios_knl_Clock_LW_delayed__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Clock_LM_tick; extern "C" far const CT__ti_sysbios_knl_Clock_LM_tick ti_sysbios_knl_Clock_LM_tick__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Clock_LM_begin; extern "C" far const CT__ti_sysbios_knl_Clock_LM_begin ti_sysbios_knl_Clock_LM_begin__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Clock_A_clockDisabled; extern "C" far const CT__ti_sysbios_knl_Clock_A_clockDisabled ti_sysbios_knl_Clock_A_clockDisabled__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Clock_A_badThreadType; extern "C" far const CT__ti_sysbios_knl_Clock_A_badThreadType ti_sysbios_knl_Clock_A_badThreadType__C; typedef xdc_UInt32 CT__ti_sysbios_knl_Clock_serviceMargin; extern "C" far const CT__ti_sysbios_knl_Clock_serviceMargin ti_sysbios_knl_Clock_serviceMargin__C; typedef ti_sysbios_knl_Clock_TickSource CT__ti_sysbios_knl_Clock_tickSource; extern "C" far const CT__ti_sysbios_knl_Clock_tickSource ti_sysbios_knl_Clock_tickSource__C; typedef ti_sysbios_knl_Clock_TickMode CT__ti_sysbios_knl_Clock_tickMode; extern "C" far const CT__ti_sysbios_knl_Clock_tickMode ti_sysbios_knl_Clock_tickMode__C; typedef xdc_UInt CT__ti_sysbios_knl_Clock_timerId; extern "C" far const CT__ti_sysbios_knl_Clock_timerId ti_sysbios_knl_Clock_timerId__C; typedef xdc_UInt32 CT__ti_sysbios_knl_Clock_tickPeriod; extern "C" far const CT__ti_sysbios_knl_Clock_tickPeriod ti_sysbios_knl_Clock_tickPeriod__C; typedef void (*CT__ti_sysbios_knl_Clock_doTickFunc)(xdc_UArg); extern "C" far const CT__ti_sysbios_knl_Clock_doTickFunc ti_sysbios_knl_Clock_doTickFunc__C; typedef ti_sysbios_knl_Clock_Handle CT__ti_sysbios_knl_Clock_triggerClock; extern "C" far const CT__ti_sysbios_knl_Clock_triggerClock ti_sysbios_knl_Clock_triggerClock__C; struct ti_sysbios_knl_Clock_Params { size_t __size; const void *__self; void *__fxns; xdc_runtime_IInstance_Params *instance; xdc_Bool startFlag; xdc_UInt32 period; xdc_UArg arg; xdc_runtime_IInstance_Params __iprms; }; struct ti_sysbios_knl_Clock_Struct { ti_sysbios_knl_Queue_Elem __f0; xdc_UInt32 __f1; xdc_UInt32 __f2; xdc_UInt32 __f3; volatile xdc_Bool __f4; ti_sysbios_knl_Clock_FuncPtr __f5; xdc_UArg __f6; xdc_runtime_Types_CordAddr __name; }; extern "C" xdc_Int ti_sysbios_knl_Clock_Module_startup__E( xdc_Int state ); extern "C" xdc_Int ti_sysbios_knl_Clock_Module_startup__F( xdc_Int state ); extern "C" void ti_sysbios_knl_Clock_Instance_init__E(ti_sysbios_knl_Clock_Object *, ti_sysbios_knl_Clock_FuncPtr clockFxn, xdc_UInt timeout, const ti_sysbios_knl_Clock_Params *); extern "C" void ti_sysbios_knl_Clock_Instance_finalize__E( ti_sysbios_knl_Clock_Object* ); extern "C" xdc_runtime_Types_Label *ti_sysbios_knl_Clock_Handle__label__S( xdc_Ptr obj, xdc_runtime_Types_Label *lab ); extern "C" xdc_Bool ti_sysbios_knl_Clock_Module__startupDone__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Clock_Object__create__S( xdc_Ptr __oa, xdc_SizeT __osz, xdc_Ptr __aa, const xdc_UChar *__pa, xdc_SizeT __psz, xdc_runtime_Error_Block *__eb ); extern "C" ti_sysbios_knl_Clock_Handle ti_sysbios_knl_Clock_create( ti_sysbios_knl_Clock_FuncPtr clockFxn, xdc_UInt timeout, const ti_sysbios_knl_Clock_Params *__prms, xdc_runtime_Error_Block *__eb ); extern "C" void ti_sysbios_knl_Clock_construct( ti_sysbios_knl_Clock_Struct *__obj, ti_sysbios_knl_Clock_FuncPtr clockFxn, xdc_UInt timeout, const ti_sysbios_knl_Clock_Params *__prms ); extern "C" void ti_sysbios_knl_Clock_Object__delete__S( xdc_Ptr instp ); extern "C" void ti_sysbios_knl_Clock_delete(ti_sysbios_knl_Clock_Handle *instp); extern "C" void ti_sysbios_knl_Clock_Object__destruct__S( xdc_Ptr objp ); extern "C" void ti_sysbios_knl_Clock_destruct(ti_sysbios_knl_Clock_Struct *obj); extern "C" xdc_Ptr ti_sysbios_knl_Clock_Object__get__S( xdc_Ptr oarr, xdc_Int i ); extern "C" xdc_Ptr ti_sysbios_knl_Clock_Object__first__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Clock_Object__next__S( xdc_Ptr obj ); extern "C" void ti_sysbios_knl_Clock_Params__init__S( xdc_Ptr dst, const void *src, xdc_SizeT psz, xdc_SizeT isz ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_getTicks__E( void ); extern "C" ti_sysbios_knl_Clock_TimerProxy_Handle ti_sysbios_knl_Clock_getTimerHandle__E( void ); extern "C" void ti_sysbios_knl_Clock_setTicks__E( xdc_UInt32 ticks ); extern "C" void ti_sysbios_knl_Clock_tickStop__E( void ); extern "C" xdc_Bool ti_sysbios_knl_Clock_tickReconfig__E( void ); extern "C" void ti_sysbios_knl_Clock_tickStart__E( void ); extern "C" void ti_sysbios_knl_Clock_tick__E( void ); extern "C" void ti_sysbios_knl_Clock_workFunc__E( xdc_UArg arg0, xdc_UArg arg1 ); extern "C" void ti_sysbios_knl_Clock_workFuncDynamic__E( xdc_UArg arg0, xdc_UArg arg1 ); extern "C" void ti_sysbios_knl_Clock_logTick__E( void ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_getCompletedTicks__E( void ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_getTickPeriod__E( void ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_getTicksUntilInterrupt__E( void ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_getTicksUntilTimeout__E( void ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_walkQueueDynamic__E( xdc_Bool service, xdc_UInt32 tick ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_walkQueuePeriodic__E( void ); extern "C" void ti_sysbios_knl_Clock_scheduleNextTick__E( xdc_UInt32 deltaTicks, xdc_UInt32 absTick ); extern "C" void ti_sysbios_knl_Clock_addI__E( ti_sysbios_knl_Clock_Handle __inst, ti_sysbios_knl_Clock_FuncPtr clockFxn, xdc_UInt32 timeout, xdc_UArg arg ); extern "C" void ti_sysbios_knl_Clock_removeI__E( ti_sysbios_knl_Clock_Handle __inst ); extern "C" void ti_sysbios_knl_Clock_start__E( ti_sysbios_knl_Clock_Handle __inst ); extern "C" void ti_sysbios_knl_Clock_startI__E( ti_sysbios_knl_Clock_Handle __inst ); extern "C" void ti_sysbios_knl_Clock_stop__E( ti_sysbios_knl_Clock_Handle __inst ); extern "C" void ti_sysbios_knl_Clock_setPeriod__E( ti_sysbios_knl_Clock_Handle __inst, xdc_UInt32 period ); extern "C" void ti_sysbios_knl_Clock_setTimeout__E( ti_sysbios_knl_Clock_Handle __inst, xdc_UInt32 timeout ); extern "C" void ti_sysbios_knl_Clock_setFunc__E( ti_sysbios_knl_Clock_Handle __inst, ti_sysbios_knl_Clock_FuncPtr fxn, xdc_UArg arg ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_getPeriod__E( ti_sysbios_knl_Clock_Handle __inst ); extern "C" xdc_UInt32 ti_sysbios_knl_Clock_getTimeout__E( ti_sysbios_knl_Clock_Handle __inst ); extern "C" xdc_Bool ti_sysbios_knl_Clock_isActive__E( ti_sysbios_knl_Clock_Handle __inst ); extern "C" void ti_sysbios_knl_Clock_doTick__I( xdc_UArg arg ); extern "C" void ti_sysbios_knl_Clock_triggerFunc__I( xdc_UArg arg ); static inline CT__ti_sysbios_knl_Clock_Module__id ti_sysbios_knl_Clock_Module_id( void ) { return ti_sysbios_knl_Clock_Module__id__C; } static inline xdc_Bool ti_sysbios_knl_Clock_Module_hasMask( void ) { return ti_sysbios_knl_Clock_Module__diagsMask__C != 0; } static inline xdc_Bits16 ti_sysbios_knl_Clock_Module_getMask( void ) { return ti_sysbios_knl_Clock_Module__diagsMask__C != 0 ? *ti_sysbios_knl_Clock_Module__diagsMask__C : 0; } static inline void ti_sysbios_knl_Clock_Module_setMask( xdc_Bits16 mask ) { if (ti_sysbios_knl_Clock_Module__diagsMask__C != 0) *ti_sysbios_knl_Clock_Module__diagsMask__C = mask; } static inline void ti_sysbios_knl_Clock_Params_init( ti_sysbios_knl_Clock_Params *prms ) { if (prms) { ti_sysbios_knl_Clock_Params__init__S(prms, 0, sizeof(ti_sysbios_knl_Clock_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline void ti_sysbios_knl_Clock_Params_copy(ti_sysbios_knl_Clock_Params *dst, const ti_sysbios_knl_Clock_Params *src) { if (dst) { ti_sysbios_knl_Clock_Params__init__S(dst, (const void *)src, sizeof(ti_sysbios_knl_Clock_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline ti_sysbios_knl_Clock_Handle ti_sysbios_knl_Clock_Object_get(ti_sysbios_knl_Clock_Instance_State *oarr, int i) { return (ti_sysbios_knl_Clock_Handle)ti_sysbios_knl_Clock_Object__get__S(oarr, i); } static inline ti_sysbios_knl_Clock_Handle ti_sysbios_knl_Clock_Object_first( void ) { return (ti_sysbios_knl_Clock_Handle)ti_sysbios_knl_Clock_Object__first__S(); } static inline ti_sysbios_knl_Clock_Handle ti_sysbios_knl_Clock_Object_next( ti_sysbios_knl_Clock_Object *obj ) { return (ti_sysbios_knl_Clock_Handle)ti_sysbios_knl_Clock_Object__next__S(obj); } static inline xdc_runtime_Types_Label *ti_sysbios_knl_Clock_Handle_label( ti_sysbios_knl_Clock_Handle inst, xdc_runtime_Types_Label *lab ) { return ti_sysbios_knl_Clock_Handle__label__S(inst, lab); } static inline xdc_String ti_sysbios_knl_Clock_Handle_name( ti_sysbios_knl_Clock_Handle inst ) { xdc_runtime_Types_Label lab; return ti_sysbios_knl_Clock_Handle__label__S(inst, &lab)->iname; } static inline ti_sysbios_knl_Clock_Handle ti_sysbios_knl_Clock_handle( ti_sysbios_knl_Clock_Struct *str ) { return (ti_sysbios_knl_Clock_Handle)str; } static inline ti_sysbios_knl_Clock_Struct *ti_sysbios_knl_Clock_struct( ti_sysbios_knl_Clock_Handle inst ) { return (ti_sysbios_knl_Clock_Struct*)inst; } typedef ti_sysbios_interfaces_ITaskSupport_FuncPtr ti_sysbios_knl_Task_SupportProxy_FuncPtr; typedef xdc_Bits32 CT__ti_sysbios_knl_Task_SupportProxy_Module__diagsEnabled; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Module__diagsEnabled ti_sysbios_knl_Task_SupportProxy_Module__diagsEnabled__C; typedef xdc_Bits32 CT__ti_sysbios_knl_Task_SupportProxy_Module__diagsIncluded; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Module__diagsIncluded ti_sysbios_knl_Task_SupportProxy_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__ti_sysbios_knl_Task_SupportProxy_Module__diagsMask; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Module__diagsMask ti_sysbios_knl_Task_SupportProxy_Module__diagsMask__C; typedef xdc_Ptr CT__ti_sysbios_knl_Task_SupportProxy_Module__gateObj; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Module__gateObj ti_sysbios_knl_Task_SupportProxy_Module__gateObj__C; typedef xdc_Ptr CT__ti_sysbios_knl_Task_SupportProxy_Module__gatePrms; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Module__gatePrms ti_sysbios_knl_Task_SupportProxy_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__ti_sysbios_knl_Task_SupportProxy_Module__id; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Module__id ti_sysbios_knl_Task_SupportProxy_Module__id__C; typedef xdc_Bool CT__ti_sysbios_knl_Task_SupportProxy_Module__loggerDefined; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Module__loggerDefined ti_sysbios_knl_Task_SupportProxy_Module__loggerDefined__C; typedef xdc_Ptr CT__ti_sysbios_knl_Task_SupportProxy_Module__loggerObj; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Module__loggerObj ti_sysbios_knl_Task_SupportProxy_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn0; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn0 ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn1; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn1 ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn2; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn2 ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn4; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn4 ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn8; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn8 ti_sysbios_knl_Task_SupportProxy_Module__loggerFxn8__C; typedef xdc_Bool (*CT__ti_sysbios_knl_Task_SupportProxy_Module__startupDoneFxn)(void); extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Module__startupDoneFxn ti_sysbios_knl_Task_SupportProxy_Module__startupDoneFxn__C; typedef xdc_Int CT__ti_sysbios_knl_Task_SupportProxy_Object__count; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Object__count ti_sysbios_knl_Task_SupportProxy_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__ti_sysbios_knl_Task_SupportProxy_Object__heap; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Object__heap ti_sysbios_knl_Task_SupportProxy_Object__heap__C; typedef xdc_SizeT CT__ti_sysbios_knl_Task_SupportProxy_Object__sizeof; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Object__sizeof ti_sysbios_knl_Task_SupportProxy_Object__sizeof__C; typedef xdc_Ptr CT__ti_sysbios_knl_Task_SupportProxy_Object__table; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_Object__table ti_sysbios_knl_Task_SupportProxy_Object__table__C; typedef xdc_SizeT CT__ti_sysbios_knl_Task_SupportProxy_defaultStackSize; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_defaultStackSize ti_sysbios_knl_Task_SupportProxy_defaultStackSize__C; typedef xdc_UInt CT__ti_sysbios_knl_Task_SupportProxy_stackAlignment; extern "C" far const CT__ti_sysbios_knl_Task_SupportProxy_stackAlignment ti_sysbios_knl_Task_SupportProxy_stackAlignment__C; struct ti_sysbios_knl_Task_SupportProxy_Fxns__ { xdc_runtime_Types_Base* __base; const xdc_runtime_Types_SysFxns2 *__sysp; xdc_Ptr (*start)(xdc_Ptr, ti_sysbios_interfaces_ITaskSupport_FuncPtr, ti_sysbios_interfaces_ITaskSupport_FuncPtr, xdc_runtime_Error_Block*); void (*swap)(xdc_Ptr*, xdc_Ptr*); xdc_Bool (*checkStack)(xdc_Char*, xdc_SizeT); xdc_SizeT (*stackUsed)(xdc_Char*, xdc_SizeT); xdc_UInt (*getStackAlignment)(void); xdc_SizeT (*getDefaultStackSize)(void); xdc_Ptr (*getCheckValueAddr)(xdc_Ptr); xdc_runtime_Types_SysFxns2 __sfxns; }; extern "C" const ti_sysbios_knl_Task_SupportProxy_Fxns__ ti_sysbios_knl_Task_SupportProxy_Module__FXNS__C; extern "C" xdc_runtime_Types_Label *ti_sysbios_knl_Task_SupportProxy_Handle__label__S( xdc_Ptr obj, xdc_runtime_Types_Label *lab ); extern "C" xdc_Bool ti_sysbios_knl_Task_SupportProxy_Module__startupDone__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Task_SupportProxy_Object__create__S( xdc_Ptr __oa, xdc_SizeT __osz, xdc_Ptr __aa, const xdc_UChar *__pa, xdc_SizeT __psz, xdc_runtime_Error_Block *__eb ); extern "C" void ti_sysbios_knl_Task_SupportProxy_Object__delete__S( xdc_Ptr instp ); extern "C" void ti_sysbios_knl_Task_SupportProxy_Object__destruct__S( xdc_Ptr objp ); extern "C" xdc_Ptr ti_sysbios_knl_Task_SupportProxy_Object__get__S( xdc_Ptr oarr, xdc_Int i ); extern "C" xdc_Ptr ti_sysbios_knl_Task_SupportProxy_Object__first__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Task_SupportProxy_Object__next__S( xdc_Ptr obj ); extern "C" void ti_sysbios_knl_Task_SupportProxy_Params__init__S( xdc_Ptr dst, const void *src, xdc_SizeT psz, xdc_SizeT isz ); extern "C" xdc_Bool ti_sysbios_knl_Task_SupportProxy_Proxy__abstract__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Task_SupportProxy_Proxy__delegate__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Task_SupportProxy_start__E( xdc_Ptr curTask, ti_sysbios_interfaces_ITaskSupport_FuncPtr enter, ti_sysbios_interfaces_ITaskSupport_FuncPtr exit, xdc_runtime_Error_Block *eb ); extern "C" void ti_sysbios_knl_Task_SupportProxy_swap__E( xdc_Ptr *oldtskContext, xdc_Ptr *newtskContext ); extern "C" xdc_Bool ti_sysbios_knl_Task_SupportProxy_checkStack__E( xdc_Char *stack, xdc_SizeT size ); extern "C" xdc_SizeT ti_sysbios_knl_Task_SupportProxy_stackUsed__E( xdc_Char *stack, xdc_SizeT size ); extern "C" xdc_UInt ti_sysbios_knl_Task_SupportProxy_getStackAlignment__E( void ); extern "C" xdc_SizeT ti_sysbios_knl_Task_SupportProxy_getDefaultStackSize__E( void ); extern "C" xdc_Ptr ti_sysbios_knl_Task_SupportProxy_getCheckValueAddr__E( xdc_Ptr curTask ); static inline ti_sysbios_interfaces_ITaskSupport_Module ti_sysbios_knl_Task_SupportProxy_Module_upCast( void ) { return (ti_sysbios_interfaces_ITaskSupport_Module)ti_sysbios_knl_Task_SupportProxy_Proxy__delegate__S(); } static inline CT__ti_sysbios_knl_Task_SupportProxy_Module__id ti_sysbios_knl_Task_SupportProxy_Module_id( void ) { return ti_sysbios_knl_Task_SupportProxy_Module__id__C; } typedef void (*ti_sysbios_knl_Task_FuncPtr)(xdc_UArg, xdc_UArg); typedef void (*ti_sysbios_knl_Task_AllBlockedFuncPtr)(void); typedef xdc_UInt32 (*ti_sysbios_knl_Task_ModStateCheckValueFuncPtr)(ti_sysbios_knl_Task_Module_State*); typedef xdc_Int (*ti_sysbios_knl_Task_ModStateCheckFuncPtr)(ti_sysbios_knl_Task_Module_State*, xdc_UInt32); typedef xdc_UInt32 (*ti_sysbios_knl_Task_ObjectCheckValueFuncPtr)(ti_sysbios_knl_Task_Handle); typedef xdc_Int (*ti_sysbios_knl_Task_ObjectCheckFuncPtr)(ti_sysbios_knl_Task_Handle, xdc_UInt32); enum ti_sysbios_knl_Task_Mode { ti_sysbios_knl_Task_Mode_RUNNING, ti_sysbios_knl_Task_Mode_READY, ti_sysbios_knl_Task_Mode_BLOCKED, ti_sysbios_knl_Task_Mode_TERMINATED, ti_sysbios_knl_Task_Mode_INACTIVE }; typedef enum ti_sysbios_knl_Task_Mode ti_sysbios_knl_Task_Mode; struct ti_sysbios_knl_Task_Stat { xdc_Int priority; xdc_Ptr stack; xdc_SizeT stackSize; xdc_runtime_IHeap_Handle stackHeap; xdc_Ptr env; ti_sysbios_knl_Task_Mode mode; xdc_Ptr sp; xdc_SizeT used; }; struct ti_sysbios_knl_Task_HookSet { void (*registerFxn)(xdc_Int); void (*createFxn)(ti_sysbios_knl_Task_Handle, xdc_runtime_Error_Block*); void (*readyFxn)(ti_sysbios_knl_Task_Handle); void (*switchFxn)(ti_sysbios_knl_Task_Handle, ti_sysbios_knl_Task_Handle); void (*exitFxn)(ti_sysbios_knl_Task_Handle); void (*deleteFxn)(ti_sysbios_knl_Task_Handle); }; typedef struct ti_sysbios_knl_Task_Args__create { ti_sysbios_knl_Task_FuncPtr fxn; } ti_sysbios_knl_Task_Args__create; struct ti_sysbios_knl_Task_PendElem { ti_sysbios_knl_Queue_Elem qElem; ti_sysbios_knl_Task_Handle task; ti_sysbios_knl_Clock_Handle clock; }; typedef xdc_Char __T1_ti_sysbios_knl_Task_Instance_State__stack; typedef xdc_Char *__ARRAY1_ti_sysbios_knl_Task_Instance_State__stack; typedef __ARRAY1_ti_sysbios_knl_Task_Instance_State__stack __TA_ti_sysbios_knl_Task_Instance_State__stack; typedef xdc_Ptr __T1_ti_sysbios_knl_Task_Instance_State__hookEnv; typedef xdc_Ptr *__ARRAY1_ti_sysbios_knl_Task_Instance_State__hookEnv; typedef __ARRAY1_ti_sysbios_knl_Task_Instance_State__hookEnv __TA_ti_sysbios_knl_Task_Instance_State__hookEnv; typedef ti_sysbios_knl_Queue_Instance_State __T1_ti_sysbios_knl_Task_Module_State__readyQ; typedef ti_sysbios_knl_Queue_Instance_State *__ARRAY1_ti_sysbios_knl_Task_Module_State__readyQ; typedef __ARRAY1_ti_sysbios_knl_Task_Module_State__readyQ __TA_ti_sysbios_knl_Task_Module_State__readyQ; typedef volatile xdc_UInt __T1_ti_sysbios_knl_Task_Module_State__smpCurSet; typedef volatile xdc_UInt *__ARRAY1_ti_sysbios_knl_Task_Module_State__smpCurSet; typedef __ARRAY1_ti_sysbios_knl_Task_Module_State__smpCurSet __TA_ti_sysbios_knl_Task_Module_State__smpCurSet; typedef volatile xdc_UInt __T1_ti_sysbios_knl_Task_Module_State__smpCurMask; typedef volatile xdc_UInt *__ARRAY1_ti_sysbios_knl_Task_Module_State__smpCurMask; typedef __ARRAY1_ti_sysbios_knl_Task_Module_State__smpCurMask __TA_ti_sysbios_knl_Task_Module_State__smpCurMask; typedef ti_sysbios_knl_Task_Handle __T1_ti_sysbios_knl_Task_Module_State__smpCurTask; typedef ti_sysbios_knl_Task_Handle *__ARRAY1_ti_sysbios_knl_Task_Module_State__smpCurTask; typedef __ARRAY1_ti_sysbios_knl_Task_Module_State__smpCurTask __TA_ti_sysbios_knl_Task_Module_State__smpCurTask; typedef ti_sysbios_knl_Queue_Handle __T1_ti_sysbios_knl_Task_Module_State__smpReadyQ; typedef ti_sysbios_knl_Queue_Handle *__ARRAY1_ti_sysbios_knl_Task_Module_State__smpReadyQ; typedef __ARRAY1_ti_sysbios_knl_Task_Module_State__smpReadyQ __TA_ti_sysbios_knl_Task_Module_State__smpReadyQ; typedef ti_sysbios_knl_Task_Handle __T1_ti_sysbios_knl_Task_Module_State__idleTask; typedef ti_sysbios_knl_Task_Handle *__ARRAY1_ti_sysbios_knl_Task_Module_State__idleTask; typedef __ARRAY1_ti_sysbios_knl_Task_Module_State__idleTask __TA_ti_sysbios_knl_Task_Module_State__idleTask; typedef ti_sysbios_knl_Task_Handle __T1_ti_sysbios_knl_Task_Module_State__constructedTasks; typedef ti_sysbios_knl_Task_Handle *__ARRAY1_ti_sysbios_knl_Task_Module_State__constructedTasks; typedef __ARRAY1_ti_sysbios_knl_Task_Module_State__constructedTasks __TA_ti_sysbios_knl_Task_Module_State__constructedTasks; struct ti_sysbios_knl_Task_RunQEntry { ti_sysbios_knl_Queue_Elem elem; xdc_UInt coreId; xdc_Int priority; }; typedef volatile ti_sysbios_knl_Task_RunQEntry __T1_ti_sysbios_knl_Task_Module_StateSmp__smpRunQ; typedef volatile ti_sysbios_knl_Task_RunQEntry *__ARRAY1_ti_sysbios_knl_Task_Module_StateSmp__smpRunQ; typedef __ARRAY1_ti_sysbios_knl_Task_Module_StateSmp__smpRunQ __TA_ti_sysbios_knl_Task_Module_StateSmp__smpRunQ; struct ti_sysbios_knl_Task_Module_StateSmp { ti_sysbios_knl_Queue_Object *sortedRunQ; __TA_ti_sysbios_knl_Task_Module_StateSmp__smpRunQ smpRunQ; }; typedef xdc_Bits32 CT__ti_sysbios_knl_Task_Module__diagsEnabled; extern "C" far const CT__ti_sysbios_knl_Task_Module__diagsEnabled ti_sysbios_knl_Task_Module__diagsEnabled__C; typedef xdc_Bits32 CT__ti_sysbios_knl_Task_Module__diagsIncluded; extern "C" far const CT__ti_sysbios_knl_Task_Module__diagsIncluded ti_sysbios_knl_Task_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__ti_sysbios_knl_Task_Module__diagsMask; extern "C" far const CT__ti_sysbios_knl_Task_Module__diagsMask ti_sysbios_knl_Task_Module__diagsMask__C; typedef xdc_Ptr CT__ti_sysbios_knl_Task_Module__gateObj; extern "C" far const CT__ti_sysbios_knl_Task_Module__gateObj ti_sysbios_knl_Task_Module__gateObj__C; typedef xdc_Ptr CT__ti_sysbios_knl_Task_Module__gatePrms; extern "C" far const CT__ti_sysbios_knl_Task_Module__gatePrms ti_sysbios_knl_Task_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__ti_sysbios_knl_Task_Module__id; extern "C" far const CT__ti_sysbios_knl_Task_Module__id ti_sysbios_knl_Task_Module__id__C; typedef xdc_Bool CT__ti_sysbios_knl_Task_Module__loggerDefined; extern "C" far const CT__ti_sysbios_knl_Task_Module__loggerDefined ti_sysbios_knl_Task_Module__loggerDefined__C; typedef xdc_Ptr CT__ti_sysbios_knl_Task_Module__loggerObj; extern "C" far const CT__ti_sysbios_knl_Task_Module__loggerObj ti_sysbios_knl_Task_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__ti_sysbios_knl_Task_Module__loggerFxn0; extern "C" far const CT__ti_sysbios_knl_Task_Module__loggerFxn0 ti_sysbios_knl_Task_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__ti_sysbios_knl_Task_Module__loggerFxn1; extern "C" far const CT__ti_sysbios_knl_Task_Module__loggerFxn1 ti_sysbios_knl_Task_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__ti_sysbios_knl_Task_Module__loggerFxn2; extern "C" far const CT__ti_sysbios_knl_Task_Module__loggerFxn2 ti_sysbios_knl_Task_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__ti_sysbios_knl_Task_Module__loggerFxn4; extern "C" far const CT__ti_sysbios_knl_Task_Module__loggerFxn4 ti_sysbios_knl_Task_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__ti_sysbios_knl_Task_Module__loggerFxn8; extern "C" far const CT__ti_sysbios_knl_Task_Module__loggerFxn8 ti_sysbios_knl_Task_Module__loggerFxn8__C; typedef xdc_Bool (*CT__ti_sysbios_knl_Task_Module__startupDoneFxn)(void); extern "C" far const CT__ti_sysbios_knl_Task_Module__startupDoneFxn ti_sysbios_knl_Task_Module__startupDoneFxn__C; typedef xdc_Int CT__ti_sysbios_knl_Task_Object__count; extern "C" far const CT__ti_sysbios_knl_Task_Object__count ti_sysbios_knl_Task_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__ti_sysbios_knl_Task_Object__heap; extern "C" far const CT__ti_sysbios_knl_Task_Object__heap ti_sysbios_knl_Task_Object__heap__C; typedef xdc_SizeT CT__ti_sysbios_knl_Task_Object__sizeof; extern "C" far const CT__ti_sysbios_knl_Task_Object__sizeof ti_sysbios_knl_Task_Object__sizeof__C; typedef xdc_Ptr CT__ti_sysbios_knl_Task_Object__table; extern "C" far const CT__ti_sysbios_knl_Task_Object__table ti_sysbios_knl_Task_Object__table__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Task_LM_switch; extern "C" far const CT__ti_sysbios_knl_Task_LM_switch ti_sysbios_knl_Task_LM_switch__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Task_LM_sleep; extern "C" far const CT__ti_sysbios_knl_Task_LM_sleep ti_sysbios_knl_Task_LM_sleep__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Task_LD_ready; extern "C" far const CT__ti_sysbios_knl_Task_LD_ready ti_sysbios_knl_Task_LD_ready__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Task_LD_block; extern "C" far const CT__ti_sysbios_knl_Task_LD_block ti_sysbios_knl_Task_LD_block__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Task_LM_yield; extern "C" far const CT__ti_sysbios_knl_Task_LM_yield ti_sysbios_knl_Task_LM_yield__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Task_LM_setPri; extern "C" far const CT__ti_sysbios_knl_Task_LM_setPri ti_sysbios_knl_Task_LM_setPri__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Task_LD_exit; extern "C" far const CT__ti_sysbios_knl_Task_LD_exit ti_sysbios_knl_Task_LD_exit__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Task_LM_setAffinity; extern "C" far const CT__ti_sysbios_knl_Task_LM_setAffinity ti_sysbios_knl_Task_LM_setAffinity__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Task_LM_schedule; extern "C" far const CT__ti_sysbios_knl_Task_LM_schedule ti_sysbios_knl_Task_LM_schedule__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Task_LM_noWork; extern "C" far const CT__ti_sysbios_knl_Task_LM_noWork ti_sysbios_knl_Task_LM_noWork__C; typedef xdc_runtime_Error_Id CT__ti_sysbios_knl_Task_E_stackOverflow; extern "C" far const CT__ti_sysbios_knl_Task_E_stackOverflow ti_sysbios_knl_Task_E_stackOverflow__C; typedef xdc_runtime_Error_Id CT__ti_sysbios_knl_Task_E_spOutOfBounds; extern "C" far const CT__ti_sysbios_knl_Task_E_spOutOfBounds ti_sysbios_knl_Task_E_spOutOfBounds__C; typedef xdc_runtime_Error_Id CT__ti_sysbios_knl_Task_E_deleteNotAllowed; extern "C" far const CT__ti_sysbios_knl_Task_E_deleteNotAllowed ti_sysbios_knl_Task_E_deleteNotAllowed__C; typedef xdc_runtime_Error_Id CT__ti_sysbios_knl_Task_E_moduleStateCheckFailed; extern "C" far const CT__ti_sysbios_knl_Task_E_moduleStateCheckFailed ti_sysbios_knl_Task_E_moduleStateCheckFailed__C; typedef xdc_runtime_Error_Id CT__ti_sysbios_knl_Task_E_objectCheckFailed; extern "C" far const CT__ti_sysbios_knl_Task_E_objectCheckFailed ti_sysbios_knl_Task_E_objectCheckFailed__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Task_A_badThreadType; extern "C" far const CT__ti_sysbios_knl_Task_A_badThreadType ti_sysbios_knl_Task_A_badThreadType__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Task_A_badTaskState; extern "C" far const CT__ti_sysbios_knl_Task_A_badTaskState ti_sysbios_knl_Task_A_badTaskState__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Task_A_noPendElem; extern "C" far const CT__ti_sysbios_knl_Task_A_noPendElem ti_sysbios_knl_Task_A_noPendElem__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Task_A_taskDisabled; extern "C" far const CT__ti_sysbios_knl_Task_A_taskDisabled ti_sysbios_knl_Task_A_taskDisabled__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Task_A_badPriority; extern "C" far const CT__ti_sysbios_knl_Task_A_badPriority ti_sysbios_knl_Task_A_badPriority__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Task_A_badTimeout; extern "C" far const CT__ti_sysbios_knl_Task_A_badTimeout ti_sysbios_knl_Task_A_badTimeout__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Task_A_badAffinity; extern "C" far const CT__ti_sysbios_knl_Task_A_badAffinity ti_sysbios_knl_Task_A_badAffinity__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Task_A_sleepTaskDisabled; extern "C" far const CT__ti_sysbios_knl_Task_A_sleepTaskDisabled ti_sysbios_knl_Task_A_sleepTaskDisabled__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Task_A_invalidCoreId; extern "C" far const CT__ti_sysbios_knl_Task_A_invalidCoreId ti_sysbios_knl_Task_A_invalidCoreId__C; typedef xdc_UInt CT__ti_sysbios_knl_Task_numPriorities; extern "C" far const CT__ti_sysbios_knl_Task_numPriorities ti_sysbios_knl_Task_numPriorities__C; typedef xdc_SizeT CT__ti_sysbios_knl_Task_defaultStackSize; extern "C" far const CT__ti_sysbios_knl_Task_defaultStackSize ti_sysbios_knl_Task_defaultStackSize__C; typedef xdc_runtime_IHeap_Handle CT__ti_sysbios_knl_Task_defaultStackHeap; extern "C" far const CT__ti_sysbios_knl_Task_defaultStackHeap ti_sysbios_knl_Task_defaultStackHeap__C; typedef ti_sysbios_knl_Task_AllBlockedFuncPtr CT__ti_sysbios_knl_Task_allBlockedFunc; extern "C" far const CT__ti_sysbios_knl_Task_allBlockedFunc ti_sysbios_knl_Task_allBlockedFunc__C; typedef xdc_Bool CT__ti_sysbios_knl_Task_initStackFlag; extern "C" far const CT__ti_sysbios_knl_Task_initStackFlag ti_sysbios_knl_Task_initStackFlag__C; typedef xdc_Bool CT__ti_sysbios_knl_Task_checkStackFlag; extern "C" far const CT__ti_sysbios_knl_Task_checkStackFlag ti_sysbios_knl_Task_checkStackFlag__C; typedef xdc_Bool CT__ti_sysbios_knl_Task_deleteTerminatedTasks; extern "C" far const CT__ti_sysbios_knl_Task_deleteTerminatedTasks ti_sysbios_knl_Task_deleteTerminatedTasks__C; typedef ti_sysbios_knl_Task_HookSet __T1_ti_sysbios_knl_Task_hooks; typedef struct { int length; ti_sysbios_knl_Task_HookSet *elem; } __ARRAY1_ti_sysbios_knl_Task_hooks; typedef __ARRAY1_ti_sysbios_knl_Task_hooks __TA_ti_sysbios_knl_Task_hooks; typedef __TA_ti_sysbios_knl_Task_hooks CT__ti_sysbios_knl_Task_hooks; extern "C" far const CT__ti_sysbios_knl_Task_hooks ti_sysbios_knl_Task_hooks__C; typedef ti_sysbios_knl_Task_ModStateCheckFuncPtr CT__ti_sysbios_knl_Task_moduleStateCheckFxn; extern "C" far const CT__ti_sysbios_knl_Task_moduleStateCheckFxn ti_sysbios_knl_Task_moduleStateCheckFxn__C; typedef ti_sysbios_knl_Task_ModStateCheckValueFuncPtr CT__ti_sysbios_knl_Task_moduleStateCheckValueFxn; extern "C" far const CT__ti_sysbios_knl_Task_moduleStateCheckValueFxn ti_sysbios_knl_Task_moduleStateCheckValueFxn__C; typedef xdc_Bool CT__ti_sysbios_knl_Task_moduleStateCheckFlag; extern "C" far const CT__ti_sysbios_knl_Task_moduleStateCheckFlag ti_sysbios_knl_Task_moduleStateCheckFlag__C; typedef ti_sysbios_knl_Task_ObjectCheckFuncPtr CT__ti_sysbios_knl_Task_objectCheckFxn; extern "C" far const CT__ti_sysbios_knl_Task_objectCheckFxn ti_sysbios_knl_Task_objectCheckFxn__C; typedef ti_sysbios_knl_Task_ObjectCheckValueFuncPtr CT__ti_sysbios_knl_Task_objectCheckValueFxn; extern "C" far const CT__ti_sysbios_knl_Task_objectCheckValueFxn ti_sysbios_knl_Task_objectCheckValueFxn__C; typedef xdc_Bool CT__ti_sysbios_knl_Task_objectCheckFlag; extern "C" far const CT__ti_sysbios_knl_Task_objectCheckFlag ti_sysbios_knl_Task_objectCheckFlag__C; typedef xdc_UInt CT__ti_sysbios_knl_Task_numConstructedTasks; extern "C" far const CT__ti_sysbios_knl_Task_numConstructedTasks ti_sysbios_knl_Task_numConstructedTasks__C; typedef void (*CT__ti_sysbios_knl_Task_startupHookFunc)(void); extern "C" far const CT__ti_sysbios_knl_Task_startupHookFunc ti_sysbios_knl_Task_startupHookFunc__C; struct ti_sysbios_knl_Task_Params { size_t __size; const void *__self; void *__fxns; xdc_runtime_IInstance_Params *instance; xdc_UArg arg0; xdc_UArg arg1; xdc_Int priority; xdc_Ptr stack; xdc_SizeT stackSize; xdc_runtime_IHeap_Handle stackHeap; xdc_Ptr env; xdc_Bool vitalTaskFlag; xdc_UInt affinity; xdc_runtime_IInstance_Params __iprms; }; struct ti_sysbios_knl_Task_Struct { ti_sysbios_knl_Queue_Elem __f0; volatile xdc_Int __f1; xdc_UInt __f2; xdc_Ptr __f3; ti_sysbios_knl_Task_Mode __f4; ti_sysbios_knl_Task_PendElem *__f5; xdc_SizeT __f6; __TA_ti_sysbios_knl_Task_Instance_State__stack __f7; xdc_runtime_IHeap_Handle __f8; ti_sysbios_knl_Task_FuncPtr __f9; xdc_UArg __f10; xdc_UArg __f11; xdc_Ptr __f12; __TA_ti_sysbios_knl_Task_Instance_State__hookEnv __f13; xdc_Bool __f14; ti_sysbios_knl_Queue_Handle __f15; xdc_UInt __f16; xdc_UInt __f17; xdc_runtime_Types_CordAddr __name; }; extern "C" xdc_Int ti_sysbios_knl_Task_Module_startup__E( xdc_Int state ); extern "C" xdc_Int ti_sysbios_knl_Task_Module_startup__F( xdc_Int state ); extern "C" xdc_Int ti_sysbios_knl_Task_Instance_init__E(ti_sysbios_knl_Task_Object *, ti_sysbios_knl_Task_FuncPtr fxn, const ti_sysbios_knl_Task_Params *, xdc_runtime_Error_Block *); extern "C" void ti_sysbios_knl_Task_Instance_finalize__E( ti_sysbios_knl_Task_Object* , int ); extern "C" xdc_runtime_Types_Label *ti_sysbios_knl_Task_Handle__label__S( xdc_Ptr obj, xdc_runtime_Types_Label *lab ); extern "C" xdc_Bool ti_sysbios_knl_Task_Module__startupDone__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Task_Object__create__S( xdc_Ptr __oa, xdc_SizeT __osz, xdc_Ptr __aa, const xdc_UChar *__pa, xdc_SizeT __psz, xdc_runtime_Error_Block *__eb ); extern "C" ti_sysbios_knl_Task_Handle ti_sysbios_knl_Task_create( ti_sysbios_knl_Task_FuncPtr fxn, const ti_sysbios_knl_Task_Params *__prms, xdc_runtime_Error_Block *__eb ); extern "C" void ti_sysbios_knl_Task_construct( ti_sysbios_knl_Task_Struct *__obj, ti_sysbios_knl_Task_FuncPtr fxn, const ti_sysbios_knl_Task_Params *__prms, xdc_runtime_Error_Block *__eb ); extern "C" void ti_sysbios_knl_Task_Object__delete__S( xdc_Ptr instp ); extern "C" void ti_sysbios_knl_Task_delete(ti_sysbios_knl_Task_Handle *instp); extern "C" void ti_sysbios_knl_Task_Object__destruct__S( xdc_Ptr objp ); extern "C" void ti_sysbios_knl_Task_destruct(ti_sysbios_knl_Task_Struct *obj); extern "C" xdc_Ptr ti_sysbios_knl_Task_Object__get__S( xdc_Ptr oarr, xdc_Int i ); extern "C" xdc_Ptr ti_sysbios_knl_Task_Object__first__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Task_Object__next__S( xdc_Ptr obj ); extern "C" void ti_sysbios_knl_Task_Params__init__S( xdc_Ptr dst, const void *src, xdc_SizeT psz, xdc_SizeT isz ); extern "C" void ti_sysbios_knl_Task_startup__E( void ); extern "C" xdc_Bool ti_sysbios_knl_Task_enabled__E( void ); extern "C" void ti_sysbios_knl_Task_unlockSched__E( void ); extern "C" xdc_UInt ti_sysbios_knl_Task_disable__E( void ); extern "C" void ti_sysbios_knl_Task_enable__E( void ); extern "C" void ti_sysbios_knl_Task_restore__E( xdc_UInt key ); extern "C" void ti_sysbios_knl_Task_restoreHwi__E( xdc_UInt key ); extern "C" ti_sysbios_knl_Task_Handle ti_sysbios_knl_Task_self__E( void ); extern "C" void ti_sysbios_knl_Task_checkStacks__E( ti_sysbios_knl_Task_Handle oldTask, ti_sysbios_knl_Task_Handle newTask ); extern "C" void ti_sysbios_knl_Task_exit__E( void ); extern "C" void ti_sysbios_knl_Task_sleep__E( xdc_UInt32 nticks ); extern "C" void ti_sysbios_knl_Task_yield__E( void ); extern "C" ti_sysbios_knl_Task_Handle ti_sysbios_knl_Task_getIdleTask__E( void ); extern "C" ti_sysbios_knl_Task_Handle ti_sysbios_knl_Task_getIdleTaskHandle__E( xdc_UInt coreId ); extern "C" void ti_sysbios_knl_Task_startCore__E( xdc_UInt coreId ); extern "C" xdc_UArg ti_sysbios_knl_Task_getArg0__E( ti_sysbios_knl_Task_Handle __inst ); extern "C" xdc_UArg ti_sysbios_knl_Task_getArg1__E( ti_sysbios_knl_Task_Handle __inst ); extern "C" xdc_Ptr ti_sysbios_knl_Task_getEnv__E( ti_sysbios_knl_Task_Handle __inst ); extern "C" ti_sysbios_knl_Task_FuncPtr ti_sysbios_knl_Task_getFunc__E( ti_sysbios_knl_Task_Handle __inst, xdc_UArg *arg0, xdc_UArg *arg1 ); extern "C" xdc_Ptr ti_sysbios_knl_Task_getHookContext__E( ti_sysbios_knl_Task_Handle __inst, xdc_Int id ); extern "C" xdc_Int ti_sysbios_knl_Task_getPri__E( ti_sysbios_knl_Task_Handle __inst ); extern "C" void ti_sysbios_knl_Task_setArg0__E( ti_sysbios_knl_Task_Handle __inst, xdc_UArg arg ); extern "C" void ti_sysbios_knl_Task_setArg1__E( ti_sysbios_knl_Task_Handle __inst, xdc_UArg arg ); extern "C" void ti_sysbios_knl_Task_setEnv__E( ti_sysbios_knl_Task_Handle __inst, xdc_Ptr env ); extern "C" void ti_sysbios_knl_Task_setHookContext__E( ti_sysbios_knl_Task_Handle __inst, xdc_Int id, xdc_Ptr hookContext ); extern "C" xdc_UInt ti_sysbios_knl_Task_setPri__E( ti_sysbios_knl_Task_Handle __inst, xdc_Int newpri ); extern "C" void ti_sysbios_knl_Task_stat__E( ti_sysbios_knl_Task_Handle __inst, ti_sysbios_knl_Task_Stat *statbuf ); extern "C" ti_sysbios_knl_Task_Mode ti_sysbios_knl_Task_getMode__E( ti_sysbios_knl_Task_Handle __inst ); extern "C" xdc_UInt ti_sysbios_knl_Task_setAffinity__E( ti_sysbios_knl_Task_Handle __inst, xdc_UInt coreId ); extern "C" xdc_UInt ti_sysbios_knl_Task_getAffinity__E( ti_sysbios_knl_Task_Handle __inst ); extern "C" void ti_sysbios_knl_Task_block__E( ti_sysbios_knl_Task_Handle __inst ); extern "C" void ti_sysbios_knl_Task_unblock__E( ti_sysbios_knl_Task_Handle __inst ); extern "C" void ti_sysbios_knl_Task_blockI__E( ti_sysbios_knl_Task_Handle __inst ); extern "C" void ti_sysbios_knl_Task_unblockI__E( ti_sysbios_knl_Task_Handle __inst, xdc_UInt hwiKey ); extern "C" void ti_sysbios_knl_Task_schedule__I( void ); extern "C" void ti_sysbios_knl_Task_enter__I( void ); extern "C" void ti_sysbios_knl_Task_sleepTimeout__I( xdc_UArg arg ); extern "C" xdc_Int ti_sysbios_knl_Task_postInit__I( ti_sysbios_knl_Task_Object *task, xdc_runtime_Error_Block *eb ); extern "C" void ti_sysbios_knl_Task_allBlockedFunction__I( void ); extern "C" void ti_sysbios_knl_Task_deleteTerminatedTasksFunc__I( void ); extern "C" void ti_sysbios_knl_Task_processVitalTaskFlag__I( ti_sysbios_knl_Task_Object *task ); extern "C" xdc_Int ti_sysbios_knl_Task_moduleStateCheck__I( ti_sysbios_knl_Task_Module_State *moduleState, xdc_UInt32 checkValue ); extern "C" xdc_UInt32 ti_sysbios_knl_Task_getModuleStateCheckValue__I( ti_sysbios_knl_Task_Module_State *moduleState ); extern "C" xdc_Int ti_sysbios_knl_Task_objectCheck__I( ti_sysbios_knl_Task_Handle handle, xdc_UInt32 checkValue ); extern "C" xdc_UInt32 ti_sysbios_knl_Task_getObjectCheckValue__I( ti_sysbios_knl_Task_Handle handle ); static inline CT__ti_sysbios_knl_Task_Module__id ti_sysbios_knl_Task_Module_id( void ) { return ti_sysbios_knl_Task_Module__id__C; } static inline xdc_Bool ti_sysbios_knl_Task_Module_hasMask( void ) { return ti_sysbios_knl_Task_Module__diagsMask__C != 0; } static inline xdc_Bits16 ti_sysbios_knl_Task_Module_getMask( void ) { return ti_sysbios_knl_Task_Module__diagsMask__C != 0 ? *ti_sysbios_knl_Task_Module__diagsMask__C : 0; } static inline void ti_sysbios_knl_Task_Module_setMask( xdc_Bits16 mask ) { if (ti_sysbios_knl_Task_Module__diagsMask__C != 0) *ti_sysbios_knl_Task_Module__diagsMask__C = mask; } static inline void ti_sysbios_knl_Task_Params_init( ti_sysbios_knl_Task_Params *prms ) { if (prms) { ti_sysbios_knl_Task_Params__init__S(prms, 0, sizeof(ti_sysbios_knl_Task_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline void ti_sysbios_knl_Task_Params_copy(ti_sysbios_knl_Task_Params *dst, const ti_sysbios_knl_Task_Params *src) { if (dst) { ti_sysbios_knl_Task_Params__init__S(dst, (const void *)src, sizeof(ti_sysbios_knl_Task_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline ti_sysbios_knl_Task_Handle ti_sysbios_knl_Task_Object_get(ti_sysbios_knl_Task_Instance_State *oarr, int i) { return (ti_sysbios_knl_Task_Handle)ti_sysbios_knl_Task_Object__get__S(oarr, i); } static inline ti_sysbios_knl_Task_Handle ti_sysbios_knl_Task_Object_first( void ) { return (ti_sysbios_knl_Task_Handle)ti_sysbios_knl_Task_Object__first__S(); } static inline ti_sysbios_knl_Task_Handle ti_sysbios_knl_Task_Object_next( ti_sysbios_knl_Task_Object *obj ) { return (ti_sysbios_knl_Task_Handle)ti_sysbios_knl_Task_Object__next__S(obj); } static inline xdc_runtime_Types_Label *ti_sysbios_knl_Task_Handle_label( ti_sysbios_knl_Task_Handle inst, xdc_runtime_Types_Label *lab ) { return ti_sysbios_knl_Task_Handle__label__S(inst, lab); } static inline xdc_String ti_sysbios_knl_Task_Handle_name( ti_sysbios_knl_Task_Handle inst ) { xdc_runtime_Types_Label lab; return ti_sysbios_knl_Task_Handle__label__S(inst, &lab)->iname; } static inline ti_sysbios_knl_Task_Handle ti_sysbios_knl_Task_handle( ti_sysbios_knl_Task_Struct *str ) { return (ti_sysbios_knl_Task_Handle)str; } static inline ti_sysbios_knl_Task_Struct *ti_sysbios_knl_Task_struct( ti_sysbios_knl_Task_Handle inst ) { return (ti_sysbios_knl_Task_Struct*)inst; } extern "C" { } #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::va_list; #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::size_t; using std::strlen; using std::strcpy; using std::strncpy; using std::strcat; using std::strncat; using std::strchr; using std::strrchr; using std::strcmp; using std::strncmp; using std::strcoll; using std::strxfrm; using std::strpbrk; using std::strspn; using std::strcspn; using std::strstr; using std::strtok; using std::strerror; using std::strdup; using std::memmove; using std::memcpy; using std::memcmp; using std::memchr; using std::memset; #pragma diag_pop using std::ptrdiff_t; using std::size_t; #pragma diag_push #pragma CHECK_MISRA("-19.15") #pragma diag_pop typedef char INT8; typedef short INT16; typedef int INT32; typedef unsigned char UINT8; typedef unsigned short UINT16; typedef unsigned int UINT32; typedef unsigned int uint; typedef void * HANDLE; typedef UINT32 IPN; typedef struct IP6N { union { UINT8 addr8[16]; UINT16 addr16[8]; UINT32 addr32[4]; }u; }IP6N; typedef HANDLE SOCKET; typedef struct _fd_set { uint count; HANDLE fd[16]; } fd_set; extern "C" void fdsetRemoveEntry( fd_set *pSet, HANDLE hEntry ); extern "C" uint fdsetTestEntry( fd_set *pSet, HANDLE hEntry ); extern "C" void mmCopy( void* pDst, void* pSrc, uint Size ); struct linger { int l_onoff; int l_linger; }; struct sockaddr { UINT8 sa_family; char sa_data[14]; }; typedef struct sockaddr SA; typedef struct sockaddr *PSA; struct in_addr { UINT32 s_addr; }; struct ip_mreq { struct in_addr imr_multiaddr; struct in_addr imr_interface; }; struct sockaddr_in { UINT8 sin_family; UINT16 sin_port; struct in_addr sin_addr; INT8 sin_zero[8]; }; typedef struct sockaddr_in SA_IN; typedef struct sockaddr_in* PSA_IN; struct in6_addr { union { UINT8 u6_addr8[16]; UINT16 u6_addr16[8]; UINT32 u6_addr32[4]; }in6_u; }; struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; unsigned int ipv6mr_interface; }; struct sockaddr_in6 { UINT8 sin6_family; UINT16 sin6_port; UINT32 sin6_flowinfo; struct in6_addr sin6_addr; UINT32 sin6_scope_id; }; typedef struct sockaddr_in6 SA_IN6; typedef struct sockaddr_in6* PSA_IN6; struct timeval { INT32 tv_sec; INT32 tv_usec; }; typedef struct _fdpollitem { HANDLE fd; UINT16 eventsRequested; UINT16 eventsDetected; } FDPOLLITEM; extern "C" int fdOpenSession( HANDLE hTask ); extern "C" void fdCloseSession( HANDLE hTask ); extern "C" int fdClose( HANDLE fd ); extern "C" int fdShare( HANDLE fd ); extern "C" int fdError(); extern "C" int fdSelect( int width, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout ); extern "C" void fdSelectAbort( HANDLE hTask ); extern "C" int fdStatus( SOCKET s, int request, int *results ); extern "C" int fdPoll( FDPOLLITEM items[], uint itemcnt, INT32 timeout ); extern "C" SOCKET NDK_accept( SOCKET s, PSA pName, int *plen ); extern "C" int NDK_bind( SOCKET s, PSA pName, int len ); extern "C" int NDK_connect( SOCKET s, PSA pName, int len ); extern "C" int NDK_getpeername( SOCKET s, PSA pName, int *plen ); extern "C" int NDK_getsockname( SOCKET s, PSA pName, int *plen ); extern "C" int NDK_getsockopt( SOCKET s, int level, int op, void *pbuf, int *pbufsize ); extern "C" int NDK_listen( SOCKET s, int maxcon ); extern "C" int NDK_recv( SOCKET s, void *pbuf, int size, int flags ); extern "C" int NDK_recvfrom( SOCKET s, void *pbuf, int size, int flags, PSA pName, int *plen ); extern "C" int NDK_recvnc( SOCKET s, void **ppbuf, int flags, HANDLE *pHandle ); extern "C" int NDK_recvncfrom( SOCKET s, void **ppbuf, int flags, PSA pName, int *plen, HANDLE *pHandle ); extern "C" void NDK_recvncfree( SOCKET Handle ); extern "C" int NDK_send( SOCKET s, void *pbuf, int size, int flags ); extern "C" int NDK_sendto( SOCKET s, void *pbuf, int size, int flags, PSA pName, int len ); extern "C" int NDK_setsockopt( SOCKET s, int level, int op, void *pbuf, int bufsize ); extern "C" int NDK_shutdown( SOCKET s, int how ); extern "C" SOCKET NDK_socket( int domain, int type, int protocol ); extern "C" int NDK_getsendncbuff(SOCKET s, UINT32 bufSize, void** phBuf, HANDLE* phPkt); extern "C" int NDK_sendnc( SOCKET s, void *pbuf, int size, HANDLE hPkt, int flags ); extern "C" void NDK_sendncfree( SOCKET Handle ); extern "C" int pipe( HANDLE *pfd1, HANDLE *pfd2 ); typedef void (*TimestampFxn)(UINT8 *pIpHdr); static inline void FD_ZERO(fd_set *pFdSet) { ((pFdSet)->count=0); } static inline void FD_CLR(HANDLE fd, fd_set *pFdSet) { fdsetRemoveEntry( (pFdSet), (fd) ); } static inline int FD_ISSET(HANDLE fd, fd_set *pFdSet) { return (fdsetTestEntry( (pFdSet), (fd) )); } static inline void FD_SET(HANDLE fd, fd_set *pFdSet) { {if((pFdSet)->count<16){(pFdSet)->fd[(pFdSet)->count++]=(fd);}}; } static inline void FD_COPY(fd_set *pFdSetSRC, fd_set *pFdSetDST) { mmCopy((pFdSetDST), (pFdSetSRC), sizeof(fd_set)); } static inline SOCKET accept(SOCKET s, PSA pName, int *plen) { return NDK_accept(s, pName, plen); } static inline int bind(SOCKET s, PSA pName, int len) { return NDK_bind(s, pName, len); } static inline int connect(SOCKET s, PSA pName, int len) { return NDK_connect(s, pName, len); } static inline int getpeername(SOCKET s, PSA pName, int *plen) { return NDK_getpeername(s, pName, plen); } static inline int getsendncbuff(SOCKET s, UINT32 bufSize, void **phBuf, HANDLE *phPkt) { return NDK_getsendncbuff(s, bufSize, phBuf, phPkt); } static inline int getsockname(SOCKET s, PSA pName, int *plen) { return NDK_getsockname(s, pName, plen); } static inline int getsockopt(SOCKET s, int level, int op, void *pbuf, int *pbufsize) { return NDK_getsockopt(s, level, op, pbuf, pbufsize); } static inline int listen(SOCKET s, int maxcon) { return NDK_listen(s, maxcon); } static inline int recv(SOCKET s, void *pbuf, int size, int flags) { return NDK_recv(s, pbuf, size, flags); } static inline int recvfrom(SOCKET s, void *pbuf, int size, int flags, PSA pName, int *plen) { return NDK_recvfrom(s, pbuf, size, flags, pName, plen); } static inline int recvnc(SOCKET s, void **ppbuf, int flags, HANDLE *pHandle) { return NDK_recvnc(s, ppbuf, flags, pHandle); } static inline int recvncfrom(SOCKET s, void **ppbuf, int flags, PSA pName, int *plen, HANDLE *pHandle) { return NDK_recvncfrom(s, ppbuf, flags, pName, plen, pHandle); } static inline void recvncfree(SOCKET Handle) { NDK_recvncfree(Handle); } static inline int send(SOCKET s, void *pbuf, int size, int flags) { return NDK_send(s, pbuf, size, flags); } static inline int sendto(SOCKET s, void *pbuf, int size, int flags, PSA pName, int len) { return NDK_sendto(s, pbuf, size, flags, pName, len); } static inline int sendnc(SOCKET s, void *pbuf, int size, HANDLE hPkt, int flags) { return NDK_sendnc(s, pbuf, size, hPkt, flags); } static inline void sendncfree(SOCKET Handle) { NDK_sendncfree(Handle); } static inline int setsockopt(SOCKET s, int level, int op, void *pbuf, int bufsize) { return NDK_setsockopt(s, level, op, pbuf, bufsize); } static inline int shutdown(SOCKET s, int how) { return NDK_shutdown(s, how); } static inline SOCKET socket(int domain, int type, int protocol) { return NDK_socket(domain, type, protocol); } typedef struct _osenvcfg { uint DbgPrintLevel; uint DbgAbortLevel; int TaskPriLow; int TaskPriNorm; int TaskPriHigh; int TaskPriKern; int TaskStkLow; int TaskStkNorm; int TaskStkHigh; } OSENVCFG; extern OSENVCFG _oscfg; extern int stricmp(const char *s1, const char *s2); typedef struct _PBM_Pkt { UINT32 Type; struct _PBM_Pkt *pPrev; struct _PBM_Pkt *pNext; UINT8 *pDataBuffer; uint BufferLen; uint Flags; uint ValidLen; uint DataOffset; uint EtherType; uint L2HdrLen; uint IpHdrLen; HANDLE hIFRx; HANDLE hIFTx; HANDLE hRoute; UINT16 PktPriority; UINT32 Aux1; UINT32 Aux2; TimestampFxn pTimestampFxn; UINT8 *pIpHdr; } PBM_Pkt; typedef void * PBM_Handle; extern "C" uint PBM_open(); extern "C" void PBM_close(); extern "C" PBM_Handle PBM_alloc( uint MaxSize ); extern "C" PBM_Handle PBM_copy( PBM_Handle hPkt ); extern "C" void PBM_free( PBM_Handle hPkt ); typedef struct _PBMQ { uint Count; PBM_Pkt *pHead; PBM_Pkt *pTail; } PBMQ; extern "C" void PBMQ_enq( PBMQ *pQ, PBM_Handle hPkt ); extern "C" PBM_Handle PBMQ_deq( PBMQ *pQ ); typedef struct _stkevent { HANDLE hSemEvent; uint EventCodes[5]; } STKEVENT; typedef void * STKEVENT_Handle; extern "C" void TaskBlock(HANDLE h); extern "C" HANDLE TaskCreate( void(*pFun)(), char *Name, int Priority, uint StackSize, UINT32 Arg1, UINT32 Arg2, UINT32 Arg3 ); extern "C" void TaskDestroy( HANDLE h ); extern "C" void TaskExit(); extern "C" HANDLE TaskGetEnv( HANDLE h, int Slot ); extern "C" int TaskGetPri(HANDLE h); extern "C" HANDLE TaskSelf(); extern "C" void TaskSetEnv( HANDLE h, int Slot, HANDLE hEnv ); extern "C" int TaskSetPri(HANDLE h, int priority); extern "C" void TaskSleep(UINT32 delay); extern "C" void TaskYield(); extern "C" void llEnter(); extern "C" void llExit(); extern "C" void NotifyLowResource(void); extern "C" HANDLE SemCreate(int Count); extern "C" HANDLE SemCreateBinary(int Count); extern "C" void SemDelete(HANDLE hSem); extern "C" int SemCount(HANDLE hSem); extern "C" int SemPend(HANDLE hSem, UINT32 Timeout); extern "C" void SemPost(HANDLE hSem); extern "C" void SemReset(HANDLE hSem, int Count); extern "C" void *mmAlloc( uint Size ); extern "C" void mmFree( void* pv ); extern "C" void mmCopy( void* pDst, void* pSrc, uint Size ); extern "C" void mmZeroInit( void* pDst, uint Size ); extern "C" void *mmBulkAlloc( INT32 Size ); extern "C" void mmBulkFree( void *pMemory ); extern int DebugCritError; extern "C" void DbgPrintf(uint Level, char *fmt, ... ); extern "C" uint OEMSysCritOn(); extern "C" void OEMSysCritOff( uint enable ); extern "C" void OEMCacheClean( void *pAddr, uint Length ); extern "C" void OEMCacheCleanSynch(); extern "C" int NDK_sprintf(char *s, const char *format, ...); extern "C" int NDK_vsprintf(char *s, const char *format, va_list arg); typedef void (*EFSFUN)(); extern "C" void efs_createfile( char *name, INT32 length, UINT8 *pData ); extern "C" void efs_createfilecb( char *name, INT32 length, UINT8 *pData, EFSFUN pllDestroyFun, UINT32 MemMgrArg ); extern "C" void efs_destroyfile( char *name ); extern "C" EFSFUN efs_loadfunction( char *name ); extern "C" void *efs_fopen( char *name, char *mode ); extern "C" int efs_fclose( void *stream ); extern "C" int efs_feof( void *stream ); extern "C" size_t efs_fread( void *ptr, size_t size, size_t nobj, void *stream ); extern "C" size_t efs_fwrite( void *ptr, size_t size, size_t nobj, void *stream ); extern "C" INT32 efs_fseek( void *stream, INT32 offset, int origin ); extern "C" INT32 efs_ftell( void *stream ); extern "C" void efs_rewind( void *stream ); extern "C" INT32 efs_getfilesize( void *f ); extern "C" size_t efs_filesend( void *stream, size_t size, SOCKET s ); extern "C" int efs_filecheck(char *name, char *user, char *pass, int *prealm); typedef struct _IntSetup { UINT8 intVectId; UINT8 sysEvtId[128]; UINT8 sysEvtCount; void (*pCallbackFxn)(void* pCallbackArg); void* pCallbackArg; UINT8 bEnable; } IntSetup; UINT32 Interrupt_add(IntSetup* myIntSetup); UINT32 Interrupt_delete(IntSetup* myIntSetup); UINT32 Interrupt_enable(IntSetup* myIntSetup); UINT32 Interrupt_disable(IntSetup* myIntSetup); extern "C" uint _llPacketInit(STKEVENT_Handle h); extern "C" void _llPacketShutdown(); extern "C" void _llPacketServiceCheck( uint fTimerTick ); extern "C" uint llPacketOpen( uint dev, HANDLE hEther ); extern "C" void llPacketClose( uint dev ); extern "C" void llPacketSend( uint dev, PBM_Handle hPkt ); extern "C" void llPacketSetRxFilter( uint dev, uint filter ); extern "C" void llPacketGetMacAddr( uint dev, UINT8 *pbData ); extern "C" uint llPacketGetMCastMax( uint dev ); extern "C" void llPacketSetMCast( uint dev, uint addrcnt, UINT8 *bAddr ); extern "C" uint llPacketGetMCast( uint dev, uint maxaddr, UINT8 *bAddr ); extern "C" uint llPacketIoctl( uint dev, uint cmd, void *arg); extern "C" void llPacketService(); extern "C" uint _llSerialInit(STKEVENT_Handle h); extern "C" void _llSerialShutdown(); extern "C" void _llSerialServiceCheck(uint fTimerTick); extern "C" uint _llSerialSend(uint dev, UINT8 *pBuf, uint len); extern "C" uint llSerialOpen(uint dev, void (*cbInput)(char c)); extern "C" void llSerialClose( uint dev ); extern "C" uint llSerialOpenHDLC( uint dev, HANDLE hHDLC, void (*cbTimer)(HANDLE h), void (*cbInput)(PBM_Handle hPkt) ); extern "C" void llSerialCloseHDLC( uint dev ); extern "C" void llSerialSendPkt( uint dev, PBM_Handle hPkt ); extern "C" void llSerialHDLCPeerMap( uint dev, UINT32 peerMap ); extern "C" void llSerialService(); extern "C" void llSerialConfig( uint dev, uint baud, uint mode, uint flowctrl ); extern "C" void _llTimerInit( STKEVENT_Handle h, UINT32 ctime ); extern "C" void _llTimerShutdown(); extern "C" UINT32 llTimerGetTime( UINT32 *pMSFrac ); extern "C" UINT32 llTimerGetStartTime(); extern "C" void _llUserLedInit(); extern "C" void _llUserLedShutdown(); extern "C" void LED_ON(UINT32 ledId); extern "C" void LED_OFF(UINT32 ledId); extern "C" void LED_TOGGLE(UINT32 ledId); typedef struct _ntargs { int CallMode; int IfIdx; IPN IPAddr; HANDLE hCallback; void(*pCb)( HANDLE, uint ); } NTARGS; extern "C" HANDLE CfgNew(); extern "C" void CfgFree( HANDLE hCfg ); extern "C" void CfgSetDefault( HANDLE hCfg ); extern "C" HANDLE CfgGetDefault(); extern "C" int CfgLoad( HANDLE hCfg, int Size, UINT8 *pData ); extern "C" int CfgSave( HANDLE hCfg, int *pSize, UINT8 *pData ); extern "C" int CfgSetExecuteOrder( HANDLE hCfg, uint Tags, uint *pOpenOrder, uint *pCloseOrder ); extern "C" int CfgExecute( HANDLE hCfg, uint fExecute ); extern "C" int CfgSetService( HANDLE hCfg, uint Tag, int (*pCb) (HANDLE, uint, uint, uint, HANDLE) ); extern "C" int CfgAddEntry( HANDLE hCfg, uint Tag, uint Item, uint Mode, int Size, UINT8 *pData, HANDLE *phCfgEntry ); extern "C" int CfgRemoveEntry( HANDLE hCfg, HANDLE hCfgEntry ); extern "C" int CfgGetEntryCnt( HANDLE hCfg, uint Tag, uint Item ); extern "C" int CfgGetEntry( HANDLE hCfg, uint Tag, uint Item, uint Index, HANDLE *phCfgEntry ); extern "C" int CfgGetNextEntry( HANDLE hCfg, HANDLE hCfgEntry, HANDLE *phCfgEntryNext ); extern "C" int CfgGetImmediate( HANDLE hCfg, uint Tag, uint Item, uint Instance, int MaxSize, UINT8 *pData ); extern "C" int CfgEntryRef( HANDLE hCfgEntry ); extern "C" int CfgEntryDeRef( HANDLE hCfgEntry ); extern "C" int CfgEntryGetData( HANDLE hCfgEntry, int *pSize, UINT8 *pData ); extern "C" int CfgEntrySetData( HANDLE hCfgEntry, int Size, UINT8 *pData ); extern "C" int CfgEntryInfo( HANDLE hCfgEntry, int *pSize, UINT8 **ppData ); extern "C" HANDLE DaemonNew( uint Type, IPN LocalAddress, uint LocalPort, int (*pCb)(SOCKET,UINT32), uint Priority, uint StackSize, UINT32 Argument, uint MaxSpawn ); extern "C" void DaemonFree( HANDLE hEntry ); typedef struct _ntparam_dhcp { UINT8 *pOptions; int len; } NTPARAM_DHCP; extern "C" HANDLE DHCPOpen( NTARGS *pNTA, NTPARAM_DHCP *pNTP ); extern "C" void DHCPClose( HANDLE hDHCP ); typedef struct _ntparam_dhcps { uint Flags; IPN PoolBase; uint PoolCount; } NTPARAM_DHCPS; extern "C" HANDLE DHCPSOpen( NTARGS *pNTA, NTPARAM_DHCPS *pNTP ); extern "C" void DHCPSClose( HANDLE hDHCPS ); struct _hostent { char *h_name; int h_addrtype; int h_length; int h_addrcnt; IPN h_addr[8]; }; typedef struct _hostent HOSTENT; extern char *DNSErrorStrings[20]; extern "C" int DNSGetHostname( char *pNameBuf, int size ); extern "C" int DNSGetHostByAddr( IPN IPAddr, void *pScrapBuf, int size ); extern "C" int DNSGetHostByName( char *Name, void *pScrapBuf, int size ); extern "C" HANDLE DNSServerOpen( NTARGS *pNTA ); extern "C" void DNSServerClose( HANDLE h ); typedef struct _ntparam_http { int MaxCon; int Port; } NTPARAM_HTTP; extern "C" HANDLE httpOpen( NTARGS *pNTA, NTPARAM_HTTP *pNTP ); extern "C" void httpClose(HANDLE h); extern "C" int httpClientProcess( SOCKET Sock, UINT32 unused ); extern char *CONTENT_TYPE_APPLET; extern char *CONTENT_TYPE_AU; extern char *CONTENT_TYPE_CSS; extern char *CONTENT_TYPE_DOC; extern char *CONTENT_TYPE_GIF; extern char *CONTENT_TYPE_HTML; extern char *CONTENT_TYPE_JPG; extern char *CONTENT_TYPE_MPEG; extern char *CONTENT_TYPE_PDF; extern char *CONTENT_TYPE_WAV; extern char *CONTENT_TYPE_ZIP; extern char *CONTENT_TYPE; extern char *CONTENT_LENGTH; extern char *CRLF; extern char *DEFAULT_NAME; extern char *HTTP_VER; extern char *SPACE; enum HTTP_STATUS_CODE { HTTP_OK=200, HTTP_NO_CONTENT=204, HTTP_BAD_REQUEST=400, HTTP_AUTH_REQUIRED=401, HTTP_NOT_FOUND=404, HTTP_NOT_ALLOWED=405, HTTP_NOT_IMPLEMENTED=501, HTTP_STATUS_CODE_END }; extern "C" int httpVersion(void); extern "C" void httpSendClientStr( SOCKET Sock, char *Response ); extern "C" void httpSendStatusLine( SOCKET Sock, int StatusCode, char *ContentType ); extern "C" void httpSendFullResponse( SOCKET Sock, int StatusCode, char *RequestedFile ); extern "C" void httpSendEntityLength( SOCKET Sock, INT32 EntityLength ); extern "C" void httpSendErrorResponse( SOCKET Sock, int StatusCode ); extern "C" int (*httpErrorResponseHook)(SOCKET Sock, int StatusCode); struct addrinfo { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; size_t ai_addrlen; struct sockaddr *ai_addr; char *ai_canonname; struct addrinfo *ai_next; }; extern "C" IPN inet_addr( const char * ); extern "C" int inet_aton( const char *, struct in_addr * ); extern "C" const char *inet_ntop(int af, const void *src, char *dst, int cnt); extern "C" int inet_pton(int af, const char *src, void *dst); extern "C" int getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res); extern "C" void freeaddrinfo(struct addrinfo *ai); extern "C" HANDLE NtAddNetwork( HANDLE hIF, IPN dwIP, IPN dwIPMask ); extern "C" void NtRemoveNetwork( HANDLE hBind ); extern "C" HANDLE NtAddStaticGateway( IPN IPTgtAddr, IPN IPTgtMask, IPN IPGateway ); extern "C" int NtRemoveStaticGateway( IPN IPTarget ); extern "C" int NtIfIdx2Ip( uint IfIdx, IPN *pIPAddr ); extern "C" int NtGetPublicHost( IPN *pIPAddr, uint MaxSize, UINT8 *pDomain ); extern "C" void NtIPN2Str( IPN IPAddr, char *str ); typedef struct _ntparam_telnet { int MaxCon; int Port; SOCKET (*Callback)(PSA); } NTPARAM_TELNET; extern "C" HANDLE TelnetOpen( NTARGS *pNTA, NTPARAM_TELNET *pNTP ); extern "C" void TelnetClose( HANDLE h ); extern "C" int telnetClientProcess( SOCKET s, SOCKET (*cbfn)(PSA) ); extern "C" int NtTftpRecv( UINT32 TftpIp, char *szFileName, char *FileBuffer, UINT32 *FileSize, UINT16 *pErrorCode ); typedef struct _ntparam_nat { IPN IPVirt; IPN IPMask; uint MTU; } NTPARAM_NAT; extern "C" HANDLE NATOpen( NTARGS *pNTA, NTPARAM_NAT *pNTP ); extern "C" void NATClose( HANDLE hNAT ); typedef struct _ci_srvargs { uint Item; HANDLE hService; uint Mode; uint Status; uint ReportCode; uint IfIdx; IPN IPAddr; void(*pCbSrv)(uint, uint, uint, HANDLE); } CISARGS; typedef struct _ci_service_telnet { CISARGS cisargs; NTPARAM_TELNET param; } CI_SERVICE_TELNET; typedef struct _ci_service_http { CISARGS cisargs; NTPARAM_HTTP param; } CI_SERVICE_HTTP; typedef struct _ci_service_nat { CISARGS cisargs; NTPARAM_NAT param; } CI_SERVICE_NAT; typedef struct _ci_service_dhcps { CISARGS cisargs; NTPARAM_DHCPS param; } CI_SERVICE_DHCPS; typedef struct _ci_service_dhcpc { CISARGS cisargs; NTPARAM_DHCP param; } CI_SERVICE_DHCPC; typedef struct _ci_service_dnss { CISARGS cisargs; } CI_SERVICE_DNSSERVER; typedef struct _ci_ipnet { uint NetType; IPN IPAddr; IPN IPMask; HANDLE hBind; char Domain[64]; } CI_IPNET; typedef struct _ci_route { IPN IPDestAddr; IPN IPDestMask; IPN IPGateAddr; HANDLE hRoute; } CI_ROUTE; typedef struct _ci_client { uint ClientType; uint Status; IPN IPAddr; char MacAddr[6]; char Hostname[256]; UINT32 TimeStatus; UINT32 TimeExpire; } CI_CLIENT; typedef struct _ci_acct { uint Flags; char Username[32]; char Password[32]; } CI_ACCT; extern "C" int NC_SystemOpen( int Priority, int OpMode ); extern "C" void NC_SystemClose(); extern "C" int NC_NetStart( HANDLE hCfg, void (*NetStart)(), void (*NetStop)(), void (*NetIP)(IPN,uint,uint) ); extern "C" void NC_NetStop( int rc ); extern "C" void NC_BootComplete(); extern "C" void NC_IPUpdate( IPN IPAddr, uint IfIdx, uint fAdd ); extern "C" void NC_setLinkHook( void (*LinkHook)(int) ); typedef int(*NS_ValidateAddress)(IPN ipAddr); extern void NS_setAddrHook(NS_ValidateAddress fxn); extern "C" void NS_PreBoot(); extern "C" void NS_BootTask( HANDLE hCfg ); extern "C" int NetworkStackInit(char* Ip); extern "C" namespace std { typedef unsigned int clock_t; typedef unsigned int __time32_t; typedef long long __time64_t; typedef __time32_t time_t; struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; }; typedef struct { short daylight; long timezone; char tzname[4]; char dstname[4]; } TZ; extern __far TZ _tz; clock_t clock(void); __time32_t __time32(__time32_t *_timer); __time32_t __mktime32(struct tm *_tptr); double __difftime32(__time32_t _time1, __time32_t _time0); extern "C" char *__ctime32(const __time32_t *_timer); struct tm *__gmtime32(const __time32_t *_timer); struct tm *__localtime32(const __time32_t *_timer); __time64_t __time64(__time64_t *_timer); __time64_t __mktime64(struct tm *_tptr); double __difftime64(__time64_t _time1, __time64_t _time0); extern "C" char *__ctime64(const __time64_t *_timer); struct tm *__gmtime64(const __time64_t *_timer); struct tm *__localtime64(const __time64_t *_timer); char *asctime(const struct tm *_timeptr); size_t strftime(char *_out, size_t _maxsize, const char *_format, const struct tm *_timeptr); time_t time(time_t *_timer); time_t mktime(struct tm *_tptr); double difftime(time_t _time1, time_t _time0); extern "C" char *ctime(const time_t *_timer); struct tm *gmtime(const time_t *_timer); struct tm *localtime(const time_t *_timer); } using std::size_t; using std::clock_t; using std::clock; using std::tm; using std::TZ; using std::_tz; using std::__time32_t; using std::__time64_t; using std::__time32; using std::__time64; using std::__ctime32; using std::__ctime64; using std::__difftime32; using std::__difftime64; using std::__gmtime32; using std::__gmtime64; using std::__localtime32; using std::__localtime64; using std::__mktime32; using std::__mktime64; using std::time_t; using std::time; using std::ctime; using std::difftime; using std::gmtime; using std::localtime; using std::mktime; using std::asctime; using std::strftime; class UdpClient { SOCKET ConnectSocket; char Ip[100]; int port; public: UdpClient(); ~UdpClient(); bool Connect(char* ip, char* port); void Send(void* buff, int size); int Read(void* readBuff, int size); void Close(); }; class UdpServer { private: sockaddr_in myAddrStruct; sockaddr_in clientAddrStruct; SOCKET channel; int port; public: UdpServer(); ~UdpServer(); const UdpServer* Share() const; bool Connect(int); void Send(void* buff, int size); int Read(void* readBuff, int size); void SendStream(void* buff, int size); }; class TcpServer { private: SOCKET ListenSocket; SOCKET ClientSocket; public: TcpServer(); ~TcpServer(); bool Connect(char*); int Send(void* buff, int size); int Read(void* readBuff, int size); }; class NTPClient { private: #pragma pack(push) #pragma pack(1) struct ntp_time { unsigned int seconds; unsigned int fraction; }; struct ntp3_header { union { struct { unsigned int LI :2; unsigned int version :3; unsigned int mode :3; unsigned int straum :8; unsigned int poll_interval :8; unsigned int precision :8; }; unsigned int value; } first_byte; int rootdelay; int root_dispersion; unsigned int reference_clock_identifier; ntp_time ref_timestamp; ntp_time originate_timestamp; ntp_time recv_timestamp; ntp_time transmit_timestamp; }; #pragma pack(pop) private: UdpClient u; ntp3_header sent_ntp_pkg; unsigned int readbuff[120]; public: NTPClient() { sent_ntp_pkg.first_byte.value = 0x1b; } ~NTPClient() { u.Close(); } bool ConnectToServer(char* ip) { return u.Connect(ip, "123"); } double GetTime_msec() { u.Send(&sent_ntp_pkg, sizeof(sent_ntp_pkg)); u.Read(readbuff, sizeof(readbuff)); ntp3_header* p_recv_ntp_pkg = (ntp3_header*) readbuff; time_t time = ((((p_recv_ntp_pkg->transmit_timestamp . seconds) & 0xff000000) >> 24) | (((p_recv_ntp_pkg->transmit_timestamp . seconds) & 0x00ff0000) >> 8) | (((p_recv_ntp_pkg->transmit_timestamp . seconds) & 0x0000ff00) << 8) | (((p_recv_ntp_pkg->transmit_timestamp . seconds) & 0x000000ff) << 24) ) - 2208988800; unsigned int frac = ((((p_recv_ntp_pkg->transmit_timestamp . fraction) & 0xff000000) >> 24) | (((p_recv_ntp_pkg->transmit_timestamp . fraction) & 0x00ff0000) >> 8) | (((p_recv_ntp_pkg->transmit_timestamp . fraction) & 0x0000ff00) << 8) | (((p_recv_ntp_pkg->transmit_timestamp . fraction) & 0x000000ff) << 24) ); double time_ms = time * 1000 + 0.000976 * 1000 * (frac >> 22); return time_ms; } double GetTime_sec() { u.Send(&sent_ntp_pkg, sizeof(sent_ntp_pkg)); u.Read(readbuff, sizeof(readbuff)); ntp3_header* p_recv_ntp_pkg = (ntp3_header*) readbuff; return ((((p_recv_ntp_pkg->transmit_timestamp . seconds) & 0xff000000) >> 24) | (((p_recv_ntp_pkg->transmit_timestamp . seconds) & 0x00ff0000) >> 8) | (((p_recv_ntp_pkg->transmit_timestamp . seconds) & 0x0000ff00) << 8) | (((p_recv_ntp_pkg->transmit_timestamp . seconds) & 0x000000ff) << 24) ) - 2208988800; } }; namespace std { } namespace __std_alias = std; namespace stlport = std; namespace _STL = std; #pragma diag_push #pragma CHECK_MISRA("-19.15") #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.15") #pragma diag_pop using std::ptrdiff_t; using std::size_t; #pragma diag_push #pragma CHECK_MISRA("-19.15") #pragma diag_pop namespace std { class exception { public: exception() throw(); exception(const exception&) throw(); exception& operator=(const exception&) throw(); virtual ~exception() throw(); virtual const char* what() const throw(); }; typedef bool __bool; class bad_exception : public exception { public: bad_exception() throw(); bad_exception(const bad_exception&) throw(); bad_exception& operator=(const bad_exception&) throw(); virtual ~bad_exception() throw(); virtual const char* what() const throw(); }; typedef void (*terminate_handler)(); extern terminate_handler set_terminate(terminate_handler) throw(); typedef void (*unexpected_handler)(); extern unexpected_handler set_unexpected(unexpected_handler) throw(); void terminate(); void unexpected(); extern __bool uncaught_exception() throw(); } namespace std { class bad_alloc : public exception { public: bad_alloc() throw(); bad_alloc(const bad_alloc&) throw(); bad_alloc& operator=(const bad_alloc&) throw(); virtual ~bad_alloc() throw(); virtual const char* what() const throw(); }; typedef void (*new_handler)(); new_handler set_new_handler(new_handler) throw(); struct nothrow_t { }; const nothrow_t nothrow = {}; } void *operator new(size_t) throw(std::bad_alloc); void operator delete(void*) throw (); void *operator new(size_t, const std::nothrow_t&) throw(); void operator delete(void*, const std::nothrow_t&) throw(); void *operator new(size_t, void*) throw(); void operator delete(void*, void*) throw(); void *operator new[](size_t) throw(std::bad_alloc); void operator delete[](void*) throw (); void *operator new[](size_t, void*) throw(); void operator delete[](void*, void*) throw(); void *operator new[](size_t, const std::nothrow_t&) throw(); void operator delete[](void*, const std::nothrow_t&) throw(); namespace std { inline void* __stl_new(size_t __n) { return ::operator new(__n); } inline void __stl_delete(void* __p) { ::operator delete(__p); } } namespace std { struct input_iterator_tag {}; struct output_iterator_tag {}; struct forward_iterator_tag : public input_iterator_tag {}; struct bidirectional_iterator_tag : public forward_iterator_tag {}; struct random_access_iterator_tag : public bidirectional_iterator_tag {}; template struct iterator { typedef _Category iterator_category; typedef _Tp value_type; typedef _Distance difference_type; typedef _Pointer pointer; typedef _Reference reference; }; template< > struct iterator { typedef output_iterator_tag iterator_category; typedef void value_type; typedef void difference_type; typedef void pointer; typedef void reference; }; template struct iterator_traits { typedef typename _Iterator::iterator_category iterator_category; typedef typename _Iterator::value_type value_type; typedef typename _Iterator::difference_type difference_type; typedef typename _Iterator::pointer pointer; typedef typename _Iterator::reference reference; }; template struct iterator_traits { typedef random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef ptrdiff_t difference_type; typedef const _Tp* pointer; typedef const _Tp& reference; }; template struct iterator_traits<_Tp*> { typedef random_access_iterator_tag iterator_category; typedef _Tp value_type; typedef ptrdiff_t difference_type; typedef _Tp* pointer; typedef _Tp& reference; }; } namespace std { template struct input_iterator : public iterator {}; struct output_iterator : public iterator {}; template struct forward_iterator : public iterator {}; template struct bidirectional_iterator : public iterator {}; template struct random_access_iterator : public iterator {}; namespace priv { template inline typename iterator_traits<_InputIterator> ::difference_type __distance(const _InputIterator& __first, const _InputIterator& __last, const input_iterator_tag &) { typename iterator_traits<_InputIterator> ::difference_type __n = 0; _InputIterator __it(__first); while (__it != __last) { ++__it; ++__n; } return __n; } template inline typename iterator_traits<_RandomAccessIterator> ::difference_type __distance(const _RandomAccessIterator& __first, const _RandomAccessIterator& __last, const random_access_iterator_tag &) { return __last - __first; } } template inline typename iterator_traits<_InputIterator> ::difference_type distance(_InputIterator __first, _InputIterator __last) { return ::std::priv:: __distance(__first, __last, typename ::std::iterator_traits< _InputIterator > ::iterator_category()); } template inline void distance(const _InputIterator& __first, const _InputIterator& __last, _Distance& __n) { __n += ::std::distance(__first, __last); } template struct _Nonconst_traits; template struct _Const_traits { typedef _Tp value_type; typedef const _Tp& reference; typedef const _Tp* pointer; typedef _Const_traits<_Tp> _ConstTraits; typedef _Nonconst_traits<_Tp> _NonConstTraits; }; template struct _Nonconst_traits { typedef _Tp value_type; typedef _Tp& reference; typedef _Tp* pointer; typedef _Const_traits<_Tp> _ConstTraits; typedef _Nonconst_traits<_Tp> _NonConstTraits; }; template struct _Nonconst_Const_traits; template struct _Const_Const_traits { typedef _Tp value_type; typedef const _Tp& reference; typedef const _Tp* pointer; typedef _Const_Const_traits<_Tp> _ConstTraits; typedef _Nonconst_Const_traits<_Tp> _NonConstTraits; }; template struct _Nonconst_Const_traits { typedef _Tp value_type; typedef const _Tp& reference; typedef const _Tp* pointer; typedef _Const_Const_traits<_Tp> _ConstTraits; typedef _Nonconst_Const_traits<_Tp> _NonConstTraits; }; namespace priv { template inline void __advance(_InputIter& __i, _Distance __n, const input_iterator_tag &) { while (__n--) ++__i; } template inline void __advance(_InputIter& __i, _Distance __n, const output_iterator_tag &) { while (__n--) ++__i; } template inline void __advance(_BidirectionalIterator& __i, _Distance __n, const bidirectional_iterator_tag &) { if (__n > 0) while (__n--) ++__i; else while (__n++) --__i; } template inline void __advance(_RandomAccessIterator& __i, _Distance __n, const random_access_iterator_tag &) { __i += __n; } } template inline void advance(_InputIterator& __i, _Distance __n) { ::std::priv:: __advance(__i, __n, typename ::std::iterator_traits< _InputIterator > ::iterator_category()); } } namespace std { struct __true_type {}; struct __false_type {}; namespace priv { using ::std::__true_type; using ::std::__false_type; } template struct __bool2type { typedef __true_type _Ret; }; template< > struct __bool2type<1> { typedef __true_type _Ret; }; template< > struct __bool2type<0> { typedef __false_type _Ret; }; template struct __type2bool { enum __attribute__((__packed__)) {_Ret = 1}; }; template< > struct __type2bool<__true_type> { enum __attribute__((__packed__)) {_Ret = 1}; }; template< > struct __type2bool<__false_type> { enum __attribute__((__packed__)) {_Ret = 0}; }; template struct _Not { typedef __false_type _Ret; }; template< > struct _Not<__false_type> { typedef __true_type _Ret; }; template struct _Land2 { typedef __false_type _Ret; }; template< > struct _Land2<__true_type, __true_type> { typedef __true_type _Ret; }; template struct _Land3 { typedef __false_type _Ret; }; template< > struct _Land3<__true_type, __true_type, __true_type> { typedef __true_type _Ret; }; template struct _Lor2 { typedef __true_type _Ret; }; template< > struct _Lor2<__false_type, __false_type> { typedef __false_type _Ret; }; template struct _Lor3 { typedef __true_type _Ret; }; template< > struct _Lor3<__false_type, __false_type, __false_type> { typedef __false_type _Ret; }; template struct __select { typedef _Tp1 _Ret; }; template struct __select { typedef _Tp2 _Ret; }; struct _NoVolatilePointerShim { _NoVolatilePointerShim(const void*); }; template char _IsCopyableFun(bool, _NoVolatilePointerShim, _Tp const*, _Tp*); char* _IsCopyableFun(bool, ...); template struct _Copyable { static _Src* __null_src(); static _Dst* __null_dst(); enum __attribute__((__packed__)) { _Ret = (sizeof(_IsCopyableFun(false, __null_src(), __null_src(), __null_dst())) == sizeof(char)) }; typedef typename __bool2type<_Ret>::_Ret _RetT; }; template struct _AreCopyable { enum __attribute__((__packed__)) { _Same = _Copyable<_Src, _Dst>::_Ret }; typedef typename _Copyable<_Src, _Dst>::_RetT _Ret; }; template struct _AreSameTypes { enum __attribute__((__packed__)) { _Same = 0 }; typedef __false_type _Ret; }; template struct _AreSameTypes<_Tp, _Tp> { enum __attribute__((__packed__)) { _Same = 1 }; typedef __true_type _Ret; }; template struct _ConversionHelper { static char _Test(bool, _Dst); static char* _Test(bool, ...); static _Src _MakeSource(); }; template struct _IsConvertible { typedef _ConversionHelper<_Src*, const volatile _Dst*> _H; enum __attribute__((__packed__)) { value = (sizeof(char) == sizeof(_H::_Test(false, _H::_MakeSource()))) }; typedef typename __bool2type::_Ret _Ret; }; template struct _IsCVConvertible { typedef _ConversionHelper<_Src, _Dst> _H; enum __attribute__((__packed__)) { value = (sizeof(char) == sizeof(_H::_Test(false, _H::_MakeSource()))) }; typedef typename __bool2type::_Ret _Ret; }; } namespace std { template struct _IsIntegral { typedef __false_type _Ret; }; template< > struct _IsIntegral { typedef __true_type _Ret; }; template< > struct _IsIntegral { typedef __true_type _Ret; }; template< > struct _IsIntegral { typedef __true_type _Ret; }; template< > struct _IsIntegral { typedef __true_type _Ret; }; template< > struct _IsIntegral { typedef __true_type _Ret; }; template< > struct _IsIntegral { typedef __true_type _Ret; }; template< > struct _IsIntegral { typedef __true_type _Ret; }; template< > struct _IsIntegral { typedef __true_type _Ret; }; template< > struct _IsIntegral { typedef __true_type _Ret; }; template< > struct _IsIntegral { typedef __true_type _Ret; }; template< > struct _IsIntegral { typedef __true_type _Ret; }; template< > struct _IsIntegral { typedef __true_type _Ret; }; template< > struct _IsIntegral { typedef __true_type _Ret; }; template struct _IsRational { typedef __false_type _Ret; }; template< > struct _IsRational { typedef __true_type _Ret; }; template< > struct _IsRational { typedef __true_type _Ret; }; template< > struct _IsRational { typedef __true_type _Ret; }; template struct __type_traits; template struct __type_traits_aux { typedef __false_type has_trivial_default_constructor; typedef __false_type has_trivial_copy_constructor; typedef __false_type has_trivial_assignment_operator; typedef __false_type has_trivial_destructor; typedef __false_type is_POD_type; }; template< > struct __type_traits_aux<__false_type> { typedef __false_type has_trivial_default_constructor; typedef __false_type has_trivial_copy_constructor; typedef __false_type has_trivial_assignment_operator; typedef __false_type has_trivial_destructor; typedef __false_type is_POD_type; }; template< > struct __type_traits_aux<__true_type> { typedef __true_type has_trivial_default_constructor; typedef __true_type has_trivial_copy_constructor; typedef __true_type has_trivial_assignment_operator; typedef __true_type has_trivial_destructor; typedef __true_type is_POD_type; }; template struct _IsRef { typedef __false_type _Ret; }; template struct _IsPtr { typedef __false_type _Ret; }; template struct __type_traits { typedef __true_type this_dummy_member_must_be_first; typedef __false_type has_trivial_default_constructor; typedef __false_type has_trivial_copy_constructor; typedef __false_type has_trivial_assignment_operator; typedef __false_type has_trivial_destructor; typedef __false_type is_POD_type; }; template struct _IsPtr<_Tp*> { typedef __true_type _Ret; }; template struct _IsRef<_Tp&> { typedef __true_type _Ret; }; template struct __type_traits<_Tp*> : __type_traits_aux<__true_type> {}; template< > struct __type_traits< bool > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const bool > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile bool > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile bool > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< char > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const char > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile char > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile char > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< signed char > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const signed char > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile signed char > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile signed char > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< unsigned char > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const unsigned char > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile unsigned char > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile unsigned char > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< wchar_t > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const wchar_t > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile wchar_t > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile wchar_t > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< short > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const short > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile short > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile short > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< unsigned short > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const unsigned short > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile unsigned short > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile unsigned short > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< int > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const int > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile int > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile int > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< unsigned int > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const unsigned int > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile unsigned int > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile unsigned int > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< unsigned long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const unsigned long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile unsigned long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile unsigned long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< long long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const long long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile long long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile long long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< unsigned long long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const unsigned long long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile unsigned long long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile unsigned long long > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< float > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const float > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile float > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile float > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< double > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const double > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile double > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile double > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< long double > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const long double > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< volatile long double > : __type_traits_aux<__true_type> {}; template< > struct __type_traits< const volatile long double > : __type_traits_aux<__true_type> {}; template struct _IsCVConvertibleIf { typedef typename _IsCVConvertible<_Src, _Dst>::_Ret _Ret; }; template struct _IsCVConvertibleIf<__false_type, _Src, _Dst> { typedef __false_type _Ret; }; template struct _TrivialNativeTypeCopy { typedef typename _IsPtr<_Src>::_Ret _Ptr1; typedef typename _IsPtr<_Dst>::_Ret _Ptr2; typedef typename _Land2<_Ptr1, _Ptr2>::_Ret _BothPtrs; typedef typename _IsCVConvertibleIf<_BothPtrs, _Src, _Dst>::_Ret _Convertible; typedef typename _Land2<_BothPtrs, _Convertible>::_Ret _Trivial1; typedef typename __bool2type<(sizeof(_Src) == sizeof(_Dst))>::_Ret _SameSize; typedef typename _IsIntegral<_Src>::_Ret _Int1; typedef typename _IsIntegral<_Dst>::_Ret _Int2; typedef typename _Land2<_Int1, _Int2>::_Ret _BothInts; typedef typename _IsRational<_Src>::_Ret _Rat1; typedef typename _IsRational<_Dst>::_Ret _Rat2; typedef typename _Land2<_Rat1, _Rat2>::_Ret _BothRats; typedef typename _Lor2<_BothInts, _BothRats>::_Ret _BothNatives; typedef typename _Land2<_BothNatives, _SameSize>::_Ret _Trivial2; typedef typename _Lor2<_Trivial1, _Trivial2>::_Ret _Ret; }; template struct _TrivialCopy { typedef typename _TrivialNativeTypeCopy<_Src, _Dst>::_Ret _NativeRet; typedef typename __type_traits<_Src>::has_trivial_assignment_operator _Tr1; typedef typename _AreCopyable<_Src, _Dst>::_Ret _Tr2; typedef typename _Land2<_Tr1, _Tr2>::_Ret _UserRet; typedef typename _Lor2<_NativeRet, _UserRet>::_Ret _Ret; static _Ret _Answer() { return _Ret(); } }; template struct _TrivialUCopy { typedef typename _TrivialNativeTypeCopy<_Src, _Dst>::_Ret _NativeRet; typedef typename __type_traits<_Src>::has_trivial_copy_constructor _Tr1; typedef typename _AreCopyable<_Src, _Dst>::_Ret _Tr2; typedef typename _Land2<_Tr1, _Tr2>::_Ret _UserRet; typedef typename _Lor2<_NativeRet, _UserRet>::_Ret _Ret; static _Ret _Answer() { return _Ret(); } }; template struct _DefaultZeroValue { typedef typename _IsIntegral<_Tp>::_Ret _Tr1; typedef typename _IsRational<_Tp>::_Ret _Tr2; typedef typename _IsPtr<_Tp>::_Ret _Tr3; typedef typename _Lor3<_Tr1, _Tr2, _Tr3>::_Ret _Ret; }; template struct _TrivialInit { typedef typename __type_traits<_Tp>::has_trivial_default_constructor _Tr1; typedef typename _DefaultZeroValue<_Tp>::_Ret _Tr2; typedef typename _Not<_Tr2>::_Ret _Tr3; typedef typename _Land2<_Tr1, _Tr3>::_Ret _Ret; static _Ret _Answer() { return _Ret(); } }; template struct _IsPtrType { typedef typename _IsPtr<_Tp>::_Ret _Type; static _Type _Ret() { return _Type(); } }; template struct _IsRefType { typedef typename _IsRef<_Tp>::_Ret _Type; static _Type _Ret() { return _Type();} }; template struct __call_traits { typedef const _Tp& const_param_type; typedef _Tp& param_type; }; template struct __call_traits<_Tp&> { typedef _Tp& param_type; typedef const _Tp& const_param_type; }; template struct __call_traits { typedef _Tp& param_type; typedef const _Tp& const_param_type; }; template struct _BothPtrType { typedef typename _IsPtr<_Tp1>::_Ret _IsPtr1; typedef typename _IsPtr<_Tp2>::_Ret _IsPtr2; typedef typename _Land2<_IsPtr1, _IsPtr2>::_Ret _Ret; static _Ret _Answer() { return _Ret(); } }; template struct _OKToSwap { typedef typename _AreSameTypes<_Tp1, _Tp2>::_Ret _Same; typedef typename _Land3<_Same, _IsRef1, _IsRef2>::_Ret _Type; static _Type _Answer() { return _Type(); } }; template inline _OKToSwap<_Tp1, _Tp2, _IsRef1, _IsRef2> _IsOKToSwap(_Tp1*, _Tp2*, const _IsRef1&, const _IsRef2&) { return _OKToSwap<_Tp1, _Tp2, _IsRef1, _IsRef2>(); } template inline _TrivialCopy<_Src, _Dst> _UseTrivialCopy(_Src*, _Dst*) { return _TrivialCopy<_Src, _Dst>(); } template inline _TrivialUCopy<_Src, _Dst> _UseTrivialUCopy(_Src*, _Dst*) { return _TrivialUCopy<_Src, _Dst>(); } struct _NegativeAnswer { typedef __false_type _Ret; static _Ret _Answer() { return _Ret(); } }; template inline _NegativeAnswer _UseTrivialCopy(_Src*, const _Dst*) { return _NegativeAnswer(); } template inline _NegativeAnswer _UseTrivialCopy(_Src*, volatile _Dst*) { return _NegativeAnswer(); } template inline _NegativeAnswer _UseTrivialCopy(_Src*, const volatile _Dst*) { return _NegativeAnswer(); } template inline _NegativeAnswer _UseTrivialUCopy(_Src*, const _Dst*) { return _NegativeAnswer(); } template inline _NegativeAnswer _UseTrivialUCopy(_Src*, volatile _Dst*) { return _NegativeAnswer(); } template inline _NegativeAnswer _UseTrivialUCopy(_Src*, const volatile _Dst*) { return _NegativeAnswer(); } template inline _TrivialInit<_Tp> _UseTrivialInit(_Tp*) { return _TrivialInit<_Tp>(); } template struct _IsPOD { typedef typename __type_traits<_Tp>::is_POD_type _Type; static _Type _Answer() { return _Type(); } }; template inline _IsPOD<_Tp> _Is_POD(_Tp*) { return _IsPOD<_Tp>(); } template struct _DefaultZeroValueQuestion { typedef typename _DefaultZeroValue<_Tp>::_Ret _Ret; static _Ret _Answer() { return _Ret(); } }; template inline _DefaultZeroValueQuestion<_Tp> _HasDefaultZeroValue(_Tp*) { return _DefaultZeroValueQuestion<_Tp>(); } template struct __stlport_class { typedef _Tp _Type; }; template struct _IsSTLportClass { typedef typename _IsConvertible<_Tp, __stlport_class<_Tp> >::_Ret _Ret; }; template class _TpWithState : private _Tp { _TpWithState(); int _state; }; template struct _IsStateless { enum __attribute__((__packed__)) { _Is = sizeof(_TpWithState<_Tp>) == sizeof(int) }; typedef typename __bool2type<_Is>::_Ret _Ret; }; } namespace std { template class __move_source { public: explicit __move_source (_Tp &_src) : _M_data(_src) {} _Tp& get() const { return _M_data; } private: _Tp &_M_data; typedef __move_source<_Tp> _Self; _Self& operator = (_Self const&); }; template struct __move_traits { typedef __false_type implemented; typedef typename __type_traits<_Tp>::has_trivial_destructor complete; }; namespace priv { template struct _MoveSourceTraits { typedef typename __move_traits<_Tp>::implemented _MvImpRet; enum __attribute__((__packed__)) {_MvImp = __type2bool<_MvImpRet>::_Ret}; typedef typename __select<_MvImp, __move_source<_Tp>, _Tp const&>::_Ret _Type; }; template inline typename _MoveSourceTraits<_Tp>::_Type _AsMoveSource (_Tp &src) { typedef typename _MoveSourceTraits<_Tp>::_Type _SrcType; return _SrcType(src); } template struct __move_traits_aux { typedef typename __move_traits<_Tp>::implemented implemented; typedef typename __move_traits<_Tp>::complete complete; }; template struct __move_traits_aux2 { typedef __move_traits<_Tp1> _MoveTraits1; typedef __move_traits<_Tp2> _MoveTraits2; typedef typename _Lor2::_Ret implemented; typedef typename _Land2::_Ret complete; }; template struct __move_traits_help { typedef __true_type implemented; typedef typename __move_traits<_Tp>::complete complete; }; template struct __move_traits_help1 { typedef __move_traits<_Tp1> _MoveTraits1; typedef __move_traits<_Tp2> _MoveTraits2; typedef typename _Lor2::_Ret implemented; typedef typename _Land2::_Ret complete; }; template struct __move_traits_help2 { typedef __move_traits<_Tp1> _MoveTraits1; typedef __move_traits<_Tp2> _MoveTraits2; typedef __true_type implemented; typedef typename _Land2::_Ret complete; }; } } namespace std { template inline void __destroy_aux(_Tp* __pointer, const __false_type& ) { __pointer->~_Tp(); } template inline void __destroy_aux(_Tp*, const __true_type& ) {} template inline void _Destroy(_Tp* __pointer) { typedef typename __type_traits<_Tp>::has_trivial_destructor _Trivial_destructor; __destroy_aux(__pointer, _Trivial_destructor()); } template inline void _Destroy_Moved(_Tp* __pointer) { typedef typename __move_traits<_Tp>::complete _Trivial_destructor; __destroy_aux(__pointer, _Trivial_destructor()); } template inline void _Construct_aux (_T1* __p, const __false_type&) { new(__p) _T1(); } template inline void _Construct_aux (_T1* __p, const __true_type&) { *__p = _T1(); } template inline void _Construct(_T1* __p) { _Construct_aux (__p, _Is_POD(__p)._Answer()); } template inline void _Copy_Construct_aux(_Tp* __p, const _Tp& __val, const __false_type&) { new(__p) _Tp(__val); } template inline void _Copy_Construct_aux(_Tp* __p, const _Tp& __val, const __true_type&) { *__p = __val; } template inline void _Copy_Construct(_Tp* __p, const _Tp& __val) { _Copy_Construct_aux(__p, __val, _Is_POD(__p)._Answer()); } template inline void _Param_Construct_aux(_T1* __p, const _T2& __val, const __false_type&) { new(__p) _T1(__val); } template inline void _Param_Construct_aux(_T1* __p, const _T2& __val, const __true_type&) { *__p = _T1(__val); } template inline void _Param_Construct(_T1* __p, const _T2& __val) { _Param_Construct_aux(__p, __val, _Is_POD(__p)._Answer()); } template inline void _Move_Construct_Aux(_T1* __p, _T2& __val, const __false_type& ) { new(__p) _T1(::std::priv:: _AsMoveSource(__val)); } template inline void _Move_Construct_Aux(_T1* __p, _T2& __val, const __true_type& ) { *__p = _T1(__val); } template inline void _Move_Construct(_T1* __p, _T2& __val) { _Move_Construct_Aux(__p, __val, _Is_POD(__p)._Answer()); } template inline void __destroy_range_aux(_ForwardIterator __first, _ForwardIterator __last, _Tp*, const __false_type& ) { for ( ; __first != __last; ++__first) { __destroy_aux(&(*__first), __false_type()); } } template inline void __destroy_range_aux(_ForwardIterator, _ForwardIterator, _Tp*, const __true_type& ) {} template inline void __destroy_range(_ForwardIterator __first, _ForwardIterator __last, _Tp *__ptr) { typedef typename __type_traits<_Tp>::has_trivial_destructor _Trivial_destructor; __destroy_range_aux(__first, __last, __ptr, _Trivial_destructor()); } template inline void _Destroy_Range(_ForwardIterator __first, _ForwardIterator __last) { __destroy_range(__first, __last, (typename ::std::iterator_traits< _ForwardIterator > ::value_type*)0); } inline void _Destroy_Range(char*, char*) {} inline void _Destroy_Range(wchar_t*, wchar_t*) {} inline void _Destroy_Range(const wchar_t*, const wchar_t*) {} template inline void __destroy_mv_srcs(_ForwardIterator __first, _ForwardIterator __last, _Tp *__ptr) { typedef typename __move_traits<_Tp>::complete _CompleteMove; __destroy_range_aux(__first, __last, __ptr, _CompleteMove()); } template inline void _Destroy_Moved_Range(_ForwardIterator __first, _ForwardIterator __last) { __destroy_mv_srcs(__first, __last, (typename ::std::iterator_traits< _ForwardIterator > ::value_type*)0); } template inline void construct(_T1* __p, const _T2& __val) {_Param_Construct(__p, __val); } template inline void construct(_T1* __p) { ::std::_Construct(__p); } template inline void destroy(_Tp* __pointer) { ::std::_Destroy(__pointer); } template inline void destroy(_ForwardIterator __first, _ForwardIterator __last) { ::std::_Destroy_Range(__first, __last); } } #pragma diag_push #pragma CHECK_MISRA("-19.15") #pragma diag_pop extern "C" namespace std { typedef int _Mbstatet; typedef _Mbstatet mbstate_t; struct tm; typedef unsigned int wint_t; wint_t btowc (int); wint_t fgetwc (FILE *); wint_t fputwc (wchar_t, FILE *); int fwide (FILE *, int); size_t mbrtowc (wchar_t * __restrict, const char * __restrict, size_t, mbstate_t * __restrict); wint_t ungetwc (wint_t, FILE *); size_t wcrtomb (char * __restrict, wchar_t, mbstate_t * __restrict); int wcscmp (const wchar_t *, const wchar_t *); size_t wcslen (const wchar_t *); int wcsncmp (const wchar_t *, const wchar_t*, size_t); wchar_t *wcsncpy (wchar_t * __restrict, const wchar_t * __restrict, size_t); int wctob (wint_t); wchar_t *wmemchr (const wchar_t *, wchar_t, size_t); int wmemcmp (const wchar_t *, const wchar_t*, size_t); wchar_t *wmemcpy (wchar_t * __restrict, const wchar_t * __restrict, size_t); wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); wchar_t *wmemset (wchar_t *, wchar_t, size_t); } using std::mbstate_t; using std::wint_t; namespace std { template class allocator; typedef long streamoff; typedef ptrdiff_t streamsize; template class fpos { public: fpos(streamoff __pos) : _M_pos(__pos), _M_st(_StateT()) {} fpos() : _M_pos(0), _M_st(_StateT()) {} operator streamoff() const { return _M_pos; } bool operator==(const fpos& __y) const { return _M_pos == __y._M_pos; } bool operator!=(const fpos& __y) const { return _M_pos != __y._M_pos; } fpos& operator+=(streamoff __off) { _M_pos += __off; return *this; } fpos& operator-=(streamoff __off) { _M_pos -= __off; return *this; } fpos operator+(streamoff __off) { fpos __tmp(*this); __tmp += __off; return __tmp; } fpos operator-(streamoff __off) { fpos __tmp(*this); __tmp -= __off; return __tmp; } public: _StateT state() const { return _M_st; } void state(_StateT __st) { _M_st = __st; } private: streamoff _M_pos; _StateT _M_st; }; typedef fpos streampos; typedef fpos wstreampos; template class __char_traits_base { public: typedef _CharT char_type; typedef _IntT int_type; typedef streamoff off_type; typedef streampos pos_type; typedef mbstate_t state_type; static void assign(char_type& __c1, const char_type& __c2) { __c1 = __c2; } static bool eq(const char_type& __c1, const char_type& __c2) { return __c1 == __c2; } static bool lt(const char_type& __c1, const char_type& __c2) { return __c1 < __c2; } static int compare(const char_type* __s1, const char_type* __s2, size_t __n) { for (size_t __i = 0; __i < __n; ++__i) if (!eq(__s1[__i], __s2[__i])) return __s1[__i] < __s2[__i] ? -1 : 1; return 0; } static size_t length(const char_type* __s) { const char_type _NullChar = char_type(); size_t __i(0); for (; !eq(__s[__i], _NullChar); ++__i) {} return __i; } static const char_type* find(const char_type* __s, size_t __n, const char_type& __c) { for ( ; __n > 0 ; ++__s, --__n) if (eq(*__s, __c)) return __s; return 0; } static char_type* move(char_type* __s1, const char_type* __s2, size_t _Sz) { return (_Sz == 0 ? __s1 : (char_type*)memmove(__s1, __s2, _Sz * sizeof(char_type))); } static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) { return (__n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n * sizeof(char_type))); } static char_type* assign(char_type* __s, size_t __n, char_type __c) { for (size_t __i = 0; __i < __n; ++__i) __s[__i] = __c; return __s; } static int_type not_eof(const int_type& __c) { return !eq_int_type(__c, eof()) ? __c : static_cast(0); } static char_type to_char_type(const int_type& __c) { return (char_type)__c; } static int_type to_int_type(const char_type& __c) { return (int_type)__c; } static bool eq_int_type(const int_type& __c1, const int_type& __c2) { return __c1 == __c2; } static int_type eof() { return (int_type)-1; } }; template class char_traits : public __char_traits_base<_CharT, _CharT> {}; template< > class char_traits : public __char_traits_base, public __stlport_class > { public: typedef char char_type; typedef int int_type; typedef streamoff off_type; typedef streampos pos_type; typedef mbstate_t state_type; static char to_char_type(const int& __c) { return (char)(unsigned char)__c; } static int to_int_type(const char& __c) { return (unsigned char)__c; } static int compare(const char* __s1, const char* __s2, size_t __n) { return memcmp(__s1, __s2, __n); } static size_t length(const char* __s) { return strlen(__s); } static void assign(char& __c1, const char& __c2) { __c1 = __c2; } static char* assign(char* __s, size_t __n, char __c) { memset(__s, __c, __n); return __s; } }; template< > class char_traits : public __char_traits_base { public: static wchar_t* move(wchar_t* __dest, const wchar_t* __src, size_t __n) { return wmemmove(__dest, __src, __n); } static wchar_t* copy(wchar_t* __dest, const wchar_t* __src, size_t __n) { return wmemcpy(__dest, __src, __n); } static int compare(const wchar_t* __s1, const wchar_t* __s2, size_t __n) { return wmemcmp(__s1, __s2, __n); } static wchar_t* assign(wchar_t* __s, size_t __n, wchar_t __c) { return wmemset(__s, __c, __n); } static size_t length(const wchar_t* __s) { return wcslen(__s); } static void assign(wchar_t& __c1, const wchar_t& __c2) { __c1 = __c2; } }; } namespace std { class ios_base; template > class basic_ios; template > class basic_streambuf; template > class basic_istream; template > class basic_ostream; template > class basic_iostream; template , class _Allocator = allocator<_CharT> > class basic_stringbuf; template , class _Allocator = allocator<_CharT> > class basic_istringstream; template , class _Allocator = allocator<_CharT> > class basic_ostringstream; template , class _Allocator = allocator<_CharT> > class basic_stringstream; template > class basic_filebuf; template > class basic_ifstream; template > class basic_ofstream; template > class basic_fstream; template > class istreambuf_iterator; template > class ostreambuf_iterator; typedef basic_ios > ios; typedef basic_ios > wios; class locale; template inline const _Facet& use_facet(const locale&); template class ctype; template class ctype_byname; template class collate; template class collate_byname; template< > class ctype; template< > class ctype_byname; template< > class collate; template< > class collate_byname; template< > class ctype; template< > class ctype_byname; template< > class collate; template< > class collate_byname; typedef basic_istream > istream; typedef basic_ostream > ostream; typedef basic_iostream > iostream; typedef basic_streambuf > streambuf; typedef basic_stringbuf, allocator > stringbuf; typedef basic_istringstream, allocator > istringstream; typedef basic_ostringstream, allocator > ostringstream; typedef basic_stringstream, allocator > stringstream; typedef basic_filebuf > filebuf; typedef basic_ifstream > ifstream; typedef basic_ofstream > ofstream; typedef basic_fstream > fstream; typedef basic_streambuf > wstreambuf; typedef basic_istream > wistream; typedef basic_ostream > wostream; typedef basic_iostream > wiostream; typedef basic_stringbuf, allocator > wstringbuf; typedef basic_istringstream, allocator > wistringstream; typedef basic_ostringstream, allocator > wostringstream; typedef basic_stringstream, allocator > wstringstream; typedef basic_filebuf > wfilebuf; typedef basic_ifstream > wifstream; typedef basic_ofstream > wofstream; typedef basic_fstream > wfstream; } #pragma diag_push #pragma CHECK_MISRA("-6.3") #pragma CHECK_MISRA("-8.5") #pragma CHECK_MISRA("-19.1") #pragma CHECK_MISRA("-19.7") #pragma CHECK_MISRA("-20.1") #pragma CHECK_MISRA("-20.2") extern "C" namespace std { #pragma diag_push #pragma CHECK_MISRA("-5.7") typedef struct { int quot, rem; } div_t; typedef struct { long quot, rem; } ldiv_t; typedef struct { long long quot, rem; } lldiv_t; #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-16.4") int abs(int _val); long labs(long _val); long long llabs(long long _val); #pragma diag_pop int atoi(const char *_st); long atol(const char *_st); long long atoll(const char *_st); int ltoa(long val, char *buffer); extern "C" double atof(const char *_st); long strtol(const char *_st, char **_endptr, int _base); unsigned long strtoul(const char *_st, char **_endptr, int _base); long long strtoll(const char *_st, char **_endptr, int _base); unsigned long long strtoull(const char *_st, char **_endptr, int _base); float strtof(const char * _st, char ** _endptr); double strtod(const char * _st, char ** _endptr); long double strtold(const char * _st, char ** _endptr); int rand(void); void srand(unsigned _seed); void *calloc(size_t _num, size_t _size) __attribute__((malloc)); void *malloc(size_t _size) __attribute__((malloc)); void *realloc(void *_ptr, size_t _size) __attribute__((malloc)); void free(void *_ptr); void *memalign(size_t _aln, size_t _size) __attribute__((malloc)); void abort(void); typedef void (*__TI_atexit_fn)(void); int atexit(__TI_atexit_fn _func); typedef int (*__TI_compar_fn)(const void *_a,const void *_b); void *bsearch(const void *_key, const void *_base, size_t _nmemb, size_t _size, __TI_compar_fn compar); void qsort(void *_base, size_t _nmemb, size_t _size, __TI_compar_fn compar); void exit(int _status); div_t div(int _numer, int _denom); ldiv_t ldiv(long _numer, long _denom); lldiv_t lldiv(long long _numer, long long _denom); char *getenv(const char *_string); int system(const char *_name); int mblen(const char *_s, size_t _n); size_t mbstowcs(wchar_t *_dest, const char *_src, size_t _n); int mbtowc(wchar_t *_dest, const char *_src, size_t _n); size_t wcstombs(char *_dest, const wchar_t *_src, size_t _n); int wctomb(char *_s, wchar_t _wc); } #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.15") #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.1") #pragma CHECK_MISRA("-19.15") #pragma diag_pop namespace std { inline long abs(long __x) { return std::labs(__x); } } namespace std { inline std::ldiv_t div(long __x, long __y) { return std::ldiv(__x, __y); } } namespace std { inline long long abs(long long __x) { return std::llabs(__x); } inline std::lldiv_t div(long long __x, long long __y) { return std::lldiv(__x, __y); } } #pragma diag_push #pragma CHECK_MISRA("-6.3") #pragma CHECK_MISRA("-19.1") #pragma CHECK_MISRA("-19.7") #pragma CHECK_MISRA("-20.1") #pragma CHECK_MISRA("-20.2") #pragma diag_push #pragma CHECK_MISRA("-19.4") #pragma CHECK_MISRA("-19.7") #pragma CHECK_MISRA("-19.13") #pragma diag_pop extern "C" namespace std { double sqrt (double x); double exp (double x); double log (double x); double log10(double x); double pow (double x, double y); double sin (double x); double cos (double x); double tan (double x); double asin (double x); double acos (double x); double atan (double x); double atan2(double y, double x); double sinh (double x); double cosh (double x); double tanh (double x); extern "C" double ceil (double x); extern "C" double floor(double x); #pragma diag_push #pragma CHECK_MISRA("-16.4") double fabs (double x); #pragma diag_pop double ldexp(double x, int n); double frexp(double x, int *_exp); double modf (double x, double *ip); double fmod (double x, double y); double log1p(double x); double hypot(double x, double y); double copysign(double x, double y); int _signbitf(float x); int _signbit(double x); int _signbitl(long double x); extern "C" double _FMOD(double x, double y); double __c6xabi_nround(double x); double __c6xabi_trunc(double x); } #pragma diag_push #pragma CHECK_MISRA("-6.3") #pragma CHECK_MISRA("-19.1") #pragma CHECK_MISRA("-19.7") #pragma CHECK_MISRA("-20.1") #pragma CHECK_MISRA("-20.2") extern "C" namespace std { float sqrtf (float x); float expf (float x); float logf (float x); float log10f(float x); float powf (float x, float y); float sinf (float x); float cosf (float x); float tanf (float x); float asinf (float x); float acosf (float x); float atanf (float x); float atan2f(float y, float x); float sinhf (float x); float coshf (float x); float tanhf (float x); extern "C" float ceilf (float x); extern "C" float floorf(float x); #pragma diag_push #pragma CHECK_MISRA("-16.4") float fabsf (float x); #pragma diag_pop float ldexpf(float x, int n); float frexpf(float x, int *_exp); float modff (float x, float *ip); float fmodf (float x, float y); float __c6xabi_roundf(float x); float __c6xabi_truncf(float x); float rsqrtf(float x); float exp2f (float x); float exp10f(float x); float log2f (float x); float powif (float x, int i); float cotf (float x); float acotf (float x); float acot2f(float x, float y); float cothf (float x); float asinhf(float x); float acoshf(float x); float atanhf(float x); float acothf(float x); float log1pf(float x); float hypotf(float x, float y); float copysignf(float x, float y); int __c6xabi_isinff(float x); extern "C" int __c6xabi_isnanf(float x); extern "C" int __c6xabi_isfinitef(float x); extern "C" int __c6xabi_isnormalf(float x); int __c6xabi_fpclassifyf(float x); #pragma diag_push #pragma CHECK_MISRA("-19.4") #pragma diag_pop } #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::sqrtf; using std::expf; using std::logf; using std::log10f; using std::powf; using std::sinf; using std::cosf; using std::tanf; using std::asinf; using std::acosf; using std::atanf; using std::atan2f; using std::sinhf; using std::coshf; using std::tanhf; using std::ceilf; using std::floorf; using std::fabsf; using std::ldexpf; using std::frexpf; using std::modff; using std::fmodf; using std::log1pf; using std::copysignf; using std::hypotf; using std::rsqrtf; using std::exp2f; using std::exp10f; using std::log2f; using std::powif; using std::cotf; using std::acotf; using std::acot2f; using std::cothf; using std::asinhf; using std::acoshf; using std::atanhf; using std::acothf; using std::__c6xabi_isnanf; using std::__c6xabi_isinff; using std::__c6xabi_isfinitef; using std::__c6xabi_isnormalf; using std::__c6xabi_fpclassifyf; using std::__c6xabi_roundf; using std::__c6xabi_truncf; #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-6.3") #pragma CHECK_MISRA("-19.1") #pragma CHECK_MISRA("-19.7") #pragma CHECK_MISRA("-20.1") #pragma CHECK_MISRA("-20.2") extern "C" namespace std { long double sqrtl (long double x); long double expl (long double x); long double logl (long double x); long double log10l(long double x); long double powl (long double x, long double y); long double sinl (long double x); long double cosl (long double x); long double tanl (long double x); long double asinl (long double x); long double acosl (long double x); long double atanl (long double x); long double atan2l(long double y, long double x); long double sinhl (long double x); long double coshl (long double x); long double tanhl (long double x); extern "C" long double ceill (long double x); extern "C" long double floorl(long double x); long double fabsl (long double x); long double ldexpl(long double x, int n); long double frexpl(long double x, int *_exp); long double modfl (long double x, long double *ip); long double fmodl (long double x, long double y); long double __c6xabi_roundl(long double x); long double __c6xabi_truncl(long double x); long double rsqrtl(long double x); long double exp2l (long double x); long double exp10l(long double x); long double log2l (long double x); long double powil (long double x, int i); long double cotl (long double x); long double acotl (long double x); long double acot2l(long double x, long double y); long double cothl (long double x); long double asinhl(long double x); long double acoshl(long double x); long double atanhl(long double x); long double acothl(long double x); long double log1pl(long double x); long double copysignl(long double x, long double y); long double hypotl(long double x, long double y); int __c6xabi_isinfl(long double x); extern "C" int __c6xabi_isnanl(long double x); extern "C" int __c6xabi_isfinitel(long double x); extern "C" int __c6xabi_isnormall(long double x); int __fpclassifyl(long double x); #pragma CHECK_MISRA("-19.4") } #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::sqrtl; using std::expl ; using std::logl ; using std::log10l; using std::powl; using std::sinl; using std::cosl; using std::tanl; using std::asinl; using std::acosl; using std::atanl; using std::atan2l; using std::sinhl; using std::coshl; using std::tanhl; using std::ceill; using std::floorl; using std::fabsl; using std::ldexpl; using std::frexpl; using std::modfl; using std::fmodl; using std::log1pl; using std::copysignl; using std::hypotl; using std::rsqrtl; using std::exp2l; using std::exp10l; using std::log2l; using std::powil; using std::cotl; using std::acotl; using std::acot2l; using std::cothl; using std::asinhl; using std::acoshl; using std::atanhl; using std::acothl; using std::__c6xabi_isnanl; using std::__c6xabi_isinfl; using std::__c6xabi_isfinitel; using std::__c6xabi_isnormall; using std::__fpclassifyl; using std::__c6xabi_roundl; using std::__c6xabi_truncl; #pragma diag_pop extern "C" namespace std { double rsqrt(double x); double exp2 (double x); double exp10(double x); double log2 (double x); double powi(double x, int i); double cot (double x); double acot (double x); double acot2(double x, double y); double coth (double x); double asinh(double x); double acosh(double x); double atanh(double x); double acoth(double x); int __c6xabi_isinf(double x); extern "C" int __c6xabi_isnan(volatile double x); extern "C" int __c6xabi_isfinite(double x); extern "C" int __c6xabi_isnormal(double x); int __c6xabi_fpclassify(double x); #pragma diag_push #pragma CHECK_MISRA("-19.4") #pragma diag_pop } #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::sqrt; using std::exp; using std::log; using std::log10; using std::pow; using std::sin; using std::cos; using std::tan; using std::asin; using std::acos; using std::atan; using std::atan2; using std::sinh; using std::cosh; using std::tanh; using std::ceil; using std::floor; using std::fabs; using std::ldexp; using std::frexp; using std::modf; using std::fmod; using std::hypot; using std::log1p; using std::copysign; using std::rsqrt; using std::exp2; using std::exp10; using std::log2; using std::powi; using std::cot; using std::acot; using std::acot2; using std::coth; using std::asinh; using std::acosh; using std::atanh; using std::acoth; using std::__c6xabi_isnan; using std::__c6xabi_isinf; using std::__c6xabi_isfinite; using std::__c6xabi_isnormal; using std::__c6xabi_fpclassify; using std::__c6xabi_nround; using std::__c6xabi_trunc; #pragma diag_pop namespace std { inline double abs(double x) { return (fabs(x)); } inline double pow(double x, int y) { return (pow(x, (double)y)); } inline float acos(float x) { return acosf(x); } inline float asin(float x) { return asinf(x); } inline float atan(float x) { return atanf(x); } inline float atan2(float x, float y) { return atan2f(x, y); } inline float ceil(float x) { return ceilf(x); } inline float cos(float x) { return cosf(x); } inline float cosh(float x) { return coshf(x); } inline float exp(float x) { return expf(x); } inline float fabs(float x) { return fabsf(x); } inline float floor(float x) { return floorf(x); } inline float fmod(float x, float y) { return fmodf(x, y); } inline float frexp(float x, int *y) { return frexpf(x, y); } inline float ldexp(float x, int y) { return ldexpf(x, y); } inline float log(float x) { return logf(x); } inline float log10(float x) { return log10f(x); } inline float modf(float x, float *y) { return modff(x, y); } inline float pow(float x, float y) { return powf(x, y); } inline float pow(float x, int y) { return powf(x, y); } inline float sin(float x) { return sinf(x); } inline float sinh(float x) { return sinhf(x); } inline float sqrt(float x) { return sqrtf(x); } inline float tan(float x) { return tanf(x); } inline float tanh(float x) { return tanhf(x); } inline float abs(float x) { return fabsf(x); } inline long double acos(long double x) { return acosl(x); } inline long double asin(long double x) { return asinl(x); } inline long double atan(long double x) { return atanl(x); } inline long double atan2(long double x, long double y) { return atan2l(x, y); } inline long double ceil(long double x) { return ceill(x); } inline long double cos(long double x) { return cosl(x); } inline long double cosh(long double x) { return coshl(x); } inline long double exp(long double x) { return expl(x); } inline long double fabs(long double x) { return fabsl(x); } inline long double floor(long double x) { return floorl(x); } inline long double fmod(long double x, long double y) { return fmodl(x, y); } inline long double frexp(long double x, int *y) { return frexpl(x, y); } inline long double ldexp(long double x, int y) { return ldexpl(x, y); } inline long double log(long double x) { return logl(x); } inline long double log10(long double x) { return log10l(x); } inline long double modf(long double x, long double *y) { return modfl(x, y); } inline long double pow(long double x, long double y) { return powl(x, y); } inline long double pow(long double x, int y) { return powl(x, y); } inline long double sin(long double x) { return sinl(x); } inline long double sinh(long double x) { return sinhl(x); } inline long double sqrt(long double x) { return sqrtl(x); } inline long double tan(long double x) { return tanl(x); } inline long double tanh(long double x) { return tanhl(x); } inline long double abs(long double x) { return fabsl(x); } } #pragma diag_push #pragma CHECK_MISRA("-20.1") #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.15") #pragma diag_pop namespace std { template struct pair { typedef _T1 first_type; typedef _T2 second_type; _T1 first; _T2 second; pair() : first(_T1()), second(_T2()) {} pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) {} template pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {} pair(const pair<_T1,_T2>& __o) : first(__o.first), second(__o.second) {} pair(__move_source > src) : first(::std::priv:: _AsMoveSource(src.get().first)), second(::std::priv:: _AsMoveSource(src.get().second)) {} }; template inline bool operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return __x.first == __y.first && __x.second == __y.second; } template inline bool operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return __x.first < __y.first || (!(__y.first < __x.first) && __x.second < __y.second); } template inline bool operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return !(__x == __y); } template inline bool operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return __y < __x; } template inline bool operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return !(__y < __x); } template inline bool operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return !(__x < __y); } template inline pair<_T1, _T2 const*> make_pair(_T1 const& __x, _T2 const (&__y)[_Sz]) { return pair<_T1, _T2 const*>(__x, static_cast<_T2 const*>(__y)); } template inline pair<_T1 const*, _T2> make_pair(_T1 const (&__x)[_Sz], _T2 const& __y) { return pair<_T1 const*, _T2>(static_cast<_T1 const*>(__x), __y); } template inline pair<_T1 const*, _T2 const*> make_pair(_T1 const (&__x)[_Sz1], _T2 const (&__y)[_Sz2]) { return pair<_T1 const*, _T2 const*>(static_cast<_T1 const*>(__x), static_cast<_T2 const*>(__y)); } template inline pair<_T1, _T2> make_pair(_T1 __x, _T2 __y) { return pair<_T1, _T2>(__x, __y); } } namespace std { namespace rel_ops { template inline bool operator!=(const _Tp& __x, const _Tp& __y) { return !(__x == __y); } template inline bool operator>(const _Tp& __x, const _Tp& __y) { return __y < __x; } template inline bool operator<=(const _Tp& __x, const _Tp& __y) { return !(__y < __x); } template inline bool operator>=(const _Tp& __x, const _Tp& __y) { return !(__x < __y); } } } namespace std { template struct __type_traits > { typedef __type_traits<_T1> _T1Traits; typedef __type_traits<_T2> _T2Traits; typedef typename _Land2::_Ret has_trivial_default_constructor; typedef typename _Land2::_Ret has_trivial_copy_constructor; typedef typename _Land2::_Ret has_trivial_assignment_operator; typedef typename _Land2::_Ret has_trivial_destructor; typedef __false_type is_POD_type; }; template struct __move_traits > : ::std::priv:: __move_traits_help1<_T1, _T2> {}; } namespace std { template inline void swap(_Tp& __a, _Tp& __b) { _Tp __tmp = __a; __a = __b; __b = __tmp; } namespace priv { template inline void __iter_swap_aux_aux(_ForwardIter1& __i1, _ForwardIter2& __i2, _Value *) { _Value tmp = *__i1; *__i1 = *__i2; *__i2 = tmp; } template inline void __iter_swap_aux(_ForwardIter1& __i1, _ForwardIter2& __i2, const __true_type& ) { swap(*__i1, *__i2); } template inline void __iter_swap_aux(_ForwardIter1& __i1, _ForwardIter2& __i2, const __false_type& ) { ::std::priv:: __iter_swap_aux_aux( __i1, __i2, (typename ::std::iterator_traits< _ForwardIter1 > ::value_type*)0 ); } } template inline void iter_swap(_ForwardIter1 __i1, _ForwardIter2 __i2) { ::std::priv:: __iter_swap_aux( __i1, __i2, _IsOKToSwap((typename ::std::iterator_traits< _ForwardIter1 > ::value_type*)0, (typename ::std::iterator_traits< _ForwardIter2 > ::value_type*)0, ::std::_IsRefType< typename ::std::iterator_traits< _ForwardIter1 > ::reference > ::_Ret(), ::std::_IsRefType< typename ::std::iterator_traits< _ForwardIter2 > ::reference > ::_Ret())._Answer()); } template inline const _Tp& (min)(const _Tp& __a, const _Tp& __b) { return __b < __a ? __b : __a; } template inline const _Tp& (max)(const _Tp& __a, const _Tp& __b) { return __a < __b ? __b : __a; } template inline const _Tp& (min)(const _Tp& __a, const _Tp& __b, _Compare __comp) { return __comp(__b, __a) ? __b : __a; } template inline const _Tp& (max)(const _Tp& __a, const _Tp& __b, _Compare __comp) { return __comp(__a, __b) ? __b : __a; } namespace priv { template inline _OutputIter __copy(_InputIter __first, _InputIter __last, _OutputIter __result, const input_iterator_tag &, _Distance*) { for ( ; __first != __last; ++__result, ++__first) *__result = *__first; return __result; } template inline _OutputIter __copy(_RandomAccessIter __first, _RandomAccessIter __last, _OutputIter __result, const random_access_iterator_tag &, _Distance*) { for (_Distance __n = __last - __first; __n > 0; --__n) { *__result = *__first; ++__first; ++__result; } return __result; } inline void* __copy_trivial(const void* __first, const void* __last, void* __result) { size_t __n = (const char*)__last - (const char*)__first; return __n ? (void *)((char*)memmove(__result, __first, __n) + __n) : __result; } template inline _BidirectionalIter2 __copy_backward(_BidirectionalIter1 __first, _BidirectionalIter1 __last, _BidirectionalIter2 __result, const bidirectional_iterator_tag &, _Distance*) { while (__first != __last) *--__result = *--__last; return __result; } template inline _BidirectionalIter __copy_backward(_RandomAccessIter __first, _RandomAccessIter __last, _BidirectionalIter __result, const random_access_iterator_tag &, _Distance*) { for (_Distance __n = __last - __first; __n > 0; --__n) *--__result = *--__last; return __result; } inline void* __copy_trivial_backward(const void* __first, const void* __last, void* __result) { const ptrdiff_t _Num = (const char*)__last - (const char*)__first; return (_Num > 0) ? memmove((char*)__result - _Num, __first, _Num) : __result ; } template inline _OutputIter __copy_ptrs(_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type& ) { return ::std::priv:: __copy(__first, __last, __result, random_access_iterator_tag(), (ptrdiff_t*)0); } template inline _OutputIter __copy_ptrs(_InputIter __first, _InputIter __last, _OutputIter __result, const __true_type& ) { return (_OutputIter)::std::priv:: __copy_trivial(__first, __last, __result); } template inline _OutputIter __copy_aux(_InputIter __first, _InputIter __last, _OutputIter __result, const __true_type& ) { return ::std::priv:: __copy_ptrs(__first, __last, __result, _UseTrivialCopy((typename ::std::iterator_traits< _InputIter > ::value_type*)0, (typename ::std::iterator_traits< _OutputIter > ::value_type*)0)._Answer()); } template inline _OutputIter __copy_aux(_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type& ) { return ::std::priv:: __copy(__first, __last, __result, typename ::std::iterator_traits< _InputIter > ::iterator_category(), (typename ::std::iterator_traits< _InputIter > ::difference_type*)0); } } template inline _OutputIter copy(_InputIter __first, _InputIter __last, _OutputIter __result) { return ::std::priv:: __copy_aux(__first, __last, __result, _BothPtrType< _InputIter, _OutputIter>::_Answer()); } namespace priv { template inline _OutputIter __copy_backward_ptrs(_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type& ) { return ::std::priv:: __copy_backward(__first, __last, __result, typename ::std::iterator_traits< _InputIter > ::iterator_category(), (typename ::std::iterator_traits< _InputIter > ::difference_type*)0); } template inline _OutputIter __copy_backward_ptrs(_InputIter __first, _InputIter __last, _OutputIter __result, const __true_type& ) { return (_OutputIter)::std::priv:: __copy_trivial_backward(__first, __last, __result); } template inline _OutputIter __copy_backward_aux(_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type&) { return ::std::priv:: __copy_backward(__first, __last, __result, typename ::std::iterator_traits< _InputIter > ::iterator_category(), (typename ::std::iterator_traits< _InputIter > ::difference_type*)0); } template inline _OutputIter __copy_backward_aux(_InputIter __first, _InputIter __last, _OutputIter __result, const __true_type&) { return ::std::priv:: __copy_backward_ptrs(__first, __last, __result, _UseTrivialCopy((typename ::std::iterator_traits< _InputIter > ::value_type*)0, (typename ::std::iterator_traits< _OutputIter > ::value_type*)0)._Answer()); } } template inline _OutputIter copy_backward(_InputIter __first, _InputIter __last, _OutputIter __result) { return ::std::priv:: __copy_backward_aux(__first, __last, __result, _BothPtrType< _InputIter, _OutputIter>::_Answer() ); } namespace priv { template inline ::std::pair<_InputIter, _OutputIter> __copy_n(_InputIter __first, _Size __count, _OutputIter __result, const input_iterator_tag &) { for ( ; __count > 0; --__count) { *__result = *__first; ++__first; ++__result; } return ::std::pair<_InputIter, _OutputIter>(__first, __result); } template inline ::std::pair<_RAIter, _OutputIter> __copy_n(_RAIter __first, _Size __count, _OutputIter __result, const random_access_iterator_tag &) { _RAIter __last = __first + __count; return ::std::pair<_RAIter, _OutputIter>(__last, ::std::copy(__first, __last, __result)); } } template inline pair<_InputIter, _OutputIter> copy_n(_InputIter __first, _Size __count, _OutputIter __result) { return ::std::priv:: __copy_n(__first, __count, __result, typename ::std::iterator_traits< _InputIter > ::iterator_category()); } namespace priv { template inline void __fill_fwd(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) { for ( ; __first != __last; ++__first) *__first = __val; } template inline void __fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, const input_iterator_tag &, _Distance*) { ::std::priv:: __fill_fwd(__first, __last, __val); } template inline void __fill(_RandomAccessIter __first, _RandomAccessIter __last, const _Tp& __val, const random_access_iterator_tag &, _Distance*) { for (_Distance __n = __last - __first ; __n > 0; ++__first, --__n) *__first = __val; } } template inline void fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) { ::std::priv:: __fill(__first, __last, __val, typename ::std::iterator_traits< _ForwardIter > ::iterator_category(), (typename ::std::iterator_traits< _ForwardIter > ::difference_type*)0); } inline void fill(unsigned char* __first, unsigned char* __last, const unsigned char& __val) { unsigned char __tmp = __val; memset(__first, __tmp, __last - __first); } inline void fill(signed char* __first, signed char* __last, const signed char& __val) { signed char __tmp = __val; memset(__first, static_cast(__tmp), __last - __first); } inline void fill(char* __first, char* __last, const char& __val) { char __tmp = __val; memset(__first, static_cast(__tmp), __last - __first); } namespace priv { template inline _OutputIter __fill_n(_OutputIter __first, _Size __n, const _Tp& __val) { for ( ; __n > 0; --__n, ++__first) *__first = __val; return __first; } template inline unsigned char* __fill_n(unsigned char* __first, _Size __n, const unsigned char& __val) { ::std::fill(__first, __first + __n, __val); return __first + __n; } template inline signed char* __fill_n(signed char* __first, _Size __n, const signed char& __val) { ::std::fill(__first, __first + __n, __val); return __first + __n; } template inline char* __fill_n(char* __first, _Size __n, const char& __val) { ::std::fill(__first, __first + __n, __val); return __first + __n; } } template inline void fill_n(_OutputIter __first, _Size __n, const _Tp& __val) { ::std::priv:: __fill_n(__first, __n, __val); } template inline ::std::pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2) { while (__first1 != __last1 && *__first1 == *__first2) { ++__first1; ++__first2; } return ::std::pair<_InputIter1, _InputIter2>(__first1, __first2); } template inline ::std::pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _BinaryPredicate __binary_pred) { while (__first1 != __last1 && __binary_pred(*__first1, *__first2)) { ++__first1; ++__first2; } return ::std::pair<_InputIter1, _InputIter2>(__first1, __first2); } template inline bool equal(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2) { for ( ; __first1 != __last1; ++__first1, ++__first2) if (!(*__first1 == *__first2)) return false; return true; } template inline bool equal(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _BinaryPredicate __binary_pred) { for ( ; __first1 != __last1; ++__first1, ++__first2) if (!__binary_pred(*__first1, *__first2)) return false; return true; } template bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2); template bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _Compare __comp); inline bool lexicographical_compare(const unsigned char* __first1, const unsigned char* __last1, const unsigned char* __first2, const unsigned char* __last2) { const size_t __len1 = __last1 - __first1; const size_t __len2 = __last2 - __first2; const int __result = memcmp(__first1, __first2, (min) (__len1, __len2)); return __result != 0 ? (__result < 0) : (__len1 < __len2); } namespace priv { template int __lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2); inline int __lexicographical_compare_3way(const unsigned char* __first1, const unsigned char* __last1, const unsigned char* __first2, const unsigned char* __last2) { const ptrdiff_t __len1 = __last1 - __first1; const ptrdiff_t __len2 = __last2 - __first2; const int __result = memcmp(__first1, __first2, (min) (__len1, __len2)); return __result != 0 ? __result : (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1)); } } template int lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2); template inline typename iterator_traits<_InputIter> ::difference_type count(_InputIter __first, _InputIter __last, const _Tp& __val) { typename iterator_traits<_InputIter> ::difference_type __n = 0; for ( ; __first != __last; ++__first) if (*__first == __val) ++__n; return __n; } template _InputIter find(_InputIter __first, _InputIter __last, const _Tp& __val); template _InputIter find_if(_InputIter __first, _InputIter __last, _Predicate __pred); template _ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2, _BinaryPred __predicate); namespace priv { template _InputIter __find_first_of(_InputIter __first1, _InputIter __last1, _ForwardIter __first2, _ForwardIter __last2); template _InputIter __find_first_of(_InputIter __first1, _InputIter __last1, _ForwardIter __first2, _ForwardIter __last2, _BinaryPredicate __comp); } template _ForwardIter1 find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2, _BinaryPredicate __comp); template inline void replace(_ForwardIter __first, _ForwardIter __last, const _Tp& __old_value, const _Tp& __new_value) { for ( ; __first != __last; ++__first) if (*__first == __old_value) *__first = __new_value; } namespace priv { template _ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, _Compare1 __comp1, _Compare2 __comp2, _Distance*); } } namespace std { template struct unary_function { typedef _Arg argument_type; typedef _Result result_type; }; template struct binary_function { typedef _Arg1 first_argument_type; typedef _Arg2 second_argument_type; typedef _Result result_type; }; template struct equal_to : public binary_function<_Tp, _Tp, bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x == __y; } }; template struct less : public binary_function<_Tp,_Tp,bool> , public __stlport_class > { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x < __y; } }; template struct __type_traits > { typedef typename _IsSTLportClass >::_Ret _STLportLess; typedef _STLportLess has_trivial_default_constructor; typedef _STLportLess has_trivial_copy_constructor; typedef _STLportLess has_trivial_assignment_operator; typedef _STLportLess has_trivial_destructor; typedef _STLportLess is_POD_type; }; namespace priv { template struct _ti_equal_to : public binary_function<_Tp, _Tp, bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x == __y; } bool operator()(_Tp& __x, _Tp& __y) const { return __x == __y; } }; template struct _ti_less : public binary_function<_Tp,_Tp,bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x < __y; } bool operator()(_Tp& __x, _Tp& __y) const { return __x < __y; } }; template _ti_less<_Tp> __less(_Tp* ) { return _ti_less<_Tp>(); } template _ti_equal_to<_Tp> __equal_to(_Tp* ) { return _ti_equal_to<_Tp>(); } } template struct plus : public binary_function<_Tp, _Tp, _Tp> { _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x + __y; } }; template struct minus : public binary_function<_Tp, _Tp, _Tp> { _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x - __y; } }; namespace priv { template struct _ti_plus : public binary_function<_Tp, _Tp, _Tp> { _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x + __y; } _Tp operator()(_Tp& __x, _Tp& __y) const { return __x + __y; } }; template struct _ti_minus : public binary_function<_Tp, _Tp, _Tp> { _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x - __y; } _Tp operator()(_Tp& __x, _Tp& __y) const { return __x - __y; } }; template _ti_plus<_Tp> __plus(_Tp* ) { return _ti_plus<_Tp>(); } template _ti_minus<_Tp> __minus(_Tp* ) { return _ti_minus<_Tp>(); } } template struct multiplies : public binary_function<_Tp, _Tp, _Tp> { _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x * __y; } }; namespace priv { template struct _Select1st : public unary_function<_Pair, typename _Pair::first_type> { const typename _Pair::first_type& operator()(const _Pair& __x) const { return __x.first; } }; template struct _Select2nd : public unary_function<_Pair, typename _Pair::second_type> { const typename _Pair::second_type& operator()(const _Pair& __x) const { return __x.second; } }; template struct _Project1st : public binary_function<_Arg1, _Arg2, _Arg1> { _Arg1 operator()(const _Arg1& __x, const _Arg2&) const { return __x; } }; template struct _Project2nd : public binary_function<_Arg1, _Arg2, _Arg2> { _Arg2 operator()(const _Arg1&, const _Arg2& __y) const { return __y; } }; template struct _Identity : public unary_function<_Tp,_Tp> { const _Tp& operator()(const _Tp& __x) const { return __x; } }; template struct _Constant_unary_fun { typedef _Argument argument_type; typedef _Result result_type; result_type _M_val; _Constant_unary_fun(const result_type& __v) : _M_val(__v) {} const result_type& operator()(const _Argument&) const { return _M_val; } }; template struct _Constant_binary_fun { typedef _Arg1 first_argument_type; typedef _Arg2 second_argument_type; typedef _Result result_type; _Result _M_val; _Constant_binary_fun(const _Result& __v) : _M_val(__v) {} const result_type& operator()(const _Arg1&, const _Arg2&) const { return _M_val; } }; template inline _Tp __identity_element(plus<_Tp>) { return _Tp(0); } template inline _Tp __identity_element(multiplies<_Tp>) { return _Tp(1); } } } namespace std { template bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2) { for ( ; __first1 != __last1 && __first2 != __last2 ; ++__first1, ++__first2) { if (*__first1 < *__first2) { return true; } if (*__first2 < *__first1) return false; } return __first1 == __last1 && __first2 != __last2; } template bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _Compare __comp) { for ( ; __first1 != __last1 && __first2 != __last2 ; ++__first1, ++__first2) { if (__comp(*__first1, *__first2)) { return true; } if (__comp(*__first2, *__first1)) return false; } return __first1 == __last1 && __first2 != __last2; } namespace priv { template int __lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2) { while (__first1 != __last1 && __first2 != __last2) { if (*__first1 < *__first2) { return -1; } if (*__first2 < *__first1) return 1; ++__first1; ++__first2; } if (__first2 == __last2) { return !(__first1 == __last1); } else { return -1; } } } template int lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2) { return ::std::priv:: __lexicographical_compare_3way(__first1, __last1, __first2, __last2); } namespace priv { template inline _RandomAccessIter __find(_RandomAccessIter __first, _RandomAccessIter __last, const _Tp& __val, const random_access_iterator_tag &) { typename iterator_traits<_RandomAccessIter> ::difference_type __trip_count = (__last - __first) >> 2; for ( ; __trip_count > 0 ; --__trip_count) { if (*__first == __val) return __first; ++__first; if (*__first == __val) return __first; ++__first; if (*__first == __val) return __first; ++__first; if (*__first == __val) return __first; ++__first; } switch (__last - __first) { case 3: if (*__first == __val) return __first; ++__first; case 2: if (*__first == __val) return __first; ++__first; case 1: if (*__first == __val) return __first; case 0: default: return __last; } } inline char* __find(char* __first, char* __last, char __val, const random_access_iterator_tag &) { void *res = memchr(__first, __val, __last - __first); return res != 0 ? static_cast(res) : __last; } inline const char* __find(const char* __first, const char* __last, char __val, const random_access_iterator_tag &) { const void *res = memchr(__first, __val, __last - __first); return res != 0 ? static_cast(res) : __last; } template inline _RandomAccessIter __find_if(_RandomAccessIter __first, _RandomAccessIter __last, _Predicate __pred, const random_access_iterator_tag &) { typename iterator_traits<_RandomAccessIter> ::difference_type __trip_count = (__last - __first) >> 2; for ( ; __trip_count > 0 ; --__trip_count) { if (__pred(*__first)) return __first; ++__first; if (__pred(*__first)) return __first; ++__first; if (__pred(*__first)) return __first; ++__first; if (__pred(*__first)) return __first; ++__first; } switch(__last - __first) { case 3: if (__pred(*__first)) return __first; ++__first; case 2: if (__pred(*__first)) return __first; ++__first; case 1: if (__pred(*__first)) return __first; case 0: default: return __last; } } template inline _InputIter __find(_InputIter __first, _InputIter __last, const _Tp& __val, const input_iterator_tag &) { while (__first != __last && !(*__first == __val)) ++__first; return __first; } template inline _InputIter __find_if(_InputIter __first, _InputIter __last, _Predicate __pred, const input_iterator_tag &) { while (__first != __last && !__pred(*__first)) ++__first; return __first; } } template _InputIter find_if(_InputIter __first, _InputIter __last, _Predicate __pred) { return ::std::priv:: __find_if(__first, __last, __pred, typename ::std::iterator_traits< _InputIter > ::iterator_category()); } template _InputIter find(_InputIter __first, _InputIter __last, const _Tp& __val) { return ::std::priv:: __find(__first, __last, __val, typename ::std::iterator_traits< _InputIter > ::iterator_category()); } template _ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2, _BinaryPred __pred) { if (__first1 == __last1 || __first2 == __last2) return __first1; _ForwardIter2 __p1(__first2); if ( ++__p1 == __last2 ) { while (__first1 != __last1 && !__pred(*__first1, *__first2)) { ++__first1; } return __first1; } for ( ; ; ) { while (__first1 != __last1 && !__pred(*__first1, *__first2)) { ++__first1; } if (__first1 == __last1) { return __last1; } _ForwardIter2 __p = __p1; _ForwardIter1 __current = __first1; if (++__current == __last1) return __last1; while (__pred(*__current, *__p)) { if (++__p == __last2) return __first1; if (++__current == __last1) return __last1; } ++__first1; } } namespace priv { template struct _IsCharLikeType { typedef __false_type _Ret; }; template< > struct _IsCharLikeType { typedef __true_type _Ret; }; template< > struct _IsCharLikeType { typedef __true_type _Ret; }; template< > struct _IsCharLikeType { typedef __true_type _Ret; }; template inline bool __stlp_eq(_Tp1 __val1, _Tp2 __val2) { return __val1 == __val2; } template inline bool __stlp_eq(_Tp, _Tp) { return true; } template inline _InputIter __find_first_of_aux2(_InputIter __first1, _InputIter __last1, _ForwardIter __first2, _ForwardIter __last2, _Tp2*, _Predicate __pred, const __true_type& ) { unsigned char __hints[((long)255 + 1) / 8]; memset(__hints, 0, sizeof(__hints) / sizeof(unsigned char)); for (; __first2 != __last2; ++__first2) { unsigned char __tmp = (unsigned char)*__first2; __hints[__tmp / 8] |= (1 << (__tmp % 8)); } for (; __first1 != __last1; ++__first1) { _Tp2 __tmp = (_Tp2)*__first1; if (__stlp_eq(*__first1, __tmp) && __pred((__hints[(unsigned char)__tmp / 8] & (1 << ((unsigned char)__tmp % 8))) != 0)) break; } return __first1; } template inline _InputIter __find_first_of_aux2(_InputIter __first1, _InputIter __last1, _ForwardIter __first2, _ForwardIter __last2, _Tp2* , _Predicate , const __false_type& ) { return ::std::priv:: __find_first_of(__first1, __last1, __first2, __last2, ::std::priv:: __equal_to((typename ::std::iterator_traits< _InputIter > ::value_type*)0)); } template inline _InputIter __find_first_of_aux1(_InputIter __first1, _InputIter __last1, _ForwardIter __first2, _ForwardIter __last2, _Tp1* __pt1, _Tp2* __pt2) { typedef typename ::std::_IsIntegral<_Tp1>::_Ret _IsIntegral; typedef typename ::std::priv:: _IsCharLikeType<_Tp2>::_Ret _IsCharLike; typedef typename ::std::_Land2<_IsIntegral, _IsCharLike>::_Ret _UseStrcspnLikeAlgo; return ::std::priv:: __find_first_of_aux2(__first1, __last1, __first2, __last2, __pt2, _Identity(), _UseStrcspnLikeAlgo()); } template inline _InputIter __find_first_of(_InputIter __first1, _InputIter __last1, _ForwardIter __first2, _ForwardIter __last2) { return ::std::priv:: __find_first_of_aux1(__first1, __last1, __first2, __last2, (typename ::std::iterator_traits< _InputIter > ::value_type*)0, (typename ::std::iterator_traits< _ForwardIter > ::value_type*)0); } template _InputIter __find_first_of(_InputIter __first1, _InputIter __last1, _ForwardIter __first2, _ForwardIter __last2, _BinaryPredicate __comp) { for ( ; __first1 != __last1; ++__first1) { for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter) { if (__comp(*__first1, *__iter)) { return __first1; } } } return __last1; } template _ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2, const forward_iterator_tag &, const forward_iterator_tag &, _BinaryPredicate __comp) { if (__first2 == __last2) return __last1; else { _ForwardIter1 __result = __last1; for (;;) { _ForwardIter1 __new_result = ::std::search(__first1, __last1, __first2, __last2, __comp); if (__new_result == __last1) return __result; else { __result = __new_result; __first1 = __new_result; ++__first1; } } } } } } namespace std { template class reverse_iterator : public iterator::iterator_category, typename iterator_traits<_Iterator>::value_type, typename iterator_traits<_Iterator>::difference_type, typename iterator_traits<_Iterator>::pointer, typename iterator_traits<_Iterator>::reference> { protected: _Iterator current; typedef reverse_iterator<_Iterator> _Self; public: typedef typename iterator_traits<_Iterator>::difference_type difference_type; typedef typename iterator_traits<_Iterator>::pointer pointer; typedef typename iterator_traits<_Iterator>::reference reference; typedef _Iterator iterator_type; public: reverse_iterator() {} explicit reverse_iterator(iterator_type __x) : current(__x) {} reverse_iterator(const _Self& __x) : current(__x.current) {} _Self& operator = (const _Self& __x) { current = __x.base(); return *this; } template reverse_iterator(const reverse_iterator<_Iter>& __x) : current(__x.base()) {} template _Self& operator = (const reverse_iterator<_Iter>& __x) { current = __x.base(); return *this; } iterator_type base() const { return current; } reference operator*() const { _Iterator __tmp = current; return *--__tmp; } pointer operator->() const { return &(operator*()); } _Self& operator++() { --current; return *this; } _Self operator++(int) { _Self __tmp = *this; --current; return __tmp; } _Self& operator--() { ++current; return *this; } _Self operator--(int) { _Self __tmp = *this; ++current; return __tmp; } _Self operator+(difference_type __n) const { return _Self(current - __n); } _Self& operator+=(difference_type __n) { current -= __n; return *this; } _Self operator-(difference_type __n) const { return _Self(current + __n); } _Self& operator-=(difference_type __n) { current += __n; return *this; } reference operator[](difference_type __n) const { return *(*this + __n); } }; template inline bool operator==(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return __x.base() == __y.base(); } template inline bool operator<(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return __y.base() < __x.base(); } template inline bool operator!=(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return !(__x == __y); } template inline bool operator>(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return __y < __x; } template inline bool operator<=(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return !(__y < __x); } template inline bool operator>=(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return !(__x < __y); } template inline typename reverse_iterator<_Iterator>::difference_type operator-(const reverse_iterator<_Iterator>& __x, const reverse_iterator<_Iterator>& __y) { return __y.base() - __x.base(); } template inline reverse_iterator<_Iterator> operator+(_DifferenceType n,const reverse_iterator<_Iterator>& x) { return x.operator+(n); } template class back_insert_iterator : public iterator { typedef back_insert_iterator<_Container> _Self; protected: _Container *container; public: typedef _Container container_type; typedef output_iterator_tag iterator_category; explicit back_insert_iterator(_Container& __x) : container(&__x) {} _Self& operator=(const _Self& __other) { container = __other.container; return *this; } _Self& operator=(const typename _Container::value_type& __val) { container->push_back(__val); return *this; } _Self& operator*() { return *this; } _Self& operator++() { return *this; } _Self operator++(int) { return *this; } }; template inline back_insert_iterator<_Container> back_inserter(_Container& __x) { return back_insert_iterator<_Container>(__x); } template class front_insert_iterator : public iterator { typedef front_insert_iterator<_Container> _Self; protected: _Container *container; public: typedef _Container container_type; typedef output_iterator_tag iterator_category; explicit front_insert_iterator(_Container& __x) : container(&__x) {} _Self& operator=(const _Self& __other) { container = __other.container; return *this; } _Self& operator=(const typename _Container::value_type& __val) { container->push_front(__val); return *this; } _Self& operator*() { return *this; } _Self& operator++() { return *this; } _Self operator++(int) { return *this; } }; template inline front_insert_iterator<_Container> front_inserter(_Container& __x) { return front_insert_iterator<_Container>(__x); } template class insert_iterator : public iterator { typedef insert_iterator<_Container> _Self; protected: _Container *container; typename _Container::iterator iter; public: typedef _Container container_type; typedef output_iterator_tag iterator_category; insert_iterator(_Container& __x, typename _Container::iterator __i) : container(&__x), iter(__i) {} _Self& operator=(_Self const& __other) { container = __other.container; iter = __other. iter; return *this; } _Self& operator=(const typename _Container::value_type& __val) { iter = container->insert(iter, __val); ++iter; return *this; } _Self& operator*() { return *this; } _Self& operator++() { return *this; } _Self& operator++(int) { return *this; } }; template inline insert_iterator<_Container> inserter(_Container& __x, _Iterator __i) { typedef typename _Container::iterator __iter; return insert_iterator<_Container>(__x, __iter(__i)); } } namespace std { namespace priv { template _BidirectionalIter1 __find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, _BidirectionalIter2 __first2, _BidirectionalIter2 __last2, const bidirectional_iterator_tag &, const bidirectional_iterator_tag &, _BinaryPredicate __comp) { typedef ::std::reverse_iterator<_BidirectionalIter1> _RevIter1; typedef ::std::reverse_iterator<_BidirectionalIter2> _RevIter2; _RevIter1 __rlast1(__first1); _RevIter2 __rlast2(__first2); _RevIter1 __rresult = ::std::search(_RevIter1(__last1), __rlast1, _RevIter2(__last2), __rlast2, __comp); if (__rresult == __rlast1) return __last1; else { _BidirectionalIter1 __result = __rresult.base(); ::std::advance(__result, - ::std::distance(__first2, __last2)); return __result; } } } template _ForwardIter1 find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2, _BinaryPredicate __comp) { return ::std::priv:: __find_end(__first1, __last1, __first2, __last2, typename ::std::iterator_traits< _ForwardIter1 > ::iterator_category(), typename ::std::iterator_traits< _ForwardIter2 > ::iterator_category(), __comp); } namespace priv { template _ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, _Compare1 __comp1, _Compare2 __comp2, _Distance*) { _Distance __len = ::std::distance(__first, __last); _Distance __half; _ForwardIter __middle; while (__len > 0) { __half = __len >> 1; __middle = __first; ::std::advance(__middle, __half); if (__comp1(*__middle, __val)) { __first = __middle; ++__first; __len = __len - __half - 1; } else __len = __half; } return __first; } } } namespace std { typedef void (* __oom_handler_type)(); class __malloc_alloc { public: typedef char value_type; static void* allocate(size_t __n) ; static void deallocate(void* __p, size_t ) { free((char*)__p); } static __oom_handler_type set_malloc_handler(__oom_handler_type __f); }; class __new_alloc { public: typedef char value_type; static void* allocate(size_t __n) { return __stl_new(__n); } static void deallocate(void* __p, size_t) { __stl_delete(__p); } }; template class __debug_alloc : public _Alloc { public: typedef _Alloc __allocator_type; typedef typename _Alloc::value_type value_type; private: struct __alloc_header { size_t __magic: 16; size_t __type_size:16; unsigned long _M_size; }; enum __attribute__((__packed__)) { __pad = 8, __magic = 0xdeba, __deleted_magic = 0xdebd, __shred_byte = 0xA3 }; enum __attribute__((__packed__)) { __extra_before = 16, __extra_after = 8 }; static size_t __extra_before_chunk() { return (long)__extra_before / sizeof(value_type) + (size_t)((long)__extra_before % sizeof(value_type) > 0); } static size_t __extra_after_chunk() { return (long)__extra_after / sizeof(value_type) + (size_t)((long)__extra_after % sizeof(value_type) > 0); } public: __debug_alloc() {} ~__debug_alloc() {} static void* allocate(size_t); static void deallocate(void *, size_t); }; enum __attribute__((__packed__)) { _MAX_BYTES = 32 * sizeof(void*) }; class __node_alloc { static void * _M_allocate(size_t& __n); static void _M_deallocate(void *__p, size_t __n); public: typedef char value_type; static void* allocate(size_t& __n) { return (__n > (size_t)_MAX_BYTES) ? __stl_new(__n) : _M_allocate(__n); } static void deallocate(void *__p, size_t __n) { if (__n > (size_t)_MAX_BYTES) __stl_delete(__p); else _M_deallocate(__p, __n); } }; template struct _Alloc_traits { typedef _Allocator _Orig; typedef typename _Allocator::template rebind<_Tp> _Rebind_type; typedef typename _Rebind_type::other allocator_type; static allocator_type create_allocator(const _Orig& __a) { return allocator_type(__a); } }; typedef __new_alloc __alloc_type; typedef __alloc_type __sgi_alloc; typedef __sgi_alloc __single_client_alloc; typedef __sgi_alloc __multithreaded_alloc; template class allocator : public __stlport_class > { public: typedef _Tp value_type; typedef _Tp* pointer; typedef const _Tp* const_pointer; typedef _Tp& reference; typedef const _Tp& const_reference; typedef size_t size_type; typedef ptrdiff_t difference_type; template struct rebind { typedef allocator<_Tp1> other; }; allocator() {} template allocator(const allocator<_Tp1>&) {} allocator(const allocator<_Tp>&) {} allocator(__move_source > src) {} ~allocator() {} pointer address(reference __x) const {return &__x;} const_pointer address(const_reference __x) const { return &__x; } _Tp* allocate(size_type __n, const void* = 0) { if (__n > max_size()) { puts("out of memory\n"); exit(1); } if (__n != 0) { size_type __buf_size = __n * sizeof(value_type); _Tp* __ret = reinterpret_cast<_Tp* >(__sgi_alloc::allocate(__buf_size)); return __ret; } return 0; } void deallocate(pointer __p, size_type __n) { if (__p != 0) { __sgi_alloc::deallocate((void*)__p, __n * sizeof(value_type)); } } void deallocate(pointer __p) const { if (__p != 0) __sgi_alloc::deallocate((void*)__p, sizeof(value_type)); } size_type max_size() const { return size_t(-1) / sizeof(value_type); } void construct(pointer __p, const_reference __val) { ::std::_Copy_Construct(__p, __val); } void destroy(pointer __p) { ::std::_Destroy(__p); } _Tp* _M_allocate(size_type __n, size_type& __allocated_n) { if (__n > max_size()) { puts("out of memory\n"); exit(1); } if (__n != 0) { size_type __buf_size = __n * sizeof(value_type); _Tp* __ret = reinterpret_cast<_Tp* >(__sgi_alloc::allocate(__buf_size)); __allocated_n = __buf_size / sizeof(value_type); return __ret; } return 0; } }; template< > class allocator { public: typedef size_t size_type; typedef ptrdiff_t difference_type; typedef void* pointer; typedef const void* const_pointer; typedef void value_type; template struct rebind { typedef allocator<_Tp1> other; }; }; template inline bool operator==(const allocator<_T1>&, const allocator<_T2>&) { return true; } template inline bool operator!=(const allocator<_T1>&, const allocator<_T2>&) { return false; } namespace priv { template struct __alloc_type_traits { typedef typename _IsSTLportClass >::_Ret _STLportAlloc; typedef _STLportAlloc has_trivial_default_constructor; typedef _STLportAlloc has_trivial_copy_constructor; typedef _STLportAlloc has_trivial_assignment_operator; typedef _STLportAlloc has_trivial_destructor; typedef _STLportAlloc is_POD_type; }; } template struct __type_traits > : ::std::priv:: __alloc_type_traits<_Tp> {}; template inline typename _Alloc_traits<_Tp, _Alloc>::allocator_type __stl_alloc_create(const _Alloc& __a, const _Tp*) { typedef typename _Alloc::template rebind<_Tp>::other _Rebound_type; return _Rebound_type(__a); } namespace priv { template class _STLP_alloc_proxy : public _MaybeReboundAlloc { private: typedef _MaybeReboundAlloc _Base; typedef typename _Base::size_type size_type; typedef _STLP_alloc_proxy<_Value, _Tp, _MaybeReboundAlloc> _Self; public: _Value _M_data; _STLP_alloc_proxy (const _MaybeReboundAlloc& __a, _Value __p) : _MaybeReboundAlloc(__a), _M_data(__p) {} _STLP_alloc_proxy (__move_source<_Self> src) : _Base(::std::priv:: _AsMoveSource(src.get()._M_base())), _M_data(::std::priv:: _AsMoveSource(src.get()._M_data)) {} _Base& _M_base() { return *this; } private: void _M_swap_alloc(_Self&, const __true_type& ) {} void _M_swap_alloc(_Self& __x, const __false_type& ) { _MaybeReboundAlloc &__base_this = *this; _MaybeReboundAlloc &__base_x = __x; ::std::swap(__base_this, __base_x); } public: void _M_swap_alloc(_Self& __x) { typedef typename _IsStateless<_MaybeReboundAlloc>::_Ret _StatelessAlloc; _M_swap_alloc(__x, _StatelessAlloc()); } void swap(_Self& __x) { _M_swap_alloc(__x); ::std::swap(_M_data, __x._M_data); } _Tp* allocate(size_type __n, size_type& __allocated_n) { typedef typename _IsSTLportClass<_MaybeReboundAlloc>::_Ret _STLportAlloc; return allocate(__n, __allocated_n, _STLportAlloc()); } _Tp* allocate(size_type __n) { return _Base::allocate(__n); } private: _Tp* allocate(size_type __n, size_type& __allocated_n, const __true_type& ) { return _Base::_M_allocate(__n, __allocated_n); } _Tp* allocate(size_type __n, size_type& __allocated_n, const __false_type& ) { __allocated_n = __n; return allocate(__n); } }; } } namespace std { template void * __debug_alloc<_Alloc>::allocate(size_t __n) { size_t __total_extra = __extra_before_chunk() + __extra_after_chunk(); size_t __real_n = __n + __total_extra; if (__real_n < __n) { puts("out of memory\n"); exit(1); } __alloc_header *__result = (__alloc_header *)__allocator_type::allocate(__real_n); memset((char*)__result, __shred_byte, __real_n * sizeof(value_type)); __result->__magic = __magic; __result->__type_size = sizeof(value_type); __result->_M_size = (unsigned long)__n; return ((char*)__result) + (long)__extra_before; } template void __debug_alloc<_Alloc>::deallocate(void *__p, size_t __n) { __alloc_header * __real_p = (__alloc_header*)((char *)__p -(long)__extra_before); unsigned char* __tmp; for (__tmp = (unsigned char*)(__real_p + 1); __tmp < (unsigned char*)__p; ++__tmp) { } size_t __real_n = __n + __extra_before_chunk() + __extra_after_chunk(); for (__tmp= ((unsigned char*)__p) + __n * sizeof(value_type); __tmp < ((unsigned char*)__real_p) + __real_n ; ++__tmp) { } __real_p->__magic = __deleted_magic; memset((char*)__p, __shred_byte, __n * sizeof(value_type)); __allocator_type::deallocate(__real_p, __real_n); } } namespace std { template , class _Alloc = allocator<_CharT> > class basic_string; typedef basic_string, allocator > string; typedef basic_string, allocator > wstring; namespace priv { const char* __get_c_string(const string& __str); } } namespace std { namespace priv { template inline _OutputIter __ucopy(_InputIter __first, _InputIter __last, _OutputIter __result, _Distance*) { _OutputIter __cur = __result; { for ( ; __first != __last; ++__first, ++__cur) _Param_Construct(&*__cur, *__first); return __cur; } } template inline _OutputIter __ucopy(_InputIter __first, _InputIter __last, _OutputIter __result, const input_iterator_tag &, _Distance* __d) { return __ucopy(__first, __last, __result, __d); } template inline _OutputIter __ucopy(_RandomAccessIter __first, _RandomAccessIter __last, _OutputIter __result, const random_access_iterator_tag &, _Distance*) { _OutputIter __cur = __result; { for (_Distance __n = __last - __first; __n > 0; --__n) { _Param_Construct(&*__cur, *__first); ++__first; ++__cur; } return __cur; } } template inline _OutputIter __ucopy(_RandomAccessIter __first, _RandomAccessIter __last, _OutputIter __result) { return __ucopy(__first, __last, __result, random_access_iterator_tag(), (ptrdiff_t*)0); } inline void* __ucopy_trivial(const void* __first, const void* __last, void* __result) { return (__last == __first) ? __result : ((char*)memcpy(__result, __first, ((const char*)__last - (const char*)__first))) + ((const char*)__last - (const char*)__first); } template inline _OutputIter __ucopy_ptrs(_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type& ) { return __ucopy(__first, __last, __result, random_access_iterator_tag(), (ptrdiff_t*)0); } template inline _OutputIter __ucopy_ptrs(_InputIter __first, _InputIter __last, _OutputIter __result, const __true_type& ) { return (_OutputIter)__ucopy_trivial(__first, __last, __result); } template inline _OutputIter __ucopy_aux(_InputIter __first, _InputIter __last, _OutputIter __result, const __true_type& ) { return __ucopy_ptrs(__first, __last, __result, _UseTrivialUCopy((typename ::std::iterator_traits< _InputIter > ::value_type*)0, (typename ::std::iterator_traits< _OutputIter > ::value_type*)0)._Answer()); } template inline _OutputIter __ucopy_aux(_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type& ) { return __ucopy(__first, __last, __result, typename ::std::iterator_traits< _InputIter > ::iterator_category(), (typename ::std::iterator_traits< _InputIter > ::difference_type*)0); } } template inline _ForwardIter uninitialized_copy(_InputIter __first, _InputIter __last, _ForwardIter __result) { return ::std::priv:: __ucopy_aux(__first, __last, __result, _BothPtrType< _InputIter, _ForwardIter>::_Answer()); } inline char* uninitialized_copy(const char* __first, const char* __last, char* __result) { return (char*)::std::priv:: __ucopy_trivial(__first, __last, __result); } inline wchar_t* uninitialized_copy(const wchar_t* __first, const wchar_t* __last, wchar_t* __result) { return (wchar_t*)::std::priv:: __ucopy_trivial (__first, __last, __result); } namespace priv { template inline pair<_InputIter, _ForwardIter> __ucopy_n(_InputIter __first, _Size __count, _ForwardIter __result, const input_iterator_tag &) { _ForwardIter __cur = __result; { for ( ; __count > 0 ; --__count, ++__first, ++__cur) _Param_Construct(&*__cur, *__first); return pair<_InputIter, _ForwardIter>(__first, __cur); } } template inline pair<_RandomAccessIter, _ForwardIter> __ucopy_n(_RandomAccessIter __first, _Size __count, _ForwardIter __result, const random_access_iterator_tag &) { _RandomAccessIter __last = __first + __count; return pair<_RandomAccessIter, _ForwardIter>(__last, uninitialized_copy(__first, __last, __result)); } template inline pair<_InputIter, _ForwardIter> __ucopy_n(_InputIter __first, _Size __count, _ForwardIter __result) { return ::std::priv:: __ucopy_n(__first, __count, __result, typename ::std::iterator_traits< _InputIter > ::iterator_category()); } } template inline pair<_InputIter, _ForwardIter> uninitialized_copy_n(_InputIter __first, _Size __count, _ForwardIter __result) { return ::std::priv:: __ucopy_n(__first, __count, __result); } namespace priv { template inline void __ufill(_ForwardIter __first, _ForwardIter __last, const _Tp& __x, _Distance*) { _ForwardIter __cur = __first; { for ( ; __cur != __last; ++__cur) _Param_Construct(&*__cur, __x); } } template inline void __ufill(_ForwardIter __first, _ForwardIter __last, const _Tp& __x, const input_iterator_tag &, _Distance* __d) { __ufill(__first, __last, __x, __d); } template inline void __ufill(_ForwardIter __first, _ForwardIter __last, const _Tp& __x, const random_access_iterator_tag &, _Distance*) { _ForwardIter __cur = __first; { for (_Distance __n = __last - __first; __n > 0; --__n, ++__cur) _Param_Construct(&*__cur, __x); } } } template inline void uninitialized_fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __x) { ::std::priv:: __ufill(__first, __last, __x, typename ::std::iterator_traits< _ForwardIter > ::iterator_category(), (typename ::std::iterator_traits< _ForwardIter > ::difference_type*)0); } inline void uninitialized_fill(unsigned char* __first, unsigned char* __last, const unsigned char& __val) { unsigned char __tmp = __val; memset(__first, __tmp, __last - __first); } inline void uninitialized_fill(signed char* __first, signed char* __last, const signed char& __val) { signed char __tmp = __val; memset(__first, static_cast(__tmp), __last - __first); } inline void uninitialized_fill(char* __first, char* __last, const char& __val) { char __tmp = __val; memset(__first, static_cast(__tmp), __last - __first); } namespace priv { template inline _ForwardIter __ufill_n(_ForwardIter __first, _Size __n, const _Tp& __x) { _ForwardIter __cur = __first; { for ( ; __n > 0; --__n, ++__cur) _Param_Construct(&*__cur, __x); } return __cur; } template inline _ForwardIter __ufill_n(_ForwardIter __first, _Size __n, const _Tp& __x, const input_iterator_tag &) { return __ufill_n(__first, __n, __x); } template inline _ForwardIter __uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x) { _ForwardIter __last = __first + __n; __ufill(__first, __last, __x, random_access_iterator_tag(), (ptrdiff_t*)0); return __last; } template inline _ForwardIter __ufill_n(_ForwardIter __first, _Size __n, const _Tp& __x, const random_access_iterator_tag &) { return __uninitialized_fill_n(__first, __n, __x); } template inline _ForwardIter __uinit_aux_aux(_ForwardIter __first, _Size __n, const _Tp& __val, const __false_type& ) { return __uninitialized_fill_n(__first, __n, __val); } template inline _ForwardIter __uinit_aux_aux(_ForwardIter __first, _Size __n, const _Tp& , const __true_type& ) { memset((unsigned char*)__first, 0, __n * sizeof(_Tp)); return __first + __n; } template inline _ForwardIter __uinit_aux(_ForwardIter __first, _Size __n, const _Tp&, const __true_type& ) { return __first + __n; } template inline _ForwardIter __uinit_aux(_ForwardIter __first, _Size __n, const _Tp& __val, const __false_type& ) { return __uinit_aux_aux(__first, __n, __val, _HasDefaultZeroValue(__first)._Answer()); } template inline _ForwardIter __uninitialized_init(_ForwardIter __first, _Size __n, const _Tp& __val) { return __uinit_aux(__first, __n, __val, _UseTrivialInit(__first)._Answer()); } } template inline void uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x) { ::std::priv:: __ufill_n(__first, __n, __x, typename ::std::iterator_traits< _ForwardIter > ::iterator_category()); } namespace priv { template inline _ForwardIter __uninitialized_copy_copy(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _ForwardIter __result) { _ForwardIter __new_result = uninitialized_copy(__first1, __last1, __result); { return uninitialized_copy(__first2, __last2, __new_result); } } template inline _ForwardIter __uninitialized_fill_copy(_ForwardIter __result, _ForwardIter __mid, const _Tp& __x, _InputIter __first, _InputIter __last) { uninitialized_fill(__result, __mid, __x); { return uninitialized_copy(__first, __last, __mid); } } template inline void __uninitialized_copy_fill(_Iter __first1, _Iter __last1, _Iter __first2, _Iter __last2, const _Tp& __x) { _Iter __mid2 = uninitialized_copy(__first1, __last1, __first2); { uninitialized_fill(__mid2, __last2, __x); } } template inline _ForwardIter __uninitialized_move(_InputIter __first, _InputIter __last, _ForwardIter __result, _TrivialUCpy __trivial_ucpy, const __false_type& ) { return __ucopy_ptrs(__first, __last, __result, __trivial_ucpy); } template inline _ForwardIter __uninitialized_move(_InputIter __first, _InputIter __last, _ForwardIter __result, _TrivialUCpy , const __true_type& ) { for (ptrdiff_t __n = __last - __first ; __n > 0; --__n) { _Move_Construct(&*__result, *__first); ++__first; ++__result; } return __result; } } } namespace std { namespace priv { template struct __char_wrapper { typedef const _CharT& const_reference; __char_wrapper(_CharT __val) : _Val(__val) {} _CharT getValue() const { return _Val; } size_t size() const { return 1; } const_reference operator[] (size_t __n) const { return (&_Val)[__n]; } private: _CharT _Val; }; template struct __cstr_wrapper { typedef const _CharT& const_reference; __cstr_wrapper(const _CharT *__cstr, size_t __size) : _CStr(__cstr), _Size(__size) {} const _CharT* c_str() const { return _CStr; } size_t size() const { return _Size; } const_reference operator[] (size_t __n) const { return _CStr[__n]; } private: const _CharT *_CStr; size_t _Size; }; template struct __bstr_wrapper { typedef const _CharT& const_reference; typedef basic_string<_CharT, _Traits, _Alloc> _BString; __bstr_wrapper (_BString const& __s) : _BStr(__s) {} size_t size() const { return _BStr.size(); } const_reference operator[] (size_t __n) const { return _BStr[__n]; } _BString const& b_str() const { return _BStr; } private: _BString const& _BStr; }; struct __on_left {}; struct __on_right {}; template class __bstr_sum { public: typedef basic_string<_CharT, _Traits, _Alloc> _BString; typedef typename _BString::const_reference const_reference; typedef typename _BString::const_iterator const_iterator; typedef typename _BString::const_reverse_iterator const_reverse_iterator; typedef typename _BString::size_type size_type; typedef typename _BString::allocator_type allocator_type; typedef __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDirection> _Self; __bstr_sum (_Left const& lhs, _Right const& rhs) : _lhs(lhs), _rhs(rhs) {} _Left const& getLhs() const { return _lhs; } _Right const& getRhs() const { return _rhs; } allocator_type get_allocator() const { return _M_get_storage(false).get_allocator(); } const_iterator begin() const { return _M_get_storage().begin(); } const_iterator end() const { return _M_get_storage().end(); } const_reverse_iterator rbegin() const { return _M_get_storage().rbegin(); } const_reverse_iterator rend() const { return _M_get_storage().rend(); } size_type size() const { return _lhs.size() + _rhs.size(); } size_type length() const { return size(); } size_t max_size() const { return _M_get_storage().max_size(); } size_type capacity() const { return size(); } bool empty() const { return size() == 0; } const_reference operator[](size_t __n) const { return (__n < _lhs.size())?_lhs[__n]:_rhs[__n - _lhs.size()]; } const_reference at(size_type __n) const { return _M_get_storage().at(__n); } typedef __bstr_sum<_CharT, _Traits, _Alloc, _Self, __bstr_wrapper<_CharT, _Traits, _Alloc>, __on_left> _BStrOnLeft; _BStrOnLeft operator += (const _BString& __s) { return append(__s); } typedef __bstr_sum<_CharT, _Traits, _Alloc, _Self, __cstr_wrapper<_CharT>, __on_left> _CStrOnLeft; _CStrOnLeft operator += (const _CharT* __s) { return append(__s); } typedef __bstr_sum<_CharT, _Traits, _Alloc, _Self, __char_wrapper<_CharT>, __on_left> _CharOnLeft; _CharOnLeft operator += (_CharT __c) { return _CharOnLeft(*this, __c); } _BStrOnLeft append (const _BString& __s) { return _BStrOnLeft(*this, __s); } _BString& append(const _BString& __s, size_type __pos, size_type __n) { return _M_get_storage().append(__s, __pos, __n); } _CStrOnLeft append(const _CharT* __s) { const size_type __n = _Traits::length(__s); return _CStrOnLeft(*this, __cstr_wrapper<_CharT>(__s, __n)); } _CStrOnLeft append(const _CharT* __s, size_type __n) { return _CStrOnLeft(*this, __cstr_wrapper<_CharT>(__s, __n)); } _BString& append(size_type __n, _CharT __c) {return _M_get_storage().append(__n, __c);} template _BString& append(_InputIter __first, _InputIter __last) {return _M_get_storage().append(__first, __last);} _BString& assign(const _BString& __s) {return _M_get_storage().assign(__s);} _BString& assign(const _BString& __s, size_type __pos, size_type __n) {return _M_get_storage().assign(__s, __pos, __n);} _BString& assign(const _CharT* __s, size_type __n) {return _M_get_storage().assign(__s, __n);} _BString& assign(const _CharT* __s) {return _M_get_storage().assign(__s); } _BString& assign(size_type __n, _CharT __c) {return _M_get_storage().assign(__n, __c);} _BString& insert(size_type __pos, const _BString& __s) {return _M_get_storage().insert(__pos, __s);} _BString& insert(size_type __pos, const _BString& __s, size_type __beg, size_type __n) {return _M_get_storage().insert(__pos, __s, __beg, __n);} _BString& insert(size_type __pos, const _CharT* __s, size_type __n) {return _M_get_storage().insert(__pos, __s, __n);} _BString& insert(size_type __pos, const _CharT* __s) {return _M_get_storage().insert(__pos, __s);} _BString& insert(size_type __pos, size_type __n, _CharT __c) {return _M_get_storage().insert(__pos, __n, __c);} _BString& erase(size_type __pos = 0, size_type __n =_BString::npos) {return _M_get_storage().erase(__pos, __n);} _BString& replace(size_type __pos, size_type __n, const _BString& __s) {return _M_get_storage().replace(__pos, __n, __s);} _BString& replace(size_type __pos1, size_type __n1, const _BString& __s, size_type __pos2, size_type __n2) {return _M_get_storage().replace(__pos1, __n1, __s, __pos2, __n2);} _BString& replace(size_type __pos, size_type __n1, const _CharT* __s, size_type __n2) {return _M_get_storage().replace(__pos, __n1, __s, __n2);} _BString& replace(size_type __pos, size_type __n1, const _CharT* __s) {return _M_get_storage().replace(__pos, __n1, __s);} _BString& replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c) {return _M_get_storage().replace(__pos, __n1, __n2, __c);} size_type copy(_CharT* __s, size_type __n, size_type __pos = 0) const {return _M_get_storage().copy(__s, __n, __pos);} void swap(_BString& __s) {_M_get_storage().swap(__s);} const _CharT* c_str() const { return _M_get_storage().c_str(); } const _CharT* data() const { return _M_get_storage().data(); } size_type find(const _BString& __s, size_type __pos = 0) const { return _M_get_storage().find(__s, __pos); } size_type find(const _CharT* __s, size_type __pos = 0) const { return _M_get_storage().find(__s, __pos); } size_type find(const _CharT* __s, size_type __pos, size_type __n) const { return _M_get_storage().find(__s, __pos, __n); } size_type find(_CharT __c, size_type __pos = 0) const { return _M_get_storage().find(__c, __pos); } size_type rfind(const _BString& __s, size_type __pos = _BString::npos) const { return _M_get_storage().rfind(__s, __pos); } size_type rfind(const _CharT* __s, size_type __pos = _BString::npos) const { return _M_get_storage().rfind(__s, __pos); } size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const { return _M_get_storage().rfind(__s, __pos, __n); } size_type rfind(_CharT __c, size_type __pos = _BString::npos) const { return _M_get_storage().rfind(__c, __pos); } size_type find_first_of(const _BString& __s, size_type __pos = 0) const { return _M_get_storage().find_first_of(__s, __pos); } size_type find_first_of(const _CharT* __s, size_type __pos = 0) const { return _M_get_storage().find_first_of(__s, __pos); } size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const { return _M_get_storage().find_first_of(__s, __pos, __n); } size_type find_first_of(_CharT __c, size_type __pos = 0) const { return _M_get_storage().find(__c, __pos); } size_type find_last_of(const _BString& __s, size_type __pos = _BString::npos) const { return _M_get_storage().find_last_of(__s, __pos); } size_type find_last_of(const _CharT* __s, size_type __pos = _BString::npos) const { return _M_get_storage().find_last_of(__s, __pos); } size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const { return _M_get_storage().find_last_of(__s, __pos, __n); } size_type find_last_of(_CharT __c, size_type __pos = _BString::npos) const { return _M_get_storage().rfind(__c, __pos); } size_type find_first_not_of(const _BString& __s, size_type __pos = 0) const { return _M_get_storage().find_first_not_of(__s, __pos); } size_type find_first_not_of(const _CharT* __s, size_type __pos = 0) const { return _M_get_storage().find_first_not_of(__s, __pos); } size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const { return _M_get_storage().find_first_not_of(__s, __pos, __n); } size_type find_first_not_of(_CharT __c, size_type __pos = 0) const { return _M_get_storage().find_first_not_of(__c, __pos); } size_type find_last_not_of(const _BString& __s, size_type __pos = _BString::npos) const { return _M_get_storage().find_last_not_of(__s, __pos); } size_type find_last_not_of(const _CharT* __s, size_type __pos =_BString:: npos) const { return _M_get_storage().find_last_not_of(__s, __pos); } size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const { return _M_get_storage().find_last_not_of(__s, __pos, __n); } size_type find_last_not_of(_CharT __c, size_type __pos = _BString::npos) const { return _M_get_storage().find_last_not_of(__c, __pos); } _BString substr(size_type __pos = 0, size_type __n = _BString::npos) const { return _M_get_storage().substr(__pos, __n); } int compare(const _BString& __s) const { return _M_get_storage().compare(__s); } int compare(size_type __pos1, size_type __n1, const _Self& __s) const { return _M_get_storage().compare(__pos1, __n1, __s); } int compare(size_type __pos1, size_type __n1, const _Self& __s, size_type __pos2, size_type __n2) const { return _M_get_storage().compare(__pos1, __n1, __s, __pos2, __n2); } int compare(const _CharT* __s) const { return _M_get_storage().compare(__s); } int compare(size_type __pos1, size_type __n1, const _CharT* __s) const { return _M_get_storage().compare(__pos1, __n1, __s); } int compare(size_type __pos1, size_type __n1, const _CharT* __s, size_type __n2) const { return _M_get_storage().compare(__pos1, __n1, __s, __n2); } _BString& _M_get_storage() { return _rhs._M_get_storage(*this, _StorageDirection()); } template _BString& _M_get_storage(__bstr_sum<_CharT, _Traits, _Alloc, _Lhs, _Rhs, _StorageDir> const& __ref, __on_left const& ) { return _lhs._M_get_storage(__ref); } template _BString& _M_get_storage(__bstr_sum<_CharT, _Traits, _Alloc, _Lhs, _Rhs, _StorageDir> const& __ref, __on_right const& ) { return _rhs._M_get_storage(__ref); } template _BString& _M_get_storage(__bstr_sum<_CharT, _Traits, _Alloc, _Lhs, _Rhs, _StorageDir> const& __ref) { return _M_get_storage(__ref, _StorageDirection()); } _BString const& _M_get_storage(bool __do_init = true) const { return _M_get_storage(*this, __do_init, _StorageDirection()); } template _BString const& _M_get_storage(__bstr_sum<_CharT, _Traits, _Alloc, _Lhs, _Rhs, _StorageDir> const& __ref, bool __do_init, __on_left const& ) const { return _lhs._M_get_storage(__ref, __do_init); } template _BString const& _M_get_storage(__bstr_sum<_CharT, _Traits, _Alloc, _Lhs, _Rhs, _StorageDir> const& __ref, bool __do_init, __on_right const& ) const { return _rhs._M_get_storage(__ref, __do_init); } template _BString const& _M_get_storage(__bstr_sum<_CharT, _Traits, _Alloc, _Lhs, _Rhs, _StorageDir> const& __ref, bool __do_init) const { return _M_get_storage(__ref, __do_init, _StorageDirection()); } private: _Left _lhs; _Right _rhs; }; template inline __bstr_sum<_CharT, _Traits, _Alloc, __bstr_sum<_CharT, _Traits, _Alloc, _Lh1, _Rh1, _StoreDir1>, __bstr_sum<_CharT, _Traits, _Alloc, _Lh2, _Rh2, _StoreDir2>, __on_right> operator + (const __bstr_sum<_CharT, _Traits, _Alloc, _Lh1, _Rh1, _StoreDir1> &__lhs, const __bstr_sum<_CharT, _Traits, _Alloc, _Lh2, _Rh2, _StoreDir2> &__rhs) { return __bstr_sum<_CharT, _Traits, _Alloc, __bstr_sum<_CharT, _Traits, _Alloc, _Lh1, _Rh1, _StoreDir1>, __bstr_sum<_CharT, _Traits, _Alloc, _Lh2, _Rh2, _StoreDir2>, __on_right>(__lhs, __rhs); } template inline bool operator == (const __bstr_sum<_CharT, _Traits, _Alloc, _Lh1, _Rh1, _StoreDir1> &__lhs, const __bstr_sum<_CharT, _Traits, _Alloc, _Lh2, _Rh2, _StoreDir2> &__rhs) { return (__lhs.size() == __rhs.size()) && (__lhs._M_get_storage() == __rhs._M_get_storage()); } template inline bool operator < (const __bstr_sum<_CharT, _Traits, _Alloc, _Lh1, _Rh1, _StoreDir1> &__lhs, const __bstr_sum<_CharT, _Traits, _Alloc, _Lh2, _Rh2, _StoreDir2> &__rhs) { return __lhs._M_get_storage() < __rhs._M_get_storage(); } template inline bool operator != (const __bstr_sum<_CharT, _Traits, _Alloc, _Lh1, _Rh1, _StoreDir1> &__lhs, const __bstr_sum<_CharT, _Traits, _Alloc, _Lh2, _Rh2, _StoreDir2> &__rhs) { return !(__lhs == __rhs); } template inline bool operator > (const __bstr_sum<_CharT, _Traits, _Alloc, _Lh1, _Rh1, _StoreDir1> &__lhs, const __bstr_sum<_CharT, _Traits, _Alloc, _Lh2, _Rh2, _StoreDir2> &__rhs) { return __rhs < __lhs; } template inline bool operator <= (const __bstr_sum<_CharT, _Traits, _Alloc, _Lh1, _Rh1, _StoreDir1> &__lhs, const __bstr_sum<_CharT, _Traits, _Alloc, _Lh2, _Rh2, _StoreDir2> &__rhs) { return !(__rhs < __lhs); } template inline bool operator >= (const __bstr_sum<_CharT, _Traits, _Alloc, _Lh1, _Rh1, _StoreDir1> &__lhs, const __bstr_sum<_CharT, _Traits, _Alloc, _Lh2, _Rh2, _StoreDir2> &__rhs) { return !(__lhs < __rhs); } template struct __sum_storage_elem { typedef __sum_storage_elem<_CharT, _Traits, _Alloc> _Self; typedef basic_string<_CharT, _Traits, _Alloc> _BString; __sum_storage_elem(_Alloc __alloc) : _M_init(false), _M_storage(__alloc) {} template void _M_Init(__bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir> const& __ref) const { if (!_M_init) { _M_storage = __ref; _M_init = true; } } template _BString const& _M_get_storage(__bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir> const& __ref, bool __do_init) const { if (__do_init) { _M_Init(__ref); } return _M_storage; } template _BString& _M_get_storage(__bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir> const& __ref) { _M_Init(__ref); return _M_storage; } size_t size() const { return 0; } _CharT const& operator[](size_t __n) const { return static_cast<_CharT* >(0)[__n]; } private: mutable bool _M_init; mutable basic_string<_CharT, _Traits, _Alloc> _M_storage; }; } } namespace std { namespace priv { template class _String_base { typedef _String_base<_Tp, _Alloc> _Self; protected: public: enum __attribute__((__packed__)) {_DEFAULT_SIZE = 4 * sizeof( void * )}; typedef _Alloc allocator_type; typedef _STLP_alloc_proxy<_Tp*, _Tp, allocator_type> _AllocProxy; typedef size_t size_type; private: union _Buffers { _Tp* _M_end_of_storage; _Tp _M_static_buf[_DEFAULT_SIZE]; } _M_buffers; protected: bool _M_using_static_buf() const { return (_M_start_of_storage._M_data == _M_buffers._M_static_buf); } _Tp const* _M_Start() const { return _M_start_of_storage._M_data; } _Tp* _M_Start() { return _M_start_of_storage._M_data; } _Tp const* _M_End() const { return _M_using_static_buf() ? _M_buffers._M_static_buf + _DEFAULT_SIZE : _M_buffers._M_end_of_storage; } _Tp* _M_End() { return _M_using_static_buf() ? _M_buffers._M_static_buf + _DEFAULT_SIZE : _M_buffers._M_end_of_storage; } size_type _M_capacity() const { return _M_using_static_buf() ? _DEFAULT_SIZE : _M_buffers._M_end_of_storage - _M_start_of_storage._M_data; } size_type _M_rest() const { return _M_using_static_buf() ? _DEFAULT_SIZE - (_M_finish - _M_buffers._M_static_buf) : _M_buffers._M_end_of_storage - _M_finish; } _Tp* _M_finish; _AllocProxy _M_start_of_storage; _Tp const* _M_Finish() const {return _M_finish;} _Tp* _M_Finish() {return _M_finish;} void _M_allocate_block(size_t __n = _DEFAULT_SIZE); void _M_deallocate_block() { if (!_M_using_static_buf() && (_M_start_of_storage._M_data != 0)) _M_start_of_storage.deallocate(_M_start_of_storage._M_data, _M_buffers._M_end_of_storage - _M_start_of_storage._M_data); } size_t max_size() const { const size_type __string_max_size = size_type(-1) / sizeof(_Tp); typename allocator_type::size_type __alloc_max_size = _M_start_of_storage.max_size(); return (min)(__alloc_max_size, __string_max_size) - 1; } _String_base(const allocator_type& __a) : _M_finish(_M_buffers._M_static_buf), _M_start_of_storage(__a, _M_buffers._M_static_buf) {} _String_base(const allocator_type& __a, size_t __n) : _M_finish(_M_buffers._M_static_buf), _M_start_of_storage(__a, _M_buffers._M_static_buf) { _M_allocate_block(__n); } void _M_move_src (_Self &src) { if (src._M_using_static_buf()) { _M_buffers = src._M_buffers; _M_finish = _M_buffers._M_static_buf + (src._M_finish - src._M_start_of_storage._M_data); _M_start_of_storage._M_data = _M_buffers._M_static_buf; } else { _M_start_of_storage._M_data = src._M_start_of_storage._M_data; _M_finish = src._M_finish; _M_buffers._M_end_of_storage = src._M_buffers._M_end_of_storage; src._M_start_of_storage._M_data = 0; } } _String_base(__move_source<_Self> src) : _M_start_of_storage(__move_source<_AllocProxy>(src.get()._M_start_of_storage)) { _M_move_src(src.get()); } ~_String_base() { _M_deallocate_block(); } void _M_reset(_Tp *__start, _Tp *__finish, _Tp *__end_of_storage) { _M_buffers._M_end_of_storage = __end_of_storage; _M_finish = __finish; _M_start_of_storage._M_data = __start; } void _M_swap(_Self &__s) { if (_M_using_static_buf()) { if (__s._M_using_static_buf()) { ::std::swap(_M_buffers, __s._M_buffers); _Tp *__tmp = _M_finish; _M_finish = _M_start_of_storage._M_data + (__s._M_finish - __s._M_start_of_storage._M_data); __s._M_finish = __s._M_buffers._M_static_buf + (__tmp - _M_start_of_storage._M_data); _M_start_of_storage.swap(__s._M_start_of_storage); _M_start_of_storage._M_data = _M_buffers._M_static_buf; __s._M_start_of_storage._M_data = __s._M_buffers._M_static_buf; } else { __s._M_swap(*this); return; } } else if (__s._M_using_static_buf()) { _Tp *__tmp = _M_start_of_storage._M_data; _Tp *__tmp_finish = _M_finish; _Tp *__tmp_end_data = _M_buffers._M_end_of_storage; _M_buffers = __s._M_buffers; _M_start_of_storage.swap(__s._M_start_of_storage); _M_start_of_storage._M_data = _M_buffers._M_static_buf; _M_finish = _M_buffers._M_static_buf + (__s._M_finish - __s._M_buffers._M_static_buf); __s._M_buffers._M_end_of_storage = __tmp_end_data; __s._M_start_of_storage._M_data = __tmp; __s._M_finish = __tmp_finish; } else { ::std::swap(_M_buffers._M_end_of_storage, __s._M_buffers._M_end_of_storage); _M_start_of_storage.swap(__s._M_start_of_storage); ::std::swap(_M_finish, __s._M_finish); } } void _M_throw_length_error() const; void _M_throw_out_of_range() const; }; } } namespace std { namespace priv { struct _String_reserve_t {}; } template class basic_string : private ::std::priv:: _String_base<_CharT,_Alloc> { private: typedef ::std::priv:: _String_base<_CharT,_Alloc> _Base; typedef basic_string<_CharT, _Traits, _Alloc> _Self; public: typedef _CharT value_type; typedef _Traits traits_type; typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; typedef typename _Base::size_type size_type; typedef ptrdiff_t difference_type; typedef random_access_iterator_tag _Iterator_category; typedef const value_type* const_iterator; typedef value_type* iterator; typedef ::std::reverse_iterator const_reverse_iterator; typedef ::std::reverse_iterator reverse_iterator; static const size_t npos = ~(size_t)0; typedef ::std::priv:: _String_reserve_t _Reserve_t; public: typedef typename _Base::allocator_type allocator_type; allocator_type get_allocator() const { return (const allocator_type&)this->_M_start_of_storage; } explicit basic_string(const allocator_type& __a = allocator_type()) : ::std::priv:: _String_base<_CharT,_Alloc>(__a, _Base::_DEFAULT_SIZE) { _M_terminate_string(); } basic_string(_Reserve_t, size_t __n, const allocator_type& __a = allocator_type()) : ::std::priv:: _String_base<_CharT,_Alloc>(__a, __n + 1) { _M_terminate_string(); } basic_string(const _Self&); basic_string(const _Self& __s, size_type __pos, size_type __n = npos, const allocator_type& __a = allocator_type()) : ::std::priv:: _String_base<_CharT,_Alloc>(__a) { if (__pos > __s.size()) this->_M_throw_out_of_range(); else _M_range_initialize(__s._M_Start() + __pos, __s._M_Start() + __pos + (min) (__n, __s.size() - __pos)); } basic_string(const _CharT* __s, size_type __n, const allocator_type& __a = allocator_type()) : ::std::priv:: _String_base<_CharT,_Alloc>(__a) { _M_range_initialize(__s, __s + __n); } basic_string(const _CharT* __s, const allocator_type& __a = allocator_type()); basic_string(size_type __n, _CharT __c, const allocator_type& __a = allocator_type()) : ::std::priv:: _String_base<_CharT,_Alloc>(__a, __n + 1) { this->_M_finish = ::std::priv:: __uninitialized_fill_n(this->_M_Start(), __n, __c); _M_terminate_string(); } basic_string(__move_source<_Self> src) : ::std::priv:: _String_base<_CharT,_Alloc>(__move_source<_Base>(src.get())) {} template basic_string(_InputIterator __f, _InputIterator __l, const allocator_type & __a = allocator_type()) : ::std::priv:: _String_base<_CharT,_Alloc>(__a) { typedef typename _IsIntegral<_InputIterator>::_Ret _Integral; _M_initialize_dispatch(__f, __l, _Integral()); } private: size_type _M_compute_next_size(size_type __n) { const size_type __size = size(); if (__n > max_size() - __size) this->_M_throw_length_error(); size_type __len = __size + (max)(__n, __size) + 1; if (__len > max_size() || __len < __size) __len = max_size(); return __len; } template void _M_range_initialize(_InputIter __f, _InputIter __l, const input_iterator_tag &__tag) { this->_M_allocate_block(); _M_construct_null(this->_M_Finish()); _M_appendT(__f, __l, __tag); } template void _M_range_initialize(_ForwardIter __f, _ForwardIter __l, const forward_iterator_tag &) { difference_type __n = ::std::distance(__f, __l); this->_M_allocate_block(__n + 1); this->_M_finish = uninitialized_copy(__f, __l, this->_M_Start()); this->_M_terminate_string(); } template void _M_range_initializeT(_InputIter __f, _InputIter __l) { _M_range_initialize(__f, __l, typename ::std::iterator_traits< _InputIter > ::iterator_category()); } template void _M_initialize_dispatch(_Integer __n, _Integer __x, const __true_type& ) { this->_M_allocate_block(__n + 1); this->_M_finish = ::std::priv:: __uninitialized_fill_n(this->_M_Start(), __n, __x); this->_M_terminate_string(); } template void _M_initialize_dispatch(_InputIter __f, _InputIter __l, const __false_type& ) { _M_range_initializeT(__f, __l); } public: _Self& operator=(const _Self& __s) { if (&__s != this) _M_assign(__s._M_Start(), __s._M_Finish()); return *this; } _Self& operator=(const _CharT* __s) { return _M_assign(__s, __s + traits_type::length(__s)); } _Self& operator=(_CharT __c) { return assign(static_cast(1), __c); } private: static _CharT _M_null() { return _CharT(); } private: void _M_construct_null(_CharT* __p) const { ::std::_Construct(__p); } void _M_terminate_string() { _M_construct_null(this->_M_Finish()); } bool _M_inside(const _CharT* __s) const { return (__s >= this->_M_Start()) && (__s < this->_M_Finish()); } void _M_range_initialize(const _CharT* __f, const _CharT* __l) { ptrdiff_t __n = __l - __f; this->_M_allocate_block(__n + 1); this->_M_finish = uninitialized_copy(__f, __l, this->_M_Start()); _M_terminate_string(); } public: iterator begin() { return this->_M_Start(); } iterator end() { return this->_M_Finish(); } const_iterator begin() const { return this->_M_Start(); } const_iterator end() const { return this->_M_Finish(); } reverse_iterator rbegin() { return reverse_iterator(this->_M_Finish()); } reverse_iterator rend() { return reverse_iterator(this->_M_Start()); } const_reverse_iterator rbegin() const { return const_reverse_iterator(this->_M_Finish()); } const_reverse_iterator rend() const { return const_reverse_iterator(this->_M_Start()); } public: size_type size() const { return this->_M_Finish() - this->_M_Start(); } size_type length() const { return size(); } size_type max_size() const { return _Base::max_size(); } void resize(size_type __n, _CharT __c) { if (__n <= size()) erase(begin() + __n, end()); else append(__n - size(), __c); } void resize(size_type __n) { resize(__n, _M_null()); } private: void _M_reserve(size_type); public: void reserve(size_type = 0); size_type capacity() const { return this->_M_capacity() - 1; } void clear() { if (!empty()) { _Traits::assign(*(this->_M_Start()), _M_null()); this->_M_finish = this->_M_Start(); } } bool empty() const { return this->_M_Start() == this->_M_Finish(); } public: const_reference operator[](size_type __n) const { return *(this->_M_Start() + __n); } reference operator[](size_type __n) { return *(this->_M_Start() + __n); } const_reference at(size_type __n) const { if (__n >= size()) this->_M_throw_out_of_range(); return *(this->_M_Start() + __n); } reference at(size_type __n) { if (__n >= size()) this->_M_throw_out_of_range(); return *(this->_M_Start() + __n); } public: _Self& operator+=(const _Self& __s) { return append(__s); } _Self& operator+=(const _CharT* __s) { return append(__s); } _Self& operator+=(_CharT __c) { push_back(__c); return *this; } private: _Self& _M_append(const _CharT* __first, const _CharT* __last); template _Self& _M_appendT(_InputIter __first, _InputIter __last, const input_iterator_tag &) { for ( ; __first != __last ; ++__first) push_back(*__first); return *this; } template _Self& _M_appendT(_ForwardIter __first, _ForwardIter __last, const forward_iterator_tag &) { if (__first != __last) { size_type __n = static_cast(::std::distance(__first, __last)); if (__n >= this->_M_rest()) { size_type __len = _M_compute_next_size(__n); pointer __new_start = this->_M_start_of_storage.allocate(__len, __len); pointer __new_finish = uninitialized_copy(this->_M_Start(), this->_M_Finish(), __new_start); __new_finish = uninitialized_copy(__first, __last, __new_finish); _M_construct_null(__new_finish); this->_M_deallocate_block(); this->_M_reset(__new_start, __new_finish, __new_start + __len); } else { _Traits::assign(*this->_M_finish, *__first++); uninitialized_copy(__first, __last, this->_M_Finish() + 1); _M_construct_null(this->_M_Finish() + __n); this->_M_finish += __n; } } return *this; } template _Self& _M_append_dispatch(_Integer __n, _Integer __x, const __true_type& ) { return append((size_type) __n, (_CharT) __x); } template _Self& _M_append_dispatch(_InputIter __f, _InputIter __l, const __false_type& ) { return _M_appendT(__f, __l, typename ::std::iterator_traits< _InputIter > ::iterator_category()); } public: template _Self& append(_InputIter __first, _InputIter __last) { typedef typename _IsIntegral<_InputIter>::_Ret _Integral; return _M_append_dispatch(__first, __last, _Integral()); } public: _Self& append(const _Self& __s) { return _M_append(__s._M_Start(), __s._M_Finish()); } _Self& append(const _Self& __s, size_type __pos, size_type __n) { if (__pos > __s.size()) this->_M_throw_out_of_range(); return _M_append(__s._M_Start() + __pos, __s._M_Start() + __pos + (min) (__n, __s.size() - __pos)); } _Self& append(const _CharT* __s, size_type __n) { return _M_append(__s, __s+__n); } _Self& append(const _CharT* __s) { return _M_append(__s, __s + traits_type::length(__s)); } _Self& append(size_type __n, _CharT __c); public: void push_back(_CharT __c) { if (this->_M_rest() == 1 ) _M_reserve(_M_compute_next_size(1)); _M_construct_null(this->_M_Finish() + 1); _Traits::assign(*(this->_M_Finish()), __c); ++this->_M_finish; } void pop_back() { _Traits::assign(*(this->_M_Finish() - 1), _M_null()); --this->_M_finish; } public: _Self& assign(const _Self& __s) { return _M_assign(__s._M_Start(), __s._M_Finish()); } _Self& assign(const _Self& __s, size_type __pos, size_type __n) { if (__pos > __s.size()) this->_M_throw_out_of_range(); return _M_assign(__s._M_Start() + __pos, __s._M_Start() + __pos + (min) (__n, __s.size() - __pos)); } _Self& assign(const _CharT* __s, size_type __n) { return _M_assign(__s, __s + __n); } _Self& assign(const _CharT* __s) { return _M_assign(__s, __s + _Traits::length(__s)); } _Self& assign(size_type __n, _CharT __c); private: _Self& _M_assign(const _CharT* __f, const _CharT* __l); template _Self& _M_assign_dispatch(_Integer __n, _Integer __x, const __true_type& ) { return assign((size_type) __n, (_CharT) __x); } template _Self& _M_assign_dispatch(_InputIter __f, _InputIter __l, const __false_type& ) { pointer __cur = this->_M_Start(); while (__f != __l && __cur != this->_M_Finish()) { _Traits::assign(*__cur, *__f); ++__f; ++__cur; } if (__f == __l) erase(__cur, this->end()); else _M_appendT(__f, __l, typename ::std::iterator_traits< _InputIter > ::iterator_category()); return *this; } public: template _Self& assign(_InputIter __first, _InputIter __last) { typedef typename _IsIntegral<_InputIter>::_Ret _Integral; return _M_assign_dispatch(__first, __last, _Integral()); } public: _Self& insert(size_type __pos, const _Self& __s) { if (__pos > size()) this->_M_throw_out_of_range(); if (__s.size() > max_size() - size()) this->_M_throw_length_error(); _M_insert(begin() + __pos, __s._M_Start(), __s._M_Finish(), &__s == this); return *this; } _Self& insert(size_type __pos, const _Self& __s, size_type __beg, size_type __n) { if (__pos > size() || __beg > __s.size()) this->_M_throw_out_of_range(); size_type __len = (min) (__n, __s.size() - __beg); if (__len > max_size() - size()) this->_M_throw_length_error(); _M_insert(begin() + __pos, __s._M_Start() + __beg, __s._M_Start() + __beg + __len, &__s == this); return *this; } _Self& insert(size_type __pos, const _CharT* __s, size_type __n) { if (__pos > size()) this->_M_throw_out_of_range(); if (__n > max_size() - size()) this->_M_throw_length_error(); _M_insert(begin() + __pos, __s, __s + __n, _M_inside(__s)); return *this; } _Self& insert(size_type __pos, const _CharT* __s) { if (__pos > size()) this->_M_throw_out_of_range(); size_type __len = _Traits::length(__s); if (__len > max_size() - size()) this->_M_throw_length_error(); _M_insert(this->_M_Start() + __pos, __s, __s + __len, _M_inside(__s)); return *this; } _Self& insert(size_type __pos, size_type __n, _CharT __c) { if (__pos > size()) this->_M_throw_out_of_range(); if (__n > max_size() - size()) this->_M_throw_length_error(); insert(begin() + __pos, __n, __c); return *this; } iterator insert(iterator __p, _CharT __c) { if (__p == end()) { push_back(__c); return this->_M_Finish() - 1; } else return _M_insert_aux(__p, __c); } void insert(iterator __p, size_t __n, _CharT __c); private: void _M_insert(iterator __p, const _CharT* __first, const _CharT* __last, bool __self_ref); pointer _M_insert_aux(pointer, _CharT); void _M_copy(const _CharT* __f, const _CharT* __l, _CharT* __res) { _Traits::copy(__res, __f, __l - __f); } void _M_move(const _CharT* __f, const _CharT* __l, _CharT* __res) { _Traits::move(__res, __f, __l - __f); } template void _M_insert_overflow(iterator __pos, _ForwardIter __first, _ForwardIter __last, size_type __n) { size_type __len = _M_compute_next_size(__n); pointer __new_start = this->_M_start_of_storage.allocate(__len, __len); pointer __new_finish = uninitialized_copy(this->_M_Start(), __pos, __new_start); __new_finish = uninitialized_copy(__first, __last, __new_finish); __new_finish = uninitialized_copy(__pos, this->_M_Finish(), __new_finish); _M_construct_null(__new_finish); this->_M_deallocate_block(); this->_M_reset(__new_start, __new_finish, __new_start + __len); } template void _M_insertT(iterator __p, _InputIter __first, _InputIter __last, const input_iterator_tag &) { for ( ; __first != __last; ++__first) { __p = insert(__p, *__first); ++__p; } } template void _M_insertT(iterator __pos, _ForwardIter __first, _ForwardIter __last, const forward_iterator_tag &) { if (__first != __last) { size_type __n = ::std::distance(__first, __last); if (__n < this->_M_rest()) { const size_type __elems_after = this->_M_finish - __pos; if (__elems_after >= __n) { uninitialized_copy((this->_M_Finish() - __n) + 1, this->_M_Finish() + 1, this->_M_Finish() + 1); this->_M_finish += __n; _Traits::move(__pos + __n, __pos, (__elems_after - __n) + 1); _M_copyT(__first, __last, __pos); } else { pointer __old_finish = this->_M_Finish(); _ForwardIter __mid = __first; ::std::advance(__mid, __elems_after + 1); ::std::uninitialized_copy(__mid, __last, this->_M_Finish() + 1); this->_M_finish += __n - __elems_after; uninitialized_copy(__pos, __old_finish + 1, this->_M_Finish()); this->_M_finish += __elems_after; _M_copyT(__first, __mid, __pos); } } else { _M_insert_overflow(__pos, __first, __last, __n); } } } template void _M_insert_dispatch(iterator __p, _Integer __n, _Integer __x, const __true_type& ) { insert(__p, (size_type) __n, (_CharT) __x); } template void _M_insert_dispatch(iterator __p, _InputIter __first, _InputIter __last, const __false_type& ) { const _Self __self(__first, __last, get_allocator()); _M_insertT(__p, __self.begin(), __self.end(), forward_iterator_tag()); } template void _M_copyT(_InputIterator __first, _InputIterator __last, pointer __result) { for ( ; __first != __last; ++__first, ++__result) _Traits::assign(*__result, *__first); } void _M_copyT(const _CharT* __f, const _CharT* __l, _CharT* __res) { _Traits::copy(__res, __f, __l - __f); } public: template void insert(iterator __p, _InputIter __first, _InputIter __last) { if (__p > this->end()) { this->_M_throw_out_of_range(); } typedef typename _IsIntegral<_InputIter>::_Ret _Integral; _M_insert_dispatch(__p, __first, __last, _Integral()); } public: void insert(iterator __p, const _CharT* __f, const _CharT* __l) { _M_insert(__p, __f, __l, _M_inside(__f)); } public: _Self& erase(size_type __pos = 0, size_type __n = npos) { if (__pos > size()) this->_M_throw_out_of_range(); erase(begin() + __pos, begin() + __pos + (min) (__n, size() - __pos)); return *this; } iterator erase(iterator __pos) { _Traits::move(__pos, __pos + 1, this->_M_Finish() - __pos); --this->_M_finish; return __pos; } iterator erase(iterator __first, iterator __last) { if (__first != __last) { traits_type::move(__first, __last, (this->_M_Finish() - __last) + 1); this->_M_finish = this->_M_Finish() - (__last - __first); } return __first; } public: _Self& replace(size_type __pos, size_type __n, const _Self& __s) { const size_type __size = size(); if (__pos > __size) this->_M_throw_out_of_range(); const size_type __len = (min) (__n, __size - __pos); if (__s.size() > max_size() - (__size - __len)) this->_M_throw_length_error(); return _M_replace(begin() + __pos, begin() + __pos + __len, __s._M_Start(), __s._M_Finish(), &__s == this); } _Self& replace(size_type __pos1, size_type __n1, const _Self& __s, size_type __pos2, size_type __n2) { const size_type __size1 = size(); const size_type __size2 = __s.size(); if (__pos1 > __size1 || __pos2 > __size2) this->_M_throw_out_of_range(); const size_type __len1 = (min) (__n1, __size1 - __pos1); const size_type __len2 = (min) (__n2, __size2 - __pos2); if (__len2 > max_size() - (__size1 - __len1)) this->_M_throw_length_error(); return _M_replace(begin() + __pos1, begin() + __pos1 + __len1, __s._M_Start() + __pos2, __s._M_Start() + __pos2 + __len2, &__s == this); } _Self& replace(size_type __pos, size_type __n1, const _CharT* __s, size_type __n2) { const size_type __size = size(); if (__pos > __size) this->_M_throw_out_of_range(); const size_type __len = (min) (__n1, __size - __pos); if (__n2 > max_size() - (__size - __len)) this->_M_throw_length_error(); return _M_replace(begin() + __pos, begin() + __pos + __len, __s, __s + __n2, _M_inside(__s)); } _Self& replace(size_type __pos, size_type __n1, const _CharT* __s) { return replace(__pos, __n1, __s, _Traits::length(__s)); } _Self& replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c) { const size_type __size = size(); if (__pos > __size) this->_M_throw_out_of_range(); const size_type __len = (min) (__n1, __size - __pos); if (__n2 > max_size() - (__size - __len)) this->_M_throw_length_error(); return replace(begin() + __pos, begin() + __pos + __len, __n2, __c); } _Self& replace(iterator __first, iterator __last, const _Self& __s) { return _M_replace(__first, __last, __s._M_Start(), __s._M_Finish(), &__s == this); } _Self& replace(iterator __first, iterator __last, const _CharT* __s, size_type __n) { if (__s != 0 && __n == this->npos) this->_M_throw_length_error(); return _M_replace(__first, __last, __s, __s + __n, _M_inside(__s)); } _Self& replace(iterator __first, iterator __last, const _CharT* __s) { return _M_replace(__first, __last, __s, __s + _Traits::length(__s), _M_inside(__s)); } _Self& replace(iterator __first, iterator __last, size_type __n, _CharT __c); private: _Self& _M_replace(iterator __first, iterator __last, const _CharT* __f, const _CharT* __l, bool __self_ref); template _Self& _M_replace_dispatch(iterator __first, iterator __last, _Integer __n, _Integer __x, const __true_type& ) { return replace(__first, __last, (size_type) __n, (_CharT) __x); } template _Self& _M_replace_dispatch(iterator __first, iterator __last, _InputIter __f, _InputIter __l, const __false_type& ) { const _Self __self(__f, __l, get_allocator()); return _M_replace(__first, __last, __self._M_Start(), __self._M_Finish(), false); } public: template _Self& replace(iterator __first, iterator __last, _InputIter __f, _InputIter __l) { typedef typename _IsIntegral<_InputIter>::_Ret _Integral; return _M_replace_dispatch(__first, __last, __f, __l, _Integral()); } public: _Self& replace(iterator __first, iterator __last, const _CharT* __f, const _CharT* __l) { return _M_replace(__first, __last, __f, __l, _M_inside(__f)); } public: size_type copy(_CharT* __s, size_type __n, size_type __pos = 0) const { if (__pos > size()) this->_M_throw_out_of_range(); const size_type __len = (min) (__n, size() - __pos); _Traits::copy(__s, this->_M_Start() + __pos, __len); return __len; } void swap(_Self& __s) { this->_M_swap(__s); } public: const _CharT* c_str() const { return this->_M_Start(); } const _CharT* data() const { return this->_M_Start(); } public: size_type find(const _Self& __s, size_type __pos = 0) const { return find(__s._M_Start(), __pos, __s.size()); } size_type find(const _CharT* __s, size_type __pos = 0) const { return find(__s, __pos, _Traits::length(__s)); } size_type find(const _CharT* __s, size_type __pos, size_type __n) const; size_type find(_CharT __c) const { return find(__c, 0); } size_type find(_CharT __c, size_type __pos ) const; public: size_type rfind(const _Self& __s, size_type __pos = npos) const { return rfind(__s._M_Start(), __pos, __s.size()); } size_type rfind(const _CharT* __s, size_type __pos = npos) const { return rfind(__s, __pos, _Traits::length(__s)); } size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const; size_type rfind(_CharT __c, size_type __pos = npos) const; public: size_type find_first_of(const _Self& __s, size_type __pos = 0) const { return find_first_of(__s._M_Start(), __pos, __s.size()); } size_type find_first_of(const _CharT* __s, size_type __pos = 0) const { return find_first_of(__s, __pos, _Traits::length(__s)); } size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const; size_type find_first_of(_CharT __c, size_type __pos = 0) const { return find(__c, __pos); } public: size_type find_last_of(const _Self& __s, size_type __pos = npos) const { return find_last_of(__s._M_Start(), __pos, __s.size()); } size_type find_last_of(const _CharT* __s, size_type __pos = npos) const { return find_last_of(__s, __pos, _Traits::length(__s)); } size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const; size_type find_last_of(_CharT __c, size_type __pos = npos) const { return rfind(__c, __pos); } public: size_type find_first_not_of(const _Self& __s, size_type __pos = 0) const { return find_first_not_of(__s._M_Start(), __pos, __s.size()); } size_type find_first_not_of(const _CharT* __s, size_type __pos = 0) const { return find_first_not_of(__s, __pos, _Traits::length(__s)); } size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const; size_type find_first_not_of(_CharT __c, size_type __pos = 0) const; public: size_type find_last_not_of(const _Self& __s, size_type __pos = npos) const { return find_last_not_of(__s._M_Start(), __pos, __s.size()); } size_type find_last_not_of(const _CharT* __s, size_type __pos = npos) const { return find_last_not_of(__s, __pos, _Traits::length(__s)); } size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const; size_type find_last_not_of(_CharT __c, size_type __pos = npos) const; public: _Self substr(size_type __pos = 0, size_type __n = npos) const { return _Self(*this, __pos, __n, get_allocator()); } public: int compare(const _Self& __s) const { return _M_compare(this->_M_Start(), this->_M_Finish(), __s._M_Start(), __s._M_Finish()); } int compare(size_type __pos1, size_type __n1, const _Self& __s) const { if (__pos1 > size()) this->_M_throw_out_of_range(); return _M_compare(this->_M_Start() + __pos1, this->_M_Start() + __pos1 + (min) (__n1, size() - __pos1), __s._M_Start(), __s._M_Finish()); } int compare(size_type __pos1, size_type __n1, const _Self& __s, size_type __pos2, size_type __n2) const { if (__pos1 > size() || __pos2 > __s.size()) this->_M_throw_out_of_range(); return _M_compare(this->_M_Start() + __pos1, this->_M_Start() + __pos1 + (min) (__n1, size() - __pos1), __s._M_Start() + __pos2, __s._M_Start() + __pos2 + (min) (__n2, __s.size() - __pos2)); } int compare(const _CharT* __s) const { return _M_compare(this->_M_Start(), this->_M_Finish(), __s, __s + _Traits::length(__s)); } int compare(size_type __pos1, size_type __n1, const _CharT* __s) const { if (__pos1 > size()) this->_M_throw_out_of_range(); return _M_compare(this->_M_Start() + __pos1, this->_M_Start() + __pos1 + (min) (__n1, size() - __pos1), __s, __s + _Traits::length(__s)); } int compare(size_type __pos1, size_type __n1, const _CharT* __s, size_type __n2) const { if (__pos1 > size()) this->_M_throw_out_of_range(); return _M_compare(this->_M_Start() + __pos1, this->_M_Start() + __pos1 + (min) (__n1, size() - __pos1), __s, __s + __n2); } public: static int _M_compare(const _CharT* __f1, const _CharT* __l1, const _CharT* __f2, const _CharT* __l2) { const ptrdiff_t __n1 = __l1 - __f1; const ptrdiff_t __n2 = __l2 - __f2; const int cmp = _Traits::compare(__f1, __f2, (min) (__n1, __n2)); return cmp != 0 ? cmp : (__n1 < __n2 ? -1 : (__n1 > __n2 ? 1 : 0)); } public: template basic_string(::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir> const& __s) : ::std::priv:: _String_base<_CharT,_Alloc>(__s . get_allocator(), __s . size() + 1) { _M_append_sum(__s); } template basic_string(::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir> const& __s, size_type __pos, size_type __n = npos, const allocator_type& __a = allocator_type()) : ::std::priv:: _String_base<_CharT,_Alloc>(__a, (__pos <= __s . size()) ? ((min) (__n, __s . size() - __pos)) : 0 + 1) { size_type __size = __s.size(); if (__pos > __size) this->_M_throw_out_of_range(); else _M_append_sum_pos(__s, __pos, (min) (__n, __size - __pos)); } private: _CharT* _M_append_fast(::std::priv:: __char_wrapper<_CharT> __c, _CharT *__buf) { ::std::_Copy_Construct(__buf, __c.getValue()); return __buf + 1; } _CharT* _M_append_fast(_CharT const* __s, size_type __s_size, _CharT *__buf) { return uninitialized_copy(__s, __s + __s_size, __buf); } _CharT* _M_append_fast(::std::priv:: __cstr_wrapper<_CharT> const& __s, _CharT *__buf) { return _M_append_fast(__s.c_str(), __s.size(), __buf); } _CharT* _M_append_fast(::std::priv:: __bstr_wrapper<_CharT, _Traits, _Alloc> __s, _CharT *__buf) { return _M_append_fast(__s.b_str(), __buf); } _CharT* _M_append_fast(_Self const& __s, _CharT *__buf) { return _M_append_fast(__s.data(), __s.size(), __buf); } _CharT* _M_append_fast(::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc> const&, _CharT *__buf) { return __buf; } template _CharT* _M_append_fast(::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir> const& __s, _CharT *__buf) { return _M_append_fast(__s.getRhs(), _M_append_fast(__s.getLhs(), __buf)); } _CharT* _M_append_fast_pos(::std::priv:: __char_wrapper<_CharT> __c, _CharT *__buf, size_type , size_type __n) { if (__n == 0) return __buf; ::std::_Copy_Construct(__buf, __c.getValue()); return __buf + 1; } _CharT* _M_append_fast_pos(_CharT const* __s, size_type __s_size, _CharT *__buf, size_type __pos, size_type __n) { return uninitialized_copy(__s + __pos, __s + __pos + (min)(__n, __s_size - __pos), __buf); } _CharT* _M_append_fast_pos(::std::priv:: __cstr_wrapper<_CharT> const& __s, _CharT *__buf, size_type __pos, size_type __n) { return _M_append_fast_pos(__s.c_str(), __s.size(), __buf, __pos, __n); } _CharT* _M_append_fast_pos(::std::priv:: __bstr_wrapper<_CharT, _Traits, _Alloc> __s, _CharT *__buf, size_type __pos, size_type __n) { return _M_append_fast_pos(__s.b_str(), __buf, __pos, __n); } _CharT* _M_append_fast_pos(_Self const& __s, _CharT *__buf, size_type __pos, size_type __n) { return _M_append_fast_pos(__s.data(), __s.size(), __buf, __pos, __n); } _CharT* _M_append_fast_pos(::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc> const&, _CharT *__buf, size_type, size_type) { return __buf; } template _CharT* _M_append_fast_pos(::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir> const& __s, _CharT *__buf, size_type __pos, size_type __n) { if (__n == 0) { return __buf; } size_type __lhs_size = __s.getLhs().size(); if (__pos < __lhs_size) { if (__n < (__lhs_size - __pos)) { return _M_append_fast_pos(__s.getLhs(), __buf, __pos, __n); } else { return _M_append_fast_pos(__s.getRhs(), _M_append_fast_pos(__s.getLhs(), __buf, __pos, __n), 0, __n - (__lhs_size - __pos)); } } else { return _M_append_fast_pos(__s.getRhs(), __buf, __pos - __lhs_size, __n); } } template _Self& _M_append_sum (::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir> const& __s) { size_type __s_size = __s.size(); if (__s_size == 0) return *this; const size_type __old_size = this->size(); if (__s_size > this->max_size() || __old_size > (this->max_size() - __s_size)) this->_M_throw_length_error(); if (__old_size + __s_size > this->capacity()) { const size_type __len = __old_size + (max)(__old_size, __s_size) + 1; pointer __new_start = this->_M_start_of_storage.allocate(__len); pointer __new_finish = uninitialized_copy(this->_M_Start(), this->_M_Finish(), __new_start); __new_finish = this->_M_append_fast(__s, __new_finish); this->_M_construct_null(__new_finish); this->_M_deallocate_block(); this->_M_reset(__new_start, __new_finish, __new_start + __len); } else { _M_append_sum_no_overflow(__s, 0, __s_size); } return *this; } template _Self& _M_append_sum_pos(::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir> const& __s, size_type __pos, size_type __n) { size_type __s_size = (min)(__s.size() - __pos, __n); if (__s_size == 0) return *this; const size_type __old_size = this->size(); if (__s_size > this->max_size() || __old_size > (this->max_size() - __s_size)) this->_M_throw_length_error(); if (__old_size + __s_size > this->capacity()) { const size_type __len = __old_size + (max)(__old_size, __s_size) + 1; pointer __new_start = this->_M_start_of_storage.allocate(__len); pointer __new_finish = uninitialized_copy(this->_M_Start(), this->_M_Finish(), __new_start); __new_finish = _M_append_fast_pos(__s, __new_finish, __pos, __s_size); this->_M_construct_null(__new_finish); this->_M_deallocate_block(); this->_M_reset(__new_start, __new_finish, __new_start + __len); } else { _M_append_sum_no_overflow(__s, __pos, __s_size); } return *this; } template void _M_append_sum_no_overflow(::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir> const& __s, size_type __pos, size_type __n) { pointer __finish = this->_M_Finish(); _M_append_fast_pos(__s, __finish + 1, __pos + 1, __n - 1); this->_M_construct_null(__finish + __n); _Traits::assign(*this->_M_finish, __s[__pos]); this->_M_finish += __n; } }; } namespace std { template inline void swap(basic_string<_CharT,_Traits,_Alloc>& __x, basic_string<_CharT,_Traits,_Alloc>& __y) { __x.swap(__y); } template struct __move_traits > { typedef __true_type implemented; typedef typename __move_traits<_Alloc>::complete complete; }; namespace priv { template void _S_string_copy(const basic_string<_CharT,_Traits,_Alloc>& __s, _CharT* __buf, size_t __n); inline const char* __get_c_string(const string& __str) { return __str.c_str(); } } } namespace std { template inline ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>, ::std::priv:: __on_right>, ::std::priv:: __on_right> operator+(const basic_string<_CharT,_Traits,_Alloc>& __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) { typedef ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>, ::std::priv:: __on_right> __root_type; __root_type __root(__rhs, ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>(__lhs.get_allocator())); return ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, __root_type, ::std::priv:: __on_right>(__lhs, __root); } template inline ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>, ::std::priv:: __on_right> operator+(const basic_string<_CharT,_Traits,_Alloc>& __lhs, const ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __rhs) { return ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>, ::std::priv:: __on_right>(__lhs, __rhs); } template inline ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, ::std::priv:: __on_left> operator+(const ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) { return ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, ::std::priv:: __on_left>(__lhs, __rhs); } template inline ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __cstr_wrapper<_CharT>, ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>, ::std::priv:: __on_right>, ::std::priv:: __on_right> operator+(const basic_string<_CharT,_Traits,_Alloc>& __x, const _CharT* __s) { const size_t __n = _Traits::length(__s); typedef ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __cstr_wrapper<_CharT>, ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>, ::std::priv:: __on_right> __root_type; __root_type __root(::std::priv:: __cstr_wrapper<_CharT>(__s, __n), ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>(__x.get_allocator())); return ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, __root_type, ::std::priv:: __on_right>(__x, __root); } template inline ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __cstr_wrapper<_CharT>, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>, ::std::priv:: __on_right>, ::std::priv:: __on_right> operator+(const _CharT* __s, const basic_string<_CharT,_Traits,_Alloc>& __y) { const size_t __n = _Traits::length(__s); typedef ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>, ::std::priv:: __on_right> __root_type; __root_type __root(__y, ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>(__y.get_allocator())); return ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __cstr_wrapper<_CharT>, __root_type, ::std::priv:: __on_right>(::std::priv:: __cstr_wrapper<_CharT>(__s, __n), __root); } template inline ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>, ::std::priv:: __cstr_wrapper<_CharT>, ::std::priv:: __on_left> operator+(const ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __x, const _CharT* __s) { const size_t __n = _Traits::length(__s); return ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>, ::std::priv:: __cstr_wrapper<_CharT>, ::std::priv:: __on_left>(__x, ::std::priv:: __cstr_wrapper<_CharT>(__s, __n)); } template inline ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __cstr_wrapper<_CharT>, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>, ::std::priv:: __on_right> operator+(const _CharT* __s, const ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __y) { const size_t __n = _Traits::length(__s); return ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __cstr_wrapper<_CharT>, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>, ::std::priv:: __on_right>(::std::priv:: __cstr_wrapper<_CharT>(__s, __n), __y); } template inline ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __char_wrapper<_CharT>, ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>, ::std::priv:: __on_right>, ::std::priv:: __on_right> operator+(const basic_string<_CharT,_Traits,_Alloc>& __x, const _CharT __c) { typedef ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __char_wrapper<_CharT>, ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>, ::std::priv:: __on_right> __root_type; __root_type __root(__c, ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>(__x.get_allocator())); return ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, __root_type, ::std::priv:: __on_right>(__x, __root); } template inline ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __char_wrapper<_CharT>, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>, ::std::priv:: __on_right>, ::std::priv:: __on_right> operator+(const _CharT __c, const basic_string<_CharT,_Traits,_Alloc>& __x) { typedef ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_wrapper<_CharT,_Traits,_Alloc>, ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>, ::std::priv:: __on_right> __root_type; __root_type __root(__x, ::std::priv:: __sum_storage_elem<_CharT, _Traits, _Alloc>(__x.get_allocator())); return ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __char_wrapper<_CharT>, __root_type, ::std::priv:: __on_right>(__c, __root); } template inline ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>, ::std::priv:: __char_wrapper<_CharT>, ::std::priv:: __on_left> operator+(const ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __x, const _CharT __c) { return ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>, ::std::priv:: __char_wrapper<_CharT>, ::std::priv:: __on_left>(__x, __c); } template inline ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __char_wrapper<_CharT>, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>, ::std::priv:: __on_right> operator+(const _CharT __c, const ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __x) { return ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, ::std::priv:: __char_wrapper<_CharT>, ::std::priv:: __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>, ::std::priv:: __on_right>(__c, __x); } template inline bool operator==(const basic_string<_CharT,_Traits,_Alloc>& __x, const basic_string<_CharT,_Traits,_Alloc>& __y) { return __x.size() == __y.size() && _Traits::compare(__x.data(), __y.data(), __x.size()) == 0; } template inline bool operator==(const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x, const basic_string<_CharT,_Traits,_Alloc>& __y) { return __x.size() == __y.size() && _Traits::compare(__x.data(), __y.data(), __x.size()) == 0; } template inline bool operator==(const basic_string<_CharT,_Traits,_Alloc>& __x, const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) { return __x.size() == __y.size() && _Traits::compare(__x.data(), __y.data(), __x.size()) == 0; } template inline bool operator==(const _CharT* __s, const basic_string<_CharT,_Traits,_Alloc>& __y) { size_t __n = _Traits::length(__s); return __n == __y.size() && _Traits::compare(__s, __y.data(), __n) == 0; } template inline bool operator==(const basic_string<_CharT,_Traits,_Alloc>& __x, const _CharT* __s) { size_t __n = _Traits::length(__s); return __x.size() == __n && _Traits::compare(__x.data(), __s, __n) == 0; } template inline bool operator==(const _CharT* __s, const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) { size_t __n = _Traits::length(__s); return __n == __y.size() && _Traits::compare(__s, __y.data(), __n) == 0; } template inline bool operator==(const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x, const _CharT* __s) { size_t __n = _Traits::length(__s); return __x.size() == __n && _Traits::compare(__x.data(), __s, __n) == 0; } template inline bool operator<(const basic_string<_CharT,_Traits,_Alloc>& __x, const basic_string<_CharT,_Traits,_Alloc>& __y) { return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(), __y.begin(), __y.end()) < 0; } template inline bool operator<(const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x, const basic_string<_CharT,_Traits,_Alloc>& __y) { return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(), __y.begin(), __y.end()) < 0; } template inline bool operator<(const basic_string<_CharT,_Traits,_Alloc>& __x, const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) { return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(), __y.begin(), __y.end()) < 0; } template inline bool operator<(const _CharT* __s, const basic_string<_CharT,_Traits,_Alloc>& __y) { size_t __n = _Traits::length(__s); return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__s, __s + __n, __y.begin(), __y.end()) < 0; } template inline bool operator<(const basic_string<_CharT,_Traits,_Alloc>& __x, const _CharT* __s) { size_t __n = _Traits::length(__s); return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(), __s, __s + __n) < 0; } template inline bool operator<(const _CharT* __s, const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) { size_t __n = _Traits::length(__s); return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__s, __s + __n, __y.begin(), __y.end()) < 0; } template inline bool operator<(const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x, const _CharT* __s) { size_t __n = _Traits::length(__s); return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(), __s, __s + __n) < 0; } template inline bool operator!=(const basic_string<_CharT,_Traits,_Alloc>& __x, const basic_string<_CharT,_Traits,_Alloc>& __y) { return !(__x == __y); } template inline bool operator>(const basic_string<_CharT,_Traits,_Alloc>& __x, const basic_string<_CharT,_Traits,_Alloc>& __y) { return __y < __x; } template inline bool operator<=(const basic_string<_CharT,_Traits,_Alloc>& __x, const basic_string<_CharT,_Traits,_Alloc>& __y) { return !(__y < __x); } template inline bool operator>=(const basic_string<_CharT,_Traits,_Alloc>& __x, const basic_string<_CharT,_Traits,_Alloc>& __y) { return !(__x < __y); } template inline bool operator!=(const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x, const basic_string<_CharT,_Traits,_Alloc>& __y) { return !(__x==__y); } template inline bool operator!=(const basic_string<_CharT,_Traits,_Alloc>& __x, const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) { return !(__x==__y); } template inline bool operator!=(const _CharT* __s, const basic_string<_CharT,_Traits,_Alloc>& __y) { return !(__s == __y); } template inline bool operator!=(const basic_string<_CharT,_Traits,_Alloc>& __x, const _CharT* __s) { return !(__x == __s); } template inline bool operator!=(const _CharT* __s, const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) { return !(__s == __y); } template inline bool operator!=(const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x, const _CharT* __s) { return !(__x == __s); } template inline bool operator>(const _CharT* __s, const basic_string<_CharT,_Traits,_Alloc>& __y) { return __y < __s; } template inline bool operator>(const basic_string<_CharT,_Traits,_Alloc>& __x, const _CharT* __s) { return __s < __x; } template inline bool operator>(const _CharT* __s, const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) { return __y < __s; } template inline bool operator>(const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x, const _CharT* __s) { return __s < __x; } template inline bool operator<=(const _CharT* __s, const basic_string<_CharT,_Traits,_Alloc>& __y) { return !(__y < __s); } template inline bool operator<=(const basic_string<_CharT,_Traits,_Alloc>& __x, const _CharT* __s) { return !(__s < __x); } template inline bool operator<=(const _CharT* __s, const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) { return !(__y < __s); } template inline bool operator<=(const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x, const _CharT* __s) { return !(__s < __x); } template inline bool operator>=(const _CharT* __s, const basic_string<_CharT,_Traits,_Alloc>& __y) { return !(__s < __y); } template inline bool operator>=(const basic_string<_CharT,_Traits,_Alloc>& __x, const _CharT* __s) { return !(__x < __s); } template inline bool operator>=(const _CharT* __s, const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) { return !(__s < __y); } template inline bool operator>=(const ::std::priv:: __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x, const _CharT* __s) { return !(__x < __s); } } namespace std { namespace priv { template struct _Eq_traits : public binary_function { bool operator()(const typename _Traits::char_type& __x, const typename _Traits::char_type& __y) const { return _Traits::eq(__x, __y); } }; template struct _Eq_char_bound : public unary_function { typename _Traits::char_type __val; _Eq_char_bound(typename _Traits::char_type __c) : __val(__c) {} bool operator()(const typename _Traits::char_type& __x) const { return _Traits::eq(__x, __val); } }; template struct _Neq_char_bound : public unary_function { typename _Traits::char_type __val; _Neq_char_bound(typename _Traits::char_type __c) : __val(__c) {} bool operator()(const typename _Traits::char_type& __x) const { return !_Traits::eq(__x, __val); } }; template struct _Eq_int_bound : public unary_function { typename _Traits::int_type __val; _Eq_int_bound(typename _Traits::int_type __c) : __val(__c) {} bool operator()(const typename _Traits::char_type& __x) const { return _Traits::eq_int_type(_Traits::to_int_type(__x), __val); } }; } } namespace std { template struct not_equal_to : public binary_function<_Tp, _Tp, bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x != __y; } }; template struct greater : public binary_function<_Tp, _Tp, bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x > __y; } }; template struct greater_equal : public binary_function<_Tp, _Tp, bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x >= __y; } }; template struct less_equal : public binary_function<_Tp, _Tp, bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x <= __y; } }; template struct divides : public binary_function<_Tp, _Tp, _Tp> { _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x / __y; } }; template struct modulus : public binary_function<_Tp, _Tp, _Tp> { _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x % __y; } }; template struct negate : public unary_function<_Tp, _Tp> { _Tp operator()(const _Tp& __x) const { return -__x; } }; template struct logical_and : public binary_function<_Tp, _Tp, bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x && __y; } }; template struct logical_or : public binary_function<_Tp, _Tp,bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return __x || __y; } }; template struct logical_not : public unary_function<_Tp, bool> { bool operator()(const _Tp& __x) const { return !__x; } }; template inline _Tp identity_element(plus<_Tp>) { return _Tp(0); } template inline _Tp identity_element(multiplies<_Tp>) { return _Tp(1); } template class unary_negate : public unary_function { typedef unary_function _Base; public: typedef typename _Base::argument_type argument_type; private: typedef typename __call_traits::const_param_type _ArgParamType; protected: _Predicate _M_pred; public: explicit unary_negate(const _Predicate& __x) : _M_pred(__x) {} bool operator()(_ArgParamType __x) const { return !_M_pred(__x); } }; template inline unary_negate<_Predicate> not1(const _Predicate& __pred) { return unary_negate<_Predicate>(__pred); } template class binary_negate : public binary_function { typedef binary_function _Base; public: typedef typename _Base::first_argument_type first_argument_type; typedef typename _Base::second_argument_type second_argument_type; private: typedef typename __call_traits::const_param_type _FstArgParamType; typedef typename __call_traits::const_param_type _SndArgParamType; protected: _Predicate _M_pred; public: explicit binary_negate(const _Predicate& __x) : _M_pred(__x) {} bool operator()(_FstArgParamType __x, _SndArgParamType __y) const { return !_M_pred(__x, __y); } }; template inline binary_negate<_Predicate> not2(const _Predicate& __pred) { return binary_negate<_Predicate>(__pred); } template class binder1st : public unary_function { typedef unary_function _Base; public: typedef typename _Base::argument_type argument_type; typedef typename _Base::result_type result_type; private: typedef typename __call_traits::param_type _ArgParamType; typedef typename __call_traits::const_param_type _ConstArgParamType; typedef typename __call_traits::const_param_type _ValueParamType; protected: _Operation op; typename _Operation::first_argument_type value; public: binder1st(const _Operation& __x, _ValueParamType __y) : op(__x), value(__y) {} result_type operator()(_ConstArgParamType __x) const { return op(value, __x); } result_type operator()(_ArgParamType __x) const { return op(value, __x); } }; template inline binder1st<_Operation> bind1st(const _Operation& __fn, const _Tp& __x) { typedef typename _Operation::first_argument_type _Arg1_type; return binder1st<_Operation>(__fn, _Arg1_type(__x)); } template class binder2nd : public unary_function { typedef unary_function _Base; public: typedef typename _Base::argument_type argument_type; typedef typename _Base::result_type result_type; private: typedef typename __call_traits::param_type _ArgParamType; typedef typename __call_traits::const_param_type _ConstArgParamType; typedef typename __call_traits::const_param_type _ValueParamType; protected: _Operation op; typename _Operation::second_argument_type value; public: binder2nd(const _Operation& __x, _ValueParamType __y) : op(__x), value(__y) {} result_type operator()(_ConstArgParamType __x) const { return op(__x, value); } result_type operator()(_ArgParamType __x) const { return op(__x, value); } }; template inline binder2nd<_Operation> bind2nd(const _Operation& __fn, const _Tp& __x) { typedef typename _Operation::second_argument_type _Arg2_type; return binder2nd<_Operation>(__fn, _Arg2_type(__x)); } template class unary_compose : public unary_function { typedef unary_function _Base; public: typedef typename _Base::argument_type argument_type; typedef typename _Base::result_type result_type; private: typedef typename __call_traits::const_param_type _ArgParamType; protected: _Operation1 _M_fn1; _Operation2 _M_fn2; public: unary_compose(const _Operation1& __x, const _Operation2& __y) : _M_fn1(__x), _M_fn2(__y) {} result_type operator()(_ArgParamType __x) const { return _M_fn1(_M_fn2(__x)); } }; template inline unary_compose<_Operation1,_Operation2> compose1(const _Operation1& __fn1, const _Operation2& __fn2) { return unary_compose<_Operation1,_Operation2>(__fn1, __fn2); } template class binary_compose : public unary_function { typedef unary_function _Base; public: typedef typename _Base::argument_type argument_type; typedef typename _Base::result_type result_type; private: typedef typename __call_traits::const_param_type _ArgParamType; protected: _Operation1 _M_fn1; _Operation2 _M_fn2; _Operation3 _M_fn3; public: binary_compose(const _Operation1& __x, const _Operation2& __y, const _Operation3& __z) : _M_fn1(__x), _M_fn2(__y), _M_fn3(__z) { } result_type operator()(_ArgParamType __x) const { return _M_fn1(_M_fn2(__x), _M_fn3(__x)); } }; template inline binary_compose<_Operation1, _Operation2, _Operation3> compose2(const _Operation1& __fn1, const _Operation2& __fn2, const _Operation3& __fn3) { return binary_compose<_Operation1,_Operation2,_Operation3>(__fn1, __fn2, __fn3); } template struct identity : public ::std::priv:: _Identity<_Tp> {}; template struct select1st : public ::std::priv:: _Select1st<_Pair> {}; template struct select2nd : public ::std::priv:: _Select2nd<_Pair> {}; template struct project1st : public ::std::priv:: _Project1st<_Arg1, _Arg2> {}; template struct project2nd : public ::std::priv:: _Project2nd<_Arg1, _Arg2> {}; namespace priv { template struct _Constant_void_fun { typedef _Result result_type; result_type _M_val; _Constant_void_fun(const result_type& __v) : _M_val(__v) {} const result_type& operator()() const { return _M_val; } }; } template struct constant_void_fun : public ::std::priv:: _Constant_void_fun<_Result> { constant_void_fun(const _Result& __v) : ::std::priv:: _Constant_void_fun<_Result>(__v) {} }; template struct constant_unary_fun : public ::std::priv:: _Constant_unary_fun<_Result, _Argument> { constant_unary_fun(const _Result& __v) : ::std::priv:: _Constant_unary_fun<_Result, _Argument>(__v) {} }; template struct constant_binary_fun : public ::std::priv:: _Constant_binary_fun<_Result, _Arg1, _Arg2> { constant_binary_fun(const _Result& __v) : ::std::priv:: _Constant_binary_fun<_Result, _Arg1, _Arg2>(__v) {} }; template inline constant_void_fun<_Result> constant0(const _Result& __val) { return constant_void_fun<_Result>(__val); } template inline constant_unary_fun<_Result,_Result> constant1(const _Result& __val) { return constant_unary_fun<_Result,_Result>(__val); } template inline constant_binary_fun<_Result,_Result,_Result> constant2(const _Result& __val) { return constant_binary_fun<_Result,_Result,_Result>(__val); } class subtractive_rng : public unary_function { private: unsigned long _M_table[55]; unsigned long _M_index1; unsigned long _M_index2; public: unsigned long operator()(unsigned long __limit) { _M_index1 = (_M_index1 + 1) % 55; _M_index2 = (_M_index2 + 1) % 55; _M_table[_M_index1] = _M_table[_M_index1] - _M_table[_M_index2]; return _M_table[_M_index1] % __limit; } void _M_initialize(unsigned long __seed) { unsigned long __k = 1; _M_table[54] = __seed; unsigned long __i; for (__i = 0; __i < 54; __i++) { unsigned long __ii = (21 * (__i + 1) % 55) - 1; _M_table[__ii] = __k; __k = __seed - __k; __seed = _M_table[__ii]; } for (int __loop = 0; __loop < 4; __loop++) { for (__i = 0; __i < 55; __i++) _M_table[__i] = _M_table[__i] - _M_table[(1 + __i + 30) % 55]; } _M_index1 = 0; _M_index2 = 31; } subtractive_rng(unsigned int __seed) { _M_initialize(__seed); } subtractive_rng() { _M_initialize(161803398ul); } }; } namespace std { template class mem_fun_t : public unary_function<_Tp*,_Ret> { typedef _Ret (_Tp::*__fun_type)(void); public: explicit mem_fun_t(__fun_type __pf) : _M_f(__pf) {} _Ret operator()(_Tp* __p) const { return (__p->*_M_f)(); } private: __fun_type _M_f; }; template class const_mem_fun_t : public unary_function { typedef _Ret (_Tp::*__fun_type)(void) const; public: explicit const_mem_fun_t(__fun_type __pf) : _M_f(__pf) {} _Ret operator()(const _Tp* __p) const { return (__p->*_M_f)(); } private: __fun_type _M_f; }; template class mem_fun_ref_t : public unary_function<_Tp,_Ret> { typedef _Ret (_Tp::*__fun_type)(void); public: explicit mem_fun_ref_t(__fun_type __pf) : _M_f(__pf) {} _Ret operator()(_Tp& __r) const { return (__r.*_M_f)(); } private: __fun_type _M_f; }; template class const_mem_fun_ref_t : public unary_function<_Tp,_Ret> { typedef _Ret (_Tp::*__fun_type)(void) const; public: explicit const_mem_fun_ref_t(__fun_type __pf) : _M_f(__pf) {} _Ret operator()(const _Tp& __r) const { return (__r.*_M_f)(); } private: __fun_type _M_f; }; template class mem_fun1_t : public binary_function<_Tp*,_Arg,_Ret> { typedef _Ret (_Tp::*__fun_type)(_Arg); public: explicit mem_fun1_t(__fun_type __pf) : _M_f(__pf) {} _Ret operator()(_Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); } private: __fun_type _M_f; }; template class const_mem_fun1_t : public binary_function { typedef _Ret (_Tp::*__fun_type)(_Arg) const; public: explicit const_mem_fun1_t(__fun_type __pf) : _M_f(__pf) {} _Ret operator()(const _Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); } private: __fun_type _M_f; }; template class mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> { typedef _Ret (_Tp::*__fun_type)(_Arg); public: explicit mem_fun1_ref_t(__fun_type __pf) : _M_f(__pf) {} _Ret operator()(_Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); } private: __fun_type _M_f; }; template class const_mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> { typedef _Ret (_Tp::*__fun_type)(_Arg) const; public: explicit const_mem_fun1_ref_t(__fun_type __pf) : _M_f(__pf) {} _Ret operator()(const _Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); } private: __fun_type _M_f; }; template class pointer_to_unary_function : public unary_function<_Arg, _Result> { protected: _Result (*_M_ptr)(_Arg); public: pointer_to_unary_function() {} explicit pointer_to_unary_function(_Result (*__x)(_Arg)) : _M_ptr(__x) {} _Result operator()(_Arg __x) const { return _M_ptr(__x); } }; template class pointer_to_binary_function : public binary_function<_Arg1,_Arg2,_Result> { protected: _Result (*_M_ptr)(_Arg1, _Arg2); public: pointer_to_binary_function() {} explicit pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2)) : _M_ptr(__x) {} _Result operator()(_Arg1 __x, _Arg2 __y) const { return _M_ptr(__x, __y); } }; template inline mem_fun_t<_Result,_Tp> mem_fun(_Result (_Tp::*__f)()) { return mem_fun_t<_Result,_Tp>(__f); } template inline const_mem_fun_t<_Result,_Tp> mem_fun(_Result (_Tp::*__f)() const) { return const_mem_fun_t<_Result,_Tp>(__f); } template inline mem_fun_ref_t<_Result,_Tp> mem_fun_ref(_Result (_Tp::*__f)()) { return mem_fun_ref_t<_Result,_Tp>(__f); } template inline const_mem_fun_ref_t<_Result,_Tp> mem_fun_ref(_Result (_Tp::*__f)() const) { return const_mem_fun_ref_t<_Result,_Tp>(__f); } template inline mem_fun1_t<_Result,_Tp,_Arg> mem_fun(_Result (_Tp::*__f)(_Arg)) { return mem_fun1_t<_Result,_Tp,_Arg>(__f); } template inline const_mem_fun1_t<_Result,_Tp,_Arg> mem_fun(_Result (_Tp::*__f)(_Arg) const) { return const_mem_fun1_t<_Result,_Tp,_Arg>(__f); } template inline mem_fun1_ref_t<_Result,_Tp,_Arg> mem_fun_ref(_Result (_Tp::*__f)(_Arg)) { return mem_fun1_ref_t<_Result,_Tp,_Arg>(__f); } template inline const_mem_fun1_ref_t<_Result,_Tp,_Arg> mem_fun_ref(_Result (_Tp::*__f)(_Arg) const) { return const_mem_fun1_ref_t<_Result,_Tp,_Arg>(__f); } template inline mem_fun1_t<_Result,_Tp,_Arg> mem_fun1(_Result (_Tp::*__f)(_Arg)) { return mem_fun1_t<_Result,_Tp,_Arg>(__f); } template inline const_mem_fun1_t<_Result,_Tp,_Arg> mem_fun1(_Result (_Tp::*__f)(_Arg) const) { return const_mem_fun1_t<_Result,_Tp,_Arg>(__f); } template inline mem_fun1_ref_t<_Result,_Tp,_Arg> mem_fun1_ref(_Result (_Tp::*__f)(_Arg)) { return mem_fun1_ref_t<_Result,_Tp,_Arg>(__f); } template inline const_mem_fun1_ref_t<_Result,_Tp,_Arg> mem_fun1_ref(_Result (_Tp::*__f)(_Arg) const) { return const_mem_fun1_ref_t<_Result,_Tp,_Arg>(__f); } template inline pointer_to_unary_function<_Arg, _Result> ptr_fun(_Result (*__f)(_Arg)) { return pointer_to_unary_function<_Arg, _Result>(__f); } template inline pointer_to_binary_function<_Arg1,_Arg2,_Result> ptr_fun(_Result (*__f)(_Arg1, _Arg2)) { return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__f); } } namespace std { namespace priv { template struct _Not_within_traits : public unary_function { typedef typename _Traits::char_type _CharT; const _CharT* _M_first; const _CharT* _M_last; _Not_within_traits(const _CharT* __f, const _CharT* __l) : _M_first(__f), _M_last(__l) {} bool operator()(const _CharT& __x) const { return find_if(_M_first, _M_last, ::std::priv:: _Eq_char_bound<_Traits>(__x)) == _M_last; } }; template inline _InputIter __str_find_first_of_aux(_InputIter __first1, _InputIter __last1, const _CharT* __first2, const _CharT* __last2, _Traits*, const __true_type& ) { return __find_first_of(__first1, __last1, __first2, __last2); } template inline _InputIter __str_find_first_of_aux(_InputIter __first1, _InputIter __last1, const _CharT* __first2, const _CharT* __last2, _Traits*, const __false_type& ) { return __find_first_of(__first1, __last1, __first2, __last2, ::std::priv:: _Eq_traits<_Traits>()); } template inline _InputIter __str_find_first_of(_InputIter __first1, _InputIter __last1, const _CharT* __first2, const _CharT* __last2, _Traits* __traits) { typedef typename _IsSTLportClass<_Traits>::_Ret _STLportTraits; return __str_find_first_of_aux(__first1, __last1, __first2, __last2, __traits, _STLportTraits()); } template inline _InputIter __str_find_first_not_of_aux3(_InputIter __first1, _InputIter __last1, const _CharT* __first2, const _CharT* __last2, _Traits* , const __true_type& __useStrcspnLikeAlgo) { return __find_first_of_aux2(__first1, __last1, __first2, __last2, __first2, not1(_Identity()), __useStrcspnLikeAlgo); } template inline _InputIter __str_find_first_not_of_aux3(_InputIter __first1, _InputIter __last1, const _CharT* __first2, const _CharT* __last2, _Traits* , const __false_type& ) { return ::std::find_if(__first1, __last1, ::std::priv:: _Not_within_traits<_Traits>(__first2, __last2)); } template inline _InputIter __str_find_first_not_of_aux2(_InputIter __first1, _InputIter __last1, const _CharT* __first2, const _CharT* __last2, _Tp* __pt, _Traits* __traits) { typedef typename _IsIntegral<_Tp>::_Ret _IsIntegral; typedef typename _IsCharLikeType<_CharT>::_Ret _IsCharLike; typedef typename _Land2<_IsIntegral, _IsCharLike>::_Ret _UseStrcspnLikeAlgo; return __str_find_first_not_of_aux3(__first1, __last1, __first2, __last2, __traits, _UseStrcspnLikeAlgo()); } template inline _InputIter __str_find_first_not_of_aux1(_InputIter __first1, _InputIter __last1, const _CharT* __first2, const _CharT* __last2, _Traits* __traits, const __true_type& ) { return __str_find_first_not_of_aux2(__first1, __last1, __first2, __last2, (typename ::std::iterator_traits< _InputIter > ::value_type*)0, __traits); } template inline _InputIter __str_find_first_not_of_aux1(_InputIter __first1, _InputIter __last1, const _CharT* __first2, const _CharT* __last2, _Traits*, const __false_type& ) { return ::std::find_if(__first1, __last1, ::std::priv:: _Not_within_traits<_Traits>(__first2, __last2)); } template inline _InputIter __str_find_first_not_of(_InputIter __first1, _InputIter __last1, const _CharT* __first2, const _CharT* __last2, _Traits* __traits) { typedef typename _IsSTLportClass<_Traits>::_Ret _STLportTraits; return __str_find_first_not_of_aux1(__first1, __last1, __first2, __last2, __traits, _STLportTraits()); } } template void basic_string<_CharT,_Traits,_Alloc>::reserve(size_type __res_arg) { if (__res_arg > max_size()) this->_M_throw_length_error(); size_type __n = (max)(__res_arg, size()) + 1; if (__n < this->_M_capacity()) return; _M_reserve(__n); } template void basic_string<_CharT,_Traits,_Alloc>::_M_reserve(size_type __n) { pointer __new_start = this->_M_start_of_storage.allocate(__n, __n); pointer __new_finish = ::std::priv:: __ucopy(this->_M_Start(), this->_M_Finish(), __new_start); _M_construct_null(__new_finish); this->_M_deallocate_block(); this->_M_reset(__new_start, __new_finish, __new_start + __n); } template basic_string<_CharT,_Traits,_Alloc>& basic_string<_CharT,_Traits,_Alloc>::append(size_type __n, _CharT __c) { if (__n > 0) { if (__n > max_size() - size()) this->_M_throw_length_error(); if (__n >= this->_M_rest()) _M_reserve(_M_compute_next_size(__n)); ::std::priv:: __uninitialized_fill_n(this->_M_finish + 1, __n - 1, __c); _M_construct_null(this->_M_finish + __n); _Traits::assign(*end(), __c); this->_M_finish += __n; } return *this; } template basic_string<_CharT, _Traits, _Alloc>& basic_string<_CharT, _Traits, _Alloc>::_M_append(const _CharT* __first, const _CharT* __last) { if (__first != __last) { size_type __n = static_cast(__last - __first); if (__n >= this->_M_rest()) { size_type __len = _M_compute_next_size(__n); pointer __new_start = this->_M_start_of_storage.allocate(__len, __len); pointer __new_finish = ::std::priv:: __ucopy(this->_M_Start(), this->_M_Finish(), __new_start); __new_finish = ::std::priv:: __ucopy(__first, __last, __new_finish); _M_construct_null(__new_finish); this->_M_deallocate_block(); this->_M_reset(__new_start, __new_finish, __new_start + __len); } else { const _CharT* __f1 = __first; ++__f1; ::std::priv:: __ucopy(__f1, __last, this->_M_finish + 1); _M_construct_null(this->_M_finish + __n); _Traits::assign(*end(), *__first); this->_M_finish += __n; } } return *this; } template basic_string<_CharT,_Traits,_Alloc>& basic_string<_CharT,_Traits,_Alloc>::assign(size_type __n, _CharT __c) { if (__n <= size()) { _Traits::assign(this->_M_Start(), __n, __c); erase(begin() + __n, end()); } else { if (__n < capacity()) { _Traits::assign(this->_M_Start(), size(), __c); append(__n - size(), __c); } else { _Self __str(__n, __c); this->swap(__str); } } return *this; } template basic_string<_CharT,_Traits,_Alloc>& basic_string<_CharT,_Traits,_Alloc>::_M_assign(const _CharT* __f, const _CharT* __l) { ptrdiff_t __n = __l - __f; if (static_cast(__n) <= size()) { _Traits::copy(this->_M_Start(), __f, __n); erase(begin() + __n, end()); } else { _Traits::copy(this->_M_Start(), __f, size()); _M_append(__f + size(), __l); } return *this; } template _CharT* basic_string<_CharT,_Traits,_Alloc> ::_M_insert_aux(_CharT* __p, _CharT __c) { pointer __new_pos = __p; if (this->_M_rest() > 1 ) { _M_construct_null(this->_M_finish + 1); _Traits::move(__p + 1, __p, this->_M_finish - __p); _Traits::assign(*__p, __c); ++this->_M_finish; } else { size_type __len = _M_compute_next_size(1); pointer __new_start = this->_M_start_of_storage.allocate(__len, __len); __new_pos = ::std::priv:: __ucopy(this->_M_Start(), __p, __new_start); _Traits::assign(*__new_pos, __c); pointer __new_finish = __new_pos + 1; __new_finish = ::std::priv:: __ucopy(__p, this->_M_finish, __new_finish); _M_construct_null(__new_finish); this->_M_deallocate_block(); this->_M_reset(__new_start, __new_finish, __new_start + __len); } return __new_pos; } template void basic_string<_CharT,_Traits,_Alloc>::insert(iterator __pos, size_t __n, _CharT __c) { if (__n != 0) { if (this->_M_rest() > __n) { const size_type __elems_after = this->_M_finish - __pos; pointer __old_finish = this->_M_finish; if (__elems_after >= __n) { ::std::priv:: __ucopy((this->_M_finish - __n) + 1, this->_M_finish + 1, this->_M_finish + 1); this->_M_finish += __n; _Traits::move(__pos + __n, __pos, (__elems_after - __n) + 1); _Traits::assign(__pos, __n, __c); } else { ::std::priv:: __uninitialized_fill_n(this->_M_finish + 1, __n - __elems_after - 1, __c); this->_M_finish += __n - __elems_after; ::std::priv:: __ucopy(__pos, __old_finish + 1, this->_M_finish); this->_M_finish += __elems_after; _Traits::assign(__pos, __elems_after + 1, __c); } } else { size_type __len = _M_compute_next_size(__n); pointer __new_start = this->_M_start_of_storage.allocate(__len, __len); pointer __new_finish = ::std::priv:: __ucopy(this->_M_Start(), __pos, __new_start); __new_finish = ::std::priv:: __uninitialized_fill_n(__new_finish, __n, __c); __new_finish = ::std::priv:: __ucopy(__pos, this->_M_finish, __new_finish); _M_construct_null(__new_finish); this->_M_deallocate_block(); this->_M_reset(__new_start, __new_finish, __new_start + __len); } } } template void basic_string<_CharT,_Traits,_Alloc>::_M_insert(iterator __pos, const _CharT* __first, const _CharT* __last, bool __self_ref) { if (__first != __last) { const size_t __n = __last - __first; if (this->_M_rest() > __n) { const size_t __elems_after = this->_M_finish - __pos; pointer __old_finish = this->_M_finish; if (__elems_after >= __n) { ::std::priv:: __ucopy((this->_M_finish - __n) + 1, this->_M_finish + 1, this->_M_finish + 1); this->_M_finish += __n; _Traits::move(__pos + __n, __pos, (__elems_after - __n) + 1); if (!__self_ref || __last < __pos) { _M_copy(__first, __last, __pos); } else { if (__first >= __pos) { __first += __n; __last += __n; _M_copy(__first, __last, __pos); } else { _M_move(__first, __last, __pos); } } } else { const_iterator __mid = __first; __mid += __elems_after + 1; ::std::priv:: __ucopy(__mid, __last, this->_M_finish + 1); this->_M_finish += __n - __elems_after; ::std::priv:: __ucopy(__pos, __old_finish + 1, this->_M_finish); this->_M_finish += __elems_after; if (!__self_ref) _M_copy(__first, __mid, __pos); else _M_move(__first, __mid, __pos); } } else { size_type __len = _M_compute_next_size(__n); pointer __new_start = this->_M_start_of_storage.allocate(__len, __len); pointer __new_finish = ::std::priv:: __ucopy(this->_M_Start(), __pos, __new_start); __new_finish = ::std::priv:: __ucopy(__first, __last, __new_finish); __new_finish = ::std::priv:: __ucopy(__pos, this->_M_finish, __new_finish); _M_construct_null(__new_finish); this->_M_deallocate_block(); this->_M_reset(__new_start, __new_finish, __new_start + __len); } } } template basic_string<_CharT,_Traits,_Alloc>& basic_string<_CharT,_Traits,_Alloc> ::replace(iterator __first, iterator __last, size_type __n, _CharT __c) { size_type __len = (size_type)(__last - __first); if (__len >= __n) { _Traits::assign(__first, __n, __c); erase(__first + __n, __last); } else { _Traits::assign(__first, __len, __c); insert(__last, __n - __len, __c); } return *this; } template basic_string<_CharT,_Traits,_Alloc>& basic_string<_CharT,_Traits,_Alloc> ::_M_replace(iterator __first, iterator __last, const _CharT* __f, const _CharT* __l, bool __self_ref) { const ptrdiff_t __n = __l - __f; const difference_type __len = __last - __first; if (__len >= __n) { if (!__self_ref || __l < __first || __f >= __last) _M_copy(__f, __l, __first); else _M_move(__f, __l, __first); erase(__first + __n, __last); } else if (!__self_ref || (__f >= __last) || (__l <= __first)) { const_iterator __m = __f + __len; _M_copy(__f, __m, __first); _M_insert(__last, __m, __l, __self_ref ); } else if (__f < __first) { const_iterator __m = __f + __len; const difference_type __off_dest = __first - this->begin(); const difference_type __off_src = __f - this->begin(); _M_insert(__last, __m, __l, true); _Traits::move(begin() + __off_dest, begin() + __off_src, __len); } else { const_iterator __m = __f + __len; _Traits::move(__first, __f, __len); _M_insert(__last, __m, __l, true); } return *this; } template typename basic_string<_CharT,_Traits,_Alloc> ::size_type basic_string<_CharT,_Traits,_Alloc>::find( const _CharT* __s, size_type __pos, size_type __n) const { const size_t __len = size(); if (__pos >= __len || __pos + __n > __len) { if ( __n == 0 && __pos <= __len ) { return __pos; } return npos; } const_pointer __result = ::std::search(this->_M_Start() + __pos, this->_M_Finish(), __s, __s + __n, ::std::priv:: _Eq_traits<_Traits>()); return __result != this->_M_Finish() ? __result - this->_M_Start() : npos; } template typename basic_string<_CharT,_Traits,_Alloc> ::size_type basic_string<_CharT,_Traits,_Alloc>::find(_CharT __c, size_type __pos) const { if (__pos >= size()) { return npos; } const_pointer __result = ::std::find_if(this->_M_Start() + __pos, this->_M_Finish(), ::std::priv:: _Eq_char_bound<_Traits>(__c)); return __result != this->_M_Finish() ? __result - this->_M_Start() : npos; } template typename basic_string<_CharT,_Traits,_Alloc> ::size_type basic_string<_CharT,_Traits,_Alloc>::rfind(const _CharT* __s, size_type __pos, size_type __n) const { const size_type __len = size(); if ( __len < __n ) { return npos; } const_pointer __last = this->_M_Start() + (min)( __len - __n, __pos) + __n; if ( __n == 0 ) { return __last - this->_M_Start(); } const_pointer __result = ::std::find_end(this->_M_Start(), __last, __s, __s + __n, ::std::priv:: _Eq_traits<_Traits>()); return __result != __last ? __result - this->_M_Start() : npos; } template typename basic_string<_CharT,_Traits,_Alloc> ::size_type basic_string<_CharT,_Traits,_Alloc>::rfind(_CharT __c, size_type __pos) const { const size_type __len = size(); if ( __len < 1 ) { return npos; } const_iterator __last = begin() + (min)(__len - 1, __pos) + 1; const_reverse_iterator __rresult = ::std::find_if(const_reverse_iterator(__last), rend(), ::std::priv:: _Eq_char_bound<_Traits>(__c)); return __rresult != rend() ? (__rresult.base() - 1) - begin() : npos; } template typename basic_string<_CharT,_Traits,_Alloc> ::size_type basic_string<_CharT,_Traits,_Alloc> ::find_first_of(const _CharT* __s, size_type __pos, size_type __n) const { if (__pos >= size()) return npos; else { const_iterator __result = ::std::priv:: __str_find_first_of(begin() + __pos, end(), __s, __s + __n, static_cast<_Traits* >(0)); return __result != end() ? __result - begin() : npos; } } template typename basic_string<_CharT,_Traits,_Alloc> ::size_type basic_string<_CharT,_Traits,_Alloc> ::find_last_of(const _CharT* __s, size_type __pos, size_type __n) const { const size_type __len = size(); if ( __len < 1 ) { return npos; } const const_iterator __last = begin() + (min)(__len - 1, __pos) + 1; const const_reverse_iterator __rresult = ::std::priv:: __str_find_first_of(const_reverse_iterator(__last), rend(), __s, __s + __n, static_cast<_Traits* >(0)); return __rresult != rend() ? (__rresult.base() - 1) - begin() : npos; } template typename basic_string<_CharT,_Traits,_Alloc> ::size_type basic_string<_CharT,_Traits,_Alloc> ::find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const { typedef typename _Traits::char_type _CharType; if (__pos >= size()) return npos; else { const_pointer __result = ::std::priv:: __str_find_first_not_of(this->_M_Start() + __pos, this->_M_Finish(), static_cast(__s), static_cast(__s) + __n, static_cast<_Traits* >(0)); return __result != this->_M_finish ? __result - this->_M_Start() : npos; } } template typename basic_string<_CharT,_Traits,_Alloc> ::size_type basic_string<_CharT,_Traits,_Alloc> ::find_first_not_of(_CharT __c, size_type __pos) const { if (1 > size()) return npos; else { const_pointer __result = ::std::find_if(this->_M_Start() + __pos, this->_M_Finish(), ::std::priv:: _Neq_char_bound<_Traits>(__c)); return __result != this->_M_finish ? __result - this->_M_Start() : npos; } } template typename basic_string<_CharT,_Traits,_Alloc> ::size_type basic_string<_CharT,_Traits,_Alloc>::find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const { typedef typename _Traits::char_type _CharType; const size_type __len = size(); if ( __len < 1 ) { return npos; } const_iterator __last = begin() + (min)(__len - 1, __pos) + 1; const_reverse_iterator __rlast = const_reverse_iterator(__last); const_reverse_iterator __rresult = ::std::priv:: __str_find_first_not_of(__rlast, rend(), static_cast(__s), static_cast(__s) + __n, static_cast<_Traits* >(0)); return __rresult != rend() ? (__rresult.base() - 1) - begin() : npos; } template typename basic_string<_CharT,_Traits,_Alloc> ::size_type basic_string<_CharT, _Traits, _Alloc>::find_last_not_of(_CharT __c, size_type __pos) const { const size_type __len = size(); if ( __len < 1 ) { return npos; } const_iterator __last = begin() + (min)(__len - 1, __pos) + 1; const_reverse_iterator __rlast = const_reverse_iterator(__last); const_reverse_iterator __rresult = ::std::find_if(__rlast, rend(), ::std::priv:: _Neq_char_bound<_Traits>(__c)); return __rresult != rend() ? (__rresult.base() - 1) - begin() : npos; } namespace priv { template void _S_string_copy(const basic_string<_CharT,_Traits,_Alloc>& __s, _CharT* __buf, size_t __n) { if (__n > 0) { __n = (min) (__n - 1, __s.size()); ::std::copy(__s.begin(), __s.begin() + __n, __buf); __buf[__n] = _CharT(); } } } } namespace std { void __stl_throw_runtime_error(const char* __msg); void __stl_throw_range_error(const char* __msg); void __stl_throw_out_of_range(const char* __msg); void __stl_throw_length_error(const char* __msg); void __stl_throw_invalid_argument(const char* __msg); void __stl_throw_overflow_error(const char* __msg); } namespace std { namespace priv { template void _String_base<_Tp,_Alloc>::_M_throw_length_error() const { __stl_throw_length_error("basic_string"); } template void _String_base<_Tp, _Alloc>::_M_throw_out_of_range() const { __stl_throw_out_of_range("basic_string"); } template void _String_base<_Tp, _Alloc>::_M_allocate_block(size_t __n) { if ((__n <= (max_size() + 1)) && (__n > 0)) { if (__n > _DEFAULT_SIZE) { this->_M_start_of_storage._M_data = _M_start_of_storage.allocate(__n, __n); this->_M_finish = this->_M_start_of_storage._M_data; this->_M_buffers._M_end_of_storage = this->_M_start_of_storage._M_data + __n; } } else { this->_M_throw_length_error(); } } } template basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT* __s, const allocator_type& __a) : ::std::priv:: _String_base<_CharT,_Alloc>(__a) { _M_range_initialize(__s, __s + traits_type::length(__s)); } template basic_string<_CharT, _Traits, _Alloc>::basic_string(const basic_string<_CharT, _Traits, _Alloc> & __s) : ::std::priv:: _String_base<_CharT,_Alloc>(__s.get_allocator()) { _M_range_initialize(__s._M_Start(), __s._M_Finish()); } template const size_t basic_string<_CharT, _Traits, _Alloc>::npos; } namespace std { class __Named_exception : public exception { public: __Named_exception(const string& __str); __Named_exception(const __Named_exception&); __Named_exception& operator = (const __Named_exception&); const char* what() const ; ~__Named_exception() ; private: enum __attribute__((__packed__)) { _S_bufsize = 256 }; char _M_static_name[_S_bufsize]; char *_M_name; }; } using std::size_t; typedef size_t __stl_atomic_t; namespace std { struct _STLP_mutex_base { inline void _M_initialize() {} inline void _M_destroy() {} inline void _M_acquire_lock() {} inline void _M_release_lock() {} }; class _STLP_mutex : public _STLP_mutex_base { public: inline _STLP_mutex () { _M_initialize(); } inline ~_STLP_mutex () { _M_destroy(); } private: _STLP_mutex(const _STLP_mutex&); void operator=(const _STLP_mutex&); }; struct _STLP_auto_lock { _STLP_auto_lock(_STLP_mutex_base& __lock) : _M_lock(__lock) { _M_lock._M_acquire_lock(); } ~_STLP_auto_lock() { _M_lock._M_release_lock(); } private: _STLP_mutex_base& _M_lock; void operator=(const _STLP_auto_lock&); _STLP_auto_lock(const _STLP_auto_lock&); }; class _Refcount_Base { __stl_atomic_t _M_ref_count; public: _Refcount_Base(__stl_atomic_t __n) : _M_ref_count(__n) {} __stl_atomic_t _M_incr() { return ++_M_ref_count; } __stl_atomic_t _M_decr() { return --_M_ref_count; } }; template class _Atomic_swap_struct { public: static __stl_atomic_t _S_swap( __stl_atomic_t* __p, __stl_atomic_t __q) { __stl_atomic_t __result = *__p; *__p = __q; return __result; } static void* _S_swap_ptr(void* * __p, void* __q) { void *__result = *__p; *__p = __q; return __result; } }; template< > class _Atomic_swap_struct<0> { public: static __stl_atomic_t _S_swap( __stl_atomic_t* __p, __stl_atomic_t __q) { __stl_atomic_t __result = *__p; *__p = __q; return __result; } static void* _S_swap_ptr(void* * __p, void* __q) { void *__result = *__p; *__p = __q; return __result; } }; inline __stl_atomic_t _Atomic_swap( __stl_atomic_t * __p, __stl_atomic_t __q) { const int __use_ptr_atomic_swap = sizeof(__stl_atomic_t) == sizeof(void*); return _Atomic_swap_struct<__use_ptr_atomic_swap>::_S_swap(__p, __q); } inline void* _Atomic_swap_ptr(void* * __p, void* __q) { const int __use_ptr_atomic_swap = sizeof(__stl_atomic_t) == sizeof(void*); return _Atomic_swap_struct<__use_ptr_atomic_swap>::_S_swap_ptr(__p, __q); } } namespace std { } namespace std { template > > class money_get; template > > class money_put; template > > class num_get; template > > class num_put; template > > class time_get; template > > class time_put; } namespace std { class _Locale_impl; class locale; template bool __locale_do_operator_call(const locale& __loc, const basic_string<_CharT, _Traits, _Alloc>& __x, const basic_string<_CharT, _Traits, _Alloc>& __y); _Locale_impl * _get_Locale_impl( _Locale_impl *locimpl ); _Locale_impl * _copy_Nameless_Locale_impl( _Locale_impl *locimpl ); namespace priv { template bool _HasFacet(const locale& __loc, const _Facet* __facet) ; template _Facet* _UseFacet(const locale& __loc, const _Facet* __facet); template void _InsertFacet(locale& __loc, _Facet* __facet); } class locale { public: class facet : protected _Refcount_Base { protected: explicit facet(size_t __init_count = 0) : _Refcount_Base( __init_count == 0 ? 0 : 1 ) {} virtual ~facet(); friend class locale; friend class _Locale_impl; friend facet * _get_facet( facet * ); friend void _release_facet( facet *& ); private: facet(const facet& ) ; void operator=(const facet&); }; class id { public: size_t _M_index; static size_t _S_max; }; typedef int category; static const __far category none = 0x000; static const __far category collate = 0x010; static const __far category ctype = 0x020; static const __far category monetary = 0x040; static const __far category numeric = 0x100; static const __far category time = 0x200; static const __far category messages = 0x400; static const __far category all = collate | ctype | monetary | numeric | time | messages; locale() ; locale(const locale&) ; explicit locale(const char *); locale(const locale&, const char*, category); template locale(const locale& __loc, _Facet* __f) { if ( __f != 0 ) { this->_M_impl = _get_Locale_impl( _copy_Nameless_Locale_impl( __loc._M_impl ) ); ::std::priv:: _InsertFacet(*this, __f); } else { this->_M_impl = _get_Locale_impl( __loc._M_impl ); } } protected: locale(_Locale_impl*); public: locale(const locale&, const locale&, category); const locale& operator=(const locale&) ; ~locale() ; public: template locale combine(const locale& __loc) const { _Facet *__facet = 0; if (! ::std::priv:: _HasFacet(__loc, __facet)) _M_throw_on_combine_error(__loc.name()); return locale(*this, ::std::priv:: _UseFacet(__loc, __facet)); } string name() const; bool operator==(const locale&) const; bool operator!=(const locale&) const; template bool operator()(const basic_string<_CharT, _Traits, _Alloc>& __x, const basic_string<_CharT, _Traits, _Alloc>& __y) const { return __locale_do_operator_call(*this, __x, __y); } static locale global(const locale&); static const locale& classic(); facet* _M_get_facet(const id&) const; facet* _M_use_facet(const id&) const; static void _M_throw_on_combine_error(const string& name); static void _M_throw_on_null_name(); static void _M_throw_on_creation_failure(int __err_code, const char* name, const char* facet); void _M_insert(facet* __f, id& __id); friend class _Locale_impl; protected: _Locale_impl* _M_impl; _Locale_impl* _M_get_impl() const { return _M_impl; } }; template inline const _Facet& use_facet(const locale& __loc) { _Facet *__facet = 0; return *(::std::priv:: _UseFacet(__loc, __facet)); } template inline bool has_facet(const locale& __loc) { _Facet *__facet = 0; return ::std::priv:: _HasFacet(__loc, __facet); } namespace priv { template inline locale::id& _GetFacetId(const _Facet*) { return _Facet::id; } locale::id& _GetFacetId(const money_get > >*); locale::id& _GetFacetId(const money_put > >*); locale::id& _GetFacetId(const num_get > >*); locale::id& _GetFacetId(const num_put > >*); locale::id& _GetFacetId(const time_get > >*); locale::id& _GetFacetId(const time_put > >*); locale::id& _GetFacetId(const money_get > >*); locale::id& _GetFacetId(const money_put > >*); locale::id& _GetFacetId(const num_get > >*); locale::id& _GetFacetId(const num_put > >*); locale::id& _GetFacetId(const time_get > >*); locale::id& _GetFacetId(const time_put > >*); template inline bool _HasFacet(const locale& __loc, const _Facet* __facet) { return (__loc._M_get_facet(_GetFacetId(__facet)) != 0); } template inline _Facet* _UseFacet(const locale& __loc, const _Facet* __facet) { return static_cast<_Facet* >(__loc . _M_use_facet(_GetFacetId(__facet))); } template inline void _InsertFacet(locale& __loc, _Facet* __facet) { __loc._M_insert(__facet, _GetFacetId(__facet)); } } } namespace std { class ios_base { public: class failure : public __Named_exception { public: explicit failure(const string&); virtual ~failure() ; }; typedef int fmtflags; typedef int iostate; typedef int openmode; typedef int seekdir; typedef fmtflags fmt_flags; static const __far int left = 0x0001; static const __far int right = 0x0002; static const __far int internal = 0x0004; static const __far int dec = 0x0008; static const __far int hex = 0x0010; static const __far int oct = 0x0020; static const __far int fixed = 0x0040; static const __far int scientific = 0x0080; static const __far int boolalpha = 0x0100; static const __far int showbase = 0x0200; static const __far int showpoint = 0x0400; static const __far int showpos = 0x0800; static const __far int skipws = 0x1000; static const __far int unitbuf = 0x2000; static const __far int uppercase = 0x4000; static const __far int adjustfield = left | right | internal; static const __far int basefield = dec | hex | oct; static const __far int floatfield = scientific | fixed; static const __far int goodbit = 0x00; static const __far int badbit = 0x01; static const __far int eofbit = 0x02; static const __far int failbit = 0x04; static const __far int __default_mode = 0x0; static const __far int app = 0x01; static const __far int ate = 0x02; static const __far int binary = 0x04; static const __far int in = 0x08; static const __far int out = 0x10; static const __far int __c6xabi_trunc = 0x20; static const __far int beg = 0x01; static const __far int cur = 0x02; static const __far int end = 0x04; public: fmtflags flags() const { return _M_fmtflags; } fmtflags flags(fmtflags __flags) { fmtflags __tmp = _M_fmtflags; _M_fmtflags = __flags; return __tmp; } fmtflags setf(fmtflags __flag) { fmtflags __tmp = _M_fmtflags; _M_fmtflags |= __flag; return __tmp; } fmtflags setf(fmtflags __flag, fmtflags __mask) { fmtflags __tmp = _M_fmtflags; _M_fmtflags &= ~__mask; _M_fmtflags |= __flag & __mask; return __tmp; } void unsetf(fmtflags __mask) { _M_fmtflags &= ~__mask; } streamsize precision() const { return _M_precision; } streamsize precision(streamsize __newprecision) { streamsize __tmp = _M_precision; _M_precision = __newprecision; return __tmp; } streamsize width() const { return _M_width; } streamsize width(streamsize __newwidth) { streamsize __tmp = _M_width; _M_width = __newwidth; return __tmp; } public: locale imbue(const locale&); locale getloc() const { return _M_locale; } public: static int xalloc(); long& iword(int __index); void*& pword(int __index); public: virtual ~ios_base(); public: enum __attribute__((__packed__)) event { erase_event, imbue_event, copyfmt_event }; typedef void (*event_callback)(event, ios_base&, int __index); void register_callback(event_callback __fn, int __index); public: static bool sync_with_stdio(bool __sync = true); public: operator void*() const { return !fail() ? (void*) const_cast(this) : (void*) 0; } bool operator!() const { return fail(); } iostate rdstate() const { return _M_iostate; } bool good() const { return _M_iostate == 0; } bool eof() const { return (_M_iostate & eofbit) != 0; } bool fail() const { return (_M_iostate & (failbit | badbit)) != 0; } bool bad() const { return (_M_iostate & badbit) != 0; } public: enum __attribute__((__packed__)) _SpecialInitType { _NoInit }; protected: void _M_copy_state(const ios_base& __x); void _M_setstate_nothrow(iostate __state) { _M_iostate |= __state; } void _M_clear_nothrow(iostate __state) { _M_iostate = __state; } iostate _M_get_exception_mask() const { return _M_exception_mask; } void _M_set_exception_mask(iostate __mask) { _M_exception_mask = __mask; } void _M_check_exception_mask() { if (_M_iostate & _M_exception_mask) _M_throw_failure(); } void _M_invoke_callbacks(event); void _M_throw_failure(); ios_base(); ios_base(_SpecialInitType __i) { } protected: static void _S_initialize(); static void _S_uninitialize(); static __far bool _S_is_synced; private: ios_base(const ios_base&); void operator=(const ios_base&); private: fmtflags _M_fmtflags; iostate _M_iostate; openmode _M_openmode; seekdir _M_seekdir; iostate _M_exception_mask; streamsize _M_precision; streamsize _M_width; locale _M_locale; pair* _M_callbacks; size_t _M_num_callbacks; size_t _M_callback_index; long* _M_iwords; size_t _M_num_iwords; void** _M_pwords; size_t _M_num_pwords; public: class Init { public: Init(); ~Init(); private: static __far long _S_count; friend class ios_base; }; friend class Init; public: typedef iostate io_state; typedef openmode open_mode; typedef seekdir seek_dir; typedef ::std::streamoff streamoff; typedef ::std::streampos streampos; }; inline ios_base& boolalpha(ios_base& __s) { __s.setf(ios_base::boolalpha); return __s;} inline ios_base& noboolalpha(ios_base& __s) { __s.unsetf(ios_base::boolalpha); return __s;} inline ios_base& showbase(ios_base& __s) { __s.setf(ios_base::showbase); return __s;} inline ios_base& noshowbase(ios_base& __s) { __s.unsetf(ios_base::showbase); return __s;} inline ios_base& showpoint(ios_base& __s) { __s.setf(ios_base::showpoint); return __s;} inline ios_base& noshowpoint(ios_base& __s) { __s.unsetf(ios_base::showpoint); return __s;} inline ios_base& showpos(ios_base& __s) { __s.setf(ios_base::showpos); return __s;} inline ios_base& noshowpos(ios_base& __s) { __s.unsetf(ios_base::showpos); return __s;} inline ios_base& skipws(ios_base& __s) { __s.setf(ios_base::skipws); return __s;} inline ios_base& noskipws(ios_base& __s) { __s.unsetf(ios_base::skipws); return __s;} inline ios_base& uppercase(ios_base& __s) { __s.setf(ios_base::uppercase); return __s;} inline ios_base& nouppercase(ios_base& __s) { __s.unsetf(ios_base::uppercase); return __s;} inline ios_base& unitbuf(ios_base& __s) { __s.setf(ios_base::unitbuf); return __s;} inline ios_base& nounitbuf(ios_base& __s) { __s.unsetf(ios_base::unitbuf); return __s;} inline ios_base& internal(ios_base& __s) { __s.setf(ios_base::internal, ios_base::adjustfield); return __s; } inline ios_base& left(ios_base& __s) { __s.setf(ios_base::left, ios_base::adjustfield); return __s; } inline ios_base& right(ios_base& __s) { __s.setf(ios_base::right, ios_base::adjustfield); return __s; } inline ios_base& dec(ios_base& __s) { __s.setf(ios_base::dec, ios_base::basefield); return __s; } inline ios_base& hex(ios_base& __s) { __s.setf(ios_base::hex, ios_base::basefield); return __s; } inline ios_base& oct(ios_base& __s) { __s.setf(ios_base::oct, ios_base::basefield); return __s; } inline ios_base& fixed(ios_base& __s) { __s.setf(ios_base::fixed, ios_base::floatfield); return __s; } inline ios_base& scientific(ios_base& __s) { __s.setf(ios_base::scientific, ios_base::floatfield); return __s; } } struct _Locale_ctype; struct _Locale_codecvt; struct _Locale_numeric; struct _Locale_time; struct _Locale_collate; struct _Locale_monetary; struct _Locale_messages; namespace std { class ctype_base { public: enum __attribute__((__packed__)) mask { space = 0x0001, print = 0x0002, cntrl = 0x0004, upper = 0x0008, lower = 0x0010, alpha = 0x0020, digit = 0x0040, punct = 0x0080, xdigit = 0x0100, alnum = alpha | digit, graph = alnum | punct }; }; template class ctype {}; template class ctype_byname {}; template< > class ctype : public locale::facet, public ctype_base { friend class ctype; public: typedef char char_type; explicit ctype(const mask* __tab = 0, bool __del = false, size_t __refs = 0); bool is(mask __m, char __c) const { return ((*(_M_ctype_table+(unsigned char)__c)) & __m) != 0; } const char* is(const char* __low, const char* __high, mask* __vec) const { for (const char* __p = __low;__p != __high; ++__p, ++__vec) { *__vec = _M_ctype_table[(unsigned char)*__p]; } return __high; } const char* scan_is(mask __m, const char* __low, const char* __high) const; const char* scan_not(mask __m, const char* __low, const char* __high) const; char (toupper)(char __c) const { return do_toupper(__c); } const char* (toupper)(char* __low, const char* __high) const { return do_toupper(__low, __high); } char (tolower)(char __c) const { return do_tolower(__c); } const char* (tolower)(char* __low, const char* __high) const { return do_tolower(__low, __high); } char widen(char __c) const { return do_widen(__c); } const char* widen(const char* __low, const char* __high, char* __to) const { return do_widen(__low, __high, __to); } char narrow(char __c, char __dfault) const { return do_narrow(__c, __dfault); } const char* narrow(const char* __low, const char* __high, char __dfault, char* __to) const { return do_narrow(__low, __high, __dfault, __to); } static __far locale::id id; static const __far size_t table_size = 256; protected: const mask* table() const { return _M_ctype_table; } static const mask* classic_table() ; ~ctype(); virtual char do_toupper(char __c) const; virtual char do_tolower(char __c) const; virtual const char* do_toupper(char* __low, const char* __high) const; virtual const char* do_tolower(char* __low, const char* __high) const; virtual char do_widen(char __c) const; virtual const char* do_widen(const char* __low, const char* __high, char* __to) const; virtual char do_narrow(char __c, char ) const; virtual const char* do_narrow(const char* __low, const char* __high, char , char* __to) const; private: struct _Is_mask { mask __m; _Is_mask(mask __x): __m(__x) {} bool operator()(char __c) {return (__m & (unsigned char) __c) != 0;} }; protected: const mask* _M_ctype_table; private: bool _M_delete; }; template< > class ctype_byname: public ctype { friend class _Locale_impl; public: explicit ctype_byname(const char*, size_t = 0); protected: ~ctype_byname(); public: virtual char do_toupper(char __c) const; virtual char do_tolower(char __c) const; virtual const char* do_toupper(char*, const char*) const; virtual const char* do_tolower(char*, const char*) const; private: ctype_byname(_Locale_ctype* __ctype) : _M_ctype(__ctype) { _M_init(); } void _M_init(); typedef ctype_byname _Self; ctype_byname(_Self const&); _Self& operator = (_Self const&); mask _M_byname_table[table_size]; _Locale_ctype* _M_ctype; }; template< > class ctype : public locale::facet, public ctype_base { public: typedef wchar_t char_type; explicit ctype(size_t __refs = 0) : locale::facet(__refs) {} bool is(mask __m, wchar_t __c) const { return do_is(__m, __c); } const wchar_t* is(const wchar_t* __low, const wchar_t* __high, mask* __vec) const { return do_is(__low, __high, __vec); } const wchar_t* scan_is(mask __m, const wchar_t* __low, const wchar_t* __high) const { return do_scan_is(__m, __low, __high); } const wchar_t* scan_not (mask __m, const wchar_t* __low, const wchar_t* __high) const { return do_scan_not(__m, __low, __high); } wchar_t (toupper)(wchar_t __c) const { return do_toupper(__c); } const wchar_t* (toupper)(wchar_t* __low, const wchar_t* __high) const { return do_toupper(__low, __high); } wchar_t (tolower)(wchar_t __c) const { return do_tolower(__c); } const wchar_t* (tolower)(wchar_t* __low, const wchar_t* __high) const { return do_tolower(__low, __high); } wchar_t widen(char __c) const { return do_widen(__c); } const char* widen(const char* __low, const char* __high, wchar_t* __to) const { return do_widen(__low, __high, __to); } char narrow(wchar_t __c, char __dfault) const { return do_narrow(__c, __dfault); } const wchar_t* narrow(const wchar_t* __low, const wchar_t* __high, char __dfault, char* __to) const { return do_narrow(__low, __high, __dfault, __to); } static __far locale::id id; protected: ~ctype(); virtual bool do_is(mask __m, wchar_t __c) const; virtual const wchar_t* do_is(const wchar_t*, const wchar_t*, mask*) const; virtual const wchar_t* do_scan_is(mask, const wchar_t*, const wchar_t*) const; virtual const wchar_t* do_scan_not(mask, const wchar_t*, const wchar_t*) const; virtual wchar_t do_toupper(wchar_t __c) const; virtual const wchar_t* do_toupper(wchar_t*, const wchar_t*) const; virtual wchar_t do_tolower(wchar_t c) const; virtual const wchar_t* do_tolower(wchar_t*, const wchar_t*) const; virtual wchar_t do_widen(char c) const; virtual const char* do_widen(const char*, const char*, wchar_t*) const; virtual char do_narrow(wchar_t __c, char __dfault) const; virtual const wchar_t* do_narrow(const wchar_t*, const wchar_t*, char, char*) const; }; template< > class ctype_byname: public ctype { friend class _Locale_impl; public: explicit ctype_byname(const char* __name, size_t __refs = 0); protected: ~ctype_byname(); virtual bool do_is(mask __m, wchar_t __c) const; virtual const wchar_t* do_is(const wchar_t*, const wchar_t*, mask*) const; virtual const wchar_t* do_scan_is(mask, const wchar_t*, const wchar_t*) const; virtual const wchar_t* do_scan_not(mask, const wchar_t*, const wchar_t*) const; virtual wchar_t do_toupper(wchar_t __c) const; virtual const wchar_t* do_toupper(wchar_t*, const wchar_t*) const; virtual wchar_t do_tolower(wchar_t c) const; virtual const wchar_t* do_tolower(wchar_t*, const wchar_t*) const; private: ctype_byname(_Locale_ctype* __ctype) : _M_ctype(__ctype) {} typedef ctype_byname _Self; ctype_byname(_Self const&); _Self& operator = (_Self const&); _Locale_ctype* _M_ctype; }; } namespace std { template class numpunct {}; template class numpunct_byname {}; template class num_get; template< > class numpunct : public locale::facet { public: typedef char char_type; typedef string string_type; explicit numpunct(size_t __refs = 0) : locale::facet(__refs) {} char decimal_point() const { return do_decimal_point(); } char thousands_sep() const { return do_thousands_sep(); } string grouping() const { return do_grouping(); } string truename() const { return do_truename(); } string falsename() const { return do_falsename(); } static __far locale::id id; protected: ~numpunct(); virtual char do_decimal_point() const; virtual char do_thousands_sep() const; virtual string do_grouping() const; virtual string do_truename() const; virtual string do_falsename() const; }; template< > class numpunct : public locale::facet { public: typedef wchar_t char_type; typedef wstring string_type; explicit numpunct(size_t __refs = 0) : locale::facet(__refs) {} wchar_t decimal_point() const { return do_decimal_point(); } wchar_t thousands_sep() const { return do_thousands_sep(); } string grouping() const { return do_grouping(); } wstring truename() const { return do_truename(); } wstring falsename() const { return do_falsename(); } static __far locale::id id; protected: ~numpunct(); virtual wchar_t do_decimal_point() const; virtual wchar_t do_thousands_sep() const; virtual string do_grouping() const; virtual wstring do_truename() const; virtual wstring do_falsename() const; }; template< > class numpunct_byname : public numpunct { friend class _Locale_impl; public: typedef char char_type; typedef string string_type; explicit numpunct_byname(const char* __name, size_t __refs = 0); protected: ~numpunct_byname(); virtual char do_decimal_point() const; virtual char do_thousands_sep() const; virtual string do_grouping() const; virtual string do_truename() const; virtual string do_falsename() const; private: numpunct_byname(_Locale_numeric *__numeric) : _M_numeric(__numeric) {} typedef numpunct_byname _Self; numpunct_byname(_Self const&); _Self& operator = (_Self const&); _Locale_numeric* _M_numeric; }; template< > class numpunct_byname: public numpunct { friend class _Locale_impl; public: typedef wchar_t char_type; typedef wstring string_type; explicit numpunct_byname(const char* __name, size_t __refs = 0); protected: ~numpunct_byname(); virtual wchar_t do_decimal_point() const; virtual wchar_t do_thousands_sep() const; virtual string do_grouping() const; virtual wstring do_truename() const; virtual wstring do_falsename() const; private: numpunct_byname(_Locale_numeric *__numeric) : _M_numeric(__numeric) {} typedef numpunct_byname _Self; numpunct_byname(_Self const&); _Self& operator = (_Self const&); _Locale_numeric* _M_numeric; }; } namespace std { template class basic_ios : public ios_base { friend class ios_base; public: typedef _CharT char_type; typedef typename _Traits::int_type int_type; typedef typename _Traits::pos_type pos_type; typedef typename _Traits::off_type off_type; typedef _Traits traits_type; public: explicit basic_ios(basic_streambuf<_CharT, _Traits>* __streambuf); explicit basic_ios(ios_base::_SpecialInitType __i) : ios_base(__i) { }; virtual ~basic_ios() {} public: basic_ostream<_CharT, _Traits>* tie() const { return _M_tied_ostream; } basic_ostream<_CharT, _Traits>* tie(basic_ostream* __new_tied_ostream) { basic_ostream* __tmp = _M_tied_ostream; _M_tied_ostream = __new_tied_ostream; return __tmp; } basic_streambuf<_CharT, _Traits>* rdbuf() const { return _M_streambuf; } basic_streambuf<_CharT, _Traits>* rdbuf(basic_streambuf*); basic_ios<_CharT, _Traits>& copyfmt(const basic_ios<_CharT, _Traits>& __x); char_type fill() const { return _M_fill; } char_type fill(char_type __fill) { char_type __tmp(_M_fill); _M_fill = __fill; return __tmp; } public: void clear(iostate __state = goodbit) { _M_clear_nothrow(this->rdbuf() ? __state : iostate(__state|ios_base::badbit)); _M_check_exception_mask(); } void setstate(iostate __state) { this->clear(rdstate() | __state); } iostate exceptions() const { return this->_M_get_exception_mask(); } void exceptions(iostate __mask) { this->_M_set_exception_mask(__mask); this->clear(this->rdstate()); } public: locale imbue(const locale&); inline char narrow(_CharT, char) const ; inline _CharT widen(char) const; static bool _S_eof(int_type __c) { const int_type __eof = _Traits::eof(); return _Traits::eq_int_type(__c, __eof); } protected: const ctype* _M_cached_ctype; public: const ctype* _M_ctype_facet() const { return _M_cached_ctype; } protected: basic_ios(); void init(basic_streambuf<_CharT, _Traits>* __streambuf); public: void _M_handle_exception(ios_base::iostate __flag); private: char_type _M_fill; basic_streambuf<_CharT, _Traits>* _M_streambuf; basic_ostream<_CharT, _Traits>* _M_tied_ostream; }; template inline char basic_ios<_CharT, _Traits>::narrow(_CharT __c, char __default) const { return _M_ctype_facet()->narrow(__c, __default); } template inline _CharT basic_ios<_CharT, _Traits>::widen(char __c) const { return _M_ctype_facet()->widen(__c); } template< > inline char basic_ios >::narrow(char __c, char) const { return __c; } template< > inline char basic_ios >::widen(char __c) const { return __c; } } namespace std { template class basic_streambuf { friend class basic_istream<_CharT, _Traits>; friend class basic_ostream<_CharT, _Traits>; public: typedef _CharT char_type; typedef typename _Traits::int_type int_type; typedef typename _Traits::pos_type pos_type; typedef typename _Traits::off_type off_type; typedef _Traits traits_type; private: char_type* _M_gbegin; char_type* _M_gnext; char_type* _M_gend; char_type* _M_pbegin; char_type* _M_pnext; char_type* _M_pend; locale _M_locale; public: virtual ~basic_streambuf(); protected: basic_streambuf() ; protected: char_type* eback() const { return _M_gbegin; } char_type* gptr() const { return _M_gnext; } char_type* egptr() const { return _M_gend; } void gbump(int __n) { _M_gnext += __n; } void setg(char_type* __gbegin, char_type* __gnext, char_type* __gend) { _M_gbegin = __gbegin; _M_gnext = __gnext; _M_gend = __gend; } public: char_type* _M_eback() const { return eback(); } char_type* _M_gptr() const { return gptr(); } char_type* _M_egptr() const { return egptr(); } void _M_gbump(int __n) { gbump(__n); } void _M_setg(char_type* __gbegin, char_type* __gnext, char_type* __gend) { this->setg(__gbegin, __gnext, __gend); } protected: char_type* pbase() const { return _M_pbegin; } char_type* pptr() const { return _M_pnext; } char_type* epptr() const { return _M_pend; } void pbump(int __n) { _M_pnext += __n; } void setp(char_type* __pbegin, char_type* __pend) { _M_pbegin = __pbegin; _M_pnext = __pbegin; _M_pend = __pend; } protected: virtual basic_streambuf<_CharT, _Traits>* setbuf(char_type*, streamsize); virtual pos_type seekoff(off_type, ios_base::seekdir, ios_base::openmode = ios_base::in | ios_base::out); virtual pos_type seekpos(pos_type, ios_base::openmode = ios_base::in | ios_base::out); virtual int sync(); public: basic_streambuf<_CharT, _Traits>* pubsetbuf(char_type* __s, streamsize __n) { return this->setbuf(__s, __n); } pos_type pubseekoff(off_type __offset, ios_base::seekdir __way, ios_base::openmode __mod = ios_base::in | ios_base::out) { return this->seekoff(__offset, __way, __mod); } pos_type pubseekpos(pos_type __sp, ios_base::openmode __mod = ios_base::in | ios_base::out) { return this->seekpos(__sp, __mod); } int pubsync() { return this->sync(); } protected: virtual streamsize showmanyc(); virtual streamsize xsgetn(char_type* __s, streamsize __n); virtual int_type underflow(); virtual int_type uflow(); virtual int_type pbackfail(int_type = traits_type::eof()); protected: virtual streamsize xsputn(const char_type* __s, streamsize __n); virtual streamsize _M_xsputnc(char_type __c, streamsize __n); virtual int_type overflow(int_type = traits_type::eof()); public: int_type sputc(char_type __c) { return ((_M_pnext < _M_pend) ? _Traits::to_int_type(*_M_pnext++ = __c) : this->overflow(_Traits::to_int_type(__c))); } streamsize sputn(const char_type* __s, streamsize __n) { return this->xsputn(__s, __n); } streamsize _M_sputnc(char_type __c, streamsize __n) { return this->_M_xsputnc(__c, __n); } private: int_type _M_snextc_aux(); public: streamsize in_avail() { return (_M_gnext < _M_gend) ? (_M_gend - _M_gnext) : this->showmanyc(); } int_type snextc() { return ( _M_gend - _M_gnext > 1 ? _Traits::to_int_type(*++_M_gnext) : this->_M_snextc_aux()); } int_type sbumpc() { return _M_gnext < _M_gend ? _Traits::to_int_type(*_M_gnext++) : this->uflow(); } int_type sgetc() { return _M_gnext < _M_gend ? _Traits::to_int_type(*_M_gnext) : this->underflow(); } streamsize sgetn(char_type* __s, streamsize __n) { return this->xsgetn(__s, __n); } int_type sputbackc(char_type __c) { return ((_M_gbegin < _M_gnext) && _Traits::eq(__c, *(_M_gnext - 1))) ? _Traits::to_int_type(*--_M_gnext) : this->pbackfail(_Traits::to_int_type(__c)); } int_type sungetc() { return (_M_gbegin < _M_gnext) ? _Traits::to_int_type(*--_M_gnext) : this->pbackfail(); } protected: virtual void imbue(const locale&); public: locale pubimbue(const locale&); locale getloc() const { return _M_locale; } void stossc() { this->sbumpc(); } }; } namespace std { template basic_streambuf<_CharT, _Traits>::basic_streambuf() : _M_gbegin(0), _M_gnext(0), _M_gend(0), _M_pbegin(0), _M_pnext(0), _M_pend(0), _M_locale() { } template basic_streambuf<_CharT, _Traits>::~basic_streambuf() {} template locale basic_streambuf<_CharT, _Traits>::pubimbue(const locale& __loc) { this->imbue(__loc); locale __tmp = _M_locale; _M_locale = __loc; return __tmp; } template streamsize basic_streambuf<_CharT, _Traits>::xsgetn(_CharT* __s, streamsize __n) { streamsize __result = 0; const int_type __eof = _Traits::eof(); while (__result < __n) { if (_M_gnext < _M_gend) { size_t __chunk = (min) (static_cast(_M_gend - _M_gnext), static_cast(__n - __result)); _Traits::copy(__s, _M_gnext, __chunk); __result += __chunk; __s += __chunk; _M_gnext += __chunk; } else { int_type __c = this->sbumpc(); if (!_Traits::eq_int_type(__c, __eof)) { *__s = _Traits::to_char_type(__c); ++__result; ++__s; } else break; } } return __result; } template streamsize basic_streambuf<_CharT, _Traits>::xsputn(const _CharT* __s, streamsize __n) { streamsize __result = 0; const int_type __eof = _Traits::eof(); while (__result < __n) { if (_M_pnext < _M_pend) { size_t __chunk = (min) (static_cast(_M_pend - _M_pnext), static_cast(__n - __result)); _Traits::copy(_M_pnext, __s, __chunk); __result += __chunk; __s += __chunk; _M_pnext += __chunk; } else if (!_Traits::eq_int_type(this->overflow(_Traits::to_int_type(*__s)), __eof)) { ++__result; ++__s; } else break; } return __result; } template streamsize basic_streambuf<_CharT, _Traits>::_M_xsputnc(_CharT __c, streamsize __n) { streamsize __result = 0; const int_type __eof = _Traits::eof(); while (__result < __n) { if (_M_pnext < _M_pend) { size_t __chunk = (min) (static_cast(_M_pend - _M_pnext), static_cast(__n - __result)); _Traits::assign(_M_pnext, __chunk, __c); __result += __chunk; _M_pnext += __chunk; } else if (!_Traits::eq_int_type(this->overflow(_Traits::to_int_type(__c)), __eof)) ++__result; else break; } return __result; } template typename basic_streambuf<_CharT, _Traits>::int_type basic_streambuf<_CharT, _Traits>::_M_snextc_aux() { int_type __eof = _Traits::eof(); if (_M_gend == _M_gnext) return _Traits::eq_int_type(this->uflow(), __eof) ? __eof : this->sgetc(); else { _M_gnext = _M_gend; return this->underflow(); } } template typename basic_streambuf<_CharT, _Traits>::int_type basic_streambuf<_CharT, _Traits>::pbackfail(int_type) { return _Traits::eof(); } template typename basic_streambuf<_CharT, _Traits>::int_type basic_streambuf<_CharT, _Traits>::overflow(int_type) { return _Traits::eof(); } template typename basic_streambuf<_CharT, _Traits>::int_type basic_streambuf<_CharT, _Traits>::uflow() { return ( _Traits::eq_int_type(this->underflow(),_Traits::eof()) ? _Traits::eof() : _Traits::to_int_type(*_M_gnext++)); } template typename basic_streambuf<_CharT, _Traits>::int_type basic_streambuf<_CharT, _Traits>::underflow() { return _Traits::eof(); } template streamsize basic_streambuf<_CharT, _Traits>::showmanyc() { return 0; } template void basic_streambuf<_CharT, _Traits>::imbue(const locale&) {} template int basic_streambuf<_CharT, _Traits>::sync() { return 0; } template typename basic_streambuf<_CharT, _Traits>::pos_type basic_streambuf<_CharT, _Traits>::seekpos(pos_type, ios_base::openmode) { return pos_type(-1); } template typename basic_streambuf<_CharT, _Traits>::pos_type basic_streambuf<_CharT, _Traits>::seekoff(off_type, ios_base::seekdir, ios_base::openmode) { return pos_type(-1); } template basic_streambuf<_CharT, _Traits>* basic_streambuf<_CharT, _Traits>:: setbuf(char_type*, streamsize) { return this; } } namespace std { template basic_ios<_CharT, _Traits> ::basic_ios(basic_streambuf<_CharT, _Traits>* __streambuf) : ios_base(), _M_cached_ctype(0), _M_fill(_CharT()), _M_streambuf(0), _M_tied_ostream(0) { basic_ios<_CharT, _Traits>::init(__streambuf); } template basic_streambuf<_CharT, _Traits>* basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __buf) { basic_streambuf<_CharT, _Traits>* __tmp = _M_streambuf; _M_streambuf = __buf; this->clear(); return __tmp; } template basic_ios<_CharT, _Traits>& basic_ios<_CharT, _Traits>::copyfmt(const basic_ios<_CharT, _Traits>& __x) { _M_invoke_callbacks(erase_event); _M_copy_state(__x); _M_cached_ctype = __x._M_cached_ctype; _M_fill = __x._M_fill; _M_tied_ostream = __x._M_tied_ostream; _M_invoke_callbacks(copyfmt_event); this->_M_set_exception_mask(__x.exceptions()); return *this; } template locale basic_ios<_CharT, _Traits>::imbue(const locale& __loc) { locale __tmp = ios_base::imbue(__loc); { if (_M_streambuf) _M_streambuf->pubimbue(__loc); _M_cached_ctype = &use_facet >(__loc); } if (false) { __tmp = ios_base::imbue(__tmp); _M_handle_exception(ios_base::failbit); } return __tmp; } template basic_ios<_CharT, _Traits>::basic_ios() : ios_base(), _M_fill(_CharT()), _M_streambuf(0), _M_tied_ostream(0) {} template void basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb) { this->rdbuf(__sb); this->imbue(locale()); this->tie(0); this->_M_set_exception_mask(ios_base::goodbit); this->_M_clear_nothrow(__sb != 0 ? ios_base::goodbit : ios_base::badbit); ios_base::flags(ios_base::skipws | ios_base::dec); ios_base::width(0); ios_base::precision(6); this->fill(widen(' ')); } template void basic_ios<_CharT, _Traits>::_M_handle_exception(ios_base::iostate __flag) { this->_M_setstate_nothrow(__flag); if (this->_M_get_exception_mask() & __flag) {}; } } namespace std { namespace priv { template extern basic_streambuf<_CharT, _Traits>* __get_ostreambuf(basic_ostream<_CharT, _Traits>&); } template class ostreambuf_iterator : public iterator { public: typedef _CharT char_type; typedef _Traits traits_type; typedef typename _Traits::int_type int_type; typedef basic_streambuf<_CharT, _Traits> streambuf_type; typedef basic_ostream<_CharT, _Traits> ostream_type; typedef output_iterator_tag iterator_category; typedef void value_type; typedef void difference_type; typedef void pointer; typedef void reference; public: ostreambuf_iterator(streambuf_type* __buf) : _M_buf(__buf), _M_ok(__buf!=0) {} inline ostreambuf_iterator(ostream_type& __o) ; ostreambuf_iterator<_CharT, _Traits>& operator=(char_type __c) { _M_ok = _M_ok && !traits_type::eq_int_type(_M_buf->sputc(__c), traits_type::eof()); return *this; } ostreambuf_iterator<_CharT, _Traits>& operator*() { return *this; } ostreambuf_iterator<_CharT, _Traits>& operator++() { return *this; } ostreambuf_iterator<_CharT, _Traits>& operator++(int) { return *this; } bool failed() const { return !_M_ok; } private: streambuf_type* _M_buf; bool _M_ok; }; template inline ostreambuf_iterator<_CharT, _Traits>::ostreambuf_iterator(basic_ostream<_CharT, _Traits>& __o) : _M_buf(::std::priv:: __get_ostreambuf(__o)), _M_ok(_M_buf != 0) {} } namespace std { namespace priv { template bool __init_bostr(basic_ostream<_CharT, _Traits>& __str); } template class basic_ostream : virtual public basic_ios<_CharT, _Traits> { typedef basic_ostream<_CharT, _Traits> _Self; public: typedef _CharT char_type; typedef typename _Traits::int_type int_type; typedef typename _Traits::pos_type pos_type; typedef typename _Traits::off_type off_type; typedef _Traits traits_type; typedef basic_ios<_CharT, _Traits> _Basic_ios; public: explicit basic_ostream(basic_streambuf<_CharT, _Traits>* __buf); explicit basic_ostream(ios_base::_SpecialInitType __i) : basic_ios<_CharT, _Traits>(__i) { } ~basic_ostream(); public: typedef basic_ios<_CharT, _Traits>& ( *__ios_fn)(basic_ios<_CharT, _Traits>&); typedef ios_base& ( *__ios_base_fn)(ios_base&); typedef _Self& ( *__ostream_fn)(_Self&); _Self& operator<< (__ostream_fn __f) { return __f(*this); } _Self & operator<< (__ios_base_fn __f) { __f(*this); return *this; } _Self& operator<< (__ios_fn __ff) { __ff(*this); return *this; } private: bool _M_copy_buffered(basic_streambuf<_CharT, _Traits>* __from, basic_streambuf<_CharT, _Traits>* __to); bool _M_copy_unbuffered(basic_streambuf<_CharT, _Traits>* __from, basic_streambuf<_CharT, _Traits>* __to); public: void _M_put_char(_CharT __c); void _M_put_nowiden(const _CharT* __s); void _M_put_widen(const char* __s); bool _M_put_widen_aux(const char* __s, streamsize __n); public: _Self& put(char_type __c); _Self& write(const char_type* __s, streamsize __n); public: _Self& operator<<(basic_streambuf<_CharT, _Traits>* __buf); _Self& operator<<(unsigned char __x) { _M_put_char(__x); return *this; } _Self& operator<<(short __x); _Self& operator<<(unsigned short __x); _Self& operator<<(int __x); _Self& operator<<(unsigned int __x); _Self& operator<<(long __x); _Self& operator<<(unsigned long __x); _Self& operator<< (long long __x); _Self& operator<< (unsigned long long __x); _Self& operator<<(float __x); _Self& operator<<(double __x); _Self& operator<<(long double __x); _Self& operator<<(const void* __x); _Self& operator<<(bool __x); public: _Self& flush() { if (this->rdbuf()) if (this->rdbuf()->pubsync() == -1) this->setstate(ios_base::badbit); return *this; } pos_type tellp() { return this->rdbuf() && !this->fail() ? this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out) : pos_type(-1); } _Self& seekp(pos_type __pos) { if (this->rdbuf() && !this->fail()) { if (this->rdbuf()->pubseekpos(__pos, ios_base::out) == pos_type(-1)) { this->setstate(ios_base::failbit); } } return *this; } _Self& seekp(off_type __off, ios_base::seekdir __dir) { if (this->rdbuf() && !this->fail()) this->rdbuf()->pubseekoff(__off, __dir, ios_base::out); return *this; } class sentry { typedef sentry _Self; private: basic_ostream<_CharT, _Traits>& _M_str; bool _M_ok; public: explicit sentry(basic_ostream<_CharT, _Traits>& __str) : _M_str(__str), _M_ok(::std::priv:: __init_bostr(__str)) {} ~sentry() { if (_M_str.flags() & ios_base::unitbuf) _M_str.flush(); } operator bool() const { return _M_ok; } private: sentry(const _Self& __s) : _M_str(__s._M_str) {} _Self& operator=(const _Self&) { return *this; } }; }; namespace priv { template bool __init_bostr(basic_ostream<_CharT, _Traits>& __str) { if (__str.good()) { if (!__str.rdbuf()) __str.setstate(ios_base::badbit); if (__str.tie()) __str.tie()->flush(); return __str.good(); } else return false; } template inline basic_streambuf<_CharT, _Traits>* __get_ostreambuf(basic_ostream<_CharT, _Traits>& __St) { return __St.rdbuf(); } } template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c){ __os._M_put_char(__c); return __os; } template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const _CharT* __s) { __os._M_put_nowiden(__s); return __os; } template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, char __c) { __os._M_put_char(__os.widen(__c)); return __os; } template inline basic_ostream& operator<<(basic_ostream& __os, char __c) { __os._M_put_char(__c); return __os; } template inline basic_ostream& operator<<(basic_ostream& __os, signed char __c) { __os._M_put_char(__c); return __os; } template inline basic_ostream& operator<<(basic_ostream& __os, unsigned char __c) { __os._M_put_char(__c); return __os; } template inline basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __s) { __os._M_put_widen(__s); return __os; } template inline basic_ostream& operator<<(basic_ostream& __os, const char* __s) { __os._M_put_nowiden(__s); return __os; } template inline basic_ostream& operator<<(basic_ostream& __os, const signed char* __s) { __os._M_put_nowiden(reinterpret_cast(__s)); return __os; } template inline basic_ostream& operator<<(basic_ostream& __os, const unsigned char* __s) { __os._M_put_nowiden(reinterpret_cast(__s)); return __os; } template inline basic_ostream<_CharT, _Traits>& endl(basic_ostream<_CharT, _Traits>& __os) { __os.put(__os.widen('\n')); __os.flush(); return __os; } template inline basic_ostream<_CharT, _Traits>& ends(basic_ostream<_CharT, _Traits>& __os) { __os.put(_CharT()); return __os; } template inline basic_ostream<_CharT, _Traits>& flush(basic_ostream<_CharT, _Traits>& __os) { __os.flush(); return __os; } } namespace std { namespace priv { template class __iostring_allocator : public allocator<_CharT> { public: enum __attribute__((__packed__)) { _STR_SIZE = 256 }; private: enum __attribute__((__packed__)) { _BUF_SIZE = _STR_SIZE + 1 }; typedef allocator<_CharT> _Base; _CharT _M_static_buf[_BUF_SIZE]; public: typedef typename _Base::size_type size_type; typedef typename _Base::pointer pointer; template struct rebind { typedef __iostring_allocator<_Tp1> other; }; _CharT* allocate(size_type __n, const void* __ptr = 0) { if (__n > _BUF_SIZE) { return _Base::allocate(__n, __ptr); } return _M_static_buf; } void deallocate(pointer __p, size_type __n) { if (__p != _M_static_buf) _Base::deallocate(__p, __n); } }; template struct __basic_iostring : public basic_string<_CharT, char_traits<_CharT>, __iostring_allocator<_CharT> > { typedef __basic_iostring<_CharT> _Self; typedef basic_string<_CharT, char_traits<_CharT>, __iostring_allocator<_CharT> > _Base; typedef typename _Base::_Reserve_t _Reserve_t; __basic_iostring() : _Base(_Reserve_t(), __iostring_allocator<_CharT>::_STR_SIZE) {} _Self& operator=(const _CharT* __s) { _Base::operator=(__s); return *this; } }; typedef __basic_iostring __iostring; typedef __basic_iostring __iowstring; } } namespace std { template class num_put: public locale::facet { public: typedef _CharT char_type; typedef _OutputIter iter_type; explicit num_put(size_t __refs = 0) : locale::facet(__refs) {} iter_type put(iter_type __s, ios_base& __f, char_type __fill, bool __val) const { return do_put(__s, __f, __fill, __val); } iter_type put(iter_type __s, ios_base& __f, char_type __fill, long __val) const { return do_put(__s, __f, __fill, __val); } iter_type put(iter_type __s, ios_base& __f, char_type __fill, unsigned long __val) const { return do_put(__s, __f, __fill, __val); } iter_type put(iter_type __s, ios_base& __f, char_type __fill, long long __val) const { return do_put(__s, __f, __fill, __val); } iter_type put(iter_type __s, ios_base& __f, char_type __fill, unsigned long long __val) const { return do_put(__s, __f, __fill, __val); } iter_type put(iter_type __s, ios_base& __f, char_type __fill, double __val) const { return do_put(__s, __f, __fill, (double)__val); } iter_type put(iter_type __s, ios_base& __f, char_type __fill, long double __val) const { return do_put(__s, __f, __fill, __val); } iter_type put(iter_type __s, ios_base& __f, char_type __fill, const void * __val) const { return do_put(__s, __f, __fill, __val); } static __far locale::id id; protected: ~num_put() {} virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, bool __val) const; virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long __val) const; virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, unsigned long __val) const; virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, double __val) const; virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long double __val) const; virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long long __val) const; virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, unsigned long long __val) const ; virtual _OutputIter do_put(_OutputIter __s, ios_base& __f, _CharT __fill, const void* __val) const; }; namespace priv { template char* __write_integer_backward(char* __buf, ios_base::fmtflags __flags, _Integer __x); extern size_t __write_float(__iostring&, ios_base::fmtflags, int, double); extern size_t __write_float(__iostring&, ios_base::fmtflags, int, long double); void __get_floor_digits(__iostring&, long double); template void __get_money_digits(::std::priv:: __basic_iostring<_CharT> &, ios_base&, long double); extern void __convert_float_buffer(__iostring const&, __iowstring&, const ctype&, wchar_t, bool = true); extern void __adjust_float_buffer(__iostring&, char); extern char* __write_integer(char* buf, ios_base::fmtflags flags, long x); extern ptrdiff_t __insert_grouping(char* first, char* last, const string&, char, char, char, int); extern void __insert_grouping(__iostring&, size_t, const string&, char, char, char, int); extern ptrdiff_t __insert_grouping(wchar_t*, wchar_t*, const string&, wchar_t, wchar_t, wchar_t, int); extern void __insert_grouping(__iowstring&, size_t, const string&, wchar_t, wchar_t, wchar_t, int); } } #pragma diag_push #pragma CHECK_MISRA("-20.1") #pragma diag_pop namespace std { enum __attribute__((__packed__)) float_round_style { round_indeterminate = -1, round_toward_zero = 0, round_to_nearest = 1, round_toward_infinity = 2, round_toward_neg_infinity = 3 }; enum __attribute__((__packed__)) float_denorm_style { denorm_indeterminate = -1, denorm_absent = 0, denorm_present = 1 }; namespace priv { template class _Numeric_limits_base { public: static __number ( min)() { return __number(0); } static __number ( max)() { return __number(0); } static const __far int digits = 0; static const __far int digits10 = 0; static const __far int radix = 0; static const __far int min_exponent = 0; static const __far int min_exponent10 = 0; static const __far int max_exponent = 0; static const __far int max_exponent10 = 0; static const __far float_denorm_style has_denorm = denorm_absent; static const __far float_round_style round_style = round_toward_zero; static const __far bool is_specialized = false; static const __far bool is_signed = false; static const __far bool is_integer = false; static const __far bool is_exact = false; static const __far bool has_infinity = false; static const __far bool has_quiet_NaN = false; static const __far bool has_signaling_NaN = false; static const __far bool has_denorm_loss = false; static const __far bool is_iec559 = false; static const __far bool is_bounded = false; static const __far bool is_modulo = false; static const __far bool traps = false; static const __far bool tinyness_before = false; static __number epsilon() { return __number(0); } static __number round_error() { return __number(0); } static __number infinity() { return __number(0); } static __number quiet_NaN() { return __number(0); } static __number signaling_NaN() { return __number(0); } static __number denorm_min() { return __number(0); } }; template class _Integer_limits : public _Numeric_limits_base<_Int> { public: static _Int ( min) () { return (_Int)__imin; } static _Int ( max) () { return (_Int)__imax; } static const __far int digits = (__idigits < 0) ? ((int)((sizeof(_Int) * (8))) - ((__imin == 0) ? 0 : 1)) : (__idigits); static const __far int digits10 = (digits * 301UL) / 1000; static const __far int radix = 2; static const __far bool is_specialized = true; static const __far bool is_signed = (__imin != 0); static const __far bool is_integer = true; static const __far bool is_exact = true; static const __far bool is_bounded = true; static const __far bool is_modulo = __ismod; }; template class _Floating_limits : public _Numeric_limits_base<__number> { public: static const __far int digits = __Digits; static const __far int digits10 = __Digits10; static const __far int radix = 2; static const __far int min_exponent = __MinExp; static const __far int max_exponent = __MaxExp; static const __far int min_exponent10 = __MinExp10; static const __far int max_exponent10 = __MaxExp10; static const __far float_denorm_style has_denorm = __DenormStyle; static const __far float_round_style round_style = __RoundStyle; static const __far bool is_specialized = true; static const __far bool is_signed = true; static const __far bool has_infinity = true; static const __far bool has_quiet_NaN = true; static const __far bool has_signaling_NaN = true; static const __far bool is_iec559 = __IsIEC559 && has_infinity && has_quiet_NaN && has_signaling_NaN && (has_denorm == denorm_present); static const __far bool has_denorm_loss = false; static const __far bool is_bounded = true; static const __far bool traps = true; static const __far bool tinyness_before = false; }; } template class numeric_limits : public ::std::priv:: _Numeric_limits_base<_Tp> {}; template< > class numeric_limits : public ::std::priv:: _Integer_limits {}; template< > class numeric_limits : public ::std::priv:: _Integer_limits {}; template< > class numeric_limits : public ::std::priv:: _Integer_limits {}; template< > class numeric_limits : public ::std::priv:: _Integer_limits {}; template< > class numeric_limits : public ::std::priv:: _Integer_limits {}; template< > class numeric_limits : public ::std::priv:: _Integer_limits {}; template< > class numeric_limits : public ::std::priv:: _Integer_limits {}; template< > class numeric_limits : public ::std::priv:: _Integer_limits {}; template< > class numeric_limits : public ::std::priv:: _Integer_limits {}; template< > class numeric_limits : public ::std::priv:: _Integer_limits {}; template< > class numeric_limits : public ::std::priv:: _Integer_limits {}; template< > class numeric_limits : public ::std::priv:: _Integer_limits {}; template< > class numeric_limits : public ::std::priv:: _Integer_limits {}; namespace priv { template class _LimG { public: static float get_F_inf(); static float get_F_qNaN(); static float get_F_sNaN(); static float get_F_denormMin(); static double get_D_inf(); static double get_D_qNaN(); static double get_D_sNaN(); static double get_D_denormMin(); static long double get_LD_inf(); static long double get_LD_qNaN(); static long double get_LD_sNaN(); static long double get_LD_denormMin(); }; } template< > class numeric_limits : public ::std::priv:: _Floating_limits { public: static float ( min) () { return 1.175494351E-38F; } static float denorm_min() { return denorm_absent ? ::std::priv:: _LimG::get_F_denormMin() : 1.175494351E-38F; } static float ( max) () { return 3.402823466E+38F; } static float epsilon() { return 1.192092896E-07F; } static float round_error() { return 0.5f; } static float infinity() { return ::std::priv:: _LimG::get_F_inf(); } static float quiet_NaN() { return ::std::priv:: _LimG::get_F_qNaN(); } static float signaling_NaN() { return ::std::priv:: _LimG::get_F_sNaN(); } }; template< > class numeric_limits : public ::std::priv:: _Floating_limits { public: static double ( min)() { return 2.2250738585072014E-308; } static double denorm_min() { return denorm_absent ? ::std::priv:: _LimG::get_D_denormMin() : 2.2250738585072014E-308; } static double ( max)() { return 1.7976931348623157E+308; } static double epsilon() { return 2.2204460492503131E-16; } static double round_error() { return 0.5; } static double infinity() { return ::std::priv:: _LimG::get_D_inf(); } static double quiet_NaN() { return ::std::priv:: _LimG::get_D_qNaN(); } static double signaling_NaN() { return ::std::priv:: _LimG::get_D_sNaN(); } }; template< > class numeric_limits : public ::std::priv:: _Floating_limits { public: static long double ( min) () { return 2.2250738585072014E-308L; } static long double denorm_min() { return denorm_absent ? ::std::priv:: _LimG::get_LD_denormMin() : 2.2250738585072014E-308L; } static const __far bool is_iec559 = false; static long double ( max) () { return 1.7976931348623157E+308L; } static long double epsilon() { return 2.2204460492503131E-16L; } static long double round_error() { return 0.5l; } static long double infinity() { return ::std::priv:: _LimG::get_LD_inf(); } static long double quiet_NaN() { return ::std::priv:: _LimG::get_LD_qNaN(); } static long double signaling_NaN() { return ::std::priv:: _LimG::get_LD_sNaN(); } }; } namespace std { namespace priv { template const bool _Numeric_limits_base<__number> :: is_specialized; template const int _Numeric_limits_base<__number> :: digits; template const int _Numeric_limits_base<__number> :: digits10; template const bool _Numeric_limits_base<__number> :: is_signed; template const bool _Numeric_limits_base<__number> :: is_integer; template const bool _Numeric_limits_base<__number> :: is_exact; template const int _Numeric_limits_base<__number> :: radix; template const int _Numeric_limits_base<__number> :: min_exponent; template const int _Numeric_limits_base<__number> :: max_exponent; template const int _Numeric_limits_base<__number> :: min_exponent10; template const int _Numeric_limits_base<__number> :: max_exponent10; template const bool _Numeric_limits_base<__number> :: has_infinity; template const bool _Numeric_limits_base<__number> :: has_quiet_NaN; template const bool _Numeric_limits_base<__number> :: has_signaling_NaN; template const float_denorm_style _Numeric_limits_base<__number> :: has_denorm; template const bool _Numeric_limits_base<__number> :: has_denorm_loss; template const bool _Numeric_limits_base<__number> :: is_iec559; template const bool _Numeric_limits_base<__number> :: is_bounded; template const bool _Numeric_limits_base<__number> :: is_modulo; template const bool _Numeric_limits_base<__number> :: traps; template const bool _Numeric_limits_base<__number> :: tinyness_before; template const float_round_style _Numeric_limits_base<__number> :: round_style; template const bool _Integer_limits<_Int, __imin, __imax, __idigits, __ismod> :: is_specialized; template const int _Integer_limits<_Int, __imin, __imax, __idigits, __ismod> :: digits; template const int _Integer_limits<_Int, __imin, __imax, __idigits, __ismod> :: digits10; template const bool _Integer_limits<_Int, __imin, __imax, __idigits, __ismod> :: is_signed; template const bool _Integer_limits<_Int, __imin, __imax, __idigits, __ismod> :: is_integer; template const bool _Integer_limits<_Int, __imin, __imax, __idigits, __ismod> :: is_exact; template const int _Integer_limits<_Int, __imin, __imax, __idigits, __ismod> :: radix; template const bool _Integer_limits<_Int, __imin, __imax, __idigits, __ismod> :: is_bounded; template const bool _Integer_limits<_Int, __imin, __imax, __idigits, __ismod> :: is_modulo; template const bool _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: is_specialized; template const int _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: digits; template const int _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: digits10; template const bool _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: is_signed; template const int _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: radix; template const int _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: min_exponent; template const int _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: max_exponent; template const int _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: min_exponent10; template const int _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: max_exponent10; template const bool _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: has_infinity; template const bool _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: has_quiet_NaN; template const bool _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: has_signaling_NaN; template const float_denorm_style _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: has_denorm; template const bool _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: has_denorm_loss; template const bool _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: is_iec559; template const bool _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: is_bounded; template const bool _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: traps; template const bool _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: tinyness_before; template const float_round_style _Floating_limits< __number, __Digits, __Digits10, __MinExp, __MaxExp, __MinExp10, __MaxExp10, __IsIEC559, __DenormStyle, __RoundStyle> :: round_style; template struct float_helper { union _WordsNumber { unsigned short _Words[8]; _Number _num; }; static _Number get_word_higher() { _WordsNumber __tmp = { _Word, 0, 0, 0, 0, 0, 0, 0 }; return __tmp._num; } static _Number get_word_lower() { _WordsNumber __tmp = { 0, 0, 0, 0, 0, 0, 0, 0 }; __tmp._Words[(sizeof(_Number) >= 12 ? 10 : sizeof(_Number)) / sizeof(unsigned short) - 1] = _Word; return __tmp._num; } static _Number get_from_last_word() { return get_word_lower(); } static _Number get_from_first_word() { return get_word_higher(); } }; template struct float_helper2 { union _WordsNumber { unsigned short _Words[8]; _Number _num; }; static _Number get_word_lower() { _WordsNumber __tmp = { 0, 0, 0, 0, 0, 0, 0, 0 }; __tmp._Words[(sizeof(_Number) >= 12 ? 10 : sizeof(_Number)) / sizeof(unsigned short) - 2] = _Word1; __tmp._Words[(sizeof(_Number) >= 12 ? 10 : sizeof(_Number)) / sizeof(unsigned short) - 1] = _Word2; return __tmp._num; } static _Number get_from_last_word() { return get_word_lower(); } }; template float _LimG<__dummy>::get_F_inf() { typedef float_helper _FloatHelper; return _FloatHelper::get_from_last_word(); } template float _LimG<__dummy>::get_F_qNaN() { typedef float_helper _FloatHelper; return _FloatHelper::get_from_last_word(); } template float _LimG<__dummy>::get_F_sNaN() { typedef float_helper _FloatHelper; return _FloatHelper::get_from_last_word(); } template float _LimG<__dummy>::get_F_denormMin() { typedef float_helper _FloatHelper; return _FloatHelper::get_from_first_word(); } template class _NumericLimitsAccess; template< > class _NumericLimitsAccess<1> { public: static double get_inf() { typedef float_helper _FloatHelper; return _FloatHelper::get_from_last_word(); } static double get_qNaN() { typedef float_helper _FloatHelper; return _FloatHelper::get_from_last_word(); } static double get_sNaN() { typedef float_helper _FloatHelper; return _FloatHelper::get_from_last_word(); } }; template double _LimG<__dummy>::get_D_inf() { return _NumericLimitsAccess<1>::get_inf(); } template double _LimG<__dummy>::get_D_qNaN() { return _NumericLimitsAccess<1>::get_qNaN(); } template double _LimG<__dummy>::get_D_sNaN() { return _NumericLimitsAccess<1>::get_sNaN(); } template double _LimG<__dummy>::get_D_denormMin() { typedef float_helper _FloatHelper; return _FloatHelper::get_from_first_word(); } template< > class _NumericLimitsAccess<0> { public: static long double get_inf() { typedef float_helper2 _FloatHelper; return _FloatHelper::get_from_last_word(); } static long double get_qNaN() { typedef float_helper2 _FloatHelper; return _FloatHelper::get_from_last_word(); } static long double get_sNaN() { typedef float_helper2 _FloatHelper; return _FloatHelper::get_from_last_word(); } }; template long double _LimG<__dummy>::get_LD_inf() { const int __use_double_limits = sizeof(double) == sizeof(long double) ? 1 : 0; return _NumericLimitsAccess<__use_double_limits>::get_inf(); } template long double _LimG<__dummy>::get_LD_qNaN() { const int __use_double_limits = sizeof(double) == sizeof(long double) ? 1 : 0; return _NumericLimitsAccess<__use_double_limits>::get_qNaN(); } template long double _LimG<__dummy>::get_LD_sNaN() { const int __use_double_limits = sizeof(double) == sizeof(long double) ? 1 : 0; return _NumericLimitsAccess<__use_double_limits>::get_sNaN(); } template long double _LimG<__dummy>::get_LD_denormMin() { typedef float_helper _FloatHelper; return _FloatHelper::get_from_first_word(); } } } namespace std { namespace priv { template _OutputIter __copy_float_and_fill(const _CharT* __first, const _CharT* __last, _OutputIter __oi, ios_base::fmtflags __flags, streamsize __width, _CharT __fill, _CharT __xplus, _CharT __xminus) { if (__width <= __last - __first) return ::std::copy(__first, __last, __oi); else { streamsize __pad = __width - (__last - __first); ios_base::fmtflags __dir = __flags & ios_base::adjustfield; if (__dir == ios_base::left) { __oi = ::std::copy(__first, __last, __oi); return ::std::priv:: __fill_n(__oi, __pad, __fill); } else if (__dir == ios_base::internal && __first != __last && (*__first == __xplus || *__first == __xminus)) { *__oi++ = *__first++; __oi = ::std::priv:: __fill_n(__oi, __pad, __fill); return ::std::copy(__first, __last, __oi); } else { __oi = ::std::priv:: __fill_n(__oi, __pad, __fill); return ::std::copy(__first, __last, __oi); } } } template _OutputIter __put_float(__iostring &__str, _OutputIter __oi, ios_base& __f, wchar_t __fill, wchar_t __decimal_point, wchar_t __sep, size_t __group_pos, const string& __grouping) { const ctype& __ct = use_facet >(__f.getloc()); __iowstring __wbuf; __convert_float_buffer(__str, __wbuf, __ct, __decimal_point); if (!__grouping.empty()) { __insert_grouping(__wbuf, __group_pos, __grouping, __sep, __ct.widen('+'), __ct.widen('-'), 0); } return __copy_float_and_fill(__wbuf.data(), __wbuf.data() + __wbuf.size(), __oi, __f.flags(), __f.width(0), __fill, __ct.widen('+'), __ct.widen('-')); } template _OutputIter __put_float(__iostring &__str, _OutputIter __oi, ios_base& __f, char __fill, char __decimal_point, char __sep, size_t __group_pos, const string& __grouping) { if ((__group_pos < __str.size()) && (__str[__group_pos] == '.')) { __str[__group_pos] = __decimal_point; } if (!__grouping.empty()) { __insert_grouping(__str, __group_pos, __grouping, __sep, '+', '-', 0); } return __copy_float_and_fill(__str.data(), __str.data() + __str.size(), __oi, __f.flags(), __f.width(0), __fill, '+', '-'); } template _OutputIter __do_put_float(_OutputIter __s, ios_base& __f, _CharT __fill, _Float __x) { __iostring __buf; size_t __group_pos = __write_float(__buf, __f.flags(), (int)__f.precision(), __x); const numpunct<_CharT>& __np = use_facet >(__f.getloc()); return __put_float(__buf, __s, __f, __fill, __np.decimal_point(), __np.thousands_sep(), __group_pos, __np.grouping()); } inline void __get_money_digits_aux (__iostring &__buf, ios_base &, long double __x) { __get_floor_digits(__buf, __x); } inline void __get_money_digits_aux (__iowstring &__wbuf, ios_base &__f, long double __x) { __iostring __buf; __get_floor_digits(__buf, __x); const ctype& __ct = use_facet >(__f.getloc()); __convert_float_buffer(__buf, __wbuf, __ct, wchar_t(0), false); } template void __get_money_digits(::std::priv:: __basic_iostring<_CharT> &__buf, ios_base& __f, long double __x) { __get_money_digits_aux(__buf, __f, __x); } template _OutputIter __copy_integer_and_fill(const _CharT* __buf, ptrdiff_t __len, _OutputIter __oi, ios_base::fmtflags __flg, streamsize __wid, _CharT __fill, _CharT __xplus, _CharT __xminus) { if (__len >= __wid) return ::std::copy(__buf, __buf + __len, __oi); else { typedef char __static_assert[(sizeof(streamsize) > sizeof(ptrdiff_t)) || ((sizeof(streamsize) == sizeof(ptrdiff_t)) && numeric_limits ::is_signed) ? 1 : -1]; ptrdiff_t __pad = static_cast((min) (static_cast((numeric_limits ::max)()), static_cast(__wid - __len))); ios_base::fmtflags __dir = __flg & ios_base::adjustfield; if (__dir == ios_base::left) { __oi = ::std::copy(__buf, __buf + __len, __oi); return ::std::priv:: __fill_n(__oi, __pad, __fill); } else if (__dir == ios_base::internal && __len != 0 && (__buf[0] == __xplus || __buf[0] == __xminus)) { *__oi++ = __buf[0]; __oi = __fill_n(__oi, __pad, __fill); return ::std::copy(__buf + 1, __buf + __len, __oi); } else if (__dir == ios_base::internal && __len >= 2 && (__flg & ios_base::showbase) && (__flg & ios_base::basefield) == ios_base::hex) { *__oi++ = __buf[0]; *__oi++ = __buf[1]; __oi = __fill_n(__oi, __pad, __fill); return ::std::copy(__buf + 2, __buf + __len, __oi); } else { __oi = __fill_n(__oi, __pad, __fill); return ::std::copy(__buf, __buf + __len, __oi); } } } template _OutputIter __put_integer(char* __buf, char* __iend, _OutputIter __s, ios_base& __f, ios_base::fmtflags __flags, wchar_t __fill) { locale __loc = __f.getloc(); const ctype& __ct = use_facet >(__loc); wchar_t __xplus = __ct.widen('+'); wchar_t __xminus = __ct.widen('-'); wchar_t __wbuf[64]; __ct.widen(__buf, __iend, __wbuf); ptrdiff_t __len = __iend - __buf; wchar_t* __eend = __wbuf + __len; const numpunct& __np = use_facet >(__loc); const string& __grouping = __np.grouping(); if (!__grouping.empty()) { int __basechars; if (__flags & ios_base::showbase) switch (__flags & ios_base::basefield) { case ios_base::hex: __basechars = 2; break; case ios_base::oct: __basechars = 1; break; default: __basechars = 0; } else __basechars = 0; __len = __insert_grouping(__wbuf, __eend, __grouping, __np.thousands_sep(), __xplus, __xminus, __basechars); } return __copy_integer_and_fill((wchar_t*)__wbuf, __len, __s, __flags, __f.width(0), __fill, __xplus, __xminus); } template _OutputIter __put_integer(char* __buf, char* __iend, _OutputIter __s, ios_base& __f, ios_base::fmtflags __flags, char __fill) { char __grpbuf[64]; ptrdiff_t __len = __iend - __buf; const numpunct& __np = use_facet >(__f.getloc()); const string& __grouping = __np.grouping(); if (!__grouping.empty()) { int __basechars; if (__flags & ios_base::showbase) switch (__flags & ios_base::basefield) { case ios_base::hex: __basechars = 2; break; case ios_base::oct: __basechars = 1; break; default: __basechars = 0; } else __basechars = 0; ::std::copy(__buf, __iend, (char *) __grpbuf); __buf = __grpbuf; __iend = __grpbuf + __len; __len = __insert_grouping(__buf, __iend, __grouping, __np.thousands_sep(), '+', '-', __basechars); } return __copy_integer_and_fill(__buf, __len, __s, __flags, __f.width(0), __fill, '+', '-'); } typedef long long __max_int_t; typedef unsigned long long __umax_int_t; const char* __hex_char_table_lo(); const char* __hex_char_table_hi(); template inline char* __write_decimal_backward(char* __ptr, _Integer __x, ios_base::fmtflags __flags, const __true_type& ) { const bool __negative = __x < 0 ; __max_int_t __temp = __x; __umax_int_t __utemp = __negative?-__temp:__temp; for (; __utemp != 0; __utemp /= 10) *--__ptr = (char)((int)(__utemp % 10) + '0'); if (__negative) *--__ptr = '-'; else if (__flags & ios_base::showpos) *--__ptr = '+'; return __ptr; } template inline char* __write_decimal_backward(char* __ptr, _Integer __x, ios_base::fmtflags __flags, const __false_type& ) { for (; __x != 0; __x /= 10) *--__ptr = (char)((int)(__x % 10) + '0'); if (__flags & ios_base::showpos) *--__ptr = '+'; return __ptr; } template char* __write_integer_backward(char* __buf, ios_base::fmtflags __flags, _Integer __x) { char* __ptr = __buf; if (__x == 0) { *--__ptr = '0'; if ((__flags & ios_base::showpos) && ((__flags & (ios_base::oct | ios_base::hex)) == 0)) *--__ptr = '+'; } else { switch (__flags & ios_base::basefield) { case ios_base::oct: { __umax_int_t __temp = __x; if ( sizeof(__x) < 8 && sizeof(__umax_int_t) >= 8 ) __temp &= 0xFFFFFFFF; for (; __temp != 0; __temp >>=3) *--__ptr = (char)((((unsigned)__temp)& 0x7) + '0'); if (__flags & ios_base::showbase) *--__ptr = '0'; } break; case ios_base::hex: { const char* __table_ptr = (__flags & ios_base::uppercase) ? __hex_char_table_hi() : __hex_char_table_lo(); __umax_int_t __temp = __x; if ( sizeof(__x) < 8 && sizeof(__umax_int_t) >= 8 ) __temp &= 0xFFFFFFFF; for (; __temp != 0; __temp >>=4) *--__ptr = __table_ptr[((unsigned)__temp & 0xF)]; if (__flags & ios_base::showbase) { *--__ptr = __table_ptr[16]; *--__ptr = '0'; } } break; default: { typedef typename __bool2type::is_signed>::_Ret _IsSigned; __ptr = __write_decimal_backward(__ptr, __x, __flags, _IsSigned()); } break; } } return __ptr; } template _OutputIter __do_put_integer(_OutputIter __s, ios_base& __f, _CharT __fill, _Integer __x) { char __buf[sizeof(_Integer) * 3 + 2]; const ptrdiff_t __buf_size = sizeof(__buf) / sizeof(char); ios_base::fmtflags __flags = __f.flags(); char* __ibeg = __write_integer_backward((char*)__buf + __buf_size, __flags, __x); return __put_integer(__ibeg, (char*)__buf + __buf_size, __s, __f, __flags, __fill); } template _OutputIter __do_put_bool(_OutputIter __s, ios_base& __f, _CharT __fill, bool __x) { const numpunct<_CharT>& __np = use_facet >(__f.getloc()); basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> > __str = __x ? __np.truename() : __np.falsename(); streamsize __wid = __f.width(0); if (__str.size() >= static_cast(__wid)) return ::std::copy(__str.begin(), __str.end(), __s); else { streamsize __pad = __wid - __str.size(); ios_base::fmtflags __dir = __f.flags() & ios_base::adjustfield; if (__dir == ios_base::left) { __s = ::std::copy(__str.begin(), __str.end(), __s); return __fill_n(__s, __pad, __fill); } else { __s = __fill_n(__s, __pad, __fill); return ::std::copy(__str.begin(), __str.end(), __s); } } } } template locale::id num_put<_CharT, _OutputIterator>::id; template _OutputIter num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT __fill, bool __val) const { if (!(__f.flags() & ios_base::boolalpha)) return do_put(__s, __f, __fill, static_cast(__val)); return ::std::priv:: __do_put_bool(__s, __f, __fill, __val); } template _OutputIter num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long __val) const { return ::std::priv:: __do_put_integer(__s, __f, __fill, __val); } template _OutputIter num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT __fill, unsigned long __val) const { return ::std::priv:: __do_put_integer(__s, __f, __fill, __val); } template _OutputIter num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT __fill, double __val) const { return ::std::priv:: __do_put_float(__s, __f, __fill, __val); } template _OutputIter num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long double __val) const { return ::std::priv:: __do_put_float(__s, __f, __fill, __val); } template _OutputIter num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT __fill, long long __val) const { return ::std::priv:: __do_put_integer(__s, __f, __fill, __val); } template _OutputIter num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT __fill, unsigned long long __val) const { return ::std::priv:: __do_put_integer(__s, __f, __fill, __val); } template _OutputIter num_put<_CharT, _OutputIter>::do_put(_OutputIter __s, ios_base& __f, _CharT , const void* __val) const { const ctype<_CharT>& __c_type = use_facet >(__f.getloc()); ios_base::fmtflags __save_flags = __f.flags(); __f.setf(ios_base::hex, ios_base::basefield); __f.setf(ios_base::showbase); __f.setf(ios_base::internal, ios_base::adjustfield); __f.width((sizeof(void*) * 2) + 2); if ( __val == 0 ) { const char* __table_ptr = (__save_flags & ios_base::uppercase) ? ::std::priv:: __hex_char_table_hi() : ::std::priv:: __hex_char_table_lo(); *(__s++) = __c_type.widen( '0' ); *(__s++) = __c_type.widen( __table_ptr[16] ); __f.width((sizeof(void*) * 2)); } else { __f.width((sizeof(void*) * 2) + 2); } _OutputIter result = ( sizeof(void*) == sizeof(unsigned long) ) ? ::std::priv:: __do_put_integer(__s, __f, __c_type.widen('0'), reinterpret_cast(__val)) : ::std::priv:: __do_put_integer(__s, __f, __c_type.widen('0'), reinterpret_cast(__val)) ; __f.flags(__save_flags); return result; } } namespace std { template basic_ostream<_CharT, _Traits>::basic_ostream(basic_streambuf<_CharT, _Traits>* __buf) : basic_ios<_CharT, _Traits>() { this->init(__buf); } template basic_ostream<_CharT, _Traits>::~basic_ostream() {} template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<_CharT, _Traits>* __from) { sentry __sentry(*this); if (__sentry) { if (__from) { bool __any_inserted = __from->gptr() != __from->egptr() ? this->_M_copy_buffered(__from, this->rdbuf()) : this->_M_copy_unbuffered(__from, this->rdbuf()); if (!__any_inserted) this->setstate(ios_base::failbit); } else this->setstate(ios_base::badbit); } return *this; } template bool basic_ostream<_CharT, _Traits> ::_M_copy_buffered(basic_streambuf<_CharT, _Traits>* __from, basic_streambuf<_CharT, _Traits>* __to) { bool __any_inserted = false; while (__from->egptr() != __from->gptr()) { const ptrdiff_t __avail = __from->egptr() - __from->gptr(); streamsize __nwritten; { __nwritten = __to->sputn(__from->gptr(), __avail); __from->gbump((int)__nwritten); } if (false) { this->_M_handle_exception(ios_base::badbit); return __any_inserted; } if (__nwritten == __avail) { { if (this->_S_eof(__from->sgetc())) return true; else __any_inserted = true; } if (false) { this->_M_handle_exception(ios_base::failbit); return false; } } else if (__nwritten != 0) return true; else return __any_inserted; } return __any_inserted || this->_M_copy_unbuffered(__from, __to); } template struct _SPutBackC { typedef basic_streambuf<_CharT, _Traits> _StreamBuf; typedef typename _StreamBuf::int_type int_type; _SPutBackC(_StreamBuf *pfrom) : __pfrom(pfrom), __c(0), __do_guard(false) {} ~_SPutBackC() { if (__do_guard) { __pfrom->sputbackc(_Traits::to_char_type(__c)); } } void guard(int_type c) { __c = c; __do_guard = true; } void release() { __do_guard = false; } private: _StreamBuf *__pfrom; int_type __c; bool __do_guard; }; template bool basic_ostream<_CharT, _Traits> ::_M_copy_unbuffered(basic_streambuf<_CharT, _Traits>* __from, basic_streambuf<_CharT, _Traits>* __to) { typedef _SPutBackC<_CharT, _Traits> _SPutBackCGuard; bool __any_inserted = false; int_type __c; { _SPutBackCGuard __cguard(__from); for (;;) { { __c = __from->sbumpc(); } if (false) { this->_M_handle_exception(ios_base::failbit); break; } if (this->_S_eof(__c)) break; __cguard.guard(__c); if (this->_S_eof(__to->sputc(_Traits::to_char_type(__c)))) break; __cguard.release(); __any_inserted = true; } } if (false) { this->_M_handle_exception(ios_base::badbit); } return __any_inserted; } namespace priv { template basic_ostream<_CharT, _Traits>& __put_num(basic_ostream<_CharT, _Traits>& __os, _Number __x) { typedef typename basic_ostream<_CharT, _Traits>::sentry _Sentry; _Sentry __sentry(__os); bool __failed = true; if (__sentry) { { typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> > _NumPut; __failed = (use_facet<_NumPut>(__os.getloc())).put(ostreambuf_iterator<_CharT, _Traits>(__os.rdbuf()), __os, __os.fill(), __x).failed(); } if (false) { __os._M_handle_exception(ios_base::badbit); } } if (__failed) __os.setstate(ios_base::badbit); return __os; } } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(short __x) { typedef char __static_assert[sizeof(short) <= sizeof(long) ? 1 : -1]; long __tmp = ((this->flags() & _Basic_ios::basefield) != ios_base::dec) ? static_cast(static_cast(__x)): __x; return ::std::priv:: __put_num(*this, __tmp); } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(unsigned short __x) { typedef char __static_assert[sizeof(unsigned short) <= sizeof(unsigned long) ? 1 : -1]; return ::std::priv:: __put_num(*this, static_cast(__x)); } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(int __x) { typedef char __static_assert[sizeof(int) <= sizeof(long) ? 1 : -1]; long __tmp = ((this->flags() & _Basic_ios::basefield) != ios_base::dec) ? static_cast(static_cast(__x)): __x; return ::std::priv:: __put_num(*this, __tmp); } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(unsigned int __x) { typedef char __static_assert[sizeof(unsigned int) <= sizeof(unsigned long) ? 1 : -1]; return ::std::priv:: __put_num(*this, static_cast(__x)); } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(long __x) { return ::std::priv:: __put_num(*this, __x); } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(unsigned long __x) { return ::std::priv:: __put_num(*this, __x); } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<< (long long __x) { return ::std::priv:: __put_num(*this, __x); } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<< (unsigned long long __x) { return ::std::priv:: __put_num(*this, __x); } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(float __x) { return ::std::priv:: __put_num(*this, static_cast(__x)); } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(double __x) { return ::std::priv:: __put_num(*this, __x); } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(long double __x) { return ::std::priv:: __put_num(*this, __x); } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(const void* __x) { return ::std::priv:: __put_num(*this, __x); } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::operator<<(bool __x) { return ::std::priv:: __put_num(*this, __x); } template void basic_ostream<_CharT, _Traits>::_M_put_char(_CharT __c) { sentry __sentry(*this); if (__sentry) { bool __failed = true; { streamsize __npad = this->width() > 0 ? this->width() - 1 : 0; if (__npad == 0) __failed = this->_S_eof(this->rdbuf()->sputc(__c)); else if ((this->flags() & ios_base::adjustfield) == ios_base::left) { __failed = this->_S_eof(this->rdbuf()->sputc(__c)); __failed = __failed || this->rdbuf()->_M_sputnc(this->fill(), __npad) != __npad; } else { __failed = this->rdbuf()->_M_sputnc(this->fill(), __npad) != __npad; __failed = __failed || this->_S_eof(this->rdbuf()->sputc(__c)); } this->width(0); } if (false) { this->_M_handle_exception(ios_base::badbit); } if (__failed) this->setstate(ios_base::badbit); } } template void basic_ostream<_CharT, _Traits>::_M_put_nowiden(const _CharT* __s) { sentry __sentry(*this); if (__sentry) { bool __failed = true; streamsize __n = _Traits::length(__s); streamsize __npad = this->width() > __n ? this->width() - __n : 0; { if (__npad == 0) __failed = this->rdbuf()->sputn(__s, __n) != __n; else if ((this->flags() & ios_base::adjustfield) == ios_base::left) { __failed = this->rdbuf()->sputn(__s, __n) != __n; __failed = __failed || this->rdbuf()->_M_sputnc(this->fill(), __npad) != __npad; } else { __failed = this->rdbuf()->_M_sputnc(this->fill(), __npad) != __npad; __failed = __failed || this->rdbuf()->sputn(__s, __n) != __n; } this->width(0); } if (false) { this->_M_handle_exception(ios_base::badbit); } if (__failed) this->setstate(ios_base::failbit); } } template void basic_ostream<_CharT, _Traits>::_M_put_widen(const char* __s) { sentry __sentry(*this); if (__sentry) { bool __failed = true; streamsize __n = char_traits::length(__s); streamsize __npad = this->width() > __n ? this->width() - __n : 0; { if (__npad == 0) __failed = !this->_M_put_widen_aux(__s, __n); else if ((this->flags() & ios_base::adjustfield) == ios_base::left) { __failed = !this->_M_put_widen_aux(__s, __n); __failed = __failed || this->rdbuf()->_M_sputnc(this->fill(), __npad) != __npad; } else { __failed = this->rdbuf()->_M_sputnc(this->fill(), __npad) != __npad; __failed = __failed || !this->_M_put_widen_aux(__s, __n); } this->width(0); } if (false) { this->_M_handle_exception(ios_base::badbit); } if (__failed) this->setstate(ios_base::failbit); } } template bool basic_ostream<_CharT, _Traits>::_M_put_widen_aux(const char* __s, streamsize __n) { basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); for ( ; __n > 0 ; --__n) if (this->_S_eof(__buf->sputc(this->widen(*__s++)))) return false; return true; } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::put(char_type __c) { sentry __sentry(*this); bool __failed = true; if (__sentry) { { __failed = this->_S_eof(this->rdbuf()->sputc(__c)); } if (false) { this->_M_handle_exception(ios_base::badbit); } } if (__failed) this->setstate(ios_base::badbit); return *this; } template basic_ostream<_CharT, _Traits>& basic_ostream<_CharT, _Traits>::write(const char_type* __s, streamsize __n) { sentry __sentry(*this); bool __failed = true; if (__sentry) { { __failed = this->rdbuf()->sputn(__s, __n) != __n; } if (false) { this->_M_handle_exception(ios_base::badbit); } } if (__failed) this->setstate(ios_base::badbit); return *this; } } namespace std { template extern basic_streambuf<_CharT, _Traits>* _M_get_istreambuf(basic_istream<_CharT, _Traits>& ) ; template class istreambuf_iterator : public iterator { public: typedef _CharT char_type; typedef _Traits traits_type; typedef typename _Traits::int_type int_type; typedef basic_streambuf<_CharT, _Traits> streambuf_type; typedef basic_istream<_CharT, _Traits> istream_type; typedef input_iterator_tag iterator_category; typedef _CharT value_type; typedef typename _Traits::off_type difference_type; typedef const _CharT* pointer; typedef const _CharT& reference; public: istreambuf_iterator(streambuf_type* __p = 0) { this->_M_init(__p); } inline istreambuf_iterator(basic_istream<_CharT, _Traits>& __is); char_type operator*() const { this->_M_getc(); return _M_c; } istreambuf_iterator<_CharT, _Traits>& operator++() { _M_buf->sbumpc(); _M_have_c = false; return *this; } istreambuf_iterator<_CharT, _Traits> operator++(int); bool equal(const istreambuf_iterator<_CharT, _Traits>& __i) const { if (this->_M_buf) this->_M_getc(); if (__i._M_buf) __i._M_getc(); return this->_M_eof == __i._M_eof; } private: void _M_init(streambuf_type* __p) { _M_buf = __p; _M_eof = (__p == 0); _M_have_c = false; } void _M_getc() const { if (_M_have_c) return; int_type __c = _M_buf->sgetc(); _M_c = traits_type::to_char_type(__c); _M_eof = traits_type::eq_int_type(__c, traits_type::eof()); _M_have_c = true; } private: streambuf_type* _M_buf; mutable _CharT _M_c; mutable bool _M_eof; mutable bool _M_have_c; }; template inline istreambuf_iterator<_CharT, _Traits>::istreambuf_iterator(basic_istream<_CharT, _Traits>& __is) { this->_M_init(_M_get_istreambuf(__is)); } template inline bool operator==(const istreambuf_iterator<_CharT, _Traits>& __x, const istreambuf_iterator<_CharT, _Traits>& __y) { return __x.equal(__y); } template inline bool operator!=(const istreambuf_iterator<_CharT, _Traits>& __x, const istreambuf_iterator<_CharT, _Traits>& __y) { return !__x.equal(__y); } template istreambuf_iterator<_CharT, _Traits> istreambuf_iterator<_CharT, _Traits>::operator++(int) { _M_getc(); istreambuf_iterator<_CharT, _Traits> __tmp = *this; _M_buf->sbumpc(); _M_have_c = false; return __tmp; } } namespace std { struct _No_Skip_WS {}; template bool _M_init_skip(basic_istream<_CharT, _Traits>& __istr); template bool _M_init_noskip(basic_istream<_CharT, _Traits>& __istr); template class basic_istream : virtual public basic_ios<_CharT, _Traits> { typedef basic_istream<_CharT, _Traits> _Self; public: typedef _CharT char_type; typedef typename _Traits::int_type int_type; typedef typename _Traits::pos_type pos_type; typedef typename _Traits::off_type off_type; typedef _Traits traits_type; typedef basic_ios<_CharT, _Traits> _Basic_ios; typedef basic_ios<_CharT, _Traits>& ( *__ios_fn)(basic_ios<_CharT, _Traits>&); typedef ios_base& ( *__ios_base_fn)(ios_base&); typedef _Self& ( *__istream_fn)(_Self&); public: explicit basic_istream(basic_streambuf<_CharT, _Traits>* __buf) : basic_ios<_CharT, _Traits>(), _M_gcount(0) { this->init(__buf); } explicit basic_istream(ios_base::_SpecialInitType __i) : basic_ios<_CharT, _Traits>(__i) { } ~basic_istream() {}; public: public: _Self& operator>> (__istream_fn __f) { return __f(*this); } _Self& operator>> (__ios_fn __f) { __f(*this); return *this; } _Self& operator>> (__ios_base_fn __f) { __f(*this); return *this; } public: _Self& operator>> (short& __val); _Self& operator>> (int& __val); _Self& operator>> (unsigned short& __val); _Self& operator>> (unsigned int& __val); _Self& operator>> (long& __val); _Self& operator>> (unsigned long& __val); _Self& operator>> (long long& __val); _Self& operator>> (unsigned long long& __val); _Self& operator>> (float& __val); _Self& operator>> (double& __val); _Self& operator>> (long double& __val); _Self& operator>> (bool& __val); _Self& operator>> (void*& __val); public: _Self& operator>>(basic_streambuf<_CharT, _Traits>*); public: streamsize gcount() const { return _M_gcount; } int_type peek(); public: int_type get(); _Self& get(char_type& __c); public: _Self& get(char_type* __s, streamsize __n, char_type __delim); _Self& get(char_type* __s, streamsize __n) { return get(__s, __n, this->widen('\n')); } public: _Self& get(basic_streambuf<_CharT, _Traits>& __buf, char_type __delim); _Self& get(basic_streambuf<_CharT, _Traits>& __buf) { return get(__buf, this->widen('\n')); } public: _Self& getline(char_type* __s, streamsize __n, char_type delim); _Self& getline(char_type* __s, streamsize __n) { return getline(__s, __n, this->widen('\n')); } public: _Self& ignore(); _Self& ignore(streamsize __n); _Self& ignore(streamsize __n, int_type __delim); _Self& read(char_type* __s, streamsize __n); streamsize readsome(char_type* __s, streamsize __n); public: _Self& putback(char_type __c); _Self& unget(); public: int sync(); pos_type tellg(); _Self& seekg(pos_type __pos); _Self& seekg(off_type, ios_base::seekdir); public: void _M_formatted_get(_CharT& __c); void _M_formatted_get(_CharT* __s); void _M_skip_whitespace(bool __set_failbit); private: streamsize _M_gcount; public: class sentry { typedef sentry _Self; private: const bool _M_ok; public: typedef _Traits traits_type; explicit sentry(basic_istream<_CharT, _Traits>& __istr, bool __noskipws = false) : _M_ok((__noskipws || !(__istr.flags() & ios_base::skipws)) ? _M_init_noskip(__istr) : _M_init_skip(__istr) ) {} sentry(basic_istream<_CharT, _Traits>& __istr, _No_Skip_WS) : _M_ok(_M_init_noskip(__istr)) {} ~sentry() {} operator bool() const { return _M_ok; } private: sentry(const _Self&) : _M_ok(false) {} _Self& operator=(const _Self&) { return *this; } }; }; template inline basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __in_str, _CharT& __c) { __in_str._M_formatted_get(__c); return __in_str; } template inline basic_istream& operator>>(basic_istream& __in_str, unsigned char& __c) { __in_str._M_formatted_get(reinterpret_cast(__c)); return __in_str; } template inline basic_istream& operator>>(basic_istream& __in_str, signed char& __c) { __in_str._M_formatted_get(reinterpret_cast(__c)); return __in_str; } template inline basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __in_str, _CharT* __s) { __in_str._M_formatted_get(__s); return __in_str; } template inline basic_istream& operator>>(basic_istream& __in_str, unsigned char* __s) { __in_str._M_formatted_get(reinterpret_cast(__s)); return __in_str; } template inline basic_istream& operator>>(basic_istream& __in_str, signed char* __s) { __in_str._M_formatted_get(reinterpret_cast(__s)); return __in_str; } template basic_istream<_CharT, _Traits>& ws(basic_istream<_CharT, _Traits>& __istr) { if (!__istr.eof()) { typedef typename basic_istream<_CharT, _Traits>::sentry _Sentry; _Sentry __sentry(__istr, _No_Skip_WS()); if (__sentry) __istr._M_skip_whitespace(false); } return __istr; } template inline bool _M_init_skip(basic_istream<_CharT, _Traits>& __istr) { if (__istr.good()) { if (__istr.tie()) __istr.tie()->flush(); __istr._M_skip_whitespace(true); } if (!__istr.good()) { __istr.setstate(ios_base::failbit); return false; } else return true; } template inline bool _M_init_noskip(basic_istream<_CharT, _Traits>& __istr) { if (__istr.good()) { if (__istr.tie()) __istr.tie()->flush(); if (!__istr.rdbuf()) __istr.setstate(ios_base::badbit); } else __istr.setstate(ios_base::failbit); return __istr.good(); } template class basic_iostream : public basic_istream<_CharT, _Traits>, public basic_ostream<_CharT, _Traits> { public: typedef basic_ios<_CharT, _Traits> _Basic_ios; explicit basic_iostream(basic_streambuf<_CharT, _Traits>* __buf); virtual ~basic_iostream(); }; template basic_streambuf<_CharT, _Traits>* _M_get_istreambuf(basic_istream<_CharT, _Traits>& __istr) { return __istr.rdbuf(); } } namespace std { template class num_get: public locale::facet { public: typedef _CharT char_type; typedef _InputIter iter_type; explicit num_get(size_t __refs = 0): locale::facet(__refs) {} _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, bool& __val) const { return do_get(__ii, __end, __str, __err, __val); } _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, long& __val) const { return do_get(__ii, __end, __str, __err, __val); } _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, unsigned short& __val) const { return do_get(__ii, __end, __str, __err, __val); } _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, unsigned int& __val) const { return do_get(__ii, __end, __str, __err, __val); } _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, unsigned long& __val) const { return do_get(__ii, __end, __str, __err, __val); } _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, long long& __val) const { return do_get(__ii, __end, __str, __err, __val); } _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, unsigned long long& __val) const { return do_get(__ii, __end, __str, __err, __val); } _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, float& __val) const { return do_get(__ii, __end, __str, __err, __val); } _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, double& __val) const { return do_get(__ii, __end, __str, __err, __val); } _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, long double& __val) const { return do_get(__ii, __end, __str, __err, __val); } _InputIter get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, void*& __val) const { return do_get(__ii, __end, __str, __err, __val); } static __far locale::id id; protected: ~num_get() {} typedef string string_type; typedef ctype<_CharT> _Ctype; typedef numpunct<_CharT> _Numpunct; virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, bool& __val) const; virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, long& __val) const; virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, unsigned short& __val) const; virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, unsigned int& __val) const; virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, unsigned long& __val) const; virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, float& __val) const; virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, double& __val) const; virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, void*& __p) const; virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, long double& __val) const; virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, long long& __val) const; virtual _InputIter do_get(_InputIter __ii, _InputIter __end, ios_base& __str, ios_base::iostate& __err, unsigned long long& __val) const; }; namespace priv { bool __valid_grouping(const char*, const char*, const char*, const char*); template bool __get_decimal_integer(_InputIter& __first, _InputIter& __last, _Integer& __val, _CharT*); bool __get_fdigit(wchar_t&, const wchar_t*); bool __get_fdigit_or_sep(wchar_t&, wchar_t, const wchar_t*); inline void _Initialize_get_float(const ctype&, char& Plus, char& Minus, char& pow_e, char& pow_E, char*) { Plus = '+'; Minus = '-'; pow_e = 'e'; pow_E = 'E'; } void _Initialize_get_float(const ctype&, wchar_t&, wchar_t&, wchar_t&, wchar_t&, wchar_t*); void __string_to_float(const __iostring&, float&); void __string_to_float(const __iostring&, double&); void __string_to_float(const __iostring&, long double&); } } namespace std { namespace priv { unsigned char __digit_val_table(unsigned); const char* __narrow_atoms(); inline bool __get_fdigit(char __c, const char*) { return __c >= '0' && __c <= '9'; } inline bool __get_fdigit_or_sep(char& __c, char __sep, const char *__digits) { if (__c == __sep) { __c = ',' ; return true ; } else return __get_fdigit(__c, __digits); } inline int __get_digit_from_table(unsigned __index) { return (__index > 127 ? 0xFF : __digit_val_table(__index)); } template int __get_base_or_zero(_InputIter& __in_ite, _InputIter& __end, ios_base::fmtflags __flags, const ctype<_CharT>& __c_type) { _CharT __atoms[5]; __c_type.widen(__narrow_atoms(), __narrow_atoms() + 5, __atoms); bool __negative = false; _CharT __c = *__in_ite; if (__c == __atoms[1] ) { __negative = true; ++__in_ite; } else if (__c == __atoms[0] ) ++__in_ite; int __base; int __valid_zero = 0; ios_base::fmtflags __basefield = __flags & ios_base::basefield; switch (__basefield) { case ios_base::oct: __base = 8; break; case ios_base::dec: __base = 10; break; case ios_base::hex: __base = 16; if (__in_ite != __end && *__in_ite == __atoms[2] ) { ++__in_ite; if (__in_ite != __end && (*__in_ite == __atoms[3] || *__in_ite == __atoms[4] )) ++__in_ite; else __valid_zero = 1; } break; default: if (__in_ite != __end && *__in_ite == __atoms[2] ) { ++__in_ite; if (__in_ite != __end && (*__in_ite == __atoms[3] || *__in_ite == __atoms[4] )) { ++__in_ite; __base = 16; } else { __base = 8; __valid_zero = 1; } } else __base = 10; break; } return (__base << 2) | ((int)__negative << 1) | __valid_zero; } template bool __get_integer(_InputIter& __first, _InputIter& __last, int __base, _Integer& __val, int __got, bool __is_negative, _CharT __separator, const string& __grouping, const __true_type& ) { bool __ovflow = false; _Integer __result = 0; bool __is_group = !__grouping.empty(); char __group_sizes[64]; char __current_group_size = 0; char* __group_sizes_end = __group_sizes; _Integer __over_base = (numeric_limits<_Integer>::min)() / static_cast<_Integer>(__base); for ( ; __first != __last ; ++__first) { const _CharT __c = *__first; if (__is_group && __c == __separator) { *__group_sizes_end++ = __current_group_size; __current_group_size = 0; continue; } int __n = __get_digit_from_table(__c); if (__n >= __base) break; ++__got; ++__current_group_size; if (__result < __over_base) __ovflow = true; else { _Integer __next = static_cast<_Integer>(__base * __result - __n); if (__result != 0) __ovflow = __ovflow || __next >= __result; __result = __next; } } if (__is_group && __group_sizes_end != __group_sizes) { *__group_sizes_end++ = __current_group_size; } if (__got > 0) { __val = __ovflow ? __is_negative ? (numeric_limits<_Integer>::min)() : (numeric_limits<_Integer>::max)() : __is_negative ? __result : static_cast<_Integer>(-__result); } return ((__got > 0) && !__ovflow) && (__is_group == 0 || __valid_grouping(__group_sizes, __group_sizes_end, __grouping.data(), __grouping.data()+ __grouping.size())); } template bool __get_integer(_InputIter& __first, _InputIter& __last, int __base, _Integer& __val, int __got, bool __is_negative, _CharT __separator, const string& __grouping, const __false_type& ) { bool __ovflow = false; _Integer __result = 0; bool __is_group = !__grouping.empty(); char __group_sizes[64]; char __current_group_size = 0; char* __group_sizes_end = __group_sizes; _Integer __over_base = (numeric_limits<_Integer>::max)() / static_cast<_Integer>(__base); for ( ; __first != __last ; ++__first) { const _CharT __c = *__first; if (__is_group && __c == __separator) { *__group_sizes_end++ = __current_group_size; __current_group_size = 0; continue; } int __n = __get_digit_from_table(__c); if (__n >= __base) break; ++__got; ++__current_group_size; if (__result > __over_base) __ovflow = true; else { _Integer __next = static_cast<_Integer>(__base * __result + __n); if (__result != 0) __ovflow = __ovflow || __next <= __result; __result = __next; } } if (__is_group && __group_sizes_end != __group_sizes) { *__group_sizes_end++ = __current_group_size; } if (__got > 0) { __val = __ovflow ? (numeric_limits<_Integer>::max)() : (__is_negative ? static_cast<_Integer>(-__result) : __result); } return ((__got > 0) && !__ovflow) && (__is_group == 0 || __valid_grouping(__group_sizes, __group_sizes_end, __grouping.data(), __grouping.data()+ __grouping.size())); } template bool __get_decimal_integer(_InputIter& __first, _InputIter& __last, _Integer& __val, _CharT* ) { string __grp; return __get_integer(__first, __last, 10, __val, 0, false, _CharT() , __grp, __false_type()); } template _InputIter __do_get_integer(_InputIter& __in_ite, _InputIter& __end, ios_base& __str, ios_base::iostate& __err, _Integer& __val, _CharT* ) { locale __loc = __str.getloc(); const ctype<_CharT>& __ctype = use_facet >(__loc); typedef typename __bool2type::is_signed>::_Ret _IsSigned; int __base_or_zero = 0; int __got = 0; if (__in_ite != __end) { __base_or_zero = __get_base_or_zero(__in_ite, __end, __str.flags(), __ctype); __got = __base_or_zero & 1; } bool __result; if (__in_ite == __end) { if (__got > 0) { __val = 0; __result = true; } else __result = false; } else { const numpunct<_CharT>& __np = use_facet >(__loc); const bool __negative = (__base_or_zero & 2) != 0; const int __base = __base_or_zero >> 2; __result = __get_integer(__in_ite, __end, __base, __val, __got, __negative, __np.thousands_sep(), __np.grouping(), _IsSigned()); } __err = static_cast(__result ? ios_base::goodbit : ios_base::failbit); if (__in_ite == __end) __err |= ios_base::eofbit; return __in_ite; } template _InputIter __copy_sign(_InputIter __first, _InputIter __last, __iostring& __v, _CharT __xplus, _CharT __xminus) { if (__first != __last) { _CharT __c = *__first; if (__c == __xplus) ++__first; else if (__c == __xminus) { __v.push_back('-'); ++__first; } } return __first; } template bool __copy_digits(_InputIter& __first, _InputIter __last, __iostring& __v, const _CharT* __digits) { bool __ok = false; for ( ; __first != __last; ++__first) { _CharT __c = *__first; if (__get_fdigit(__c, __digits)) { __v.push_back((char)__c); __ok = true; } else break; } return __ok; } template bool __copy_grouped_digits(_InputIter& __first, _InputIter __last, __iostring& __v, const _CharT * __digits, _CharT __sep, const string& __grouping, bool& __grouping_ok) { bool __ok = false; char __group_sizes[64]; char*__group_sizes_end = __group_sizes; char __current_group_size = 0; for ( ; __first != __last; ++__first) { _CharT __c = *__first; bool __tmp = __get_fdigit_or_sep(__c, __sep, __digits); if (__tmp) { if (__c == ',') { *__group_sizes_end++ = __current_group_size; __current_group_size = 0; } else { __ok = true; __v.push_back((char)__c); ++__current_group_size; } } else break; } if (__group_sizes_end != __group_sizes) *__group_sizes_end++ = __current_group_size; __grouping_ok = __valid_grouping(__group_sizes, __group_sizes_end, __grouping.data(), __grouping.data() + __grouping.size()); return __ok; } template bool __read_float(__iostring& __buf, _InputIter& __in_ite, _InputIter& __end, const ctype<_CharT> &__ct, const numpunct<_CharT> &__numpunct) { string __grouping = __numpunct.grouping(); bool __digits_before_dot ; bool __digits_after_dot = false; bool __ok; bool __grouping_ok = true; _CharT __dot = __numpunct.decimal_point(); _CharT __sep = __numpunct.thousands_sep(); _CharT __digits[10]; _CharT __xplus; _CharT __xminus; _CharT __pow_e; _CharT __pow_E; _Initialize_get_float(__ct, __xplus, __xminus, __pow_e, __pow_E, __digits); __in_ite = __copy_sign(__in_ite, __end, __buf, __xplus, __xminus); if (!__grouping.empty()) __digits_before_dot = __copy_grouped_digits(__in_ite, __end, __buf, __digits, __sep, __grouping, __grouping_ok); else __digits_before_dot = __copy_digits(__in_ite, __end, __buf, __digits); if (__in_ite != __end && *__in_ite == __dot) { __buf.push_back('.'); ++__in_ite; __digits_after_dot = __copy_digits(__in_ite, __end, __buf, __digits); } __ok = __digits_before_dot || __digits_after_dot; if (__ok && __in_ite != __end && (*__in_ite == __pow_e || *__in_ite == __pow_E)) { __buf.push_back('e'); ++__in_ite; __in_ite = __copy_sign(__in_ite, __end, __buf, __xplus, __xminus); __ok = __copy_digits(__in_ite, __end, __buf, __digits); } return __ok; } template _InputIter __do_get_float(_InputIter& __in_ite, _InputIter& __end, ios_base& __str, ios_base::iostate& __err, _Float& __val, _CharT* ) { locale __loc = __str.getloc(); const ctype<_CharT> &__ctype = use_facet >(__loc); const numpunct<_CharT> &__numpunct = use_facet >(__loc); __iostring __buf ; bool __ok = __read_float(__buf, __in_ite, __end, __ctype, __numpunct); if (__ok) { __string_to_float(__buf, __val); __err = ios_base::goodbit; } else { __err = ios_base::failbit; } if (__in_ite == __end) __err |= ios_base::eofbit; return __in_ite; } template _InputIter __do_get_alphabool(_InputIter& __in_ite, _InputIter& __end, ios_base& __str, ios_base::iostate& __err, bool& __x, _CharT* ) { const numpunct<_CharT>& __np = use_facet >(__str.getloc()); const basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> > __truename = __np.truename(); const basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> > __falsename = __np.falsename(); bool __true_ok = true; bool __false_ok = true; size_t __n = 0; for ( ; __in_ite != __end; ++__in_ite) { _CharT __c = *__in_ite; __true_ok = __true_ok && (__c == __truename[__n]); __false_ok = __false_ok && (__c == __falsename[__n]); ++__n; if ((!__true_ok && !__false_ok) || (__true_ok && __n >= __truename.size()) || (__false_ok && __n >= __falsename.size())) { ++__in_ite; break; } } if (__true_ok && __n < __truename.size()) __true_ok = false; if (__false_ok && __n < __falsename.size()) __false_ok = false; if (__true_ok || __false_ok) { __err = ios_base::goodbit; __x = __true_ok; } else __err = ios_base::failbit; if (__in_ite == __end) __err |= ios_base::eofbit; return __in_ite; } } template locale::id num_get<_CharT, _InputIterator>::id; template _InputIter num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __s, ios_base::iostate& __err, bool& __x) const { if (__s.flags() & ios_base::boolalpha) { return ::std::priv:: __do_get_alphabool(__in_ite, __end, __s, __err, __x, (_CharT*)0); } else { long __lx; _InputIter __tmp = ::std::priv:: __do_get_integer(__in_ite, __end, __s, __err, __lx, (_CharT*)0 ); if (!(__err & ios_base::failbit)) { if (__lx == 0) __x = false; else if (__lx == 1) __x = true; else __err |= ios_base::failbit; } return __tmp; } } template _InputIter num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str, ios_base::iostate& __err, long& __val) const { return ::std::priv:: __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); } template _InputIter num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str, ios_base::iostate& __err, unsigned short& __val) const { return ::std::priv:: __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); } template _InputIter num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str, ios_base::iostate& __err, unsigned int& __val) const { return ::std::priv:: __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); } template _InputIter num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str, ios_base::iostate& __err, unsigned long& __val) const { return ::std::priv:: __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); } template _InputIter num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str, ios_base::iostate& __err, float& __val) const { return ::std::priv:: __do_get_float(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); } template _InputIter num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str, ios_base::iostate& __err, double& __val) const { return ::std::priv:: __do_get_float(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); } template _InputIter num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str, ios_base::iostate& __err, long double& __val) const { return ::std::priv:: __do_get_float(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); } template _InputIter num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str, ios_base::iostate& __err, void*& __p) const { unsigned long long __val; iter_type __tmp = ::std::priv:: __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); if (!(__err & ios_base::failbit)) # pragma diag_suppress 1107 __p = reinterpret_cast(__val); return __tmp; } template _InputIter num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str, ios_base::iostate& __err, long long& __val) const { return ::std::priv:: __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); } template _InputIter num_get<_CharT, _InputIter>::do_get(_InputIter __in_ite, _InputIter __end, ios_base& __str, ios_base::iostate& __err, unsigned long long& __val) const { return ::std::priv:: __do_get_integer(__in_ite, __end, __str, __err, __val, (_CharT*)0 ); } } namespace std { namespace priv { template struct _Is_not_wspace { typedef typename _Traits::char_type argument_type; typedef bool result_type; const ctype* _M_ctype; _Is_not_wspace(const ctype* __c_type) : _M_ctype(__c_type) {} bool operator()(argument_type __c) const { return !_M_ctype->is(ctype_base::space, __c); } }; template struct _Is_wspace_null { typedef typename _Traits::char_type argument_type; typedef bool result_type; const ctype* _M_ctype; _Is_wspace_null(const ctype* __c_type) : _M_ctype(__c_type) {} bool operator()(argument_type __c) const { return _Traits::eq(__c, argument_type()) || _M_ctype->is(ctype_base::space, __c); } }; template struct _Scan_for_wspace { typedef typename _Traits::char_type char_type; typedef char_type* first_argument_type; typedef char_type* second_argument_type; typedef char_type* result_type; const ctype* _M_ctype; _Scan_for_wspace(const ctype* __ctype) : _M_ctype(__ctype) {} const char_type* operator()(const char_type* __first, const char_type* __last) const { return _M_ctype->scan_is(ctype_base::space, __first, __last); } }; template struct _Scan_wspace_null { typedef typename _Traits::char_type char_type; typedef char_type* first_argument_type; typedef char_type* second_argument_type; typedef char_type* result_type; const ctype* _M_ctype; _Scan_wspace_null(const ctype* __c_type) : _M_ctype(__c_type) {} const char_type* operator()(const char_type* __first, const char_type* __last) const { __last = find_if(__first, __last, _Eq_char_bound<_Traits>(char_type())); return _M_ctype->scan_is(ctype_base::space, __first, __last); } }; template struct _Scan_for_not_wspace { typedef typename _Traits::char_type char_type; typedef char_type* first_argument_type; typedef char_type* second_argument_type; typedef char_type* result_type; const ctype* _M_ctype; _Scan_for_not_wspace(const ctype* __c_type) : _M_ctype(__c_type) {} const char_type* operator()(const char_type* __first, const char_type* __last) const { return _M_ctype->scan_not(ctype_base::space, __first, __last); } }; template struct _Scan_for_char_val { typedef typename _Traits::char_type char_type; typedef char_type* first_argument_type; typedef char_type* second_argument_type; typedef char_type* result_type; char_type _M_val; _Scan_for_char_val(char_type __val) : _M_val(__val) {} const char_type* operator()(const char_type* __first, const char_type* __last) const { return find_if(__first, __last, _Eq_char_bound<_Traits>(_M_val)); } }; template struct _Scan_for_int_val { typedef typename _Traits::char_type char_type; typedef typename _Traits::int_type int_type; typedef char_type* first_argument_type; typedef char_type* second_argument_type; typedef char_type* result_type; int_type _M_val; _Scan_for_int_val(int_type __val) : _M_val(__val) {} const char_type* operator()(const char_type* __first, const char_type* __last) const { return find_if(__first, __last, _Eq_int_bound<_Traits>(_M_val)); } }; template bool __pushback(basic_streambuf<_CharT, _Traits>* __buf, _CharT __c) { bool ret; { const typename _Traits::int_type __eof = _Traits::eof(); ret = !_Traits::eq_int_type(__buf->sputbackc(__c), __eof); } if (false) { ret = false; } return ret; } template ios_base::iostate __get_num(basic_istream<_CharT, _Traits>& __that, _Number& __val) { typedef typename basic_istream<_CharT, _Traits>::sentry _Sentry; ios_base::iostate __err = 0; _Sentry __sentry( __that ); if (__sentry) { typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> > _Num_get; { (use_facet<_Num_get>(__that.getloc())).get(istreambuf_iterator<_CharT, _Traits>(__that.rdbuf()), 0, __that, __err, __val); } if (false) { __that._M_handle_exception(ios_base::badbit); } if (__err) __that.setstate(__err); } return __err; } } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>> (short& __val) { long __lval; ::std::priv:: __get_num(*this, __lval); if ( this->fail() ) { return *this; } short __tmp = static_cast(__lval); unsigned short __uval = static_cast(__lval); if ((__tmp != __lval) && ((long)__uval != __lval)) this->setstate(ios_base::failbit); else __val = __tmp; return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>> (int& __val) { long __lval; ::std::priv:: __get_num(*this, __lval); if ( this->fail() ) { return *this; } int __tmp = __lval; unsigned int __uval = __lval; if ((__tmp != __lval) && ((long)__uval != __lval)) this->setstate(ios_base::failbit); else __val = __tmp; return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>> (unsigned short& __val) { ::std::priv:: __get_num(*this, __val); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>> (unsigned int& __val) { ::std::priv:: __get_num(*this, __val); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>> (long& __val) { ::std::priv:: __get_num(*this, __val); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>> (unsigned long& __val) { ::std::priv:: __get_num(*this, __val); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>> (long long& __val) { ::std::priv:: __get_num(*this, __val); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>> (unsigned long long& __val) { ::std::priv:: __get_num(*this, __val); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>> (float& __val) { ::std::priv:: __get_num(*this, __val); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>> (double& __val) { ::std::priv:: __get_num(*this, __val); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>> (long double& __val) { ::std::priv:: __get_num(*this, __val); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>> (bool& __val) { ::std::priv:: __get_num(*this, __val); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::operator>> (void*& __val) { ::std::priv:: __get_num(*this, __val); return *this; } template typename basic_istream<_CharT, _Traits> ::int_type basic_istream<_CharT, _Traits>::peek() { typename _Traits::int_type __tmp = _Traits::eof(); this->_M_gcount = 0; sentry __sentry(*this, _No_Skip_WS()); if (__sentry) { { __tmp = this->rdbuf()->sgetc(); } if (false) { this->_M_handle_exception(ios_base::badbit); } if (this->_S_eof(__tmp)) this->setstate(ios_base::eofbit); } return __tmp; } template typename basic_istream<_CharT, _Traits> ::int_type basic_istream<_CharT, _Traits>::get() { typename _Traits::int_type __tmp = _Traits::eof(); sentry __sentry(*this, _No_Skip_WS()); this->_M_gcount = 0; if (__sentry) { { __tmp = this->rdbuf()->sbumpc(); } if (false) { this->_M_handle_exception(ios_base::badbit); } if (!this->_S_eof(__tmp)) this->_M_gcount = 1; } if (_M_gcount == 0) this->setstate(ios_base::eofbit | ios_base::failbit); return __tmp; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::get(_CharT& __c) { sentry __sentry(*this, _No_Skip_WS()); this->_M_gcount = 0; if (__sentry) { typename _Traits::int_type __tmp = _Traits::eof(); { __tmp = this->rdbuf()->sbumpc(); } if (false) { this->_M_handle_exception(ios_base::badbit); } if (!this->_S_eof(__tmp)) { this->_M_gcount = 1; __c = _Traits::to_char_type(__tmp); } } if (this->_M_gcount == 0) this->setstate(ios_base::eofbit | ios_base::failbit); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::ignore() { sentry __sentry(*this, _No_Skip_WS()); this->_M_gcount = 0; if (__sentry) { int_type __c; { __c = this->rdbuf()->sbumpc(); } if (false) { this->_M_handle_exception(ios_base::badbit); return *this; } if (!this->_S_eof(__c)) this->_M_gcount = 1; else this->setstate(ios_base::eofbit); } return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::putback(_CharT __c) { this->_M_gcount = 0; sentry __sentry(*this, _No_Skip_WS()); if (__sentry) { typename _Traits::int_type __tmp = _Traits::eof(); basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); if (__buf) { { __tmp = __buf->sputbackc(__c); } if (false) { this->_M_handle_exception(ios_base::badbit); } } if (this->_S_eof(__tmp)) this->setstate(ios_base::badbit); } else this->setstate(ios_base::failbit); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::unget() { this->_M_gcount = 0; sentry __sentry(*this, _No_Skip_WS()); if (__sentry) { basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); if (__buf) { { if (this->_S_eof(__buf->sungetc())) this->setstate(ios_base::badbit); } if (false) { this->_M_handle_exception(ios_base::badbit); } } else this->setstate(ios_base::badbit); } else this->setstate(ios_base::failbit); return *this; } template int basic_istream<_CharT, _Traits>::sync() { sentry __sentry(*this, _No_Skip_WS()); basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); if (__buf) { if (__buf->pubsync() == -1) { this->setstate(ios_base::badbit); return -1; } else return 0; } else return -1; } template typename basic_istream<_CharT, _Traits> ::pos_type basic_istream<_CharT, _Traits>::tellg() { sentry __sentry(*this, _No_Skip_WS()); basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); return (__buf && !this->fail()) ? __buf->pubseekoff(0, ios_base::cur, ios_base::in) : pos_type(-1); } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::seekg(pos_type __pos) { sentry __sentry(*this, _No_Skip_WS()); basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); if (!this->fail() && __buf) { if (__buf->pubseekpos(__pos, ios_base::in) == pos_type(-1)) { this->setstate(ios_base::failbit); } } return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::seekg(off_type __off, ios_base::seekdir __dir) { sentry __sentry(*this, _No_Skip_WS()); basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); if (!this->fail() && __buf) __buf->pubseekoff(__off, __dir, ios_base::in); return *this; } template void basic_istream<_CharT, _Traits>::_M_formatted_get(_CharT& __c) { sentry __sentry(*this); if (__sentry) { typename _Traits::int_type __tmp; { __tmp = this->rdbuf()->sbumpc(); } if (false) { this->_M_handle_exception(ios_base::badbit); return; } if (!this->_S_eof(__tmp)) __c = _Traits::to_char_type(__tmp); else this->setstate(ios_base::eofbit | ios_base::failbit); } } namespace priv { template < class _CharT, class _Traits, class _Is_Delim> streamsize __read_unbuffered(basic_istream<_CharT, _Traits>* __that, basic_streambuf<_CharT, _Traits>* __buf, streamsize _Num, _CharT* __s, _Is_Delim __is_delim, bool __extract_delim, bool __append_null, bool __is_getline) { streamsize __n = 0; ios_base::iostate __status = 0; typedef typename basic_istream<_CharT, _Traits>::int_type int_type; { for (;;) { if (__n == _Num) { if (__is_getline) __status |= ios_base::failbit; break; } int_type __c = __buf->sbumpc(); if (__that->_S_eof(__c)) { if (__n < _Num || __is_getline) __status |= ios_base::eofbit; break; } else if (__is_delim(_Traits::to_char_type(__c))) { if (__extract_delim) { ++__n; } else if ( !__pushback(__buf, _Traits::to_char_type(__c)) ) { __status |= ios_base::failbit; } break; } *__s++ = _Traits::to_char_type(__c); ++__n; } } if (false) { __that->_M_handle_exception(ios_base::badbit); *__s = _CharT(); return __n; } if (__append_null) *__s = _CharT(); if (__status) __that->setstate(__status); return __n; } template < class _CharT, class _Traits, class _Is_Delim, class _Scan_Delim> streamsize __read_buffered(basic_istream<_CharT, _Traits>* __that, basic_streambuf<_CharT, _Traits>* __buf, streamsize _Num, _CharT* __s, _Is_Delim __is_delim, _Scan_Delim __scan_delim, bool __extract_delim, bool __append_null, bool __is_getline) { streamsize __n = 0; ios_base::iostate __status = 0; bool __done = false; { while (__buf->_M_egptr() != __buf->_M_gptr() && !__done) { const _CharT* __first = __buf->_M_gptr(); const _CharT* __last = __buf->_M_egptr(); typedef char __static_assert[(sizeof(streamsize) > sizeof(ptrdiff_t)) || ((sizeof(streamsize) == sizeof(ptrdiff_t)) && numeric_limits ::is_signed) ? 1 : -1]; ptrdiff_t __request = static_cast((min) (static_cast((numeric_limits ::max)()), _Num - __n)); const _CharT* __p = __scan_delim(__first, __last); ptrdiff_t __chunk = (min) (ptrdiff_t(__p - __first), __request); _Traits::copy(__s, __first, __chunk); __s += __chunk; __n += __chunk; __buf->_M_gbump((int)__chunk); if (__p != __last && __p - __first <= __request) { if (__extract_delim) { __n += 1; __buf->_M_gbump(1); } __done = true; } else if (__n == _Num) { if (__is_getline) { if (__chunk == __last - __first) { if (__that->_S_eof(__buf->sgetc())) __status |= ios_base::eofbit; } else __status |= ios_base::failbit; } __done = true; } else { if (__that->_S_eof(__buf->sgetc())) { __status |= ios_base::eofbit; __done = true; } } } } if (false) { __that->_M_handle_exception(ios_base::badbit); __done = true; } if (__done) { if (__append_null) *__s = _CharT(); if (__status != 0) __that->setstate(__status); return __n; } return __n + __read_unbuffered(__that, __buf, _Num - __n, __s, __is_delim, __extract_delim,__append_null,__is_getline); } } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::get(_CharT* __s, streamsize __n, _CharT __delim) { sentry __sentry(*this, _No_Skip_WS()); this->_M_gcount = 0; if (__sentry) { if (__n > 0) { basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); if (__buf->egptr() != __buf->gptr()) this->_M_gcount = ::std::priv:: __read_buffered(this, __buf, __n - 1, __s, ::std::priv:: _Eq_char_bound<_Traits>(__delim), ::std::priv:: _Scan_for_char_val<_Traits>(__delim), false, true, false); else this->_M_gcount = ::std::priv:: __read_unbuffered(this, __buf, __n - 1, __s, ::std::priv:: _Eq_char_bound<_Traits>(__delim), false, true, false); } } if (this->_M_gcount == 0) this->setstate(ios_base::failbit); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::getline(_CharT* __s, streamsize __n, _CharT __delim) { sentry __sentry(*this, _No_Skip_WS()); this->_M_gcount = 0; if (__sentry) { if (__n > 0) { basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); this->_M_gcount = __buf->egptr() != __buf->gptr() ? ::std::priv:: __read_buffered(this, __buf, __n - 1, __s, ::std::priv:: _Eq_char_bound<_Traits>(__delim), ::std::priv:: _Scan_for_char_val<_Traits>(__delim), true, true, true) : ::std::priv:: __read_unbuffered(this, __buf, __n - 1, __s, ::std::priv:: _Eq_char_bound<_Traits>(__delim), true, true, true); } } if (this->_M_gcount == 0) this->setstate(ios_base::failbit); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n) { sentry __sentry(*this, _No_Skip_WS()); this->_M_gcount = 0; if (__sentry && !this->eof()) { basic_streambuf<_CharT, _Traits>*__buf = this->rdbuf(); if (__buf->gptr() != __buf->egptr()) _M_gcount = ::std::priv:: __read_buffered(this, __buf, __n, __s, ::std::priv:: _Constant_unary_fun(false), ::std::priv:: _Project2nd(), false, false, false); else _M_gcount = ::std::priv:: __read_unbuffered(this, __buf, __n, __s, ::std::priv:: _Constant_unary_fun(false), false, false, false); } else this->setstate(ios_base::failbit); if (this->eof()) this->setstate(ios_base::eofbit | ios_base::failbit); return *this; } template streamsize basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __nmax) { sentry __sentry(*this, _No_Skip_WS()); this->_M_gcount = 0; if (__sentry && !this->eof() && __nmax >= 0) { basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); streamsize __avail = __buf->in_avail(); if (__avail == -1) this->_M_setstate_nothrow(ios_base::eofbit); else if (__avail != 0) { if (__buf->gptr() != __buf->egptr()) _M_gcount = ::std::priv:: __read_buffered(this, __buf, (min) (__avail, __nmax), __s, ::std::priv:: _Constant_unary_fun(false), ::std::priv:: _Project2nd(), false, false, false); else _M_gcount = ::std::priv:: __read_unbuffered(this, __buf, (min) (__avail, __nmax), __s, ::std::priv:: _Constant_unary_fun(false), false, false, false); } } else { if (this->eof()) this->setstate(ios_base::eofbit | ios_base::failbit); else this->setstate(ios_base::failbit); } return _M_gcount; } template void basic_istream<_CharT, _Traits>::_M_formatted_get(_CharT* __s) { sentry __sentry(*this); if (__sentry) { basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); streamsize __nmax = this->width() > 0 ? this->width() - 1 : ((numeric_limits::max)() / sizeof(_CharT)) - 1; streamsize __n = __buf->gptr() != __buf->egptr() ? ::std::priv:: __read_buffered(this, __buf, __nmax, __s, ::std::priv:: _Is_wspace_null<_Traits>(this->_M_ctype_facet()), ::std::priv:: _Scan_wspace_null<_Traits>(this->_M_ctype_facet()), false, true, false) : ::std::priv:: __read_unbuffered(this, __buf, __nmax, __s, ::std::priv:: _Is_wspace_null<_Traits>(this->_M_ctype_facet()), false, true, false); if (__n == 0) this->setstate(ios_base::failbit); } this->width(0); } template < class _CharT, class _Traits, class _Is_Delim> void _M_ignore_unbuffered(basic_istream<_CharT, _Traits>* __that, basic_streambuf<_CharT, _Traits>* __buf, _Is_Delim __is_delim, bool __extract_delim, bool __set_failbit) { bool __done = false; ios_base::iostate __status = 0; typedef typename basic_istream<_CharT, _Traits>::int_type int_type; { while (!__done) { int_type __c = __buf->sbumpc(); if (__that->_S_eof(__c)) { __done = true; __status |= __set_failbit ? ios_base::eofbit | ios_base::failbit : ios_base::eofbit; } else if (__is_delim(_Traits::to_char_type(__c))) { __done = true; if (!__extract_delim) if (__that->_S_eof(__buf->sputbackc(_Traits::to_char_type(__c)))) __status |= ios_base::failbit; } } } if (false) { __that->_M_handle_exception(ios_base::badbit); } __that->setstate(__status); } template < class _CharT, class _Traits, class _Is_Delim, class _Scan_Delim> void _M_ignore_buffered(basic_istream<_CharT, _Traits>* __that, basic_streambuf<_CharT, _Traits>* __buf, _Is_Delim __is_delim, _Scan_Delim __scan_delim, bool __extract_delim, bool __set_failbit) { bool __at_eof = false; bool __found_delim = false; { while (__buf->_M_egptr() != __buf->_M_gptr() && !__at_eof && !__found_delim) { const _CharT* __p = __scan_delim(__buf->_M_gptr(), __buf->_M_egptr()); __buf->_M_gbump((int)(__p - __buf->_M_gptr())); if (__p != __buf->_M_egptr()) { if (__extract_delim) __buf->_M_gbump(1); __found_delim = true; } else __at_eof = __that->_S_eof(__buf->sgetc()); } } if (false) { __that->_M_handle_exception(ios_base::badbit); return; } if (__at_eof) { __that->setstate(__set_failbit ? ios_base::eofbit | ios_base::failbit : ios_base::eofbit); return; } if (__found_delim) return; _M_ignore_unbuffered(__that, __buf, __is_delim, __extract_delim, __set_failbit); } template < class _CharT, class _Traits, class _Max_Chars, class _Is_Delim> streamsize _M_ignore_unbuffered(basic_istream<_CharT, _Traits>* __that, basic_streambuf<_CharT, _Traits>* __buf, streamsize _Num, _Max_Chars __max_chars, _Is_Delim __is_delim, bool __extract_delim, bool __set_failbit) { streamsize __n = 0; ios_base::iostate __status = 0; typedef typename basic_istream<_CharT, _Traits>::int_type int_type; { while (__max_chars(_Num, __n) > 0) { int_type __c = __buf->sbumpc(); if (__that->_S_eof(__c)) { __status |= __set_failbit ? ios_base::eofbit | ios_base::failbit : ios_base::eofbit; break; } else if (__is_delim(_Traits::to_char_type(__c))) { if (__extract_delim) ++__n; else if (__that->_S_eof(__buf->sputbackc(_Traits::to_char_type(__c)))) __status |= ios_base::failbit; break; } ++__n; } } if (false) { __that->_M_handle_exception(ios_base::badbit); } if (__status) __that->setstate(__status); return __n; } template < class _CharT, class _Traits, class _Max_Chars, class _Is_Delim, class _Scan_Delim> streamsize _M_ignore_buffered(basic_istream<_CharT, _Traits>* __that, basic_streambuf<_CharT, _Traits>* __buf, streamsize _Num, _Max_Chars __max_chars, _Is_Delim __is_delim, _Scan_Delim __scan_delim, bool __extract_delim, bool __set_failbit) { streamsize __n = 0; bool __at_eof = false; bool __done = false; { while (__buf->_M_egptr() != __buf->_M_gptr() && !__done) { ptrdiff_t __avail = __buf->_M_egptr() - __buf->_M_gptr(); streamsize __m = __max_chars(_Num, __n); if (__avail >= __m) { const _CharT* __last = __buf->_M_gptr() + static_cast(__m); const _CharT* __p = __scan_delim(__buf->_M_gptr(), __last); ptrdiff_t __chunk = __p - __buf->_M_gptr(); __n += __chunk; __buf->_M_gbump((int)__chunk); if (__extract_delim && __p != __last) { __n += 1; __buf->_M_gbump(1); } __done = true; } else { const _CharT* __p = __scan_delim(__buf->_M_gptr(), __buf->_M_egptr()); ptrdiff_t __chunk = __p - __buf->_M_gptr(); __n += __chunk; __buf->_M_gbump((int)__chunk); if (__p != __buf->_M_egptr()) { if (__extract_delim) { __n += 1; __buf->_M_gbump(1); } __done = true; } else if (__that->_S_eof(__buf->sgetc())) { __done = true; __at_eof = true; } } } } if (false) { __that->_M_handle_exception(ios_base::badbit); return __n; } if (__at_eof) __that->setstate(__set_failbit ? ios_base::eofbit | ios_base::failbit : ios_base::eofbit); if (__done) return __n; return __n + _M_ignore_unbuffered(__that, __buf, _Num, __max_chars, __is_delim, __extract_delim, __set_failbit); } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::ignore(streamsize __n) { sentry __sentry(*this, _No_Skip_WS()); this->_M_gcount = 0; if (__sentry) { basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); typedef ::std::priv:: _Constant_unary_fun _Const_bool; typedef ::std::priv:: _Constant_binary_fun _Const_streamsize; const streamsize __maxss = (numeric_limits::max)(); if (__n == (numeric_limits::max)()) { if (__buf->gptr() != __buf->egptr()) _M_gcount = _M_ignore_buffered(this, __buf, __maxss, _Const_streamsize(__maxss), _Const_bool(false), ::std::priv:: _Project2nd(), false, false); else _M_gcount = _M_ignore_unbuffered(this, __buf, __maxss, _Const_streamsize(__maxss), _Const_bool(false), false, false); } else { if (__buf->gptr() != __buf->egptr()) _M_gcount = _M_ignore_buffered(this, __buf, __n, minus(), _Const_bool(false), ::std::priv:: _Project2nd(), false, false); else _M_gcount = _M_ignore_unbuffered(this, __buf, __n, minus(), _Const_bool(false), false, false); } } return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __delim) { sentry __sentry(*this, _No_Skip_WS()); this->_M_gcount = 0; if (__sentry) { basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); typedef ::std::priv:: _Constant_unary_fun _Const_bool; typedef ::std::priv:: _Constant_binary_fun _Const_streamsize; const streamsize __maxss = (numeric_limits::max)(); if (__n == (numeric_limits::max)()) { if (__buf->gptr() != __buf->egptr()) _M_gcount = _M_ignore_buffered(this, __buf, __maxss, _Const_streamsize(__maxss), ::std::priv:: _Eq_int_bound<_Traits>(__delim), ::std::priv:: _Scan_for_int_val<_Traits>(__delim), true, false); else _M_gcount = _M_ignore_unbuffered(this, __buf, __maxss, _Const_streamsize(__maxss), ::std::priv:: _Eq_int_bound<_Traits>(__delim), true, false); } else { if (__buf->gptr() != __buf->egptr()) _M_gcount = _M_ignore_buffered(this, __buf, __n, minus(), ::std::priv:: _Eq_int_bound<_Traits>(__delim), ::std::priv:: _Scan_for_int_val<_Traits>(__delim), true, false); else _M_gcount = _M_ignore_unbuffered(this, __buf, __n, minus(), ::std::priv:: _Eq_int_bound<_Traits>(__delim), true, false); } } return *this; } template void basic_istream<_CharT, _Traits>::_M_skip_whitespace(bool __set_failbit) { basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); if (!__buf) this->setstate(ios_base::badbit); else if (__buf->gptr() != __buf->egptr()) _M_ignore_buffered(this, __buf, ::std::priv:: _Is_not_wspace<_Traits>(this->_M_ctype_facet()), ::std::priv:: _Scan_for_not_wspace<_Traits>(this->_M_ctype_facet()), false, __set_failbit); else _M_ignore_unbuffered(this, __buf, ::std::priv:: _Is_not_wspace<_Traits>(this->_M_ctype_facet()), false, __set_failbit); } namespace priv { template < class _CharT, class _Traits, class _Is_Delim> streamsize __copy_unbuffered(basic_istream<_CharT, _Traits>* __that, basic_streambuf<_CharT, _Traits>* __src, basic_streambuf<_CharT, _Traits>* __dest, _Is_Delim __is_delim, bool __extract_delim, bool __rethrow) { streamsize __extracted = 0; ios_base::iostate __status = 0; typedef typename basic_istream<_CharT, _Traits>::int_type int_type; int_type __c; { for (;;) { __c = __src->sbumpc(); if (__that->_S_eof(__c)) { __status |= ios_base::eofbit; break; } else if (__is_delim(_Traits::to_char_type(__c))) { if (!__extract_delim && !__pushback(__src, _Traits::to_char_type(__c))) __status |= ios_base::failbit; break; } else { bool __failed = false; { if (!__that->_S_eof(__dest->sputc(_Traits::to_char_type(__c)))) ++__extracted; else __failed = true; } if (false) { __failed = true; } if (__failed && !__pushback(__src, _Traits::to_char_type(__c))) __status |= ios_base::failbit; if (__failed) break; } } } if (false) { if (__rethrow && __extracted == 0) __that->_M_handle_exception(ios_base::failbit); } __that->setstate(__status); return __extracted; } template < class _CharT, class _Traits, class _Is_Delim, class _Scan_Delim> streamsize __copy_buffered(basic_istream<_CharT, _Traits>* __that, basic_streambuf<_CharT, _Traits>* __src, basic_streambuf<_CharT, _Traits>* __dest, _Scan_Delim __scan_delim, _Is_Delim __is_delim, bool __extract_delim, bool __rethrow) { streamsize __extracted = 0; ios_base::iostate __status = 0; typedef typename basic_istream<_CharT, _Traits>::int_type int_type; int_type __c ; _CharT* __first = __src->_M_gptr(); ptrdiff_t __avail = __src->_M_egptr() - __first; bool __do_handle_exceptions = false; { for (;;) { const _CharT* __last = __scan_delim(__first, __src->_M_egptr()); streamsize __n = __dest->sputn(__first, __extract_delim && __last != __src->_M_egptr() ? (__last - __first) + 1 : (__last - __first)); __src->_M_gbump((int)__n); __extracted += __n; __do_handle_exceptions = true; if (__n < __avail) break; __c = __src->sgetc(); __first = __src->_M_gptr(); __avail = __src->_M_egptr() - __first; if (__avail > 0) {} else if (__that->_S_eof(__c)) { __status |= ios_base::eofbit; break; } else { return __extracted + __copy_unbuffered(__that, __src, __dest, __is_delim, __extract_delim, __rethrow); } __do_handle_exceptions = false; } } if (false) { if (__rethrow && __do_handle_exceptions && __extracted == 0) __that->_M_handle_exception(ios_base::failbit); } if (__status) __that->setstate(__status); return __extracted; } } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits> ::get(basic_streambuf<_CharT, _Traits>& __dest, _CharT __delim) { sentry __sentry(*this, _No_Skip_WS()); this->_M_gcount = 0; if (__sentry) { basic_streambuf<_CharT, _Traits>* __src = this->rdbuf(); if (__src) this->_M_gcount = __src->egptr() != __src->gptr() ? ::std::priv:: __copy_buffered(this, __src, &__dest, ::std::priv:: _Scan_for_char_val<_Traits>(__delim), ::std::priv:: _Eq_char_bound<_Traits>(__delim), false, false) : ::std::priv:: __copy_unbuffered(this, __src, &__dest, ::std::priv:: _Eq_char_bound<_Traits>(__delim), false, false); } if (this->_M_gcount == 0) this->setstate(ios_base::failbit); return *this; } template basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits> ::operator>>(basic_streambuf<_CharT, _Traits>* __dest) { streamsize __n = 0; typedef typename basic_istream<_CharT, _Traits>::sentry _Sentry; _Sentry __sentry(*this); if (__sentry) { basic_streambuf<_CharT, _Traits>* __src = this->rdbuf(); if (__src && __dest) __n = __src->egptr() != __src->gptr() ? ::std::priv:: __copy_buffered(this, __src, __dest, ::std::priv:: _Project2nd(), ::std::priv:: _Constant_unary_fun(false), false, true) : ::std::priv:: __copy_unbuffered(this, __src, __dest, ::std::priv:: _Constant_unary_fun(false), false, true); } if (__n == 0) this->setstate(ios_base::failbit); return *this; } template basic_iostream<_CharT, _Traits> ::basic_iostream(basic_streambuf<_CharT, _Traits>* __buf) : basic_ios<_CharT, _Traits>(), basic_istream<_CharT, _Traits>(__buf), basic_ostream<_CharT, _Traits>(__buf) { this->init(__buf); } template basic_iostream<_CharT, _Traits>::~basic_iostream() {} } namespace std { static ios_base::Init _ios_initer; __far extern istream cin; __far extern ostream cout; __far extern ostream cerr; __far extern ostream clog; __far extern wistream wcin; __far extern wostream wcout; __far extern wostream wcerr; __far extern wostream wclog; } #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::div_t; using std::ldiv_t; using std::lldiv_t; using std::size_t; using std::abs; using std::labs; using std::atoi; using std::atol; using std::llabs; using std::atoll; using std::atof; using std::strtol; using std::strtoul; using std::strtoll; using std::strtoull; using std::strtof; using std::strtod; using std::strtold; using std::rand; using std::srand; using std::calloc; using std::malloc; using std::realloc; using std::free; using std::memalign; using std::abort; using std::atexit; using std::bsearch; using std::qsort; using std::exit; using std::div; using std::ldiv; using std::lldiv; using std::getenv; using std::system; using std::mblen; using std::mbtowc; using std::wctomb; using std::mbstowcs; using std::wcstombs; #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.1") #pragma CHECK_MISRA("-19.15") #pragma diag_pop extern "C" { extern "C" { extern "C" { using std::size_t; using std::clock_t; using std::clock; using std::tm; using std::TZ; using std::_tz; using std::__time32_t; using std::__time64_t; using std::__time32; using std::__time64; using std::__ctime32; using std::__ctime64; using std::__difftime32; using std::__difftime64; using std::__gmtime32; using std::__gmtime64; using std::__localtime32; using std::__localtime64; using std::__mktime32; using std::__mktime64; using std::time_t; using std::time; using std::ctime; using std::difftime; using std::gmtime; using std::localtime; using std::mktime; using std::asctime; using std::strftime; enum ti_sysbios_knl_Event_PendState { ti_sysbios_knl_Event_PendState_TIMEOUT = 0, ti_sysbios_knl_Event_PendState_POSTED = 1, ti_sysbios_knl_Event_PendState_CLOCK_WAIT = 2, ti_sysbios_knl_Event_PendState_WAIT_FOREVER = 3 }; typedef enum ti_sysbios_knl_Event_PendState ti_sysbios_knl_Event_PendState; struct ti_sysbios_knl_Event_PendElem { ti_sysbios_knl_Task_PendElem tpElem; ti_sysbios_knl_Event_PendState pendState; xdc_UInt matchingEvents; xdc_UInt andMask; xdc_UInt orMask; }; typedef xdc_Bits32 CT__ti_sysbios_knl_Event_Module__diagsEnabled; extern "C" far const CT__ti_sysbios_knl_Event_Module__diagsEnabled ti_sysbios_knl_Event_Module__diagsEnabled__C; typedef xdc_Bits32 CT__ti_sysbios_knl_Event_Module__diagsIncluded; extern "C" far const CT__ti_sysbios_knl_Event_Module__diagsIncluded ti_sysbios_knl_Event_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__ti_sysbios_knl_Event_Module__diagsMask; extern "C" far const CT__ti_sysbios_knl_Event_Module__diagsMask ti_sysbios_knl_Event_Module__diagsMask__C; typedef xdc_Ptr CT__ti_sysbios_knl_Event_Module__gateObj; extern "C" far const CT__ti_sysbios_knl_Event_Module__gateObj ti_sysbios_knl_Event_Module__gateObj__C; typedef xdc_Ptr CT__ti_sysbios_knl_Event_Module__gatePrms; extern "C" far const CT__ti_sysbios_knl_Event_Module__gatePrms ti_sysbios_knl_Event_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__ti_sysbios_knl_Event_Module__id; extern "C" far const CT__ti_sysbios_knl_Event_Module__id ti_sysbios_knl_Event_Module__id__C; typedef xdc_Bool CT__ti_sysbios_knl_Event_Module__loggerDefined; extern "C" far const CT__ti_sysbios_knl_Event_Module__loggerDefined ti_sysbios_knl_Event_Module__loggerDefined__C; typedef xdc_Ptr CT__ti_sysbios_knl_Event_Module__loggerObj; extern "C" far const CT__ti_sysbios_knl_Event_Module__loggerObj ti_sysbios_knl_Event_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__ti_sysbios_knl_Event_Module__loggerFxn0; extern "C" far const CT__ti_sysbios_knl_Event_Module__loggerFxn0 ti_sysbios_knl_Event_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__ti_sysbios_knl_Event_Module__loggerFxn1; extern "C" far const CT__ti_sysbios_knl_Event_Module__loggerFxn1 ti_sysbios_knl_Event_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__ti_sysbios_knl_Event_Module__loggerFxn2; extern "C" far const CT__ti_sysbios_knl_Event_Module__loggerFxn2 ti_sysbios_knl_Event_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__ti_sysbios_knl_Event_Module__loggerFxn4; extern "C" far const CT__ti_sysbios_knl_Event_Module__loggerFxn4 ti_sysbios_knl_Event_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__ti_sysbios_knl_Event_Module__loggerFxn8; extern "C" far const CT__ti_sysbios_knl_Event_Module__loggerFxn8 ti_sysbios_knl_Event_Module__loggerFxn8__C; typedef xdc_Bool (*CT__ti_sysbios_knl_Event_Module__startupDoneFxn)(void); extern "C" far const CT__ti_sysbios_knl_Event_Module__startupDoneFxn ti_sysbios_knl_Event_Module__startupDoneFxn__C; typedef xdc_Int CT__ti_sysbios_knl_Event_Object__count; extern "C" far const CT__ti_sysbios_knl_Event_Object__count ti_sysbios_knl_Event_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__ti_sysbios_knl_Event_Object__heap; extern "C" far const CT__ti_sysbios_knl_Event_Object__heap ti_sysbios_knl_Event_Object__heap__C; typedef xdc_SizeT CT__ti_sysbios_knl_Event_Object__sizeof; extern "C" far const CT__ti_sysbios_knl_Event_Object__sizeof ti_sysbios_knl_Event_Object__sizeof__C; typedef xdc_Ptr CT__ti_sysbios_knl_Event_Object__table; extern "C" far const CT__ti_sysbios_knl_Event_Object__table ti_sysbios_knl_Event_Object__table__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Event_LM_post; extern "C" far const CT__ti_sysbios_knl_Event_LM_post ti_sysbios_knl_Event_LM_post__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Event_LM_pend; extern "C" far const CT__ti_sysbios_knl_Event_LM_pend ti_sysbios_knl_Event_LM_pend__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Event_A_nullEventMasks; extern "C" far const CT__ti_sysbios_knl_Event_A_nullEventMasks ti_sysbios_knl_Event_A_nullEventMasks__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Event_A_nullEventId; extern "C" far const CT__ti_sysbios_knl_Event_A_nullEventId ti_sysbios_knl_Event_A_nullEventId__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Event_A_eventInUse; extern "C" far const CT__ti_sysbios_knl_Event_A_eventInUse ti_sysbios_knl_Event_A_eventInUse__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Event_A_badContext; extern "C" far const CT__ti_sysbios_knl_Event_A_badContext ti_sysbios_knl_Event_A_badContext__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Event_A_pendTaskDisabled; extern "C" far const CT__ti_sysbios_knl_Event_A_pendTaskDisabled ti_sysbios_knl_Event_A_pendTaskDisabled__C; struct ti_sysbios_knl_Event_Params { size_t __size; const void *__self; void *__fxns; xdc_runtime_IInstance_Params *instance; xdc_runtime_IInstance_Params __iprms; }; struct ti_sysbios_knl_Event_Struct { volatile xdc_UInt __f0; ti_sysbios_knl_Queue_Struct __f1; xdc_runtime_Types_CordAddr __name; }; extern "C" void ti_sysbios_knl_Event_Instance_init__E(ti_sysbios_knl_Event_Object *, const ti_sysbios_knl_Event_Params *); extern "C" xdc_runtime_Types_Label *ti_sysbios_knl_Event_Handle__label__S( xdc_Ptr obj, xdc_runtime_Types_Label *lab ); extern "C" xdc_Bool ti_sysbios_knl_Event_Module__startupDone__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Event_Object__create__S( xdc_Ptr __oa, xdc_SizeT __osz, xdc_Ptr __aa, const xdc_UChar *__pa, xdc_SizeT __psz, xdc_runtime_Error_Block *__eb ); extern "C" ti_sysbios_knl_Event_Handle ti_sysbios_knl_Event_create( const ti_sysbios_knl_Event_Params *__prms, xdc_runtime_Error_Block *__eb ); extern "C" void ti_sysbios_knl_Event_construct( ti_sysbios_knl_Event_Struct *__obj, const ti_sysbios_knl_Event_Params *__prms ); extern "C" void ti_sysbios_knl_Event_Object__delete__S( xdc_Ptr instp ); extern "C" void ti_sysbios_knl_Event_delete(ti_sysbios_knl_Event_Handle *instp); extern "C" void ti_sysbios_knl_Event_Object__destruct__S( xdc_Ptr objp ); extern "C" void ti_sysbios_knl_Event_destruct(ti_sysbios_knl_Event_Struct *obj); extern "C" xdc_Ptr ti_sysbios_knl_Event_Object__get__S( xdc_Ptr oarr, xdc_Int i ); extern "C" xdc_Ptr ti_sysbios_knl_Event_Object__first__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Event_Object__next__S( xdc_Ptr obj ); extern "C" void ti_sysbios_knl_Event_Params__init__S( xdc_Ptr dst, const void *src, xdc_SizeT psz, xdc_SizeT isz ); extern "C" xdc_UInt ti_sysbios_knl_Event_pend__E( ti_sysbios_knl_Event_Handle __inst, xdc_UInt andMask, xdc_UInt orMask, xdc_UInt32 timeout ); extern "C" void ti_sysbios_knl_Event_post__E( ti_sysbios_knl_Event_Handle __inst, xdc_UInt eventMask ); extern "C" xdc_UInt ti_sysbios_knl_Event_getPostedEvents__E( ti_sysbios_knl_Event_Handle __inst ); extern "C" void ti_sysbios_knl_Event_sync__E( ti_sysbios_knl_Event_Handle __inst, xdc_UInt eventId, xdc_UInt count ); extern "C" void ti_sysbios_knl_Event_pendTimeout__I( xdc_UArg arg ); extern "C" xdc_UInt ti_sysbios_knl_Event_checkEvents__I( ti_sysbios_knl_Event_Object *event, xdc_UInt andMask, xdc_UInt orMask ); static inline CT__ti_sysbios_knl_Event_Module__id ti_sysbios_knl_Event_Module_id( void ) { return ti_sysbios_knl_Event_Module__id__C; } static inline xdc_Bool ti_sysbios_knl_Event_Module_hasMask( void ) { return ti_sysbios_knl_Event_Module__diagsMask__C != 0; } static inline xdc_Bits16 ti_sysbios_knl_Event_Module_getMask( void ) { return ti_sysbios_knl_Event_Module__diagsMask__C != 0 ? *ti_sysbios_knl_Event_Module__diagsMask__C : 0; } static inline void ti_sysbios_knl_Event_Module_setMask( xdc_Bits16 mask ) { if (ti_sysbios_knl_Event_Module__diagsMask__C != 0) *ti_sysbios_knl_Event_Module__diagsMask__C = mask; } static inline void ti_sysbios_knl_Event_Params_init( ti_sysbios_knl_Event_Params *prms ) { if (prms) { ti_sysbios_knl_Event_Params__init__S(prms, 0, sizeof(ti_sysbios_knl_Event_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline void ti_sysbios_knl_Event_Params_copy(ti_sysbios_knl_Event_Params *dst, const ti_sysbios_knl_Event_Params *src) { if (dst) { ti_sysbios_knl_Event_Params__init__S(dst, (const void *)src, sizeof(ti_sysbios_knl_Event_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline ti_sysbios_knl_Event_Handle ti_sysbios_knl_Event_Object_get(ti_sysbios_knl_Event_Instance_State *oarr, int i) { return (ti_sysbios_knl_Event_Handle)ti_sysbios_knl_Event_Object__get__S(oarr, i); } static inline ti_sysbios_knl_Event_Handle ti_sysbios_knl_Event_Object_first( void ) { return (ti_sysbios_knl_Event_Handle)ti_sysbios_knl_Event_Object__first__S(); } static inline ti_sysbios_knl_Event_Handle ti_sysbios_knl_Event_Object_next( ti_sysbios_knl_Event_Object *obj ) { return (ti_sysbios_knl_Event_Handle)ti_sysbios_knl_Event_Object__next__S(obj); } static inline xdc_runtime_Types_Label *ti_sysbios_knl_Event_Handle_label( ti_sysbios_knl_Event_Handle inst, xdc_runtime_Types_Label *lab ) { return ti_sysbios_knl_Event_Handle__label__S(inst, lab); } static inline xdc_String ti_sysbios_knl_Event_Handle_name( ti_sysbios_knl_Event_Handle inst ) { xdc_runtime_Types_Label lab; return ti_sysbios_knl_Event_Handle__label__S(inst, &lab)->iname; } static inline ti_sysbios_knl_Event_Handle ti_sysbios_knl_Event_handle( ti_sysbios_knl_Event_Struct *str ) { return (ti_sysbios_knl_Event_Handle)str; } static inline ti_sysbios_knl_Event_Struct *ti_sysbios_knl_Event_struct( ti_sysbios_knl_Event_Handle inst ) { return (ti_sysbios_knl_Event_Struct*)inst; } extern "C" { } enum ti_sysbios_knl_Semaphore_Mode { ti_sysbios_knl_Semaphore_Mode_COUNTING = 0x0, ti_sysbios_knl_Semaphore_Mode_BINARY = 0x1, ti_sysbios_knl_Semaphore_Mode_COUNTING_PRIORITY = 0x2, ti_sysbios_knl_Semaphore_Mode_BINARY_PRIORITY = 0x3 }; typedef enum ti_sysbios_knl_Semaphore_Mode ti_sysbios_knl_Semaphore_Mode; typedef struct ti_sysbios_knl_Semaphore_Args__create { xdc_Int count; } ti_sysbios_knl_Semaphore_Args__create; enum ti_sysbios_knl_Semaphore_PendState { ti_sysbios_knl_Semaphore_PendState_TIMEOUT = 0, ti_sysbios_knl_Semaphore_PendState_POSTED = 1, ti_sysbios_knl_Semaphore_PendState_CLOCK_WAIT = 2, ti_sysbios_knl_Semaphore_PendState_WAIT_FOREVER = 3 }; typedef enum ti_sysbios_knl_Semaphore_PendState ti_sysbios_knl_Semaphore_PendState; struct ti_sysbios_knl_Semaphore_PendElem { ti_sysbios_knl_Task_PendElem tpElem; ti_sysbios_knl_Semaphore_PendState pendState; }; typedef xdc_Bits32 CT__ti_sysbios_knl_Semaphore_Module__diagsEnabled; extern "C" far const CT__ti_sysbios_knl_Semaphore_Module__diagsEnabled ti_sysbios_knl_Semaphore_Module__diagsEnabled__C; typedef xdc_Bits32 CT__ti_sysbios_knl_Semaphore_Module__diagsIncluded; extern "C" far const CT__ti_sysbios_knl_Semaphore_Module__diagsIncluded ti_sysbios_knl_Semaphore_Module__diagsIncluded__C; typedef xdc_Bits16 *CT__ti_sysbios_knl_Semaphore_Module__diagsMask; extern "C" far const CT__ti_sysbios_knl_Semaphore_Module__diagsMask ti_sysbios_knl_Semaphore_Module__diagsMask__C; typedef xdc_Ptr CT__ti_sysbios_knl_Semaphore_Module__gateObj; extern "C" far const CT__ti_sysbios_knl_Semaphore_Module__gateObj ti_sysbios_knl_Semaphore_Module__gateObj__C; typedef xdc_Ptr CT__ti_sysbios_knl_Semaphore_Module__gatePrms; extern "C" far const CT__ti_sysbios_knl_Semaphore_Module__gatePrms ti_sysbios_knl_Semaphore_Module__gatePrms__C; typedef xdc_runtime_Types_ModuleId CT__ti_sysbios_knl_Semaphore_Module__id; extern "C" far const CT__ti_sysbios_knl_Semaphore_Module__id ti_sysbios_knl_Semaphore_Module__id__C; typedef xdc_Bool CT__ti_sysbios_knl_Semaphore_Module__loggerDefined; extern "C" far const CT__ti_sysbios_knl_Semaphore_Module__loggerDefined ti_sysbios_knl_Semaphore_Module__loggerDefined__C; typedef xdc_Ptr CT__ti_sysbios_knl_Semaphore_Module__loggerObj; extern "C" far const CT__ti_sysbios_knl_Semaphore_Module__loggerObj ti_sysbios_knl_Semaphore_Module__loggerObj__C; typedef xdc_runtime_Types_LoggerFxn0 CT__ti_sysbios_knl_Semaphore_Module__loggerFxn0; extern "C" far const CT__ti_sysbios_knl_Semaphore_Module__loggerFxn0 ti_sysbios_knl_Semaphore_Module__loggerFxn0__C; typedef xdc_runtime_Types_LoggerFxn1 CT__ti_sysbios_knl_Semaphore_Module__loggerFxn1; extern "C" far const CT__ti_sysbios_knl_Semaphore_Module__loggerFxn1 ti_sysbios_knl_Semaphore_Module__loggerFxn1__C; typedef xdc_runtime_Types_LoggerFxn2 CT__ti_sysbios_knl_Semaphore_Module__loggerFxn2; extern "C" far const CT__ti_sysbios_knl_Semaphore_Module__loggerFxn2 ti_sysbios_knl_Semaphore_Module__loggerFxn2__C; typedef xdc_runtime_Types_LoggerFxn4 CT__ti_sysbios_knl_Semaphore_Module__loggerFxn4; extern "C" far const CT__ti_sysbios_knl_Semaphore_Module__loggerFxn4 ti_sysbios_knl_Semaphore_Module__loggerFxn4__C; typedef xdc_runtime_Types_LoggerFxn8 CT__ti_sysbios_knl_Semaphore_Module__loggerFxn8; extern "C" far const CT__ti_sysbios_knl_Semaphore_Module__loggerFxn8 ti_sysbios_knl_Semaphore_Module__loggerFxn8__C; typedef xdc_Bool (*CT__ti_sysbios_knl_Semaphore_Module__startupDoneFxn)(void); extern "C" far const CT__ti_sysbios_knl_Semaphore_Module__startupDoneFxn ti_sysbios_knl_Semaphore_Module__startupDoneFxn__C; typedef xdc_Int CT__ti_sysbios_knl_Semaphore_Object__count; extern "C" far const CT__ti_sysbios_knl_Semaphore_Object__count ti_sysbios_knl_Semaphore_Object__count__C; typedef xdc_runtime_IHeap_Handle CT__ti_sysbios_knl_Semaphore_Object__heap; extern "C" far const CT__ti_sysbios_knl_Semaphore_Object__heap ti_sysbios_knl_Semaphore_Object__heap__C; typedef xdc_SizeT CT__ti_sysbios_knl_Semaphore_Object__sizeof; extern "C" far const CT__ti_sysbios_knl_Semaphore_Object__sizeof ti_sysbios_knl_Semaphore_Object__sizeof__C; typedef xdc_Ptr CT__ti_sysbios_knl_Semaphore_Object__table; extern "C" far const CT__ti_sysbios_knl_Semaphore_Object__table ti_sysbios_knl_Semaphore_Object__table__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Semaphore_LM_post; extern "C" far const CT__ti_sysbios_knl_Semaphore_LM_post ti_sysbios_knl_Semaphore_LM_post__C; typedef xdc_runtime_Log_Event CT__ti_sysbios_knl_Semaphore_LM_pend; extern "C" far const CT__ti_sysbios_knl_Semaphore_LM_pend ti_sysbios_knl_Semaphore_LM_pend__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Semaphore_A_noEvents; extern "C" far const CT__ti_sysbios_knl_Semaphore_A_noEvents ti_sysbios_knl_Semaphore_A_noEvents__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Semaphore_A_invTimeout; extern "C" far const CT__ti_sysbios_knl_Semaphore_A_invTimeout ti_sysbios_knl_Semaphore_A_invTimeout__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Semaphore_A_badContext; extern "C" far const CT__ti_sysbios_knl_Semaphore_A_badContext ti_sysbios_knl_Semaphore_A_badContext__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Semaphore_A_overflow; extern "C" far const CT__ti_sysbios_knl_Semaphore_A_overflow ti_sysbios_knl_Semaphore_A_overflow__C; typedef xdc_runtime_Assert_Id CT__ti_sysbios_knl_Semaphore_A_pendTaskDisabled; extern "C" far const CT__ti_sysbios_knl_Semaphore_A_pendTaskDisabled ti_sysbios_knl_Semaphore_A_pendTaskDisabled__C; typedef xdc_Bool CT__ti_sysbios_knl_Semaphore_supportsEvents; extern "C" far const CT__ti_sysbios_knl_Semaphore_supportsEvents ti_sysbios_knl_Semaphore_supportsEvents__C; typedef xdc_Bool CT__ti_sysbios_knl_Semaphore_supportsPriority; extern "C" far const CT__ti_sysbios_knl_Semaphore_supportsPriority ti_sysbios_knl_Semaphore_supportsPriority__C; typedef void (*CT__ti_sysbios_knl_Semaphore_eventPost)(ti_sysbios_knl_Event_Handle, xdc_UInt); extern "C" far const CT__ti_sysbios_knl_Semaphore_eventPost ti_sysbios_knl_Semaphore_eventPost__C; typedef void (*CT__ti_sysbios_knl_Semaphore_eventSync)(ti_sysbios_knl_Event_Handle, xdc_UInt, xdc_UInt); extern "C" far const CT__ti_sysbios_knl_Semaphore_eventSync ti_sysbios_knl_Semaphore_eventSync__C; struct ti_sysbios_knl_Semaphore_Params { size_t __size; const void *__self; void *__fxns; xdc_runtime_IInstance_Params *instance; ti_sysbios_knl_Event_Handle event; xdc_UInt eventId; ti_sysbios_knl_Semaphore_Mode mode; xdc_runtime_IInstance_Params __iprms; }; struct ti_sysbios_knl_Semaphore_Struct { ti_sysbios_knl_Event_Handle __f0; xdc_UInt __f1; ti_sysbios_knl_Semaphore_Mode __f2; volatile xdc_UInt16 __f3; ti_sysbios_knl_Queue_Struct __f4; xdc_runtime_Types_CordAddr __name; }; extern "C" void ti_sysbios_knl_Semaphore_Instance_init__E(ti_sysbios_knl_Semaphore_Object *, xdc_Int count, const ti_sysbios_knl_Semaphore_Params *); extern "C" void ti_sysbios_knl_Semaphore_Instance_finalize__E( ti_sysbios_knl_Semaphore_Object* ); extern "C" xdc_runtime_Types_Label *ti_sysbios_knl_Semaphore_Handle__label__S( xdc_Ptr obj, xdc_runtime_Types_Label *lab ); extern "C" xdc_Bool ti_sysbios_knl_Semaphore_Module__startupDone__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Semaphore_Object__create__S( xdc_Ptr __oa, xdc_SizeT __osz, xdc_Ptr __aa, const xdc_UChar *__pa, xdc_SizeT __psz, xdc_runtime_Error_Block *__eb ); extern "C" ti_sysbios_knl_Semaphore_Handle ti_sysbios_knl_Semaphore_create( xdc_Int count, const ti_sysbios_knl_Semaphore_Params *__prms, xdc_runtime_Error_Block *__eb ); extern "C" void ti_sysbios_knl_Semaphore_construct( ti_sysbios_knl_Semaphore_Struct *__obj, xdc_Int count, const ti_sysbios_knl_Semaphore_Params *__prms ); extern "C" void ti_sysbios_knl_Semaphore_Object__delete__S( xdc_Ptr instp ); extern "C" void ti_sysbios_knl_Semaphore_delete(ti_sysbios_knl_Semaphore_Handle *instp); extern "C" void ti_sysbios_knl_Semaphore_Object__destruct__S( xdc_Ptr objp ); extern "C" void ti_sysbios_knl_Semaphore_destruct(ti_sysbios_knl_Semaphore_Struct *obj); extern "C" xdc_Ptr ti_sysbios_knl_Semaphore_Object__get__S( xdc_Ptr oarr, xdc_Int i ); extern "C" xdc_Ptr ti_sysbios_knl_Semaphore_Object__first__S( void ); extern "C" xdc_Ptr ti_sysbios_knl_Semaphore_Object__next__S( xdc_Ptr obj ); extern "C" void ti_sysbios_knl_Semaphore_Params__init__S( xdc_Ptr dst, const void *src, xdc_SizeT psz, xdc_SizeT isz ); extern "C" xdc_Int ti_sysbios_knl_Semaphore_getCount__E( ti_sysbios_knl_Semaphore_Handle __inst ); extern "C" xdc_Bool ti_sysbios_knl_Semaphore_pend__E( ti_sysbios_knl_Semaphore_Handle __inst, xdc_UInt32 timeout ); extern "C" void ti_sysbios_knl_Semaphore_post__E( ti_sysbios_knl_Semaphore_Handle __inst ); extern "C" void ti_sysbios_knl_Semaphore_registerEvent__E( ti_sysbios_knl_Semaphore_Handle __inst, ti_sysbios_knl_Event_Handle event, xdc_UInt eventId ); extern "C" void ti_sysbios_knl_Semaphore_reset__E( ti_sysbios_knl_Semaphore_Handle __inst, xdc_Int count ); extern "C" void ti_sysbios_knl_Semaphore_pendTimeout__I( xdc_UArg arg ); static inline CT__ti_sysbios_knl_Semaphore_Module__id ti_sysbios_knl_Semaphore_Module_id( void ) { return ti_sysbios_knl_Semaphore_Module__id__C; } static inline xdc_Bool ti_sysbios_knl_Semaphore_Module_hasMask( void ) { return ti_sysbios_knl_Semaphore_Module__diagsMask__C != 0; } static inline xdc_Bits16 ti_sysbios_knl_Semaphore_Module_getMask( void ) { return ti_sysbios_knl_Semaphore_Module__diagsMask__C != 0 ? *ti_sysbios_knl_Semaphore_Module__diagsMask__C : 0; } static inline void ti_sysbios_knl_Semaphore_Module_setMask( xdc_Bits16 mask ) { if (ti_sysbios_knl_Semaphore_Module__diagsMask__C != 0) *ti_sysbios_knl_Semaphore_Module__diagsMask__C = mask; } static inline void ti_sysbios_knl_Semaphore_Params_init( ti_sysbios_knl_Semaphore_Params *prms ) { if (prms) { ti_sysbios_knl_Semaphore_Params__init__S(prms, 0, sizeof(ti_sysbios_knl_Semaphore_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline void ti_sysbios_knl_Semaphore_Params_copy(ti_sysbios_knl_Semaphore_Params *dst, const ti_sysbios_knl_Semaphore_Params *src) { if (dst) { ti_sysbios_knl_Semaphore_Params__init__S(dst, (const void *)src, sizeof(ti_sysbios_knl_Semaphore_Params), sizeof(xdc_runtime_IInstance_Params)); } } static inline ti_sysbios_knl_Semaphore_Handle ti_sysbios_knl_Semaphore_Object_get(ti_sysbios_knl_Semaphore_Instance_State *oarr, int i) { return (ti_sysbios_knl_Semaphore_Handle)ti_sysbios_knl_Semaphore_Object__get__S(oarr, i); } static inline ti_sysbios_knl_Semaphore_Handle ti_sysbios_knl_Semaphore_Object_first( void ) { return (ti_sysbios_knl_Semaphore_Handle)ti_sysbios_knl_Semaphore_Object__first__S(); } static inline ti_sysbios_knl_Semaphore_Handle ti_sysbios_knl_Semaphore_Object_next( ti_sysbios_knl_Semaphore_Object *obj ) { return (ti_sysbios_knl_Semaphore_Handle)ti_sysbios_knl_Semaphore_Object__next__S(obj); } static inline xdc_runtime_Types_Label *ti_sysbios_knl_Semaphore_Handle_label( ti_sysbios_knl_Semaphore_Handle inst, xdc_runtime_Types_Label *lab ) { return ti_sysbios_knl_Semaphore_Handle__label__S(inst, lab); } static inline xdc_String ti_sysbios_knl_Semaphore_Handle_name( ti_sysbios_knl_Semaphore_Handle inst ) { xdc_runtime_Types_Label lab; return ti_sysbios_knl_Semaphore_Handle__label__S(inst, &lab)->iname; } static inline ti_sysbios_knl_Semaphore_Handle ti_sysbios_knl_Semaphore_handle( ti_sysbios_knl_Semaphore_Struct *str ) { return (ti_sysbios_knl_Semaphore_Handle)str; } static inline ti_sysbios_knl_Semaphore_Struct *ti_sysbios_knl_Semaphore_struct( ti_sysbios_knl_Semaphore_Handle inst ) { return (ti_sysbios_knl_Semaphore_Struct*)inst; } struct timespec { time_t tv_sec; long tv_nsec; }; struct itimerspec { struct timespec it_interval; struct timespec it_value; }; typedef unsigned long timer_t; typedef uint32_t clockid_t; typedef unsigned long useconds_t; typedef struct pthread_attr_t { int priority; void *stack; size_t stacksize; size_t guardsize; int detachstate; } pthread_attr_t; typedef uint32_t pthread_barrierattr_t; typedef uint32_t pthread_condattr_t; typedef void *pthread_key_t; typedef struct pthread_mutexattr_t { int type; int protocol; int prioceiling; } pthread_mutexattr_t; typedef uint32_t pthread_rwlockattr_t; typedef void *pthread_t; typedef struct pthread_barrier_t { ti_sysbios_knl_Semaphore_Struct sem; int count; int pendCount; } pthread_barrier_t; typedef struct pthread_cond_t { ti_sysbios_knl_Queue_Struct waitList; } pthread_cond_t; typedef void *pthread_mutex_t; typedef uint32_t pthread_once_t; typedef struct pthread_rwlock_t { ti_sysbios_knl_Semaphore_Struct sem; ti_sysbios_knl_Semaphore_Struct readSem; int activeReaderCnt; int blockedReaderCnt; pthread_t owner; } pthread_rwlock_t; struct _pthread_cleanup_context { void (*fxn)(void *); void *arg; int cancelType; struct _pthread_cleanup_context *next; }; typedef union sigval { int sival_int; void *sival_ptr; } sigval; typedef struct sigevent { int sigev_notify; int sigev_signo; sigval sigev_value; void (*sigev_notify_function)(sigval val); pthread_attr_t *sigev_notify_attributes; } sigevent; } using std::size_t; using std::clock_t; using std::clock; using std::tm; using std::TZ; using std::_tz; using std::__time32_t; using std::__time64_t; using std::__time32; using std::__time64; using std::__ctime32; using std::__ctime64; using std::__difftime32; using std::__difftime64; using std::__gmtime32; using std::__gmtime64; using std::__localtime32; using std::__localtime64; using std::__mktime32; using std::__mktime64; using std::time_t; using std::time; using std::ctime; using std::difftime; using std::gmtime; using std::localtime; using std::mktime; using std::asctime; using std::strftime; extern int clock_gettime(clockid_t clockId, struct timespec *ts); extern int clock_settime(clockid_t clockId, const struct timespec *ts); extern int timer_create(clockid_t clockId, struct sigevent *evp, timer_t *timerid); extern int timer_delete(timer_t timerid); extern int timer_gettime(timer_t timerid, struct itimerspec *its); extern int timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); } typedef struct sem_t { ti_sysbios_knl_Semaphore_Struct sem; } sem_t; int sem_destroy(sem_t *sem); int sem_getvalue(sem_t *sem, int *value); int sem_init(sem_t *sem, int pshared, unsigned value); int sem_post(sem_t *sem); int sem_timedwait(sem_t *sem, const struct timespec *abstime); int sem_trywait(sem_t *sem); int sem_wait(sem_t *sem); } extern "C" { extern "C" { struct sched_param { int sched_priority; }; extern int sched_yield(void); } extern int pthread_attr_destroy(pthread_attr_t *attr); extern int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate); extern int pthread_attr_getguardsize(const pthread_attr_t *attr, size_t *guardsize); extern int pthread_attr_getschedparam(const pthread_attr_t *attr, struct sched_param *schedparam); extern int pthread_attr_getstack(const pthread_attr_t *attr, void **stackaddr, size_t *stacksize); extern int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize); extern int pthread_attr_init(pthread_attr_t *attr); extern int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachedstate); extern int pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize); extern int pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *schedparam); extern int pthread_attr_setstack(pthread_attr_t *attr, void *stackaddr, size_t stacksize); extern int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize); extern int pthread_cancel(pthread_t pthread); extern void _pthread_cleanup_pop(struct _pthread_cleanup_context *context, int execute); extern void _pthread_cleanup_push(struct _pthread_cleanup_context *context, void (*fxn)(void *), void *arg); extern int pthread_create(pthread_t *newthread, const pthread_attr_t *attr, void *(*startroutine)(void *), void *arg); extern int pthread_detach(pthread_t pthread); extern int pthread_equal(pthread_t pt1, pthread_t pt2); extern void pthread_exit(void *ptr); extern int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param); extern int pthread_join(pthread_t th, void **thread_return); extern int pthread_once(pthread_once_t *once, void (*initFxn)(void)); extern pthread_t pthread_self(void); extern int pthread_setcancelstate(int state, int *oldstate); extern int pthread_setschedparam(pthread_t pthread, int policy, const struct sched_param *param); extern int pthread_barrierattr_destroy(pthread_barrierattr_t *attr); extern int pthread_barrierattr_init(pthread_barrierattr_t *attr); extern int pthread_barrier_destroy(pthread_barrier_t *barrier); extern int pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned count); extern int pthread_barrier_wait(pthread_barrier_t *barrier); extern int pthread_condattr_destroy(pthread_condattr_t *attr); extern int pthread_condattr_init(pthread_condattr_t * attr); extern int pthread_cond_broadcast(pthread_cond_t *cond); extern int pthread_cond_destroy(pthread_cond_t *cond); extern int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr); extern int pthread_cond_signal(pthread_cond_t *cond); extern int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime); extern int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex); extern int pthread_key_create(pthread_key_t *key, void (*destructor)(void*)); extern int pthread_key_delete(pthread_key_t key); extern void *pthread_getspecific(pthread_key_t key); extern int pthread_setspecific(pthread_key_t key, const void *value); extern int pthread_mutexattr_destroy(pthread_mutexattr_t *attr); extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type); extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *attr, int *prioceiling); extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr, int *protocol); extern int pthread_mutexattr_init(pthread_mutexattr_t *attr); extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr, int prioceiling); extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, int protocol); extern int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type); extern int pthread_mutex_destroy(pthread_mutex_t *mutex); extern int pthread_mutex_getprioceiling(const pthread_mutex_t *mutex, int *prioceiling); extern int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr); extern int pthread_mutex_lock(pthread_mutex_t *mutex); extern int pthread_mutex_setprioceiling(pthread_mutex_t *mutex, int prioceiling, int *oldceiling); extern int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abstime); extern int pthread_mutex_trylock(pthread_mutex_t *mutex); extern int pthread_mutex_unlock(pthread_mutex_t *mutex); extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr); extern int pthread_rwlockattr_init(pthread_rwlockattr_t * attr); extern int pthread_rwlock_destroy(pthread_rwlock_t *rwlock); extern int pthread_rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr); extern int pthread_rwlock_rdlock(pthread_rwlock_t *rwlock); extern int pthread_rwlock_timedrdlock(pthread_rwlock_t *rwlock, const struct timespec *abstime); extern int pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock, const struct timespec *abstime); extern int pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock); extern int pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock); extern int pthread_rwlock_unlock(pthread_rwlock_t *rwlock); extern int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock); } const int MaxqSize = 64; template class CConqueue { private: int front, rear, count; DataType qlist[MaxqSize]; pthread_mutex_t mutex; sem_t queue_sem; public: CConqueue(); ~CConqueue(); void Insert(const DataType& item); DataType Pop(void); DataType Front(void) const; int Length(void) const; int IsEmpty(void) const; int Full(void) const; }; template CConqueue::CConqueue() : front(0), rear(0), count(0) { sem_init(&queue_sem, 0, 0); pthread_mutex_init(&mutex, 0); pthread_mutex_unlock(&mutex); } template CConqueue::~CConqueue() { pthread_mutex_unlock(&mutex); } template int CConqueue::Length(void) const { return count; } template int CConqueue::IsEmpty(void) const { return (count == 0); } template int CConqueue::Full(void) const { return (count == MaxqSize); } template void CConqueue::Insert(const DataType& item) { pthread_mutex_lock(&mutex); if(!Full()) { count++; qlist[rear] = item; rear = (rear + 1) % MaxqSize; sem_post(&queue_sem); } pthread_mutex_unlock(&mutex); } template DataType CConqueue::Pop(void) { DataType temp; sem_wait(&queue_sem); pthread_mutex_lock(&mutex); if(!IsEmpty()) { temp = Front(); count--; front = (front + 1) % MaxqSize; } else { } pthread_mutex_unlock(&mutex); return temp; } template DataType CConqueue::Front(void) const { return qlist[front]; } class MutexCls { void* handle; public: MutexCls(); MutexCls(char* name); ~MutexCls(); void Post(); void Pend(); }; #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::va_list; #pragma diag_pop using std::size_t; using std::FILE; using std::fpos_t; using std::_ftable; using std::__TI_tmpnams; using std::remove; using std::rename; using std::tmpfile; using std::tmpnam; using std::fclose; using std::fopen; using std::freopen; using std::setbuf; using std::setvbuf; using std::fflush; using std::fprintf; using std::fscanf; using std::printf; using std::scanf; using std::sprintf; using std::snprintf; using std::sscanf; using std::vfprintf; using std::vprintf; using std::vsprintf; using std::vsnprintf; using std::fgetc; using std::fgets; using std::fputc; using std::fputs; using std::getc; using std::getchar; using std::gets; using std::putc; using std::putchar; using std::puts; using std::ungetc; using std::fread; using std::fwrite; using std::fgetpos; using std::fseek; using std::fsetpos; using std::ftell; using std::rewind; using std::clearerr; using std::feof; using std::ferror; using std::perror; class ActiveCls { private: pthread_t thread; protected: void attach(void* (*tsk_fxn)(void* arg), int priority) { pthread_attr_t params; pthread_attr_init(¶ms); pthread_attr_setstacksize(¶ms, 0x100000); sched_param sch; pthread_attr_getschedparam(¶ms, &sch); sch.sched_priority = priority; pthread_create(&thread, ¶ms, tsk_fxn, this); pthread_setschedparam(thread, 0, &sch); } static void* run(void* obj) { return ((ActiveCls*) obj)->Run(); } virtual void* Run() { xdc_runtime_System_printf__E("Warning.. Run() function is not implemented for this class.\n"); xdc_runtime_System_flush__E();; return 0; } ActiveCls(int pri) { attach(&ActiveCls::run, pri); } ActiveCls() { xdc_runtime_System_printf__E("Warning.. Class priority is not set, defaulting to priority 1.\n"); xdc_runtime_System_flush__E();; attach(&ActiveCls::run, 1); } }; #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::size_t; using std::strlen; using std::strcpy; using std::strncpy; using std::strcat; using std::strncat; using std::strchr; using std::strrchr; using std::strcmp; using std::strncmp; using std::strcoll; using std::strxfrm; using std::strpbrk; using std::strspn; using std::strcspn; using std::strstr; using std::strtok; using std::strerror; using std::strdup; using std::memmove; using std::memcpy; using std::memcmp; using std::memchr; using std::memset; #pragma diag_pop namespace SystemManager { typedef enum { off = 0, on = 1 } OnOffEnuType; typedef enum { FireStatusEnuType_Safe = 0, FireStatusEnuType_Firing = 1 } FireStatusEnuType; typedef struct { LosStatusEnuType Los :4; uint32 GimbalStatus :4; uint32 TrackOffSetReturn :4; uint32 TrackOffsetProgress :4; uint32 TrackRate :4; uint32 :12; real32 BodyAzimuthPosition; real32 BodyElevationPosition; real32 AzimuthRate; real32 EleveationRate; } LosStatusType; typedef struct { uint32 PlatformYear; uint32 PlatformMonth; uint32 PlatformDay; uint32 PlatformHour; uint32 PlatformMinute; uint32 PlatformSecond; } DateAndTimeStruct; typedef struct { uint32 IrCamPolarity :4; uint32 IrCamFreeze :4; uint32 IrCamFov :4; uint32 IrCamFocus :4; uint32 IrCamVideoMod :4; uint32 IrCamManualLevel :4; uint32 IrCamManualGain :4; uint32 :4; uint32 NirCamPolarity :4; uint32 NirCamFreeze :4; uint32 NirCamFov :4; uint32 NirCamFocus :4; uint32 NirCamVideoMod :4; uint32 Wavelength :4; uint32 :8; uint32 SymbologDecLevel :8; uint32 rsv3 :24; } VideoSettingsType; union VideoSettingsStatusType { struct { uint32 IrCamPolarity :4; uint32 IrCamFreeze :4; uint32 IrCamFov :4; uint32 IrCamFocus :4; uint32 IrCamVideoMod :4; uint32 IrCamManualLevel :4; uint32 IrCamManualGain :4; uint32 :4; uint32 NirCamPolarity :4; uint32 NirCamFreeze :4; uint32 NirCamFov :4; uint32 NirCamFocus :4; uint32 NirCamVideoMod :4; uint32 Wavelength :4; uint32 :8; uint16 IRmanLevelVal; uint16 IRmanGainVal; uint32 SymbologDecLevel :8; uint32 rsv3 :24; }; uint32 data[4]; }; namespace RangeFinder { typedef enum { LrfArmCmdEnu_NoChange = 0, LrfArmCmdEnu_DisArm = 1, LrfArmCmdEnu_Arm = 2 } LrfArmCmdEnuType; typedef enum { LrfFireEnu_NoChange = 0, LrfFireEnu_Start = 1, LrfFireEnu_Stop = 2 } LrfFireCmdEnuType; typedef enum { LrfArmStatusEnu_Safe = 0, LrfArmStatusEnu_Armed = 1 } LrfArmStatusEnuType; typedef enum { LrfRangeLogicCmdEnu_First = 1, LrfRangeLogicCmdEnu_Last = 2 } LrfRangeLogicCmdEnuType; typedef enum { LrfRangeLogicStatusEnu_First = 0, LrfRangeLogicStatusEnu_Last = 1, } LrfRangeLogicStatusEnuType; typedef enum { LrfMaskStatusEnu_NotMasked = 0, LrfMaskStatusEnu_Masked = 1 } LrfMaskStatusEnuType; typedef struct { uint32 ArmCmd :4; uint32 FireCmd :4; uint32 RangeLogic :4; uint32 rsv :20; } LrfCmdType; typedef struct { uint32 OnOffStatus :4; uint32 ArmStatus :4; uint32 FireStatus :4; uint32 LaseBeforeArm :4; uint32 Masked :4; uint32 ArmSwitch :4; uint32 RangeLogic :4; uint32 TemperatureStatus :4; } LrfStatusType; } namespace Illuminator { typedef enum { LIArmCmdEnu_NoChange = 0, LIArmCmdEnu_DisArm = 1, LIArmCmdEnu_Arm = 2 } LIArmCmdEnuType; typedef enum { LIFireEnu_NoChange = 0, LIFireEnu_Start = 1, LIFireEnu_Stop = 2 } LIFireCmdEnuType; typedef enum { LIArmStatusEnu_Safe = 0, LIArmStatusEnu_Armed = 1 } LIArmStatusEnuType; typedef struct { uint32 ArmCmd :4; uint32 FireCmd :4; uint32 Rsv :24; } LICmdType; typedef struct { uint32 OnOffStatus :4; uint32 ArmStatus :4; uint32 FireStatus :4; uint32 LaseBeforeArm :4; uint32 Masked :4; uint32 TemperatureStatus :4; uint32 ArmSwitch :4; uint32 rsv :4; } LIStatusType; } namespace HighPowerLaser { typedef enum { HPLFireStatusEnu_NotFirable = 1, HPLFireStatusEnu_Firable = 2 } HPLFireableStatusEnuType; typedef enum { HPLMaskStatusEnu_NotMasked = 0, HPLMaskStatusEnu_Masked = 1 } HPLMaskStatusEnuType; typedef enum { HPLStatusEnu_DisArmed = 0, HPLStatusEnu_Armed = 1, HPLStatusEnu_ArmedAndFiring = 2 } HPLArmAndFireStatusEnu; typedef enum { HPLControlBypassEnu_Disable = 1, HPLControlBypassEnu_Enable = 2 } HPLControlBypassEnuType; typedef struct { HPLArmAndFireStatusEnu status :4; HPLControlBypassEnuType bypass :4; uint32 :24; } HPLInfoType; typedef struct { uint32 firebility :4; uint32 mask :4; uint32 :24; } HPLUsabilityType; } } using namespace SystemManager::RangeFinder; using namespace SystemManager::Illuminator; using namespace SystemManager::HighPowerLaser; using namespace SystemManager; #pragma pack(push) #pragma pack(1) struct McHeader { uint32 Length; uint32 Id; struct { uint32 seconds; uint32 fraction; } DeliveryTime; }; struct McCommand { McHeader head; uint8 data[120]; McCommand() { memset(this, 0, sizeof(*this)); } }; typedef McCommand McStatus; struct SystemModeCmdStruct { McHeader hdr; SystemModeCmdEnuType ModeCmd :8; SystemSubModeEnuType SubModeCmd :8; uint32 rsv :16; SystemModeCmdStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 101; hdr.Length = sizeof(*this); } }; struct IrTrkCmdStruct { McHeader hdr; uint32 TrackerControl :8; uint32 rsv :24; IrTrkCmdStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 102; hdr.Length = sizeof(*this); } }; struct NirTrkCmdStruct { McHeader hdr; uint32 TrackerControl :8; uint32 rsv :24; NirTrkCmdStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 103; hdr.Length = sizeof(*this); } }; struct VideoControlMsgStruct { McHeader hdr; VideoSettingsType settings; VideoControlMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 104; hdr.Length = sizeof(*this); } }; struct LrfControlMsgStruct { McHeader hdr; LrfCmdType LrfCmd; LrfControlMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 105; hdr.Length = sizeof(*this); } }; struct LUIControlMsgStruct { McHeader hdr; LICmdType cmd; LUIControlMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 106; hdr.Length = sizeof(*this); } }; struct BITStatusReqMsgStruct { McHeader hdr; BITStatusReqMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 110; hdr.Length = sizeof(*this); } }; struct ParallaxCtrlMsgStruct { McHeader hdr; uint32 ParallaxCmnd :4; uint32 rsv :28; real32 ParallaxX; real32 ParallaxY; real32 ParallaxZ; ParallaxCtrlMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 111; hdr.Length = sizeof(*this); } }; struct CorrectionAnglesCtrlMsgStruct { McHeader hdr; uint32 CorrectionCmnd :8; uint32 Rsv :24; real32 BearingCmnd; real32 ElevationCorrection; real32 TiltRoll; real32 TiltPitch; CorrectionAnglesCtrlMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 112; hdr.Length = sizeof(*this); } }; struct TimeMsgStruct { McHeader hdr; DateAndTimeStruct data; TimeMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 116; hdr.Length = sizeof(*this); } }; struct SoftwareVersionRqMsgStruct { McHeader hdr; SoftwareVersionRqMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 117; hdr.Length = sizeof(*this); } }; struct ReadSettingsMsgStruct { McHeader hdr; uint32 ReadSettings :4; uint32 rsv :28; ReadSettingsMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 118; hdr.Length = sizeof(*this); } }; struct TargetDataRqMsgStruct { McHeader hdr; TargetDataRqMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 122; hdr.Length = sizeof(*this); } }; struct MaskingAnglesMsg1Struct { McHeader hdr; uint32 MaskingAnglesControl; struct { real32 NoLaserBeginBearing; real32 NoLaserEndBearing; real32 NoLaserBeginElevation; real32 NoLaserEndElevation; } region[16]; MaskingAnglesMsg1Struct() { memset(this, 0, sizeof(*this)); hdr.Id = 113; hdr.Length = sizeof(*this); } }; struct MaskingAnglesMsg2Struct { McHeader hdr; uint32 MaskingAnglesControl; struct { real32 NoLaserBeginBearing; real32 NoLaserEndBearing; real32 NoLaserBeginElevation; real32 NoLaserEndElevation; } region[16]; MaskingAnglesMsg2Struct() { memset(this, 0, sizeof(*this)); hdr.Id = 114; hdr.Length = sizeof(*this); } }; struct MaskingAnglesMsg3Struct { McHeader hdr; uint32 MaskingAnglesControl; struct { real32 NoLaserBeginBearing; real32 NoLaserEndBearing; real32 NoLaserBeginElevation; real32 NoLaserEndElevation; } region[16]; MaskingAnglesMsg3Struct() { memset(this, 0, sizeof(*this)); hdr.Id = 115; hdr.Length = sizeof(*this); } }; struct LosControlMsgStruct { McHeader hdr; struct { uint32 mode :4; uint32 TrackOffset :4; uint32 TrackOffsetRate :4; uint32 :20; } LosCmd; real32 AzimuthRate; real32 EleveationRate; real32 AzimuthPosition; real32 ElevationPosition; real32 CuedPointBearing; real32 CuedPointElevation; uint32 CuedPointRange; real32 CuedPointTargetVelocity_X; real32 CuedPointTargetVelocity_Y; real32 CuedPointTargetVelocity_Z; struct { uint32 CuedTargetVelocityValidity :8; uint32 CuedTargetTip :8; uint32 rsv :16; } CuedPointTargetDataStatus; struct { uint32 secs; uint32 fraction; } CuedPointTargetDataTimeValidity; LosControlMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 121; hdr.Length = sizeof(*this); } }; struct SystemStatusMsgStruct { McHeader hdr; uint32 mode :4; uint32 submode :4; uint32 systemTemp :4; uint32 IrTemp :4; uint32 NirTemp :4; uint32 rsv :12; SystemStatusMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 1; mode = SystemModeStatusEnu_StandBy; submode = SystemSubModeEnu_Manual; hdr.Length = sizeof(*this); } }; struct IrTrkStatusStruct { McHeader hdr; uint32 TrackerStatus :8; uint32 rsv :24; IrTrkStatusStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 2; hdr.Length = sizeof(*this); } }; struct NirTrkStatusStruct { McHeader hdr; uint32 TrackerStatus :8; uint32 rsv :24; NirTrkStatusStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 3; hdr.Length = sizeof(*this); } }; struct VideoStatusMsgStruct { McHeader hdr; VideoSettingsStatusType status; VideoStatusMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 4; hdr.Length = sizeof(*this); } }; struct LrfStatusMsgStruct { McHeader hdr; LrfStatusType LrfStatus; LrfStatusMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 5; hdr.Length = sizeof(*this); } }; struct LIStatusMsgStruct { McHeader hdr; LIStatusType Status; LIStatusMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 6; hdr.Length = sizeof(*this); } }; struct BITStatusMsgStruct { McHeader hdr; uint32 PBITReport[16]; uint32 CBITReport[16]; uint32 IBITReport[16]; BITStatusMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 0xA; hdr.Length = sizeof(*this); } }; struct ParallaxStatusMsgStruct { McHeader hdr; real32 ParallaxX; real32 ParallaxY; real32 ParallaxZ; ParallaxStatusMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 11; hdr.Length = sizeof(*this); } }; struct CorrectionAnglesStatusMsgStruct { McHeader hdr; real32 BearingCorrection; real32 ElevationCorrection; real32 TiltRoll; real32 TiltPitch; CorrectionAnglesStatusMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 12; hdr.Length = sizeof(*this); } }; struct MaskingAnglesStatus1MsgStruct { McHeader hdr; uint32 MaskingAnglesControl; struct { real32 NoLaserBeginBearing; real32 NoLaserEndBearing; real32 NoLaserBeginElevation; real32 NoLaserEndElevation; } region[16]; MaskingAnglesStatus1MsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 13; hdr.Length = sizeof(*this); } }; struct MaskingAnglesStatus2MsgStruct { McHeader hdr; uint32 MaskingAnglesControl; struct { real32 NoLaserBeginBearing; real32 NoLaserEndBearing; real32 NoLaserBeginElevation; real32 NoLaserEndElevation; } region[16]; MaskingAnglesStatus2MsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 14; hdr.Length = sizeof(*this); } }; struct MaskingAnglesStatus3MsgStruct { McHeader hdr; uint32 MaskingAnglesControl; struct { real32 NoLaserBeginBearing; real32 NoLaserEndBearing; real32 NoLaserBeginElevation; real32 NoLaserEndElevation; } region[16]; MaskingAnglesStatus3MsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 15; hdr.Length = sizeof(*this); } }; struct PlatformDateAndTimeReqMsgStruct { McHeader hdr; PlatformDateAndTimeReqMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 16; hdr.Length = sizeof(*this); } }; struct SoftwareVersionMsgStruct { McHeader hdr; uint32 RevisionNo; uint32 VersionNo; uint32 ConfigurationNo; SoftwareVersionMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 17; hdr.Length = sizeof(*this); } }; struct HtsInstallationAnglesMsg { McHeader hdr; real32 RollAngle; real32 YawAngle; real32 PitchAngle; HtsInstallationAnglesMsg() { memset(this, 0, sizeof(*this)); hdr.Id = 18; hdr.Length = sizeof(*this); } }; struct LosStatusMsgStruct { McHeader hdr; LosStatusType status; LosStatusMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 21; hdr.Length = sizeof(*this); } }; struct TargetDataMsgStruct { McHeader hdr; struct { uint32 TargetRangeValidit :4; uint32 TargetRangeSource :4; uint32 TargetRangeErrorValidity :4; uint32 rsv :20; } TargetDataStatus; struct { uint32 secs; uint32 fraction; } TimeValidity; uint32 TargetRange; real32 TargetRangeError; TargetDataMsgStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 22; hdr.Length = sizeof(*this); } }; struct HTS2KKS_HPLFirebilityStruct { McHeader hdr; HPLUsabilityType info; HTS2KKS_HPLFirebilityStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 0x7; hdr.Length = sizeof(*this); } }; struct KKS2HTS_HPLInfoStruct { McHeader hdr; HPLInfoType info; KKS2HTS_HPLInfoStruct() { memset(this, 0, sizeof(*this)); hdr.Id = 107; hdr.Length = sizeof(*this); } }; #pragma pack(pop) class SystemManagerCls; class InterCoreCls; class MaintenanceCls; class BitCls; class MissionComputerCls: public ActiveCls { public: MissionComputerCls() : ActiveCls(2), itsSystemManagerCls(0), itsInterCoreCls(0), itsBitCls(0), ReaderObj(this), WriterObj(this) { ; } ~MissionComputerCls(); private: void SetUdpPort(UdpServer* p_UdpPort); public: SystemManagerCls* getItsSystemManagerCls() const; void setItsSystemManagerCls(SystemManagerCls* p_SystemManagerCls); void setItsMaintenanceCls(MaintenanceCls* p_MaintenanceCls); void SetItsInterCoreCls(InterCoreCls* p_InterCoreCls); BitCls* getItsBitCls() const; void setItsBitCls(BitCls* p_BitCls); void EnableIOPortInThisTask() const; public: void __setItsSystemManagerCls(SystemManagerCls* p_SystemManagerCls); void _setItsSystemManagerCls(SystemManagerCls* p_SystemManagerCls); void _clearItsSystemManagerCls(); void __setItsMaintenanceCls(MaintenanceCls* p_MaintenanceCls); void _setItsMaintenanceCls(MaintenanceCls* p_MaintenanceCls); void ClearItsMaintenanceCls(); void __setItsBitCls(BitCls* p_BitCls); void _setItsBitCls(BitCls* p_BitCls); void _clearItsBitCls(); protected: void cleanUpRelations(); protected: BitCls* itsBitCls; SystemManagerCls* itsSystemManagerCls; MaintenanceCls* itsMaintenanceCls; UdpServer* udpPort; InterCoreCls* itsInterCoreCls; private: CConqueue CommandQueue; CConqueue StatusQueue; SystemStatusMsgStruct systemStatusMsg; LrfStatusMsgStruct LrfStatusMsg; LIStatusMsgStruct LIStatusMsg; SoftwareVersionMsgStruct SoftwareVersionMsg; HTS2KKS_HPLFirebilityStruct HTS2KKS_HPLFirebilityMsg; protected: MutexCls RWMutex; public: void Process(); void Send(void*, int); void Read(); void UpdateMcStatus(SystemModeStatusEnuType mode, SystemSubModeEnuType submode); void UpdateMcStatus(LrfStatusType status); void UpdateMcStatus(LIStatusType status); void UpdateMcStatus(HPLUsabilityType& status); void UpdateMcStatus(LosStatusType& status); void UpdateMcStatus(VideoSettingsStatusType& status); void UpdateMcStatus_IRTrk(TrkTargetStatusEnu); void UpdateMcStatus_NIRTrk(TrkTargetStatusEnu); virtual void* Run(); protected: UdpServer* itsUdpPort; void setItsUdpPort(UdpServer* p_UdpPort) { itsUdpPort = p_UdpPort; } UdpServer* getItsUdpPort() const { return itsUdpPort; } public: class Reader: public ActiveCls { MissionComputerCls* itsOuterCls; public: Reader(MissionComputerCls* p_OuterCls) : ActiveCls(6) { itsOuterCls = p_OuterCls; } public: virtual void* Run(); } ReaderObj; class Sender: public ActiveCls { MissionComputerCls* itsOuterCls; public: Sender(MissionComputerCls* p_OuterCls) : ActiveCls(4) { itsOuterCls = p_OuterCls; } public: virtual void* Run(); } WriterObj; }; #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::size_t; using std::strlen; using std::strcpy; using std::strncpy; using std::strcat; using std::strncat; using std::strchr; using std::strrchr; using std::strcmp; using std::strncmp; using std::strcoll; using std::strxfrm; using std::strpbrk; using std::strspn; using std::strcspn; using std::strstr; using std::strtok; using std::strerror; using std::strdup; using std::memmove; using std::memcpy; using std::memcmp; using std::memchr; using std::memset; #pragma diag_pop class SemaphoreCls { private: void* HMailBox; public: SemaphoreCls(int queueSize, char* nm); ~SemaphoreCls(); int Pend() ; int Pend(unsigned int timeOut); bool Post(unsigned char semId); int ReleaseAll(); private: void * HSemaphore[256]; int NumOfSem; }; #pragma pack(push) #pragma pack(1) extern "C" void WriteInternalRam(void* dataPtr, int size, int offset); extern "C" void ReadInternalRam(void* dataPtr, int size, int offset); class InterCoreCls { private: SemaphoreCls* sem[8]; public: InterCoreCls(int me); ~InterCoreCls(); void Send(void* sendBuf, int size, int destCore); int Read(void* readBuf, int destCore); void Resume(); bool IsComFailed(CoreNameEnuType core_x, CoreNameEnuType core_y); int Wait(); private: void notifyPeer(CoreNameEnuType peerCore); private: CoreNameEnuType myId; int coreMesh[8][8]; uint32 messageCountsBetweenCores[8][8]; struct CoreHeaderStruct { uint32 head :16; uint32 sourceCoreId :8; uint32 destCoreId :8; uint32 messageCount :32; uint32 messagesize; }; bool FailList[8][8]; }; #pragma pack(pop) #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::va_list; #pragma diag_pop const unsigned int NUM_OF_SYS_BITS = 160; const unsigned int NUM_OF_SLC_BITS = 160; const unsigned int NUM_OF_SLE_BITS = 150; const unsigned int NUM_OF_IRTRK_BITS = 13; const unsigned int NUM_OF_NIRTRK_BITS = 13; const unsigned int NUM_OF_SYM_BITS = 12; const unsigned int SM_CBIT_SYMBOLOGY_TX_MSG_FAIL = 0; const unsigned int SM_CBIT_SYMBOLOGY_RX_MSG_FAIL = 1; const unsigned int SM_CBIT_LASER_RANGER_FAIL = 20; const unsigned int IRTRK_CBIT_SM_MSG_MISS_FAIL = 0; const unsigned int IRTRK_CBIT_SM_MSG_CRC_FAIL = 1; const unsigned int IRTRK_CBIT_SM_MSG_RANGE_FAIL = 2; const unsigned int IRTRK_CBIT_NIRTRK_MSG_MISS_FAIL = 3; const unsigned int IRTRK_CBIT_NIRTRK_MSG_CRC_FAIL = 4; const unsigned int IRTRK_CBIT_NIRTRK_MSG_RANGE_FAIL = 5; const unsigned int IRTRK_CBIT_SLM_MSG_MISS_FAIL = 6; const unsigned int IRTRK_CBIT_SLM_MSG_CRC_FAIL = 7; const unsigned int IRTRK_CBIT_SLM_MSG_RANGE_FAIL = 8; const unsigned int IRTRK_CBIT_VBLANK_ABSENT_FAIL = 9; const unsigned int IRTRK_CBIT_LBLANK_ABSENT_FAIL = 10; const unsigned int IRTRK_CBIT_PICTURE_SINGLE_COLOR_FAIL = 11; const unsigned int IRTRK_CBIT_TIME_OVERFLOW_FAIL = 12; const unsigned int NIRTRK_CBIT_SM_MSG_MISS_FAIL = 0; const unsigned int NIRTRK_CBIT_SM_MSG_CRC_FAIL = 1; const unsigned int NIRTRK_CBIT_SM_MSG_RANGE_FAIL = 2; const unsigned int NIRTRK_CBIT_NIRTRK_MSG_MISS_FAIL = 3; const unsigned int NIRTRK_CBIT_NIRTRK_MSG_CRC_FAIL = 4; const unsigned int NIRTRK_CBIT_NIRTRK_MSG_RANGE_FAIL = 5; const unsigned int NIRTRK_CBIT_SLM_MSG_MISS_FAIL = 6; const unsigned int NIRTRK_CBIT_SLM_MSG_CRC_FAIL = 7; const unsigned int NIRTRK_CBIT_SLM_MSG_RANGE_FAIL = 8; const unsigned int NIRTRK_CBIT_VBLANK_ABSENT_FAIL = 9; const unsigned int NIRTRK_CBIT_LBLANK_ABSENT_FAIL = 10; const unsigned int NIRTRK_CBIT_PICTURE_SINGLE_COLOR_FAIL = 11; const unsigned int NIRTRK_CBIT_TIME_OVERFLOW_FAIL = 12; const unsigned int SYM_CBIT_SM_MSG_MISS_FAIL = 0; const unsigned int SYM_CBIT_SM_MSG_CONTENT_FAIL = 1; const unsigned int SYM_CBIT_SM_MSG_RANGE_FAIL = 2; const unsigned int SYM_CBIT_IRTRK_MSG_MISS_FAIL = 3; const unsigned int SYM_CBIT_IRTRK_MSG_CRC_FAIL = 4; const unsigned int SYM_CBIT_IRTRK_MSG_RANGE_FAIL = 5; const unsigned int SYM_CBIT_NIRTRK_MSG_MISS_FAIL = 6; const unsigned int SYM_CBIT_NIRTRK_MSG_CRC_FAIL = 7; const unsigned int SYM_CBIT_NIRTRK_MSG_RANGE_FAIL = 8; const unsigned int SYM_CBIT_SLM_MSG_MISS_FAIL = 9; const unsigned int SYM_CBIT_SLM_MSG_CRC_FAIL = 10; const unsigned int SYM_CBIT_SLM_MSG_RANGE_FAIL = 11; #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::size_t; using std::strlen; using std::strcpy; using std::strncpy; using std::strcat; using std::strncat; using std::strchr; using std::strrchr; using std::strcmp; using std::strncmp; using std::strcoll; using std::strxfrm; using std::strpbrk; using std::strspn; using std::strcspn; using std::strstr; using std::strtok; using std::strerror; using std::strdup; using std::memmove; using std::memcpy; using std::memcmp; using std::memchr; using std::memset; #pragma diag_pop struct BitStr { unsigned short FailLimit; unsigned short RecoverLimit; unsigned short ErrorCount; unsigned short RecoverCount; unsigned int ErrorGeneralCount; unsigned int BitErrorCount; bool Fail; BitStr() { memset(this, 0, sizeof(*this)); FailLimit = 10; RecoverLimit = 40; } }; bool BitIsSet(unsigned int word, unsigned int bitIndex); void SetBit(unsigned int &word, unsigned int index, bool value); void SetBitBinaryWord(unsigned int *BitBinaryWord, unsigned int Index, bool failed); bool IsNan(float arg); unsigned short EndianneConvert(unsigned short ); void BitHysteresis(BitStr& bit, bool error); class MissionComputerCls; class SystemManagerCls; class UdpClient; class BitCls { private: unsigned int BitBinaryWord[5]; BitBinaryListStruct BitBinaryList; BITStatusMsgStruct MCBITStatusMsg; public: BitCls(); ~BitCls(); void Run(); private: BitStr BitList[NUM_OF_SYS_BITS]; bool ProcessBit(bool failed, unsigned int index); void RunLowFrequencyTests(); void RunHighFrequencyTests(); public: SystemManagerCls* getItsSystemManagerCls() const; void setItsSystemManagerCls(SystemManagerCls* p_SystemManagerCls); MissionComputerCls* getItsMissionComputerCls() const; void setItsMissionComputerCls( MissionComputerCls* p_MissionComputerCls); public: void __setItsSystemManagerCls(SystemManagerCls* p_SystemManagerCls); void _setItsSystemManagerCls(SystemManagerCls* p_SystemManagerCls); void _clearItsSystemManagerCls(); void __setItsMissionComputerCls( MissionComputerCls* p_MissionComputerCls); void _setItsMissionComputerCls( MissionComputerCls* p_MissionComputerCls); void _clearItsMissionComputerCls(); protected: void cleanUpRelations(); protected: SystemManagerCls* itsSystemManagerCls; MissionComputerCls* itsMissionComputerCls; public: uint32* GetBitBinaryWordList() const; void SetSymbologyBitBinaryWord(uint32*); void PerformStartupTests(); }; #pragma diag_push #pragma CHECK_MISRA("-19.15") using std::size_t; using std::strlen; using std::strcpy; using std::strncpy; using std::strcat; using std::strncat; using std::strchr; using std::strrchr; using std::strcmp; using std::strncmp; using std::strcoll; using std::strxfrm; using std::strpbrk; using std::strspn; using std::strcspn; using std::strstr; using std::strtok; using std::strerror; using std::strdup; using std::memmove; using std::memcpy; using std::memcmp; using std::memchr; using std::memset; #pragma diag_pop using namespace SystemManager::RangeFinder; using namespace SystemManager::Illuminator; using namespace SystemManager::HighPowerLaser; using namespace SystemManager; #pragma pack(push) #pragma pack(1) struct GeneralStatusStruct { struct { SystemModeStatusEnuType mode :4; SystemSubModeEnuType submode :4; } systemMode; uint8 IsSystemReady; uint8 masked :1; uint8 GimDis :1; uint8 :6; LosStatusType SightStatus; DateAndTimeStruct DateAndTime; LIStatusType LIStatus; LrfStatusType LrfStatus; HPLUsabilityType HplUsability; VideoSettingsStatusType VideoSettings; struct { TrkTargetStatusEnu PasTrkStatus; TrkTargetStatusEnu ActTrkStatus; } trackStatus; GeneralStatusStruct() { memset(this, 0, sizeof(*this)); systemMode.mode = SystemModeStatusEnu_Initialization; systemMode.submode = SystemSubModeEnu_NA; IsSystemReady = 1; VideoSettings.SymbologDecLevel = 2; LIStatus.ArmSwitch = on; LIStatus.Masked = LrfMaskStatusEnu_NotMasked; LIStatus.OnOffStatus = on; LrfStatus.ArmSwitch = on; LrfStatus.Masked = LrfMaskStatusEnu_NotMasked; LrfStatus.OnOffStatus = on; trackStatus.ActTrkStatus = trkStatusOff; trackStatus.PasTrkStatus = trkStatusOff; VideoSettings.IRmanLevelVal = 923; VideoSettings.IRmanGainVal = 90; } }; struct Settings { uint32 DefaultVideoSource :4; uint32 DefaultIrCamPolarity :4; uint32 DefaultIrCamVideoMode :4; uint32 DefaultNirCamPolarity :4; uint32 DefaultDeclutterLevel :4; uint32 DefaultLrfRangeLogic :4; uint32 Reserved :8; real32 Parallax_x; real32 Parallax_y; real32 Parallax_z; real32 BearingCorrection; real32 ElevationCorrection; real32 TiltRoll; real32 TiltPitch; }; #pragma pack(pop) extern GeneralStatusStruct GeneralStatus; extern SYS_SYM_MsgStruct SystemManagerToSymbologyMessage; extern SYM_SYS_MsgStruct SymbologyToSystemManagerMessage; extern IRTRK_SYS_MsgStruct IrTrkToSystemManagerMessage; extern NIRTRK_SYS_MsgStruct NirTrkToSystemManagerMessage; extern SYS_NIRTRK_MsgStruct SmToIrTrkMessage; extern SYS_NIRTRK_MsgStruct SmToNirTrkMessage; extern SYS_SLM_MsgStruct Sm2SlmMessage; extern Slm2SmMsgStruct SlmToSystemManagerMessage; class MissionComputerCls; class MaintenanceCls; class BitCls; class ILaserRanger; class InterCoreCls; class IrCameraCls; class IPrecisionCamera; class SystemManagerCls; class GenericSystemCls { protected: SystemManagerCls* itsSystemManagerCls; BitCls* itsBitCls; InterCoreCls* itsInterCoreCls; MissionComputerCls* itsMissionComputerCls; IrCameraCls* itsIrCameraCls; IPrecisionCamera* itsNIRCamCls; public: GenericSystemCls(){} void SetItsSystemManagerCls(SystemManagerCls* p_SystemManagerCls) { itsSystemManagerCls = p_SystemManagerCls; } void SetItsInterCoreCls(InterCoreCls* p_InterCoreCls) { itsInterCoreCls = p_InterCoreCls; } void SetItsMissionComputerCls(MissionComputerCls* p_MissionComputerCls) { itsMissionComputerCls = p_MissionComputerCls; } void SetItsBitCls(BitCls* p_BitCls); void SetItsIrCamCls(IrCameraCls* p_IrCamCls) { itsIrCameraCls = p_IrCamCls; } void SetItsNIRCamCls(IPrecisionCamera* p_NIRCamCls) { itsNIRCamCls = p_NIRCamCls; } virtual void enter() {}; virtual void exit() {}; virtual void ChangeSystemSubMode(SystemSubModeEnuType); virtual void ConsumeLICmd(LICmdType& cmd) const; virtual void ConsumeLrfCmd(LrfCmdType& cmd) const; virtual void ConsumeHPLCmd(HPLInfoType& info) const; virtual void ConfigureSystem(); virtual void ConsumeVideoCmd(SystemManager::VideoSettingsType&); virtual void ChangeVideoSource(int source); virtual void UpdateDateAndTime(DateAndTimeStruct& time); virtual void ConsumePasTrkCmd(TrkCommandEnu cmd); virtual void ConsumeActTrkCmd(TrkCommandEnu cmd); virtual void ConsumeLosCmd(LosControlMsgStruct* cmd); protected: void __ConsumeLosCmd(LosControlMsgStruct* cmd); }; class OperationalSystemCls: public GenericSystemCls { public: void enter(); void exit(); void ChangeSystemSubMode(SystemSubModeEnuType); void LogSubModeChange(SystemSubModeEnuType); void ConsumePasTrkCmd(TrkCommandEnu cmd); void ConsumeActTrkCmd(TrkCommandEnu cmd); void ConsumeLosCmd(LosControlMsgStruct* cmd); private: }; class MaintenanceSystemCls: public GenericSystemCls { public: void enter() { GeneralStatus.systemMode.mode = SystemModeStatusEnu_Maintenance; xdc_runtime_System_printf__E("[system state] entering maintenance..\n"); xdc_runtime_System_flush__E();; } void exit() { xdc_runtime_System_printf__E("[system state] exiting maintenance..\n"); xdc_runtime_System_flush__E();; } virtual void Speak() const { xdc_runtime_System_printf__E("maintenance..\n"); xdc_runtime_System_flush__E();; } void ChangeVideoSource(int source); }; class StandbySystemCls : public GenericSystemCls { void enter() { GeneralStatus.systemMode.mode = SystemModeStatusEnu_StandBy; xdc_runtime_System_printf__E("[system state] entering to standby mode..\n"); xdc_runtime_System_flush__E();; } void exit() { xdc_runtime_System_printf__E("[system state] exiting standby mode..\n"); xdc_runtime_System_flush__E();; } virtual void ConsumeLICmd(LICmdType& cmd) const; void ConsumeLrfCmd(LrfCmdType& cmd) const; void ConsumeLosCmd(LosControlMsgStruct* cmd); }; class IBITSystemCls: public GenericSystemCls { void enter() { GeneralStatus.systemMode.mode = SystemModeStatusEnu_Ibit; xdc_runtime_System_printf__E("[system state] entering IBIT..\n"); xdc_runtime_System_flush__E();; } void exit() { xdc_runtime_System_printf__E("[system state] exiting IBIT..\n"); xdc_runtime_System_flush__E();; } void ConsumeVideoCmd(SystemManager::VideoSettingsType& settings); }; class InitializationSystemCls : public GenericSystemCls { public: void enter() { xdc_runtime_System_printf__E("======================================================\n"); xdc_runtime_System_flush__E();; xdc_runtime_System_printf__E("[system state] initializing..\n"); xdc_runtime_System_flush__E();; AwakeOtherCores(); itsBitCls->PerformStartupTests(); exit(); } void exit(); virtual void Speak() const { xdc_runtime_System_printf__E("Initialization..\n"); xdc_runtime_System_flush__E();; } virtual void ConsumeLICmd(LICmdType& cmd) const; void ConsumeLrfCmd(LrfCmdType& cmd) const; void ConfigureSystem(); void ConsumeVideoCmd(SystemManager::VideoSettingsType&); private: void AwakeOtherCores() const; }; class ShuttingDownSystemCls : public GenericSystemCls { public: void enter() { GeneralStatus.systemMode.mode = SystemModeStatusEnu_ShuttingDown; xdc_runtime_System_printf__E("[system state] entering shutting down..\n"); xdc_runtime_System_flush__E();; } void exit() { xdc_runtime_System_printf__E("[system state] exiting shutting down..\n"); xdc_runtime_System_flush__E();; } virtual void Speak() const { xdc_runtime_System_printf__E("shutting down..\n"); xdc_runtime_System_flush__E();; } void ConsumeVideoCmd(SystemManager::VideoSettingsType& settings); }; class MissionComputerCls; class MaintenanceCls; class BitCls; class ILaserRanger; class InterCoreCls; class IPrecisionCamera; class SystemManagerCls: public ActiveCls { public: SystemManagerCls() : ActiveCls(6), CoreCommunicationObj(this) { ; itsMissionComputerCls = 0; itsMaintenanceCls = 0; itsBitCls = 0; itsLaserInt = 0; handlers[0] = &initializationSystemObj; handlers[1] = &standbySystemObj; handlers[2] = &operationalSystemObj; handlers[3] = &maintenanceSystemObj; handlers[4] = &shuttingDownSystemObj; handlers[5] = &IBITSystemObj; for (int i = 0; i < 6; i++) { handlers[i]->SetItsSystemManagerCls(this); } systemHandler = &initializationSystemObj; } ~SystemManagerCls(); public: MissionComputerCls* getItsMissionComputerCls() const; void setItsMissionComputerCls(MissionComputerCls* p_MissionComputerCls); MaintenanceCls* getItsMaintenanceCls() const; void setItsMaintenanceCls(MaintenanceCls* p_MaintenanceCls); BitCls* getItsBitCls() const; void setItsBitCls(BitCls* p_BitCls); void __setItsMissionComputerCls( MissionComputerCls* p_MissionComputerCls); void _setItsMissionComputerCls( MissionComputerCls* p_MissionComputerCls); void _clearItsMissionComputerCls(); void __setItsMaintenanceCls(MaintenanceCls* p_MaintenanceCls); void _setItsMaintenanceCls(MaintenanceCls* p_MaintenanceCls); void _clearItsMaintenanceCls(); void __setItsBitCls(BitCls* p_BitCls); void _setItsBitCls(BitCls* p_BitCls); void _clearItsBitCls(); void SetItsLaserInt(ILaserRanger* pI) { itsLaserInt = pI; } void SetitsInterCoreCls(InterCoreCls* p_InterCoreCls) { itsInterCoreCls = p_InterCoreCls; for (int i = 0; i < 6; i++) { handlers[i]->SetItsInterCoreCls(p_InterCoreCls); } CoreCommunicationObj.SetitsInterCoreCls(p_InterCoreCls); } void SetItsNIRCamCls(IPrecisionCamera* p_NIRCamCls) { itsNIRCamCls = p_NIRCamCls; } GenericSystemCls* GetHandler() const { return systemHandler; } void SetItsIrCamCls(IrCameraCls* p_IrCamCls) { for (int i = 0; i < 6; i++) { handlers[i]->SetItsIrCamCls(p_IrCamCls); } } public: void ConsumeSystemModeCmd(SystemModeCmdEnuType mode, SystemSubModeEnuType submode); void ProcessSymbologyMessage(void* msg); void* Run(); public: void ChangeSystemMode(SystemModeCmdEnuType newCmd); void UpdateSymbology(); protected: void cleanUpRelations(); protected: class InterCoreStuff: public ActiveCls { private: InterCoreCls* itsInterCoreCls; SystemManagerCls* itsOuterCls; public: InterCoreStuff(SystemManagerCls* p_OuterCls) : ActiveCls(2) { ; itsOuterCls = p_OuterCls; } public: virtual void* Run(); void SetitsInterCoreCls(InterCoreCls* p_InterCoreCls) { itsInterCoreCls = p_InterCoreCls; } } CoreCommunicationObj; protected: MissionComputerCls* itsMissionComputerCls; MaintenanceCls* itsMaintenanceCls; BitCls* itsBitCls; ILaserRanger* itsLaserInt; InterCoreCls* itsInterCoreCls; IPrecisionCamera* itsNIRCamCls; private: GenericSystemCls* systemHandler; OperationalSystemCls operationalSystemObj; MaintenanceSystemCls maintenanceSystemObj; StandbySystemCls standbySystemObj; IBITSystemCls IBITSystemObj; InitializationSystemCls initializationSystemObj; ShuttingDownSystemCls shuttingDownSystemObj; GenericSystemCls* handlers[6]; }; MissionComputerCls::~MissionComputerCls() { cleanUpRelations(); } BitCls* MissionComputerCls::getItsBitCls() const { return itsBitCls; } void MissionComputerCls::__setItsBitCls(BitCls* p_BitCls) { itsBitCls = p_BitCls; } void MissionComputerCls::_setItsBitCls(BitCls* p_BitCls) { if(itsBitCls != 0) { itsBitCls->__setItsMissionComputerCls(0); } __setItsBitCls(p_BitCls); } void MissionComputerCls::setItsBitCls(BitCls* p_BitCls) { if(p_BitCls != 0) { p_BitCls->_setItsMissionComputerCls(this); } _setItsBitCls(p_BitCls); } void MissionComputerCls::_clearItsBitCls() { itsBitCls = 0; } SystemManagerCls* MissionComputerCls::getItsSystemManagerCls() const { return itsSystemManagerCls; } void MissionComputerCls::__setItsSystemManagerCls( SystemManagerCls* p_SystemManagerCls) { itsSystemManagerCls = p_SystemManagerCls; } void MissionComputerCls::_setItsSystemManagerCls( SystemManagerCls* p_SystemManagerCls) { if(itsSystemManagerCls != 0) { itsSystemManagerCls->__setItsMissionComputerCls(0); } __setItsSystemManagerCls(p_SystemManagerCls); } void MissionComputerCls::setItsSystemManagerCls( SystemManagerCls* p_SystemManagerCls) { if(p_SystemManagerCls != 0) { p_SystemManagerCls->_setItsMissionComputerCls(this); } _setItsSystemManagerCls(p_SystemManagerCls); } void MissionComputerCls::_clearItsSystemManagerCls() { itsSystemManagerCls = 0; } void MissionComputerCls::cleanUpRelations() { if(itsBitCls != 0) { MissionComputerCls* p_MissionComputerCls = itsBitCls->getItsMissionComputerCls(); if(p_MissionComputerCls != 0) { itsBitCls->__setItsMissionComputerCls(0); } itsBitCls = 0; } if(itsSystemManagerCls != 0) { MissionComputerCls* p_MissionComputerCls = itsSystemManagerCls->getItsMissionComputerCls(); if(p_MissionComputerCls != 0) { itsSystemManagerCls->__setItsMissionComputerCls(0); } itsSystemManagerCls = 0; } } void MissionComputerCls::SetUdpPort(UdpServer* p_UdpPort) { udpPort = p_UdpPort; } void MissionComputerCls::SetItsInterCoreCls(InterCoreCls* p_InterCoreCls) { itsInterCoreCls = p_InterCoreCls; } void* MissionComputerCls::Run() { while (1) { Process(); } } void* MissionComputerCls::Reader::Run() { UdpServer u; McCommand newCommand; u.Connect(2000); itsOuterCls->setItsUdpPort(&u); uint32 readsize = u.Read(&newCommand, sizeof(newCommand)); itsOuterCls->RWMutex.Post(); while (true) { ( (readsize == ((McHeader* )&newCommand)->Length) ? 0 : xdc_runtime_System_printf__E("\nKod %s dosyasindaki \n %d. satirda %s varsayiminda yanildi..\n", "D:/yglsdev/SystemManager/source/MissionComputerCls.cpp", 156, "readsize == ((McHeader* )&newCommand)->Length") ) ; xdc_runtime_System_flush__E();; if(readsize == ((McHeader*) &newCommand)->Length) { itsOuterCls->CommandQueue.Insert(newCommand); } readsize = u.Read(&newCommand, sizeof(newCommand)); } } void* MissionComputerCls::Sender::Run() { itsOuterCls->RWMutex.Pend(); itsOuterCls->EnableIOPortInThisTask(); McStatus status; while (true) { status = itsOuterCls->StatusQueue.Pop(); int size = ((McHeader*) &status)->Length; (itsOuterCls->getItsUdpPort())->Send(&status, size); } } void MissionComputerCls::Process() { McCommand command = CommandQueue.Pop(); switch (command.head.Id) { case 101: itsSystemManagerCls->ConsumeSystemModeCmd( ((SystemModeCmdStruct*) &command)->ModeCmd, ((SystemModeCmdStruct*) &command)->SubModeCmd); break; case 102: { TrkCommandEnu cmd = TrkCommandEnu( ((IrTrkCmdStruct*) &command)->TrackerControl); itsSystemManagerCls->GetHandler()->ConsumePasTrkCmd(cmd); UpdateMcStatus_IRTrk(GeneralStatus.trackStatus.PasTrkStatus); break; } case 103: { TrkCommandEnu cmd = TrkCommandEnu( ((NirTrkCmdStruct*) &command)->TrackerControl); itsSystemManagerCls->GetHandler()->ConsumeActTrkCmd(cmd); UpdateMcStatus_NIRTrk(GeneralStatus.trackStatus.ActTrkStatus); break; } case 104: itsSystemManagerCls->GetHandler()->ConsumeVideoCmd( ((VideoControlMsgStruct*) &command)->settings); UpdateMcStatus(GeneralStatus.VideoSettings); break; case 105: itsSystemManagerCls->GetHandler()->ConsumeLrfCmd( ((LrfControlMsgStruct*) &command)->LrfCmd); UpdateMcStatus(GeneralStatus.LrfStatus); break; case 106: itsSystemManagerCls->GetHandler()->ConsumeLICmd( ((LUIControlMsgStruct*) &command)->cmd); UpdateMcStatus(GeneralStatus.LIStatus); break; case 107: itsSystemManagerCls->GetHandler()->ConsumeHPLCmd( ((KKS2HTS_HPLInfoStruct*) &command)->info); UpdateMcStatus(GeneralStatus.HplUsability); break; case 111: case 112: case 113: case 114: case 115: break; case 116: itsSystemManagerCls->GetHandler()->UpdateDateAndTime( ((TimeMsgStruct*) &command)->data); break; case 117: SoftwareVersionMsg.ConfigurationNo = 0; SoftwareVersionMsg.VersionNo = 1; SoftwareVersionMsg.RevisionNo = 0; Send(&SoftwareVersionMsg, sizeof(SoftwareVersionMsg)); break; case 118: break; case 121: itsSystemManagerCls->GetHandler()->ConsumeLosCmd( (LosControlMsgStruct*) &command); break; case 122: case 110: break; default: break; } } void MissionComputerCls::Send(void* status, int size) { McStatus temp; memcpy(&temp, status, size); StatusQueue.Insert(temp); } void MissionComputerCls::UpdateMcStatus(SystemModeStatusEnuType mode, SystemSubModeEnuType submode) { systemStatusMsg.mode = mode; systemStatusMsg.submode = submode; Send(&systemStatusMsg, sizeof(systemStatusMsg)); } void MissionComputerCls::UpdateMcStatus(LrfStatusType status) { LrfStatusMsg.LrfStatus = status; Send(&LrfStatusMsg, sizeof(LrfStatusMsg)); } void MissionComputerCls::UpdateMcStatus(LIStatusType status) { LIStatusMsg.Status = status; Send(&LIStatusMsg, sizeof(LIStatusMsg)); } void MissionComputerCls::UpdateMcStatus(HPLUsabilityType& status) { HTS2KKS_HPLFirebilityMsg.info = status; Send(&HTS2KKS_HPLFirebilityMsg, sizeof(HTS2KKS_HPLFirebilityMsg)); } void MissionComputerCls::UpdateMcStatus(LosStatusType& status) { LosStatusMsgStruct LosStatusMsg; LosStatusMsg.status = status; memcpy(&LosStatusMsg.status, &status, sizeof(status)); Send(&LosStatusMsg, sizeof(LosStatusMsg)); } void MissionComputerCls::EnableIOPortInThisTask() const { udpPort->Share(); } void MissionComputerCls::UpdateMcStatus_IRTrk(TrkTargetStatusEnu status) { IrTrkStatusStruct IrTrkStatus; IrTrkStatus.TrackerStatus = status; Send(&IrTrkStatus, sizeof(IrTrkStatus)); } void MissionComputerCls::UpdateMcStatus_NIRTrk(TrkTargetStatusEnu status) { NirTrkStatusStruct NIRTrkStatus; NIRTrkStatus.TrackerStatus = status; Send(&NIRTrkStatus, sizeof(NIRTrkStatus)); } void MissionComputerCls::UpdateMcStatus(VideoSettingsStatusType& status) { VideoStatusMsgStruct mcVideoStatus; memcpy(&mcVideoStatus.status, &status, sizeof(status)); Send(&mcVideoStatus, sizeof(mcVideoStatus)); }