<commit_before>/*
 * File:  XPathOnSchema.cpp
 * Copyright (C) 2004 The Institute for System Programming of the Russian Academy of Sciences (ISP RAS)
 */


#include "common/sedna.h"

#include "tr/executor/base/XPathOnSchema.h"
#include "tr/executor/base/PPBase.h"
#include "tr/crmutils/node_utils.h"
#include "common/errdbg/d_printf.h"


///////////////////////////////////////////////////////////////////////////////
/// Some usefull static helpers
///////////////////////////////////////////////////////////////////////////////

static inline int compare_schema_node(const void *e1, const void *e2)
{
    return *(int*)e1 - *(int*)e2;
}

static t_scmnodes_const descendant_nodes(schema_node_cptr node,
                                         node_type_restriction restriction,
                                         t_scmnodes_set* extended_nodes,
                                         t_scmnodes_set* extender_nodes)
{

    t_scmnodes_const res;

    /* Recursively get actual descendants of this node */  
    for (sc_ref_item * ref = node->children.first; ref != NULL; ref = ref->next)<commit_msg>fix in abspath schema nodes comparator<commit_after>/*
 * File:  XPathOnSchema.cpp
 * Copyright (C) 2004 The Institute for System Programming of the Russian Academy of Sciences (ISP RAS)
 */


#include "common/sedna.h"

#include "tr/executor/base/XPathOnSchema.h"
#include "tr/executor/base/PPBase.h"
#include "tr/crmutils/node_utils.h"
#include "common/errdbg/d_printf.h"


///////////////////////////////////////////////////////////////////////////////
/// Some usefull static helpers
///////////////////////////////////////////////////////////////////////////////

static inline int compare_schema_node(const void *e1, const void *e2)
{
    schema_node_xptr v1 = *(schema_node_xptr*)e1;
    schema_node_xptr v2 = *(schema_node_xptr*)e2;
    if ( v1 == v2 ) return 0;
    else if ( v1 < v2 ) return -1;
    return 1;
}

static t_scmnodes_const descendant_nodes(schema_node_cptr node,
                                         node_type_restriction restriction,
                                         t_scmnodes_set* extended_nodes,
                                         t_scmnodes_set* extender_nodes)
{

    t_scmnodes_const res;

    /* Recursively get actual descendants of this node */  
    for (sc_ref_item * ref = node->children.first; ref != NULL; ref = ref->next)
{'fraction_non_alphanumeric': 0.21584241408214586, 'fraction_numerical': 0.010477787091366304, 'mean_word_length': 1.6551724137931034, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '356695', 'n_tokens_mistral': 681, 'n_tokens_neox': 652, 'n_words': 164}