diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2005-01-12 11:25:18 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2005-01-12 11:25:18 +0000 |
| commit | a9847935e7beea2cfe0f95c55a3d28528a44958b (patch) | |
| tree | d4cbf6033e01f2311e3bda3e472d8219ab682cc4 | |
| parent | 501edfbcefc2407354b4050e85cd47668ed86652 (diff) | |
| download | lasso-a9847935e7beea2cfe0f95c55a3d28528a44958b.tar.gz lasso-a9847935e7beea2cfe0f95c55a3d28528a44958b.tar.xz lasso-a9847935e7beea2cfe0f95c55a3d28528a44958b.zip | |
added support for SNIPPET_OPTIONAL (for use with SNIPPET_INTEGER or
SNIPPET_BOOLEAN) (not that really tested)
| -rw-r--r-- | lasso/xml/private.h | 1 | ||||
| -rw-r--r-- | lasso/xml/xml.c | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lasso/xml/private.h b/lasso/xml/private.h index 46f47658..a2b595bb 100644 --- a/lasso/xml/private.h +++ b/lasso/xml/private.h @@ -50,6 +50,7 @@ typedef enum { SNIPPET_BOOLEAN = 1 << 20, SNIPPET_INTEGER = 1 << 21, SNIPPET_LASSO_DUMP = 1 << 22, + SNIPPET_OPTIONAL = 1 << 23, } SnippetType; struct XmlSnippet { diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index 89cfcfe7..508cbbba 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -864,8 +864,9 @@ lasso_node_build_xmlNode_from_snippets(LassoNode *node, xmlNode *xmlnode, if (lasso_dump == FALSE && snippet->type & SNIPPET_LASSO_DUMP) continue; - if (value == NULL && ! (snippet->type & SNIPPET_BOOLEAN || - snippet->type & SNIPPET_INTEGER) ) + if (value == NULL && (!(snippet->type & SNIPPET_BOOLEAN || + snippet->type & SNIPPET_INTEGER) || + snippet->type & SNIPPET_OPTIONAL)) continue; /* XXX: not sure it is 64-bits clean */ @@ -933,6 +934,7 @@ lasso_node_build_xmlNode_from_snippets(LassoNode *node, xmlNode *xmlnode, case SNIPPET_INTEGER: case SNIPPET_BOOLEAN: case SNIPPET_LASSO_DUMP: + case SNIPPET_OPTIONAL: g_assert_not_reached(); } if (snippet->type & SNIPPET_INTEGER) |
