1 /***********************************************************************/
2 /* Open Visualization Data Explorer                                    */
3 /* (C) Copyright IBM Corp. 2004                                        */
4 /* ALL RIGHTS RESERVED                                                 */
5 /* This code licensed under the                                        */
6 /*    "IBM PUBLIC LICENSE - Open Visualization Data Explorer"          */
7 /***********************************************************************/
8 
9 /* please read tmainUtil.h for explanation of class */
10 
11 #pragma unmanaged
12 
13 #include "tmainUtil.h"
14 #include <direct.h>
15 #include <windows.h>
16 #include <iostream>
17 
18 using namespace std;
19 
20 // forward declarations
21 int fillparms(string[], const char *, int*);
22 
getenvstr(char * name,string & value)23 int getenvstr(char *name, string& value)
24 {
25 	size_t requiredSize;
26 	char *s=NULL;
27 
28 	getenv_s( &requiredSize, NULL, 0, name);
29 	if(requiredSize > 1) {
30 		s = new char[requiredSize];
31 		if(!s)
32 		{
33 			printf("Failed to allocate memory!\n");
34 			exit(1);
35 		}
36 		getenv_s( &requiredSize, s, requiredSize, name);
37 
38 		if (s) {
39 			value = s;
40 			// Go ahead and remove any enclosing quotes.
41 			for(int i=value.length()-1; i >= 0; i--) {
42 				if(value[i] == '"')
43 					value.erase(i, 1);
44 			}
45 		}
46 	}
47 	return ((s && *s) ? 1 : 0);
48 }
49 
50 /*  In Windows, the name/value pair must be separated by = 	*/
51 /*  with no blanks on either side of =.  Null values would have */
52 /*  name=\0 to unset them in the environment.			*/
putenvstr(char * name,const char * in)53 int putenvstr(char *name, const char *in)
54 {
55 	char *value = new char[strlen(in)+1];
56 	strcpy_s(value, strlen(in)+1, in);
57     char s[MAXENV];
58     char *p, *q;
59     int rc;
60     int len;
61     int newlen;
62 
63     if (!*name)
64 	return 0;
65 
66     if (!*value)
67         return 0;
68 
69     for(p = name; *p == ' '; p++);
70     for(q = &name[strlen(name)-1]; *q == ' ' && q != p; q--);
71 
72     len = (int)(q-p)+1;
73     strncpy_s(s, MAXENV, p, len);
74     s[len] = '\0';
75     strcat_s(s, MAXENV, "=");
76 
77     for(p = value; *p == ' '; p++);
78     if(strlen(p)) {
79 	for(q = &value[strlen(value)-1]; *q == ' ' && q != p; q--);
80 	if (*p != ' ') {
81 	    newlen = strlen(s);
82 	    len = (int)(q-p)+1;
83 	    strncat_s(s, MAXENV, p, len);
84 	    s[len+newlen] = '\0';
85 	}
86     }
87 
88     p = new char[strlen(s) + 1];
89     strcpy_s(p, strlen(s)+1, s);
90 
91     rc = _putenv(p);
92 	delete p;
93 	delete value;
94 
95     return (!rc ? 1 :0);
96 }
97 
~DXEnvironment()98 DXEnvironment::~DXEnvironment() {
99 	if(exnumflags>0)
100 		delete [] exflags;
101 	if(uinumflags>0)
102 		delete [] uiflags;
103 }
104 
addExFlag(string s)105 void DXEnvironment::addExFlag(string s) {
106 	string *temp = new string[exnumflags+1];
107 	for(int i = 0; i < exnumflags; i++)
108 		temp[i] = exflags[i];
109 
110 	temp[exnumflags] = s;
111 	exnumflags++;
112 
113 	if(exnumflags>1)
114 		delete [] exflags;
115 
116 	exflags = temp;
117 }
118 
addUiFlag(string s)119 void DXEnvironment::addUiFlag(string s) {
120 	string *temp = new string[uinumflags+1];
121 	for(int i = 0; i < uinumflags; i++)
122 		temp[i] = uiflags[i];
123 
124 	temp[uinumflags] = s;
125 	uinumflags++;
126 
127 	if(uinumflags>1)
128 		delete [] uiflags;
129 
130 	uiflags = temp;
131 }
132 
getExFlags()133 string DXEnvironment::getExFlags() {
134 	string temp;
135 
136 		for(int i=0; i < exnumflags; i++)
137 			temp += exflags[i] + " ";
138 
139 	return temp;
140 }
141 
getUiFlags()142 string DXEnvironment::getUiFlags() {
143 	string temp;
144 
145 		for(int i=0; i < uinumflags; i++)
146 			temp += uiflags[i] + " ";
147 
148 	return temp;
149 }
150 
getExArgs(char ** & argv)151 int DXEnvironment::getExArgs(char ** &argv) {
152 
153 	argv = new char*[exnumflags];
154 	for(int i = 0; i < exnumflags; i++) {
155 		argv[i] = new char[exflags[i].length() + 1];
156 		strcpy_s(argv[i], exflags[i].length()+1, exflags[i].c_str());
157 	}
158 
159 	return exnumflags;
160 }
161 
getUiArgs(char ** & argv)162 int DXEnvironment::getUiArgs(char ** &argv) {
163 
164 	argv = new char*[uinumflags];
165 	for(int i = 0; i < uinumflags; i++) {
166 		argv[i] = new char[uiflags[i].length()+1];
167 		strcpy_s(argv[i], uiflags[i].length()+1, uiflags[i].c_str());
168 	}
169 
170 	return uinumflags;
171 }
172 
173 
174 #define checkna(str)	\
175     if ((i >= numparams-1) || (params[i+1][0] == '-')) {	\
176 		throw(str);		\
177     }					\
178 	i++;				\
179 	s = params[i];
180 
Setup(const int argc,char ** argv)181 int DXEnvironment::Setup(const int argc, char **argv) {
182 	char cwd[512];
183 	_getcwd(cwd, sizeof(cwd));
184 	curdir = cwd;
185 	string localpath;
186 	char path[MAXENV];
187 	bool seeflags = false;
188 
189 	getenvstr("Path", localpath);
190 	strcpy_s(path, MAXENV, localpath.c_str());
191 	getenvstr("DXARGS", dxargs);
192 	getenvstr("DXROOT", dxroot);
193 	getenvstr("DXDATA", dxdata);
194 	getenvstr("DXMACROS", dxmacros);
195 	getenvstr("DXMODULES", dxmodules);
196 	getenvstr("DXMDF", dxmdf);
197 	getenvstr("DXINCLUDE", dxinclude);
198 	getenvstr("DXCOLORS", dxcolors);
199 	getenvstr("MAGICK_HOME", magickhome);
200 
201 	if(dxroot == ""){
202 		TCHAR path[512];
203 		/* get dxroot by locating path to executable. */
204 		if(GetModuleFileName(NULL, path, 512)) {
205 			dxroot = path;
206 		}
207 	}
208 
209 	if(dxroot.rfind(".exe") != string::npos) {
210 		// remove exe file name
211 		int lastbs = dxroot.rfind("\\");
212 		dxroot.erase(lastbs);
213 	}
214 
215 	// remove the last slash or backslash.
216 	if(dxroot != "" &&
217 		(dxroot[dxroot.length()] == '/' || dxroot[dxroot.length()] == '\\'))
218 		dxroot.erase(dxroot.length());
219 
220 	/* now add dxroot\samples\data to dxdata */
221 	if(dxdata != "")
222 		dxdata += ";";
223 	dxdata += dxroot;
224 	dxdata += "\\samples\\data";
225 
226 	/* now add dxroot\samples\macros to dxmacros */
227 	if(dxmacros != "")
228 		dxmacros += ";";
229 	dxmacros += dxroot;
230 	dxmacros += "\\samples\\macros";
231 
232 	// getparms
233 
234 	// fill parms array, first with DXARGS values
235 	// then with the command line options
236 	// then with pipe args
237 	// so they will have priority given to the last ones in
238 
239 	int n = 0;
240 	int i = 0;
241 
242 	fillparms(params, dxargs.c_str(), &n);
243 
244 	int readpipe = 0;
245 
246 	// The UI and EX need the exe given.
247 	addUiFlag(argv[0]);
248 	addExFlag(argv[0]);
249 
250 	for(i=1; i < argc; i++) {
251 		params[n] = argv[i];
252 		if(params[n] == "-pipeargs")
253 			readpipe = 1;
254 		else {
255 			n++;
256 		}
257 	}
258 
259 	if(readpipe) {
260 		char c;
261 		string pipestr;
262 		for(i = 0; (c=getchar()) != EOF; i++)
263 			pipestr[i] = c;
264 		pipestr[i] = '\0';
265 		fillparms(params, pipestr.c_str(), &n);
266 	}
267 
268 	numparams = n;
269 
270 	/* now parse the paramters */
271 	//try {
272 		string exhighlight = "-B";
273 
274 		for(i=0; i<numparams; i++) {
275 			string s = params[i];
276 			if(s == "-whereami") {
277 				printf("installed in %s\n", dxroot);
278 				exit(0);
279 			}
280 			if(s == "-whicharch") {
281 				printf("windows\n");
282 				exit(0);
283 			}
284 			if(s == "-host") {
285 				checkna("-host: missing host name");
286 				exhost = s;
287 			} else
288 			if(s == "-local") {
289 				exhost = "localhost";
290 			} else
291 			if(s == "-connect") {
292 				throw("Not able to run remote at this time.");
293 			} else
294 			if(s == "-directory") {
295 				checkna("-directory: missing directory name");
296 				cdto = s;
297 			} else
298 			if(s == "-memory") {
299 				checkna("-memory: missing parameter, must give number of Megabytes");
300 				addExFlag(" -M" + s );
301 			} else
302 			if(s == "-threads") {
303 				checkna("-threads: missing parameter, must give number of threads");
304 				addExFlag("-p");
305 				addExFlag(s);
306 			} else
307 			if(s == "-port") {
308 				checkna("-port: missing port number");
309 				port = s;
310 			} else
311 			if(s == "-image" || s == "-edit" || s == "-java" || s == "-kiosk" || s == "-menubar") {
312 				uimode = s;
313 				if(s == "-menubar")
314 					uimode = " -kiosk";
315 				addExFlag(" -r");
316 			} else
317 			if(s == "-execute")
318 				addUiFlag(s);
319 			else
320 			if(s == "-execute_on_change")
321 				addUiFlag(s);
322 			else
323 			if(s == "-suppress")
324 				addUiFlag(s);
325 			else
326 			if(s == "-synchronous")
327 				addUiFlag(s);
328 			else
329 			if(s == "-log") {
330 				if( i >= numparams )
331 					throw("-log: missing parameter, must be on or off");
332 				i++; s = params[i];
333 				if(s == "on") {
334 					addUiFlag("-log");
335 					addUiFlag("on");
336 					addExFlag("-l");
337 				} else if (s == "off") {
338 					addUiFlag("-log");
339 					addUiFlag("off");
340 				} else
341 					throw("-log: bad parameter, must be on or off");
342 			}
343 			else
344 			if(s == "-cache") {
345 				if(i >= numparams )
346 					throw("-cache: missing parameter, must be on or off");
347 				i++; s = params[i];
348 				if(s == "on") {
349 					addUiFlag("-cache");
350 					addUiFlag("on");
351 				} else if (s == "off") {
352 					addUiFlag("-cache");
353 					addUiFlag("off");
354 					addExFlag("-c");
355 				} else
356 					throw("-cache: bad parameter, must be on or off");
357 			}
358 			else
359 			if(s == "-trace") {
360 				if(i >= numparams)
361 					throw("-trace: missing parameter, must be on or off");
362 				i++; s = params[i];
363 				if(s == "on") {
364 					addExFlag("-T");
365 					addUiFlag("-trace");
366 					addUiFlag("on");
367 				} else if (s == "off") {
368 					addUiFlag("-trace");
369 					addUiFlag("off");
370 				} else
371 					throw("-trace: bad parameter, must be on or off");
372 			}
373 			else
374 			if(s == "-readahead") {
375 				if(i >= numparams)
376 					throw("-readahead: missing parameter, must be on or off");
377 				i++; s = params[i];
378 				if(s == "on") {
379 					addUiFlag("-readahead");
380 					addUiFlag("on");
381 				} else if (s == "off") {
382 					addExFlag("-u");
383 					addUiFlag("-readahead");
384 					addUiFlag("off");
385 				} else
386 					throw("-readahead: bad parameter, must be on or off");
387 			}
388 			else
389 			if(s == "-timing") {
390 				if(i >= numparams)
391 					throw("-timing: missing parameter, must be on or off");
392 				i++; s = params[i];
393 				if(s == "on") {
394 					addExFlag("-m");
395 					addUiFlag("-timing");
396 					addUiFlag("on");
397 				} else if (s == "off") {
398 					addUiFlag("-timing");
399 					addUiFlag("off");
400 				} else
401 					throw("-timing: bad parameter, must be on or off");
402 			}
403 			else
404 			if(s == "-highlight") {
405 				if(i >= numparams)
406 					throw("-highlight: missing parameter, must be on or off");
407 				i++; s = params[i];
408 				if(s == "on") {
409 					addUiFlag("-highlight");
410 					addUiFlag("on");
411 				} else if (s == "off") {
412 					exhighlight = "";
413 					addUiFlag("-highlight");
414 					addUiFlag("off");
415 				} else
416 					throw("-highlight: bad parameter, must be on or off");
417 			}
418 			else
419 			if(s == "-optimize") {
420 				checkna("-optimize: missing parameter");
421 				if(s == "memory") {
422 					putenvstr("DXPIXELTYPE", "DXByte");
423 					putenvstr("DXDELAYEDCOLORS", "1");
424 				} else if (s == "precision") {
425 					putenvstr("DXPIXELTYPE", "DXFloat");
426 					putenvstr("DXDELAYEDCOLORS", "");
427 				} else
428 					throw("-optimize: parameter not recognized");
429 			}
430 			else
431 			if(s == "-script") {
432 				addExFlag("-R");
433 				exonly = true;
434 			}
435 			else
436 			if(s == "-exonly" || s == "-execonly") {
437 				addExFlag("-r");
438 				exonly = true;
439 			}
440 			else
441 			if(s == "-program") {
442 				checkna("-program: missing program name");
443 				filename = s;
444 			}
445 			else
446 			if(s == "-cfg") {
447 				checkna("-cfg: missing configuration file");
448 				addUiFlag("-cfg");
449 				addUiFlag(s);
450 			}
451 			else
452 			if(s == "-uionly") {
453 				uionly = true;
454 			}
455 			else
456 			if(s == "-dxroot") {
457 				checkna("-dxroot: missing directory name");
458 				dxroot = s;
459 			}
460 			else
461 			if(s == "-mdf") {
462 				checkna("-mdf: missing filename");
463 				dxmdf = s;
464 				addExFlag("-F");
465 				addExFlag(s);
466 				addUiFlag("-mdf");
467 				addUiFlag(s);
468 			}
469 			else
470 			if(s == "-data") {
471 				checkna("-data: missing directory list");
472 				dxdata = s;
473 			}
474 			else
475 			if(s == "-macros") {
476 				checkna("-macros: missing directory list");
477 				dxmacros = s;
478 			}
479 			else
480 			if(s == "-include") {
481 				checkna("-include: missing directory list");
482 				dxinclude = s;
483 			}
484 			else
485 			if(s == "-colors") {
486 				checkna("-colors: missing file name");
487 				dxcolors = s;
488 			}
489 			else
490 			if(s == "-verbose" || s == "-echo") {
491 				seeflags = true;
492 			}
493 			else
494 			if(s == "-help" || s == "-shorthelp" || s == "-h")
495 				ShortHelp();
496 			else
497 			if(s == "-morehelp" || s == "-longhelp")
498 				LongHelp();
499 			else
500 			if(s == "-version") {
501 				showversion = true;
502 			}
503 			else
504 			if(s == "-file") {
505 				checkna("-file: missing input filename");
506 				filename = s;
507 			}
508 			else
509 			if(s[0] == '-') {
510 				string err = "Unrecognized parameter: " + s;
511 				throw(err);
512 			}
513 			else
514 			if(filename != "") {
515 				string err = "input filename already set to '" + filename;
516 				err += "' ; '" + s + "' unrecognized";
517 				throw(err);
518 			}
519 			else
520 				filename = s;
521 
522 
523 		}
524 
525 		addExFlag(exhighlight); // Since highlight can only be turned off with the flag.
526 
527 	//}
528 	//catch(char *err) {
529 	//	printf("%s\n", err);
530 	//	exit(1);
531 	//}
532 
533 	strcat_s(path, MAXENV, ";");
534 	strcat_s(path, MAXENV, magickhome.c_str());
535 
536 	putenvstr("DXDATA", dxdata.c_str());
537 	putenvstr("DXMACROS", dxmacros.c_str());
538 	putenvstr("DXMODULES", dxmodules.c_str());
539 	putenvstr("DXINCLUDE", dxinclude.c_str());
540 	putenvstr("DXMDF", dxmdf.c_str());
541 	putenvstr("DXCOLORS", dxcolors.c_str());
542 	putenvstr("MAGICK_HOME", magickhome.c_str());
543 	putenvstr("DXROOT", dxroot.c_str());
544 
545 	if(exonly && uionly) {
546 		printf("-uionly and execonly are mutually exclusive.\n");
547 		exit(1);
548 	}
549 
550 	if(seeflags) {
551 		//Need to print out env as well
552 
553 		LPVOID d = GetEnvironmentStrings();
554 		LPTSTR s;
555 
556 		if(d) {
557 			for(s = (LPSTR) d; *s; s++)
558 			{
559 				while( *s )
560 					putchar(*s++);
561 				putchar('\n');
562 			}
563 			FreeEnvironmentStrings((LPSTR)d);
564 		}
565 
566 		cout << endl << "-----------------------------" << endl << endl;
567 		cout << "exflags: " << getExFlags() << endl;
568 		cout << "uiflags: " << getUiFlags() << endl;
569 		cout << "dxroot: " << dxroot << endl;
570 		cout << "dxargs: " << dxargs << endl;
571 		cout << "dxdata: " << dxdata << endl;
572 		cout << "dxmacros: " << dxmacros << endl;
573 		cout << "dxmodules: " << dxmodules << endl;
574 		cout << "dxmdf: " << dxmdf << endl;
575 		cout << "dxinclude: " << dxinclude << endl;
576 		cout << "dxcolors: " << dxcolors << endl;
577 		cout << "magickhome: " << magickhome << endl;
578 		cout << "curdir: " << curdir << endl;
579 		cout << "exhost: " << exhost << endl;
580 		cout << "cdto: " << cdto << endl;
581 		cout << "filename: " << filename << endl;
582 		cout << "port: " << port << endl;
583 		exit(1);
584 	}
585 
586 	if(cdto == "")
587 		cdto = cwd;
588 	_chdir(cdto.c_str());
589 
590 	return 0;
591 }
592 
593 
594 
595 
596 /*  This fills the parm array with tokens that have their	*/
597 /*  leading and trailing blanks removed.  In Windows, filepaths	*/
598 /*  may contain spaces if they were passed in as quoted strings	*/
599 /*  and the shell may have removed the quotes, leaving interior	*/
600 /*  blanks.							*/
fillparms(string parm[],const char * orig,int * n)601 int fillparms(string parm[], const char *orig, int* n)
602 {
603 	char *p, *q, *s;
604 	s = new char[strlen(orig) + 1];
605 	strcpy_s(s, strlen(orig)+1, orig);
606 
607 	for (p = s; *p; p++)
608 		if (*p == '\t' || *p == '\n' || *p == '\f')
609 			*p = ' ';
610 
611 	for (p = s; *p; p = q) {			/* start next */
612 		for( ; *p == ' '; p++)			/* skip to nonblank */
613 			;
614 		if(*p == '"')
615 			for(q = p; *q && *q != '"'; q++)	/* find quoted token end */
616 				;
617 		else
618 			for (q = p; *q && *q != ' '; q++)	/* find token end */
619 				;
620 		if (p == q)				/* no more tokens */
621 			return 1;
622 		char *dest = new char[q-p+1];
623 		strncpy_s(dest, q-p+1, p, (int)(q-p));		/* load it */
624 		dest[(int)(q-p)] = '\0';
625 		parm[*n] = dest;
626 		delete dest;
627 		(*n)++;
628 	}
629 
630 	delete s;
631 
632 	return 1;
633 }
634 
635 
ShortHelp()636 int ShortHelp()
637 {
638     printf(
639 
640 "command line parameters:\n"
641 " -program filename    start UI with this network\n"
642 " -image               start DX with an image window as the anchor window \n"
643 " -edit                start DX with an editor window as the anchor window \n"
644 " -menubar             start DX with a small menubar as the anchor window \n"
645 " -startup             start DX with an initial startup panel (default) \n"
646 "\n"
647 " -uionly              start the UI only (no exec)\n"
648 " -script filename     start the exec only, in script mode, running this script\n"
649 " -script              start the exec only, in script mode\n"
650 "\n"
651 " -host hostname       start executive on this machine\n"
652 " -memory #Mbytes      set the amount of memory the exec uses\n"
653 "\n"
654 " -macros pathlist     directory list to search for UI macros\n"
655 " -data pathlist       directory list to search for data files\n"
656 "\n"
657 " -prompter            start the DX Data Prompter\n"
658 " -builder             start the DX Module Builder\n"
659 " -tutor               start the DX Tutorial\n"
660 "\n"
661 " -morehelp            print longer help with information about other options\n"
662 
663 
664     );
665 
666     exit(0);
667 }
668 
LongHelp()669 int LongHelp()
670 {
671     printf(
672 
673 "command line parameters:\n"
674 " -host hostname       start executive on this machine               \n"
675 " -local               start executive on the current machine (default)\n"
676 "\n"
677 " -program filename    start UI with this network\n"
678 " -script filename     run exec only, in script mode, with this script\n"
679 " -script              run exec only, in script mode\n"
680 "\n"
681 " -image               start DX with an image window as the anchor window \n"
682 " -edit                start DX with the VP Editor as the anchor \n"
683 " -menubar             start DX with a small menubar as the anchor window \n"
684 " -startup             start DX with an initial dialog (default) \n"
685 "\n"
686 " -uionly              start the UI only (no exec)\n"
687 " -execonly            start the exec only (no UI) in remote mode\n"
688 " -connect host:port   start a distributed exec only (no UI)\n"
689 "\n"
690 " -prompter            start the DX Data Prompter\n"
691 " -jdxserver           start the JavaDX Server\n"
692 " -full                start the Full Data Prompter\n"
693 " -file filename       start the Data Prompter with this header file\n"
694 "\n"
695 " -builder             start the DX Module Builder\n"
696 " -tutor               start the DX Tutorial\n"
697 "\n"
698 " -suppress            do not open control panels at startup in image mode\n"
699 " -execute             execute the program automatically at startup\n"
700 " -execute_on_change   go into execute_on_change mode at startup\n"
701 "\n"
702 " -optimize [memory|precision]\n"
703 "                      select whether to minimize memory usage or to produce \n"
704 "                      more color-accurate images.  When memory is optimized, \n"
705 "                      image objects are generated with 24 bits/pixel instead \n"
706 "                      of 96, and ReadImage will produce delayed color images \n"
707 "                      if supported by the format. (default = precision)\n"
708 "\n"
709 " -memory #Mbytes      set the amount of memory the exec uses\n"
710 " -threads #threads    set the number of threads the exec uses \n"
711 "                      (SMP versions only)\n"
712 " -log [on|off]        executive and ui logging: (default = off)\n"
713 " -cache [on|off]      executive cache: (default = on)\n"
714 " -trace [on|off]      executive trace: (default = off)\n"
715 " -readahead [on|off]  executive readahead: (default = on)\n"
716 " -timing [on|off]     module timing: (default = off)\n"
717 " -highlight [on|off]  node execution highlighting: (default = on)\n"
718 " -directory dirname   cd to this directory before starting exec\n"
719 " -metric              have the UI use metric units when possible\n"
720 "\n"
721 " -exec filename       execute this user executive\n"
722 " -mdf filename        use this user .mdf file\n"
723 "\n"
724 " -key <64bit hex>     16 character hexidecimal (64 bit) number that is used\n"
725 "		      to encode and decode .net files.\n"
726 " -encode              Encode a .net file into a binary format with a key \n"
727 "                      that must be specified with the -key option.   \n"
728 "                      For example, \n"
729 "                        dx -encode -key 193495946952abed foo.net \n"
730 "                      The resulting file can only be decoded by the DX\n"
731 "                      user interface when using the same -key option.\n"
732 "                      For example, \n"
733 "                        dx -key 193495946952abed bar.net \n"
734 "\n"
735 " -dxroot dirname      dx root directory; defaults to /usr/lpp/dx\n"
736 "\n"
737 " -macros pathlist     directory list to search for UI macros\n"
738 " -data pathlist       directory list to search for data files\n"
739 " -include pathlist    directory list to search for script files\n"
740 " -modules pathlist    directory list to search for outboard modules\n"
741 "\n"
742 " -colors filename     replace default color names/RGB values file\n"
743 " -8bitcmap [private|shared|0-1|-1]\n"
744 "                      private/shared colormap error threshold (default=0.1)\n"
745 "                      -1 is equivalent to private.\n"
746 " -hwrender [gl|opengl]  \n"
747 "                      override default hardware rendering library on platforms\n"
748 "                      where both are supported.  (default = opengl).\n"
749 "\n"
750 " -verbose             echo command lines before executing\n"
751 " -echo                echo the command lines without executing them\n"
752 " -outboarddebug       let user start outboard modules by hand\n"
753 " -version             show version numbers of dxexec, dxui, dx.exe, and X server\n"
754 " -synchronous         force synchronization of X events between dx and the x server\n"
755 "\n"
756 " -help                print a short help message\n"
757 " -morehelp            print this help message\n"
758 "\n"
759 "environment variables:\n"
760 " DXHOST               sets hostname for -host\n"
761 "\n"
762 " DXPROCESSORS         sets number of processors for multiprocessor DX\n"
763 " DXMEMORY             sets memory limit in megabytes\n"
764 " DXAXESMAXWIDTH       sets the maximum number of digits in axes tick labels\n"
765 "                      before a switch to scientific notation is made\n"
766 " DXDEFAULTIMAGEFORMAT Sets the image type to either 24-bit color or floating\n"
767 "                      point color (96-bit) images depending on the value\n"
768 "                      DXByte (24-bit) or DXFloat (96-bit)\n"
769 " DXDELAYEDCOLORS      If set to anything other than 0, enables ReadImage to\n"
770 "                      created delayed color images if the image is stored in\n"
771 "                      a tiff byte-with-colormap format or a gif image\n"
772 " DX_NESTED_LOOPS      For faces, loops, and edges data, if set, allows loops\n"
773 "                      other than the enclosing loop for a face to be listed\n"
774 "                      first, with a consequent decrease in performance\n"
775 " DXPIXELTYPE          Sets the image type to either 24-bit color or floating\n"
776 "                      point (96-bit) color.  This affects the behavior of\n"
777 "                      Render and ReadImage.  This can be set to either DXByte\n"
778 "                      or DXFloat (default).\n"
779 " DX_USER_INTERACTOR_FILE Specifies a file containing user interactors for use by\n"
780 "                      the SuperviseState and SuperviseWindow modules\n"
781 "\n"
782 " DXEXEC               sets filename for -exec\n"
783 " DXMDF                sets filename for -mdf\n"
784 "\n"
785 " DXMACROS             sets pathlist for -macros\n"
786 " DXDATA               sets pathlist for -data\n"
787 " DXINCLUDE            sets pathlist for -include\n"
788 " DXMODULES            sets pathlist for -modules\n"
789 "\n"
790 " DXCOLORS             sets filename for -colors\n"
791 " DX8BITCMAP           sets threshold for -8bitcmap\n"
792 "\n"
793 " DXGAMMA              sets gamma correction for displayed images. Default is 2.\n"
794 " DXGAMMA_8BIT\n"
795 " DXGAMMA_12BIT\n"
796 " DXGAMMA_24BIT        sets the gamma correction factor for the windows with \n"
797 "                      the indicated window depth.  Overrides the value set \n"
798 "                      by DXGAMMA.\n"
799 "\n"
800 " DXHWMOD              specifies the name of the hardware rendering library \n"
801 "                      to use when more than one is supported. Should be\n"
802 "                      either DXhwdd.o or DXhwddOGL.o\n"
803 "\n"
804 " DXROOT               sets directory for -dxroot\n"
805 "\n"
806 " DXARGS               prepends these args to the command line\n"
807 "\n"
808 "command line parameters override environment variables.\n"
809 "If conflicting parameters are given, the last one has precedence.\n"
810 "Also, there are some other less frequently used command line options\n"
811 "that are not documented here.  See the User's Guide for a complete\n"
812 "list of options.\n"
813 "\n"
814 
815 
816     );
817 
818     exit(0);
819 }
820