• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GRN_OBJ_FIN函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GRN_OBJ_FIN函数的典型用法代码示例。如果您正苦于以下问题:C++ GRN_OBJ_FIN函数的具体用法?C++ GRN_OBJ_FIN怎么用?C++ GRN_OBJ_FIN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GRN_OBJ_FIN函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: rb_grn_prefix_operator_exec

/*
 * Executes a prefix-search operation. Prefix-serach operation checks
 * whether `text` starts with `prefix` or not.
 *
 * @example Executes prefix-search operations with the default context
 *   Groonga::Operator::PREFIX.exec("Hello Rroonga", "Hello")   # => true
 *   Groonga::Operator::PREFIX.exec("Hello Rroonga", "Rroonga") # => false
 *
 * @example Executes prefix-search operations with the specified context
 *   context = Groonga::Context.new
 *   Groonga::Operator::PREFIX.exec("Hello Rroonga", "Hello",
 *                                  :context => context) # => true
 *   Groonga::Operator::PREFIX.exec("Hello Rroonga", "Rroonga",
 *                                  :context => context) # => false
 *
 * @overload exec(text, prefix, options={})
 *   @param text [String] The text to be searched.
 *   @param prefix [String] The prefix to be contained.
 *   @param options [::Hash] The options.
 *   @option options [Groonga::Context] (Groonga::Context.default)
 *      The context to executes the operation.
 *   @return [Boolean] `true` if `text` starts with `prefix`, `false`
 *      otherwise.
 */
static VALUE
rb_grn_prefix_operator_exec (int argc, VALUE *argv, VALUE self)
{
    grn_bool have_prefix;
    VALUE rb_text;
    VALUE rb_prefix;
    VALUE rb_options;
    VALUE rb_context;
    grn_ctx *context;
    grn_obj text;
    grn_obj prefix;

    rb_scan_args(argc, argv, "21", &rb_text, &rb_prefix, &rb_options);

    rb_grn_scan_options(rb_options,
                        "context", &rb_context,
                        NULL);
    context = rb_grn_context_ensure(&rb_context);

    GRN_VOID_INIT(&text);
    GRN_VOID_INIT(&prefix);
    RVAL2GRNBULK(rb_text, context, &text);
    RVAL2GRNBULK(rb_prefix, context, &prefix);
    have_prefix = grn_operator_exec_prefix(context, &text, &prefix);
    GRN_OBJ_FIN(context, &text);
    GRN_OBJ_FIN(context, &prefix);

    return CBOOL2RVAL(have_prefix);
}
开发者ID:genki,项目名称:rroonga,代码行数:53,代码来源:rb-grn-prefix-operator.c


示例2: report_set_column_value_failure

static void
report_set_column_value_failure(grn_ctx *ctx,
                                grn_obj *key,
                                const char *column_name,
                                unsigned int column_name_size,
                                grn_obj *column_value)
{
  grn_obj key_inspected, column_value_inspected;

  GRN_TEXT_INIT(&key_inspected, 0);
  GRN_TEXT_INIT(&column_value_inspected, 0);
  grn_inspect_limited(ctx, &key_inspected, key);
  grn_inspect_limited(ctx, &column_value_inspected, column_value);
  GRN_LOG(ctx, GRN_LOG_ERROR,
          "[table][load] failed to set column value: %s: "
          "key: <%.*s>, column: <%.*s>, value: <%.*s>",
          ctx->errbuf,
          (int)GRN_TEXT_LEN(&key_inspected),
          GRN_TEXT_VALUE(&key_inspected),
          column_name_size,
          column_name,
          (int)GRN_TEXT_LEN(&column_value_inspected),
          GRN_TEXT_VALUE(&column_value_inspected));
  GRN_OBJ_FIN(ctx, &key_inspected);
  GRN_OBJ_FIN(ctx, &column_value_inspected);
}
开发者ID:cosmo0920,项目名称:groonga,代码行数:26,代码来源:load.c


示例3: rb_grn_less_operator_exec

/*
 * Executes a less operation.
 *
 * @example Executes less operations with the default context
 *   Groonga::Operator::LESS.exec(1, 2) # => true
 *   Groonga::Operator::LESS.exec(2, 1) # => false
 *
 * @example Executes less operations with the specified context
 *   context = Groonga::Context.new
 *   Groonga::Operator::LESS.exec(1, 2,
 *                                :context => context) # => true
 *   Groonga::Operator::LESS.exec(2, 1,
 *                                :context => context) # => false
 *
 * @overload exec(x, y, options={})
 *   @param x [::Object] The left hand side value.
 *   @param y [::Object] The right hand side value.
 *   @param options [::Hash] The options.
 *   @option options [Groonga::Context] (Groonga::Context.default)
 *      The context to executes the operation.
 *   @return [Boolean] `true` if `x` is less than `y`, `false`
 *      otherwise.
 */
