func (r *Rule) Disable() {
	C.yr_rule_disable(r.cptr)
}
Disable disables a single rule.
package yara
import "C"
import "unsafe"
type Rule struct {
	cptr *C.YR_RULE
	rules *Rules
}
func (r *Rule) Identifier() string {
	return C.GoString(C.rule_identifier(r.cptr))
}
func (r *Rule) Namespace() string {
	return C.GoString(C.rule_namespace(r.cptr))
}
func (r *Rule) Tags() (tags []string) {
	var size C.int
	C.rule_tags(r.cptr, nil, &size)
	if size == 0 {
		return
	}
	tagptrs := make([]*C.char, int(size))
	C.rule_tags(r.cptr, &tagptrs[0], &size)
	for _, t := range tagptrs {
		tags = append(tags, C.GoString(t))
	}
	return
}
type Meta struct {
	Identifier string
	Value      interface{}
}
func (r *Rule) Metas() (metas []Meta) {
	var size C.int
	C.rule_metas(r.cptr, nil, &size)
	if size == 0 {
		return
	}
	mptrs := make([]*C.YR_META, int(size))
	C.rule_metas(r.cptr, &mptrs[0], &size)
	for _, cptr := range mptrs {
		var cid, cstr *C.char
		C.meta_get(cptr, &cid, &cstr)
		id := C.GoString(cid)
		var val interface{}
		switch cptr._type {
		case C.META_TYPE_STRING:
			val = C.GoString(cstr)
		case C.META_TYPE_INTEGER:
			val = int(cptr.integer)
		case C.META_TYPE_BOOLEAN:
			val = (cptr.integer != 0)
		}
		metas = append(metas, Meta{id, val})
	}
	return
}
func (r *Rule) IsPrivate() bool {
	return r.cptr.flags&C.RULE_FLAGS_PRIVATE != 0
}
func (r *Rule) IsGlobal() bool {
	return r.cptr.flags&C.RULE_FLAGS_GLOBAL != 0
}
type String struct {
	cptr *C.YR_STRING
	rules *Rules
}
func (r *Rule) Strings() (strs []String) {
	var size C.int
	C.rule_strings(r.cptr, nil, &size)
	if size == 0 {
		return
	}
	ptrs := make([]*C.YR_STRING, int(size))
	C.rule_strings(r.cptr, &ptrs[0], &size)
	for _, ptr := range ptrs {
		strs = append(strs, String{ptr, r.rules})
	}
	return
}
func (s *String) Identifier() string {
	return C.GoString(C.string_identifier(s.cptr))
}
type Match struct {
	cptr *C.YR_MATCH
	rules *Rules
}
func (s *String) Matches(sc *ScanContext) (matches []Match) {
	if sc == nil || sc.cptr == nil {
		return
	}
	var size C.int
	C.string_matches(sc.cptr, s.cptr, nil, &size)
	ptrs := make([]*C.YR_MATCH, int(size))
	if size == 0 {
		return
	}
	C.string_matches(sc.cptr, s.cptr, &ptrs[0], &size)
	for _, ptr := range ptrs {
		matches = append(matches, Match{ptr, s.rules})
	}
	return
}
func (m *Match) Base() int64 {
	return int64(m.cptr.base)
}
func (m *Match) Offset() int64 {
	return int64(m.cptr.offset)
}
func (m *Match) Data() []byte {
	return C.GoBytes(unsafe.Pointer(m.cptr.data), C.int(m.cptr.data_length))
}
func (r *Rule) getMatchStrings(sc *ScanContext) (matchstrings []MatchString) {
	for _, s := range r.Strings() {
		for _, m := range s.Matches(sc) {
			matchstrings = append(matchstrings, MatchString{
				Name:   s.Identifier(),
				Base:   uint64(m.Base()),
				Offset: uint64(m.Offset()),
				Data:   m.Data(),
			})
		}
	}
	return
}
func (r *Rule) Enable() {
	C.yr_rule_enable(r.cptr)
}