#include <fcntl.h>
#include "citadel.h"

struct config config;

main() {
	int file,a,b,c;
	struct msgmain msgmain;

	get_config();	
	file=open("./MMstructure",O_RDONLY);
	read(file,&msgmain,sizeof(struct msgmain));
	close(file);

	printf("Node name: %s - Domain name: %s\n",
		config.c_nodename,config.c_fqdn);
	printf("This is %s, located in %s.\n",
		config.c_humannode,config.c_bbs_city);
	printf("The system administrator is %s.\n\n",config.c_sysadm);

if (msgmain.MMflags & MM_VALID)
	printf("New users need validation.\n");
else
	printf("There are no unvalidated users.\n");

	
	printf("\nMessage base statistics:\n");
if (msgmain.MMflags & MM_BUSY)
	printf("Message file is LOCKED.\n");
else
	printf("Message file is unlocked.\n");
	printf("Number of messages on system: %ld\n",
		msgmain.MMhighest - msgmain.MMlowest);
	printf("Range of message ID's online: %ld - %ld\n",
		msgmain.MMlowest,msgmain.MMhighest);
	printf("       Current file position: %ld\n",msgmain.MMcurpos);
	printf("        Size of message base: %ld\n",config.c_msgbase);
	printf("      Average message length: %ld\n",
		config.c_msgbase / (msgmain.MMhighest - msgmain.MMlowest));

	exit(0);
	}
