added QSE_XLI_MULSEGSTR

This commit is contained in:
hyung-hwan 2013-09-16 13:33:51 +00:00
parent cb170d2e7a
commit c1c1f203ee
4 changed files with 16 additions and 9 deletions

View File

@ -1478,7 +1478,7 @@ static int open_config_file (qse_httpd_t* httpd)
} }
qse_xli_getopt (httpd_xtn->xli, QSE_XLI_TRAIT, &trait); qse_xli_getopt (httpd_xtn->xli, QSE_XLI_TRAIT, &trait);
trait |= QSE_XLI_VALIDATE; trait |= QSE_XLI_MULSEGSTR | QSE_XLI_VALIDATE;
qse_xli_setopt (httpd_xtn->xli, QSE_XLI_TRAIT, &trait); qse_xli_setopt (httpd_xtn->xli, QSE_XLI_TRAIT, &trait);
for (i = 0; i < QSE_COUNTOF(defs); i++) for (i = 0; i < QSE_COUNTOF(defs); i++)

View File

@ -134,6 +134,8 @@ static void print_usage (QSE_FILE* out, int argc, qse_char_t* argv[])
qse_fprintf (out, QSE_T(" -a allow a key alias\n")); qse_fprintf (out, QSE_T(" -a allow a key alias\n"));
qse_fprintf (out, QSE_T(" -f keep file inclusion info\n")); qse_fprintf (out, QSE_T(" -f keep file inclusion info\n"));
qse_fprintf (out, QSE_T(" -t keep comment text\n")); qse_fprintf (out, QSE_T(" -t keep comment text\n"));
qse_fprintf (out, QSE_T(" -s allow multi-segmented strings\n"));
qse_fprintf (out, QSE_T(" -v perform validation\n"));
qse_fprintf (out, QSE_T(" -m number specify the maximum amount of memory to use in bytes\n")); qse_fprintf (out, QSE_T(" -m number specify the maximum amount of memory to use in bytes\n"));
#if defined(QSE_BUILD_DEBUG) #if defined(QSE_BUILD_DEBUG)
qse_fprintf (out, QSE_T(" -X number fail the number'th memory allocation\n")); qse_fprintf (out, QSE_T(" -X number fail the number'th memory allocation\n"));
@ -160,9 +162,9 @@ static int handle_args (int argc, qse_char_t* argv[])
static qse_opt_t opt = static qse_opt_t opt =
{ {
#if defined(QSE_BUILD_DEBUG) #if defined(QSE_BUILD_DEBUG)
QSE_T("hi:o:uaftvm:X:"), QSE_T("hi:o:uaftsvm:X:"),
#else #else
QSE_T("hi:o:uaftvm:"), QSE_T("hi:o:uaftsvm:"),
#endif #endif
lng lng
}; };
@ -220,6 +222,10 @@ static int handle_args (int argc, qse_char_t* argv[])
g_trait |= QSE_XLI_KEEPTEXT; g_trait |= QSE_XLI_KEEPTEXT;
break; break;
case QSE_T('s'):
g_trait |= QSE_XLI_MULSEGSTR;
break;
case QSE_T('v'): case QSE_T('v'):
g_trait |= QSE_XLI_VALIDATE; g_trait |= QSE_XLI_VALIDATE;
break; break;

View File

@ -79,13 +79,14 @@ typedef enum qse_xli_opt_t qse_xli_opt_t;
enum qse_xli_trait_t enum qse_xli_trait_t
{ {
QSE_XLI_KEYNODUP = (1 << 1), QSE_XLI_KEYNODUP = (1 << 1),
QSE_XLI_KEYALIAS = (1 << 2), QSE_XLI_KEYALIAS = (1 << 2),
QSE_XLI_KEEPTEXT = (1 << 3), /**< keep comment text */ QSE_XLI_KEEPTEXT = (1 << 3), /**< keep comment text */
QSE_XLI_KEEPFILE = (1 << 4), /**< keep inclusion file info */ QSE_XLI_KEEPFILE = (1 << 4), /**< keep inclusion file info */
QSE_XLI_VALIDATE = (1 << 5) QSE_XLI_MULSEGSTR = (1 << 5), /**< support multi-segmented string */
QSE_XLI_VALIDATE = (1 << 6)
}; };
typedef enum qse_xli_trait_t qse_xli_trait_t; typedef enum qse_xli_trait_t qse_xli_trait_t;

View File

@ -734,7 +734,7 @@ static int read_pair (qse_xli_t* xli)
curstrseg = (qse_xli_str_t*)pair->val; curstrseg = (qse_xli_str_t*)pair->val;
if (get_token (xli) <= -1) goto oops; if (get_token (xli) <= -1) goto oops;
if (MATCH(xli, TOK_COMMA)) if ((xli->opt.trait & QSE_XLI_MULSEGSTR) && MATCH(xli, TOK_COMMA))
{ {
/* multi-segmented string */ /* multi-segmented string */
do do