]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/string.c
tableprinter: definition of the table separated from handle
[libucw.git] / ucw / string.c
index bd9303ee8142a92b548e18580830705d3a1e3eab..29cfa42b5e50699de6fd5f4e62645fbb380c8d15 100644 (file)
@@ -2,7 +2,7 @@
  *     UCW Library -- String Routines
  *
  *     (c) 2006 Pavel Charvat <pchar@ucw.cz>
- *     (c) 2007--2008 Martin Mares <mj@ucw.cz>
+ *     (c) 2007--2012 Martin Mares <mj@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU Lesser General Public License.
 
 #undef LOCAL_DEBUG
 
-#include "ucw/lib.h"
-#include "ucw/string.h"
+#include <ucw/lib.h>
+#include <ucw/string.h>
 
 #ifdef CONFIG_DARWIN
-uns
-strnlen(const char *str, uns n)
+size_t
+strnlen(const char *str, size_t n)
 {
   const char *end = str + n;
   const char *c;
@@ -25,10 +25,10 @@ strnlen(const char *str, uns n)
 #endif
 
 char *
-str_format_flags(char *dest, const char *fmt, uns flags)
+str_format_flags(char *dest, const char *fmt, uint flags)
 {
   char *start = dest;
-  for (uns i=0; fmt[i]; i++)
+  for (uint i=0; fmt[i]; i++)
     {
       if (flags & (1 << i))
        *dest++ = fmt[i];
@@ -39,11 +39,11 @@ str_format_flags(char *dest, const char *fmt, uns flags)
   return start;
 }
 
-uns
-str_count_char(const char *str, uns chr)
+size_t
+str_count_char(const char *str, uint chr)
 {
   const byte *s = str;
-  uns i = 0;
+  size_t i = 0;
   while (*s)
     if (*s++ == chr)
       i++;