From: Martin Mares Date: Sat, 11 Feb 2012 11:20:31 +0000 (+0100) Subject: Merge branch 'dev-trans' X-Git-Tag: v5.0~74 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=ba1c173f544383aa6553a75dee6e6858d8f243a4;p=libucw.git Merge branch 'dev-trans' Conflicts: ucw/Makefile ucw/string.h --- ba1c173f544383aa6553a75dee6e6858d8f243a4 diff --cc ucw/Makefile index 1778ee84,15e56870..145792aa --- a/ucw/Makefile +++ b/ucw/Makefile @@@ -10,28 -10,31 +10,29 @@@ endi LIBUCW_MODS= \ threads \ alloc alloc_str realloc bigalloc mempool mempool-str mempool-fmt eltpool \ - mmap partmap hashfunc \ + partmap hashfunc \ slists simple-lists bitsig \ - log log-stream log-file log-syslog log-conf proctitle tbf \ + log log-stream log-file log-syslog log-conf tbf \ conf-alloc conf-dump conf-input conf-intr conf-journal conf-parse conf-section \ ipaccess \ - profile \ fastbuf ff-binary ff-string ff-printf ff-unicode ff-stkstring \ - fb-file carefulio fb-mem fb-temp tempfile fb-mmap fb-limfd fb-buffer fb-grow fb-pool fb-atomic fb-param fb-socket \ + fb-file fb-mem fb-temp tempfile fb-mmap fb-limfd fb-buffer fb-grow fb-pool fb-atomic fb-param fb-socket \ char-cat char-upper char-lower unicode stkstring \ wildmatch regex \ - prime primetable random timer randomkey \ + prime primetable random timer \ bit-ffs bit-fls \ url \ - mainloop main-block \ - exitstatus runcmd sighandler \ - lizard lizard-safe adler32 \ + mainloop main-block main-rec \ + proctitle exitstatus runcmd \ + lizard lizard-safe adler32 sighandler \ md5 sha1 sha1-hmac \ base64 base224 \ - sync \ - qache \ + io-careful io-sync io-mmap io-size \ - string str-esc str-split str-match str-imatch str-hex \ + string str-esc str-split str-match str-imatch str-hex str-fix \ bbuf gary \ getopt \ - strtonum + strtonum \ + resource trans res-fd res-mem res-subpool res-mempool res-eltpool LIBUCW_MAIN_INCLUDES= \ lib.h log.h threads.h \ @@@ -47,16 -50,18 +48,17 @@@ prime.h \ bitops.h \ conf.h getopt.h ipaccess.h \ - profile.h \ - fastbuf.h lfs.h ff-unicode.h ff-binary.h \ + fastbuf.h io.h ff-unicode.h ff-binary.h \ url.h \ mainloop.h \ - lizard.h \ - md5.h \ + process.h \ + lizard.h sighandler.h \ + md5.h sha1.h \ base64.h base224.h \ - qache.h \ kmp.h kmp-search.h binsearch.h \ partmap.h \ - strtonum.h + strtonum.h \ + resource.h trans.h ifdef CONFIG_UCW_THREADS # Some modules require threading diff --cc ucw/fb-atomic.c index 8b454485,227e324c..aef0018a --- a/ucw/fb-atomic.c +++ b/ucw/fb-atomic.c @@@ -9,8 -9,9 +9,9 @@@ #include "ucw/lib.h" #include "ucw/fastbuf.h" -#include "ucw/lfs.h" +#include "ucw/io.h" #include "ucw/conf.h" + #include "ucw/trans.h" #include #include diff --cc ucw/fb-param.c index 528765cb,e59444cb..e8d035b2 --- a/ucw/fb-param.c +++ b/ucw/fb-param.c @@@ -10,8 -10,9 +10,9 @@@ #include "ucw/lib.h" #include "ucw/conf.h" -#include "ucw/lfs.h" +#include "ucw/io.h" #include "ucw/fastbuf.h" + #include "ucw/trans.h" #include #include diff --cc ucw/string.h index 8cfe1645,b5faa9ac..8ec579c7 --- a/ucw/string.h +++ b/ucw/string.h @@@ -17,17 -17,21 +17,27 @@@ uns strnlen(const char *str, uns n); #endif + /** + * Format a set of flag bits. When the i-th bit of @flags is 1, + * set the i-th character of @dest to @fmt[i], otherwise to '-'. + **/ char *str_format_flags(char *dest, const char *fmt, uns flags); + + /** Counts occurrences of @chr in @str. **/ uns str_count_char(const char *str, uns chr); +/** Returns a non-zero value if @haystack starts with @needle. **/ +int str_starts_with(const char *haystack, const char *needle); + +/** Returns a non-zero value if @haystack ends with @needle. **/ +int str_ends_with(const char *haystack, const char *needle); + /* str-esc.c */ + /** + * Decode a string with backslash escape sequences as in C99 strings. + * It is safe to pass @dest equal to @src. + **/ char *str_unesc(char *dest, const char *src); /* str-split.c */