static VALUE
rb_grn_less_operator_exec (int argc, VALUE *argv, VALUE self)
{
    grn_bool less;
    VALUE rb_x;
    VALUE rb_y;
    VALUE rb_options;
    VALUE rb_context;
    grn_ctx *context;
    grn_obj x;
    grn_obj y;

    rb_scan_args(argc, argv, "21", &rb_x, &rb_y, &rb_options);

    rb_grn_scan_options(rb_options,
                        "context", &rb_context,
                        NULL);
    context = rb_grn_context_ensure(&rb_context);

    GRN_VOID_INIT(&x);
    GRN_VOID_INIT(&y);
    RVAL2GRNBULK(rb_x, context, &x);
    RVAL2GRNBULK(rb_y, context, &y);
    less = grn_operator_exec_less(context, &x, &y);
    GRN_OBJ_FIN(context, &x);
    GRN_OBJ_FIN(context, &y);

    return CBOOL2RVAL(less);
}
开发者ID:genki,项目名称:rroonga,代码行数:52,代码来源:rb-grn-less-operator.c


示例4: GRN_OBJ_FIN

 Buffers::~Buffers() {
   for (size_t i = 0; i < n_; ++i) {
     grn_obj *buffer = (*this)[i];
     GRN_OBJ_FIN(ctx_, buffer);
   }
   GRN_OBJ_FIN(ctx_, &buffers_);
 }
开发者ID:kenhys,项目名称:mroonga,代码行数:7,代码来源:mrn_buffers.cpp


示例5: grn_rset_recinfo_update_calc_values

void
grn_rset_recinfo_update_calc_values(grn_ctx *ctx,
                                    grn_rset_recinfo *ri,
                                    grn_obj *table,
                                    grn_obj *value)
{
  grn_table_group_flags flags;
  byte *values;
  grn_obj value_int64;
  grn_obj value_float;

  flags = DB_OBJ(table)->flags.group;

  values = (((byte *)ri->subrecs) +
            GRN_RSET_SUBRECS_SIZE(DB_OBJ(table)->subrec_size,
                                  DB_OBJ(table)->max_n_subrecs));

  GRN_INT64_INIT(&value_int64, 0);
  GRN_FLOAT_INIT(&value_float, 0);

  if (flags & (GRN_TABLE_GROUP_CALC_MAX |
               GRN_TABLE_GROUP_CALC_MIN |
               GRN_TABLE_GROUP_CALC_SUM)) {
    grn_obj_cast(ctx, value, &value_int64, GRN_FALSE);
  }
  if (flags & GRN_TABLE_GROUP_CALC_AVG) {
    grn_obj_cast(ctx, value, &value_float, GRN_FALSE);
  }

  if (flags & GRN_TABLE_GROUP_CALC_MAX) {
    int64_t current_max = *((int64_t *)values);
    int64_t value_raw = GRN_INT64_VALUE(&value_int64);
    if (ri->n_subrecs == 1 || value_raw > current_max) {
      *((int64_t *)values) = value_raw;
    }
    values += GRN_RSET_MAX_SIZE;
  }
  if (flags & GRN_TABLE_GROUP_CALC_MIN) {
    int64_t current_min = *((int64_t *)values);
    int64_t value_raw = GRN_INT64_VALUE(&value_int64);
    if (ri->n_subrecs == 1 || value_raw < current_min) {
      *((int64_t *)values) = value_raw;
    }
    values += GRN_RSET_MIN_SIZE;
  }
  if (flags & GRN_TABLE_GROUP_CALC_SUM) {
    int64_t value_raw = GRN_INT64_VALUE(&value_int64);
    *((int64_t *)values) += value_raw;
    values += GRN_RSET_SUM_SIZE;
  }
  if (flags & GRN_TABLE_GROUP_CALC_AVG) {
    double current_average = *((double *)values);
    double value_raw = GRN_FLOAT_VALUE(&value_float);
    *((double *)values) += (value_raw - current_average) / ri->n_subrecs;
    values += GRN_RSET_AVG_SIZE;
  }

  GRN_OBJ_FIN(ctx, &value_float);
  GRN_OBJ_FIN(ctx, &value_int64);
}
开发者ID:AkioKanno,项目名称:groonga,代码行数:60,代码来源:rset.c


