]> mj.ucw.cz Git - libucw.git/commitdiff
Gone (some functions moved to the main lib, some were unused).
authorMartin Mares <mj@ucw.cz>
Sat, 10 Jul 2004 20:36:06 +0000 (20:36 +0000)
committerMartin Mares <mj@ucw.cz>
Sat, 10 Jul 2004 20:36:06 +0000 (20:36 +0000)
charset/debug.c [deleted file]
charset/strlen.c [deleted file]
charset/utf8.c [deleted file]

diff --git a/charset/debug.c b/charset/debug.c
deleted file mode 100644 (file)
index 197739b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *     The UniCode Library -- Debugging Support Functions
- *
- *     (c) 1997 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 "charset/unicode.h"
-
-static byte *
-get_static_buffer(uns size)
-{
-  static byte *static_debug_buffer;
-  static uns static_debug_size;
-
-  if (!static_debug_buffer)
-    {
-      if (size < 1024)
-       size = 1024;
-      static_debug_buffer = xmalloc(size);
-      static_debug_size = size;
-    }
-  else if (static_debug_size < size)
-    {
-      size = (size+1023) & ~1023;
-      static_debug_buffer = xrealloc(static_debug_buffer, size);
-      static_debug_size = size;
-    }
-  return static_debug_buffer;
-}
-
-byte *
-static_ucs2_to_utf8(word *w)
-{
-  byte *buf = get_static_buffer(Ustrlen(w) * 3 + 1);
-
-  ucs2_to_utf8(buf, w);
-  return buf;
-}
diff --git a/charset/strlen.c b/charset/strlen.c
deleted file mode 100644 (file)
index 1fb0f75..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *     The UniCode Library -- String Length
- *
- *     (c) 1997--2003 Martin Mares <mj@ucw.cz>
- *     (c) 2003 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 "charset/unicode.h"
-
-uns
-Ustrlen(word *w)
-{
-  word *z = w;
-
-  while (*z)
-    z++;
-  return z - w;
-}
-
-uns
-utf8_strlen(byte *str)
-{
-  uns len = 0;
-  while (*str)
-    {
-      UTF8_SKIP(str);
-      len++;
-    }
-  return len;
-}
-
-uns
-utf8_strnlen(byte *str, uns n)
-{
-  uns len = 0;
-  byte *end = str + n;
-  while (str < end)
-    {
-      UTF8_SKIP(str);
-      len++;
-    }
-  return len;
-}
diff --git a/charset/utf8.c b/charset/utf8.c
deleted file mode 100644 (file)
index 09f924a..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *     The UniCode Library -- UTF-8 Functions
- *
- *     (c) 1997 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 "charset/unicode.h"
-
-uns
-ucs2_to_utf8(byte *d, word *s)
-{
-  byte *d0 = d;
-
-  while (*s)
-    {
-      uns u = *s++;
-      PUT_UTF8(d,u);
-    }
-  *d = 0;
-  return d - d0;
-}
-
-uns
-utf8_to_ucs2(word *d, byte *s)
-{
-  word *d0 = d;
-
-  while (*s)
-    if (IS_UTF8(*s))
-      {
-       uns u;
-       GET_UTF8_CHAR(s,u);
-       *d++ = u;
-      }
-    else if (*s >= 0x80)
-      *d++ = UNI_REPLACEMENT;
-    else
-      *d++ = *s++;
-  *d = 0;
-  return d - d0;
-}