From 3159161cef959b597b0e8c2326f1b81c1b4e185a Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Fri, 27 Jul 2018 23:07:56 +0100 Subject: [PATCH] Problem: zmq_timers_* are ready for STABLE Solution: move them from DRAFT state to STABLE --- include/zmq.h | 38 +++++++++++++++++++------------------- src/zmq_draft.h | 18 ------------------ 2 files changed, 19 insertions(+), 37 deletions(-) diff --git a/include/zmq.h b/include/zmq.h index 8449fc5d..c0094bad 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -543,6 +543,25 @@ ZMQ_EXPORT int zmq_atomic_counter_dec (void *counter_); ZMQ_EXPORT int zmq_atomic_counter_value (void *counter_); ZMQ_EXPORT void zmq_atomic_counter_destroy (void **counter_p_); +/******************************************************************************/ +/* Scheduling timers */ +/******************************************************************************/ + +#define ZMQ_HAVE_TIMERS + +typedef void(zmq_timer_fn) (int timer_id, void *arg); + +ZMQ_EXPORT void *zmq_timers_new (void); +ZMQ_EXPORT int zmq_timers_destroy (void **timers_p); +ZMQ_EXPORT int +zmq_timers_add (void *timers, size_t interval, zmq_timer_fn handler, void *arg); +ZMQ_EXPORT int zmq_timers_cancel (void *timers, int timer_id); +ZMQ_EXPORT int +zmq_timers_set_interval (void *timers, int timer_id, size_t interval); +ZMQ_EXPORT int zmq_timers_reset (void *timers, int timer_id); +ZMQ_EXPORT long zmq_timers_timeout (void *timers); +ZMQ_EXPORT int zmq_timers_execute (void *timers); + /******************************************************************************/ /* These functions are not documented by man pages -- use at your own risk. */ @@ -706,25 +725,6 @@ ZMQ_EXPORT int zmq_socket_get_peer_state (void *socket, const void *routing_id, size_t routing_id_size); -/******************************************************************************/ -/* Scheduling timers */ -/******************************************************************************/ - -#define ZMQ_HAVE_TIMERS - -typedef void(zmq_timer_fn) (int timer_id, void *arg); - -ZMQ_EXPORT void *zmq_timers_new (void); -ZMQ_EXPORT int zmq_timers_destroy (void **timers_p); -ZMQ_EXPORT int -zmq_timers_add (void *timers, size_t interval, zmq_timer_fn handler, void *arg); -ZMQ_EXPORT int zmq_timers_cancel (void *timers, int timer_id); -ZMQ_EXPORT int -zmq_timers_set_interval (void *timers, int timer_id, size_t interval); -ZMQ_EXPORT int zmq_timers_reset (void *timers, int timer_id); -ZMQ_EXPORT long zmq_timers_timeout (void *timers); -ZMQ_EXPORT int zmq_timers_execute (void *timers); - #endif // ZMQ_BUILD_DRAFT_API diff --git a/src/zmq_draft.h b/src/zmq_draft.h index 5ce06829..36cd54f4 100644 --- a/src/zmq_draft.h +++ b/src/zmq_draft.h @@ -162,24 +162,6 @@ int zmq_socket_get_peer_state (void *socket_, const void *routing_id_, size_t routing_id_size_); -/******************************************************************************/ -/* Scheduling timers */ -/******************************************************************************/ - -typedef void(zmq_timer_fn) (int timer_id_, void *arg_); - -void *zmq_timers_new (void); -int zmq_timers_destroy (void **timers_p_); -int zmq_timers_add (void *timers_, - size_t interval_, - zmq_timer_fn handler_, - void *arg_); -int zmq_timers_cancel (void *timers_, int timer_id_); -int zmq_timers_set_interval (void *timers_, int timer_id_, size_t interval_); -int zmq_timers_reset (void *timers_, int timer_id_); -long zmq_timers_timeout (void *timers_); -int zmq_timers_execute (void *timers_); - #endif // ZMQ_BUILD_DRAFT_API #endif //ifndef __ZMQ_DRAFT_H_INCLUDED__