MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
callback.h
1 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 #ifndef MEMCACHED_CALLBACK_H
3 #define MEMCACHED_CALLBACK_H
4 
5 #include "memcached/engine_common.h"
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
15  typedef enum {
16  ON_CONNECT = 0,
17  ON_DISCONNECT = 1,
18  ON_AUTH = 2,
19  ON_SWITCH_CONN = 3,
20  ON_LOG_LEVEL = 4
21  } ENGINE_EVENT_TYPE;
22 
23  #define MAX_ENGINE_EVENT_TYPE 5
24 
33  typedef void (*EVENT_CALLBACK)(const void *cookie,
34  ENGINE_EVENT_TYPE type,
35  const void *event_data,
36  const void *cb_data);
37 
41  typedef struct {
50  void (*register_callback)(ENGINE_HANDLE *engine,
51  ENGINE_EVENT_TYPE type,
52  EVENT_CALLBACK cb,
53  const void *cb_data);
54 
58  void (*perform_callbacks)(ENGINE_EVENT_TYPE type,
59  const void *data,
60  const void *cookie);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif