Rizin
unix-like reverse engineering framework and cli tools
rz_project.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2020-2021 Florian Märkl <info@florianmaerkl.de>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #ifndef RZ_PROJECT_H
5 #define RZ_PROJECT_H
6 
7 #include <rz_util/rz_serialize.h>
8 #include <rz_core.h>
9 #include <sdb.h>
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 #define RZ_PROJECT_VERSION 8
16 
17 typedef Sdb RzProject;
18 
19 typedef enum rz_project_err {
30 
32 RZ_API RzProjectErr rz_project_save(RzCore *core, RzProject *prj, const char *file);
36 
41 RZ_API RzProjectErr rz_project_load(RzCore *core, RzProject *prj, bool load_bin_io, RZ_NULLABLE const char *file, RzSerializeResultInfo *res);
42 
47 RZ_API RzProjectErr rz_project_load_file(RzCore *core, const char *file, bool load_bin_io, RzSerializeResultInfo *res);
48 
52 RZ_API bool rz_project_migrate(RzProject *prj, unsigned long version, RzSerializeResultInfo *res);
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #endif
static bool err
Definition: armass.c:435
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
Definition: compress.c:68
#define RZ_API
RZ_API bool rz_project_migrate_v2_v3(RzProject *prj, RzSerializeResultInfo *res)
Sdb RzProject
Definition: rz_project.h:17
RZ_API RzProjectErr rz_project_save(RzCore *core, RzProject *prj, const char *file)
Definition: project.c:35
RZ_API void rz_project_free(RzProject *prj)
Definition: project.c:129
rz_project_err
Definition: rz_project.h:19
@ RZ_PROJECT_ERR_MIGRATION_FAILED
Definition: rz_project.h:26
@ RZ_PROJECT_ERR_COMPRESSION_FAILED
Definition: rz_project.h:27
@ RZ_PROJECT_ERR_NEWER_VERSION
Definition: rz_project.h:24
@ RZ_PROJECT_ERR_SUCCESS
Definition: rz_project.h:20
@ RZ_PROJECT_ERR_INVALID_CONTENTS
Definition: rz_project.h:25
@ RZ_PROJECT_ERR_INVALID_TYPE
Definition: rz_project.h:22
@ RZ_PROJECT_ERR_FILE
Definition: rz_project.h:21
@ RZ_PROJECT_ERR_INVALID_VERSION
Definition: rz_project.h:23
@ RZ_PROJECT_ERR_UNKNOWN
Definition: rz_project.h:28
RZ_API bool rz_project_migrate_v1_v2(RzProject *prj, RzSerializeResultInfo *res)
RZ_API bool rz_project_migrate_v3_v4(RzProject *prj, RzSerializeResultInfo *res)
RZ_API RzProjectErr rz_project_load(RzCore *core, RzProject *prj, bool load_bin_io, RZ_NULLABLE const char *file, RzSerializeResultInfo *res)
Definition: project.c:133
RZ_API RZ_NONNULL const char * rz_project_err_message(RzProjectErr err)
Definition: project.c:11
RZ_API RzProjectErr rz_project_load_file(RzCore *core, const char *file, bool load_bin_io, RzSerializeResultInfo *res)
Definition: project.c:168
RZ_API RzProjectErr rz_project_save_file(RzCore *core, const char *file, bool compress)
Definition: project.c:42
enum rz_project_err RzProjectErr
RZ_API RzProject * rz_project_load_file_raw(const char *file)
Load a file into an RzProject but don't actually migrate anything or load it into an RzCore.
Definition: project.c:88
RZ_API bool rz_project_migrate(RzProject *prj, unsigned long version, RzSerializeResultInfo *res)
Migrate the given project to the current version in-place.
#define RZ_NULLABLE
Definition: rz_types.h:65
#define RZ_NONNULL
Definition: rz_types.h:64
Definition: gzappend.c:170
Definition: sdb.h:63