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 | Variables
com.h File Reference
#include "groonga_in.h"
#include "str.h"
#include "hash.h"
#include <sys/poll.h>
Include dependency graph for com.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _grn_com_queue_entry
struct  _grn_com_queue
struct  _grn_com_addr
struct  _grn_com
struct  _grn_com_event
struct  _grn_com_header
struct  _grn_msg
struct  grn_edge

Macros

#define GRN_COM_QUEUE_BINSIZE   (0x100)
#define GRN_COM_QUEUE_INIT(q)
#define GRN_COM_QUEUE_EMPTYP(q)   (((q)->first == (q)->last) && !(q)->next)
#define GRN_COM_POLLIN   POLLIN
#define GRN_COM_POLLOUT   POLLOUT
#define GRN_COM_PROTO_HTTP   0x47
#define GRN_COM_PROTO_GQTP   0xc7
#define GRN_COM_PROTO_MBREQ   0x80
#define GRN_COM_PROTO_MBRES   0x81
#define GRN_EDGE_WORKER   0
#define GRN_EDGE_COMMUNICATOR   1

Typedefs

typedef struct _grn_com_queue grn_com_queue
typedef struct _grn_com_queue_entry grn_com_queue_entry
typedef struct _grn_com grn_com
typedef struct _grn_com_event grn_com_event
typedef struct _grn_com_addr grn_com_addr
typedef void grn_com_callback (grn_ctx *ctx, grn_com_event *, grn_com *)
typedef void grn_msg_handler (grn_ctx *ctx, grn_obj *msg)
typedef struct _grn_com_header grn_com_header
typedef struct _grn_msg grn_msg

Enumerations

enum  {
  grn_com_ok = 0, grn_com_emem, grn_com_erecv_head, grn_com_erecv_body,
  grn_com_eproto
}

Functions

GRN_API grn_rc grn_com_queue_enque (grn_ctx *ctx, grn_com_queue *q, grn_com_queue_entry *e)
GRN_API grn_com_queue_entrygrn_com_queue_deque (grn_ctx *ctx, grn_com_queue *q)
grn_rc grn_com_init (void)
void grn_com_fin (void)
GRN_API grn_rc grn_com_event_init (grn_ctx *ctx, grn_com_event *ev, int max_nevents, int data_size)
GRN_API grn_rc grn_com_event_fin (grn_ctx *ctx, grn_com_event *ev)
GRN_API grn_rc grn_com_event_start_accept (grn_ctx *ctx, grn_com_event *ev)
grn_rc grn_com_event_stop_accept (grn_ctx *ctx, grn_com_event *ev)
grn_rc grn_com_event_add (grn_ctx *ctx, grn_com_event *ev, grn_sock fd, int events, grn_com **com)
grn_rc grn_com_event_mod (grn_ctx *ctx, grn_com_event *ev, grn_sock fd, int events, grn_com **com)
GRN_API grn_rc grn_com_event_del (grn_ctx *ctx, grn_com_event *ev, grn_sock fd)
GRN_API grn_rc grn_com_event_poll (grn_ctx *ctx, grn_com_event *ev, int timeout)
grn_rc grn_com_event_each (grn_ctx *ctx, grn_com_event *ev, grn_com_callback *func)
GRN_API grn_comgrn_com_copen (grn_ctx *ctx, grn_com_event *ev, const char *dest, int port)
GRN_API grn_rc grn_com_sopen (grn_ctx *ctx, grn_com_event *ev, const char *bind_address, int port, grn_msg_handler *func, struct hostent *he)
GRN_API void grn_com_close_ (grn_ctx *ctx, grn_com *com)
GRN_API grn_rc grn_com_close (grn_ctx *ctx, grn_com *com)
GRN_API grn_rc grn_com_send (grn_ctx *ctx, grn_com *cs, grn_com_header *header, const char *body, uint32_t size, int flags)
grn_rc grn_com_recv (grn_ctx *ctx, grn_com *cs, grn_com_header *header, grn_obj *buf)
GRN_API grn_rc grn_com_send_http (grn_ctx *ctx, grn_com *cs, const char *path, uint32_t path_len, int flags)
GRN_API grn_rc grn_msg_send (grn_ctx *ctx, grn_obj *msg, int flags)
GRN_API grn_objgrn_msg_open_for_reply (grn_ctx *ctx, grn_obj *query, grn_com_queue *old)
GRN_API grn_objgrn_msg_open (grn_ctx *ctx, grn_com *com, grn_com_queue *old)
GRN_API grn_rc grn_msg_set_property (grn_ctx *ctx, grn_obj *obj, uint16_t status, uint32_t key_size, uint8_t extra_size)
GRN_API grn_rc grn_msg_close (grn_ctx *ctx, grn_obj *msg)
GRN_API void grn_edges_init (grn_ctx *ctx, void(*dispatcher)(grn_ctx *ctx, grn_edge *edge))
GRN_API void grn_edges_fin (grn_ctx *ctx)
GRN_API grn_edgegrn_edges_add (grn_ctx *ctx, grn_com_addr *addr, int *added)
grn_edgegrn_edges_add_communicator (grn_ctx *ctx, grn_com_addr *addr)
GRN_API void grn_edges_delete (grn_ctx *ctx, grn_edge *edge)
void grn_edge_dispatch (grn_ctx *ctx, grn_edge *edge, grn_obj *msg)

