diff options
-rw-r--r-- | include/tpax/tpax.h | 12 | ||||
-rw-r--r-- | src/driver/tpax_driver_ctx.c | 10 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/tpax/tpax.h b/include/tpax/tpax.h index 1ea9887..bb6aae7 100644 --- a/include/tpax/tpax.h +++ b/include/tpax/tpax.h @@ -63,6 +63,17 @@ extern "C" { #define TPAX_DRIVER_STRICT_DEVICE_ID 0X10000000 +/* source data flags */ +#define TPAX_SOURCE_DATA_NONE 0x0000 +#define TPAX_SOURCE_DATA_PENDING 0x0001 +#define TPAX_SOURCE_DATA_OPENED 0x0002 +#define TPAX_SOURCE_DATA_CLOSED 0x0004 + +#define TPAX_SOURCE_DATA_FILEIO 0X0010 +#define TPAX_SOURCE_DATA_MAPPED 0x0020 +#define TPAX_SOURCE_DATA_CACHED 0x0040 +#define TPAX_SOURCE_DATA_ERROR 0x0080 + /* error flags */ #define TPAX_ERROR_TOP_LEVEL 0x0001 #define TPAX_ERROR_NESTED 0x0002 @@ -119,6 +130,7 @@ struct tpax_common_ctx { uint64_t drvflags; uint64_t actflags; uint64_t fmtflags; + uint64_t srcflags; uint32_t blksize; }; diff --git a/src/driver/tpax_driver_ctx.c b/src/driver/tpax_driver_ctx.c index 6a5f882..4ad7fe6 100644 --- a/src/driver/tpax_driver_ctx.c +++ b/src/driver/tpax_driver_ctx.c @@ -818,6 +818,8 @@ int tpax_lib_get_driver_ctx( } else if (archive) { memcpy(&lfdctx,fdctx,sizeof(*fdctx)); + cctx.srcflags = TPAX_SOURCE_DATA_PENDING; + lfdctx.fdin = openat( fdctx->fdcwd, archive->arg, @@ -829,7 +831,15 @@ int tpax_lib_get_driver_ctx( program,archive->arg, meta,false); + cctx.srcflags = TPAX_SOURCE_DATA_OPENED; + fdctx = &lfdctx; + + } else if (cctx.drvflags & TPAX_DRIVER_EXEC_MODE_WRITE) { + cctx.srcflags = TPAX_SOURCE_DATA_NONE; + + } else { + cctx.srcflags = TPAX_SOURCE_DATA_PENDING; } /* not implemented mode(s) */ |