Example #1
0
File: sort.c Project: mmuensch/core
bool GenericItemLess(const char *sort_type, void *lhs, void *rhs)
{
    if (strcmp(sort_type, "int") == 0)
    {
        return RlistItemNumberLess(lhs, rhs, NULL, true);
    }
    else if (strcmp(sort_type, "real") == 0)
    {
        return RlistItemNumberLess(lhs, rhs, NULL, false);
    }
    else if (strcmp(sort_type, "IP") == 0 || strcmp(sort_type, "ip") == 0)
    {
        return RlistItemIPLess(lhs, rhs, NULL);
    }
    else if (strcmp(sort_type, "MAC") == 0 || strcmp(sort_type, "mac") == 0)
    {
        return RlistItemMACLess(lhs, rhs, NULL);
    }

    // "lex"
    return RlistItemLess(lhs, rhs, NULL);
}
Example #2
0
File: sort.c Project: cduclos/core
static bool RlistItemRealLess(void *lhs, void *rhs, ARG_UNUSED void *ctx)
{
    return RlistItemNumberLess(lhs, rhs, ctx, false);
}
Example #3
0
File: sort.c Project: cduclos/core
static bool RlistItemIntLess(void *lhs, void *rhs, ARG_UNUSED void *ctx)
{
    return RlistItemNumberLess(lhs, rhs, ctx, true);
}