on master help sign in
Comment up the render code
119567fNeil Mitchell
gen/test.c+5−5
@@ -63,10 +63,11 @@ struct document
63
63
64typedef struct
64typedef struct
65{
65{
66− const document* d;
66+ const document* d; // Document, used to get at the body
67− char* buffer;
67+ char* buffer; // Buffer we are writing too
68− int length;
68+ int length; // Length of buffer, do not write past the end.
69− int cursor;
69+ // No character is reserved for a NULL terminator.
70+ int cursor; // Cursor of where we are writing now
70} render;
71} render;
71
72
72static inline void render_char(render* r, char c)
73static inline void render_char(render* r, char c)
@@ -178,7 +179,6 @@ attr* hexml_node_attributes(const document* d, const node* n, int* res)
178 return &d->attrs.attrs[n->attrs.start];
179 return &d->attrs.attrs[n->attrs.start];
179}
180}
180
181
181−
182attr* hexml_node_attribute(const document* d, const node* n, const char* s, int slen)
182attr* hexml_node_attribute(const document* d, const node* n, const char* s, int slen)
183{
183{
184 if (slen == -1) slen = (int) strlen(s);
184 if (slen == -1) slen = (int) strlen(s);