2019-10-24 13:51:22 +02:00
|
|
|
module builtin
|
|
|
|
|
2019-10-25 11:07:50 +02:00
|
|
|
|
2019-10-26 10:14:16 +02:00
|
|
|
// <string.h>
|
2019-10-26 10:43:25 +02:00
|
|
|
fn C.memcpy(byteptr, byteptr, int) voidptr
|
2019-10-26 10:51:22 +02:00
|
|
|
fn C.memmove(byteptr, byteptr, int) voidptr
|
2019-10-26 10:14:16 +02:00
|
|
|
|
2019-10-24 13:51:22 +02:00
|
|
|
//fn C.malloc(int) byteptr
|
2019-10-24 14:41:29 +02:00
|
|
|
fn C.realloc(a byteptr, b int) byteptr
|
|
|
|
|
|
|
|
fn C.qsort(voidptr, int, int, voidptr)
|
|
|
|
|
|
|
|
fn C.sprintf(a ...voidptr) byteptr
|
2019-10-25 11:07:50 +02:00
|
|
|
fn C.strlen(s byteptr) int
|
2019-10-25 22:41:18 +02:00
|
|
|
fn C.isdigit(s byteptr) bool
|
2019-10-25 11:07:50 +02:00
|
|
|
|
2019-10-31 22:52:08 +01:00
|
|
|
// stdio.h
|
|
|
|
fn C.popen(c byteptr, t byteptr) voidptr
|
2019-10-26 10:14:16 +02:00
|
|
|
|
2019-10-26 00:55:16 +02:00
|
|
|
// <execinfo.h>
|
2019-10-25 16:59:41 +02:00
|
|
|
fn backtrace(a voidptr, b int) int
|
2019-10-31 22:52:08 +01:00
|
|
|
fn backtrace_symbols(voidptr, int) &byteptr
|
2019-10-25 16:59:41 +02:00
|
|
|
fn backtrace_symbols_fd(voidptr, int, int)
|
2019-10-25 11:07:50 +02:00
|
|
|
|
2019-10-26 00:55:16 +02:00
|
|
|
// <libproc.h>
|
2019-10-26 01:19:14 +02:00
|
|
|
fn proc_pidpath(int, voidptr, int) int
|
2019-10-26 00:55:16 +02:00
|
|
|
|
2019-11-14 23:07:38 +01:00
|
|
|
fn C.realpath(byteptr, byteptr) &char
|
|
|
|
|
2019-10-24 14:41:29 +02:00
|
|
|
|
|
|
|
|
2019-11-24 04:27:02 +01:00
|
|
|
|
2019-11-25 11:54:07 +01:00
|
|
|
fn C.chmod(byteptr, int) int
|
|
|
|
fn C.printf(byteptr, ...byteptr) int
|
|
|
|
fn C.fputs(byteptr) int
|
2019-11-24 04:27:02 +01:00
|
|
|
fn C.fflush(byteptr) int
|
|
|
|
// TODO define args in these functions
|
|
|
|
fn C.fseek() int
|
|
|
|
fn C.fopen() int
|
|
|
|
fn C.fwrite() int
|
|
|
|
fn C.fclose() int
|
|
|
|
fn C.pclose() int
|
|
|
|
fn C.system() int
|
|
|
|
fn C.setenv() int
|
|
|
|
fn C.unsetenv() int
|
|
|
|
fn C.access() int
|
|
|
|
fn C.remove() int
|
|
|
|
fn C.rmdir() int
|
|
|
|
fn C.chdir() int
|
|
|
|
fn C.fread() int
|
|
|
|
fn C.rewind() int
|
|
|
|
fn C.stat() int
|
2019-12-04 21:53:11 +01:00
|
|
|
fn C.lstat() int
|
2019-11-24 04:27:02 +01:00
|
|
|
fn C.rename() int
|
|
|
|
fn C.fgets() int
|
|
|
|
fn C.memset() int
|
|
|
|
fn C.sigemptyset() int
|
|
|
|
fn C.getcwd() int
|
|
|
|
fn C.signal() int
|
|
|
|
fn C.mktime() int
|
|
|
|
fn C.gettimeofday() int
|
|
|
|
fn C.sleep() int
|
|
|
|
fn C.usleep() int
|
|
|
|
fn C.opendir() voidptr
|
|
|
|
fn C.closedir() int
|
|
|
|
fn C.mkdir() int
|
|
|
|
fn C.srand() int
|
|
|
|
fn C.atof() int
|
|
|
|
fn C.tolower() int
|
|
|
|
fn C.toupper() int
|
|
|
|
fn C.getchar() int
|
2019-12-02 09:37:35 +01:00
|
|
|
fn C.strerror() charptr
|
2019-11-24 04:27:02 +01:00
|
|
|
fn C.snprintf() int
|
|
|
|
fn C.fprintf(byteptr, ...byteptr)
|
|
|
|
|
|
|
|
fn C.WIFEXITED() bool
|
|
|
|
fn C.WEXITSTATUS() int
|
|
|
|
fn C.WIFSIGNALED() bool
|
|
|
|
fn C.WTERMSIG() int
|
|
|
|
fn C.DEFAULT_LE() bool
|
|
|
|
fn C.DEFAULT_EQ() bool
|
|
|
|
fn C.DEFAULT_GT() bool
|
|
|
|
fn C.DEFAULT_EQUAL() bool
|
|
|
|
fn C.DEFAULT_NOT_EQUAL() bool
|
|
|
|
fn C.DEFAULT_LT() bool
|
|
|
|
fn C.DEFAULT_GE() bool
|
|
|
|
fn C.isatty() int
|
|
|
|
|
2019-11-22 17:00:56 +01:00
|
|
|
fn C.syscall() int
|
2019-12-04 00:01:17 +01:00
|
|
|
fn C.sysctl() int
|
2019-11-22 17:00:56 +01:00
|
|
|
|
2019-11-24 04:27:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-24 13:16:05 +01:00
|
|
|
|
2019-10-24 14:41:29 +02:00
|
|
|
// Windows
|
2019-11-25 11:54:07 +01:00
|
|
|
fn C._setmode(int, int) int
|
2019-10-24 14:41:29 +02:00
|
|
|
fn C._fileno(int) int
|
2019-11-16 00:30:50 +01:00
|
|
|
fn C._get_osfhandle(fd int) C.intptr_t
|
|
|
|
fn C.GetModuleFileNameW(hModule voidptr, lpFilename &u16, nSize u32) u32
|
|
|
|
fn C.CreatePipe(hReadPipe &voidptr, hWritePipe &voidptr, lpPipeAttributes voidptr, nSize u32) bool
|
|
|
|
fn C.SetHandleInformation(hObject voidptr, dwMask u32, dwFlags u32) bool
|
|
|
|
fn C.ExpandEnvironmentStringsW(lpSrc &u16, lpDst &u16, nSize u32) u32
|
|
|
|
fn C.CreateProcessW(lpApplicationName &u16, lpCommandLine &u16, lpProcessAttributes voidptr, lpThreadAttributes voidptr, bInheritHandles bool, dwCreationFlags u32, lpEnvironment voidptr, lpCurrentDirectory &u16, lpStartupInfo voidptr, lpProcessInformation voidptr) bool
|
|
|
|
fn C.ReadFile(hFile voidptr, lpBuffer voidptr, nNumberOfBytesToRead u32, lpNumberOfBytesRead voidptr, lpOverlapped voidptr) bool
|
|
|
|
fn C.GetFileAttributesW(lpFileName byteptr) u32
|
|
|
|
fn C.RegQueryValueExW(hKey voidptr, lpValueName &u16, lpReserved &u32, lpType &u32, lpData byteptr, lpcbData &u32) int
|
|
|
|
fn C.RegOpenKeyExW(hKey voidptr, lpSubKey &u16, ulOptions u32, samDesired u32, phkResult voidptr) int
|
2019-11-24 13:21:49 +01:00
|
|
|
fn C.RegCloseKey()
|
|
|
|
fn C.RegQueryValueEx() voidptr
|
2019-11-24 04:27:02 +01:00
|
|
|
fn C.RemoveDirectory() int
|
2019-12-05 09:25:55 +01:00
|
|
|
fn C.GetStdHandle() voidptr
|
2019-11-24 11:16:02 +01:00
|
|
|
fn C.SetConsoleMode()
|
2019-11-24 13:16:05 +01:00
|
|
|
fn C.GetConsoleMode() int
|
|
|
|
fn C._putws()
|
2019-11-24 11:16:02 +01:00
|
|
|
fn C.wprintf()
|
2019-11-24 13:16:05 +01:00
|
|
|
fn C.setbuf()
|
|
|
|
fn C.SymCleanup()
|
|
|
|
fn C.MultiByteToWideChar() int
|
|
|
|
fn C.wcslen() int
|
|
|
|
fn C.WideCharToMultiByte() byteptr
|
|
|
|
fn C._wstat()
|
|
|
|
fn C._wrename()
|
|
|
|
fn C._wfopen() voidptr
|
|
|
|
fn C._wpopen() voidptr
|
|
|
|
fn C._pclose() int
|
|
|
|
fn C._wsystem() int
|
|
|
|
fn C._wgetenv() voidptr
|
|
|
|
fn C._putenv() int
|
|
|
|
fn C._waccess() int
|
|
|
|
fn C._wremove()
|
|
|
|
fn C.ReadConsole()
|
2019-12-05 09:25:55 +01:00
|
|
|
fn C.fgetws() voidptr
|
2019-11-24 13:16:05 +01:00
|
|
|
fn C.GetModuleFileName() int
|
|
|
|
fn C._wchdir()
|
|
|
|
fn C._wgetcwd() int
|
|
|
|
fn C._fullpath() int
|
|
|
|
fn C.GetCommandLine() voidptr
|
2019-11-24 13:21:49 +01:00
|
|
|
fn C.CommandLineToArgvW() &voidptr
|
2019-11-24 13:16:05 +01:00
|
|
|
fn C.LocalFree()
|
|
|
|
fn C.FindFirstFileW() voidptr
|
|
|
|
fn C.FindFirstFile() voidptr
|
|
|
|
fn C.FindNextFile() voidptr
|
|
|
|
fn C.FindClose()
|
|
|
|
fn C.MAKELANGID() int
|
|
|
|
fn C.FormatMessage() voidptr
|
|
|
|
fn C.CloseHandle()
|
2019-11-24 13:21:49 +01:00
|
|
|
fn C.GetExitCodeProcess()
|
2019-11-24 13:29:11 +01:00
|
|
|
fn C.RegOpenKeyEx() voidptr
|
2019-11-24 13:31:51 +01:00
|
|
|
fn C.GetTickCount() i64
|
2019-11-25 02:35:41 +01:00
|
|
|
|
|
|
|
fn C.Sleep()
|
|
|
|
fn C.WSAStartup(u16, &voidptr) int
|
|
|
|
fn C.WSAGetLastError() int
|
|
|
|
fn C.closesocket(int) int
|
|
|
|
fn C.vschannel_init(&C.TlsContext)
|
|
|
|
fn C.request(&C.TlsContext,int, &u16, byteptr, &byteptr)
|
|
|
|
fn C.vschannel_cleanup(&C.TlsContext)
|
|
|
|
fn C.URLDownloadToFile(int, &u16,&u16, int, int)
|
|
|
|
fn C.GetLastError() u32
|
|
|
|
fn C.CreateDirectory(byteptr, int) bool
|
|
|
|
fn C.BCryptGenRandom(int,voidptr,int,int) int
|
|
|
|
fn C.CreateMutex(int,bool,byteptr) voidptr
|
|
|
|
fn C.WaitForSingleObject(voidptr,int) int
|
2019-12-01 08:33:26 +01:00
|
|
|
fn C.ReleaseMutex(voidptr) bool
|