Sun-Solaris-Exacct

 view release on metacpan or  search on metacpan

File/File.xs  view on Meta::CPAN

	ea_file_t	*self;
ALIAS:
	previous = 1
PREINIT:
	ea_object_type_t		type;
	const char			*type_str;
	ea_object_t			object;
	SV				*sv;
	static const char *const	type_map[] =
	    { "EO_NONE", "EO_GROUP", "EO_ITEM" };
PPCODE:
	/* Call the appropriate next/last function. */
	if (ix == 0) {
		type = ea_next_object(self, &object);
	} else {
		type = ea_previous_object(self, &object);
	}

	/* Work out the call context. */
	switch (GIMME_V) {
	case G_SCALAR:

Object/Object.xs  view on Meta::CPAN

 # Return the value of the object.  For simple Items, a SV containing the value
 # of the underlying exacct ea_item_t is returned.  For nested Items or Groups,
 # a reference to the nested Item or Group is returned.  For Groups, in a scalar
 # context a reference to the tied array used to store the objects in the Group
 # is returned; in a list context the objects within the Group are returned on
 # the perl stack as a list.
 #
void
value(self)
	xs_ea_object_t	*self;
PPCODE:
	/*
	 * For Items, return the perl representation
	 * of the underlying ea_object_t.
	 */
	if (IS_ITEM(self)) {
		SV	*retval;

		switch (self->ea_obj->eo_catalog & EXT_TYPE_MASK) {
		case EXT_UINT8:
			retval = newSVuv(self->ea_obj->eo_item.ei_uint8);

Object/Object.xs  view on Meta::CPAN

MODULE = Sun::Solaris::Exacct::Object PACKAGE = Sun::Solaris::Exacct::Object::_Array
PROTOTYPES: ENABLE

 #
 # Copy the passed list of xs_ea_object_t.
 #
void
copy_xs_ea_objects(...)
PREINIT:
	int	i;
PPCODE:
	EXTEND(SP, items);
	for (i = 0; i < items; i++) {
		HV	*stash;
		stash = SvROK(ST(i)) ? SvSTASH(SvRV(ST(i))) : NULL;
		if (stash != Sun_Solaris_Exacct_Object_Item_stash &&
		    stash != Sun_Solaris_Exacct_Object_Group_stash) {
			croak("item is not of type " PKGBASE "::Object");
		}
		PUSHs(sv_2mortal(copy_xs_ea_object(ST(i))));
	}



( run in 0.569 second using v1.01-cache-2.11-cpan-5511b514fd6 )