Пример #1
0
/**
 * Write one version element to disk
 * @param vparent the parent versions element
 * @param v the version to write
 * @param index the index of the version (>=1)
 * @return 1 if it worked else 0
 */
static int write_one_version( dom_item *vparent, version *v, int index )
{
    int res = 1;
    char istr[8];
    snprintf( istr,8,"%d",index);
    dom_item *velement = dom_object_create( "version" );
    if ( velement != NULL )
    {
        dom_attribute *attr = dom_attribute_create("id",istr);
        if ( attr != NULL )
        {
            res = dom_add_attribute( velement, attr );
            if ( res )
            {
                char *vid = to_utf8( version_id(v),
                                     u_strlen(version_id(v)) );
                if ( vid != NULL )
                {
                    UChar *v_desc = version_description(v);
                    char *description = to_utf8( v_desc, u_strlen(v_desc) );
                    if ( description != NULL )
                    {
                        res = dom_add_attribute( velement,
                                                 dom_attribute_create("vid",vid) );
                        if ( res )
                            res = dom_add_attribute( velement,
                                                     dom_attribute_create("description",
                                                             description) );
                        if ( res )
                            res = dom_add_child( vparent, velement );
                        free( description );
                    }
                    free( vid );
                }
                else
                    res = 0;
            }
            else
                res = 0;
        }
        else
            res = 0;
    }
    else
        res = 0;
    return res;
}
Пример #2
0
/* { dg-do compile { target ia64-*-hpux* } } */

extern int foo () __attribute__((version_id ("20040821")));

int foo(int i)
{
	return (1);
}

/* { dg-final { scan-assembler "alias.*foo.*foo\\\{20040821\\\}" } } */