2#ifndef PCDOGS_RUNTIME_FUNCTIONS_H
3#define PCDOGS_RUNTIME_FUNCTIONS_H
54void CRT_qsort(
void *base, uint32_t count, uint32_t element_size, int32_t (*compare)(
void const *,
void const *));
56void CRT_shortsort(
char *first_element,
char *last_element, uint32_t element_size, int32_t (*compare)(
void const *,
void const *));
58void CRT_swap(
char *dest,
char *src, uint32_t count);
66char *
CRT_strstr(
char const *haystack,
char const *needle);
82void CRT_exit(int32_t status) __attribute__((noreturn));
86void _doexit(int32_t status, int32_t quick_exit, int32_t return_to_caller);
94int32_t
CRT_vsprintf(
char *buffer,
char const *format, uint8_t *argument_cursor);
101void __amsg_exit(int32_t runtime_error) __attribute__((noreturn));
117void __fassign(int32_t flag,
void *destination,
char const *number);
119char *
_cftoe(
double const *value,
char *buffer, int32_t precision, int32_t uppercase_exponent);
121char *
_cftof(
double const *value,
char *buffer, int32_t precision);
123char *
_cftog(
double const *value,
char *buffer, int32_t precision, int32_t uppercase_exponent);
129char *
__cfltcvt(
double const *value,
char *buffer, int32_t format, int32_t precision, int32_t uppercase_exponent);
133int32_t
CRT_isctype(int32_t ch, int32_t char_type_mask);
135int64_t __stdcall
__allmul(int64_t lhs, int64_t rhs);
139int32_t
_output(struct
File_Handle *output_context,
char const *format, uint8_t *argument_cursor);
155EXCEPTION_DISPOSITION
__unwind_handler(struct _EXCEPTION_RECORD *exception_record,
void *establisher_frame, struct _CONTEXT *context_record,
void **dispatcher_context);
172int32_t
CRT_write(int32_t file_no,
void const *buffer, uint32_t byte_count);
213int32_t
CRT_lseek(int32_t fd, int32_t offset, int32_t origin);
217int32_t
CRT_read(int32_t fd,
void *buffer, uint32_t count);
221void *
CRT_calloc(uint32_t count, uint32_t element_size);
225int32_t
CRT_XcptFilter(uint32_t xcptnum, struct _EXCEPTION_POINTERS *pxcptinfoptrs);
235void _parse_cmdline(
char *command_line,
char **argv,
char *arg_buffer, int32_t *argc_out, int32_t *char_count_out);
263void __ld12_copy(uint32_t *dest, uint32_t const *src);
269void __ld12_shr(uint32_t *value, int32_t bit_count);
277int32_t
__atodbl(
double *output,
char const *text);
279int32_t
__atoflt(
float *output,
char const *text);
291void *
_memset(
void *dest, int32_t value, uint32_t count);
295uint32_t
_strlen(
char const *str);
299int32_t
__crtGetStringTypeA(DWORD info_type, LPCSTR src, int32_t src_count, uint16_t *char_types, UINT code_page, LCID locale, int32_t strict);
312uint64_t __stdcall
__aulldiv(uint64_t dividend, uint64_t divisor);
314uint64_t __stdcall
__aullrem(uint64_t dividend, uint64_t divisor);
326int32_t
CRT_sopen(
char const *filename, int32_t oflag, int32_t shflag, ...);
330int32_t
__chvalidator(uint8_t character, int32_t fallback_mask, uint8_t multibyte_mask);
332int32_t
__setmbcp(int32_t requested_code_page);
346char *
_strncpy(
char *dest,
char const *src, uint32_t count);
348int32_t
__crtLCMapStringA(LCID locale, DWORD map_flags, LPCSTR src, int32_t src_count, LPSTR dest, int32_t dest_count, UINT code_page, int32_t strict);
354uint32_t
CRT_strnlen(
char const *str, uint32_t max_count);
358void ___add_12(uint32_t *accumulator, uint32_t const *addend);
366int32_t
__strgtold12(struct
CRT_LD12Fields *output, const
char **end_pointer,
char const *text, int32_t mult12, int32_t scale, int32_t decimal_point, int32_t implicit_exponent);
378void __stdcall
Exception_RtlUnwindThunk(
void *target_frame,
void *target_ip, struct _EXCEPTION_RECORD *exception_record,
void *return_value);
380int32_t
__strcmpi(
char const *s1,
char const *s2);
uint32_t CRT_MapCodePageToLocaleId(uint32_t code_page)
uint32_t CRT_msize(void *ptr)
int32_t CRT_fclose(struct File_Handle *stream)
void String_MakeInsertionGap(char *buffer, int32_t insert_count)
void __freebuf(struct File_Handle *stream)
void CRT_qsort(void *base, uint32_t count, uint32_t element_size, int32_t(*compare)(void const *, void const *))
int32_t CRT_flsall(int32_t flush_mode)
char * __crtGetEnvironmentStringsA()
void __shl_12byte(uint32_t *value)
struct CRT_ExceptionAction * CRT_FindExceptionAction(uint32_t exception_code)
void _cropzeros(char *formatted_string)
int32_t CRT_StartupSEHFilter(void *establisher_frame)
int32_t CRT_LCMapStringA_MappedAllocationExceptionFilter()
int64_t __allmul(int64_t lhs, int64_t rhs)
int16_t CRT_VaArgShort(uint8_t **argument_cursor)
int32_t __ld12_is_zero_upper(uint32_t const *value, int32_t start_bit)
void ___add_12(uint32_t *accumulator, uint32_t const *addend)
void _ftbuf(int32_t clear_buffer, struct File_Handle *stream)
uint32_t CRT_ResolveRequestedCodePage(int32_t requested_code_page)
char * _cftog(double const *value, char *buffer, int32_t precision, int32_t uppercase_exponent)
void * __nh_malloc(uint32_t size, int32_t new_mode)
char * String_FormatScientificFloat(double const *value, char *buffer, int32_t precision, int32_t uppercase_exponent)
int32_t CRT_close(int32_t file_no)
int32_t _heap_init(int32_t mt_flag)
int32_t CRT_printf(char const *format,...)
int32_t __crtLCMapStringA(LCID locale, DWORD map_flags, LPCSTR src, int32_t src_count, LPSTR dest, int32_t dest_count, UINT code_page, int32_t strict)
void _parse_cmdline(char *command_line, char **argv, char *arg_buffer, int32_t *argc_out, int32_t *char_count_out)
uint32_t CRT_fwrite(void const *buffer, uint32_t size, uint32_t count, struct File_Handle *stream)
void * CRT_malloc(uint32_t size)
void * __sbh_alloc_block(uint32_t size)
void CRT_write_string(char const *source, int32_t count, struct File_Handle *stream, int32_t *written_count)
int32_t _stbuf(struct File_Handle *stream)
int32_t __setmbcp(int32_t requested_code_page)
uint64_t __aullrem(uint64_t dividend, uint64_t divisor)
int32_t CRT_fprintf(struct File_Handle *stream, char const *format,...)
int32_t __strgtold12(struct CRT_LD12Fields *output, const char **end_pointer, char const *text, int32_t mult12, int32_t scale, int32_t decimal_point, int32_t implicit_exponent)
char * _cftoe(double const *value, char *buffer, int32_t precision, int32_t uppercase_exponent)
struct File_Handle * _openfile(char const *filename, char const *mode, int32_t sharing_flag, struct File_Handle *stream)
void __ld12_copy(uint32_t *dest, uint32_t const *src)
int32_t CRT_vsprintf(char *buffer, char const *format, uint8_t *argument_cursor)
void * CRT_realloc(void *ptr, uint32_t size)
EXCEPTION_DISPOSITION __except_handler3(struct _EXCEPTION_RECORD *exception_record, struct CRT_SEHRegistration3 *registration, struct _CONTEXT *context, void *dispatcher_context)
struct File_Handle * CRT_fsopen(char const *filename, char const *mode, int32_t sharing_flag)
int32_t __ld12_is_zero(uint32_t const *value)
int32_t __ld12_round_and_clear(uint32_t *value, int32_t bit_index)
void(*)() CRT_onexit(void(*callback)())
void _doexit(int32_t status, int32_t quick_exit, int32_t return_to_caller)
int32_t String_ParseInt(char const *string)
int32_t CRT_XcptFilter(uint32_t xcptnum, struct _EXCEPTION_POINTERS *pxcptinfoptrs)
int32_t CRT_read(int32_t fd, void *buffer, uint32_t count)
void * CRT_calloc(uint32_t count, uint32_t element_size)
char * CRT_strcat(char *dest, char const *src)
char * String_RoundAndCopyDigitsFloat(char *output, int32_t digit_count, struct CRT_FloatConversionRecord *conversion_state)
void __amsg_exit(int32_t runtime_error)
int32_t __crtGetStringTypeA(DWORD info_type, LPCSTR src, int32_t src_count, uint16_t *char_types, UINT code_page, LCID locale, int32_t strict)
void _longjmp(struct CRT_JumpBuffer3 *jump_buffer, int32_t value)
char * CRT_StrchrCdecl(char const *string, int32_t character)
int32_t CRT_tolower(int32_t ch)
void CRT_exit_immediate(int32_t status)
int32_t String_ParseAtoi(char const *string)
char * _cftof(double const *value, char *buffer, int32_t precision)
int32_t CRT_LCMapStringA_SourceAllocationExceptionFilter()
int32_t __atoflt(float *output, char const *text)
int32_t CRT_VaArgInt(uint8_t **argument_cursor)
int32_t CRT_fseek(struct File_Handle *stream, int32_t offset, int32_t origin)
BOOL String_ConvertToDecimalStringFloat(struct CRT_Extended80Argument value, int32_t digit_count, uint32_t format_flags, struct CRT_DecimalFloatOutput *output)
int32_t __ld12_to_ieee(struct CRT_LD12Fields const *value, void *output, struct CRT_IEEEFormatDescriptor const *format)
void __flt_mul(struct CRT_LD12Fields *left_and_result, struct CRT_LD12Fields const *right)
int32_t _set_osfhnd(int32_t fd, HANDLE os_handle)
int32_t _positive(double const *value)
int32_t __add_with_overflow_check(uint32_t left, uint32_t right, uint32_t *sum)
void __sbh_free_block(struct CRT_HeapSegment *segment, void *user_ptr)
int32_t __sbh_resize_block(struct CRT_HeapSegment *segment, void *user_ptr, uint32_t new_size)
int32_t String_ConvertCRTWideCharToMultiByte(char *buffer, uint16_t wide_char)
uint32_t _cw_to_abstract_cw(uint32_t control_word)
char * String_StrchrCRT(int32_t character, char const *string)
int32_t __ld12_to_double(struct CRT_LD12Fields const *value, double *output)
int32_t __sbh_alloc_new_group(struct CRT_HeapSegment *segment)
char * _strncpy(char *dest, char const *src, uint32_t count)
char * __cfltcvt(double const *value, char *buffer, int32_t format, int32_t precision, int32_t uppercase_exponent)
void * CRT_MoveBytesOverlapSafeDuplicate(void *dest, void const *src, uint32_t count)
void __fassign(int32_t flag, void *destination, char const *number)
int32_t __setjmp3(struct CRT_JumpBuffer3 *jump_buffer, int32_t argument_count,...)
int32_t CRT_fflush(struct File_Handle *stream)
int32_t __ld12_increment(uint32_t *value, int32_t bit_index)
void __double_to_long_double80(uint16_t *destination, double const *source)
void __ld12_shr(uint32_t *value, int32_t bit_count)
void CRT_AbortFloatSupportNotLoaded()
int32_t CRT_ProbeRead4(uint32_t const volatile *address)
void __shr_12byte(uint32_t *value)
void Exception_RtlUnwindThunk(void *target_frame, void *target_ip, struct _EXCEPTION_RECORD *exception_record, void *return_value)
int32_t CRT_chsize(int32_t fd, int32_t size)
char * String_FormatFixedUsingCachedDigits(double const *value, char *buffer, int32_t precision)
int32_t CRT_ShowMessageBoxA(LPCSTR lp_text, LPCSTR lp_caption, UINT u_type)
int32_t CRT_atexit(void(*callback)())
void CRT_initterm(void(**first)(), void(**last)())
int32_t CRT_GetStringTypeA_AllocaExceptionFilter()
int32_t CRT_write(int32_t file_no, void const *buffer, uint32_t byte_count)
void _forcdecpt(char *buffer)
void CRT_exit(int32_t status)
int32_t CRT_commit(int32_t file_no)
void __setmbcp_updatetables()
int32_t _free_osfhnd(int32_t fd)
struct CRT_FloatConversionRecord * __fpmath(double value)
void _getbuf(struct File_Handle *stream)
void CRT_shortsort(char *first_element, char *last_element, uint32_t element_size, int32_t(*compare)(void const *, void const *))
void CRT_InitializeFloatingPoint()
void CRT_WriteRuntimeErrorBanner()
int32_t __strcmpi(char const *s1, char const *s2)
int32_t CRT_TestFdivBugFallback()
int32_t CRT_flsbuf(int32_t ch, struct File_Handle *stream)
void * _heap_alloc(uint32_t size)
int32_t CRT_TestPentiumFdivBug()
char * CRT_MoveBytesOverlapSafe(char *dest, char const *src, uint32_t count)
struct CRT_HeapSegment * __sbh_find_block(void *ptr)
void * _memset(void *dest, int32_t value, uint32_t count)
EXCEPTION_DISPOSITION __unwind_handler(struct _EXCEPTION_RECORD *exception_record, void *establisher_frame, struct _CONTEXT *context_record, void **dispatcher_context)
void CRT_fast_error_exit(int32_t runtime_error)
char * CRT_SkipProgramNameInCmdLine()
int32_t CRT_ProbeReadSEHFilter(void *establisher_frame)
int64_t __ftol_msvc(long double value)
uint32_t _abstract_cw_to_cw(uint32_t abstract_control_word)
int32_t _flush(struct File_Handle *stream)
int32_t __sbh_heap_init()
void CRT_write_multi_char(int32_t ch, int32_t count, struct File_Handle *stream, int32_t *written_count)
void __global_unwind2(struct CRT_SEHRegistration3 *target_frame)
void __mtold12(uint8_t const *digits, uint32_t digit_count, struct CRT_LD12Fields *output)
void CRT_swap(char *dest, char *src, uint32_t count)
int32_t CRT_lseek(int32_t fd, int32_t offset, int32_t origin)
int64_t CRT_VaArgInt64(uint8_t **argument_cursor)
int32_t CRT_GetStringTypeAAllocaFailure(int32_t *establisher_frame)
uint64_t __aulldiv(uint64_t dividend, uint64_t divisor)
int32_t __abnormal_termination()
uint32_t CRT_fread(void *buffer, uint32_t size, uint32_t count, struct File_Handle *stream)
void __seh_longjmp_unwind_4(struct CRT_JumpBuffer3 *jump_buffer)
uint32_t _strlen(char const *str)
struct File_Handle * CRT_fopen(char const *filename, char const *mode)
uint32_t CRT_control87(uint32_t new_control, uint32_t mask)
uint32_t CRT_controlfp(uint32_t new_value, uint32_t mask)
int32_t CRT_filbuf(struct File_Handle *stream)
int32_t CRT_sopen(char const *filename, int32_t oflag, int32_t shflag,...)
void __flt_power10(struct CRT_LD12Fields *value, int32_t power, int32_t mult12)
int32_t __ld12_to_float(struct CRT_LD12Fields const *value, float *output)
struct CRT_HeapSegment * __sbh_alloc_new_region()
void _setdefaultprecision()
void CRT_InitFloatFormatDispatch()
int32_t CRT_ismbblead(uint32_t character)
void __ld12_clear(uint32_t *value)
int32_t String_FormatCRTString(char *buffer, char const *format,...)
void CRT_write_char(int32_t ch, struct File_Handle *stream, int32_t *written_count)
char * CRT_strstr(char const *haystack, char const *needle)
int32_t __atodbl(double *output, char const *text)
int32_t CRT_isatty(int32_t fd)
HANDLE CRT_get_osfhandle(int32_t fd)
int32_t _output(struct File_Handle *output_context, char const *format, uint8_t *argument_cursor)
void _dosmaperr(uint32_t os_error_code)
int32_t __chvalidator(uint8_t character, int32_t fallback_mask, uint8_t multibyte_mask)
void _NMSG_WRITE(int32_t runtime_error_id)
void __local_unwind2(struct CRT_SEHRegistration3 *registration, int32_t stop_try_level, void *establisher_frame)
int32_t CRT_ftell(struct File_Handle *stream)
int32_t CRT_callnewh(uint32_t size)
int32_t CRT_ProbeReadSEHHandler(int32_t *establisher_frame)
void __alloca_probe(void)
int32_t CRT_isctype(int32_t ch, int32_t char_type_mask)
char * CRT_strcpy(char *dest, char const *src)
int32_t CRT_setmode(int32_t fd, int32_t mode)
uint32_t CRT_strnlen(char const *str, uint32_t max_count)
struct File_Handle * _getstream()