summaryrefslogtreecommitdiff
path: root/ioreplay/src/init/init.h
diff options
context:
space:
mode:
authorPaul Bütow <pbuetow@mimecast.com>2018-03-01 11:21:26 +0000
committerPaul Bütow <pbuetow@mimecast.com>2018-03-01 11:21:26 +0000
commit56f8cdff9aaa9bf00c5dc9441a7569374f2cbafb (patch)
treeb5b440b504b9879e241733fa38d19089fb3377b2 /ioreplay/src/init/init.h
initial commit0.1
Diffstat (limited to 'ioreplay/src/init/init.h')
-rw-r--r--ioreplay/src/init/init.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/ioreplay/src/init/init.h b/ioreplay/src/init/init.h
new file mode 100644
index 0000000..3d9f9e9
--- /dev/null
+++ b/ioreplay/src/init/init.h
@@ -0,0 +1,64 @@
+// Copyright 2018 Mimecast Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef INIT_H
+#define INIT_H
+
+#include "../defaults.h"
+#include "../options.h"
+#include "../datas/amap.h"
+#include "../datas/rbuffer.h"
+#include "../mounts.h"
+
+typedef struct init_s_ {
+ amap_s *threads_map;
+ rbuffer_s *reuse_queue;
+ options_s *opts;
+ mounts_s *mounts;
+ FILE *replay_fd;
+ pthread_mutex_t reuse_queue_mutex;
+} init_s;
+
+/**
+ * @brief Creates a new init object
+ *
+ * @param opts The options object
+ * @return The new mounts object
+ */
+init_s* init_new(options_s *opts);
+
+/**
+ * @brief Destroys the init object
+ *
+ * @param i The init object
+ */
+void init_destroy(init_s *i);
+
+/**
+ * @brief Initialises the test environment
+ *
+ * @param opts The options object
+ * @return SUCCESS if initialised without any issues
+ */
+status_e init_run(options_s *opts);
+
+/**
+ * @brief Extracts some useful information from the .replay meta header
+ *
+ * @param i The init object
+ * @param init_offset To store the offset of the init section
+ */
+void init_extract_header(init_s *i, off_t *init_offset);
+
+#endif // INIT_H