Example #1
0
WBXML_DECLARE(WB_BOOL) wbxml_charset_get_mib(const WB_TINY       *name,
                                             WBXMLCharsetMIBEnum *mib_enum)
{
    WB_ULONG i = 0;
  
    for (i = 0; i < WBXML_TABLE_SIZE(wbxml_charset_entries); i++) {
        if (WBXML_STRCASECMP(name, wbxml_charset_entries[i].name) == 0) {
            if (mib_enum != NULL) {
                *mib_enum = wbxml_charset_entries[i].mib_enum;
            }

            return TRUE;
        }
    }

    return FALSE;
}
Example #2
0
const WBXMLLangEntry * wbxml_tables_search_table(const WBXMLLangEntry *main_table,
                                                                const WB_UTINY *public_id, 
                                                                const WB_UTINY *system_id,
                                                                const WB_UTINY *root)
{
    WB_ULONG index;

    if (main_table == NULL)
        return NULL;

    /* Search by XML Public ID  */
    if (public_id != NULL) {
        index = 0;

        while (main_table[index].publicID != NULL) {
            if (main_table[index].publicID->xmlPublicID && WBXML_STRCASECMP((const WB_TINY *)main_table[index].publicID->xmlPublicID, (const WB_TINY *)public_id) == 0)
                return &main_table[index];
            index++;
        }
    }

    /* Search by XML System ID  */
    if (system_id != NULL) {
        index = 0;

        while (main_table[index].publicID != NULL) {
            if (main_table[index].publicID->xmlDTD && WBXML_STRCMP((const WB_TINY *)main_table[index].publicID->xmlDTD, (const WB_TINY *)system_id) == 0) 
                return &main_table[index];
            index++;
        }
    }

    /* Search by XML Root Element  */
    if (root != NULL) {
        index = 0;

        while (main_table[index].publicID != NULL) {
            if (main_table[index].publicID->xmlRootElt && WBXML_STRCMP((const WB_TINY *)main_table[index].publicID->xmlRootElt, (const WB_TINY *)root) == 0) 
                return &main_table[index];
            index++;
        }
    }

    return NULL;
}