]> mj.ucw.cz Git - libucw.git/commitdiff
Removed xprintf() -- it was very ugly and its only raison d'etre was
authorMartin Mares <mj@ucw.cz>
Sun, 27 Oct 2002 13:22:34 +0000 (13:22 +0000)
committerMartin Mares <mj@ucw.cz>
Sun, 27 Oct 2002 13:22:34 +0000 (13:22 +0000)
the lack of bprintf().

lib/Makefile
lib/printf.c [deleted file]
lib/printf.h [deleted file]

index e8784f67ca3ea7b91a2cdd5e78bdb8b5e15943f9..ad93507dacf6dd896bd95e777525889f917e94a4 100644 (file)
@@ -8,7 +8,7 @@ LIBSH_MODS=alloc alloc_str ctmatch db fastbuf fb-file fb-mem lists \
        prime random realloc regex timer url wildmatch \
        wordsplit str_ctype str_upper bucket conf object sorter \
        finger proctitle ipaccess profile bitsig randomkey \
-       hashfunc base64 base224 fb-temp printf fb-mmap fb-printf
+       hashfunc base64 base224 fb-temp fb-mmap fb-printf
 LIBSH_MOD_PATHS=$(addprefix obj/lib/,$(LIBSH_MODS)) $(CUSTOM_MODULES)
 
 obj/lib/libsh.a: $(addsuffix .o,$(LIBSH_MOD_PATHS))
diff --git a/lib/printf.c b/lib/printf.c
deleted file mode 100644 (file)
index b6bf5d4..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *     Sherlock Library -- auto-resizable printf() functions
- *
- *     (c) 2002, Robert Spalek <robert@ucw.cz>
- *
- *     This software may be freely distributed and used according to the terms
- *     of the GNU Lesser General Public License.
- */
-
-#include "lib/lib.h"
-#include "lib/printf.h"
-
-#include <stdio.h>
-
-byte *
-vxprintf(char *msg, va_list v)
-{
-       static byte *buf = NULL;
-       static int buf_len = 0;
-       int len;
-       if (!buf)
-       {
-               buf_len = 1024;
-               buf = xmalloc(buf_len);
-       }
-       while (1)
-       {
-               len = vsnprintf(buf, buf_len, msg, v);
-               if (len >= 0 && len < buf_len)
-                       return buf;
-               else
-               {
-                       buf_len *= 2;
-                       if (len >= buf_len)
-                               buf_len = len + 1;
-                       buf = xrealloc(buf, buf_len);
-               }
-       }
-}
-
-byte *
-xprintf(char *msg, ...)
-{
-       byte *txt;
-       va_list v;
-       va_start(v, msg);
-       txt = vxprintf(msg, v);
-       va_end(v);
-       return txt;
-}
diff --git a/lib/printf.h b/lib/printf.h
deleted file mode 100644 (file)
index 977338e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *     Sherlock Library -- auto-resizable printf() functions
- *
- *     (c) 2002, Robert Spalek <robert@ucw.cz>
- *
- *     This software may be freely distributed and used according to the terms
- *     of the GNU Lesser General Public License.
- */
-
-#ifndef _LIB_PRINTF_H
-#define _LIB_PRINTF_H
-
-#include <stdarg.h>
-
-/* The following functions are NOT reentrable.  */
-
-byte *vxprintf(char *msg, va_list v);
-byte *xprintf(char *msg, ...) __attribute__((format(printf,1,2)));
-
-#endif