Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Functions | Variables
proc.c File Reference
#include "proc.h"
#include "ii.h"
#include "db.h"
#include "util.h"
#include "output.h"
#include "pat.h"
#include "geo.h"
#include "token.h"
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/stat.h>
Include dependency graph for proc.c:

Go to the source code of this file.

Data Structures

struct  grn_substitute_term_by_column_data
struct  tokenize_token

Macros

#define O_NOFOLLOW   0
#define O_BINARY   0
#define VAR   GRN_PROC_GET_VAR_BY_OFFSET
#define GRN_SELECT_INTERNAL_VAR_CONDITION   "$condition"
#define GRN_SELECT_INTERNAL_VAR_MATCH_COLUMNS   "$match_columns"
#define DEFAULT_LIMIT   10
#define DEFAULT_OUTPUT_COLUMNS   "_id, _key, *"
#define DEFAULT_DRILLDOWN_LIMIT   10
#define DEFAULT_DRILLDOWN_OUTPUT_COLUMNS   "_key, _nsubrecs"
#define DUMP_COLUMNS   "_id, _key, _value, *"
#define CHECK_EXPR_FLAG(name)
#define GRN_EXPR_NONE   0
#define GRN_STRLEN(s)   ((s) ? strlen(s) : 0)
#define GRN_PTR_POP(obj, value)
#define CHECK_FLAG(name)
#define GRN_STRING_NONE   0
#define CHECK_FLAG(name)
#define GRN_TOKEN_NONE   0
#define COMPARE_AND_RETURN(type, value1, value2)
#define DIST(ox, oy)   (dists[((lx + 1) * (oy)) + (ox)])
#define DEF_VAR(v, name_str)
#define DEF_COMMAND(name, func, nvars, vars)

Typedefs

typedef grn_rc(* grn_substitute_term_func )(grn_ctx *ctx, const char *term, unsigned int term_len, grn_obj *substituted_term, grn_user_data *user_data)

Functions

grn_rc grn_select (grn_ctx *ctx, const char *table, unsigned int table_len, const char *match_columns, unsigned int match_columns_len, const char *query, unsigned int query_len, const char *filter, unsigned int filter_len, const char *scorer, unsigned int scorer_len, const char *sortby, unsigned int sortby_len, const char *output_columns, unsigned int output_columns_len, int offset, int limit, const char *drilldown, unsigned int drilldown_len, const char *drilldown_sortby, unsigned int drilldown_sortby_len, const char *drilldown_output_columns, unsigned int drilldown_output_columns_len, int drilldown_offset, int drilldown_limit, const char *cache, unsigned int cache_len, const char *match_escalation_threshold, unsigned int match_escalation_threshold_len, const char *query_expander, unsigned int query_expander_len, const char *query_flags, unsigned int query_flags_len)
void grn_ii_buffer_check (grn_ctx *ctx, grn_ii *ii, uint32_t seg)
void grn_db_init_builtin_query (grn_ctx *ctx)

Variables

const char * grn_document_root = NULL

Macro Definition Documentation

