00001
00002
00003
00004
00005
00006
00007
00008
00014 #ifndef __GEARMAN_CON_H__
00015 #define __GEARMAN_CON_H__
00016
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020
00033 GEARMAN_API
00034 void gearman_con_set_host(gearman_con_st *con, const char *host);
00035
00039 GEARMAN_API
00040 void gearman_con_set_port(gearman_con_st *con, in_port_t port);
00041
00045 GEARMAN_API
00046 gearman_con_options_t gearman_con_options(const gearman_con_st *con);
00047
00051 GEARMAN_API
00052 void gearman_con_set_options(gearman_con_st *con,
00053 gearman_con_options_t options);
00054
00058 GEARMAN_API
00059 void gearman_con_add_options(gearman_con_st *con,
00060 gearman_con_options_t options);
00061
00065 GEARMAN_API
00066 void gearman_con_remove_options(gearman_con_st *con,
00067 gearman_con_options_t options);
00068
00072 GEARMAN_API
00073 gearman_return_t gearman_con_set_fd(gearman_con_st *con, int fd);
00074
00078 GEARMAN_API
00079 void *gearman_con_context(const gearman_con_st *con);
00080
00084 GEARMAN_API
00085 void gearman_con_set_context(gearman_con_st *con, const void *context);
00086
00090 GEARMAN_API
00091 gearman_return_t gearman_con_connect(gearman_con_st *con);
00092
00096 GEARMAN_API
00097 void gearman_con_close(gearman_con_st *con);
00098
00102 GEARMAN_API
00103 void gearman_con_reset_addrinfo(gearman_con_st *con);
00104
00108 GEARMAN_API
00109 gearman_return_t gearman_con_send(gearman_con_st *con,
00110 const gearman_packet_st *packet, bool flush);
00111
00115 GEARMAN_API
00116 size_t gearman_con_send_data(gearman_con_st *con, const void *data,
00117 size_t data_size, gearman_return_t *ret_ptr);
00118
00122 GEARMAN_API
00123 gearman_return_t gearman_con_flush(gearman_con_st *con);
00124
00128 GEARMAN_API
00129 gearman_packet_st *gearman_con_recv(gearman_con_st *con,
00130 gearman_packet_st *packet,
00131 gearman_return_t *ret_ptr, bool recv_data);
00132
00136 GEARMAN_API
00137 size_t gearman_con_recv_data(gearman_con_st *con, void *data, size_t data_size,
00138 gearman_return_t *ret_ptr);
00139
00143 GEARMAN_API
00144 size_t gearman_con_read(gearman_con_st *con, void *data, size_t data_size,
00145 gearman_return_t *ret_ptr);
00146
00150 GEARMAN_API
00151 gearman_return_t gearman_con_set_events(gearman_con_st *con, short events);
00152
00157 GEARMAN_API
00158 gearman_return_t gearman_con_set_revents(gearman_con_st *con, short revents);
00159
00163 GEARMAN_API
00164 void *gearman_con_protocol_context(const gearman_con_st *con);
00165
00169 GEARMAN_API
00170 void gearman_con_set_protocol_context(gearman_con_st *con, const void *context);
00171
00175 GEARMAN_API
00176 void gearman_con_set_protocol_context_free_fn(gearman_con_st *con,
00177 gearman_con_protocol_context_free_fn *function);
00178
00182 GEARMAN_API
00183 void gearman_con_set_packet_pack_fn(gearman_con_st *con,
00184 gearman_packet_pack_fn *function);
00185
00189 GEARMAN_API
00190 void gearman_con_set_packet_unpack_fn(gearman_con_st *con,
00191 gearman_packet_unpack_fn *function);
00192
00195 #ifdef __cplusplus
00196 }
00197 #endif
00198
00199 #endif