@@ -13,36 +13,15 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ +/* This file is automatically generated from library.xml */ + #include "config.h" -#import "OFApplication.h" -#import "OFDNSResourceRecord.h" -#import "OFHTTPRequest.h" -#import "OFHTTPResponse.h" -#import "OFMethodSignature.h" -#import "OFObject.h" -#import "OFStdIOStream.h" -#import "OFString.h" -#import "OFZIPArchiveEntry.h" - -#import "amiga-library.h" -#import "of_strptime.h" -#import "pbkdf2.h" -#import "platform.h" -#import "scrypt.h" -#import "socket.h" - -#ifdef OF_AMIGAOS_M68K -# define PPC_PARAMS(...) (void) -# define M68K_ARG OF_M68K_ARG -#else -# define PPC_PARAMS(...) (__VA_ARGS__) -# define M68K_ARG(...) -#endif +#import "amiga-glue.h" #ifdef OF_MORPHOS /* All __saveds functions in this file need to use the SysV ABI */ __asm__ ( ".section .text\n" @@ -52,77 +31,66 @@ " blr\n" ); #endif bool __saveds -glue_of_init PPC_PARAMS(unsigned int version, struct of_libc *libc, FILE **sF) +glue_of_init PPC_PARAMS(unsigned int version, struct of_libc *_Nonnull libc, FILE *_Nonnull *_Nonnull sF) { M68K_ARG(unsigned int, version, d0) - M68K_ARG(struct of_libc *, libc, a0) - M68K_ARG(FILE **, sF, a1) + M68K_ARG(struct of_libc *_Nonnull, libc, a0) + M68K_ARG(FILE *_Nonnull *_Nonnull, sF, a1) return of_init(version, libc, sF); } -int __saveds -glue_of_application_main PPC_PARAMS(int *argc, char ***argv, - id delegate) -{ - M68K_ARG(int *, argc, a0) - M68K_ARG(char ***, argv, a1) - M68K_ARG(id , delegate, a2) - - return of_application_main(argc, argv, delegate); -} - -void *__saveds +void *_Nullable __saveds glue_of_alloc PPC_PARAMS(size_t count, size_t size) { M68K_ARG(size_t, count, d0) M68K_ARG(size_t, size, d1) return of_alloc(count, size); } -void *__saveds +void *_Nullable __saveds glue_of_alloc_zeroed PPC_PARAMS(size_t count, size_t size) { M68K_ARG(size_t, count, d0) M68K_ARG(size_t, size, d1) return of_alloc_zeroed(count, size); } -void *__saveds -glue_of_realloc PPC_PARAMS(void *pointer, size_t count, size_t size) +void *_Nullable __saveds +glue_of_realloc PPC_PARAMS(void *_Nullable pointer, size_t count, size_t size) { - M68K_ARG(void *, pointer, a0) + M68K_ARG(void *_Nullable, pointer, a0) M68K_ARG(size_t, count, d0) M68K_ARG(size_t, size, d1) return of_realloc(pointer, count, size); } -uint32_t *__saveds +uint32_t *_Nonnull __saveds glue_of_hash_seed_ref(void) { return of_hash_seed_ref(); } -OFStdIOStream **__saveds +OFStdIOStream *_Nonnull *_Nullable __saveds glue_of_stdin_ref(void) { return of_stdin_ref(); } -OFStdIOStream **__saveds +OFStdIOStream *_Nonnull *_Nullable __saveds glue_of_stdout_ref(void) { return of_stdout_ref(); } -OFStdIOStream **__saveds +OFStdIOStream *_Nonnull *_Nullable __saveds glue_of_stderr_ref(void) { return of_stderr_ref(); } @@ -133,13 +101,22 @@ 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) +int __saveds +glue_of_application_main PPC_PARAMS(int *_Nonnull argc, char *_Nullable *_Nonnull *_Nonnull argv, id delegate) +{ + M68K_ARG(int *_Nonnull, argc, a0) + M68K_ARG(char *_Nullable *_Nonnull *_Nonnull, argv, a1) + M68K_ARG(id , delegate, a2) + + return of_application_main(argc, argv, delegate); +} + +const char *_Nullable __saveds +glue_of_http_request_method_to_string PPC_PARAMS(of_http_request_method_t method) { M68K_ARG(of_http_request_method_t, method, d0) return of_http_request_method_to_string(method); } @@ -150,11 +127,11 @@ M68K_ARG(OFString *, string, a0) return of_http_request_method_from_string(string); } -OFString *__saveds +OFString *_Nonnull __saveds glue_of_http_status_code_to_string PPC_PARAMS(short code) { M68K_ARG(short, code, d0) return of_http_status_code_to_string(code); @@ -182,11 +159,11 @@ M68K_ARG(OFString *, string, a0) return of_string_parse_encoding(string); } -OFString *__saveds +OFString *_Nullable __saveds glue_of_string_name_of_encoding PPC_PARAMS(of_string_encoding_t encoding) { M68K_ARG(of_string_encoding_t, encoding, d0) return of_string_name_of_encoding(encoding); @@ -200,12 +177,11 @@ return of_string_utf8_encode(c, UTF8); } ssize_t __saveds -glue_of_string_utf8_decode PPC_PARAMS(const char *UTF8, size_t len, - of_unichar_t *c) +glue_of_string_utf8_decode PPC_PARAMS(const char *UTF8, size_t len, of_unichar_t *c) { M68K_ARG(const char *, UTF8, a0) M68K_ARG(size_t, len, d0) M68K_ARG(of_unichar_t *, c, a1) @@ -226,69 +202,64 @@ M68K_ARG(const of_char32_t *, string, a0) return of_string_utf32_length(string); } -OFString *__saveds +OFString *_Nonnull __saveds glue_of_zip_archive_entry_version_to_string PPC_PARAMS(uint16_t version) { M68K_ARG(uint16_t, version, d0) return of_zip_archive_entry_version_to_string(version); } -OFString *__saveds -glue_of_zip_archive_entry_compression_method_to_string PPC_PARAMS( - uint16_t compressionMethod) +OFString *_Nonnull __saveds +glue_of_zip_archive_entry_compression_method_to_string PPC_PARAMS(uint16_t compressionMethod) { M68K_ARG(uint16_t, compressionMethod, d0) - return of_zip_archive_entry_compression_method_to_string( - compressionMethod); + return of_zip_archive_entry_compression_method_to_string(compressionMethod); } size_t __saveds -glue_of_zip_archive_entry_extra_field_find PPC_PARAMS(OFData *extraField, - uint16_t tag, uint16_t *size) +glue_of_zip_archive_entry_extra_field_find PPC_PARAMS(OFData *extraField, uint16_t tag, uint16_t *size) { M68K_ARG(OFData *, extraField, a0) M68K_ARG(uint16_t, tag, d0) M68K_ARG(uint16_t *, size, a1) return of_zip_archive_entry_extra_field_find(extraField, tag, size); } void __saveds -glue_of_pbkdf2 PPC_PARAMS(const of_pbkdf2_parameters_t *param) +glue_of_pbkdf2 PPC_PARAMS(of_pbkdf2_parameters_t param) { - M68K_ARG(const of_pbkdf2_parameters_t *, param, a0) + M68K_ARG(of_pbkdf2_parameters_t, param, a0) - of_pbkdf2(*param); + of_pbkdf2(param); } void __saveds -glue_of_salsa20_8_core PPC_PARAMS(uint32_t *buffer) +glue_of_salsa20_8_core PPC_PARAMS(uint32_t *_Nonnull buffer) { - M68K_ARG(uint32_t *, buffer, a0) + M68K_ARG(uint32_t *_Nonnull, buffer, a0) of_salsa20_8_core(buffer); } void __saveds -glue_of_scrypt_block_mix PPC_PARAMS(uint32_t *output, const uint32_t *input, - size_t blockSize) +glue_of_scrypt_block_mix PPC_PARAMS(uint32_t *_Nonnull output, const uint32_t *_Nonnull input, size_t blockSize) { - M68K_ARG(uint32_t *, output, a0) - M68K_ARG(const uint32_t *, input, a1) + M68K_ARG(uint32_t *_Nonnull, output, a0) + M68K_ARG(const uint32_t *_Nonnull, input, a1) M68K_ARG(size_t, blockSize, d0) of_scrypt_block_mix(output, input, blockSize); } void __saveds -glue_of_scrypt_romix PPC_PARAMS(uint32_t *buffer, size_t blockSize, - size_t costFactor, uint32_t *tmp) +glue_of_scrypt_romix PPC_PARAMS(uint32_t *buffer, size_t blockSize, size_t costFactor, uint32_t *tmp) { M68K_ARG(uint32_t *, buffer, a0) M68K_ARG(size_t, blockSize, d0) M68K_ARG(size_t, costFactor, d1) M68K_ARG(uint32_t *, tmp, a1) @@ -295,185 +266,169 @@ of_scrypt_romix(buffer, blockSize, costFactor, tmp); } void __saveds -glue_of_scrypt PPC_PARAMS(const of_scrypt_parameters_t *param) +glue_of_scrypt PPC_PARAMS(of_scrypt_parameters_t param) { - M68K_ARG(const of_scrypt_parameters_t *, param, a0) + M68K_ARG(of_scrypt_parameters_t, param, a0) - of_scrypt(*param); + of_scrypt(param); } -const char *__saveds -glue_of_strptime PPC_PARAMS(const char *buf, const char *fmt, struct tm *tm, - int16_t *tz) +const char *_Nullable __saveds +glue_of_strptime PPC_PARAMS(const char *buf, const char *fmt, struct tm *tm, int16_t *_Nullable tz) { M68K_ARG(const char *, buf, a0) M68K_ARG(const char *, fmt, a1) M68K_ARG(struct tm *, tm, a2) - M68K_ARG(int16_t *, tz, a3) + M68K_ARG(int16_t *_Nullable, tz, a3) return of_strptime(buf, fmt, tm, tz); } -void __saveds -glue_of_socket_address_parse_ip PPC_PARAMS(of_socket_address_t *address, - OFString *IP, uint16_t port) -{ - M68K_ARG(of_socket_address_t *, address, a0) - M68K_ARG(OFString *, IP, a1) - M68K_ARG(uint16_t, port, d0) - - *address = of_socket_address_parse_ip(IP, port); -} - -void __saveds -glue_of_socket_address_parse_ipv4 PPC_PARAMS(of_socket_address_t *address, - OFString *IP, uint16_t port) -{ - M68K_ARG(of_socket_address_t *, address, a0) - M68K_ARG(OFString *, IP, a1) - M68K_ARG(uint16_t, port, d0) - - *address = of_socket_address_parse_ipv4(IP, port); -} - -void __saveds -glue_of_socket_address_parse_ipv6 PPC_PARAMS(of_socket_address_t *address, - OFString *IP, uint16_t port) -{ - M68K_ARG(of_socket_address_t *, address, a0) - M68K_ARG(OFString *, IP, a1) - M68K_ARG(uint16_t, port, d0) - - *address = of_socket_address_parse_ipv6(IP, port); -} - -void __saveds -glue_of_socket_address_ipx PPC_PARAMS(of_socket_address_t *address, - const unsigned char *node, uint32_t network, uint16_t port) -{ - M68K_ARG(of_socket_address_t *, address, a0) - M68K_ARG(const unsigned char *, node, a1) +of_socket_address_t __saveds +glue_of_socket_address_parse_ip PPC_PARAMS(OFString *IP, uint16_t port) +{ + M68K_ARG(OFString *, IP, a0) + M68K_ARG(uint16_t, port, d0) + + return of_socket_address_parse_ip(IP, port); +} + +of_socket_address_t __saveds +glue_of_socket_address_parse_ipv4 PPC_PARAMS(OFString *IP, uint16_t port) +{ + M68K_ARG(OFString *, IP, a0) + M68K_ARG(uint16_t, port, d0) + + return of_socket_address_parse_ipv4(IP, port); +} + +of_socket_address_t __saveds +glue_of_socket_address_parse_ipv6 PPC_PARAMS(OFString *IP, uint16_t port) +{ + M68K_ARG(OFString *, IP, a0) + M68K_ARG(uint16_t, port, d0) + + return of_socket_address_parse_ipv6(IP, port); +} + +of_socket_address_t __saveds +glue_of_socket_address_ipx PPC_PARAMS(const unsigned char *_Nonnull node, uint32_t network, uint16_t port) +{ + M68K_ARG(const unsigned char *_Nonnull, node, a0) M68K_ARG(uint32_t, network, d0) M68K_ARG(uint16_t, port, d1) - *address = of_socket_address_ipx(node, network, port); + return of_socket_address_ipx(node, network, port); } bool __saveds -glue_of_socket_address_equal PPC_PARAMS(const of_socket_address_t *address1, - const of_socket_address_t *address2) +glue_of_socket_address_equal PPC_PARAMS(const of_socket_address_t *_Nonnull address1, const of_socket_address_t *_Nonnull address2) { - M68K_ARG(const of_socket_address_t *, address1, a0) - M68K_ARG(const of_socket_address_t *, address2, a1) + M68K_ARG(const of_socket_address_t *_Nonnull, address1, a0) + M68K_ARG(const of_socket_address_t *_Nonnull, address2, a1) return of_socket_address_equal(address1, address2); } unsigned long __saveds -glue_of_socket_address_hash PPC_PARAMS(const of_socket_address_t *address) +glue_of_socket_address_hash PPC_PARAMS(const of_socket_address_t *_Nonnull address) { - M68K_ARG(const of_socket_address_t *, address, a0) + M68K_ARG(const of_socket_address_t *_Nonnull, address, a0) return of_socket_address_hash(address); } -OFString *__saveds -glue_of_socket_address_ip_string PPC_PARAMS(const of_socket_address_t *address, - uint16_t *port) +OFString *_Nonnull __saveds +glue_of_socket_address_ip_string PPC_PARAMS(const of_socket_address_t *_Nonnull address, uint16_t *_Nullable port) { - M68K_ARG(const of_socket_address_t *, address, a0) - M68K_ARG(uint16_t *, port, a1) + M68K_ARG(const of_socket_address_t *_Nonnull, address, a0) + M68K_ARG(uint16_t *_Nullable, port, a1) return of_socket_address_ip_string(address, port); } void __saveds -glue_of_socket_address_set_port PPC_PARAMS(of_socket_address_t *address, - uint16_t port) +glue_of_socket_address_set_port PPC_PARAMS(of_socket_address_t *_Nonnull address, uint16_t port) { - M68K_ARG(of_socket_address_t *, address, a0) + M68K_ARG(of_socket_address_t *_Nonnull, address, a0) M68K_ARG(uint16_t, port, d0) of_socket_address_set_port(address, port); } uint16_t __saveds -glue_of_socket_address_get_port PPC_PARAMS(const of_socket_address_t *address) +glue_of_socket_address_get_port PPC_PARAMS(const of_socket_address_t *_Nonnull address) { - M68K_ARG(const of_socket_address_t *, address, a0) + M68K_ARG(const of_socket_address_t *_Nonnull, address, a0) return of_socket_address_get_port(address); } void __saveds -glue_of_socket_address_set_ipx_network PPC_PARAMS(of_socket_address_t *address, - uint32_t network) +glue_of_socket_address_set_ipx_network PPC_PARAMS(of_socket_address_t *_Nonnull address, uint32_t network) { - M68K_ARG(of_socket_address_t *, address, a0) + M68K_ARG(of_socket_address_t *_Nonnull, address, a0) M68K_ARG(uint32_t, network, d0) of_socket_address_set_ipx_network(address, network); } uint32_t __saveds -glue_of_socket_address_get_ipx_network PPC_PARAMS( - const of_socket_address_t *address) +glue_of_socket_address_get_ipx_network PPC_PARAMS(const of_socket_address_t *_Nonnull address) { - M68K_ARG(const of_socket_address_t *, address, a0) + M68K_ARG(const of_socket_address_t *_Nonnull, address, a0) return of_socket_address_get_ipx_network(address); } void __saveds -glue_of_socket_address_set_ipx_node PPC_PARAMS(of_socket_address_t *address, - const unsigned char *node) +glue_of_socket_address_set_ipx_node PPC_PARAMS(of_socket_address_t *_Nonnull address, const unsigned char *_Nonnull node) { - M68K_ARG(of_socket_address_t *, address, a0) - M68K_ARG(const unsigned char *, node, a1) + M68K_ARG(of_socket_address_t *_Nonnull, address, a0) + M68K_ARG(const unsigned char *_Nonnull, node, a1) of_socket_address_set_ipx_node(address, node); } void __saveds -glue_of_socket_address_get_ipx_node PPC_PARAMS( - const of_socket_address_t *address, unsigned char *node) +glue_of_socket_address_get_ipx_node PPC_PARAMS(const of_socket_address_t *_Nonnull address, unsigned char *_Nonnull node) { - M68K_ARG(const of_socket_address_t *, address, a0) - M68K_ARG(unsigned char *, node, a1) + M68K_ARG(const of_socket_address_t *_Nonnull, address, a0) + M68K_ARG(unsigned char *_Nonnull, node, a1) of_socket_address_get_ipx_node(address, node); } -OFString *__saveds +OFString *_Nonnull __saveds glue_of_dns_class_to_string PPC_PARAMS(of_dns_class_t DNSClass) { M68K_ARG(of_dns_class_t, DNSClass, d0) return of_dns_class_to_string(DNSClass); } -OFString *__saveds +OFString *_Nonnull __saveds glue_of_dns_record_type_to_string PPC_PARAMS(of_dns_record_type_t recordType) { M68K_ARG(of_dns_record_type_t, recordType, d0) return of_dns_record_type_to_string(recordType); } of_dns_class_t __saveds -glue_of_dns_class_parse PPC_PARAMS(OFString *string) +glue_of_dns_class_parse PPC_PARAMS(OFString *_Nonnull string) { - M68K_ARG(OFString *, string, a0) + M68K_ARG(OFString *_Nonnull, string, a0) return of_dns_class_parse(string); } of_dns_record_type_t __saveds -glue_of_dns_record_type_parse PPC_PARAMS(OFString *string) +glue_of_dns_record_type_parse PPC_PARAMS(OFString *_Nonnull string) { - M68K_ARG(OFString *, string, a0) + M68K_ARG(OFString *_Nonnull, string, a0) return of_dns_record_type_parse(string); }