[Groonga-commit] groonga/groonga at 80e579f [master] Extract grn_str and grn_string declarations

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Apr 10 18:03:53 JST 2018


Kouhei Sutou	2018-04-10 18:03:53 +0900 (Tue, 10 Apr 2018)

  New Revision: 80e579f701197fbbd94309d1e9a62cafb1cd0a41
  https://github.com/groonga/groonga/commit/80e579f701197fbbd94309d1e9a62cafb1cd0a41

  Message:
    Extract grn_str and grn_string declarations

  Added files:
    include/groonga/string.h
  Modified files:
    include/groonga.h
    include/groonga/Makefile.am
    include/groonga/groonga.h

  Modified: include/groonga.h (+1 -0)
===================================================================
--- include/groonga.h    2018-04-10 17:55:43 +0900 (d984ab232)
+++ include/groonga.h    2018-04-10 18:03:53 +0900 (dd465e3aa)
@@ -44,6 +44,7 @@
 #include "groonga/pat.h"
 #include "groonga/request_canceler.h"
 #include "groonga/request_timer.h"
+#include "groonga/string.h"
 #include "groonga/table.h"
 #include "groonga/thread.h"
 #include "groonga/time.h"

  Modified: include/groonga/Makefile.am (+1 -0)
===================================================================
--- include/groonga/Makefile.am    2018-04-10 17:55:43 +0900 (d8e115a2a)
+++ include/groonga/Makefile.am    2018-04-10 18:03:53 +0900 (5187333e8)
@@ -30,6 +30,7 @@ groonga_include_HEADERS =			\
 	request_canceler.h			\
 	request_timer.h				\
 	scorer.h				\
+	string.h				\
 	table.h					\
 	thread.h				\
 	time.h					\

  Modified: include/groonga/groonga.h (+0 -79)
