Ejemplo n.º 1
0
int
source_file(const char filename[])
{
	FILE *fp;
	int result;
	SourcingState sourcing_state;

	if((fp = fopen(filename, "r")) == NULL)
		return 1;

	sourcing_state = curr_stats.sourcing_state;
	curr_stats.sourcing_state = SOURCING_PROCESSING;

	result = source_file_internal(fp, filename);

	curr_stats.sourcing_state = sourcing_state;

	fclose(fp);
	return result;
}
Ejemplo n.º 2
0
int
cfg_source_file(const char filename[])
{
	/* TODO: maybe move this to commands.c or separate unit eventually. */

	FILE *fp;
	int result;
	SourcingState sourcing_state;

	if((fp = os_fopen(filename, "r")) == NULL)
	{
		return 1;
	}

	sourcing_state = curr_stats.sourcing_state;
	curr_stats.sourcing_state = SOURCING_PROCESSING;

	result = source_file_internal(fp, filename);

	curr_stats.sourcing_state = sourcing_state;

	fclose(fp);
	return result;
}