Logo Search packages:      
Sourcecode: rapple version File versions  Download package

static void config_start ( void *  data,
const char *  el,
const char **  attr 
) [static]

Handles start of element event. Passed to XML_SetElementHandler.

Parameters:
data 
el 
attr 

Definition at line 110 of file confp.c.

References rpl_str_list_node::node, rpl_list_prepend(), rpl_me_malloc(), and rpl_str_list_create_node().

Referenced by rpl_cfg_parse().

                                                            {
    int i;
    rpl_str_t dir_title = RPL_STR_NUL;
    rpl_str_list_node *lnp;

    if(log_flag && (strcmp(el, "logfile") == 0))
        str_capture = 1;
    if(log_flag && (strcmp(el, "loglevel") == 0))
        str_capture = 1;

    if(ds_flag && (strcmp(el, "basedir") == 0))
        str_capture = 1;
    if(strcmp(el, "srcdir") == 0)
        str_capture = 1;
    if(strcmp(el, "webdir") == 0)
        str_capture = 1;

    if(tidy_flag && (strcmp(el, "config") == 0))
        str_capture = 1;

    if(dg_flag && (strcmp(el, "dir") == 0)) {
        str_capture = 1;
        /* capture title attribute */
        for(i=0; attr[i]; i+=2) {
            if(strcmp(attr[i], "title") == 0) {
                dir_title = (rpl_str_t)rpl_me_malloc(strlen(attr[i+1]) + 1);
                strcpy(dir_title, attr[i+1]);
                lnp = rpl_str_list_create_node(dir_title);
                rpl_list_prepend(&cfg_dg_dir_titles, &lnp->node, lnp);
            }
        }
    }

    if(tpl_flag && (strcmp(el, "domain") == 0))
        str_capture = 1;
    if(tpl_flag && (strcmp(el, "tplXSLT") == 0))
        str_capture = 1;
    if(tpl_flag && (strcmp(el, "catalog") == 0))
        str_capture = 1;

      if(lc_flag && (strcmp(el, "xslt") == 0))
            str_capture = 1;
      if(lc_flag && (strcmp(el, "htmlReport") == 0))
            str_capture = 1;
      if(lc_flag && (strcmp(el, "xmlReport") == 0))
            str_capture = 1;

    if(db_flag && (strcmp(el, "dbname") == 0))
        str_capture = 1;
    if(db_flag && (strcmp(el, "host") == 0))
        str_capture = 1;
    if(db_flag && (strcmp(el, "port") == 0))
        str_capture = 1;
    if(db_flag && (strcmp(el, "username") == 0))
        str_capture = 1;
    if(db_flag && (strcmp(el, "password") == 0))
        str_capture = 1;

    /* if the appropriate flag has already been set */
    if(str_capture) {
        *cfg_str_buf = 0;
    }

    /* acknowledge container element for next pass */
    if(strcmp(el, "logger") == 0)
        log_flag = 1;
    if(strcmp(el, "datastore") == 0)
        ds_flag = 1;
    if(strcmp(el, "tidy") == 0)
        tidy_flag = 1;
    if(strcmp(el, "template") == 0)
        tpl_flag = 1;
    if((strcmp(el, "digest") == 0))
        dg_flag = 1;
    if((strcmp(el, "linkchecker") == 0))
        lc_flag = 1;
    if((strcmp(el, "database") == 0))
        db_flag = 1;
}


Generated by  Doxygen 1.6.0   Back to index