Variables

GRN_VAR grn_hashgrn_edges

Macro Definition Documentation

#define GRN_COM_POLLIN   POLLIN

Definition at line 95 of file com.h.

#define GRN_COM_POLLOUT   POLLOUT

Definition at line 96 of file com.h.

#define GRN_COM_PROTO_GQTP   0xc7

Definition at line 175 of file com.h.

#define GRN_COM_PROTO_HTTP   0x47

Definition at line 174 of file com.h.

#define GRN_COM_PROTO_MBREQ   0x80

Definition at line 176 of file com.h.

#define GRN_COM_PROTO_MBRES   0x81

Definition at line 177 of file com.h.

#define GRN_COM_QUEUE_BINSIZE   (0x100)

Definition at line 46 of file com.h.

#define GRN_COM_QUEUE_EMPTYP (   q)    (((q)->first == (q)->last) && !(q)->next)

Definition at line 70 of file com.h.

#define GRN_COM_QUEUE_INIT (   q)
Value:
do {\
(q)->next = NULL;\
(q)->tail = &(q)->next;\
(q)->first = 0;\
(q)->last = 0;\
CRITICAL_SECTION_INIT((q)->cs);\
} while (0)

Definition at line 62 of file com.h.

#define GRN_EDGE_COMMUNICATOR   1

Definition at line 233 of file com.h.

#define GRN_EDGE_WORKER   0

Definition at line 232 of file com.h.

Typedef Documentation

typedef struct _grn_com grn_com

Definition at line 101 of file com.h.

typedef struct _grn_com_addr grn_com_addr

Definition at line 103 of file com.h.

typedef void grn_com_callback(grn_ctx *ctx, grn_com_event *, grn_com *)

Definition at line 104 of file com.h.

typedef struct _grn_com_event grn_com_event

Definition at line 102 of file com.h.

Definition at line 179 of file com.h.

typedef struct _grn_com_queue grn_com_queue

Definition at line 43 of file com.h.

Definition at line 44 of file com.h.

typedef struct _grn_msg grn_msg

Definition at line 208 of file com.h.

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

Definition at line 105 of file com.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
grn_com_ok 
grn_com_emem 
grn_com_erecv_head 
grn_com_erecv_body 
grn_com_eproto 

Definition at line 107 of file com.h.

Function Documentation

GRN_API grn_rc grn_com_close ( grn_ctx ctx,
grn_com com 
)

Definition at line 998 of file com.c.

Here is the call graph for this function:

Here is the caller graph for this function:

GRN_API void grn_com_close_ ( grn_ctx ctx,
grn_com com 
)

Definition at line 986 of file com.c.

Here is the caller graph for this function:

GRN_API grn_com* grn_com_copen ( grn_ctx ctx,
grn_com_event ev,
const char *  dest,
int  port 
)

Definition at line 906 of file com.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_com_event_add ( grn_ctx ctx,
grn_com_event ev,
grn_sock  fd,
int  events,
grn_com **  com 
)

Definition at line 341 of file com.c.

Here is the call graph for this function:

Here is the caller graph for this function:

GRN_API grn_rc grn_com_event_del ( grn_ctx ctx,
grn_com_event ev,
grn_sock  fd 
)

Definition at line 423 of file com.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_com_event_each ( grn_ctx ctx,
grn_com_event ev,
grn_com_callback func 
)
GRN_API grn_rc grn_com_event_fin ( grn_ctx ctx,
grn_com_event ev 
)

Definition at line 321 of file com.c.

Here is the call graph for this function:

GRN_API grn_rc grn_com_event_init ( grn_ctx ctx,
grn_com_event ev,
int  max_nevents,
int  data_size 
)

Definition at line 276 of file com.c.

Here is the call graph for this function:

grn_rc grn_com_event_mod ( grn_ctx ctx,
grn_com_event ev,
grn_sock  fd,
int  events,
grn_com **  com 
)

