void piece_insert(int n, const char *str);
void piece_escape(const char *p, size_t n);
void piece_flush(size_t n);
-void piece_pack();
+void piece_pack(void);
static void markup_action(const char *text);
static void markup_option(const char *name, int sense);
void piece_escape(const char *p, size_t n) {
size_t i, j = 0;
for (i = 0; i < n; ++i)
+#if 1 /* switch not implemented yet in c_to_python */
+ if (p[i] == '<' || p[i] == '>')
+ j += 4;
+ else if (p[i] == '&')
+ j += 5;
+ else
+ ++j;
+#else
switch (p[i]) {
case '<':
case '>':
++j;
break;
}
+#endif
char *q = malloc(j + 1);
j = 0;
for (i = 0; i < n; ++i)
+#if 1 /* switch not implemented yet in c_to_python */
+ if (p[i] == '<') {
+ memcpy(q + j, "<", 4);
+ j += 4;
+ }
+ else if (p[i] == '>') {
+ memcpy(q + j, ">", 4);
+ j += 4;
+ }
+ else if (p[i] == '&') {
+ memcpy(q + j, "&", 5);
+ j += 5;
+ }
+ else
+ q[j++] = p[i];
+#else
switch (p[i]) {
case '<':
memcpy(q + j, "<", 4);
q[j++] = p[i];
break;
}
+#endif
q[j] = 0;
piece[piece1++] = q;
}
yytext += n;
}
-void piece_pack() {
+void piece_pack(void) {
int i;
size_t j = 0;
for (i = piece0; i < piece1; ++i)