Groonga
Loading...
Searching...
No Matches
proc.h File Reference
#include <groonga.h>
Include dependency graph for proc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef grn_rc(* grn_proc_option_value_parse_func) (grn_ctx *ctx, const char *name, grn_obj *value, const char *tag, void *user_data)
 

Enumerations

enum  grn_proc_type {
  GRN_PROC_INVALID = 0 , GRN_PROC_TOKENIZER , GRN_PROC_COMMAND , GRN_PROC_FUNCTION ,
  GRN_PROC_HOOK , GRN_PROC_NORMALIZER , GRN_PROC_TOKEN_FILTER , GRN_PROC_SCORER ,
  GRN_PROC_WINDOW_FUNCTION , GRN_PROC_AGGREGATOR , GRN_PROC_EXTRACTOR
}
 
enum  grn_proc_option_value_type {
  GRN_PROC_OPTION_VALUE_RAW , GRN_PROC_OPTION_VALUE_MODE , GRN_PROC_OPTION_VALUE_OPERATOR , GRN_PROC_OPTION_VALUE_EXPR_FLAGS ,
  GRN_PROC_OPTION_VALUE_INT32 , GRN_PROC_OPTION_VALUE_UINT32 , GRN_PROC_OPTION_VALUE_INT64 , GRN_PROC_OPTION_VALUE_BOOL ,
  GRN_PROC_OPTION_VALUE_FUNC , GRN_PROC_OPTION_VALUE_TOKENIZE_MODE , GRN_PROC_OPTION_VALUE_TOKEN_CURSOR_FLAGS , GRN_PROC_OPTION_VALUE_DOUBLE ,
  GRN_PROC_OPTION_VALUE_RAW_STRING
}
 

Functions

GRN_API grn_objgrn_proc_create (grn_ctx *ctx, const char *name, int name_size, grn_proc_type type, grn_proc_func *init, grn_proc_func *next, grn_proc_func *fin, unsigned int nvars, grn_expr_var *vars)
 Create the procedure in the database handled by ctx.
 
GRN_API grn_objgrn_proc_get_info (grn_ctx *ctx, grn_user_data *user_data, grn_expr_var **vars, unsigned int *nvars, grn_obj **caller)
 Get information on procedure and expression that use user_data.
 
GRN_API grn_proc_type grn_proc_get_type (grn_ctx *ctx, grn_obj *proc)
 
GRN_API grn_rc grn_proc_prefixed_options_parse (grn_ctx *ctx, grn_obj *options, const char *prefix, const char *tag, const char *name,...)
 
GRN_API grn_rc grn_proc_prefixed_options_parsev (grn_ctx *ctx, grn_obj *options, const char *prefix, const char *tag, const char *name, va_list args)
 
GRN_API grn_rc grn_proc_options_parse (grn_ctx *ctx, grn_obj *options, const char *tag, const char *name,...)
 
GRN_API grn_rc grn_proc_options_parsev (grn_ctx *ctx, grn_obj *options, const char *tag, const char *name, va_list args)
 
GRN_API grn_rc grn_proc_func_generate_cache_key (grn_ctx *ctx, const char *function_name, grn_obj **args, int n_args, grn_obj *cache_key)
 

Typedef Documentation

◆ grn_proc_option_value_parse_func

typedef grn_rc(* grn_proc_option_value_parse_func) (grn_ctx *ctx, const char *name, grn_obj *value, const char *tag, void *user_data)

Enumeration Type Documentation

◆ grn_proc_option_value_type

Enumerator
GRN_PROC_OPTION_VALUE_RAW 
GRN_PROC_OPTION_VALUE_MODE 
GRN_PROC_OPTION_VALUE_OPERATOR 
GRN_PROC_OPTION_VALUE_EXPR_FLAGS 
GRN_PROC_OPTION_VALUE_INT32 
GRN_PROC_OPTION_VALUE_UINT32 
GRN_PROC_OPTION_VALUE_INT64 
GRN_PROC_OPTION_VALUE_BOOL 
GRN_PROC_OPTION_VALUE_FUNC 
GRN_PROC_OPTION_VALUE_TOKENIZE_MODE 
GRN_PROC_OPTION_VALUE_TOKEN_CURSOR_FLAGS 
GRN_PROC_OPTION_VALUE_DOUBLE 
GRN_PROC_OPTION_VALUE_RAW_STRING 

◆ grn_proc_type

Enumerator
GRN_PROC_INVALID 
GRN_PROC_TOKENIZER 
GRN_PROC_COMMAND 
GRN_PROC_FUNCTION 
GRN_PROC_HOOK 
GRN_PROC_NORMALIZER 
GRN_PROC_TOKEN_FILTER 
GRN_PROC_SCORER 
GRN_PROC_WINDOW_FUNCTION 
GRN_PROC_AGGREGATOR 
GRN_PROC_EXTRACTOR 

Function Documentation

◆ grn_proc_create()

GRN_API grn_obj * grn_proc_create ( grn_ctx ctx,
const char *  name,
int  name_size,
grn_proc_type  type,
grn_proc_func init,
grn_proc_func next,
grn_proc_func fin,
unsigned int  nvars,
grn_expr_var vars 
)

Create the procedure in the database handled by ctx.

Parameters
ctxThe context object.
nameName of procedure.
name_sizeThe number of bytes of name parameter. If negative value is specified, name parameter is assumed that NULL-terminated string.
typeType of procedure.
initInitialization callback function.
nextMain callback function.
finFinalization callback function.
nvarsThe number of vars.
varsVariables used in callback functions.
Returns
The procedure object on success, NULL on error.

◆ grn_proc_func_generate_cache_key()

GRN_API grn_rc grn_proc_func_generate_cache_key ( grn_ctx ctx,
const char *  function_name,
grn_obj **  args,
int  n_args,
grn_obj cache_key 
)

◆ grn_proc_get_info()

GRN_API grn_obj * grn_proc_get_info ( grn_ctx ctx,
grn_user_data user_data,
grn_expr_var **  vars,
unsigned int *  nvars,
grn_obj **  caller 
)

Get information on procedure and expression that use user_data.

Parameters
ctxThe context object.
user_dataThe user data passed to grn_proc_func.
varsThe buffer to store defined variables.
nvarsThe buffer to store the number of vars.
callerThe buffer to store calling expression.
Returns
The procedure object. It may be NULL.

◆ grn_proc_get_type()

GRN_API grn_proc_type grn_proc_get_type ( grn_ctx ctx,
grn_obj proc 
)

◆ grn_proc_options_parse()

GRN_API grn_rc grn_proc_options_parse ( grn_ctx ctx,
grn_obj options,
const char *  tag,
const char *  name,
  ... 
)

◆ grn_proc_options_parsev()

GRN_API grn_rc grn_proc_options_parsev ( grn_ctx ctx,
grn_obj options,
const char *  tag,
const char *  name,
va_list  args 
)

◆ grn_proc_prefixed_options_parse()

GRN_API grn_rc grn_proc_prefixed_options_parse ( grn_ctx ctx,
grn_obj options,
const char *  prefix,
const char *  tag,
const char *  name,
  ... 
)

◆ grn_proc_prefixed_options_parsev()

GRN_API grn_rc grn_proc_prefixed_options_parsev ( grn_ctx ctx,
grn_obj options,
const char *  prefix,
const char *  tag,
const char *  name,
va_list  args 
)