Finished off MOZ_USER_DIR patch. This allows developers to change config-dir at compile time. Defaults to .netscape for classic build and .mozilla for autoconf build.

This commit is contained in:
cls%seawood.org 1998-09-30 00:23:45 +00:00
Родитель 6bb49750f7
Коммит 1d2a2f6f97
8 изменённых файлов: 20 добавлений и 20 удалений

Просмотреть файл

@ -488,7 +488,7 @@ HPUX_RESOURCE_HACK = -Wp,-H16384
OTHER_LIBS = -L$(DIST)/lib $(OS_LIBS)
ifndef NO_EDITOR
ifdef MOZ_EDITOR
EXPORT_DEPLIBS += cxxlink-filter
US_DEPLIBS += cxxlink-filter
CCLD = CC -tl,./cxxlink-filter
@ -596,7 +596,7 @@ EXPORT_LDFLAGS = $(BASIC_LIBS) $(EXPORT_LIB) $(BASIC_LIBS_2) $(NSPR_LIB) $(OTHER
FRANCE_LDFLAGS = $(BASIC_LIBS) $(FRANCE_LIB) $(BASIC_LIBS_2) $(NSPR_LIB) $(OTHER_LIBS)
US_LDFLAGS = $(BASIC_LIBS) $(US_LIB) $(BASIC_LIBS_2) $(NSPR_LIB) $(OTHER_LIBS)
ifndef NO_EDITOR
ifdef MOZ_EDITOR
#
# OSF's cxx link command will link in _dynamic_ version of two C++
# libraries. This is bad, they are not shipped on a base system.
@ -658,7 +658,7 @@ ifndef NO_WEBFONTS
EXTRA_REL_FILES += $(WEBFONT_DSO)
endif
ifndef NO_EDITOR
ifdef MOZ_EDITOR
OTHER_LIBS += -L/tools/ns/lib
#

Просмотреть файл

@ -31,7 +31,7 @@ char *fe_GetConfigDir(void)
home = pw ? pw->pw_dir : "/";
}
result = PR_smprintf("%s/.netscape", home);
result = PR_smprintf("%s/%s", home, MOZ_USER_DIR);
return result;
}

Просмотреть файл

