<commit_before>/**
 *
 * @file     attribute.h
 * @author   <NAME> <<EMAIL>>
 * @date     Mon Nov 25, 2002 00:39
 * @brief    SCEW attribute type declaration
 *
 * $Id$
 *
 * @if copyright
 *
 * Copyright (C) 2002, 2003 <NAME>
 *
 * SCEW is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * SCEW is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * @endif
 *
 * Attribute related functions. SCEW provides functions to access the
 * attributes of all the loaded elements. XML element attributes are
 * basically a name-value pair.
 */


#ifndef ATTRIBUTE_H_ALEIX0211250039
#define ATTRIBUTE_H_ALEIX0211250039

#include "types.h"

#include <expat.h>

/**
 * Creates a new attribute with the given pair (name, value).
 *
 * @return the new created attribute.
 */
extern scew_attribute*
scew_attribute_create(XML_Char const* name, XML_Char const* value);

/**
 * Frees an attribute memory structure. That is, its name and value.
 */
extern void
scew_attribute_free(scew_attribute* attribute);

/**
 * Returns the number of attributes of the specified element. An element
 * can have zero or more attributes.
 */
extern unsigned int
scew_attribute_count(scew_element const* element);

/**
 * Returns the element attribute on the specified position. Positions
 * are zero based.
 *
 * @return the attribute on the specified position, NULL if there is no
 * attribute in the position.
 */
extern scew_attribute*
scew_attribute_by_index(scew_element const* element, unsigned int idx);

/**
 * Returns the element attribute with the specified name. Remember that<commit_msg>minor changes in documentation<commit_after>/**
 *
 * @file     attribute.h
 * @author   <NAME> <<EMAIL>>
 * @date     Mon Nov 25, 2002 00:39
 * @brief    SCEW attribute type declaration
 *
 * $Id$
 *
 * @if copyright
 *
 * Copyright (C) 2002, 2003 <NAME>
 *
 * SCEW is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * SCEW is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * @endif
 *
 * Attribute related functions. SCEW provides functions to access the
 * attributes of all the loaded elements. XML element attributes are
 * basically a name-value pair.
 */


#ifndef ATTRIBUTE_H_ALEIX0211250039
#define ATTRIBUTE_H_ALEIX0211250039

#include "types.h"

#include <expat.h>

/**
 * Creates a new attribute with the given pair (name, value).
 *
 * @return the new created attribute.
 */
extern scew_attribute*
scew_attribute_create(XML_Char const* name, XML_Char const* value);

/**
 * Frees an attribute memory structure. That is, its name and value. You
 * should not call this function with an attribute coming from an
 * element, but created with <code>scew_attribute_create</code>.
 */
extern void
scew_attribute_free(scew_attribute* attribute);

/**
 * Returns the number of attributes of the specified element. An element
 * can have zero or more attributes.
 */
extern unsigned int
scew_attribute_count(scew_element const* element);

/**
 * Returns the element attribute on the specified position. Positions
 * are zero based.
 *
 * @return the attribute on the specified position, NULL if there is no
 * attribute in the position.
 */
extern scew_attribute*
scew_attribute_by_index(scew_element const* element, unsigned int idx);

/**
 * Returns the element attribute with the specified name. Remember that
{'fraction_non_alphanumeric': 0.0771797153024911, 'fraction_numerical': 0.02402135231316726, 'mean_word_length': 3.9800664451827243, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4353419', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1247, 'n_words': 575}