// Parse constructs and ACL from a string representation. func Parse(s string) (*ACL, error) { cs := C.CString(s) cacl, _ := C.acl_from_text(cs) if cacl == nil { return nil, fmt.Errorf("unable to parse ACL") } return &ACL{cacl}, nil }
func NewFromString(s string) (self *ACL, e error) { cs := C.CString(s) ptr, err := C.acl_from_text(cs) if err != nil { return nil, err } ret, err := C.acl_valid(ptr) if ret != 0 && err != nil { return nil, err } self = &ACL{ptr: ptr} return self, nil }