Skip to content

Commit

Permalink
blocktags are pregenerated.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo A. S. Lopes authored and cataphract committed Oct 4, 2011
1 parent f3567a6 commit 497e013
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/VERSION
@@ -1 +1 @@
2.0.9-dev
2.1.2.1-dev
34 changes: 34 additions & 0 deletions lib/blocktags_generated.c
@@ -0,0 +1,34 @@
static struct kw blocktags[] = {
{ "P", 1, 0 },
{ "BR", 2, 1 },
{ "DL", 2, 0 },
{ "H1", 2, 0 },
{ "H2", 2, 0 },
{ "H3", 2, 0 },
{ "H4", 2, 0 },
{ "H5", 2, 0 },
{ "H6", 2, 0 },
{ "HR", 2, 1 },
{ "OL", 2, 0 },
{ "UL", 2, 0 },
{ "BDO", 3, 0 },
{ "DFN", 3, 0 },
{ "DIV", 3, 0 },
{ "MAP", 3, 0 },
{ "PRE", 3, 0 },
{ "WBR", 3, 0 },
{ "XMP", 3, 0 },
{ "NOBR", 4, 0 },
{ "STYLE", 5, 0 },
{ "TABLE", 5, 0 },
{ "CENTER", 6, 0 },
{ "IFRAME", 6, 0 },
{ "OBJECT", 6, 0 },
{ "SCRIPT", 6, 0 },
{ "ADDRESS", 7, 0 },
{ "LISTING", 7, 0 },
{ "PLAINTEXT", 9, 0 },
{ "BLOCKQUOTE", 10, 0 },
};

#define NR_blocktags 30
9 changes: 9 additions & 0 deletions lib/mktags.c
@@ -1,7 +1,15 @@
/* On merge: This file is to be run to generate blocktags_generated.c
every time it changes */

/* block-level tags for passing html blocks through the blender
*/
#include <stdio.h>

/* on merge: added these three lines */
#include "config.h"
#define emalloc malloc
#define erealloc realloc

#define __WITHOUT_AMALLOC 1
#include "cstring.h"
#include "tags.h"
Expand Down Expand Up @@ -29,6 +37,7 @@ casort(struct kw *a, struct kw *b)
{
if ( a->size != b->size )
return a->size - b->size;

return strncasecmp(a->id, b->id, b->size);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/tags.c
Expand Up @@ -15,7 +15,7 @@ static STRING(struct kw) extratags;
*
* Additional tags still need to be allocated, sorted, and deallocated.
*/
#include "blocktags"
#include "blocktags_generated.c" /* on merge: changed file name */


/* define an additional html block tag
Expand Down

0 comments on commit 497e013

Please sign in to comment.