libmemif: remove per_thread_ namespace
Type: refactor Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Ib5a88132ad28860553fc82f5aaaf84e0a1b8e8bf
This commit is contained in:

committed by
Damjan Marion

parent
9f99e9a60e
commit
45cf1fc3f5
@ -23,7 +23,7 @@
|
|||||||
#define _LIBMEMIF_H_
|
#define _LIBMEMIF_H_
|
||||||
|
|
||||||
/** Libmemif version. */
|
/** Libmemif version. */
|
||||||
#define LIBMEMIF_VERSION "3.1"
|
#define LIBMEMIF_VERSION "4.0"
|
||||||
/** Default name of application using libmemif. */
|
/** Default name of application using libmemif. */
|
||||||
#define MEMIF_DEFAULT_APP_NAME "libmemif-app"
|
#define MEMIF_DEFAULT_APP_NAME "libmemif-app"
|
||||||
|
|
||||||
@ -98,12 +98,6 @@ typedef enum
|
|||||||
#define MEMIF_FD_EVENT_MOD (1 << 4)
|
#define MEMIF_FD_EVENT_MOD (1 << 4)
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/** \brief Memif per thread main handle
|
|
||||||
Pointer of type void, pointing to internal structure.
|
|
||||||
Used to identify internal per thread database.
|
|
||||||
*/
|
|
||||||
typedef void *memif_per_thread_main_handle_t;
|
|
||||||
|
|
||||||
/** \brief Memif connection handle
|
/** \brief Memif connection handle
|
||||||
pointer of type void, pointing to internal structure
|
pointer of type void, pointing to internal structure
|
||||||
*/
|
*/
|
||||||
@ -498,28 +492,6 @@ int memif_init (memif_control_fd_update_t * on_control_fd_update,
|
|||||||
char *app_name, memif_alloc_t * memif_alloc,
|
char *app_name, memif_alloc_t * memif_alloc,
|
||||||
memif_realloc_t * memif_realloc, memif_free_t * memif_free);
|
memif_realloc_t * memif_realloc, memif_free_t * memif_free);
|
||||||
|
|
||||||
/** \brief Memif per thread initialization
|
|
||||||
@param pt_main - per thread main handle
|
|
||||||
@param private_ctx - private context
|
|
||||||
@param on_control_fd_update - if control fd updates inform user to watch new fd
|
|
||||||
@param app_name - application name (will be truncated to 32 chars)
|
|
||||||
@param memif_alloc - custom memory allocator, NULL = default
|
|
||||||
@param memif_realloc - custom memory reallocation, NULL = default
|
|
||||||
@param memif_free - custom memory free, NULL = default
|
|
||||||
|
|
||||||
Per thread version of memif_init ().
|
|
||||||
Instead of using global database, creates and initializes unique database,
|
|
||||||
identified by 'memif_per_thread_main_handle_t'.
|
|
||||||
|
|
||||||
\return memif_err_t
|
|
||||||
*/
|
|
||||||
int memif_per_thread_init (memif_per_thread_main_handle_t * pt_main,
|
|
||||||
void *private_ctx,
|
|
||||||
memif_control_fd_update_t * on_control_fd_update,
|
|
||||||
char *app_name, memif_alloc_t * memif_alloc,
|
|
||||||
memif_realloc_t * memif_realloc,
|
|
||||||
memif_free_t * memif_free);
|
|
||||||
|
|
||||||
/** \brief Memif cleanup
|
/** \brief Memif cleanup
|
||||||
|
|
||||||
Free libmemif internal allocations.
|
Free libmemif internal allocations.
|
||||||
@ -528,15 +500,6 @@ int memif_per_thread_init (memif_per_thread_main_handle_t * pt_main,
|
|||||||
*/
|
*/
|
||||||
int memif_cleanup ();
|
int memif_cleanup ();
|
||||||
|
|
||||||
/** \brief Memif per thread cleanup
|
|
||||||
@param pt_main - per thread main handle
|
|
||||||
|
|
||||||
Free libmemif internal allocations and sets the handle to NULL.
|
|
||||||
|
|
||||||
\return memif_err_t
|
|
||||||
*/
|
|
||||||
int memif_per_thread_cleanup (memif_per_thread_main_handle_t * pt_main);
|
|
||||||
|
|
||||||
/** \brief Memory interface create function
|
/** \brief Memory interface create function
|
||||||
@param conn - connection handle for client app
|
@param conn - connection handle for client app
|
||||||
@param args - memory interface connection arguments
|
@param args - memory interface connection arguments
|
||||||
@ -585,19 +548,6 @@ int memif_create (memif_conn_handle_t * conn, memif_conn_args_t * args,
|
|||||||
*/
|
*/
|
||||||
int memif_control_fd_handler (int fd, uint8_t events);
|
int memif_control_fd_handler (int fd, uint8_t events);
|
||||||
|
|
||||||
/** \brief Memif per thread control file descriptor handler
|
|
||||||
@param pt_main - per thread main handle
|
|
||||||
@param fd - file descriptor on which the event occurred
|
|
||||||
@param events - event type(s) that occurred
|
|
||||||
|
|
||||||
Per thread version of memif_control_fd_handler.
|
|
||||||
|
|
||||||
\return memif_err_t
|
|
||||||
|
|
||||||
*/
|
|
||||||
int memif_per_thread_control_fd_handler (memif_per_thread_main_handle_t
|
|
||||||
pt_main, int fd, uint8_t events);
|
|
||||||
|
|
||||||
/** \brief Memif delete
|
/** \brief Memif delete
|
||||||
@param conn - pointer to memif connection handle
|
@param conn - pointer to memif connection handle
|
||||||
|
|
||||||
@ -714,13 +664,6 @@ int memif_poll_event (int timeout);
|
|||||||
@param pt_main - per thread main handle
|
@param pt_main - per thread main handle
|
||||||
@param timeout - timeout in seconds
|
@param timeout - timeout in seconds
|
||||||
|
|
||||||
Per thread version of memif_poll_event.
|
|
||||||
|
|
||||||
\return memif_err_t
|
|
||||||
*/
|
|
||||||
int memif_per_thread_poll_event (memif_per_thread_main_handle_t pt_main,
|
|
||||||
int timeout);
|
|
||||||
|
|
||||||
/** \brief Send signal to stop concurrently running memif_poll_event().
|
/** \brief Send signal to stop concurrently running memif_poll_event().
|
||||||
|
|
||||||
The function, however, does not wait for memif_poll_event() to stop.
|
The function, however, does not wait for memif_poll_event() to stop.
|
||||||
@ -735,15 +678,6 @@ int memif_per_thread_poll_event (memif_per_thread_main_handle_t pt_main,
|
|||||||
*/
|
*/
|
||||||
#define MEMIF_HAVE_CANCEL_POLL_EVENT 1
|
#define MEMIF_HAVE_CANCEL_POLL_EVENT 1
|
||||||
int memif_cancel_poll_event ();
|
int memif_cancel_poll_event ();
|
||||||
/** \brief Send signal to stop concurrently running memif_poll_event().
|
|
||||||
@param pt_main - per thread main handle
|
|
||||||
|
|
||||||
Per thread version of memif_cancel_poll_event.
|
|
||||||
|
|
||||||
\return memif_err_t
|
|
||||||
*/
|
|
||||||
int memif_per_thread_cancel_poll_event (memif_per_thread_main_handle_t
|
|
||||||
pt_main);
|
|
||||||
|
|
||||||
/** \brief Set connection request timer value
|
/** \brief Set connection request timer value
|
||||||
@param timer - new timer value
|
@param timer - new timer value
|
||||||
@ -755,19 +689,6 @@ int memif_per_thread_cancel_poll_event (memif_per_thread_main_handle_t
|
|||||||
*/
|
*/
|
||||||
int memif_set_connection_request_timer (struct itimerspec timer);
|
int memif_set_connection_request_timer (struct itimerspec timer);
|
||||||
|
|
||||||
/** \brief Set connection request timer value
|
|
||||||
@param pt_main - per thread main handle
|
|
||||||
@param timer - new timer value
|
|
||||||
|
|
||||||
Per thread version of memif_set_connection_request_timer
|
|
||||||
|
|
||||||
\return memif_err_t
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
memif_per_thread_set_connection_request_timer (memif_per_thread_main_handle_t
|
|
||||||
pt_main,
|
|
||||||
struct itimerspec timer);
|
|
||||||
|
|
||||||
/** \brief Send connection request
|
/** \brief Send connection request
|
||||||
@param conn - memif connection handle
|
@param conn - memif connection handle
|
||||||
|
|
||||||
@ -794,20 +715,6 @@ int memif_request_connection (memif_conn_handle_t conn);
|
|||||||
int memif_create_socket (memif_socket_handle_t * sock, const char *filename,
|
int memif_create_socket (memif_socket_handle_t * sock, const char *filename,
|
||||||
void *private_ctx);
|
void *private_ctx);
|
||||||
|
|
||||||
/** \brief Create memif socket
|
|
||||||
@param pt_main - per thread main handle
|
|
||||||
@param sock - socket handle for client app
|
|
||||||
@param filename - path to socket file
|
|
||||||
@param private_ctx - private context
|
|
||||||
|
|
||||||
Per thread version of memif_create_socket.
|
|
||||||
|
|
||||||
\return memif_err_t
|
|
||||||
*/
|
|
||||||
int memif_per_thread_create_socket (memif_per_thread_main_handle_t pt_main,
|
|
||||||
memif_socket_handle_t * sock,
|
|
||||||
const char *filename, void *private_ctx);
|
|
||||||
|
|
||||||
/** \brief Delete memif socket
|
/** \brief Delete memif socket
|
||||||
@param sock - socket handle for client app
|
@param sock - socket handle for client app
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user