Lines Matching refs:attrtab
96 static int jas_iccattrtab_lookup(jas_iccattrtab_t *attrtab, jas_iccuint32_t name);
97 static jas_iccattrtab_t *jas_iccattrtab_copy(jas_iccattrtab_t *attrtab);
139 static int jas_iccattrtab_add(jas_iccattrtab_t *attrtab, int i,
141 static int jas_iccattrtab_replace(jas_iccattrtab_t *attrtab, int i,
143 static void jas_iccattrtab_delete(jas_iccattrtab_t *attrtab, int i);
145 static int jas_iccattrtab_get(jas_iccattrtab_t *attrtab, int i,
212 if (!(prof->attrtab = jas_iccattrtab_create())) in jas_iccprof_create()
233 assert(newprof->attrtab); in jas_iccprof_copy()
234 jas_iccattrtab_destroy(newprof->attrtab); in jas_iccprof_copy()
235 if (!(newprof->attrtab = jas_iccattrtab_copy(prof->attrtab))) in jas_iccprof_copy()
246 if (prof->attrtab) in jas_iccprof_destroy()
247 jas_iccattrtab_destroy(prof->attrtab); in jas_iccprof_destroy()
255 jas_iccattrtab_dump(prof->attrtab, out); in jas_iccprof_dump()
376 if (!(tagtab->ents = jas_alloc2(prof->attrtab->numattrs, in jas_iccprof_save()
379 tagtab->numents = prof->attrtab->numattrs; in jas_iccprof_save()
383 if (jas_iccattrtab_get(prof->attrtab, i, &attrname, &attrval)) in jas_iccprof_save()
421 if (jas_iccattrtab_get(prof->attrtab, i, &attrname, &attrval)) in jas_iccprof_save()
550 if ((i = jas_iccattrtab_lookup(prof->attrtab, name)) < 0) in jas_iccprof_getattr()
552 if (!(attrval = jas_iccattrval_clone(prof->attrtab->attrs[i].val))) in jas_iccprof_getattr()
563 if ((i = jas_iccattrtab_lookup(prof->attrtab, name)) >= 0) { in jas_iccprof_setattr()
565 if (jas_iccattrtab_replace(prof->attrtab, i, name, val)) in jas_iccprof_setattr()
568 jas_iccattrtab_delete(prof->attrtab, i); in jas_iccprof_setattr()
572 if (jas_iccattrtab_add(prof->attrtab, -1, name, val)) in jas_iccprof_setattr()
689 static jas_iccattrtab_t *jas_iccattrtab_copy(jas_iccattrtab_t *attrtab) in jas_iccattrtab_copy() argument
695 for (i = 0; i < attrtab->numattrs; ++i) { in jas_iccattrtab_copy()
696 if (jas_iccattrtab_add(newattrtab, i, attrtab->attrs[i].name, in jas_iccattrtab_copy()
697 attrtab->attrs[i].val)) in jas_iccattrtab_copy()
716 void jas_iccattrtab_dump(jas_iccattrtab_t *attrtab, FILE *out) in jas_iccattrtab_dump() argument
723 fprintf(out, "numattrs=%d\n", attrtab->numattrs); in jas_iccattrtab_dump()
725 for (i = 0; i < attrtab->numattrs; ++i) { in jas_iccattrtab_dump()
726 attr = &attrtab->attrs[i]; in jas_iccattrtab_dump()
754 static int jas_iccattrtab_add(jas_iccattrtab_t *attrtab, int i, in jas_iccattrtab_add() argument
762 i = attrtab->numattrs; in jas_iccattrtab_add()
764 assert(i >= 0 && i <= attrtab->numattrs); in jas_iccattrtab_add()
765 if (attrtab->numattrs >= attrtab->maxattrs) { in jas_iccattrtab_add()
766 if (jas_iccattrtab_resize(attrtab, attrtab->numattrs + 32)) { in jas_iccattrtab_add()
772 n = attrtab->numattrs - i; in jas_iccattrtab_add()
774 memmove(&attrtab->attrs[i + 1], &attrtab->attrs[i], in jas_iccattrtab_add()
776 attr = &attrtab->attrs[i]; in jas_iccattrtab_add()
779 ++attrtab->numattrs; in jas_iccattrtab_add()
787 static int jas_iccattrtab_replace(jas_iccattrtab_t *attrtab, int i, in jas_iccattrtab_replace() argument
794 attr = &attrtab->attrs[i]; in jas_iccattrtab_replace()
803 static void jas_iccattrtab_delete(jas_iccattrtab_t *attrtab, int i) in jas_iccattrtab_delete() argument
806 jas_iccattrval_destroy(attrtab->attrs[i].val); in jas_iccattrtab_delete()
807 if ((n = attrtab->numattrs - i - 1) > 0) in jas_iccattrtab_delete()
808 memmove(&attrtab->attrs[i], &attrtab->attrs[i + 1], in jas_iccattrtab_delete()
810 --attrtab->numattrs; in jas_iccattrtab_delete()
813 static int jas_iccattrtab_get(jas_iccattrtab_t *attrtab, int i, in jas_iccattrtab_get() argument
817 if (i < 0 || i >= attrtab->numattrs) in jas_iccattrtab_get()
819 attr = &attrtab->attrs[i]; in jas_iccattrtab_get()
828 static int jas_iccattrtab_lookup(jas_iccattrtab_t *attrtab, in jas_iccattrtab_lookup() argument
833 for (i = 0; i < attrtab->numattrs; ++i) { in jas_iccattrtab_lookup()
834 attr = &attrtab->attrs[i]; in jas_iccattrtab_lookup()