CodeBase

 view release on metacpan or  search on metacpan

CodeBase.xs  view on Meta::CPAN

fieldinfo(self)
     CodeBase::Record	*self

 PREINIT:
    int 	field_no;
    char	buffer[256];
    FIELD4	*field;
    char	field_type;
    int		n_fields;
	
 PPCODE:
    CB_TRACE(1, ("fieldinfo(\"%s\")\n", SELF));
    CB_TRACE(1, ("fieldinfo returns ("));
    cb_errno = CB_SUCCESS;

    n_fields = d4numFields(self->data4);
    
    EXTEND(sp, 2 * n_fields);

    for (field_no = 1; field_no <= n_fields; field_no++) 
    {

CodeBase.xs  view on Meta::CPAN

# 	Returns an array of field names
void
names(self)
    CodeBase::Record	*self

 PREINIT:
    const FIELD4	*field;
    const char		*field_name;
    int			field_no, n_fields;

 PPCODE:
    CB_TRACE(1, ("names(\"%s\"\n", SELF));
    cb_errno = CB_SUCCESS;
    n_fields = d4numFields(self->data4);
    CB_TRACE(1, ("names returns ("));
    EXTEND(sp, n_fields);
    for (field_no = 1; field_no <= n_fields; field_no++)
    {
	field      = d4fieldJ(self->data4, field_no);
	field_name = f4name(field);
	PUSHs(sv_2mortal(newSVpv((char *)field_name, 0)));

CodeBase.xs  view on Meta::CPAN

    CodeBase::Record	*self

 PREINIT:
    FIELD4	*field;
    int 	field_no;
    char	buffer[256];
    char	fieldtype;
    Boolean	only_named_fields = (items > 1);
    int		n_fields;

 PPCODE:
    CB_TRACE(1, ("values(\"%s\")\n", SvPV(ST(0),na)));
    CB_TRACE(1, ("values returns ("));
    cb_errno = CB_SUCCESS;
    n_fields = (only_named_fields ? items - 1 : d4numFields(self->data4));

    EXTEND(sp, n_fields);
    for (field_no = 1; field_no <= n_fields; field_no++) 
    {
	if (!only_named_fields) 
	{

CodeBase.xs  view on Meta::CPAN

    char	*index_name

 PREINIT:
    INDEX4	*index;
    HV		*hash;
    SV		*ref;
    TAG4INFO	*tag4info;
    int		tag_no;
    char	*value;

 PPCODE:
#if S4VERSION < 6000
    if (index_name == NULL)
    {
	index_name = d4fileName(self->data4);
    }
#endif
    CB_TRACE(1, ("taginfo(\"%s\", \"%s\")\n", SELF, index_name));
    cb_errno = CB_SUCCESS;

    if (   ((index = d4index(self->data4, index_name)) == NULL)

CodeBase.xs  view on Meta::CPAN

#	Return tags associated with current index file.
#
void
tags(self)
    CodeBase::File	*self

 PREINIT:
    TAG4	*tag   = NULL;
    int		n_tags = 0;

 PPCODE:
    CB_TRACE(1, ("tags(\"%s\")\n", SELF));
    CB_TRACE(1, ("tags returns ("));
    cb_errno = CB_SUCCESS;
    while ((tag = d4tagNext(self->data4, tag)) != NULL)
    {
	XPUSHs(sv_2mortal(newSVpv(t4alias(tag), 0)));
	CB_TRACE(1, ("%s%s", (n_tags++ ? ", " : ""), t4alias(tag)));
    }
    CB_TRACE(1, (")\n"));



( run in 0.413 second using v1.01-cache-2.11-cpan-71847e10f99 )