예제 #1
0
파일: lucy.go 프로젝트: apache/lucy
//export GOLUCY_Doc_Serialize
func GOLUCY_Doc_Serialize(d *C.lucy_Doc, outstream *C.lucy_OutStream) {
	ivars := C.lucy_Doc_IVARS(d)
	fields := fetchDocFields(d)
	hash := clownfish.GoToClownfish(fields, unsafe.Pointer(C.CFISH_HASH), false)
	defer C.cfish_decref(hash)
	C.lucy_Freezer_serialize_hash((*C.cfish_Hash)(hash), outstream)
	C.LUCY_OutStream_Write_CI32(outstream, ivars.doc_id)
}
예제 #2
0
파일: store.go 프로젝트: rlugojr/lucy
func (out *OutStreamIMP) WriteCI32(value int32) error {
	return clownfish.TrapErr(func() {
		self := (*C.lucy_OutStream)(clownfish.Unwrap(out, "out"))
		C.LUCY_OutStream_Write_CI32(self, C.int32_t(value))
	})
}