From 799e2d46923728ac670d7110f764868b82333a0b Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 20 May 2014 04:32:00 +0200 Subject: Modify mds-server to use mds-base (some regression...) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-base.h | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'src/mds-base.h') diff --git a/src/mds-base.h b/src/mds-base.h index 28d7432..e92e73e 100644 --- a/src/mds-base.h +++ b/src/mds-base.h @@ -135,6 +135,16 @@ extern void received_reexec(int signo); */ extern void received_terminate(int signo); +/** + * This function should be implemented by the actual server implementation + * + * This function will be invoked before `initialise_server` (if not re-exec:ing) + * or before `unmarshal_server` (if re-exec:ing) + * + * @return Non-zero on error + */ +extern int preinitialise_server(void); + /** * This function should be implemented by the actual server implementation * @@ -148,12 +158,24 @@ extern int initialise_server(void); /** * This function should be implemented by the actual server implementation * - * Unmarshal server implementation specific data and update the servers state accordingly + * This function will be invoked asgter `initialise_server` (if not re-exec:ing) + * or after `unmarshal_server` (if re-exec:ing) * - * @param state_buf The marshalled data that as not been read already - * @return Non-zero on error + * @return Non-zero on error */ -extern int unmarshal_server(char* state_buf); +extern int postinitialise_server(void); + +/** + * This function should be implemented by the actual server implementation + * + * Calculate the number of bytes that will be stored by `marshal_server` + * + * On failure the program should `abort()` or exit by other means. + * However it should not be possible for this function to fail. + * + * @return The number of bytes that will be stored by `marshal_server` + */ +extern size_t marshal_server_size(void) __attribute__((pure)); /** * This function should be implemented by the actual server implementation @@ -168,14 +190,12 @@ extern int marshal_server(char* state_buf); /** * This function should be implemented by the actual server implementation * - * Calculate the number of bytes that will be stored by `marshal_server` - * - * On failure the program should `abort()` or exit by other means. - * However it should not be possible for this function to fail. + * Unmarshal server implementation specific data and update the servers state accordingly * - * @return The number of bytes that will be stored by `marshal_server` + * @param state_buf The marshalled data that as not been read already + * @return Non-zero on error */ -extern size_t marshal_server_size(void); +extern int unmarshal_server(char* state_buf); /** * This function should be implemented by the actual server implementation @@ -187,7 +207,6 @@ extern size_t marshal_server_size(void); */ extern int reexec_failure_recover(void); - /** * This function should be implemented by the actual server implementation * -- cgit v1.2.3-70-g09d2