• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

src/include/xmmsc/xmmsc_ipc_msg.h

Go to the documentation of this file.
00001 /*  XMMS2 - X Music Multiplexer System
00002  *  Copyright (C) 2003-2009 XMMS2 Team
00003  *
00004  *  PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!!
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public
00008  *  License as published by the Free Software Foundation; either
00009  *  version 2.1 of the License, or (at your option) any later version.
00010  *
00011  *  This library is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  *  Lesser General Public License for more details.
00015  */
00016 
00017 #ifndef __XMMS_IPC_MSG_H__
00018 #define __XMMS_IPC_MSG_H__
00019 
00020 #include "xmmsc/xmmsc_compiler.h"
00021 #include "xmmsc/xmmsc_stdint.h"
00022 #include "xmmsc/xmmsc_stdbool.h"
00023 #include "xmmsc/xmmsc_util.h"
00024 #include "xmmsc/xmmsc_ipc_transport.h"
00025 #include "xmmsc/xmmsv_coll.h"
00026 #include "xmmsc/xmmsv.h"
00027 
00028 #define XMMS_IPC_MSG_DEFAULT_SIZE 128 /*32768*/
00029 #define XMMS_IPC_MSG_HEAD_LEN 16 /* all but data */
00030 
00031 typedef struct xmms_ipc_msg_St xmms_ipc_msg_t;
00032 
00033 uint32_t xmms_ipc_msg_get_length (const xmms_ipc_msg_t *msg);
00034 uint32_t xmms_ipc_msg_get_object (const xmms_ipc_msg_t *msg);
00035 uint32_t xmms_ipc_msg_get_cmd (const xmms_ipc_msg_t *msg);
00036 uint32_t xmms_ipc_msg_get_cookie (const xmms_ipc_msg_t *msg);
00037 void xmms_ipc_msg_set_length (xmms_ipc_msg_t *msg, uint32_t len);
00038 void xmms_ipc_msg_set_cookie (xmms_ipc_msg_t *msg, uint32_t cookie);
00039 void xmms_ipc_msg_set_cmd (xmms_ipc_msg_t *msg, uint32_t cmd);
00040 void xmms_ipc_msg_set_object (xmms_ipc_msg_t *msg, uint32_t object);
00041 
00042 xmms_ipc_msg_t *xmms_ipc_msg_new (uint32_t object, uint32_t cmd);
00043 xmms_ipc_msg_t * xmms_ipc_msg_alloc (void);
00044 void xmms_ipc_msg_destroy (xmms_ipc_msg_t *msg);
00045 
00046 bool xmms_ipc_msg_write_transport (xmms_ipc_msg_t *msg, xmms_ipc_transport_t *transport, bool *disconnected);
00047 bool xmms_ipc_msg_read_transport (xmms_ipc_msg_t *msg, xmms_ipc_transport_t *transport, bool *disconnected);
00048 
00049 uint32_t xmms_ipc_msg_put_error (xmms_ipc_msg_t *msg, const char *errmsg);
00050 uint32_t xmms_ipc_msg_put_uint32 (xmms_ipc_msg_t *msg, uint32_t v);
00051 uint32_t xmms_ipc_msg_put_int32 (xmms_ipc_msg_t *msg, int32_t v);
00052 uint32_t xmms_ipc_msg_put_float (xmms_ipc_msg_t *msg, float v);
00053 uint32_t xmms_ipc_msg_put_string (xmms_ipc_msg_t *msg, const char *str);
00054 uint32_t xmms_ipc_msg_put_collection (xmms_ipc_msg_t *msg, xmmsv_coll_t *coll);
00055 uint32_t xmms_ipc_msg_put_bin (xmms_ipc_msg_t *msg, const unsigned char *data, unsigned int len);
00056 uint32_t xmms_ipc_msg_put_value (xmms_ipc_msg_t *msg, xmmsv_t* v);
00057 uint32_t xmms_ipc_msg_put_value_data (xmms_ipc_msg_t *msg, xmmsv_t *v);
00058 uint32_t xmms_ipc_msg_put_value_list (xmms_ipc_msg_t *msg, xmmsv_t *v);
00059 uint32_t xmms_ipc_msg_put_value_dict (xmms_ipc_msg_t *msg, xmmsv_t *v);
00060 
00061 void xmms_ipc_msg_store_uint32 (xmms_ipc_msg_t *msg, uint32_t offset, uint32_t v);
00062 
00063 bool xmms_ipc_msg_get_error_alloc (xmms_ipc_msg_t *msg, char **buf, unsigned int *len);
00064 bool xmms_ipc_msg_get_uint32 (xmms_ipc_msg_t *msg, uint32_t *v);
00065 bool xmms_ipc_msg_get_int32 (xmms_ipc_msg_t *msg, int32_t *v);
00066 bool xmms_ipc_msg_get_float (xmms_ipc_msg_t *msg, float *v);
00067 bool xmms_ipc_msg_get_string (xmms_ipc_msg_t *msg, char *str, unsigned int maxlen);
00068 bool xmms_ipc_msg_get_string_alloc (xmms_ipc_msg_t *msg, char **buf, unsigned int *len);
00069 bool xmms_ipc_msg_get_collection_alloc (xmms_ipc_msg_t *msg, xmmsv_coll_t **coll);
00070 bool xmms_ipc_msg_get_bin_alloc (xmms_ipc_msg_t *msg, unsigned char **buf, unsigned int *len);
00071 
00072 bool xmms_ipc_msg_get_value_alloc (xmms_ipc_msg_t *msg, xmmsv_t **val);
00073 bool xmms_ipc_msg_get_value_of_type_alloc (xmms_ipc_msg_t *msg, xmmsv_type_t type, xmmsv_t **val);
00074 
00075 #endif 

Generated on Wed Feb 9 2011 for XMMS2 by  doxygen 1.7.1