]> mj.ucw.cz Git - libucw.git/blob - ucw/string.c
The big move. Step #1: Move whole lib/ to ucw/.
[libucw.git] / ucw / string.c
1 /*
2  *      UCW Library -- String Routines
3  *
4  *      (c) 2006 Pavel Charvat <pchar@ucw.cz>
5  *      (c) 2007 Martin Mares <mj@ucw.cz>
6  *
7  *      This software may be freely distributed and used according to the terms
8  *      of the GNU Lesser General Public License.
9  */
10
11 #undef LOCAL_DEBUG
12
13 #include "ucw/lib.h"
14 #include "ucw/string.h"
15
16 char *
17 str_format_flags(char *dest, const char *fmt, uns flags)
18 {
19   char *start = dest;
20   for (uns i=0; fmt[i]; i++)
21     {
22       if (flags & (1 << i))
23         *dest++ = fmt[i];
24       else
25         *dest++ = '-';
26     }
27   *dest = 0;
28   return start;
29 }