Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
groonga.c File Reference
#include "lib/groonga_in.h"
#include "lib/com.h"
#include "lib/ctx_impl.h"
#include "lib/proc.h"
#include "lib/db.h"
#include "lib/util.h"
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <fcntl.h>
Include dependency graph for groonga.c:

Go to the source code of this file.

Data Structures

struct  ht_context
struct  _config_file_entry

Macros

#define MSG_NOSIGNAL   0
#define STDIN_FILENO   0
#define STDOUT_FILENO   1
#define STDERR_FILENO   2
#define DEFAULT_PORT   10041
#define DEFAULT_DEST   "localhost"
#define DEFAULT_MAX_NFTHREADS   8
#define MAX_CON   0x10000
#define RLIMIT_NOFILE_MINIMUM   4096
#define PIPE_READ   0
#define PIPE_WRITE   1
#define CTX_GET(name)   (grn_ctx_get(ctx, (name), strlen(name)))
#define RELATIVE_TIME_THRESH   1000000000
#define MBRES(ctx, re, status, key_len, extra_len, flags)
#define GRN_MSG_MBRES(block)
#define MODE_MASK   0x007f
#define MODE_USE_QL   0x0080
#define MODE_NEW_DB   0x0100
#define CONFIG_FILE_BUF_SIZE   4096
#define CONFIG_FILE_MAX_NAME_LENGTH   128
#define CONFIG_FILE_MAX_VALUE_LENGTH   2048

Typedefs

typedef void(* grn_edge_dispatcher_func )(grn_ctx *ctx, grn_edge *edge)
typedef void(* grn_handler_func )(grn_ctx *ctx, grn_obj *msg)
typedef struct _config_file_entry config_file_entry

Enumerations

enum  grn_http_request_type { grn_http_request_type_none = 0, grn_http_request_type_get, grn_http_request_type_post }
enum  {
  MBRES_SUCCESS = 0x00, MBRES_KEY_ENOENT = 0x01, MBRES_KEY_EEXISTS = 0x02, MBRES_E2BIG = 0x03,
  MBRES_EINVAL = 0x04, MBRES_NOT_STORED = 0x05, MBRES_UNKNOWN_COMMAND = 0x81, MBRES_ENOMEM = 0x82
}
enum  {
  MBCMD_GET = 0x00, MBCMD_SET = 0x01, MBCMD_ADD = 0x02, MBCMD_REPLACE = 0x03,
  MBCMD_DELETE = 0x04, MBCMD_INCREMENT = 0x05, MBCMD_DECREMENT = 0x06, MBCMD_QUIT = 0x07,
  MBCMD_FLUSH = 0x08, MBCMD_GETQ = 0x09, MBCMD_NOOP = 0x0a, MBCMD_VERSION = 0x0b,
  MBCMD_GETK = 0x0c, MBCMD_GETKQ = 0x0d, MBCMD_APPEND = 0x0e, MBCMD_PREPEND = 0x0f,
  MBCMD_STAT = 0x10, MBCMD_SETQ = 0x11, MBCMD_ADDQ = 0x12, MBCMD_REPLACEQ = 0x13,
  MBCMD_DELETEQ = 0x14, MBCMD_INCREMENTQ = 0x15, MBCMD_DECREMENTQ = 0x16, MBCMD_QUITQ = 0x17,
  MBCMD_FLUSHQ = 0x18, MBCMD_APPENDQ = 0x19, MBCMD_PREPENDQ = 0x1a
}
enum  { EDGE_IDLE = 0x00, EDGE_WAIT = 0x01, EDGE_DOING = 0x02, EDGE_ABORT = 0x03 }
enum  {
  mode_alone = 0, mode_client, mode_daemon, mode_server,
  mode_usage, mode_version, mode_config, mode_error
}
enum  config_file_status {
  CONFIG_FILE_SUCCESS, CONFIG_FILE_FORMAT_ERROR, CONFIG_FILE_FOPEN_ERROR, CONFIG_FILE_MALLOC_ERROR,
  CONFIG_FILE_ATEXIT_ERROR
}

Functions

int main (int argc, char **argv)

Macro Definition Documentation

#define CONFIG_FILE_BUF_SIZE   4096

Definition at line 1656 of file groonga.c.

#define CONFIG_FILE_MAX_NAME_LENGTH   128

Definition at line 1657 of file groonga.c.

#define CONFIG_FILE_MAX_VALUE_LENGTH   2048

Definition at line 1658 of file groonga.c.

#define CTX_GET (   name)    (grn_ctx_get(ctx, (name), strlen(name)))

