mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
checker: define missing C fn args & check C & JS args (#8770)
This commit is contained in:
parent
ead2ba6004
commit
2d73411396
34 changed files with 358 additions and 284 deletions
|
@ -45,9 +45,10 @@ pub fn proc_pidpath(int, voidptr, int) int
|
|||
|
||||
fn C.realpath(charptr, charptr) &char
|
||||
|
||||
fn C.chmod(byteptr, int) int
|
||||
// fn C.chmod(byteptr, mode_t) int
|
||||
fn C.chmod(byteptr, u32) int
|
||||
|
||||
fn C.printf(byteptr, ...byteptr) int
|
||||
fn C.printf(byteptr, ...voidptr) int
|
||||
|
||||
fn C.puts(byteptr) int
|
||||
|
||||
|
@ -56,7 +57,7 @@ fn C.fputs(str byteptr, stream &C.FILE) int
|
|||
fn C.fflush(&C.FILE) int
|
||||
|
||||
// TODO define args in these functions
|
||||
fn C.fseek() int
|
||||
fn C.fseek(stream &C.FILE, offset int, whence int) int
|
||||
|
||||
fn C.fopen(filename charptr, mode charptr) &C.FILE
|
||||
|
||||
|
@ -66,9 +67,9 @@ fn C.fread(ptr voidptr, item_size size_t, items size_t, stream &C.FILE) size_t
|
|||
|
||||
fn C.fwrite(ptr voidptr, item_size size_t, items size_t, stream &C.FILE) size_t
|
||||
|
||||
fn C.fclose() int
|
||||
fn C.fclose(stream &C.FILE) int
|
||||
|
||||
fn C.pclose() int
|
||||
fn C.pclose(stream &C.FILE) int
|
||||
|
||||
// process execution, os.process:
|
||||
fn C.getpid() int
|
||||
|
@ -94,25 +95,25 @@ fn C.setenv(charptr, charptr, int) int
|
|||
|
||||
fn C.unsetenv(charptr) int
|
||||
|
||||
fn C.access() int
|
||||
fn C.access(path charptr, amode int) int
|
||||
|
||||
fn C.remove() int
|
||||
fn C.remove(filename charptr) int
|
||||
|
||||
fn C.rmdir() int
|
||||
fn C.rmdir(path charptr) int
|
||||
|
||||
fn C.chdir() int
|
||||
fn C.chdir(path charptr) int
|
||||
|
||||
fn C.rewind() int
|
||||
fn C.rewind(stream &C.FILE) int
|
||||
|
||||
fn C.stat(charptr, voidptr) int
|
||||
|
||||
fn C.lstat() int
|
||||
fn C.lstat(path charptr, buf &C.stat) int
|
||||
|
||||
fn C.rename() int
|
||||
fn C.rename(old_filename charptr, new_filename charptr) int
|
||||
|
||||
fn C.fgets() int
|
||||
fn C.fgets(str charptr, n int, stream &C.FILE) int
|
||||
|
||||
fn C.memset() int
|
||||
fn C.memset(str voidptr, c int, n size_t) int
|
||||
|
||||
fn C.sigemptyset() int
|
||||
|
||||
|
@ -122,18 +123,20 @@ fn C.signal(signal int, handlercb voidptr) voidptr
|
|||
|
||||
fn C.mktime() int
|
||||
|
||||
fn C.gettimeofday() int
|
||||
fn C.gettimeofday(tv &C.timeval, tz &C.timezone) int
|
||||
|
||||
[trusted]
|
||||
fn C.sleep(int) int
|
||||
fn C.sleep(seconds u32) u32
|
||||
|
||||
fn C.usleep() int
|
||||
// fn C.usleep(usec useconds_t) int
|
||||
fn C.usleep(usec u32) int
|
||||
|
||||
fn C.opendir(charptr) voidptr
|
||||
|
||||
fn C.closedir() int
|
||||
fn C.closedir(dirp &C.DIR) int
|
||||
|
||||
fn C.mkdir() int
|
||||
// fn C.mkdir(path charptr, mode mode_t) int
|
||||
fn C.mkdir(path charptr, mode u32) int
|
||||
|
||||
// C.rand returns a pseudorandom integer from 0 (inclusive) to C.RAND_MAX (exclusive)
|
||||
[trusted]
|
||||
|
@ -141,13 +144,13 @@ fn C.rand() int
|
|||
|
||||
// C.srand seeds the internal PRNG with the given value.
|
||||
[trusted]
|
||||
fn C.srand(seed uint)
|
||||
fn C.srand(seed u32)
|
||||
|
||||
fn C.atof() int
|
||||
fn C.atof(str charptr) f64
|
||||
|
||||
fn C.tolower() int
|
||||
fn C.tolower(c int) int
|
||||
|
||||
fn C.toupper() int
|
||||
fn C.toupper(c int) int
|
||||
|
||||
[trusted]
|
||||
fn C.getchar() int
|
||||
|
@ -155,33 +158,33 @@ fn C.getchar() int
|
|||
[trusted]
|
||||
fn C.strerror(int) charptr
|
||||
|
||||
fn C.snprintf() int
|
||||
fn C.snprintf(str charptr, size size_t, format charptr, opt ...voidptr) int
|
||||
|
||||
fn C.fprintf(byteptr, ...byteptr)
|
||||
|
||||
fn C.WIFEXITED() bool
|
||||
fn C.WIFEXITED(status int) bool
|
||||
|
||||
fn C.WEXITSTATUS() int
|
||||
fn C.WEXITSTATUS(status int) int
|
||||
|
||||
fn C.WIFSIGNALED() bool
|
||||
fn C.WIFSIGNALED(status int) bool
|
||||
|
||||
fn C.WTERMSIG() int
|
||||
fn C.WTERMSIG(status int) int
|
||||
|
||||
fn C.isatty() int
|
||||
fn C.isatty(fd int) int
|
||||
|
||||
fn C.syscall() int
|
||||
fn C.syscall(number int, va ...voidptr) int
|
||||
|
||||
fn C.sysctl() int
|
||||
fn C.sysctl(name &int, namelen u32, oldp voidptr, oldlenp voidptr, newp voidptr, newlen size_t) int
|
||||
|
||||
fn C._fileno(int) int
|
||||
|
||||
fn C._get_osfhandle(fd int) C.intptr_t
|
||||
|
||||
fn C.GetModuleFileName() int
|
||||
fn C.GetModuleFileName(hModule voidptr, lpFilename &u16, nSize u32) int
|
||||
|
||||
fn C.GetModuleFileNameW(hModule voidptr, lpFilename &u16, nSize u32) u32
|
||||
|
||||
fn C.CreateFile() voidptr
|
||||
fn C.CreateFile(lpFilename &u16, dwDesiredAccess u32, dwShareMode u32, lpSecurityAttributes &u16, dwCreationDisposition u32, dwFlagsAndAttributes u32, hTemplateFile voidptr) voidptr
|
||||
|
||||
fn C.CreateFileW(lpFilename &u16, dwDesiredAccess u32, dwShareMode u32, lpSecurityAttributes &u16, dwCreationDisposition u32, dwFlagsAndAttributes u32, hTemplateFile voidptr) u32
|
||||
|
||||
|
@ -203,11 +206,11 @@ fn C.ReadFile(hFile voidptr, lpBuffer voidptr, nNumberOfBytesToRead u32, lpNumbe
|
|||
|
||||
fn C.GetFileAttributesW(lpFileName byteptr) u32
|
||||
|
||||
fn C.RegQueryValueEx() voidptr
|
||||
fn C.RegQueryValueEx(hKey voidptr, lpValueName &u16, lp_reserved &u32, lpType &u32, lpData byteptr, lpcbData &u32) voidptr
|
||||
|
||||
fn C.RegQueryValueExW(hKey voidptr, lpValueName &u16, lp_reserved &u32, lpType &u32, lpData byteptr, lpcbData &u32) int
|
||||
|
||||
fn C.RegOpenKeyEx() voidptr
|
||||
fn C.RegOpenKeyEx(hKey voidptr, lpSubKey &u16, ulOptions u32, samDesired u32, phkResult voidptr) voidptr
|
||||
|
||||
fn C.RegOpenKeyExW(hKey voidptr, lpSubKey &u16, ulOptions u32, samDesired u32, phkResult voidptr) int
|
||||
|
||||
|
@ -215,9 +218,9 @@ fn C.RegSetValueEx() voidptr
|
|||
|
||||
fn C.RegSetValueExW(hKey voidptr, lpValueName &u16, Reserved u32, dwType u32, lpData byteptr, lpcbData u32) int
|
||||
|
||||
fn C.RegCloseKey()
|
||||
fn C.RegCloseKey(hKey voidptr)
|
||||
|
||||
fn C.RemoveDirectory() int
|
||||
fn C.RemoveDirectory(lpPathName charptr) int
|
||||
|
||||
// fn C.GetStdHandle() voidptr
|
||||
fn C.GetStdHandle(u32) voidptr
|
||||
|
@ -235,33 +238,33 @@ fn C.wprintf()
|
|||
// fn C.setbuf()
|
||||
fn C.setbuf(voidptr, charptr)
|
||||
|
||||
fn C.SymCleanup()
|
||||
fn C.SymCleanup(hProcess voidptr)
|
||||
|
||||
fn C.MultiByteToWideChar() int
|
||||
fn C.MultiByteToWideChar(codePage u32, dwFlags u32, lpMultiMyteStr charptr, cbMultiByte int, lpWideCharStr &u16, cchWideChar int) int
|
||||
|
||||
fn C.wcslen() int
|
||||
fn C.wcslen(str &u16) int
|
||||
|
||||
fn C.WideCharToMultiByte() int
|
||||
fn C.WideCharToMultiByte(codePage u32, dwFlags u32, lpWideCharStr &u16, cchWideChar int, lpMultiByteStr charptr, cbMultiByte int, lpDefaultChar charptr, lpUsedDefaultChar &int) int
|
||||
|
||||
fn C._wstat()
|
||||
fn C._wstat(path &u16, buffer &C._stat)
|
||||
|
||||
fn C._wrename() int
|
||||
fn C._wrename(oldname &u16, newname &u16) int
|
||||
|
||||
fn C._wfopen() voidptr
|
||||
fn C._wfopen(filename &u16, mode &u16) voidptr
|
||||
|
||||
fn C._wpopen() voidptr
|
||||
fn C._wpopen(command &u16, mode &u16) voidptr
|
||||
|
||||
fn C._pclose() int
|
||||
fn C._pclose(stream &C.FILE) int
|
||||
|
||||
fn C._wsystem() int
|
||||
fn C._wsystem(command &u16) int
|
||||
|
||||
fn C._wgetenv() voidptr
|
||||
fn C._wgetenv(varname &u16) voidptr
|
||||
|
||||
fn C._putenv() int
|
||||
fn C._putenv(envstring charptr) int
|
||||
|
||||
fn C._waccess() int
|
||||
fn C._waccess(path &u16, mode int) int
|
||||
|
||||
fn C._wremove() int
|
||||
fn C._wremove(path &u16) int
|
||||
|
||||
fn C.ReadConsole(in_input_handle voidptr, out_buffer voidptr, in_chars_to_read u32, out_read_chars &u32, in_input_control voidptr) bool
|
||||
|
||||
|
@ -269,9 +272,9 @@ fn C.WriteConsole() voidptr
|
|||
|
||||
fn C.WriteFile() voidptr
|
||||
|
||||
fn C._wchdir()
|
||||
fn C._wchdir(dirname &u16)
|
||||
|
||||
fn C._wgetcwd() int
|
||||
fn C._wgetcwd(buffer &u16, maxlen int) int
|
||||
|
||||
fn C._fullpath() int
|
||||
|
||||
|
@ -281,25 +284,26 @@ fn C.GetCommandLine() voidptr
|
|||
|
||||
fn C.LocalFree()
|
||||
|
||||
fn C.FindFirstFileW() voidptr
|
||||
fn C.FindFirstFileW(lpFileName &u16, lpFindFileData voidptr) voidptr
|
||||
|
||||
fn C.FindFirstFile() voidptr
|
||||
fn C.FindFirstFile(lpFileName byteptr, lpFindFileData voidptr) voidptr
|
||||
|
||||
fn C.FindNextFile() int
|
||||
fn C.FindNextFile(hFindFile voidptr, lpFindFileData voidptr) int
|
||||
|
||||
fn C.FindClose()
|
||||
fn C.FindClose(hFindFile voidptr)
|
||||
|
||||
fn C.MAKELANGID() int
|
||||
// macro
|
||||
fn C.MAKELANGID(lgid voidptr, srtid voidptr) int
|
||||
|
||||
fn C.FormatMessage() voidptr
|
||||
fn C.FormatMessage(dwFlags u32, lpSource voidptr, dwMessageId u32, dwLanguageId u32, lpBuffer voidptr, nSize int, Arguments ...voidptr) voidptr
|
||||
|
||||
fn C.CloseHandle(voidptr) int
|
||||
|
||||
fn C.GetExitCodeProcess()
|
||||
fn C.GetExitCodeProcess(hProcess voidptr, lpExitCode &u32)
|
||||
|
||||
fn C.GetTickCount() i64
|
||||
|
||||
fn C.Sleep()
|
||||
fn C.Sleep(dwMilliseconds u32)
|
||||
|
||||
fn C.WSAStartup(u16, &voidptr) int
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue