on master help sign in
More inline
commit36f887482cce03bbd054db9e020da83e138b70aa authorNeil Mitchell <ndmitchell@gmail.com> dateMon 28 Nov 2016, 18:24 (10 years ago) parent6691cb4
1 file changed+7−6
hexml.c+7−6
hexml.c+7−6
@@ -292,14 +292,14 @@ bool find(document* d, char c)
292292/////////////////////////////////////////////////////////////////////
293293// PARSING CODE
294294
295−void node_alloc(node_buffer* b, int ask)
295+void static inline node_alloc(node_buffer* b, int ask)
296296{
297297 int space = b->size - b->used_back - b->used_front;
298298 if (space >= ask) return;
299299 assert(0);
300300}
301301
302−void attr_alloc(attr_buffer* b, int ask)
302+void static inline attr_alloc(attr_buffer* b, int ask)
303303{
304304 int space = b->size - b->used;
305305 if (space >= ask) return;
@@ -312,7 +312,7 @@ void attr_alloc(attr_buffer* b, int ask)
312312
313313// you now expect a name, perhaps preceeded by whitespace
314314// the name may be empty
315−str parse_name(document* d)
315+str static inline parse_name(document* d)
316316{
317317 trim(d);
318318 int start = doc_position(d);
@@ -324,7 +324,7 @@ str parse_name(document* d)
324324 return start_end(start, doc_position(d));
325325}
326326
327−str parse_attrval(document* d)
327+str static inline parse_attrval(document* d)
328328{
329329 trim(d);
330330 if (peek(d) != '=') return start_length(0,0);
@@ -351,7 +351,7 @@ str parse_attrval(document* d)
351351
352352// seen a tag name, now looking for attributes terminated by >
353353// puts the attributes it finds in the attribute buffer
354−str parse_attributes(document* d)
354+str static inline parse_attributes(document* d)
355355{
356356 str res;
357357 res.start = d->attrs.used;
@@ -372,7 +372,7 @@ str parse_content(document* d);
372372
373373
374374// Add a new entry into tag, am at a '<'
375−void parse_tag(document* d)
375+void static inline parse_tag(document* d)
376376{
377377 node_alloc(&d->nodes, 1);
378378 d->nodes.used_back++;
@@ -426,6 +426,7 @@ void parse_tag(document* d)
426426}
427427
428428// Parser until </, return the index of your node children
429+// Not inline as it is recursive
429430str parse_content(document* d)
430431{
431432 int before = d->nodes.used_back;