Lines Matching refs:cp
422 register const _ast_iconv_list_t* cp;
443 cp = ccmaplist(NiL);
450 if (error_info.trace < DEBUG_TRACE) sfprintf(sfstderr, "%s: debug-%d: AHA%d _ast_iconv_name n=%d bp=%p cp=%p ccode=%d name=\"%s\"\n", error_info.id, error_info.trace, __LINE__, n, bp, cp, cp->ccode, cp->name);
452 if (strgrpmatch(m, cp->match, sub, elementsof(sub) / 2, STR_MAXIMAL|STR_LEFT|STR_ICASE))
456 bp = cp;
461 bp = cp;
465 if (cp->ccode < 0)
467 if (!(++cp)->name)
470 else if (!(cp = (const _ast_iconv_list_t*)ccmaplist((_ast_iconv_list_t*)cp)))
471 cp = codes;
473 if (cp = bp)
475 if (cp->canon)
477 if (cp->index)
481 m = cp->index;
485 b += sfsprintf(b, e - b, cp->canon, m);
487 else if (cp->ccode == CC_NATIVE)
509 if (error_info.trace < DEBUG_TRACE) sfprintf(sfstderr, "%s: debug-%d: AHA%d _ast_iconv_name ccode=%d canon=\"%s\"\n", error_info.id, error_info.trace, __LINE__, cp->ccode, o);
511 return cp->ccode;
1566 _ast_iconv_list(_ast_iconv_list_t* cp)
1571 if (!cp)
1573 if (!(cp = newof(0, _ast_iconv_list_t, 1, 0)))
1575 if (!(cp->data = opendir(_win_maps)))
1577 free(cp);
1581 if (cp->data)
1583 if (ent = readdir((DIR*)cp->data))
1585 cp->name = cp->match = cp->desc = (const char*)ent->d_name;
1586 return cp;
1588 closedir((DIR*)cp->data);
1589 free(cp);
1593 if (!cp)
1596 if (cp->ccode >= 0)
1597 return (cp = ccmaplist(cp)) ? cp : (_ast_iconv_list_t*)codes;
1598 return (++cp)->name ? cp : (_ast_iconv_list_t*)0;