Index: src/amiga-glue.m ================================================================== --- src/amiga-glue.m +++ src/amiga-glue.m @@ -70,10 +70,71 @@ M68K_ARG(char ***, argv, a1) M68K_ARG(id , delegate, a2) return of_application_main(argc, argv, delegate); } + +void *__saveds +glue_of_malloc PPC_PARAMS(size_t count, size_t size) +{ + M68K_ARG(size_t, count, d0) + M68K_ARG(size_t, size, d1) + + return of_malloc(count, size); +} + +void *__saveds +glue_of_calloc PPC_PARAMS(size_t count, size_t size) +{ + M68K_ARG(size_t, count, d0) + M68K_ARG(size_t, size, d1) + + return of_calloc(count, size); +} + +void *__saveds +glue_of_realloc PPC_PARAMS(void *pointer, size_t count, size_t size) +{ + M68K_ARG(void *, pointer, a0) + M68K_ARG(size_t, count, d0) + M68K_ARG(size_t, size, d1) + + return of_realloc(pointer, count, size); +} + +uint32_t *__saveds +glue_of_hash_seed_ref(void) +{ + return of_hash_seed_ref(); +} + +OFStdIOStream **__saveds +glue_of_stdin_ref(void) +{ + return of_stdin_ref(); +} + +OFStdIOStream **__saveds +glue_of_stdout_ref(void) +{ + return of_stdout_ref(); +} + +OFStdIOStream **__saveds +glue_of_stderr_ref(void) +{ + return of_stderr_ref(); +} + +void __saveds +glue_of_logv PPC_PARAMS(OFConstantString *format, va_list arguments) +{ + M68K_ARG(OFConstantString *, format, a0) + M68K_ARG(va_list, arguments, a1) + + of_logv(format, arguments); +} const char *__saveds glue_of_http_request_method_to_string PPC_PARAMS( of_http_request_method_t method) { @@ -112,43 +173,10 @@ M68K_ARG(const char *, type, a0) return of_alignof_type_encoding(type); } -uint32_t *__saveds -glue_of_hash_seed_ref(void) -{ - return of_hash_seed_ref(); -} - -OFStdIOStream **__saveds -glue_of_stdin_ref(void) -{ - return of_stdin_ref(); -} - -OFStdIOStream **__saveds -glue_of_stdout_ref(void) -{ - return of_stdout_ref(); -} - -OFStdIOStream **__saveds -glue_of_stderr_ref(void) -{ - return of_stderr_ref(); -} - -void __saveds -glue_of_logv PPC_PARAMS(OFConstantString *format, va_list arguments) -{ - M68K_ARG(OFConstantString *, format, a0) - M68K_ARG(va_list, arguments, a1) - - of_logv(format, arguments); -} - of_string_encoding_t __saveds glue_of_string_parse_encoding PPC_PARAMS(OFString *string) { M68K_ARG(OFString *, string, a0) Index: src/amiga-library.m ================================================================== --- src/amiga-library.m +++ src/amiga-library.m @@ -68,21 +68,24 @@ void __register_frame_info(const void *, void *); void *__deregister_frame_info(const void *); #endif extern bool glue_of_init(void); +extern void *glue_of_malloc(void); +extern void *glue_of_calloc(void); +extern void *glue_of_realloc(void); +extern uint32_t *glue_of_hash_seed_ref(void); +extern OFStdIOStream **glue_of_stdin_ref(void); +extern OFStdIOStream **glue_of_stdout_ref(void); +extern OFStdIOStream **glue_of_stderr_ref(void); +extern void glue_of_logv(void); extern int glue_of_application_main(void); extern const char *glue_of_http_request_method_to_string(void); extern of_http_request_method_t glue_of_http_request_method_from_string(void); extern OFString *glue_of_http_status_code_to_string(void); extern size_t glue_of_sizeof_type_encoding(void); extern size_t glue_of_alignof_type_encoding(void); -extern uint32_t *glue_of_hash_seed_ref(void); -extern OFStdIOStream **glue_of_stdin_ref(void); -extern OFStdIOStream **glue_of_stdout_ref(void); -extern OFStdIOStream **glue_of_stderr_ref(void); -extern void glue_of_logv(void); extern of_string_encoding_t glue_of_string_parse_encoding(void); extern OFString *glue_of_string_name_of_encoding(void); extern size_t glue_of_string_utf8_encode(void); extern ssize_t glue_of_string_utf8_decode(void); extern size_t glue_of_string_utf16_length(void); @@ -625,21 +628,24 @@ #ifdef OF_MORPHOS (CONST_APTR)-1, (CONST_APTR)FUNCARRAY_32BIT_SYSTEMV, #endif (CONST_APTR)glue_of_init, + (CONST_APTR)glue_of_malloc, + (CONST_APTR)glue_of_calloc, + (CONST_APTR)glue_of_realloc, + (CONST_APTR)glue_of_hash_seed_ref, + (CONST_APTR)glue_of_stdin_ref, + (CONST_APTR)glue_of_stdout_ref, + (CONST_APTR)glue_of_stderr_ref, + (CONST_APTR)glue_of_logv, (CONST_APTR)glue_of_application_main, (CONST_APTR)glue_of_http_request_method_to_string, (CONST_APTR)glue_of_http_request_method_from_string, (CONST_APTR)glue_of_http_status_code_to_string, (CONST_APTR)glue_of_sizeof_type_encoding, (CONST_APTR)glue_of_alignof_type_encoding, - (CONST_APTR)of_hash_seed_ref, - (CONST_APTR)glue_of_stdin_ref, - (CONST_APTR)glue_of_stdout_ref, - (CONST_APTR)glue_of_stderr_ref, - (CONST_APTR)glue_of_logv, (CONST_APTR)glue_of_string_parse_encoding, (CONST_APTR)glue_of_string_name_of_encoding, (CONST_APTR)glue_of_string_utf8_encode, (CONST_APTR)glue_of_string_utf8_decode, (CONST_APTR)glue_of_string_utf16_length, Index: src/amigaos3.sfd ================================================================== --- src/amigaos3.sfd +++ src/amigaos3.sfd @@ -3,21 +3,24 @@ ==libname objfw68k.library ==bias 30 ==public * The following function is only for the linklib. bool glue_of_init(unsigned int version, struct of_libc *_Nonnull libc, FILE *_Nonnull *_Nonnull sF)(d0,a0,a1) +void *_Nullable glue_of_malloc(size_t count, size_t size)(d0,d1) +void *_Nullable glue_of_calloc(size_t count, size_t size)(d0,d1) +void *_Nullable glue_of_realloc(void *_Nullable pointer, size_t count, size_t size)(a0,d0,d1) +uint32_t *_Nonnull glue_of_hash_seed_ref(void)() +OFStdIOStream *_Nonnull *_Nullable glue_of_stdin_ref(void)() +OFStdIOStream *_Nonnull *_Nullable glue_of_stdout_ref(void)() +OFStdIOStream *_Nonnull *_Nullable glue_of_stderr_ref(void)() +void glue_of_logv(OFConstantString *format, va_list arguments)(a0,a1) int glue_of_application_main(int *_Nonnull argc, char *_Nullable *_Nonnull *_Nonnull argv, id delegate)(a0,a1,a2) const char *_Nullable glue_of_http_request_method_to_string(of_http_request_method_t method)(d0) of_http_request_method_t glue_of_http_request_method_from_string(OFString *string)(a0) OFString *_Nonnull glue_of_http_status_code_to_string(short code)(d0) size_t glue_of_sizeof_type_encoding(const char *type)(a0) size_t glue_of_alignof_type_encoding(const char *type)(a0) -uint32_t *_Nonnull glue_of_hash_seed_ref(void)() -OFStdIOStream *_Nonnull *_Nullable glue_of_stdin_ref(void)() -OFStdIOStream *_Nonnull *_Nullable glue_of_stdout_ref(void)() -OFStdIOStream *_Nonnull *_Nullable glue_of_stderr_ref(void)() -void glue_of_logv(OFConstantString *format, va_list arguments)(a0,a1) of_string_encoding_t glue_of_string_parse_encoding(OFString *string)(a0) OFString *_Nullable glue_of_string_name_of_encoding(of_string_encoding_t encoding)(d0) size_t glue_of_string_utf8_encode(of_unichar_t c, char *UTF8)(d0,a0) ssize_t glue_of_string_utf8_decode(const char *UTF8, size_t len, of_unichar_t *c)(a0,d0,a1) size_t glue_of_string_utf16_length(const of_char16_t *string)(a0) Index: src/linklib/linklib.m ================================================================== --- src/linklib/linklib.m +++ src/linklib/linklib.m @@ -367,45 +367,26 @@ { dtor(); } #endif -int -of_application_main(int *argc, char ***argv, - id delegate) -{ - return glue_of_application_main(argc, argv, delegate); -} - -const char * -of_http_request_method_to_string(of_http_request_method_t method) -{ - return glue_of_http_request_method_to_string(method); -} - -of_http_request_method_t -of_http_request_method_from_string(OFString *string) -{ - return glue_of_http_request_method_from_string(string); -} - -OFString * -of_http_status_code_to_string(short code) -{ - return glue_of_http_status_code_to_string(code); -} - -size_t -of_sizeof_type_encoding(const char *type) -{ - return glue_of_sizeof_type_encoding(type); -} - -size_t -of_alignof_type_encoding(const char *type) -{ - return glue_of_alignof_type_encoding(type); +void * +of_malloc(size_t count, size_t size) +{ + return glue_of_malloc(count, size); +} + +void * +of_calloc(size_t count, size_t size) +{ + return glue_of_calloc(count, size); +} + +void * +of_realloc(void *pointer, size_t count, size_t size) +{ + return glue_of_realloc(pointer, count, size); } uint32_t * of_hash_seed_ref(void) { @@ -443,10 +424,47 @@ void of_logv(OFConstantString *format, va_list arguments) { glue_of_logv(format, arguments); } + +int +of_application_main(int *argc, char ***argv, + id delegate) +{ + return glue_of_application_main(argc, argv, delegate); +} + +const char * +of_http_request_method_to_string(of_http_request_method_t method) +{ + return glue_of_http_request_method_to_string(method); +} + +of_http_request_method_t +of_http_request_method_from_string(OFString *string) +{ + return glue_of_http_request_method_from_string(string); +} + +OFString * +of_http_status_code_to_string(short code) +{ + return glue_of_http_status_code_to_string(code); +} + +size_t +of_sizeof_type_encoding(const char *type) +{ + return glue_of_sizeof_type_encoding(type); +} + +size_t +of_alignof_type_encoding(const char *type) +{ + return glue_of_alignof_type_encoding(type); +} of_string_encoding_t of_string_parse_encoding(OFString *string) { return glue_of_string_parse_encoding(string);