<commit_before>/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */
#include "ecore_private.h"
#include "Ecore_Data.h"
#include "Ecore_Str.h"

static Ecore_List *group_list = NULL;

Ecore_Path_Group *__ecore_path_group_find(const char *name);
Ecore_Path_Group *__ecore_path_group_find_id(int id);

/**
 * @defgroup Ecore_Path_Group Path Group Functions
 *
 * Functions that make it easier to find a file in a set of search paths.
 *
 * @todo Give this a better description.
 */

/**
 * Creates a new path group.
 * @param   group_name The name of the new group.
 * @return  @c 0 on error, the integer id of the new group on success.
 * @ingroup Ecore_Path_Group
 */
EAPI int
ecore_path_group_new(const char *group_name)
{
   int lastid;
   Ecore_Path_Group *group;

   CHECK_PARAM_POINTER_RETURN("group_name", group_name, -1);

   if (!group_list)
     {
	group_list = ecore_list_new();
	lastid = 0;
     }
   else
     {
	Ecore_Path_Group *last;

	group = __ecore_path_group_find(group_name);
	if (group)
	  return -1;

	last = ecore_list_last_goto(group_list);
	lastid = last->id;
     }
<commit_msg>return -1  if group is not valid<commit_after>/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */
#include "ecore_private.h"
#include "Ecore_Data.h"
#include "Ecore_Str.h"

static Ecore_List *group_list = NULL;

Ecore_Path_Group *__ecore_path_group_find(const char *name);
Ecore_Path_Group *__ecore_path_group_find_id(int id);

/**
 * @defgroup Ecore_Path_Group Path Group Functions
 *
 * Functions that make it easier to find a file in a set of search paths.
 *
 * @todo Give this a better description.
 */

/**
 * Creates a new path group.
 * @param   group_name The name of the new group.
 * @return  @c 0 on error, the integer id of the new group on success.
 * @ingroup Ecore_Path_Group
 */
EAPI int
ecore_path_group_new(const char *group_name)
{
   int lastid;
   Ecore_Path_Group *group;

   CHECK_PARAM_POINTER_RETURN("group_name", group_name, -1);

   if (!group_list)
     {
	group_list = ecore_list_new();
	lastid = 0;
     }
   else
     {
	Ecore_Path_Group *last;

	group = __ecore_path_group_find(group_name);
	if (!group)
	  return -1;

	last = ecore_list_last_goto(group_list);
	lastid = last->id;
     }

{'fraction_non_alphanumeric': 0.11081322609472744, 'fraction_numerical': 0.011170688114387846, 'mean_word_length': 4.008948545861298, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1751421', 'n_tokens_mistral': 875, 'n_tokens_neox': 856, 'n_words': 216}