#define CHECK_EXPR_FLAG (   name)
Value:
if (((query_flags_end - query_flags) >= (sizeof(#name) - 1)) &&\
(!memcmp(query_flags, #name, sizeof(#name) - 1))) {\
flags |= GRN_EXPR_ ## name;\
query_flags += sizeof(#name);\
continue;\
}
#define CHECK_FLAG (   name)
Value:
if (((names_end - names) >= (sizeof(#name) - 1)) &&\
(!memcmp(names, #name, sizeof(#name) - 1))) {\
flags |= GRN_STRING_ ## name;\
names += sizeof(#name);\
continue;\
}
#define CHECK_FLAG (   name)
Value:
if (((names_end - names) >= (sizeof(#name) - 1)) &&\
(!memcmp(names, #name, sizeof(#name) - 1))) {\
flags |= GRN_TOKEN_ ## name;\
names += sizeof(#name);\
continue;\
}
#define COMPARE_AND_RETURN (   type,
  value1,
  value2 
)
Value:
{\
type computed_value1 = value1;\
type computed_value2 = value2;\
if (computed_value1 > computed_value2) {\
return 1;\
} else if (computed_value1 < computed_value2) {\
return -1;\
} else {\
return 0;\
}\
}
#define DEF_COMMAND (   name,
  func,
  nvars,
  vars 
)
Value:
(grn_proc_create(ctx, (name), (sizeof(name) - 1),\
GRN_PROC_COMMAND, (func), NULL, NULL, (nvars), (vars)))

Definition at line 4107 of file proc.c.

#define DEF_VAR (   v,
  name_str 
)
Value:
do {\
(v).name = (name_str);\
(v).name_size = GRN_STRLEN(name_str);\
GRN_TEXT_INIT(&(v).value, 0);\
} while (0)

Definition at line 4101 of file proc.c.

#define DEFAULT_DRILLDOWN_LIMIT   10

Definition at line 376 of file proc.c.

#define DEFAULT_DRILLDOWN_OUTPUT_COLUMNS   "_key, _nsubrecs"

Definition at line 377 of file proc.c.

#define DEFAULT_LIMIT   10

Definition at line 374 of file proc.c.

#define DEFAULT_OUTPUT_COLUMNS   "_id, _key, *"

Definition at line 375 of file proc.c.

#define DIST (   ox,
  oy 
)    (dists[((lx + 1) * (oy)) + (ox)])

Definition at line 3541 of file proc.c.

#define DUMP_COLUMNS   "_id, _key, _value, *"

Definition at line 378 of file proc.c.

#define GRN_EXPR_NONE   0
#define GRN_PTR_POP (   obj,
  value 
)
Value:
do {\
if (GRN_BULK_VSIZE(obj) >= sizeof(grn_obj *)) {\
GRN_BULK_INCR_LEN((obj), -(sizeof(grn_obj *)));\
value = *(grn_obj **)(GRN_BULK_CURR(obj));\
} else {\
value = NULL;\
}\
} while (0)

Definition at line 2409 of file proc.c.

#define GRN_SELECT_INTERNAL_VAR_CONDITION   "$condition"

Definition at line 56 of file proc.c.

#define GRN_SELECT_INTERNAL_VAR_MATCH_COLUMNS   "$match_columns"

Definition at line 57 of file proc.c.

#define GRN_STRING_NONE   0
#define GRN_STRLEN (   s)    ((s) ? strlen(s) : 0)

Definition at line 1358 of file proc.c.

#define GRN_TOKEN_NONE   0
#define O_BINARY   0

Definition at line 38 of file proc.c.

#define O_NOFOLLOW   0

Definition at line 34 of file proc.c.

#define VAR   GRN_PROC_GET_VAR_BY_OFFSET

Definition at line 54 of file proc.c.

Typedef Documentation

typedef grn_rc(* grn_substitute_term_func)(grn_ctx *ctx, const char *term, unsigned int term_len, grn_obj *substituted_term, grn_user_data *user_data)

Definition at line 41 of file proc.c.

Function Documentation

void grn_db_init_builtin_query ( grn_ctx ctx)

Definition at line 4112 of file proc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void grn_ii_buffer_check ( grn_ctx ctx,
grn_ii ii,
uint32_t  seg 
)

Definition at line 2954 of file ii.c.

Here is the call graph for this function:

grn_rc grn_select ( grn_ctx ctx,
const char *  table,
unsigned int  table_len,
const char *  match_columns,
unsigned int  match_columns_len,
const char *  query,
unsigned int  query_len,
const char *  filter,
unsigned int  filter_len,
const char *  scorer,
unsigned int  scorer_len,
const char *  sortby,
unsigned int  sortby_len,
const char *  output_columns,
unsigned int  output_columns_len,
int  offset,
int  limit,
const char *  drilldown,
unsigned int  drilldown_len,
const char *  drilldown_sortby,
unsigned int  drilldown_sortby_len,
const char *  drilldown_output_columns,
unsigned int  drilldown_output_columns_len,
int  drilldown_offset,
int  drilldown_limit,
const char *  cache,
unsigned int  cache_len,
const char *  match_escalation_threshold,
unsigned int  match_escalation_threshold_len,
const char *  query_expander,
unsigned int  query_expander_len,
const char *  query_flags,
unsigned int  query_flags_len 
)

Definition at line 446 of file proc.c.

Here is the call graph for this function:

Variable Documentation

const char* grn_document_root = NULL

Definition at line 52 of file proc.c.