mmd-ruby 5.2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +78 -0
  3. data/MultiMarkdown-5/src/GLibFacade.c +310 -0
  4. data/MultiMarkdown-5/src/GLibFacade.h +100 -0
  5. data/MultiMarkdown-5/src/beamer.c +182 -0
  6. data/MultiMarkdown-5/src/beamer.h +11 -0
  7. data/MultiMarkdown-5/src/critic.c +117 -0
  8. data/MultiMarkdown-5/src/critic.h +15 -0
  9. data/MultiMarkdown-5/src/glib.h +11 -0
  10. data/MultiMarkdown-5/src/html.c +1171 -0
  11. data/MultiMarkdown-5/src/html.h +14 -0
  12. data/MultiMarkdown-5/src/latex.c +1234 -0
  13. data/MultiMarkdown-5/src/latex.h +16 -0
  14. data/MultiMarkdown-5/src/libMultiMarkdown.h +257 -0
  15. data/MultiMarkdown-5/src/lyx.c +2269 -0
  16. data/MultiMarkdown-5/src/lyx.h +37 -0
  17. data/MultiMarkdown-5/src/lyxbeamer.c +265 -0
  18. data/MultiMarkdown-5/src/lyxbeamer.h +11 -0
  19. data/MultiMarkdown-5/src/memoir.c +80 -0
  20. data/MultiMarkdown-5/src/memoir.h +10 -0
  21. data/MultiMarkdown-5/src/multimarkdown.c +559 -0
  22. data/MultiMarkdown-5/src/odf.c +1241 -0
  23. data/MultiMarkdown-5/src/odf.h +18 -0
  24. data/MultiMarkdown-5/src/opml.c +189 -0
  25. data/MultiMarkdown-5/src/opml.h +15 -0
  26. data/MultiMarkdown-5/src/parse_utilities.c +912 -0
  27. data/MultiMarkdown-5/src/parser.c +17341 -0
  28. data/MultiMarkdown-5/src/parser.h +190 -0
  29. data/MultiMarkdown-5/src/rng.c +117 -0
  30. data/MultiMarkdown-5/src/rtf.c +665 -0
  31. data/MultiMarkdown-5/src/rtf.h +17 -0
  32. data/MultiMarkdown-5/src/strtok.c +56 -0
  33. data/MultiMarkdown-5/src/strtok.h +9 -0
  34. data/MultiMarkdown-5/src/text.c +56 -0
  35. data/MultiMarkdown-5/src/text.h +11 -0
  36. data/MultiMarkdown-5/src/toc.c +157 -0
  37. data/MultiMarkdown-5/src/toc.h +15 -0
  38. data/MultiMarkdown-5/src/transclude.c +335 -0
  39. data/MultiMarkdown-5/src/transclude.h +28 -0
  40. data/MultiMarkdown-5/src/version.h +59 -0
  41. data/MultiMarkdown-5/src/writer.c +767 -0
  42. data/MultiMarkdown-5/src/writer.h +38 -0
  43. data/README.md +77 -0
  44. data/Rakefile +88 -0
  45. data/bin/mmd-ruby +123 -0
  46. data/ext/extconf.h +3 -0
  47. data/ext/extconf.rb +10 -0
  48. data/ext/multimarkdown.c +133 -0
  49. data/lib/mmd-jekyll.rb +19 -0
  50. data/lib/mmd-ruby.rb +1 -0
  51. data/lib/mmd.rb +1 -0
  52. data/lib/multimarkdown-ruby.rb +1 -0
  53. data/lib/multimarkdown.bundle +0 -0
  54. data/lib/multimarkdown.rb +69 -0
  55. data/lib/multimarkdown/version.rb +6 -0
  56. data/mmd-ruby.gemspec +37 -0
  57. data/test/extensions_test.rb +174 -0
  58. data/test/multimarkdown_test.rb +77 -0
  59. metadata +120 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4c4dbdbe5498729941dbdd689488f663ae908ce4
