]> git.sesse.net Git - vlc/blob - modules/access/mms/buffer.h
bcf27700892a49ff93f64264ad247bb67925050c
[vlc] / modules / access / mms / buffer.h
1 /*****************************************************************************
2  * buffer.h: MMS access plug-in
3  *****************************************************************************
4  * Copyright (C) 2001, 2002 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 typedef struct
25 {
26     uint8_t *p_data;    // pointer on data
27     int     i_data;     // number of bytes set in p_data
28
29     // private
30     int    i_size;     // size of p_data memory allocated
31 } var_buffer_t;
32
33
34 /*****************************************************************************
35  * Macro/Function to create/manipulate buffer 
36  *****************************************************************************/
37 int  var_buffer_initwrite( var_buffer_t *p_buf, int i_default_size );
38 int  var_buffer_reinitwrite( var_buffer_t *p_buf, int i_default_size );
39 void var_buffer_add8 ( var_buffer_t *p_buf, uint8_t  i_byte );
40 void var_buffer_add16( var_buffer_t *p_buf, uint16_t i_word );
41 void var_buffer_add32( var_buffer_t *p_buf, uint32_t i_word );
42 void var_buffer_add64( var_buffer_t *p_buf, uint64_t i_word );
43 void var_buffer_addmemory( var_buffer_t *p_buf, void *p_mem, int i_mem );
44 void var_buffer_addUTF16( var_buffer_t *p_buf, const char *p_str );
45 void var_buffer_free( var_buffer_t *p_buf );
46
47
48 void      var_buffer_initread( var_buffer_t *p_buf, void *p_data, int i_data );
49 uint8_t   var_buffer_get8 ( var_buffer_t *p_buf );
50 uint16_t  var_buffer_get16( var_buffer_t *p_buf );
51 uint32_t  var_buffer_get32( var_buffer_t *p_buf );
52 uint64_t  var_buffer_get64( var_buffer_t *p_buf );
53 int       var_buffer_getmemory ( var_buffer_t *p_buf, void *p_mem, int64_t i_mem );
54 int       var_buffer_readempty( var_buffer_t *p_buf );
55 void      var_buffer_getguid( var_buffer_t *p_buf, guid_t *p_guid );
56