Upstep Go dependencies (#340)

* Upstep Go dependencies

* tiny linter fix

* Tidy
This commit is contained in:
tobi 2021-12-12 15:47:51 +01:00 committed by GitHub
commit 67ac8db190
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
160 changed files with 248601 additions and 232400 deletions

2
vendor/modernc.org/libc/Makefile generated vendored
View file

@ -97,7 +97,7 @@ windows_386:
CCGO_CPP=i686-w64-mingw32-cpp TARGET_GOOS=windows TARGET_GOARCH=386 go generate
GOOS=windows GOARCH=386 go build -v ./...
all_targets: linux_amd64 linux_386 linux_arm linux_arm64 windows_amd64 windows_386
all_targets: linux_amd64 linux_386 linux_arm linux_arm64 linux_s390x # windows_amd64 windows_386
echo done
build_all_targets:

View file

@ -25,6 +25,7 @@ var CAPI = map[string]struct{}{
"__builtin_bswap16": {},
"__builtin_bswap32": {},
"__builtin_bswap64": {},
"__builtin_bzero": {},
"__builtin_clz": {},
"__builtin_clzl": {},
"__builtin_clzll": {},
@ -73,7 +74,7 @@ var CAPI = map[string]struct{}{
"__ccgo_in6addr_anyp": {},
"__ccgo_pthreadAttrGetDetachState": {},
"__ccgo_pthreadMutexattrGettype": {},
"__ccgo_sqlite4_log": {},
"__ccgo_sqlite3_log": {},
"__cmsg_nxthdr": {},
"__ctype_get_mb_cur_max": {},
"__darwin_fd_clr": {},
@ -106,6 +107,7 @@ var CAPI = map[string]struct{}{
"__lookup_ipliteral": {},
"__lookup_name": {},
"__lookup_serv": {},
"__mb_cur_max": {},
"__putenv": {},
"__shgetc": {},
"__shlim": {},
@ -115,7 +117,6 @@ var CAPI = map[string]struct{}{
"__strchrnul": {},
"__sync_add_and_fetch_uint32": {},
"__sync_sub_and_fetch_uint32": {},
"__sync_synchronize": {},
"__toread": {},
"__toread_needs_stdio_exit": {},
"__uflow": {},
@ -142,6 +143,7 @@ var CAPI = map[string]struct{}{
"atoi": {},
"atol": {},
"bind": {},
"bzero": {},
"calloc": {},
"ceil": {},
"ceilf": {},
@ -169,7 +171,7 @@ var CAPI = map[string]struct{}{
"dlerror": {},
"dlopen": {},
"dlsym": {},
"dup3": {},
"dup2": {},
"environ": {},
"exit": {},
"exp": {},
@ -217,6 +219,7 @@ var CAPI = map[string]struct{}{
"gai_strerror": {},
"getaddrinfo": {},
"getattrlist": {},
"getc": {},
"getcwd": {},
"getegid": {},
"getentropy": {},
@ -236,7 +239,9 @@ var CAPI = map[string]struct{}{
"getpeername": {},
"getpid": {},
"getpwnam": {},
"getpwnam_r": {},
"getpwuid": {},
"getpwuid_r": {},
"getresgid": {},
"getresuid": {},
"getrusage": {},
@ -256,6 +261,7 @@ var CAPI = map[string]struct{}{
"ioctl": {},
"isalnum": {},
"isalpha": {},
"isascii": {},
"isatty": {},
"isdigit": {},
"islower": {},
@ -263,6 +269,7 @@ var CAPI = map[string]struct{}{
"isnanf": {},
"isnanl": {},
"isprint": {},
"issetugid": {},
"isspace": {},
"isupper": {},
"iswalnum": {},
@ -312,6 +319,7 @@ var CAPI = map[string]struct{}{
"opendir": {},
"openpty": {},
"pathconf": {},
"pause": {},
"pclose": {},
"perror": {},
"pipe": {},
@ -375,6 +383,7 @@ var CAPI = map[string]struct{}{
"remove": {},
"rename": {},
"rewind": {},
"rindex": {},
"rint": {},
"rmdir": {},
"round": {},
@ -462,6 +471,7 @@ var CAPI = map[string]struct{}{
"tzset": {},
"umask": {},
"uname": {},
"ungetc": {},
"unlink": {},
"unsetenv": {},
"usleep": {},
@ -477,5 +487,6 @@ var CAPI = map[string]struct{}{
"wctomb": {},
"wcwidth": {},
"write": {},
"writev": {},
"zero_struct_address": {},
}

View file

@ -3,474 +3,492 @@
package libc // import "modernc.org/libc"
var CAPI = map[string]struct{}{
"_IO_putc": {},
"_NSGetEnviron": {},
"___errno_location": {},
"__assert_fail": {},
"__assert_rtn": {},
"__builtin___memcpy_chk": {},
"__builtin___memmove_chk": {},
"__builtin___memset_chk": {},
"__builtin___snprintf_chk": {},
"__builtin___sprintf_chk": {},
"__builtin___strcat_chk": {},
"__builtin___strcpy_chk": {},
"__builtin___strncpy_chk": {},
"__builtin___vsnprintf_chk": {},
"__builtin_abort": {},
"__builtin_abs": {},
"__builtin_add_overflowInt64": {},
"__builtin_add_overflowUint32": {},
"__builtin_add_overflowUint64": {},
"__builtin_bswap16": {},
"__builtin_bswap32": {},
"__builtin_bswap64": {},
"__builtin_clz": {},
"__builtin_clzl": {},
"__builtin_clzll": {},
"__builtin_constant_p_impl": {},
"__builtin_copysign": {},
"__builtin_copysignf": {},
"__builtin_copysignl": {},
"__builtin_exit": {},
"__builtin_expect": {},
"__builtin_fabs": {},
"__builtin_free": {},
"__builtin_getentropy": {},
"__builtin_huge_val": {},
"__builtin_huge_valf": {},
"__builtin_inf": {},
"__builtin_inff": {},
"__builtin_infl": {},
"__builtin_isnan": {},
"__builtin_malloc": {},
"__builtin_memcmp": {},
"__builtin_memcpy": {},
"__builtin_memset": {},
"__builtin_mmap": {},
"__builtin_mul_overflowInt64": {},
"__builtin_mul_overflowUint128": {},
"__builtin_mul_overflowUint64": {},
"__builtin_nan": {},
"__builtin_nanf": {},
"__builtin_nanl": {},
"__builtin_object_size": {},
"__builtin_popcount": {},
"__builtin_popcountl": {},
"__builtin_prefetch": {},
"__builtin_printf": {},
"__builtin_snprintf": {},
"__builtin_sprintf": {},
"__builtin_strchr": {},
"__builtin_strcmp": {},
"__builtin_strcpy": {},
"__builtin_strlen": {},
"__builtin_sub_overflowInt64": {},
"__builtin_trap": {},
"__builtin_unreachable": {},
"__ccgo_dmesg": {},
"__ccgo_in6addr_anyp": {},
"__ccgo_sqlite3_log": {},
"__cmsg_nxthdr": {},
"__ctype_get_mb_cur_max": {},
"__darwin_fd_clr": {},
"__darwin_fd_isset": {},
"__darwin_fd_set": {},
"__env_rm_add": {},
"__errno_location": {},
"__error": {},
"__floatscan": {},
"__fpclassify": {},
"__fpclassifyf": {},
"__fpclassifyl": {},
"__h_errno_location": {},
"__inet_aton": {},
"__inline_isnand": {},
"__inline_isnanf": {},
"__inline_isnanl": {},
"__intscan": {},
"__isalnum_l": {},
"__isalpha_l": {},
"__isdigit_l": {},
"__islower_l": {},
"__isnan": {},
"__isnanf": {},
"__isnanl": {},
"__isoc99_sscanf": {},
"__isprint_l": {},
"__isupper_l": {},
"__isxdigit_l": {},
"__lookup_ipliteral": {},
"__lookup_name": {},
"__lookup_serv": {},
"__putenv": {},
"__shgetc": {},
"__shlim": {},
"__stderrp": {},
"__stdinp": {},
"__stdoutp": {},
"__strchrnul": {},
"__sync_add_and_fetch_uint32": {},
"__sync_sub_and_fetch_uint32": {},
"__sync_synchronize": {},
"__toread": {},
"__toread_needs_stdio_exit": {},
"__uflow": {},
"_exit": {},
"_longjmp": {},
"_obstack_begin": {},
"_obstack_newchunk": {},
"_setjmp": {},
"abort": {},
"abs": {},
"accept": {},
"access": {},
"acos": {},
"acosh": {},
"alarm": {},
"asin": {},
"asinh": {},
"atan": {},
"atan2": {},
"atanh": {},
"atexit": {},
"atof": {},
"atoi": {},
"atol": {},
"bind": {},
"calloc": {},
"ceil": {},
"ceilf": {},
"cfgetospeed": {},
"cfsetispeed": {},
"cfsetospeed": {},
"chdir": {},
"chflags": {},
"chmod": {},
"chown": {},
"clock": {},
"clock_gettime": {},
"close": {},
"closedir": {},
"confstr": {},
"connect": {},
"copyfile": {},
"copysign": {},
"copysignf": {},
"copysignl": {},
"cos": {},
"cosf": {},
"cosh": {},
"dlclose": {},
"dlerror": {},
"dlopen": {},
"dlsym": {},
"dup2": {},
"environ": {},
"exit": {},
"exp": {},
"fabs": {},
"fabsf": {},
"fabsl": {},
"fchmod": {},
"fchown": {},
"fclose": {},
"fcntl": {},
"fcntl64": {},
"fdopen": {},
"ferror": {},
"fflush": {},
"fgetc": {},
"fgets": {},
"fileno": {},
"flock": {},
"floor": {},
"fmod": {},
"fmodl": {},
"fopen": {},
"fopen64": {},
"fork": {},
"fprintf": {},
"fputc": {},
"fputs": {},
"fread": {},
"free": {},
"freeaddrinfo": {},
"frexp": {},
"fsctl": {},
"fseek": {},
"fstat": {},
"fstat64": {},
"fstatfs": {},
"fsync": {},
"ftell": {},
"ftruncate": {},
"fts_close": {},
"fts_open": {},
"fts_read": {},
"futimes": {},
"fwrite": {},
"gai_strerror": {},
"getaddrinfo": {},
"getattrlist": {},
"getcwd": {},
"getegid": {},
"getentropy": {},
"getenv": {},
"geteuid": {},
"getgid": {},
"getgrgid": {},
"getgrnam": {},
"gethostbyaddr": {},
"gethostbyaddr_r": {},
"gethostbyname": {},
"gethostbyname2": {},
"gethostbyname2_r": {},
"gethostname": {},
"gethostuuid": {},
"getnameinfo": {},
"getpeername": {},
"getpid": {},
"getpwnam": {},
"getpwuid": {},
"getresgid": {},
"getresuid": {},
"getrusage": {},
"getservbyname": {},
"getsockname": {},
"getsockopt": {},
"gettimeofday": {},
"getuid": {},
"gmtime_r": {},
"h_errno": {},
"htonl": {},
"htons": {},
"hypot": {},
"inet_ntoa": {},
"inet_ntop": {},
"inet_pton": {},
"ioctl": {},
"isalnum": {},
"isalpha": {},
"isatty": {},
"isdigit": {},
"islower": {},
"isnan": {},
"isnanf": {},
"isnanl": {},
"isprint": {},
"isspace": {},
"isupper": {},
"iswalnum": {},
"iswspace": {},
"isxdigit": {},
"kill": {},
"ldexp": {},
"link": {},
"listen": {},
"localtime": {},
"localtime_r": {},
"log": {},
"log10": {},
"longjmp": {},
"lrand48": {},
"lseek": {},
"lseek64": {},
"lstat": {},
"lstat64": {},
"mach_absolute_time": {},
"mach_timebase_info": {},
"malloc": {},
"mblen": {},
"mbstowcs": {},
"mbtowc": {},
"memchr": {},
"memcmp": {},
"memcpy": {},
"memmove": {},
"memset": {},
"mkdir": {},
"mkfifo": {},
"mknod": {},
"mkstemp": {},
"mkstemps": {},
"mkstemps64": {},
"mktime": {},
"mmap": {},
"modf": {},
"munmap": {},
"nanf": {},
"nl_langinfo": {},
"ntohs": {},
"obstack_free": {},
"obstack_vprintf": {},
"open": {},
"opendir": {},
"openpty": {},
"pathconf": {},
"pclose": {},
"perror": {},
"pipe": {},
"poll": {},
"popen": {},
"posix_fadvise": {},
"pow": {},
"pread": {},
"printf": {},
"pselect": {},
"pthread_attr_destroy": {},
"pthread_attr_getdetachstate": {},
"pthread_attr_init": {},
"pthread_attr_setdetachstate": {},
"pthread_attr_setscope": {},
"pthread_attr_setstacksize": {},
"pthread_cond_broadcast": {},
"pthread_cond_destroy": {},
"pthread_cond_init": {},
"pthread_cond_signal": {},
"pthread_cond_timedwait": {},
"pthread_cond_wait": {},
"pthread_create": {},
"pthread_detach": {},
"pthread_equal": {},
"pthread_exit": {},
"pthread_getspecific": {},
"pthread_join": {},
"pthread_key_create": {},
"pthread_key_delete": {},
"pthread_mutex_destroy": {},
"pthread_mutex_init": {},
"pthread_mutex_lock": {},
"pthread_mutex_trylock": {},
"pthread_mutex_unlock": {},
"pthread_mutexattr_destroy": {},
"pthread_mutexattr_init": {},
"pthread_mutexattr_settype": {},
"pthread_self": {},
"pthread_setspecific": {},
"putc": {},
"putchar": {},
"putenv": {},
"puts": {},
"pwrite": {},
"qsort": {},
"raise": {},
"rand": {},
"rand_r": {},
"random": {},
"read": {},
"readdir": {},
"readlink": {},
"readv": {},
"realloc": {},
"reallocarray": {},
"realpath": {},
"recv": {},
"recvfrom": {},
"recvmsg": {},
"remove": {},
"rename": {},
"rewind": {},
"rint": {},
"rmdir": {},
"round": {},
"scalbn": {},
"scalbnl": {},
"select": {},
"send": {},
"sendmsg": {},
"sendto": {},
"setattrlist": {},
"setbuf": {},
"setenv": {},
"setjmp": {},
"setlocale": {},
"setsid": {},
"setsockopt": {},
"setvbuf": {},
"shmat": {},
"shmctl": {},
"shmdt": {},
"shutdown": {},
"sigaction": {},
"signal": {},
"sin": {},
"sinf": {},
"sinh": {},
"sleep": {},
"snprintf": {},
"socket": {},
"sprintf": {},
"sqrt": {},
"srand48": {},
"srandomdev": {},
"sscanf": {},
"stat": {},
"stat64": {},
"statfs": {},
"stderr": {},
"stdin": {},
"stdout": {},
"strcasecmp": {},
"strcat": {},
"strchr": {},
"strcmp": {},
"strcpy": {},
"strcspn": {},
"strdup": {},
"strerror": {},
"strlcat": {},
"strlcpy": {},
"strlen": {},
"strncat": {},
"strncmp": {},
"strncpy": {},
"strnlen": {},
"strpbrk": {},
"strrchr": {},
"strspn": {},
"strstr": {},
"strtod": {},
"strtof": {},
"strtoimax": {},
"strtok": {},
"strtol": {},
"strtold": {},
"strtoll": {},
"strtoul": {},
"strtoull": {},
"strtoumax": {},
"symlink": {},
"sysconf": {},
"system": {},
"tan": {},
"tanh": {},
"tcgetattr": {},
"tcsendbreak": {},
"tcsetattr": {},
"time": {},
"tmpfile": {},
"tolower": {},
"toupper": {},
"trunc": {},
"truncate": {},
"tzset": {},
"umask": {},
"uname": {},
"unlink": {},
"unsetenv": {},
"usleep": {},
"utime": {},
"utimes": {},
"vasprintf": {},
"vfprintf": {},
"vprintf": {},
"vsnprintf": {},
"vsprintf": {},
"waitpid": {},
"wcschr": {},
"wctomb": {},
"wcwidth": {},
"write": {},
"zero_struct_address": {},
"_IO_putc": {},
"_NSGetEnviron": {},
"___errno_location": {},
"__assert_fail": {},
"__assert_rtn": {},
"__builtin___memcpy_chk": {},
"__builtin___memmove_chk": {},
"__builtin___memset_chk": {},
"__builtin___snprintf_chk": {},
"__builtin___sprintf_chk": {},
"__builtin___strcat_chk": {},
"__builtin___strcpy_chk": {},
"__builtin___strncpy_chk": {},
"__builtin___vsnprintf_chk": {},
"__builtin_abort": {},
"__builtin_abs": {},
"__builtin_add_overflowInt64": {},
"__builtin_add_overflowUint32": {},
"__builtin_add_overflowUint64": {},
"__builtin_bswap16": {},
"__builtin_bswap32": {},
"__builtin_bswap64": {},
"__builtin_bzero": {},
"__builtin_clz": {},
"__builtin_clzl": {},
"__builtin_clzll": {},
"__builtin_constant_p_impl": {},
"__builtin_copysign": {},
"__builtin_copysignf": {},
"__builtin_copysignl": {},
"__builtin_exit": {},
"__builtin_expect": {},
"__builtin_fabs": {},
"__builtin_free": {},
"__builtin_getentropy": {},
"__builtin_huge_val": {},
"__builtin_huge_valf": {},
"__builtin_inf": {},
"__builtin_inff": {},
"__builtin_infl": {},
"__builtin_isnan": {},
"__builtin_malloc": {},
"__builtin_memcmp": {},
"__builtin_memcpy": {},
"__builtin_memset": {},
"__builtin_mmap": {},
"__builtin_mul_overflowInt64": {},
"__builtin_mul_overflowUint128": {},
"__builtin_mul_overflowUint64": {},
"__builtin_nan": {},
"__builtin_nanf": {},
"__builtin_nanl": {},
"__builtin_object_size": {},
"__builtin_popcount": {},
"__builtin_popcountl": {},
"__builtin_prefetch": {},
"__builtin_printf": {},
"__builtin_snprintf": {},
"__builtin_sprintf": {},
"__builtin_strchr": {},
"__builtin_strcmp": {},
"__builtin_strcpy": {},
"__builtin_strlen": {},
"__builtin_sub_overflowInt64": {},
"__builtin_trap": {},
"__builtin_unreachable": {},
"__ccgo_dmesg": {},
"__ccgo_getMutexType": {},
"__ccgo_in6addr_anyp": {},
"__ccgo_pthreadAttrGetDetachState": {},
"__ccgo_pthreadMutexattrGettype": {},
"__ccgo_sqlite3_log": {},
"__cmsg_nxthdr": {},
"__ctype_get_mb_cur_max": {},
"__darwin_fd_clr": {},
"__darwin_fd_isset": {},
"__darwin_fd_set": {},
"__env_rm_add": {},
"__errno_location": {},
"__error": {},
"__floatscan": {},
"__fpclassify": {},
"__fpclassifyf": {},
"__fpclassifyl": {},
"__h_errno_location": {},
"__inet_aton": {},
"__inline_isnand": {},
"__inline_isnanf": {},
"__inline_isnanl": {},
"__intscan": {},
"__isalnum_l": {},
"__isalpha_l": {},
"__isdigit_l": {},
"__islower_l": {},
"__isnan": {},
"__isnanf": {},
"__isnanl": {},
"__isoc99_sscanf": {},
"__isprint_l": {},
"__isupper_l": {},
"__isxdigit_l": {},
"__lookup_ipliteral": {},
"__lookup_name": {},
"__lookup_serv": {},
"__mb_cur_max": {},
"__putenv": {},
"__shgetc": {},
"__shlim": {},
"__stderrp": {},
"__stdinp": {},
"__stdoutp": {},
"__strchrnul": {},
"__sync_add_and_fetch_uint32": {},
"__sync_sub_and_fetch_uint32": {},
"__toread": {},
"__toread_needs_stdio_exit": {},
"__uflow": {},
"_exit": {},
"_longjmp": {},
"_obstack_begin": {},
"_obstack_newchunk": {},
"_setjmp": {},
"abort": {},
"abs": {},
"accept": {},
"access": {},
"acos": {},
"acosh": {},
"alarm": {},
"arc4random_buf": {},
"asin": {},
"asinh": {},
"atan": {},
"atan2": {},
"atanh": {},
"atexit": {},
"atof": {},
"atoi": {},
"atol": {},
"bind": {},
"bzero": {},
"calloc": {},
"ceil": {},
"ceilf": {},
"cfgetospeed": {},
"cfsetispeed": {},
"cfsetospeed": {},
"chdir": {},
"chflags": {},
"chmod": {},
"chown": {},
"clock": {},
"clock_gettime": {},
"close": {},
"closedir": {},
"confstr": {},
"connect": {},
"copyfile": {},
"copysign": {},
"copysignf": {},
"copysignl": {},
"cos": {},
"cosf": {},
"cosh": {},
"dlclose": {},
"dlerror": {},
"dlopen": {},
"dlsym": {},
"dup2": {},
"environ": {},
"exit": {},
"exp": {},
"fabs": {},
"fabsf": {},
"fabsl": {},
"fchmod": {},
"fchown": {},
"fclose": {},
"fcntl": {},
"fcntl64": {},
"fdopen": {},
"ferror": {},
"fflush": {},
"fgetc": {},
"fgets": {},
"fileno": {},
"flock": {},
"floor": {},
"fmod": {},
"fmodl": {},
"fopen": {},
"fopen64": {},
"fork": {},
"fprintf": {},
"fputc": {},
"fputs": {},
"fread": {},
"free": {},
"freeaddrinfo": {},
"frexp": {},
"fsctl": {},
"fseek": {},
"fstat": {},
"fstat64": {},
"fstatfs": {},
"fsync": {},
"ftell": {},
"ftruncate": {},
"fts_close": {},
"fts_open": {},
"fts_read": {},
"futimes": {},
"fwrite": {},
"gai_strerror": {},
"getaddrinfo": {},
"getattrlist": {},
"getc": {},
"getcwd": {},
"getegid": {},
"getentropy": {},
"getenv": {},
"geteuid": {},
"getgid": {},
"getgrgid": {},
"getgrgid_r": {},
"getgrnam": {},
"getgrnam_r": {},
"gethostbyaddr": {},
"gethostbyaddr_r": {},
"gethostbyname": {},
"gethostbyname2": {},
"gethostbyname2_r": {},
"gethostname": {},
"gethostuuid": {},
"getnameinfo": {},
"getpeername": {},
"getpid": {},
"getpwnam": {},
"getpwnam_r": {},
"getpwuid": {},
"getpwuid_r": {},
"getresgid": {},
"getresuid": {},
"getrusage": {},
"getservbyname": {},
"getsockname": {},
"getsockopt": {},
"gettimeofday": {},
"getuid": {},
"gmtime_r": {},
"h_errno": {},
"htonl": {},
"htons": {},
"hypot": {},
"inet_ntoa": {},
"inet_ntop": {},
"inet_pton": {},
"ioctl": {},
"isalnum": {},
"isalpha": {},
"isascii": {},
"isatty": {},
"isdigit": {},
"islower": {},
"isnan": {},
"isnanf": {},
"isnanl": {},
"isprint": {},
"issetugid": {},
"isspace": {},
"isupper": {},
"iswalnum": {},
"iswspace": {},
"isxdigit": {},
"kill": {},
"ldexp": {},
"link": {},
"listen": {},
"localtime": {},
"localtime_r": {},
"log": {},
"log10": {},
"longjmp": {},
"lrand48": {},
"lseek": {},
"lseek64": {},
"lstat": {},
"lstat64": {},
"mach_absolute_time": {},
"mach_timebase_info": {},
"malloc": {},
"mblen": {},
"mbstowcs": {},
"mbtowc": {},
"memchr": {},
"memcmp": {},
"memcpy": {},
"memmove": {},
"memset": {},
"mkdir": {},
"mkfifo": {},
"mknod": {},
"mkstemp": {},
"mkstemps": {},
"mkstemps64": {},
"mktime": {},
"mmap": {},
"modf": {},
"munmap": {},
"nanf": {},
"nl_langinfo": {},
"ntohs": {},
"obstack_free": {},
"obstack_vprintf": {},
"open": {},
"opendir": {},
"openpty": {},
"pathconf": {},
"pause": {},
"pclose": {},
"perror": {},
"pipe": {},
"poll": {},
"popen": {},
"posix_fadvise": {},
"pow": {},
"pread": {},
"printf": {},
"pselect": {},
"pthread_attr_destroy": {},
"pthread_attr_getdetachstate": {},
"pthread_attr_init": {},
"pthread_attr_setdetachstate": {},
"pthread_attr_setscope": {},
"pthread_attr_setstacksize": {},
"pthread_cond_broadcast": {},
"pthread_cond_destroy": {},
"pthread_cond_init": {},
"pthread_cond_signal": {},
"pthread_cond_timedwait": {},
"pthread_cond_wait": {},
"pthread_create": {},
"pthread_detach": {},
"pthread_equal": {},
"pthread_exit": {},
"pthread_getspecific": {},
"pthread_join": {},
"pthread_key_create": {},
"pthread_key_delete": {},
"pthread_mutex_destroy": {},
"pthread_mutex_init": {},
"pthread_mutex_lock": {},
"pthread_mutex_trylock": {},
"pthread_mutex_unlock": {},
"pthread_mutexattr_destroy": {},
"pthread_mutexattr_init": {},
"pthread_mutexattr_settype": {},
"pthread_self": {},
"pthread_setspecific": {},
"putc": {},
"putchar": {},
"putenv": {},
"puts": {},
"pwrite": {},
"qsort": {},
"raise": {},
"rand": {},
"rand_r": {},
"random": {},
"read": {},
"readdir": {},
"readlink": {},
"readv": {},
"realloc": {},
"reallocarray": {},
"realpath": {},
"recv": {},
"recvfrom": {},
"recvmsg": {},
"remove": {},
"rename": {},
"rewind": {},
"rindex": {},
"rint": {},
"rmdir": {},
"round": {},
"scalbn": {},
"scalbnl": {},
"sched_yield": {},
"select": {},
"send": {},
"sendmsg": {},
"sendto": {},
"setattrlist": {},
"setbuf": {},
"setenv": {},
"setjmp": {},
"setlocale": {},
"setsid": {},
"setsockopt": {},
"setvbuf": {},
"shmat": {},
"shmctl": {},
"shmdt": {},
"shutdown": {},
"sigaction": {},
"signal": {},
"sin": {},
"sinf": {},
"sinh": {},
"sleep": {},
"snprintf": {},
"socket": {},
"sprintf": {},
"sqrt": {},
"srand48": {},
"srandomdev": {},
"sscanf": {},
"stat": {},
"stat64": {},
"statfs": {},
"stderr": {},
"stdin": {},
"stdout": {},
"strcasecmp": {},
"strcat": {},
"strchr": {},
"strcmp": {},
"strcpy": {},
"strcspn": {},
"strdup": {},
"strerror": {},
"strlcat": {},
"strlcpy": {},
"strlen": {},
"strncat": {},
"strncmp": {},
"strncpy": {},
"strnlen": {},
"strpbrk": {},
"strrchr": {},
"strspn": {},
"strstr": {},
"strtod": {},
"strtof": {},
"strtoimax": {},
"strtok": {},
"strtol": {},
"strtold": {},
"strtoll": {},
"strtoul": {},
"strtoull": {},
"strtoumax": {},
"symlink": {},
"sysconf": {},
"system": {},
"tan": {},
"tanh": {},
"tcgetattr": {},
"tcsendbreak": {},
"tcsetattr": {},
"time": {},
"tmpfile": {},
"tolower": {},
"toupper": {},
"trunc": {},
"truncate": {},
"tzset": {},
"umask": {},
"uname": {},
"ungetc": {},
"unlink": {},
"unsetenv": {},
"usleep": {},
"utime": {},
"utimes": {},
"vasprintf": {},
"vfprintf": {},
"vprintf": {},
"vsnprintf": {},
"vsprintf": {},
"waitpid": {},
"wcschr": {},
"wctomb": {},
"wcwidth": {},
"write": {},
"writev": {},
"zero_struct_address": {},
}

View file

@ -28,6 +28,7 @@ var CAPI = map[string]struct{}{
"__builtin_bswap16": {},
"__builtin_bswap32": {},
"__builtin_bswap64": {},
"__builtin_bzero": {},
"__builtin_clz": {},
"__builtin_clzl": {},
"__builtin_clzll": {},
@ -107,7 +108,6 @@ var CAPI = map[string]struct{}{
"__swbuf": {},
"__sync_add_and_fetch_uint32": {},
"__sync_sub_and_fetch_uint32": {},
"__sync_synchronize": {},
"__syscall1": {},
"__syscall3": {},
"__syscall4": {},
@ -139,6 +139,7 @@ var CAPI = map[string]struct{}{
"backtrace": {},
"backtrace_symbols_fd": {},
"bind": {},
"bzero": {},
"calloc": {},
"ceil": {},
"ceilf": {},
@ -260,6 +261,7 @@ var CAPI = map[string]struct{}{
"ioctl": {},
"isalnum": {},
"isalpha": {},
"isascii": {},
"isatty": {},
"isdigit": {},
"isnan": {},
@ -368,6 +370,7 @@ var CAPI = map[string]struct{}{
"remove": {},
"rename": {},
"rewind": {},
"rindex": {},
"rint": {},
"rmdir": {},
"round": {},

View file

@ -23,6 +23,7 @@ var CAPI = map[string]struct{}{
"__builtin_bswap16": {},
"__builtin_bswap32": {},
"__builtin_bswap64": {},
"__builtin_bzero": {},
"__builtin_clz": {},
"__builtin_clzl": {},
"__builtin_clzll": {},
@ -104,7 +105,6 @@ var CAPI = map[string]struct{}{
"__strncasecmp_l": {},
"__sync_add_and_fetch_uint32": {},
"__sync_sub_and_fetch_uint32": {},
"__sync_synchronize": {},
"__syscall1": {},
"__syscall3": {},
"__syscall4": {},
@ -136,6 +136,7 @@ var CAPI = map[string]struct{}{
"backtrace": {},
"backtrace_symbols_fd": {},
"bind": {},
"bzero": {},
"calloc": {},
"ceil": {},
"ceilf": {},
@ -261,6 +262,7 @@ var CAPI = map[string]struct{}{
"ioctl": {},
"isalnum": {},
"isalpha": {},
"isascii": {},
"isatty": {},
"isdigit": {},
"islower": {},
@ -384,6 +386,7 @@ var CAPI = map[string]struct{}{
"remove": {},
"rename": {},
"rewind": {},
"rindex": {},
"rint": {},
"rmdir": {},
"round": {},

View file

@ -23,6 +23,7 @@ var CAPI = map[string]struct{}{
"__builtin_bswap16": {},
"__builtin_bswap32": {},
"__builtin_bswap64": {},
"__builtin_bzero": {},
"__builtin_clz": {},
"__builtin_clzl": {},
"__builtin_clzll": {},
@ -104,7 +105,6 @@ var CAPI = map[string]struct{}{
"__strncasecmp_l": {},
"__sync_add_and_fetch_uint32": {},
"__sync_sub_and_fetch_uint32": {},
"__sync_synchronize": {},
"__syscall1": {},
"__syscall3": {},
"__syscall4": {},
@ -136,6 +136,7 @@ var CAPI = map[string]struct{}{
"backtrace": {},
"backtrace_symbols_fd": {},
"bind": {},
"bzero": {},
"calloc": {},
"ceil": {},
"ceilf": {},
@ -261,6 +262,7 @@ var CAPI = map[string]struct{}{
"ioctl": {},
"isalnum": {},
"isalpha": {},
"isascii": {},
"isatty": {},
"isdigit": {},
"islower": {},
@ -386,6 +388,7 @@ var CAPI = map[string]struct{}{
"remove": {},
"rename": {},
"rewind": {},
"rindex": {},
"rint": {},
"rmdir": {},
"round": {},

View file

@ -23,6 +23,7 @@ var CAPI = map[string]struct{}{
"__builtin_bswap16": {},
"__builtin_bswap32": {},
"__builtin_bswap64": {},
"__builtin_bzero": {},
"__builtin_clz": {},
"__builtin_clzl": {},
"__builtin_clzll": {},
@ -104,7 +105,6 @@ var CAPI = map[string]struct{}{
"__strncasecmp_l": {},
"__sync_add_and_fetch_uint32": {},
"__sync_sub_and_fetch_uint32": {},
"__sync_synchronize": {},
"__syscall1": {},
"__syscall3": {},
"__syscall4": {},
@ -136,6 +136,7 @@ var CAPI = map[string]struct{}{
"backtrace": {},
"backtrace_symbols_fd": {},
"bind": {},
"bzero": {},
"calloc": {},
"ceil": {},
"ceilf": {},
@ -261,6 +262,7 @@ var CAPI = map[string]struct{}{
"ioctl": {},
"isalnum": {},
"isalpha": {},
"isascii": {},
"isatty": {},
"isdigit": {},
"islower": {},
@ -384,6 +386,7 @@ var CAPI = map[string]struct{}{
"remove": {},
"rename": {},
"rewind": {},
"rindex": {},
"rint": {},
"rmdir": {},
"round": {},

View file

@ -23,6 +23,7 @@ var CAPI = map[string]struct{}{
"__builtin_bswap16": {},
"__builtin_bswap32": {},
"__builtin_bswap64": {},
"__builtin_bzero": {},
"__builtin_clz": {},
"__builtin_clzl": {},
"__builtin_clzll": {},
@ -104,7 +105,6 @@ var CAPI = map[string]struct{}{
"__strncasecmp_l": {},
"__sync_add_and_fetch_uint32": {},
"__sync_sub_and_fetch_uint32": {},
"__sync_synchronize": {},
"__syscall1": {},
"__syscall3": {},
"__syscall4": {},
@ -136,6 +136,7 @@ var CAPI = map[string]struct{}{
"backtrace": {},
"backtrace_symbols_fd": {},
"bind": {},
"bzero": {},
"calloc": {},
"ceil": {},
"ceilf": {},
@ -261,6 +262,7 @@ var CAPI = map[string]struct{}{
"ioctl": {},
"isalnum": {},
"isalpha": {},
"isascii": {},
"isatty": {},
"isdigit": {},
"islower": {},
@ -384,6 +386,7 @@ var CAPI = map[string]struct{}{
"remove": {},
"rename": {},
"rewind": {},
"rindex": {},
"rint": {},
"rmdir": {},
"round": {},

View file

@ -23,6 +23,7 @@ var CAPI = map[string]struct{}{
"__builtin_bswap16": {},
"__builtin_bswap32": {},
"__builtin_bswap64": {},
"__builtin_bzero": {},
"__builtin_clz": {},
"__builtin_clzl": {},
"__builtin_clzll": {},
@ -104,7 +105,6 @@ var CAPI = map[string]struct{}{
"__strncasecmp_l": {},
"__sync_add_and_fetch_uint32": {},
"__sync_sub_and_fetch_uint32": {},
"__sync_synchronize": {},
"__syscall1": {},
"__syscall3": {},
"__syscall4": {},
@ -136,6 +136,7 @@ var CAPI = map[string]struct{}{
"backtrace": {},
"backtrace_symbols_fd": {},
"bind": {},
"bzero": {},
"calloc": {},
"ceil": {},
"ceilf": {},
@ -261,6 +262,7 @@ var CAPI = map[string]struct{}{
"ioctl": {},
"isalnum": {},
"isalpha": {},
"isascii": {},
"isatty": {},
"isdigit": {},
"islower": {},
@ -384,6 +386,7 @@ var CAPI = map[string]struct{}{
"remove": {},
"rename": {},
"rewind": {},
"rindex": {},
"rint": {},
"rmdir": {},
"round": {},

View file

@ -28,6 +28,7 @@ var CAPI = map[string]struct{}{
"__builtin_bswap16": {},
"__builtin_bswap32": {},
"__builtin_bswap64": {},
"__builtin_bzero": {},
"__builtin_clz": {},
"__builtin_clzl": {},
"__builtin_clzll": {},
@ -144,6 +145,7 @@ var CAPI = map[string]struct{}{
"backtrace": {},
"backtrace_symbols_fd": {},
"bind": {},
"bzero": {},
"calloc": {},
"ceil": {},
"ceilf": {},
@ -265,6 +267,7 @@ var CAPI = map[string]struct{}{
"ioctl": {},
"isalnum": {},
"isalpha": {},
"isascii": {},
"isatty": {},
"isdigit": {},
"isnan": {},
@ -373,6 +376,7 @@ var CAPI = map[string]struct{}{
"remove": {},
"rename": {},
"rewind": {},
"rindex": {},
"rint": {},
"rmdir": {},
"round": {},

View file

@ -72,6 +72,7 @@ var CAPI = map[string]struct{}{
"GetCommModemStatus": {},
"GetCommState": {},
"GetCommandLineW": {},
"GetComputerNameExW": {},
"GetComputerNameW": {},
"GetConsoleCP": {},
"GetConsoleMode": {},
@ -272,6 +273,7 @@ var CAPI = map[string]struct{}{
"__builtin_bswap16": {},
"__builtin_bswap32": {},
"__builtin_bswap64": {},
"__builtin_bzero": {},
"__builtin_clz": {},
"__builtin_clzl": {},
"__builtin_clzll": {},
@ -327,6 +329,7 @@ var CAPI = map[string]struct{}{
"__env_rm_add": {},
"__errno_location": {},
"__imp__environ": {},
"__imp__wenviron": {},
"__isalnum_l": {},
"__isalpha_l": {},
"__isdigit_l": {},
@ -359,7 +362,6 @@ var CAPI = map[string]struct{}{
"__strchrnul": {},
"__sync_add_and_fetch_uint32": {},
"__sync_sub_and_fetch_uint32": {},
"__sync_synchronize": {},
"_access": {},
"_assert": {},
"_beginthread": {},
@ -370,6 +372,7 @@ var CAPI = map[string]struct{}{
"_chsize": {},
"_commit": {},
"_controlfp": {},
"_copysign": {},
"_endthreadex": {},
"_errno": {},
"_exit": {},
@ -413,7 +416,10 @@ var CAPI = map[string]struct{}{
"_vsnwprintf": {},
"_wcsicmp": {},
"_wcsnicmp": {},
"_wgetenv": {},
"_wopen": {},
"_wputenv": {},
"_wtoi": {},
"_wunlink": {},
"abort": {},
"abs": {},
@ -434,6 +440,7 @@ var CAPI = map[string]struct{}{
"backtrace": {},
"backtrace_symbols_fd": {},
"bind": {},
"bzero": {},
"calloc": {},
"ceil": {},
"ceilf": {},
@ -526,6 +533,7 @@ var CAPI = map[string]struct{}{
"ioctlsocket": {},
"isalnum": {},
"isalpha": {},
"isascii": {},
"isatty": {},
"isdigit": {},
"islower": {},
@ -603,6 +611,7 @@ var CAPI = map[string]struct{}{
"recv": {},
"rename": {},
"rewind": {},
"rindex": {},
"rint": {},
"rmdir": {},
"round": {},

View file

@ -72,6 +72,7 @@ var CAPI = map[string]struct{}{
"GetCommModemStatus": {},
"GetCommState": {},
"GetCommandLineW": {},
"GetComputerNameExW": {},
"GetComputerNameW": {},
"GetConsoleCP": {},
"GetConsoleMode": {},
@ -270,6 +271,7 @@ var CAPI = map[string]struct{}{
"__builtin_bswap16": {},
"__builtin_bswap32": {},
"__builtin_bswap64": {},
"__builtin_bzero": {},
"__builtin_clz": {},
"__builtin_clzl": {},
"__builtin_clzll": {},
@ -325,6 +327,7 @@ var CAPI = map[string]struct{}{
"__env_rm_add": {},
"__errno_location": {},
"__imp__environ": {},
"__imp__wenviron": {},
"__isalnum_l": {},
"__isalpha_l": {},
"__isdigit_l": {},
@ -357,7 +360,6 @@ var CAPI = map[string]struct{}{
"__strchrnul": {},
"__sync_add_and_fetch_uint32": {},
"__sync_sub_and_fetch_uint32": {},
"__sync_synchronize": {},
"_access": {},
"_assert": {},
"_beginthread": {},
@ -368,6 +370,7 @@ var CAPI = map[string]struct{}{
"_chsize": {},
"_commit": {},
"_controlfp": {},
"_copysign": {},
"_endthreadex": {},
"_errno": {},
"_exit": {},
@ -409,7 +412,10 @@ var CAPI = map[string]struct{}{
"_vsnwprintf": {},
"_wcsicmp": {},
"_wcsnicmp": {},
"_wgetenv": {},
"_wopen": {},
"_wputenv": {},
"_wtoi": {},
"_wunlink": {},
"abort": {},
"abs": {},
@ -430,6 +436,7 @@ var CAPI = map[string]struct{}{
"backtrace": {},
"backtrace_symbols_fd": {},
"bind": {},
"bzero": {},
"calloc": {},
"ceil": {},
"ceilf": {},
@ -522,6 +529,7 @@ var CAPI = map[string]struct{}{
"ioctlsocket": {},
"isalnum": {},
"isalpha": {},
"isascii": {},
"isatty": {},
"isdigit": {},
"islower": {},
@ -599,6 +607,7 @@ var CAPI = map[string]struct{}{
"recv": {},
"rename": {},
"rewind": {},
"rindex": {},
"rint": {},
"rmdir": {},
"round": {},

64
vendor/modernc.org/libc/ccgo.go generated vendored
View file

@ -1273,7 +1273,7 @@ func AssignBitFieldPtr64Uint64(p uintptr, v uint64, w, off int, mask uint64) uin
func PostDecBitFieldPtr8Int8(p uintptr, d int8, w, off int, mask uint8) (r int8) {
x0 := *(*uint8)(unsafe.Pointer(p))
s := 8 - w
r = int8(x0) & int8(mask) << s >> s
r = int8(x0) & int8(mask) << s >> (s + off)
*(*uint8)(unsafe.Pointer(p)) = x0&^uint8(mask) | uint8(r-d)<<off&mask
return r
}
@ -1281,7 +1281,7 @@ func PostDecBitFieldPtr8Int8(p uintptr, d int8, w, off int, mask uint8) (r int8)
func PostDecBitFieldPtr8Int16(p uintptr, d int16, w, off int, mask uint8) (r int16) {
x0 := *(*uint8)(unsafe.Pointer(p))
s := 16 - w
r = int16(x0) & int16(mask) << s >> s
r = int16(x0) & int16(mask) << s >> (s + off)
*(*uint8)(unsafe.Pointer(p)) = x0&^uint8(mask) | uint8(r-d)<<off&mask
return r
}
@ -1289,7 +1289,7 @@ func PostDecBitFieldPtr8Int16(p uintptr, d int16, w, off int, mask uint8) (r int
func PostDecBitFieldPtr8Int32(p uintptr, d int32, w, off int, mask uint8) (r int32) {
x0 := *(*uint8)(unsafe.Pointer(p))
s := 32 - w
r = int32(x0) & int32(mask) << s >> s
r = int32(x0) & int32(mask) << s >> (s + off)
*(*uint8)(unsafe.Pointer(p)) = x0&^uint8(mask) | uint8(r-d)<<off&mask
return r
}
@ -1297,7 +1297,7 @@ func PostDecBitFieldPtr8Int32(p uintptr, d int32, w, off int, mask uint8) (r int
func PostDecBitFieldPtr8Int64(p uintptr, d int64, w, off int, mask uint8) (r int64) {
x0 := *(*uint8)(unsafe.Pointer(p))
s := 64 - w
r = int64(x0) & int64(mask) << s >> s
r = int64(x0) & int64(mask) << s >> (s + off)
*(*uint8)(unsafe.Pointer(p)) = x0&^uint8(mask) | uint8(r-d)<<off&mask
return r
}
@ -1305,7 +1305,7 @@ func PostDecBitFieldPtr8Int64(p uintptr, d int64, w, off int, mask uint8) (r int
func PostDecBitFieldPtr16Int8(p uintptr, d int8, w, off int, mask uint16) (r int8) {
x0 := *(*uint16)(unsafe.Pointer(p))
s := 8 - w
r = int8(x0) & int8(mask) << s >> s
r = int8(x0) & int8(mask) << s >> (s + off)
*(*uint16)(unsafe.Pointer(p)) = x0&^uint16(mask) | uint16(r-d)<<off&mask
return r
}
@ -1313,7 +1313,7 @@ func PostDecBitFieldPtr16Int8(p uintptr, d int8, w, off int, mask uint16) (r int
func PostDecBitFieldPtr16Int16(p uintptr, d int16, w, off int, mask uint16) (r int16) {
x0 := *(*uint16)(unsafe.Pointer(p))
s := 16 - w
r = int16(x0) & int16(mask) << s >> s
r = int16(x0) & int16(mask) << s >> (s + off)
*(*uint16)(unsafe.Pointer(p)) = x0&^uint16(mask) | uint16(r-d)<<off&mask
return r
}
@ -1321,7 +1321,7 @@ func PostDecBitFieldPtr16Int16(p uintptr, d int16, w, off int, mask uint16) (r i
func PostDecBitFieldPtr16Int32(p uintptr, d int32, w, off int, mask uint16) (r int32) {
x0 := *(*uint16)(unsafe.Pointer(p))
s := 32 - w
r = int32(x0) & int32(mask) << s >> s
r = int32(x0) & int32(mask) << s >> (s + off)
*(*uint16)(unsafe.Pointer(p)) = x0&^uint16(mask) | uint16(r-d)<<off&mask
return r
}
@ -1329,7 +1329,7 @@ func PostDecBitFieldPtr16Int32(p uintptr, d int32, w, off int, mask uint16) (r i
func PostDecBitFieldPtr16Int64(p uintptr, d int64, w, off int, mask uint16) (r int64) {
x0 := *(*uint16)(unsafe.Pointer(p))
s := 64 - w
r = int64(x0) & int64(mask) << s >> s
r = int64(x0) & int64(mask) << s >> (s + off)
*(*uint16)(unsafe.Pointer(p)) = x0&^uint16(mask) | uint16(r-d)<<off&mask
return r
}
@ -1337,7 +1337,7 @@ func PostDecBitFieldPtr16Int64(p uintptr, d int64, w, off int, mask uint16) (r i
func PostDecBitFieldPtr32Int8(p uintptr, d int8, w, off int, mask uint32) (r int8) {
x0 := *(*uint32)(unsafe.Pointer(p))
s := 8 - w
r = int8(x0) & int8(mask) << s >> s
r = int8(x0) & int8(mask) << s >> (s + off)
*(*uint32)(unsafe.Pointer(p)) = x0&^uint32(mask) | uint32(r-d)<<off&mask
return r
}
@ -1345,7 +1345,7 @@ func PostDecBitFieldPtr32Int8(p uintptr, d int8, w, off int, mask uint32) (r int
func PostDecBitFieldPtr32Int16(p uintptr, d int16, w, off int, mask uint32) (r int16) {
x0 := *(*uint32)(unsafe.Pointer(p))
s := 16 - w
r = int16(x0) & int16(mask) << s >> s
r = int16(x0) & int16(mask) << s >> (s + off)
*(*uint32)(unsafe.Pointer(p)) = x0&^uint32(mask) | uint32(r-d)<<off&mask
return r
}
@ -1353,7 +1353,7 @@ func PostDecBitFieldPtr32Int16(p uintptr, d int16, w, off int, mask uint32) (r i
func PostDecBitFieldPtr32Int32(p uintptr, d int32, w, off int, mask uint32) (r int32) {
x0 := *(*uint32)(unsafe.Pointer(p))
s := 32 - w
r = int32(x0) & int32(mask) << s >> s
r = int32(x0) & int32(mask) << s >> (s + off)
*(*uint32)(unsafe.Pointer(p)) = x0&^uint32(mask) | uint32(r-d)<<off&mask
return r
}
@ -1361,7 +1361,7 @@ func PostDecBitFieldPtr32Int32(p uintptr, d int32, w, off int, mask uint32) (r i
func PostDecBitFieldPtr32Int64(p uintptr, d int64, w, off int, mask uint32) (r int64) {
x0 := *(*uint32)(unsafe.Pointer(p))
s := 64 - w
r = int64(x0) & int64(mask) << s >> s
r = int64(x0) & int64(mask) << s >> (s + off)
*(*uint32)(unsafe.Pointer(p)) = x0&^uint32(mask) | uint32(r-d)<<off&mask
return r
}
@ -1369,7 +1369,7 @@ func PostDecBitFieldPtr32Int64(p uintptr, d int64, w, off int, mask uint32) (r i
func PostDecBitFieldPtr64Int8(p uintptr, d int8, w, off int, mask uint64) (r int8) {
x0 := *(*uint64)(unsafe.Pointer(p))
s := 8 - w
r = int8(x0) & int8(mask) << s >> s
r = int8(x0) & int8(mask) << s >> (s + off)
*(*uint64)(unsafe.Pointer(p)) = x0&^uint64(mask) | uint64(r-d)<<off&mask
return r
}
@ -1377,7 +1377,7 @@ func PostDecBitFieldPtr64Int8(p uintptr, d int8, w, off int, mask uint64) (r int
func PostDecBitFieldPtr64Int16(p uintptr, d int16, w, off int, mask uint64) (r int16) {
x0 := *(*uint64)(unsafe.Pointer(p))
s := 16 - w
r = int16(x0) & int16(mask) << s >> s
r = int16(x0) & int16(mask) << s >> (s + off)
*(*uint64)(unsafe.Pointer(p)) = x0&^uint64(mask) | uint64(r-d)<<off&mask
return r
}
@ -1385,7 +1385,7 @@ func PostDecBitFieldPtr64Int16(p uintptr, d int16, w, off int, mask uint64) (r i
func PostDecBitFieldPtr64Int32(p uintptr, d int32, w, off int, mask uint64) (r int32) {
x0 := *(*uint64)(unsafe.Pointer(p))
s := 32 - w
r = int32(x0) & int32(mask) << s >> s
r = int32(x0) & int32(mask) << s >> (s + off)
*(*uint64)(unsafe.Pointer(p)) = x0&^uint64(mask) | uint64(r-d)<<off&mask
return r
}
@ -1393,7 +1393,7 @@ func PostDecBitFieldPtr64Int32(p uintptr, d int32, w, off int, mask uint64) (r i
func PostDecBitFieldPtr64Int64(p uintptr, d int64, w, off int, mask uint64) (r int64) {
x0 := *(*uint64)(unsafe.Pointer(p))
s := 64 - w
r = int64(x0) & int64(mask) << s >> s
r = int64(x0) & int64(mask) << s >> (s + off)
*(*uint64)(unsafe.Pointer(p)) = x0&^uint64(mask) | uint64(r-d)<<off&mask
return r
}
@ -1513,7 +1513,7 @@ func PostDecBitFieldPtr64Uint64(p uintptr, d uint64, w, off int, mask uint64) (r
func PostIncBitFieldPtr8Int8(p uintptr, d int8, w, off int, mask uint8) (r int8) {
x0 := *(*uint8)(unsafe.Pointer(p))
s := 8 - w
r = int8(x0) & int8(mask) << s >> s
r = int8(x0) & int8(mask) << s >> (s + off)
*(*uint8)(unsafe.Pointer(p)) = x0&^uint8(mask) | uint8(r+d)<<off&mask
return r
}
@ -1521,7 +1521,7 @@ func PostIncBitFieldPtr8Int8(p uintptr, d int8, w, off int, mask uint8) (r int8)
func PostIncBitFieldPtr8Int16(p uintptr, d int16, w, off int, mask uint8) (r int16) {
x0 := *(*uint8)(unsafe.Pointer(p))
s := 16 - w
r = int16(x0) & int16(mask) << s >> s
r = int16(x0) & int16(mask) << s >> (s + off)
*(*uint8)(unsafe.Pointer(p)) = x0&^uint8(mask) | uint8(r+d)<<off&mask
return r
}
@ -1529,7 +1529,7 @@ func PostIncBitFieldPtr8Int16(p uintptr, d int16, w, off int, mask uint8) (r int
func PostIncBitFieldPtr8Int32(p uintptr, d int32, w, off int, mask uint8) (r int32) {
x0 := *(*uint8)(unsafe.Pointer(p))
s := 32 - w
r = int32(x0) & int32(mask) << s >> s
r = int32(x0) & int32(mask) << s >> (s + off)
*(*uint8)(unsafe.Pointer(p)) = x0&^uint8(mask) | uint8(r+d)<<off&mask
return r
}
@ -1537,7 +1537,7 @@ func PostIncBitFieldPtr8Int32(p uintptr, d int32, w, off int, mask uint8) (r int
func PostIncBitFieldPtr8Int64(p uintptr, d int64, w, off int, mask uint8) (r int64) {
x0 := *(*uint8)(unsafe.Pointer(p))
s := 64 - w
r = int64(x0) & int64(mask) << s >> s
r = int64(x0) & int64(mask) << s >> (s + off)
*(*uint8)(unsafe.Pointer(p)) = x0&^uint8(mask) | uint8(r+d)<<off&mask
return r
}
@ -1545,7 +1545,7 @@ func PostIncBitFieldPtr8Int64(p uintptr, d int64, w, off int, mask uint8) (r int
func PostIncBitFieldPtr16Int8(p uintptr, d int8, w, off int, mask uint16) (r int8) {
x0 := *(*uint16)(unsafe.Pointer(p))
s := 8 - w
r = int8(x0) & int8(mask) << s >> s
r = int8(x0) & int8(mask) << s >> (s + off)
*(*uint16)(unsafe.Pointer(p)) = x0&^uint16(mask) | uint16(r+d)<<off&mask
return r
}
@ -1553,7 +1553,7 @@ func PostIncBitFieldPtr16Int8(p uintptr, d int8, w, off int, mask uint16) (r int
func PostIncBitFieldPtr16Int16(p uintptr, d int16, w, off int, mask uint16) (r int16) {
x0 := *(*uint16)(unsafe.Pointer(p))
s := 16 - w
r = int16(x0) & int16(mask) << s >> s
r = int16(x0) & int16(mask) << s >> (s + off)
*(*uint16)(unsafe.Pointer(p)) = x0&^uint16(mask) | uint16(r+d)<<off&mask
return r
}
@ -1561,7 +1561,7 @@ func PostIncBitFieldPtr16Int16(p uintptr, d int16, w, off int, mask uint16) (r i
func PostIncBitFieldPtr16Int32(p uintptr, d int32, w, off int, mask uint16) (r int32) {
x0 := *(*uint16)(unsafe.Pointer(p))
s := 32 - w
r = int32(x0) & int32(mask) << s >> s
r = int32(x0) & int32(mask) << s >> (s + off)
*(*uint16)(unsafe.Pointer(p)) = x0&^uint16(mask) | uint16(r+d)<<off&mask
return r
}
@ -1569,7 +1569,7 @@ func PostIncBitFieldPtr16Int32(p uintptr, d int32, w, off int, mask uint16) (r i
func PostIncBitFieldPtr16Int64(p uintptr, d int64, w, off int, mask uint16) (r int64) {
x0 := *(*uint16)(unsafe.Pointer(p))
s := 64 - w
r = int64(x0) & int64(mask) << s >> s
r = int64(x0) & int64(mask) << s >> (s + off)
*(*uint16)(unsafe.Pointer(p)) = x0&^uint16(mask) | uint16(r+d)<<off&mask
return r
}
@ -1577,7 +1577,7 @@ func PostIncBitFieldPtr16Int64(p uintptr, d int64, w, off int, mask uint16) (r i
func PostIncBitFieldPtr32Int8(p uintptr, d int8, w, off int, mask uint32) (r int8) {
x0 := *(*uint32)(unsafe.Pointer(p))
s := 8 - w
r = int8(x0) & int8(mask) << s >> s
r = int8(x0) & int8(mask) << s >> (s + off)
*(*uint32)(unsafe.Pointer(p)) = x0&^uint32(mask) | uint32(r+d)<<off&mask
return r
}
@ -1585,7 +1585,7 @@ func PostIncBitFieldPtr32Int8(p uintptr, d int8, w, off int, mask uint32) (r int
func PostIncBitFieldPtr32Int16(p uintptr, d int16, w, off int, mask uint32) (r int16) {
x0 := *(*uint32)(unsafe.Pointer(p))
s := 16 - w
r = int16(x0) & int16(mask) << s >> s
r = int16(x0) & int16(mask) << s >> (s + off)
*(*uint32)(unsafe.Pointer(p)) = x0&^uint32(mask) | uint32(r+d)<<off&mask
return r
}
@ -1593,7 +1593,7 @@ func PostIncBitFieldPtr32Int16(p uintptr, d int16, w, off int, mask uint32) (r i
func PostIncBitFieldPtr32Int32(p uintptr, d int32, w, off int, mask uint32) (r int32) {
x0 := *(*uint32)(unsafe.Pointer(p))
s := 32 - w
r = int32(x0) & int32(mask) << s >> s
r = int32(x0) & int32(mask) << s >> (s + off)
*(*uint32)(unsafe.Pointer(p)) = x0&^uint32(mask) | uint32(r+d)<<off&mask
return r
}
@ -1601,7 +1601,7 @@ func PostIncBitFieldPtr32Int32(p uintptr, d int32, w, off int, mask uint32) (r i
func PostIncBitFieldPtr32Int64(p uintptr, d int64, w, off int, mask uint32) (r int64) {
x0 := *(*uint32)(unsafe.Pointer(p))
s := 64 - w
r = int64(x0) & int64(mask) << s >> s
r = int64(x0) & int64(mask) << s >> (s + off)
*(*uint32)(unsafe.Pointer(p)) = x0&^uint32(mask) | uint32(r+d)<<off&mask
return r
}
@ -1609,7 +1609,7 @@ func PostIncBitFieldPtr32Int64(p uintptr, d int64, w, off int, mask uint32) (r i
func PostIncBitFieldPtr64Int8(p uintptr, d int8, w, off int, mask uint64) (r int8) {
x0 := *(*uint64)(unsafe.Pointer(p))
s := 8 - w
r = int8(x0) & int8(mask) << s >> s
r = int8(x0) & int8(mask) << s >> (s + off)
*(*uint64)(unsafe.Pointer(p)) = x0&^uint64(mask) | uint64(r+d)<<off&mask
return r
}
@ -1617,7 +1617,7 @@ func PostIncBitFieldPtr64Int8(p uintptr, d int8, w, off int, mask uint64) (r int
func PostIncBitFieldPtr64Int16(p uintptr, d int16, w, off int, mask uint64) (r int16) {
x0 := *(*uint64)(unsafe.Pointer(p))
s := 16 - w
r = int16(x0) & int16(mask) << s >> s
r = int16(x0) & int16(mask) << s >> (s + off)
*(*uint64)(unsafe.Pointer(p)) = x0&^uint64(mask) | uint64(r+d)<<off&mask
return r
}
@ -1625,7 +1625,7 @@ func PostIncBitFieldPtr64Int16(p uintptr, d int16, w, off int, mask uint64) (r i
func PostIncBitFieldPtr64Int32(p uintptr, d int32, w, off int, mask uint64) (r int32) {
x0 := *(*uint64)(unsafe.Pointer(p))
s := 32 - w
r = int32(x0) & int32(mask) << s >> s
r = int32(x0) & int32(mask) << s >> (s + off)
*(*uint64)(unsafe.Pointer(p)) = x0&^uint64(mask) | uint64(r+d)<<off&mask
return r
}
@ -1633,7 +1633,7 @@ func PostIncBitFieldPtr64Int32(p uintptr, d int32, w, off int, mask uint64) (r i
func PostIncBitFieldPtr64Int64(p uintptr, d int64, w, off int, mask uint64) (r int64) {
x0 := *(*uint64)(unsafe.Pointer(p))
s := 64 - w
r = int64(x0) & int64(mask) << s >> s
r = int64(x0) & int64(mask) << s >> (s + off)
*(*uint64)(unsafe.Pointer(p)) = x0&^uint64(mask) | uint64(r+d)<<off&mask
return r
}

View file

@ -314,6 +314,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.

View file

@ -101,6 +101,7 @@ const (
LOCK_SH = 0x01
LOCK_UN = 0x08
MAC_OS_VERSION_11_0 = 110000
MAC_OS_VERSION_12_0 = 120000
MAC_OS_X_VERSION_10_0 = 1000
MAC_OS_X_VERSION_10_1 = 1010
MAC_OS_X_VERSION_10_10 = 101000
@ -194,6 +195,7 @@ const (
S_IXOTH = 0000001
S_IXUSR = 0000100
USER_FSIGNATURES_CDHASH_LEN = 20
X_ARM_MACHTYPES_H_ = 0
X_BSD_ARM__TYPES_H_ = 0
X_BSD_MACHINE_TYPES_H_ = 0
X_BSD_MACHINE__TYPES_H_ = 0
@ -229,7 +231,7 @@ const (
X_U_INT8_T = 0
)
const ( /* fcntl.h:536:1: */
const ( /* fcntl.h:545:1: */
FILESEC_OWNER = 1
FILESEC_GROUP = 2
FILESEC_UUID = 3
@ -448,6 +450,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -762,17 +770,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -790,33 +798,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system
@ -1391,7 +1399,7 @@ type Flock = struct {
Fl_pid Pid_t
Fl_type int16
Fl_whence int16
} /* fcntl.h:350:1 */
} /* fcntl.h:359:1 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -1756,7 +1764,7 @@ type U_int32_t = uint32 /* _u_int32_t.h:30:33 */
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type U_int64_t = uint64 /* _u_int64_t.h:30:33 */
type Register_t = Int64_t /* types.h:63:33 */
type Register_t = Int64_t /* types.h:66:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -1836,19 +1844,20 @@ type Intptr_t = X__darwin_intptr_t /* _intptr_t.h:32:33 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type Uintptr_t = uint64 /* _uintptr_t.h:30:33 */
type Uintptr_t = uint64 /* _uintptr_t.h:34:33 */
// These types are used for reserving the largest possible size.
type User_addr_t = U_int64_t /* types.h:74:33 */
type User_size_t = U_int64_t /* types.h:75:33 */
type User_ssize_t = Int64_t /* types.h:76:33 */
type User_long_t = Int64_t /* types.h:77:33 */
type User_ulong_t = U_int64_t /* types.h:78:33 */
type User_time_t = Int64_t /* types.h:79:33 */
type User_off_t = Int64_t /* types.h:80:33 */
type User_addr_t = U_int64_t /* types.h:77:33 */
type User_size_t = U_int64_t /* types.h:78:33 */
type User_ssize_t = Int64_t /* types.h:79:33 */
type User_long_t = Int64_t /* types.h:80:33 */
type User_ulong_t = U_int64_t /* types.h:81:33 */
type User_time_t = Int64_t /* types.h:82:33 */
type User_off_t = Int64_t /* types.h:83:33 */
// This defines the size of syscall arguments after copying into the kernel:
type Syscall_arg_t = U_int64_t /* types.h:101:33 */
type Syscall_arg_t = U_int64_t /* types.h:104:33 */
type Timespec = struct {
Ftv_sec X__darwin_time_t
@ -1869,7 +1878,7 @@ type Flocktimeout = struct {
Ftv_sec X__darwin_time_t
Ftv_nsec int64
}
} /* fcntl.h:365:1 */
} /* fcntl.h:374:1 */
// advisory file read data type -
// information passed by user to system
@ -1878,7 +1887,7 @@ type Radvisory = struct {
Fra_offset Off_t
Fra_count int32
F__ccgo_pad1 [4]byte
} /* fcntl.h:378:1 */
} /* fcntl.h:387:1 */
// detached code signatures data type -
// information passed by user to system used by F_ADDSIGS and F_ADDFILESIGS.
@ -1891,13 +1900,13 @@ type Fsignatures = struct {
Ffs_fsignatures_size Size_t
Ffs_cdhash [20]int8
Ffs_hash_type int32
} /* fcntl.h:391:9 */
} /* fcntl.h:400:9 */
// detached code signatures data type -
// information passed by user to system used by F_ADDSIGS and F_ADDFILESIGS.
// F_ADDFILESIGS is a shortcut for files that contain their own signature and
// doesn't require mapping of the file in order to load the signature.
type Fsignatures_t = Fsignatures /* fcntl.h:401:3 */
type Fsignatures_t = Fsignatures /* fcntl.h:410:3 */
type Fsupplement = struct {
Ffs_file_start Off_t
@ -1905,9 +1914,9 @@ type Fsupplement = struct {
Ffs_blob_size Size_t
Ffs_orig_fd int32
F__ccgo_pad1 [4]byte
} /* fcntl.h:403:9 */
} /* fcntl.h:412:9 */
type Fsupplement_t = Fsupplement /* fcntl.h:408:3 */
type Fsupplement_t = Fsupplement /* fcntl.h:417:3 */
// DYLD needs to check if the object is allowed to be combined
// into the main binary. This is done between the code signature
@ -1921,7 +1930,7 @@ type Fchecklv = struct {
Flv_file_start Off_t
Flv_error_message_size Size_t
Flv_error_message uintptr
} /* fcntl.h:422:9 */
} /* fcntl.h:431:9 */
// DYLD needs to check if the object is allowed to be combined
// into the main binary. This is done between the code signature
@ -1931,7 +1940,7 @@ type Fchecklv = struct {
// the MAC module doesn't say no when LV isn't enabled and then that
// is cached on the vnode, and the MAC module never gets change once
// a process that library validation enabled.
type Fchecklv_t = Fchecklv /* fcntl.h:426:3 */
type Fchecklv_t = Fchecklv /* fcntl.h:435:3 */
// At this time F_GETSIGSINFO can only indicate platformness.
// As additional requestable information is defined, new keys will be added and the
@ -1942,14 +1951,14 @@ type Fgetsigsinfo = struct {
Ffg_file_start Off_t
Ffg_info_request int32
Ffg_sig_is_platform int32
} /* fcntl.h:436:9 */
} /* fcntl.h:445:9 */
// At this time F_GETSIGSINFO can only indicate platformness.
// As additional requestable information is defined, new keys will be added and the
// fgetsigsinfo_t structure will be lengthened to add space for the additional information
// fgetsigsinfo_t used by F_GETSIGSINFO command
type Fgetsigsinfo_t = Fgetsigsinfo /* fcntl.h:440:3 */
type Fgetsigsinfo_t = Fgetsigsinfo /* fcntl.h:449:3 */
// lock operations for flock(2)
@ -1961,13 +1970,13 @@ type Fstore = struct {
Ffst_offset Off_t
Ffst_length Off_t
Ffst_bytesalloc Off_t
} /* fcntl.h:451:9 */
} /* fcntl.h:460:9 */
// lock operations for flock(2)
// fstore_t type used by F_PREALLOCATE command
type Fstore_t = Fstore /* fcntl.h:457:3 */
type Fstore_t = Fstore /* fcntl.h:466:3 */
// fpunchhole_t used by F_PUNCHHOLE
type Fpunchhole = struct {
@ -1975,19 +1984,19 @@ type Fpunchhole = struct {
Freserved uint32
Ffp_offset Off_t
Ffp_length Off_t
} /* fcntl.h:460:9 */
} /* fcntl.h:469:9 */
// fpunchhole_t used by F_PUNCHHOLE
type Fpunchhole_t = Fpunchhole /* fcntl.h:465:3 */
type Fpunchhole_t = Fpunchhole /* fcntl.h:474:3 */
// factive_file_trim_t used by F_TRIM_ACTIVE_FILE
type Ftrimactivefile = struct {
Ffta_offset Off_t
Ffta_length Off_t
} /* fcntl.h:468:9 */
} /* fcntl.h:477:9 */
// factive_file_trim_t used by F_TRIM_ACTIVE_FILE
type Ftrimactivefile_t = Ftrimactivefile /* fcntl.h:471:3 */
type Ftrimactivefile_t = Ftrimactivefile /* fcntl.h:480:3 */
// fspecread_t used by F_SPECULATIVE_READ
type Fspecread = struct {
@ -1995,10 +2004,10 @@ type Fspecread = struct {
Freserved uint32
Ffsr_offset Off_t
Ffsr_length Off_t
} /* fcntl.h:474:9 */
} /* fcntl.h:483:9 */
// fspecread_t used by F_SPECULATIVE_READ
type Fspecread_t = Fspecread /* fcntl.h:479:3 */
type Fspecread_t = Fspecread /* fcntl.h:488:3 */
// fbootstraptransfer_t used by F_READBOOTSTRAP and F_WRITEBOOTSTRAP commands
@ -2006,11 +2015,11 @@ type Fbootstraptransfer = struct {
Ffbt_offset Off_t
Ffbt_length Size_t
Ffbt_buffer uintptr
} /* fcntl.h:483:9 */
} /* fcntl.h:492:9 */
// fbootstraptransfer_t used by F_READBOOTSTRAP and F_WRITEBOOTSTRAP commands
type Fbootstraptransfer_t = Fbootstraptransfer /* fcntl.h:487:3 */
type Fbootstraptransfer_t = Fbootstraptransfer /* fcntl.h:496:3 */
// For F_LOG2PHYS this information is passed back to user
// Currently only devoffset is returned - that is the VOP_BMAP
@ -2037,10 +2046,10 @@ type Log2phys = struct {
F__ccgo_pad1 [4]byte
Fl2p_contigbytes Off_t
Fl2p_devoffset Off_t
} /* fcntl.h:513:1 */
} /* fcntl.h:522:1 */
type Filesec_t = uintptr /* _filesec_t.h:31:25 */
type Filesec_property_t = uint32 /* fcntl.h:547:3 */
type Filesec_property_t = uint32 /* fcntl.h:556:3 */
var _ int8 /* gen.c:2:13: */

View file

@ -95,6 +95,7 @@ const (
INT_LEAST8_MIN = -128
LITTLE_ENDIAN = 1234
MAC_OS_VERSION_11_0 = 110000
MAC_OS_VERSION_12_0 = 120000
MAC_OS_X_VERSION_10_0 = 1000
MAC_OS_X_VERSION_10_1 = 1010
MAC_OS_X_VERSION_10_10 = 101000
@ -204,6 +205,7 @@ const (
WINT_MAX = 2147483647
WINT_MIN = -2147483648
X_ARM_ARCH_H = 0
X_ARM_MACHTYPES_H_ = 0
X_ARM__ENDIAN_H_ = 0
X_BLKCNT_T = 0
X_BLKSIZE_T = 0
@ -475,6 +477,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -826,17 +834,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -854,33 +862,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Copyright (c) 2000-2018 Apple Inc. All rights reserved.
//
@ -1156,7 +1164,7 @@ type U_int32_t = uint32 /* _u_int32_t.h:30:33 */
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type U_int64_t = uint64 /* _u_int64_t.h:30:33 */
type Register_t = Int64_t /* types.h:63:33 */
type Register_t = Int64_t /* types.h:66:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -1236,19 +1244,20 @@ type Intptr_t = X__darwin_intptr_t /* _intptr_t.h:32:33 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type Uintptr_t = uint64 /* _uintptr_t.h:30:33 */
type Uintptr_t = uint64 /* _uintptr_t.h:34:33 */
// These types are used for reserving the largest possible size.
type User_addr_t = U_int64_t /* types.h:74:33 */
type User_size_t = U_int64_t /* types.h:75:33 */
type User_ssize_t = Int64_t /* types.h:76:33 */
type User_long_t = Int64_t /* types.h:77:33 */
type User_ulong_t = U_int64_t /* types.h:78:33 */
type User_time_t = Int64_t /* types.h:79:33 */
type User_off_t = Int64_t /* types.h:80:33 */
type User_addr_t = U_int64_t /* types.h:77:33 */
type User_size_t = U_int64_t /* types.h:78:33 */
type User_ssize_t = Int64_t /* types.h:79:33 */
type User_long_t = Int64_t /* types.h:80:33 */
type User_ulong_t = U_int64_t /* types.h:81:33 */
type User_time_t = Int64_t /* types.h:82:33 */
type User_off_t = Int64_t /* types.h:83:33 */
// This defines the size of syscall arguments after copying into the kernel:
type Syscall_arg_t = U_int64_t /* types.h:101:33 */
type Syscall_arg_t = U_int64_t /* types.h:104:33 */
// Copyright (c) 2003-2007 Apple Inc. All rights reserved.
//
@ -1889,7 +1898,7 @@ type X__darwin_pthread_t = uintptr /* _pthread_
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdint.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/stdint.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -3730,7 +3739,7 @@ type Errno_t = int32 /* _errno_t.h:30:32 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/AvailabilityInternal.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -4032,7 +4041,7 @@ type Fd_set1 = struct{ Ffds_bits [32]X__int32_t } /* _fd_def.h:50:9 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/AvailabilityInternal.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.

View file

@ -219,6 +219,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -533,17 +539,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -561,33 +567,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system

View file

@ -259,6 +259,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -573,17 +579,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -601,33 +607,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system

44
vendor/modernc.org/libc/libc.go generated vendored
View file

@ -219,6 +219,7 @@ func write(b []byte) (int, error) {
return len(b), nil
}
func X__builtin_bzero(t *TLS, s uintptr, n types.Size_t) { Xbzero(t, s, n) }
func X__builtin_abort(t *TLS) { Xabort(t) }
func X__builtin_abs(t *TLS, j int32) int32 { return Xabs(t, j) }
func X__builtin_clz(t *TLS, n uint32) int32 { return int32(mbits.LeadingZeros32(n)) }
@ -949,7 +950,7 @@ func Xatol(t *TLS, nptr uintptr) long {
}
// time_t mktime(struct tm *tm);
func Xmktime(t *TLS, ptm uintptr) types.Time_t {
func Xmktime(t *TLS, ptm uintptr) time.Time_t {
loc := gotime.Local
if r := getenv(Environ(), "TZ"); r != 0 {
zone, off := parseZone(GoString(r))
@ -967,7 +968,7 @@ func Xmktime(t *TLS, ptm uintptr) types.Time_t {
)
(*time.Tm)(unsafe.Pointer(ptm)).Ftm_wday = int32(tt.Weekday())
(*time.Tm)(unsafe.Pointer(ptm)).Ftm_yday = int32(tt.YearDay() - 1)
return types.Time_t(tt.Unix())
return time.Time_t(tt.Unix())
}
// char *strpbrk(const char *s, const char *accept);
@ -1063,7 +1064,10 @@ func X_IO_putc(t *TLS, c int32, fp uintptr) int32 {
// int atexit(void (*function)(void));
func Xatexit(t *TLS, function uintptr) int32 {
panic(todo(""))
AtExit(func() {
(*struct{ f func(*TLS) })(unsafe.Pointer(&struct{ uintptr }{function})).f(t)
})
return 0
}
// int vasprintf(char **strp, const char *fmt, va_list ap);
@ -1367,3 +1371,37 @@ out:
copy((*RawMem)(unsafe.Pointer(s))[:len(b):len(b)], b)
return s
}
// void bzero(void *s, size_t n);
func Xbzero(t *TLS, s uintptr, n types.Size_t) {
b := (*RawMem)(unsafe.Pointer(s))[:n]
for i := range b {
b[i] = 0
}
}
// char *rindex(const char *s, int c);
func Xrindex(t *TLS, s uintptr, c int32) uintptr {
if s == 0 {
return 0
}
var r uintptr
for {
c2 := int32(*(*byte)(unsafe.Pointer(s)))
if c2 == c {
r = s
}
if c2 == 0 {
return r
}
s++
}
}
// int isascii(int c);
func Xisascii(t *TLS, c int32) int32 {
return Bool32(c >= 0 && c <= 0x7f)
}

4
vendor/modernc.org/libc/libc32.go generated vendored
View file

@ -7,6 +7,10 @@
package libc // import "modernc.org/libc"
const (
heapSize = 1 << 30 // Adjust for your debugging session requirements and system RAM size.
)
type (
// RawMem represents the biggest byte array the runtime can handle
RawMem [1<<31 - 1]byte

4
vendor/modernc.org/libc/libc64.go generated vendored
View file

@ -7,6 +7,10 @@
package libc // import "modernc.org/libc"
const (
heapSize = 2 << 30 // Adjust for your debugging session requirements and system RAM size.
)
type (
// RawMem represents the biggest byte array the runtime can handle
RawMem [1<<50 - 1]byte

View file

@ -5,15 +5,14 @@
package libc // import "modernc.org/libc"
import (
"bufio"
crand "crypto/rand"
"encoding/hex"
"fmt"
"io"
"os"
"os/exec"
gosignal "os/signal"
"path/filepath"
"strconv"
"strings"
"syscall"
gotime "time"
@ -29,7 +28,6 @@ import (
"modernc.org/libc/limits"
"modernc.org/libc/netdb"
"modernc.org/libc/netinet/in"
"modernc.org/libc/pwd"
"modernc.org/libc/signal"
"modernc.org/libc/stdio"
"modernc.org/libc/sys/socket"
@ -59,6 +57,19 @@ var X__stderrp = Xstdout
var X__stdinp = Xstdin
var X__stdoutp = Xstdout
// user@darwin-m1:~/tmp$ cat main.c
// #include <xlocale.h>
// #include <stdio.h>
//
// int main() {
// printf("%i\n", ___mb_cur_max());
// return 0;
// }
// user@darwin-m1:~/tmp$ gcc main.c && ./a.out
// 1
// user@darwin-m1:~/tmp$
var X__mb_cur_max int32 = 1
var startTime = gotime.Now() // For clock(3)
type file uintptr
@ -282,24 +293,23 @@ func Xlocaltime(_ *TLS, timep uintptr) uintptr {
// struct tm *localtime_r(const time_t *timep, struct tm *result);
func Xlocaltime_r(_ *TLS, timep, result uintptr) uintptr {
panic(todo(""))
// loc := gotime.Local
// if r := getenv(Environ(), "TZ"); r != 0 {
// zone, off := parseZone(GoString(r))
// loc = gotime.FixedZone(zone, -off)
// }
// ut := *(*unix.Time_t)(unsafe.Pointer(timep))
// t := gotime.Unix(int64(ut), 0).In(loc)
// (*time.Tm)(unsafe.Pointer(result)).Ftm_sec = int32(t.Second())
// (*time.Tm)(unsafe.Pointer(result)).Ftm_min = int32(t.Minute())
// (*time.Tm)(unsafe.Pointer(result)).Ftm_hour = int32(t.Hour())
// (*time.Tm)(unsafe.Pointer(result)).Ftm_mday = int32(t.Day())
// (*time.Tm)(unsafe.Pointer(result)).Ftm_mon = int32(t.Month() - 1)
// (*time.Tm)(unsafe.Pointer(result)).Ftm_year = int32(t.Year() - 1900)
// (*time.Tm)(unsafe.Pointer(result)).Ftm_wday = int32(t.Weekday())
// (*time.Tm)(unsafe.Pointer(result)).Ftm_yday = int32(t.YearDay())
// (*time.Tm)(unsafe.Pointer(result)).Ftm_isdst = Bool32(isTimeDST(t))
// return result
loc := gotime.Local
if r := getenv(Environ(), "TZ"); r != 0 {
zone, off := parseZone(GoString(r))
loc = gotime.FixedZone(zone, -off)
}
ut := *(*time_t)(unsafe.Pointer(timep))
t := gotime.Unix(int64(ut), 0).In(loc)
(*time.Tm)(unsafe.Pointer(result)).Ftm_sec = int32(t.Second())
(*time.Tm)(unsafe.Pointer(result)).Ftm_min = int32(t.Minute())
(*time.Tm)(unsafe.Pointer(result)).Ftm_hour = int32(t.Hour())
(*time.Tm)(unsafe.Pointer(result)).Ftm_mday = int32(t.Day())
(*time.Tm)(unsafe.Pointer(result)).Ftm_mon = int32(t.Month() - 1)
(*time.Tm)(unsafe.Pointer(result)).Ftm_year = int32(t.Year() - 1900)
(*time.Tm)(unsafe.Pointer(result)).Ftm_wday = int32(t.Weekday())
(*time.Tm)(unsafe.Pointer(result)).Ftm_yday = int32(t.YearDay())
(*time.Tm)(unsafe.Pointer(result)).Ftm_isdst = Bool32(isTimeDST(t))
return result
}
// int open(const char *pathname, int flags, ...);
@ -574,40 +584,37 @@ func Xgettimeofday(t *TLS, tv, tz uintptr) int32 {
// int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen);
func Xgetsockopt(t *TLS, sockfd, level, optname int32, optval, optlen uintptr) int32 {
panic(todo(""))
// if _, _, err := unix.Syscall6(unix.SYS_GETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, optlen, 0); err != 0 {
// t.setErrno(err)
// return -1
// }
if _, _, err := unix.Syscall6(unix.SYS_GETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, optlen, 0); err != 0 {
t.setErrno(err)
return -1
}
// return 0
return 0
}
// int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen);
func Xsetsockopt(t *TLS, sockfd, level, optname int32, optval uintptr, optlen socket.Socklen_t) int32 {
panic(todo(""))
// if _, _, err := unix.Syscall6(unix.SYS_SETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, uintptr(optlen), 0); err != 0 {
// t.setErrno(err)
// return -1
// }
if _, _, err := unix.Syscall6(unix.SYS_SETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, uintptr(optlen), 0); err != 0 {
t.setErrno(err)
return -1
}
// return 0
return 0
}
// int ioctl(int fd, unsigned long request, ...);
func Xioctl(t *TLS, fd int32, request ulong, va uintptr) int32 {
panic(todo(""))
// var argp uintptr
// if va != 0 {
// argp = VaUintptr(&va)
// }
// n, _, err := unix.Syscall(unix.SYS_IOCTL, uintptr(fd), uintptr(request), argp)
// if err != 0 {
// t.setErrno(err)
// return -1
// }
var argp uintptr
if va != 0 {
argp = VaUintptr(&va)
}
n, _, err := unix.Syscall(unix.SYS_IOCTL, uintptr(fd), uintptr(request), argp)
if err != 0 {
t.setErrno(err)
return -1
}
// return int32(n)
return int32(n)
}
// int getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
@ -651,13 +658,12 @@ func Xselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout uintptr)
// int mkfifo(const char *pathname, mode_t mode);
func Xmkfifo(t *TLS, pathname uintptr, mode types.Mode_t) int32 {
panic(todo(""))
// if err := unix.Mkfifo(GoString(pathname), mode); err != nil {
// t.setErrno(err)
// return -1
// }
if err := unix.Mkfifo(GoString(pathname), uint32(mode)); err != nil {
t.setErrno(err)
return -1
}
// return 0
return 0
}
// mode_t umask(mode_t mask);
@ -710,94 +716,86 @@ func Xuname(t *TLS, buf uintptr) int32 {
// ssize_t recv(int sockfd, void *buf, size_t len, int flags);
func Xrecv(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) types.Ssize_t {
panic(todo(""))
// n, _, err := unix.Syscall6(unix.SYS_RECVFROM, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0)
// if err != 0 {
// t.setErrno(err)
// return -1
// }
n, _, err := unix.Syscall6(unix.SYS_RECVFROM, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0)
if err != 0 {
t.setErrno(err)
return -1
}
// return types.Ssize_t(n)
return types.Ssize_t(n)
}
// ssize_t send(int sockfd, const void *buf, size_t len, int flags);
func Xsend(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) types.Ssize_t {
panic(todo(""))
// n, _, err := unix.Syscall6(unix.SYS_SENDTO, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0)
// if err != 0 {
// t.setErrno(err)
// return -1
// }
n, _, err := unix.Syscall6(unix.SYS_SENDTO, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0)
if err != 0 {
t.setErrno(err)
return -1
}
// return types.Ssize_t(n)
return types.Ssize_t(n)
}
// int shutdown(int sockfd, int how);
func Xshutdown(t *TLS, sockfd, how int32) int32 {
panic(todo(""))
// if _, _, err := unix.Syscall(unix.SYS_SHUTDOWN, uintptr(sockfd), uintptr(how), 0); err != 0 {
// t.setErrno(err)
// return -1
// }
if _, _, err := unix.Syscall(unix.SYS_SHUTDOWN, uintptr(sockfd), uintptr(how), 0); err != 0 {
t.setErrno(err)
return -1
}
// return 0
return 0
}
// int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
func Xgetpeername(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 {
panic(todo(""))
// if _, _, err := unix.Syscall(unix.SYS_GETPEERNAME, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 {
// t.setErrno(err)
// return -1
// }
if _, _, err := unix.Syscall(unix.SYS_GETPEERNAME, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 {
t.setErrno(err)
return -1
}
// return 0
return 0
}
// int socket(int domain, int type, int protocol);
func Xsocket(t *TLS, domain, type1, protocol int32) int32 {
panic(todo(""))
// n, _, err := unix.Syscall(unix.SYS_SOCKET, uintptr(domain), uintptr(type1), uintptr(protocol))
// if err != 0 {
// t.setErrno(err)
// return -1
// }
n, _, err := unix.Syscall(unix.SYS_SOCKET, uintptr(domain), uintptr(type1), uintptr(protocol))
if err != 0 {
t.setErrno(err)
return -1
}
// return int32(n)
return int32(n)
}
// int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
func Xbind(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 {
panic(todo(""))
// n, _, err := unix.Syscall(unix.SYS_BIND, uintptr(sockfd), addr, uintptr(addrlen))
// if err != 0 {
// t.setErrno(err)
// return -1
// }
n, _, err := unix.Syscall(unix.SYS_BIND, uintptr(sockfd), addr, uintptr(addrlen))
if err != 0 {
t.setErrno(err)
return -1
}
// return int32(n)
return int32(n)
}
// int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
func Xconnect(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 {
panic(todo(""))
// if _, _, err := unix.Syscall(unix.SYS_CONNECT, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 {
// t.setErrno(err)
// return -1
// }
if _, _, err := unix.Syscall(unix.SYS_CONNECT, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 {
t.setErrno(err)
return -1
}
// return 0
return 0
}
// int listen(int sockfd, int backlog);
func Xlisten(t *TLS, sockfd, backlog int32) int32 {
panic(todo(""))
// if _, _, err := unix.Syscall(unix.SYS_LISTEN, uintptr(sockfd), uintptr(backlog), 0); err != 0 {
// t.setErrno(err)
// return -1
// }
if _, _, err := unix.Syscall(unix.SYS_LISTEN, uintptr(sockfd), uintptr(backlog), 0); err != 0 {
t.setErrno(err)
return -1
}
// return 0
return 0
}
// int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
@ -869,92 +867,6 @@ func Xsystem(t *TLS, command uintptr) int32 {
return 0
}
var staticGetpwuid pwd.Passwd
func init() {
atExit = append(atExit, func() { closePasswd(&staticGetpwuid) })
}
func closePasswd(p *pwd.Passwd) {
Xfree(nil, p.Fpw_name)
Xfree(nil, p.Fpw_passwd)
Xfree(nil, p.Fpw_gecos)
Xfree(nil, p.Fpw_dir)
Xfree(nil, p.Fpw_shell)
*p = pwd.Passwd{}
}
// struct passwd *getpwuid(uid_t uid);
func Xgetpwuid(t *TLS, uid uint32) uintptr {
f, err := os.Open("/etc/passwd")
if err != nil {
if dmesgs {
dmesg("%v: %v", origin(1), err)
}
panic(todo("", err))
}
defer f.Close()
sid := strconv.Itoa(int(uid))
sc := bufio.NewScanner(f)
for sc.Scan() {
s := strings.TrimSpace(sc.Text())
if len(s) == 0 || strings.HasPrefix(s, "#") {
continue
}
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(sc.Text(), ":")
if len(a) < 7 {
panic(todo("%q", sc.Text()))
}
if a[2] == sid {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
closePasswd(&staticGetpwuid)
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
initPasswd(t, &staticGetpwuid, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6])
if dmesgs {
dmesg("%v: ok", origin(1))
}
return uintptr(unsafe.Pointer(&staticGetpwuid))
}
}
if sc.Err() != nil {
panic(todo(""))
}
if dmesgs {
dmesg("%v: 0", origin(1))
}
return 0
}
func initPasswd(t *TLS, p *pwd.Passwd, name, pwd string, uid, gid uint32, gecos, dir, shell string) {
p.Fpw_name = cString(t, name)
p.Fpw_passwd = cString(t, pwd)
p.Fpw_uid = uid
p.Fpw_gid = gid
p.Fpw_gecos = cString(t, gecos)
p.Fpw_dir = cString(t, dir)
p.Fpw_shell = cString(t, shell)
}
// int setvbuf(FILE *stream, char *buf, int mode, size_t size);
func Xsetvbuf(t *TLS, stream, buf uintptr, mode int32, size types.Size_t) int32 {
return 0 //TODO
@ -996,171 +908,6 @@ func Xfileno(t *TLS, stream uintptr) int32 {
return -1
}
// var staticGetpwnam pwd.Passwd
//
// func init() {
// atExit = append(atExit, func() { closePasswd(&staticGetpwnam) })
// }
// struct passwd *getpwnam(const char *name);
func Xgetpwnam(t *TLS, name uintptr) uintptr {
panic(todo(""))
// f, err := os.Open("/etc/passwd")
// if err != nil {
// panic(todo("", err))
// }
// defer f.Close()
// sname := GoString(name)
// sc := bufio.NewScanner(f)
// for sc.Scan() {
// // eg. "root:x:0:0:root:/root:/bin/bash"
// a := strings.Split(sc.Text(), ":")
// if len(a) < 7 {
// panic(todo(""))
// }
// if a[0] == sname {
// uid, err := strconv.Atoi(a[2])
// if err != nil {
// panic(todo(""))
// }
// gid, err := strconv.Atoi(a[3])
// if err != nil {
// panic(todo(""))
// }
// closePasswd(&staticGetpwnam)
// gecos := a[4]
// if strings.Contains(gecos, ",") {
// a := strings.Split(gecos, ",")
// gecos = a[0]
// }
// initPasswd(t, &staticGetpwnam, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6])
// return uintptr(unsafe.Pointer(&staticGetpwnam))
// }
// }
// if sc.Err() != nil {
// panic(todo(""))
// }
// return 0
}
// var staticGetgrnam grp.Group
//
// func init() {
// atExit = append(atExit, func() { closeGroup(&staticGetgrnam) })
// }
// struct group *getgrnam(const char *name);
func Xgetgrnam(t *TLS, name uintptr) uintptr {
panic(todo(""))
// f, err := os.Open("/etc/group")
// if err != nil {
// panic(todo(""))
// }
// defer f.Close()
// sname := GoString(name)
// sc := bufio.NewScanner(f)
// for sc.Scan() {
// // eg. "root:x:0:"
// a := strings.Split(sc.Text(), ":")
// if len(a) < 4 {
// panic(todo(""))
// }
// if a[0] == sname {
// closeGroup(&staticGetgrnam)
// gid, err := strconv.Atoi(a[2])
// if err != nil {
// panic(todo(""))
// }
// var names []string
// if a[3] != "" {
// names = strings.Split(a[3], ",")
// }
// initGroup(t, &staticGetgrnam, a[0], a[1], uint32(gid), names)
// return uintptr(unsafe.Pointer(&staticGetgrnam))
// }
// }
// if sc.Err() != nil {
// panic(todo(""))
// }
// return 0
}
// func closeGroup(p *grp.Group) {
// Xfree(nil, p.Fgr_name)
// Xfree(nil, p.Fgr_passwd)
// if p.Fgr_mem != 0 {
// panic(todo(""))
// }
//
// *p = grp.Group{}
// }
//
// func initGroup(t *TLS, p *grp.Group, name, pwd string, gid uint32, names []string) {
// p.Fgr_name = cString(t, name)
// p.Fgr_passwd = cString(t, pwd)
// p.Fgr_gid = gid
// p.Fgr_mem = 0
// if len(names) != 0 {
// panic(todo("%q %q %v %q %v", name, pwd, gid, names, len(names)))
// }
// }
//
// func init() {
// atExit = append(atExit, func() { closeGroup(&staticGetgrgid) })
// }
//
// var staticGetgrgid grp.Group
// struct group *getgrgid(gid_t gid);
func Xgetgrgid(t *TLS, gid uint32) uintptr {
panic(todo(""))
// f, err := os.Open("/etc/group")
// if err != nil {
// panic(todo(""))
// }
// defer f.Close()
// sid := strconv.Itoa(int(gid))
// sc := bufio.NewScanner(f)
// for sc.Scan() {
// // eg. "root:x:0:"
// a := strings.Split(sc.Text(), ":")
// if len(a) < 4 {
// panic(todo(""))
// }
// if a[2] == sid {
// closeGroup(&staticGetgrgid)
// var names []string
// if a[3] != "" {
// names = strings.Split(a[3], ",")
// }
// initGroup(t, &staticGetgrgid, a[0], a[1], gid, names)
// return uintptr(unsafe.Pointer(&staticGetgrgid))
// }
// }
// if sc.Err() != nil {
// panic(todo(""))
// }
// return 0
}
// int mkstemps(char *template, int suffixlen);
func Xmkstemps(t *TLS, template uintptr, suffixlen int32) int32 {
panic(todo(""))
@ -1905,18 +1652,6 @@ func Xrmdir(t *TLS, pathname uintptr) int32 {
return 0
}
func X__darwin_fd_set(...interface{}) {
panic(todo(""))
}
func X__darwin_fd_clr(...interface{}) {
panic(todo(""))
}
func X__darwin_fd_isset(...interface{}) int32 {
panic(todo(""))
}
// uint64_t mach_absolute_time(void);
func Xmach_absolute_time(t *TLS) uint64 {
return uint64(gotime.Now().UnixNano())
@ -2115,44 +1850,155 @@ func Xarc4random_buf(t *TLS, buf uintptr, buflen size_t) {
}
}
func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */
return (int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr & uint32(3)))
type darwin_mutexattr_t struct {
sig int64
x [8]byte
}
func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */
return (*(*int32)(unsafe.Pointer((m /* &.__u */ /* &.__i */))) & 15)
type darwin_mutex_t struct {
sig int64
x [65]byte
}
func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */
return *(*int32)(unsafe.Pointer((a /* &.__u */ /* &.__i */) + 6*4))
func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 {
return (int32((*darwin_mutexattr_t)(unsafe.Pointer(a)).x[4] >> 2 & 3))
}
func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */
*(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer((a /* &.__u */ /* &.__i */) + 6*4))
func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 {
return (int32((*darwin_mutex_t)(unsafe.Pointer(m)).x[4] >> 2 & 3))
}
func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 {
panic(todo(""))
}
func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 {
panic(todo(""))
}
func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 {
panic(todo(""))
}
func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 {
return 0
}
func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */
if uint32(state) > 1 {
return 22
}
*(*int32)(unsafe.Pointer((a /* &.__u */ /* &.__i */) + 6*4)) = state
func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 {
*(*darwin_mutexattr_t)(unsafe.Pointer(a)) = darwin_mutexattr_t{}
return 0
}
func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */
return 0
}
func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */
*(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{}
return 0
}
func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */
func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 {
if uint32(type1) > uint32(2) {
return 22
return errno.EINVAL
}
(*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr = (((*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr & Uint32FromInt32(CplInt32(3))) | uint32(type1))
(*darwin_mutexattr_t)(unsafe.Pointer(a)).x[4] = byte(type1 << 2)
return 0
}
// ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
func Xwritev(t *TLS, fd int32, iov uintptr, iovcnt int32) types.Ssize_t {
// if dmesgs {
// dmesg("%v: fd %v iov %#x iovcnt %v", origin(1), fd, iov, iovcnt)
// }
r, _, err := unix.Syscall(unix.SYS_WRITEV, uintptr(fd), iov, uintptr(iovcnt))
if err != 0 {
if dmesgs {
dmesg("%v: %v FAIL", origin(1), err)
}
t.setErrno(err)
return -1
}
return types.Ssize_t(r)
}
// int pause(void);
func Xpause(t *TLS) int32 {
c := make(chan os.Signal)
gosignal.Notify(c,
syscall.SIGABRT,
syscall.SIGALRM,
syscall.SIGBUS,
syscall.SIGCHLD,
syscall.SIGCONT,
syscall.SIGFPE,
syscall.SIGHUP,
syscall.SIGILL,
// syscall.SIGINT,
syscall.SIGIO,
syscall.SIGIOT,
syscall.SIGKILL,
syscall.SIGPIPE,
syscall.SIGPROF,
syscall.SIGQUIT,
syscall.SIGSEGV,
syscall.SIGSTOP,
syscall.SIGSYS,
syscall.SIGTERM,
syscall.SIGTRAP,
syscall.SIGTSTP,
syscall.SIGTTIN,
syscall.SIGTTOU,
syscall.SIGURG,
syscall.SIGUSR1,
syscall.SIGUSR2,
syscall.SIGVTALRM,
syscall.SIGWINCH,
syscall.SIGXCPU,
syscall.SIGXFSZ,
)
switch <-c {
case syscall.SIGINT:
panic(todo(""))
default:
t.setErrno(errno.EINTR)
return -1
}
}
// #define __DARWIN_FD_SETSIZE 1024
// #define __DARWIN_NFDBITS (sizeof(__int32_t) * __DARWIN_NBBY) /* bits per mask */
// #define __DARWIN_NBBY 8 /* bits in a byte */
// #define __DARWIN_howmany(x, y) ((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1)) /* # y's == x bits? */
// typedef struct fd_set {
// __int32_t fds_bits[__DARWIN_howmany(__DARWIN_FD_SETSIZE, __DARWIN_NFDBITS)];
// } fd_set;
// __darwin_fd_set(int _fd, struct fd_set *const _p)
// {
// (_p->fds_bits[(unsigned long)_fd / __DARWIN_NFDBITS] |= ((__int32_t)(((unsigned long)1) << ((unsigned long)_fd % __DARWIN_NFDBITS))));
// }
func X__darwin_fd_set(tls *TLS, _fd int32, _p uintptr) int32 { /* main.c:12:1: */
*(*int32)(unsafe.Pointer(_p + uintptr(uint64(_fd)/(uint64(unsafe.Sizeof(int32(0)))*uint64(8)))*4)) |= int32(uint64(uint64(1)) << (uint64(_fd) % (uint64(unsafe.Sizeof(int32(0))) * uint64(8))))
return int32(0)
}
// __darwin_fd_isset(int _fd, const struct fd_set *_p)
// {
// return _p->fds_bits[(unsigned long)_fd / __DARWIN_NFDBITS] & ((__int32_t)(((unsigned long)1) << ((unsigned long)_fd % __DARWIN_NFDBITS)));
// }
func X__darwin_fd_isset(tls *TLS, _fd int32, _p uintptr) int32 { /* main.c:17:1: */
return *(*int32)(unsafe.Pointer(_p + uintptr(uint64(_fd)/(uint64(unsafe.Sizeof(int32(0)))*uint64(8)))*4)) & int32(uint64(uint64(1))<<(uint64(_fd)%(uint64(unsafe.Sizeof(int32(0)))*uint64(8))))
}
// __darwin_fd_clr(int _fd, struct fd_set *const _p)
// {
// (_p->fds_bits[(unsigned long)_fd / __DARWIN_NFDBITS] &= ~((__int32_t)(((unsigned long)1) << ((unsigned long)_fd % __DARWIN_NFDBITS))));
// }
func X__darwin_fd_clr(tls *TLS, _fd int32, _p uintptr) int32 { /* main.c:22:1: */
*(*int32)(unsafe.Pointer(_p + uintptr(uint64(_fd)/(uint64(unsafe.Sizeof(int32(0)))*uint64(8)))*4)) &= ^int32(uint64(uint64(1)) << (uint64(_fd) % (uint64(unsafe.Sizeof(int32(0))) * uint64(8))))
return int32(0)
}
// int ungetc(int c, FILE *stream);
func Xungetc(t *TLS, c int32, stream uintptr) int32 {
panic(todo(""))
}
// int issetugid(void);
func Xissetugid(t *TLS) int32 {
panic(todo(""))
}

View file

@ -377,14 +377,13 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 {
// int dup2(int oldfd, int newfd);
func Xdup2(t *TLS, oldfd, newfd int32) int32 {
panic(todo(""))
// n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
// if err != 0 {
// t.setErrno(err)
// return -1
// }
n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
if err != 0 {
t.setErrno(err)
return -1
}
// return int32(n)
return int32(n)
}
// ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize);

View file

@ -5,14 +5,12 @@
package libc // import "modernc.org/libc"
import (
"bufio"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"runtime/debug"
"strconv"
"strings"
"syscall"
gotime "time"
@ -22,14 +20,12 @@ import (
"modernc.org/libc/errno"
"modernc.org/libc/fcntl"
"modernc.org/libc/fts"
"modernc.org/libc/grp"
gonetdb "modernc.org/libc/honnef.co/go/netdb"
"modernc.org/libc/langinfo"
"modernc.org/libc/limits"
"modernc.org/libc/netdb"
"modernc.org/libc/netinet/in"
"modernc.org/libc/pthread"
"modernc.org/libc/pwd"
"modernc.org/libc/signal"
"modernc.org/libc/stdio"
"modernc.org/libc/sys/socket"
@ -197,7 +193,23 @@ func Xlocaltime(_ *TLS, timep uintptr) uintptr {
// struct tm *localtime_r(const time_t *timep, struct tm *result);
func Xlocaltime_r(_ *TLS, timep, result uintptr) uintptr {
panic(todo(""))
loc := gotime.Local
if r := getenv(Environ(), "TZ"); r != 0 {
zone, off := parseZone(GoString(r))
loc = gotime.FixedZone(zone, -off)
}
ut := *(*unix.Time_t)(unsafe.Pointer(timep))
t := gotime.Unix(int64(ut), 0).In(loc)
(*time.Tm)(unsafe.Pointer(result)).Ftm_sec = int32(t.Second())
(*time.Tm)(unsafe.Pointer(result)).Ftm_min = int32(t.Minute())
(*time.Tm)(unsafe.Pointer(result)).Ftm_hour = int32(t.Hour())
(*time.Tm)(unsafe.Pointer(result)).Ftm_mday = int32(t.Day())
(*time.Tm)(unsafe.Pointer(result)).Ftm_mon = int32(t.Month() - 1)
(*time.Tm)(unsafe.Pointer(result)).Ftm_year = int32(t.Year() - 1900)
(*time.Tm)(unsafe.Pointer(result)).Ftm_wday = int32(t.Weekday())
(*time.Tm)(unsafe.Pointer(result)).Ftm_yday = int32(t.YearDay())
(*time.Tm)(unsafe.Pointer(result)).Ftm_isdst = Bool32(isTimeDST(t))
return result
}
// int open(const char *pathname, int flags, ...);
@ -678,286 +690,6 @@ func Xsystem(t *TLS, command uintptr) int32 {
return 0
}
var staticGetpwuid pwd.Passwd
func init() {
atExit = append(atExit, func() { closePasswd(&staticGetpwuid) })
}
func closePasswd(p *pwd.Passwd) {
Xfree(nil, p.Fpw_name)
Xfree(nil, p.Fpw_passwd)
Xfree(nil, p.Fpw_gecos)
Xfree(nil, p.Fpw_dir)
Xfree(nil, p.Fpw_shell)
*p = pwd.Passwd{}
}
// struct passwd *getpwuid(uid_t uid);
func Xgetpwuid(t *TLS, uid uint32) uintptr {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sid := strconv.Itoa(int(uid))
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:0:root:/root:/bin/bash"
s := sc.Text()
if strings.HasPrefix(s, "#") {
continue
}
a := strings.Split(s, ":")
if len(a) < 7 {
panic(todo("%q", s))
}
if a[2] == sid {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
closePasswd(&staticGetpwuid)
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
initPasswd(t, &staticGetpwuid, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6])
return uintptr(unsafe.Pointer(&staticGetpwuid))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
func initPasswd(t *TLS, p *pwd.Passwd, name, pwd string, uid, gid uint32, gecos, dir, shell string) {
p.Fpw_name = cString(t, name)
p.Fpw_passwd = cString(t, pwd)
p.Fpw_uid = uid
p.Fpw_gid = gid
p.Fpw_gecos = cString(t, gecos)
p.Fpw_dir = cString(t, dir)
p.Fpw_shell = cString(t, shell)
}
func initPasswd2(t *TLS, buf uintptr, buflen types.Size_t, p *pwd.Passwd, name, pwd string, uid, gid uint32, gecos, dir, shell string) bool {
p.Fpw_name, buf, buflen = bufString(buf, buflen, name)
if buf == 0 {
return false
}
p.Fpw_passwd, buf, buflen = bufString(buf, buflen, pwd)
if buf == 0 {
return false
}
p.Fpw_uid = uid
p.Fpw_gid = gid
if buf == 0 {
return false
}
p.Fpw_gecos, buf, buflen = bufString(buf, buflen, gecos)
if buf == 0 {
return false
}
p.Fpw_dir, buf, buflen = bufString(buf, buflen, dir)
if buf == 0 {
return false
}
p.Fpw_shell, buf, buflen = bufString(buf, buflen, shell)
if buf == 0 {
return false
}
return true
}
func bufString(buf uintptr, buflen types.Size_t, s string) (uintptr, uintptr, types.Size_t) {
buf0 := buf
rq := len(s) + 1
if rq > int(buflen) {
return 0, 0, 0
}
copy((*RawMem)(unsafe.Pointer(buf))[:len(s):len(s)], s)
buf += uintptr(len(s))
*(*byte)(unsafe.Pointer(buf)) = 0
return buf0, buf + 1, buflen - types.Size_t(rq)
}
// int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result);
func Xgetpwuid_r(t *TLS, uid types.Uid_t, cpwd, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sid := strconv.Itoa(int(uid))
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(sc.Text(), ":")
if len(a) < 7 {
panic(todo(""))
}
if a[2] == sid {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
var v pwd.Passwd
if initPasswd2(t, buf, buflen, &v, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6]) {
*(*pwd.Passwd)(unsafe.Pointer(cpwd)) = v
*(*uintptr)(unsafe.Pointer(result)) = cpwd
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return errno.ERANGE
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
// struct passwd *getpwnam(const char *name);
func Xgetpwnam(t *TLS, name uintptr) uintptr {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(sc.Text(), ":")
if len(a) < 7 {
panic(todo(""))
}
if a[0] == sname {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
closePasswd(&staticGetpwnam)
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
initPasswd(t, &staticGetpwnam, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6])
return uintptr(unsafe.Pointer(&staticGetpwnam))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
// int getpwnam_r(char *name, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result);
func Xgetpwnam_r(t *TLS, name, cpwd, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(sc.Text(), ":")
if len(a) < 7 {
panic(todo(""))
}
if a[0] == sname {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
var v pwd.Passwd
if initPasswd2(t, buf, buflen, &v, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6]) {
*(*pwd.Passwd)(unsafe.Pointer(cpwd)) = v
*(*uintptr)(unsafe.Pointer(result)) = cpwd
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return errno.ERANGE
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
// int setvbuf(FILE *stream, char *buf, int mode, size_t size);
func Xsetvbuf(t *TLS, stream, buf uintptr, mode int32, size types.Size_t) int32 {
return 0 //TODO
@ -983,257 +715,6 @@ func Xfileno(t *TLS, stream uintptr) int32 {
panic(todo(""))
}
var staticGetpwnam pwd.Passwd
func init() {
atExit = append(atExit, func() { closePasswd(&staticGetpwnam) })
}
var staticGetgrnam grp.Group
func init() {
atExit = append(atExit, func() { closeGroup(&staticGetgrnam) })
}
// struct group *getgrnam(const char *name);
func Xgetgrnam(t *TLS, name uintptr) uintptr {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:"
a := strings.Split(sc.Text(), ":")
if len(a) < 4 {
panic(todo(""))
}
if a[0] == sname {
closeGroup(&staticGetgrnam)
gid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
initGroup(t, &staticGetgrnam, a[0], a[1], uint32(gid), names)
return uintptr(unsafe.Pointer(&staticGetgrnam))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
// int getgrnam_r(const char *name, struct group *grp, char *buf, size_t buflen, struct group **result);
func Xgetgrnam_r(t *TLS, name, pGrp, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:"
a := strings.Split(sc.Text(), ":")
if len(a) < 4 {
panic(todo(""))
}
if a[0] == sname {
gid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
var x grp.Group
if initGroup2(buf, buflen, &x, a[0], a[1], uint32(gid), names) {
*(*grp.Group)(unsafe.Pointer(pGrp)) = x
*(*uintptr)(unsafe.Pointer(result)) = pGrp
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
func closeGroup(p *grp.Group) {
Xfree(nil, p.Fgr_name)
Xfree(nil, p.Fgr_passwd)
if p := p.Fgr_mem; p != 0 {
for {
q := *(*uintptr)(unsafe.Pointer(p))
if q == 0 {
break
}
Xfree(nil, q)
p += unsafe.Sizeof(uintptr(0))
}
}
*p = grp.Group{}
}
func initGroup(t *TLS, p *grp.Group, name, pwd string, gid uint32, names []string) {
p.Fgr_name = cString(t, name)
p.Fgr_passwd = cString(t, pwd)
p.Fgr_gid = gid
a := Xcalloc(t, 1, types.Size_t(unsafe.Sizeof(uintptr(0)))*types.Size_t((len(names)+1)))
if a == 0 {
panic("OOM")
}
for p := a; len(names) != 0; p += unsafe.Sizeof(uintptr(0)) {
*(*uintptr)(unsafe.Pointer(p)) = cString(t, names[0])
names = names[1:]
}
p.Fgr_mem = a
}
func initGroup2(buf uintptr, buflen types.Size_t, p *grp.Group, name, pwd string, gid uint32, names []string) bool {
p.Fgr_name, buf, buflen = bufString(buf, buflen, name)
if buf == 0 {
return false
}
p.Fgr_passwd, buf, buflen = bufString(buf, buflen, pwd)
if buf == 0 {
return false
}
p.Fgr_gid = gid
rq := unsafe.Sizeof(uintptr(0)) * uintptr(len(names)+1)
if rq > uintptr(buflen) {
return false
}
a := buf
buf += rq
for ; len(names) != 0; buf += unsafe.Sizeof(uintptr(0)) {
if len(names[0])+1 > int(buflen) {
return false
}
*(*uintptr)(unsafe.Pointer(buf)), buf, buflen = bufString(buf, buflen, names[0])
names = names[1:]
}
*(*uintptr)(unsafe.Pointer(buf)) = 0
p.Fgr_mem = a
return true
}
func init() {
atExit = append(atExit, func() { closeGroup(&staticGetgrgid) })
}
var staticGetgrgid grp.Group
// struct group *getgrgid(gid_t gid);
func Xgetgrgid(t *TLS, gid uint32) uintptr {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sid := strconv.Itoa(int(gid))
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:"
a := strings.Split(sc.Text(), ":")
if len(a) < 4 {
panic(todo(""))
}
if a[2] == sid {
closeGroup(&staticGetgrgid)
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
initGroup(t, &staticGetgrgid, a[0], a[1], gid, names)
return uintptr(unsafe.Pointer(&staticGetgrgid))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
// int getgrgid_r(gid_t gid, struct group *grp, char *buf, size_t buflen, struct group **result);
func Xgetgrgid_r(t *TLS, gid uint32, pGrp, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sid := strconv.Itoa(int(gid))
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:"
a := strings.Split(sc.Text(), ":")
if len(a) < 4 {
panic(todo(""))
}
if a[2] == sid {
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
var x grp.Group
if initGroup2(buf, buflen, &x, a[0], a[1], gid, names) {
*(*grp.Group)(unsafe.Pointer(pGrp)) = x
*(*uintptr)(unsafe.Pointer(result)) = pGrp
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
// int mkstemps(char *template, int suffixlen);
func Xmkstemps(t *TLS, template uintptr, suffixlen int32) int32 {
return Xmkstemps64(t, template, suffixlen)

View file

@ -336,13 +336,12 @@ func Xutime(t *TLS, filename, times uintptr) int32 {
// int chown(const char *pathname, uid_t owner, gid_t group);
func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 {
panic(todo(""))
// if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 {
// t.setErrno(err)
// return -1
// }
if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 {
t.setErrno(err)
return -1
}
// return 0
return 0
}
// int link(const char *oldpath, const char *newpath);

531
vendor/modernc.org/libc/libc_linux.go generated vendored
View file

@ -5,7 +5,6 @@
package libc // import "modernc.org/libc"
import (
"bufio"
"encoding/hex"
"fmt"
"math"
@ -14,8 +13,6 @@ import (
"os/exec"
"path/filepath"
"runtime/debug"
"strconv"
"strings"
"sync"
"syscall"
"time"
@ -26,13 +23,11 @@ import (
"modernc.org/libc/errno"
"modernc.org/libc/fcntl"
"modernc.org/libc/fts"
"modernc.org/libc/grp"
gonetdb "modernc.org/libc/honnef.co/go/netdb"
"modernc.org/libc/langinfo"
"modernc.org/libc/limits"
"modernc.org/libc/netdb"
"modernc.org/libc/netinet/in"
"modernc.org/libc/pwd"
"modernc.org/libc/signal"
"modernc.org/libc/stdio"
"modernc.org/libc/stdlib"
@ -655,281 +650,6 @@ func Xsystem(t *TLS, command uintptr) int32 {
return 0
}
var staticGetpwuid pwd.Passwd
func init() {
atExit = append(atExit, func() { closePasswd(&staticGetpwuid) })
}
func closePasswd(p *pwd.Passwd) {
Xfree(nil, p.Fpw_name)
Xfree(nil, p.Fpw_passwd)
Xfree(nil, p.Fpw_gecos)
Xfree(nil, p.Fpw_dir)
Xfree(nil, p.Fpw_shell)
*p = pwd.Passwd{}
}
// struct passwd *getpwuid(uid_t uid);
func Xgetpwuid(t *TLS, uid uint32) uintptr {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sid := strconv.Itoa(int(uid))
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(sc.Text(), ":")
if len(a) < 7 {
panic(todo(""))
}
if a[2] == sid {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
closePasswd(&staticGetpwuid)
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
initPasswd(t, &staticGetpwuid, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6])
return uintptr(unsafe.Pointer(&staticGetpwuid))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
func initPasswd(t *TLS, p *pwd.Passwd, name, pwd string, uid, gid uint32, gecos, dir, shell string) {
p.Fpw_name = cString(t, name)
p.Fpw_passwd = cString(t, pwd)
p.Fpw_uid = uid
p.Fpw_gid = gid
p.Fpw_gecos = cString(t, gecos)
p.Fpw_dir = cString(t, dir)
p.Fpw_shell = cString(t, shell)
}
func initPasswd2(t *TLS, buf uintptr, buflen types.Size_t, p *pwd.Passwd, name, pwd string, uid, gid uint32, gecos, dir, shell string) bool {
p.Fpw_name, buf, buflen = bufString(buf, buflen, name)
if buf == 0 {
return false
}
p.Fpw_passwd, buf, buflen = bufString(buf, buflen, pwd)
if buf == 0 {
return false
}
p.Fpw_uid = uid
p.Fpw_gid = gid
if buf == 0 {
return false
}
p.Fpw_gecos, buf, buflen = bufString(buf, buflen, gecos)
if buf == 0 {
return false
}
p.Fpw_dir, buf, buflen = bufString(buf, buflen, dir)
if buf == 0 {
return false
}
p.Fpw_shell, buf, buflen = bufString(buf, buflen, shell)
if buf == 0 {
return false
}
return true
}
func bufString(buf uintptr, buflen types.Size_t, s string) (uintptr, uintptr, types.Size_t) {
buf0 := buf
rq := len(s) + 1
if rq > int(buflen) {
return 0, 0, 0
}
copy((*RawMem)(unsafe.Pointer(buf))[:len(s):len(s)], s)
buf += uintptr(len(s))
*(*byte)(unsafe.Pointer(buf)) = 0
return buf0, buf + 1, buflen - types.Size_t(rq)
}
// int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result);
func Xgetpwuid_r(t *TLS, uid types.Uid_t, cpwd, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sid := strconv.Itoa(int(uid))
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(sc.Text(), ":")
if len(a) < 7 {
panic(todo(""))
}
if a[2] == sid {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
var v pwd.Passwd
if initPasswd2(t, buf, buflen, &v, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6]) {
*(*pwd.Passwd)(unsafe.Pointer(cpwd)) = v
*(*uintptr)(unsafe.Pointer(result)) = cpwd
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return errno.ERANGE
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
// struct passwd *getpwnam(const char *name);
func Xgetpwnam(t *TLS, name uintptr) uintptr {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(sc.Text(), ":")
if len(a) < 7 {
panic(todo(""))
}
if a[0] == sname {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
closePasswd(&staticGetpwnam)
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
initPasswd(t, &staticGetpwnam, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6])
return uintptr(unsafe.Pointer(&staticGetpwnam))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
// int getpwnam_r(char *name, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result);
func Xgetpwnam_r(t *TLS, name, cpwd, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(sc.Text(), ":")
if len(a) < 7 {
panic(todo(""))
}
if a[0] == sname {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
var v pwd.Passwd
if initPasswd2(t, buf, buflen, &v, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6]) {
*(*pwd.Passwd)(unsafe.Pointer(cpwd)) = v
*(*uintptr)(unsafe.Pointer(result)) = cpwd
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return errno.ERANGE
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
// int setvbuf(FILE *stream, char *buf, int mode, size_t size);
func Xsetvbuf(t *TLS, stream, buf uintptr, mode int32, size types.Size_t) int32 {
return 0 //TODO
@ -965,257 +685,6 @@ func Xfileno(t *TLS, stream uintptr) int32 {
return -1
}
var staticGetpwnam pwd.Passwd
func init() {
atExit = append(atExit, func() { closePasswd(&staticGetpwnam) })
}
var staticGetgrnam grp.Group
func init() {
atExit = append(atExit, func() { closeGroup(&staticGetgrnam) })
}
// struct group *getgrnam(const char *name);
func Xgetgrnam(t *TLS, name uintptr) uintptr {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:"
a := strings.Split(sc.Text(), ":")
if len(a) < 4 {
panic(todo(""))
}
if a[0] == sname {
closeGroup(&staticGetgrnam)
gid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
initGroup(t, &staticGetgrnam, a[0], a[1], uint32(gid), names)
return uintptr(unsafe.Pointer(&staticGetgrnam))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
// int getgrnam_r(const char *name, struct group *grp, char *buf, size_t buflen, struct group **result);
func Xgetgrnam_r(t *TLS, name, pGrp, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:"
a := strings.Split(sc.Text(), ":")
if len(a) < 4 {
panic(todo(""))
}
if a[0] == sname {
gid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
var x grp.Group
if initGroup2(buf, buflen, &x, a[0], a[1], uint32(gid), names) {
*(*grp.Group)(unsafe.Pointer(pGrp)) = x
*(*uintptr)(unsafe.Pointer(result)) = pGrp
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
func closeGroup(p *grp.Group) {
Xfree(nil, p.Fgr_name)
Xfree(nil, p.Fgr_passwd)
if p := p.Fgr_mem; p != 0 {
for {
q := *(*uintptr)(unsafe.Pointer(p))
if q == 0 {
break
}
Xfree(nil, q)
p += unsafe.Sizeof(uintptr(0))
}
}
*p = grp.Group{}
}
func initGroup(t *TLS, p *grp.Group, name, pwd string, gid uint32, names []string) {
p.Fgr_name = cString(t, name)
p.Fgr_passwd = cString(t, pwd)
p.Fgr_gid = gid
a := Xcalloc(t, 1, types.Size_t(unsafe.Sizeof(uintptr(0)))*types.Size_t((len(names)+1)))
if a == 0 {
panic("OOM")
}
for p := a; len(names) != 0; p += unsafe.Sizeof(uintptr(0)) {
*(*uintptr)(unsafe.Pointer(p)) = cString(t, names[0])
names = names[1:]
}
p.Fgr_mem = a
}
func initGroup2(buf uintptr, buflen types.Size_t, p *grp.Group, name, pwd string, gid uint32, names []string) bool {
p.Fgr_name, buf, buflen = bufString(buf, buflen, name)
if buf == 0 {
return false
}
p.Fgr_passwd, buf, buflen = bufString(buf, buflen, pwd)
if buf == 0 {
return false
}
p.Fgr_gid = gid
rq := unsafe.Sizeof(uintptr(0)) * uintptr(len(names)+1)
if rq > uintptr(buflen) {
return false
}
a := buf
buf += rq
for ; len(names) != 0; buf += unsafe.Sizeof(uintptr(0)) {
if len(names[0])+1 > int(buflen) {
return false
}
*(*uintptr)(unsafe.Pointer(buf)), buf, buflen = bufString(buf, buflen, names[0])
names = names[1:]
}
*(*uintptr)(unsafe.Pointer(buf)) = 0
p.Fgr_mem = a
return true
}
func init() {
atExit = append(atExit, func() { closeGroup(&staticGetgrgid) })
}
var staticGetgrgid grp.Group
// struct group *getgrgid(gid_t gid);
func Xgetgrgid(t *TLS, gid uint32) uintptr {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sid := strconv.Itoa(int(gid))
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:"
a := strings.Split(sc.Text(), ":")
if len(a) < 4 {
panic(todo(""))
}
if a[2] == sid {
closeGroup(&staticGetgrgid)
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
initGroup(t, &staticGetgrgid, a[0], a[1], gid, names)
return uintptr(unsafe.Pointer(&staticGetgrgid))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
// int getgrgid_r(gid_t gid, struct group *grp, char *buf, size_t buflen, struct group **result);
func Xgetgrgid_r(t *TLS, gid uint32, pGrp, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sid := strconv.Itoa(int(gid))
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:"
a := strings.Split(sc.Text(), ":")
if len(a) < 4 {
panic(todo(""))
}
if a[2] == sid {
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
var x grp.Group
if initGroup2(buf, buflen, &x, a[0], a[1], gid, names) {
*(*grp.Group)(unsafe.Pointer(pGrp)) = x
*(*uintptr)(unsafe.Pointer(result)) = pGrp
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
// int mkstemps(char *template, int suffixlen);
func Xmkstemps(t *TLS, template uintptr, suffixlen int32) int32 {
return Xmkstemps64(t, template, suffixlen)

View file

@ -5,14 +5,12 @@
package libc // import "modernc.org/libc"
import (
"bufio"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"runtime/debug"
"strconv"
"strings"
"syscall"
gotime "time"
@ -22,13 +20,11 @@ import (
"modernc.org/libc/errno"
"modernc.org/libc/fcntl"
"modernc.org/libc/fts"
"modernc.org/libc/grp"
gonetdb "modernc.org/libc/honnef.co/go/netdb"
"modernc.org/libc/langinfo"
"modernc.org/libc/limits"
"modernc.org/libc/netdb"
"modernc.org/libc/netinet/in"
"modernc.org/libc/pwd"
"modernc.org/libc/stdio"
"modernc.org/libc/sys/socket"
"modernc.org/libc/sys/stat"
@ -232,7 +228,23 @@ func Xlocaltime(_ *TLS, timep uintptr) uintptr {
// struct tm *localtime_r(const time_t *timep, struct tm *result);
func Xlocaltime_r(_ *TLS, timep, result uintptr) uintptr {
panic(todo(""))
loc := gotime.Local
if r := getenv(Environ(), "TZ"); r != 0 {
zone, off := parseZone(GoString(r))
loc = gotime.FixedZone(zone, -off)
}
ut := *(*time.Time_t)(unsafe.Pointer(timep))
t := gotime.Unix(int64(ut), 0).In(loc)
(*time.Tm)(unsafe.Pointer(result)).Ftm_sec = int32(t.Second())
(*time.Tm)(unsafe.Pointer(result)).Ftm_min = int32(t.Minute())
(*time.Tm)(unsafe.Pointer(result)).Ftm_hour = int32(t.Hour())
(*time.Tm)(unsafe.Pointer(result)).Ftm_mday = int32(t.Day())
(*time.Tm)(unsafe.Pointer(result)).Ftm_mon = int32(t.Month() - 1)
(*time.Tm)(unsafe.Pointer(result)).Ftm_year = int32(t.Year() - 1900)
(*time.Tm)(unsafe.Pointer(result)).Ftm_wday = int32(t.Weekday())
(*time.Tm)(unsafe.Pointer(result)).Ftm_yday = int32(t.YearDay())
(*time.Tm)(unsafe.Pointer(result)).Ftm_isdst = Bool32(isTimeDST(t))
return result
}
// int open(const char *pathname, int flags, ...);
@ -714,286 +726,6 @@ func Xsystem(t *TLS, command uintptr) int32 {
return 0
}
var staticGetpwuid pwd.Passwd
func init() {
atExit = append(atExit, func() { closePasswd(&staticGetpwuid) })
}
func closePasswd(p *pwd.Passwd) {
Xfree(nil, p.Fpw_name)
Xfree(nil, p.Fpw_passwd)
Xfree(nil, p.Fpw_gecos)
Xfree(nil, p.Fpw_dir)
Xfree(nil, p.Fpw_shell)
*p = pwd.Passwd{}
}
// struct passwd *getpwuid(uid_t uid);
func Xgetpwuid(t *TLS, uid uint32) uintptr {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sid := strconv.Itoa(int(uid))
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:0:root:/root:/bin/bash"
s := sc.Text()
if strings.HasPrefix(s, "#") {
continue
}
a := strings.Split(s, ":")
if len(a) < 7 {
panic(todo("%q", s))
}
if a[2] == sid {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
closePasswd(&staticGetpwuid)
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
initPasswd(t, &staticGetpwuid, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6])
return uintptr(unsafe.Pointer(&staticGetpwuid))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
func initPasswd(t *TLS, p *pwd.Passwd, name, pwd string, uid, gid uint32, gecos, dir, shell string) {
p.Fpw_name = cString(t, name)
p.Fpw_passwd = cString(t, pwd)
p.Fpw_uid = uid
p.Fpw_gid = gid
p.Fpw_gecos = cString(t, gecos)
p.Fpw_dir = cString(t, dir)
p.Fpw_shell = cString(t, shell)
}
func initPasswd2(t *TLS, buf uintptr, buflen types.Size_t, p *pwd.Passwd, name, pwd string, uid, gid uint32, gecos, dir, shell string) bool {
p.Fpw_name, buf, buflen = bufString(buf, buflen, name)
if buf == 0 {
return false
}
p.Fpw_passwd, buf, buflen = bufString(buf, buflen, pwd)
if buf == 0 {
return false
}
p.Fpw_uid = uid
p.Fpw_gid = gid
if buf == 0 {
return false
}
p.Fpw_gecos, buf, buflen = bufString(buf, buflen, gecos)
if buf == 0 {
return false
}
p.Fpw_dir, buf, buflen = bufString(buf, buflen, dir)
if buf == 0 {
return false
}
p.Fpw_shell, buf, buflen = bufString(buf, buflen, shell)
if buf == 0 {
return false
}
return true
}
func bufString(buf uintptr, buflen types.Size_t, s string) (uintptr, uintptr, types.Size_t) {
buf0 := buf
rq := len(s) + 1
if rq > int(buflen) {
return 0, 0, 0
}
copy((*RawMem)(unsafe.Pointer(buf))[:len(s):len(s)], s)
buf += uintptr(len(s))
*(*byte)(unsafe.Pointer(buf)) = 0
return buf0, buf + 1, buflen - types.Size_t(rq)
}
// int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result);
func Xgetpwuid_r(t *TLS, uid types.Uid_t, cpwd, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sid := strconv.Itoa(int(uid))
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(sc.Text(), ":")
if len(a) < 7 {
panic(todo(""))
}
if a[2] == sid {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
var v pwd.Passwd
if initPasswd2(t, buf, buflen, &v, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6]) {
*(*pwd.Passwd)(unsafe.Pointer(cpwd)) = v
*(*uintptr)(unsafe.Pointer(result)) = cpwd
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return errno.ERANGE
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
// struct passwd *getpwnam(const char *name);
func Xgetpwnam(t *TLS, name uintptr) uintptr {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(sc.Text(), ":")
if len(a) < 7 {
panic(todo(""))
}
if a[0] == sname {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
closePasswd(&staticGetpwnam)
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
initPasswd(t, &staticGetpwnam, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6])
return uintptr(unsafe.Pointer(&staticGetpwnam))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
// int getpwnam_r(char *name, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result);
func Xgetpwnam_r(t *TLS, name, cpwd, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(sc.Text(), ":")
if len(a) < 7 {
panic(todo(""))
}
if a[0] == sname {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
var v pwd.Passwd
if initPasswd2(t, buf, buflen, &v, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6]) {
*(*pwd.Passwd)(unsafe.Pointer(cpwd)) = v
*(*uintptr)(unsafe.Pointer(result)) = cpwd
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return errno.ERANGE
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
// int setvbuf(FILE *stream, char *buf, int mode, size_t size);
func Xsetvbuf(t *TLS, stream, buf uintptr, mode int32, size types.Size_t) int32 {
return 0 //TODO
@ -1019,257 +751,6 @@ func Xfileno(t *TLS, stream uintptr) int32 {
panic(todo(""))
}
var staticGetpwnam pwd.Passwd
func init() {
atExit = append(atExit, func() { closePasswd(&staticGetpwnam) })
}
var staticGetgrnam grp.Group
func init() {
atExit = append(atExit, func() { closeGroup(&staticGetgrnam) })
}
// struct group *getgrnam(const char *name);
func Xgetgrnam(t *TLS, name uintptr) uintptr {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:"
a := strings.Split(sc.Text(), ":")
if len(a) < 4 {
panic(todo(""))
}
if a[0] == sname {
closeGroup(&staticGetgrnam)
gid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
initGroup(t, &staticGetgrnam, a[0], a[1], uint32(gid), names)
return uintptr(unsafe.Pointer(&staticGetgrnam))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
// int getgrnam_r(const char *name, struct group *grp, char *buf, size_t buflen, struct group **result);
func Xgetgrnam_r(t *TLS, name, pGrp, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:"
a := strings.Split(sc.Text(), ":")
if len(a) < 4 {
panic(todo(""))
}
if a[0] == sname {
gid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
var x grp.Group
if initGroup2(buf, buflen, &x, a[0], a[1], uint32(gid), names) {
*(*grp.Group)(unsafe.Pointer(pGrp)) = x
*(*uintptr)(unsafe.Pointer(result)) = pGrp
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
func closeGroup(p *grp.Group) {
Xfree(nil, p.Fgr_name)
Xfree(nil, p.Fgr_passwd)
if p := p.Fgr_mem; p != 0 {
for {
q := *(*uintptr)(unsafe.Pointer(p))
if q == 0 {
break
}
Xfree(nil, q)
p += unsafe.Sizeof(uintptr(0))
}
}
*p = grp.Group{}
}
func initGroup(t *TLS, p *grp.Group, name, pwd string, gid uint32, names []string) {
p.Fgr_name = cString(t, name)
p.Fgr_passwd = cString(t, pwd)
p.Fgr_gid = gid
a := Xcalloc(t, 1, types.Size_t(unsafe.Sizeof(uintptr(0)))*types.Size_t((len(names)+1)))
if a == 0 {
panic("OOM")
}
for p := a; len(names) != 0; p += unsafe.Sizeof(uintptr(0)) {
*(*uintptr)(unsafe.Pointer(p)) = cString(t, names[0])
names = names[1:]
}
p.Fgr_mem = a
}
func initGroup2(buf uintptr, buflen types.Size_t, p *grp.Group, name, pwd string, gid uint32, names []string) bool {
p.Fgr_name, buf, buflen = bufString(buf, buflen, name)
if buf == 0 {
return false
}
p.Fgr_passwd, buf, buflen = bufString(buf, buflen, pwd)
if buf == 0 {
return false
}
p.Fgr_gid = gid
rq := unsafe.Sizeof(uintptr(0)) * uintptr(len(names)+1)
if rq > uintptr(buflen) {
return false
}
a := buf
buf += rq
for ; len(names) != 0; buf += unsafe.Sizeof(uintptr(0)) {
if len(names[0])+1 > int(buflen) {
return false
}
*(*uintptr)(unsafe.Pointer(buf)), buf, buflen = bufString(buf, buflen, names[0])
names = names[1:]
}
*(*uintptr)(unsafe.Pointer(buf)) = 0
p.Fgr_mem = a
return true
}
func init() {
atExit = append(atExit, func() { closeGroup(&staticGetgrgid) })
}
var staticGetgrgid grp.Group
// struct group *getgrgid(gid_t gid);
func Xgetgrgid(t *TLS, gid uint32) uintptr {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sid := strconv.Itoa(int(gid))
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:"
a := strings.Split(sc.Text(), ":")
if len(a) < 4 {
panic(todo(""))
}
if a[2] == sid {
closeGroup(&staticGetgrgid)
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
initGroup(t, &staticGetgrgid, a[0], a[1], gid, names)
return uintptr(unsafe.Pointer(&staticGetgrgid))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
// int getgrgid_r(gid_t gid, struct group *grp, char *buf, size_t buflen, struct group **result);
func Xgetgrgid_r(t *TLS, gid uint32, pGrp, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sid := strconv.Itoa(int(gid))
sc := bufio.NewScanner(f)
for sc.Scan() {
// eg. "root:x:0:"
a := strings.Split(sc.Text(), ":")
if len(a) < 4 {
panic(todo(""))
}
if a[2] == sid {
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
var x grp.Group
if initGroup2(buf, buflen, &x, a[0], a[1], gid, names) {
*(*grp.Group)(unsafe.Pointer(pGrp)) = x
*(*uintptr)(unsafe.Pointer(result)) = pGrp
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
// int mkstemps(char *template, int suffixlen);
func Xmkstemps(t *TLS, template uintptr, suffixlen int32) int32 {
return Xmkstemps64(t, template, suffixlen)

View file

@ -337,13 +337,12 @@ func Xutime(t *TLS, filename, times uintptr) int32 {
// int chown(const char *pathname, uid_t owner, gid_t group);
func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 {
panic(todo(""))
// if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 {
// t.setErrno(err)
// return -1
// }
if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 {
t.setErrno(err)
return -1
}
// return 0
return 0
}
// int link(const char *oldpath, const char *newpath);

574
vendor/modernc.org/libc/libc_unix.go generated vendored
View file

@ -8,22 +8,32 @@
package libc // import "modernc.org/libc"
import (
"bufio"
"io/ioutil"
"os"
gosignal "os/signal"
"reflect"
"strconv"
"strings"
"syscall"
"unsafe"
"golang.org/x/sys/unix"
"modernc.org/libc/errno"
"modernc.org/libc/grp"
"modernc.org/libc/poll"
"modernc.org/libc/pwd"
"modernc.org/libc/signal"
"modernc.org/libc/stdio"
"modernc.org/libc/sys/types"
)
var staticGetpwnam pwd.Passwd
func init() {
atExit = append(atExit, func() { closePasswd(&staticGetpwnam) })
}
// sighandler_t signal(int signum, sighandler_t handler);
func Xsignal(t *TLS, signum int32, handler uintptr) uintptr { //TODO use sigaction?
signalsMu.Lock()
@ -261,3 +271,567 @@ func Xfdopen(t *TLS, fd int32, mode uintptr) uintptr {
t.setErrno(errno.EINVAL)
return 0
}
// struct passwd *getpwnam(const char *name);
func Xgetpwnam(t *TLS, name uintptr) uintptr {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
s := strings.TrimSpace(sc.Text())
if s == "" || strings.HasPrefix(s, "#") {
continue
}
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(s, ":")
if len(a) < 7 {
panic(todo(""))
}
if a[0] == sname {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
closePasswd(&staticGetpwnam)
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
initPasswd(t, &staticGetpwnam, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6])
return uintptr(unsafe.Pointer(&staticGetpwnam))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
// int getpwnam_r(char *name, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result);
func Xgetpwnam_r(t *TLS, name, cpwd, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
s := strings.TrimSpace(sc.Text())
if s == "" || strings.HasPrefix(s, "#") {
continue
}
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(s, ":")
if len(a) < 7 {
panic(todo("%q", s))
}
if a[0] == sname {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
var v pwd.Passwd
if initPasswd2(t, buf, buflen, &v, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6]) {
*(*pwd.Passwd)(unsafe.Pointer(cpwd)) = v
*(*uintptr)(unsafe.Pointer(result)) = cpwd
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return errno.ERANGE
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
func init() {
atExit = append(atExit, func() { closeGroup(&staticGetgrgid) })
}
var staticGetgrgid grp.Group
// struct group *getgrgid(gid_t gid);
func Xgetgrgid(t *TLS, gid uint32) uintptr {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sid := strconv.Itoa(int(gid))
sc := bufio.NewScanner(f)
for sc.Scan() {
s := strings.TrimSpace(sc.Text())
if s == "" || strings.HasPrefix(s, "#") {
continue
}
// eg. "root:x:0:"
a := strings.Split(s, ":")
if len(a) < 4 {
panic(todo("%q", s))
}
if a[2] == sid {
closeGroup(&staticGetgrgid)
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
initGroup(t, &staticGetgrgid, a[0], a[1], gid, names)
return uintptr(unsafe.Pointer(&staticGetgrgid))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
// int getgrgid_r(gid_t gid, struct group *grp, char *buf, size_t buflen, struct group **result);
func Xgetgrgid_r(t *TLS, gid uint32, pGrp, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sid := strconv.Itoa(int(gid))
sc := bufio.NewScanner(f)
for sc.Scan() {
s := strings.TrimSpace(sc.Text())
if s == "" || strings.HasPrefix(s, "#") {
continue
}
// eg. "root:x:0:"
a := strings.Split(s, ":")
if len(a) < 4 {
panic(todo("%q", s))
}
if a[2] == sid {
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
var x grp.Group
if initGroup2(buf, buflen, &x, a[0], a[1], gid, names) {
*(*grp.Group)(unsafe.Pointer(pGrp)) = x
*(*uintptr)(unsafe.Pointer(result)) = pGrp
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
func initPasswd2(t *TLS, buf uintptr, buflen types.Size_t, p *pwd.Passwd, name, pwd string, uid, gid uint32, gecos, dir, shell string) bool {
p.Fpw_name, buf, buflen = bufString(buf, buflen, name)
if buf == 0 {
return false
}
p.Fpw_passwd, buf, buflen = bufString(buf, buflen, pwd)
if buf == 0 {
return false
}
p.Fpw_uid = uid
p.Fpw_gid = gid
if buf == 0 {
return false
}
p.Fpw_gecos, buf, buflen = bufString(buf, buflen, gecos)
if buf == 0 {
return false
}
p.Fpw_dir, buf, buflen = bufString(buf, buflen, dir)
if buf == 0 {
return false
}
p.Fpw_shell, buf, buflen = bufString(buf, buflen, shell)
if buf == 0 {
return false
}
return true
}
func bufString(buf uintptr, buflen types.Size_t, s string) (uintptr, uintptr, types.Size_t) {
buf0 := buf
rq := len(s) + 1
if rq > int(buflen) {
return 0, 0, 0
}
copy((*RawMem)(unsafe.Pointer(buf))[:len(s):len(s)], s)
buf += uintptr(len(s))
*(*byte)(unsafe.Pointer(buf)) = 0
return buf0, buf + 1, buflen - types.Size_t(rq)
}
func closeGroup(p *grp.Group) {
Xfree(nil, p.Fgr_name)
Xfree(nil, p.Fgr_passwd)
if p := p.Fgr_mem; p != 0 {
for {
q := *(*uintptr)(unsafe.Pointer(p))
if q == 0 {
break
}
Xfree(nil, q)
p += unsafe.Sizeof(uintptr(0))
}
}
*p = grp.Group{}
}
func initGroup(t *TLS, p *grp.Group, name, pwd string, gid uint32, names []string) {
p.Fgr_name = cString(t, name)
p.Fgr_passwd = cString(t, pwd)
p.Fgr_gid = gid
a := Xcalloc(t, 1, types.Size_t(unsafe.Sizeof(uintptr(0)))*types.Size_t((len(names)+1)))
if a == 0 {
panic("OOM")
}
for p := a; len(names) != 0; p += unsafe.Sizeof(uintptr(0)) {
*(*uintptr)(unsafe.Pointer(p)) = cString(t, names[0])
names = names[1:]
}
p.Fgr_mem = a
}
func initGroup2(buf uintptr, buflen types.Size_t, p *grp.Group, name, pwd string, gid uint32, names []string) bool {
p.Fgr_name, buf, buflen = bufString(buf, buflen, name)
if buf == 0 {
return false
}
p.Fgr_passwd, buf, buflen = bufString(buf, buflen, pwd)
if buf == 0 {
return false
}
p.Fgr_gid = gid
rq := unsafe.Sizeof(uintptr(0)) * uintptr(len(names)+1)
if rq > uintptr(buflen) {
return false
}
a := buf
buf += rq
for ; len(names) != 0; buf += unsafe.Sizeof(uintptr(0)) {
if len(names[0])+1 > int(buflen) {
return false
}
*(*uintptr)(unsafe.Pointer(buf)), buf, buflen = bufString(buf, buflen, names[0])
names = names[1:]
}
*(*uintptr)(unsafe.Pointer(buf)) = 0
p.Fgr_mem = a
return true
}
func init() {
atExit = append(atExit, func() { closeGroup(&staticGetgrgid) })
}
var staticGetpwuid pwd.Passwd
func init() {
atExit = append(atExit, func() { closePasswd(&staticGetpwuid) })
}
func closePasswd(p *pwd.Passwd) {
Xfree(nil, p.Fpw_name)
Xfree(nil, p.Fpw_passwd)
Xfree(nil, p.Fpw_gecos)
Xfree(nil, p.Fpw_dir)
Xfree(nil, p.Fpw_shell)
*p = pwd.Passwd{}
}
var staticGetgrnam grp.Group
func init() {
atExit = append(atExit, func() { closeGroup(&staticGetgrnam) })
}
// struct passwd *getpwuid(uid_t uid);
func Xgetpwuid(t *TLS, uid uint32) uintptr {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sid := strconv.Itoa(int(uid))
sc := bufio.NewScanner(f)
for sc.Scan() {
s := strings.TrimSpace(sc.Text())
if len(s) == 0 || strings.HasPrefix(s, "#") {
continue
}
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(s, ":")
if len(a) < 7 {
panic(todo("%q", s))
}
if a[2] == sid {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
closePasswd(&staticGetpwuid)
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
initPasswd(t, &staticGetpwuid, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6])
return uintptr(unsafe.Pointer(&staticGetpwuid))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
func initPasswd(t *TLS, p *pwd.Passwd, name, pwd string, uid, gid uint32, gecos, dir, shell string) {
p.Fpw_name = cString(t, name)
p.Fpw_passwd = cString(t, pwd)
p.Fpw_uid = uid
p.Fpw_gid = gid
p.Fpw_gecos = cString(t, gecos)
p.Fpw_dir = cString(t, dir)
p.Fpw_shell = cString(t, shell)
}
// struct group *getgrnam(const char *name);
func Xgetgrnam(t *TLS, name uintptr) uintptr {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
s := strings.TrimSpace(sc.Text())
if len(s) == 0 || strings.HasPrefix(s, "#") {
continue
}
// eg. "root:x:0:"
a := strings.Split(s, ":")
if len(a) < 4 {
panic(todo("%q", s))
}
if a[0] == sname {
closeGroup(&staticGetgrnam)
gid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
initGroup(t, &staticGetgrnam, a[0], a[1], uint32(gid), names)
return uintptr(unsafe.Pointer(&staticGetgrnam))
}
}
if sc.Err() != nil {
panic(todo(""))
}
return 0
}
// int getgrnam_r(const char *name, struct group *grp, char *buf, size_t buflen, struct group **result);
func Xgetgrnam_r(t *TLS, name, pGrp, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/group")
if err != nil {
panic(todo(""))
}
defer f.Close()
sname := GoString(name)
sc := bufio.NewScanner(f)
for sc.Scan() {
s := strings.TrimSpace(sc.Text())
if len(s) == 0 || strings.HasPrefix(s, "#") {
continue
}
// eg. "root:x:0:"
a := strings.Split(s, ":")
if len(a) < 4 {
panic(todo("%q", s))
}
if a[0] == sname {
gid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
var names []string
if a[3] != "" {
names = strings.Split(a[3], ",")
}
var x grp.Group
if initGroup2(buf, buflen, &x, a[0], a[1], uint32(gid), names) {
*(*grp.Group)(unsafe.Pointer(pGrp)) = x
*(*uintptr)(unsafe.Pointer(result)) = pGrp
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}
// int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result);
func Xgetpwuid_r(t *TLS, uid types.Uid_t, cpwd, buf uintptr, buflen types.Size_t, result uintptr) int32 {
f, err := os.Open("/etc/passwd")
if err != nil {
panic(todo("", err))
}
defer f.Close()
sid := strconv.Itoa(int(uid))
sc := bufio.NewScanner(f)
for sc.Scan() {
s := strings.TrimSpace(sc.Text())
if len(s) == 0 || strings.HasPrefix(s, "#") {
continue
}
// eg. "root:x:0:0:root:/root:/bin/bash"
a := strings.Split(s, ":")
if len(a) < 7 {
panic(todo("%q", s))
}
if a[2] == sid {
uid, err := strconv.Atoi(a[2])
if err != nil {
panic(todo(""))
}
gid, err := strconv.Atoi(a[3])
if err != nil {
panic(todo(""))
}
gecos := a[4]
if strings.Contains(gecos, ",") {
a := strings.Split(gecos, ",")
gecos = a[0]
}
var v pwd.Passwd
if initPasswd2(t, buf, buflen, &v, a[0], a[1], uint32(uid), uint32(gid), gecos, a[5], a[6]) {
*(*pwd.Passwd)(unsafe.Pointer(cpwd)) = v
*(*uintptr)(unsafe.Pointer(result)) = cpwd
return 0
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return errno.ERANGE
}
}
if sc.Err() != nil {
panic(todo(""))
}
*(*uintptr)(unsafe.Pointer(result)) = 0
return 0
}

View file

@ -10,6 +10,7 @@ import (
"math"
"os"
"os/exec"
"os/user"
"path/filepath"
"strings"
"sync"
@ -31,14 +32,19 @@ import (
)
// Keep these outside of the var block otherwise go generate will miss them.
var X__imp__environ = EnvironP()
var X__imp__wenviron = uintptr(unsafe.Pointer(&wenviron))
var X_imp___environ = EnvironP()
var X_iob [stdio.X_IOB_ENTRIES]stdio.FILE
var Xtimezone long // extern long timezone;
var iobMap = map[uintptr]int32{} // &_iob[fd] -> fd
var (
iobMap = map[uintptr]int32{} // &_iob[fd] -> fd
wenvValid bool
wenviron uintptr // &winEnviron[0]
winEnviron = []uintptr{0}
)
func init() {
for i := range X_iob {
@ -70,6 +76,7 @@ var (
procCreateFileA = modkernel32.NewProc("CreateFileA")
procCreateFileMappingW = modkernel32.NewProc("CreateFileMappingW")
procCreateFileW = modkernel32.NewProc("CreateFileW")
procCreateHardLinkW = modkernel32.NewProc("CreateHardLinkW")
procCreatePipe = modkernel32.NewProc("CreatePipe")
procCreateProcessA = modkernel32.NewProc("CreateProcessA")
procCreateProcessW = modkernel32.NewProc("CreateProcessW")
@ -85,24 +92,29 @@ var (
procFormatMessageW = modkernel32.NewProc("FormatMessageW")
procGetACP = modkernel32.NewProc("GetACP")
procGetCommState = modkernel32.NewProc("GetCommState")
procGetComputerNameExW = modkernel32.NewProc("GetComputerNameExW")
procGetConsoleCP = modkernel32.NewProc("GetConsoleCP")
procGetConsoleScreenBufferInfo = modkernel32.NewProc("GetConsoleScreenBufferInfo")
procGetCurrentProcess = modkernel32.NewProc("GetCurrentProcess")
procGetCurrentProcessId = modkernel32.NewProc("GetCurrentProcessId")
procGetCurrentThread = modkernel32.NewProc("GetCurrentThread")
procGetCurrentThreadId = modkernel32.NewProc("GetCurrentThreadId")
procGetEnvironmentVariableA = modkernel32.NewProc("GetEnvironmentVariableA")
procGetEnvironmentVariableW = modkernel32.NewProc("GetEnvironmentVariableW")
procGetExitCodeProcess = modkernel32.NewProc("GetExitCodeProcess")
procGetExitCodeThread = modkernel32.NewProc("GetExitCodeThread")
procGetFileAttributesA = modkernel32.NewProc("GetFileAttributesA")
procGetFileAttributesExA = modkernel32.NewProc("GetFileAttributesExA")
procGetFileAttributesExW = modkernel32.NewProc("GetFileAttributesExW")
procGetFileInformationByHandle = modkernel32.NewProc("GetFileInformationByHandle")
procGetFileSize = modkernel32.NewProc("GetFileSize")
procGetFullPathNameW = modkernel32.NewProc("GetFullPathNameW")
procGetLastError = modkernel32.NewProc("GetLastError")
procGetLogicalDriveStringsA = modkernel32.NewProc("GetLogicalDriveStringsA")
procGetModuleFileNameW = modkernel32.NewProc("GetModuleFileNameW")
procGetModuleHandleA = modkernel32.NewProc("GetModuleHandleA")
procGetModuleHandleW = modkernel32.NewProc("GetModuleHandleW")
procGetPrivateProfileStringA = modkernel32.NewProc("GetPrivateProfileStringA")
procGetProcAddress = modkernel32.NewProc("GetProcAddress")
procGetProcessHeap = modkernel32.NewProc("GetProcessHeap")
procGetSystemInfo = modkernel32.NewProc("GetSystemInfo")
@ -112,13 +124,17 @@ var (
procGetTickCount = modkernel32.NewProc("GetTickCount")
procGetVersionExA = modkernel32.NewProc("GetVersionExA")
procGetVersionExW = modkernel32.NewProc("GetVersionExW")
procGetVolumeInformationA = modkernel32.NewProc("GetVolumeInformationA")
procGetVolumeInformationW = modkernel32.NewProc("GetVolumeInformationW")
procHeapAlloc = modkernel32.NewProc("HeapAlloc")
procHeapFree = modkernel32.NewProc("HeapFree")
procInitializeCriticalSection = modkernel32.NewProc("InitializeCriticalSection")
procLeaveCriticalSection = modkernel32.NewProc("LeaveCriticalSection")
procLockFile = modkernel32.NewProc("LockFile")
procLockFileEx = modkernel32.NewProc("LockFileEx")
procLstrlenW = modkernel32.NewProc("lstrlenW")
procMapViewOfFile = modkernel32.NewProc("MapViewOfFile")
procMoveFileW = modkernel32.NewProc("MoveFileW")
procMultiByteToWideChar = modkernel32.NewProc("MultiByteToWideChar")
procOpenEventA = modkernel32.NewProc("OpenEventA")
procPeekConsoleInputW = modkernel32.NewProc("PeekConsoleInputW")
@ -136,6 +152,7 @@ var (
procSetFilePointer = modkernel32.NewProc("SetFilePointer")
procSleepEx = modkernel32.NewProc("SleepEx")
procSystemTimeToFileTime = modkernel32.NewProc("SystemTimeToFileTime")
procTerminateThread = modkernel32.NewProc("TerminateThread")
procUnlockFile = modkernel32.NewProc("UnlockFile")
procUnlockFileEx = modkernel32.NewProc("UnlockFileEx")
procWaitForSingleObjectEx = modkernel32.NewProc("WaitForSingleObjectEx")
@ -150,7 +167,19 @@ var (
modadvapi = syscall.NewLazyDLL("advapi32.dll")
//--
procGetFileSecurityW = modadvapi.NewProc("GetFileSecurityW")
procAccessCheck = modadvapi.NewProc("AccessCheck")
procGetAclInformation = modadvapi.NewProc("GetAclInformation")
procGetFileSecurityA = modadvapi.NewProc("GetFileSecurityA")
procGetFileSecurityW = modadvapi.NewProc("GetFileSecurityW")
procGetSecurityDescriptorDacl = modadvapi.NewProc("GetSecurityDescriptorDacl")
procGetSecurityDescriptorOwner = modadvapi.NewProc("GetSecurityDescriptorOwner")
procGetSidIdentifierAuthority = modadvapi.NewProc("GetSidIdentifierAuthority")
procGetSidLengthRequired = modadvapi.NewProc("GetSidLengthRequired")
procGetSidSubAuthority = modadvapi.NewProc("GetSidSubAuthority")
procImpersonateSelf = modadvapi.NewProc("ImpersonateSelf")
procInitializeSid = modadvapi.NewProc("InitializeSid")
procOpenThreadToken = modadvapi.NewProc("OpenThreadToken")
procRevertToSelf = modadvapi.NewProc("RevertToSelf")
//--
modws2_32 = syscall.NewLazyDLL("ws2_32.dll")
@ -160,10 +189,20 @@ var (
moduser32 = syscall.NewLazyDLL("user32.dll")
//--
procRegisterClassW = moduser32.NewProc("RegisterClassW")
procUnregisterClassW = moduser32.NewProc("UnregisterClassW")
procWaitForInputIdle = moduser32.NewProc("WaitForInputIdle")
procCreateWindowExW = moduser32.NewProc("CreateWindowExW")
procMsgWaitForMultipleObjectsEx = moduser32.NewProc("MsgWaitForMultipleObjectsEx")
procPeekMessageW = moduser32.NewProc("PeekMessageW")
procRegisterClassW = moduser32.NewProc("RegisterClassW")
procUnregisterClassW = moduser32.NewProc("UnregisterClassW")
procWaitForInputIdle = moduser32.NewProc("WaitForInputIdle")
//--
netapi = syscall.NewLazyDLL("netapi32.dll")
procNetGetDCName = netapi.NewProc("NetGetDCName")
procNetUserGetInfo = netapi.NewProc("NetUserGetInfo")
userenvapi = syscall.NewLazyDLL("userenv.dll")
procGetProfilesDirectoryW = userenvapi.NewProc("GetProfilesDirectoryW")
)
var (
@ -1865,7 +1904,11 @@ func X_stricmp(t *TLS, string1, string2 uintptr) int32 {
// _Frees_ptr_opt_ LPVOID lpMem
// );
func XHeapFree(t *TLS, hHeap uintptr, dwFlags uint32, lpMem uintptr) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall(procHeapFree.Addr(), 3, hHeap, uintptr(dwFlags), lpMem)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// HANDLE GetProcessHeap();
@ -2472,7 +2515,11 @@ func XGetCommModemStatus(t *TLS, _ ...interface{}) int32 {
// LPCWSTR lpNewFileName
// );
func XMoveFileW(t *TLS, lpExistingFileName, lpNewFileName uintptr) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall(procMoveFileW.Addr(), 2, lpExistingFileName, lpNewFileName, 0)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// DWORD GetFullPathNameW(
@ -2648,7 +2695,11 @@ func XFindNextFileW(t *TLS, hFindFile, lpFindFileData uintptr) int32 {
// LPSTR lpBuffer
// );
func XGetLogicalDriveStringsA(t *TLS, nBufferLength uint32, lpBuffer uintptr) uint32 {
panic(todo(""))
r0, _, err := syscall.Syscall(procGetLogicalDriveStringsA.Addr(), 2, uintptr(nBufferLength), lpBuffer, 0)
if err != 0 {
t.setErrno(err)
}
return uint32(r0)
}
// BOOL GetVolumeInformationA(
@ -2662,7 +2713,21 @@ func XGetLogicalDriveStringsA(t *TLS, nBufferLength uint32, lpBuffer uintptr) ui
// DWORD nFileSystemNameSize
// );
func XGetVolumeInformationA(t *TLS, lpRootPathName, lpVolumeNameBuffer uintptr, nVolumeNameSize uint32, lpVolumeSerialNumber, lpMaximumComponentLength, lpFileSystemFlags, lpFileSystemNameBuffer uintptr, nFileSystemNameSize uint32) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall9(procGetVolumeInformationA.Addr(), 8,
lpRootPathName,
lpVolumeNameBuffer,
uintptr(nVolumeNameSize),
lpVolumeSerialNumber,
lpMaximumComponentLength,
lpFileSystemFlags,
lpFileSystemNameBuffer,
uintptr(nFileSystemNameSize),
0,
)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// BOOL CreateHardLinkW(
@ -2671,7 +2736,11 @@ func XGetVolumeInformationA(t *TLS, lpRootPathName, lpVolumeNameBuffer uintptr,
// LPSECURITY_ATTRIBUTES lpSecurityAttributes
// );
func XCreateHardLinkW(t *TLS, lpFileName, lpExistingFileName, lpSecurityAttributes uintptr) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall(procCreateHardLinkW.Addr(), 1, lpFileName, lpExistingFileName, lpSecurityAttributes)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// BOOL DeviceIoControl(
@ -2699,7 +2768,25 @@ func XDeviceIoControl(t *TLS, hDevice uintptr, dwIoControlCode uint32, lpInBuffe
// size_t count
// );
func Xwcsncmp(t *TLS, string1, string2 uintptr, count types.Size_t) int32 {
panic(todo(""))
var s1 = goWideString(string1)
var l1 = len(s1)
var s2 = goWideString(string2)
var l2 = len(s2)
// shorter is lesser
if l1 < l2 {
return -1
}
if l2 > l1 {
return 1
}
// compare at most count
var cmpLen = count
if types.Size_t(l1) < cmpLen {
cmpLen = types.Size_t(l1)
}
return int32(strings.Compare(s1[:cmpLen], s2[:cmpLen]))
}
// int MultiByteToWideChar(
@ -2906,7 +2993,11 @@ func XGetDiskFreeSpaceW(t *TLS, lpRootPathName, lpSectorsPerCluster, lpBytesPerS
// LPCSTR lpFileName
// );
func XGetFileAttributesA(t *TLS, lpFileName uintptr) uint32 {
panic(todo(""))
r0, _, err := syscall.Syscall(procGetFileAttributesA.Addr(), 1, lpFileName, 0, 0)
if err != 0 {
t.setErrno(err)
}
return uint32(r0)
}
// BOOL GetFileAttributesExW(
@ -3638,7 +3729,18 @@ func XWaitForSingleObjectEx(t *TLS, hHandle uintptr, dwMilliseconds uint32, bAle
// DWORD dwFlags
// );
func XMsgWaitForMultipleObjectsEx(t *TLS, nCount uint32, pHandles uintptr, dwMilliseconds, dwWakeMask, dwFlags uint32) uint32 {
panic(todo(""))
r0, _, err := syscall.Syscall6(procMsgWaitForMultipleObjectsEx.Addr(), 5,
uintptr(nCount),
pHandles,
uintptr(dwMilliseconds),
uintptr(dwWakeMask),
uintptr(dwFlags),
0,
)
if err != 0 {
t.setErrno(err)
}
return uint32(r0)
}
func XMessageBoxW(t *TLS, _ ...interface{}) int32 {
@ -3664,7 +3766,11 @@ func XGetModuleFileNameW(t *TLS, hModule, lpFileName uintptr, nSize uint32) uint
// LPBYTE *Buffer
// );
func XNetGetDCName(t *TLS, ServerName, DomainName, Buffer uintptr) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall(procNetGetDCName.Addr(), 3, ServerName, DomainName, Buffer)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// NET_API_STATUS NET_API_FUNCTION NetUserGetInfo(
@ -3674,15 +3780,34 @@ func XNetGetDCName(t *TLS, ServerName, DomainName, Buffer uintptr) int32 {
// LPBYTE *bufptr
// );
func XNetUserGetInfo(t *TLS, servername, username uintptr, level uint32, bufptr uintptr) uint32 {
panic(todo(""))
r0, _, err := syscall.Syscall6(procNetUserGetInfo.Addr(), 4,
servername,
username,
uintptr(level),
bufptr,
0,
0,
)
if err != 0 {
t.setErrno(err)
}
return uint32(r0)
}
func XlstrlenW(t *TLS, _ ...interface{}) int32 {
panic(todo(""))
}
func XGetProfilesDirectoryW(t *TLS, _ ...interface{}) int32 {
panic(todo(""))
// USERENVAPI BOOL GetProfilesDirectoryW(
// [out] LPWSTR lpProfileDir,
// [in, out] LPDWORD lpcchSize
// );
func XGetProfilesDirectoryW(t *TLS, lpProfileDir, lpcchSize uintptr) int32 {
r0, _, err := syscall.Syscall(procGetProfilesDirectoryW.Addr(), 2, lpProfileDir, lpcchSize, 0)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
func XNetApiBufferFree(t *TLS, _ ...interface{}) int32 {
@ -3698,7 +3823,18 @@ func XNetApiBufferFree(t *TLS, _ ...interface{}) int32 {
// LPCSTR lpFileName
// );
func XGetPrivateProfileStringA(t *TLS, lpAppName, lpKeyName, lpDefault, lpReturnedString uintptr, nSize uint32, lpFileName uintptr) uint32 {
panic(todo(""))
r0, _, err := syscall.Syscall6(procGetPrivateProfileStringA.Addr(), 4,
lpAppName,
lpKeyName,
lpDefault,
lpReturnedString,
uintptr(nSize),
lpFileName,
)
if err != 0 {
t.setErrno(0x02)
}
return uint32(r0)
}
func XGetWindowsDirectoryA(t *TLS, _ ...interface{}) int32 {
@ -3726,21 +3862,34 @@ func XGetFileSecurityW(t *TLS, lpFileName uintptr, RequestedInformation uint32,
// LPBOOL lpbOwnerDefaulted
// );
func XGetSecurityDescriptorOwner(t *TLS, pSecurityDescriptor, pOwner, lpbOwnerDefaulted uintptr) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall(procGetSecurityDescriptorOwner.Addr(), 3, pSecurityDescriptor, pOwner, lpbOwnerDefaulted)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// PSID_IDENTIFIER_AUTHORITY GetSidIdentifierAuthority(
// PSID pSid
// );
func XGetSidIdentifierAuthority(t *TLS, pSid uintptr) uintptr {
panic(todo(""))
r0, _, err := syscall.Syscall(procGetSidIdentifierAuthority.Addr(), 1, pSid, 0, 0)
if err != 0 {
t.setErrno(err)
}
return r0
}
// BOOL ImpersonateSelf(
// SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
// );
func XImpersonateSelf(t *TLS, ImpersonationLevel int32) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall(procImpersonateSelf.Addr(), 1, uintptr(ImpersonationLevel), 0, 0)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// BOOL OpenThreadToken(
@ -3750,17 +3899,29 @@ func XImpersonateSelf(t *TLS, ImpersonationLevel int32) int32 {
// PHANDLE TokenHandle
// );
func XOpenThreadToken(t *TLS, ThreadHandle uintptr, DesiredAccess uint32, OpenAsSelf int32, TokenHandle uintptr) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall6(procOpenThreadToken.Addr(), 4, ThreadHandle, uintptr(DesiredAccess), uintptr(OpenAsSelf), TokenHandle, 0, 0)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// HANDLE GetCurrentThread();
func XGetCurrentThread(t *TLS) uintptr {
panic(todo(""))
r0, _, err := syscall.Syscall(procGetCurrentThread.Addr(), 0, 0, 0, 0)
if err != 0 {
t.setErrno(err)
}
return r0
}
// BOOL RevertToSelf();
func XRevertToSelf(t *TLS) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall(procRevertToSelf.Addr(), 0, 0, 0, 0)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// BOOL AccessCheck(
@ -3774,7 +3935,21 @@ func XRevertToSelf(t *TLS) int32 {
// LPBOOL AccessStatus
// );
func XAccessCheck(t *TLS, pSecurityDescriptor, ClientToken uintptr, DesiredAccess uint32, GenericMapping, PrivilegeSet, PrivilegeSetLength, GrantedAccess, AccessStatus uintptr) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall9(procAccessCheck.Addr(), 8,
pSecurityDescriptor,
ClientToken,
uintptr(DesiredAccess),
GenericMapping,
PrivilegeSet,
PrivilegeSetLength,
GrantedAccess,
AccessStatus,
0,
)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// int _wcsicmp(
@ -3838,7 +4013,21 @@ func XGetFileInformationByHandle(t *TLS, hFile, lpFileInformation uintptr) int32
// DWORD nFileSystemNameSize
// );
func XGetVolumeInformationW(t *TLS, lpRootPathName, lpVolumeNameBuffer uintptr, nVolumeNameSize uint32, lpVolumeSerialNumber, lpMaximumComponentLength, lpFileSystemFlags, lpFileSystemNameBuffer uintptr, nFileSystemNameSize uint32) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall9(procGetVolumeInformationW.Addr(), 8,
lpRootPathName,
lpVolumeNameBuffer,
uintptr(nVolumeNameSize),
lpVolumeSerialNumber,
lpMaximumComponentLength,
lpFileSystemFlags,
lpFileSystemNameBuffer,
uintptr(nFileSystemNameSize),
0,
)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// wchar_t *wcschr(
@ -3988,7 +4177,24 @@ func XGetACP(t *TLS) uint32 {
// LPDWORD pcbBuffer
// );
func XGetUserNameW(t *TLS, lpBuffer, pcbBuffer uintptr) int32 {
panic(todo(""))
u, err := user.Current()
if err != nil {
panic(todo(""))
return 0
}
wcnt := *(*uint16)(unsafe.Pointer(pcbBuffer))
s := utf16.Encode([]rune(u.Username))
if len(s)+1 > int(wcnt) {
panic(todo(""))
}
*(*uint16)(unsafe.Pointer(pcbBuffer)) = uint16(len(s) + 1)
for _, v := range s {
*(*uint16)(unsafe.Pointer(lpBuffer)) = v
lpBuffer += 2
}
return 1
}
// HMODULE LoadLibraryExW(
@ -3997,11 +4203,28 @@ func XGetUserNameW(t *TLS, lpBuffer, pcbBuffer uintptr) int32 {
// DWORD dwFlags
// );
func XLoadLibraryExW(t *TLS, lpLibFileName, hFile uintptr, dwFlags uint32) uintptr {
panic(todo(""))
return 0 // If the function fails, the return value is NULL.
}
func Xwcscpy(t *TLS, _ ...interface{}) int32 {
panic(todo(""))
// wchar_t *wcscpy(
// wchar_t *strDestination,
// const wchar_t *strSource
// );
func Xwcscpy(t *TLS, strDestination, strSource uintptr) uintptr {
if strSource == 0 {
return 0
}
d := strDestination
for {
c := *(*uint16)(unsafe.Pointer(strSource))
strSource += 2
*(*uint16)(unsafe.Pointer(d)) = c
d += 2
if c == 0 {
return strDestination
}
}
}
func XwsprintfW(t *TLS, _ ...interface{}) int32 {
@ -4062,7 +4285,24 @@ func XSetTimer(t *TLS, _ ...interface{}) int32 {
// LPVOID lpParam
// );
func XCreateWindowExW(t *TLS, dwExStyle uint32, lpClassName, lpWindowName uintptr, dwStyle uint32, x, y, nWidth, nHeight int32, hWndParent, hMenu, hInstance, lpParam uintptr) uintptr {
panic(todo(""))
r0, _, err := syscall.Syscall12(procCreateWindowExW.Addr(), 12,
uintptr(dwExStyle),
lpClassName,
lpWindowName,
uintptr(dwStyle),
uintptr(x),
uintptr(y),
uintptr(nWidth),
uintptr(nHeight),
hWndParent,
hMenu,
hInstance,
lpParam,
)
if err != 0 {
t.setErrno(err)
}
return r0
}
// BOOL PeekMessageW(
@ -4073,7 +4313,18 @@ func XCreateWindowExW(t *TLS, dwExStyle uint32, lpClassName, lpWindowName uintpt
// UINT wRemoveMsg
// );
func XPeekMessageW(t *TLS, lpMsg, hWnd uintptr, wMsgFilterMin, wMsgFilterMax, wRemoveMsg uint32) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall6(procPeekMessageW.Addr(), 5,
lpMsg,
hWnd,
uintptr(wMsgFilterMin),
uintptr(wMsgFilterMax),
uintptr(wRemoveMsg),
0,
)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
func XGetMessageW(t *TLS, _ ...interface{}) int32 {
@ -4209,8 +4460,16 @@ func X_InterlockedExchange(t *TLS, Target uintptr, Value long) long {
return old
}
func XTerminateThread(t *TLS, _ ...interface{}) int32 {
panic(todo(""))
// BOOL TerminateThread(
// [in, out] HANDLE hThread,
// [in] DWORD dwExitCode
// );
func XTerminateThread(t *TLS, hThread uintptr, dwExitCode uint32) int32 {
r0, _, err := syscall.Syscall(procTerminateThread.Addr(), 2, hThread, uintptr(dwExitCode), 0)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// BOOL GetComputerNameW(
@ -4345,8 +4604,12 @@ func XDdeQueryStringW(t *TLS, _ ...interface{}) int32 {
panic(todo(""))
}
func X_wcsicmp(t *TLS, _ ...interface{}) int32 {
panic(todo(""))
// int _wcsicmp(
// const wchar_t *string1,
// const wchar_t *string2
// );
func X_wcsicmp(t *TLS, string1, string2 uintptr) int32 {
return Xwcsicmp(t, string1, string2)
}
func XDdeCreateDataHandle(t *TLS, _ ...interface{}) uintptr {
@ -4790,6 +5053,7 @@ func goWideBytes(p uintptr, n int) []uint16 {
return w
}
// This version does include the zero terminator in the returned Go string.
func goWideString(p uintptr) string {
if p == 0 {
return ""
@ -4814,6 +5078,28 @@ func goWideStringN(p uintptr, n int) string {
panic(todo(""))
}
// This version does not include the zero terminator in the returned Go string.
func goWideStringNZ(p uintptr) string {
if p == 0 {
return ""
}
var w []uint16
var raw = (*RawMem)(unsafe.Pointer(p))
var i = 0
for {
wc := *(*uint16)(unsafe.Pointer(&raw[i]))
if wc == 0 {
break
}
w = append(w, wc)
i = i + 2
}
s := utf16.Decode(w)
return string(s)
}
// LPWSTR GetCommandLineW();
func XGetCommandLineW(t *TLS) uintptr {
return uintptr(unsafe.Pointer(syscall.GetCommandLine()))
@ -4856,7 +5142,18 @@ func XGetAce(t *TLS, pAcl uintptr, dwAceIndex uint32, pAce uintptr) int32 {
// ACL_INFORMATION_CLASS dwAclInformationClass
// );
func XGetAclInformation(t *TLS, pAcl, pAclInformation uintptr, nAclInformationLength, dwAclInformationClass uint32) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall6(procGetAclInformation.Addr(), 4,
pAclInformation,
pAclInformation,
uintptr(nAclInformationLength),
uintptr(dwAclInformationClass),
0,
0,
)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// BOOL GetFileSecurityA(
@ -4867,7 +5164,18 @@ func XGetAclInformation(t *TLS, pAcl, pAclInformation uintptr, nAclInformationLe
// LPDWORD lpnLengthNeeded
// );
func XGetFileSecurityA(t *TLS, lpFileName uintptr, RequestedInformation uint32, pSecurityDescriptor uintptr, nLength uint32, lpnLengthNeeded uintptr) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall6(procGetFileSecurityA.Addr(), 5,
lpFileName,
uintptr(RequestedInformation),
pSecurityDescriptor,
uintptr(nLength),
lpnLengthNeeded,
0,
)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// DWORD GetLengthSid(
@ -4884,14 +5192,29 @@ func XGetLengthSid(t *TLS, pSid uintptr) uint32 {
// LPBOOL lpbDaclDefaulted
// );
func XGetSecurityDescriptorDacl(t *TLS, pSecurityDescriptor, lpbDaclPresent, pDacl, lpbDaclDefaulted uintptr) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall6(procGetSecurityDescriptorDacl.Addr(), 4,
pSecurityDescriptor,
lpbDaclPresent,
pDacl,
lpbDaclDefaulted,
0,
0,
)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// DWORD GetSidLengthRequired(
// UCHAR nSubAuthorityCount
// );
func XGetSidLengthRequired(t *TLS, nSubAuthorityCount uint8) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall(procGetSidLengthRequired.Addr(), 1, uintptr(nSubAuthorityCount), 0, 0)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// PDWORD GetSidSubAuthority(
@ -4899,7 +5222,11 @@ func XGetSidLengthRequired(t *TLS, nSubAuthorityCount uint8) int32 {
// DWORD nSubAuthority
// );
func XGetSidSubAuthority(t *TLS, pSid uintptr, nSubAuthority uint32) uintptr {
panic(todo(""))
r0, _, err := syscall.Syscall(procGetSidSubAuthority.Addr(), 2, pSid, uintptr(nSubAuthority), 0)
if err != 0 {
t.setErrno(err)
}
return r0
}
// BOOL InitializeAcl(
@ -4917,7 +5244,11 @@ func XInitializeAcl(t *TLS, pAcl uintptr, nAclLength, dwAclRevision uint32) int3
// BYTE nSubAuthorityCount
// );
func XInitializeSid(t *TLS, Sid, pIdentifierAuthority uintptr, nSubAuthorityCount uint8) int32 {
panic(todo(""))
r0, _, err := syscall.Syscall(procInitializeSid.Addr(), 3, Sid, pIdentifierAuthority, uintptr(nSubAuthorityCount))
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// VOID RaiseException(
@ -5369,8 +5700,8 @@ func X_gmtime64(t *TLS, sourceTime uintptr) uintptr {
}
// __time64_t _mktime64(struct tm *timeptr);
func X_mktime64(t *TLS, timeptr uintptr) int64 {
panic(todo(""))
func X_mktime64(t *TLS, timeptr uintptr) time.X__time64_t {
return time.X__time64_t(Xmktime(t, timeptr))
}
// char * gai_strerrorA(int ecode);
@ -5416,3 +5747,128 @@ func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_a
func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */
return *(*int32)(unsafe.Pointer(a)) & int32(3)
}
func Xchmod(t *TLS, pathname uintptr, mode int32) int32 {
panic(todo("%q %#o", GoString(pathname), mode))
}
// typedef enum _COMPUTER_NAME_FORMAT {
// ComputerNameNetBIOS,
// ComputerNameDnsHostname,
// ComputerNameDnsDomain,
// ComputerNameDnsFullyQualified,
// ComputerNamePhysicalNetBIOS,
// ComputerNamePhysicalDnsHostname,
// ComputerNamePhysicalDnsDomain,
// ComputerNamePhysicalDnsFullyQualified,
// ComputerNameMax
// } COMPUTER_NAME_FORMAT;
// BOOL GetComputerNameExW(
// [in] COMPUTER_NAME_FORMAT NameType,
// [out] LPWSTR lpBuffer,
// [in, out] LPDWORD nSize
// );
func XGetComputerNameExW(t *TLS, nameType int32, lpBuffer, nSize uintptr) int32 {
r0, _, err := syscall.Syscall(procGetComputerNameExW.Addr(), 3, uintptr(nameType), lpBuffer, nSize)
if err != 0 {
t.setErrno(err)
}
return int32(r0)
}
// double _copysign(
// double x,
// double y
// );
func X_copysign(t *TLS, x, y float64) float64 { return Xcopysign(t, x, y) }
// int _wtoi(
// const wchar_t *str
// );
func X_wtoi(t *TLS, str uintptr) int32 {
panic(todo(""))
}
func allocW(t *TLS, v string) (r uintptr) {
s := utf16.Encode([]rune(v))
p := Xcalloc(t, types.Size_t(len(s)+1), 2)
if p == 0 {
panic(todo(""))
}
r = p
for _, v := range s {
*(*uint16)(unsafe.Pointer(p)) = v
p += 2
}
return r
}
// wchar_t *_wgetenv(
// const wchar_t *varname
// );
func X_wgetenv(t *TLS, varname uintptr) uintptr {
if !wenvValid {
bootWinEnviron(t)
}
k := strings.ToLower(goWideStringNZ(varname))
for _, v := range winEnviron[:len(winEnviron)-1] {
s := strings.ToLower(goWideStringNZ(v))
x := strings.IndexByte(s, '=')
if s[:x] == k {
// trc("%v: %q -> %q", origin(1), goWideStringNZ(varname), goWideStringNZ(v))
return v
}
}
// trc("%v: %q -> %q", origin(1), goWideStringNZ(varname), "")
return 0
}
// int _wputenv(
// const wchar_t *envstring
// );
func X_wputenv(t *TLS, envstring uintptr) int32 {
if !wenvValid {
bootWinEnviron(t)
}
s0 := goWideStringNZ(envstring)
s := strings.ToLower(s0)
x := strings.IndexByte(s, '=')
k := s[:x]
for i, v := range winEnviron[:len(winEnviron)-1] {
s2 := strings.ToLower(goWideStringNZ(v))
x := strings.IndexByte(s2, '=')
if s2[:x] == k {
Xfree(t, v)
winEnviron[i] = allocW(t, s0)
return 0
}
}
np := allocW(t, s0)
winEnviron = winEnviron[:len(winEnviron)-1]
winEnviron = append(winEnviron, np, 0)
wenviron = uintptr(unsafe.Pointer(&winEnviron[0]))
return 0
}
func bootWinEnviron(t *TLS) {
winEnviron = winEnviron[:0]
p := Environ()
for {
q := *(*uintptr)(unsafe.Pointer(p))
p += unsafe.Sizeof(uintptr(0))
if q == 0 {
break
}
s := GoString(q)
// trc("%v: %q", origin(1), s)
r := allocW(t, s)
winEnviron = append(winEnviron, r)
}
wenviron = uintptr(unsafe.Pointer(&winEnviron[0]))
wenvValid = true
}

View file

@ -288,10 +288,6 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 {
// return 0
}
func Xchmod(t *TLS, pathname uintptr, mode int32) int32 {
panic(todo(""))
}
// int utimes(const char *filename, const struct timeval times[2]);
func Xutimes(t *TLS, filename, times uintptr) int32 {
panic(todo(""))

View file

@ -292,10 +292,6 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 {
// return 0
}
func Xchmod(t *TLS, pathname uintptr, mode int32) int32 {
panic(todo(""))
}
// int utimes(const char *filename, const struct timeval times[2]);
func Xutimes(t *TLS, filename, times uintptr) int32 {
panic(todo(""))

View file

@ -83,6 +83,7 @@ const (
WORD_BIT = 32
X_ARM_LIMITS_H_ = 0
X_ARM__LIMITS_H_ = 0
X_BSD_MACHINE_LIMITS_H_ = 0
X_CDEFS_H_ = 0
X_DARWIN_FEATURE_64_BIT_INODE = 1
X_DARWIN_FEATURE_ONLY_64_BIT_INODE = 1
@ -333,6 +334,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -620,6 +627,7 @@ type X__float128 = float64 /* <builtin>:47:21 */
// compiler. GCC provides its own limits.h which can be found in
// /usr/lib/gcc, although it is not very informative.
// This file is public domain.
// Copyright (c) 2000-2007 Apple Inc. All rights reserved.
// Copyright (c) 1988, 1993
// The Regents of the University of California. All rights reserved.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -230,17 +230,17 @@ type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:366:9 */
type locale_t = uintptr /* alltypes.h:366:32 */
func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */
return (Bool32((func() int32 {
return Bool32(func() int32 {
if 0 != 0 {
return Xisalpha(tls, c)
}
return (Bool32((((uint32(c)) | uint32(32)) - uint32('a')) < uint32(26)))
}() != 0) || (func() int32 {
return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26))
}() != 0 || func() int32 {
if 0 != 0 {
return Xisdigit(tls, c)
}
return (Bool32(((uint32(c)) - uint32('0')) < uint32(10)))
}() != 0)))
return Bool32(uint32(c)-uint32('0') < uint32(10))
}() != 0)
}
func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */
@ -248,7 +248,7 @@ func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */
}
func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */
return (Bool32(((uint32(c) | uint32(32)) - uint32('a')) < uint32(26)))
return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26))
}
func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */
@ -256,7 +256,7 @@ func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */
}
func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */
return (Bool32((uint32(c) - uint32('0')) < uint32(10)))
return Bool32(uint32(c)-uint32('0') < uint32(10))
}
func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */
@ -264,7 +264,7 @@ func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */
}
func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */
return (Bool32((uint32(c) - uint32('a')) < uint32(26)))
return Bool32(uint32(c)-uint32('a') < uint32(26))
}
func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */
@ -272,7 +272,7 @@ func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */
}
func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */
return (Bool32((uint32(c) - uint32(0x20)) < uint32(0x5f)))
return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f))
}
func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */
@ -280,7 +280,7 @@ func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */
}
func Xisspace(tls *TLS, c int32) int32 { /* isspace.c:4:5: */
return (Bool32((c == ' ') || ((uint32(c) - uint32('\t')) < uint32(5))))
return Bool32(c == ' ' || uint32(c)-uint32('\t') < uint32(5))
}
func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */
@ -288,12 +288,12 @@ func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */
}
func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */
return (Bool32((func() int32 {
return Bool32(func() int32 {
if 0 != 0 {
return Xisdigit(tls, c)
}
return (Bool32(((uint32(c)) - uint32('0')) < uint32(10)))
}() != 0) || (((uint32(c) | uint32(32)) - uint32('a')) < uint32(6))))
return Bool32(uint32(c)-uint32('0') < uint32(10))
}() != 0 || uint32(c)|uint32(32)-uint32('a') < uint32(6))
}
func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */
@ -343,7 +343,7 @@ __2:
if !(*(*uintptr)(unsafe.Pointer(e)) != 0) {
goto __4
}
if !(!(Xstrncmp(tls, s, *(*uintptr)(unsafe.Pointer(e)), (l+size_t(1))) != 0)) {
if !!(Xstrncmp(tls, s, *(*uintptr)(unsafe.Pointer(e)), l+size_t(1)) != 0) {
goto __5
}
tmp = *(*uintptr)(unsafe.Pointer(e))
@ -365,8 +365,8 @@ __1:
if !(Environ() == _soldenv) {
goto __6
}
newenv = Xrealloc(tls, _soldenv, (uint32(unsafe.Sizeof(uintptr(0))) * (i + size_t(2))))
if !(!(newenv != 0)) {
newenv = Xrealloc(tls, _soldenv, uint32(unsafe.Sizeof(uintptr(0)))*(i+size_t(2)))
if !!(newenv != 0) {
goto __8
}
goto oom
@ -374,8 +374,8 @@ __8:
;
goto __7
__6:
newenv = Xmalloc(tls, (uint32(unsafe.Sizeof(uintptr(0))) * (i + size_t(2))))
if !(!(newenv != 0)) {
newenv = Xmalloc(tls, uint32(unsafe.Sizeof(uintptr(0)))*(i+size_t(2)))
if !!(newenv != 0) {
goto __9
}
goto oom
@ -384,14 +384,14 @@ __9:
if !(i != 0) {
goto __10
}
Xmemcpy(tls, newenv, Environ(), (uint32(unsafe.Sizeof(uintptr(0))) * i))
Xmemcpy(tls, newenv, Environ(), uint32(unsafe.Sizeof(uintptr(0)))*i)
__10:
;
Xfree(tls, _soldenv)
__7:
;
*(*uintptr)(unsafe.Pointer(newenv + uintptr(i)*4)) = s
*(*uintptr)(unsafe.Pointer(newenv + uintptr((i+size_t(1)))*4)) = uintptr(0)
*(*uintptr)(unsafe.Pointer(newenv + uintptr(i+size_t(1))*4)) = uintptr(0)
*(*uintptr)(unsafe.Pointer(EnvironP())) = AssignPtrUintptr(uintptr(unsafe.Pointer(&_soldenv)), newenv)
if !(r != 0) {
goto __11
@ -408,7 +408,7 @@ oom:
var _soldenv uintptr /* putenv.c:22:14: */
func Xputenv(tls *TLS, s uintptr) int32 { /* putenv.c:43:5: */
var l size_t = (size_t((int32(X__strchrnul(tls, s, '=')) - int32(s)) / 1))
var l size_t = size_t((int32(X__strchrnul(tls, s, '=')) - int32(s)) / 1)
if !(l != 0) || !(int32(*(*int8)(unsafe.Pointer(s + uintptr(l)))) != 0) {
return Xunsetenv(tls, s)
}
@ -423,7 +423,7 @@ func X__env_rm_add(tls *TLS, old uintptr, new uintptr) { /* setenv.c:5:6: */
*(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*4)) = new
Xfree(tls, old)
return
} else if !(int32(*(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*4))) != 0) && (new != 0) {
} else if !(int32(*(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*4))) != 0) && new != 0 {
*(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*4)) = new
new = uintptr(0)
}
@ -431,11 +431,11 @@ func X__env_rm_add(tls *TLS, old uintptr, new uintptr) { /* setenv.c:5:6: */
if !(new != 0) {
return
}
var t uintptr = Xrealloc(tls, _senv_alloced, (uint32(unsafe.Sizeof(uintptr(0))) * (_senv_alloced_n + size_t(1))))
var t uintptr = Xrealloc(tls, _senv_alloced, uint32(unsafe.Sizeof(uintptr(0)))*(_senv_alloced_n+size_t(1)))
if !(t != 0) {
return
}
*(*uintptr)(unsafe.Pointer((AssignPtrUintptr(uintptr(unsafe.Pointer(&_senv_alloced)), t)) + uintptr(PostIncUint32(&_senv_alloced_n, 1))*4)) = new
*(*uintptr)(unsafe.Pointer(AssignPtrUintptr(uintptr(unsafe.Pointer(&_senv_alloced)), t) + uintptr(PostIncUint32(&_senv_alloced_n, 1))*4)) = new
}
var _senv_alloced uintptr /* setenv.c:7:14: */
@ -446,29 +446,29 @@ func Xsetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /*
var l1 size_t
var l2 size_t
if (!(var1 != 0) || !(int32(AssignUint32(&l1, (size_t((int32(X__strchrnul(tls, var1, '='))-int32(var1))/1)))) != 0)) || (*(*int8)(unsafe.Pointer(var1 + uintptr(l1))) != 0) {
(*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 22
if !(var1 != 0) || !(int32(AssignUint32(&l1, size_t((int32(X__strchrnul(tls, var1, '='))-int32(var1))/1))) != 0) || *(*int8)(unsafe.Pointer(var1 + uintptr(l1))) != 0 {
*(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22
return -1
}
if !(overwrite != 0) && (Xgetenv(tls, var1) != 0) {
if !(overwrite != 0) && Xgetenv(tls, var1) != 0 {
return 0
}
l2 = Xstrlen(tls, value)
s = Xmalloc(tls, ((l1 + l2) + size_t(2)))
s = Xmalloc(tls, l1+l2+size_t(2))
if !(s != 0) {
return -1
}
Xmemcpy(tls, s, var1, l1)
*(*int8)(unsafe.Pointer(s + uintptr(l1))) = int8('=')
Xmemcpy(tls, ((s + uintptr(l1)) + uintptr(1)), value, (l2 + size_t(1)))
Xmemcpy(tls, s+uintptr(l1)+uintptr(1), value, l2+size_t(1))
return X__putenv(tls, s, l1, s)
}
func Xunsetenv(tls *TLS, name uintptr) int32 { /* unsetenv.c:9:5: */
var l size_t = (size_t((int32(X__strchrnul(tls, name, '=')) - int32(name)) / 1))
if !(l != 0) || (*(*int8)(unsafe.Pointer(name + uintptr(l))) != 0) {
(*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 22
var l size_t = size_t((int32(X__strchrnul(tls, name, '=')) - int32(name)) / 1)
if !(l != 0) || *(*int8)(unsafe.Pointer(name + uintptr(l))) != 0 {
*(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22
return -1
}
if Environ() != 0 {
@ -476,7 +476,7 @@ func Xunsetenv(tls *TLS, name uintptr) int32 { /* unsetenv.c:9:5: */
var eo uintptr = e
for ; *(*uintptr)(unsafe.Pointer(e)) != 0; e += 4 {
//TODO if (!strncmp(name, *e, l) && l[*e] == '=')
if !(Xstrncmp(tls, name, *(*uintptr)(unsafe.Pointer(e)), l) != 0) && (int32(*(*int8)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(e))) + uintptr(l)))) == '=') {
if !(Xstrncmp(tls, name, *(*uintptr)(unsafe.Pointer(e)), l) != 0) && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(e)) + uintptr(l)))) == '=' {
X__env_rm_add(tls, *(*uintptr)(unsafe.Pointer(e)), uintptr(0))
} else if eo != e {
*(*uintptr)(unsafe.Pointer(PostIncUintptr(&eo, 4))) = *(*uintptr)(unsafe.Pointer(e))
@ -896,15 +896,15 @@ func a_or_64(tls *TLS, p uintptr, v uint64_t) { /* atomic.h:220:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*struct{ v uint64_t })(unsafe.Pointer(bp /* u */)) = func() (r struct{ v uint64_t }) {
*(*struct{ v uint64_t })(unsafe.Pointer(bp)) = func() (r struct{ v uint64_t }) {
*(*uint64_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = v
return r
}()
if *(*uint32_t)(unsafe.Pointer((bp /* &u */ /* &.r */))) != 0 {
a_or(tls, p, int32(*(*uint32_t)(unsafe.Pointer((bp /* &u */ /* &.r */)))))
if *(*uint32_t)(unsafe.Pointer(bp)) != 0 {
a_or(tls, p, int32(*(*uint32_t)(unsafe.Pointer(bp))))
}
if *(*uint32_t)(unsafe.Pointer((bp /* &u */ /* &.r */) + 1*4)) != 0 {
a_or(tls, (p + uintptr(1)*4), int32(*(*uint32_t)(unsafe.Pointer((bp /* &u */ /* &.r */) + 1*4))))
if *(*uint32_t)(unsafe.Pointer(bp + 1*4)) != 0 {
a_or(tls, p+uintptr(1)*4, int32(*(*uint32_t)(unsafe.Pointer(bp + 1*4))))
}
}
@ -928,35 +928,35 @@ func Xwcrtomb(tls *TLS, s uintptr, wc wchar_t, st uintptr) size_t { /* wcrtomb.c
if uint32(wc) < uint32(0x80) {
*(*int8)(unsafe.Pointer(s)) = int8(wc)
return size_t(1)
} else if (func() int32 {
if !(!(int32(*(*uintptr)(unsafe.Pointer(((*__pthread)(unsafe.Pointer(__pthread_self(tls))).locale /* &.cat */)))) != 0)) {
} else if func() int32 {
if !!(int32(*(*uintptr)(unsafe.Pointer((*__pthread)(unsafe.Pointer(__pthread_self(tls))).locale))) != 0) {
return 4
}
return 1
}()) == 1 {
if !(((uint32(wc)) - uint32(0xdf80)) < uint32(0x80)) {
(*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 84
}() == 1 {
if !(uint32(wc)-uint32(0xdf80) < uint32(0x80)) {
*(*int32)(unsafe.Pointer(X___errno_location(tls))) = 84
return Uint32FromInt32(-1)
}
*(*int8)(unsafe.Pointer(s)) = int8(wc)
return size_t(1)
} else if uint32(wc) < uint32(0x800) {
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = (int8(0xc0 | (int32(wc) >> 6)))
*(*int8)(unsafe.Pointer(s)) = (int8(0x80 | (int32(wc) & 0x3f)))
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0xc0 | int32(wc)>>6)
*(*int8)(unsafe.Pointer(s)) = int8(0x80 | int32(wc)&0x3f)
return size_t(2)
} else if (uint32(wc) < uint32(0xd800)) || ((uint32(wc) - uint32(0xe000)) < uint32(0x2000)) {
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = (int8(0xe0 | (int32(wc) >> 12)))
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = (int8(0x80 | ((int32(wc) >> 6) & 0x3f)))
*(*int8)(unsafe.Pointer(s)) = (int8(0x80 | (int32(wc) & 0x3f)))
} else if uint32(wc) < uint32(0xd800) || uint32(wc)-uint32(0xe000) < uint32(0x2000) {
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0xe0 | int32(wc)>>12)
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0x80 | int32(wc)>>6&0x3f)
*(*int8)(unsafe.Pointer(s)) = int8(0x80 | int32(wc)&0x3f)
return size_t(3)
} else if (uint32(wc) - uint32(0x10000)) < uint32(0x100000) {
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = (int8(0xf0 | (int32(wc) >> 18)))
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = (int8(0x80 | ((int32(wc) >> 12) & 0x3f)))
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = (int8(0x80 | ((int32(wc) >> 6) & 0x3f)))
*(*int8)(unsafe.Pointer(s)) = (int8(0x80 | (int32(wc) & 0x3f)))
} else if uint32(wc)-uint32(0x10000) < uint32(0x100000) {
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0xf0 | int32(wc)>>18)
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0x80 | int32(wc)>>12&0x3f)
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0x80 | int32(wc)>>6&0x3f)
*(*int8)(unsafe.Pointer(s)) = int8(0x80 | int32(wc)&0x3f)
return size_t(4)
}
(*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 84
*(*int32)(unsafe.Pointer(X___errno_location(tls))) = 84
return Uint32FromInt32(-1)
}
@ -974,11 +974,11 @@ func Xwcsrtombs(tls *TLS, s uintptr, ws uintptr, n size_t, st uintptr) size_t {
ws2 = *(*uintptr)(unsafe.Pointer(ws))
for ; *(*wchar_t)(unsafe.Pointer(ws2)) != 0; ws2 += 2 {
if uint32(*(*wchar_t)(unsafe.Pointer(ws2))) >= 0x80 {
l = Xwcrtomb(tls, bp /* &buf[0] */, *(*wchar_t)(unsafe.Pointer(ws2)), uintptr(0))
if !((l + size_t(1)) != 0) {
l = Xwcrtomb(tls, bp, *(*wchar_t)(unsafe.Pointer(ws2)), uintptr(0))
if !(l+size_t(1) != 0) {
return Uint32FromInt32(-1)
}
n = n + (l)
n = n + l
} else {
n++
}
@ -986,46 +986,46 @@ func Xwcsrtombs(tls *TLS, s uintptr, ws uintptr, n size_t, st uintptr) size_t {
return n
}
for n >= size_t(4) {
if (uint32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws))))) - 1) >= 0x7f {
if uint32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))))-1 >= 0x7f {
if !(int32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws))))) != 0) {
*(*int8)(unsafe.Pointer(s)) = int8(0)
*(*uintptr)(unsafe.Pointer(ws)) = uintptr(0)
return (N - n)
return N - n
}
l = Xwcrtomb(tls, s, *(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))), uintptr(0))
if !((l + size_t(1)) != 0) {
if !(l+size_t(1) != 0) {
return Uint32FromInt32(-1)
}
s += uintptr(l)
n = n - (l)
n = n - l
} else {
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))))
n--
}
(*(*uintptr)(unsafe.Pointer(ws))) += 2
*(*uintptr)(unsafe.Pointer(ws)) += 2
}
for n != 0 {
if (uint32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws))))) - 1) >= 0x7f {
if uint32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))))-1 >= 0x7f {
if !(int32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws))))) != 0) {
*(*int8)(unsafe.Pointer(s)) = int8(0)
*(*uintptr)(unsafe.Pointer(ws)) = uintptr(0)
return (N - n)
return N - n
}
l = Xwcrtomb(tls, bp /* &buf[0] */, *(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))), uintptr(0))
if !((l + size_t(1)) != 0) {
l = Xwcrtomb(tls, bp, *(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))), uintptr(0))
if !(l+size_t(1) != 0) {
return Uint32FromInt32(-1)
}
if l > n {
return (N - n)
return N - n
}
Xwcrtomb(tls, s, *(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))), uintptr(0))
s += uintptr(l)
n = n - (l)
n = n - l
} else {
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))))
n--
}
(*(*uintptr)(unsafe.Pointer(ws))) += 2
*(*uintptr)(unsafe.Pointer(ws)) += 2
}
return N
}
@ -1036,7 +1036,7 @@ func Xwcstombs(tls *TLS, s uintptr, ws uintptr, n size_t) size_t { /* wcstombs.c
*(*uintptr)(unsafe.Pointer(bp)) = ws
//TODO return wcsrtombs(s, &(const wchar_t *){ws}, n, 0);
return Xwcsrtombs(tls, s, bp /* &ws */, n, uintptr(0))
return Xwcsrtombs(tls, s, bp, n, uintptr(0))
}
// Support signed or unsigned plain-char
@ -1051,28 +1051,28 @@ func Xwcstombs(tls *TLS, s uintptr, ws uintptr, n size_t) size_t { /* wcstombs.c
func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: */
c = int32(uint8(c))
if !(c != 0) {
return (s + uintptr(Xstrlen(tls, s)))
return s + uintptr(Xstrlen(tls, s))
}
var w uintptr
for ; (uintptr_t(s) % (uintptr_t(unsafe.Sizeof(size_t(0))))) != 0; s++ {
if !(int32(*(*int8)(unsafe.Pointer(s))) != 0) || (int32(*(*uint8)(unsafe.Pointer(s))) == c) {
for ; uintptr_t(s)%uintptr_t(unsafe.Sizeof(size_t(0))) != 0; s++ {
if !(int32(*(*int8)(unsafe.Pointer(s))) != 0) || int32(*(*uint8)(unsafe.Pointer(s))) == c {
return s
}
}
var k size_t = ((Uint32(Uint32FromInt32(-1)) / size_t(255)) * size_t(c))
for w = s; !(((((*(*uint32)(unsafe.Pointer(w))) - (Uint32(Uint32FromInt32(-1)) / size_t(255))) & ^(*(*uint32)(unsafe.Pointer(w)))) & ((Uint32(Uint32FromInt32(-1)) / size_t(255)) * (size_t((255 / 2) + 1)))) != 0) && !(((((*(*uint32)(unsafe.Pointer(w)) ^ k) - (Uint32(Uint32FromInt32(-1)) / size_t(255))) & ^(*(*uint32)(unsafe.Pointer(w)) ^ k)) & ((Uint32(Uint32FromInt32(-1)) / size_t(255)) * (size_t((255 / 2) + 1)))) != 0); w += 4 {
var k size_t = Uint32(Uint32FromInt32(-1)) / size_t(255) * size_t(c)
for w = s; !((*(*uint32)(unsafe.Pointer(w))-Uint32(Uint32FromInt32(-1))/size_t(255)) & ^*(*uint32)(unsafe.Pointer(w)) & (Uint32(Uint32FromInt32(-1))/size_t(255)*size_t(255/2+1)) != 0) && !((*(*uint32)(unsafe.Pointer(w))^k-Uint32(Uint32FromInt32(-1))/size_t(255)) & ^(*(*uint32)(unsafe.Pointer(w))^k) & (Uint32(Uint32FromInt32(-1))/size_t(255)*size_t(255/2+1)) != 0); w += 4 {
}
s = w
for ; (*(*int8)(unsafe.Pointer(s)) != 0) && (int32(*(*uint8)(unsafe.Pointer(s))) != c); s++ {
for ; *(*int8)(unsafe.Pointer(s)) != 0 && int32(*(*uint8)(unsafe.Pointer(s))) != c; s++ {
}
return s
}
func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */
var l size_t = Xstrlen(tls, s)
var d uintptr = Xmalloc(tls, (l + size_t(1)))
var d uintptr = Xmalloc(tls, l+size_t(1))
if !(d != 0) {
return uintptr(0)
}
return Xmemcpy(tls, d, s, (l + size_t(1)))
return Xmemcpy(tls, d, s, l+size_t(1))
}

View file

@ -230,17 +230,17 @@ type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:343:9 */
type locale_t = uintptr /* alltypes.h:343:32 */
func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */
return (Bool32((func() int32 {
return Bool32(func() int32 {
if 0 != 0 {
return Xisalpha(tls, c)
}
return (Bool32((((uint32(c)) | uint32(32)) - uint32('a')) < uint32(26)))
}() != 0) || (func() int32 {
return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26))
}() != 0 || func() int32 {
if 0 != 0 {
return Xisdigit(tls, c)
}
return (Bool32(((uint32(c)) - uint32('0')) < uint32(10)))
}() != 0)))
return Bool32(uint32(c)-uint32('0') < uint32(10))
}() != 0)
}
func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */
@ -248,7 +248,7 @@ func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */
}
func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */
return (Bool32(((uint32(c) | uint32(32)) - uint32('a')) < uint32(26)))
return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26))
}
func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */
@ -256,7 +256,7 @@ func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */
}
func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */
return (Bool32((uint32(c) - uint32('0')) < uint32(10)))
return Bool32(uint32(c)-uint32('0') < uint32(10))
}
func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */
@ -264,7 +264,7 @@ func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */
}
func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */
return (Bool32((uint32(c) - uint32('a')) < uint32(26)))
return Bool32(uint32(c)-uint32('a') < uint32(26))
}
func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */
@ -272,7 +272,7 @@ func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */
}
func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */
return (Bool32((uint32(c) - uint32(0x20)) < uint32(0x5f)))
return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f))
}
func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */
@ -280,7 +280,7 @@ func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */
}
func Xisspace(tls *TLS, c int32) int32 { /* isspace.c:4:5: */
return (Bool32((c == ' ') || ((uint32(c) - uint32('\t')) < uint32(5))))
return Bool32(c == ' ' || uint32(c)-uint32('\t') < uint32(5))
}
func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */
@ -288,12 +288,12 @@ func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */
}
func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */
return (Bool32((func() int32 {
return Bool32(func() int32 {
if 0 != 0 {
return Xisdigit(tls, c)
}
return (Bool32(((uint32(c)) - uint32('0')) < uint32(10)))
}() != 0) || (((uint32(c) | uint32(32)) - uint32('a')) < uint32(6))))
return Bool32(uint32(c)-uint32('0') < uint32(10))
}() != 0 || uint32(c)|uint32(32)-uint32('a') < uint32(6))
}
func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */
@ -343,7 +343,7 @@ __2:
if !(*(*uintptr)(unsafe.Pointer(e)) != 0) {
goto __4
}
if !(!(Xstrncmp(tls, s, *(*uintptr)(unsafe.Pointer(e)), (l+uint64(1))) != 0)) {
if !!(Xstrncmp(tls, s, *(*uintptr)(unsafe.Pointer(e)), l+uint64(1)) != 0) {
goto __5
}
tmp = *(*uintptr)(unsafe.Pointer(e))
@ -365,8 +365,8 @@ __1:
if !(Environ() == _soldenv) {
goto __6
}
newenv = Xrealloc(tls, _soldenv, (uint64(unsafe.Sizeof(uintptr(0))) * (i + uint64(2))))
if !(!(newenv != 0)) {
newenv = Xrealloc(tls, _soldenv, uint64(unsafe.Sizeof(uintptr(0)))*(i+uint64(2)))
if !!(newenv != 0) {
goto __8
}
goto oom
@ -374,8 +374,8 @@ __8:
;
goto __7
__6:
newenv = Xmalloc(tls, (uint64(unsafe.Sizeof(uintptr(0))) * (i + uint64(2))))
if !(!(newenv != 0)) {
newenv = Xmalloc(tls, uint64(unsafe.Sizeof(uintptr(0)))*(i+uint64(2)))
if !!(newenv != 0) {
goto __9
}
goto oom
@ -384,14 +384,14 @@ __9:
if !(i != 0) {
goto __10
}
Xmemcpy(tls, newenv, Environ(), (uint64(unsafe.Sizeof(uintptr(0))) * i))
Xmemcpy(tls, newenv, Environ(), uint64(unsafe.Sizeof(uintptr(0)))*i)
__10:
;
Xfree(tls, _soldenv)
__7:
;
*(*uintptr)(unsafe.Pointer(newenv + uintptr(i)*8)) = s
*(*uintptr)(unsafe.Pointer(newenv + uintptr((i+uint64(1)))*8)) = uintptr(0)
*(*uintptr)(unsafe.Pointer(newenv + uintptr(i+uint64(1))*8)) = uintptr(0)
*(*uintptr)(unsafe.Pointer(EnvironP())) = AssignPtrUintptr(uintptr(unsafe.Pointer(&_soldenv)), newenv)
if !(r != 0) {
goto __11
@ -408,7 +408,7 @@ oom:
var _soldenv uintptr /* putenv.c:22:14: */
func Xputenv(tls *TLS, s uintptr) int32 { /* putenv.c:43:5: */
var l size_t = (size_t((int64(X__strchrnul(tls, s, '=')) - int64(s)) / 1))
var l size_t = size_t((int64(X__strchrnul(tls, s, '=')) - int64(s)) / 1)
if !(l != 0) || !(int32(*(*int8)(unsafe.Pointer(s + uintptr(l)))) != 0) {
return Xunsetenv(tls, s)
}
@ -423,7 +423,7 @@ func X__env_rm_add(tls *TLS, old uintptr, new uintptr) { /* setenv.c:5:6: */
*(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*8)) = new
Xfree(tls, old)
return
} else if !(int32(*(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*8))) != 0) && (new != 0) {
} else if !(int32(*(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*8))) != 0) && new != 0 {
*(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*8)) = new
new = uintptr(0)
}
@ -431,11 +431,11 @@ func X__env_rm_add(tls *TLS, old uintptr, new uintptr) { /* setenv.c:5:6: */
if !(new != 0) {
return
}
var t uintptr = Xrealloc(tls, _senv_alloced, (uint64(unsafe.Sizeof(uintptr(0))) * (_senv_alloced_n + uint64(1))))
var t uintptr = Xrealloc(tls, _senv_alloced, uint64(unsafe.Sizeof(uintptr(0)))*(_senv_alloced_n+uint64(1)))
if !(t != 0) {
return
}
*(*uintptr)(unsafe.Pointer((AssignPtrUintptr(uintptr(unsafe.Pointer(&_senv_alloced)), t)) + uintptr(PostIncUint64(&_senv_alloced_n, 1))*8)) = new
*(*uintptr)(unsafe.Pointer(AssignPtrUintptr(uintptr(unsafe.Pointer(&_senv_alloced)), t) + uintptr(PostIncUint64(&_senv_alloced_n, 1))*8)) = new
}
var _senv_alloced uintptr /* setenv.c:7:14: */
@ -446,29 +446,29 @@ func Xsetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /*
var l1 size_t
var l2 size_t
if (!(var1 != 0) || !(int32(AssignUint64(&l1, (size_t((int64(X__strchrnul(tls, var1, '='))-int64(var1))/1)))) != 0)) || (*(*int8)(unsafe.Pointer(var1 + uintptr(l1))) != 0) {
(*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 22
if !(var1 != 0) || !(int32(AssignUint64(&l1, size_t((int64(X__strchrnul(tls, var1, '='))-int64(var1))/1))) != 0) || *(*int8)(unsafe.Pointer(var1 + uintptr(l1))) != 0 {
*(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22
return -1
}
if !(overwrite != 0) && (Xgetenv(tls, var1) != 0) {
if !(overwrite != 0) && Xgetenv(tls, var1) != 0 {
return 0
}
l2 = Xstrlen(tls, value)
s = Xmalloc(tls, ((l1 + l2) + uint64(2)))
s = Xmalloc(tls, l1+l2+uint64(2))
if !(s != 0) {
return -1
}
Xmemcpy(tls, s, var1, l1)
*(*int8)(unsafe.Pointer(s + uintptr(l1))) = int8('=')
Xmemcpy(tls, ((s + uintptr(l1)) + uintptr(1)), value, (l2 + uint64(1)))
Xmemcpy(tls, s+uintptr(l1)+uintptr(1), value, l2+uint64(1))
return X__putenv(tls, s, l1, s)
}
func Xunsetenv(tls *TLS, name uintptr) int32 { /* unsetenv.c:9:5: */
var l size_t = (size_t((int64(X__strchrnul(tls, name, '=')) - int64(name)) / 1))
if !(l != 0) || (*(*int8)(unsafe.Pointer(name + uintptr(l))) != 0) {
(*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 22
var l size_t = size_t((int64(X__strchrnul(tls, name, '=')) - int64(name)) / 1)
if !(l != 0) || *(*int8)(unsafe.Pointer(name + uintptr(l))) != 0 {
*(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22
return -1
}
if Environ() != 0 {
@ -476,7 +476,7 @@ func Xunsetenv(tls *TLS, name uintptr) int32 { /* unsetenv.c:9:5: */
var eo uintptr = e
for ; *(*uintptr)(unsafe.Pointer(e)) != 0; e += 8 {
//TODO if (!strncmp(name, *e, l) && l[*e] == '=')
if !(Xstrncmp(tls, name, *(*uintptr)(unsafe.Pointer(e)), l) != 0) && (int32(*(*int8)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(e))) + uintptr(l)))) == '=') {
if !(Xstrncmp(tls, name, *(*uintptr)(unsafe.Pointer(e)), l) != 0) && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(e)) + uintptr(l)))) == '=' {
X__env_rm_add(tls, *(*uintptr)(unsafe.Pointer(e)), uintptr(0))
} else if eo != e {
*(*uintptr)(unsafe.Pointer(PostIncUintptr(&eo, 8))) = *(*uintptr)(unsafe.Pointer(e))
@ -924,7 +924,7 @@ func a_ctz_64(tls *TLS, x uint64_t) int32 { /* atomic_arch.h:112:19: */
}
func a_ctz_32(tls *TLS, x uint32_t) int32 { /* atomic.h:256:19: */
return int32(_sdebruijn32[(((x & -x) * uint32_t(0x076be629)) >> 27)])
return int32(_sdebruijn32[x&-x*uint32_t(0x076be629)>>27])
}
var _sdebruijn32 = [32]int8{
@ -951,35 +951,35 @@ func Xwcrtomb(tls *TLS, s uintptr, wc wchar_t, st uintptr) size_t { /* wcrtomb.c
if uint32(wc) < uint32(0x80) {
*(*int8)(unsafe.Pointer(s)) = int8(wc)
return uint64(1)
} else if (func() int32 {
if !(!(int32(*(*uintptr)(unsafe.Pointer(((*__pthread)(unsafe.Pointer(__pthread_self(tls))).locale /* &.cat */)))) != 0)) {
} else if func() int32 {
if !!(int32(*(*uintptr)(unsafe.Pointer((*__pthread)(unsafe.Pointer(__pthread_self(tls))).locale))) != 0) {
return 4
}
return 1
}()) == 1 {
if !(((uint32(wc)) - uint32(0xdf80)) < uint32(0x80)) {
(*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 84
}() == 1 {
if !(uint32(wc)-uint32(0xdf80) < uint32(0x80)) {
*(*int32)(unsafe.Pointer(X___errno_location(tls))) = 84
return Uint64FromInt32(-1)
}
*(*int8)(unsafe.Pointer(s)) = int8(wc)
return uint64(1)
} else if uint32(wc) < uint32(0x800) {
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = (int8(0xc0 | (int32(wc) >> 6)))
*(*int8)(unsafe.Pointer(s)) = (int8(0x80 | (int32(wc) & 0x3f)))
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0xc0 | int32(wc)>>6)
*(*int8)(unsafe.Pointer(s)) = int8(0x80 | int32(wc)&0x3f)
return uint64(2)
} else if (uint32(wc) < uint32(0xd800)) || ((uint32(wc) - uint32(0xe000)) < uint32(0x2000)) {
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = (int8(0xe0 | (int32(wc) >> 12)))
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = (int8(0x80 | ((int32(wc) >> 6) & 0x3f)))
*(*int8)(unsafe.Pointer(s)) = (int8(0x80 | (int32(wc) & 0x3f)))
} else if uint32(wc) < uint32(0xd800) || uint32(wc)-uint32(0xe000) < uint32(0x2000) {
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0xe0 | int32(wc)>>12)
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0x80 | int32(wc)>>6&0x3f)
*(*int8)(unsafe.Pointer(s)) = int8(0x80 | int32(wc)&0x3f)
return uint64(3)
} else if (uint32(wc) - uint32(0x10000)) < uint32(0x100000) {
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = (int8(0xf0 | (int32(wc) >> 18)))
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = (int8(0x80 | ((int32(wc) >> 12) & 0x3f)))
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = (int8(0x80 | ((int32(wc) >> 6) & 0x3f)))
*(*int8)(unsafe.Pointer(s)) = (int8(0x80 | (int32(wc) & 0x3f)))
} else if uint32(wc)-uint32(0x10000) < uint32(0x100000) {
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0xf0 | int32(wc)>>18)
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0x80 | int32(wc)>>12&0x3f)
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(0x80 | int32(wc)>>6&0x3f)
*(*int8)(unsafe.Pointer(s)) = int8(0x80 | int32(wc)&0x3f)
return uint64(4)
}
(*(*int32)(unsafe.Pointer(X___errno_location(tls)))) = 84
*(*int32)(unsafe.Pointer(X___errno_location(tls))) = 84
return Uint64FromInt32(-1)
}
@ -997,11 +997,11 @@ func Xwcsrtombs(tls *TLS, s uintptr, ws uintptr, n size_t, st uintptr) size_t {
ws2 = *(*uintptr)(unsafe.Pointer(ws))
for ; *(*wchar_t)(unsafe.Pointer(ws2)) != 0; ws2 += 2 {
if uint32(*(*wchar_t)(unsafe.Pointer(ws2))) >= 0x80 {
l = Xwcrtomb(tls, bp /* &buf[0] */, *(*wchar_t)(unsafe.Pointer(ws2)), uintptr(0))
if !((l + uint64(1)) != 0) {
l = Xwcrtomb(tls, bp, *(*wchar_t)(unsafe.Pointer(ws2)), uintptr(0))
if !(l+uint64(1) != 0) {
return Uint64FromInt32(-1)
}
n = n + (l)
n = n + l
} else {
n++
}
@ -1009,46 +1009,46 @@ func Xwcsrtombs(tls *TLS, s uintptr, ws uintptr, n size_t, st uintptr) size_t {
return n
}
for n >= uint64(4) {
if (uint32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws))))) - 1) >= 0x7f {
if uint32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))))-1 >= 0x7f {
if !(int32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws))))) != 0) {
*(*int8)(unsafe.Pointer(s)) = int8(0)
*(*uintptr)(unsafe.Pointer(ws)) = uintptr(0)
return (N - n)
return N - n
}
l = Xwcrtomb(tls, s, *(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))), uintptr(0))
if !((l + uint64(1)) != 0) {
if !(l+uint64(1) != 0) {
return Uint64FromInt32(-1)
}
s += uintptr(l)
n = n - (l)
n = n - l
} else {
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))))
n--
}
(*(*uintptr)(unsafe.Pointer(ws))) += 2
*(*uintptr)(unsafe.Pointer(ws)) += 2
}
for n != 0 {
if (uint32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws))))) - 1) >= 0x7f {
if uint32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))))-1 >= 0x7f {
if !(int32(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws))))) != 0) {
*(*int8)(unsafe.Pointer(s)) = int8(0)
*(*uintptr)(unsafe.Pointer(ws)) = uintptr(0)
return (N - n)
return N - n
}
l = Xwcrtomb(tls, bp /* &buf[0] */, *(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))), uintptr(0))
if !((l + uint64(1)) != 0) {
l = Xwcrtomb(tls, bp, *(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))), uintptr(0))
if !(l+uint64(1) != 0) {
return Uint64FromInt32(-1)
}
if l > n {
return (N - n)
return N - n
}
Xwcrtomb(tls, s, *(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))), uintptr(0))
s += uintptr(l)
n = n - (l)
n = n - l
} else {
*(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8(*(*wchar_t)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ws)))))
n--
}
(*(*uintptr)(unsafe.Pointer(ws))) += 2
*(*uintptr)(unsafe.Pointer(ws)) += 2
}
return N
}
@ -1059,7 +1059,7 @@ func Xwcstombs(tls *TLS, s uintptr, ws uintptr, n size_t) size_t { /* wcstombs.c
*(*uintptr)(unsafe.Pointer(bp)) = ws
//TODO return wcsrtombs(s, &(const wchar_t *){ws}, n, 0);
return Xwcsrtombs(tls, s, bp /* &ws */, n, uintptr(0))
return Xwcsrtombs(tls, s, bp, n, uintptr(0))
}
// Support signed or unsigned plain-char
@ -1074,28 +1074,28 @@ func Xwcstombs(tls *TLS, s uintptr, ws uintptr, n size_t) size_t { /* wcstombs.c
func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: */
c = int32(uint8(c))
if !(c != 0) {
return (s + uintptr(Xstrlen(tls, s)))
return s + uintptr(Xstrlen(tls, s))
}
var w uintptr
for ; (uint64(s) % (uint64(unsafe.Sizeof(size_t(0))))) != 0; s++ {
if !(int32(*(*int8)(unsafe.Pointer(s))) != 0) || (int32(*(*uint8)(unsafe.Pointer(s))) == c) {
for ; uint64(s)%uint64(unsafe.Sizeof(size_t(0))) != 0; s++ {
if !(int32(*(*int8)(unsafe.Pointer(s))) != 0) || int32(*(*uint8)(unsafe.Pointer(s))) == c {
return s
}
}
var k size_t = ((Uint64(Uint64FromInt32(-1)) / uint64(255)) * size_t(c))
for w = s; !(((((*(*uint64)(unsafe.Pointer(w))) - (Uint64(Uint64FromInt32(-1)) / uint64(255))) & ^(*(*uint64)(unsafe.Pointer(w)))) & ((Uint64(Uint64FromInt32(-1)) / uint64(255)) * (uint64((255 / 2) + 1)))) != 0) && !(((((*(*uint64)(unsafe.Pointer(w)) ^ k) - (Uint64(Uint64FromInt32(-1)) / uint64(255))) & ^(*(*uint64)(unsafe.Pointer(w)) ^ k)) & ((Uint64(Uint64FromInt32(-1)) / uint64(255)) * (uint64((255 / 2) + 1)))) != 0); w += 8 {
var k size_t = Uint64(Uint64FromInt32(-1)) / uint64(255) * size_t(c)
for w = s; !((*(*uint64)(unsafe.Pointer(w))-Uint64(Uint64FromInt32(-1))/uint64(255)) & ^*(*uint64)(unsafe.Pointer(w)) & (Uint64(Uint64FromInt32(-1))/uint64(255)*uint64(255/2+1)) != 0) && !((*(*uint64)(unsafe.Pointer(w))^k-Uint64(Uint64FromInt32(-1))/uint64(255)) & ^(*(*uint64)(unsafe.Pointer(w))^k) & (Uint64(Uint64FromInt32(-1))/uint64(255)*uint64(255/2+1)) != 0); w += 8 {
}
s = w
for ; (*(*int8)(unsafe.Pointer(s)) != 0) && (int32(*(*uint8)(unsafe.Pointer(s))) != c); s++ {
for ; *(*int8)(unsafe.Pointer(s)) != 0 && int32(*(*uint8)(unsafe.Pointer(s))) != c; s++ {
}
return s
}
func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */
var l size_t = Xstrlen(tls, s)
var d uintptr = Xmalloc(tls, (l + uint64(1)))
var d uintptr = Xmalloc(tls, l+uint64(1))
if !(d != 0) {
return uintptr(0)
}
return Xmemcpy(tls, d, s, (l + uint64(1)))
return Xmemcpy(tls, d, s, l+uint64(1))
}

View file

@ -299,6 +299,7 @@ const (
IPV6CTL_STATS = 6
IPV6CTL_TEMPPLTIME = 33
IPV6CTL_TEMPVLTIME = 34
IPV6CTL_ULA_USETEMPADDR = 51
IPV6CTL_USETEMPADDR = 32
IPV6CTL_USE_DEFAULTZONE = 39
IPV6CTL_USE_DEPRECATED = 21
@ -431,9 +432,9 @@ const (
KEV_DL_LINK_ON = 13
KEV_DL_LINK_QUALITY_METRIC_CHANGED = 20
KEV_DL_LOW_POWER_MODE_CHANGED = 30
KEV_DL_MASTER_ELECTED = 23
KEV_DL_NODE_ABSENCE = 22
KEV_DL_NODE_PRESENCE = 21
KEV_DL_PRIMARY_ELECTED = 23
KEV_DL_PROTO_ATTACHED = 14
KEV_DL_PROTO_DETACHED = 15
KEV_DL_QOS_MODE_CHANGED = 29
@ -467,6 +468,7 @@ const (
KEV_INET_SUBCLASS = 1
LITTLE_ENDIAN = 1234
MAC_OS_VERSION_11_0 = 110000
MAC_OS_VERSION_12_0 = 120000
MAC_OS_X_VERSION_10_0 = 1000
MAC_OS_X_VERSION_10_1 = 1010
MAC_OS_X_VERSION_10_10 = 101000
@ -689,6 +691,7 @@ const (
WINT_MAX = 2147483647
WINT_MIN = -2147483648
X_ARM_ARCH_H = 0
X_ARM_MACHTYPES_H_ = 0
X_ARM__ENDIAN_H_ = 0
X_ARM__PARAM_H_ = 0
X_BLKCNT_T = 0
@ -696,6 +699,7 @@ const (
X_BSD_ARM__TYPES_H_ = 0
X_BSD_MACHINE_ENDIAN_H_ = 0
X_BSD_MACHINE_TYPES_H_ = 0
X_BSD_MACHINE__PARAM_H_ = 0
X_BSD_MACHINE__TYPES_H_ = 0
X_CADDR_T = 0
X_CDEFS_H_ = 0
@ -1011,6 +1015,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -1325,17 +1335,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -1353,33 +1363,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system
@ -1950,7 +1960,7 @@ type U_int32_t = uint32 /* _u_int32_t.h:30:33 */
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type U_int64_t = uint64 /* _u_int64_t.h:30:33 */
type Register_t = Int64_t /* types.h:63:33 */
type Register_t = Int64_t /* types.h:66:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -2030,19 +2040,20 @@ type Intptr_t = X__darwin_intptr_t /* _intptr_t.h:32:33 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type Uintptr_t = uint64 /* _uintptr_t.h:30:33 */
type Uintptr_t = uint64 /* _uintptr_t.h:34:33 */
// These types are used for reserving the largest possible size.
type User_addr_t = U_int64_t /* types.h:74:33 */
type User_size_t = U_int64_t /* types.h:75:33 */
type User_ssize_t = Int64_t /* types.h:76:33 */
type User_long_t = Int64_t /* types.h:77:33 */
type User_ulong_t = U_int64_t /* types.h:78:33 */
type User_time_t = Int64_t /* types.h:79:33 */
type User_off_t = Int64_t /* types.h:80:33 */
type User_addr_t = U_int64_t /* types.h:77:33 */
type User_size_t = U_int64_t /* types.h:78:33 */
type User_ssize_t = Int64_t /* types.h:79:33 */
type User_long_t = Int64_t /* types.h:80:33 */
type User_ulong_t = U_int64_t /* types.h:81:33 */
type User_time_t = Int64_t /* types.h:82:33 */
type User_off_t = Int64_t /* types.h:83:33 */
// This defines the size of syscall arguments after copying into the kernel:
type Syscall_arg_t = U_int64_t /* types.h:101:33 */
type Syscall_arg_t = U_int64_t /* types.h:104:33 */
type Socklen_t = X__darwin_socklen_t /* _socklen_t.h:31:33 */
@ -2050,7 +2061,7 @@ type Socklen_t = X__darwin_socklen_t /* _socklen_t.h:31:33 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdint.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/stdint.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -2699,7 +2710,7 @@ type Uintmax_t = uint64 /* _uintmax_t.h:32:26 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/AvailabilityInternal.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -5160,6 +5171,7 @@ type Fsfilcnt_t = X__darwin_fsfilcnt_t /* _fsfilcnt_t.h:31:41 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
// Copyright (c) 2006-2007 Apple Inc. All rights reserved.
// Copyright (c) 2000-2007 Apple Inc. All rights reserved.
@ -5497,6 +5509,8 @@ type Iovec = struct {
// Additional options, not kept in so_options.
// When adding new socket-options, you need to make sure MPTCP supports these as well!
// Network Service Type for option SO_NET_SERVICE_TYPE
//
// The vast majority of sockets should use Best Effort that is the default
@ -5580,9 +5594,9 @@ type Iovec = struct {
// These are supported values for SO_NETSVC_MARKING_LEVEL
type Sae_associd_t = X__uint32_t /* socket.h:289:20 */
type Sae_associd_t = X__uint32_t /* socket.h:293:20 */
type Sae_connid_t = X__uint32_t /* socket.h:293:20 */
type Sae_connid_t = X__uint32_t /* socket.h:297:20 */
// connectx() flag parameters
@ -5596,7 +5610,7 @@ type Sa_endpoints = struct {
Fsae_dstaddr uintptr
Fsae_dstaddrlen Socklen_t
F__ccgo_pad3 [4]byte
} /* socket.h:303:9 */
} /* socket.h:307:9 */
// connectx() flag parameters
@ -5605,31 +5619,31 @@ type Sockaddr = struct {
Fsa_len X__uint8_t
Fsa_family Sa_family_t
Fsa_data [14]int8
} /* socket.h:303:9 */
} /* socket.h:307:9 */
// connectx() flag parameters
// sockaddr endpoints
type Sa_endpoints_t = Sa_endpoints /* socket.h:309:3 */
type Sa_endpoints_t = Sa_endpoints /* socket.h:313:3 */
// Structure used for manipulating linger option.
type Linger = struct {
Fl_onoff int32
Fl_linger int32
} /* socket.h:315:1 */
} /* socket.h:319:1 */
// Structure to control non-portable Sockets extension to POSIX
type So_np_extensions = struct {
Fnpx_flags U_int32_t
Fnpx_mask U_int32_t
} /* socket.h:333:1 */
} /* socket.h:337:1 */
// Structure used by kernel to pass protocol
// information in raw sockets.
type Sockproto = struct {
Fsp_family X__uint16_t
Fsp_protocol X__uint16_t
} /* socket.h:421:1 */
} /* socket.h:425:1 */
// RFC 2553: protocol-independent placeholder for socket addresses
@ -5640,7 +5654,7 @@ type Sockaddr_storage = struct {
F__ss_pad1 [6]int8
F__ss_align X__int64_t
F__ss_pad2 [112]int8
} /* socket.h:441:1 */
} /* socket.h:445:1 */
// Protocol families, same as address families for now.
@ -5676,7 +5690,7 @@ type Msghdr = struct {
Fmsg_control uintptr
Fmsg_controllen Socklen_t
Fmsg_flags int32
} /* socket.h:548:1 */
} /* socket.h:552:1 */
// Header for ancillary data objects in msg_control buffer.
// Used for additional information with/about a datagram
@ -5686,7 +5700,7 @@ type Cmsghdr = struct {
Fcmsg_len Socklen_t
Fcmsg_level int32
Fcmsg_type int32
} /* socket.h:596:1 */
} /* socket.h:600:1 */
// given pointer to struct cmsghdr, return pointer to data
@ -5710,7 +5724,7 @@ type Sf_hdtr = struct {
Ftrailers uintptr
Ftrl_cnt int32
F__ccgo_pad2 [4]byte
} /* socket.h:687:1 */
} /* socket.h:691:1 */
// The following two #includes insure htonl and family are defined
// Copyright (c) 2000-2007 Apple Inc. All rights reserved.
@ -6241,8 +6255,8 @@ type In_pktinfo = struct {
// IPv6 address
type In6_addr = struct {
F__u6_addr struct {
_ [0]uint32
F__u6_addr8 [16]X__uint8_t
F__ccgo_pad1 [0]uint32
F__u6_addr8 [16]X__uint8_t
}
} /* in6.h:152:9 */
@ -6459,8 +6473,8 @@ type Sockaddr_in6 = struct {
Fsin6_flowinfo X__uint32_t
Fsin6_addr struct {
F__u6_addr struct {
_ [0]uint32
F__u6_addr8 [16]X__uint8_t
F__ccgo_pad1 [0]uint32
F__u6_addr8 [16]X__uint8_t
}
}
Fsin6_scope_id X__uint32_t
@ -6536,8 +6550,8 @@ type Sockaddr_in6 = struct {
type Ipv6_mreq = struct {
Fipv6mr_multiaddr struct {
F__u6_addr struct {
_ [0]uint32
F__u6_addr8 [16]X__uint8_t
F__ccgo_pad1 [0]uint32
F__u6_addr8 [16]X__uint8_t
}
}
Fipv6mr_interface uint32
@ -6547,8 +6561,8 @@ type Ipv6_mreq = struct {
type In6_pktinfo = struct {
Fipi6_addr struct {
F__u6_addr struct {
_ [0]uint32
F__u6_addr8 [16]X__uint8_t
F__ccgo_pad1 [0]uint32
F__u6_addr8 [16]X__uint8_t
}
}
Fipi6_ifindex uint32
@ -6563,8 +6577,8 @@ type Ip6_mtuinfo = struct {
Fsin6_flowinfo X__uint32_t
Fsin6_addr struct {
F__u6_addr struct {
_ [0]uint32
F__u6_addr8 [16]X__uint8_t
F__ccgo_pad1 [0]uint32
F__u6_addr8 [16]X__uint8_t
}
}
Fsin6_scope_id X__uint32_t

View file

@ -272,6 +272,7 @@ const (
IPV6CTL_STATS = 6
IPV6CTL_TEMPPLTIME = 33
IPV6CTL_TEMPVLTIME = 34
IPV6CTL_ULA_USETEMPADDR = 51
IPV6CTL_USETEMPADDR = 32
IPV6CTL_USE_DEFAULTZONE = 39
IPV6CTL_USE_DEPRECATED = 21
@ -404,9 +405,9 @@ const (
KEV_DL_LINK_ON = 13
KEV_DL_LINK_QUALITY_METRIC_CHANGED = 20
KEV_DL_LOW_POWER_MODE_CHANGED = 30
KEV_DL_MASTER_ELECTED = 23
KEV_DL_NODE_ABSENCE = 22
KEV_DL_NODE_PRESENCE = 21
KEV_DL_PRIMARY_ELECTED = 23
KEV_DL_PROTO_ATTACHED = 14
KEV_DL_PROTO_DETACHED = 15
KEV_DL_QOS_MODE_CHANGED = 29
@ -440,6 +441,7 @@ const (
KEV_INET_SUBCLASS = 1
LITTLE_ENDIAN = 1234
MAC_OS_VERSION_11_0 = 110000
MAC_OS_VERSION_12_0 = 120000
MAC_OS_X_VERSION_10_0 = 1000
MAC_OS_X_VERSION_10_1 = 1010
MAC_OS_X_VERSION_10_10 = 101000
@ -646,6 +648,7 @@ const (
WINT_MAX = 2147483647
WINT_MIN = -2147483648
X_ARM_ARCH_H = 0
X_ARM_MACHTYPES_H_ = 0
X_ARM__ENDIAN_H_ = 0
X_ARM__PARAM_H_ = 0
X_BLKCNT_T = 0
@ -653,6 +656,7 @@ const (
X_BSD_ARM__TYPES_H_ = 0
X_BSD_MACHINE_ENDIAN_H_ = 0
X_BSD_MACHINE_TYPES_H_ = 0
X_BSD_MACHINE__PARAM_H_ = 0
X_BSD_MACHINE__TYPES_H_ = 0
X_CADDR_T = 0
X_CDEFS_H_ = 0
@ -853,7 +857,7 @@ type X__float128 = float64 /* <builtin>:47:21 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdint.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/stdint.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -1200,6 +1204,12 @@ type Uint_fast64_t = Uint64_t /* stdint.h:56:25 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -1514,17 +1524,17 @@ type Uint_fast64_t = Uint64_t /* stdint.h:56:25 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -1542,33 +1552,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system
@ -2106,7 +2116,7 @@ type U_int32_t = uint32 /* _u_int32_t.h:30:33 */
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type U_int64_t = uint64 /* _u_int64_t.h:30:33 */
type Register_t = Int64_t /* types.h:63:33 */
type Register_t = Int64_t /* types.h:66:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -2158,19 +2168,20 @@ type Register_t = Int64_t /* types.h:63:33 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type Uintptr_t = uint64 /* _uintptr_t.h:30:33 */
type Uintptr_t = uint64 /* _uintptr_t.h:34:33 */
// These types are used for reserving the largest possible size.
type User_addr_t = U_int64_t /* types.h:74:33 */
type User_size_t = U_int64_t /* types.h:75:33 */
type User_ssize_t = Int64_t /* types.h:76:33 */
type User_long_t = Int64_t /* types.h:77:33 */
type User_ulong_t = U_int64_t /* types.h:78:33 */
type User_time_t = Int64_t /* types.h:79:33 */
type User_off_t = Int64_t /* types.h:80:33 */
type User_addr_t = U_int64_t /* types.h:77:33 */
type User_size_t = U_int64_t /* types.h:78:33 */
type User_ssize_t = Int64_t /* types.h:79:33 */
type User_long_t = Int64_t /* types.h:80:33 */
type User_ulong_t = U_int64_t /* types.h:81:33 */
type User_time_t = Int64_t /* types.h:82:33 */
type User_off_t = Int64_t /* types.h:83:33 */
// This defines the size of syscall arguments after copying into the kernel:
type Syscall_arg_t = U_int64_t /* types.h:101:33 */
type Syscall_arg_t = U_int64_t /* types.h:104:33 */
type Intptr_t = X__darwin_intptr_t /* _intptr_t.h:32:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
@ -2443,7 +2454,7 @@ type Uintmax_t = uint64 /* _uintmax_t.h:32:26 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/AvailabilityInternal.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -4879,6 +4890,7 @@ type Fsfilcnt_t = X__darwin_fsfilcnt_t /* _fsfilcnt_t.h:31:41 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
// Copyright (c) 2006-2007 Apple Inc. All rights reserved.
// Copyright (c) 2000-2007 Apple Inc. All rights reserved.
@ -5243,6 +5255,8 @@ type Iovec = struct {
// Additional options, not kept in so_options.
// When adding new socket-options, you need to make sure MPTCP supports these as well!
// Network Service Type for option SO_NET_SERVICE_TYPE
//
// The vast majority of sockets should use Best Effort that is the default
@ -5326,9 +5340,9 @@ type Iovec = struct {
// These are supported values for SO_NETSVC_MARKING_LEVEL
type Sae_associd_t = X__uint32_t /* socket.h:289:20 */
type Sae_associd_t = X__uint32_t /* socket.h:293:20 */
type Sae_connid_t = X__uint32_t /* socket.h:293:20 */
type Sae_connid_t = X__uint32_t /* socket.h:297:20 */
// connectx() flag parameters
@ -5342,7 +5356,7 @@ type Sa_endpoints = struct {
Fsae_dstaddr uintptr
Fsae_dstaddrlen Socklen_t
F__ccgo_pad3 [4]byte
} /* socket.h:303:9 */
} /* socket.h:307:9 */
// connectx() flag parameters
@ -5351,31 +5365,31 @@ type Sockaddr = struct {
Fsa_len X__uint8_t
Fsa_family Sa_family_t
Fsa_data [14]int8
} /* socket.h:303:9 */
} /* socket.h:307:9 */
// connectx() flag parameters
// sockaddr endpoints
type Sa_endpoints_t = Sa_endpoints /* socket.h:309:3 */
type Sa_endpoints_t = Sa_endpoints /* socket.h:313:3 */
// Structure used for manipulating linger option.
type Linger = struct {
Fl_onoff int32
Fl_linger int32
} /* socket.h:315:1 */
} /* socket.h:319:1 */
// Structure to control non-portable Sockets extension to POSIX
type So_np_extensions = struct {
Fnpx_flags U_int32_t
Fnpx_mask U_int32_t
} /* socket.h:333:1 */
} /* socket.h:337:1 */
// Structure used by kernel to pass protocol
// information in raw sockets.
type Sockproto = struct {
Fsp_family X__uint16_t
Fsp_protocol X__uint16_t
} /* socket.h:421:1 */
} /* socket.h:425:1 */
// RFC 2553: protocol-independent placeholder for socket addresses
@ -5386,7 +5400,7 @@ type Sockaddr_storage = struct {
F__ss_pad1 [6]int8
F__ss_align X__int64_t
F__ss_pad2 [112]int8
} /* socket.h:441:1 */
} /* socket.h:445:1 */
// Protocol families, same as address families for now.
@ -5422,7 +5436,7 @@ type Msghdr = struct {
Fmsg_control uintptr
Fmsg_controllen Socklen_t
Fmsg_flags int32
} /* socket.h:548:1 */
} /* socket.h:552:1 */
// Header for ancillary data objects in msg_control buffer.
// Used for additional information with/about a datagram
@ -5432,7 +5446,7 @@ type Cmsghdr = struct {
Fcmsg_len Socklen_t
Fcmsg_level int32
Fcmsg_type int32
} /* socket.h:596:1 */
} /* socket.h:600:1 */
// given pointer to struct cmsghdr, return pointer to data
@ -5456,7 +5470,7 @@ type Sf_hdtr = struct {
Ftrailers uintptr
Ftrl_cnt int32
F__ccgo_pad2 [4]byte
} /* socket.h:687:1 */
} /* socket.h:691:1 */
// The following two #includes insure htonl and family are defined
// Copyright (c) 2000-2007 Apple Inc. All rights reserved.
@ -5987,8 +6001,8 @@ type In_pktinfo = struct {
// IPv6 address
type In6_addr = struct {
F__u6_addr struct {
_ [0]uint32
F__u6_addr8 [16]X__uint8_t
F__ccgo_pad1 [0]uint32
F__u6_addr8 [16]X__uint8_t
}
} /* in6.h:152:9 */
@ -6205,8 +6219,8 @@ type Sockaddr_in6 = struct {
Fsin6_flowinfo X__uint32_t
Fsin6_addr struct {
F__u6_addr struct {
_ [0]uint32
F__u6_addr8 [16]X__uint8_t
F__ccgo_pad1 [0]uint32
F__u6_addr8 [16]X__uint8_t
}
}
Fsin6_scope_id X__uint32_t
@ -6282,8 +6296,8 @@ type Sockaddr_in6 = struct {
type Ipv6_mreq = struct {
Fipv6mr_multiaddr struct {
F__u6_addr struct {
_ [0]uint32
F__u6_addr8 [16]X__uint8_t
F__ccgo_pad1 [0]uint32
F__u6_addr8 [16]X__uint8_t
}
}
Fipv6mr_interface uint32
@ -6293,8 +6307,8 @@ type Ipv6_mreq = struct {
type In6_pktinfo = struct {
Fipi6_addr struct {
F__u6_addr struct {
_ [0]uint32
F__u6_addr8 [16]X__uint8_t
F__ccgo_pad1 [0]uint32
F__u6_addr8 [16]X__uint8_t
}
}
Fipi6_ifindex uint32
@ -6309,8 +6323,8 @@ type Ip6_mtuinfo = struct {
Fsin6_flowinfo X__uint32_t
Fsin6_addr struct {
F__u6_addr struct {
_ [0]uint32
F__u6_addr8 [16]X__uint8_t
F__ccgo_pad1 [0]uint32
F__u6_addr8 [16]X__uint8_t
}
}
Fsin6_scope_id X__uint32_t

View file

@ -17,6 +17,7 @@ var _ unsafe.Pointer
const (
CLOCKS_PER_SEC = 1000000
MAC_OS_VERSION_11_0 = 110000
MAC_OS_VERSION_12_0 = 120000
MAC_OS_X_VERSION_10_0 = 1000
MAC_OS_X_VERSION_10_1 = 1010
MAC_OS_X_VERSION_10_10 = 101000
@ -75,6 +76,7 @@ const (
SCHED_OTHER = 1
SCHED_RR = 2
TIME_UTC = 1
X_ARM_MACHTYPES_H_ = 0
X_BSD_ARM__TYPES_H_ = 0
X_BSD_MACHINE_TYPES_H_ = 0
X_BSD_MACHINE__TYPES_H_ = 0
@ -675,6 +677,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -989,17 +997,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -1017,33 +1025,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system
@ -1666,7 +1674,7 @@ type Sched_param = struct {
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/AvailabilityInternal.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -2114,7 +2122,7 @@ type U_int32_t = uint32 /* _u_int32_t.h:30:33 */
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type U_int64_t = uint64 /* _u_int64_t.h:30:33 */
type Register_t = Int64_t /* types.h:63:33 */
type Register_t = Int64_t /* types.h:66:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -2194,19 +2202,20 @@ type Intptr_t = X__darwin_intptr_t /* _intptr_t.h:32:33 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type Uintptr_t = uint64 /* _uintptr_t.h:30:33 */
type Uintptr_t = uint64 /* _uintptr_t.h:34:33 */
// These types are used for reserving the largest possible size.
type User_addr_t = U_int64_t /* types.h:74:33 */
type User_size_t = U_int64_t /* types.h:75:33 */
type User_ssize_t = Int64_t /* types.h:76:33 */
type User_long_t = Int64_t /* types.h:77:33 */
type User_ulong_t = U_int64_t /* types.h:78:33 */
type User_time_t = Int64_t /* types.h:79:33 */
type User_off_t = Int64_t /* types.h:80:33 */
type User_addr_t = U_int64_t /* types.h:77:33 */
type User_size_t = U_int64_t /* types.h:78:33 */
type User_ssize_t = Int64_t /* types.h:79:33 */
type User_long_t = Int64_t /* types.h:80:33 */
type User_ulong_t = U_int64_t /* types.h:81:33 */
type User_time_t = Int64_t /* types.h:82:33 */
type User_off_t = Int64_t /* types.h:83:33 */
// This defines the size of syscall arguments after copying into the kernel:
type Syscall_arg_t = U_int64_t /* types.h:101:33 */
type Syscall_arg_t = U_int64_t /* types.h:104:33 */
type Clock_t = X__darwin_clock_t /* _clock_t.h:31:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
@ -3028,4 +3037,19 @@ type Mach_port_t = X__darwin_mach_port_t /* _mach_port_t.h:50:30 */
type Sigset_t = X__darwin_sigset_t /* _sigset_t.h:31:41 */
// !
// @typedef pthread_jit_write_callback_t
// The type of a function that can be supplied to {@link
// pthread_jit_write_with_callback_np} to write to the MAP_JIT region while it
// is writeable.
//
// @param ctx
// A pointer to context that will be passed through to the callback function.
//
// @result
// A result code to be returned to the caller of @{link
// pthread_jit_write_with_callback_np}. The system does not interpret/act on
// the value of this result.
type Pthread_jit_write_callback_t = uintptr /* pthread.h:581:13 */
var _ int8 /* gen.c:2:13: */

View file

@ -242,6 +242,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -556,17 +562,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -584,33 +590,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system

View file

@ -45,6 +45,7 @@ const (
ILL_PRVOPC = 3
ILL_PRVREG = 6
MAC_OS_VERSION_11_0 = 110000
MAC_OS_VERSION_12_0 = 120000
MAC_OS_X_VERSION_10_0 = 1000
MAC_OS_X_VERSION_10_1 = 1010
MAC_OS_X_VERSION_10_10 = 101000
@ -152,10 +153,12 @@ const (
SV_SIGINFO = 64
TRAP_BRKPT = 1
TRAP_TRACE = 2
X_ARM_MACHTYPES_H_ = 0
X_ARM_SIGNAL_ = 1
X_BSD_ARM__TYPES_H_ = 0
X_BSD_MACHINE_SIGNAL_H_ = 0
X_BSD_MACHINE_TYPES_H_ = 0
X_BSD_MACHINE__MCONTEXT_H_ = 0
X_BSD_MACHINE__TYPES_H_ = 0
X_CDEFS_H_ = 0
X_DARWIN_FEATURE_64_BIT_INODE = 1
@ -341,6 +344,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -764,17 +773,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -792,33 +801,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system
@ -1334,7 +1343,7 @@ type X__darwin_wctype_t = X__uint32_t /* _types.h:43:20 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/AvailabilityInternal.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -1512,7 +1521,7 @@ type X__darwin_wctype_t = X__uint32_t /* _types.h:43:20 */
//
// @(#)cdefs.h 8.8 (Berkeley) 1/9/95
type Sig_atomic_t = int32 /* signal.h:15:13 */
type Sig_atomic_t = int32 /* signal.h:17:13 */
// Language spec sez we must list exactly one parameter, even though we
// actually supply three. Ugh!
@ -1569,6 +1578,7 @@ type Sig_atomic_t = int32 /* signal.h:15:13 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_START@
@ -2135,7 +2145,7 @@ type U_int32_t = uint32 /* _u_int32_t.h:30:33 */
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type U_int64_t = uint64 /* _u_int64_t.h:30:33 */
type Register_t = Int64_t /* types.h:63:33 */
type Register_t = Int64_t /* types.h:66:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -2215,31 +2225,32 @@ type Intptr_t = X__darwin_intptr_t /* _intptr_t.h:32:33 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type Uintptr_t = uint64 /* _uintptr_t.h:30:33 */
type Uintptr_t = uint64 /* _uintptr_t.h:34:33 */
// These types are used for reserving the largest possible size.
type User_addr_t = U_int64_t /* types.h:74:33 */
type User_size_t = U_int64_t /* types.h:75:33 */
type User_ssize_t = Int64_t /* types.h:76:33 */
type User_long_t = Int64_t /* types.h:77:33 */
type User_ulong_t = U_int64_t /* types.h:78:33 */
type User_time_t = Int64_t /* types.h:79:33 */
type User_off_t = Int64_t /* types.h:80:33 */
type User_addr_t = U_int64_t /* types.h:77:33 */
type User_size_t = U_int64_t /* types.h:78:33 */
type User_ssize_t = Int64_t /* types.h:79:33 */
type User_long_t = Int64_t /* types.h:80:33 */
type User_ulong_t = U_int64_t /* types.h:81:33 */
type User_time_t = Int64_t /* types.h:82:33 */
type User_off_t = Int64_t /* types.h:83:33 */
// This defines the size of syscall arguments after copying into the kernel:
type Syscall_arg_t = U_int64_t /* types.h:101:33 */
type Syscall_arg_t = U_int64_t /* types.h:104:33 */
type X__darwin_arm_exception_state = struct {
F__exception X__uint32_t
F__fsr X__uint32_t
F__far X__uint32_t
} /* _structs.h:39:1 */
} /* _structs.h:41:1 */
type X__darwin_arm_exception_state64 = struct {
F__far X__uint64_t
F__esr X__uint32_t
F__exception X__uint32_t
} /* _structs.h:57:1 */
} /* _structs.h:59:1 */
type X__darwin_arm_thread_state = struct {
F__r [13]X__uint32_t
@ -2247,7 +2258,7 @@ type X__darwin_arm_thread_state = struct {
F__lr X__uint32_t
F__pc X__uint32_t
F__cpsr X__uint32_t
} /* _structs.h:75:1 */
} /* _structs.h:77:1 */
// By default, the pointer fields in the arm_thread_state64_t structure are
// opaque on the arm64e architecture and require the use of accessor macros.
@ -2262,7 +2273,7 @@ type X__darwin_arm_thread_state64 = struct {
F__pc X__uint64_t
F__cpsr X__uint32_t
F__pad X__uint32_t
} /* _structs.h:134:1 */
} /* _structs.h:136:1 */
// Accessor macros for arm_thread_state64_t pointer fields
@ -2281,29 +2292,21 @@ type X__darwin_arm_thread_state64 = struct {
type X__darwin_arm_vfp_state = struct {
F__r [64]X__uint32_t
F__fpscr X__uint32_t
} /* _structs.h:422:1 */
} /* _structs.h:424:1 */
type X__darwin_arm_neon_state64 = struct {
F__v [32]X__uint128_t
F__fpsr X__uint32_t
F__fpcr X__uint32_t
} /* _structs.h:441:1 */
} /* _structs.h:443:1 */
type X__darwin_arm_neon_state = struct {
F__v [16]X__uint128_t
F__fpsr X__uint32_t
F__fpcr X__uint32_t
} /* _structs.h:448:1 */
} /* _structs.h:450:1 */
type X__darwin_arm_amx_state_v1 = struct {
F__ccgo_pad1 [0]uint64
F__x [8][64]X__uint8_t
F__y [8][64]X__uint8_t
F__z [64][64]X__uint8_t
F__amx_state_t_el1 X__uint64_t
} /* _structs.h:512:1 */
type X__arm_pagein_state = struct{ F__pagein_error int32 } /* _structs.h:531:1 */
type X__arm_pagein_state = struct{ F__pagein_error int32 } /* _structs.h:514:1 */
// Debug State
@ -2314,7 +2317,7 @@ type X__arm_legacy_debug_state = struct {
F__bcr [16]X__uint32_t
F__wvr [16]X__uint32_t
F__wcr [16]X__uint32_t
} /* _structs.h:568:1 */
} /* _structs.h:551:1 */
type X__darwin_arm_debug_state32 = struct {
F__bvr [16]X__uint32_t
@ -2322,7 +2325,7 @@ type X__darwin_arm_debug_state32 = struct {
F__wvr [16]X__uint32_t
F__wcr [16]X__uint32_t
F__mdscr_el1 X__uint64_t
} /* _structs.h:591:1 */
} /* _structs.h:574:1 */
type X__darwin_arm_debug_state64 = struct {
F__bvr [16]X__uint64_t
@ -2330,9 +2333,9 @@ type X__darwin_arm_debug_state64 = struct {
F__wvr [16]X__uint64_t
F__wcr [16]X__uint64_t
F__mdscr_el1 X__uint64_t
} /* _structs.h:601:1 */
} /* _structs.h:584:1 */
type X__darwin_arm_cpmu_state64 = struct{ F__ctrs [16]X__uint64_t } /* _structs.h:633:1 */
type X__darwin_arm_cpmu_state64 = struct{ F__ctrs [16]X__uint64_t } /* _structs.h:616:1 */
type X__darwin_mcontext32 = struct {
F__es struct {
@ -2351,7 +2354,7 @@ type X__darwin_mcontext32 = struct {
F__r [64]X__uint32_t
F__fpscr X__uint32_t
}
} /* _mcontext.h:39:1 */
} /* _mcontext.h:41:1 */
type X__darwin_mcontext64 = struct {
F__es struct {
@ -2373,9 +2376,9 @@ type X__darwin_mcontext64 = struct {
F__fpsr X__uint32_t
F__fpcr X__uint32_t
}
} /* _mcontext.h:62:1 */
} /* _mcontext.h:64:1 */
type Mcontext_t = uintptr /* _mcontext.h:83:33 */
type Mcontext_t = uintptr /* _mcontext.h:85:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -2695,32 +2698,6 @@ type Stack_t = X__darwin_sigaltstack /* _sigaltstack.h:48:33 */ // [???] signal
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_START@
//
// This file contains Original Code and/or Modifications of Original Code
// as defined in and that are subject to the Apple Public Source License
// Version 2.0 (the 'License'). You may not use this file except in
// compliance with the License. The rights granted to you under the License
// may not be used to create, or enable the creation or redistribution of,
// unlawful or unlicensed copies of an Apple operating system, or to
// circumvent, violate, or enable the circumvention or violation of, any
// terms of an Apple operating system software license agreement.
//
// Please obtain a copy of the License at
// http://www.opensource.apple.com/apsl/ and read it before using this file.
//
// The Original Code and all software distributed under the License are
// distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
// EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
// INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
// Please see the License for the specific language governing rights and
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
// Copyright (c) 2003-2007 Apple Inc. All rights reserved.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_START@
@ -2950,18 +2927,18 @@ type Sigset_t = X__darwin_sigset_t /* _sigset_t.h:31:41 */
type Uid_t = X__darwin_uid_t /* _uid_t.h:31:31 */
type Sigval = struct {
_ [0]uint64
Fsival_int int32
_ [4]byte
F__ccgo_pad1 [0]uint64
Fsival_int int32
F__ccgo_pad2 [4]byte
} /* signal.h:158:1 */
type Sigevent = struct {
Fsigev_notify int32
Fsigev_signo int32
Fsigev_value struct {
_ [0]uint64
Fsival_int int32
_ [4]byte
F__ccgo_pad1 [0]uint64
Fsival_int int32
F__ccgo_pad2 [4]byte
}
Fsigev_notify_function uintptr
Fsigev_notify_attributes uintptr
@ -2976,9 +2953,9 @@ type X__siginfo = struct {
Fsi_status int32
Fsi_addr uintptr
Fsi_value struct {
_ [0]uint64
Fsival_int int32
_ [4]byte
F__ccgo_pad1 [0]uint64
Fsival_int int32
F__ccgo_pad2 [4]byte
}
Fsi_band int64
F__pad [7]uint64

View file

@ -23,6 +23,7 @@ const (
L_ctermid = 1024
L_tmpnam = 1024
MAC_OS_VERSION_11_0 = 110000
MAC_OS_VERSION_12_0 = 120000
MAC_OS_X_VERSION_10_0 = 1000
MAC_OS_X_VERSION_10_1 = 1010
MAC_OS_X_VERSION_10_10 = 101000
@ -63,6 +64,7 @@ const (
SEEK_END = 2
SEEK_SET = 0
TMP_MAX = 308915776
X_ARM_MACHTYPES_H_ = 0
X_BSD_ARM__TYPES_H_ = 0
X_BSD_MACHINE_TYPES_H_ = 0
X_BSD_MACHINE__TYPES_H_ = 0
@ -129,7 +131,7 @@ type X__float128 = float64 /* <builtin>:47:21 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/stdio.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -356,6 +358,12 @@ type X__gnuc_va_list = X__builtin_va_list /* stdarg.h:40:27 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -793,7 +801,7 @@ type X__gnuc_va_list = X__builtin_va_list /* stdarg.h:40:27 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/AvailabilityInternal.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -1019,17 +1027,17 @@ type X__gnuc_va_list = X__builtin_va_list /* stdarg.h:40:27 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -1047,33 +1055,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system
@ -1648,7 +1656,7 @@ type U_int32_t = uint32 /* _u_int32_t.h:30:33 */
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type U_int64_t = uint64 /* _u_int64_t.h:30:33 */
type Register_t = Int64_t /* types.h:63:33 */
type Register_t = Int64_t /* types.h:66:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -1728,19 +1736,20 @@ type Intptr_t = X__darwin_intptr_t /* _intptr_t.h:32:33 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type Uintptr_t = uint64 /* _uintptr_t.h:30:33 */
type Uintptr_t = uint64 /* _uintptr_t.h:34:33 */
// These types are used for reserving the largest possible size.
type User_addr_t = U_int64_t /* types.h:74:33 */
type User_size_t = U_int64_t /* types.h:75:33 */
type User_ssize_t = Int64_t /* types.h:76:33 */
type User_long_t = Int64_t /* types.h:77:33 */
type User_ulong_t = U_int64_t /* types.h:78:33 */
type User_time_t = Int64_t /* types.h:79:33 */
type User_off_t = Int64_t /* types.h:80:33 */
type User_addr_t = U_int64_t /* types.h:77:33 */
type User_size_t = U_int64_t /* types.h:78:33 */
type User_ssize_t = Int64_t /* types.h:79:33 */
type User_long_t = Int64_t /* types.h:80:33 */
type User_ulong_t = U_int64_t /* types.h:81:33 */
type User_time_t = Int64_t /* types.h:82:33 */
type User_off_t = Int64_t /* types.h:83:33 */
// This defines the size of syscall arguments after copying into the kernel:
type Syscall_arg_t = U_int64_t /* types.h:101:33 */
type Syscall_arg_t = U_int64_t /* types.h:104:33 */
type Va_list = X__darwin_va_list /* _va_list.h:32:26 */

View file

@ -94,6 +94,7 @@ const (
IOPOL_STANDARD = 5
IOPOL_THROTTLE = 3
IOPOL_TYPE_DISK = 0
IOPOL_TYPE_VFS_ALLOW_LOW_SPACE_WRITES = 9
IOPOL_TYPE_VFS_ATIME_UPDATES = 2
IOPOL_TYPE_VFS_IGNORE_CONTENT_PROTECTION = 6
IOPOL_TYPE_VFS_IGNORE_PERMISSIONS = 7
@ -102,6 +103,8 @@ const (
IOPOL_TYPE_VFS_STATFS_NO_DATA_VOLUME = 4
IOPOL_TYPE_VFS_TRIGGER_RESOLVE = 5
IOPOL_UTILITY = 4
IOPOL_VFS_ALLOW_LOW_SPACE_WRITES_OFF = 0
IOPOL_VFS_ALLOW_LOW_SPACE_WRITES_ON = 1
IOPOL_VFS_CONTENT_PROTECTION_DEFAULT = 0
IOPOL_VFS_CONTENT_PROTECTION_IGNORE = 1
IOPOL_VFS_IGNORE_PERMISSIONS_OFF = 0
@ -114,6 +117,7 @@ const (
IOPOL_VFS_TRIGGER_RESOLVE_OFF = 1
LITTLE_ENDIAN = 1234
MAC_OS_VERSION_11_0 = 110000
MAC_OS_VERSION_12_0 = 120000
MAC_OS_X_VERSION_10_0 = 1000
MAC_OS_X_VERSION_10_1 = 1010
MAC_OS_X_VERSION_10_10 = 101000
@ -297,12 +301,14 @@ const (
WUNTRACED = 0x00000002
X_ALLOCA_H_ = 0
X_ARM_ARCH_H = 0
X_ARM_MACHTYPES_H_ = 0
X_ARM_SIGNAL_ = 1
X_ARM__ENDIAN_H_ = 0
X_BSD_ARM__TYPES_H_ = 0
X_BSD_MACHINE_ENDIAN_H_ = 0
X_BSD_MACHINE_SIGNAL_H_ = 0
X_BSD_MACHINE_TYPES_H_ = 0
X_BSD_MACHINE__MCONTEXT_H_ = 0
X_BSD_MACHINE__TYPES_H_ = 0
X_CDEFS_H_ = 0
X_CT_RUNE_T = 0
@ -749,7 +755,7 @@ type X__float128 = float64 /* <builtin>:47:21 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/AvailabilityInternal.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -909,6 +915,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -1332,17 +1344,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -1360,33 +1372,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system
@ -2137,7 +2149,7 @@ type Id_t = X__darwin_id_t /* _id_t.h:31:25 */ // can hold pid_t, gid_t, or uid_
//
// @(#)cdefs.h 8.8 (Berkeley) 1/9/95
type Sig_atomic_t = int32 /* signal.h:15:13 */
type Sig_atomic_t = int32 /* signal.h:17:13 */
// Language spec sez we must list exactly one parameter, even though we
// actually supply three. Ugh!
@ -2194,6 +2206,7 @@ type Sig_atomic_t = int32 /* signal.h:15:13 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_START@
@ -2760,7 +2773,7 @@ type U_int32_t = uint32 /* _u_int32_t.h:30:33 */
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type U_int64_t = uint64 /* _u_int64_t.h:30:33 */
type Register_t = Int64_t /* types.h:63:33 */
type Register_t = Int64_t /* types.h:66:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -2840,31 +2853,32 @@ type Intptr_t = X__darwin_intptr_t /* _intptr_t.h:32:33 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type Uintptr_t = uint64 /* _uintptr_t.h:30:33 */
type Uintptr_t = uint64 /* _uintptr_t.h:34:33 */
// These types are used for reserving the largest possible size.
type User_addr_t = U_int64_t /* types.h:74:33 */
type User_size_t = U_int64_t /* types.h:75:33 */
type User_ssize_t = Int64_t /* types.h:76:33 */
type User_long_t = Int64_t /* types.h:77:33 */
type User_ulong_t = U_int64_t /* types.h:78:33 */
type User_time_t = Int64_t /* types.h:79:33 */
type User_off_t = Int64_t /* types.h:80:33 */
type User_addr_t = U_int64_t /* types.h:77:33 */
type User_size_t = U_int64_t /* types.h:78:33 */
type User_ssize_t = Int64_t /* types.h:79:33 */
type User_long_t = Int64_t /* types.h:80:33 */
type User_ulong_t = U_int64_t /* types.h:81:33 */
type User_time_t = Int64_t /* types.h:82:33 */
type User_off_t = Int64_t /* types.h:83:33 */
// This defines the size of syscall arguments after copying into the kernel:
type Syscall_arg_t = U_int64_t /* types.h:101:33 */
type Syscall_arg_t = U_int64_t /* types.h:104:33 */
type X__darwin_arm_exception_state = struct {
F__exception X__uint32_t
F__fsr X__uint32_t
F__far X__uint32_t
} /* _structs.h:39:1 */
} /* _structs.h:41:1 */
type X__darwin_arm_exception_state64 = struct {
F__far X__uint64_t
F__esr X__uint32_t
F__exception X__uint32_t
} /* _structs.h:57:1 */
} /* _structs.h:59:1 */
type X__darwin_arm_thread_state = struct {
F__r [13]X__uint32_t
@ -2872,7 +2886,7 @@ type X__darwin_arm_thread_state = struct {
F__lr X__uint32_t
F__pc X__uint32_t
F__cpsr X__uint32_t
} /* _structs.h:75:1 */
} /* _structs.h:77:1 */
// By default, the pointer fields in the arm_thread_state64_t structure are
// opaque on the arm64e architecture and require the use of accessor macros.
@ -2887,7 +2901,7 @@ type X__darwin_arm_thread_state64 = struct {
F__pc X__uint64_t
F__cpsr X__uint32_t
F__pad X__uint32_t
} /* _structs.h:134:1 */
} /* _structs.h:136:1 */
// Accessor macros for arm_thread_state64_t pointer fields
@ -2906,29 +2920,21 @@ type X__darwin_arm_thread_state64 = struct {
type X__darwin_arm_vfp_state = struct {
F__r [64]X__uint32_t
F__fpscr X__uint32_t
} /* _structs.h:422:1 */
} /* _structs.h:424:1 */
type X__darwin_arm_neon_state64 = struct {
F__v [32]X__uint128_t
F__fpsr X__uint32_t
F__fpcr X__uint32_t
} /* _structs.h:441:1 */
} /* _structs.h:443:1 */
type X__darwin_arm_neon_state = struct {
F__v [16]X__uint128_t
F__fpsr X__uint32_t
F__fpcr X__uint32_t
} /* _structs.h:448:1 */
} /* _structs.h:450:1 */
type X__darwin_arm_amx_state_v1 = struct {
F__ccgo_pad1 [0]uint64
F__x [8][64]X__uint8_t
F__y [8][64]X__uint8_t
F__z [64][64]X__uint8_t
F__amx_state_t_el1 X__uint64_t
} /* _structs.h:512:1 */
type X__arm_pagein_state = struct{ F__pagein_error int32 } /* _structs.h:531:1 */
type X__arm_pagein_state = struct{ F__pagein_error int32 } /* _structs.h:514:1 */
// Debug State
@ -2939,7 +2945,7 @@ type X__arm_legacy_debug_state = struct {
F__bcr [16]X__uint32_t
F__wvr [16]X__uint32_t
F__wcr [16]X__uint32_t
} /* _structs.h:568:1 */
} /* _structs.h:551:1 */
type X__darwin_arm_debug_state32 = struct {
F__bvr [16]X__uint32_t
@ -2947,7 +2953,7 @@ type X__darwin_arm_debug_state32 = struct {
F__wvr [16]X__uint32_t
F__wcr [16]X__uint32_t
F__mdscr_el1 X__uint64_t
} /* _structs.h:591:1 */
} /* _structs.h:574:1 */
type X__darwin_arm_debug_state64 = struct {
F__bvr [16]X__uint64_t
@ -2955,9 +2961,9 @@ type X__darwin_arm_debug_state64 = struct {
F__wvr [16]X__uint64_t
F__wcr [16]X__uint64_t
F__mdscr_el1 X__uint64_t
} /* _structs.h:601:1 */
} /* _structs.h:584:1 */
type X__darwin_arm_cpmu_state64 = struct{ F__ctrs [16]X__uint64_t } /* _structs.h:633:1 */
type X__darwin_arm_cpmu_state64 = struct{ F__ctrs [16]X__uint64_t } /* _structs.h:616:1 */
type X__darwin_mcontext32 = struct {
F__es struct {
@ -2976,7 +2982,7 @@ type X__darwin_mcontext32 = struct {
F__r [64]X__uint32_t
F__fpscr X__uint32_t
}
} /* _mcontext.h:39:1 */
} /* _mcontext.h:41:1 */
type X__darwin_mcontext64 = struct {
F__es struct {
@ -2998,9 +3004,9 @@ type X__darwin_mcontext64 = struct {
F__fpsr X__uint32_t
F__fpcr X__uint32_t
}
} /* _mcontext.h:62:1 */
} /* _mcontext.h:64:1 */
type Mcontext_t = uintptr /* _mcontext.h:83:33 */
type Mcontext_t = uintptr /* _mcontext.h:85:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -3320,32 +3326,6 @@ type Stack_t = X__darwin_sigaltstack /* _sigaltstack.h:48:33 */ // [???] signal
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_START@
//
// This file contains Original Code and/or Modifications of Original Code
// as defined in and that are subject to the Apple Public Source License
// Version 2.0 (the 'License'). You may not use this file except in
// compliance with the License. The rights granted to you under the License
// may not be used to create, or enable the creation or redistribution of,
// unlawful or unlicensed copies of an Apple operating system, or to
// circumvent, violate, or enable the circumvention or violation of, any
// terms of an Apple operating system software license agreement.
//
// Please obtain a copy of the License at
// http://www.opensource.apple.com/apsl/ and read it before using this file.
//
// The Original Code and all software distributed under the License are
// distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
// EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
// INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
// Please see the License for the specific language governing rights and
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
// Copyright (c) 2003-2007 Apple Inc. All rights reserved.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_START@
@ -3548,18 +3528,18 @@ type Sigset_t = X__darwin_sigset_t /* _sigset_t.h:31:41 */
type Uid_t = X__darwin_uid_t /* _uid_t.h:31:31 */
type Sigval = struct {
_ [0]uint64
Fsival_int int32
_ [4]byte
F__ccgo_pad1 [0]uint64
Fsival_int int32
F__ccgo_pad2 [4]byte
} /* signal.h:158:1 */
type Sigevent = struct {
Fsigev_notify int32
Fsigev_signo int32
Fsigev_value struct {
_ [0]uint64
Fsival_int int32
_ [4]byte
F__ccgo_pad1 [0]uint64
Fsival_int int32
F__ccgo_pad2 [4]byte
}
Fsigev_notify_function uintptr
Fsigev_notify_attributes uintptr
@ -3574,9 +3554,9 @@ type X__siginfo = struct {
Fsi_status int32
Fsi_addr uintptr
Fsi_value struct {
_ [0]uint64
Fsival_int int32
_ [4]byte
F__ccgo_pad1 [0]uint64
Fsival_int int32
F__ccgo_pad2 [4]byte
}
Fsi_band int64
F__pad [7]uint64
@ -3834,7 +3814,7 @@ type Sigstack = struct {
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdint.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/stdint.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.

View file

@ -103,9 +103,9 @@ const (
KEV_DL_LINK_ON = 13
KEV_DL_LINK_QUALITY_METRIC_CHANGED = 20
KEV_DL_LOW_POWER_MODE_CHANGED = 30
KEV_DL_MASTER_ELECTED = 23
KEV_DL_NODE_ABSENCE = 22
KEV_DL_NODE_PRESENCE = 21
KEV_DL_PRIMARY_ELECTED = 23
KEV_DL_PROTO_ATTACHED = 14
KEV_DL_PROTO_DETACHED = 15
KEV_DL_QOS_MODE_CHANGED = 29
@ -139,6 +139,7 @@ const (
KEV_INET_SUBCLASS = 1
LITTLE_ENDIAN = 1234
MAC_OS_VERSION_11_0 = 110000
MAC_OS_VERSION_12_0 = 120000
MAC_OS_X_VERSION_10_0 = 1000
MAC_OS_X_VERSION_10_1 = 1010
MAC_OS_X_VERSION_10_10 = 101000
@ -335,6 +336,7 @@ const (
WINT_MAX = 2147483647
WINT_MIN = -2147483648
X_ARM_ARCH_H = 0
X_ARM_MACHTYPES_H_ = 0
X_ARM__ENDIAN_H_ = 0
X_ARM__PARAM_H_ = 0
X_BLKCNT_T = 0
@ -342,6 +344,7 @@ const (
X_BSD_ARM__TYPES_H_ = 0
X_BSD_MACHINE_ENDIAN_H_ = 0
X_BSD_MACHINE_TYPES_H_ = 0
X_BSD_MACHINE__PARAM_H_ = 0
X_BSD_MACHINE__TYPES_H_ = 0
X_CADDR_T = 0
X_CDEFS_H_ = 0
@ -680,6 +683,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -1031,17 +1040,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -1059,33 +1068,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Copyright (c) 2000-2018 Apple Inc. All rights reserved.
//
@ -1361,7 +1370,7 @@ type U_int32_t = uint32 /* _u_int32_t.h:30:33 */
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type U_int64_t = uint64 /* _u_int64_t.h:30:33 */
type Register_t = Int64_t /* types.h:63:33 */
type Register_t = Int64_t /* types.h:66:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -1441,19 +1450,20 @@ type Intptr_t = X__darwin_intptr_t /* _intptr_t.h:32:33 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type Uintptr_t = uint64 /* _uintptr_t.h:30:33 */
type Uintptr_t = uint64 /* _uintptr_t.h:34:33 */
// These types are used for reserving the largest possible size.
type User_addr_t = U_int64_t /* types.h:74:33 */
type User_size_t = U_int64_t /* types.h:75:33 */
type User_ssize_t = Int64_t /* types.h:76:33 */
type User_long_t = Int64_t /* types.h:77:33 */
type User_ulong_t = U_int64_t /* types.h:78:33 */
type User_time_t = Int64_t /* types.h:79:33 */
type User_off_t = Int64_t /* types.h:80:33 */
type User_addr_t = U_int64_t /* types.h:77:33 */
type User_size_t = U_int64_t /* types.h:78:33 */
type User_ssize_t = Int64_t /* types.h:79:33 */
type User_long_t = Int64_t /* types.h:80:33 */
type User_ulong_t = U_int64_t /* types.h:81:33 */
type User_time_t = Int64_t /* types.h:82:33 */
type User_off_t = Int64_t /* types.h:83:33 */
// This defines the size of syscall arguments after copying into the kernel:
type Syscall_arg_t = U_int64_t /* types.h:101:33 */
type Syscall_arg_t = U_int64_t /* types.h:104:33 */
// Copyright (c) 2003-2007 Apple Inc. All rights reserved.
//
@ -2094,7 +2104,7 @@ type X__darwin_pthread_t = uintptr /* _pthread_
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdint.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/stdint.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -3935,7 +3945,7 @@ type Errno_t = int32 /* _errno_t.h:30:32 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/AvailabilityInternal.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -4237,7 +4247,7 @@ type Fd_set1 = struct{ Ffds_bits [32]X__int32_t } /* _fd_def.h:50:9 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/AvailabilityInternal.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -5207,6 +5217,7 @@ type Fsfilcnt_t = X__darwin_fsfilcnt_t /* _fsfilcnt_t.h:31:41 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
// Copyright (c) 2006-2007 Apple Inc. All rights reserved.
// Copyright (c) 2000-2007 Apple Inc. All rights reserved.
@ -5571,6 +5582,8 @@ type Iovec = struct {
// Additional options, not kept in so_options.
// When adding new socket-options, you need to make sure MPTCP supports these as well!
// Network Service Type for option SO_NET_SERVICE_TYPE
//
// The vast majority of sockets should use Best Effort that is the default
@ -5654,9 +5667,9 @@ type Iovec = struct {
// These are supported values for SO_NETSVC_MARKING_LEVEL
type Sae_associd_t = X__uint32_t /* socket.h:289:20 */
type Sae_associd_t = X__uint32_t /* socket.h:293:20 */
type Sae_connid_t = X__uint32_t /* socket.h:293:20 */
type Sae_connid_t = X__uint32_t /* socket.h:297:20 */
// connectx() flag parameters
@ -5670,7 +5683,7 @@ type Sa_endpoints = struct {
Fsae_dstaddr uintptr
Fsae_dstaddrlen Socklen_t
F__ccgo_pad3 [4]byte
} /* socket.h:303:9 */
} /* socket.h:307:9 */
// connectx() flag parameters
@ -5679,31 +5692,31 @@ type Sockaddr = struct {
Fsa_len X__uint8_t
Fsa_family Sa_family_t
Fsa_data [14]int8
} /* socket.h:303:9 */
} /* socket.h:307:9 */
// connectx() flag parameters
// sockaddr endpoints
type Sa_endpoints_t = Sa_endpoints /* socket.h:309:3 */
type Sa_endpoints_t = Sa_endpoints /* socket.h:313:3 */
// Structure used for manipulating linger option.
type Linger = struct {
Fl_onoff int32
Fl_linger int32
} /* socket.h:315:1 */
} /* socket.h:319:1 */
// Structure to control non-portable Sockets extension to POSIX
type So_np_extensions = struct {
Fnpx_flags U_int32_t
Fnpx_mask U_int32_t
} /* socket.h:333:1 */
} /* socket.h:337:1 */
// Structure used by kernel to pass protocol
// information in raw sockets.
type Sockproto = struct {
Fsp_family X__uint16_t
Fsp_protocol X__uint16_t
} /* socket.h:421:1 */
} /* socket.h:425:1 */
// RFC 2553: protocol-independent placeholder for socket addresses
@ -5714,7 +5727,7 @@ type Sockaddr_storage = struct {
F__ss_pad1 [6]int8
F__ss_align X__int64_t
F__ss_pad2 [112]int8
} /* socket.h:441:1 */
} /* socket.h:445:1 */
// Protocol families, same as address families for now.
@ -5750,7 +5763,7 @@ type Msghdr = struct {
Fmsg_control uintptr
Fmsg_controllen Socklen_t
Fmsg_flags int32
} /* socket.h:548:1 */
} /* socket.h:552:1 */
// Header for ancillary data objects in msg_control buffer.
// Used for additional information with/about a datagram
@ -5760,7 +5773,7 @@ type Cmsghdr = struct {
Fcmsg_len Socklen_t
Fcmsg_level int32
Fcmsg_type int32
} /* socket.h:596:1 */
} /* socket.h:600:1 */
// given pointer to struct cmsghdr, return pointer to data
@ -5784,6 +5797,6 @@ type Sf_hdtr = struct {
Ftrailers uintptr
Ftrl_cnt int32
F__ccgo_pad2 [4]byte
} /* socket.h:687:1 */
} /* socket.h:691:1 */
var _ int8 /* gen.c:2:13: */

View file

@ -25,6 +25,7 @@ const (
EF_MAY_SHARE_BLOCKS = 0x00000001
EF_NO_XATTRS = 0x00000002
MAC_OS_VERSION_11_0 = 110000
MAC_OS_VERSION_12_0 = 120000
MAC_OS_X_VERSION_10_0 = 1000
MAC_OS_X_VERSION_10_1 = 1010
MAC_OS_X_VERSION_10_10 = 101000
@ -107,6 +108,7 @@ const (
UF_TRACKED = 0x00000040
UTIME_NOW = -1
UTIME_OMIT = -2
X_ARM_MACHTYPES_H_ = 0
X_BLKCNT_T = 0
X_BLKSIZE_T = 0
X_BSD_ARM__TYPES_H_ = 0
@ -332,6 +334,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -646,17 +654,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -674,33 +682,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system
@ -1096,7 +1104,7 @@ type X__darwin_pthread_t = uintptr /* _pthread_
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/AvailabilityInternal.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -1546,7 +1554,7 @@ type U_int32_t = uint32 /* _u_int32_t.h:30:33 */
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type U_int64_t = uint64 /* _u_int64_t.h:30:33 */
type Register_t = Int64_t /* types.h:63:33 */
type Register_t = Int64_t /* types.h:66:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -1626,19 +1634,20 @@ type Intptr_t = X__darwin_intptr_t /* _intptr_t.h:32:33 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type Uintptr_t = uint64 /* _uintptr_t.h:30:33 */
type Uintptr_t = uint64 /* _uintptr_t.h:34:33 */
// These types are used for reserving the largest possible size.
type User_addr_t = U_int64_t /* types.h:74:33 */
type User_size_t = U_int64_t /* types.h:75:33 */
type User_ssize_t = Int64_t /* types.h:76:33 */
type User_long_t = Int64_t /* types.h:77:33 */
type User_ulong_t = U_int64_t /* types.h:78:33 */
type User_time_t = Int64_t /* types.h:79:33 */
type User_off_t = Int64_t /* types.h:80:33 */
type User_addr_t = U_int64_t /* types.h:77:33 */
type User_size_t = U_int64_t /* types.h:78:33 */
type User_ssize_t = Int64_t /* types.h:79:33 */
type User_long_t = Int64_t /* types.h:80:33 */
type User_ulong_t = U_int64_t /* types.h:81:33 */
type User_time_t = Int64_t /* types.h:82:33 */
type User_off_t = Int64_t /* types.h:83:33 */
// This defines the size of syscall arguments after copying into the kernel:
type Syscall_arg_t = U_int64_t /* types.h:101:33 */
type Syscall_arg_t = U_int64_t /* types.h:104:33 */
type Timespec = struct {
Ftv_sec X__darwin_time_t

View file

@ -48,6 +48,7 @@ const (
INT_LEAST8_MIN = -128
LITTLE_ENDIAN = 1234
MAC_OS_VERSION_11_0 = 110000
MAC_OS_VERSION_12_0 = 120000
MAC_OS_X_VERSION_10_0 = 1000
MAC_OS_X_VERSION_10_1 = 1010
MAC_OS_X_VERSION_10_10 = 101000
@ -107,6 +108,7 @@ const (
WINT_MAX = 2147483647
WINT_MIN = -2147483648
X_ARM_ARCH_H = 0
X_ARM_MACHTYPES_H_ = 0
X_ARM__ENDIAN_H_ = 0
X_BLKCNT_T = 0
X_BLKSIZE_T = 0
@ -375,6 +377,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -726,17 +734,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -754,33 +762,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Copyright (c) 2000-2018 Apple Inc. All rights reserved.
//
@ -1056,7 +1064,7 @@ type U_int32_t = uint32 /* _u_int32_t.h:30:33 */
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type U_int64_t = uint64 /* _u_int64_t.h:30:33 */
type Register_t = Int64_t /* types.h:63:33 */
type Register_t = Int64_t /* types.h:66:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -1136,19 +1144,20 @@ type Intptr_t = X__darwin_intptr_t /* _intptr_t.h:32:33 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type Uintptr_t = uint64 /* _uintptr_t.h:30:33 */
type Uintptr_t = uint64 /* _uintptr_t.h:34:33 */
// These types are used for reserving the largest possible size.
type User_addr_t = U_int64_t /* types.h:74:33 */
type User_size_t = U_int64_t /* types.h:75:33 */
type User_ssize_t = Int64_t /* types.h:76:33 */
type User_long_t = Int64_t /* types.h:77:33 */
type User_ulong_t = U_int64_t /* types.h:78:33 */
type User_time_t = Int64_t /* types.h:79:33 */
type User_off_t = Int64_t /* types.h:80:33 */
type User_addr_t = U_int64_t /* types.h:77:33 */
type User_size_t = U_int64_t /* types.h:78:33 */
type User_ssize_t = Int64_t /* types.h:79:33 */
type User_long_t = Int64_t /* types.h:80:33 */
type User_ulong_t = U_int64_t /* types.h:81:33 */
type User_time_t = Int64_t /* types.h:82:33 */
type User_off_t = Int64_t /* types.h:83:33 */
// This defines the size of syscall arguments after copying into the kernel:
type Syscall_arg_t = U_int64_t /* types.h:101:33 */
type Syscall_arg_t = U_int64_t /* types.h:104:33 */
// Copyright (c) 2003-2007 Apple Inc. All rights reserved.
//
@ -1789,7 +1798,7 @@ type X__darwin_pthread_t = uintptr /* _pthread_
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdint.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/stdint.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -3630,7 +3639,7 @@ type Errno_t = int32 /* _errno_t.h:30:32 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/AvailabilityInternal.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -3932,7 +3941,7 @@ type Fd_set1 = struct{ Ffds_bits [32]X__int32_t } /* _fd_def.h:50:9 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/AvailabilityInternal.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.

View file

@ -340,6 +340,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -1066,17 +1072,17 @@ type Termios = struct {
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -1094,33 +1100,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system
@ -1329,6 +1335,7 @@ type Winsize = struct {
// 17-18 compat
// 127-124 compat
// 117-116 compat
// 105 unused
// END OF PROTECTED INCLUDE.

View file

@ -17,6 +17,7 @@ var _ unsafe.Pointer
const (
CLOCKS_PER_SEC = 1000000
MAC_OS_VERSION_11_0 = 110000
MAC_OS_VERSION_12_0 = 120000
MAC_OS_X_VERSION_10_0 = 1000
MAC_OS_X_VERSION_10_1 = 1010
MAC_OS_X_VERSION_10_10 = 101000
@ -50,6 +51,7 @@ const (
MAC_OS_X_VERSION_10_8 = 1080
MAC_OS_X_VERSION_10_9 = 1090
TIME_UTC = 1
X_ARM_MACHTYPES_H_ = 0
X_BSD_ARM__TYPES_H_ = 0
X_BSD_MACHINE_TYPES_H_ = 0
X_BSD_MACHINE__TYPES_H_ = 0
@ -292,6 +294,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -606,17 +614,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -634,33 +642,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system
@ -1086,7 +1094,7 @@ type X__darwin_wctype_t = X__uint32_t /* _types.h:43:20 */
//
// It has been auto-edited by fixincludes from:
//
// "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h"
// "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/AvailabilityInternal.h"
//
// This had to be done to correct non-standard usages in the
// original, manufacturer supplied header file.
@ -1534,7 +1542,7 @@ type U_int32_t = uint32 /* _u_int32_t.h:30:33 */
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type U_int64_t = uint64 /* _u_int64_t.h:30:33 */
type Register_t = Int64_t /* types.h:63:33 */
type Register_t = Int64_t /* types.h:66:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -1614,19 +1622,20 @@ type Intptr_t = X__darwin_intptr_t /* _intptr_t.h:32:33 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type Uintptr_t = uint64 /* _uintptr_t.h:30:33 */
type Uintptr_t = uint64 /* _uintptr_t.h:34:33 */
// These types are used for reserving the largest possible size.
type User_addr_t = U_int64_t /* types.h:74:33 */
type User_size_t = U_int64_t /* types.h:75:33 */
type User_ssize_t = Int64_t /* types.h:76:33 */
type User_long_t = Int64_t /* types.h:77:33 */
type User_ulong_t = U_int64_t /* types.h:78:33 */
type User_time_t = Int64_t /* types.h:79:33 */
type User_off_t = Int64_t /* types.h:80:33 */
type User_addr_t = U_int64_t /* types.h:77:33 */
type User_size_t = U_int64_t /* types.h:78:33 */
type User_ssize_t = Int64_t /* types.h:79:33 */
type User_long_t = Int64_t /* types.h:80:33 */
type User_ulong_t = U_int64_t /* types.h:81:33 */
type User_time_t = Int64_t /* types.h:82:33 */
type User_off_t = Int64_t /* types.h:83:33 */
// This defines the size of syscall arguments after copying into the kernel:
type Syscall_arg_t = U_int64_t /* types.h:101:33 */
type Syscall_arg_t = U_int64_t /* types.h:104:33 */
type Clock_t = X__darwin_clock_t /* _clock_t.h:31:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.

View file

@ -27,6 +27,7 @@ const (
L_SET = 0
L_XTND = 2
MAC_OS_VERSION_11_0 = 110000
MAC_OS_VERSION_12_0 = 120000
MAC_OS_X_VERSION_10_0 = 1000
MAC_OS_X_VERSION_10_1 = 1010
MAC_OS_X_VERSION_10_10 = 101000
@ -74,6 +75,7 @@ const (
X_OK = 1
X_ACCESS_EXTENDED_MASK = 4193792
X_APPEND_OK = 8192
X_ARM_MACHTYPES_H_ = 0
X_BSD_ARM__TYPES_H_ = 0
X_BSD_MACHINE_TYPES_H_ = 0
X_BSD_MACHINE__TYPES_H_ = 0
@ -618,6 +620,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -932,17 +940,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -960,33 +968,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system
@ -1922,7 +1930,7 @@ type U_int32_t = uint32 /* _u_int32_t.h:30:33 */
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type U_int64_t = uint64 /* _u_int64_t.h:30:33 */
type Register_t = Int64_t /* types.h:63:33 */
type Register_t = Int64_t /* types.h:66:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -2002,19 +2010,20 @@ type Intptr_t = X__darwin_intptr_t /* _intptr_t.h:32:33 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type Uintptr_t = uint64 /* _uintptr_t.h:30:33 */
type Uintptr_t = uint64 /* _uintptr_t.h:34:33 */
// These types are used for reserving the largest possible size.
type User_addr_t = U_int64_t /* types.h:74:33 */
type User_size_t = U_int64_t /* types.h:75:33 */
type User_ssize_t = Int64_t /* types.h:76:33 */
type User_long_t = Int64_t /* types.h:77:33 */
type User_ulong_t = U_int64_t /* types.h:78:33 */
type User_time_t = Int64_t /* types.h:79:33 */
type User_off_t = Int64_t /* types.h:80:33 */
type User_addr_t = U_int64_t /* types.h:77:33 */
type User_size_t = U_int64_t /* types.h:78:33 */
type User_ssize_t = Int64_t /* types.h:79:33 */
type User_long_t = Int64_t /* types.h:80:33 */
type User_ulong_t = U_int64_t /* types.h:81:33 */
type User_time_t = Int64_t /* types.h:82:33 */
type User_off_t = Int64_t /* types.h:83:33 */
// This defines the size of syscall arguments after copying into the kernel:
type Syscall_arg_t = U_int64_t /* types.h:101:33 */
type Syscall_arg_t = U_int64_t /* types.h:104:33 */
type Ssize_t = X__darwin_ssize_t /* _ssize_t.h:31:33 */
// Copyright (c) 2003-2007 Apple Inc. All rights reserved.

View file

@ -15,6 +15,7 @@ var _ atomic.Value
var _ unsafe.Pointer
const (
X_ARM_MACHTYPES_H_ = 0
X_BSD_ARM__TYPES_H_ = 0
X_BSD_MACHINE_TYPES_H_ = 0
X_BSD_MACHINE__TYPES_H_ = 0
@ -240,6 +241,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -554,17 +561,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -582,33 +589,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system
@ -1180,7 +1187,7 @@ type U_int32_t = uint32 /* _u_int32_t.h:30:33 */
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type U_int64_t = uint64 /* _u_int64_t.h:30:33 */
type Register_t = Int64_t /* types.h:63:33 */
type Register_t = Int64_t /* types.h:66:33 */
// Copyright (c) 2003-2012 Apple Inc. All rights reserved.
//
@ -1260,19 +1267,20 @@ type Intptr_t = X__darwin_intptr_t /* _intptr_t.h:32:33 */
// limitations under the License.
//
// @APPLE_OSREFERENCE_LICENSE_HEADER_END@
type Uintptr_t = uint64 /* _uintptr_t.h:30:33 */
type Uintptr_t = uint64 /* _uintptr_t.h:34:33 */
// These types are used for reserving the largest possible size.
type User_addr_t = U_int64_t /* types.h:74:33 */
type User_size_t = U_int64_t /* types.h:75:33 */
type User_ssize_t = Int64_t /* types.h:76:33 */
type User_long_t = Int64_t /* types.h:77:33 */
type User_ulong_t = U_int64_t /* types.h:78:33 */
type User_time_t = Int64_t /* types.h:79:33 */
type User_off_t = Int64_t /* types.h:80:33 */
type User_addr_t = U_int64_t /* types.h:77:33 */
type User_size_t = U_int64_t /* types.h:78:33 */
type User_ssize_t = Int64_t /* types.h:79:33 */
type User_long_t = Int64_t /* types.h:80:33 */
type User_ulong_t = U_int64_t /* types.h:81:33 */
type User_time_t = Int64_t /* types.h:82:33 */
type User_off_t = Int64_t /* types.h:83:33 */
// This defines the size of syscall arguments after copying into the kernel:
type Syscall_arg_t = U_int64_t /* types.h:101:33 */
type Syscall_arg_t = U_int64_t /* types.h:104:33 */
type Time_t = X__darwin_time_t /* _time_t.h:31:33 */

View file

@ -185,6 +185,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -499,17 +505,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -527,33 +533,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system

240
vendor/modernc.org/libc/watch.go generated vendored Normal file
View file

@ -0,0 +1,240 @@
// Copyright 2021 The Libc Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package libc // import "modernc.org/libc"
import (
"fmt"
"math"
"os"
"sync"
"unsafe"
)
var (
watches = map[uintptr]watch{}
watchesMu sync.Mutex
)
type watch interface {
msg() string
}
type watcher string
func (w watcher) msg() string {
if w == "" {
return ""
}
return fmt.Sprintf(": %s", w)
}
type watchInt8 struct {
val int8
watcher
}
func WatchInt8(p uintptr, msg string) {
watchesMu.Lock()
watches[p] = &watchInt8{*(*int8)(unsafe.Pointer(p)), watcher(msg)}
watchesMu.Unlock()
}
type watchUint8 struct {
val uint8
watcher
}
func WatchUint8(p uintptr, msg string) {
watchesMu.Lock()
watches[p] = &watchUint8{*(*uint8)(unsafe.Pointer(p)), watcher(msg)}
watchesMu.Unlock()
}
type watchInt16 struct {
val int16
watcher
}
func WatchInt16(p uintptr, msg string) {
watchesMu.Lock()
watches[p] = &watchInt16{*(*int16)(unsafe.Pointer(p)), watcher(msg)}
watchesMu.Unlock()
}
type watchUint16 struct {
val uint16
watcher
}
func WatchUint16(p uintptr, msg string) {
watchesMu.Lock()
watches[p] = &watchUint16{*(*uint16)(unsafe.Pointer(p)), watcher(msg)}
watchesMu.Unlock()
}
type watchInt32 struct {
val int32
watcher
}
func WatchInt32(p uintptr, msg string) {
watchesMu.Lock()
watches[p] = &watchInt32{*(*int32)(unsafe.Pointer(p)), watcher(msg)}
watchesMu.Unlock()
}
type watchUint32 struct {
val uint32
watcher
}
func WatchUint32(p uintptr, msg string) {
watchesMu.Lock()
watches[p] = &watchUint32{*(*uint32)(unsafe.Pointer(p)), watcher(msg)}
watchesMu.Unlock()
}
type watchInt64 struct {
val int64
watcher
}
func WatchInt64(p uintptr, msg string) {
watchesMu.Lock()
watches[p] = &watchInt64{*(*int64)(unsafe.Pointer(p)), watcher(msg)}
watchesMu.Unlock()
}
type watchUint64 struct {
val uint64
watcher
}
func WatchUint64(p uintptr, msg string) {
watchesMu.Lock()
watches[p] = &watchUint64{*(*uint64)(unsafe.Pointer(p)), watcher(msg)}
watchesMu.Unlock()
}
type watchFloat32 struct {
val float32
watcher
}
func WatchFloat32(p uintptr, msg string) {
watchesMu.Lock()
watches[p] = &watchFloat32{*(*float32)(unsafe.Pointer(p)), watcher(msg)}
watchesMu.Unlock()
}
type watchFloat64 struct {
val float64
watcher
}
func WatchFloat64(p uintptr, msg string) {
watchesMu.Lock()
watches[p] = &watchFloat64{*(*float64)(unsafe.Pointer(p)), watcher(msg)}
watchesMu.Unlock()
}
type watchPtr struct {
val uintptr
watcher
}
func WatchPtr(p uintptr, msg string) {
watchesMu.Lock()
watches[p] = &watchPtr{*(*uintptr)(unsafe.Pointer(p)), watcher(msg)}
watchesMu.Unlock()
}
func Watch() {
watchesMu.Lock()
flush := false
for p, v := range watches {
switch x := v.(type) {
case *watchInt8:
if val := *(*int8)(unsafe.Pointer(p)); val != x.val {
flush = true
fmt.Fprintf(os.Stderr, "%v: int8@%#x was %d, new %d%s\n", origin(2), p, x.val, val, x.msg())
x.val = val
}
case *watchUint8:
if val := *(*uint8)(unsafe.Pointer(p)); val != x.val {
flush = true
fmt.Fprintf(os.Stderr, "%v: uint8@%#x was %d, new %d%s\n", origin(2), p, x.val, val, x.msg())
x.val = val
}
case *watchInt16:
if val := *(*int16)(unsafe.Pointer(p)); val != x.val {
flush = true
fmt.Fprintf(os.Stderr, "%v: int16@%#x was %d, new %d%s\n", origin(2), p, x.val, val, x.msg())
x.val = val
}
case *watchUint16:
if val := *(*uint16)(unsafe.Pointer(p)); val != x.val {
flush = true
fmt.Fprintf(os.Stderr, "%v: uint16@%#x was %d, new %d%s\n", origin(2), p, x.val, val, x.msg())
x.val = val
}
case *watchInt32:
if val := *(*int32)(unsafe.Pointer(p)); val != x.val {
flush = true
fmt.Fprintf(os.Stderr, "%v: int32@%#x was %d, new %d%s\n", origin(2), p, x.val, val, x.msg())
x.val = val
}
case *watchUint32:
if val := *(*uint32)(unsafe.Pointer(p)); val != x.val {
flush = true
fmt.Fprintf(os.Stderr, "%v: uint32@%#x was %d, new %d%s\n", origin(2), p, x.val, val, x.msg())
x.val = val
}
case *watchInt64:
if val := *(*int64)(unsafe.Pointer(p)); val != x.val {
flush = true
fmt.Fprintf(os.Stderr, "%v: int64@%#x was %d, new %d%s\n", origin(2), p, x.val, val, x.msg())
x.val = val
}
case *watchUint64:
if val := *(*uint64)(unsafe.Pointer(p)); val != x.val {
flush = true
fmt.Fprintf(os.Stderr, "%v: uint64@%#x was %d, new %d%s\n", origin(2), p, x.val, val, x.msg())
x.val = val
}
case *watchFloat32:
if val := *(*float32)(unsafe.Pointer(p)); math.Float32bits(val) != math.Float32bits(x.val) {
flush = true
fmt.Fprintf(os.Stderr, "%v: float32@%#x was %v(%#x), new %v(%#x)%s\n", origin(2), p, x.val, math.Float32bits(x.val), val, math.Float32bits(val), x.msg())
x.val = val
}
case *watchFloat64:
if val := *(*float64)(unsafe.Pointer(p)); math.Float64bits(val) != math.Float64bits(x.val) {
flush = true
fmt.Fprintf(os.Stderr, "%v: float64@%#x was %v(%#x), new %v(%#x)%s\n", origin(2), p, x.val, math.Float64bits(x.val), val, math.Float64bits(val), x.msg())
x.val = val
}
case *watchPtr:
if val := *(*uintptr)(unsafe.Pointer(p)); val != x.val {
flush = true
fmt.Fprintf(os.Stderr, "%v: ptr@%#x was %#x, new %#x%s\n", origin(2), p, x.val, val, x.msg())
x.val = val
}
default:
panic(todo("%T", x))
}
}
if flush {
os.Stderr.Sync()
}
watchesMu.Unlock()
}
func WatchDelete(p uintptr) {
watchesMu.Lock()
delete(watches, p)
watchesMu.Unlock()
}

View file

@ -187,6 +187,12 @@ type X__float128 = float64 /* <builtin>:47:21 */
// in between its arguments. __CONCAT can also concatenate double-quoted
// strings produced by the __STRING macro, but this only works with ANSI C.
// __pure2 can be used for functions that are only a function of their scalar
// arguments (meaning they can't dereference pointers).
//
// __stateful_pure can be used for functions that have no side effects,
// but depend on the state of the memory.
// __unused denotes variables and functions that may not be used, preventing
// the compiler from warning about it if not used.
@ -610,17 +616,17 @@ type X__float128 = float64 /* <builtin>:47:21 */
// This header file contains integer types. It's intended to also contain
// flotaing point and other arithmetic types, as needed, later.
type X__int8_t = int8 /* _types.h:13:33 */
type X__uint8_t = uint8 /* _types.h:17:33 */
type X__int16_t = int16 /* _types.h:18:33 */
type X__uint16_t = uint16 /* _types.h:19:33 */
type X__int32_t = int32 /* _types.h:20:33 */
type X__uint32_t = uint32 /* _types.h:21:33 */
type X__int64_t = int64 /* _types.h:22:33 */
type X__uint64_t = uint64 /* _types.h:23:33 */
type X__int8_t = int8 /* _types.h:15:33 */
type X__uint8_t = uint8 /* _types.h:19:33 */
type X__int16_t = int16 /* _types.h:20:33 */
type X__uint16_t = uint16 /* _types.h:21:33 */
type X__int32_t = int32 /* _types.h:22:33 */
type X__uint32_t = uint32 /* _types.h:23:33 */
type X__int64_t = int64 /* _types.h:24:33 */
type X__uint64_t = uint64 /* _types.h:25:33 */
type X__darwin_intptr_t = int64 /* _types.h:25:33 */
type X__darwin_natural_t = uint32 /* _types.h:26:33 */
type X__darwin_intptr_t = int64 /* _types.h:27:33 */
type X__darwin_natural_t = uint32 /* _types.h:28:33 */
// The rune type below is declared to be an ``int'' instead of the more natural
// ``unsigned long'' or ``long''. Two things are happening here. It is not
@ -638,33 +644,33 @@ type X__darwin_natural_t = uint32 /* _types.h:26:33 */
// wchar_t, and should also be able to hold all members of the largest
// character set plus one extra value (WEOF). wint_t must be at least 16 bits.
type X__darwin_ct_rune_t = int32 /* _types.h:46:33 */ // ct_rune_t
type X__darwin_ct_rune_t = int32 /* _types.h:48:33 */ // ct_rune_t
// mbstate_t is an opaque object to keep conversion state, during multibyte
// stream conversions. The content must not be referenced by user programs.
type X__mbstate_t = struct {
_ [0]uint64
F__mbstate8 [128]int8
} /* _types.h:55:3 */
F__ccgo_pad1 [0]uint64
F__mbstate8 [128]int8
} /* _types.h:57:3 */
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:57:33 */ // mbstate_t
type X__darwin_mbstate_t = X__mbstate_t /* _types.h:59:33 */ // mbstate_t
type X__darwin_ptrdiff_t = int64 /* _types.h:60:33 */ // ptr1 - ptr2
type X__darwin_ptrdiff_t = int64 /* _types.h:62:33 */ // ptr1 - ptr2
type X__darwin_size_t = uint64 /* _types.h:68:33 */ // sizeof()
type X__darwin_size_t = uint64 /* _types.h:70:33 */ // sizeof()
type X__darwin_va_list = X__builtin_va_list /* _types.h:74:33 */ // va_list
type X__darwin_va_list = X__builtin_va_list /* _types.h:76:33 */ // va_list
type X__darwin_wchar_t = int32 /* _types.h:80:33 */ // wchar_t
type X__darwin_wchar_t = int32 /* _types.h:82:33 */ // wchar_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:85:33 */ // rune_t
type X__darwin_rune_t = X__darwin_wchar_t /* _types.h:87:33 */ // rune_t
type X__darwin_wint_t = int32 /* _types.h:88:33 */ // wint_t
type X__darwin_wint_t = int32 /* _types.h:90:33 */ // wint_t
type X__darwin_clock_t = uint64 /* _types.h:93:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:94:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:95:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:96:33 */ // time()
type X__darwin_clock_t = uint64 /* _types.h:95:33 */ // clock()
type X__darwin_socklen_t = X__uint32_t /* _types.h:96:33 */ // socklen_t (duh)
type X__darwin_ssize_t = int64 /* _types.h:97:33 */ // byte count or error
type X__darwin_time_t = int64 /* _types.h:98:33 */ // time()
// Type definitions; takes common type definitions that must be used
// in multiple header files due to [XSI], removes them from the system