From 90bcd26d254db8411ddbd079ce089e022c8fe062 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 25 Jun 2008 20:42:36 +0200 Subject: [PATCH] Moved matching and splitting functions to lib/str-*.c. --- lib/Makefile | 4 ++-- lib/{patimatch.c => str-imatch.c} | 2 +- lib/{patmatch.c => str-match.c} | 2 +- lib/{patmatch.h => str-match.h} | 0 lib/{wordsplit.c => str-split.c} | 0 lib/string.h | 11 ++++++++--- 6 files changed, 12 insertions(+), 7 deletions(-) rename lib/{patimatch.c => str-imatch.c} (93%) rename lib/{patmatch.c => str-match.c} (92%) rename lib/{patmatch.h => str-match.h} (100%) rename lib/{wordsplit.c => str-split.c} (100%) diff --git a/lib/Makefile b/lib/Makefile index 6df66820..13999541 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -20,7 +20,7 @@ LIBUCW_MODS= \ fastbuf ff-binary ff-string ff-printf ff-unicode \ fb-file carefulio fb-mem fb-temp fb-mmap fb-limfd fb-buffer fb-grow fb-pool fb-atomic fb-param fb-socket \ str_ctype str_upper str_lower unicode stkstring \ - wildmatch wordsplit ctmatch patimatch patmatch regex \ + wildmatch ctmatch regex \ prime primetable random timer randomkey \ bit-ffs bit-fls \ db \ @@ -31,7 +31,7 @@ LIBUCW_MODS= \ base64 base224 \ sync \ qache \ - string str-esc \ + string str-esc str-split str-match str-imatch \ bbuf \ getopt diff --git a/lib/patimatch.c b/lib/str-imatch.c similarity index 93% rename from lib/patimatch.c rename to lib/str-imatch.c index ea5a4be9..9d739efd 100644 --- a/lib/patimatch.c +++ b/lib/str-imatch.c @@ -13,4 +13,4 @@ #define Convert(x) Cupcase(x) #define MATCH_FUNC_NAME str_match_pattern_nocase -#include "lib/patmatch.h" +#include "lib/str-match.h" diff --git a/lib/patmatch.c b/lib/str-match.c similarity index 92% rename from lib/patmatch.c rename to lib/str-match.c index 373054ad..839da6ca 100644 --- a/lib/patmatch.c +++ b/lib/str-match.c @@ -12,4 +12,4 @@ #define Convert(x) (x) #define MATCH_FUNC_NAME str_match_pattern -#include "lib/patmatch.h" +#include "lib/str-match.h" diff --git a/lib/patmatch.h b/lib/str-match.h similarity index 100% rename from lib/patmatch.h rename to lib/str-match.h diff --git a/lib/wordsplit.c b/lib/str-split.c similarity index 100% rename from lib/wordsplit.c rename to lib/str-split.c diff --git a/lib/string.h b/lib/string.h index a9de082f..50c4dc47 100644 --- a/lib/string.h +++ b/lib/string.h @@ -11,15 +11,20 @@ #ifndef _UCW_STRING_H #define _UCW_STRING_H -char *str_unesc(char *dest, const char *src); +/* string.c */ + char *str_format_flags(char *dest, const char *fmt, uns flags); -/* wordsplit.c */ +/* str-esc.c */ + +char *str_unesc(char *dest, const char *src); + +/* str-split.c */ int str_sepsplit(char *str, uns sep, char **rec, uns max); int str_wordsplit(char *str, char **rec, uns max); -/* pat(i)match.c: Matching of shell patterns */ +/* str-(i)match.c: Matching of shell patterns */ int str_match_pattern(const char *patt, const char *str); int str_match_pattern_nocase(const char *patt, const char *str); -- 2.39.2