Definition at line 829 of file groonga.c.

#define DEFAULT_DEST   "localhost"

Definition at line 69 of file groonga.c.

#define DEFAULT_MAX_NFTHREADS   8

Definition at line 70 of file groonga.c.

#define DEFAULT_PORT   10041

Definition at line 68 of file groonga.c.

#define GRN_MSG_MBRES (   block)
Value:
do {\
if (!quiet) {\
grn_obj *re = grn_msg_open_for_reply(ctx, (grn_obj *)msg, &edge->send_old);\
((grn_msg *)re)->header.qtype = header->qtype;\
block\
}\
} while (0)

Definition at line 873 of file groonga.c.

#define MAX_CON   0x10000

Definition at line 71 of file groonga.c.

#define MBRES (   ctx,
  re,
  status,
  key_len,
  extra_len,
  flags 
)
Value:
do {\
grn_msg_set_property((ctx), (re), (status), (key_len), (extra_len));\
grn_msg_send((ctx), (re), (flags));\
} while (0)

Definition at line 868 of file groonga.c.

#define MODE_MASK   0x007f

Definition at line 1613 of file groonga.c.

#define MODE_NEW_DB   0x0100

Definition at line 1615 of file groonga.c.

#define MODE_USE_QL   0x0080

Definition at line 1614 of file groonga.c.

#define MSG_NOSIGNAL   0

Definition at line 55 of file groonga.c.

#define PIPE_READ   0

Definition at line 90 of file groonga.c.

#define PIPE_WRITE   1

Definition at line 91 of file groonga.c.

#define RELATIVE_TIME_THRESH   1000000000

Definition at line 866 of file groonga.c.

#define RLIMIT_NOFILE_MINIMUM   4096

Definition at line 73 of file groonga.c.

#define STDERR_FILENO   2

Definition at line 65 of file groonga.c.

#define STDIN_FILENO   0

Definition at line 59 of file groonga.c.

#define STDOUT_FILENO   1

Definition at line 62 of file groonga.c.

Typedef Documentation

typedef void(* grn_edge_dispatcher_func)(grn_ctx *ctx, grn_edge *edge)

Definition at line 414 of file groonga.c.

typedef void(* grn_handler_func)(grn_ctx *ctx, grn_obj *msg)

Definition at line 415 of file groonga.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
MBRES_SUCCESS 
MBRES_KEY_ENOENT 
MBRES_KEY_EEXISTS 
MBRES_E2BIG 
MBRES_EINVAL 
MBRES_NOT_STORED 
MBRES_UNKNOWN_COMMAND 
MBRES_ENOMEM 

Definition at line 781 of file groonga.c.

anonymous enum
Enumerator:
MBCMD_GET 
MBCMD_SET 
MBCMD_ADD 
MBCMD_REPLACE 
MBCMD_DELETE 
MBCMD_INCREMENT 
MBCMD_DECREMENT 
MBCMD_QUIT 
MBCMD_FLUSH 
MBCMD_GETQ 
MBCMD_NOOP 
MBCMD_VERSION 
MBCMD_GETK 
MBCMD_GETKQ 
MBCMD_APPEND 
MBCMD_PREPEND 
MBCMD_STAT 
MBCMD_SETQ 
MBCMD_ADDQ 
MBCMD_REPLACEQ 
MBCMD_DELETEQ 
MBCMD_INCREMENTQ 
MBCMD_DECREMENTQ 
MBCMD_QUITQ 
MBCMD_FLUSHQ 
MBCMD_APPENDQ 
MBCMD_PREPENDQ 

Definition at line 792 of file groonga.c.

anonymous enum
Enumerator:
EDGE_IDLE 
EDGE_WAIT 
EDGE_DOING 
EDGE_ABORT 

Definition at line 1336 of file groonga.c.

anonymous enum
Enumerator:
mode_alone 
mode_client 
mode_daemon 
mode_server 
mode_usage 
mode_version 
mode_config 
mode_error 

Definition at line 1602 of file groonga.c.

Enumerator:
CONFIG_FILE_SUCCESS 
CONFIG_FILE_FORMAT_ERROR 
CONFIG_FILE_FOPEN_ERROR 
CONFIG_FILE_MALLOC_ERROR 
CONFIG_FILE_ATEXIT_ERROR 

Definition at line 1660 of file groonga.c.

Enumerator:
grn_http_request_type_none 
grn_http_request_type_get 
grn_http_request_type_post 

Definition at line 263 of file groonga.c.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 2095 of file groonga.c.

Here is the call graph for this function: