File:  [ELWIX - Embedded LightWeight unIX -] / embedtools / src / Attic / dumpcfg.c
Revision 1.1.2.3: download - view: text, annotated - select for diffs - revision graph
Fri Dec 18 14:12:24 2009 UTC (14 years, 6 months ago) by misho
Branches: tools1_0
add new prog

#include "global.h"
#include "dumpz.h"


int Verbose;


int main(int argc, char **argv)
{
	char ch;
	int idxmask = 0;
	register int i, idx;
	sl_config cfg[2];

	while ((ch = getopt(argc, argv, "hvid")) != -1)
		switch (ch) {
			case 'v':
				Verbose++;
				break;
			case 'i':	// interfaces
				idxmask |= 1 << 0;
				break;
			case 'd':	// disks
				idxmask |= 1 << 1;
				break;
			case 'h':
			default:
				return 1;
		}
	argc -= optind;
	argv += optind;

	for (idx = 0; 2 > idx; idx++)
		InitConfig(&cfg[idx]);

	for (i = 0x2, idx = 0; i; i >>= 1, idx++)
		switch (i & idxmask) {
			case 1:
				Interfaces(&cfg[0]);
				break;
			case 2:
				Disks(&cfg[1]);
				break;
		}

	for (idx = 0; 2 > idx; idx++)
		UnloadConfig(&cfg[idx]);
	return 0;
}

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>