diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2016-01-02 21:50:29 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2016-01-02 21:50:29 +0100 |
commit | 3567c7b73a193cf64793efe59416321e290de7ba (patch) | |
tree | 5994cc58e9b0570e4b2144d3a0b116378c3ca6f6 /src/settings.h | |
parent | typo (diff) | |
download | radharc-3567c7b73a193cf64793efe59416321e290de7ba.tar.gz radharc-3567c7b73a193cf64793efe59416321e290de7ba.tar.bz2 radharc-3567c7b73a193cf64793efe59416321e290de7ba.tar.xz |
marshal settings
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to 'src/settings.h')
-rw-r--r-- | src/settings.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/settings.h b/src/settings.h index b1909bb..980c6f6 100644 --- a/src/settings.h +++ b/src/settings.h @@ -91,6 +91,7 @@ struct settings { /** * Pathname to the hook script. + * Do not free this. */ char *hookpath; @@ -122,6 +123,7 @@ struct settings { /** * Values for -d, -e, and -m, in order. + * Do not free its elements. */ char **monitors_id; @@ -144,3 +146,22 @@ struct settings { */ void parse_command_line(int argc, char *argv[], struct settings *settings); + +/** + * Marshal settings into a buffer. + * + * @param param The buffer, `NULL` if you want to know the required size. + * @param settings The settings to marshal. + * @return The size of the output. + */ +size_t marshal_settings(char *buffer, const struct settings *settings); + +/** + * Unmarshal settings from a buffer. + * + * @param buffer The buffer. + * @param settings Output parameter for the settings, will be allocated. + * @return The number of unmarshalled bytes, 0 on error. + */ +size_t unmarshal_settings(char *buffer, struct settings **settings); + |