@@ -179,6 +179,10 @@ Bool nxagentVerbose = False;
179
179
180
180
char * nxagentKeystrokeFile = NULL ;
181
181
182
+ /*
183
+ * This is the entry point, called from os/utils.c
184
+ */
185
+
182
186
int ddxProcessArgument (int argc , char * argv [], int i )
183
187
{
184
188
/*
@@ -187,6 +191,12 @@ int ddxProcessArgument(int argc, char *argv[], int i)
187
191
188
192
static Bool resetOptions = True ;
189
193
194
+ /*
195
+ * the first call of ddxProcessArgument is used to setup defaults
196
+ * and read/process the options from environment and/or the options
197
+ * file.
198
+ */
199
+
190
200
if (resetOptions == True )
191
201
{
192
202
char * envOptions = NULL ;
@@ -233,6 +243,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
233
243
234
244
if (envOptions != NULL )
235
245
{
246
+ /* envOptions will be modified! */
236
247
nxagentParseOptionString (envOptions );
237
248
free (envOptions );
238
249
}
@@ -681,6 +692,7 @@ int ddxProcessArgument(int argc, char *argv[], int i)
681
692
return 0 ;
682
693
}
683
694
695
+ /* FIXME: seems to be ignored; is not documented */
684
696
if (!strcmp (argv [i ], "-extensions" ))
685
697
{
686
698
return 1 ;
@@ -977,6 +989,10 @@ static void nxagentParseOptions(char *name, char *value)
977
989
validateString (name ), validateString (value ));
978
990
#endif
979
991
992
+ /*
993
+ * these options are also command line options (prefixed with "-")
994
+ * and require an argument. They are handled by ddxProcessArgument()
995
+ */
980
996
if (!strcmp (name , "kbtype" ) ||
981
997
!strcmp (name , "keyboard" ) ||
982
998
!strcmp (name , "id" ) ||
@@ -996,13 +1012,21 @@ static void nxagentParseOptions(char *name, char *value)
996
1012
}
997
1013
else if (!strcmp (name , "R" ) && !strcmp (value , "1" ))
998
1014
{
1015
+ /*
1016
+ * this option is a command line option and requires no
1017
+ * argument. It is handled by ddxProcessArgument()
1018
+ */
999
1019
argc = 1 ;
1000
1020
}
1001
1021
else if (!strcmp (name , "fast" ) || !strcmp (name , "slow" ))
1002
1022
{
1003
1023
fprintf (stderr , "Warning: Ignoring deprecated option '%s'.\n" , name );
1004
1024
return ;
1005
1025
}
1026
+ /*
1027
+ * the following options are only allowed in the options parameter and
1028
+ * always require an argument.
1029
+ */
1006
1030
else if (!strcmp (name , "render" ))
1007
1031
{
1008
1032
if (nxagentReconnectTrap == True )
@@ -1458,7 +1482,7 @@ void nxagentProcessOptionsFile(char * filename)
1458
1482
int size ;
1459
1483
1460
1484
int sizeOfFile ;
1461
- int maxFileSize = 1024 ;
1485
+ int maxFileSize = 1024 ; /* FIXME: why? */
1462
1486
1463
1487
#ifdef DEBUG
1464
1488
fprintf (stderr , "nxagentProcessOptionsFile: Going to process option file [%s].\n" ,
0 commit comments