|
Groonga
|
#include <stdarg.h>#include <stdbool.h>#include <stdint.h>#include <string.h>#include <sys/types.h>

Go to the source code of this file.
Classes | |
| union | grn_user_data |
| struct | _grn_ctx |
| struct | _grn_section |
| struct | _grn_obj_header |
| struct | _grn_obj |
| struct | grn_expr_var |
| struct | _grn_fuzzy_search_optarg |
| struct | _grn_match_info |
| struct | _grn_search_optarg |
| struct | _grn_index_datum |
| struct | _grn_snip_mapping |
| struct | _grn_logger_info |
| struct | _grn_logger |
| struct | _grn_query_logger |
| struct | _grn_ctx_info |
| struct | _grn_table_delete_optarg |
| struct | _grn_table_scan_hit |
| struct | grn_timeval |
Macros | |
| #define | GRN_API |
| #define | GRN_ID_NIL (0x00) |
| Means "does not exist". | |
| #define | GRN_ID_MAX (0x3fffffff) |
| #define | GRN_TRUE true |
| #define | GRN_FALSE false |
| #define | GRN_LZO_ERROR GRN_LZ4_ERROR |
| #define | GRN_COMMAND_VERSION_MIN GRN_COMMAND_VERSION_1 |
| #define | GRN_COMMAND_VERSION_STABLE GRN_COMMAND_VERSION_1 |
| #define | GRN_COMMAND_VERSION_MAX GRN_COMMAND_VERSION_3 |
| #define | GRN_QUERY_LOG_NONE (0x00) |
| #define | GRN_QUERY_LOG_COMMAND (0x01 << 0) |
| #define | GRN_QUERY_LOG_RESULT_CODE (0x01 << 1) |
| #define | GRN_QUERY_LOG_DESTINATION (0x01 << 2) |
| #define | GRN_QUERY_LOG_CACHE (0x01 << 3) |
| #define | GRN_QUERY_LOG_SIZE (0x01 << 4) |
| #define | GRN_QUERY_LOG_SCORE (0x01 << 5) |
| #define | GRN_QUERY_LOG_ALL |
| #define | GRN_QUERY_LOG_DEFAULT GRN_QUERY_LOG_ALL |
| #define | GRN_CTX_MSGSIZE (0x80) |
| #define | GRN_CTX_FIN (0xff) |
| #define | GRN_CTX_USER_DATA(ctx) (&((ctx)->user_data)) |
| #define | GRN_CTX_USE_QL (0x03) |
| #define | GRN_CTX_BATCH_MODE (0x04) |
| #define | GRN_CTX_PER_DB (0x08) |
| #define | GRN_CTX_GET_ENCODING(ctx) ((ctx)->encoding) |
| #define | GRN_CTX_SET_ENCODING(ctx, enc) |
| #define | GRN_OBJ_FLAGS_MASK (0xffff) |
| #define | GRN_OBJ_TABLE_TYPE_MASK (0x07) |
| #define | GRN_OBJ_TABLE_HASH_KEY (0x00) |
| #define | GRN_OBJ_TABLE_PAT_KEY (0x01) |
| #define | GRN_OBJ_TABLE_DAT_KEY (0x02) |
| #define | GRN_OBJ_TABLE_NO_KEY (0x03) |
| #define | GRN_OBJ_KEY_MASK (0x07 << 3) |
Mask of GRN_OBJ_KEY_* | |
| #define | GRN_OBJ_KEY_UINT (0x00 << 3) |
| #define | GRN_OBJ_KEY_INT (0x01 << 3) |
| #define | GRN_OBJ_KEY_FLOAT (0x02 << 3) |
| #define | GRN_OBJ_KEY_GEO_POINT (0x03 << 3) |
| #define | GRN_OBJ_KEY_WITH_SIS (0x01 << 6) |
| #define | GRN_OBJ_KEY_NORMALIZE (0x01 << 7) |
| #define | GRN_OBJ_COLUMN_TYPE_MASK (0x07) |
| #define | GRN_OBJ_COLUMN_SCALAR (0x00) |
| #define | GRN_OBJ_COLUMN_VECTOR (0x01) |
| #define | GRN_OBJ_COLUMN_INDEX (0x02) |
| #define | GRN_OBJ_COMPRESS_MASK (0x07 << 4) |
| #define | GRN_OBJ_COMPRESS_NONE (0x00 << 4) |
| #define | GRN_OBJ_COMPRESS_ZLIB (0x01 << 4) |
| #define | GRN_OBJ_COMPRESS_LZ4 (0x02 << 4) |
| #define | GRN_OBJ_COMPRESS_LZO GRN_OBJ_COMPRESS_LZ4 |
| #define | GRN_OBJ_COMPRESS_ZSTD (0x03 << 4) |
| #define | GRN_OBJ_COMPRESS_OPENZL (0x04 << 4) |
| #define | GRN_OBJ_WITH_SECTION (0x01 << 7) |
| #define | GRN_OBJ_WITH_WEIGHT (0x01 << 8) |
| #define | GRN_OBJ_WITH_POSITION (0x01 << 9) |
| #define | GRN_OBJ_RING_BUFFER (0x01 << 10) |
| #define | GRN_OBJ_WEIGHT_BFLOAT16 (0x01 << 11) |
| #define | GRN_OBJ_UNIT_MASK (0x0f << 8) |
| #define | GRN_OBJ_UNIT_DOCUMENT_NONE (0x00 << 8) |
| #define | GRN_OBJ_UNIT_DOCUMENT_SECTION (0x01 << 8) |
| #define | GRN_OBJ_UNIT_DOCUMENT_POSITION (0x02 << 8) |
| #define | GRN_OBJ_UNIT_SECTION_NONE (0x03 << 8) |
| #define | GRN_OBJ_UNIT_SECTION_POSITION (0x04 << 8) |
| #define | GRN_OBJ_UNIT_POSITION_NONE (0x05 << 8) |
| #define | GRN_OBJ_UNIT_USERDEF_DOCUMENT (0x06 << 8) |
| #define | GRN_OBJ_UNIT_USERDEF_SECTION (0x07 << 8) |
| #define | GRN_OBJ_UNIT_USERDEF_POSITION (0x08 << 8) |
| #define | GRN_OBJ_NO_SUBREC (0x00 << 13) |
| #define | GRN_OBJ_WITH_SUBREC (0x01 << 13) |
| #define | GRN_OBJ_KEY_VAR_SIZE (0x01 << 14) |
| #define | GRN_OBJ_TEMPORARY (0x00 << 15) |
| #define | GRN_OBJ_PERSISTENT (0x01 << 15) |
| #define | GRN_OBJ_KEY_LARGE (0x01 << 16) |
| #define | GRN_OBJ_INDEX_SMALL (0x01 << 16) |
| #define | GRN_OBJ_INDEX_MEDIUM (0x01 << 17) |
| #define | GRN_OBJ_INDEX_LARGE (0x01 << 18) |
| #define | GRN_OBJ_WEIGHT_FLOAT32 (0x01 << 19) |
| #define | GRN_OBJ_MISSING_MASK (0x03 << 20) |
| #define | GRN_OBJ_MISSING_ADD (0x00 << 20) |
| #define | GRN_OBJ_MISSING_IGNORE (0x01 << 20) |
| #define | GRN_OBJ_MISSING_NIL (0x02 << 20) |
| #define | GRN_OBJ_INVALID_MASK (0x03 << 22) |
| #define | GRN_OBJ_INVALID_ERROR (0x00 << 22) |
| #define | GRN_OBJ_INVALID_WARN (0x01 << 22) |
| #define | GRN_OBJ_INVALID_IGNORE (0x02 << 22) |
| #define | GRN_OBJ_COMPRESS_FILTER_SHUFFLE (0x01 << 24) |
| #define | GRN_OBJ_COMPRESS_FILTER_BYTE_DELTA (0x01 << 25) |
| #define | GRN_OBJ_COMPRESS_FILTER_TRUNCATE_PRECISION_1BYTE (0x01 << 26) |
| #define | GRN_OBJ_COMPRESS_FILTER_TRUNCATE_PRECISION_2BYTES (0x01 << 27) |
| #define | GRN_OBJ_VISIBLE ((uint32_t)(0x00 << 31)) |
| #define | GRN_OBJ_INVISIBLE ((uint32_t)(0x01 << 31)) |
| #define | GRN_VOID (0x00) |
| #define | GRN_BULK (0x02) |
| #define | GRN_PTR (0x03) |
| #define | GRN_UVECTOR (0x04) |
| #define | GRN_PVECTOR (0x05) /* vector of grn_obj* */ |
| #define | GRN_VECTOR (0x06) /* vector of arbitrary data */ |
| #define | GRN_MSG (0x07) |
| #define | GRN_QUERY (0x08) |
| #define | GRN_ACCESSOR (0x09) |
| #define | GRN_SNIP (0x0b) |
| #define | GRN_PATSNIP (0x0c) |
| #define | GRN_STRING (0x0d) |
| #define | GRN_HIGHLIGHTER (0x0e) |
| #define | GRN_CURSOR_TABLE_HASH_KEY (0x10) |
| #define | GRN_CURSOR_TABLE_PAT_KEY (0x11) |
| #define | GRN_CURSOR_TABLE_DAT_KEY (0x12) |
| #define | GRN_CURSOR_TABLE_NO_KEY (0x13) |
| #define | GRN_CURSOR_COLUMN_INDEX (0x18) |
| #define | GRN_CURSOR_COLUMN_GEO_INDEX (0x1a) |
| #define | GRN_CURSOR_CONFIG (0x1f) |
| #define | GRN_TYPE (0x20) |
| #define | GRN_PROC (0x21) |
| #define | GRN_EXPR (0x22) |
| #define | GRN_TABLE_HASH_KEY (0x30) |
| #define | GRN_TABLE_PAT_KEY (0x31) |
| #define | GRN_TABLE_DAT_KEY (0x32) |
| #define | GRN_TABLE_NO_KEY (0x33) |
| #define | GRN_DB (0x37) |
| #define | GRN_COLUMN_FIX_SIZE (0x40) |
| #define | GRN_COLUMN_VAR_SIZE (0x41) |
| #define | GRN_COLUMN_INDEX (0x48) |
| #define | GRN_HTTP_CLIENT (0x50) |
| #define | GRN_OBJ_REFER (0x01 << 0) |
| #define | GRN_OBJ_OUTPLACE (0x01 << 1) |
| #define | GRN_OBJ_OWN (0x01 << 5) |
| #define | GRN_OBJ_INIT(obj, obj_type, obj_flags, obj_domain) |
| #define | GRN_OBJ_FIN(ctx, obj) (grn_obj_close((ctx), (obj))) |
| #define | GRN_OP_BUT GRN_OP_AND_NOT |
| #define | GRN_OP_NEAR2 GRN_OP_NEAR_NO_OFFSET |
| #define | GRN_INFO_SUPPORT_LZO GRN_INFO_SUPPORT_LZ4 |
| #define | GRN_INFO_SUPPORT_ARROW GRN_INFO_SUPPORT_APACHE_ARROW |
| #define | GRN_COLUMN_EACH(ctx, column, id, value, block) |
| #define | GRN_OBJ_SET_MASK (0x07) |
| #define | GRN_OBJ_SET (0x01) |
| Replace the value of the record/column with the specified value. | |
| #define | GRN_OBJ_INCR (0x02) |
| Add the specified value to the record/column value. | |
| #define | GRN_OBJ_DECR (0x03) |
| Subtract the specified value from the record/column value. | |
| #define | GRN_OBJ_APPEND (0x04) |
| Append the specified value to the column value. | |
| #define | GRN_OBJ_PREPEND (0x05) |
| Prepend the specified value to the column value. | |
| #define | GRN_OBJ_GET (0x01 << 4) |
| #define | GRN_OBJ_COMPARE (0x01 << 5) |
| #define | GRN_OBJ_LOCK (0x01 << 6) |
| #define | GRN_OBJ_UNLOCK (0x01 << 7) |
| #define | GRN_OBJ_REMOVE_DEPENDENT (0x01 << 0) |
| #define | GRN_OBJ_REMOVE_ENSURE (0x01 << 1) |
| #define | GRN_OBJ_GET_DOMAIN(obj) ((obj)->header.type == GRN_TABLE_NO_KEY ? GRN_ID_NIL : (obj)->header.domain) |
| #define | GRN_TABLE_FUZZY_SEARCH_WITH_TRANSPOSITION (0x01 << 0) |
| #define | GRN_TABLE_FUZZY_SEARCH_USE_PREFIX_LENGTH (0x01 << 1) |
| #define | GRN_TABLE_FUZZY_SEARCH_USE_MAX_DISTANCE_RATIO (0x01 << 2) |
| #define | GRN_TABLE_FUZZY_SEARCH_SKIP_TOKENIZE (0x01 << 3) |
| #define | GRN_MATCH_INFO_GET_MIN_RECORD_ID (0x01) |
| #define | GRN_MATCH_INFO_ONLY_SKIP_TOKEN (0x02) |
| #define | GRN_N_HOOK_ENTRIES 5 /* (GRN_HOOK_SELECT + 1) */ |
| #define | GRN_QUERY_AND '+' |
| #define | GRN_QUERY_AND_NOT '-' |
| #define | GRN_QUERY_ADJ_INC '>' |
| #define | GRN_QUERY_ADJ_DEC '<' |
| #define | GRN_QUERY_ADJ_NEG '~' |
| #define | GRN_QUERY_PREFIX '*' |
| #define | GRN_QUERY_PARENL '(' |
| #define | GRN_QUERY_PARENR ')' |
| #define | GRN_QUERY_QUOTEL '"' |
| #define | GRN_QUERY_QUOTER '"' |
| #define | GRN_QUERY_ESCAPE '\\' |
| #define | GRN_QUERY_COLUMN ':' |
| #define | GRN_SNIP_NORMALIZE (0x01 << 0) |
| #define | GRN_SNIP_COPY_TAG (0x01 << 1) |
| #define | GRN_SNIP_SKIP_LEADING_SPACES (0x01 << 2) |
| #define | GRN_SNIP_MAPPING_HTML_ESCAPE ((grn_snip_mapping *)-1) |
| #define | GRN_LOG_NONE (0x00 << 0) |
| #define | GRN_LOG_TIME (0x01 << 0) |
| #define | GRN_LOG_TITLE (0x01 << 1) |
| #define | GRN_LOG_MESSAGE (0x01 << 2) |
| #define | GRN_LOG_LOCATION (0x01 << 3) |
| #define | GRN_LOG_PID (0x01 << 4) |
| #define | GRN_LOG_PROCESS_ID GRN_LOG_PID |
| #define | GRN_LOG_THREAD_ID (0x01 << 5) |
| #define | GRN_LOG_CONTEXT_ID (0x01 << 6) |
| #define | GRN_LOG_CTX_ID GRN_LOG_CONTEXT_ID |
| #define | GRN_LOG_ALL |
| #define | GRN_LOG_DEFAULT (GRN_LOG_TIME | GRN_LOG_MESSAGE) |
| #define | GRN_ATTRIBUTE_PRINTF(fmt_pos) |
| #define | GRN_ATTRIBUTE_ALLOC_SIZE(size) |
| #define | GRN_ATTRIBUTE_ALLOC_SIZE_N(n, size) |
| #define | GRN_LOG_DEFAULT_LEVEL GRN_LOG_NOTICE |
| #define | GRN_LOG(ctx, level, ...) |
| #define | GRN_SLOW_LOG_PUSH(ctx, level) |
| #define | GRN_SLOW_LOG_POP_BEGIN(ctx, level, elapsed_time) |
| #define | GRN_SLOW_LOG_POP_END(ctx) |
| #define | GRN_QUERY_LOG(ctx, flag, mark, format, ...) |
| #define | GRN_BULK_BUFSIZE (sizeof(grn_obj) - sizeof(grn_obj_header)) |
| #define | GRN_BULK_BUFSIZE_MAX 0x1f |
| #define | GRN_BULK_SIZE_IN_FLAGS(flags) (size_t)((flags) & GRN_BULK_BUFSIZE_MAX) |
| #define | GRN_BULK_OUTP(bulk) ((bulk)->header.impl_flags & GRN_OBJ_OUTPLACE) |
| #define | GRN_BULK_REWIND(bulk) |
| #define | GRN_BULK_SET_CURR(buf, p) |
| #define | GRN_BULK_INCR_LEN(bulk, len) |
| #define | GRN_BULK_WSIZE(bulk) |
| #define | GRN_BULK_REST(bulk) |
| #define | GRN_BULK_VSIZE(bulk) |
| #define | GRN_BULK_EMPTYP(bulk) |
| #define | GRN_BULK_HEAD(bulk) (GRN_BULK_OUTP(bulk) ? ((bulk)->u.b.head) : (char *)&((bulk)->u.b.head)) |
| #define | GRN_BULK_CURR(bulk) |
| #define | GRN_BULK_TAIL(bulk) (GRN_BULK_OUTP(bulk) ? ((bulk)->u.b.tail) : (char *)&((bulk)[1])) |
| #define | GRN_OBJ_DO_SHALLOW_COPY (GRN_OBJ_REFER | GRN_OBJ_OUTPLACE) |
| #define | GRN_OBJ_VECTOR (0x01 << 7) |
| #define | GRN_OBJ_MUTABLE(obj) ((obj) && (obj)->header.type <= GRN_VECTOR) |
| #define | GRN_VALUE_FIX_SIZE_INIT(obj, flags, domain) |
| #define | GRN_VALUE_VAR_SIZE_INIT(obj, flags, domain) |
| #define | GRN_VOID_INIT(obj) GRN_OBJ_INIT((obj), GRN_VOID, 0, GRN_DB_VOID) |
| #define | GRN_TEXT_INIT(obj, flags) GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_TEXT) |
| #define | GRN_SHORT_TEXT_INIT(obj, flags) GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_SHORT_TEXT) |
| #define | GRN_LONG_TEXT_INIT(obj, flags) GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_LONG_TEXT) |
| #define | GRN_TEXT_SET_REF(obj, str, len) |
| #define | GRN_TEXT_SET(ctx, obj, str, len) |
| #define | GRN_TEXT_PUT(ctx, obj, str, len) grn_bulk_write((ctx), (obj), (const char *)(str), (unsigned int)(len)) |
| #define | GRN_TEXT_PUTC(ctx, obj, c) |
| #define | GRN_TEXT_PUTS(ctx, obj, str) GRN_TEXT_PUT((ctx), (obj), (str), strlen(str)) |
| #define | GRN_TEXT_SETS(ctx, obj, str) GRN_TEXT_SET((ctx), (obj), (str), strlen(str)) |
| #define | GRN_TEXT_VALUE(obj) GRN_BULK_HEAD(obj) |
| #define | GRN_TEXT_LEN(obj) GRN_BULK_VSIZE(obj) |
| #define | GRN_TEXT_EQUAL_CSTRING(bulk, string) |
| #define | GRN_BINARY_INIT(obj, flags) GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_BINARY) |
| #define | GRN_SHORT_BINARY_INIT(obj, flags) GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_SHORT_BINARY) |
| #define | GRN_LONG_BINARY_INIT(obj, flags) GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_LONG_BINARY) |
| #define | GRN_BINARY_SET_REF(obj, data, len) |
| #define | GRN_BINARY_SET(ctx, obj, data, len) |
| #define | GRN_BINARY_PUT(ctx, obj, data, len) grn_bulk_write((ctx), (obj), (const char *)(data), (unsigned int)(len)) |
| #define | GRN_BINARY_VALUE(obj) ((const uint8_t *)GRN_BULK_HEAD(obj)) |
| #define | GRN_BINARY_LEN(obj) GRN_BULK_VSIZE(obj) |
| #define | GRN_JSON_INIT(obj, flags) GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_JSON) |
| #define | GRN_JSON_SET_REF(obj, data, len) |
| #define | GRN_JSON_SET(ctx, obj, data, len) |
| #define | GRN_JSON_VALUE(obj) ((const uint8_t *)GRN_BULK_HEAD(obj)) |
| #define | GRN_JSON_LEN(obj) GRN_BULK_VSIZE(obj) |
| #define | GRN_BOOL_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_BOOL) |
| #define | GRN_INT8_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT8) |
| #define | GRN_UINT8_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT8) |
| #define | GRN_INT16_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT16) |
| #define | GRN_UINT16_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT16) |
| #define | GRN_INT32_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT32) |
| #define | GRN_UINT32_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT32) |
| #define | GRN_INT64_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT64) |
| #define | GRN_UINT64_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT64) |
| #define | GRN_BFLOAT16_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_BFLOAT16) |
| #define | GRN_FLOAT32_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_FLOAT32) |
| #define | GRN_FLOAT_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_FLOAT) |
| #define | GRN_TIME_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_TIME) |
| #define | GRN_RECORD_INIT GRN_VALUE_FIX_SIZE_INIT |
| #define | GRN_PTR_INIT(obj, flags, domain) |
| #define | GRN_TOKYO_GEO_POINT_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_TOKYO_GEO_POINT) |
| #define | GRN_WGS84_GEO_POINT_INIT(obj, flags) GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_WGS84_GEO_POINT) |
| #define | GRN_BOOL_SET(ctx, obj, val) |
| #define | GRN_INT8_SET(ctx, obj, val) |
| #define | GRN_UINT8_SET(ctx, obj, val) |
| #define | GRN_INT16_SET(ctx, obj, val) |
| #define | GRN_UINT16_SET(ctx, obj, val) |
| #define | GRN_INT32_SET(ctx, obj, val) |
| #define | GRN_UINT32_SET(ctx, obj, val) |
| #define | GRN_INT64_SET(ctx, obj, val) |
| #define | GRN_UINT64_SET(ctx, obj, val) |
| #define | GRN_BFLOAT16_SET(ctx, obj, val) |
| #define | GRN_FLOAT32_SET(ctx, obj, val) |
| #define | GRN_FLOAT_SET(ctx, obj, val) |
| #define | GRN_TIME_SET GRN_INT64_SET |
| #define | GRN_RECORD_SET(ctx, obj, val) |
| #define | GRN_PTR_SET(ctx, obj, val) |
| #define | GRN_GEO_DEGREE2MSEC(degree) ((int32_t)((degree) * 3600 * 1000 + ((degree) > 0 ? 0.5 : -0.5))) |
| #define | GRN_GEO_MSEC2DEGREE(msec) ((((int32_t)(msec)) / 3600.0) * 0.001) |
| #define | GRN_GEO_RESOLUTION 3600000 |
| #define | GRN_GEO_M_PI 3.14159265358979323846 |
| #define | GRN_GEO_RADIAN2MSEC(radian) ((int32_t)(((GRN_GEO_RESOLUTION * 180) / GRN_GEO_M_PI) * (radian))) |
| #define | GRN_GEO_MSEC2RADIAN(msec) ((GRN_GEO_M_PI / (GRN_GEO_RESOLUTION * 180)) * (msec)) |
| #define | GRN_GEO_POINT_SET(ctx, obj, _latitude, _longitude) |
| #define | GRN_BOOL_SET_AT(ctx, obj, offset, val) |
| #define | GRN_INT8_SET_AT(ctx, obj, offset, val) |
| #define | GRN_UINT8_SET_AT(ctx, obj, offset, val) |
| #define | GRN_INT16_SET_AT(ctx, obj, offset, val) |
| #define | GRN_UINT16_SET_AT(ctx, obj, offset, val) |
| #define | GRN_INT32_SET_AT(ctx, obj, offset, val) |
| #define | GRN_UINT32_SET_AT(ctx, obj, offset, val) |
| #define | GRN_INT64_SET_AT(ctx, obj, offset, val) |
| #define | GRN_UINT64_SET_AT(ctx, obj, offset, val) |
| #define | GRN_BFLOAT16_SET_AT(ctx, obj, offset, val) |
| #define | GRN_FLOAT32_SET_AT(ctx, obj, offset, val) |
| #define | GRN_FLOAT_SET_AT(ctx, obj, offset, val) |
| #define | GRN_TIME_SET_AT GRN_INT64_SET_AT |
| #define | GRN_RECORD_SET_AT(ctx, obj, offset, val) |
| #define | GRN_PTR_SET_AT(ctx, obj, offset, val) |
| #define | GRN_BOOL_VALUE(obj) (*((bool *)GRN_BULK_HEAD(obj))) |
| #define | GRN_INT8_VALUE(obj) (*((int8_t *)GRN_BULK_HEAD(obj))) |
| #define | GRN_UINT8_VALUE(obj) (*((uint8_t *)GRN_BULK_HEAD(obj))) |
| #define | GRN_INT16_VALUE(obj) (*((int16_t *)GRN_BULK_HEAD(obj))) |
| #define | GRN_UINT16_VALUE(obj) (*((uint16_t *)GRN_BULK_HEAD(obj))) |
| #define | GRN_INT32_VALUE(obj) (*((int32_t *)GRN_BULK_HEAD(obj))) |
| #define | GRN_UINT32_VALUE(obj) (*((uint32_t *)GRN_BULK_HEAD(obj))) |
| #define | GRN_INT64_VALUE(obj) (*((int64_t *)GRN_BULK_HEAD(obj))) |
| #define | GRN_UINT64_VALUE(obj) (*((uint64_t *)GRN_BULK_HEAD(obj))) |
| #define | GRN_BFLOAT16_VALUE(obj) (*((grn_bfloat16 *)GRN_BULK_HEAD(obj))) |
| #define | GRN_FLOAT32_VALUE(obj) (*((float *)GRN_BULK_HEAD(obj))) |
| #define | GRN_FLOAT_VALUE(obj) (*((double *)GRN_BULK_HEAD(obj))) |
| #define | GRN_TIME_VALUE GRN_INT64_VALUE |
| #define | GRN_RECORD_VALUE(obj) (*((grn_id *)GRN_BULK_HEAD(obj))) |
| #define | GRN_PTR_VALUE(obj) (*((grn_obj **)GRN_BULK_HEAD(obj))) |
| #define | GRN_GEO_POINT_VALUE_RAW(obj) (grn_geo_point *)GRN_BULK_HEAD(obj) |
| #define | GRN_GEO_POINT_VALUE(obj, _latitude, _longitude) |
| #define | GRN_GEO_POINT_VALUE_RADIAN(obj, _latitude, _longitude) |
| #define | GRN_BOOL_VALUE_AT(obj, offset) (((bool *)GRN_BULK_HEAD(obj))[offset]) |
| #define | GRN_INT8_VALUE_AT(obj, offset) (((int8_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define | GRN_UINT8_VALUE_AT(obj, offset) (((uint8_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define | GRN_INT16_VALUE_AT(obj, offset) (((int16_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define | GRN_UINT16_VALUE_AT(obj, offset) (((uint16_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define | GRN_INT32_VALUE_AT(obj, offset) (((int32_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define | GRN_UINT32_VALUE_AT(obj, offset) (((uint32_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define | GRN_INT64_VALUE_AT(obj, offset) (((int64_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define | GRN_UINT64_VALUE_AT(obj, offset) (((uint64_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define | GRN_BFLOAT16_VALUE_AT(obj, offset) (((grn_bfloat16 *)GRN_BULK_HEAD(obj))[offset]) |
| #define | GRN_FLOAT32_VALUE_AT(obj, offset) (((float *)GRN_BULK_HEAD(obj))[offset]) |
| #define | GRN_FLOAT_VALUE_AT(obj, offset) (((double *)GRN_BULK_HEAD(obj))[offset]) |
| #define | GRN_TIME_VALUE_AT GRN_INT64_VALUE_AT |
| #define | GRN_RECORD_VALUE_AT(obj, offset) (((grn_id *)GRN_BULK_HEAD(obj))[offset]) |
| #define | GRN_PTR_VALUE_AT(obj, offset) (((grn_obj **)GRN_BULK_HEAD(obj))[offset]) |
| #define | GRN_BOOL_PUT(ctx, obj, val) |
| #define | GRN_INT8_PUT(ctx, obj, val) |
| #define | GRN_UINT8_PUT(ctx, obj, val) |
| #define | GRN_INT16_PUT(ctx, obj, val) |
| #define | GRN_UINT16_PUT(ctx, obj, val) |
| #define | GRN_INT32_PUT(ctx, obj, val) |
| #define | GRN_UINT32_PUT(ctx, obj, val) |
| #define | GRN_INT64_PUT(ctx, obj, val) |
| #define | GRN_UINT64_PUT(ctx, obj, val) |
| #define | GRN_BFLOAT16_PUT(ctx, obj, val) |
| #define | GRN_FLOAT32_PUT(ctx, obj, val) |
| #define | GRN_FLOAT_PUT(ctx, obj, val) |
| #define | GRN_TIME_PUT GRN_INT64_PUT |
| #define | GRN_RECORD_PUT(ctx, obj, val) |
| #define | GRN_PTR_PUT(ctx, obj, val) |
| #define | GRN_BULK_POP(obj, value, type, default) |
| #define | GRN_BOOL_POP(obj, value) GRN_BULK_POP(obj, value, bool, 0) |
| #define | GRN_INT8_POP(obj, value) GRN_BULK_POP(obj, value, int8_t, 0) |
| #define | GRN_UINT8_POP(obj, value) GRN_BULK_POP(obj, value, uint8_t, 0) |
| #define | GRN_INT16_POP(obj, value) GRN_BULK_POP(obj, value, int16_t, 0) |
| #define | GRN_UINT16_POP(obj, value) GRN_BULK_POP(obj, value, uint16_t, 0) |
| #define | GRN_INT32_POP(obj, value) GRN_BULK_POP(obj, value, int32_t, 0) |
| #define | GRN_UINT32_POP(obj, value) GRN_BULK_POP(obj, value, uint32_t, 0) |
| #define | GRN_INT64_POP(obj, value) GRN_BULK_POP(obj, value, int64_t, 0) |
| #define | GRN_UINT64_POP(obj, value) GRN_BULK_POP(obj, value, uint64_t, 0) |
| #define | GRN_BFLOAT16_POP(obj, value) GRN_BULK_POP(obj, value, grn_bfloat16, 0.0) |
| #define | GRN_FLOAT32_POP(obj, value) GRN_BULK_POP(obj, value, float, 0.0) |
| #define | GRN_FLOAT_POP(obj, value) GRN_BULK_POP(obj, value, double, 0.0) |
| #define | GRN_TIME_POP GRN_INT64_POP |
| #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) |
| #define | GRN_BULK_VECTOR_SIZE(obj, type) (GRN_BULK_VSIZE(obj) / sizeof(type)) |
| #define | GRN_BOOL_VECTOR_SIZE(obj) GRN_BULK_VECTOR_SIZE(obj, bool) |
| #define | GRN_INT8_VECTOR_SIZE(obj) GRN_BULK_VECTOR_SIZE(obj, int8_t) |
| #define | GRN_UINT8_VECTOR_SIZE(obj) GRN_BULK_VECTOR_SIZE(obj, uint8_t) |
| #define | GRN_INT16_VECTOR_SIZE(obj) GRN_BULK_VECTOR_SIZE(obj, int16_t) |
| #define | GRN_UINT16_VECTOR_SIZE(obj) GRN_BULK_VECTOR_SIZE(obj, uint16_t) |
| #define | GRN_INT32_VECTOR_SIZE(obj) GRN_BULK_VECTOR_SIZE(obj, int32_t) |
| #define | GRN_UINT32_VECTOR_SIZE(obj) GRN_BULK_VECTOR_SIZE(obj, uint32_t) |
| #define | GRN_INT64_VECTOR_SIZE(obj) GRN_BULK_VECTOR_SIZE(obj, int64_t) |
| #define | GRN_UINT64_VECTOR_SIZE(obj) GRN_BULK_VECTOR_SIZE(obj, uint64_t) |
| #define | GRN_BFLOAT16_VECTOR_SIZE(obj) GRN_BULK_VECTOR_SIZE(obj, grn_bfloat16) |
| #define | GRN_FLOAT32_VECTOR_SIZE(obj) GRN_BULK_VECTOR_SIZE(obj, float) |
| #define | GRN_FLOAT_VECTOR_SIZE(obj) GRN_BULK_VECTOR_SIZE(obj, double) |
| #define | GRN_TIME_VECTOR_SIZE GRN_INT64_VECTOR_SIZE |
| #define | GRN_RECORD_VECTOR_SIZE(obj) GRN_BULK_VECTOR_SIZE(obj, grn_id) |
| #define | GRN_PTR_VECTOR_SIZE(obj) GRN_BULK_VECTOR_SIZE(obj, grn_obj *) |
| #define | GRN_CTX_MORE (0x01 << 0) |
| #define | GRN_CTX_TAIL (0x01 << 1) |
| #define | GRN_CTX_HEAD (0x01 << 2) |
| #define | GRN_CTX_QUIET (0x01 << 3) |
| #define | GRN_CTX_QUIT (0x01 << 4) |
Functions | |
| GRN_API grn_rc | grn_init (void) |
| GRN_API grn_rc | grn_fin (void) |
| GRN_API const char * | grn_get_global_error_message (void) |
| GRN_API const char * | grn_log_level_to_string (grn_log_level level) |
| GRN_API bool | grn_log_level_parse (const char *string, grn_log_level *level) |
| GRN_API grn_rc | grn_ctx_init (grn_ctx *ctx, int flags) |
| Initialize the context. | |
| GRN_API grn_rc | grn_ctx_fin (grn_ctx *ctx) |
| Finish the context. | |
| GRN_API grn_ctx * | grn_ctx_open (int flags) |
| Open the context. | |
| GRN_API grn_rc | grn_ctx_close (grn_ctx *ctx) |
| Close the context. | |
| GRN_API grn_rc | grn_ctx_set_finalizer (grn_ctx *ctx, grn_proc_func *func) |
| Set the callback function to be called when the context is finished. | |
| GRN_API grn_rc | grn_ctx_push_temporary_open_space (grn_ctx *ctx) |
| GRN_API grn_rc | grn_ctx_pop_temporary_open_space (grn_ctx *ctx) |
| GRN_API grn_rc | grn_ctx_merge_temporary_open_space (grn_ctx *ctx) |
| GRN_API grn_encoding | grn_get_default_encoding (void) |
| GRN_API grn_rc | grn_set_default_encoding (grn_encoding encoding) |
| Set the default encoding. | |
| GRN_API const char * | grn_get_version (void) |
| GRN_API uint32_t | grn_get_version_major (void) |
| GRN_API uint32_t | grn_get_version_minor (void) |
| GRN_API uint32_t | grn_get_version_micro (void) |
| GRN_API const char * | grn_get_package (void) |
| GRN_API const char * | grn_get_package_label (void) |
| GRN_API grn_command_version | grn_get_default_command_version (void) |
| GRN_API grn_rc | grn_set_default_command_version (grn_command_version version) |
| Set default command version. | |
| GRN_API grn_command_version | grn_ctx_get_command_version (grn_ctx *ctx) |
| GRN_API grn_rc | grn_ctx_set_command_version (grn_ctx *ctx, grn_command_version version) |
| Set command version for this context. | |
| GRN_API int64_t | grn_ctx_get_match_escalation_threshold (grn_ctx *ctx) |
| GRN_API grn_rc | grn_ctx_set_match_escalation_threshold (grn_ctx *ctx, int64_t threshold) |
| Set the threshold to determine whether search strategy escalation is used or not. | |
| GRN_API bool | grn_ctx_get_force_match_escalation (grn_ctx *ctx) |
| GRN_API grn_rc | grn_ctx_set_force_match_escalation (grn_ctx *ctx, bool force) |
| GRN_API int32_t | grn_ctx_get_n_workers (grn_ctx *ctx) |
| GRN_API grn_rc | grn_ctx_set_n_workers (grn_ctx *ctx, int32_t n_workers) |
| GRN_API int64_t | grn_get_default_match_escalation_threshold (void) |
| GRN_API grn_rc | grn_set_default_match_escalation_threshold (int64_t threshold) |
| Set the default threshold to determine whether search strategy escalation is used or not. | |
| GRN_API int32_t | grn_get_default_n_workers (void) |
| GRN_API grn_rc | grn_set_default_n_workers (int32_t n_workers) |
| GRN_API bool | grn_is_back_trace_enable (void) |
| GRN_API grn_rc | grn_set_back_trace_enable (bool enable) |
| GRN_API bool | grn_is_reference_count_enable (void) |
| GRN_API grn_rc | grn_set_reference_count_enable (bool enable) |
| GRN_API grn_rc | grn_ctx_set_variable (grn_ctx *ctx, const char *name, int name_size, void *data, grn_close_func close_func) |
| GRN_API void * | grn_ctx_get_variable (grn_ctx *ctx, const char *name, int name_size) |
| GRN_API grn_rc | grn_unset_variable (const char *name, int name_size) |
| GRN_API int | grn_get_lock_timeout (void) |
| Retrieve the current lock timeout. | |
| GRN_API grn_rc | grn_set_lock_timeout (int timeout) |
| Set the lock timeout used during write operations. | |
| GRN_API size_t | grn_get_memory_map_size (void) |
| GRN_API const char * | grn_encoding_to_string (grn_encoding encoding) |
Return string representation for the encoding. For example, grn_encoding_to_string(GRN_ENC_UTF8) returns "utf8". | |
| GRN_API grn_encoding | grn_encoding_parse (const char *name) |
Parse encoding name and return grn_encoding. For example, grn_encoding_parse("UTF8") returns GRN_ENC_UTF8. | |
| GRN_API grn_rc | grn_ctx_use (grn_ctx *ctx, grn_obj *db) |
| Set the database that the context is using. | |
| GRN_API grn_obj * | grn_ctx_db (grn_ctx *ctx) |
| Retrieve the database that the context is using. | |
| GRN_API grn_obj * | grn_ctx_get (grn_ctx *ctx, const char *name, int name_size) |
| Retrieve the object corresponding to the specified name from the database that the context is using. | |
| GRN_API grn_rc | grn_ctx_get_all_tables (grn_ctx *ctx, grn_obj *tables_buffer) |
| Retrieve all tables from the database that the context is using. | |
| GRN_API grn_rc | grn_ctx_get_all_types (grn_ctx *ctx, grn_obj *types_buffer) |
| GRN_API grn_rc | grn_ctx_get_all_tokenizers (grn_ctx *ctx, grn_obj *tokenizers_buffer) |
| GRN_API grn_rc | grn_ctx_get_all_normalizers (grn_ctx *ctx, grn_obj *normalizers_buffer) |
| GRN_API grn_rc | grn_ctx_get_all_token_filters (grn_ctx *ctx, grn_obj *token_filters_buffer) |
| GRN_API grn_obj * | grn_ctx_at (grn_ctx *ctx, grn_id id) |
| Retrieve the object corresponding to the specified ID from the context or the database that the context is using. | |
| GRN_API bool | grn_ctx_is_opened (grn_ctx *ctx, grn_id id) |
| GRN_API grn_rc | grn_plugin_register (grn_ctx *ctx, const char *name) |
| GRN_API grn_rc | grn_plugin_unregister (grn_ctx *ctx, const char *name) |
| GRN_API grn_rc | grn_plugin_register_by_path (grn_ctx *ctx, const char *path) |
| GRN_API grn_rc | grn_plugin_unregister_by_path (grn_ctx *ctx, const char *path) |
| GRN_API const char * | grn_plugin_get_system_plugins_dir (void) |
| GRN_API const char * | grn_plugin_get_suffix (void) |
| GRN_API const char * | grn_plugin_get_ruby_suffix (void) |
| GRN_API grn_rc | grn_plugin_get_names (grn_ctx *ctx, grn_obj *names) |
| GRN_API grn_obj * | grn_obj_column (grn_ctx *ctx, grn_obj *table, const char *name, uint32_t name_size) |
| Retrieve a column or an accessor from a specified table or accessor. | |
| GRN_API grn_obj * | grn_obj_get_info (grn_ctx *ctx, grn_obj *obj, grn_info_type type, grn_obj *valuebuf) |
| Get information on the object. | |
| GRN_API grn_rc | grn_obj_set_info (grn_ctx *ctx, grn_obj *obj, grn_info_type type, grn_obj *value) |
| Set information on the object. | |
| GRN_API grn_obj * | grn_obj_get_element_info (grn_ctx *ctx, grn_obj *obj, grn_id id, grn_info_type type, grn_obj *valuebuf) |
| Get information on the record with the ID in the object. | |
| GRN_API grn_rc | grn_obj_set_element_info (grn_ctx *ctx, grn_obj *obj, grn_id id, grn_info_type type, grn_obj *value) |
| Set information on the record with the ID in the object. | |
| GRN_API grn_obj * | grn_obj_get_value (grn_ctx *ctx, grn_obj *obj, grn_id id, grn_obj *value) |
| Retrieve the value of the record corresponding to the given ID in the specified object. | |
| GRN_API int | grn_obj_get_values (grn_ctx *ctx, grn_obj *obj, grn_id offset, void **values) |
| Retrieve an array of fixed-size column values starting from a specified record ID. | |
| GRN_API grn_rc | grn_obj_set_value (grn_ctx *ctx, grn_obj *obj, grn_id id, grn_obj *value, int flags) |
| Update the value of a record identified by the given ID in the specified object. | |
| GRN_API grn_rc | grn_obj_remove (grn_ctx *ctx, grn_obj *obj) |
| Remove the specified object. | |
| GRN_API grn_rc | grn_obj_remove_dependent (grn_ctx *ctx, grn_obj *obj) |
| GRN_API grn_rc | grn_obj_remove_flags (grn_ctx *ctx, grn_obj *obj, uint32_t flags) |
| GRN_API grn_rc | grn_obj_remove_force (grn_ctx *ctx, const char *name, int name_size) |
| GRN_API grn_rc | grn_ctx_remove (grn_ctx *ctx, const char *name, int name_size, uint32_t flags) |
| GRN_API grn_rc | grn_ctx_remove_by_id (grn_ctx *ctx, grn_id id, uint32_t flags) |
| GRN_API grn_rc | grn_obj_rename (grn_ctx *ctx, grn_obj *obj, const char *name, unsigned int name_size) |
| Rename a persistent object in the database used by the context. | |
| GRN_API grn_rc | grn_column_rename (grn_ctx *ctx, grn_obj *column, const char *name, unsigned int name_size) |
| Rename a column in the database used by the context. | |
| GRN_API grn_rc | grn_obj_close (grn_ctx *ctx, grn_obj *obj) |
| Close an object. | |
| GRN_API grn_rc | grn_obj_reinit (grn_ctx *ctx, grn_obj *obj, grn_id domain, uint8_t flags) |
| Reinitialize an object. | |
| GRN_API grn_rc | grn_obj_unlink (grn_ctx *ctx, grn_obj *obj) |
| Unlink an object. | |
| GRN_API grn_rc | grn_obj_refer (grn_ctx *ctx, grn_obj *obj) |
| GRN_API grn_rc | grn_obj_refer_recursive (grn_ctx *ctx, grn_obj *obj) |
| GRN_API grn_rc | grn_obj_refer_recursive_dependent (grn_ctx *ctx, grn_obj *obj) |
| GRN_API void | grn_obj_unref (grn_ctx *ctx, grn_obj *obj) |
| GRN_API void | grn_obj_unref_recursive (grn_ctx *ctx, grn_obj *obj) |
| GRN_API void | grn_obj_unref_recursive_dependent (grn_ctx *ctx, grn_obj *obj) |
| GRN_API grn_user_data * | grn_obj_user_data (grn_ctx *ctx, grn_obj *obj) |
| Returns a pointer to user data that can be registered in the object. | |
| GRN_API grn_rc | grn_obj_set_finalizer (grn_ctx *ctx, grn_obj *obj, grn_proc_func *func) |
| Set the callback function when finalizing the object. | |
| GRN_API const char * | grn_obj_path (grn_ctx *ctx, grn_obj *obj) |
| Return the file path associated with an object. | |
| GRN_API int | grn_obj_name (grn_ctx *ctx, grn_obj *obj, char *namebuf, int buf_size) |
Return an object's name by storing it in namebuf. | |
| GRN_API int | grn_column_name (grn_ctx *ctx, grn_obj *obj, char *namebuf, int buf_size) |
Return a column's name by storing it in namebuf. | |
| GRN_API grn_id | grn_obj_get_range (grn_ctx *ctx, grn_obj *obj) |
| Retrieve the value range based on the ID associated with an object. | |
| GRN_API int | grn_obj_expire (grn_ctx *ctx, grn_obj *obj, int threshold) |
| Free allocatable memory occupied by an object based on a threshold. | |
| GRN_API int | grn_obj_check (grn_ctx *ctx, grn_obj *obj) |
| Check the integrity of the file corresponding to an object. | |
| GRN_API grn_rc | grn_obj_lock (grn_ctx *ctx, grn_obj *obj, grn_id id, int timeout) |
| Lock an object with a specified timeout. | |
| GRN_API grn_rc | grn_obj_unlock (grn_ctx *ctx, grn_obj *obj, grn_id id) |
| Unlock an object. | |
| GRN_API grn_rc | grn_obj_clear_lock (grn_ctx *ctx, grn_obj *obj) |
| Forcefully clear locks on an object. | |
| GRN_API unsigned int | grn_obj_is_locked (grn_ctx *ctx, grn_obj *obj) |
| Check if an object is currently locked. | |
| GRN_API grn_rc | grn_obj_flush (grn_ctx *ctx, grn_obj *obj) |
| GRN_API grn_rc | grn_obj_flush_recursive (grn_ctx *ctx, grn_obj *obj) |
| GRN_API grn_rc | grn_obj_flush_recursive_dependent (grn_ctx *ctx, grn_obj *obj) |
| GRN_API grn_rc | grn_obj_flush_only_opened (grn_ctx *ctx, grn_obj *obj) |
| GRN_API uint64_t | grn_obj_defrag (grn_ctx *ctx, grn_obj *obj, int threshold) |
| Defragment an object to reduce fragmentation in the database file. | |
| GRN_API grn_obj * | grn_obj_db (grn_ctx *ctx, grn_obj *obj) |
Return the database to which obj belongs. | |
| GRN_API grn_id | grn_obj_id (grn_ctx *ctx, grn_obj *obj) |
| Return the ID of an object. | |
| GRN_API grn_rc | grn_obj_search (grn_ctx *ctx, grn_obj *obj, grn_obj *query, grn_obj *res, grn_operator op, grn_search_optarg *optarg) |
Search for obj in query. | |
| GRN_API grn_rc | grn_proc_set_is_stable (grn_ctx *ctx, grn_obj *proc, bool is_stable) |
| GRN_API bool | grn_proc_is_stable (grn_ctx *ctx, grn_obj *proc) |
| GRN_API int | grn_proc_call_next (grn_ctx *ctx, grn_obj *exec_info, grn_obj *in, grn_obj *out) |
| GRN_API void * | grn_proc_get_ctx_local_data (grn_ctx *ctx, grn_obj *exec_info) |
| GRN_API void * | grn_proc_get_hook_local_data (grn_ctx *ctx, grn_obj *exec_info) |
| GRN_API const char * | grn_hook_entry_to_string (grn_hook_entry entry) |
| GRN_API grn_rc | grn_obj_add_hook (grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry, int offset, grn_obj *proc, grn_obj *data) |
| Add a hook to the object. If multiple hooks are set for the object, they are called in the order they are registered in the hook list. | |
| GRN_API int | grn_obj_get_nhooks (grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry) |
| Get the number of hooks set on the object. | |
| GRN_API grn_obj * | grn_obj_get_hook (grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry, int offset, grn_obj *data) |
Get the hook set on the object. If hook data is set, it is stored in data. | |
| GRN_API grn_rc | grn_obj_delete_hook (grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry, int offset) |
| Delete the hook set on the object. | |
| GRN_API grn_obj * | grn_obj_open (grn_ctx *ctx, unsigned char type, grn_obj_flags flags, grn_id domain) |
| GRN_API int | grn_column_index (grn_ctx *ctx, grn_obj *column, grn_operator op, grn_obj **indexbuf, int buf_size, int *section) |
| GRN_API unsigned int | grn_column_find_index_data (grn_ctx *ctx, grn_obj *column, grn_operator op, grn_index_datum *index_data, unsigned int n_index_data) |
Return indexes that can perform a specified operation by storing it in index_data. | |
| GRN_API uint32_t | grn_column_get_all_index_data (grn_ctx *ctx, grn_obj *column, grn_index_datum *index_data, uint32_t n_index_data) |
| GRN_API grn_rc | grn_column_get_all_index_columns (grn_ctx *ctx, grn_obj *column, grn_obj *index_columns) |
| GRN_API grn_rc | grn_obj_delete_by_id (grn_ctx *ctx, grn_obj *db, grn_id id, bool remove_p) |
| Delete an object (such as a table or column) identified by the ID from the database. | |
| GRN_API grn_rc | grn_obj_path_by_id (grn_ctx *ctx, grn_obj *db, grn_id id, char *buffer) |
| Return the pathname of an object ID. | |
| GRN_API grn_obj * | grn_snip_open (grn_ctx *ctx, int flags, unsigned int width, unsigned int max_results, const char *defaultopentag, unsigned int defaultopentag_len, const char *defaultclosetag, unsigned int defaultclosetag_len, grn_snip_mapping *mapping) |
| GRN_API grn_rc | grn_snip_add_cond (grn_ctx *ctx, grn_obj *snip, const char *keyword, unsigned int keyword_len, const char *opentag, unsigned int opentag_len, const char *closetag, unsigned int closetag_len) |
| GRN_API grn_rc | grn_snip_set_normalizer (grn_ctx *ctx, grn_obj *snip, grn_obj *normalizer) |
| GRN_API grn_obj * | grn_snip_get_normalizer (grn_ctx *ctx, grn_obj *snip) |
| GRN_API grn_rc | grn_snip_set_normalizers (grn_ctx *ctx, grn_obj *snip, grn_obj *normalizers) |
| GRN_API grn_obj * | grn_snip_get_normalizers (grn_ctx *ctx, grn_obj *snip) |
| GRN_API grn_rc | grn_snip_set_delimiter_regexp (grn_ctx *ctx, grn_obj *snip, const char *pattern, int pattern_length) |
| GRN_API const char * | grn_snip_get_delimiter_regexp (grn_ctx *ctx, grn_obj *snip, size_t *pattern_length) |
| GRN_API grn_rc | grn_snip_exec (grn_ctx *ctx, grn_obj *snip, const char *string, unsigned int string_len, unsigned int *nresults, unsigned int *max_tagged_len) |
| GRN_API grn_rc | grn_snip_get_result (grn_ctx *ctx, grn_obj *snip, const unsigned int index, char *result, unsigned int *result_len) |
| GRN_API grn_rc | grn_logger_info_set (grn_ctx *ctx, const grn_logger_info *info) |
| GRN_API bool | grn_log_flags_parse (const char *string, int string_size, int *flags) |
| GRN_API grn_rc | grn_logger_set (grn_ctx *ctx, const grn_logger *logger) |
| GRN_API void | grn_logger_set_max_level (grn_ctx *ctx, grn_log_level max_level) |
| GRN_API grn_log_level | grn_logger_get_max_level (grn_ctx *ctx) |
| GRN_API void | grn_logger_put (grn_ctx *ctx, grn_log_level level, const char *file, int line, const char *func, const char *fmt,...) GRN_ATTRIBUTE_PRINTF(6) |
| GRN_API void | grn_logger_putv (grn_ctx *ctx, grn_log_level level, const char *file, int line, const char *func, const char *fmt, va_list ap) |
| GRN_API void | grn_logger_reopen (grn_ctx *ctx) |
| GRN_API bool | grn_logger_pass (grn_ctx *ctx, grn_log_level level) |
| GRN_API bool | grn_logger_is_default_logger (grn_ctx *ctx) |
| GRN_API void | grn_default_logger_set_max_level (grn_log_level level) |
| GRN_API grn_log_level | grn_default_logger_get_max_level (void) |
| GRN_API void | grn_default_logger_set_flags (int flags) |
| GRN_API int | grn_default_logger_get_flags (void) |
| GRN_API void | grn_default_logger_set_path (const char *path) |
| GRN_API const char * | grn_default_logger_get_path (void) |
| GRN_API void | grn_default_logger_set_rotate_threshold_size (off_t threshold) |
| GRN_API off_t | grn_default_logger_get_rotate_threshold_size (void) |
| GRN_API grn_rc | grn_slow_log_push (grn_ctx *ctx) |
| GRN_API double | grn_slow_log_pop (grn_ctx *ctx) |
| GRN_API bool | grn_slow_log_is_slow (grn_ctx *ctx, double elapsed_time) |
| GRN_API bool | grn_query_log_flags_parse (const char *string, int string_size, unsigned int *flags) |
| GRN_API grn_rc | grn_query_logger_set (grn_ctx *ctx, const grn_query_logger *logger) |
| GRN_API void | grn_query_logger_set_flags (grn_ctx *ctx, unsigned int flags) |
| GRN_API void | grn_query_logger_add_flags (grn_ctx *ctx, unsigned int flags) |
| GRN_API void | grn_query_logger_remove_flags (grn_ctx *ctx, unsigned int flags) |
| GRN_API unsigned int | grn_query_logger_get_flags (grn_ctx *ctx) |
| GRN_API void | grn_query_logger_put (grn_ctx *ctx, unsigned int flag, const char *mark, const char *format,...) GRN_ATTRIBUTE_PRINTF(4) |
| GRN_API void | grn_query_logger_reopen (grn_ctx *ctx) |
| GRN_API bool | grn_query_logger_pass (grn_ctx *ctx, unsigned int flag) |
| GRN_API void | grn_default_query_logger_set_flags (unsigned int flags) |
| GRN_API unsigned int | grn_default_query_logger_get_flags (void) |
| GRN_API void | grn_default_query_logger_set_path (const char *path) |
| GRN_API const char * | grn_default_query_logger_get_path (void) |
| GRN_API void | grn_default_query_logger_set_rotate_threshold_size (off_t threshold) |
| GRN_API off_t | grn_default_query_logger_get_rotate_threshold_size (void) |
| GRN_API grn_rc | grn_bulk_reinit (grn_ctx *ctx, grn_obj *bulk, size_t size) |
| GRN_API grn_rc | grn_bulk_resize (grn_ctx *ctx, grn_obj *bulk, size_t new_size) |
| GRN_API grn_rc | grn_bulk_write (grn_ctx *ctx, grn_obj *bulk, const char *str, size_t len) |
| GRN_API grn_rc | grn_bulk_write_from (grn_ctx *ctx, grn_obj *bulk, const char *str, size_t from, size_t len) |
| GRN_API grn_rc | grn_bulk_reserve (grn_ctx *ctx, grn_obj *bulk, size_t len) |
| GRN_API grn_rc | grn_bulk_space (grn_ctx *ctx, grn_obj *bulk, size_t len) |
| GRN_API grn_rc | grn_bulk_truncate (grn_ctx *ctx, grn_obj *bulk, size_t len) |
| GRN_API char * | grn_bulk_detach (grn_ctx *ctx, grn_obj *bulk) |
| GRN_API grn_rc | grn_bulk_fin (grn_ctx *ctx, grn_obj *bulk) |
| GRN_API grn_rc | grn_text_itoa (grn_ctx *ctx, grn_obj *bulk, int i) |
| GRN_API grn_rc | grn_text_itoa_padded (grn_ctx *ctx, grn_obj *bulk, int i, char ch, size_t len) |
| GRN_API grn_rc | grn_text_lltoa (grn_ctx *ctx, grn_obj *bulk, long long int i) |
| GRN_API grn_rc | grn_text_f32toa (grn_ctx *ctx, grn_obj *bulk, float f) |
| GRN_API grn_rc | grn_text_ftoa (grn_ctx *ctx, grn_obj *bulk, double d) |
| GRN_API grn_rc | grn_text_itoh (grn_ctx *ctx, grn_obj *bulk, unsigned int i, size_t len) |
| GRN_API grn_rc | grn_text_itob (grn_ctx *ctx, grn_obj *bulk, grn_id id) |
| GRN_API grn_rc | grn_text_lltob32h (grn_ctx *ctx, grn_obj *bulk, long long int i) |
| GRN_API grn_rc | grn_text_benc (grn_ctx *ctx, grn_obj *bulk, unsigned int v) |
| GRN_API grn_rc | grn_text_esc (grn_ctx *ctx, grn_obj *bulk, const char *s, size_t len) |
| GRN_API grn_rc | grn_text_code_point (grn_ctx *ctx, grn_obj *buffer, uint32_t code_point) |
| GRN_API grn_rc | grn_text_urlenc (grn_ctx *ctx, grn_obj *buf, const char *str, size_t len) |
| GRN_API const char * | grn_text_urldec (grn_ctx *ctx, grn_obj *buf, const char *s, const char *e, char d) |
| GRN_API grn_rc | grn_text_escape_xml (grn_ctx *ctx, grn_obj *buf, const char *s, size_t len) |
| GRN_API grn_rc | grn_text_time2rfc1123 (grn_ctx *ctx, grn_obj *bulk, int sec) |
| GRN_API grn_rc | grn_text_printf (grn_ctx *ctx, grn_obj *bulk, const char *format,...) GRN_ATTRIBUTE_PRINTF(3) |
| GRN_API grn_rc | grn_text_printfv (grn_ctx *ctx, grn_obj *bulk, const char *format, va_list args) |
| GRN_API grn_rc | grn_text_vprintf (grn_ctx *ctx, grn_obj *bulk, const char *format, va_list args) |
| GRN_API void | grn_ctx_recv_handler_set (grn_ctx *, grn_recv_handler_func func, void *user_data) |
| GRN_API grn_rc | grn_ctx_push (grn_ctx *ctx, grn_obj *obj) |
| GRN_API grn_obj * | grn_ctx_pop (grn_ctx *ctx) |
| GRN_API grn_rc | grn_obj_columns (grn_ctx *ctx, grn_obj *table, const char *str, unsigned int str_size, grn_obj *res) |
| GRN_API grn_rc | grn_load (grn_ctx *ctx, grn_content_type input_type, const char *table, unsigned int table_len, const char *columns, unsigned int columns_len, const char *values, unsigned int values_len, const char *ifexists, unsigned int ifexists_len, const char *each, unsigned int each_len) |
| GRN_API grn_rc | grn_ctx_connect (grn_ctx *ctx, const char *host, int port, int flags) |
| GRN_API unsigned int | grn_ctx_send (grn_ctx *ctx, const char *str, unsigned int str_len, int flags) |
| GRN_API grn_rc | grn_ctx_recv (grn_ctx *ctx, char **str, unsigned int *str_len, int *flags) |
| GRN_API grn_rc | grn_ctx_info_get (grn_ctx *ctx, grn_ctx_info *info) |
| GRN_API grn_rc | grn_set_segv_handler (void) |
| GRN_API grn_rc | grn_set_abrt_handler (void) |
| GRN_API grn_rc | grn_set_int_handler (void) |
| GRN_API grn_rc | grn_set_term_handler (void) |
| #define GRN_ACCESSOR (0x09) |
| #define GRN_API |
| #define GRN_ATTRIBUTE_ALLOC_SIZE | ( | size | ) |
| #define GRN_ATTRIBUTE_ALLOC_SIZE_N | ( | n, | |
| size | |||
| ) |
| #define GRN_ATTRIBUTE_PRINTF | ( | fmt_pos | ) |
| #define GRN_BFLOAT16_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_BFLOAT16) |
| #define GRN_BFLOAT16_POP | ( | obj, | |
| value | |||
| ) | GRN_BULK_POP(obj, value, grn_bfloat16, 0.0) |
| #define GRN_BFLOAT16_PUT | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_BFLOAT16_SET | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_BFLOAT16_SET_AT | ( | ctx, | |
| obj, | |||
| offset, | |||
| val | |||
| ) |
| #define GRN_BFLOAT16_VALUE | ( | obj | ) | (*((grn_bfloat16 *)GRN_BULK_HEAD(obj))) |
| #define GRN_BFLOAT16_VALUE_AT | ( | obj, | |
| offset | |||
| ) | (((grn_bfloat16 *)GRN_BULK_HEAD(obj))[offset]) |
| #define GRN_BFLOAT16_VECTOR_SIZE | ( | obj | ) | GRN_BULK_VECTOR_SIZE(obj, grn_bfloat16) |
| #define GRN_BINARY_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_BINARY) |
| #define GRN_BINARY_LEN | ( | obj | ) | GRN_BULK_VSIZE(obj) |
| #define GRN_BINARY_PUT | ( | ctx, | |
| obj, | |||
| data, | |||
| len | |||
| ) | grn_bulk_write((ctx), (obj), (const char *)(data), (unsigned int)(len)) |
| #define GRN_BINARY_SET | ( | ctx, | |
| obj, | |||
| data, | |||
| len | |||
| ) |
| #define GRN_BINARY_SET_REF | ( | obj, | |
| data, | |||
| len | |||
| ) |
| #define GRN_BINARY_VALUE | ( | obj | ) | ((const uint8_t *)GRN_BULK_HEAD(obj)) |
| #define GRN_BOOL_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_BOOL) |
| #define GRN_BOOL_POP | ( | obj, | |
| value | |||
| ) | GRN_BULK_POP(obj, value, bool, 0) |
| #define GRN_BOOL_PUT | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_BOOL_SET | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_BOOL_SET_AT | ( | ctx, | |
| obj, | |||
| offset, | |||
| val | |||
| ) |
| #define GRN_BOOL_VALUE | ( | obj | ) | (*((bool *)GRN_BULK_HEAD(obj))) |
| #define GRN_BOOL_VALUE_AT | ( | obj, | |
| offset | |||
| ) | (((bool *)GRN_BULK_HEAD(obj))[offset]) |
| #define GRN_BOOL_VECTOR_SIZE | ( | obj | ) | GRN_BULK_VECTOR_SIZE(obj, bool) |
| #define GRN_BULK (0x02) |
Auto-extendable buffer that can be used for storing a number and variable size string.
| #define GRN_BULK_BUFSIZE (sizeof(grn_obj) - sizeof(grn_obj_header)) |
| #define GRN_BULK_BUFSIZE_MAX 0x1f |
| #define GRN_BULK_CURR | ( | bulk | ) |
| #define GRN_BULK_EMPTYP | ( | bulk | ) |
| #define GRN_BULK_HEAD | ( | bulk | ) | (GRN_BULK_OUTP(bulk) ? ((bulk)->u.b.head) : (char *)&((bulk)->u.b.head)) |
| #define GRN_BULK_INCR_LEN | ( | bulk, | |
| len | |||
| ) |
| #define GRN_BULK_OUTP | ( | bulk | ) | ((bulk)->header.impl_flags & GRN_OBJ_OUTPLACE) |
| #define GRN_BULK_POP | ( | obj, | |
| value, | |||
| type, | |||
| default | |||
| ) |
| #define GRN_BULK_REST | ( | bulk | ) |
| #define GRN_BULK_REWIND | ( | bulk | ) |
| #define GRN_BULK_SET_CURR | ( | buf, | |
| p | |||
| ) |
| #define GRN_BULK_SIZE_IN_FLAGS | ( | flags | ) | (size_t)((flags) & GRN_BULK_BUFSIZE_MAX) |
| #define GRN_BULK_TAIL | ( | bulk | ) | (GRN_BULK_OUTP(bulk) ? ((bulk)->u.b.tail) : (char *)&((bulk)[1])) |
| #define GRN_BULK_VECTOR_SIZE | ( | obj, | |
| type | |||
| ) | (GRN_BULK_VSIZE(obj) / sizeof(type)) |
| #define GRN_BULK_VSIZE | ( | bulk | ) |
| #define GRN_BULK_WSIZE | ( | bulk | ) |
| #define GRN_COLUMN_EACH | ( | ctx, | |
| column, | |||
| id, | |||
| value, | |||
| block | |||
| ) |
| #define GRN_COLUMN_FIX_SIZE (0x40) |
| #define GRN_COLUMN_INDEX (0x48) |
| #define GRN_COLUMN_VAR_SIZE (0x41) |
| #define GRN_COMMAND_VERSION_MAX GRN_COMMAND_VERSION_3 |
| #define GRN_COMMAND_VERSION_MIN GRN_COMMAND_VERSION_1 |
| #define GRN_COMMAND_VERSION_STABLE GRN_COMMAND_VERSION_1 |
| #define GRN_CTX_BATCH_MODE (0x04) |
| #define GRN_CTX_FIN (0xff) |
| #define GRN_CTX_GET_ENCODING | ( | ctx | ) | ((ctx)->encoding) |
| #define GRN_CTX_HEAD (0x01 << 2) |
| #define GRN_CTX_MORE (0x01 << 0) |
| #define GRN_CTX_MSGSIZE (0x80) |
| #define GRN_CTX_PER_DB (0x08) |
| #define GRN_CTX_QUIET (0x01 << 3) |
| #define GRN_CTX_QUIT (0x01 << 4) |
| #define GRN_CTX_SET_ENCODING | ( | ctx, | |
| enc | |||
| ) |
| #define GRN_CTX_TAIL (0x01 << 1) |
| #define GRN_CTX_USE_QL (0x03) |
| #define GRN_CTX_USER_DATA | ( | ctx | ) | (&((ctx)->user_data)) |
| #define GRN_CURSOR_COLUMN_GEO_INDEX (0x1a) |
| #define GRN_CURSOR_COLUMN_INDEX (0x18) |
| #define GRN_CURSOR_CONFIG (0x1f) |
| #define GRN_CURSOR_TABLE_DAT_KEY (0x12) |
| #define GRN_CURSOR_TABLE_HASH_KEY (0x10) |
| #define GRN_CURSOR_TABLE_NO_KEY (0x13) |
| #define GRN_CURSOR_TABLE_PAT_KEY (0x11) |
| #define GRN_DB (0x37) |
| #define GRN_EXPR (0x22) |
| #define GRN_FALSE false |
| #define GRN_FLOAT32_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_FLOAT32) |
| #define GRN_FLOAT32_POP | ( | obj, | |
| value | |||
| ) | GRN_BULK_POP(obj, value, float, 0.0) |
| #define GRN_FLOAT32_PUT | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_FLOAT32_SET | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_FLOAT32_SET_AT | ( | ctx, | |
| obj, | |||
| offset, | |||
| val | |||
| ) |
| #define GRN_FLOAT32_VALUE | ( | obj | ) | (*((float *)GRN_BULK_HEAD(obj))) |
| #define GRN_FLOAT32_VALUE_AT | ( | obj, | |
| offset | |||
| ) | (((float *)GRN_BULK_HEAD(obj))[offset]) |
| #define GRN_FLOAT32_VECTOR_SIZE | ( | obj | ) | GRN_BULK_VECTOR_SIZE(obj, float) |
| #define GRN_FLOAT_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_FLOAT) |
| #define GRN_FLOAT_POP | ( | obj, | |
| value | |||
| ) | GRN_BULK_POP(obj, value, double, 0.0) |
| #define GRN_FLOAT_PUT | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_FLOAT_SET | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_FLOAT_SET_AT | ( | ctx, | |
| obj, | |||
| offset, | |||
| val | |||
| ) |
| #define GRN_FLOAT_VALUE | ( | obj | ) | (*((double *)GRN_BULK_HEAD(obj))) |
| #define GRN_FLOAT_VALUE_AT | ( | obj, | |
| offset | |||
| ) | (((double *)GRN_BULK_HEAD(obj))[offset]) |
| #define GRN_FLOAT_VECTOR_SIZE | ( | obj | ) | GRN_BULK_VECTOR_SIZE(obj, double) |
| #define GRN_GEO_DEGREE2MSEC | ( | degree | ) | ((int32_t)((degree) * 3600 * 1000 + ((degree) > 0 ? 0.5 : -0.5))) |
| #define GRN_GEO_M_PI 3.14159265358979323846 |
| #define GRN_GEO_MSEC2DEGREE | ( | msec | ) | ((((int32_t)(msec)) / 3600.0) * 0.001) |
| #define GRN_GEO_MSEC2RADIAN | ( | msec | ) | ((GRN_GEO_M_PI / (GRN_GEO_RESOLUTION * 180)) * (msec)) |
| #define GRN_GEO_POINT_SET | ( | ctx, | |
| obj, | |||
| _latitude, | |||
| _longitude | |||
| ) |
| #define GRN_GEO_POINT_VALUE | ( | obj, | |
| _latitude, | |||
| _longitude | |||
| ) |
| #define GRN_GEO_POINT_VALUE_RADIAN | ( | obj, | |
| _latitude, | |||
| _longitude | |||
| ) |
| #define GRN_GEO_POINT_VALUE_RAW | ( | obj | ) | (grn_geo_point *)GRN_BULK_HEAD(obj) |
| #define GRN_GEO_RADIAN2MSEC | ( | radian | ) | ((int32_t)(((GRN_GEO_RESOLUTION * 180) / GRN_GEO_M_PI) * (radian))) |
| #define GRN_GEO_RESOLUTION 3600000 |
| #define GRN_HIGHLIGHTER (0x0e) |
| #define GRN_HTTP_CLIENT (0x50) |
| #define GRN_ID_MAX (0x3fffffff) |
| #define GRN_ID_NIL (0x00) |
Means "does not exist".
| #define GRN_INFO_SUPPORT_ARROW GRN_INFO_SUPPORT_APACHE_ARROW |
| #define GRN_INFO_SUPPORT_LZO GRN_INFO_SUPPORT_LZ4 |
| #define GRN_INT16_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT16) |
| #define GRN_INT16_POP | ( | obj, | |
| value | |||
| ) | GRN_BULK_POP(obj, value, int16_t, 0) |
| #define GRN_INT16_PUT | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_INT16_SET | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_INT16_SET_AT | ( | ctx, | |
| obj, | |||
| offset, | |||
| val | |||
| ) |
| #define GRN_INT16_VALUE | ( | obj | ) | (*((int16_t *)GRN_BULK_HEAD(obj))) |
| #define GRN_INT16_VALUE_AT | ( | obj, | |
| offset | |||
| ) | (((int16_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define GRN_INT16_VECTOR_SIZE | ( | obj | ) | GRN_BULK_VECTOR_SIZE(obj, int16_t) |
| #define GRN_INT32_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT32) |
| #define GRN_INT32_POP | ( | obj, | |
| value | |||
| ) | GRN_BULK_POP(obj, value, int32_t, 0) |
| #define GRN_INT32_PUT | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_INT32_SET | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_INT32_SET_AT | ( | ctx, | |
| obj, | |||
| offset, | |||
| val | |||
| ) |
| #define GRN_INT32_VALUE | ( | obj | ) | (*((int32_t *)GRN_BULK_HEAD(obj))) |
| #define GRN_INT32_VALUE_AT | ( | obj, | |
| offset | |||
| ) | (((int32_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define GRN_INT32_VECTOR_SIZE | ( | obj | ) | GRN_BULK_VECTOR_SIZE(obj, int32_t) |
| #define GRN_INT64_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT64) |
| #define GRN_INT64_POP | ( | obj, | |
| value | |||
| ) | GRN_BULK_POP(obj, value, int64_t, 0) |
| #define GRN_INT64_PUT | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_INT64_SET | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_INT64_SET_AT | ( | ctx, | |
| obj, | |||
| offset, | |||
| val | |||
| ) |
| #define GRN_INT64_VALUE | ( | obj | ) | (*((int64_t *)GRN_BULK_HEAD(obj))) |
| #define GRN_INT64_VALUE_AT | ( | obj, | |
| offset | |||
| ) | (((int64_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define GRN_INT64_VECTOR_SIZE | ( | obj | ) | GRN_BULK_VECTOR_SIZE(obj, int64_t) |
| #define GRN_INT8_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT8) |
| #define GRN_INT8_POP | ( | obj, | |
| value | |||
| ) | GRN_BULK_POP(obj, value, int8_t, 0) |
| #define GRN_INT8_PUT | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_INT8_SET | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_INT8_SET_AT | ( | ctx, | |
| obj, | |||
| offset, | |||
| val | |||
| ) |
| #define GRN_INT8_VALUE | ( | obj | ) | (*((int8_t *)GRN_BULK_HEAD(obj))) |
| #define GRN_INT8_VALUE_AT | ( | obj, | |
| offset | |||
| ) | (((int8_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define GRN_INT8_VECTOR_SIZE | ( | obj | ) | GRN_BULK_VECTOR_SIZE(obj, int8_t) |
| #define GRN_JSON_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_JSON) |
| #define GRN_JSON_LEN | ( | obj | ) | GRN_BULK_VSIZE(obj) |
| #define GRN_JSON_SET | ( | ctx, | |
| obj, | |||
| data, | |||
| len | |||
| ) |
| #define GRN_JSON_SET_REF | ( | obj, | |
| data, | |||
| len | |||
| ) |
| #define GRN_JSON_VALUE | ( | obj | ) | ((const uint8_t *)GRN_BULK_HEAD(obj)) |
| #define GRN_LOG | ( | ctx, | |
| level, | |||
| ... | |||
| ) |
| #define GRN_LOG_ALL |
| #define GRN_LOG_CONTEXT_ID (0x01 << 6) |
| #define GRN_LOG_CTX_ID GRN_LOG_CONTEXT_ID |
| #define GRN_LOG_DEFAULT (GRN_LOG_TIME | GRN_LOG_MESSAGE) |
| #define GRN_LOG_DEFAULT_LEVEL GRN_LOG_NOTICE |
| #define GRN_LOG_LOCATION (0x01 << 3) |
| #define GRN_LOG_MESSAGE (0x01 << 2) |
| #define GRN_LOG_NONE (0x00 << 0) |
| #define GRN_LOG_PID (0x01 << 4) |
| #define GRN_LOG_PROCESS_ID GRN_LOG_PID |
| #define GRN_LOG_THREAD_ID (0x01 << 5) |
| #define GRN_LOG_TIME (0x01 << 0) |
| #define GRN_LOG_TITLE (0x01 << 1) |
| #define GRN_LONG_BINARY_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_LONG_BINARY) |
| #define GRN_LONG_TEXT_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_LONG_TEXT) |
| #define GRN_LZO_ERROR GRN_LZ4_ERROR |
| #define GRN_MATCH_INFO_GET_MIN_RECORD_ID (0x01) |
| #define GRN_MATCH_INFO_ONLY_SKIP_TOKEN (0x02) |
| #define GRN_MSG (0x07) |
| #define GRN_N_HOOK_ENTRIES 5 /* (GRN_HOOK_SELECT + 1) */ |
| #define GRN_OBJ_APPEND (0x04) |
Append the specified value to the column value.
| #define GRN_OBJ_COLUMN_INDEX (0x02) |
Index column type. Indicates that the column is an inverted index.
| #define GRN_OBJ_COLUMN_SCALAR (0x00) |
Scalar column type. Indicates that the column stores a scalar value.
| #define GRN_OBJ_COLUMN_TYPE_MASK (0x07) |
Mask for column types. Used to isolate the column type bits from the flags.
| #define GRN_OBJ_COLUMN_VECTOR (0x01) |
Vector column type. Indicates that the column stores a vector of values.
| #define GRN_OBJ_COMPARE (0x01 << 5) |
| #define GRN_OBJ_COMPRESS_FILTER_BYTE_DELTA (0x01 << 25) |
| #define GRN_OBJ_COMPRESS_FILTER_SHUFFLE (0x01 << 24) |
| #define GRN_OBJ_COMPRESS_FILTER_TRUNCATE_PRECISION_1BYTE (0x01 << 26) |
| #define GRN_OBJ_COMPRESS_FILTER_TRUNCATE_PRECISION_2BYTES (0x01 << 27) |
| #define GRN_OBJ_COMPRESS_LZ4 (0x02 << 4) |
LZ4 compression. Indicates that the objects are compressed using LZ4.
| #define GRN_OBJ_COMPRESS_LZO GRN_OBJ_COMPRESS_LZ4 |
| #define GRN_OBJ_COMPRESS_MASK (0x07 << 4) |
| #define GRN_OBJ_COMPRESS_NONE (0x00 << 4) |
| #define GRN_OBJ_COMPRESS_OPENZL (0x04 << 4) |
OpenZL compression. Indicates that the objects are compressed using OpenZL.
| #define GRN_OBJ_COMPRESS_ZLIB (0x01 << 4) |
zlib compression. Indicates that the objects are compressed using zlib.
| #define GRN_OBJ_COMPRESS_ZSTD (0x03 << 4) |
Zstandard (zstd) compression. Indicates that the objects are compressed using Zstandard.
| #define GRN_OBJ_DECR (0x03) |
Subtract the specified value from the record/column value.
| #define GRN_OBJ_DO_SHALLOW_COPY (GRN_OBJ_REFER | GRN_OBJ_OUTPLACE) |
| #define GRN_OBJ_FIN | ( | ctx, | |
| obj | |||
| ) | (grn_obj_close((ctx), (obj))) |
| #define GRN_OBJ_FLAGS_MASK (0xffff) |
| #define GRN_OBJ_GET (0x01 << 4) |
| #define GRN_OBJ_GET_DOMAIN | ( | obj | ) | ((obj)->header.type == GRN_TABLE_NO_KEY ? GRN_ID_NIL : (obj)->header.domain) |
| #define GRN_OBJ_INCR (0x02) |
Add the specified value to the record/column value.
| #define GRN_OBJ_INDEX_LARGE (0x01 << 18) |
| #define GRN_OBJ_INDEX_MEDIUM (0x01 << 17) |
| #define GRN_OBJ_INDEX_SMALL (0x01 << 16) |
| #define GRN_OBJ_INIT | ( | obj, | |
| obj_type, | |||
| obj_flags, | |||
| obj_domain | |||
| ) |
| #define GRN_OBJ_INVALID_ERROR (0x00 << 22) |
| #define GRN_OBJ_INVALID_IGNORE (0x02 << 22) |
| #define GRN_OBJ_INVALID_MASK (0x03 << 22) |
| #define GRN_OBJ_INVALID_WARN (0x01 << 22) |
| #define GRN_OBJ_INVISIBLE ((uint32_t)(0x01 << 31)) |
| #define GRN_OBJ_KEY_FLOAT (0x02 << 3) |
Float (Used to create data types. Used to determine sorting method.)
| #define GRN_OBJ_KEY_GEO_POINT (0x03 << 3) |
Latitude and longitude (grn_geo_point) (Used to create data types. Used to determine sorting method.)
| #define GRN_OBJ_KEY_INT (0x01 << 3) |
Signed integer (Used to create data types. Used to determine sorting method.)
| #define GRN_OBJ_KEY_LARGE (0x01 << 16) |
| #define GRN_OBJ_KEY_MASK (0x07 << 3) |
Mask of GRN_OBJ_KEY_*
| #define GRN_OBJ_KEY_NORMALIZE (0x01 << 7) |
| #define GRN_OBJ_KEY_UINT (0x00 << 3) |
Unsigned integer (Used to create data types. Used to determine sorting method.)
| #define GRN_OBJ_KEY_VAR_SIZE (0x01 << 14) |
It shows that the key is variable size not fixed size. If you're using DB API such as grn_table_create(), you don't need to use this. You can use type object such as ShortText instead. If you're using a low-level table such as grn_hash and grn_pat directly, you can use this to show that the table uses variable size key.
| #define GRN_OBJ_KEY_WITH_SIS (0x01 << 6) |
Enable semi-infinite string support. This is only available with GRN_OBJ_TABLE_PAT_KEY. You can use efficient suffix search with this but it requires more storage/memory size. Because it generates many additional data for efficient suffix search implicitly.
| #define GRN_OBJ_LOCK (0x01 << 6) |
| #define GRN_OBJ_MISSING_ADD (0x00 << 20) |
| #define GRN_OBJ_MISSING_IGNORE (0x01 << 20) |
| #define GRN_OBJ_MISSING_MASK (0x03 << 20) |
| #define GRN_OBJ_MISSING_NIL (0x02 << 20) |
| #define GRN_OBJ_MUTABLE | ( | obj | ) | ((obj) && (obj)->header.type <= GRN_VECTOR) |
| #define GRN_OBJ_NO_SUBREC (0x00 << 13) |
| #define GRN_OBJ_OUTPLACE (0x01 << 1) |
| #define GRN_OBJ_OWN (0x01 << 5) |
A flag to represent that GRN_PTR or GRN_PVECTOR owns associated grn_obj. When this flag is set, the associated grn_obj will be automatically closed using grn_obj_close when owning GRN_PTR or GRN_PVECTOR is closed.
You can use this flag only with GRN_PTR_INIT.
| #define GRN_OBJ_PERSISTENT (0x01 << 15) |
Persistent object. When set, the object is persisted to storage.
| #define GRN_OBJ_PREPEND (0x05) |
Prepend the specified value to the column value.
| #define GRN_OBJ_REFER (0x01 << 0) |
| #define GRN_OBJ_REMOVE_DEPENDENT (0x01 << 0) |
| #define GRN_OBJ_REMOVE_ENSURE (0x01 << 1) |
| #define GRN_OBJ_RING_BUFFER (0x01 << 10) |
| #define GRN_OBJ_SET (0x01) |
Replace the value of the record/column with the specified value.
| #define GRN_OBJ_SET_MASK (0x07) |
| #define GRN_OBJ_TABLE_DAT_KEY (0x02) |
| #define GRN_OBJ_TABLE_HASH_KEY (0x00) |
| #define GRN_OBJ_TABLE_NO_KEY (0x03) |
| #define GRN_OBJ_TABLE_PAT_KEY (0x01) |
| #define GRN_OBJ_TABLE_TYPE_MASK (0x07) |
| #define GRN_OBJ_TEMPORARY (0x00 << 15) |
| #define GRN_OBJ_UNIT_DOCUMENT_NONE (0x00 << 8) |
| #define GRN_OBJ_UNIT_DOCUMENT_POSITION (0x02 << 8) |
| #define GRN_OBJ_UNIT_DOCUMENT_SECTION (0x01 << 8) |
| #define GRN_OBJ_UNIT_MASK (0x0f << 8) |
| #define GRN_OBJ_UNIT_POSITION_NONE (0x05 << 8) |
| #define GRN_OBJ_UNIT_SECTION_NONE (0x03 << 8) |
| #define GRN_OBJ_UNIT_SECTION_POSITION (0x04 << 8) |
| #define GRN_OBJ_UNIT_USERDEF_DOCUMENT (0x06 << 8) |
| #define GRN_OBJ_UNIT_USERDEF_POSITION (0x08 << 8) |
| #define GRN_OBJ_UNIT_USERDEF_SECTION (0x07 << 8) |
| #define GRN_OBJ_UNLOCK (0x01 << 7) |
| #define GRN_OBJ_VECTOR (0x01 << 7) |
| #define GRN_OBJ_VISIBLE ((uint32_t)(0x00 << 31)) |
| #define GRN_OBJ_WEIGHT_BFLOAT16 (0x01 << 11) |
| #define GRN_OBJ_WEIGHT_FLOAT32 (0x01 << 19) |
| #define GRN_OBJ_WITH_POSITION (0x01 << 9) |
Enable position information. This flag is only effective when used in conjunction with GRN_OBJ_COLUMN_INDEX. When set, the inverted index will store the occurrence positions of terms within documents. This enables phrase searches. Full-text search indexes must have position information enabled because phrase searches rely on it.
| #define GRN_OBJ_WITH_SECTION (0x01 << 7) |
Enable section information. This flag is only effective when used in conjunction with GRN_OBJ_COLUMN_INDEX. When set, the inverted index will store section information. This allows the same index column to support multiple documents using multiple columns.
| #define GRN_OBJ_WITH_SUBREC (0x01 << 13) |
| #define GRN_OBJ_WITH_WEIGHT (0x01 << 8) |
Enable weight information. This flag is only effective when used in conjunction with GRN_OBJ_COLUMN_INDEX. When set, the inverted index will store weight information. This allows search results to be scored based on the weights assigned to individual columns.
| #define GRN_OP_BUT GRN_OP_AND_NOT |
| #define GRN_OP_NEAR2 GRN_OP_NEAR_NO_OFFSET |
| #define GRN_PATSNIP (0x0c) |
| #define GRN_PROC (0x21) |
| #define GRN_PTR (0x03) |
Buffer that has a grn_obj *. The hold grn_obj * can be closed automatically when this is closed by specifying GRN_OBJ_OWN flag.
| #define GRN_PTR_INIT | ( | obj, | |
| flags, | |||
| domain | |||
| ) |
| #define GRN_PTR_POP | ( | obj, | |
| value | |||
| ) | GRN_BULK_POP(obj, value, grn_obj *, NULL) |
| #define GRN_PTR_PUT | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_PTR_SET | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_PTR_SET_AT | ( | ctx, | |
| obj, | |||
| offset, | |||
| val | |||
| ) |
| #define GRN_PTR_VALUE | ( | obj | ) | (*((grn_obj **)GRN_BULK_HEAD(obj))) |
| #define GRN_PTR_VALUE_AT | ( | obj, | |
| offset | |||
| ) | (((grn_obj **)GRN_BULK_HEAD(obj))[offset]) |
| #define GRN_PTR_VECTOR_SIZE | ( | obj | ) | GRN_BULK_VECTOR_SIZE(obj, grn_obj *) |
| #define GRN_PVECTOR (0x05) /* vector of grn_obj* */ |
| #define GRN_QUERY (0x08) |
| #define GRN_QUERY_ADJ_DEC '<' |
| #define GRN_QUERY_ADJ_INC '>' |
| #define GRN_QUERY_ADJ_NEG '~' |
| #define GRN_QUERY_AND '+' |
| #define GRN_QUERY_AND_NOT '-' |
| #define GRN_QUERY_COLUMN ':' |
| #define GRN_QUERY_ESCAPE '\\' |
| #define GRN_QUERY_LOG | ( | ctx, | |
| flag, | |||
| mark, | |||
| format, | |||
| ... | |||
| ) |
| #define GRN_QUERY_LOG_ALL |
| #define GRN_QUERY_LOG_CACHE (0x01 << 3) |
| #define GRN_QUERY_LOG_COMMAND (0x01 << 0) |
| #define GRN_QUERY_LOG_DEFAULT GRN_QUERY_LOG_ALL |
| #define GRN_QUERY_LOG_DESTINATION (0x01 << 2) |
| #define GRN_QUERY_LOG_NONE (0x00) |
| #define GRN_QUERY_LOG_RESULT_CODE (0x01 << 1) |
| #define GRN_QUERY_LOG_SCORE (0x01 << 5) |
| #define GRN_QUERY_LOG_SIZE (0x01 << 4) |
| #define GRN_QUERY_PARENL '(' |
| #define GRN_QUERY_PARENR ')' |
| #define GRN_QUERY_PREFIX '*' |
| #define GRN_QUERY_QUOTEL '"' |
| #define GRN_QUERY_QUOTER '"' |
| #define GRN_RECORD_INIT GRN_VALUE_FIX_SIZE_INIT |
| #define GRN_RECORD_POP | ( | obj, | |
| value | |||
| ) | GRN_BULK_POP(obj, value, grn_id, GRN_ID_NIL) |
| #define GRN_RECORD_PUT | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_RECORD_SET | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_RECORD_SET_AT | ( | ctx, | |
| obj, | |||
| offset, | |||
| val | |||
| ) |
| #define GRN_RECORD_VALUE | ( | obj | ) | (*((grn_id *)GRN_BULK_HEAD(obj))) |
| #define GRN_RECORD_VALUE_AT | ( | obj, | |
| offset | |||
| ) | (((grn_id *)GRN_BULK_HEAD(obj))[offset]) |
| #define GRN_RECORD_VECTOR_SIZE | ( | obj | ) | GRN_BULK_VECTOR_SIZE(obj, grn_id) |
| #define GRN_SHORT_BINARY_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_SHORT_BINARY) |
| #define GRN_SHORT_TEXT_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_SHORT_TEXT) |
| #define GRN_SLOW_LOG_POP_BEGIN | ( | ctx, | |
| level, | |||
| elapsed_time | |||
| ) |
| #define GRN_SLOW_LOG_POP_END | ( | ctx | ) |
| #define GRN_SLOW_LOG_PUSH | ( | ctx, | |
| level | |||
| ) |
| #define GRN_SNIP (0x0b) |
| #define GRN_SNIP_COPY_TAG (0x01 << 1) |
| #define GRN_SNIP_MAPPING_HTML_ESCAPE ((grn_snip_mapping *)-1) |
| #define GRN_SNIP_NORMALIZE (0x01 << 0) |
| #define GRN_SNIP_SKIP_LEADING_SPACES (0x01 << 2) |
| #define GRN_STRING (0x0d) |
| #define GRN_TABLE_DAT_KEY (0x32) |
| #define GRN_TABLE_FUZZY_SEARCH_SKIP_TOKENIZE (0x01 << 3) |
| #define GRN_TABLE_FUZZY_SEARCH_USE_MAX_DISTANCE_RATIO (0x01 << 2) |
| #define GRN_TABLE_FUZZY_SEARCH_USE_PREFIX_LENGTH (0x01 << 1) |
| #define GRN_TABLE_FUZZY_SEARCH_WITH_TRANSPOSITION (0x01 << 0) |
| #define GRN_TABLE_HASH_KEY (0x30) |
| #define GRN_TABLE_NO_KEY (0x33) |
| #define GRN_TABLE_PAT_KEY (0x31) |
| #define GRN_TEXT_EQUAL_CSTRING | ( | bulk, | |
| string | |||
| ) |
| #define GRN_TEXT_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_TEXT) |
| #define GRN_TEXT_LEN | ( | obj | ) | GRN_BULK_VSIZE(obj) |
| #define GRN_TEXT_PUT | ( | ctx, | |
| obj, | |||
| str, | |||
| len | |||
| ) | grn_bulk_write((ctx), (obj), (const char *)(str), (unsigned int)(len)) |
| #define GRN_TEXT_PUTC | ( | ctx, | |
| obj, | |||
| c | |||
| ) |
| #define GRN_TEXT_PUTS | ( | ctx, | |
| obj, | |||
| str | |||
| ) | GRN_TEXT_PUT((ctx), (obj), (str), strlen(str)) |
| #define GRN_TEXT_SET | ( | ctx, | |
| obj, | |||
| str, | |||
| len | |||
| ) |
| #define GRN_TEXT_SET_REF | ( | obj, | |
| str, | |||
| len | |||
| ) |
| #define GRN_TEXT_SETS | ( | ctx, | |
| obj, | |||
| str | |||
| ) | GRN_TEXT_SET((ctx), (obj), (str), strlen(str)) |
| #define GRN_TEXT_VALUE | ( | obj | ) | GRN_BULK_HEAD(obj) |
| #define GRN_TIME_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_TIME) |
| #define GRN_TIME_POP GRN_INT64_POP |
| #define GRN_TIME_PUT GRN_INT64_PUT |
| #define GRN_TIME_SET GRN_INT64_SET |
| #define GRN_TIME_SET_AT GRN_INT64_SET_AT |
| #define GRN_TIME_VALUE GRN_INT64_VALUE |
| #define GRN_TIME_VALUE_AT GRN_INT64_VALUE_AT |
| #define GRN_TIME_VECTOR_SIZE GRN_INT64_VECTOR_SIZE |
| #define GRN_TOKYO_GEO_POINT_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_TOKYO_GEO_POINT) |
| #define GRN_TRUE true |
| #define GRN_TYPE (0x20) |
| #define GRN_UINT16_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT16) |
| #define GRN_UINT16_POP | ( | obj, | |
| value | |||
| ) | GRN_BULK_POP(obj, value, uint16_t, 0) |
| #define GRN_UINT16_PUT | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_UINT16_SET | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_UINT16_SET_AT | ( | ctx, | |
| obj, | |||
| offset, | |||
| val | |||
| ) |
| #define GRN_UINT16_VALUE | ( | obj | ) | (*((uint16_t *)GRN_BULK_HEAD(obj))) |
| #define GRN_UINT16_VALUE_AT | ( | obj, | |
| offset | |||
| ) | (((uint16_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define GRN_UINT16_VECTOR_SIZE | ( | obj | ) | GRN_BULK_VECTOR_SIZE(obj, uint16_t) |
| #define GRN_UINT32_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT32) |
| #define GRN_UINT32_POP | ( | obj, | |
| value | |||
| ) | GRN_BULK_POP(obj, value, uint32_t, 0) |
| #define GRN_UINT32_PUT | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_UINT32_SET | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_UINT32_SET_AT | ( | ctx, | |
| obj, | |||
| offset, | |||
| val | |||
| ) |
| #define GRN_UINT32_VALUE | ( | obj | ) | (*((uint32_t *)GRN_BULK_HEAD(obj))) |
| #define GRN_UINT32_VALUE_AT | ( | obj, | |
| offset | |||
| ) | (((uint32_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define GRN_UINT32_VECTOR_SIZE | ( | obj | ) | GRN_BULK_VECTOR_SIZE(obj, uint32_t) |
| #define GRN_UINT64_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT64) |
| #define GRN_UINT64_POP | ( | obj, | |
| value | |||
| ) | GRN_BULK_POP(obj, value, uint64_t, 0) |
| #define GRN_UINT64_PUT | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_UINT64_SET | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_UINT64_SET_AT | ( | ctx, | |
| obj, | |||
| offset, | |||
| val | |||
| ) |
| #define GRN_UINT64_VALUE | ( | obj | ) | (*((uint64_t *)GRN_BULK_HEAD(obj))) |
| #define GRN_UINT64_VALUE_AT | ( | obj, | |
| offset | |||
| ) | (((uint64_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define GRN_UINT64_VECTOR_SIZE | ( | obj | ) | GRN_BULK_VECTOR_SIZE(obj, uint64_t) |
| #define GRN_UINT8_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT8) |
| #define GRN_UINT8_POP | ( | obj, | |
| value | |||
| ) | GRN_BULK_POP(obj, value, uint8_t, 0) |
| #define GRN_UINT8_PUT | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_UINT8_SET | ( | ctx, | |
| obj, | |||
| val | |||
| ) |
| #define GRN_UINT8_SET_AT | ( | ctx, | |
| obj, | |||
| offset, | |||
| val | |||
| ) |
| #define GRN_UINT8_VALUE | ( | obj | ) | (*((uint8_t *)GRN_BULK_HEAD(obj))) |
| #define GRN_UINT8_VALUE_AT | ( | obj, | |
| offset | |||
| ) | (((uint8_t *)GRN_BULK_HEAD(obj))[offset]) |
| #define GRN_UINT8_VECTOR_SIZE | ( | obj | ) | GRN_BULK_VECTOR_SIZE(obj, uint8_t) |
| #define GRN_UVECTOR (0x04) |
| #define GRN_VALUE_FIX_SIZE_INIT | ( | obj, | |
| flags, | |||
| domain | |||
| ) |
| #define GRN_VALUE_VAR_SIZE_INIT | ( | obj, | |
| flags, | |||
| domain | |||
| ) |
| #define GRN_VECTOR (0x06) /* vector of arbitrary data */ |
| #define GRN_VOID (0x00) |
| #define GRN_VOID_INIT | ( | obj | ) | GRN_OBJ_INIT((obj), GRN_VOID, 0, GRN_DB_VOID) |
| #define GRN_WGS84_GEO_POINT_INIT | ( | obj, | |
| flags | |||
| ) | GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_WGS84_GEO_POINT) |
| typedef bool grn_bool |
| typedef void(* grn_close_func) (grn_ctx *ctx, void *data) |
| typedef uint32_t grn_column_flags |
grn_ctx is the most important object.
grn_ctx keeps the current information such as:
match_escalation_threshold.grn_ctx provides platform features such as:
| typedef struct _grn_ctx_info grn_ctx_info |
| typedef struct _grn_fuzzy_search_optarg grn_fuzzy_search_optarg |
| typedef uint32_t grn_id |
| typedef struct _grn_index_datum grn_index_datum |
| typedef struct _grn_logger grn_logger |
| typedef struct _grn_logger_info grn_logger_info |
| typedef struct _grn_match_info grn_match_info |
The generic Groonga object type.
This is a generic type to represent most Groonga objects such as database, table, column, buffer and so on. You can use grn_obj to represent different types of objects. For example, you can use grn_obj both for grn_hash and grn_pat. This is convenient to provide generic API. For example, you can use grn_obj_get_value for table, column and accessor.
This is convenient but this may be difficult to understand when you don't have a common knowledge of object-oriented programming in C. Here are some examples of common grn_obj usages:
You can use grn_obj as a buffer. You can store scalar values or vector values in a grn_obj.
For this usage, you need to allocate a grn_obj on stack or heap. In general, stack is used to reduce memory allocation cost. Then you need to initialize the allocated grn_obj by GRN_*_INIT() macros such as GRN_TEXT_INIT and GRN_INT32_INIT. You need to free the allocated grn_obj when it's no longer needed. You can use GRN_OBJ_FIN or grn_obj_close for it. (GRN_OBJ_FIN is an alias of grn_obj_close.) In general, GRN_OBJ_FIN is used for a grn_obj in stack.
Here is an example to use grn_obj as a text buffer:
You can use grn_obj as a generic type for database, table, column and so on. In this usage, you use a heap allocated grn_obj. So grn_obj * is used instead of grn_obj.
For example, you can use grn_db_open to open a database:
You can use grn_obj_close to free the opened database:
| typedef uint16_t grn_obj_flags |
| typedef struct _grn_obj_header grn_obj_header |
| typedef grn_obj * grn_proc_func(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data) |
| typedef struct _grn_query_logger grn_query_logger |
| typedef void(* grn_recv_handler_func) (grn_ctx *ctx, int flags, void *user_data) |
| typedef struct _grn_search_optarg grn_search_optarg |
| typedef struct _grn_section grn_section |
| typedef struct _grn_snip_mapping grn_snip_mapping |
| typedef grn_obj grn_table_cursor |
| typedef struct _grn_table_delete_optarg grn_table_delete_optarg |
| typedef uint32_t grn_table_flags |
| enum grn_builtin_type |
| enum grn_command_version |
| enum grn_content_type |
The input/output content format.
| enum grn_encoding |
| enum grn_hook_entry |
| enum grn_info_type |
| enum grn_log_level |
| enum grn_operator |
| enum grn_rc |
| GRN_API grn_rc grn_bulk_write_from | ( | grn_ctx * | ctx, |
| grn_obj * | bulk, | ||
| const char * | str, | ||
| size_t | from, | ||
| size_t | len | ||
| ) |
| GRN_API unsigned int grn_column_find_index_data | ( | grn_ctx * | ctx, |
| grn_obj * | column, | ||
| grn_operator | op, | ||
| grn_index_datum * | index_data, | ||
| unsigned int | n_index_data | ||
| ) |
Return indexes that can perform a specified operation by storing it in index_data.
| ctx | The context object. |
| column | The target column to search for associated indexes. |
| op | The operator that the indexes should support. (e.g., GRN_OP_EQUAL, GRN_OP_PREFIX, GRN_OP_LESS, and so on.). |
| index_data | An array to store information about the found indexes. Each element is a grn_index_datum structure containing details about an index. The caller must allocate this array with at least n_index_data elements. |
| n_index_data | The maximum number of entries to store in index_data. |
n_index_data, only the first n_index_data entries are filled in index_data. | GRN_API grn_rc grn_column_get_all_index_columns | ( | grn_ctx * | ctx, |
| grn_obj * | column, | ||
| grn_obj * | index_columns | ||
| ) |
| GRN_API uint32_t grn_column_get_all_index_data | ( | grn_ctx * | ctx, |
| grn_obj * | column, | ||
| grn_index_datum * | index_data, | ||
| uint32_t | n_index_data | ||
| ) |
| GRN_API int grn_column_index | ( | grn_ctx * | ctx, |
| grn_obj * | column, | ||
| grn_operator | op, | ||
| grn_obj ** | indexbuf, | ||
| int | buf_size, | ||
| int * | section | ||
| ) |
Return a column's name by storing it in namebuf.
If the column has a name and buf_size is greater than or equal to the length of the name, the name is copied into namebuf.
If the length of the name exceeds buf_size, the name is not copied into namebuf, but the length of the name is still returned.
The maximum possible length of the name is limited by GRN_TABLE_MAX_KEY_SIZE.
If the obj is an accessor, it returns the accessor's name instead. For detailed information on accessor's naming conventions, see grn_obj_column.
| ctx | The context object. |
| obj | The column whose name is to be retrieved. |
| namebuf | A buffer allocated by the caller to store the column's name. |
| buf_size | The size of namebuf in bytes. |
0 if the obj parameter is NULL. | GRN_API grn_rc grn_column_rename | ( | grn_ctx * | ctx, |
| grn_obj * | column, | ||
| const char * | name, | ||
| unsigned int | name_size | ||
| ) |
Rename a column in the database used by the context.
| ctx | The context object. |
| column | The column object to be renamed. It must be a persistent object. |
| name | The new name for the column. |
| name_size | The size of the name in bytes. |
Retrieve the object corresponding to the specified ID from the context or the database that the context is using.
| ctx | The context object. |
| id | The object ID to be retrieved. |
NULL otherwise. Close the context.
This function releases memory that was managed by the context and closes. (Internally, grn_ctx_fin is called to release allocated memory.)
| ctx | The context object initialized by grn_ctx_open. |
Retrieve the database that the context is using.
| ctx | The context object. |
NULL if database is not in use. Finish the context.
This function releases memory that was managed by the context and finishes.
| ctx | The context object initialized by grn_ctx_init. |
Retrieve the object corresponding to the specified name from the database that the context is using.
| ctx | The context object. |
| name | The name of the object to be retrieved. |
| name_size | The size of the name in bytes. |
NULL otherwise. Retrieve all tables from the database that the context is using.
tables_buffer is properly initialized as a GRN_PVECTOR using GRN_PTR_INIT with the GRN_OBJ_VECTOR flag before invoking this function.tables_buffer using GRN_OBJ_FIN. Otherwise, memory leaks may occur.Here is an example of how to use grn_ctx_get_all_tables to retrieve and process all tables:
| ctx | The context object. |
| tables_buffer | The buffer to store the retrieved tables (must be prepared by the caller). |
| GRN_API grn_command_version grn_ctx_get_command_version | ( | grn_ctx * | ctx | ) |
| ctx | The context object. |
| ctx | The context object. |
| GRN_API grn_rc grn_ctx_info_get | ( | grn_ctx * | ctx, |
| grn_ctx_info * | info | ||
| ) |
Initialize the context.
| ctx | The context object allocated by the caller. |
| flags | Initialization options. |
Open the context.
| flags | Initialization options. |
NULL if initialization fails. | GRN_API void grn_ctx_recv_handler_set | ( | grn_ctx * | , |
| grn_recv_handler_func | func, | ||
| void * | user_data | ||
| ) |
| GRN_API unsigned int grn_ctx_send | ( | grn_ctx * | ctx, |
| const char * | str, | ||
| unsigned int | str_len, | ||
| int | flags | ||
| ) |
| GRN_API grn_rc grn_ctx_set_command_version | ( | grn_ctx * | ctx, |
| grn_command_version | version | ||
| ) |
Set command version for this context.
| ctx | The context object. |
| version | New command version. |
| GRN_API grn_rc grn_ctx_set_finalizer | ( | grn_ctx * | ctx, |
| grn_proc_func * | func | ||
| ) |
Set the callback function to be called when the context is finished.
| ctx | The context object. |
| func | The callback function called on finish. |
Set the threshold to determine whether search strategy escalation is used or not.
| ctx | The context object. |
| threshold | New threshold. |
| GRN_API grn_rc grn_ctx_set_variable | ( | grn_ctx * | ctx, |
| const char * | name, | ||
| int | name_size, | ||
| void * | data, | ||
| grn_close_func | close_func | ||
| ) |
Set the database that the context is using.
You can initialize it if you specify NULL for the parameter db.
| ctx | The context object. |
| db | The database object. |
| GRN_API int grn_default_logger_get_flags | ( | void | ) |
| GRN_API grn_log_level grn_default_logger_get_max_level | ( | void | ) |
| GRN_API const char * grn_default_logger_get_path | ( | void | ) |
| GRN_API off_t grn_default_logger_get_rotate_threshold_size | ( | void | ) |
| GRN_API void grn_default_logger_set_flags | ( | int | flags | ) |
| GRN_API void grn_default_logger_set_max_level | ( | grn_log_level | level | ) |
| GRN_API void grn_default_logger_set_path | ( | const char * | path | ) |
| GRN_API void grn_default_logger_set_rotate_threshold_size | ( | off_t | threshold | ) |
| GRN_API unsigned int grn_default_query_logger_get_flags | ( | void | ) |
| GRN_API const char * grn_default_query_logger_get_path | ( | void | ) |
| GRN_API off_t grn_default_query_logger_get_rotate_threshold_size | ( | void | ) |
| GRN_API void grn_default_query_logger_set_flags | ( | unsigned int | flags | ) |
| GRN_API void grn_default_query_logger_set_path | ( | const char * | path | ) |
| GRN_API void grn_default_query_logger_set_rotate_threshold_size | ( | off_t | threshold | ) |
| GRN_API grn_encoding grn_encoding_parse | ( | const char * | name | ) |
Parse encoding name and return grn_encoding. For example, grn_encoding_parse("UTF8") returns GRN_ENC_UTF8.
| name | The encoding name |
name on success, GRN_ENC_UTF8 on invalid encoding name. | GRN_API const char * grn_encoding_to_string | ( | grn_encoding | encoding | ) |
Return string representation for the encoding. For example, grn_encoding_to_string(GRN_ENC_UTF8) returns "utf8".
| encoding | The encoding |
| GRN_API grn_command_version grn_get_default_command_version | ( | void | ) |
| GRN_API grn_encoding grn_get_default_encoding | ( | void | ) |
| GRN_API int64_t grn_get_default_match_escalation_threshold | ( | void | ) |
| GRN_API int32_t grn_get_default_n_workers | ( | void | ) |
| GRN_API const char * grn_get_global_error_message | ( | void | ) |
| GRN_API int grn_get_lock_timeout | ( | void | ) |
Retrieve the current lock timeout.
Groonga uses a read lock-free mechanism. It allows multiple threads or processes to perform read operations concurrently, even during write operations. Write operations, in contrast, require locking to ensure data consistency.
When performing write operations:
The default lock timeout is set to 900,000 milliseconds (15 minutes).
| GRN_API size_t grn_get_memory_map_size | ( | void | ) |
| GRN_API const char * grn_get_package | ( | void | ) |
| GRN_API const char * grn_get_package_label | ( | void | ) |
| GRN_API const char * grn_get_version | ( | void | ) |
| GRN_API uint32_t grn_get_version_major | ( | void | ) |
| GRN_API uint32_t grn_get_version_micro | ( | void | ) |
| GRN_API uint32_t grn_get_version_minor | ( | void | ) |
| GRN_API const char * grn_hook_entry_to_string | ( | grn_hook_entry | entry | ) |
| GRN_API bool grn_is_back_trace_enable | ( | void | ) |
| GRN_API bool grn_is_reference_count_enable | ( | void | ) |
| GRN_API grn_rc grn_load | ( | grn_ctx * | ctx, |
| grn_content_type | input_type, | ||
| const char * | table, | ||
| unsigned int | table_len, | ||
| const char * | columns, | ||
| unsigned int | columns_len, | ||
| const char * | values, | ||
| unsigned int | values_len, | ||
| const char * | ifexists, | ||
| unsigned int | ifexists_len, | ||
| const char * | each, | ||
| unsigned int | each_len | ||
| ) |
| GRN_API bool grn_log_flags_parse | ( | const char * | string, |
| int | string_size, | ||
| int * | flags | ||
| ) |
| GRN_API bool grn_log_level_parse | ( | const char * | string, |
| grn_log_level * | level | ||
| ) |
| GRN_API const char * grn_log_level_to_string | ( | grn_log_level | level | ) |
| GRN_API grn_log_level grn_logger_get_max_level | ( | grn_ctx * | ctx | ) |
| GRN_API grn_rc grn_logger_info_set | ( | grn_ctx * | ctx, |
| const grn_logger_info * | info | ||
| ) |
| GRN_API bool grn_logger_pass | ( | grn_ctx * | ctx, |
| grn_log_level | level | ||
| ) |
| GRN_API void grn_logger_put | ( | grn_ctx * | ctx, |
| grn_log_level | level, | ||
| const char * | file, | ||
| int | line, | ||
| const char * | func, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
| GRN_API void grn_logger_putv | ( | grn_ctx * | ctx, |
| grn_log_level | level, | ||
| const char * | file, | ||
| int | line, | ||
| const char * | func, | ||
| const char * | fmt, | ||
| va_list | ap | ||
| ) |
| GRN_API grn_rc grn_logger_set | ( | grn_ctx * | ctx, |
| const grn_logger * | logger | ||
| ) |
| GRN_API void grn_logger_set_max_level | ( | grn_ctx * | ctx, |
| grn_log_level | max_level | ||
| ) |
| GRN_API grn_rc grn_obj_add_hook | ( | grn_ctx * | ctx, |
| grn_obj * | obj, | ||
| grn_hook_entry | entry, | ||
| int | offset, | ||
| grn_obj * | proc, | ||
| grn_obj * | data | ||
| ) |
Add a hook to the object. If multiple hooks are set for the object, they are called in the order they are registered in the hook list.
| ctx | The context object. |
| obj | The target object. |
| entry | The type of hook. |
| offset | The offset of execution order. Add to the beginning if 0 is specified. Add to the end if -1 is specified. |
| proc | The procedure object. |
| data | The hook data. |
Check the integrity of the file corresponding to an object.
| ctx | The context object. |
| obj | The target object whose file is to be checked. |
Forcefully clear locks on an object.
Unlike grn_obj_unlock, which decrements the lock count by one, this function forcefully resets the lock count of an object to zero, unlocking it regardless of the current lock count.
| ctx | The context object. |
| obj | The target object whose lock is to be cleared. |
Close an object.
This function frees all resources used by the specified object (`obj`) from memory. All resources include other associated objects. In general, you must close temporary objects explicitly. You don't need to close persistent objects explicitly because you can close persistent objects implicitly by closing a DB object. You can use \ref grn_obj_unlink instead. It closes temporary objects but does nothing for most persistent objects. It's useful for normal use cases.
| ctx | The context object. |
| obj | The object to be closed. |
| GRN_API grn_obj * grn_obj_column | ( | grn_ctx * | ctx, |
| grn_obj * | table, | ||
| const char * | name, | ||
| uint32_t | name_size | ||
| ) |
Retrieve a column or an accessor from a specified table or accessor.
This function returns a column corresponding to the given name from the specified table. If the name does not correspond to any column, it returns NULL. If the name is an accessor string, it returns the corresponding accessor. Accessor strings are dot-concatenated column names. Column names that are started with _ such as _id and _key are pseudo column names. This function returns an accessor for a pseudo column name. See https://groonga.org/docs/reference/columns/pseudo.html for pseudo column.
Column name examples: name, age
Pseudo column name examples: _key, _score, _nsubrecs
Accessor string examples: tag.name, user.bookmarks.url
If this function returns an accessor, you must call grn_obj_unlink with it when it's no longer needed. You can use grn_obj_is_accessor to detect whether it's an accessor or not.
To illustrate its usage, here is an example to use grn_obj_column with pseudo column like GRN_COLUMN_NAME_ID and GRN_COLUMN_NAME_ID_LEN to retrieve the accessor object for _id.
| ctx | The context object. |
| table | The target table or accessor from which the column or accessor is retrieved. |
| name | The name of the column or an accessor string. |
| name_size | The length of the name string. |
| GRN_API grn_rc grn_obj_columns | ( | grn_ctx * | ctx, |
| grn_obj * | table, | ||
| const char * | str, | ||
| unsigned int | str_size, | ||
| grn_obj * | res | ||
| ) |
Return the database to which obj belongs.
| ctx | The context object. |
| obj | Target object. |
obj belongs, NULL if obj doesn't belong to any database. Defragment an object to reduce fragmentation in the database file.
The defragmentation process aims to reduce the fragmentation in the database file area occupied by the object, based on the provided threshold value.
| ctx | The context object. |
| obj | The target object to defragment. |
| threshold | The threshold value used to guide the defragmentation process. |
See ctx->rc for error details.
Delete an object (such as a table or column) identified by the ID from the database.
| ctx | The context object. |
| db | The target database object. |
| id | The ID of the object to be deleted. |
| remove_p | A boolean flag indicating the deletion mode:
|
id is GRN_ID_NIL. | GRN_API grn_rc grn_obj_delete_hook | ( | grn_ctx * | ctx, |
| grn_obj * | obj, | ||
| grn_hook_entry | entry, | ||
| int | offset | ||
| ) |
Delete the hook set on the object.
| ctx | The context object. |
| obj | The target object. |
| entry | The type of hook. |
| offset | The offset of execution order. |
offset. Free allocatable memory occupied by an object based on a threshold.
| ctx | The context object. |
| obj | The target object whose memory is to be managed. |
| threshold | The threshold value used as a benchmark for freeing memory spaces. |
| GRN_API grn_obj * grn_obj_get_element_info | ( | grn_ctx * | ctx, |
| grn_obj * | obj, | ||
| grn_id | id, | ||
| grn_info_type | type, | ||
| grn_obj * | valuebuf | ||
| ) |
Get information on the record with the ID in the object.
| ctx | The context object. |
| obj | The target object. |
| id | The target ID. |
| type | The type of information. |
| valuebuf | The buffer to store the retrieved value (must be prepared by the caller). |
valuebuf. | GRN_API grn_obj * grn_obj_get_hook | ( | grn_ctx * | ctx, |
| grn_obj * | obj, | ||
| grn_hook_entry | entry, | ||
| int | offset, | ||
| grn_obj * | data | ||
| ) |
Get the hook set on the object. If hook data is set, it is stored in data.
| ctx | The context object. |
| obj | The target object. |
| entry | The type of hook. |
| offset | The offset of execution order. |
| data | The buffer to store hook data. |
NULL otherwise. | GRN_API grn_obj * grn_obj_get_info | ( | grn_ctx * | ctx, |
| grn_obj * | obj, | ||
| grn_info_type | type, | ||
| grn_obj * | valuebuf | ||
| ) |
Get information on the object.
| ctx | The context object. |
| obj | The target object. |
| type | The type of information. |
| valuebuf | The buffer to store the retrieved value (must be prepared by the caller). |
valuebuf. | GRN_API int grn_obj_get_nhooks | ( | grn_ctx * | ctx, |
| grn_obj * | obj, | ||
| grn_hook_entry | entry | ||
| ) |
Get the number of hooks set on the object.
| ctx | The context object. |
| obj | The target object. |
| entry | The type of hook. |
Retrieve the value range based on the ID associated with an object.
For example, it may return \ref GRN_DB_INT32 from \ref grn_builtin_type to indicate that the object operates within the integer range.
| ctx | The context object. |
| obj | The target object whose range ID is to be returned. |
NULL. Retrieve the value of the record corresponding to the given ID in the specified object.
| ctx | The context object |
| obj | The target object from which to retrieve the value |
| id | The ID of the target record |
| value | The buffer to store the retrieved value (must be prepared by the caller) |
Retrieve an array of fixed-size column values starting from a specified record ID.
This function retrieves values from a fixed-size column (obj), starting at the record ID given by offset. The retrieved values are stored in the array pointed to by values, and the number of records that can be retrieved is returned.
-1, check ctx->rc for the specific error code (e.g., GRN_NO_MEMORY_AVAILABLE, GRN_INVALID_ARGUMENT). Additional details might be available in ctx->errbuf.| ctx | The context object |
| obj | The target fixed-size column |
| offset | The starting record ID for retrieving values |
| values | A pointer to an array where the values will be stored |
-1 if an error occurred. Return the ID of an object.
| ctx | The context object. |
| obj | The target object whose ID is to be retrieved. |
Check if an object is currently locked.
| ctx | The context object. |
| obj | The target object whose lock status is to be checked. |
0 if there are no locks. Return the number of acquired locks if the object or any of its related sub-objects are currently locked. Lock an object with a specified timeout.
| ctx | The context object. |
| obj | The target object to lock. |
| id | The ID of the target object. |
| timeout | The maximum time to wait for the lock, in seconds. |
Return an object's name by storing it in namebuf.
If the object has a name and `buf_size` is greater than or equal to the length of the name, the name is copied into `namebuf`. If the length of the name exceeds `buf_size`, the name is not copied into `namebuf`, but the length of the name is still returned. The maximum possible length of the name is limited by \ref GRN_TABLE_MAX_KEY_SIZE.
| ctx | The context object. |
| obj | The object whose name is to be retrieved. |
| namebuf | A buffer allocated by the caller to store the object's name. |
| buf_size | The size of namebuf in bytes. |
0 if the object is unnamed or NULL. | GRN_API grn_obj * grn_obj_open | ( | grn_ctx * | ctx, |
| unsigned char | type, | ||
| grn_obj_flags | flags, | ||
| grn_id | domain | ||
| ) |
Return the file path associated with an object.
| ctx | The context object. |
| obj | The object whose file path is to be retrieved. |
NULL if the object is temporary. Return the pathname of an object ID.
| ctx | The context object. |
| db | The target database object. |
| id | The ID of the object whose pathname is to be obtained. |
| buffer | A pre-allocated buffer where the resulting pathname will be stored. For example, char buffer[PATH_MAX] can be used. |
db is not a database object or if buffer is NULL. Reinitialize an object.
Buffer objects, \ref GRN_BULK, \ref GRN_PTR, \ref GRN_UVECTOR, \ref GRN_PVECTOR, and \ref GRN_VECTOR, are only target objects of this function. You can't use other objects such as table and column for this function. This function frees the current data in the specified object (`obj`) and initializes the specified `obj` for the specified `domain` and `flags`. Before calling this function, the object must have been initialized. You can use `GRN_XXX_INIT()` macros such as \ref GRN_TEXT_INIT to initialize a buffer object.
| ctx | The context object. |
| obj | The object to be reinitialized. It must be a buffer object. |
| domain | The new type that the object can hold. |
| flags | 0 or GRN_OBJ_VECTOR. If GRN_OBJ_VECTOR is specified, the object will be configured to store a vector of values of the specified domain. |
Remove the specified object.
This function frees the specified object (`obj`) from memory. If the object is a persistent object, it also removes the associated files from disk.
| ctx | The context object. |
| obj | The target object to be removed. |
| GRN_API grn_rc grn_obj_rename | ( | grn_ctx * | ctx, |
| grn_obj * | obj, | ||
| const char * | name, | ||
| unsigned int | name_size | ||
| ) |
Rename a persistent object in the database used by the context.
This function updates the name of the specified object (`obj`) to the new name provided. The object must be a persistent object.
| ctx | The context object. |
| obj | The target object to be renamed. |
| name | The new name for the given object. |
| name_size | The size of the name in bytes. |
| GRN_API grn_rc grn_obj_search | ( | grn_ctx * | ctx, |
| grn_obj * | obj, | ||
| grn_obj * | query, | ||
| grn_obj * | res, | ||
| grn_operator | op, | ||
| grn_search_optarg * | optarg | ||
| ) |
Search for obj in query.
| ctx | The context object. |
| obj | The object to be searched. |
| query | Search query. |
| res | The table to store results. |
| op | Logical operation of the table stored in res and the table of the search result.
|
| optarg | Search options. For example, you can specify the search mode in grn_search_optarg::mode. If GRN_OP_EQUAL is specified for grn_search_optarg::mode, it searching for equal record. |
obj is NULL. | GRN_API grn_rc grn_obj_set_element_info | ( | grn_ctx * | ctx, |
| grn_obj * | obj, | ||
| grn_id | id, | ||
| grn_info_type | type, | ||
| grn_obj * | value | ||
| ) |
Set information on the record with the ID in the object.
| ctx | The context object. |
| obj | The target object. |
| id | The target ID. |
| type | The type of information. |
| value | The value to set. |
| GRN_API grn_rc grn_obj_set_finalizer | ( | grn_ctx * | ctx, |
| grn_obj * | obj, | ||
| grn_proc_func * | func | ||
| ) |
Set the callback function when finalizing the object.
| ctx | The context object. |
| obj | Target object. Table, table cursor, column, procedure, and expression can be specified. |
| func | Callback function when finalizing. |
obj is not table, table cursor, column, procedure, or expression. | GRN_API grn_rc grn_obj_set_info | ( | grn_ctx * | ctx, |
| grn_obj * | obj, | ||
| grn_info_type | type, | ||
| grn_obj * | value | ||
| ) |
Set information on the object.
| ctx | The context object. |
| obj | The target object. |
| type | The type of information. |
| value | The value to set. |
obj is NULL. | GRN_API grn_rc grn_obj_set_value | ( | grn_ctx * | ctx, |
| grn_obj * | obj, | ||
| grn_id | id, | ||
| grn_obj * | value, | ||
| int | flags | ||
| ) |
Update the value of a record identified by the given ID in the specified object.
This function updates the value of the record specified by id in the given object (obj). If the corresponding record does not exist, it returns GRN_INVALID_ARGUMENT.
| ctx | The context object. |
| obj | The target object where the value will be updated. |
| id | The ID of the record to be updated. |
| value | The value to be stored in the record. |
| flags | Only one flag can be specified, depending on the type of the object (obj).
|
Unlink an object.
This calls grn_obj_close only when the specified object (obj) can be closed. See the following description for details.
Reference Count Mode:
Reference count mode manages object lifetimes by keeping track of active references. It can be enabled in two ways:
GRN_ENABLE_REFERENCE_COUNT to yes before running the program.Non reference count mode:
This is the default. You can disable reference count mode explicitly by GRN_ENABLE_REFERENCE_COUNT=no environment variable.
The following objects are closed immediately:
Other objects such as persisted tables and columns are not closed.
Reference count mode:
You need to enable this explicitly by GRN_ENABLE_REFERENCE_COUNT=yes environment variable.
The following objects are closed immediately:
The reference count is decreased for the following objects:
If the reference count reaches zero, the object is closed.
| ctx | The context object. |
| obj | The object to be unlinked and freed from memory. |
Unlock an object.
Unlike grn_obj_clear_lock, which forcefully resets the lock count to zero, this function decrements the lock count of an object by one.
| ctx | The context object. |
| obj | The target object to unlock. |
| id | The ID of the target object. |
| GRN_API grn_user_data * grn_obj_user_data | ( | grn_ctx * | ctx, |
| grn_obj * | obj | ||
| ) |
Returns a pointer to user data that can be registered in the object.
| ctx | The context object |
| obj | Only table, column, proc, and expr can be specified |
| GRN_API const char * grn_plugin_get_ruby_suffix | ( | void | ) |
| GRN_API const char * grn_plugin_get_suffix | ( | void | ) |
| GRN_API const char * grn_plugin_get_system_plugins_dir | ( | void | ) |
| GRN_API bool grn_query_log_flags_parse | ( | const char * | string, |
| int | string_size, | ||
| unsigned int * | flags | ||
| ) |
| GRN_API void grn_query_logger_put | ( | grn_ctx * | ctx, |
| unsigned int | flag, | ||
| const char * | mark, | ||
| const char * | format, | ||
| ... | |||
| ) |
| GRN_API grn_rc grn_query_logger_set | ( | grn_ctx * | ctx, |
| const grn_query_logger * | logger | ||
| ) |
| GRN_API grn_rc grn_set_default_command_version | ( | grn_command_version | version | ) |
Set default command version.
| version | New command version |
| GRN_API grn_rc grn_set_default_encoding | ( | grn_encoding | encoding | ) |
Set the default encoding.
| encoding | New encoding |
Set the default threshold to determine whether search strategy escalation is used or not.
| threshold | New default threshold. |
Set the lock timeout used during write operations.
Special cases for the timeout parameter:
timeout is 0, Groonga will attempt to acquire the lock only once. If it fails, it will not retry and the operation will fail immediately without waiting for the lock to be released.timeout is negative value, Groonga will wait forever for retrying to acquire the lock without any timeout until it succeeds.The default lock timeout is 900,000 milliseconds (15 minutes).
Lock Timeout Configuration:
Lock timeout can be configured in two ways:
-DGRN_LOCK_TIMEOUT=<milliseconds> when configuring the build with CMake to specify a default lock timeout by milliseconds.| timeout | The new lock timeout in milliseconds. |
| GRN_API grn_rc grn_snip_add_cond | ( | grn_ctx * | ctx, |
| grn_obj * | snip, | ||
| const char * | keyword, | ||
| unsigned int | keyword_len, | ||
| const char * | opentag, | ||
| unsigned int | opentag_len, | ||
| const char * | closetag, | ||
| unsigned int | closetag_len | ||
| ) |
| GRN_API grn_rc grn_snip_exec | ( | grn_ctx * | ctx, |
| grn_obj * | snip, | ||
| const char * | string, | ||
| unsigned int | string_len, | ||
| unsigned int * | nresults, | ||
| unsigned int * | max_tagged_len | ||
| ) |
| GRN_API const char * grn_snip_get_delimiter_regexp | ( | grn_ctx * | ctx, |
| grn_obj * | snip, | ||
| size_t * | pattern_length | ||
| ) |
| GRN_API grn_rc grn_snip_get_result | ( | grn_ctx * | ctx, |
| grn_obj * | snip, | ||
| const unsigned int | index, | ||
| char * | result, | ||
| unsigned int * | result_len | ||
| ) |
| GRN_API grn_obj * grn_snip_open | ( | grn_ctx * | ctx, |
| int | flags, | ||
| unsigned int | width, | ||
| unsigned int | max_results, | ||
| const char * | defaultopentag, | ||
| unsigned int | defaultopentag_len, | ||
| const char * | defaultclosetag, | ||
| unsigned int | defaultclosetag_len, | ||
| grn_snip_mapping * | mapping | ||
| ) |
| GRN_API grn_rc grn_snip_set_delimiter_regexp | ( | grn_ctx * | ctx, |
| grn_obj * | snip, | ||
| const char * | pattern, | ||
| int | pattern_length | ||
| ) |
| GRN_API grn_rc grn_text_printfv | ( | grn_ctx * | ctx, |
| grn_obj * | bulk, | ||
| const char * | format, | ||
| va_list | args | ||
| ) |
| GRN_API const char * grn_text_urldec | ( | grn_ctx * | ctx, |
| grn_obj * | buf, | ||
| const char * | s, | ||
| const char * | e, | ||
| char | d | ||
| ) |
| GRN_API grn_rc grn_text_vprintf | ( | grn_ctx * | ctx, |
| grn_obj * | bulk, | ||
| const char * | format, | ||
| va_list | args | ||
| ) |