<commit_before>/*
 * Copyright (c) 2012-2013 <NAME> <<EMAIL>>
 * All rights reserved
 *
 * You may redistribute this file and/or modify it under the terms of the GNU
 * General Public License version 2 as published by the Free Software
 * Foundation. For the terms of this license, see 
 * <http://www.gnu.org/licenses/>.
 *
 * You are free to use this file under the terms of the GNU General Public
 * License, but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "rcv.h"

int
rcv_process_file(rcv_t *rcv, const char *fname, rcv_check_func check)
{

	rcv->env = map_create();
	rcv->have_vars = 0;

	if (!rcv_load_file(rcv, fname))
		exit(EXIT_FAILURE);

	map_add(rcv->env, "HOME", getenv("HOME"));

	while ((rcv_get_pkgver(rcv)) > 0);

	check(rcv);

	map_destroy(rcv->env);
	rcv->env = NULL;
	
	return EXIT_SUCCESS;
}<commit_msg>process_file.c: do not fail if a pkg has been removed.<commit_after>/*
 * Copyright (c) 2012-2013 <NAME> <<EMAIL>>
 * All rights reserved
 *
 * You may redistribute this file and/or modify it under the terms of the GNU
 * General Public License version 2 as published by the Free Software
 * Foundation. For the terms of this license, see 
 * <http://www.gnu.org/licenses/>.
 *
 * You are free to use this file under the terms of the GNU General Public
 * License, but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "rcv.h"

int
rcv_process_file(rcv_t *rcv, const char *fname, rcv_check_func check)
{

	rcv->env = map_create();
	rcv->have_vars = 0;

	if (!rcv_load_file(rcv, fname)) {
		map_destroy(rcv->env);
		rcv->env = NULL;
		return EXIT_FAILURE;
	}

	map_add(rcv->env, "HOME", getenv("HOME"));

	while ((rcv_get_pkgver(rcv)) > 0);

	check(rcv);

	map_destroy(rcv->env);
	rcv->env = NULL;
	
	return EXIT_SUCCESS;
}
{'fraction_non_alphanumeric': 0.12005583992554676, 'fraction_numerical': 0.010237319683573755, 'mean_word_length': 4.046948356807512, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4767867', 'n_tokens_mistral': 766, 'n_tokens_neox': 718, 'n_words': 255}