Done with doxygenizing
[citadel.git] / webcit / snprintf.c
index 7db792c20827fea32b19e8a5dbd3fa51f3549dd2..91408df24fa1699463d5c668f36452edb2c3c85a 100644 (file)
@@ -1,12 +1,14 @@
 /*
- * modified from Sten Gunterberg's BUGTRAQ post of 22 Jul 1997
+ * $Id$
+ */
+/** 
+ * \defgroup SnprintfReplacement modified from Sten Gunterberg's BUGTRAQ post of 22 Jul 1997
  * --nathan bryant <bryant@cs.usm.maine.edu>
  *
- * $Id$
  */
-
-/*
- * Replacements for snprintf() and vsnprintf()
+/*@{*/
+/**
+ * \brief Replacements for snprintf() and vsnprintf()
  *
  * Use it only if you have the "spare" cycles needed to effectively
  * do every snprintf operation twice! Why is that? Because everything
  * Written July 1997 by Sten Gunterberg (gunterberg@ergon.ch)
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
+#include "webcit.h"
 #include "webserver.h"
 
+/**
+ * \brief is it needed????
+ * \param fmt the formatstring?
+ * \param argp how many params?
+ */
 static int needed(const char *fmt, va_list argp)
 {
        static FILE *sink = NULL;
 
-       /* ok, there's a small race here that could result in the sink being
+       /**
+        * ok, there's a small race here that could result in the sink being
         * opened more than once if we're threaded, but I'd rather ignore it than
         * spend cycles synchronizing :-) */
 
@@ -45,6 +50,13 @@ static int needed(const char *fmt, va_list argp)
        return vfprintf(sink, fmt, argp);
 }
 
+/**
+ * \brief vsnprintf wrapper
+ * \param buf the output charbuffer
+ * \param max maximal size of the buffer
+ * \param fmt the formatstring (see man printf)
+ * \param argp the variable argument list 
+ */
 int vsnprintf(char *buf, size_t max, const char *fmt, va_list argp)
 {
        char *p;
@@ -63,6 +75,13 @@ int vsnprintf(char *buf, size_t max, const char *fmt, va_list argp)
        return size;
 }
 
+/**
+ * \brief snprintf wrapper
+ * \param buf the output charbuffer
+ * \param max maximal size of the buffer
+ * \param fmt the formatstring (see man printf)
+ * \param ... the variable argument list 
+ */
 int snprintf(char *buf, size_t max, const char *fmt,...)
 {
        va_list argp;
@@ -74,3 +93,7 @@ int snprintf(char *buf, size_t max, const char *fmt,...)
 
        return bytes;
 }
+
+
+
+/*@}*/