示例6: parse_id_value

static grn_id
parse_id_value(grn_ctx *ctx, grn_obj *value)
{
  switch (value->header.type) {
  case GRN_DB_UINT32 :
    return GRN_UINT32_VALUE(value);
  case GRN_DB_INT32 :
    return GRN_INT32_VALUE(value);
  default :
    {
      grn_id id = GRN_ID_NIL;
      grn_obj casted_value;
      GRN_UINT32_INIT(&casted_value, 0);
      if (grn_obj_cast(ctx, value, &casted_value, GRN_FALSE) != GRN_SUCCESS) {
        grn_obj inspected;
        GRN_TEXT_INIT(&inspected, 0);
        grn_inspect(ctx, &inspected, value);
        ERR(GRN_INVALID_ARGUMENT,
            "<%s>: failed to cast to <UInt32>: <%.*s>",
            GRN_COLUMN_NAME_ID,
            (int)GRN_TEXT_LEN(&inspected),
            GRN_TEXT_VALUE(&inspected));
        GRN_OBJ_FIN(ctx, &inspected);
      } else {
        id = GRN_UINT32_VALUE(&casted_value);
      }
      GRN_OBJ_FIN(ctx, &casted_value);
      return id;
    }
  }
}
开发者ID:cosmo0920,项目名称:groonga,代码行数:31,代码来源:load.c


示例7: load_synonyms

static void
load_synonyms(grn_ctx *ctx)
{
  static char path_env[GRN_ENV_BUFFER_SIZE];
  const char *path;
  grn_file_reader *file_reader;
  int number_of_lines;
  grn_encoding encoding;
  grn_obj line, key, value;

  grn_getenv("GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE",
             path_env,
             GRN_ENV_BUFFER_SIZE);
  if (path_env[0]) {
    path = path_env;
  } else {
    path = get_system_synonyms_file();
  }
  file_reader = grn_file_reader_open(ctx, path);
  if (!file_reader) {
    GRN_LOG(ctx, GRN_LOG_WARNING,
            "[plugin][query-expander][tsv] "
            "synonyms file doesn't exist: <%s>",
            path);
    return;
  }

  GRN_TEXT_INIT(&line, 0);
  GRN_TEXT_INIT(&key, 0);
  GRN_TEXT_INIT(&value, 0);
  grn_bulk_reserve(ctx, &value, MAX_SYNONYM_BYTES);
  number_of_lines = 0;
  while (grn_file_reader_read_line(ctx, file_reader, &line) == GRN_SUCCESS) {
    const char *line_value = GRN_TEXT_VALUE(&line);
    size_t line_length = GRN_TEXT_LEN(&line);

    if (line_length > 0 && line_value[line_length - 1] == '\n') {
      if (line_length > 1 && line_value[line_length - 2] == '\r') {
        line_length -= 2;
      } else {
        line_length -= 1;
      }
    }
    number_of_lines++;
    if (number_of_lines == 1) {
      encoding = guess_encoding(ctx, &line_value, &line_length);
    }
    GRN_BULK_REWIND(&key);
    GRN_BULK_REWIND(&value);
    parse_synonyms_file_line(ctx, line_value, line_length, &key, &value);
    GRN_BULK_REWIND(&line);
  }
  GRN_OBJ_FIN(ctx, &line);
  GRN_OBJ_FIN(ctx, &key);
  GRN_OBJ_FIN(ctx, &value);

  grn_file_reader_close(ctx, file_reader);
}
开发者ID:cosmo0920,项目名称:groonga,代码行数:58,代码来源:tsv.c


示例8: grn_mrb_value_to_raw_data_buffer_fin

void
grn_mrb_value_to_raw_data_buffer_fin(mrb_state *mrb,
                                     grn_mrb_value_to_raw_data_buffer *buffer)
{
  grn_ctx *ctx = (grn_ctx *)mrb->ud;

  GRN_OBJ_FIN(ctx, &(buffer->from));
  GRN_OBJ_FIN(ctx, &(buffer->to));
}
开发者ID:AkioKanno,项目名称:groonga,代码行数:9,代码来源:mrb_converter.c


示例9: ngx_http_groonga_handler_cleanup

