Mon, 13 Jan 2014 23:44:15 +0200
- renamed files to .cxx, restructured parser.cc
73
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | /* |
75
bf8c57437231
- renamed files to .cxx, restructured parser.cc
Teemu Piippo <crimsondusk64@gmail.com>
parents:
73
diff
changeset
|
2 | Copyright (c) 2012-2014, Santeri Piippo |
73
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
3 | All rights reserved. |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
4 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | Redistribution and use in source and binary forms, with or without |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | modification, are permitted provided that the following conditions are met: |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | * Redistributions of source code must retain the above copyright |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | notice, this list of conditions and the following disclaimer. |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | * Redistributions in binary form must reproduce the above copyright |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | notice, this list of conditions and the following disclaimer in the |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | documentation and/or other materials provided with the distribution. |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
14 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | * Neither the name of the <organization> nor the |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | names of its contributors may be used to endorse or promote products |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | derived from this software without specific prior written permission. |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
22 | DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
29 | */ |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
30 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
31 | #ifndef BOTC_DATABUFFER_H |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
32 | #define BOTC_DATABUFFER_H |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
33 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | #include <stdio.h> |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
35 | #include <string.h> |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
36 | #include "main.h" |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
37 | #include "stringtable.h" |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
38 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
39 | #define MAX_MARKS 512 |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
40 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
41 | extern int g_NextMark; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
42 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
43 | // ============================================================================ |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
44 | // DataBuffer: A dynamic data buffer. |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
45 | class data_buffer |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
46 | { |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
47 | public: |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
48 | // The actual buffer |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
49 | byte* buffer; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
50 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
51 | // Allocated size of the buffer |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
52 | int allocsize; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
53 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
54 | // Written size of the buffer |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
55 | int writesize; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
56 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
57 | // Marks and references |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
58 | ScriptMark* marks[MAX_MARKS]; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
59 | ScriptMarkReference* refs[MAX_MARKS]; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
60 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
61 | data_buffer (int size = 128); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
62 | ~data_buffer (); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
63 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
64 | // ==================================================================== |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
65 | // Write stuff to the buffer |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
66 | // TODO: un-template and remove the union, move to source file |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
67 | template<class T> void write (T stuff) |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
68 | { |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
69 | if (writesize + sizeof (T) >= allocsize) |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
70 | { |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
71 | // We don't have enough space in the buffer to write |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
72 | // the stuff - thus resize. First, store the old |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
73 | // buffer temporarily: |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
74 | char* copy = new char[allocsize]; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
75 | memcpy (copy, buffer, allocsize); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
76 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
77 | // Remake the buffer with the new size. Have enough space |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
78 | // for the stuff we're going to write, as well as a bit |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
79 | // of leeway so we don't have to resize immediately again. |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
80 | size_t newsize = allocsize + sizeof (T) + 128; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
81 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
82 | delete buffer; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
83 | buffer = new unsigned char[newsize]; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
84 | allocsize = newsize; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
85 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
86 | // Now, copy the stuff back. |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
87 | memcpy (buffer, copy, allocsize); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
88 | delete copy; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
89 | } |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
90 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
91 | // Buffer is now guaranteed to have enough space. |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
92 | // Write the stuff one byte at a time. |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
93 | generic_union<T> uni; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
94 | uni.as_t = stuff; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
95 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
96 | for (int x = 0; x < sizeof (T); x++) |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
97 | { |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
98 | if (writesize >= allocsize) // should NEVER happen because resizing is done above |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
99 | error ("DataBuffer: written size exceeds allocated size!\n"); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
100 | |
75
bf8c57437231
- renamed files to .cxx, restructured parser.cc
Teemu Piippo <crimsondusk64@gmail.com>
parents:
73
diff
changeset
|
101 | buffer[writesize] = uni.as_bytes[x]; |
73
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
102 | writesize++; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
103 | } |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
104 | } |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
105 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
106 | // ==================================================================== |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
107 | // Merge another data buffer into this one. |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
108 | void merge (data_buffer* other); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
109 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
110 | // Clones this databuffer to a new one and returns it. |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
111 | data_buffer* clone (); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
112 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
113 | // ==================================================================== |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
114 | // Adds a mark to the buffer. A mark is a "pointer" to a particular |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
115 | // position in the bytecode. The actual permanent position cannot |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
116 | // be predicted in any way or form, thus these things will be used |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
117 | // to "mark" a position like that for future use. |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
118 | int add_mark (string name); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
119 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
120 | // ==================================================================== |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
121 | // A ref is another "mark" that references a mark. When the bytecode |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
122 | // is written to file, they are changed into their marks' current |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
123 | // positions. Marks themselves are never written to files, only refs are |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
124 | int add_reference (int marknum, bool placeholder = true); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
125 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
126 | // Delete a mark and all references to it. |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
127 | void delete_mark (int marknum); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
128 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
129 | // Adjusts a mark to the current position |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
130 | void move_mark(int i); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
131 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
132 | void offset_mark (int mark, int offset); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
133 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
134 | // Dump the buffer (for debugging purposes) |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
135 | void dump(); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
136 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
137 | // Count the amount of marks |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
138 | int count_marks (); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
139 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
140 | // Count the amount of refs |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
141 | int count_references (); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
142 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
143 | // Write a float into the buffer |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
144 | void write_float (string floatstring); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
145 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
146 | void write_string (string a); |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
147 | }; |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
148 | |
1ee9b312dc18
- *hot stuff coming through*
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
149 | #endif // BOTC_DATABUFFER_H |