30#define GRN_PLUGIN_IMPL_NAME_RAW(type) grn_plugin_impl_##type
31#define GRN_PLUGIN_IMPL_NAME_TAGGED(type, tag) \
32 GRN_PLUGIN_IMPL_NAME_RAW(type##_##tag)
33#define GRN_PLUGIN_IMPL_NAME_TAGGED_EXPANDABLE(type, tag) \
34 GRN_PLUGIN_IMPL_NAME_TAGGED(type, tag)
36#ifdef GRN_PLUGIN_FUNCTION_TAG
37# define GRN_PLUGIN_IMPL_NAME(type) \
38 GRN_PLUGIN_IMPL_NAME_TAGGED_EXPANDABLE(type, GRN_PLUGIN_FUNCTION_TAG)
40# define GRN_PLUGIN_IMPL_NAME(type) GRN_PLUGIN_IMPL_NAME_RAW(type)
43#define GRN_PLUGIN_INIT GRN_PLUGIN_IMPL_NAME(init)
44#define GRN_PLUGIN_REGISTER GRN_PLUGIN_IMPL_NAME(register)
45#define GRN_PLUGIN_FIN GRN_PLUGIN_IMPL_NAME(fin)
47#if defined(_WIN32) || defined(_WIN64)
48# define GRN_PLUGIN_EXPORT __declspec(dllexport)
50# define GRN_PLUGIN_EXPORT
60#define GRN_PLUGIN_DECLARE_FUNCTIONS(tag) \
61 extern grn_rc GRN_PLUGIN_IMPL_NAME_TAGGED(init, tag)(grn_ctx * ctx); \
62 extern grn_rc GRN_PLUGIN_IMPL_NAME_TAGGED(register, tag)(grn_ctx * ctx); \
63 extern grn_rc GRN_PLUGIN_IMPL_NAME_TAGGED(fin, tag)(grn_ctx * ctx)
71 grn_ctx *ctx,
size_t size,
const char *file,
int line,
const char *func)
75 grn_ctx *ctx,
size_t size,
const char *file,
int line,
const char *func)
86 grn_ctx *ctx,
void *ptr,
const char *file,
int line,
const char *func);
88#define GRN_PLUGIN_MALLOC(ctx, size) \
89 grn_plugin_malloc((ctx), (size), __FILE__, __LINE__, __FUNCTION__)
90#define GRN_PLUGIN_MALLOCN(ctx, type, n) \
91 ((type *)(grn_plugin_malloc((ctx), \
96#define GRN_PLUGIN_CALLOC(ctx, size) \
97 grn_plugin_calloc((ctx), (size), __FILE__, __LINE__, __FUNCTION__)
98#define GRN_PLUGIN_REALLOC(ctx, ptr, size) \
99 grn_plugin_realloc((ctx), (ptr), (size), __FILE__, __LINE__, __FUNCTION__)
100#define GRN_PLUGIN_FREE(ctx, ptr) \
101 grn_plugin_free((ctx), (ptr), __FILE__, __LINE__, __FUNCTION__)
103#define GRN_PLUGIN_LOG(ctx, level, ...) GRN_LOG((ctx), (level), __VA_ARGS__)
134#define GRN_PLUGIN_SET_ERROR(ctx, level, error_code, ...) \
136 grn_plugin_set_error(ctx, \
145#define GRN_PLUGIN_ERROR(ctx, error_code, ...) \
146 GRN_PLUGIN_SET_ERROR(ctx, GRN_LOG_ERROR, error_code, __VA_ARGS__)
148#define GRN_PLUGIN_CLEAR_ERROR(ctx) \
150 grn_plugin_clear_error((ctx)); \
198 unsigned char flags);
219 int32_t default_value);
225 double default_value);
269 unsigned int offset);
283 unsigned int str_length,
289 unsigned int str_length,
314 int32_t default_value_raw,
319 int64_t default_value_raw,
324 double default_value_raw,
grn_rc
Definition groonga.h:61
grn_obj * grn_proc_func(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
Definition groonga.h:346
uint32_t grn_id
Definition groonga.h:44
#define GRN_API
Definition groonga.h:39
grn_operator
Definition groonga.h:1149
grn_log_level
Definition groonga.h:192
#define GRN_ATTRIBUTE_PRINTF(fmt_pos)
Definition groonga.h:2426
grn_content_type
The input/output content format.
Definition groonga.h:225
#define GRN_ATTRIBUTE_ALLOC_SIZE(size)
Definition groonga.h:2443
grn_encoding
Definition groonga.h:163
GRN_API const char * grn_plugin_proc_get_var_string(grn_ctx *ctx, grn_user_data *user_data, const char *name, int name_size, size_t *size)
GRN_API void grn_plugin_set_error(grn_ctx *ctx, grn_log_level level, grn_rc error_code, const char *file, int line, const char *func, const char *format,...) GRN_ATTRIBUTE_PRINTF(7)
GRN_API int grn_plugin_isspace(grn_ctx *ctx, const char *str_ptr, unsigned int str_length, grn_encoding encoding)
GRN_API int32_t grn_plugin_proc_get_value_int32(grn_ctx *ctx, grn_obj *value, int32_t default_value_raw, const char *tag)
GRN_API void grn_plugin_backtrace(grn_ctx *ctx)
#define GRN_PLUGIN_FIN
Definition plugin.h:45
GRN_API grn_obj * grn_plugin_proc_get_var(grn_ctx *ctx, grn_user_data *user_data, const char *name, int name_size)
#define GRN_PLUGIN_EXPORT
Definition plugin.h:50
GRN_API grn_operator grn_plugin_proc_get_value_operator(grn_ctx *ctx, grn_obj *value, grn_operator default_oeprator, const char *tag)
#define GRN_PLUGIN_REGISTER
Definition plugin.h:44
GRN_API void grn_plugin_mutex_unlock(grn_ctx *ctx, grn_plugin_mutex *mutex)
GRN_API void grn_plugin_mutex_destroy(grn_ctx *ctx, grn_plugin_mutex *mutex)
GRN_API grn_obj * grn_plugin_proc_get_vars(grn_ctx *ctx, grn_user_data *user_data)
GRN_API void grn_plugin_mutex_lock(grn_ctx *ctx, grn_plugin_mutex *mutex)
GRN_API grn_obj * grn_plugin_command_create(grn_ctx *ctx, const char *name, int name_size, grn_proc_func func, unsigned int n_vars, grn_expr_var *vars)
GRN_API const char * grn_plugin_win32_base_dir(void)
GRN_API grn_obj * grn_plugin_proc_get_var_by_offset(grn_ctx *ctx, grn_user_data *user_data, unsigned int offset)
GRN_API void grn_plugin_mutex_close(grn_ctx *ctx, grn_plugin_mutex *mutex)
GRN_API void * grn_plugin_calloc(grn_ctx *ctx, size_t size, const char *file, int line, const char *func) GRN_ATTRIBUTE_ALLOC_SIZE(2)
GRN_API const char * grn_plugin_windows_base_dir(void)
GRN_API void grn_plugin_free(grn_ctx *ctx, void *ptr, const char *file, int line, const char *func)
GRN_API grn_obj * grn_plugin_proc_get_caller(grn_ctx *ctx, grn_user_data *user_data)
GRN_API int32_t grn_plugin_proc_get_var_int32(grn_ctx *ctx, grn_user_data *user_data, const char *name, int name_size, int32_t default_value)
GRN_API grn_plugin_mutex * grn_plugin_mutex_open(grn_ctx *ctx)
Create a new object of grn_plugin_mutex.
GRN_API int64_t grn_plugin_proc_get_value_int64(grn_ctx *ctx, grn_obj *value, int64_t default_value_raw, const char *tag)
GRN_API grn_plugin_mutex * grn_plugin_mutex_create(grn_ctx *ctx)
GRN_API grn_content_type grn_plugin_proc_get_var_content_type(grn_ctx *ctx, grn_user_data *user_data, const char *name, int name_size, grn_content_type default_value)
GRN_API void * grn_plugin_realloc(grn_ctx *ctx, void *ptr, size_t size, const char *file, int line, const char *func) GRN_ATTRIBUTE_ALLOC_SIZE(3)
GRN_API double grn_plugin_proc_get_value_double(grn_ctx *ctx, grn_obj *value, double default_value_raw, const char *tag)
GRN_API void grn_plugin_logtrace(grn_ctx *ctx, grn_log_level level)
GRN_API int grn_plugin_charlen(grn_ctx *ctx, const char *str_ptr, unsigned int str_length, grn_encoding encoding)
struct _grn_plugin_mutex grn_plugin_mutex
Definition plugin.h:153
GRN_API grn_operator grn_plugin_proc_get_value_mode(grn_ctx *ctx, grn_obj *value, grn_operator default_mode, const char *tag)
GRN_API bool grn_plugin_proc_get_value_bool(grn_ctx *ctx, grn_obj *value, bool default_value, const char *tag)
GRN_API grn_rc grn_plugin_expr_var_init(grn_ctx *ctx, grn_expr_var *var, const char *name, int name_size)
#define GRN_PLUGIN_INIT
Definition plugin.h:43
GRN_API void grn_plugin_clear_error(grn_ctx *ctx)
GRN_API grn_obj * grn_plugin_proc_alloc(grn_ctx *ctx, grn_user_data *user_data, grn_id domain, unsigned char flags)
GRN_API void * grn_plugin_malloc(grn_ctx *ctx, size_t size, const char *file, int line, const char *func) GRN_ATTRIBUTE_ALLOC_SIZE(2)
GRN_API double grn_plugin_proc_get_var_double(grn_ctx *ctx, grn_user_data *user_data, const char *name, int name_size, double default_value)
GRN_API bool grn_plugin_proc_get_var_bool(grn_ctx *ctx, grn_user_data *user_data, const char *name, int name_size, bool default_value)
GRN_API grn_log_level grn_plugin_proc_get_var_log_level(grn_ctx *ctx, grn_user_data *user_data, const char *name, int name_size, grn_log_level default_value)
Get the specified command argument value as grn_log_level.
Definition groonga.h:1139