Beispiel #1
0
func (r *Rules) Save(path string) error {
	cpath := C.CString(path)
	code := C.yr_rules_save(r.handle, cpath)
	C.free(unsafe.Pointer(cpath))

	if code != C.ERROR_SUCCESS {
		return Error(code)
	}

	return nil
}
Beispiel #2
0
// Save writes a compiled ruleset to filename.
func (r *Rules) Save(filename string) (err error) {
	cfilename := C.CString(filename)
	defer C.free(unsafe.Pointer(cfilename))
	err = newError(C.yr_rules_save(r.cptr, cfilename))
	return
}