diff options
author | data-man <dataman@tutanota.com> | 2022-01-24 13:34:09 +0500 |
---|---|---|
committer | data-man <dataman@tutanota.com> | 2022-01-24 13:34:09 +0500 |
commit | 09124f64f6eb332e49b4d13c4975fc36260f7f2b (patch) | |
tree | b42d6a07a33051879f1ebd680ac01730e9fc632f | |
parent | 475bc25800451c76d9a721fb35628693758a15e0 (diff) | |
download | bfs-09124f64f6eb332e49b4d13c4975fc36260f7f2b.tar.xz |
Simplifying
-rw-r--r-- | eval.c | 7 | ||||
-rw-r--r-- | expr.h | 7 | ||||
-rw-r--r-- | parse.c | 7 | ||||
-rw-r--r-- | regexp.h | 26 | ||||
-rw-r--r-- | util.c | 7 | ||||
-rw-r--r-- | util.h | 8 |
6 files changed, 31 insertions, 31 deletions
@@ -37,6 +37,7 @@ #include "time.h" #include "trie.h" #include "util.h" +#include "regexp.h" #include <assert.h> #include <errno.h> #include <fcntl.h> @@ -54,12 +55,6 @@ #include <unistd.h> #include <wchar.h> -#ifdef USE_ONIGURUMA - #include <onigposix.h> -#else - #include <regex.h> -#endif - struct eval_state { /** Data about the current file. */ const struct BFTW *ftwbuf; @@ -25,18 +25,13 @@ #include "eval.h" #include "exec.h" #include "printf.h" +#include "regexp.h" #include "stat.h" #include <stdbool.h> #include <stddef.h> #include <sys/types.h> #include <time.h> -#ifdef USE_ONIGURUMA - #include <onigposix.h> -#else - #include <regex.h> -#endif - /** * Possible types of numeric comparison. */ @@ -41,6 +41,7 @@ #include "time.h" #include "typo.h" #include "util.h" +#include "regexp.h" #include <assert.h> #include <errno.h> #include <fcntl.h> @@ -59,12 +60,6 @@ #include <time.h> #include <unistd.h> -#ifdef USE_ONIGURUMA - #include <onigposix.h> -#else - #include <regex.h> -#endif - // Strings printed by -D tree for "fake" expressions static char *fake_and_arg = "-a"; static char *fake_false_arg = "-false"; diff --git a/regexp.h b/regexp.h new file mode 100644 index 0000000..14da4d5 --- /dev/null +++ b/regexp.h @@ -0,0 +1,26 @@ +/**************************************************************************** + * bfs * + * Copyright (C) 2016-2022 Tavian Barnes <tavianator@tavianator.com> * + * * + * Permission to use, copy, modify, and/or distribute this software for any * + * purpose with or without fee is hereby granted. * + * * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * + ****************************************************************************/ + +#ifndef BFS_REGEXP_H +#define BFS_REGEXP_H + +#ifdef USE_ONIGURUMA + #include <onigposix.h> +#else + #include <regex.h> +#endif + +#endif // BFS_REGEXP_H @@ -16,6 +16,7 @@ #include "util.h" #include "dstring.h" +#include "regexp.h" #include <assert.h> #include <errno.h> #include <fcntl.h> @@ -29,12 +30,6 @@ #include <sys/types.h> #include <unistd.h> -#ifdef USE_ONIGURUMA - #include <onigposix.h> -#else - #include <regex.h> -#endif - #if BFS_HAS_SYS_PARAM # include <sys/param.h> #endif @@ -20,7 +20,7 @@ #ifndef BFS_UTIL_H #define BFS_UTIL_H - +#include "regexp.h" #include <fcntl.h> #include <fnmatch.h> #include <stdbool.h> @@ -28,12 +28,6 @@ #include <stdio.h> #include <sys/types.h> -#ifdef USE_ONIGURUMA - #include <onigposix.h> -#else - #include <regex.h> -#endif - // Some portability concerns #ifdef __has_feature |