XMMS2
src/include/xmmsc/xmmsv_bitbuffer.h
Go to the documentation of this file.
00001 /*  XMMS2 - X Music Multiplexer System
00002  *  Copyright (C) 2003-2011 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 
00018 #ifndef __XMMSV_BITBUFFER_H__
00019 #define __XMMSV_BITBUFFER_H__
00020 
00021 #include "xmmsc/xmmsv_general.h"
00022 
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026 
00027 /**
00028  * @defgroup BitbufferType Bitbuffer
00029  * @ingroup ValueType
00030  * @{
00031  */
00032 
00033 /* Bitbuffer */
00034 xmmsv_t *xmmsv_bitbuffer_new_ro (const unsigned char *v, int len);
00035 xmmsv_t *xmmsv_bitbuffer_new (void);
00036 int xmmsv_bitbuffer_get_bits (xmmsv_t *v, int bits, int *res);
00037 int xmmsv_bitbuffer_get_data (xmmsv_t *v, unsigned char *b, int len);
00038 int xmmsv_bitbuffer_put_bits (xmmsv_t *v, int bits, int d);
00039 int xmmsv_bitbuffer_put_bits_at (xmmsv_t *v, int bits, int d, int offset);
00040 int xmmsv_bitbuffer_put_data (xmmsv_t *v, const unsigned char *b, int len);
00041 int xmmsv_bitbuffer_align (xmmsv_t *v);
00042 int xmmsv_bitbuffer_goto (xmmsv_t *v, int pos);
00043 int xmmsv_bitbuffer_pos (xmmsv_t *v);
00044 int xmmsv_bitbuffer_rewind (xmmsv_t *v);
00045 int xmmsv_bitbuffer_end (xmmsv_t *v);
00046 int xmmsv_bitbuffer_len (xmmsv_t *v);
00047 const unsigned char *xmmsv_bitbuffer_buffer (xmmsv_t *v);
00048 
00049 int xmmsv_bitbuffer_serialize_value (xmmsv_t *bb, xmmsv_t *v);
00050 int xmmsv_bitbuffer_deserialize_value (xmmsv_t *bb, xmmsv_t **val);
00051 
00052 /** @} */
00053 
00054 #ifdef __cplusplus
00055 }
00056 #endif
00057 
00058 #endif