コード例 #1
0
ファイル: lucy.go プロジェクト: lazycrazyowl/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_C32(outstream, C.uint32_t(ivars.doc_id))
}
コード例 #2
0
ファイル: lucy.go プロジェクト: kidaa/lucy
//export GOLUCY_Doc_Serialize
func GOLUCY_Doc_Serialize(d *C.lucy_Doc, outstream *C.lucy_OutStream) {
	ivars := C.lucy_Doc_IVARS(d)
	hash := (*C.cfish_Hash)(ivars.fields)
	C.lucy_Freezer_serialize_hash(hash, outstream)
	C.LUCY_OutStream_Write_C32(outstream, C.uint32_t(ivars.doc_id))
}