* xmlLoadCatalogs: * @pathss: a list of directories separated by a colon or a space. * * Load the catalogs and makes their definitions effective for the default * external entity loader. * this function is not thread safe, catalog initialization should * preferably be done once at startup */
| 3169 | * preferably be done once at startup |
| 3170 | */ |
| 3171 | void |
| 3172 | xmlLoadCatalogs(const char *pathss) { |
| 3173 | const char *cur; |
| 3174 | const char *paths; |
| 3175 | xmlChar *path; |
| 3176 | #ifdef _WIN32 |
| 3177 | int i, iLen; |
| 3178 | #endif |
| 3179 | |
| 3180 | if (pathss == NULL) |
| 3181 | return; |
| 3182 | |
| 3183 | cur = pathss; |
| 3184 | while (*cur != 0) { |
| 3185 | while (xmlIsBlank_ch(*cur)) cur++; |
| 3186 | if (*cur != 0) { |
| 3187 | paths = cur; |
| 3188 | while ((*cur != 0) && (*cur != PATH_SEPARATOR) && (!xmlIsBlank_ch(*cur))) |
| 3189 | cur++; |
| 3190 | path = xmlStrndup((const xmlChar *)paths, cur - paths); |
| 3191 | if (path != NULL) { |
| 3192 | #ifdef _WIN32 |
| 3193 | iLen = strlen((const char*)path); |
| 3194 | for(i = 0; i < iLen; i++) { |
| 3195 | if(path[i] == '\\') { |
| 3196 | path[i] = '/'; |
| 3197 | } |
| 3198 | } |
| 3199 | #endif |
| 3200 | xmlLoadCatalog((const char *) path); |
| 3201 | xmlFree(path); |
| 3202 | } |
| 3203 | } |
| 3204 | while (*cur == PATH_SEPARATOR) |
| 3205 | cur++; |
| 3206 | } |
| 3207 | } |
| 3208 | |
| 3209 | /** |
| 3210 | * xmlCatalogCleanup: |
no test coverage detected