Lines Matching refs:pchglist
101 if (pi->pchgno < jpc_pchglist_numpchgs(pi->pchglist)) { in jpc_pi_next()
102 pi->pchg = jpc_pchglist_get(pi->pchglist, pi->pchgno); in jpc_pi_next()
103 } else if (pi->pchgno == jpc_pchglist_numpchgs(pi->pchglist)) { in jpc_pi_next()
528 if (pi->pchglist) { in jpc_pi_destroy()
529 jpc_pchglist_destroy(pi->pchglist); in jpc_pi_destroy()
542 if (!(pi->pchglist = jpc_pchglist_create())) { in jpc_pi_create0()
551 return jpc_pchglist_insert(pi->pchglist, -1, pchg); in jpc_pi_addpchg()
556 jpc_pchglist_t *pchglist; in jpc_pchglist_create() local
557 if (!(pchglist = jas_malloc(sizeof(jpc_pchglist_t)))) { in jpc_pchglist_create()
560 pchglist->numpchgs = 0; in jpc_pchglist_create()
561 pchglist->maxpchgs = 0; in jpc_pchglist_create()
562 pchglist->pchgs = 0; in jpc_pchglist_create()
563 return pchglist; in jpc_pchglist_create()
566 int jpc_pchglist_insert(jpc_pchglist_t *pchglist, int pchgno, jpc_pchg_t *pchg) in jpc_pchglist_insert() argument
572 pchgno = pchglist->numpchgs; in jpc_pchglist_insert()
574 if (pchglist->numpchgs >= pchglist->maxpchgs) { in jpc_pchglist_insert()
575 newmaxpchgs = pchglist->maxpchgs + 128; in jpc_pchglist_insert()
576 if (!(newpchgs = jas_realloc2(pchglist->pchgs, newmaxpchgs, sizeof(jpc_pchg_t *)))) { in jpc_pchglist_insert()
579 pchglist->maxpchgs = newmaxpchgs; in jpc_pchglist_insert()
580 pchglist->pchgs = newpchgs; in jpc_pchglist_insert()
582 for (i = pchglist->numpchgs; i > pchgno; --i) { in jpc_pchglist_insert()
583 pchglist->pchgs[i] = pchglist->pchgs[i - 1]; in jpc_pchglist_insert()
585 pchglist->pchgs[pchgno] = pchg; in jpc_pchglist_insert()
586 ++pchglist->numpchgs; in jpc_pchglist_insert()
590 jpc_pchg_t *jpc_pchglist_remove(jpc_pchglist_t *pchglist, int pchgno) in jpc_pchglist_remove() argument
594 assert(pchgno < pchglist->numpchgs); in jpc_pchglist_remove()
595 pchg = pchglist->pchgs[pchgno]; in jpc_pchglist_remove()
596 for (i = pchgno + 1; i < pchglist->numpchgs; ++i) { in jpc_pchglist_remove()
597 pchglist->pchgs[i - 1] = pchglist->pchgs[i]; in jpc_pchglist_remove()
599 --pchglist->numpchgs; in jpc_pchglist_remove()
613 jpc_pchglist_t *jpc_pchglist_copy(jpc_pchglist_t *pchglist) in jpc_pchglist_copy() argument
621 for (pchgno = 0; pchgno < pchglist->numpchgs; ++pchgno) { in jpc_pchglist_copy()
622 if (!(newpchg = jpc_pchg_copy(pchglist->pchgs[pchgno])) || in jpc_pchglist_copy()
631 void jpc_pchglist_destroy(jpc_pchglist_t *pchglist) in jpc_pchglist_destroy() argument
634 if (pchglist->pchgs) { in jpc_pchglist_destroy()
635 for (pchgno = 0; pchgno < pchglist->numpchgs; ++pchgno) { in jpc_pchglist_destroy()
636 jpc_pchg_destroy(pchglist->pchgs[pchgno]); in jpc_pchglist_destroy()
638 jas_free(pchglist->pchgs); in jpc_pchglist_destroy()
640 jas_free(pchglist); in jpc_pchglist_destroy()
648 jpc_pchg_t *jpc_pchglist_get(jpc_pchglist_t *pchglist, int pchgno) in jpc_pchglist_get() argument
650 return pchglist->pchgs[pchgno]; in jpc_pchglist_get()
653 int jpc_pchglist_numpchgs(jpc_pchglist_t *pchglist) in jpc_pchglist_numpchgs() argument
655 return pchglist->numpchgs; in jpc_pchglist_numpchgs()