diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-02-11 11:43:25 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-02-11 11:43:25 -0500 |
commit | 9bd603b639d7dd08fbe0af7e8669358bd066b7cd (patch) | |
tree | 8207b9680cc33846ff7d9ce0c8917aa052766c43 /include/relocation.h | |
parent | b828cc647f63de48c6e24f5a1043e052eb99b2a2 (diff) | |
download | spmc-9bd603b639d7dd08fbe0af7e8669358bd066b7cd.tar.gz |
Refactor project structure:
* Move prototypes and definitions to respective header files
* Renamed strings.h to str.h to avoid collision with standard library header
Diffstat (limited to 'include/relocation.h')
-rw-r--r-- | include/relocation.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/relocation.h b/include/relocation.h new file mode 100644 index 0000000..128b2bd --- /dev/null +++ b/include/relocation.h @@ -0,0 +1,21 @@ +#ifndef SPM_RELOCATION_H +#define SPM_RELOCATION_H + +#define PREFIX_WRITE_BIN 0 +#define PREFIX_WRITE_TEXT 1 + +typedef struct { + char *prefix; + char *path; +} RelocationEntry; + +int relocate(const char *filename, const char *_oldstr, const char *_newstr); +void relocate_root(const char *destroot, const char *baseroot); +int replace_text(char *data, const char *_spattern, const char *_sreplacement); +int file_replace_text(char *filename, const char *spattern, const char *sreplacement); +RelocationEntry **prefixes_read(const char *filename); +void prefixes_free(RelocationEntry **entry); +int prefixes_write(const char *output_file, int mode, char **prefix, const char *tree); + + +#endif //SPM_RELOCATION_H |