Documentation ¶
Overview ¶
Package crt provides C-runtime services. (Work In Progress)
Index ¶
- Constants
- func CString(s string) unsafe.Pointer
- func Calloc(size int) (unsafe.Pointer, error)
- func CopyBytes(dst unsafe.Pointer, src []byte, addNull bool)
- func CopyString(dst unsafe.Pointer, src string, addNull bool)
- func Free(ptr unsafe.Pointer) error
- func GoBytesLen(s *int8, len int) []byte
- func GoString(s *int8) string
- func GoStringLen(s *int8, len int) string
- func GoUTF16String(s unsafe.Pointer) string
- func Malloc(size int) (unsafe.Pointer, error)
- func Movemem(dest, src unsafe.Pointer, n int) int
- func P2U(p unsafe.Pointer) uintptr
- func Realloc(tls *TLS, ptr unsafe.Pointer, size int) (unsafe.Pointer, error)
- func RegisterHeap(h unsafe.Pointer, n int64)
- func TODO(msg string, more ...interface{}) string
- func U2P(u uintptr) unsafe.Pointer
- func UsableSize(p unsafe.Pointer) int
- func VAFloat64(ap *[]interface{}) float64
- func VAInt32(ap *[]interface{}) (v int32)
- func VAInt64(ap *[]interface{}) (v int64)
- func VALong(ap *[]interface{}) int64
- func VAOther(ap *[]interface{}) (v interface{})
- func VAPointer(ap *[]interface{}) (r unsafe.Pointer)
- func VAULong(ap *[]interface{}) uint64
- func VAUint32(ap *[]interface{}) (v uint32)
- func VAUint64(ap *[]interface{}) (v uint64)
- func XAreFileApisANSI(tls *TLS) int32
- func XCloseHandle(tls *TLS, hObject unsafe.Pointer) int32
- func XCreateFileA(tls *TLS, lpFileName *int8, dwDesiredAccess uint32, dwShareMode uint32, ...) unsafe.Pointer
- func XCreateFileMappingA(tls *TLS, hFile unsafe.Pointer, lpAttributes *XSECURITY_ATTRIBUTES, ...) unsafe.Pointer
- func XCreateFileMappingW(tls *TLS, hFile unsafe.Pointer, lpAttributes *XSECURITY_ATTRIBUTES, ...) unsafe.Pointer
- func XCreateFileW(tls *TLS, lpFileName *uint16, dwDesiredAccess uint32, dwShareMode uint32, ...) unsafe.Pointer
- func XCreateMutexW(tls *TLS, lpMutexAttributes *XSECURITY_ATTRIBUTES, bInitialOwner int32, ...) unsafe.Pointer
- func XDeleteCriticalSection(tls *TLS, lpCriticalSection *XCRITICAL_SECTION)
- func XDeleteFileA(tls *TLS, lpFileName *int8) int32
- func XDeleteFileW(tls *TLS, lpFileName *uint16) int32
- func XEnterCriticalSection(tls *TLS, lpCriticalSection *XCRITICAL_SECTION)
- func XFlushFileBuffers(tls *TLS, hFile unsafe.Pointer) int32
- func XFlushViewOfFile(tls *TLS, lpBaseAddress unsafe.Pointer, dwNumberOfBytesToFlush uint64) int32
- func XFormatMessageA(tls *TLS, dwFlags uint32, lpSource unsafe.Pointer, dwMessageId uint32, ...) uint32
- func XFormatMessageW(tls *TLS, dwFlags uint32, lpSource unsafe.Pointer, dwMessageId uint32, ...) uint32
- func XFreeLibrary(tls *TLS, hModule *XHMODULE) int32
- func XGetCurrentProcessId(tls *TLS) uint32
- func XGetCurrentThreadId(tls *TLS) uint32
- func XGetDiskFreeSpaceA(tls *TLS, lpRootPathName *int8, lpSectorsPerCluster *uint32, ...) int32
- func XGetDiskFreeSpaceW(tls *TLS, lpRootPathName *uint16, lpSectorsPerCluster *uint32, ...) int32
- func XGetFileAttributesA(tls *TLS, lpFileName *int8) uint32
- func XGetFileAttributesExW(tls *TLS, lpFileName *uint16, fInfoLevelId int32, ...) int32
- func XGetFileAttributesW(tls *TLS, lpFileName *uint16) uint32
- func XGetFileSize(tls *TLS, hFile unsafe.Pointer, lpFileSizeHigh *uint32) uint32
- func XGetFullPathNameA(tls *TLS, lpFileName *int8, nBufferLength uint32, lpBuffer *int8, ...) uint32
- func XGetFullPathNameW(tls *TLS, lpFileName *uint16, nBufferLength uint32, lpBuffer *uint16, ...) uint32
- func XGetLastError(tls *TLS) uint32
- func XGetProcAddress(tls *TLS, hModule *XHMODULE, lpProcName *int8) func(*TLS) int64
- func XGetProcessHeap(tls *TLS) unsafe.Pointer
- func XGetSystemInfo(tls *TLS, lpSystemInfo *XSYSTEM_INFO)
- func XGetSystemTime(tls *TLS, lpSystemTime *XSYSTEMTIME)
- func XGetSystemTimeAsFileTime(tls *TLS, lpSystemTimeAsFileTime *XFILETIME)
- func XGetTempPathA(tls *TLS, nBufferLength uint32, lpBuffer *int8) uint32
- func XGetTempPathW(tls *TLS, nBufferLength uint32, lpBuffer *uint16) uint32
- func XGetTickCount(tls *TLS) uint32
- func XGetVersionExA(tls *TLS, lpVersionInfo *XOSVERSIONINFOA) int32
- func XGetVersionExW(tls *TLS, lpVersionInfo *XOSVERSIONINFOW) int32
- func XHeapAlloc(tls *TLS, hHeap unsafe.Pointer, dwFlags uint32, dwBytes uint64) unsafe.Pointer
- func XHeapCompact(tls *TLS, hHeap unsafe.Pointer, dwFlags uint32) uint64
- func XHeapCreate(tls *TLS, flOptions uint32, dwInitialSize uint64, dwMaximumSize uint64) unsafe.Pointer
- func XHeapDestroy(tls *TLS, hHeap unsafe.Pointer) int32
- func XHeapFree(tls *TLS, hHeap unsafe.Pointer, dwFlags uint32, lpMem unsafe.Pointer) int32
- func XHeapReAlloc(tls *TLS, hHeap unsafe.Pointer, dwFlags uint32, lpMem unsafe.Pointer, ...) unsafe.Pointer
- func XHeapSize(tls *TLS, hHeap unsafe.Pointer, dwFlags uint32, lpMem unsafe.Pointer) uint64
- func XHeapValidate(tls *TLS, hHeap unsafe.Pointer, dwFlags uint32, lpMem unsafe.Pointer) int32
- func XInitializeCriticalSection(tls *TLS, lpCriticalSection *XCRITICAL_SECTION)
- func XLeaveCriticalSection(tls *TLS, lpCriticalSection *XCRITICAL_SECTION)
- func XLocalFree(tls *TLS, hMem unsafe.Pointer) unsafe.Pointer
- func XLockFile(tls *TLS, hFile unsafe.Pointer, dwFileOffsetLow uint32, ...) int32
- func XLockFileEx(tls *TLS, hFile unsafe.Pointer, dwFlags uint32, dwReserved uint32, ...) int32
- func XMapViewOfFile(tls *TLS, hFileMappingObject unsafe.Pointer, dwDesiredAccess uint32, ...) unsafe.Pointer
- func XMultiByteToWideChar(tls *TLS, CodePage uint32, dwFlags uint32, lpMultiByteStr *int8, ...) int32
- func XOutputDebugStringA(tls *TLS, lpOutputString *int8)
- func XOutputDebugStringW(tls *TLS, lpOutputString *uint16)
- func XQueryPerformanceCounter(tls *TLS, lpPerformanceCount *XLARGE_INTEGER) int32
- func XReadFile(tls *TLS, hFile unsafe.Pointer, lpBuffer unsafe.Pointer, ...) int32
- func XSetEndOfFile(tls *TLS, hFile unsafe.Pointer) int32
- func XSetFilePointer(tls *TLS, hFile unsafe.Pointer, lDistanceToMove int32, ...) uint32
- func XSleep(tls *TLS, dwMilliseconds uint32)
- func XSystemTimeToFileTime(tls *TLS, lpSystemTime *XSYSTEMTIME, lpFileTime *XFILETIME) int32
- func XUnlockFile(tls *TLS, hFile unsafe.Pointer, dwFileOffsetLow uint32, ...) int32
- func XUnlockFileEx(tls *TLS, hFile unsafe.Pointer, dwReserved uint32, ...) int32
- func XUnmapViewOfFile(tls *TLS, lpBaseAddress unsafe.Pointer) int32
- func XWaitForSingleObject(tls *TLS, hHandle unsafe.Pointer, dwMilliseconds uint32) uint32
- func XWaitForSingleObjectEx(tls *TLS, hHandle unsafe.Pointer, dwMilliseconds uint32, bAlertable int32) uint32
- func XWideCharToMultiByte(tls *TLS, CodePage uint32, dwFlags uint32, lpWideCharStr *uint16, ...) int32
- func XWriteFile(tls *TLS, hFile unsafe.Pointer, lpBuffer unsafe.Pointer, ...) int32
- func X_InterlockedCompareExchange(tls *TLS, dest *int32, exchange, comparand int32) int32
- func X__builtin_abort(tls *TLS)
- func X__builtin_abs(tks *TLS, j int32) int32
- func X__builtin_assert_fail(tls *TLS, file *int8, line int32, fn, msg *int8)
- func X__builtin_bswap64(tls *TLS, x uint64) uint64
- func X__builtin_copysign(tls *TLS, x, y float64) float64
- func X__builtin_exit(tls *TLS, n int32)
- func X__builtin_ffs(tls *TLS, i int32) int32
- func X__builtin_ffsl(tls *TLS, i int64) int32
- func X__builtin_ffsll(tls *TLS, i int64) int32
- func X__builtin_fprintf(tls *TLS, stream unsafe.Pointer, format *int8, args ...interface{}) int32
- func X__builtin_isprint(tls *TLS, c int32) int32
- func X__builtin_malloc(tls *TLS, size uint64) (p unsafe.Pointer)
- func X__builtin_memcmp(tls *TLS, s1, s2 unsafe.Pointer, n uint64) int32
- func X__builtin_memcpy(tls *TLS, dest, src unsafe.Pointer, n uint64) unsafe.Pointer
- func X__builtin_memset(tls *TLS, s unsafe.Pointer, c int32, n uint64) unsafe.Pointer
- func X__builtin_printf(tls *TLS, format *int8, args ...interface{}) int32
- func X__builtin_sprintf(tls *TLS, str, format *int8, args ...interface{}) int32
- func X__builtin_strcmp(tls *TLS, s1, s2 *int8) int32
- func X__builtin_strcpy(tls *TLS, dest, src *int8) *int8
- func X__builtin_strlen(tls *TLS, s *int8) uint64
- func X__builtin_trap(tls *TLS)
- func X__ctype_b_loc(tls *TLS) (r0 **uint16)
- func X__errno_location(tls *TLS) *int32
- func X__register_stdfiles(tls *TLS, in, out, err unsafe.Pointer)
- func X__signbit(tls *TLS, x float64) int32
- func X__signbitf(tls *TLS, x float32) int32
- func X_beginthreadex(tls *TLS, a unsafe.Pointer, b uint32, c func(*TLS, unsafe.Pointer) uint32, ...) uintptr
- func X_endthreadex(tls *TLS, a uint32)
- func X_msize(tls *TLS, ptr unsafe.Pointer) uint32
- func Xabort(tls *TLS)
- func Xabs(tls *TLS, j int32) int32
- func Xacos(tls *TLS, x float64) float64
- func Xasin(tls *TLS, x float64) float64
- func Xatan(tls *TLS, x float64) float64
- func Xatoi(tls *TLS, _s *int8) (r0 int32)
- func Xcalloc(tls *TLS, nmemb, size uint64) (p unsafe.Pointer)
- func Xceil(tls *TLS, x float64) float64
- func Xclose(tls *TLS, fd int32) int32
- func Xcopysign(tls *TLS, x, y float64) float64
- func Xcos(tls *TLS, x float64) float64
- func Xcosh(tls *TLS, x float64) float64
- func Xdlclose(tls *TLS, handle unsafe.Pointer) int32
- func Xdlerror(tls *TLS) *int8
- func Xdlopen(tls *TLS, filename *int8, flags int32) unsafe.Pointer
- func Xdlsym(tls *TLS, handle unsafe.Pointer, symbol *int8) unsafe.Pointer
- func Xexit(tls *TLS, n int32)
- func Xexp(tls *TLS, x float64) float64
- func Xfabs(tls *TLS, x float64) float64
- func Xfclose(tls *TLS, stream *unsafe.Pointer) int32
- func Xfflush(tls *TLS, stream *unsafe.Pointer) int32
- func Xffs(tls *TLS, i int32) int32
- func Xffsl(tls *TLS, i int64) int32
- func Xffsll(tls *TLS, i int64) int32
- func Xfgetc(tls *TLS, stream *unsafe.Pointer) int32
- func Xfgets(tls *TLS, s *int8, size int32, stream *unsafe.Pointer) *int8
- func Xfloor(tls *TLS, x float64) float64
- func Xfopen(tls *TLS, path, mode *int8) *unsafe.Pointer
- func Xfopen64(tls *TLS, path, mode *int8) *unsafe.Pointer
- func Xfprintf(tls *TLS, stream *unsafe.Pointer, format *int8, args ...interface{}) int32
- func Xfread(tls *TLS, ptr unsafe.Pointer, size, nmemb uint64, stream *unsafe.Pointer) uint64
- func Xfree(tls *TLS, ptr unsafe.Pointer)
- func Xfseek(tls *TLS, stream *unsafe.Pointer, offset, whence int32) int32
- func Xftell(tls *TLS, stream *unsafe.Pointer) int32
- func Xfwrite(tls *TLS, ptr unsafe.Pointer, size, nmemb uint64, stream *unsafe.Pointer) uint64
- func Xgetenv(tls *TLS, name *int8) *int8
- func Xindex(tls *TLS, s *int8, c int32) *int8
- func Xisprint(tls *TLS, c int32) int32
- func Xlog(tls *TLS, x float64) float64
- func Xlog10(tls *TLS, x float64) float64
- func Xmalloc(tls *TLS, size uint64) unsafe.Pointer
- func Xmalloc_usable_size(tls *TLS, ptr unsafe.Pointer) uint64
- func Xmemcmp(tls *TLS, s1, s2 unsafe.Pointer, n uint64) int32
- func Xmemcpy(tls *TLS, dest, src unsafe.Pointer, n uint64) unsafe.Pointer
- func Xmemmove(tls *TLS, dest, src unsafe.Pointer, n uint64) unsafe.Pointer
- func Xmempcpy(tls *TLS, dest, src unsafe.Pointer, n uint64) unsafe.Pointer
- func Xmemset(tls *TLS, s unsafe.Pointer, c int32, n uint64) unsafe.Pointer
- func Xopen(tls *TLS, pathname *int8, flags int32, args ...interface{}) int32
- func Xopen64(tls *TLS, pathname *int8, flags int32, args ...interface{}) int32
- func Xpow(tls *TLS, x, y float64) float64
- func Xprintf(tls *TLS, format *int8, args ...interface{}) int32
- func Xpthread_cond_signal(tls *TLS, cond *Xpthread_cond_t) int32
- func Xpthread_cond_wait(tls *TLS, cond *Xpthread_cond_t, mutex *Xpthread_mutex_t) int32
- func Xpthread_create(tls *TLS, thread *uint64, attr *Xpthread_attr_t, ...) int32
- func Xpthread_detach(tls *TLS, thread uint64) int32
- func Xpthread_equal(tls *TLS, thread1, thread2 uint64) int32
- func Xpthread_join(tls *TLS, thread uint64, value_ptr *unsafe.Pointer) int32
- func Xpthread_mutex_destroy(tls *TLS, mutex *Xpthread_mutex_t) int32
- func Xpthread_mutex_init(tls *TLS, mutex *Xpthread_mutex_t, mutexattr *Xpthread_mutexattr_t) int32
- func Xpthread_mutex_lock(tls *TLS, mutex *Xpthread_mutex_t) int32
- func Xpthread_mutex_trylock(tls *TLS, mutex *Xpthread_mutex_t) int32
- func Xpthread_mutex_unlock(tls *TLS, mutex *Xpthread_mutex_t) int32
- func Xpthread_mutexattr_destroy(tls *TLS, attr *Xpthread_mutexattr_t) int32
- func Xpthread_mutexattr_init(tls *TLS, attr *Xpthread_mutexattr_t) int32
- func Xpthread_mutexattr_settype(tls *TLS, attr *Xpthread_mutexattr_t, kind int32) int32
- func Xpthread_self(tls *TLS) uint64
- func Xqsort(tls *TLS, base unsafe.Pointer, nmemb, size uint64, ...)
- func Xread(tls *TLS, fd int32, buf unsafe.Pointer, count uint64) int64
- func Xrealloc(tls *TLS, ptr unsafe.Pointer, size uint64) unsafe.Pointer
- func Xrewind(tls *TLS, stream *unsafe.Pointer)
- func Xrindex(tls *TLS, s *int8, c int32) *int8
- func Xround(tls *TLS, x float64) float64
- func Xsched_yield(tls *TLS) int32
- func Xsin(tls *TLS, x float64) float64
- func Xsinh(tls *TLS, x float64) float64
- func Xsprintf(tls *TLS, str, format *int8, args ...interface{}) int32
- func Xsqrt(tls *TLS, x float64) float64
- func Xstrcat(tls *TLS, dest, src *int8) *int8
- func Xstrchr(tls *TLS, s *int8, c int32) *int8
- func Xstrcmp(tls *TLS, s1, s2 *int8) int32
- func Xstrcpy(tls *TLS, dest, src *int8) *int8
- func Xstrerror_r(tls *TLS, errnum int32, buf *int8, buflen uint64) int32
- func Xstrlen(tls *TLS, s *int8) uint64
- func Xstrncmp(tls *TLS, s1, s2 *int8, n uint64) int32
- func Xstrncpy(tls *TLS, dest, src *int8, n uint64) *int8
- func Xstrrchr(tls *TLS, s *int8, c int32) *int8
- func Xtan(tls *TLS, x float64) float64
- func Xtanh(tls *TLS, x float64) float64
- func Xtime(tls *TLS, tloc *int64) int64
- func Xtolower(tls *TLS, c int32) int32
- func Xvfprintf(tls *TLS, stream *unsafe.Pointer, format *int8, ap []interface{}) int32
- func Xvprintf(tls *TLS, format *int8, ap []interface{}) int32
- type TLS
- type XCRITICAL_SECTION
- type XFILETIME
- type XHMODULE
- type XLARGE_INTEGER
- type XOSVERSIONINFOA
- type XOSVERSIONINFOW
- type XOVERLAPPED
- type XSECURITY_ATTRIBUTES
- type XSYSTEMTIME
- type XSYSTEM_INFO
- type Xpthread_attr_t
- type Xpthread_cond_t
- type Xpthread_mutex_t
- type Xpthread_mutexattr_t
- type Xtm
Constants ¶
const ( Tpthread_cond_t = "" /* 196-byte string literal not displayed */ Tpthread_mutexattr_t = "union{__size [4]int8,__align int32}" )
const ( Tpthread_attr_t = "union{[56]int8,int64}" Tpthread_mutex_t = "" /* 201-byte string literal not displayed */ )
const ( TCRITICAL_SECTION = "struct{*struct{},int32,int32,*struct{},*struct{},uint64}" TFILETIME = "struct{uint32,uint32}" TLARGE_INTEGER = "union{struct{uint32,int32},struct{uint32,int32},int64}" TSECURITY_ATTRIBUTES = "struct{uint32,*struct{},int32}" TSYSTEM_INFO = "struct{union{uint32,struct{uint16,uint16}},uint32,*struct{},*struct{},uint64,uint32,uint32,uint32,uint16,uint16}" TSYSTEMTIME = "struct{uint16,uint16,uint16,uint16,uint16,uint16,uint16,uint16}" THMODULE = "struct{int32}" TOSVERSIONINFOA = "struct{uint32,uint32,uint32,uint32,uint32,[128]int8}" TOSVERSIONINFOW = "struct{uint32,uint32,uint32,uint32,uint32,[128]uint16}" TOVERLAPPED = "struct{uint64,uint64,union{struct{uint32,uint32},*struct{}},*struct{}}" )
const Ttm = "struct{int32,int32,int32,int32,int32,int32,int32,int32,int32}"
Variables ¶
This section is empty.
Functions ¶
func Calloc ¶
Calloc is like Malloc except the allocated memory is zeroed. Calloc is safe for concurrent use by multiple goroutines.
func CopyString ¶
CopyString copies src to dest, optionally adding a zero byte at the end.
func Free ¶
Free deallocates memory. The argument of Free must have been acquired from Calloc or Malloc or Realloc. Free is safe for concurrent use by multiple goroutines.
func GoBytesLen ¶
GoBytesLen returns a []byte copied from a C char* string s having length len bytes.
func GoStringLen ¶
GoStringLen returns a string from a C char* string s having length len bytes.
func GoUTF16String ¶
TODO: implement a generic wide string variant of this GoUTF16String converts a wide string to a GOString using windows-specific implementations in go's syscall package
func Malloc ¶
Malloc allocates size bytes and returns a byte slice of the allocated memory. The memory is not initialized. Malloc panics for size < 0 and returns (nil, nil) for zero size. Malloc is safe for concurrent use by multiple goroutines.
func Movemem ¶
Movemem copies n bytes from memory area src to memory area dest. The memory areas may overlap: copying takes place as though the bytes in src are first copied into a temporary array that does not overlap src or dest, and the bytes are then copied from the temporary array to dest.
func P2U ¶
P2U returns the uintptr value represented by p. If p was obtained by U2P then the uintptr value originally passed to U2P is returned. Otherwise the return value is uintptr(p).
The function is safe for concurrent use by multiple goroutines.
func Realloc ¶
Realloc changes the size of the memory allocated at ptr to size bytes or returns an error, if any. The contents will be unchanged in the range from the start of the region up to the minimum of the old and new sizes. If the new size is larger than the old size, the added memory will not be initialized. If ptr is nil, then the call is equivalent to Malloc(size), for all values of size; if size is equal to zero, and ptr is not nil, then the call is equivalent to Free(ptr). Unless ptr is nil, it must have been returned by an earlier call to Malloc, Calloc or Realloc. If the area pointed to was moved, a Free(ptr) is done. Relloc is safe for concurrent use by multiple goroutines.
func RegisterHeap ¶
RegisterHeap registers the sbrk-style heap.
func U2P ¶
U2P returns unsafe.Pointer(&u).
The function is safe for concurrent use by multiple goroutines.
func UsableSize ¶
UsableSize reports the size of the memory block allocated at p, which must have been acquired from Calloc, Malloc or Realloc. The allocated memory block size can be larger than the size originally requested from Calloc, Malloc or Realloc.
func XCloseHandle ¶
//sys: BOOL CloseHandle(HANDLE hObject);
func XCreateFileA ¶
func XCreateFileA(tls *TLS, lpFileName *int8, dwDesiredAccess uint32, dwShareMode uint32, lpSecurityAttributes *XSECURITY_ATTRIBUTES, dwCreationDisposition uint32, dwFlagsAndAttributes uint32, hTemplateFile unsafe.Pointer) unsafe.Pointer
//sys: HANDLE CreateFileA(LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
func XCreateFileMappingA ¶
func XCreateFileMappingA(tls *TLS, hFile unsafe.Pointer, lpAttributes *XSECURITY_ATTRIBUTES, flProtect uint32, dwMaximumSizeHigh uint32, dwMaximumSizeLow uint32, lpName *int8) unsafe.Pointer
//sys: HANDLE CreateFileMappingA(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCTSTR lpName);
func XCreateFileMappingW ¶
func XCreateFileMappingW(tls *TLS, hFile unsafe.Pointer, lpAttributes *XSECURITY_ATTRIBUTES, flProtect uint32, dwMaximumSizeHigh uint32, dwMaximumSizeLow uint32, lpName *uint16) unsafe.Pointer
//sys: HANDLE CreateFileMappingW(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCWSTR lpName);
func XCreateFileW ¶
func XCreateFileW(tls *TLS, lpFileName *uint16, dwDesiredAccess uint32, dwShareMode uint32, lpSecurityAttributes *XSECURITY_ATTRIBUTES, dwCreationDisposition uint32, dwFlagsAndAttributes uint32, hTemplateFile unsafe.Pointer) unsafe.Pointer
//sys: HANDLE CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
func XCreateMutexW ¶
func XCreateMutexW(tls *TLS, lpMutexAttributes *XSECURITY_ATTRIBUTES, bInitialOwner int32, lpName *uint16) unsafe.Pointer
//sys: HANDLE CreateMutexW(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCWSTR lpName);
func XDeleteCriticalSection ¶
func XDeleteCriticalSection(tls *TLS, lpCriticalSection *XCRITICAL_SECTION)
//sys: void DeleteCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
func XDeleteFileA ¶
//sys: BOOL DeleteFileA(LPCTSTR lpFileName);
func XDeleteFileW ¶
//sys: BOOL DeleteFileW(LPCWSTR lpFileName);
func XEnterCriticalSection ¶
func XEnterCriticalSection(tls *TLS, lpCriticalSection *XCRITICAL_SECTION)
//sys: void EnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
func XFlushFileBuffers ¶
//sys: BOOL FlushFileBuffers(HANDLE hFile);
func XFlushViewOfFile ¶
//sys: BOOL FlushViewOfFile(LPCVOID lpBaseAddress, SIZE_T dwNumberOfBytesToFlush);
func XFormatMessageA ¶
func XFormatMessageA(tls *TLS, dwFlags uint32, lpSource unsafe.Pointer, dwMessageId uint32, dwLanguageId uint32, lpBuffer *int8, nSize uint32, Arguments *[]interface{}) uint32
//sys: DWORD FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPTSTR lpBuffer, DWORD nSize, va_list* Arguments);
func XFormatMessageW ¶
func XFormatMessageW(tls *TLS, dwFlags uint32, lpSource unsafe.Pointer, dwMessageId uint32, dwLanguageId uint32, lpBuffer *uint16, nSize uint32, Arguments *[]interface{}) uint32
//sys: DWORD FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPCWSTR lpBuffer, DWORD nSize, va_list* Arguments);
func XFreeLibrary ¶
//sys: BOOL FreeLibrary(HMODULE hModule);
func XGetCurrentProcessId ¶
//sys: DWORD GetCurrentProcessId();
func XGetCurrentThreadId ¶
DWORD WINAPI GetCurrentThreadId(void);
func XGetDiskFreeSpaceA ¶
func XGetDiskFreeSpaceA(tls *TLS, lpRootPathName *int8, lpSectorsPerCluster *uint32, lpBytesPerSector *uint32, lpNumberOfFreeClusters *uint32, lpTotalNumberOfClusters *uint32) int32
//sys: BOOL GetDiskFreeSpaceA(LPCTSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters);
func XGetDiskFreeSpaceW ¶
func XGetDiskFreeSpaceW(tls *TLS, lpRootPathName *uint16, lpSectorsPerCluster *uint32, lpBytesPerSector *uint32, lpNumberOfFreeClusters *uint32, lpTotalNumberOfClusters *uint32) int32
//sys: BOOL GetDiskFreeSpaceW(LPCWSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters);
func XGetFileAttributesA ¶
//sys: DWORD GetFileAttributesA(LPCTSTR lpFileName);
func XGetFileAttributesExW ¶
func XGetFileAttributesExW(tls *TLS, lpFileName *uint16, fInfoLevelId int32, lpFileInformation unsafe.Pointer) int32
//sys: BOOL GetFileAttributesExW(LPCWSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation);
func XGetFileAttributesW ¶
//sys: DWORD GetFileAttributesW(LPCWSTR lpFileName);
func XGetFileSize ¶
//sys: DWORD GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh);
func XGetFullPathNameA ¶
func XGetFullPathNameA(tls *TLS, lpFileName *int8, nBufferLength uint32, lpBuffer *int8, lpFilePart **int8) uint32
//sys: DWORD GetFullPathNameA( LPCTSTR lpFileName, DWORD nBufferLength, LPTSTR lpBuffer, LPTSTR* lpFilePart);
func XGetFullPathNameW ¶
func XGetFullPathNameW(tls *TLS, lpFileName *uint16, nBufferLength uint32, lpBuffer *uint16, lpFilePart **uint16) uint32
//sys: DWORD GetFullPathNameW( LPCWSTR lpFileName, DWORD nBufferLength, LPCWSTR lpBuffer, LPCWSTR* lpFilePart);
func XGetProcAddress ¶
//sys: FARPROC GetProcAddress(HMODULE hModule, LPCSTR lpProcName);
func XGetProcessHeap ¶
//sys: HANDLE GetProcessHeap();
func XGetSystemInfo ¶
func XGetSystemInfo(tls *TLS, lpSystemInfo *XSYSTEM_INFO)
//sys: void GetSystemInfo(LPSYSTEM_INFO lpSystemInfo);
func XGetSystemTime ¶
func XGetSystemTime(tls *TLS, lpSystemTime *XSYSTEMTIME)
//sys: void GetSystemTime(LPSYSTEMTIME lpSystemTime);
func XGetSystemTimeAsFileTime ¶
//sys: void GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime);
func XGetTempPathA ¶
//sys: DWORD GetTempPathA(DWORD nBufferLength, LPTSTR lpBuffer);
func XGetTempPathW ¶
//sys: DWORD GetTempPathW(DWORD nBufferLength, LPCWSTR lpBuffer);
func XGetVersionExA ¶
func XGetVersionExA(tls *TLS, lpVersionInfo *XOSVERSIONINFOA) int32
//sys: BOOL GetVersionExA(LPOSVERSIONINFO lpVersionInfo);
func XGetVersionExW ¶
func XGetVersionExW(tls *TLS, lpVersionInfo *XOSVERSIONINFOW) int32
//sys: BOOL GetVersionExW(LPOSVERSIONINFOW lpVersionInfo);
func XHeapAlloc ¶
//sys: LPVOID HeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes);
func XHeapCompact ¶
//sys: SIZE_T HeapCompact(HANDLE hHeap, DWORD dwFlags);
func XHeapCreate ¶
func XHeapCreate(tls *TLS, flOptions uint32, dwInitialSize uint64, dwMaximumSize uint64) unsafe.Pointer
//sys: HANDLE HeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize);
func XHeapDestroy ¶
//sys: BOOL HeapDestroy(HANDLE hHeap);
func XHeapReAlloc ¶
func XHeapReAlloc(tls *TLS, hHeap unsafe.Pointer, dwFlags uint32, lpMem unsafe.Pointer, dwBytes uint64) unsafe.Pointer
//sys: LPVOID HeapReAlloc(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, SIZE_T dwBytes);
func XHeapValidate ¶
//sys: BOOL HeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);
func XInitializeCriticalSection ¶
func XInitializeCriticalSection(tls *TLS, lpCriticalSection *XCRITICAL_SECTION)
//sys: void InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
func XLeaveCriticalSection ¶
func XLeaveCriticalSection(tls *TLS, lpCriticalSection *XCRITICAL_SECTION)
//sys: void LeaveCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
func XLocalFree ¶
//sys: HLOCAL LocalFree(HLOCAL hMem);
func XLockFile ¶
func XLockFile(tls *TLS, hFile unsafe.Pointer, dwFileOffsetLow uint32, dwFileOffsetHigh uint32, nNumberOfBytesToLockLow uint32, nNumberOfBytesToLockHigh uint32) int32
//sys: BOOL LockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh);
func XLockFileEx ¶
func XLockFileEx(tls *TLS, hFile unsafe.Pointer, dwFlags uint32, dwReserved uint32, nNumberOfBytesToLockLow uint32, nNumberOfBytesToLockHigh uint32, lpOverlapped *XOVERLAPPED) int32
//sys: BOOL LockFileEx(HANDLE hFile, DWORD dwFlags, DWORD dwReserved, DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, LPOVERLAPPED lpOverlapped);
func XMapViewOfFile ¶
func XMapViewOfFile(tls *TLS, hFileMappingObject unsafe.Pointer, dwDesiredAccess uint32, dwFileOffsetHigh uint32, dwFileOffsetLow uint32, dwNumberOfBytesToMap uint64) unsafe.Pointer
//sys: LPVOID MapViewOfFile(HANDLE hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, DWORD dwFileOffsetLow, SIZE_T dwNumberOfBytesToMap);
func XMultiByteToWideChar ¶
func XMultiByteToWideChar(tls *TLS, CodePage uint32, dwFlags uint32, lpMultiByteStr *int8, cbMultiByte int32, lpWideCharStr *uint16, cchWideChar int32) int32
//sys: int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar);
func XOutputDebugStringA ¶
//sys: void OutputDebugStringA(LPCTSTR lpOutputString);
func XOutputDebugStringW ¶
//sys: void OutputDebugStringW(LPCWSTR lpOutputString);
func XQueryPerformanceCounter ¶
func XQueryPerformanceCounter(tls *TLS, lpPerformanceCount *XLARGE_INTEGER) int32
//sys: BOOL QueryPerformanceCounter(LARGE_INTEGER* lpPerformanceCount);
func XReadFile ¶
func XReadFile(tls *TLS, hFile unsafe.Pointer, lpBuffer unsafe.Pointer, nNumberOfBytesToRead uint32, lpNumberOfBytesRead *uint32, lpOverlapped *XOVERLAPPED) int32
//sys: BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped);
func XSetEndOfFile ¶
//sys: BOOL SetEndOfFile(HANDLE hFile);
func XSetFilePointer ¶
func XSetFilePointer(tls *TLS, hFile unsafe.Pointer, lDistanceToMove int32, lpDistanceToMoveHigh *int32, dwMoveMethod uint32) uint32
//sys: DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod);
func XSystemTimeToFileTime ¶
func XSystemTimeToFileTime(tls *TLS, lpSystemTime *XSYSTEMTIME, lpFileTime *XFILETIME) int32
//sys: BOOL SystemTimeToFileTime(SYSTEMTIME* lpSystemTime, LPFILETIME lpFileTime);
func XUnlockFile ¶
func XUnlockFile(tls *TLS, hFile unsafe.Pointer, dwFileOffsetLow uint32, dwFileOffsetHigh uint32, nNumberOfBytesToUnlockLow uint32, nNumberOfBytesToUnlockHigh uint32) int32
//sys: BOOL UnlockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh);
func XUnlockFileEx ¶
func XUnlockFileEx(tls *TLS, hFile unsafe.Pointer, dwReserved uint32, nNumberOfBytesToUnlockLow uint32, nNumberOfBytesToUnlockHigh uint32, lpOverlapped *XOVERLAPPED) int32
//sys: BOOL UnlockFileEx(HANDLE hFile, DWORD dwReserved, DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh, LPOVERLAPPED lpOverlapped);
func XUnmapViewOfFile ¶
//sys: BOOL UnmapViewOfFile(LPCVOID lpBaseAddress);
func XWaitForSingleObject ¶
//sys: DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds);
func XWaitForSingleObjectEx ¶
func XWaitForSingleObjectEx(tls *TLS, hHandle unsafe.Pointer, dwMilliseconds uint32, bAlertable int32) uint32
//sys: DWORD WaitForSingleObjectEx(HANDLE hHandle, DWORD dwMilliseconds, BOOL bAlertable);
func XWideCharToMultiByte ¶
func XWideCharToMultiByte(tls *TLS, CodePage uint32, dwFlags uint32, lpWideCharStr *uint16, cchWideChar int32, lpMultiByteStr *int8, cbMultiByte int32, lpDefaultChar *int8, lpUsedDefaultChar *int32) int32
//sys: int WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar);
func XWriteFile ¶
func XWriteFile(tls *TLS, hFile unsafe.Pointer, lpBuffer unsafe.Pointer, nNumberOfBytesToWrite uint32, lpNumberOfBytesWritten *uint32, lpOverlapped *XOVERLAPPED) int32
//sys: BOOL WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped);
func X_InterlockedCompareExchange ¶
LONG __cdecl InterlockedCompareExchange(_Inout_ LONG volatile *Destination,_In_ LONG Exchange,_In_ LONG Comparand); TODO: figure out if we can bypass a minor race (see below for an explanation)
func X__builtin_assert_fail ¶
func X__builtin_bswap64 ¶
uint64_t __builtin_bswap64 (uint64_t x)
func X__builtin_copysign ¶
func X__builtin_fprintf ¶
int __builtin_fprintf(void* stream, const char *format, ...);
func X__builtin_malloc ¶
void *malloc(size_t size);
func X__builtin_memcmp ¶
int memcmp(const void *s1, const void *s2, size_t n)
func X__builtin_memcpy ¶
void *memcpy(void *dest, const void *src, size_t n)
func X__builtin_memset ¶
void *memset(void *s, int c, size_t n)
func X__builtin_printf ¶
int printf(const char *format, ...);
func X__builtin_sprintf ¶
int sprintf(char *str, const char *format, ...);
func X__builtin_strcmp ¶
int strcmp(const char *s1, const char *s2)
func X__builtin_strcpy ¶
char *strcpy(char *dest, const char *src)
func X__builtin_strlen ¶
size_t strlen(const char *s)
func X__ctype_b_loc ¶
const unsigned short **__ctype_b_loc(void)
func X__errno_location ¶
extern int *__errno_location(void);
func X__register_stdfiles ¶
void __register_stdfiles(void *, void *, void *);
func X_beginthreadex ¶
func X_endthreadex ¶
func Xmalloc_usable_size ¶
size_t malloc_usable_size (void *ptr);
func Xpthread_cond_signal ¶
func Xpthread_cond_signal(tls *TLS, cond *Xpthread_cond_t) int32
int pthread_cond_signal(pthread_cond_t *cond);
func Xpthread_cond_wait ¶
func Xpthread_cond_wait(tls *TLS, cond *Xpthread_cond_t, mutex *Xpthread_mutex_t) int32
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
func Xpthread_create ¶
func Xpthread_create(tls *TLS, thread *uint64, attr *Xpthread_attr_t, start_routine func(*TLS, unsafe.Pointer) unsafe.Pointer, arg unsafe.Pointer) int32
int pthread_create(pthread_t *restrict thread, const pthread_attr_t *restrict attr, void *(*start_routine)(void*), void *restrict arg);
func Xpthread_detach ¶
int pthread_detach(pthread_t thread);
func Xpthread_equal ¶
extern int pthread_equal(pthread_t __thread1, pthread_t __thread2);
func Xpthread_join ¶
int pthread_join(pthread_t thread, void **value_ptr);
func Xpthread_mutex_destroy ¶
func Xpthread_mutex_destroy(tls *TLS, mutex *Xpthread_mutex_t) int32
extern int pthread_mutex_destroy(pthread_mutex_t * __mutex);
func Xpthread_mutex_init ¶
func Xpthread_mutex_init(tls *TLS, mutex *Xpthread_mutex_t, mutexattr *Xpthread_mutexattr_t) int32
extern int pthread_mutex_init(pthread_mutex_t * __mutex, pthread_mutexattr_t * __mutexattr);
func Xpthread_mutex_lock ¶
func Xpthread_mutex_lock(tls *TLS, mutex *Xpthread_mutex_t) int32
extern int pthread_mutex_lock(pthread_mutex_t * __mutex);
func Xpthread_mutex_trylock ¶
func Xpthread_mutex_trylock(tls *TLS, mutex *Xpthread_mutex_t) int32
int pthread_mutex_trylock(pthread_mutex_t *mutex);
func Xpthread_mutex_unlock ¶
func Xpthread_mutex_unlock(tls *TLS, mutex *Xpthread_mutex_t) int32
extern int pthread_mutex_unlock(pthread_mutex_t * __mutex);
func Xpthread_mutexattr_destroy ¶
func Xpthread_mutexattr_destroy(tls *TLS, attr *Xpthread_mutexattr_t) int32
extern int pthread_mutexattr_destroy(pthread_mutexattr_t * __attr);
func Xpthread_mutexattr_init ¶
func Xpthread_mutexattr_init(tls *TLS, attr *Xpthread_mutexattr_t) int32
extern int pthread_mutexattr_init(pthread_mutexattr_t * __attr);
func Xpthread_mutexattr_settype ¶
func Xpthread_mutexattr_settype(tls *TLS, attr *Xpthread_mutexattr_t, kind int32) int32
extern int pthread_mutexattr_settype(pthread_mutexattr_t * __attr, int __kind);
func Xqsort ¶
func Xqsort(tls *TLS, base unsafe.Pointer, nmemb, size uint64, compar func(tls *TLS, a, b unsafe.Pointer) int32)
void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *));
func Xstrerror_r ¶
int strerror_r(int errnum, char *buf, size_t buflen);
Types ¶
type TLS ¶
type TLS struct {
// contains filtered or unexported fields
}
TLS represents the C-thread local storage.
type XCRITICAL_SECTION ¶
type XHMODULE ¶
type XHMODULE struct {
X0 int32
}
func XLoadLibraryA ¶
//sys: HMODULE LoadLibraryA(LPCTSTR lpFileName);
func XLoadLibraryW ¶
//sys: HMODULE LoadLibraryW(LPCWSTR lpFileName);
type XLARGE_INTEGER ¶
type XOSVERSIONINFOA ¶
type XOSVERSIONINFOW ¶
type XOVERLAPPED ¶
type XSECURITY_ATTRIBUTES ¶
type XSYSTEMTIME ¶
type XSYSTEM_INFO ¶
type Xpthread_attr_t ¶
type Xpthread_cond_t ¶
type Xpthread_cond_t struct { X [0]struct { X__size [48]int8 X__align int64 // contains filtered or unexported fields } U [48]byte } // t4 union{__data struct{__lock int32,__futex uint32,__total_seq uint64,__wakeup_seq uint64,__woken_seq uint64,__mutex *struct{},__nwaiters uint32,__broadcast_seq uint32},__size [48]int8,__align int64}
type Xpthread_mutex_t ¶
type Xpthread_mutex_t struct { X [0]struct { X0 struct { X0 int32 X1 uint32 X2 int32 X3 uint32 X4 int32 X5 int16 X6 int16 X7 struct { X0 unsafe.Pointer X1 unsafe.Pointer } } X__size [40]int8 X__align int64 } U [40]byte } // union{__data struct{__lock int32,__count uint32,__owner int32,__nusers uint32,__kind int32,__spins int16,__elision int16,__list struct{__prev *struct{},__next *struct{}}},__size [40]int8,__align int64}
type Xpthread_mutexattr_t ¶
Source Files ¶
- assert.go
- atoi.go
- builtin.go
- ctype.go
- ctype_b_loc.go
- dlfcn.go
- errno.go
- etc.go
- fcntl_windows.go
- malloc_amd64.go
- math.go
- pthread.go
- pthread64.go
- ptrace_disabled.go
- sched.go
- stdarg.go
- stdarg64.go
- stdio64_windows.go
- stdio_windows.go
- stdlib.go
- stdlib64.go
- strace_disabled.go
- string.go
- string64.go
- strings.go
- strings64.go
- time.go
- time64_windows.go
- unistd64_windows.go
- unistd_common.go
- windows.go
- windows_amd64.go
- windows_impl_amd64.go