I've done some minor bits of documentation update:
include/apr_file_info.txt
warning about cross-platform incompatibility in timestamps
vs. system time (previously submitted but not in CVS at this time,
maybe there's a pushback on it)
include/apr_lib.txt
documentation of apr_vformatter so it is now more readable and
has escape sequences listed instead of just extensions
(I had to go to the code to find the 'q' modifier)
include/apr_strings.txt
added links to apr_vformatter() from other functions that
discussed it, just makes it easier to track it down from the doc
Nothing major, just figured I could do them and save someone else the
trouble. If they're good enough someone needs to submit them for me. If
they suck there's always a convenient bit bucket.
mma
Index: include/apr_file_info.h
===================================================================
RCS file: /home/cvspublic/apr/include/apr_file_info.h,v
retrieving revision 1.40
diff -u -3 -r1.40 apr_file_info.h
--- include/apr_file_info.h 5 Mar 2003 21:22:25 -0000 1.40
+++ include/apr_file_info.h 30 Jun 2003 01:33:03 -0000
@@ -164,6 +164,20 @@
* @defgroup apr_file_stat Stat Functions
* @{
*/
+
+/**
+ * @warning
+ * File system timestamps are not stored with the same accuracy on all
+ * platforms. For example, on Windows 2000 they are stored to the
+ * microsecond whereas on Mandrake Linux 9.0 they are stored to the second.
+ * Code that compares the result of apr_time_now() (e.g. a 'file loaded'
+ * timestamp) to apr_finfo_t.mtime may only work on some platforms in
+ * extreme cases, such as when a file is modified within a second of its
+ * load time but the stored modification timestamp is actually earlier
+ * than the previous file loaded timetamp. If this is an issue, use
+ * apr_time_sec() on both operands when comparing times.
+ */
+
/** file info structure */
typedef struct apr_finfo_t apr_finfo_t;
Index: include/apr_lib.h
===================================================================
RCS file: /home/cvspublic/apr/include/apr_lib.h,v
retrieving revision 1.63
diff -u -3 -r1.63 apr_lib.h
--- include/apr_lib.h 17 Apr 2003 17:31:55 -0000 1.63
+++ include/apr_lib.h 30 Jun 2003 01:47:59 -0000
@@ -143,52 +143,75 @@
/**
* apr_vformatter() is a generic printf-style formatting routine
* with some extensions.
+ * @par
* @param flush_func The function to call when the buffer is full
* @param c The buffer to write to
* @param fmt The format string
* @param ap The arguments to use to fill out the format string.
- *
- * @remark
- * <PRE>
- * 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
- *
+ * @par Escape Sequences
+ * <dl>
+ * <dt>@c d </dt><dd>signed decimal integer</dd>
+ * <dt>@c i </dt><dd>signed decimal integer</dd>
+ * <dt>@c u </dt><dd>unsigned decimal integer</dd>
+ * <dt>@c o </dt><dd>unsigned octal</dd>
+ * <dt>@c x </dt><dd>unsigned hexadecimal (lowercase)
+ * <dt>@c X </dt><dd>unsigned hexadecimal (uppercase)
+ * <dt>@c c </dt><dd>single character</dd>
+ * <dt>@c s </dt><dd>string</dd>
+ * <dt>@c e </dt><dd>floating point with exponent 'e'</dd>
+ * <dt>@c E </dt><dd>floating point with exponent 'E'</dd>
+ * <dt>@c f </dt><dd>floating point without exponent</dd>
+ * <dt>@c g </dt><dd>floating point in most compact form of @c f or @c e </dd>
+ * <dt>@c G </dt><dd>floating point in most compact form of @c f or @c E </dd>
+ * <dt>@c n </dt><dd>number of characters written so far,
+ * written to integer at given address</dd>
+ * <dt>@c pA </dt><dd>takes a struct in_addr *,
+ * and prints it as @c a.b.c.d</dd>
+ * <dt>@c pI </dt><dd>takes an apr_sockaddr_t *
+ * and prints it as @c a.b.c.d:port
+ * or [ipv6-address] @c :port </dd>
+ * <dt>@c pT </dt><dd>takes an apr_os_thread_t * and prints it in decimal
+ * ('0' is printed if !APR_HAS_THREADS)</dd>
+ * <dt>@c pp </dt><dd>takes a void * and outputs it in hex</dd>
+ * </dl>
+ * @par
* 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
+ * @par Integer Width Modifiers
+ * <dl>
+ * <dt>@c q </dt><dd>quad</dd>
+ * <dt>@c l </dt><dd>long</dd>
+ * <dt>@em none </dt><dd>default</dd>
+ * <dt>@c h </dt><dd>short</dd>
+ * </dl>
+ * @par Output
+ * apr_vformatter allows for arbitrary output methods
* using the apr_vformatter_buff and flush_func.
- *
+ * @par
* 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).
- *
+ * @par
* If the end of output is reached, apr_vformatter returns the
* number of bytes written.
- *
+ * @par
* 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.
- *
+ * @par
* 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.
- *
+ * @remark
* 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"
@@ -199,7 +222,6 @@
* 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.
- * </PRE>
*/
APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b),
apr_vformatter_buff_t *c, const char *fmt,
Index: include/apr_strings.h
===================================================================
RCS file: /home/cvspublic/apr/include/apr_strings.h,v
retrieving revision 1.34
diff -u -3 -r1.34 apr_strings.h
--- include/apr_strings.h 5 Mar 2003 21:22:26 -0000 1.34
+++ include/apr_strings.h 30 Jun 2003 01:32:41 -0000
@@ -283,8 +283,8 @@
*/
/**
- * snprintf routine based on apr_vformatter. This means it understands the
- * same extensions.
+ * snprintf routine based on apr_vformatter().
+ * This means it understands the same extensions.
* @param buf The buffer to write to
* @param len The size of the buffer
* @param format The format string
@@ -295,8 +295,8 @@
__attribute__((format(printf,3,4)));
/**
- * vsnprintf routine based on apr_vformatter. This means it understands the
- * same extensions.
+ * vsnprintf routine based on apr_vformatter().
+ * This means it understands the same extensions.
* @param buf The buffer to write to
* @param len The size of the buffer
* @param format The format string