* su: removed private functions accidentally declared as globals
su_t64_to_time(), mutex_trylocker(), su_port_set_system_preferences()
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10814
d0543943-73ff-0310-b7d9-
9358b9ac24b2
-Tue Dec 16 13:51:53 CST 2008
+Tue Dec 16 13:52:51 CST 2008
#include "config.h"
+#include <sofia-sip/heap.h>
+
#include <assert.h>
#include <stdio.h>
#include <sys/types.h>
SOFIAPUBFUN uint32_t su_ntp_fraq(su_time_t t);
SOFIAPUBFUN uint32_t su_time_ms(su_time_t t);
#else
+su_inline uint32_t su_ntp_fraq(su_time_t t);
+su_inline uint32_t su_time_ms(su_time_t t);
+#endif
+
+SOFIAPUBFUN su_ntp_t su_ntp_hilo(uint32_t hi, uint32_t lo);
+
+SOFIAPUBFUN uint64_t su_counter(void);
+
+SOFIAPUBFUN uint64_t su_nanocounter(void);
+
+SOFIAPUBFUN uint32_t su_random(void);
+
+#if SU_HAVE_INLINE
/** Middle 32 bit of NTP timestamp. */
su_inline uint32_t su_ntp_fraq(su_time_t t)
{
}
#endif
-SOFIAPUBFUN su_ntp_t su_ntp_hilo(uint32_t hi, uint32_t lo);
-
-SOFIAPUBFUN uint64_t su_counter(void);
-
-SOFIAPUBFUN uint64_t su_nanocounter(void);
-
-SOFIAPUBFUN uint32_t su_random();
-
SOFIA_END_DECLS
#endif /* !defined(SU_TIME_H) */
return pthread_mutex_lock(mutex + 1);
}
-int mutex_trylocker(void *_mutex)
+static int mutex_trylocker(void *_mutex)
{
pthread_mutex_t *mutex = _mutex;
return pthread_mutex_trylock(mutex + 1);
if (start) preferred_su_clone_start = start;
}
+static
void su_port_set_system_preferences(char const *name)
{
su_port_create_f *create = preferred_su_port_create;
SOFIAPUBFUN char const *su_port_name(su_port_t const *port);
+SOFIAPUBFUN int su_timer_reset_all(su_timer_queue_t *, su_task_r );
+
/* ---------------------------------------------------------------------- */
/* React to multiple events per one poll() to make sure
* Contains hint of number of sockets supported by su_root_t */
int su_root_size_hint = 64;
+/* ====================================================================== */
+
+_su_task_r su_task_new(su_task_r task, su_root_t *root, su_port_t *port);
+int su_task_attach(su_task_r self, su_root_t *root);
+int su_task_detach(su_task_r self);
+
+int su_timer_reset_all(su_timer_t **t0, su_task_r);
+
/* =========================================================================
* Tasks
*/
}
}
-_su_task_r su_task_new(su_task_r task, su_root_t *root, su_port_t *port);
-int su_task_attach(su_task_r self, su_root_t *root);
-int su_task_detach(su_task_r self);
-
-int su_timer_reset_all(su_timer_t **t0, su_task_r);
-
/* Note that is *not* necessary same as su_root_t,
* as su_root_t can be extended */
typedef uint64_t su_t64_t; /* time with 64 bits */
+static su_time_t su_t64_to_time(su_t64_t const us);
+
const uint32_t su_res32 = 1000000UL;
const su_t64_t su_res64 = (su_t64_t)1000000UL;
return (uint32_t) (ntp >> 16) & 0xffffffffLU;
}
+static
su_time_t su_t64_to_time(su_t64_t const us)
{
su_time_t tv;