File:  [ELWIX - Embedded LightWeight unIX -] / embedtools / src / Attic / dumpcfg.c
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Wed Jun 8 12:45:41 2011 UTC (13 years ago) by misho
Branches: MAIN
CVS tags: tools2_0, tools1_2, tools1_1, TOOLS1_2, TOOLS1_1, TOOLS1_0, HEAD
new ver

    1: #include "global.h"
    2: #include "dumpz.h"
    3: 
    4: 
    5: int Verbose;
    6: 
    7: 
    8: int main(int argc, char **argv)
    9: {
   10: 	char ch;
   11: 	int idxmask = 0;
   12: 	register int i, idx;
   13: 	sl_config cfg[2];
   14: 
   15: 	while ((ch = getopt(argc, argv, "hvid")) != -1)
   16: 		switch (ch) {
   17: 			case 'v':
   18: 				Verbose++;
   19: 				break;
   20: 			case 'i':	// interfaces
   21: 				idxmask |= 1 << 0;
   22: 				break;
   23: 			case 'd':	// disks
   24: 				idxmask |= 1 << 1;
   25: 				break;
   26: 			case 'h':
   27: 			default:
   28: 				return 1;
   29: 		}
   30: 	argc -= optind;
   31: 	argv += optind;
   32: 
   33: 	for (idx = 0; 2 > idx; idx++)
   34: 		InitConfig(&cfg[idx]);
   35: 
   36: 	for (i = 0x2, idx = 0; i; i >>= 1, idx++)
   37: 		switch (i & idxmask) {
   38: 			case 1:
   39: 				Interfaces(&cfg[0]);
   40: 				break;
   41: 			case 2:
   42: 				Disks(&cfg[1]);
   43: 				break;
   44: 		}
   45: 
   46: 	for (idx = 0; 2 > idx; idx++)
   47: 		UnloadConfig(&cfg[idx]);
   48: 	return 0;
   49: }

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