lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [15/50] [abbrv] Rename _UTF8 and _Str to _Utf8
Date Fri, 11 Oct 2013 13:31:53 GMT
http://git-wip-us.apache.org/repos/asf/lucy/blob/c3ccd8cd/core/LucyX/Search/ProximityQuery.c
----------------------------------------------------------------------
diff --git a/core/LucyX/Search/ProximityQuery.c b/core/LucyX/Search/ProximityQuery.c
index 903995a..ee76917 100644
--- a/core/LucyX/Search/ProximityQuery.c
+++ b/core/LucyX/Search/ProximityQuery.c
@@ -104,10 +104,10 @@ ProximityQuery_Dump_IMP(ProximityQuery *self) {
     ProximityQuery_Dump_t super_dump
         = SUPER_METHOD_PTR(PROXIMITYQUERY, LUCY_ProximityQuery_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_Str(dump, "within", 6,
-                   (Obj*)Str_newf("%i64", (int64_t)ivars->within));
+    Hash_Store_Utf8(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
+    Hash_Store_Utf8(dump, "terms", 5, Freezer_dump((Obj*)ivars->terms));
+    Hash_Store_Utf8(dump, "within", 6,
+                    (Obj*)Str_newf("%i64", (int64_t)ivars->within));
     return (Obj*)dump;
 }
 
@@ -118,11 +118,11 @@ ProximityQuery_Load_IMP(ProximityQuery *self, Obj *dump) {
         = SUPER_METHOD_PTR(PROXIMITYQUERY, LUCY_ProximityQuery_Load);
     ProximityQuery *loaded = (ProximityQuery*)super_load(self, dump);
     ProximityQueryIVARS *loaded_ivars = ProximityQuery_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);
-    Obj *within = CERTIFY(Hash_Fetch_Str(source, "within", 6), OBJ);
+    Obj *within = CERTIFY(Hash_Fetch_Utf8(source, "within", 6), OBJ);
     loaded_ivars->within = (uint32_t)Obj_To_I64(within);
     return (Obj*)loaded;
 }
@@ -151,17 +151,17 @@ ProximityQuery_To_String_IMP(ProximityQuery *self) {
     ProximityQueryIVARS *const ivars = ProximityQuery_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);
     CB_catf(buf, "~%u32", ivars->within);
     String *retval = CB_Yield_String(buf);
     DECREF(buf);

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3ccd8cd/perl/xs/Lucy/Analysis/RegexTokenizer.c
----------------------------------------------------------------------
diff --git a/perl/xs/Lucy/Analysis/RegexTokenizer.c b/perl/xs/Lucy/Analysis/RegexTokenizer.c
index cba3ab0..59baf40 100644
--- a/perl/xs/Lucy/Analysis/RegexTokenizer.c
+++ b/perl/xs/Lucy/Analysis/RegexTokenizer.c
@@ -45,8 +45,8 @@ lucy_RegexTokenizer_init(lucy_RegexTokenizer *self,
     lucy_RegexTokenizerIVARS *const ivars = lucy_RegexTokenizer_IVARS(self);
     #define DEFAULT_PATTERN "\\w+(?:['\\x{2019}]\\w+)*"
     if (pattern) {
-        if (CFISH_Str_Find_Str(pattern, "\\p", 2) != -1
-            || CFISH_Str_Find_Str(pattern, "\\P", 2) != -1
+        if (CFISH_Str_Find_Utf8(pattern, "\\p", 2) != -1
+            || CFISH_Str_Find_Utf8(pattern, "\\P", 2) != -1
            ) {
             CFISH_DECREF(self);
             THROW(CFISH_ERR, "\\p and \\P constructs forbidden");
@@ -137,9 +137,9 @@ LUCY_RegexTokenizer_Destroy_IMP(lucy_RegexTokenizer *self) {
 }
 
 void
-LUCY_RegexTokenizer_Tokenize_Str_IMP(lucy_RegexTokenizer *self,
-                                     const char *string, size_t string_len,
-                                     lucy_Inversion *inversion) {
+LUCY_RegexTokenizer_Tokenize_Utf8_IMP(lucy_RegexTokenizer *self,
+                                      const char *string, size_t string_len,
+                                      lucy_Inversion *inversion) {
     lucy_RegexTokenizerIVARS *const ivars = lucy_RegexTokenizer_IVARS(self);
     uint32_t   num_code_points = 0;
     SV        *wrapper    = sv_newmortal();

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3ccd8cd/perl/xs/Lucy/Document/Doc.c
----------------------------------------------------------------------
diff --git a/perl/xs/Lucy/Document/Doc.c b/perl/xs/Lucy/Document/Doc.c
index 224f0bb..1d6723a 100644
--- a/perl/xs/Lucy/Document/Doc.c
+++ b/perl/xs/Lucy/Document/Doc.c
@@ -178,12 +178,12 @@ cfish_Hash*
 LUCY_Doc_Dump_IMP(lucy_Doc *self) {
     lucy_DocIVARS *const ivars = lucy_Doc_IVARS(self);
     cfish_Hash *dump = cfish_Hash_new(0);
-    CFISH_Hash_Store_Str(dump, "_class", 6,
-                        (cfish_Obj*)CFISH_Str_Clone(LUCY_Doc_Get_Class_Name(self)));
-    CFISH_Hash_Store_Str(dump, "doc_id", 7,
-                        (cfish_Obj*)cfish_Str_newf("%i32", ivars->doc_id));
-    CFISH_Hash_Store_Str(dump, "fields", 6,
-                        XSBind_perl_to_cfish((SV*)ivars->fields));
+    CFISH_Hash_Store_Utf8(dump, "_class", 6,
+                          (cfish_Obj*)CFISH_Str_Clone(LUCY_Doc_Get_Class_Name(self)));
+    CFISH_Hash_Store_Utf8(dump, "doc_id", 7,
+                          (cfish_Obj*)cfish_Str_newf("%i32", ivars->doc_id));
+    CFISH_Hash_Store_Utf8(dump, "fields", 6,
+                          XSBind_perl_to_cfish((SV*)ivars->fields));
     return dump;
 }
 
@@ -191,15 +191,15 @@ lucy_Doc*
 LUCY_Doc_Load_IMP(lucy_Doc *self, cfish_Obj *dump) {
     cfish_Hash *source = (cfish_Hash*)CFISH_CERTIFY(dump, CFISH_HASH);
     cfish_String *class_name = (cfish_String*)CFISH_CERTIFY(
-                                   CFISH_Hash_Fetch_Str(source, "_class", 6),
+                                   CFISH_Hash_Fetch_Utf8(source, "_class", 6),
                                    CFISH_STRING);
     cfish_VTable *vtable = cfish_VTable_singleton(class_name, NULL);
     lucy_Doc *loaded = (lucy_Doc*)CFISH_VTable_Make_Obj(vtable);
     cfish_Obj *doc_id = CFISH_CERTIFY(
-                           CFISH_Hash_Fetch_Str(source, "doc_id", 7),
+                           CFISH_Hash_Fetch_Utf8(source, "doc_id", 7),
                            CFISH_OBJ);
     cfish_Hash *fields = (cfish_Hash*)CFISH_CERTIFY(
-                            CFISH_Hash_Fetch_Str(source, "fields", 6),
+                            CFISH_Hash_Fetch_Utf8(source, "fields", 6),
                             CFISH_HASH);
     SV *fields_sv = XSBind_cfish_to_perl((cfish_Obj*)fields);
     CHY_UNUSED_VAR(self);


Mime
View raw message