llgo/c/hyper-related c lib
This commit is contained in:
13
c/fddef/_wrap/fddef.c
Normal file
13
c/fddef/_wrap/fddef.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
int fd_isset(int n, fd_set *fd) {
|
||||
return FD_ISSET(n, fd);
|
||||
}
|
||||
|
||||
void fdSet(int n, fd_set *fd) {
|
||||
FD_SET(n, fd);
|
||||
}
|
||||
|
||||
void fd_zero(fd_set *fd) {
|
||||
FD_ZERO(fd);
|
||||
}
|
||||
24
c/fddef/fddef.go
Normal file
24
c/fddef/fddef.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package fddef
|
||||
|
||||
import (
|
||||
"github.com/goplus/llgo/c"
|
||||
_ "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
LLGoFiles = "_wrap/fddef.c"
|
||||
LLGoPackage = "link: c"
|
||||
)
|
||||
|
||||
type FdSet struct {
|
||||
Unused [8]byte
|
||||
}
|
||||
|
||||
//go:linkname FdZero C.fd_zero
|
||||
func FdZero(fdSet *FdSet)
|
||||
|
||||
//go:linkname Fdset C.fdSet
|
||||
func Fdset(fd c.Int, fdSet *FdSet)
|
||||
|
||||
//go:linkname FdIsset C.fd_isset
|
||||
func FdIsset(fd c.Int, fdSet *FdSet) c.Int
|
||||
Reference in New Issue
Block a user