/*
 * User-definable service listing
 * by Ken Hollis
 */

#include "cfingerd.h"

void show_services(void)
{
    int i;

    for (i = 1; i < num_headers + 1; i++)
	pprintf(prog_config.services.header[i]);

    for (i = 0; i < fakeuser_num; i++) {
	printf(prog_config.services.display_string,
	(prog_config.services.name_pos == 1) ? prog_config.fusers[i].user :
	(prog_config.services.service_pos == 1) ? prog_config.fusers[i].description :
	(prog_config.services.search_pos == 1) ?
		(prog_config.fusers[i].searchable ? "TRUE" : "FALSE") : " ",
	(prog_config.services.name_pos == 2) ? prog_config.fusers[i].user :
	(prog_config.services.service_pos == 2) ? prog_config.fusers[i].description :
	(prog_config.services.search_pos == 2) ?
		(prog_config.fusers[i].searchable ? "TRUE" : "FALSE") : " ",
	(prog_config.services.name_pos == 3) ? prog_config.fusers[i].user :
	(prog_config.services.service_pos == 3) ? prog_config.fusers[i].description :
	(prog_config.services.search_pos == 3) ?
		(prog_config.fusers[i].searchable ? "TRUE" : "FALSE") : " ");

	printf("\n");
    }
}
