summaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-07-13 05:03:48 +0000
committermidipix <writeonce@midipix.org>2024-07-14 20:18:46 +0000
commit5ea1d7cd4b630a91b4a72fb722a937a107d76fc0 (patch)
tree034f126157e388b09a615989d959d6ac39402824 /src/internal
parentc1438ffaef9c2f9ae116ebc375db2cc1468c341c (diff)
downloadtpax-5ea1d7cd4b630a91b4a72fb722a937a107d76fc0.tar.bz2
tpax-5ea1d7cd4b630a91b4a72fb722a937a107d76fc0.tar.xz
driver: -s <replstr> support: implementation and integration.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/tpax_driver_impl.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/internal/tpax_driver_impl.h b/src/internal/tpax_driver_impl.h
index d340748..3df8244 100644
--- a/src/internal/tpax_driver_impl.h
+++ b/src/internal/tpax_driver_impl.h
@@ -7,6 +7,7 @@
#ifndef TPAX_DRIVER_IMPL_H
#define TPAX_DRIVER_IMPL_H
+#include <regex.h>
#include <stdint.h>
#include <dirent.h>
#include <stdio.h>
@@ -31,6 +32,9 @@
#define TPAX_ITEM_SYMLINK 0X4
#define TPAX_ITEM_NAMEREF 0x8
+#define TPAX_REPL_GLOBAL 0x01
+#define TPAX_REPL_PRINT 0x02
+
extern const struct argv_option tpax_default_options[];
enum app_tags {
@@ -45,6 +49,7 @@ enum app_tags {
TAG_FORMAT,
TAG_BLKSIZE,
TAG_OPTIONS,
+ TAG_REPLSTR,
TAG_RECURSE,
TAG_NORECURSE,
TAG_STRICT_PATH,
@@ -74,6 +79,14 @@ struct tpax_dirent_buffer {
struct tpax_dirent dbuf[];
};
+struct tpax_replstr {
+ const char * replarg;
+ const char * replstr;
+ const char * regexp;
+ regex_t regex;
+ uint32_t flags;
+};
+
struct tpax_driver_ctx_impl {
const char * file;
struct tpax_common_ctx cctx;
@@ -82,6 +95,8 @@ struct tpax_driver_ctx_impl {
const struct tpax_unit_ctx * euctx;
const char * eunit;
struct argv_keyval ** keyvalv;
+ struct tpax_replstr * replstrv;
+ char * replstrs;
struct tpax_error_info ** errinfp;
struct tpax_error_info ** erricap;
struct tpax_error_info * erriptr[64];