ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / ARDroneLib / VP_SDK / ATcodec / ATcodec_Memory.h
1 /**
2  * @file ATcodec_Memory.h
3  * @author aurelien.morelle@parrot.fr
4  * @date 2006/12/06
5  */
6
7 #ifndef _AT_CODEC_MEMORY_INCLUDE_
8 #define _AT_CODEC_MEMORY_INCLUDE_
9
10
11 typedef  int (*ATcodec_Getchar)(char **str); 
12 typedef void (*ATcodec_Putchar)(char **str, int c); 
13
14
15 typedef struct _ATcodec_Memory_s_
16 {
17   const char *start;
18   int size;
19   int char_size;
20
21   char *current;
22
23   ATcodec_Getchar get;
24   ATcodec_Putchar put;
25 }
26 ATcodec_Memory_t;
27
28
29 // Init
30
31 void
32 ATcodec_Memory_Init        (ATcodec_Memory_t *mem, const char *start, int size, int char_size, ATcodec_Getchar get, ATcodec_Putchar put);
33
34
35 // Put
36
37 void
38 ATcodec_Memory_Put_Char    (ATcodec_Memory_t *mem, int character);
39
40 void
41 ATcodec_Memory_Put_String  (ATcodec_Memory_t *mem, const char *str);
42
43 void
44 ATcodec_Memory_Raw_Put_Int (ATcodec_Memory_t *mem, int value);
45
46 void
47 ATcodec_Memory_Str_Put_Int (ATcodec_Memory_t *mem, int value);
48
49
50 // Get
51
52 int
53 ATcodec_Memory_Get_Char    (ATcodec_Memory_t *mem);
54
55 void
56 ATcodec_Memory_Unget_Char  (ATcodec_Memory_t *mem);
57
58 void
59 ATcodec_Memory_Get_String  (ATcodec_Memory_t *mem, char *dst);
60
61 int
62 ATcodec_Memory_Raw_Get_Int (ATcodec_Memory_t *mem);
63
64 int
65 ATcodec_Memory_Str_Get_Int (ATcodec_Memory_t *mem);
66
67
68 #endif // ! _AT_CODEC_MEMORY_INCLUDE_