buffer.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * buffer.h: MMS access plug-in
00003  *****************************************************************************
00004  * Copyright (C) 2001, 2002 the VideoLAN team
00005  * $Id$
00006  *
00007  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 #ifndef _MMS_BUFFER_H_
00025 #define _MMS_BUFFER_H_ 1
00026 
00027 typedef struct
00028 {
00029     uint8_t *p_data;    // pointer on data
00030     int     i_data;     // number of bytes set in p_data
00031 
00032     // private
00033     int    i_size;     // size of p_data memory allocated
00034 } var_buffer_t;
00035 
00036 /*****************************************************************************
00037  * Macro/Function to create/manipulate buffer
00038  *****************************************************************************/
00039 int  var_buffer_initwrite( var_buffer_t *p_buf, int i_default_size );
00040 int  var_buffer_reinitwrite( var_buffer_t *p_buf, int i_default_size );
00041 void var_buffer_add8 ( var_buffer_t *p_buf, uint8_t  i_byte );
00042 void var_buffer_add16( var_buffer_t *p_buf, uint16_t i_word );
00043 void var_buffer_add32( var_buffer_t *p_buf, uint32_t i_word );
00044 void var_buffer_add64( var_buffer_t *p_buf, uint64_t i_word );
00045 void var_buffer_addmemory( var_buffer_t *p_buf, void *p_mem, int i_mem );
00046 void var_buffer_addUTF16( var_buffer_t *p_buf, const char *p_str );
00047 void var_buffer_free( var_buffer_t *p_buf );
00048 
00049 
00050 void      var_buffer_initread( var_buffer_t *p_buf, void *p_data, int i_data );
00051 uint8_t   var_buffer_get8 ( var_buffer_t *p_buf );
00052 uint16_t  var_buffer_get16( var_buffer_t *p_buf );
00053 uint32_t  var_buffer_get32( var_buffer_t *p_buf );
00054 uint64_t  var_buffer_get64( var_buffer_t *p_buf );
00055 int       var_buffer_getmemory ( var_buffer_t *p_buf, void *p_mem, int64_t i_mem );
00056 int       var_buffer_readempty( var_buffer_t *p_buf );
00057 void      var_buffer_getguid( var_buffer_t *p_buf, guid_t *p_guid );
00058 
00059 #endif

Generated on Tue May 25 08:04:52 2010 for VLC by  doxygen 1.5.6