Ejemplo n.º 1
0
static
int CC order_column ( const BSTNode *item, const BSTNode *n )
{
    const SColumnBestFit *a = ( const SColumnBestFit* ) item;
    const SColumnBestFit *b = ( const SColumnBestFit* ) n;
    if ( a -> distance < b -> distance )
        return -1;
    if ( a -> distance > b -> distance )
        return 1;
    return VCtxIdCmp ( & a -> scol -> cid, & b -> scol -> cid );
}
Ejemplo n.º 2
0
/* Sort
 *  compares by ( name, type ) pair
 */
int CC VColumnRefSort ( const BSTNode *item, const BSTNode *n )
{
    const VColumnRef *a = ( const VColumnRef* ) item;
    const VColumnRef *b = ( const VColumnRef* ) n;

    /* sorted first by name - case sensitive ASCII alphabetically */
    int diff = StringCompare ( & a -> name, & b -> name );
    if ( diff != 0 )
        return diff;

    /* sort by cid */
    return VCtxIdCmp ( & a -> cid, & b -> cid );
}