static void
ngx_http_groonga_handler_cleanup(void *user_data)
{
  ngx_http_groonga_handler_data_t *data = user_data;
  grn_ctx *context;

  context = &(data->context);
  GRN_OBJ_FIN(context, &(data->head));
  GRN_OBJ_FIN(context, &(data->body));
  GRN_OBJ_FIN(context, &(data->foot));
  grn_ctx_fin(context);
}
开发者ID:bossato,项目名称:groonga,代码行数:12,代码来源:ngx_http_groonga_module.c


示例10: grn_ctx_impl_mrb_fin

void
grn_ctx_impl_mrb_fin(grn_ctx *ctx)
{
  if (ctx->impl->mrb.state) {
    mrb_close(ctx->impl->mrb.state);
    ctx->impl->mrb.state = NULL;
    grn_hash_close(ctx, ctx->impl->mrb.checked_procs);
    grn_hash_close(ctx, ctx->impl->mrb.registered_plugins);
    GRN_OBJ_FIN(ctx, &(ctx->impl->mrb.buffer.from));
    GRN_OBJ_FIN(ctx, &(ctx->impl->mrb.buffer.to));
  }
}
开发者ID:tSU-RooT,项目名称:groonga,代码行数:12,代码来源:ctx_impl_mrb.c


示例11: ngx_http_groonga_handler_cleanup

static void
ngx_http_groonga_handler_cleanup(void *user_data)
{
  ngx_http_groonga_handler_data_t *data = user_data;

  if (!data->initialized) {
    return;
  }

  GRN_OBJ_FIN(context, &(data->typed.head));
  GRN_OBJ_FIN(context, &(data->typed.body));
  GRN_OBJ_FIN(context, &(data->typed.foot));
}
开发者ID:XLPE,项目名称:groonga,代码行数:13,代码来源:ngx_http_groonga_module.c


示例12: proc_column_create