Definition at line 384 of file com.c.

Here is the call graph for this function:

Here is the caller graph for this function:

GRN_API grn_rc grn_com_event_poll ( grn_ctx ctx,
grn_com_event ev,
int  timeout 
)

Definition at line 539 of file com.c.

GRN_API grn_rc grn_com_event_start_accept ( grn_ctx ctx,
grn_com_event ev 
)

Definition at line 461 of file com.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_rc grn_com_event_stop_accept ( grn_ctx ctx,
grn_com_event ev 
)

Definition at line 479 of file com.c.

Here is the call graph for this function:

void grn_com_fin ( void  )

Definition at line 268 of file com.c.

Here is the caller graph for this function:

grn_rc grn_com_init ( void  )

Definition at line 248 of file com.c.

Here is the caller graph for this function:

GRN_API grn_com_queue_entry* grn_com_queue_deque ( grn_ctx ctx,
grn_com_queue q 
)

Definition at line 102 of file com.c.

Here is the caller graph for this function:

GRN_API grn_rc grn_com_queue_enque ( grn_ctx ctx,
grn_com_queue q,
grn_com_queue_entry e 
)

Definition at line 73 of file com.c.

Here is the caller graph for this function:

grn_rc grn_com_recv ( grn_ctx ctx,
grn_com cs,
grn_com_header header,
grn_obj buf 
)

Definition at line 831 of file com.c.

Here is the call graph for this function:

Here is the caller graph for this function:

GRN_API grn_rc grn_com_send ( grn_ctx ctx,
grn_com cs,
grn_com_header header,
const char *  body,
uint32_t  size,
int  flags 
)

Definition at line 695 of file com.c.

Here is the caller graph for this function:

GRN_API grn_rc grn_com_send_http ( grn_ctx ctx,
grn_com cs,
const char *  path,
uint32_t  path_len,
int  flags 
)

Definition at line 675 of file com.c.

Here is the call graph for this function:

GRN_API grn_rc grn_com_sopen ( grn_ctx ctx,
grn_com_event ev,
const char *  bind_address,
int  port,
grn_msg_handler func,
struct hostent *  he 
)

Definition at line 1013 of file com.c.

Here is the call graph for this function:

void grn_edge_dispatch ( grn_ctx ctx,
grn_edge edge,
grn_obj msg 
)

Definition at line 1162 of file com.c.

Here is the call graph for this function:

Here is the caller graph for this function:

GRN_API grn_edge* grn_edges_add ( grn_ctx ctx,
grn_com_addr addr,
int *  added 
)

Definition at line 1122 of file com.c.

Here is the call graph for this function:

Here is the caller graph for this function:

grn_edge* grn_edges_add_communicator ( grn_ctx ctx,
grn_com_addr addr 
)

Definition at line 1146 of file com.c.

Here is the call graph for this function:

Here is the caller graph for this function:

GRN_API void grn_edges_delete ( grn_ctx ctx,
grn_edge edge 
)

Definition at line 1137 of file com.c.

Here is the call graph for this function:

GRN_API void grn_edges_fin ( grn_ctx ctx)

Definition at line 1116 of file com.c.

Here is the call graph for this function:

GRN_API void grn_edges_init ( grn_ctx ctx,
void(*)(grn_ctx *ctx, grn_edge *edge)  dispatcher 
)

Definition at line 1109 of file com.c.

Here is the call graph for this function:

GRN_API grn_rc grn_msg_close ( grn_ctx ctx,
grn_obj msg 
)

Definition at line 165 of file com.c.

Here is the call graph for this function:

Here is the caller graph for this function:

GRN_API grn_obj* grn_msg_open ( grn_ctx ctx,
grn_com com,
grn_com_queue old 
)

Definition at line 131 of file com.c.

Here is the call graph for this function:

Here is the caller graph for this function:

GRN_API grn_obj* grn_msg_open_for_reply ( grn_ctx ctx,
grn_obj query,
grn_com_queue old 
)

Definition at line 153 of file com.c.

Here is the call graph for this function:

GRN_API grn_rc grn_msg_send ( grn_ctx ctx,
grn_obj msg,
int  flags 
)

Definition at line 184 of file com.c.

Here is the call graph for this function:

GRN_API grn_rc grn_msg_set_property ( grn_ctx ctx,
grn_obj obj,
uint16_t  status,
uint32_t  key_size,
uint8_t  extra_size 
)

Definition at line 173 of file com.c.

Variable Documentation

GRN_VAR grn_hash* grn_edges

Definition at line 248 of file com.h.