Lines Matching refs:obj
319 ea_next_object(ea_file_t *ef, ea_object_t *obj) in ea_next_object() argument
346 ret = fread(&obj->eo_catalog, 1, sizeof (ea_catalog_t), f->ef_fp); in ea_next_object()
354 exacct_order32(&obj->eo_catalog); in ea_next_object()
357 obj->eo_type = EO_ITEM; in ea_next_object()
360 switch (obj->eo_catalog & EXT_TYPE_MASK) { in ea_next_object()
362 obj->eo_type = EO_GROUP; in ea_next_object()
370 obj->eo_type = EO_NONE; in ea_next_object()
401 obj->eo_type = EO_NONE; in ea_next_object()
408 obj->eo_type = EO_NONE; in ea_next_object()
415 return (obj->eo_type); in ea_next_object()
419 ea_previous_object(ea_file_t *ef, ea_object_t *obj) in ea_previous_object() argument
470 return (ea_next_object(ef, obj)); in ea_previous_object()
486 ea_object_t *obj, in xget_object() argument
498 if ((r = xread(f, &obj->eo_catalog, sizeof (ea_catalog_t))) == 0) { in xget_object()
505 exacct_order32(&obj->eo_catalog); in xget_object()
511 if ((obj->eo_catalog & EXT_TYPE_MASK) == EXT_GROUP) { in xget_object()
512 obj->eo_type = EO_GROUP; in xget_object()
520 if (xread(f, &obj->eo_group.eg_nobjs, sizeof (uint32_t)) != in xget_object()
525 exacct_order32(&obj->eo_group.eg_nobjs); in xget_object()
535 if (stack_new_group(f, obj->eo_group.eg_nobjs) != 0) { in xget_object()
545 if (obj->eo_group.eg_nobjs == 0) { in xget_object()
554 return (obj->eo_type); in xget_object()
560 obj->eo_type = EO_ITEM; in xget_object()
561 switch (obj->eo_catalog & EXT_TYPE_MASK) { in xget_object()
590 obj->eo_item.ei_string = buf; in xget_object()
595 obj->eo_item.ei_size = sz; in xget_object()
598 if (xread(f, &obj->eo_item.ei_uint8, sizeof (uint8_t)) != in xget_object()
603 obj->eo_item.ei_size = sizeof (uint8_t); in xget_object()
606 if (xread(f, &obj->eo_item.ei_uint16, sizeof (uint16_t)) != in xget_object()
611 exacct_order16(&obj->eo_item.ei_uint16); in xget_object()
612 obj->eo_item.ei_size = sizeof (uint16_t); in xget_object()
615 if (xread(f, &obj->eo_item.ei_uint32, sizeof (uint32_t)) != in xget_object()
620 exacct_order32(&obj->eo_item.ei_uint32); in xget_object()
621 obj->eo_item.ei_size = sizeof (uint32_t); in xget_object()
624 if (xread(f, &obj->eo_item.ei_uint64, sizeof (uint64_t)) != in xget_object()
629 exacct_order64(&obj->eo_item.ei_uint64); in xget_object()
630 obj->eo_item.ei_size = sizeof (uint64_t); in xget_object()
633 if (xread(f, &obj->eo_item.ei_double, sizeof (double)) != in xget_object()
638 exacct_order64((uint64_t *)&obj->eo_item.ei_double); in xget_object()
639 obj->eo_item.ei_size = sizeof (double); in xget_object()
665 return (obj->eo_type); in xget_object()
669 ea_get_object(ea_file_t *ef, ea_object_t *obj) in ea_get_object() argument
671 obj->eo_next = NULL; in ea_get_object()
672 return (xget_object((ea_file_impl_t *)ef, obj, fread_wrapper, in ea_get_object()
683 ea_object_t *obj; in unpack_group() local
695 if ((obj = ea_alloc(sizeof (ea_object_t))) == NULL) { in unpack_group()
699 obj->eo_next = NULL; in unpack_group()
700 if (xget_object(f, obj, bufread_wrapper, bufseek_wrapper, in unpack_group()
702 ea_free(obj, sizeof (ea_object_t)); in unpack_group()
707 (void) ea_attach_to_group(grp, obj); in unpack_group()
709 if (obj->eo_type == EO_GROUP && in unpack_group()
710 unpack_group(f, obj, flag) == -1) { in unpack_group()
734 ea_object_t *obj; in ea_unpack_object() local
753 if ((obj = ea_alloc(sizeof (ea_object_t))) == NULL) { in ea_unpack_object()
758 obj->eo_next = NULL; in ea_unpack_object()
759 if ((first_obj_type = xget_object(&fake, obj, bufread_wrapper, in ea_unpack_object()
762 ea_free(obj, sizeof (ea_object_t)); in ea_unpack_object()
767 if (obj->eo_type == EO_GROUP && unpack_group(&fake, obj, flag) == -1) { in ea_unpack_object()
769 ea_free_object(obj, flag); in ea_unpack_object()
773 *objp = obj; in ea_unpack_object()
781 if ((obj = ea_alloc(sizeof (ea_object_t))) == NULL) { in ea_unpack_object()
788 obj->eo_next = NULL; in ea_unpack_object()
789 if (xget_object(&fake, obj, bufread_wrapper, bufseek_wrapper, in ea_unpack_object()
792 ea_free(obj, sizeof (ea_object_t)); in ea_unpack_object()
804 (void) ea_attach_to_object(*objp, obj); in ea_unpack_object()
806 if (obj->eo_type == EO_GROUP && in ea_unpack_object()
807 unpack_group(&fake, obj, flag) == -1) { in ea_unpack_object()
809 ea_free(obj, sizeof (ea_object_t)); in ea_unpack_object()
819 ea_write_object(ea_file_t *ef, ea_object_t *obj) in ea_write_object() argument
835 sz = ea_pack_object(obj, NULL, 0); in ea_write_object()
840 if (ea_pack_object(obj, buf, sz) == (size_t)-1) { in ea_write_object()
1344 ea_object_t *first_obj, *prev_obj, *obj; in ea_get_object_tree() local
1349 obj = ea_alloc(sizeof (ea_object_t)); in ea_get_object_tree()
1350 bzero(obj, sizeof (*obj)); in ea_get_object_tree()
1353 if (ea_get_object(ef, obj) == -1) { in ea_get_object_tree()
1354 ea_free(obj, sizeof (ea_object_t)); in ea_get_object_tree()
1363 first_obj = obj; in ea_get_object_tree()
1366 prev_obj->eo_next = obj; in ea_get_object_tree()
1368 prev_obj = obj; in ea_get_object_tree()
1371 if (obj->eo_type == EO_GROUP && obj->eo_group.eg_nobjs > 0) { in ea_get_object_tree()
1372 if ((obj->eo_group.eg_objs = ea_get_object_tree(ef, in ea_get_object_tree()
1373 obj->eo_group.eg_nobjs)) == NULL) { in ea_get_object_tree()