You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2013/09/14 21:29:36 UTC
[lucy-commits] [04/15] Rename _UTF8 and _Str to _Utf8
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Index/SortReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortReader.c b/core/Lucy/Index/SortReader.c
index 7275621..2958422 100644
--- a/core/Lucy/Index/SortReader.c
+++ b/core/Lucy/Index/SortReader.c
@@ -63,12 +63,12 @@ DefSortReader_init(DefaultSortReader *self, Schema *schema, Folder *folder,
seg_tick);
DefaultSortReaderIVARS *const ivars = DefSortReader_IVARS(self);
Segment *segment = DefSortReader_Get_Segment(self);
- Hash *metadata = (Hash*)Seg_Fetch_Metadata_Str(segment, "sort", 4);
+ Hash *metadata = (Hash*)Seg_Fetch_Metadata_Utf8(segment, "sort", 4);
// Check format.
ivars->format = 0;
if (metadata) {
- Obj *format = Hash_Fetch_Str(metadata, "format", 6);
+ Obj *format = Hash_Fetch_Utf8(metadata, "format", 6);
if (!format) { THROW(ERR, "Missing 'format' var"); }
else {
ivars->format = (int32_t)Obj_To_I64(format);
@@ -86,9 +86,9 @@ DefSortReader_init(DefaultSortReader *self, Schema *schema, Folder *folder,
// hashes.
if (metadata) {
ivars->counts
- = (Hash*)INCREF(CERTIFY(Hash_Fetch_Str(metadata, "counts", 6),
+ = (Hash*)INCREF(CERTIFY(Hash_Fetch_Utf8(metadata, "counts", 6),
HASH));
- ivars->null_ords = (Hash*)Hash_Fetch_Str(metadata, "null_ords", 9);
+ ivars->null_ords = (Hash*)Hash_Fetch_Utf8(metadata, "null_ords", 9);
if (ivars->null_ords) {
CERTIFY(ivars->null_ords, HASH);
INCREF(ivars->null_ords);
@@ -96,7 +96,7 @@ DefSortReader_init(DefaultSortReader *self, Schema *schema, Folder *folder,
else {
ivars->null_ords = Hash_new(0);
}
- ivars->ord_widths = (Hash*)Hash_Fetch_Str(metadata, "ord_widths", 10);
+ ivars->ord_widths = (Hash*)Hash_Fetch_Utf8(metadata, "ord_widths", 10);
if (ivars->ord_widths) {
CERTIFY(ivars->ord_widths, HASH);
INCREF(ivars->ord_widths);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Index/SortWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortWriter.c b/core/Lucy/Index/SortWriter.c
index 3adf9de..fe1641c 100644
--- a/core/Lucy/Index/SortWriter.c
+++ b/core/Lucy/Index/SortWriter.c
@@ -236,8 +236,8 @@ SortWriter_Finish_IMP(SortWriter *self) {
VA_Clear(field_writers);
// Store metadata.
- Seg_Store_Metadata_Str(ivars->segment, "sort", 4,
- (Obj*)SortWriter_Metadata(self));
+ Seg_Store_Metadata_Utf8(ivars->segment, "sort", 4,
+ (Obj*)SortWriter_Metadata(self));
// Clean up.
Folder *folder = ivars->folder;
@@ -260,9 +260,9 @@ SortWriter_Metadata_IMP(SortWriter *self) {
= (SortWriter_Metadata_t)SUPER_METHOD_PTR(SORTWRITER,
LUCY_SortWriter_Metadata);
Hash *const metadata = super_meta(self);
- Hash_Store_Str(metadata, "counts", 6, INCREF(ivars->counts));
- Hash_Store_Str(metadata, "null_ords", 9, INCREF(ivars->null_ords));
- Hash_Store_Str(metadata, "ord_widths", 10, INCREF(ivars->ord_widths));
+ Hash_Store_Utf8(metadata, "counts", 6, INCREF(ivars->counts));
+ Hash_Store_Utf8(metadata, "null_ords", 9, INCREF(ivars->null_ords));
+ Hash_Store_Utf8(metadata, "ord_widths", 10, INCREF(ivars->ord_widths));
return metadata;
}
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Plan/BlobType.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Plan/BlobType.c b/core/Lucy/Plan/BlobType.c
index 90ccc4f..5b94640 100644
--- a/core/Lucy/Plan/BlobType.c
+++ b/core/Lucy/Plan/BlobType.c
@@ -64,18 +64,18 @@ Hash*
BlobType_Dump_For_Schema_IMP(BlobType *self) {
BlobTypeIVARS *const ivars = BlobType_IVARS(self);
Hash *dump = Hash_new(0);
- Hash_Store_Str(dump, "type", 4, (Obj*)Str_newf("blob"));
+ Hash_Store_Utf8(dump, "type", 4, (Obj*)Str_newf("blob"));
// Store attributes that override the defaults -- even if they're
// meaningless.
if (ivars->boost != 1.0) {
- Hash_Store_Str(dump, "boost", 5, (Obj*)Str_newf("%f64", ivars->boost));
+ Hash_Store_Utf8(dump, "boost", 5, (Obj*)Str_newf("%f64", ivars->boost));
}
if (ivars->indexed) {
- Hash_Store_Str(dump, "indexed", 7, (Obj*)CFISH_TRUE);
+ Hash_Store_Utf8(dump, "indexed", 7, (Obj*)CFISH_TRUE);
}
if (ivars->stored) {
- Hash_Store_Str(dump, "stored", 6, (Obj*)CFISH_TRUE);
+ Hash_Store_Utf8(dump, "stored", 6, (Obj*)CFISH_TRUE);
}
return dump;
@@ -84,24 +84,24 @@ BlobType_Dump_For_Schema_IMP(BlobType *self) {
Hash*
BlobType_Dump_IMP(BlobType *self) {
Hash *dump = BlobType_Dump_For_Schema(self);
- Hash_Store_Str(dump, "_class", 6,
- (Obj*)Str_Clone(BlobType_Get_Class_Name(self)));
- DECREF(Hash_Delete_Str(dump, "type", 4));
+ Hash_Store_Utf8(dump, "_class", 6,
+ (Obj*)Str_Clone(BlobType_Get_Class_Name(self)));
+ DECREF(Hash_Delete_Utf8(dump, "type", 4));
return dump;
}
BlobType*
BlobType_Load_IMP(BlobType *self, Obj *dump) {
Hash *source = (Hash*)CERTIFY(dump, HASH);
- String *class_name = (String*)Hash_Fetch_Str(source, "_class", 6);
+ String *class_name = (String*)Hash_Fetch_Utf8(source, "_class", 6);
VTable *vtable
= (class_name != NULL && Obj_Is_A((Obj*)class_name, STRING))
? VTable_singleton(class_name, NULL)
: BLOBTYPE;
BlobType *loaded = (BlobType*)VTable_Make_Obj(vtable);
- Obj *boost_dump = Hash_Fetch_Str(source, "boost", 5);
- Obj *indexed_dump = Hash_Fetch_Str(source, "indexed", 7);
- Obj *stored_dump = Hash_Fetch_Str(source, "stored", 6);
+ Obj *boost_dump = Hash_Fetch_Utf8(source, "boost", 5);
+ Obj *indexed_dump = Hash_Fetch_Utf8(source, "indexed", 7);
+ Obj *stored_dump = Hash_Fetch_Utf8(source, "stored", 6);
UNUSED_VAR(self);
BlobType_init(loaded, false);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Plan/FullTextType.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Plan/FullTextType.c b/core/Lucy/Plan/FullTextType.c
index 03fcb3e..30f2919 100644
--- a/core/Lucy/Plan/FullTextType.c
+++ b/core/Lucy/Plan/FullTextType.c
@@ -81,23 +81,23 @@ Hash*
FullTextType_Dump_For_Schema_IMP(FullTextType *self) {
FullTextTypeIVARS *const ivars = FullTextType_IVARS(self);
Hash *dump = Hash_new(0);
- Hash_Store_Str(dump, "type", 4, (Obj*)Str_newf("fulltext"));
+ Hash_Store_Utf8(dump, "type", 4, (Obj*)Str_newf("fulltext"));
// Store attributes that override the defaults.
if (ivars->boost != 1.0) {
- Hash_Store_Str(dump, "boost", 5, (Obj*)Str_newf("%f64", ivars->boost));
+ Hash_Store_Utf8(dump, "boost", 5, (Obj*)Str_newf("%f64", ivars->boost));
}
if (!ivars->indexed) {
- Hash_Store_Str(dump, "indexed", 7, (Obj*)CFISH_FALSE);
+ Hash_Store_Utf8(dump, "indexed", 7, (Obj*)CFISH_FALSE);
}
if (!ivars->stored) {
- Hash_Store_Str(dump, "stored", 6, (Obj*)CFISH_FALSE);
+ Hash_Store_Utf8(dump, "stored", 6, (Obj*)CFISH_FALSE);
}
if (ivars->sortable) {
- Hash_Store_Str(dump, "sortable", 8, (Obj*)CFISH_TRUE);
+ Hash_Store_Utf8(dump, "sortable", 8, (Obj*)CFISH_TRUE);
}
if (ivars->highlightable) {
- Hash_Store_Str(dump, "highlightable", 13, (Obj*)CFISH_TRUE);
+ Hash_Store_Utf8(dump, "highlightable", 13, (Obj*)CFISH_TRUE);
}
return dump;
@@ -107,11 +107,11 @@ Hash*
FullTextType_Dump_IMP(FullTextType *self) {
FullTextTypeIVARS *const ivars = FullTextType_IVARS(self);
Hash *dump = FullTextType_Dump_For_Schema(self);
- Hash_Store_Str(dump, "_class", 6,
- (Obj*)Str_Clone(FullTextType_Get_Class_Name(self)));
- Hash_Store_Str(dump, "analyzer", 8,
- (Obj*)Analyzer_Dump(ivars->analyzer));
- DECREF(Hash_Delete_Str(dump, "type", 4));
+ Hash_Store_Utf8(dump, "_class", 6,
+ (Obj*)Str_Clone(FullTextType_Get_Class_Name(self)));
+ Hash_Store_Utf8(dump, "analyzer", 8,
+ (Obj*)Analyzer_Dump(ivars->analyzer));
+ DECREF(Hash_Delete_Utf8(dump, "type", 4));
return dump;
}
@@ -120,7 +120,7 @@ FullTextType*
FullTextType_Load_IMP(FullTextType *self, Obj *dump) {
UNUSED_VAR(self);
Hash *source = (Hash*)CERTIFY(dump, HASH);
- String *class_name = (String*)Hash_Fetch_Str(source, "_class", 6);
+ String *class_name = (String*)Hash_Fetch_Utf8(source, "_class", 6);
VTable *vtable
= (class_name != NULL && Obj_Is_A((Obj*)class_name, STRING))
? VTable_singleton(class_name, NULL)
@@ -128,21 +128,21 @@ FullTextType_Load_IMP(FullTextType *self, Obj *dump) {
FullTextType *loaded = (FullTextType*)VTable_Make_Obj(vtable);
// Extract boost.
- Obj *boost_dump = Hash_Fetch_Str(source, "boost", 5);
+ Obj *boost_dump = Hash_Fetch_Utf8(source, "boost", 5);
float boost = boost_dump ? (float)Obj_To_F64(boost_dump) : 1.0f;
// Find boolean properties.
- Obj *indexed_dump = Hash_Fetch_Str(source, "indexed", 7);
- Obj *stored_dump = Hash_Fetch_Str(source, "stored", 6);
- Obj *sort_dump = Hash_Fetch_Str(source, "sortable", 8);
- Obj *hl_dump = Hash_Fetch_Str(source, "highlightable", 13);
+ Obj *indexed_dump = Hash_Fetch_Utf8(source, "indexed", 7);
+ Obj *stored_dump = Hash_Fetch_Utf8(source, "stored", 6);
+ Obj *sort_dump = Hash_Fetch_Utf8(source, "sortable", 8);
+ Obj *hl_dump = Hash_Fetch_Utf8(source, "highlightable", 13);
bool indexed = indexed_dump ? Obj_To_Bool(indexed_dump) : true;
bool stored = stored_dump ? Obj_To_Bool(stored_dump) : true;
bool sortable = sort_dump ? Obj_To_Bool(sort_dump) : false;
bool hl = hl_dump ? Obj_To_Bool(hl_dump) : false;
// Extract an Analyzer.
- Obj *analyzer_dump = Hash_Fetch_Str(source, "analyzer", 8);
+ Obj *analyzer_dump = Hash_Fetch_Utf8(source, "analyzer", 8);
Analyzer *analyzer = NULL;
if (analyzer_dump) {
if (Obj_Is_A(analyzer_dump, ANALYZER)) {
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Plan/NumericType.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Plan/NumericType.c b/core/Lucy/Plan/NumericType.c
index 6ccda7d..1d470d9 100644
--- a/core/Lucy/Plan/NumericType.c
+++ b/core/Lucy/Plan/NumericType.c
@@ -46,20 +46,20 @@ Hash*
NumType_Dump_For_Schema_IMP(NumericType *self) {
NumericTypeIVARS *const ivars = NumType_IVARS(self);
Hash *dump = Hash_new(0);
- Hash_Store_Str(dump, "type", 4, (Obj*)NumType_Specifier(self));
+ Hash_Store_Utf8(dump, "type", 4, (Obj*)NumType_Specifier(self));
// Store attributes that override the defaults.
if (ivars->boost != 1.0) {
- Hash_Store_Str(dump, "boost", 5, (Obj*)Str_newf("%f64", ivars->boost));
+ Hash_Store_Utf8(dump, "boost", 5, (Obj*)Str_newf("%f64", ivars->boost));
}
if (!ivars->indexed) {
- Hash_Store_Str(dump, "indexed", 7, (Obj*)CFISH_FALSE);
+ Hash_Store_Utf8(dump, "indexed", 7, (Obj*)CFISH_FALSE);
}
if (!ivars->stored) {
- Hash_Store_Str(dump, "stored", 6, (Obj*)CFISH_FALSE);
+ Hash_Store_Utf8(dump, "stored", 6, (Obj*)CFISH_FALSE);
}
if (ivars->sortable) {
- Hash_Store_Str(dump, "sortable", 8, (Obj*)CFISH_TRUE);
+ Hash_Store_Utf8(dump, "sortable", 8, (Obj*)CFISH_TRUE);
}
return dump;
@@ -68,9 +68,9 @@ NumType_Dump_For_Schema_IMP(NumericType *self) {
Hash*
NumType_Dump_IMP(NumericType *self) {
Hash *dump = NumType_Dump_For_Schema(self);
- Hash_Store_Str(dump, "_class", 6,
- (Obj*)Str_Clone(NumType_Get_Class_Name(self)));
- DECREF(Hash_Delete_Str(dump, "type", 4));
+ Hash_Store_Utf8(dump, "_class", 6,
+ (Obj*)Str_Clone(NumType_Get_Class_Name(self)));
+ DECREF(Hash_Delete_Utf8(dump, "type", 4));
return dump;
}
@@ -80,23 +80,23 @@ NumType_Load_IMP(NumericType *self, Obj *dump) {
Hash *source = (Hash*)CERTIFY(dump, HASH);
// Get a VTable
- String *class_name = (String*)Hash_Fetch_Str(source, "_class", 6);
- String *type_spec = (String*)Hash_Fetch_Str(source, "type", 4);
+ String *class_name = (String*)Hash_Fetch_Utf8(source, "_class", 6);
+ String *type_spec = (String*)Hash_Fetch_Utf8(source, "type", 4);
VTable *vtable = NULL;
if (class_name != NULL && Obj_Is_A((Obj*)class_name, STRING)) {
vtable = VTable_singleton(class_name, NULL);
}
else if (type_spec != NULL && Obj_Is_A((Obj*)type_spec, STRING)) {
- if (Str_Equals_Str(type_spec, "i32_t", 5)) {
+ if (Str_Equals_Utf8(type_spec, "i32_t", 5)) {
vtable = INT32TYPE;
}
- else if (Str_Equals_Str(type_spec, "i64_t", 5)) {
+ else if (Str_Equals_Utf8(type_spec, "i64_t", 5)) {
vtable = INT64TYPE;
}
- else if (Str_Equals_Str(type_spec, "f32_t", 5)) {
+ else if (Str_Equals_Utf8(type_spec, "f32_t", 5)) {
vtable = FLOAT32TYPE;
}
- else if (Str_Equals_Str(type_spec, "f64_t", 5)) {
+ else if (Str_Equals_Utf8(type_spec, "f64_t", 5)) {
vtable = FLOAT64TYPE;
}
else {
@@ -107,13 +107,13 @@ NumType_Load_IMP(NumericType *self, Obj *dump) {
NumericType *loaded = (NumericType*)VTable_Make_Obj(vtable);
// Extract boost.
- Obj *boost_dump = Hash_Fetch_Str(source, "boost", 5);
+ Obj *boost_dump = Hash_Fetch_Utf8(source, "boost", 5);
float boost = boost_dump ? (float)Obj_To_F64(boost_dump) : 1.0f;
// Find boolean properties.
- Obj *indexed_dump = Hash_Fetch_Str(source, "indexed", 7);
- Obj *stored_dump = Hash_Fetch_Str(source, "stored", 6);
- Obj *sort_dump = Hash_Fetch_Str(source, "sortable", 8);
+ Obj *indexed_dump = Hash_Fetch_Utf8(source, "indexed", 7);
+ Obj *stored_dump = Hash_Fetch_Utf8(source, "stored", 6);
+ Obj *sort_dump = Hash_Fetch_Utf8(source, "sortable", 8);
bool indexed = indexed_dump ? Obj_To_Bool(indexed_dump) : true;
bool stored = stored_dump ? Obj_To_Bool(stored_dump) : true;
bool sortable = sort_dump ? Obj_To_Bool(sort_dump) : false;
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Plan/Schema.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Plan/Schema.c b/core/Lucy/Plan/Schema.c
index 8ce77d0..098a698 100644
--- a/core/Lucy/Plan/Schema.c
+++ b/core/Lucy/Plan/Schema.c
@@ -256,13 +256,13 @@ Schema_Dump_IMP(Schema *self) {
FieldType *type;
// Record class name, store dumps of unique Analyzers.
- Hash_Store_Str(dump, "_class", 6,
- (Obj*)Str_Clone(Schema_Get_Class_Name(self)));
- Hash_Store_Str(dump, "analyzers", 9,
- Freezer_dump((Obj*)ivars->uniq_analyzers));
+ Hash_Store_Utf8(dump, "_class", 6,
+ (Obj*)Str_Clone(Schema_Get_Class_Name(self)));
+ Hash_Store_Utf8(dump, "analyzers", 9,
+ Freezer_dump((Obj*)ivars->uniq_analyzers));
// Dump FieldTypes.
- Hash_Store_Str(dump, "fields", 6, (Obj*)type_dumps);
+ Hash_Store_Utf8(dump, "fields", 6, (Obj*)type_dumps);
Hash_Iterate(ivars->types);
while (Hash_Next(ivars->types, (Obj**)&field, (Obj**)&type)) {
VTable *type_vtable = FType_Get_VTable(type);
@@ -276,8 +276,8 @@ Schema_Dump_IMP(Schema *self) {
= S_find_in_array(ivars->uniq_analyzers, (Obj*)analyzer);
// Store the tick which references a unique analyzer.
- Hash_Store_Str(type_dump, "analyzer", 8,
- (Obj*)Str_newf("%u32", tick));
+ Hash_Store_Utf8(type_dump, "analyzer", 8,
+ (Obj*)Str_newf("%u32", tick));
Hash_Store(type_dumps, (Obj*)field, (Obj*)type_dump);
}
@@ -306,13 +306,13 @@ Schema*
Schema_Load_IMP(Schema *self, Obj *dump) {
Hash *source = (Hash*)CERTIFY(dump, HASH);
String *class_name
- = (String*)CERTIFY(Hash_Fetch_Str(source, "_class", 6), STRING);
+ = (String*)CERTIFY(Hash_Fetch_Utf8(source, "_class", 6), STRING);
VTable *vtable = VTable_singleton(class_name, NULL);
Schema *loaded = (Schema*)VTable_Make_Obj(vtable);
Hash *type_dumps
- = (Hash*)CERTIFY(Hash_Fetch_Str(source, "fields", 6), HASH);
+ = (Hash*)CERTIFY(Hash_Fetch_Utf8(source, "fields", 6), HASH);
VArray *analyzer_dumps
- = (VArray*)CERTIFY(Hash_Fetch_Str(source, "analyzers", 9), VARRAY);
+ = (VArray*)CERTIFY(Hash_Fetch_Utf8(source, "analyzers", 9), VARRAY);
VArray *analyzers
= (VArray*)Freezer_load((Obj*)analyzer_dumps);
String *field;
@@ -328,56 +328,56 @@ Schema_Load_IMP(Schema *self, Obj *dump) {
while (Hash_Next(type_dumps, (Obj**)&field, (Obj**)&type_dump)) {
String *type_str;
CERTIFY(type_dump, HASH);
- type_str = (String*)Hash_Fetch_Str(type_dump, "type", 4);
+ type_str = (String*)Hash_Fetch_Utf8(type_dump, "type", 4);
if (type_str) {
- if (Str_Equals_Str(type_str, "fulltext", 8)) {
+ if (Str_Equals_Utf8(type_str, "fulltext", 8)) {
// Replace the "analyzer" tick with the real thing.
Obj *tick
- = CERTIFY(Hash_Fetch_Str(type_dump, "analyzer", 8), OBJ);
+ = CERTIFY(Hash_Fetch_Utf8(type_dump, "analyzer", 8), OBJ);
Analyzer *analyzer
= (Analyzer*)VA_Fetch(analyzers,
(uint32_t)Obj_To_I64(tick));
if (!analyzer) {
THROW(ERR, "Can't find analyzer for '%o'", field);
}
- Hash_Store_Str(type_dump, "analyzer", 8, INCREF(analyzer));
+ Hash_Store_Utf8(type_dump, "analyzer", 8, INCREF(analyzer));
FullTextType *type
= (FullTextType*)S_load_type(FULLTEXTTYPE,
(Obj*)type_dump);
Schema_Spec_Field(loaded, field, (FieldType*)type);
DECREF(type);
}
- else if (Str_Equals_Str(type_str, "string", 6)) {
+ else if (Str_Equals_Utf8(type_str, "string", 6)) {
StringType *type
= (StringType*)S_load_type(STRINGTYPE, (Obj*)type_dump);
Schema_Spec_Field(loaded, field, (FieldType*)type);
DECREF(type);
}
- else if (Str_Equals_Str(type_str, "blob", 4)) {
+ else if (Str_Equals_Utf8(type_str, "blob", 4)) {
BlobType *type
= (BlobType*)S_load_type(BLOBTYPE, (Obj*)type_dump);
Schema_Spec_Field(loaded, field, (FieldType*)type);
DECREF(type);
}
- else if (Str_Equals_Str(type_str, "i32_t", 5)) {
+ else if (Str_Equals_Utf8(type_str, "i32_t", 5)) {
Int32Type *type
= (Int32Type*)S_load_type(INT32TYPE, (Obj*)type_dump);
Schema_Spec_Field(loaded, field, (FieldType*)type);
DECREF(type);
}
- else if (Str_Equals_Str(type_str, "i64_t", 5)) {
+ else if (Str_Equals_Utf8(type_str, "i64_t", 5)) {
Int64Type *type
= (Int64Type*)S_load_type(INT64TYPE, (Obj*)type_dump);
Schema_Spec_Field(loaded, field, (FieldType*)type);
DECREF(type);
}
- else if (Str_Equals_Str(type_str, "f32_t", 5)) {
+ else if (Str_Equals_Utf8(type_str, "f32_t", 5)) {
Float32Type *type
= (Float32Type*)S_load_type(FLOAT32TYPE, (Obj*)type_dump);
Schema_Spec_Field(loaded, field, (FieldType*)type);
DECREF(type);
}
- else if (Str_Equals_Str(type_str, "f64_t", 5)) {
+ else if (Str_Equals_Utf8(type_str, "f64_t", 5)) {
Float64Type *type
= (Float64Type*)S_load_type(FLOAT64TYPE, (Obj*)type_dump);
Schema_Spec_Field(loaded, field, (FieldType*)type);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Plan/StringType.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Plan/StringType.c b/core/Lucy/Plan/StringType.c
index e87045e..087d743 100644
--- a/core/Lucy/Plan/StringType.c
+++ b/core/Lucy/Plan/StringType.c
@@ -58,20 +58,20 @@ Hash*
StringType_Dump_For_Schema_IMP(StringType *self) {
StringTypeIVARS *const ivars = StringType_IVARS(self);
Hash *dump = Hash_new(0);
- Hash_Store_Str(dump, "type", 4, (Obj*)Str_newf("string"));
+ Hash_Store_Utf8(dump, "type", 4, (Obj*)Str_newf("string"));
// Store attributes that override the defaults.
if (ivars->boost != 1.0) {
- Hash_Store_Str(dump, "boost", 5, (Obj*)Str_newf("%f64", ivars->boost));
+ Hash_Store_Utf8(dump, "boost", 5, (Obj*)Str_newf("%f64", ivars->boost));
}
if (!ivars->indexed) {
- Hash_Store_Str(dump, "indexed", 7, (Obj*)CFISH_FALSE);
+ Hash_Store_Utf8(dump, "indexed", 7, (Obj*)CFISH_FALSE);
}
if (!ivars->stored) {
- Hash_Store_Str(dump, "stored", 6, (Obj*)CFISH_FALSE);
+ Hash_Store_Utf8(dump, "stored", 6, (Obj*)CFISH_FALSE);
}
if (ivars->sortable) {
- Hash_Store_Str(dump, "sortable", 8, (Obj*)CFISH_TRUE);
+ Hash_Store_Utf8(dump, "sortable", 8, (Obj*)CFISH_TRUE);
}
return dump;
@@ -80,25 +80,25 @@ StringType_Dump_For_Schema_IMP(StringType *self) {
Hash*
StringType_Dump_IMP(StringType *self) {
Hash *dump = StringType_Dump_For_Schema(self);
- Hash_Store_Str(dump, "_class", 6,
- (Obj*)Str_Clone(StringType_Get_Class_Name(self)));
- DECREF(Hash_Delete_Str(dump, "type", 4));
+ Hash_Store_Utf8(dump, "_class", 6,
+ (Obj*)Str_Clone(StringType_Get_Class_Name(self)));
+ DECREF(Hash_Delete_Utf8(dump, "type", 4));
return dump;
}
StringType*
StringType_Load_IMP(StringType *self, Obj *dump) {
Hash *source = (Hash*)CERTIFY(dump, HASH);
- String *class_name = (String*)Hash_Fetch_Str(source, "_class", 6);
+ String *class_name = (String*)Hash_Fetch_Utf8(source, "_class", 6);
VTable *vtable
= (class_name != NULL && Obj_Is_A((Obj*)class_name, STRING))
? VTable_singleton(class_name, NULL)
: STRINGTYPE;
StringType *loaded = (StringType*)VTable_Make_Obj(vtable);
- Obj *boost_dump = Hash_Fetch_Str(source, "boost", 5);
- Obj *indexed_dump = Hash_Fetch_Str(source, "indexed", 7);
- Obj *stored_dump = Hash_Fetch_Str(source, "stored", 6);
- Obj *sortable_dump = Hash_Fetch_Str(source, "sortable", 8);
+ Obj *boost_dump = Hash_Fetch_Utf8(source, "boost", 5);
+ Obj *indexed_dump = Hash_Fetch_Utf8(source, "indexed", 7);
+ Obj *stored_dump = Hash_Fetch_Utf8(source, "stored", 6);
+ Obj *sortable_dump = Hash_Fetch_Utf8(source, "sortable", 8);
UNUSED_VAR(self);
float boost = boost_dump ? (float)Obj_To_F64(boost_dump) : 1.0f;
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Search/ANDQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/ANDQuery.c b/core/Lucy/Search/ANDQuery.c
index 0ef378e..88bfe5a 100644
--- a/core/Lucy/Search/ANDQuery.c
+++ b/core/Lucy/Search/ANDQuery.c
@@ -55,10 +55,10 @@ ANDQuery_To_String_IMP(ANDQuery *self) {
CB_Cat(buf, kid_string);
DECREF(kid_string);
if (i == num_kids - 1) {
- CB_Cat_Trusted_UTF8(buf, ")", 1);
+ CB_Cat_Trusted_Utf8(buf, ")", 1);
}
else {
- CB_Cat_Trusted_UTF8(buf, " AND ", 5);
+ CB_Cat_Trusted_Utf8(buf, " AND ", 5);
}
}
String *retval = CB_Yield_String(buf);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Search/Compiler.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/Compiler.c b/core/Lucy/Search/Compiler.c
index 4ffa29d..1ed904e 100644
--- a/core/Lucy/Search/Compiler.c
+++ b/core/Lucy/Search/Compiler.c
@@ -111,7 +111,7 @@ Compiler_To_String_IMP(Compiler *self) {
String *stringified_query = Query_To_String(ivars->parent);
CharBuf *buf = CB_new_from_trusted_utf8("compiler(", 9);
CB_Cat(buf, stringified_query);
- CB_Cat_Trusted_UTF8(buf, ")", 1);
+ CB_Cat_Trusted_Utf8(buf, ")", 1);
String *string = CB_Yield_String(buf);
DECREF(buf);
DECREF(stringified_query);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Search/LeafQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/LeafQuery.c b/core/Lucy/Search/LeafQuery.c
index 9ff388c..52c2718 100644
--- a/core/Lucy/Search/LeafQuery.c
+++ b/core/Lucy/Search/LeafQuery.c
@@ -118,9 +118,9 @@ LeafQuery_Dump_IMP(LeafQuery *self) {
= SUPER_METHOD_PTR(LEAFQUERY, LUCY_LeafQuery_Dump);
Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
if (ivars->field) {
- Hash_Store_Str(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
+ Hash_Store_Utf8(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
}
- Hash_Store_Str(dump, "text", 4, Freezer_dump((Obj*)ivars->text));
+ Hash_Store_Utf8(dump, "text", 4, Freezer_dump((Obj*)ivars->text));
return (Obj*)dump;
}
@@ -131,12 +131,12 @@ LeafQuery_Load_IMP(LeafQuery *self, Obj *dump) {
= SUPER_METHOD_PTR(LEAFQUERY, LUCY_LeafQuery_Load);
LeafQuery *loaded = (LeafQuery*)super_load(self, dump);
LeafQueryIVARS *loaded_ivars = LeafQuery_IVARS(loaded);
- Obj *field = Hash_Fetch_Str(source, "field", 5);
+ Obj *field = Hash_Fetch_Utf8(source, "field", 5);
if (field) {
loaded_ivars->field
= (String*)CERTIFY(Freezer_load(field), STRING);
}
- Obj *text = CERTIFY(Hash_Fetch_Str(source, "text", 4), OBJ);
+ Obj *text = CERTIFY(Hash_Fetch_Utf8(source, "text", 4), OBJ);
loaded_ivars->text = (String*)CERTIFY(Freezer_load(text), STRING);
return (Obj*)loaded;
}
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Search/NoMatchQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/NoMatchQuery.c b/core/Lucy/Search/NoMatchQuery.c
index b46d460..bd9a045 100644
--- a/core/Lucy/Search/NoMatchQuery.c
+++ b/core/Lucy/Search/NoMatchQuery.c
@@ -83,8 +83,8 @@ NoMatchQuery_Dump_IMP(NoMatchQuery *self) {
NoMatchQuery_Dump_t super_dump
= SUPER_METHOD_PTR(NOMATCHQUERY, LUCY_NoMatchQuery_Dump);
Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
- Hash_Store_Str(dump, "fails_to_match", 14,
- (Obj*)Bool_singleton(ivars->fails_to_match));
+ Hash_Store_Utf8(dump, "fails_to_match", 14,
+ (Obj*)Bool_singleton(ivars->fails_to_match));
return (Obj*)dump;
}
@@ -94,7 +94,7 @@ NoMatchQuery_Load_IMP(NoMatchQuery *self, Obj *dump) {
NoMatchQuery_Load_t super_load
= SUPER_METHOD_PTR(NOMATCHQUERY, LUCY_NoMatchQuery_Load);
NoMatchQuery *loaded = super_load(self, dump);
- Obj *fails = CFISH_Hash_Fetch_Str(source, "fails_to_match", 14);
+ Obj *fails = CFISH_Hash_Fetch_Utf8(source, "fails_to_match", 14);
NoMatchQuery_IVARS(loaded)->fails_to_match
= fails ? Obj_To_Bool(fails) : true;
return loaded;
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Search/ORQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/ORQuery.c b/core/Lucy/Search/ORQuery.c
index 3ee0cfd..5167d0c 100644
--- a/core/Lucy/Search/ORQuery.c
+++ b/core/Lucy/Search/ORQuery.c
@@ -71,10 +71,10 @@ ORQuery_To_String_IMP(ORQuery *self) {
CB_Cat(buf, kid_string);
DECREF(kid_string);
if (i == last_kid) {
- CB_Cat_Trusted_UTF8(buf, ")", 1);
+ CB_Cat_Trusted_Utf8(buf, ")", 1);
}
else {
- CB_Cat_Trusted_UTF8(buf, " OR ", 4);
+ CB_Cat_Trusted_Utf8(buf, " OR ", 4);
}
}
String *retval = CB_Yield_String(buf);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Search/PhraseQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/PhraseQuery.c b/core/Lucy/Search/PhraseQuery.c
index 4f02f61..7576401 100644
--- a/core/Lucy/Search/PhraseQuery.c
+++ b/core/Lucy/Search/PhraseQuery.c
@@ -98,8 +98,8 @@ PhraseQuery_Dump_IMP(PhraseQuery *self) {
PhraseQuery_Dump_t super_dump
= SUPER_METHOD_PTR(PHRASEQUERY, LUCY_PhraseQuery_Dump);
Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
- Hash_Store_Str(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
- Hash_Store_Str(dump, "terms", 5, Freezer_dump((Obj*)ivars->terms));
+ Hash_Store_Utf8(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
+ Hash_Store_Utf8(dump, "terms", 5, Freezer_dump((Obj*)ivars->terms));
return (Obj*)dump;
}
@@ -110,10 +110,10 @@ PhraseQuery_Load_IMP(PhraseQuery *self, Obj *dump) {
= SUPER_METHOD_PTR(PHRASEQUERY, LUCY_PhraseQuery_Load);
PhraseQuery *loaded = (PhraseQuery*)super_load(self, dump);
PhraseQueryIVARS *loaded_ivars = PhraseQuery_IVARS(loaded);
- Obj *field = CERTIFY(Hash_Fetch_Str(source, "field", 5), OBJ);
+ Obj *field = CERTIFY(Hash_Fetch_Utf8(source, "field", 5), OBJ);
loaded_ivars->field
= (String*)CERTIFY(Freezer_load(field), STRING);
- Obj *terms = CERTIFY(Hash_Fetch_Str(source, "terms", 5), OBJ);
+ Obj *terms = CERTIFY(Hash_Fetch_Utf8(source, "terms", 5), OBJ);
loaded_ivars->terms
= (VArray*)CERTIFY(Freezer_load(terms), VARRAY);
return (Obj*)loaded;
@@ -140,17 +140,17 @@ PhraseQuery_To_String_IMP(PhraseQuery *self) {
PhraseQueryIVARS *const ivars = PhraseQuery_IVARS(self);
uint32_t num_terms = VA_Get_Size(ivars->terms);
CharBuf *buf = CB_new_from_str(ivars->field);
- CB_Cat_Trusted_UTF8(buf, ":\"", 2);
+ CB_Cat_Trusted_Utf8(buf, ":\"", 2);
for (uint32_t i = 0; i < num_terms; i++) {
Obj *term = VA_Fetch(ivars->terms, i);
String *term_string = Obj_To_String(term);
CB_Cat(buf, term_string);
DECREF(term_string);
if (i < num_terms - 1) {
- CB_Cat_Trusted_UTF8(buf, " ", 1);
+ CB_Cat_Trusted_Utf8(buf, " ", 1);
}
}
- CB_Cat_Trusted_UTF8(buf, "\"", 1);
+ CB_Cat_Trusted_Utf8(buf, "\"", 1);
String *retval = CB_Yield_String(buf);
DECREF(buf);
return retval;
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Search/PolyQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/PolyQuery.c b/core/Lucy/Search/PolyQuery.c
index 5a36db0..8e85af9 100644
--- a/core/Lucy/Search/PolyQuery.c
+++ b/core/Lucy/Search/PolyQuery.c
@@ -98,7 +98,7 @@ PolyQuery_Dump_IMP(PolyQuery *self) {
PolyQuery_Dump_t super_dump
= SUPER_METHOD_PTR(POLYQUERY, LUCY_PolyQuery_Dump);
Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
- Hash_Store_Str(dump, "children", 8, Freezer_dump((Obj*)ivars->children));
+ Hash_Store_Utf8(dump, "children", 8, Freezer_dump((Obj*)ivars->children));
return (Obj*)dump;
}
@@ -108,7 +108,7 @@ PolyQuery_Load_IMP(PolyQuery *self, Obj *dump) {
PolyQuery_Load_t super_load
= SUPER_METHOD_PTR(POLYQUERY, LUCY_PolyQuery_Load);
PolyQuery *loaded = (PolyQuery*)super_load(self, dump);
- Obj *children = CERTIFY(Hash_Fetch_Str(source, "children", 8), OBJ);
+ Obj *children = CERTIFY(Hash_Fetch_Utf8(source, "children", 8), OBJ);
PolyQuery_IVARS(loaded)->children
= (VArray*)CERTIFY(Freezer_load(children), VARRAY);
return (Obj*)loaded;
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Search/Query.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/Query.c b/core/Lucy/Search/Query.c
index d3215fb..78ebea2 100644
--- a/core/Lucy/Search/Query.c
+++ b/core/Lucy/Search/Query.c
@@ -55,10 +55,10 @@ Obj*
Query_Dump_IMP(Query *self) {
QueryIVARS *ivars = Query_IVARS(self);
Hash *dump = Hash_new(0);
- Hash_Store_Str(dump, "_class", 6,
- (Obj*)Str_Clone(Obj_Get_Class_Name((Obj*)self)));
- Hash_Store_Str(dump, "boost", 5,
- (Obj*)Str_newf("%f64", (double)ivars->boost));
+ Hash_Store_Utf8(dump, "_class", 6,
+ (Obj*)Str_Clone(Obj_Get_Class_Name((Obj*)self)));
+ Hash_Store_Utf8(dump, "boost", 5,
+ (Obj*)Str_newf("%f64", (double)ivars->boost));
return (Obj*)dump;
}
@@ -67,10 +67,10 @@ Query_Load_IMP(Query *self, Obj *dump) {
CHY_UNUSED_VAR(self);
Hash *source = (Hash*)CERTIFY(dump, HASH);
String *class_name
- = (String*)CERTIFY(Hash_Fetch_Str(source, "_class", 6), STRING);
+ = (String*)CERTIFY(Hash_Fetch_Utf8(source, "_class", 6), STRING);
VTable *vtable = VTable_singleton(class_name, NULL);
Query *loaded = (Query*)VTable_Make_Obj(vtable);
- Obj *boost = CERTIFY(Hash_Fetch_Str(source, "boost", 5), OBJ);
+ Obj *boost = CERTIFY(Hash_Fetch_Utf8(source, "boost", 5), OBJ);
Query_IVARS(loaded)->boost = (float)Obj_To_F64(boost);
return (Obj*)loaded;
}
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Search/QueryParser.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/QueryParser.c b/core/Lucy/Search/QueryParser.c
index 21100d4..037d6b1 100644
--- a/core/Lucy/Search/QueryParser.c
+++ b/core/Lucy/Search/QueryParser.c
@@ -141,10 +141,10 @@ QParser_init(QueryParser *self, Schema *schema, Analyzer *analyzer,
VA_Sort(ivars->fields, NULL, NULL);
// Derive default "occur" from default boolean operator.
- if (Str_Equals_Str(ivars->default_boolop, "OR", 2)) {
+ if (Str_Equals_Utf8(ivars->default_boolop, "OR", 2)) {
ivars->default_occur = SHOULD;
}
- else if (Str_Equals_Str(ivars->default_boolop, "AND", 3)) {
+ else if (Str_Equals_Utf8(ivars->default_boolop, "AND", 3)) {
ivars->default_occur = MUST;
}
else {
@@ -876,11 +876,11 @@ QParser_Expand_Leaf_IMP(QueryParser *self, Query *query) {
StringIterator *tail = Str_Tail(full_text);
StrIter_Skip_Next_Whitespace(top);
StrIter_Skip_Prev_Whitespace(tail);
- if (StrIter_Starts_With_UTF8(top, "\"", 1)) {
+ if (StrIter_Starts_With_Utf8(top, "\"", 1)) {
is_phrase = true;
StrIter_Advance(top, 1);
- if (StrIter_Ends_With_UTF8(tail, "\"", 1)
- && !StrIter_Ends_With_UTF8(tail, "\\\"", 2)
+ if (StrIter_Ends_With_Utf8(tail, "\"", 1)
+ && !StrIter_Ends_With_Utf8(tail, "\\\"", 2)
) {
StrIter_Recede(tail, 1);
}
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Search/QueryParser/QueryLexer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/QueryParser/QueryLexer.c b/core/Lucy/Search/QueryParser/QueryLexer.c
index af07f5f..de9e66f 100644
--- a/core/Lucy/Search/QueryParser/QueryLexer.c
+++ b/core/Lucy/Search/QueryParser/QueryLexer.c
@@ -163,7 +163,7 @@ QueryLexer_Tokenize_IMP(QueryLexer *self, const String *query_string) {
static ParserElem*
S_consume_keyword(StringIterator *iter, const char *keyword,
size_t keyword_len, int type) {
- if (!StrIter_Starts_With_UTF8(iter, keyword, keyword_len)) {
+ if (!StrIter_Starts_With_Utf8(iter, keyword, keyword_len)) {
return NULL;
}
StringIterator *temp = StrIter_Clone(iter);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Search/RangeQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/RangeQuery.c b/core/Lucy/Search/RangeQuery.c
index a208213..d4c7174 100644
--- a/core/Lucy/Search/RangeQuery.c
+++ b/core/Lucy/Search/RangeQuery.c
@@ -166,19 +166,19 @@ RangeQuery_Dump_IMP(RangeQuery *self) {
RangeQuery_Dump_t super_dump
= SUPER_METHOD_PTR(RANGEQUERY, LUCY_RangeQuery_Dump);
Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
- Hash_Store_Str(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
+ Hash_Store_Utf8(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
if (ivars->lower_term) {
- Hash_Store_Str(dump, "lower_term", 10,
- Freezer_dump((Obj*)ivars->lower_term));
+ Hash_Store_Utf8(dump, "lower_term", 10,
+ Freezer_dump((Obj*)ivars->lower_term));
}
if (ivars->upper_term) {
- Hash_Store_Str(dump, "upper_term", 10,
- Freezer_dump((Obj*)ivars->upper_term));
+ Hash_Store_Utf8(dump, "upper_term", 10,
+ Freezer_dump((Obj*)ivars->upper_term));
}
- Hash_Store_Str(dump, "include_lower", 13,
- (Obj*)Bool_singleton(ivars->include_lower));
- Hash_Store_Str(dump, "include_upper", 13,
- (Obj*)Bool_singleton(ivars->include_upper));
+ Hash_Store_Utf8(dump, "include_lower", 13,
+ (Obj*)Bool_singleton(ivars->include_lower));
+ Hash_Store_Utf8(dump, "include_upper", 13,
+ (Obj*)Bool_singleton(ivars->include_upper));
return (Obj*)dump;
}
@@ -189,23 +189,23 @@ RangeQuery_Load_IMP(RangeQuery *self, Obj *dump) {
= SUPER_METHOD_PTR(RANGEQUERY, LUCY_RangeQuery_Load);
RangeQuery *loaded = (RangeQuery*)super_load(self, dump);
RangeQueryIVARS *loaded_ivars = RangeQuery_IVARS(loaded);
- Obj *field = CERTIFY(Hash_Fetch_Str(source, "field", 5), OBJ);
+ Obj *field = CERTIFY(Hash_Fetch_Utf8(source, "field", 5), OBJ);
loaded_ivars->field = (String*)CERTIFY(Freezer_load(field), STRING);
- Obj *lower_term = Hash_Fetch_Str(source, "lower_term", 10);
+ Obj *lower_term = Hash_Fetch_Utf8(source, "lower_term", 10);
if (lower_term) {
loaded_ivars->lower_term
= (Obj*)CERTIFY(Freezer_load(lower_term), OBJ);
}
- Obj *upper_term = Hash_Fetch_Str(source, "upper_term", 10);
+ Obj *upper_term = Hash_Fetch_Utf8(source, "upper_term", 10);
if (upper_term) {
loaded_ivars->upper_term
= (Obj*)CERTIFY(Freezer_load(upper_term), OBJ);
}
Obj *include_lower
- = CERTIFY(Hash_Fetch_Str(source, "include_lower", 13), OBJ);
+ = CERTIFY(Hash_Fetch_Utf8(source, "include_lower", 13), OBJ);
loaded_ivars->include_lower = Obj_To_Bool(include_lower);
Obj *include_upper
- = CERTIFY(Hash_Fetch_Str(source, "include_upper", 13), OBJ);
+ = CERTIFY(Hash_Fetch_Utf8(source, "include_upper", 13), OBJ);
loaded_ivars->include_upper = Obj_To_Bool(include_upper);
return (Obj*)loaded;
}
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Search/TermQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/TermQuery.c b/core/Lucy/Search/TermQuery.c
index 3644834..eeae547 100644
--- a/core/Lucy/Search/TermQuery.c
+++ b/core/Lucy/Search/TermQuery.c
@@ -80,8 +80,8 @@ TermQuery_Dump_IMP(TermQuery *self) {
TermQuery_Dump_t super_dump
= SUPER_METHOD_PTR(TERMQUERY, LUCY_TermQuery_Dump);
Hash *dump = (Hash*)CERTIFY(super_dump(self), HASH);
- Hash_Store_Str(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
- Hash_Store_Str(dump, "term", 4, Freezer_dump(ivars->term));
+ Hash_Store_Utf8(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
+ Hash_Store_Utf8(dump, "term", 4, Freezer_dump(ivars->term));
return (Obj*)dump;
}
@@ -92,9 +92,9 @@ TermQuery_Load_IMP(TermQuery *self, Obj *dump) {
= SUPER_METHOD_PTR(TERMQUERY, LUCY_TermQuery_Load);
TermQuery *loaded = (TermQuery*)super_load(self, dump);
TermQueryIVARS *loaded_ivars = TermQuery_IVARS(loaded);
- Obj *field = CERTIFY(Hash_Fetch_Str(source, "field", 5), OBJ);
+ Obj *field = CERTIFY(Hash_Fetch_Utf8(source, "field", 5), OBJ);
loaded_ivars->field = (String*)CERTIFY(Freezer_load(field), STRING);
- Obj *term = CERTIFY(Hash_Fetch_Str(source, "term", 4), OBJ);
+ Obj *term = CERTIFY(Hash_Fetch_Utf8(source, "term", 4), OBJ);
loaded_ivars->term = (Obj*)CERTIFY(Freezer_load(term), OBJ);
return (Obj*)loaded;
}
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Store/CompoundFileReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/CompoundFileReader.c b/core/Lucy/Store/CompoundFileReader.c
index 2ecf45c..8ee59c7 100644
--- a/core/Lucy/Store/CompoundFileReader.c
+++ b/core/Lucy/Store/CompoundFileReader.c
@@ -48,9 +48,9 @@ CFReader_do_open(CompoundFileReader *self, Folder *folder) {
Folder_Get_Path(folder)));
}
else {
- Obj *format = Hash_Fetch_Str(metadata, "format", 6);
+ Obj *format = Hash_Fetch_Utf8(metadata, "format", 6);
ivars->format = format ? (int32_t)Obj_To_I64(format) : 0;
- ivars->records = (Hash*)INCREF(Hash_Fetch_Str(metadata, "files", 5));
+ ivars->records = (Hash*)INCREF(Hash_Fetch_Utf8(metadata, "files", 5));
if (ivars->format < 1) {
error = Err_new(Str_newf("Corrupt %o file: Missing or invalid 'format'",
cfmeta_file));
@@ -194,8 +194,8 @@ CFReader_Local_Open_In_IMP(CompoundFileReader *self, const String *name) {
return instream;
}
else {
- Obj *len = Hash_Fetch_Str(entry, "length", 6);
- Obj *offset = Hash_Fetch_Str(entry, "offset", 6);
+ Obj *len = Hash_Fetch_Utf8(entry, "length", 6);
+ Obj *offset = Hash_Fetch_Utf8(entry, "offset", 6);
if (!len || !offset) {
Err_set_error(Err_new(Str_newf("Malformed entry for '%o' in '%o'",
name, Folder_Get_Path(ivars->real_folder))));
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Store/CompoundFileWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/CompoundFileWriter.c b/core/Lucy/Store/CompoundFileWriter.c
index 0cb9891..82e4178 100644
--- a/core/Lucy/Store/CompoundFileWriter.c
+++ b/core/Lucy/Store/CompoundFileWriter.c
@@ -105,15 +105,15 @@ S_do_consolidate(CompoundFileWriter *self, CompoundFileWriterIVARS *ivars) {
if (!outstream) { RETHROW(INCREF(Err_get_error())); }
// Start metadata.
- Hash_Store_Str(metadata, "files", 5, INCREF(sub_files));
- Hash_Store_Str(metadata, "format", 6,
- (Obj*)Str_newf("%i32", CFWriter_current_file_format));
+ Hash_Store_Utf8(metadata, "files", 5, INCREF(sub_files));
+ Hash_Store_Utf8(metadata, "format", 6,
+ (Obj*)Str_newf("%i32", CFWriter_current_file_format));
VA_Sort(files, NULL, NULL);
for (uint32_t i = 0, max = VA_Get_Size(files); i < max; i++) {
String *infilename = (String*)VA_Fetch(files, i);
- if (!Str_Ends_With_Str(infilename, ".json", 5)) {
+ if (!Str_Ends_With_Utf8(infilename, ".json", 5)) {
InStream *instream = Folder_Open_In(folder, infilename);
Hash *file_data = Hash_new(2);
int64_t offset, len;
@@ -126,10 +126,10 @@ S_do_consolidate(CompoundFileWriter *self, CompoundFileWriterIVARS *ivars) {
len = OutStream_Tell(outstream) - offset;
// Record offset and length.
- Hash_Store_Str(file_data, "offset", 6,
- (Obj*)Str_newf("%i64", offset));
- Hash_Store_Str(file_data, "length", 6,
- (Obj*)Str_newf("%i64", len));
+ Hash_Store_Utf8(file_data, "offset", 6,
+ (Obj*)Str_newf("%i64", offset));
+ Hash_Store_Utf8(file_data, "length", 6,
+ (Obj*)Str_newf("%i64", len));
Hash_Store(sub_files, (Obj*)infilename, (Obj*)file_data);
VA_Push(merged, INCREF(infilename));
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Store/FSFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/FSFolder.c b/core/Lucy/Store/FSFolder.c
index cdb353c..70522f3 100644
--- a/core/Lucy/Store/FSFolder.c
+++ b/core/Lucy/Store/FSFolder.c
@@ -229,7 +229,7 @@ FSFolder_Local_Find_Folder_IMP(FSFolder *self, const String *name) {
else if (!S_is_local_entry(name)) {
return NULL;
}
- else if (Str_Starts_With_Str(name, ".", 1)) {
+ else if (Str_Starts_With_Utf8(name, ".", 1)) {
// Don't allow access outside of the main dir.
return NULL;
}
@@ -302,7 +302,7 @@ S_create_dir(const String *path) {
static bool
S_is_local_entry(const String *path) {
- return Str_Find_Str(path, "/", 1) == -1;
+ return Str_Find_Utf8(path, "/", 1) == -1;
}
/***************************************************************************/
@@ -366,7 +366,7 @@ S_hard_link(String *from_path, String *to_path) {
static bool
S_is_absolute(const String *path) {
- return Str_Starts_With_Str(path, DIR_SEP, 1);
+ return Str_Starts_With_Utf8(path, DIR_SEP, 1);
}
static String*
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Store/Folder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/Folder.c b/core/Lucy/Store/Folder.c
index 9d7bb46..c45169f 100644
--- a/core/Lucy/Store/Folder.c
+++ b/core/Lucy/Store/Folder.c
@@ -41,7 +41,7 @@ Folder_init(Folder *self, const String *path) {
}
else {
// Copy path, strip trailing slash or equivalent.
- if (Str_Ends_With_Str(path, DIR_SEP, strlen(DIR_SEP))) {
+ if (Str_Ends_With_Utf8(path, DIR_SEP, strlen(DIR_SEP))) {
ivars->path = Str_SubString(path, 0, Str_Length(path) - 1);
}
else {
@@ -209,7 +209,7 @@ Folder_Delete_Tree_IMP(Folder *self, const String *path) {
static bool
S_is_updir(String *path) {
- if (Str_Equals_Str(path, ".", 1) || Str_Equals_Str(path, "..", 2)) {
+ if (Str_Equals_Utf8(path, ".", 1) || Str_Equals_Utf8(path, "..", 2)) {
return true;
}
else {
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Store/Lock.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/Lock.c b/core/Lucy/Store/Lock.c
index 4d778d0..fc6efc7 100644
--- a/core/Lucy/Store/Lock.c
+++ b/core/Lucy/Store/Lock.c
@@ -168,10 +168,10 @@ LFLock_Request_IMP(LockFileLock *self) {
// Prepare to write pid, lock name, and host to the lock file as JSON.
file_data = Hash_new(3);
- Hash_Store_Str(file_data, "pid", 3,
- (Obj*)Str_newf("%i32", (int32_t)PID_getpid()));
- Hash_Store_Str(file_data, "host", 4, INCREF(ivars->host));
- Hash_Store_Str(file_data, "name", 4, INCREF(ivars->name));
+ Hash_Store_Utf8(file_data, "pid", 3,
+ (Obj*)Str_newf("%i32", (int32_t)PID_getpid()));
+ Hash_Store_Utf8(file_data, "host", 4, INCREF(ivars->host));
+ Hash_Store_Utf8(file_data, "name", 4, INCREF(ivars->name));
// Write to a temporary file, then use the creation of a hard link to
// ensure atomic but non-destructive creation of the lockfile with its
@@ -233,7 +233,7 @@ LFLock_Maybe_Delete_File_IMP(LockFileLock *self, const String *path,
bool success = false;
// Only delete locks that start with our lock name.
- if (!Str_Starts_With_Str(path, "locks", 5)) {
+ if (!Str_Starts_With_Utf8(path, "locks", 5)) {
return false;
}
StringIterator *iter = Str_Top(path);
@@ -248,10 +248,10 @@ LFLock_Maybe_Delete_File_IMP(LockFileLock *self, const String *path,
if (Folder_Exists(folder, path)) {
Hash *hash = (Hash*)Json_slurp_json(folder, path);
if (hash != NULL && Obj_Is_A((Obj*)hash, HASH)) {
- String *pid_buf = (String*)Hash_Fetch_Str(hash, "pid", 3);
- String *host = (String*)Hash_Fetch_Str(hash, "host", 4);
+ String *pid_buf = (String*)Hash_Fetch_Utf8(hash, "pid", 3);
+ String *host = (String*)Hash_Fetch_Utf8(hash, "host", 4);
String *name
- = (String*)Hash_Fetch_Str(hash, "name", 4);
+ = (String*)Hash_Fetch_Utf8(hash, "name", 4);
// Match hostname and lock name.
if (host != NULL
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Store/SharedLock.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/SharedLock.c b/core/Lucy/Store/SharedLock.c
index 7ff1fc6..9d33b7b 100644
--- a/core/Lucy/Store/SharedLock.c
+++ b/core/Lucy/Store/SharedLock.c
@@ -61,7 +61,7 @@ ShLock_Request_IMP(SharedLock *self) {
// Empty lock_path indicates whether this particular instance is locked.
if (ivars->lock_path
- && !Str_Equals_Str(ivars->lock_path, "", 0)
+ && !Str_Equals_Utf8(ivars->lock_path, "", 0)
&& Folder_Exists(ivars->folder, ivars->lock_path)
) {
// Don't allow double obtain.
@@ -83,7 +83,7 @@ ShLock_Request_IMP(SharedLock *self) {
void
ShLock_Release_IMP(SharedLock *self) {
SharedLockIVARS *const ivars = ShLock_IVARS(self);
- if (ivars->lock_path && !Str_Equals_Str(ivars->lock_path, "", 0)) {
+ if (ivars->lock_path && !Str_Equals_Utf8(ivars->lock_path, "", 0)) {
ShLock_Release_t super_release
= SUPER_METHOD_PTR(SHAREDLOCK, LUCY_ShLock_Release);
super_release(self);
@@ -111,7 +111,7 @@ ShLock_Clear_Stale_IMP(SharedLock *self) {
while (DH_Next(dh)) {
String *entry = DH_Get_Entry(dh);
if (Str_Starts_With(entry, ivars->name)
- && Str_Ends_With_Str(entry, ".lock", 5)
+ && Str_Ends_With_Utf8(entry, ".lock", 5)
) {
String *candidate = Str_newf("%o/%o", lock_dir_name, entry);
ShLock_Maybe_Delete_File(self, candidate, false, true);
@@ -149,7 +149,7 @@ ShLock_Is_Locked_IMP(SharedLock *self) {
if (!isdigit(code_point)) { break; }
}
if (code_point == '.'
- && StrIter_Starts_With_UTF8(iter, "lock", 4)
+ && StrIter_Starts_With_Utf8(iter, "lock", 4)
) {
StrIter_Advance(iter, 4);
if (!StrIter_Has_Next(iter)) {
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Analysis/TestNormalizer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestNormalizer.c b/core/Lucy/Test/Analysis/TestNormalizer.c
index 1fb45f4..b1fea5c 100644
--- a/core/Lucy/Test/Analysis/TestNormalizer.c
+++ b/core/Lucy/Test/Analysis/TestNormalizer.c
@@ -79,15 +79,15 @@ test_normalization(TestBatchRunner *runner) {
for (uint32_t i = 0, max = VA_Get_Size(tests); i < max; i++) {
Hash *test = (Hash*)VA_Fetch(tests, i);
- String *form = (String*)Hash_Fetch_Str(
+ String *form = (String*)Hash_Fetch_Utf8(
test, "normalization_form", 18);
- bool case_fold = Bool_Get_Value((BoolNum*)Hash_Fetch_Str(
+ bool case_fold = Bool_Get_Value((BoolNum*)Hash_Fetch_Utf8(
test, "case_fold", 9));
- bool strip_accents = Bool_Get_Value((BoolNum*)Hash_Fetch_Str(
+ bool strip_accents = Bool_Get_Value((BoolNum*)Hash_Fetch_Utf8(
test, "strip_accents", 13));
Normalizer *normalizer = Normalizer_new(form, case_fold, strip_accents);
- VArray *words = (VArray*)Hash_Fetch_Str(test, "words", 5);
- VArray *norms = (VArray*)Hash_Fetch_Str(test, "norms", 5);
+ VArray *words = (VArray*)Hash_Fetch_Utf8(test, "words", 5);
+ VArray *norms = (VArray*)Hash_Fetch_Utf8(test, "norms", 5);
for (uint32_t j = 0, max = VA_Get_Size(words); j < max; j++) {
String *word = (String*)VA_Fetch(words, j);
VArray *got = Normalizer_Split(normalizer, word);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Analysis/TestSnowballStemmer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestSnowballStemmer.c b/core/Lucy/Test/Analysis/TestSnowballStemmer.c
index 894c6e4..3e6a44d 100644
--- a/core/Lucy/Test/Analysis/TestSnowballStemmer.c
+++ b/core/Lucy/Test/Analysis/TestSnowballStemmer.c
@@ -71,8 +71,8 @@ test_stemming(TestBatchRunner *runner) {
Hash *lang_data;
Hash_Iterate(tests);
while (Hash_Next(tests, (Obj**)&iso, (Obj**)&lang_data)) {
- VArray *words = (VArray*)Hash_Fetch_Str(lang_data, "words", 5);
- VArray *stems = (VArray*)Hash_Fetch_Str(lang_data, "stems", 5);
+ VArray *words = (VArray*)Hash_Fetch_Utf8(lang_data, "words", 5);
+ VArray *stems = (VArray*)Hash_Fetch_Utf8(lang_data, "stems", 5);
SnowballStemmer *stemmer = SnowStemmer_new(iso);
for (uint32_t i = 0, max = VA_Get_Size(words); i < max; i++) {
String *word = (String*)VA_Fetch(words, i);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Analysis/TestSnowballStopFilter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestSnowballStopFilter.c b/core/Lucy/Test/Analysis/TestSnowballStopFilter.c
index 46f4cd5..44fe6dc 100644
--- a/core/Lucy/Test/Analysis/TestSnowballStopFilter.c
+++ b/core/Lucy/Test/Analysis/TestSnowballStopFilter.c
@@ -37,8 +37,8 @@ S_make_stopfilter(void *unused, ...) {
va_start(args, unused);
while (NULL != (stopword = va_arg(args, char*))) {
- Hash_Store_Str(stoplist, stopword, strlen(stopword),
- (Obj*)Str_newf(""));
+ Hash_Store_Utf8(stoplist, stopword, strlen(stopword),
+ (Obj*)Str_newf(""));
}
va_end(args);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Analysis/TestStandardTokenizer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestStandardTokenizer.c b/core/Lucy/Test/Analysis/TestStandardTokenizer.c
index 837cb58..ab5f36e 100644
--- a/core/Lucy/Test/Analysis/TestStandardTokenizer.c
+++ b/core/Lucy/Test/Analysis/TestStandardTokenizer.c
@@ -66,31 +66,31 @@ test_tokenizer(TestBatchRunner *runner) {
TEST_TRUE(runner,
token
&& Str_Is_A(token, STRING)
- && Str_Equals_Str(token, "tha\xcc\x82t's", 8),
+ && Str_Equals_Utf8(token, "tha\xcc\x82t's", 8),
"Token: %s", Str_Get_Ptr8(token));
token = (String*)VA_Fetch(got, 1);
TEST_TRUE(runner,
token
&& Str_Is_A(token, STRING)
- && Str_Equals_Str(token, "1,02\xC2\xADZ4.38", 11),
+ && Str_Equals_Utf8(token, "1,02\xC2\xADZ4.38", 11),
"Token: %s", Str_Get_Ptr8(token));
token = (String*)VA_Fetch(got, 2);
TEST_TRUE(runner,
token
&& Str_Is_A(token, STRING)
- && Str_Equals_Str(token, "\xE0\xB8\x81\xC2\xAD\xC2\xAD", 7),
+ && Str_Equals_Utf8(token, "\xE0\xB8\x81\xC2\xAD\xC2\xAD", 7),
"Token: %s", Str_Get_Ptr8(token));
token = (String*)VA_Fetch(got, 3);
TEST_TRUE(runner,
token
&& Str_Is_A(token, STRING)
- && Str_Equals_Str(token, "\xF0\xA0\x80\x80", 4),
+ && Str_Equals_Utf8(token, "\xF0\xA0\x80\x80", 4),
"Token: %s", Str_Get_Ptr8(token));
token = (String*)VA_Fetch(got, 4);
TEST_TRUE(runner,
token
&& Str_Is_A(token, STRING)
- && Str_Equals_Str(token, "a", 1),
+ && Str_Equals_Utf8(token, "a", 1),
"Token: %s", Str_Get_Ptr8(token));
DECREF(got);
@@ -101,8 +101,8 @@ test_tokenizer(TestBatchRunner *runner) {
for (uint32_t i = 0, max = VA_Get_Size(tests); i < max; i++) {
Hash *test = (Hash*)VA_Fetch(tests, i);
- String *text = (String*)Hash_Fetch_Str(test, "text", 4);
- VArray *wanted = (VArray*)Hash_Fetch_Str(test, "words", 5);
+ String *text = (String*)Hash_Fetch_Utf8(test, "text", 4);
+ VArray *wanted = (VArray*)Hash_Fetch_Utf8(test, "words", 5);
VArray *got = StandardTokenizer_Split(tokenizer, text);
TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got), "UCD test #%d", i + 1);
DECREF(got);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Highlight/TestHighlighter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Highlight/TestHighlighter.c b/core/Lucy/Test/Highlight/TestHighlighter.c
index 2539ad0..706cd2a 100644
--- a/core/Lucy/Test/Highlight/TestHighlighter.c
+++ b/core/Lucy/Test/Highlight/TestHighlighter.c
@@ -72,7 +72,7 @@ test_Raw_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query) {
raw_excerpt = Highlighter_Raw_Excerpt(highlighter, field_val, &top,
heat_map);
TEST_TRUE(runner,
- Str_Equals_Str(raw_excerpt, "Ook.", 4),
+ Str_Equals_Utf8(raw_excerpt, "Ook.", 4),
"Raw_Excerpt at top %s", Str_Get_Ptr8(raw_excerpt));
TEST_TRUE(runner,
top == 0,
@@ -87,7 +87,7 @@ test_Raw_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query) {
raw_excerpt = Highlighter_Raw_Excerpt(highlighter, field_val, &top,
heat_map);
TEST_TRUE(runner,
- Str_Equals_Str(raw_excerpt, "Urk.", 4),
+ Str_Equals_Utf8(raw_excerpt, "Urk.", 4),
"Raw_Excerpt in middle, with 2 bounds");
TEST_TRUE(runner,
top == 6,
@@ -103,7 +103,7 @@ test_Raw_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query) {
raw_excerpt = Highlighter_Raw_Excerpt(highlighter, field_val, &top,
heat_map);
TEST_TRUE(runner,
- Str_Equals_Str(raw_excerpt, ELLIPSIS " i.", 6),
+ Str_Equals_Utf8(raw_excerpt, ELLIPSIS " i.", 6),
"Ellipsis at top");
TEST_TRUE(runner,
top == 10,
@@ -119,7 +119,7 @@ test_Raw_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query) {
raw_excerpt = Highlighter_Raw_Excerpt(highlighter, field_val, &top,
heat_map);
TEST_TRUE(runner,
- Str_Equals_Str(raw_excerpt, "Iz no" ELLIPSIS, 8),
+ Str_Equals_Utf8(raw_excerpt, "Iz no" ELLIPSIS, 8),
"Ellipsis at end");
TEST_TRUE(runner,
top == 6,
@@ -138,7 +138,7 @@ test_Raw_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query) {
raw_excerpt = Highlighter_Raw_Excerpt(highlighter, field_val, &top,
heat_map);
TEST_TRUE(runner,
- Str_Equals_Str(raw_excerpt, "abc/d" ELLIPSIS, 8),
+ Str_Equals_Utf8(raw_excerpt, "abc/d" ELLIPSIS, 8),
"Long word at top");
DECREF(heat_map);
DECREF(raw_excerpt);
@@ -150,7 +150,7 @@ test_Raw_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query) {
raw_excerpt = Highlighter_Raw_Excerpt(highlighter, field_val, &top,
heat_map);
TEST_TRUE(runner,
- Str_Equals_Str(raw_excerpt, ELLIPSIS " f/g" ELLIPSIS, 10),
+ Str_Equals_Utf8(raw_excerpt, ELLIPSIS " f/g" ELLIPSIS, 10),
"Long word in middle");
DECREF(heat_map);
DECREF(raw_excerpt);
@@ -170,7 +170,7 @@ test_Highlight_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query)
highlighted = Highlighter_Highlight_Excerpt(highlighter, spans,
raw_excerpt, 0);
TEST_TRUE(runner,
- Str_Equals_Str(highlighted, "a <strong>b</strong> c", 22),
+ Str_Equals_Utf8(highlighted, "a <strong>b</strong> c", 22),
"basic Highlight_Excerpt");
DECREF(highlighted);
DECREF(spans);
@@ -182,7 +182,7 @@ test_Highlight_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query)
highlighted = Highlighter_Highlight_Excerpt(highlighter, spans,
raw_excerpt, 0);
TEST_TRUE(runner,
- Str_Equals_Str(highlighted, "<strong>Φ</strong>", 23),
+ Str_Equals_Utf8(highlighted, "<strong>Φ</strong>", 23),
"don't surround spans off end of raw excerpt.");
DECREF(highlighted);
DECREF(spans);
@@ -193,7 +193,7 @@ test_Highlight_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query)
highlighted = Highlighter_Highlight_Excerpt(highlighter, spans,
raw_excerpt, 1);
TEST_TRUE(runner,
- Str_Equals_Str(highlighted,
+ Str_Equals_Utf8(highlighted,
"Φ <strong>Φ</strong> Φ", 37),
"Highlight_Excerpt pays attention to offset");
DECREF(highlighted);
@@ -208,7 +208,7 @@ test_Highlight_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query)
highlighted = Highlighter_Highlight_Excerpt(highlighter, spans,
raw_excerpt, 0);
TEST_TRUE(runner,
- Str_Equals_Str(highlighted,
+ Str_Equals_Utf8(highlighted,
"Φ <strong>Oook. Urk. Ick.</strong> Φ",
46),
"Highlight_Excerpt works with overlapping spans");
@@ -227,7 +227,7 @@ test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
HitDoc *hit = Hits_Next(hits);
String *excerpt = Highlighter_Create_Excerpt(highlighter, hit);
TEST_TRUE(runner,
- Str_Find_Str(excerpt,
+ Str_Find_Utf8(excerpt,
"<strong>Φ</strong> a b c d <strong>x y z</strong>",
54) >= 0,
"highlighter tagged phrase and single term");
@@ -239,7 +239,7 @@ test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
Highlighter_Set_Post_Tag(highlighter, post_tag);
excerpt = Highlighter_Create_Excerpt(highlighter, hit);
TEST_TRUE(runner,
- Str_Find_Str(excerpt,
+ Str_Find_Utf8(excerpt,
"\x1B[1mΦ\x1B[0m a b c d \x1B[1mx y z\x1B[0m",
36) >= 0,
"set_pre_tag and set_post_tag");
@@ -249,7 +249,7 @@ test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
hit = Hits_Next(hits);
excerpt = Highlighter_Create_Excerpt(highlighter, hit);
TEST_TRUE(runner,
- Str_Find_Str(excerpt, "x", 1) >= 0,
+ Str_Find_Utf8(excerpt, "x", 1) >= 0,
"excerpt field with partial hit doesn't cause highlighter freakout");
DECREF(excerpt);
DECREF(hit);
@@ -261,7 +261,7 @@ test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
hit = Hits_Next(hits);
excerpt = Highlighter_Create_Excerpt(highlighter, hit);
TEST_TRUE(runner,
- Str_Find_Str(excerpt,
+ Str_Find_Utf8(excerpt,
"<strong>b</strong> c d <strong>x y z</strong>",
45) >= 0,
"query with same word in both phrase and term doesn't cause freakout");
@@ -276,7 +276,7 @@ test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
hit = Hits_Next(hits);
excerpt = Highlighter_Create_Excerpt(highlighter, hit);
TEST_TRUE(runner,
- Str_Find_Str(excerpt, """, 6) >= 0,
+ Str_Find_Utf8(excerpt, """, 6) >= 0,
"HTML entity encoded properly");
DECREF(excerpt);
DECREF(hit);
@@ -289,7 +289,7 @@ test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
hit = Hits_Next(hits);
excerpt = Highlighter_Create_Excerpt(highlighter, hit);
TEST_TRUE(runner,
- Str_Find_Str(excerpt, "Φ", 6) == -1,
+ Str_Find_Utf8(excerpt, "Φ", 6) == -1,
"no ellipsis for short excerpt");
DECREF(excerpt);
DECREF(hit);
@@ -303,7 +303,7 @@ test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
highlighter = Highlighter_new(searcher, query, content, 200);
excerpt = Highlighter_Create_Excerpt(highlighter, hit);
TEST_TRUE(runner,
- Str_Find_Str(excerpt, "strong", 5) >= 0,
+ Str_Find_Utf8(excerpt, "strong", 5) >= 0,
"specify field highlights correct field...");
DECREF(excerpt);
DECREF(highlighter);
@@ -311,7 +311,7 @@ test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
highlighter = Highlighter_new(searcher, query, alt, 200);
excerpt = Highlighter_Create_Excerpt(highlighter, hit);
TEST_TRUE(runner,
- Str_Find_Str(excerpt, "strong", 5) == -1,
+ Str_Find_Utf8(excerpt, "strong", 5) == -1,
"... but not another field");
DECREF(excerpt);
DECREF(highlighter);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Index/TestSegment.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Index/TestSegment.c b/core/Lucy/Test/Index/TestSegment.c
index bd83256..e0e9b6b 100644
--- a/core/Lucy/Test/Index/TestSegment.c
+++ b/core/Lucy/Test/Index/TestSegment.c
@@ -63,12 +63,12 @@ test_metadata_storage(TestBatchRunner *runner) {
Segment *segment = Seg_new(1);
String *got;
- Seg_Store_Metadata_Str(segment, "foo", 3, (Obj*)Str_newf("bar"));
- got = (String*)Seg_Fetch_Metadata_Str(segment, "foo", 3);
+ Seg_Store_Metadata_Utf8(segment, "foo", 3, (Obj*)Str_newf("bar"));
+ got = (String*)Seg_Fetch_Metadata_Utf8(segment, "foo", 3);
TEST_TRUE(runner,
got
&& Str_Is_A(got, STRING)
- && Str_Equals_Str(got, "bar", 3),
+ && Str_Equals_Utf8(got, "bar", 3),
"metadata round trip"
);
DECREF(segment);
@@ -79,9 +79,9 @@ test_seg_name_and_num(TestBatchRunner *runner) {
Segment *segment_z = Seg_new(35);
String *seg_z_name = Seg_num_to_name(35);
TEST_TRUE(runner, Seg_Get_Number(segment_z) == INT64_C(35), "Get_Number");
- TEST_TRUE(runner, Str_Equals_Str(Seg_Get_Name(segment_z), "seg_z", 5),
+ TEST_TRUE(runner, Str_Equals_Utf8(Seg_Get_Name(segment_z), "seg_z", 5),
"Get_Name");
- TEST_TRUE(runner, Str_Equals_Str(seg_z_name, "seg_z", 5),
+ TEST_TRUE(runner, Str_Equals_Utf8(seg_z_name, "seg_z", 5),
"num_to_name");
DECREF(seg_z_name);
DECREF(segment_z);
@@ -130,7 +130,7 @@ test_Write_File_and_Read_File(TestBatchRunner *runner) {
String *jetsam = (String*)SSTR_WRAP_STR("jetsam", 6);
Seg_Set_Count(segment, 111);
- Seg_Store_Metadata_Str(segment, "foo", 3, (Obj*)Str_newf("bar"));
+ Seg_Store_Metadata_Utf8(segment, "foo", 3, (Obj*)Str_newf("bar"));
Seg_Add_Field(segment, flotsam);
Seg_Add_Field(segment, jetsam);
@@ -143,11 +143,11 @@ test_Write_File_and_Read_File(TestBatchRunner *runner) {
TEST_TRUE(runner,
Seg_Field_Num(got, jetsam) == Seg_Field_Num(segment, jetsam),
"Round trip field names through file");
- meta = (String*)Seg_Fetch_Metadata_Str(got, "foo", 3);
+ meta = (String*)Seg_Fetch_Metadata_Utf8(got, "foo", 3);
TEST_TRUE(runner,
meta
&& Str_Is_A(meta, STRING)
- && Str_Equals_Str(meta, "bar", 3),
+ && Str_Equals_Utf8(meta, "bar", 3),
"Round trip metadata through file");
DECREF(got);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Plan/TestFullTextType.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Plan/TestFullTextType.c b/core/Lucy/Test/Plan/TestFullTextType.c
index 0a4436e..243dd69 100644
--- a/core/Lucy/Test/Plan/TestFullTextType.c
+++ b/core/Lucy/Test/Plan/TestFullTextType.c
@@ -52,7 +52,7 @@ test_Dump_Load_and_Equals(TestBatchRunner *runner) {
FullTextType_Set_Highlightable(highlightable, true);
// (This step is normally performed by Schema_Load() internally.)
- Hash_Store_Str((Hash*)another_dump, "analyzer", 8, INCREF(tokenizer));
+ Hash_Store_Utf8((Hash*)another_dump, "analyzer", 8, INCREF(tokenizer));
FullTextType *another_clone = FullTextType_Load(type, another_dump);
TEST_FALSE(runner, FullTextType_Equals(type, (Obj*)boost_differs),
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Search/TestQueryParserSyntax.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestQueryParserSyntax.c b/core/Lucy/Test/Search/TestQueryParserSyntax.c
index d2aab4e..6a074b3 100644
--- a/core/Lucy/Test/Search/TestQueryParserSyntax.c
+++ b/core/Lucy/Test/Search/TestQueryParserSyntax.c
@@ -68,7 +68,7 @@ build_index() {
RegexTokenizer *word_tokenizer = RegexTokenizer_new(word_pattern);
Hash *stop_list = Hash_new(0);
- Hash_Store_Str(stop_list, "x", 1, (Obj*)CFISH_TRUE);
+ Hash_Store_Utf8(stop_list, "x", 1, (Obj*)CFISH_TRUE);
SnowballStopFilter *stop_filter = SnowStop_new(NULL, stop_list);
VArray *analyzers = VA_new(0);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Search/TestSortSpec.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestSortSpec.c b/core/Lucy/Test/Search/TestSortSpec.c
index ed6b945..6401f27 100644
--- a/core/Lucy/Test/Search/TestSortSpec.c
+++ b/core/Lucy/Test/Search/TestSortSpec.c
@@ -465,7 +465,7 @@ test_sort_spec(TestBatchRunner *runner) {
error = Err_trap(S_attempt_sorted_search, &sort_ctx);
TEST_TRUE(runner, error != NULL
&& Err_Is_A(error, ERR)
- && Str_Find_Str(Err_Get_Mess(error), "sortable", 8) != -1,
+ && Str_Find_Utf8(Err_Get_Mess(error), "sortable", 8) != -1,
"sorting on a non-sortable field throws an error");
DECREF(error);
@@ -473,7 +473,7 @@ test_sort_spec(TestBatchRunner *runner) {
error = Err_trap(S_attempt_sorted_search, &sort_ctx);
TEST_TRUE(runner, error != NULL
&& Err_Is_A(error, ERR)
- && Str_Find_Str(Err_Get_Mess(error), "sortable", 8) != -1,
+ && Str_Find_Utf8(Err_Get_Mess(error), "sortable", 8) != -1,
"sorting on an unknown field throws an error");
DECREF(error);
#endif
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Store/TestCompoundFileReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestCompoundFileReader.c b/core/Lucy/Test/Store/TestCompoundFileReader.c
index bb7eb89..f493762 100644
--- a/core/Lucy/Test/Store/TestCompoundFileReader.c
+++ b/core/Lucy/Test/Store/TestCompoundFileReader.c
@@ -112,7 +112,7 @@ test_open(TestBatchRunner *runner) {
Err_set_error(NULL);
real_folder = S_folder_with_contents();
metadata = (Hash*)Json_slurp_json(real_folder, cfmeta_file);
- Hash_Store_Str(metadata, "format", 6, (Obj*)Str_newf("%i32", -1));
+ Hash_Store_Utf8(metadata, "format", 6, (Obj*)Str_newf("%i32", -1));
Folder_Delete(real_folder, cfmeta_file);
Json_spew_json((Obj*)metadata, real_folder, cfmeta_file);
cf_reader = CFReader_open(real_folder);
@@ -122,7 +122,7 @@ test_open(TestBatchRunner *runner) {
"Set Err_error when format is invalid");
Err_set_error(NULL);
- Hash_Store_Str(metadata, "format", 6, (Obj*)Str_newf("%i32", 1000));
+ Hash_Store_Utf8(metadata, "format", 6, (Obj*)Str_newf("%i32", 1000));
Folder_Delete(real_folder, cfmeta_file);
Json_spew_json((Obj*)metadata, real_folder, cfmeta_file);
cf_reader = CFReader_open(real_folder);
@@ -132,7 +132,7 @@ test_open(TestBatchRunner *runner) {
"Set Err_error when format too recent");
Err_set_error(NULL);
- DECREF(Hash_Delete_Str(metadata, "format", 6));
+ DECREF(Hash_Delete_Utf8(metadata, "format", 6));
Folder_Delete(real_folder, cfmeta_file);
Json_spew_json((Obj*)metadata, real_folder, cfmeta_file);
cf_reader = CFReader_open(real_folder);
@@ -141,9 +141,9 @@ test_open(TestBatchRunner *runner) {
TEST_TRUE(runner, Err_get_error() != NULL,
"Set Err_error when format key is missing");
- Hash_Store_Str(metadata, "format", 6,
- (Obj*)Str_newf("%i32", CFWriter_current_file_format));
- DECREF(Hash_Delete_Str(metadata, "files", 5));
+ Hash_Store_Utf8(metadata, "format", 6,
+ (Obj*)Str_newf("%i32", CFWriter_current_file_format));
+ DECREF(Hash_Delete_Utf8(metadata, "files", 5));
Folder_Delete(real_folder, cfmeta_file);
Json_spew_json((Obj*)metadata, real_folder, cfmeta_file);
cf_reader = CFReader_open(real_folder);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Store/TestCompoundFileWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestCompoundFileWriter.c b/core/Lucy/Test/Store/TestCompoundFileWriter.c
index 5ed0565..3918ca8 100644
--- a/core/Lucy/Test/Store/TestCompoundFileWriter.c
+++ b/core/Lucy/Test/Store/TestCompoundFileWriter.c
@@ -114,7 +114,7 @@ test_offsets(TestBatchRunner *runner) {
cf_metadata = (Hash*)CERTIFY(
Json_slurp_json(folder, cfmeta_file), HASH);
files = (Hash*)CERTIFY(
- Hash_Fetch_Str(cf_metadata, "files", 5), HASH);
+ Hash_Fetch_Utf8(cf_metadata, "files", 5), HASH);
String *file;
Obj *filestats;
@@ -125,7 +125,7 @@ test_offsets(TestBatchRunner *runner) {
Hash_Iterate(files);
while (Hash_Next(files, (Obj**)&file, &filestats)) {
Hash *stats = (Hash*)CERTIFY(filestats, HASH);
- Obj *offset = CERTIFY(Hash_Fetch_Str(stats, "offset", 6), OBJ);
+ Obj *offset = CERTIFY(Hash_Fetch_Utf8(stats, "offset", 6), OBJ);
int64_t offs = Obj_To_I64(offset);
if (offs % 8 != 0) {
offsets_ok = false;
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Store/TestFSFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSFolder.c b/core/Lucy/Test/Store/TestFSFolder.c
index 6c66f10..689bfa0 100644
--- a/core/Lucy/Test/Store/TestFSFolder.c
+++ b/core/Lucy/Test/Store/TestFSFolder.c
@@ -119,7 +119,7 @@ test_protect_symlinks(TestBatchRunner *runner) {
bool saw_bazooka_boffo = false;
for (uint32_t i = 0, max = VA_Get_Size(list); i < max; i++) {
String *entry = (String*)VA_Fetch(list, i);
- if (Str_Ends_With_Str(entry, "bazooka/boffo", 13)) {
+ if (Str_Ends_With_Utf8(entry, "bazooka/boffo", 13)) {
saw_bazooka_boffo = true;
}
}
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Store/TestFileHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFileHandle.c b/core/Lucy/Test/Store/TestFileHandle.c
index 3d1e94b..4942d35 100644
--- a/core/Lucy/Test/Store/TestFileHandle.c
+++ b/core/Lucy/Test/Store/TestFileHandle.c
@@ -56,7 +56,7 @@ TestFH_Run_IMP(TestFileHandle *self, TestBatchRunner *runner) {
FileHandle *fh = S_new_filehandle();
StackString *foo = SSTR_WRAP_STR("foo", 3);
- TEST_TRUE(runner, Str_Equals_Str(FH_Get_Path(fh), "", 0), "Get_Path");
+ TEST_TRUE(runner, Str_Equals_Utf8(FH_Get_Path(fh), "", 0), "Get_Path");
FH_Set_Path(fh, (String*)foo);
TEST_TRUE(runner, Str_Equals(FH_Get_Path(fh), (Obj*)foo), "Set_Path");
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Store/TestRAMFileHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMFileHandle.c b/core/Lucy/Test/Store/TestRAMFileHandle.c
index c8a57b9..d276d5d 100644
--- a/core/Lucy/Test/Store/TestRAMFileHandle.c
+++ b/core/Lucy/Test/Store/TestRAMFileHandle.c
@@ -55,7 +55,7 @@ test_Read_Write(TestBatchRunner *runner) {
char buffer[12];
char *buf = buffer;
- TEST_TRUE(runner, Str_Equals_Str(RAMFH_Get_Path(fh), "", 0),
+ TEST_TRUE(runner, Str_Equals_Utf8(RAMFH_Get_Path(fh), "", 0),
"NULL arg as filepath yields empty string");
TEST_TRUE(runner, RAMFH_Write(fh, foo, 3), "Write returns success");
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Store/TestRAMFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMFolder.c b/core/Lucy/Test/Store/TestRAMFolder.c
index 13aeb9d..c173897 100644
--- a/core/Lucy/Test/Store/TestRAMFolder.c
+++ b/core/Lucy/Test/Store/TestRAMFolder.c
@@ -159,7 +159,7 @@ test_Local_Find_Folder(TestBatchRunner *runner) {
TEST_TRUE(runner,
local
&& RAMFolder_Is_A(local, RAMFOLDER)
- && Str_Equals_Str(RAMFolder_Get_Path(local), "foo", 3),
+ && Str_Equals_Utf8(RAMFolder_Get_Path(local), "foo", 3),
"Find local directory");
DECREF(folder);
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Util/TestIndexFileNames.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestIndexFileNames.c b/core/Lucy/Test/Util/TestIndexFileNames.c
index c2b55ee..c5b2a18 100644
--- a/core/Lucy/Test/Util/TestIndexFileNames.c
+++ b/core/Lucy/Test/Util/TestIndexFileNames.c
@@ -32,7 +32,7 @@ S_test_local_part(TestBatchRunner *runner, const char *source,
const char *wanted, const char *test_name) {
StackString *source_str = SSTR_WRAP_STR(source, strlen(source));
String *got = IxFileNames_local_part((String*)source_str);
- TEST_TRUE(runner, Str_Equals_Str(got, wanted, strlen(wanted)), test_name);
+ TEST_TRUE(runner, Str_Equals_Utf8(got, wanted, strlen(wanted)), test_name);
DECREF(got);
}
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Test/Util/TestJson.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestJson.c b/core/Lucy/Test/Util/TestJson.c
index 3b17a6d..2fa7e32 100644
--- a/core/Lucy/Test/Util/TestJson.c
+++ b/core/Lucy/Test/Util/TestJson.c
@@ -35,8 +35,8 @@ TestJson_new() {
static Obj*
S_make_dump() {
Hash *dump = Hash_new(0);
- Hash_Store_Str(dump, "foo", 3, (Obj*)Str_newf("foo"));
- Hash_Store_Str(dump, "stuff", 5, (Obj*)VA_new(0));
+ Hash_Store_Utf8(dump, "foo", 3, (Obj*)Str_newf("foo"));
+ Hash_Store_Utf8(dump, "stuff", 5, (Obj*)VA_new(0));
return (Obj*)dump;
}
@@ -163,7 +163,7 @@ test_numbers(TestBatchRunner *runner) {
Integer64 *i64 = Int64_new(33);
String *json = Json_to_json((Obj*)i64);
String *trimmed = Str_Trim(json);
- TEST_TRUE(runner, Str_Equals_Str(trimmed, "33", 2), "Integer");
+ TEST_TRUE(runner, Str_Equals_Utf8(trimmed, "33", 2), "Integer");
DECREF(json);
DECREF(trimmed);
@@ -326,14 +326,14 @@ test_floats(TestBatchRunner *runner) {
static void
test_max_depth(TestBatchRunner *runner) {
Hash *circular = Hash_new(0);
- Hash_Store_Str(circular, "circular", 8, INCREF(circular));
+ Hash_Store_Utf8(circular, "circular", 8, INCREF(circular));
Err_set_error(NULL);
String *not_json = Json_to_json((Obj*)circular);
TEST_TRUE(runner, not_json == NULL,
"to_json returns NULL when fed recursing data");
TEST_TRUE(runner, Err_get_error() != NULL,
"to_json sets Err_error when fed recursing data");
- DECREF(Hash_Delete_Str(circular, "circular", 8));
+ DECREF(Hash_Delete_Utf8(circular, "circular", 8));
DECREF(circular);
}
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Util/Freezer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Freezer.c b/core/Lucy/Util/Freezer.c
index e492962..521ea03 100644
--- a/core/Lucy/Util/Freezer.c
+++ b/core/Lucy/Util/Freezer.c
@@ -455,7 +455,7 @@ S_load_via_load_method(VTable *vtable, Obj *dump) {
static Obj*
S_load_from_hash(Hash *dump) {
- String *class_name = (String*)Hash_Fetch_Str(dump, "_class", 6);
+ String *class_name = (String*)Hash_Fetch_Utf8(dump, "_class", 6);
// Assume that the presence of the "_class" key paired with a valid class
// name indicates the output of a dump() rather than an ordinary Hash.
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Util/IndexFileNames.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/IndexFileNames.c b/core/Lucy/Util/IndexFileNames.c
index e3b7bf7..ee5d237 100644
--- a/core/Lucy/Util/IndexFileNames.c
+++ b/core/Lucy/Util/IndexFileNames.c
@@ -32,8 +32,8 @@ IxFileNames_latest_snapshot(Folder *folder) {
while (DH_Next(dh)) {
String *entry = DH_Get_Entry(dh);
- if (Str_Starts_With_Str(entry, "snapshot_", 9)
- && Str_Ends_With_Str(entry, ".json", 5)
+ if (Str_Starts_With_Utf8(entry, "snapshot_", 9)
+ && Str_Ends_With_Utf8(entry, ".json", 5)
) {
uint64_t gen = IxFileNames_extract_gen(entry);
if (gen > latest_gen) {
http://git-wip-us.apache.org/repos/asf/lucy/blob/3804cbc3/core/Lucy/Util/Json.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Json.c b/core/Lucy/Util/Json.c
index b5e7f57..c564c55 100644
--- a/core/Lucy/Util/Json.c
+++ b/core/Lucy/Util/Json.c
@@ -159,7 +159,7 @@ Json_to_json(Obj *dump) {
}
else {
// Append newline.
- CB_Cat_Trusted_UTF8(buf, "\n", 1);
+ CB_Cat_Trusted_Utf8(buf, "\n", 1);
json = CB_Yield_String(buf);
}
@@ -177,7 +177,7 @@ static const int32_t MAX_DEPTH = 200;
static void
S_append_json_string(String *dump, CharBuf *buf) {
// Append opening quote.
- CB_Cat_Trusted_UTF8(buf, "\"", 1);
+ CB_Cat_Trusted_Utf8(buf, "\"", 1);
// Process string data.
StringIterator *iter = Str_Top(dump);
@@ -241,12 +241,12 @@ S_append_json_string(String *dump, CharBuf *buf) {
buffer[0] = (char)code_point;
len = 1;
}
- CB_Cat_Trusted_UTF8(buf, buffer, len);
+ CB_Cat_Trusted_Utf8(buf, buffer, len);
}
}
// Append closing quote.
- CB_Cat_Trusted_UTF8(buf, "\"", 1);
+ CB_Cat_Trusted_Utf8(buf, "\"", 1);
DECREF(iter);
}
@@ -254,7 +254,7 @@ S_append_json_string(String *dump, CharBuf *buf) {
static void
S_cat_whitespace(CharBuf *buf, int32_t depth) {
while (depth--) {
- CB_Cat_Trusted_UTF8(buf, indentation, INDENTATION_LEN);
+ CB_Cat_Trusted_Utf8(buf, indentation, INDENTATION_LEN);
}
}
@@ -268,13 +268,13 @@ S_to_json(Obj *dump, CharBuf *buf, int32_t depth) {
}
if (!dump) {
- CB_Cat_Trusted_UTF8(buf, "null", 4);
+ CB_Cat_Trusted_Utf8(buf, "null", 4);
}
else if (dump == (Obj*)CFISH_TRUE) {
- CB_Cat_Trusted_UTF8(buf, "true", 4);
+ CB_Cat_Trusted_Utf8(buf, "true", 4);
}
else if (dump == (Obj*)CFISH_FALSE) {
- CB_Cat_Trusted_UTF8(buf, "false", 5);
+ CB_Cat_Trusted_Utf8(buf, "false", 5);
}
else if (Obj_Is_A(dump, STRING)) {
S_append_json_string((String*)dump, buf);
@@ -290,36 +290,36 @@ S_to_json(Obj *dump, CharBuf *buf, int32_t depth) {
size_t size = VA_Get_Size(array);
if (size == 0) {
// Put empty array on single line.
- CB_Cat_Trusted_UTF8(buf, "[]", 2);
+ CB_Cat_Trusted_Utf8(buf, "[]", 2);
return true;
}
else if (size == 1) {
Obj *elem = VA_Fetch(array, 0);
if (!(Obj_Is_A(elem, HASH) || Obj_Is_A(elem, VARRAY))) {
// Put array containing single scalar element on one line.
- CB_Cat_Trusted_UTF8(buf, "[", 1);
+ CB_Cat_Trusted_Utf8(buf, "[", 1);
if (!S_to_json(elem, buf, depth + 1)) {
return false;
}
- CB_Cat_Trusted_UTF8(buf, "]", 1);
+ CB_Cat_Trusted_Utf8(buf, "]", 1);
return true;
}
}
// Fall back to spreading elements across multiple lines.
- CB_Cat_Trusted_UTF8(buf, "[", 1);
+ CB_Cat_Trusted_Utf8(buf, "[", 1);
for (size_t i = 0; i < size; i++) {
- CB_Cat_Trusted_UTF8(buf, "\n", 1);
+ CB_Cat_Trusted_Utf8(buf, "\n", 1);
S_cat_whitespace(buf, depth + 1);
if (!S_to_json(VA_Fetch(array, i), buf, depth + 1)) {
return false;
}
if (i + 1 < size) {
- CB_Cat_Trusted_UTF8(buf, ",", 1);
+ CB_Cat_Trusted_Utf8(buf, ",", 1);
}
}
- CB_Cat_Trusted_UTF8(buf, "\n", 1);
+ CB_Cat_Trusted_Utf8(buf, "\n", 1);
S_cat_whitespace(buf, depth);
- CB_Cat_Trusted_UTF8(buf, "]", 1);
+ CB_Cat_Trusted_Utf8(buf, "]", 1);
}
else if (Obj_Is_A(dump, HASH)) {
Hash *hash = (Hash*)dump;
@@ -327,7 +327,7 @@ S_to_json(Obj *dump, CharBuf *buf, int32_t depth) {
// Put empty hash on single line.
if (size == 0) {
- CB_Cat_Trusted_UTF8(buf, "{}", 2);
+ CB_Cat_Trusted_Utf8(buf, "{}", 2);
return true;
}
@@ -346,24 +346,24 @@ S_to_json(Obj *dump, CharBuf *buf, int32_t depth) {
VA_Sort(keys, NULL, NULL);
// Spread pairs across multiple lines.
- CB_Cat_Trusted_UTF8(buf, "{", 1);
+ CB_Cat_Trusted_Utf8(buf, "{", 1);
for (size_t i = 0; i < size; i++) {
Obj *key = VA_Fetch(keys, i);
- CB_Cat_Trusted_UTF8(buf, "\n", 1);
+ CB_Cat_Trusted_Utf8(buf, "\n", 1);
S_cat_whitespace(buf, depth + 1);
S_append_json_string((String*)key, buf);
- CB_Cat_Trusted_UTF8(buf, ": ", 2);
+ CB_Cat_Trusted_Utf8(buf, ": ", 2);
if (!S_to_json(Hash_Fetch(hash, key), buf, depth + 1)) {
DECREF(keys);
return false;
}
if (i + 1 < size) {
- CB_Cat_Trusted_UTF8(buf, ",", 1);
+ CB_Cat_Trusted_Utf8(buf, ",", 1);
}
}
- CB_Cat_Trusted_UTF8(buf, "\n", 1);
+ CB_Cat_Trusted_Utf8(buf, "\n", 1);
S_cat_whitespace(buf, depth);
- CB_Cat_Trusted_UTF8(buf, "}", 1);
+ CB_Cat_Trusted_Utf8(buf, "}", 1);
DECREF(keys);
}