Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

switch_apr.c File Reference


Data Structures

struct  switch_dir
struct  apr_threadattr_t

Defines

#define APR_WANT_STDIO
#define APR_WANT_STRFUNC

Functions

void switch_pool_clear (switch_memory_pool_t *p)
unsigned int switch_hashfunc_default (const char *key, switch_ssize_t *klen)
switch_status_t switch_dso_load (switch_dso_handle_t **res_handle, const char *path, switch_memory_pool_t *ctx)
switch_status_t switch_dso_unload (switch_dso_handle_t *handle)
switch_status_t switch_dso_sym (switch_dso_handle_sym_t *ressym, switch_dso_handle_t *handle, const char *symname)
const char * switch_dso_error (switch_dso_handle_t *dso, char *buf, size_t bufsize)
switch_status_t switch_strftime (char *s, switch_size_t *retsize, switch_size_t max, const char *format, switch_time_exp_t *tm)
int switch_snprintf (char *buf, switch_size_t len, const char *format,...)
int switch_vsnprintf (char *buf, switch_size_t len, const char *format, va_list ap)
char * switch_copy_string (char *dst, const char *src, switch_size_t dst_size)
switch_status_t switch_thread_rwlock_create (switch_thread_rwlock_t **rwlock, switch_memory_pool_t *pool)
switch_status_t switch_thread_rwlock_destroy (switch_thread_rwlock_t *rwlock)
switch_memory_pool_tswitch_thread_rwlock_pool_get (switch_thread_rwlock_t *rwlock)
switch_status_t switch_thread_rwlock_rdlock (switch_thread_rwlock_t *rwlock)
switch_status_t switch_thread_rwlock_tryrdlock (switch_thread_rwlock_t *rwlock)
switch_status_t switch_thread_rwlock_wrlock (switch_thread_rwlock_t *rwlock)
switch_status_t switch_thread_rwlock_trywrlock (switch_thread_rwlock_t *rwlock)
switch_status_t switch_thread_rwlock_unlock (switch_thread_rwlock_t *rwlock)
switch_status_t switch_mutex_init (switch_mutex_t **lock, unsigned int flags, switch_memory_pool_t *pool)
switch_status_t switch_mutex_destroy (switch_mutex_t *lock)
switch_status_t switch_mutex_lock (switch_mutex_t *lock)
switch_status_t switch_mutex_unlock (switch_mutex_t *lock)
switch_status_t switch_mutex_trylock (switch_mutex_t *lock)
switch_time_t switch_time_now (void)
switch_status_t switch_time_exp_gmt_get (switch_time_t *result, switch_time_exp_t *input)
switch_status_t switch_time_exp_get (switch_time_t *result, switch_time_exp_t *input)
switch_status_t switch_time_exp_lt (switch_time_exp_t *result, switch_time_t input)
switch_status_t switch_time_exp_gmt (switch_time_exp_t *result, switch_time_t input)
switch_status_t switch_rfc822_date (char *date_str, switch_time_t t)
switch_time_t switch_time_make (switch_time_t sec, int32_t usec)
switch_status_t switch_thread_cond_create (switch_thread_cond_t **cond, switch_memory_pool_t *pool)
switch_status_t switch_thread_cond_wait (switch_thread_cond_t *cond, switch_mutex_t *mutex)
switch_status_t switch_thread_cond_timedwait (switch_thread_cond_t *cond, switch_mutex_t *mutex, switch_interval_time_t timeout)
switch_status_t switch_thread_cond_signal (switch_thread_cond_t *cond)
switch_status_t switch_thread_cond_broadcast (switch_thread_cond_t *cond)
switch_status_t switch_thread_cond_destroy (switch_thread_cond_t *cond)
switch_status_t switch_file_open (switch_file_t **newf, const char *fname, int32_t flag, switch_fileperms_t perm, switch_memory_pool_t *pool)
switch_status_t switch_file_seek (switch_file_t *thefile, switch_seek_where_t where, int64_t *offset)
switch_status_t switch_file_close (switch_file_t *thefile)
switch_status_t switch_file_lock (switch_file_t *thefile, int type)
switch_status_t switch_file_rename (const char *from_path, const char *to_path, switch_memory_pool_t *pool)
switch_status_t switch_file_remove (const char *path, switch_memory_pool_t *pool)
switch_status_t switch_file_read (switch_file_t *thefile, void *buf, switch_size_t *nbytes)
switch_status_t switch_file_write (switch_file_t *thefile, const void *buf, switch_size_t *nbytes)
int switch_file_printf (switch_file_t *thefile, const char *format,...)
switch_status_t switch_file_mktemp (switch_file_t **thefile, char *templ, int32_t flags, switch_memory_pool_t *pool)
switch_size_t switch_file_get_size (switch_file_t *thefile)
switch_status_t switch_directory_exists (const char *dirname, switch_memory_pool_t *pool)
switch_status_t switch_file_exists (const char *filename, switch_memory_pool_t *pool)
switch_status_t switch_dir_make (const char *path, switch_fileperms_t perm, switch_memory_pool_t *pool)
switch_status_t switch_dir_make_recursive (const char *path, switch_fileperms_t perm, switch_memory_pool_t *pool)
switch_status_t switch_dir_open (switch_dir_t **new_dir, const char *dirname, switch_memory_pool_t *pool)
switch_status_t switch_dir_close (switch_dir_t *thedir)
const char * switch_dir_next_file (switch_dir_t *thedir, char *buf, switch_size_t len)
switch_status_t switch_threadattr_create (switch_threadattr_t **new_attr, switch_memory_pool_t *pool)
switch_status_t switch_threadattr_detach_set (switch_threadattr_t *attr, int32_t on)
switch_status_t switch_threadattr_stacksize_set (switch_threadattr_t *attr, switch_size_t stacksize)
switch_status_t switch_threadattr_priority_increase (switch_threadattr_t *attr)
switch_status_t switch_thread_create (switch_thread_t **new_thread, switch_threadattr_t *attr, switch_thread_start_t func, void *data, switch_memory_pool_t *cont)
switch_status_t switch_socket_addr_get (switch_sockaddr_t **sa, switch_bool_t remote, switch_socket_t *sock)
switch_status_t switch_socket_create (switch_socket_t **new_sock, int family, int type, int protocol, switch_memory_pool_t *pool)
switch_status_t switch_socket_shutdown (switch_socket_t *sock, switch_shutdown_how_e how)
switch_status_t switch_socket_close (switch_socket_t *sock)
switch_status_t switch_socket_bind (switch_socket_t *sock, switch_sockaddr_t *sa)
switch_status_t switch_socket_listen (switch_socket_t *sock, int32_t backlog)
switch_status_t switch_socket_accept (switch_socket_t **new_sock, switch_socket_t *sock, switch_memory_pool_t *pool)
switch_status_t switch_socket_connect (switch_socket_t *sock, switch_sockaddr_t *sa)
switch_status_t switch_socket_send (switch_socket_t *sock, const char *buf, switch_size_t *len)
switch_status_t switch_socket_sendto (switch_socket_t *sock, switch_sockaddr_t *where, int32_t flags, const char *buf, switch_size_t *len)
switch_status_t switch_socket_recv (switch_socket_t *sock, char *buf, switch_size_t *len)
switch_status_t switch_sockaddr_info_get (switch_sockaddr_t **sa, const char *hostname, int32_t family, switch_port_t port, int32_t flags, switch_memory_pool_t *pool)
switch_status_t switch_socket_opt_set (switch_socket_t *sock, int32_t opt, int32_t on)
switch_status_t switch_socket_timeout_set (switch_socket_t *sock, switch_interval_time_t t)
switch_status_t switch_sockaddr_ip_get (char **addr, switch_sockaddr_t *sa)
switch_status_t switch_mcast_join (switch_socket_t *sock, switch_sockaddr_t *join, switch_sockaddr_t *iface, switch_sockaddr_t *source)
const char * switch_get_addr (char *buf, switch_size_t len, switch_sockaddr_t *in)
uint16_t switch_sockaddr_get_port (switch_sockaddr_t *sa)
int32_t switch_sockaddr_get_family (switch_sockaddr_t *sa)
switch_status_t switch_socket_recvfrom (switch_sockaddr_t *from, switch_socket_t *sock, int32_t flags, char *buf, size_t *len)
switch_status_t switch_pollset_create (switch_pollset_t **pollset, uint32_t size, switch_memory_pool_t *p, uint32_t flags)
switch_status_t switch_pollset_add (switch_pollset_t *pollset, const switch_pollfd_t *descriptor)
switch_status_t switch_poll (switch_pollfd_t *aprset, int32_t numsock, int32_t *nsds, switch_interval_time_t timeout)
switch_status_t switch_socket_create_pollfd (switch_pollfd_t **poll, switch_socket_t *sock, int16_t flags, switch_memory_pool_t *pool)
 Create a set of file descriptors to poll.
void switch_uuid_format (char *buffer, const switch_uuid_t *uuid)
void switch_uuid_get (switch_uuid_t *uuid)
switch_status_t switch_uuid_parse (switch_uuid_t *uuid, const char *uuid_str)
switch_status_t switch_queue_create (switch_queue_t **queue, unsigned int queue_capacity, switch_memory_pool_t *pool)
unsigned int switch_queue_size (switch_queue_t *queue)
switch_status_t switch_queue_pop (switch_queue_t *queue, void **data)
switch_status_t switch_queue_push (switch_queue_t *queue, void *data)
switch_status_t switch_queue_trypop (switch_queue_t *queue, void **data)
switch_status_t switch_queue_trypush (switch_queue_t *queue, void *data)
int switch_vasprintf (char **ret, const char *fmt, va_list ap)
switch_status_t switch_match_glob (const char *pattern, switch_array_header_t **result, switch_memory_pool_t *p)


Define Documentation

#define APR_WANT_STDIO
 

#define APR_WANT_STRFUNC
 


Function Documentation

char* switch_copy_string char *  dst,
const char *  src,
switch_size_t  dst_size
 

00126 {
00127         if (!dst) return NULL;
00128         if (!src) {
00129                 *dst = '\0';
00130                 return dst;
00131         }
00132         return apr_cpystrn(dst, src, dst_size);
00133 }

