| memcached.h | | memcached.h | |
| | | | |
| skipping to change at line 17 | | skipping to change at line 17 | |
| * | | * | |
| * Summary: interface for memcached server | | * Summary: interface for memcached server | |
| * Description: main include file for libmemcached | | * Description: main include file for libmemcached | |
| * | | * | |
| */ | | */ | |
| | | | |
| #ifndef __LIBMEMCACHED_MEMCACHED_H__ | | #ifndef __LIBMEMCACHED_MEMCACHED_H__ | |
| #define __LIBMEMCACHED_MEMCACHED_H__ | | #define __LIBMEMCACHED_MEMCACHED_H__ | |
| | | | |
| #include <inttypes.h> | | #include <inttypes.h> | |
|
| #include <netdb.h> | | | |
| #include <netinet/in.h> | | | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| | | | |
| #if !defined(__cplusplus) | | #if !defined(__cplusplus) | |
| # include <stdbool.h> | | # include <stdbool.h> | |
| #endif | | #endif | |
| | | | |
| #include <libmemcached/visibility.h> | | #include <libmemcached/visibility.h> | |
| #include <libmemcached/configure.h> | | #include <libmemcached/configure.h> | |
|
| | | #include <libmemcached/platform.h> | |
| #include <libmemcached/constants.h> | | #include <libmemcached/constants.h> | |
| #include <libmemcached/types.h> | | #include <libmemcached/types.h> | |
| #include <libmemcached/string.h> | | #include <libmemcached/string.h> | |
| #include <libmemcached/stats.h> | | #include <libmemcached/stats.h> | |
| #include <libhashkit/hashkit.h> | | #include <libhashkit/hashkit.h> | |
| // Everything above this line must be in the order specified. | | // Everything above this line must be in the order specified. | |
| #include <libmemcached/allocators.h> | | #include <libmemcached/allocators.h> | |
| #include <libmemcached/analyze.h> | | #include <libmemcached/analyze.h> | |
| #include <libmemcached/auto.h> | | #include <libmemcached/auto.h> | |
| #include <libmemcached/behavior.h> | | #include <libmemcached/behavior.h> | |
| | | | |
End of changes. 2 change blocks. |
| 2 lines changed or deleted | | 1 lines changed or added | |
|
| protocol_handler.h | | protocol_handler.h | |
| | | | |
| skipping to change at line 22 | | skipping to change at line 22 | |
| */ | | */ | |
| | | | |
| #ifndef __LIBMEMCACHED_PROTOCOL_H__ | | #ifndef __LIBMEMCACHED_PROTOCOL_H__ | |
| #define __LIBMEMCACHED_PROTOCOL_H__ | | #define __LIBMEMCACHED_PROTOCOL_H__ | |
| | | | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| #if !defined(__cplusplus) | | #if !defined(__cplusplus) | |
| # include <stdbool.h> | | # include <stdbool.h> | |
| #endif | | #endif | |
| | | | |
|
| | | #include <libmemcached/platform.h> | |
| #include <libmemcached/memcached/protocol_binary.h> | | #include <libmemcached/memcached/protocol_binary.h> | |
| #include <libmemcached/visibility.h> | | #include <libmemcached/visibility.h> | |
| #include <libmemcached/protocol/callback.h> | | #include <libmemcached/protocol/callback.h> | |
| | | | |
| /* Forward declarations */ | | /* Forward declarations */ | |
| /* | | /* | |
| * You should only access memcached_protocol_st from one thread!, | | * You should only access memcached_protocol_st from one thread!, | |
| * and never assume anything about the internal layout / sizes of the | | * and never assume anything about the internal layout / sizes of the | |
| * structures. | | * structures. | |
| */ | | */ | |
| | | | |
| skipping to change at line 51 | | skipping to change at line 52 | |
| * This function should behave exactly like read(2) | | * This function should behave exactly like read(2) | |
| * | | * | |
| * @param cookie a cookie used to represent a given client | | * @param cookie a cookie used to represent a given client | |
| * @param fd the filedescriptor associated with the client | | * @param fd the filedescriptor associated with the client | |
| * @param buf destination buffer | | * @param buf destination buffer | |
| * @param nbuf number of bytes to receive | | * @param nbuf number of bytes to receive | |
| * @return the number of bytes copied into buf | | * @return the number of bytes copied into buf | |
| * or -1 upon error (errno should contain more information) | | * or -1 upon error (errno should contain more information) | |
| */ | | */ | |
| typedef ssize_t (*memcached_protocol_recv_func)(const void *cookie, | | typedef ssize_t (*memcached_protocol_recv_func)(const void *cookie, | |
|
| int fd, | | memcached_socket_t fd, | |
| void *buf, | | void *buf, | |
| size_t nbuf); | | size_t nbuf); | |
| | | | |
| /** | | /** | |
| * Function the protocol handler should call to send data. | | * Function the protocol handler should call to send data. | |
| * This function should behave exactly like write(2) | | * This function should behave exactly like write(2) | |
| * | | * | |
| * @param cookie a cookie used to represent a given client | | * @param cookie a cookie used to represent a given client | |
| * @param fd the filedescriptor associated with the client | | * @param fd the filedescriptor associated with the client | |
| * @param buf the source buffer | | * @param buf the source buffer | |
| * @param nbuf number of bytes to send | | * @param nbuf number of bytes to send | |
| * @return the number of bytes sent | | * @return the number of bytes sent | |
| * or -1 upon error (errno should contain more information) | | * or -1 upon error (errno should contain more information) | |
| */ | | */ | |
| typedef ssize_t (*memcached_protocol_send_func)(const void *cookie, | | typedef ssize_t (*memcached_protocol_send_func)(const void *cookie, | |
|
| int fd, | | memcached_socket_t fd, | |
| const void *buf, | | const void *buf, | |
| size_t nbuf); | | size_t nbuf); | |
| | | | |
| /** | | /** | |
| * Create an instance of the protocol handler | | * Create an instance of the protocol handler | |
| * | | * | |
| * @return NULL if allocation of an instance fails | | * @return NULL if allocation of an instance fails | |
| */ | | */ | |
| LIBMEMCACHED_API | | LIBMEMCACHED_API | |
| memcached_protocol_st *memcached_protocol_create_instance(void); | | memcached_protocol_st *memcached_protocol_create_instance(void); | |
| | | | |
| skipping to change at line 141 | | skipping to change at line 142 | |
| memcached_protocol_recv_func recv, | | memcached_protocol_recv_func recv, | |
| memcached_protocol_send_func send); | | memcached_protocol_send_func send); | |
| | | | |
| /** | | /** | |
| * Create a new client instance and associate it with a socket | | * Create a new client instance and associate it with a socket | |
| * @param instance the protocol instance to bind the client to | | * @param instance the protocol instance to bind the client to | |
| * @param sock the client socket | | * @param sock the client socket | |
| * @return NULL if allocation fails, otherwise an instance | | * @return NULL if allocation fails, otherwise an instance | |
| */ | | */ | |
| LIBMEMCACHED_API | | LIBMEMCACHED_API | |
|
| memcached_protocol_client_st *memcached_protocol_create_client(memcached_pr
otocol_st *instance, int sock); | | memcached_protocol_client_st *memcached_protocol_create_client(memcached_pr
otocol_st *instance, memcached_socket_t sock); | |
| | | | |
| /** | | /** | |
| * Destroy a client handle. | | * Destroy a client handle. | |
| * The caller needs to close the socket accociated with the client | | * The caller needs to close the socket accociated with the client | |
| * <b>before</b> calling this function. This function invalidates the | | * <b>before</b> calling this function. This function invalidates the | |
| * client memory area. | | * client memory area. | |
| * | | * | |
| * @param client the client to destroy | | * @param client the client to destroy | |
| */ | | */ | |
| LIBMEMCACHED_API | | LIBMEMCACHED_API | |
| | | | |
| skipping to change at line 193 | | skipping to change at line 194 | |
| */ | | */ | |
| LIBMEMCACHED_API | | LIBMEMCACHED_API | |
| memcached_protocol_event_t memcached_protocol_client_work(memcached_protoco
l_client_st *client); | | memcached_protocol_event_t memcached_protocol_client_work(memcached_protoco
l_client_st *client); | |
| | | | |
| /** | | /** | |
| * Get the socket attached to a client handle | | * Get the socket attached to a client handle | |
| * @param client the client to query | | * @param client the client to query | |
| * @return the socket handle | | * @return the socket handle | |
| */ | | */ | |
| LIBMEMCACHED_API | | LIBMEMCACHED_API | |
|
| int memcached_protocol_client_get_socket(memcached_protocol_client_st *clie
nt); | | memcached_socket_t memcached_protocol_client_get_socket(memcached_protocol_
client_st *client); | |
| | | | |
| /** | | /** | |
| * Get the error id socket attached to a client handle | | * Get the error id socket attached to a client handle | |
| * @param client the client to query for an error code | | * @param client the client to query for an error code | |
| * @return the OS error code from the client | | * @return the OS error code from the client | |
| */ | | */ | |
| LIBMEMCACHED_API | | LIBMEMCACHED_API | |
| int memcached_protocol_client_get_errno(memcached_protocol_client_st *clien
t); | | int memcached_protocol_client_get_errno(memcached_protocol_client_st *clien
t); | |
| | | | |
| /** | | /** | |
| | | | |
End of changes. 5 change blocks. |
| 4 lines changed or deleted | | 5 lines changed or added | |
|