diff options
author | Max Kellermann <max@duempel.org> | 2013-01-03 17:58:22 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-03 17:58:22 +0100 |
commit | 5155b0f6087b5929838f6594a719011e3e704244 (patch) | |
tree | e924eff40e0330d4a4129213f32dc6f03dadcd16 /src/ClientMessage.cxx | |
parent | d919f8d50ab32a94b8965330297985cd14c45a42 (diff) | |
download | mpd-5155b0f6087b5929838f6594a719011e3e704244.tar.gz mpd-5155b0f6087b5929838f6594a719011e3e704244.tar.xz mpd-5155b0f6087b5929838f6594a719011e3e704244.zip |
ClientMessage: turn into a class
Diffstat (limited to 'src/ClientMessage.cxx')
-rw-r--r-- | src/ClientMessage.cxx | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/src/ClientMessage.cxx b/src/ClientMessage.cxx index c15ea0802..6fbcf3371 100644 --- a/src/ClientMessage.cxx +++ b/src/ClientMessage.cxx @@ -40,57 +40,3 @@ client_message_valid_channel_name(const char *name) return true; } - -void -client_message_init_null(struct client_message *msg) -{ - assert(msg != NULL); - - msg->channel = NULL; - msg->message = NULL; -} - -void -client_message_init(struct client_message *msg, - const char *channel, const char *message) -{ - assert(msg != NULL); - - msg->channel = g_strdup(channel); - msg->message = g_strdup(message); -} - -void -client_message_copy(struct client_message *dest, - const struct client_message *src) -{ - assert(dest != NULL); - assert(src != NULL); - assert(client_message_defined(src)); - - client_message_init(dest, src->channel, src->message); -} - -struct client_message * -client_message_dup(const struct client_message *src) -{ - struct client_message *dest = g_slice_new(struct client_message); - client_message_copy(dest, src); - return dest; -} - -void -client_message_deinit(struct client_message *msg) -{ - assert(msg != NULL); - - g_free(msg->channel); - g_free(msg->message); -} - -void -client_message_free(struct client_message *msg) -{ - client_message_deinit(msg); - g_slice_free(struct client_message, msg); -} |