@ -32,7 +32,7 @@ fe_ensure_config_dir_exists ()
struct stat st;
XP_Bool exists;
dir = PR_smprintf ("%s/.netscape", fe_home_dir);
dir = PR_smprintf ("%s/%s", fe_home_dir, MOZ_USER_DIR);
if (!dir)
return FALSE;
@ -240,7 +240,7 @@ void check_for_lock_file()
else
{
char *fmt = NULL;
char *lock = name ? name : ".netscape/lock";
char *lock = name ? name : MOZ_USER_DIR "/lock";
fmt = PR_sprintf_append(fmt, XP_GetString(GNOMEFE_APP_HAS_DETECTED_LOCK),
XP_AppName, lock);

Просмотреть файл

@ -147,7 +147,7 @@ main(int argc,
#ifdef OLD_UNIX_FILES
".netscape-preferences"
#else
".netscape/preferences.js"
MOZ_USER_DIR "/preferences.js"
#endif
);

Просмотреть файл

@ -1,4 +1,4 @@
/* $Id: qtmoz.cpp,v 1.1 1998/09/25 18:01:40 ramiro%netscape.com Exp $
/* $Id: qtmoz.cpp,v 1.2 1998/09/30 00:23:35 cls%seawood.org Exp $
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
@ -1073,7 +1073,7 @@ mozilla_main(int argc, char** argv)
}
PR_snprintf (buf, sizeof (buf), "%s/%s", fe_home_dir,
".netscape/preferences.js");
MOZ_USER_DIR "/preferences.js");
PREF_Init((char*)buf);
#endif // XP_WIN
@ -1144,7 +1144,7 @@ mozilla_main(int argc, char** argv)
fe_pidlock = name;
} else {
char *fmt = NULL;
char *lock = name ? name : ".netscape/lock";
char *lock = name ? name : MOZ_USER_DIR "/lock";
fmt = PR_sprintf_append(fmt, XP_GetString(QTFE_APP_HAS_DETECTED_LOCK),
XP_AppName, lock);
@ -1211,9 +1211,9 @@ mozilla_main(int argc, char** argv)
/* New XP-prefs routine. */
SECNAV_InitConfigObject();
PR_snprintf (buf, sizeof (buf), "%s/%s", fe_home_dir, ".netscape/user.js");
PR_snprintf (buf, sizeof (buf), "%s/%s", fe_home_dir, MOZ_USER_DIR "/user.js");
PREF_ReadUserJSFile(buf);
PR_snprintf (buf, sizeof (buf), "%s/%s", fe_home_dir, ".netscape/hook.js");
PR_snprintf (buf, sizeof (buf), "%s/%s", fe_home_dir, MOZ_USER_DIR "/hook.js");
HK_ReadHookFile(buf);
/*fe_globalPrefs.global_history_expiration*/
@ -1437,7 +1437,7 @@ fe_ensure_config_dir_exists ()
struct stat st;
XP_Bool exists;
dir = PR_smprintf ("%s/.netscape", fe_home_dir);
dir = PR_smprintf ("%s/%s", fe_home_dir, MOZ_USER_DIR);
if (!dir)
return FALSE;

Просмотреть файл

@ -862,7 +862,7 @@ XtResource fe_GlobalResources [] =
/* The location of the config dir ($HOME/.netscape by default) */
{ "configDir", XtCString, XtRString, sizeof (String),
XtOffset (fe_GlobalData *, config_dir), XtRString,
".netscape" },
MOZ_USER_DIR },
# undef RES_ERROR
};
@ -915,7 +915,7 @@ char *fe_GetConfigDir(void)
if(fe_globalData.config_dir) {
result = PR_smprintf("%s/%s", home, fe_globalData.config_dir);
} else {
result = PR_smprintf("%s/.netscape", home);
result = PR_smprintf("%s/%s", home, MOZ_USER_DIR);
}
return result;
@ -2716,7 +2716,7 @@ main
/* allocated for the real filename. extremely unlikely, and */
/* if it happens, the program should probably just crash anyway */
/* because it's not going to be able to do much else. */
char *lock = name ? name : ".netscape/lock";
char *lock = name ? name : MOZ_USER_DIR "/lock";
fmt = PR_sprintf_append(fmt, XP_GetString(XFE_APP_HAS_DETECTED_LOCK),
XP_AppName, lock);
@ -3877,7 +3877,7 @@ fe_copy_init_files (Widget toplevel)
}
FROB("preferences",
"./netscape/preferences",
".netscape/preferences",
".netscape-preferences",
".MCOM-preferences",
(S_IRUSR | S_IWUSR)) /* rw only by owner */

Просмотреть файл

@ -3398,7 +3398,7 @@ char* fe_GetLDAPTmpFile(char *name) {
{
strncpy(tmp, configdir, sizeof(tmp));
free(configdir);
} else snprintf(tmp, sizeof(tmp), "%.900s/.netscape/", home);
} else snprintf(tmp, sizeof(tmp), "%.900s/%s/", home, MOZ_USER_DIR);
#ifdef _XP_TMP_FILENAME_FOR_LDAP_
/* we need to write this */

Просмотреть файл

@ -363,9 +363,9 @@ test_kdb_name_cb (void *arg, int vers)
{
static char f[1024];
if (vers <= 2)
sprintf(f, "%s/.netscape/key.db", getenv("HOME"));
sprintf(f, "%s/%s/key.db", getenv("HOME"),MOZ_USER_DIR);
else
sprintf(f, "%s/.netscape/key%d.db", getenv("HOME"), vers);
sprintf(f, "%s/%s/key%d.db", getenv("HOME"), MOZ_USER_DIR, vers);
return f;
}