1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-02-02 06:05:45 +01:00

changed indentation to use spaces only

This commit is contained in:
dan
2004-10-12 21:28:27 +00:00
parent 5912898b06
commit 6830b05716
240 changed files with 35951 additions and 35773 deletions

View File

@@ -19,7 +19,7 @@ char *_WINGS_progname = NULL;
Bool
Bool
W_ApplicationInitialized(void)
{
return _WINGS_progname!=NULL;
@@ -40,9 +40,9 @@ WMInitializeApplication(char *applicationName, int *argc, char **argv)
#ifdef I18N
if (getenv("NLSPATH"))
bindtextdomain("WINGs", getenv("NLSPATH"));
bindtextdomain("WINGs", getenv("NLSPATH"));
else
bindtextdomain("WINGs", LOCALEDIR);
bindtextdomain("WINGs", LOCALEDIR);
#endif
_WINGS_progname = argv[0];
@@ -52,7 +52,7 @@ WMInitializeApplication(char *applicationName, int *argc, char **argv)
WMApplication.argv = wmalloc((*argc+1)*sizeof(char*));
for (i=0; i<*argc; i++) {
WMApplication.argv[i] = wstrdup(argv[i]);
WMApplication.argv[i] = wstrdup(argv[i]);
}
WMApplication.argv[i] = NULL;
@@ -65,7 +65,7 @@ void
WMSetResourcePath(char *path)
{
if (WMApplication.resourcePath)
wfree(WMApplication.resourcePath);
wfree(WMApplication.resourcePath);
WMApplication.resourcePath = wstrdup(path);
}
@@ -82,24 +82,24 @@ checkFile(char *path, char *folder, char *ext, char *resource)
{
char *ret;
int extralen;
extralen = (ext ? strlen(ext) : 0) + (folder ? strlen(folder) : 0) + 4;
extralen = (ext ? strlen(ext) : 0) + (folder ? strlen(folder) : 0) + 4;
ret = wmalloc(strlen(path)+strlen(resource)+extralen+8);
strcpy(ret, path);
if (folder) {
strcat(ret, "/");
strcat(ret, folder);
strcat(ret, "/");
strcat(ret, folder);
}
if (ext) {
strcat(ret, "/");
strcat(ret, ext);
strcat(ret, "/");
strcat(ret, ext);
}
strcat(ret, "/");
strcat(ret, resource);
if (access(ret, F_OK)!=0) {
wfree(ret);
ret = NULL;
wfree(ret);
ret = NULL;
}
return ret;
@@ -112,90 +112,90 @@ WMPathForResourceOfType(char *resource, char *ext)
char *path = NULL;
char *tmp, *appdir;
int i;
/*
/*
* Paths are searched in this order:
* - resourcePath/ext
* - argv[0]/ext
* - GNUSTEP_USER_ROOT/Apps/ApplicationName.app/ext
* - GNUSTEP_USER_ROOT/Apps/ApplicationName.app/ext
* - ~/GNUstep/Apps/ApplicationName.app/ext
* - GNUSTEP_LOCAL_ROOT/Apps/ApplicationName.app/ext
* - /usr/local/GNUstep/Apps/ApplicationName.app/ext
* - GNUSTEP_SYSTEM_ROOT/Apps/ApplicationName.app/ext
* - /usr/GNUstep/Apps/ApplicationName.app/ext
*/
if (WMApplication.resourcePath) {
path = checkFile(WMApplication.resourcePath, NULL, ext, resource);
if (path)
return path;
path = checkFile(WMApplication.resourcePath, NULL, ext, resource);
if (path)
return path;
}
if (WMApplication.argv[0]) {
tmp = wstrdup(WMApplication.argv[0]);
i = strlen(tmp);
while (i > 0 && tmp[i]!='/')
i--;
tmp[i] = 0;
if (i>0) {
path = checkFile(tmp, NULL, ext, resource);
} else {
path = NULL;
}
wfree(tmp);
if (path)
return path;
tmp = wstrdup(WMApplication.argv[0]);
i = strlen(tmp);
while (i > 0 && tmp[i]!='/')
i--;
tmp[i] = 0;
if (i>0) {
path = checkFile(tmp, NULL, ext, resource);
} else {
path = NULL;
}
wfree(tmp);
if (path)
return path;
}
appdir = wmalloc(strlen(WMApplication.applicationName)+10);
sprintf(appdir, "Apps/%s.app", WMApplication.applicationName);
if (getenv("GNUSTEP_USER_ROOT")) {
path = checkFile(getenv("GNUSTEP_USER_ROOT"), appdir, ext, resource);
if (path) {
wfree(appdir);
return path;
}
}
tmp = wusergnusteppath();
if (tmp) {
path = checkFile(tmp, appdir, ext, resource);
if (path) {
wfree(appdir);
return path;
}
}
if (getenv("GNUSTEP_LOCAL_ROOT")) {
path = checkFile(getenv("GNUSTEP_LOCAL_ROOT"), appdir, ext, resource);
if (path) {
wfree(appdir);
return path;
}
}
path = checkFile("/usr/local/GNUstep", appdir, ext, resource);
if (path) {
wfree(appdir);
return path;
path = checkFile(getenv("GNUSTEP_USER_ROOT"), appdir, ext, resource);
if (path) {
wfree(appdir);
return path;
}
}
tmp = wusergnusteppath();
if (tmp) {
path = checkFile(tmp, appdir, ext, resource);
if (path) {
wfree(appdir);
return path;
}
}
if (getenv("GNUSTEP_LOCAL_ROOT")) {
path = checkFile(getenv("GNUSTEP_LOCAL_ROOT"), appdir, ext, resource);
if (path) {
wfree(appdir);
return path;
}
}
path = checkFile("/usr/local/GNUstep", appdir, ext, resource);
if (path) {
wfree(appdir);
return path;
}
if (getenv("GNUSTEP_SYSTEM_ROOT")) {
path = checkFile(getenv("GNUSTEP_SYSTEM_ROOT"), appdir, ext, resource);
if (path) {
wfree(appdir);
return path;
}
path = checkFile(getenv("GNUSTEP_SYSTEM_ROOT"), appdir, ext, resource);
if (path) {
wfree(appdir);
return path;
}
}
path = checkFile("/usr/GNUstep", appdir, ext, resource);
if (path) {
wfree(appdir);
return path;
wfree(appdir);
return path;
}
return NULL;
}