github.com/gotranspile/cxgo@v0.3.8-0.20240118201721-29871598a6a2/libs/sys_types.go (about) 1 package libs 2 3 import ( 4 "github.com/gotranspile/cxgo/runtime/csys" 5 "github.com/gotranspile/cxgo/types" 6 ) 7 8 const ( 9 sysTypesH = "sys/types.h" 10 ) 11 12 func init() { 13 RegisterLibrary(sysTypesH, func(c *Env) *Library { 14 intT := types.IntT(4) 15 return &Library{ 16 Idents: map[string]*types.Ident{ 17 "O_RDONLY": c.NewIdent("O_RDONLY", "csys.O_RDONLY", csys.O_RDONLY, intT), 18 "O_WRONLY": c.NewIdent("O_WRONLY", "csys.O_WRONLY", csys.O_WRONLY, intT), 19 "O_RDWR": c.NewIdent("O_RDWR", "csys.O_RDWR", csys.O_RDWR, intT), 20 "O_CREAT": c.NewIdent("O_CREAT", "csys.O_CREAT", csys.O_CREAT, intT), 21 "O_EXCL": c.NewIdent("O_EXCL", "csys.O_EXCL", csys.O_EXCL, intT), 22 "O_TRUNC": c.NewIdent("O_TRUNC", "csys.O_TRUNC", csys.O_TRUNC, intT), 23 }, 24 } 25 }) 26 }