connection.h | connection.h | |||
---|---|---|---|---|
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: | |||
* | * | |||
* Gearmand client and server library. | * Gearmand client and server library. | |||
* | * | |||
* Copyright (C) 2011 Data Differential, http://datadifferential.com/ | * Copyright (C) 2011-2013 Data Differential, http://datadifferential.com/ | |||
* Copyright (C) 2008 Brian Aker, Eric Day | * Copyright (C) 2008 Brian Aker, Eric Day | |||
* All rights reserved. | * All rights reserved. | |||
* | * | |||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions are | * modification, are permitted provided that the following conditions are | |||
* met: | * met: | |||
* | * | |||
* * Redistributions of source code must retain the above copyright | * * Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | * notice, this list of conditions and the following disclaimer. | |||
* | * | |||
skipping to change at line 46 | skipping to change at line 46 | |||
* | * | |||
*/ | */ | |||
#pragma once | #pragma once | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <sys/socket.h> | #include <sys/socket.h> | |||
#include <netdb.h> | #include <netdb.h> | |||
#ifdef NI_MAXHOST | #ifdef NI_MAXHOST | |||
#define GEARMAN_NI_MAXHOST NI_MAXHOST | # define GEARMAN_NI_MAXHOST NI_MAXHOST | |||
#else | #else | |||
#define GEARMAN_NI_MAXHOST 1025 | # define GEARMAN_NI_MAXHOST 1025 | |||
#endif | #endif | |||
#ifdef NI_MAXSERV | #ifdef NI_MAXSERV | |||
#define GEARMAN_NI_MAXSERV NI_MAXSERV | # define GEARMAN_NI_MAXSERV NI_MAXSERV | |||
#else | #else | |||
#define GEARMAN_NI_MAXSERV 32 | # define GEARMAN_NI_MAXSERV 32 | |||
#endif | #endif | |||
/* | /* | |||
Do not define these enum in your application. There are left publically d ue to one client. | Do not define these enum in your application. There are left publically d ue to one client. | |||
*/ | */ | |||
enum gearman_con_recv_t { | enum gearman_con_recv_t { | |||
GEARMAN_CON_RECV_UNIVERSAL_NONE, | GEARMAN_CON_RECV_UNIVERSAL_NONE, | |||
GEARMAN_CON_RECV_UNIVERSAL_READ, | GEARMAN_CON_RECV_UNIVERSAL_READ, | |||
GEARMAN_CON_RECV_STATE_READ_DATA | GEARMAN_CON_RECV_STATE_READ_DATA | |||
End of changes. 5 change blocks. | ||||
5 lines changed or deleted | 5 lines changed or added | |||
return.h | return.h | |||
---|---|---|---|---|
skipping to change at line 97 | skipping to change at line 97 | |||
GEARMAN_PIPE_EOF, // DEPRECATED, SERVER ONLY | GEARMAN_PIPE_EOF, // DEPRECATED, SERVER ONLY | |||
GEARMAN_QUEUE_ERROR, // DEPRECATED, SERVER ONLY | GEARMAN_QUEUE_ERROR, // DEPRECATED, SERVER ONLY | |||
GEARMAN_FLUSH_DATA, // Internal state, should never be seen by either cli ent or worker. | GEARMAN_FLUSH_DATA, // Internal state, should never be seen by either cli ent or worker. | |||
GEARMAN_SEND_BUFFER_TOO_SMALL, | GEARMAN_SEND_BUFFER_TOO_SMALL, | |||
GEARMAN_IGNORE_PACKET, // Internal only | GEARMAN_IGNORE_PACKET, // Internal only | |||
GEARMAN_UNKNOWN_OPTION, // DEPRECATED | GEARMAN_UNKNOWN_OPTION, // DEPRECATED | |||
GEARMAN_TIMEOUT, | GEARMAN_TIMEOUT, | |||
GEARMAN_ARGUMENT_TOO_LARGE, | GEARMAN_ARGUMENT_TOO_LARGE, | |||
GEARMAN_INVALID_ARGUMENT, | GEARMAN_INVALID_ARGUMENT, | |||
GEARMAN_IN_PROGRESS, // See gearman_client_job_status() | GEARMAN_IN_PROGRESS, // See gearman_client_job_status() | |||
GEARMAN_INVALID_SERVER_OPTION, // Bad server option sent to server | ||||
GEARMAN_MAX_RETURN, /* Always add new error code before */ | GEARMAN_MAX_RETURN, /* Always add new error code before */ | |||
GEARMAN_FAIL= GEARMAN_WORK_FAIL, | GEARMAN_FAIL= GEARMAN_WORK_FAIL, | |||
GEARMAN_FATAL= GEARMAN_WORK_FAIL, | GEARMAN_FATAL= GEARMAN_WORK_FAIL, | |||
GEARMAN_ERROR= GEARMAN_WORK_ERROR | GEARMAN_ERROR= GEARMAN_WORK_ERROR | |||
}; | }; | |||
static inline bool gearman_continue(enum gearman_return_t rc) | static inline bool gearman_continue(enum gearman_return_t rc) | |||
{ | { | |||
return rc == GEARMAN_IO_WAIT || rc == GEARMAN_IN_PROGRESS || rc == GEARM AN_PAUSE || rc == GEARMAN_JOB_EXISTS; | return rc == GEARMAN_IO_WAIT || rc == GEARMAN_IN_PROGRESS || rc == GEARM AN_PAUSE || rc == GEARMAN_JOB_EXISTS; | |||
} | } | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
universal.h | universal.h | |||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
#pragma once | #pragma once | |||
#include <libgearman-1.0/allocator.h> | #include <libgearman-1.0/allocator.h> | |||
/** | /** | |||
@todo this is only used by the server and should be made private. | @todo this is only used by the server and should be made private. | |||
*/ | */ | |||
typedef struct gearman_connection_st gearman_connection_st; | typedef struct gearman_connection_st gearman_connection_st; | |||
typedef gearman_return_t (gearman_event_watch_fn)(gearman_connection_st *co n, | typedef gearman_return_t (gearman_event_watch_fn)(gearman_connection_st *co n, | |||
short events, void *conte xt); | short events, void *conte xt); | |||
typedef struct gearman_server_options_st gearman_server_options_st; | ||||
/** | /** | |||
* @ingroup gearman_universal | * @ingroup gearman_universal | |||
*/ | */ | |||
struct gearman_universal_st | struct gearman_universal_st | |||
{ | { | |||
struct { | struct { | |||
bool dont_track_packets; | bool dont_track_packets; | |||
bool non_blocking; | bool non_blocking; | |||
} options; | } options; | |||
gearman_verbose_t verbose; | gearman_verbose_t verbose; | |||
uint32_t con_count; | uint32_t con_count; | |||
uint32_t packet_count; | uint32_t packet_count; | |||
uint32_t pfds_size; | uint32_t pfds_size; | |||
uint32_t sending; | uint32_t sending; | |||
int timeout; // Connection timeout. | int timeout; // Connection timeout. | |||
gearman_connection_st *con_list; | gearman_connection_st *con_list; | |||
gearman_server_options_st *server_options_list; | ||||
gearman_packet_st *packet_list; | gearman_packet_st *packet_list; | |||
struct pollfd *pfds; | struct pollfd *pfds; | |||
gearman_log_fn *log_fn; | gearman_log_fn *log_fn; | |||
void *log_context; | void *log_context; | |||
gearman_allocator_t allocator; | gearman_allocator_t allocator; | |||
struct gearman_vector_st *_namespace; | struct gearman_vector_st *_namespace; | |||
struct { | struct { | |||
gearman_return_t rc; | gearman_return_t rc; | |||
int last_errno; | int last_errno; | |||
char last_error[GEARMAN_MAX_ERROR_SIZE]; | char last_error[GEARMAN_MAX_ERROR_SIZE]; | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 2 lines changed or added | |||
version.h | version.h | |||
---|---|---|---|---|
skipping to change at line 40 | skipping to change at line 40 | |||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
* | * | |||
*/ | */ | |||
#pragma once | #pragma once | |||
#define LIBGEARMAN_VERSION_STRING "1.0.2" | #define LIBGEARMAN_VERSION_STRING "1.0.3" | |||
#define LIBGEARMAN_VERSION_HEX 0x01000002 | #define LIBGEARMAN_VERSION_HEX 0x01000003 | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 0 lines changed or added | |||