From: Martin Mares Date: Sun, 27 Oct 2002 13:22:34 +0000 (+0000) Subject: Removed xprintf() -- it was very ugly and its only raison d'etre was X-Git-Tag: holmes-import~1316 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=0c53af3db5fdca461f49998194ecbfd8f55b7a8a;p=libucw.git Removed xprintf() -- it was very ugly and its only raison d'etre was the lack of bprintf(). --- diff --git a/lib/Makefile b/lib/Makefile index e8784f67..ad93507d 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -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 index b6bf5d4a..00000000 --- a/lib/printf.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Sherlock Library -- auto-resizable printf() functions - * - * (c) 2002, Robert Spalek - * - * 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 - -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 index 977338ee..00000000 --- a/lib/printf.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Sherlock Library -- auto-resizable printf() functions - * - * (c) 2002, Robert Spalek - * - * 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 - -/* The following functions are NOT reentrable. */ - -byte *vxprintf(char *msg, va_list v); -byte *xprintf(char *msg, ...) __attribute__((format(printf,1,2))); - -#endif