aboutsummaryrefslogtreecommitdiff
path: root/src/resources.h
diff options
context:
space:
mode:
authorJan Sucan <jan@jansucan.com>2022-06-18 08:50:45 +0200
committerJan Sucan <jan@jansucan.com>2022-06-18 08:50:54 +0200
commit948a65cf39c8ce31c5adc0f24979e0cb55bc33c3 (patch)
treeae923f4594fef0abb777f63291d62530c345b229 /src/resources.h
parente1d10bea5d9fc94ba800ade1de430c7f3c0ccacd (diff)
Refactor the command line interface
Select operation by its name instead of by number of the arguments.
Diffstat (limited to 'src/resources.h')
-rw-r--r--src/resources.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/resources.h b/src/resources.h
index 3c6e768..3cc0dff 100644
--- a/src/resources.h
+++ b/src/resources.h
@@ -27,6 +27,9 @@
#ifndef RESOURCES_H
#define RESOURCES_H
+#include "operation_id.h"
+#include "options.h"
+
#include <stdio.h>
typedef struct {
@@ -37,9 +40,35 @@ typedef struct {
char *in_buffer;
char *ref_buffer;
char *out_buffer;
+
+ size_t out_buffer_size;
+} resources_backup_t;
+
+typedef struct {
+ FILE *in_file;
+ FILE *out_file;
+
+ char *in_buffer;
+ char *out_buffer;
+
+ size_t in_sector_size;
+ size_t in_buffer_size;
+} resources_restore_t;
+
+typedef struct {
+ operation_id_t operation_id;
+
+ union {
+ resources_backup_t backup;
+ resources_restore_t restore;
+ } res;
} resources_t;
-void resources_init(resources_t *const res);
+int resources_allocate(const options_t *const opts, resources_t *const res);
+const resources_backup_t *
+resources_get_for_backup(const resources_t *const res);
+const resources_restore_t *
+resources_get_for_restore(const resources_t *const res);
void resources_free(resources_t *const res);
#endif /* RESOURCES_H */