static grn_obj *
proc_column_create(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
{
    uint32_t nvars;
    grn_obj *buf = args[0];
    grn_expr_var *vars;
    grn_proc_get_info(ctx, user_data, &vars, &nvars, NULL);
    if (nvars == 6) {
        grn_obj_flags flags = grn_atoi(GRN_TEXT_VALUE(&vars[2].value),
                                       GRN_BULK_CURR(&vars[2].value), NULL);
        grn_obj *column, *table = grn_ctx_get(ctx, GRN_TEXT_VALUE(&vars[0].value),
                                              GRN_TEXT_LEN(&vars[0].value));
        grn_obj *type = grn_ctx_get(ctx, GRN_TEXT_VALUE(&vars[3].value),
                                    GRN_TEXT_LEN(&vars[3].value));
        if (GRN_TEXT_LEN(&vars[1].value)) {
            flags |= GRN_OBJ_PERSISTENT;
        }
        column = grn_column_create(ctx, table,
                                   GRN_TEXT_VALUE(&vars[1].value),
                                   GRN_TEXT_LEN(&vars[1].value),
                                   NULL, flags, type);
        if (column) {
            if (GRN_TEXT_LEN(&vars[4].value)) {
                grn_obj sources, source_ids, **p, **pe;
                GRN_PTR_INIT(&sources, GRN_OBJ_VECTOR, GRN_ID_NIL);
                GRN_UINT32_INIT(&source_ids, GRN_OBJ_VECTOR);
                grn_obj_columns(ctx, type,
                                GRN_TEXT_VALUE(&vars[4].value),
                                GRN_TEXT_LEN(&vars[4].value),
                                &sources);
                p = (grn_obj **)GRN_BULK_HEAD(&sources);
                pe = (grn_obj **)GRN_BULK_CURR(&sources);
                while (p < pe) {
                    grn_id source_id = grn_obj_id(ctx, *p++);
                    if (source_id) {
                        GRN_UINT32_PUT(ctx, &source_ids, source_id);
                    }
                }
                if (GRN_BULK_VSIZE(&source_ids)) {
                    grn_obj_set_info(ctx, column, GRN_INFO_SOURCE, &source_ids);
                }
                GRN_OBJ_FIN(ctx, &source_ids);
                GRN_OBJ_FIN(ctx, &sources);
            }
            grn_obj_unlink(ctx, column);
        }
        GRN_TEXT_PUTS(ctx, buf, ctx->rc ? "false" : "true");
    }
    return buf;
}
开发者ID:hayamiz,项目名称:groonga,代码行数:50,代码来源:proc.c


示例13: rb_grn_vector_from_ruby_object

grn_obj *
rb_grn_vector_from_ruby_object (VALUE object, grn_ctx *context, grn_obj *vector)
{
    VALUE *values;
    grn_obj value;
    int i, n;

    if (vector)
	GRN_OBJ_INIT(vector, GRN_VECTOR, 0, GRN_ID_NIL);
    else
	vector = grn_obj_open(context, GRN_VECTOR, 0, 0);

    if (NIL_P(object))
	return vector;

    GRN_VOID_INIT(&value);
    n = RARRAY_LEN(object);
    values = RARRAY_PTR(object);
    for (i = 0; i < n; i++) {
	grn_obj *_value = &value;
	RVAL2GRNOBJ(values[i], context, &_value);
	grn_vector_add_element(context, vector,
			       GRN_BULK_HEAD(&value),
			       GRN_BULK_VSIZE(&value),
			       0,
			       value.header.domain);
    }
    GRN_OBJ_FIN(context, &value);

    return vector;
}
开发者ID:ryoqun,项目名称:rroonga,代码行数:31,代码来源:rb-grn-utils.c


示例14: mroonga_snippet_html_deinit

MRN_API void mroonga_snippet_html_deinit(UDF_INIT *init)
{
  MRN_DBUG_ENTER_FUNCTION();

  mrn_snippet_html_info *info =
    reinterpret_cast<mrn_snippet_html_info *>(init->ptr);
  if (!info) {
    DBUG_VOID_RETURN;
  }

  if (info->snippet) {
    grn_obj_close(info->ctx, info->snippet);
  }
  if (info->query_mode.used) {
    if (info->query_mode.default_column) {
      grn_obj_close(info->ctx, info->query_mode.default_column);
    }
    if (info->query_mode.table) {
      grn_obj_close(info->ctx, info->query_mode.table);
    }
  }
  GRN_OBJ_FIN(info->ctx, &(info->result));
  if (!info->use_shared_db) {
    grn_obj_close(info->ctx, info->db);
  }
  mrn_context_pool->release(info->ctx);
  my_free(info);

  DBUG_VOID_RETURN;
}
开发者ID:kenhys,项目名称:mroonga,代码行数:30,代码来源:mrn_udf_snippet_html.cpp


示例15: command_schema_output_token_filters

static void
command_schema_output_token_filters(grn_ctx *ctx)
{
  grn_obj token_filters;
  int i, n;

  GRN_PTR_INIT(&token_filters, GRN_OBJ_VECTOR, GRN_DB_OBJECT);

  grn_ctx_get_all_token_filters(ctx, &token_filters);

  grn_ctx_output_cstr(ctx, "token_filters");

  n = GRN_BULK_VSIZE(&token_filters) / sizeof(grn_obj *);
  grn_ctx_output_map_open(ctx, "token_filters", n);
  for (i = 0; i < n; i++) {
    grn_obj *token_filter;

    token_filter = GRN_PTR_VALUE_AT(&token_filters, i);

    command_schema_output_name(ctx, token_filter);

    grn_ctx_output_map_open(ctx, "token_filter", 1);

    grn_ctx_output_cstr(ctx, "name");
    command_schema_output_name(ctx, token_filter);

    grn_ctx_output_map_close(ctx);
  }
  grn_ctx_output_map_close(ctx);

  GRN_OBJ_FIN(ctx, &token_filters);
}
开发者ID:XLPE,项目名称:groonga,代码行数:32,代码来源:proc_schema.c


示例16: rb_grn_expression_inspect

/*
 * call-seq:
 *   _expression_.inspect -> String
 *
 * _expression_の中身を人に見やすい文字列で返す。
 */
static VALUE
rb_grn_expression_inspect (VALUE self)
{
    grn_ctx *context = NULL;
    grn_obj inspected;
    grn_obj *expression;
    VALUE rb_inspected;

    rb_grn_expression_deconstruct(SELF(self), &expression, &context,
                                  NULL, NULL,
                                  NULL, NULL, NULL);

    GRN_TEXT_INIT(&inspected, 0);
    GRN_TEXT_PUTS(context, &inspected, "#<Groonga::Expression ");
#ifdef WIN32
    GRN_TEXT_PUTS(context, &inspected, "(not supported on Windows)");
#else
    grn_expr_inspect(context, &inspected, expression);
#endif
    GRN_TEXT_PUTS(context, &inspected, ">");
    rb_inspected = rb_grn_context_rb_string_new(context,
						GRN_TEXT_VALUE(&inspected),
						GRN_TEXT_LEN(&inspected));
    GRN_OBJ_FIN(context, &inspected);

    return rb_inspected;
}
开发者ID:mallowlabs,项目名称:rroonga,代码行数:33,代码来源:rb-grn-expression.c


示例17: rb_grn_view_get_column_value

/*
 * Document-method: column_value
 *
 * call-seq:
 *   view.column_value(id, name) -> 値
 *
 * _view_の_id_に対応するカラム_name_の値を返す。
 */
static VALUE
rb_grn_view_get_column_value (VALUE self, VALUE rb_id, VALUE rb_name)
{
    VALUE rb_value = Qnil;
#ifdef WIN32
    rb_raise(rb_eNotImpError,
             "grn_obj_get_value_o() isn't available on Windows.");
#else
    RbGrnTable *rb_view;
    grn_ctx *context = NULL;
    grn_obj *view, *value, *accessor;
    grn_obj id;

    rb_view = SELF(self);
    rb_grn_table_deconstruct(rb_view, &view, &context,
                             NULL, NULL,
                             &value, NULL, NULL,
                             NULL);
    GRN_BULK_REWIND(value);
    GRN_TEXT_INIT(&id, 0);
    GRN_TEXT_PUT(context, &id, RSTRING_PTR(rb_id), RSTRING_LEN(rb_id));
    accessor = grn_obj_column(context, view,
                              RSTRING_PTR(rb_name), RSTRING_LEN(rb_name));
    grn_obj_get_value_o(context, accessor, &id, value);
    grn_obj_unlink(context, accessor);
    rb_value = GRNOBJ2RVAL(Qnil, context, value, self);
    GRN_OBJ_FIN(context, &id);
#endif

    return rb_value;
}
开发者ID:nobu,项目名称:rroonga,代码行数:39,代码来源:rb-grn-view.c


示例18: teardown

void
teardown (void)
{
  GRN_OBJ_FIN(&context, &buffer);
  grn_obj_close(&context, database);
  grn_ctx_fin(&context);
}
开发者ID:WEIC-DEV,项目名称:groonga,代码行数:7,代码来源:test-string.c


示例19: exec_match_uvector_bulk

static grn_bool
exec_match_uvector_bulk(grn_ctx *ctx, grn_obj *uvector, grn_obj *query)
{
  grn_bool matched = GRN_FALSE;
  unsigned int i, size;
  grn_obj element;
  unsigned int element_size;

  size = grn_uvector_size(ctx, uvector);
  element_size = grn_uvector_element_size(ctx, uvector);
  GRN_VALUE_FIX_SIZE_INIT(&element, 0, uvector->header.domain);
  for (i = 0; i < size; i++) {
    GRN_BULK_REWIND(&element);
    grn_bulk_write(ctx, &element,
                   GRN_BULK_HEAD(uvector) + (element_size * i),
                   element_size);
    if (grn_operator_exec_equal(ctx, &element, query)) {
      matched = GRN_TRUE;
      break;
    }
  }
  GRN_OBJ_FIN(ctx, &element);

  return matched;
}
开发者ID:groonga,项目名称:groonga,代码行数:25,代码来源:operator.c


示例20: command_schema_output_normalizers

static void
command_schema_output_normalizers(grn_ctx *ctx)
{
  grn_obj normalizers;
  unsigned int i, n;

  GRN_PTR_INIT(&normalizers, GRN_OBJ_VECTOR, GRN_DB_OBJECT);

  grn_ctx_get_all_normalizers(ctx, &normalizers);

  grn_ctx_output_cstr(ctx, "normalizers");

  n = GRN_BULK_VSIZE(&normalizers) / sizeof(grn_obj *);
  grn_ctx_output_map_open(ctx, "normalizers", n);
  for (i = 0; i < n; i++) {
    grn_obj *normalizer;

    normalizer = GRN_PTR_VALUE_AT(&normalizers, i);

    command_schema_output_name(ctx, normalizer);

    grn_ctx_output_map_open(ctx, "normalizer", 1);

    grn_ctx_output_cstr(ctx, "name");
    command_schema_output_name(ctx, normalizer);

    grn_ctx_output_map_close(ctx);
  }
  grn_ctx_output_map_close(ctx);

  GRN_OBJ_FIN(ctx, &normalizers);
}
开发者ID:XLPE,项目名称:groonga,代码行数:32,代码来源:proc_schema.c



注:本文中的GRN_OBJ_FIN函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GRN_TEXT_INIT函数代码示例发布时间:2022-05-30
下一篇:
C++ GRN_FREE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap