Main Page | Modules | Data Structures | File List | Data Fields

Miscellaneous Utilities
[State Utility Library]


Defines

#define SMD_HTTPD_DEFAULT_PORT   8021
#define RE_IP   "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"

Functions

 sul_get_time_now (void)
 sul_get_local_ip (const char **ip, apr_pool_t *pool)
 sul_get_nameinfo (char **name, const char *ip, apr_pool_t *pool)
 sul_strtolower (apr_pool_t *pool, const char *str)
 sul_string_makelower (char *str)
 sul_socket_connect_timed (apr_socket_t *sock, apr_sockaddr_t *sa, apr_interval_time_t c_secs, apr_interval_time_t a_secs)
 sul_parse_key (const char *nptr)
 sul_str_replace (const char *src, const char *from, char to, apr_pool_t *pool)
 sul_tokenize_string (apr_array_header_t **toks, const char *str, const char *delims, apr_pool_t *pool)
 sul_join_strings (apr_array_header_t *strings, const char *sep, apr_size_t bgn, apr_pool_t *pool)
 sul_pool_cleanup_free (void *arg)
 sul_pcre_compile (pcre **re, const char *pattern, apr_pool_t *pool)
 sul_pcre_match_simple (pcre *re, const char *str, apr_pool_t *pool)
 sul_keys_array_contains (apr_array_header_t *arr, apr_int32_t key)

Define Documentation

#define RE_IP   "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"
 

A regular expression that will match formaly valid IP addresses, this will also match IP's that are special, so be careful.

#define SMD_HTTPD_DEFAULT_PORT   8021
 

Default port number of the State HTTP daemon. It's pretty much assume that if state is running on a machine, then there is also a state http daemon running on this port on the machine also.


Function Documentation

sul_get_local_ip const char **  ip,
apr_pool_t *  pool
 

Gets the IP address of the local machine.

Parameters:
ip 
pool 
Returns:

sul_get_nameinfo char **  name,
const char *  ip,
apr_pool_t *  pool
 

Gets the DNS name lookup for a given IP address.

Parameters:
name Pointer to receive the name information for the IP.
ip IP address to get name information for.
pool Pool to allocate memory overhead from.
Returns:
APR error status value.

sul_get_time_now void   ) 
 

Gets a floating value representing the number of seconds since this function was first called.

Returns:
A double which is a floating point time value.

sul_join_strings apr_array_header_t *  strings,
const char *  sep,
apr_size_t  bgn,
apr_pool_t *  pool
 

Parameters:
strings 
sep 
bgn 
pool 
Returns:

sul_keys_array_contains apr_array_header_t *  arr,
apr_int32_t  key
 

Looks in an array of sul_key_t's for a given key.

Parameters:
arr Array of sul_key_t's to look in.
key Key to look for in arr.
Returns:
TRUE if arr contains key.

sul_parse_key const char *  nptr  ) 
 

Parses a key from a string.

Parameters:
nptr String to be parsed as a key.
Returns:
An integer key or 0 if an error occured.

sul_pcre_compile pcre **  re,
const char *  pattern,
apr_pool_t *  pool
 

Parameters:
re 
pattern 
pool 

sul_pcre_match_simple pcre *  re,
const char *  str,
apr_pool_t *  pool
 

Parameters:
re 
str 
pool 
Returns:

sul_pool_cleanup_free void *  arg  ) 
 

APR cleanup function that just free's the arg using the standard libraries free function.

Parameters:
arg Pointer to the block of memory to free.
Returns:
APR_SUCCESS

sul_socket_connect_timed apr_socket_t *  sock,
apr_sockaddr_t *  sa,
apr_interval_time_t  c_secs,
apr_interval_time_t  a_secs
 

Attempts to do a timed socket connect that will time out after a given dureation elapses.

Parameters:
sock A socket.
sa Socket address to establish a connection with.
c_secs Number of seconds to block for a connection.
a_secs Number of seconds to block for when doing things after connection.
Returns:
APR error status value.

sul_str_replace const char *  src,
const char *  from,
char  to,
apr_pool_t *  pool
 

Parameters:
src 
from 
to 
pool 
Returns:

sul_string_makelower char *  str  ) 
 

Gets a lower case instance of the given string.

Parameters:
str String to convert to lowercase.
Returns:
A new lower case string.

sul_strtolower apr_pool_t *  pool,
const char *  str
 

Gets a lower case instance of the given string.

Parameters:
pool Pool to allocate memory overhead from.
str String to convert to lowercase.
Returns:
A new lower case string.

sul_tokenize_string apr_array_header_t **  toks,
const char *  str,
const char *  delims,
apr_pool_t *  pool
 

Parameters:
toks 
str 
delims 
pool 
Returns:


Generated on Wed Apr 28 09:38:38 2004 for State by doxygen 1.3.5