+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these libraries and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
/* $TOG: resource.c /main/7 1997/03/14 13:45:09 barstow $ */
/* (c) Copyright 1997 The Open Group */
/* *
char *errorLogFile;
int errorLogSize;
int daemonMode;
+int quiet;
char *pidFile;
int lockPidFile;
char *authDir;
#ifdef DEF_NETWORK_DEV
char *networkDev;
#endif
-#if defined(__osf__)
-char *ignoreLocales;
-#endif
/*
* Dtlogin will accept both Dtlogin and XDM resources. The string variable
# ifdef __apollo
# define DEF_LANG "C"
# endif
-# ifdef __osf__
-# define DEF_LANG "C"
-# endif
-# ifdef __hp_osf
-# define DEF_LANG "en_US.88591"
-# endif
# ifdef sun /* default language under Solaris */
# define DEF_LANG "C"
# endif
"50",
"daemonMode", "DaemonMode", DM_BOOL, (char **) &daemonMode,
"false",
+"quiet", "quiet", DM_BOOL, (char **) &quiet,
+ "false",
"pidFile", "PidFile", DM_STRING, &pidFile,
"",
"lockPidFile", "LockPidFile", DM_BOOL, (char **) &lockPidFile,
"networkDevice","NetworkDevice",DM_STRING, &networkDev,
DEF_NETWORK_DEV,
#endif
-#if defined(__osf__)
-"ignoreLocales", "IgnoreLocales", DM_STRING, &ignoreLocales,
- "",
-#endif
};
# define NUM_DM_RESOURCES (sizeof DmResources / sizeof DmResources[0])
char *type;
XrmValue value;
char *string, *new_string;
+ char empty[] = "";
char str_buf[50];
int len;
}
else
{
- string = default_value;
- len = (string == NULL ? 0 : strlen (string));
+ if(default_value) {
+ string = default_value;
+ len = strlen (string);
+ } else {
+ string = empty;
+ len = 0;
+ }
}
Debug ("%s/%s value %*.*s\n", name, class, len, len, string);
if (valueType == DM_STRING && *valuep) {
if (string != NULL && strlen (*valuep) == len && !strncmp (*valuep, string, len))
- return;
+ return 0;
else {
free (*valuep);
*(valuep) = NULL;
if (!new_string) {
LogOutOfMem(
ReadCatalog(MC_LOG_SET,MC_LOG_GET_RSC,MC_DEF_LOG_GET_RSC));
- return;
+ return 0;
}
strncpy (new_string, string, len);
new_string[len] = '\0';
break;
}
+
+ return 1;
}
XrmOptionDescRec configTable [] = {
{"-debug", "*debugLevel", XrmoptionSepArg, (caddr_t) NULL },
{"-xrm", NULL, XrmoptionResArg, (caddr_t) NULL },
{"-daemon", ".daemonMode", XrmoptionNoArg, "true" },
-{"-nodaemon", ".daemonMode", XrmoptionNoArg, "false" }
+{"-nodaemon", ".daemonMode", XrmoptionNoArg, "false" },
+{"-quiet", ".quiet", XrmoptionNoArg, "true" }
};
static int originalArgc;
strncpy(newname, tempName, tempLen);
strcpy(newname+tempLen, name);
free (langString);
+ free (tempName);
return(newname);
}
}
+
+ default:
+ /* special is of an unknown value */
+ return(NULL);
}
}