int switch_snprintf char *  buf,
switch_size_t  len,
const char *  format,
  ...
 

00111 {
00112         va_list ap;
00113         int ret;
00114         va_start(ap, format);
00115         ret = apr_vsnprintf(buf, len, format, ap);
00116         va_end(ap);
00117         return ret;
00118 }

int switch_vasprintf char **  ret,
const char *  fmt,
va_list  ap
 

00776 {
00777 #ifdef HAVE_VASPRINTF
00778         return vasprintf(ret, fmt, ap);
00779 #else
00780         char *buf;
00781         int len;
00782         size_t buflen;
00783         va_list ap2;
00784         char *tmp = NULL;
00785 
00786 #ifdef _MSC_VER
00787 #if _MSC_VER >= 1500
00788         /* hack for incorrect assumption in msvc header files for code analysis */
00789         __analysis_assume(tmp);
00790 #endif
00791         ap2 = ap;
00792 #else
00793         va_copy(ap2, ap);
00794 #endif
00795 
00796         len = vsnprintf(tmp, 0, fmt, ap2);
00797 
00798         if (len > 0 && (buf = malloc((buflen = (size_t) (len + 1)))) != NULL) {
00799                 len = vsnprintf(buf, buflen, fmt, ap);
00800                 *ret = buf;
00801         } else {
00802                 *ret = NULL;
00803                 len = -1;
00804         }
00805 
00806         va_end(ap2);
00807         return len;
00808 #endif
00809 }

int switch_vsnprintf char *  buf,
switch_size_t  len,
const char *  format,
va_list  ap
 

00121 {
00122         return apr_vsnprintf(buf, len, format, ap);
00123 }


Generated on Mon May 26 22:06:51 2008 for FreeSWITCH by  doxygen 1.3.9.1