1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

add missing cfns

This commit is contained in:
Unknown User 2019-11-25 02:35:41 +01:00 committed by Alexander Medvednikov
parent 5794594e19
commit 268a6dc6d9
4 changed files with 18 additions and 5 deletions

View File

@ -144,8 +144,21 @@ fn C.FindClose()
fn C.MAKELANGID() int fn C.MAKELANGID() int
fn C.FormatMessage() voidptr fn C.FormatMessage() voidptr
fn C.CloseHandle() fn C.CloseHandle()
fn C.WaitForSingleObject()
fn C.GetExitCodeProcess() fn C.GetExitCodeProcess()
fn C.RegOpenKeyEx() voidptr fn C.RegOpenKeyEx() voidptr
fn C.GetTickCount() i64 fn C.GetTickCount() i64
fn C.Sleep()
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
fn C.ReleaseMutex(voidptr) bool

View File

@ -67,7 +67,7 @@ fn C.ftell(fp voidptr) int
fn C.getenv(byteptr) byteptr fn C.getenv(byteptr) byteptr
fn C.sigaction(int, voidptr, int) fn C.sigaction(int, voidptr, int)
fn C.GetLastError() u32
// read_bytes reads an amount of bytes from the beginning of the file // read_bytes reads an amount of bytes from the beginning of the file
pub fn (f File) read_bytes(size int) []byte { pub fn (f File) read_bytes(size int) []byte {

View File

@ -130,7 +130,7 @@ pub fn dir_exists(path string) bool {
return false return false
} }
fn C.CreateDirectory(byteptr, int) bool
// mkdir creates a new directory with the specified path. // mkdir creates a new directory with the specified path.
pub fn mkdir(path string) ?bool { pub fn mkdir(path string) ?bool {

View File

@ -77,7 +77,7 @@ pub fn (m mut Mutex) lock() {
pub fn (m mut Mutex) unlock() { pub fn (m mut Mutex) unlock() {
if m.state == .waiting { if m.state == .waiting {
if C.ReleaseMutex(m.mx) != 0 { if ReleaseMutex(m.mx) {
m.state = .broken m.state = .broken
return return
} }