1.1 --- a/libe2access/host/ops.h Sun Mar 06 01:30:32 2022 +0100
1.2 +++ b/libe2access/host/ops.h Sun Mar 06 18:20:32 2022 +0100
1.3 @@ -1,5 +1,5 @@
1.4 /*
1.5 - * Operations.
1.6 + * Operations and their invocation.
1.7 *
1.8 * Copyright (C) 2022 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 @@ -21,12 +21,37 @@
1.11
1.12 #pragma once
1.13
1.14 +#include <ext2fs/ext2fs.h>
1.15 +
1.16 +/* Invocation support. */
1.17 +
1.18 +enum op_results
1.19 +{
1.20 + OP_SUCCESS = 0,
1.21 + OP_FAILED = 1,
1.22 + OP_UNKNOWN = 2,
1.23 +};
1.24 +
1.25 +int handle_op_result(const char *operation, enum op_results op_result);
1.26 +enum op_results run_operation(ext2_filsys fs, const char *operation, int argc, char *argv[]);
1.27 +
1.28 +/* Operations exposed by the program. */
1.29 +
1.30 +typedef int (*op_sig)(ext2_filsys, int, char *[]);
1.31 +
1.32 +struct operation
1.33 +{
1.34 + const char *name;
1.35 + op_sig fn;
1.36 +};
1.37 +
1.38 int copy_in(ext2_filsys fs, int argc, char *argv[]);
1.39 int copy_out(ext2_filsys fs, int argc, char *argv[]);
1.40 int list(ext2_filsys fs, int argc, char *argv[]);
1.41 int make_dirs(ext2_filsys fs, int argc, char *argv[]);
1.42 int remove_dirs(ext2_filsys fs, int argc, char *argv[]);
1.43 int remove_non_dirs(ext2_filsys fs, int argc, char *argv[]);
1.44 +int run_script(ext2_filsys fs, int argc, char *argv[]);
1.45 int stat_objects(ext2_filsys fs, int argc, char *argv[]);
1.46
1.47 /* vim: tabstop=4 expandtab shiftwidth=4