Example #1
0
int cfg_print_subsections(char *section, char *function, char *notfunction, int print_heading)
{
	int ret = 0;
	struct cfg_section *current;
	char *p1, *p2;

	if ((current = cfg_database))
	do {
		p1 = current->name; p2 = section;
		while (*p1 && *p1 == tolower((int)(unsigned char)*p2)) {
			p1++; p2++;
		}
		if (*p1++ != ':') continue;
		if (!*p1 || *p2) continue;
		if (notfunction && ext_has_function(p1, notfunction))
			continue;
		if (!function || ext_has_function(p1, function)) {
			if (ret == 0 && print_heading != 0)
				printf("Subsections of [%s]:\n", section);
			ret++;
			printf("%s\n", p1);
		}
	} while ((current = current->next));
	return ret;
}
Example #2
0
void cfg_print_subsections(char *section, char *function, char *notfunction)
{
	struct cfg_section *current;
	char *p1, *p2;

	if ((current = cfg_database))
	do {
		p1 = current->name; p2 = section;
		while (*p1 && *p1 == tolower((int)(unsigned char)*p2)) {
			p1++; p2++;
		}
		if (*p1++ != ':') continue;
		if (!*p1 || *p2) continue;
		if (notfunction && ext_has_function(p1, notfunction))
			continue;
		if (!function || ext_has_function(p1, function))
			printf("%s\n", p1);
	} while ((current = current->next));
}