/** * Marshal server implementation specific data into a buffer * * @param state_buf The buffer for the marshalled data * @return Non-zero on error */ int marshal_server(char *state_buf) { buf_set_next(state_buf, int, MDS_ECHO_VARS_VERSION); buf_set_next(state_buf, int, connected); buf_set_next(state_buf, uint32_t, message_id); mds_message_marshal(&received, state_buf); mds_message_destroy(&received); return 0; }
/** * Marshal server implementation specific data into a buffer * * @param state_buf The buffer for the marshalled data * @return Non-zero on error */ int marshal_server(char *state_buf) { buf_set_next(state_buf, int, MDS_COLOUR_VARS_VERSION); buf_set_next(state_buf, int, connected); buf_set_next(state_buf, uint32_t, message_id); mds_message_marshal(&received, state_buf); state_buf += mds_message_marshal_size(&received) / sizeof(char*); colour_list_marshal(&colours, state_buf); mds_message_destroy(&received); colour_list_destroy(&colours); return 0; }
/** * Marshal server implementation specific data into a buffer * * @param state_buf The buffer for the marshalled data * @return Non-zero on error */ int marshal_server(char* state_buf) { buf_set_next(state_buf, int, MDS_VT_VARS_VERSION); buf_set_next(state_buf, int, connected); buf_set_next(state_buf, uint32_t, message_id); buf_set_next(state_buf, int, display_vt); buf_set_next(state_buf, int, display_tty_fd); buf_set_next(state_buf, int, vt_is_active); buf_set_next(state_buf, struct stat, old_vt_stat); buf_set_next(state_buf, int, secondary_socket_fd); buf_set_next(state_buf, ssize_t, nonexclusive_counter); memcpy(state_buf, vtfile_path, PATH_MAX * sizeof(char)); state_buf += PATH_MAX; mds_message_marshal(&received, state_buf); mds_message_destroy(&received); return 0; }