susumu.yata
null+****@clear*****
Thu Nov 12 09:47:21 JST 2015
susumu.yata 2015-11-12 09:47:21 +0900 (Thu, 12 Nov 2015) New Revision: 0b19b044142382d00491dff17e696721b7d532fb https://github.com/groonga/groonga/commit/0b19b044142382d00491dff17e696721b7d532fb Message: grn_ts: add lib/ts/ts_types.h Copied files: lib/ts/ts_types.h (from lib/grn_ts.h) Modified files: lib/grn_ts.h lib/ts.c lib/ts/sources.am lib/ts/ts_buf.h lib/ts/ts_expr.c lib/ts/ts_expr.h lib/ts/ts_str.h Modified: lib/grn_ts.h (+0 -96) =================================================================== --- lib/grn_ts.h 2015-11-10 22:21:11 +0900 (184ed38) +++ lib/grn_ts.h 2015-11-12 09:47:21 +0900 (06ca2e5) @@ -19,108 +19,12 @@ #ifndef GRN_TS_H #define GRN_TS_H -#include <stddef.h> - #include "grn.h" #ifdef __cplusplus extern "C" { #endif -/*------------------------------------------------------------- - * Built-in data types. - */ - -/* ID (_id). */ -typedef grn_id grn_ts_id; - -/* Score (_score). */ -typedef float grn_ts_score; - -/* Record (_id, _score). */ -typedef struct { - grn_ts_id id; - grn_ts_score score; -} grn_ts_record; - -/* Built-in scalar data types. */ - -/* Bool. */ -typedef grn_bool grn_ts_bool; - -/* Int. */ -typedef int64_t grn_ts_int; - -/* Float. */ -typedef double grn_ts_float; - -/* Time. */ -typedef int64_t grn_ts_time; - -/* Text. */ -typedef struct { - const char *ptr; - size_t size; -} grn_ts_text; - -/* GeoPoint. */ -typedef grn_geo_point grn_ts_geo_point; -typedef grn_geo_point grn_ts_tokyo_geo_point; -typedef grn_geo_point grn_ts_wgs84_geo_point; - -/* Ref. */ -typedef grn_ts_record grn_ts_ref; - -/* Built-in vector data types. */ - -/* BoolVector. */ -typedef struct { - const grn_ts_bool *ptr; - size_t size; -} grn_ts_bool_vector; - -/* IntVector. */ -typedef struct { - const grn_ts_int *ptr; - size_t size; -} grn_ts_int_vector; - -/* FloatVector. */ -typedef struct { - const grn_ts_float *ptr; - size_t size; -} grn_ts_float_vector; - -/* TimeVector. */ -typedef struct { - const grn_ts_time *ptr; - size_t size; -} grn_ts_time_vector; - -/* TextVector. */ -typedef struct { - const grn_ts_text *ptr; - size_t size; -} grn_ts_text_vector; - -/* GeoPointVector. */ -typedef struct { - const grn_ts_geo_point *ptr; - size_t size; -} grn_ts_geo_point_vector; -typedef grn_ts_geo_point_vector grn_ts_tokyo_geo_point_vector; -typedef grn_ts_geo_point_vector grn_ts_wgs84_geo_point_vector; - -/* RefVector. */ -typedef struct { - const grn_ts_ref *ptr; - size_t size; -} grn_ts_ref_vector; - -/*------------------------------------------------------------- - * API. - */ - /* * grn_ts_select() finds records passing through a filter and writes the values * of output columns (the evaluation results of output expressions) into the Modified: lib/ts.c (+1 -0) =================================================================== --- lib/ts.c 2015-11-10 22:21:11 +0900 (2d73b94) +++ lib/ts.c 2015-11-12 09:47:21 +0900 (46f238e) @@ -27,6 +27,7 @@ #include "ts/ts_expr.h" #include "ts/ts_log.h" #include "ts/ts_str.h" +#include "ts/ts_types.h" /*------------------------------------------------------------- * Miscellaneous. Modified: lib/ts/sources.am (+2 -1) =================================================================== --- lib/ts/sources.am 2015-11-10 22:21:11 +0900 (31ec497) +++ lib/ts/sources.am 2015-11-12 09:47:21 +0900 (892393b) @@ -5,4 +5,5 @@ libgrnts_la_SOURCES = \ ts_expr.h \ ts_log.h \ ts_str.c \ - ts_str.h + ts_str.h \ + ts_types.h Modified: lib/ts/ts_buf.h (+1 -1) =================================================================== --- lib/ts/ts_buf.h 2015-11-10 22:21:11 +0900 (04c675e) +++ lib/ts/ts_buf.h 2015-11-12 09:47:21 +0900 (dd98b2c) @@ -19,7 +19,7 @@ #ifndef GRN_TS_BUF_H #define GRN_TS_BUF_H -#include "../grn_ts.h" +#include "ts_types.h" #ifdef __cplusplus extern "C" { Modified: lib/ts/ts_expr.c (+0 -1) =================================================================== --- lib/ts/ts_expr.c 2015-11-10 22:21:11 +0900 (8435fb9) +++ lib/ts/ts_expr.c 2015-11-12 09:47:21 +0900 (b1d049c) @@ -30,7 +30,6 @@ #include "../grn_pat.h" #include "../grn_store.h" -#include "ts_buf.h" #include "ts_log.h" #include "ts_str.h" Modified: lib/ts/ts_expr.h (+1 -27) =================================================================== --- lib/ts/ts_expr.h 2015-11-10 22:21:11 +0900 (cbd377e) +++ lib/ts/ts_expr.h 2015-11-12 09:47:21 +0900 (267a0d4) @@ -19,11 +19,8 @@ #ifndef GRN_TS_EXPR_H #define GRN_TS_EXPR_H -#include <stdint.h> - -#include "../grn_ts.h" - #include "ts_buf.h" +#include "ts_types.h" #ifdef __cplusplus extern "C" { @@ -33,29 +30,6 @@ extern "C" { * Enumeration types. */ -/* grn_builtin_type or table ID. */ -typedef grn_id grn_ts_data_type; - -enum { GRN_TS_VECTOR_FLAG = 1 << 7 }; - -typedef enum { - GRN_TS_VOID = 0, /* GRN_DB_VOID */ - GRN_TS_BOOL = 1, /* GRN_DB_BOOL */ - GRN_TS_INT = 2, /* GRN_DB_[U]INT(8/16/32/64) */ - GRN_TS_FLOAT = 3, /* GRN_DB_FLOAT */ - GRN_TS_TIME = 4, /* GRN_DB_TIME */ - GRN_TS_TEXT = 5, /* GRN_DB_[SHORT_/LONG_]TEST */ - GRN_TS_GEO_POINT = 6, /* GRN_DB_(TOKYO/WGS84)_GEO_POINT */ - GRN_TS_REF = 7, /* Table reference. */ - GRN_TS_BOOL_VECTOR = GRN_TS_VECTOR_FLAG | GRN_TS_BOOL, - GRN_TS_INT_VECTOR = GRN_TS_VECTOR_FLAG | GRN_TS_INT, - GRN_TS_FLOAT_VECTOR = GRN_TS_VECTOR_FLAG | GRN_TS_FLOAT, - GRN_TS_TIME_VECTOR = GRN_TS_VECTOR_FLAG | GRN_TS_TIME, - GRN_TS_TEXT_VECTOR = GRN_TS_VECTOR_FLAG | GRN_TS_TEXT, - GRN_TS_GEO_POINT_VECTOR = GRN_TS_VECTOR_FLAG | GRN_TS_GEO_POINT, - GRN_TS_REF_VECTOR = GRN_TS_VECTOR_FLAG | GRN_TS_REF -} grn_ts_data_kind; - typedef enum { /* Invalid operator. */ GRN_TS_OP_NOP, Modified: lib/ts/ts_str.h (+1 -1) =================================================================== --- lib/ts/ts_str.h 2015-11-10 22:21:11 +0900 (fe83b7b) +++ lib/ts/ts_str.h 2015-11-12 09:47:21 +0900 (c425ea1) @@ -19,7 +19,7 @@ #ifndef GRN_TS_STR_H #define GRN_TS_STR_H -#include "../grn_ts.h" +#include "ts_types.h" #ifdef __cplusplus extern "C" { Copied: lib/ts/ts_types.h (+37 -30) 64% =================================================================== --- lib/grn_ts.h 2015-11-10 22:21:11 +0900 (184ed38) +++ lib/ts/ts_types.h 2015-11-12 09:47:21 +0900 (7260f2e) @@ -16,12 +16,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef GRN_TS_H -#define GRN_TS_H +#ifndef GRN_TS_TYPES_H +#define GRN_TS_TYPES_H -#include <stddef.h> - -#include "grn.h" +#include "../grn.h" #ifdef __cplusplus extern "C" { @@ -31,6 +29,9 @@ extern "C" { * Built-in data types. */ +/* grn_builtin_type or table ID. */ +typedef grn_id grn_ts_data_type; + /* ID (_id). */ typedef grn_id grn_ts_id; @@ -43,7 +44,33 @@ typedef struct { grn_ts_score score; } grn_ts_record; -/* Built-in scalar data types. */ +/*------------------------------------------------------------- + * Built-in data kinds. + */ + +enum { GRN_TS_VECTOR_FLAG = 1 << 7 }; + +typedef enum { + GRN_TS_VOID = 0, /* GRN_DB_VOID */ + GRN_TS_BOOL = 1, /* GRN_DB_BOOL */ + GRN_TS_INT = 2, /* GRN_DB_[U]INT(8/16/32/64) */ + GRN_TS_FLOAT = 3, /* GRN_DB_FLOAT */ + GRN_TS_TIME = 4, /* GRN_DB_TIME */ + GRN_TS_TEXT = 5, /* GRN_DB_[SHORT_/LONG_]TEST */ + GRN_TS_GEO_POINT = 6, /* GRN_DB_(TOKYO/WGS84)_GEO_POINT */ + GRN_TS_REF = 7, /* Table reference. */ + GRN_TS_BOOL_VECTOR = GRN_TS_VECTOR_FLAG | GRN_TS_BOOL, + GRN_TS_INT_VECTOR = GRN_TS_VECTOR_FLAG | GRN_TS_INT, + GRN_TS_FLOAT_VECTOR = GRN_TS_VECTOR_FLAG | GRN_TS_FLOAT, + GRN_TS_TIME_VECTOR = GRN_TS_VECTOR_FLAG | GRN_TS_TIME, + GRN_TS_TEXT_VECTOR = GRN_TS_VECTOR_FLAG | GRN_TS_TEXT, + GRN_TS_GEO_POINT_VECTOR = GRN_TS_VECTOR_FLAG | GRN_TS_GEO_POINT, + GRN_TS_REF_VECTOR = GRN_TS_VECTOR_FLAG | GRN_TS_REF +} grn_ts_data_kind; + +/*------------------------------------------------------------- + * Built-in scalar data kinds. + */ /* Bool. */ typedef grn_bool grn_ts_bool; @@ -71,7 +98,9 @@ typedef grn_geo_point grn_ts_wgs84_geo_point; /* Ref. */ typedef grn_ts_record grn_ts_ref; -/* Built-in vector data types. */ +/*------------------------------------------------------------- + * Built-in vector data kinds. + */ /* BoolVector. */ typedef struct { @@ -117,30 +146,8 @@ typedef struct { size_t size; } grn_ts_ref_vector; -/*------------------------------------------------------------- - * API. - */ - -/* - * grn_ts_select() finds records passing through a filter and writes the values - * of output columns (the evaluation results of output expressions) into the - * output buffer (`ctx->impl->outbuf`). - * - * Note that the first `offset` records will be discarded and at most `limit` - * records will be output. - * - * On success, grn_ts_select() returns GRN_SUCCESS. - * On failure, grn_ts_select() returns an error code and set the details into - * `ctx`. - */ -grn_rc grn_ts_select(grn_ctx *ctx, grn_obj *table, - const char *filter_ptr, size_t filter_size, - const char *output_columns_ptr, - size_t output_columns_size, - size_t offset, size_t limit); - #ifdef __cplusplus } #endif -#endif /* GRN_TS_H */ +#endif /* GRN_TS_TYPES_H */ -------------- next part -------------- HTML����������������������������...下載