Main Page | Modules | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

General Purpose Library Routines


Data Structures

struct  apr_vformatter_buff_t

Defines

#define HUGE_STRING_LEN   8192
#define apr_killpg(x, y)   (killpg ((x), (y)))

Typedefs

typedef apr_vformatter_buff_t apr_vformatter_buff_t

Functions

 APR_DECLARE (const char *) apr_filepath_name_get(const char *pathname)
 APR_DECLARE (int) apr_vformatter(int(*flush_func)(apr_vformatter_buff_t *b)
 APR_DECLARE (apr_status_t) apr_password_get(const char *prompt
 APR_DECLARE (const char *)

Variables

apr_vformatter_buff_tc
apr_vformatter_buff_t const
char * 
fmt
apr_vformatter_buff_t const
char va_list 
ap
char * pwbuf
char apr_size_t * bufsize

Detailed Description

This is collection of oddballs that didn't fit anywhere else, and might move to more appropriate headers with the release of APR 1.0.

Define Documentation

#define apr_killpg x,
y   )     (killpg ((x), (y)))
 

apr_killpg Small utility macros to make things easier to read. Not usually a goal, to be sure..

Definition at line 101 of file apr_lib.h.

#define HUGE_STRING_LEN   8192
 

A constant representing a 'large' string.

Definition at line 52 of file apr_lib.h.


Typedef Documentation

typedef struct apr_vformatter_buff_t apr_vformatter_buff_t
 

See also:
apr_vformatter_buff_t

Definition at line 59 of file apr_lib.h.


Function Documentation

APR_DECLARE const char *   ) 
 

Deprecated:
See also:
apr_filepath_name_get

Definition at line 128 of file netware/dso.c.

APR_DECLARE apr_status_t   )  const
 

Display a prompt and read in the password from stdin.

Parameters:
prompt The prompt to display
pwbuf Buffer to store the password
bufsize The length of the password buffer.

APR_DECLARE int   ) 
 

apr_vformatter() is a generic printf-style formatting routine with some extensions.

Parameters:
flush_func The function to call when the buffer is full
c The buffer to write to
fmt The format string
ap The arguments to use to fill out the format string.
Remarks:
 The extensions are:
%pA takes a struct in_addr *, and prints it as a.b.c.d %pI takes an apr_sockaddr_t * and prints it as a.b.c.d:port or [ipv6-address]:port %pT takes an apr_os_thread_t * and prints it in decimal ('0' is printed if !APR_HAS_THREADS) %pp takes a void * and outputs it in hex

 The %p hacks are to force gcc's printf warning code to skip
 over a pointer argument without complaining.  This does
 mean that the ANSI-style %p (output a void * in hex format) won't
 work as expected at all, but that seems to be a fair trade-off
 for the increased robustness of having printf-warnings work.

 Additionally, apr_vformatter allows for arbitrary output methods
 using the apr_vformatter_buff and flush_func.

 The apr_vformatter_buff has two elements curpos and endpos.
 curpos is where apr_vformatter will write the next byte of output.
 It proceeds writing output to curpos, and updating curpos, until
 either the end of output is reached, or curpos == endpos (i.e. the
 buffer is full).

 If the end of output is reached, apr_vformatter returns the
 number of bytes written.

 When the buffer is full, the flush_func is called.  The flush_func
 can return -1 to indicate that no further output should be attempted,
 and apr_vformatter will return immediately with -1.  Otherwise
 the flush_func should flush the buffer in whatever manner is
 appropriate, re apr_pool_t nitialize curpos and endpos, and return 0.

 Note that flush_func is only invoked as a result of attempting to
 write another byte at curpos when curpos >= endpos.  So for
 example, it's possible when the output exactly matches the buffer
 space available that curpos == endpos will be true when
 apr_vformatter returns.

 apr_vformatter does not call out to any other code, it is entirely
 self-contained.  This allows the callers to do things which are
 otherwise "unsafe".  For example, apr_psprintf uses the "scratch"
 space at the unallocated end of a block, and doesn't actually
 complete the allocation until apr_vformatter returns.  apr_psprintf
 would be completely broken if apr_vformatter were to call anything
 that used this same pool.  Similarly http_bprintf() uses the "scratch"
 space at the end of its output buffer, and doesn't actually note
 that the space is in use until it either has to flush the buffer
 or until apr_vformatter returns.
 

APR_DECLARE const char *   )  const
 

Get the value associated with a given key from the table. After this call, The data is still in the table

Parameters:
t The table to search for the key
key The key to search for
Returns:
The value associated with the key


Variable Documentation

apr_size_t const char va_list ap
 

Definition at line 267 of file apr_strings.h.

Referenced by APR_DECLARE_NONSTD(), find_allowdeny(), ignore_entry(), log_err(), magic_rsl_printf(), and rewritelog().

char apr_size_t* bufsize
 

Definition at line 176 of file apr_lib.h.

apr_vformatter_buff_t* c
 

Definition at line 167 of file apr_lib.h.

apr_vformatter_buff_t const char* fmt
 

Definition at line 167 of file apr_lib.h.

char* pwbuf
 

Definition at line 176 of file apr_lib.h.

Referenced by APR_DECLARE(), and getpwnam_safe().