===================================================================
--- include/groonga/groonga.h    2018-04-10 17:55:43 +0900 (88fa7687a)
+++ include/groonga/groonga.h    2018-04-10 18:03:53 +0900 (2415d68a4)
@@ -1550,85 +1550,6 @@ GRN_API void grn_ctx_recv_handler_set(grn_ctx *,
 #define GRN_RECORD_POP(obj, value) GRN_BULK_POP(obj, value, grn_id, GRN_ID_NIL)
 #define GRN_PTR_POP(obj, value) GRN_BULK_POP(obj, value, grn_obj *, NULL)
 
-/* grn_str: deprecated. use grn_string instead. */
-
-typedef struct {
-  const char *orig;
-  char *norm;
-  short *checks;
-  unsigned char *ctypes;
-  int flags;
-  unsigned int orig_blen;
-  unsigned int norm_blen;
-  unsigned int length;
-  grn_encoding encoding;
-} grn_str;
-
-#define GRN_STR_REMOVEBLANK            (0x01<<0)
-#define GRN_STR_WITH_CTYPES            (0x01<<1)
-#define GRN_STR_WITH_CHECKS            (0x01<<2)
-#define GRN_STR_NORMALIZE              GRN_OBJ_KEY_NORMALIZE
-
-GRN_API grn_str *grn_str_open(grn_ctx *ctx, const char *str, unsigned int str_len,
-                              int flags);
-GRN_API grn_rc grn_str_close(grn_ctx *ctx, grn_str *nstr);
-
-/* grn_string */
-
-#define GRN_STRING_REMOVE_BLANK               (0x01<<0)
-#define GRN_STRING_WITH_TYPES                 (0x01<<1)
-#define GRN_STRING_WITH_CHECKS                (0x01<<2)
-#define GRN_STRING_REMOVE_TOKENIZED_DELIMITER (0x01<<3)
-
-#define GRN_NORMALIZER_AUTO ((grn_obj *)1)
-
-#define GRN_CHAR_BLANK 0x80
-#define GRN_CHAR_IS_BLANK(c) ((c) & (GRN_CHAR_BLANK))
-#define GRN_CHAR_TYPE(c) ((c) & 0x7f)
-
-typedef enum {
-  GRN_CHAR_NULL = 0,
-  GRN_CHAR_ALPHA,
-  GRN_CHAR_DIGIT,
-  GRN_CHAR_SYMBOL,
-  GRN_CHAR_HIRAGANA,
-  GRN_CHAR_KATAKANA,
-  GRN_CHAR_KANJI,
-  GRN_CHAR_OTHERS,
-  GRN_CHAR_EMOJI
-} grn_char_type;
-
-GRN_API const char *grn_char_type_to_string(grn_char_type type);
-
-GRN_API grn_obj *grn_string_open(grn_ctx *ctx,
-                                 const char *string,
-                                 unsigned int length_in_bytes,
-                                 grn_obj *normalizer, int flags);
-GRN_API grn_rc grn_string_get_original(grn_ctx *ctx, grn_obj *string,
-                                       const char **original,
-                                       unsigned int *length_in_bytes);
-GRN_API int grn_string_get_flags(grn_ctx *ctx, grn_obj *string);
-GRN_API grn_rc grn_string_get_normalized(grn_ctx *ctx, grn_obj *string,
-                                         const char **normalized,
-                                         unsigned int *length_in_bytes,
-                                         unsigned int *n_characters);
-GRN_API grn_rc grn_string_set_normalized(grn_ctx *ctx, grn_obj *string,
-                                         char *normalized,
-                                         unsigned int length_in_bytes,
-                                         unsigned int n_characters);
-GRN_API const short *grn_string_get_checks(grn_ctx *ctx, grn_obj *string);
-GRN_API grn_rc grn_string_set_checks(grn_ctx *ctx,
-                                     grn_obj *string,
-                                     short *checks);
-GRN_API const unsigned char *grn_string_get_types(grn_ctx *ctx, grn_obj *string);
-GRN_API grn_rc grn_string_set_types(grn_ctx *ctx,
-                                    grn_obj *string,
-                                    unsigned char *types);
-GRN_API grn_encoding grn_string_get_encoding(grn_ctx *ctx, grn_obj *string);
-
-
-GRN_API int grn_charlen(grn_ctx *ctx, const char *str, const char *end);
-
 GRN_API grn_rc grn_ctx_push(grn_ctx *ctx, grn_obj *obj);
 GRN_API grn_obj *grn_ctx_pop(grn_ctx *ctx);
 

  Added: include/groonga/string.h (+107 -0) 100644
===================================================================
--- /dev/null
+++ include/groonga/string.h    2018-04-10 18:03:53 +0900 (4adc5783a)
@@ -0,0 +1,107 @@
+/*
+  Copyright(C) 2009-2018 Brazil
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#pragma once
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/* grn_str: deprecated. use grn_string instead. */
+
+typedef struct {
+  const char *orig;
+  char *norm;
+  short *checks;
+  unsigned char *ctypes;
+  int flags;
+  unsigned int orig_blen;
+  unsigned int norm_blen;
+  unsigned int length;
+  grn_encoding encoding;
+} grn_str;
+
+#define GRN_STR_REMOVEBLANK            (0x01<<0)
+#define GRN_STR_WITH_CTYPES            (0x01<<1)
+#define GRN_STR_WITH_CHECKS            (0x01<<2)
+#define GRN_STR_NORMALIZE              GRN_OBJ_KEY_NORMALIZE
+
+GRN_API grn_str *grn_str_open(grn_ctx *ctx, const char *str, unsigned int str_len,
+                              int flags);
+GRN_API grn_rc grn_str_close(grn_ctx *ctx, grn_str *nstr);
+
+
+/* grn_string */
+
+#define GRN_STRING_REMOVE_BLANK               (0x01<<0)
+#define GRN_STRING_WITH_TYPES                 (0x01<<1)
+#define GRN_STRING_WITH_CHECKS                (0x01<<2)
+#define GRN_STRING_REMOVE_TOKENIZED_DELIMITER (0x01<<3)
+
+#define GRN_NORMALIZER_AUTO ((grn_obj *)1)
+
+#define GRN_CHAR_BLANK 0x80
+#define GRN_CHAR_IS_BLANK(c) ((c) & (GRN_CHAR_BLANK))
+#define GRN_CHAR_TYPE(c) ((c) & 0x7f)
+
+typedef enum {
+  GRN_CHAR_NULL = 0,
+  GRN_CHAR_ALPHA,
+  GRN_CHAR_DIGIT,
+  GRN_CHAR_SYMBOL,
+  GRN_CHAR_HIRAGANA,
+  GRN_CHAR_KATAKANA,
+  GRN_CHAR_KANJI,
+  GRN_CHAR_OTHERS,
+  GRN_CHAR_EMOJI
+} grn_char_type;
+
+GRN_API const char *grn_char_type_to_string(grn_char_type type);
+
+GRN_API grn_obj *grn_string_open(grn_ctx *ctx,
+                                 const char *string,
+                                 unsigned int length_in_bytes,
+                                 grn_obj *normalizer, int flags);
+GRN_API grn_rc grn_string_get_original(grn_ctx *ctx, grn_obj *string,
+                                       const char **original,
+                                       unsigned int *length_in_bytes);
+GRN_API int grn_string_get_flags(grn_ctx *ctx, grn_obj *string);
+GRN_API grn_rc grn_string_get_normalized(grn_ctx *ctx, grn_obj *string,
+                                         const char **normalized,
+                                         unsigned int *length_in_bytes,
+                                         unsigned int *n_characters);
+GRN_API grn_rc grn_string_set_normalized(grn_ctx *ctx, grn_obj *string,
+                                         char *normalized,
+                                         unsigned int length_in_bytes,
+                                         unsigned int n_characters);
+GRN_API const short *grn_string_get_checks(grn_ctx *ctx, grn_obj *string);
+GRN_API grn_rc grn_string_set_checks(grn_ctx *ctx,
+                                     grn_obj *string,
+                                     short *checks);
+GRN_API const unsigned char *grn_string_get_types(grn_ctx *ctx, grn_obj *string);
+GRN_API grn_rc grn_string_set_types(grn_ctx *ctx,
+                                    grn_obj *string,
+                                    unsigned char *types);
+GRN_API grn_encoding grn_string_get_encoding(grn_ctx *ctx, grn_obj *string);
+
+
+GRN_API int grn_charlen(grn_ctx *ctx, const char *str, const char *end);
+
+#ifdef __cplusplus
+}
+#endif
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180410/cc1dc8e3/attachment-0001.htm 



More information about the Groonga-commit mailing list
Back to archive index