Exemple #1
0
// Check can be used to check the validity of entries in the given
// database files.
//
// We expect a colon separated list of database file paths.
func (m *Magic) Check(file string) error {
	if m.ptr == nil {
		return ConnectionError
	}

	cf := C.CString(file)
	defer C.free(unsafe.Pointer(cf))

	C.magic_check(m.ptr, cf)
	return m.check()
}
Exemple #2
0
func Check(cookie Magic_t, filename string) int {
	cfilename := C.CString(filename)
	defer C.free(unsafe.Pointer(cfilename))
	return (int)(C.magic_check(cookie, cfilename))
}