4
+ data.tar.gz: acb2daf80944bf161d309bad7a16ea76b3d42872
5
+ SHA512:
6
+ metadata.gz: af1815bad1d99ec9cd28dac56eebfbf2f789c3b50b93a1d42517a89cc002f2610b043372509c1a338f80159454227552d54bad72ae30bc2db8a6b8f65b2ddf4b
7
+ data.tar.gz: 51cf5700855bc7b111687fd9a0802d80195573e2322c13cb5afc156cddbec484acd9bb61495d4d9d4f634be6613651bf8465ef4b44e674e2f62990dc599ea4a6
data/LICENSE ADDED
@@ -0,0 +1,78 @@
1
+ MultiMarkdown-5 in C
2
+ Copyright (c) 2010-2016 Fletcher T. Penney
3
+
4
+ Ruby Markdown Extension (rpeg-markdown) used as template for this gem
5
+ Copyright (c) 2008 Ryan Tomayko
6
+
7
+ Ruby MultiMarkdown Extension (rpeg-multimarkdown) used as another template
8
+ Copyright (c) 2009 Oliver ? (https://github.com/djungelvral)
9
+
10
+ Micro-optparse (included in bin/mmd-ruby)
11
+ Copyright (c) 2011 Florian Pilz
12
+
13
+ Both mmd-ruby and MultiMarkdown-5 are released under both the GPL
14
+ and MIT licenses. You may pick the license that best fits your needs.
15
+
16
+ Micro-optparse is released under the MIT license.
17
+
18
+ The GPL
19
+
20
+ This program is free software; you can redistribute it and/or modify
21
+ it under the terms of the GNU General Public License as published by
22
+ the Free Software Foundation; either version 2 of the License, or
23
+ (at your option) any later version.
24
+
25
+ This program is distributed in the hope that it will be useful,
26
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
+ GNU General Public License for more details.
29
+
30
+ You should have received a copy of the GNU General Public License
31
+ along with this program; if not, write to the Free Software
32
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33
+
34
+ The MIT License
35
+
36
+ Permission is hereby granted, free of charge, to any person obtaining a copy
37
+ of this software and associated documentation files (the "Software"), to deal
38
+ in the Software without restriction, including without limitation the rights
39
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
40
+ copies of the Software, and to permit persons to whom the Software is
41
+ furnished to do so, subject to the following conditions:
42
+
43
+ The above copyright notice and this permission notice shall be included in
44
+ all copies or substantial portions of the Software.
45
+
46
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
47
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
48
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
49
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
50
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
51
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
52
+ THE SOFTWARE.
53
+
54
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
55
+
56
+ my_getopt (included for convenience - http://www.geocities.com/bsittler/)
57
+
58
+ Copyright 1997, 2000, 2001, 2002, 2006, Benjamin Sittler
59
+
60
+ Permission is hereby granted, free of charge, to any person
61
+ obtaining a copy of this software and associated documentation
62
+ files (the "Software"), to deal in the Software without
63
+ restriction, including without limitation the rights to use, copy,
64
+ modify, merge, publish, distribute, sublicense, and/or sell copies
65
+ of the Software, and to permit persons to whom the Software is
66
+ furnished to do so, subject to the following conditions:
67
+
68
+ The above copyright notice and this permission notice shall be
69
+ included in all copies or substantial portions of the Software.
70
+
71
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
72
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
73
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
74
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
75
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
76
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
77
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
78
+ DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,310 @@
1
+ /*
2
+ * GLibFacade.c
3
+ * MultiMarkdown
4
+ *
5
+ * Created by Daniel Jalkut on 7/26/11.
6
+ * Modified by Fletcher T. Penney on 9/15/11 and 12/3/13.
7
+ * Modified by Dan Lowe on 1/3/12.
8
+ *
9
+ * License for original code by Daniel Jalkut:
10
+ *
11
+ * Copyright 2011 Daniel Jalkut. All rights reserved.
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
14
+ * this software and associated documentation files (the “Software”), to deal in
15
+ * the Software without restriction, including without limitation the rights to
16
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17
+ * of the Software, and to permit persons to whom the Software is furnished to do
18
+ * so, subject to the following conditions:
19
+ *
20
+ * The above copyright notice and this permission notice shall be included in all
21
+ * copies or substantial portions of the Software.
22
+ *
23
+ * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ * SOFTWARE.
30
+ */
31
+
32
+ #include "GLibFacade.h"
33
+
34
+ #include <stdio.h>
35
+ #include <stdlib.h>
36
+ #include <string.h>
37
+ #include <stdarg.h>
38
+
39
+ /*
40
+ * The following section came from:
41
+ *
42
+ * http://lists-archives.org/mingw-users/12649-asprintf-missing-vsnprintf-
43
+ * behaving-differently-and-_vsncprintf-undefined.html
44
+ *
45
+ * and
46
+ *
47
+ * http://groups.google.com/group/jansson-users/browse_thread/thread/
48
+ * 76a88d63d9519978/041a7d0570de2d48?lnk=raot
49
+ */
50
+
51
+ /* Solaris and Windows do not provide vasprintf() or asprintf(). */
52
+ #if defined(__WIN32) || (defined(__SVR4) && defined(__sun))
53
+ int vasprintf( char **sptr, char *fmt, va_list argv )
54
+ {
55
+ int wanted = vsnprintf( *sptr = NULL, 0, fmt, argv );
56
+ if( (wanted > 0) && ((*sptr = malloc( 1 + wanted )) != NULL) )
57
+ return vsprintf( *sptr, fmt, argv );
58
+
59
+ return wanted;
60
+ }
61
+
62
+ int asprintf( char **sptr, char *fmt, ... )
63
+ {
64
+ int retval;
65
+ va_list argv;
66
+ va_start( argv, fmt );
67
+ retval = vasprintf( sptr, fmt, argv );
68
+ va_end( argv );
69
+ return retval;
70
+ }
71
+ #endif
72
+
73
+
74
+ /* GString */
75
+
76
+ #define kStringBufferStartingSize 1024
77
+ #define kStringBufferGrowthMultiplier 2
78
+
79
+ GString* g_string_new(const char *startingString)
80
+ {
81
+ GString* newString = malloc(sizeof(GString));
82
+
83
+ if (startingString == NULL) startingString = "";
84
+
85
+ size_t startingBufferSize = kStringBufferStartingSize;
86
+ size_t startingStringSize = strlen(startingString);
87
+ while (startingBufferSize < (startingStringSize + 1))
88
+ {
89
+ startingBufferSize *= kStringBufferGrowthMultiplier;
90
+ }
91
+
92
+ newString->str = malloc(startingBufferSize);
93
+ newString->currentStringBufferSize = startingBufferSize;
94
+ strncpy(newString->str, startingString, startingStringSize);
95
+ newString->str[startingStringSize] = '\0';
96
+ newString->currentStringLength = startingStringSize;
97
+
98
+ return newString;
99
+ }
100
+
101
+ char* g_string_free(GString* ripString, bool freeCharacterData)
102
+ {
103
+ if (ripString == NULL)
104
+ return NULL;
105
+
106
+ char* returnedString = ripString->str;
107
+ if (freeCharacterData)
108
+ {
109
+ if (ripString->str != NULL)
110
+ {
111
+ free(ripString->str);
112
+ }
113
+ returnedString = NULL;
114
+ }
115
+
116
+ free(ripString);
117
+
118
+ return returnedString;
119
+ }
120
+
121
+ static void ensureStringBufferCanHold(GString* baseString, size_t newStringSize)
122
+ {
123
+ size_t newBufferSizeNeeded = newStringSize + 1;
124
+ if (newBufferSizeNeeded > baseString->currentStringBufferSize)
125
+ {
126
+ size_t newBufferSize = baseString->currentStringBufferSize;
127
+
128
+ while (newBufferSizeNeeded > newBufferSize)
129
+ {
130
+ newBufferSize *= kStringBufferGrowthMultiplier;
131
+ }
132
+
133
+ char *temp;
134
+ temp = realloc(baseString->str, newBufferSize);
135
+
136
+ if (temp == NULL) {
137
+ /* realloc failed */
138
+ fprintf(stderr, "error reallocating memory\n");
139
+
140
+ exit(1);
141
+ }
142
+ baseString->str = temp;
143
+ baseString->currentStringBufferSize = newBufferSize;
144
+ }
145
+ }
146
+
147
+ void g_string_append(GString* baseString, char* appendedString)
148
+ {
149
+ if ((appendedString != NULL) && (strlen(appendedString) > 0))
150
+ {
151
+ size_t appendedStringLength = strlen(appendedString);
152
+ size_t newStringLength = baseString->currentStringLength + appendedStringLength;
153
+ ensureStringBufferCanHold(baseString, newStringLength);
154
+
155
+ /* We already know where the current string ends, so pass that as the starting address for strncat */
156
+ strncat(baseString->str + baseString->currentStringLength, appendedString, appendedStringLength);
157
+ baseString->currentStringLength = newStringLength;
158
+ }
159
+ }
160
+
161
+ void g_string_append_c(GString* baseString, char appendedCharacter)
162
+ {
163
+ size_t newSizeNeeded = baseString->currentStringLength + 1;
164
+ ensureStringBufferCanHold(baseString, newSizeNeeded);
165
+
166
+ baseString->str[baseString->currentStringLength] = appendedCharacter;
167
+ baseString->currentStringLength++;
168
+ baseString->str[baseString->currentStringLength] = '\0';
169
+ }
170
+
171
+ void g_string_append_printf(GString* baseString, char* format, ...)
172
+ {
173
+ va_list args;
174
+ va_start(args, format);
175
+
176
+ char* formattedString = NULL;
177
+ vasprintf(&formattedString, format, args);
178
+ if (formattedString != NULL)
179
+ {
180
+ g_string_append(baseString, formattedString);
181
+ free(formattedString);
182
+ }
183
+ va_end(args);
184
+ }
185
+
186
+ void g_string_prepend(GString* baseString, char* prependedString)
187
+ {
188
+ if ((prependedString != NULL) && (strlen(prependedString) > 0))
189
+ {
190
+ size_t prependedStringLength = strlen(prependedString);
191
+ size_t newStringLength = baseString->currentStringLength + prependedStringLength;
192
+ ensureStringBufferCanHold(baseString, newStringLength);
193
+
194
+ memmove(baseString->str + prependedStringLength, baseString->str, baseString->currentStringLength);
195
+ strncpy(baseString->str, prependedString, prependedStringLength);
196
+ baseString->currentStringLength = newStringLength;
197
+ baseString->str[baseString->currentStringLength] = '\0';
198
+ }
199
+ }
200
+
201
+ void g_string_insert(GString* baseString, size_t pos, char * insertedString)
202
+ {
203
+ if ((insertedString != NULL) && (strlen(insertedString) > 0))
204
+ {
205
+ if (pos > baseString->currentStringLength)
206
+ pos = baseString->currentStringLength;
207
+
208
+ size_t insertedStringLength = strlen(insertedString);
209
+ size_t newStringLength = baseString->currentStringLength + insertedStringLength;
210
+ ensureStringBufferCanHold(baseString, newStringLength);
211
+
212
+ /* Shift following string to 'right' */
213
+ memmove(baseString->str + pos + insertedStringLength, baseString->str + pos, baseString->currentStringLength - pos);
214
+ strncpy(baseString->str + pos, insertedString, insertedStringLength);
215
+ baseString->currentStringLength = newStringLength;
216
+ baseString->str[baseString->currentStringLength] = '\0';
217
+ }
218
+ }
219
+
220
+ void g_string_insert_c(GString* baseString, size_t pos, char insertedCharacter)
221
+ {
222
+ if (pos > baseString->currentStringLength)
223
+ pos = baseString->currentStringLength;
224
+
225
+ size_t newSizeNeeded = baseString->currentStringLength + 1;
226
+ ensureStringBufferCanHold(baseString, newSizeNeeded);
227
+
228
+ /* Shift following string to 'right' */
229
+ memmove(baseString->str + pos + 1, baseString->str + pos, baseString->currentStringLength - pos);
230
+
231
+ baseString->str[pos] = insertedCharacter;
232
+ baseString->currentStringLength++;
233
+ baseString->str[baseString->currentStringLength] = '\0';
234
+ }
235
+
236
+
237
+ void g_string_insert_printf(GString* baseString, size_t pos, char* format, ...)
238
+ {
239
+ va_list args;
240
+ va_start(args, format);
241
+
242
+ char* formattedString = NULL;
243
+ vasprintf(&formattedString, format, args);
244
+ if (formattedString != NULL)
245
+ {
246
+ g_string_insert(baseString, pos, formattedString);
247
+ free(formattedString);
248
+ }
249
+ va_end(args);
250
+ }
251
+
252
+ void g_string_erase(GString* baseString, size_t pos, size_t len)
253
+ {
254
+ if ((pos > baseString->currentStringLength) || (len <= 0))
255
+ return;
256
+
257
+ if ((pos + len) >= baseString->currentStringLength)
258
+ len = -1;
259
+
260
+ if (len == -1) {
261
+ baseString->currentStringLength = pos;
262
+ } else {
263
+ memmove(baseString->str + pos, baseString->str + pos + len, baseString->currentStringLength - pos - len);
264
+ baseString->currentStringLength -= len;
265
+ }
266
+ baseString->str[baseString->currentStringLength] = '\0';
267
+ }
268
+
269
+ /* GSList */
270
+
271
+ void g_slist_free(GSList* ripList)
272
+ {
273
+ GSList* thisListItem = ripList;
274
+ while (thisListItem != NULL)
275
+ {
276
+ GSList* nextItem = thisListItem->next;
277
+
278
+ /* I guess we don't release the data? Non-retained memory management is hard... let's figure it out later. */
279
+ free(thisListItem);
280
+
281
+ thisListItem = nextItem;
282
+ }
283
+ }
284
+
285
+ /* Currently only used for markdown_output.c endnotes printing */
286
+ GSList* g_slist_reverse(GSList* theList)
287
+ {
288
+ GSList* lastNodeSeen = NULL;
289
+
290
+ /* Iterate the list items, tacking them on to our new reversed List as we find them */
291
+ GSList* listWalker = theList;
292
+ while (listWalker != NULL)
293
+ {
294
+ GSList* nextNode = listWalker->next;
295
+ listWalker->next = lastNodeSeen;
296
+ lastNodeSeen = listWalker;
297
+ listWalker = nextNode;
298
+ }
299
+
300
+ return lastNodeSeen;
301
+ }
302
+
303
+ GSList* g_slist_prepend(GSList* targetElement, void* newElementData)
304
+ {
305
+ GSList* newElement = malloc(sizeof(GSList));
306
+ newElement->data = newElementData;
307
+ newElement->next = targetElement;
308
+ return newElement;
309
+ }
310
+
@@ -0,0 +1,100 @@
1
+ /*
2
+ * GLibFacade.h
3
+ * MultiMarkdown
4
+ *
5
+ * Created by Daniel Jalkut on 7/26/11.
6
+ * Modified by Fletcher T. Penney on 9/15/11 and 12/3/13.
7
+ * Modified by Dan Lowe on 1/3/12.
8
+ *
9
+ * License for original code by Daniel Jalkut:
10
+ *
11
+ * Copyright 2011 Daniel Jalkut. All rights reserved.
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
14
+ * this software and associated documentation files (the “Software”), to deal in
15
+ * the Software without restriction, including without limitation the rights to
16
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17
+ * of the Software, and to permit persons to whom the Software is furnished to do
18
+ * so, subject to the following conditions:
19
+ *
20
+ * The above copyright notice and this permission notice shall be included in all
21
+ * copies or substantial portions of the Software.
22
+ *
23
+ * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ * SOFTWARE.
30
+ */
31
+
32
+ #ifndef __MARKDOWN_GLIB_FACADE__
33
+ #define __MARKDOWN_GLIB_FACADE__
34
+
35
+ /* peg_markdown uses the link symbol for its own purposes */
36
+ #define link MARKDOWN_LINK_IGNORED
37
+ #include <unistd.h>
38
+ #undef link
39
+
40
+ #include <stdbool.h>
41
+ #include <ctype.h>
42
+
43
+ typedef int gboolean;
44
+ typedef char gchar;
45
+
46
+ /* This style of bool is used in shared source code */
47
+ #if !defined(FALSE)
48
+ #define FALSE false
49
+ #endif
50
+ #if !defined(TRUE)
51
+ #define TRUE true
52
+ #endif
53
+
54
+ /* WE implement minimal mirror implementations of GLib's GString and GSList
55
+ * sufficient to cover the functionality required by MultiMarkdown.
56
+ *
57
+ * NOTE: THese are 100% clean, from-scratch implementations using only the
58
+ * GLib function prototype as guide for behavior.
59
+ */
60
+
61
+ typedef struct
62
+ {
63
+ /* Current UTF8 byte stream this string represents */
64
+ char* str;
65
+
66
+ /* Where in the str buffer will we add new characters */
67
+ /* or append new strings? */
68
+ unsigned long currentStringBufferSize;
69
+ unsigned long currentStringLength;
70
+ } GString;
71
+
72
+ GString* g_string_new(const char *startingString);
73
+ char* g_string_free(GString* ripString, bool freeCharacterData);
74
+
75
+ void g_string_append_c(GString* baseString, char appendedCharacter);
76
+ void g_string_append(GString* baseString, char *appendedString);
77
+
78
+ void g_string_prepend(GString* baseString, char* prependedString);
79
+
80
+ void g_string_append_printf(GString* baseString, char* format, ...);
81
+
82
+ void g_string_insert(GString* baseString, size_t pos, char * insertedString);
83
+ void g_string_insert_c(GString* baseString, size_t pos, char insertedCharacter);
84
+ void g_string_insert_printf(GString* baseString, size_t pos, char* format, ...);
85
+
86
+ void g_string_erase(GString* baseString, size_t pos, size_t len);
87
+
88
+ /* Just implement a very simple singly linked list. */
89
+
90
+ typedef struct _GSList
91
+ {
92
+ void* data;
93
+ struct _GSList* next;
94
+ } GSList;
95
+
96
+ void g_slist_free(GSList* ripList);
97
+ GSList* g_slist_prepend(GSList* targetElement, void* newElementData);
98
+ GSList* g_slist_reverse(GSList* theList);
99
+
100
+ #endif