]> mj.ucw.cz Git - libucw.git/commitdiff
Renamed fb-printf to ff-printf to keep fastbuf front-ends and back-ends apart.
authorMartin Mares <mj@ucw.cz>
Sat, 10 Jul 2004 20:39:31 +0000 (20:39 +0000)
committerMartin Mares <mj@ucw.cz>
Sat, 10 Jul 2004 20:39:31 +0000 (20:39 +0000)
lib/Makefile
lib/fb-printf.c [deleted file]
lib/ff-printf.c [new file with mode: 0644]

index 5297668f71c44a384395d7dddf239ec124c3c1bf..d46c02e1f8e5f77a676bd9ac1f6963a4e9ac5b7f 100644 (file)
@@ -9,7 +9,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 str_lower bucket conf object sorter \
        finger proctitle ipaccess profile bitsig randomkey \
-       hashfunc base64 base224 fb-temp fb-mmap fb-printf urlkey \
+       hashfunc base64 base224 fb-temp fb-mmap ff-printf urlkey \
        partmap fb-limfd fb-buffer mainloop exitstatus runcmd carefulio \
        lizard lizard-safe sighandler buck2obj obj2buck \
        unicode-utf8 ff-utf8
diff --git a/lib/fb-printf.c b/lib/fb-printf.c
deleted file mode 100644 (file)
index 395e04b..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *     Sherlock Library -- Printf on Fastbuf Streams
- *
- *     (c) 2002 Martin Mares <mj@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/fastbuf.h"
-
-#include <alloca.h>
-
-int
-vbprintf(struct fastbuf *b, byte *msg, va_list args)
-{
-  byte *buf;
-  int r, len = 256;
-
-  while (1)
-    {
-      buf = alloca(len);
-      r = vsnprintf(buf, len, msg, args);
-      if (r < 0)
-       len += len;
-      else if (r < len)
-       {
-         bwrite(b, buf, r);
-         return r;
-       }
-      else
-       len = r+1;
-    }
-}
-
-int
-bprintf(struct fastbuf *b, byte *msg, ...)
-{
-  va_list args;
-  int res;
-
-  va_start(args, msg);
-  res = vbprintf(b, msg, args);
-  va_end(args);
-  return res;
-}
-
-#ifdef TEST
-
-int main(void)
-{
-  struct fastbuf *b = bfdopen_shared(1, 65536);
-  bprintf(b, "13=%d str=<%s> msg=%m\n", 13, "str");
-  bclose(b);
-  return 0;
-}
-
-#endif
diff --git a/lib/ff-printf.c b/lib/ff-printf.c
new file mode 100644 (file)
index 0000000..395e04b
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ *     Sherlock Library -- Printf on Fastbuf Streams
+ *
+ *     (c) 2002 Martin Mares <mj@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/fastbuf.h"
+
+#include <alloca.h>
+
+int
+vbprintf(struct fastbuf *b, byte *msg, va_list args)
+{
+  byte *buf;
+  int r, len = 256;
+
+  while (1)
+    {
+      buf = alloca(len);
+      r = vsnprintf(buf, len, msg, args);
+      if (r < 0)
+       len += len;
+      else if (r < len)
+       {
+         bwrite(b, buf, r);
+         return r;
+       }
+      else
+       len = r+1;
+    }
+}
+
+int
+bprintf(struct fastbuf *b, byte *msg, ...)
+{
+  va_list args;
+  int res;
+
+  va_start(args, msg);
+  res = vbprintf(b, msg, args);
+  va_end(args);
+  return res;
+}
+
+#ifdef TEST
+
+int main(void)
+{
+  struct fastbuf *b = bfdopen_shared(1, 65536);
+  bprintf(b, "13=%d str=<%s> msg=%m\n", 13, "str");
+  bclose(b);
+  return 0;
+}
+
+#endif