Mon Oct 18 16:23:30 PDT 1999
(Raster) OS/2 patches :) SVN revision: 849
This commit is contained in:
parent
e441e38d58
commit
851b111ab4
|
@ -3536,3 +3536,10 @@ remember ipc uses scanf now
|
|||
raise, lower & layer win_op calls
|
||||
|
||||
minor other fixes
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Mon Oct 18 16:23:30 PDT 1999
|
||||
(Raster)
|
||||
|
||||
OS/2 patches :)
|
||||
|
|
4
src/E.h
4
src/E.h
|
@ -158,9 +158,13 @@ DialogSetParamText(__d,
|
|||
*/
|
||||
#define DEFAULT_SH_PATH "/sbin/csh"
|
||||
#else
|
||||
#ifdef __EMX__
|
||||
#define DEFAULT_SH_PATH "sh.exe"
|
||||
#else
|
||||
#define DEFAULT_SH_PATH "/bin/sh"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* shut warnings up
|
||||
* pid_t wait3(int *status, int options, struct rusage *rusage);
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
*/
|
||||
#include "E.h"
|
||||
#include "timestamp.h"
|
||||
#ifdef __EMX__
|
||||
#include <process.h>
|
||||
#endif
|
||||
|
||||
ActionClass *
|
||||
CreateAclass(char *name)
|
||||
|
@ -626,10 +629,11 @@ runApp(char *exe, char *params)
|
|||
|
||||
EDBUG(6, "runApp");
|
||||
|
||||
#ifndef __EMX__
|
||||
if (fork())
|
||||
EDBUG_RETURN(0);
|
||||
|
||||
setsid();
|
||||
#endif
|
||||
sh = usershell(getuid());
|
||||
if (exe)
|
||||
{
|
||||
|
@ -639,8 +643,13 @@ runApp(char *exe, char *params)
|
|||
Efree(path);
|
||||
real_exec = (char *)Emalloc(strlen(params) + 6);
|
||||
sprintf(real_exec, "exec %s", params);
|
||||
#ifndef __EMX__
|
||||
execl(sh, sh, "-c", (char *)real_exec, NULL);
|
||||
exit(0);
|
||||
#else
|
||||
spawnl(P_NOWAIT, sh, sh, "-c", (char *)real_exec, NULL);
|
||||
EDBUG_RETURN(0);
|
||||
#endif
|
||||
}
|
||||
if (!mode.startup)
|
||||
{
|
||||
|
@ -648,7 +657,11 @@ runApp(char *exe, char *params)
|
|||
if (!path)
|
||||
{
|
||||
/* absolute path */
|
||||
#ifndef __EMX__
|
||||
if (((char *)exe)[0] == '/')
|
||||
#else
|
||||
if (_fnisabs((char *)exe))
|
||||
#endif
|
||||
DialogAlertOK("There was an error running the program:\n"
|
||||
"%s\n"
|
||||
"This program could not be executed.\n"
|
||||
|
@ -726,13 +739,20 @@ runApp(char *exe, char *params)
|
|||
Efree(path);
|
||||
}
|
||||
}
|
||||
#ifndef __EMX__
|
||||
exit(100);
|
||||
#else
|
||||
EDBUG_RETURN(0);
|
||||
#endif
|
||||
}
|
||||
real_exec = (char *)Emalloc(strlen(params) + 6);
|
||||
sprintf(real_exec, "exec %s", (char *)params);
|
||||
#ifndef __EMX__
|
||||
execl(sh, sh, "-c", (char *)real_exec, NULL);
|
||||
exit(0);
|
||||
|
||||
#else
|
||||
spawnl(P_NOWAIT, sh, sh, "-c", (char *)real_exec, NULL);
|
||||
#endif
|
||||
EDBUG_RETURN(0);
|
||||
|
||||
}
|
||||
|
|
83
src/config.c
83
src/config.c
|
@ -23,6 +23,12 @@
|
|||
#include "E.h"
|
||||
#include "conf.h"
|
||||
|
||||
#ifdef __EMX__
|
||||
#include <process.h>
|
||||
extern char *__XOS2RedirRoot(const char *);
|
||||
|
||||
#endif
|
||||
|
||||
static char is_autosave = 0;
|
||||
|
||||
static void SkipTillEnd(FILE * ConfigFile);
|
||||
|
@ -3074,8 +3080,15 @@ OpenConfigFileForReading(char *path, char preprocess)
|
|||
/* All output is passed through epp for preprocessing however. */
|
||||
FILE *fpin /*, *fpout */ ;
|
||||
char execline[FILEPATH_LEN_MAX];
|
||||
|
||||
#ifndef __EMX__
|
||||
char *epp_path = ENLIGHTENMENT_BIN "/epp";
|
||||
|
||||
#else
|
||||
char *epp_path = __XOS2RedirRoot(ENLIGHTENMENT_BIN "/epp.exe");
|
||||
char *x11root = getenv("X11ROOT");
|
||||
|
||||
#endif
|
||||
EDBUG(5, "OpenConfigFileForReading");
|
||||
if (!path)
|
||||
EDBUG_RETURN(0);
|
||||
|
@ -3107,7 +3120,11 @@ OpenConfigFileForReading(char *path, char preprocess)
|
|||
s = duplicate(path);
|
||||
while (s[i])
|
||||
{
|
||||
#ifndef __EMX__
|
||||
if (s[i] == '/')
|
||||
#else
|
||||
if (s[i] == '/' || s[i] == '\\' || s[i] == ':')
|
||||
#endif
|
||||
s[i] = '.';
|
||||
i++;
|
||||
}
|
||||
|
@ -3116,12 +3133,22 @@ OpenConfigFileForReading(char *path, char preprocess)
|
|||
"-P "
|
||||
"-nostdinc "
|
||||
"-undef "
|
||||
#ifndef __EMX__
|
||||
"-include %s/config/definitions "
|
||||
"-I%s "
|
||||
"-I%s/config "
|
||||
"-D ENLIGHTENMENT_VERSION=%s "
|
||||
"-D ENLIGHTENMENT_ROOT=%s "
|
||||
"-D ENLIGHTENMENT_BIN=%s "
|
||||
#else
|
||||
"-include %s%s/config/definitions "
|
||||
"-I%s "
|
||||
"-I%s%s/config "
|
||||
"-D ENLIGHTENMENT_VERSION=%s "
|
||||
"-D ENLIGHTENMENT_ROOT=%s%s "
|
||||
"-D ENLIGHTENMENT_BIN=%s%s "
|
||||
"-D X11ROOT=%s "
|
||||
#endif
|
||||
"-D ENLIGHTENMENT_THEME=%s "
|
||||
"-D SCREEN_RESOLUTION_%ix%i=1 "
|
||||
"-D SCREEN_WIDTH_%i=1 "
|
||||
|
@ -3132,8 +3159,18 @@ OpenConfigFileForReading(char *path, char preprocess)
|
|||
"-D USER_SHELL=%s "
|
||||
"-D ENLIGHTENMENT_VERSION_015=1 "
|
||||
"%s %s/cached/cfg/%s.preparsed",
|
||||
#ifndef __EMX__
|
||||
epp_path, ENLIGHTENMENT_ROOT, themepath, ENLIGHTENMENT_ROOT,
|
||||
ENLIGHTENMENT_VERSION, ENLIGHTENMENT_ROOT, ENLIGHTENMENT_BIN,
|
||||
#else
|
||||
epp_path, x11root, ENLIGHTENMENT_ROOT,
|
||||
themepath,
|
||||
x11root, ENLIGHTENMENT_ROOT,
|
||||
ENLIGHTENMENT_VERSION,
|
||||
x11root, ENLIGHTENMENT_ROOT,
|
||||
x11root, ENLIGHTENMENT_BIN,
|
||||
x11root,
|
||||
#endif
|
||||
themepath,
|
||||
root.w, root.h, root.w, root.h, root.depth,
|
||||
def_user, def_home, def_shell,
|
||||
|
@ -3142,7 +3179,11 @@ OpenConfigFileForReading(char *path, char preprocess)
|
|||
Esnprintf(execline, sizeof(execline),
|
||||
"%s/cached/cfg/%s.preparsed",
|
||||
UserEDir(), s);
|
||||
#ifndef __EMX__
|
||||
fpin = fopen(execline, "r");
|
||||
#else
|
||||
fpin = fopen(execline, "rt");
|
||||
#endif
|
||||
if (s)
|
||||
Efree(s);
|
||||
if (def_user)
|
||||
|
@ -3155,7 +3196,11 @@ OpenConfigFileForReading(char *path, char preprocess)
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifndef __EMX__
|
||||
fpin = fopen(path, "r");
|
||||
#else
|
||||
fpin = fopen(path, "rt");
|
||||
#endif
|
||||
EDBUG_RETURN(fpin);
|
||||
}
|
||||
EDBUG_RETURN(0);
|
||||
|
@ -3182,7 +3227,11 @@ LoadConfigFile(char *f)
|
|||
|
||||
while (s2[i])
|
||||
{
|
||||
#ifndef __EMX__
|
||||
if (s2[i] == '/')
|
||||
#else
|
||||
if (s2[i] == '/' || s2[i] == '\\' || s2[i] == ':')
|
||||
#endif
|
||||
s2[i] = '.';
|
||||
i++;
|
||||
}
|
||||
|
@ -3411,11 +3460,22 @@ FindFile(char *file)
|
|||
|
||||
EDBUG(6, "FindFile");
|
||||
/* if absolute path - and file exists - return it */
|
||||
#ifndef __EMX__
|
||||
if (file[0] == '/')
|
||||
#else
|
||||
if (_fnisabs(file))
|
||||
#endif
|
||||
{
|
||||
if (isfile(file))
|
||||
EDBUG_RETURN(duplicate(file));
|
||||
}
|
||||
#ifdef __EMX__
|
||||
if (file[0] == '/')
|
||||
{
|
||||
if (isfile(__XOS2RedirRoot(file)))
|
||||
EDBUG_RETURN(duplicate(__XOS2RedirRoot(file)));
|
||||
}
|
||||
#endif
|
||||
/* look in ~/.enlightenment first */
|
||||
Esnprintf(s, sizeof(s), "%s/%s", UserEDir(), file);
|
||||
if (isfile(s))
|
||||
|
@ -3425,7 +3485,11 @@ FindFile(char *file)
|
|||
if (isfile(s))
|
||||
EDBUG_RETURN(duplicate(s));
|
||||
/* look in system config dir */
|
||||
#ifndef __EMX__
|
||||
Esnprintf(s, sizeof(s), "%s/config/%s", ENLIGHTENMENT_ROOT, file);
|
||||
#else
|
||||
Esnprintf(s, sizeof(s), "%s/config/%s", __XOS2RedirRoot(ENLIGHTENMENT_ROOT), file);
|
||||
#endif
|
||||
if (isfile(s))
|
||||
EDBUG_RETURN(duplicate(s));
|
||||
/* not found.... NULL */
|
||||
|
@ -3439,17 +3503,32 @@ FindNoThemeFile(char *file)
|
|||
|
||||
EDBUG(6, "FindFile");
|
||||
/* if absolute path - and file exists - return it */
|
||||
#ifndef __EMX__
|
||||
if (file[0] == '/')
|
||||
#else
|
||||
if (_fnisabs(file))
|
||||
#endif
|
||||
{
|
||||
if (isfile(file))
|
||||
EDBUG_RETURN(duplicate(file));
|
||||
}
|
||||
#ifdef __EMX__
|
||||
if (file[0] == '/')
|
||||
{
|
||||
if (isfile(__XOS2RedirRoot(file)))
|
||||
EDBUG_RETURN(duplicate(__XOS2RedirRoot(file)));
|
||||
}
|
||||
#endif
|
||||
/* look in ~/.enlightenment first */
|
||||
Esnprintf(s, sizeof(s), "%s/%s", UserEDir(), file);
|
||||
if (isfile(s))
|
||||
EDBUG_RETURN(duplicate(s));
|
||||
/* look in system config dir */
|
||||
#ifndef __EMX__
|
||||
Esnprintf(s, sizeof(s), "%s/config/%s", ENLIGHTENMENT_ROOT, file);
|
||||
#else
|
||||
Esnprintf(s, sizeof(s), "%s/config/%s", __XOS2RedirRoot(ENLIGHTENMENT_ROOT), file);
|
||||
#endif
|
||||
if (isfile(s))
|
||||
EDBUG_RETURN(duplicate(s));
|
||||
/* not found.... NULL */
|
||||
|
@ -3468,7 +3547,11 @@ LoadEConfig(char *themelocation)
|
|||
|
||||
Esnprintf(s, sizeof(s), "%s/", UserEDir());
|
||||
Fnlib_add_dir(fd, s);
|
||||
#ifndef __EMX__
|
||||
Esnprintf(s, sizeof(s), "%s/config/", ENLIGHTENMENT_ROOT);
|
||||
#else
|
||||
Esnprintf(s, sizeof(s), "%s/config/", __XOS2RedirRoot(ENLIGHTENMENT_ROOT));
|
||||
#endif
|
||||
Fnlib_add_dir(fd, s);
|
||||
/* save the current theme */
|
||||
if ((themelocation) && (themelocation[0] != 0))
|
||||
|
|
|
@ -27,7 +27,14 @@ GetUniqueBGString(Background * bg)
|
|||
{
|
||||
char s[256];
|
||||
const char *chmap =
|
||||
#ifndef __EMX__
|
||||
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
|
||||
|
||||
#else
|
||||
"0123456789abcdefghijklmnopqrstuvwxyz€<EFBFBD>‚ƒ„…†‡ˆŠ‹Œ<EFBFBD>Ž<EFBFBD><EFBFBD>‘’“”•–—˜™<EFBFBD>-_";
|
||||
|
||||
/* cyrillic symbols from 866 page correctly handled instead of eng. capitals */
|
||||
#endif
|
||||
int n1, n2, n3, n4, n5, f1, f2, f3, f4, f5, f6;
|
||||
|
||||
n1 = (bg->bg.solid.r << 24) | (bg->bg.solid.g << 16) |
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
*/
|
||||
#include "E.h"
|
||||
#include <errno.h>
|
||||
#include <io.h> /* EMX select() */
|
||||
|
||||
char throw_move_events_away = 0;
|
||||
void DeskAccountTimeout(int val, void *data);
|
||||
|
|
138
src/file.c
138
src/file.c
|
@ -22,6 +22,13 @@
|
|||
*/
|
||||
#include "E.h"
|
||||
|
||||
#ifdef __EMX__
|
||||
#define chdir _chdir2
|
||||
#define getcwd _getcwd2
|
||||
extern char *__XOS2RedirRoot(const char *);
|
||||
|
||||
#endif
|
||||
|
||||
char *
|
||||
FileExtension(char *file)
|
||||
{
|
||||
|
@ -291,6 +298,7 @@ filesize(char *s)
|
|||
int
|
||||
fileinode(char *s)
|
||||
{
|
||||
#ifndef __EMX__
|
||||
struct stat st;
|
||||
|
||||
EDBUG(9, "filesize");
|
||||
|
@ -299,6 +307,9 @@ fileinode(char *s)
|
|||
if (stat(s, &st) < 0)
|
||||
EDBUG_RETURN(0);
|
||||
EDBUG_RETURN((int)st.st_ino);
|
||||
#else
|
||||
EDBUG_RETURN(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -378,9 +389,11 @@ group(char *s)
|
|||
char *
|
||||
username(int uid)
|
||||
{
|
||||
char *s;
|
||||
|
||||
#ifndef __EMX__
|
||||
static int usr_uid = -1;
|
||||
static char *usr_s = NULL;
|
||||
char *s;
|
||||
struct passwd *pwd;
|
||||
|
||||
EDBUG(9, "username");
|
||||
|
@ -396,15 +409,21 @@ username(int uid)
|
|||
usr_s = duplicate(s);
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
#else
|
||||
if ((s = getenv("USER")) != NULL)
|
||||
EDBUG_RETURN(duplicate(s));
|
||||
#endif
|
||||
EDBUG_RETURN(duplicate("unknown"));
|
||||
}
|
||||
|
||||
char *
|
||||
homedir(int uid)
|
||||
{
|
||||
char *s;
|
||||
|
||||
#ifndef __EMX__
|
||||
static int usr_uid = -1;
|
||||
static char *usr_s = NULL;
|
||||
char *s;
|
||||
struct passwd *pwd;
|
||||
|
||||
EDBUG(9, "homedir");
|
||||
|
@ -422,6 +441,12 @@ homedir(int uid)
|
|||
usr_s = duplicate(s);
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
#else
|
||||
if ((s = getenv("HOME")) != NULL)
|
||||
EDBUG_RETURN(_fnslashify(duplicate(s)));
|
||||
if ((s = getenv("TMP")) != NULL)
|
||||
EDBUG_RETURN(_fnslashify(duplicate(s)));
|
||||
#endif
|
||||
EDBUG_RETURN(duplicate((getenv("TMPDIR") == NULL) ? "/tmp"
|
||||
: getenv("TMPDIR")));
|
||||
}
|
||||
|
@ -429,9 +454,10 @@ homedir(int uid)
|
|||
char *
|
||||
usershell(int uid)
|
||||
{
|
||||
#ifndef __EMX__
|
||||
char *s;
|
||||
static int usr_uid = -1;
|
||||
static char *usr_s = NULL;
|
||||
char *s;
|
||||
struct passwd *pwd;
|
||||
|
||||
EDBUG(9, "usershell");
|
||||
|
@ -454,6 +480,9 @@ usershell(int uid)
|
|||
EDBUG_RETURN(s);
|
||||
}
|
||||
EDBUG_RETURN(duplicate("/bin/sh"));
|
||||
#else
|
||||
EDBUG_RETURN(duplicate("sh.exe"));
|
||||
#endif
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -861,19 +890,57 @@ pathtoexec(char *file)
|
|||
int len, exelen;
|
||||
|
||||
EDBUG(9, "pathtoexec");
|
||||
#ifndef __EMX__
|
||||
if (file[0] == '/')
|
||||
#else
|
||||
if (_fnisabs(file))
|
||||
#endif
|
||||
{
|
||||
if (canexec(file))
|
||||
EDBUG_RETURN(duplicate(file));
|
||||
#ifdef __EMX__
|
||||
len = strlen(file);
|
||||
s = Emalloc(len + 5);
|
||||
strcpy(s, file);
|
||||
strcat(s, ".cmd");
|
||||
if (canexec(s))
|
||||
EDBUG_RETURN(s);
|
||||
strcpy(s + len, ".exe");
|
||||
if (canexec(s))
|
||||
EDBUG_RETURN(s);
|
||||
Efree(s);
|
||||
if (file[0] != '/' && file[0] != '\\')
|
||||
EDBUG_RETURN(NULL);
|
||||
file = __XOS2RedirRoot(file);
|
||||
if (canexec(file))
|
||||
EDBUG_RETURN(duplicate(file));
|
||||
len = strlen(file);
|
||||
s = Emalloc(len + 5);
|
||||
strcpy(s, file);
|
||||
strcat(s, ".cmd");
|
||||
if (canexec(s))
|
||||
EDBUG_RETURN(s);
|
||||
strcpy(s + len, ".exe");
|
||||
if (canexec(s))
|
||||
EDBUG_RETURN(s);
|
||||
Efree(s);
|
||||
EDBUG_RETURN(NULL);
|
||||
#endif
|
||||
}
|
||||
p = getenv("PATH");
|
||||
if (!p)
|
||||
EDBUG_RETURN(duplicate(file));
|
||||
if (!file)
|
||||
EDBUG_RETURN(NULL);
|
||||
#ifndef __EMX__
|
||||
cp = p;
|
||||
exelen = strlen(file);
|
||||
while ((ep = strchr(cp, ':')))
|
||||
#else
|
||||
cp = p = _fnslashify(strdup(p));
|
||||
exelen = strlen(file) + 4;
|
||||
while ((ep = strchr(cp, ';')))
|
||||
#endif
|
||||
{
|
||||
len = ep - cp;
|
||||
s = Emalloc(len + 1);
|
||||
|
@ -882,10 +949,32 @@ pathtoexec(char *file)
|
|||
strncpy(s, cp, len);
|
||||
s[len] = 0;
|
||||
s = Erealloc(s, len + 2 + exelen);
|
||||
strcat(s, "/");
|
||||
#ifdef __EMX__
|
||||
if (s[len - 1] != '/')
|
||||
#endif
|
||||
strcat(s, "/");
|
||||
strcat(s, file);
|
||||
if (canexec(s))
|
||||
#ifndef __EMX__
|
||||
EDBUG_RETURN(s);
|
||||
#else
|
||||
{
|
||||
free(p);
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
strcat(s, ".cmd");
|
||||
if (canexec(s))
|
||||
{
|
||||
free(p);
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
strcpy(s + strlen(s) - 3, "exe");
|
||||
if (canexec(s))
|
||||
{
|
||||
free(p);
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
#endif
|
||||
Efree(s);
|
||||
}
|
||||
cp = ep + 1;
|
||||
|
@ -897,7 +986,10 @@ pathtoexec(char *file)
|
|||
strncpy(s, cp, len);
|
||||
s[len] = 0;
|
||||
s = Erealloc(s, len + 2 + exelen);
|
||||
strcat(s, "/");
|
||||
#ifdef __EMX__
|
||||
if (s[len - 1] != '/')
|
||||
#endif
|
||||
strcat(s, "/");
|
||||
strcat(s, file);
|
||||
if (canexec(s))
|
||||
EDBUG_RETURN(s);
|
||||
|
@ -914,7 +1006,11 @@ pathtofile(char *file)
|
|||
int len, exelen;
|
||||
|
||||
EDBUG(9, "pathtofile");
|
||||
#ifndef __EMX__
|
||||
if (file[0] == '/')
|
||||
#else
|
||||
if (_fnisabs(file))
|
||||
#endif
|
||||
{
|
||||
if (exists(file))
|
||||
EDBUG_RETURN(duplicate(file));
|
||||
|
@ -926,7 +1022,12 @@ pathtofile(char *file)
|
|||
EDBUG_RETURN(NULL);
|
||||
cp = p;
|
||||
exelen = strlen(file);
|
||||
#ifndef __EMX__
|
||||
while ((ep = strchr(cp, ':')))
|
||||
#else
|
||||
cp = p = _fnslashify(strdup(p));
|
||||
while ((ep = strchr(cp, ';')))
|
||||
#endif
|
||||
{
|
||||
len = ep - cp;
|
||||
s = Emalloc(len + 1);
|
||||
|
@ -935,10 +1036,20 @@ pathtofile(char *file)
|
|||
strncpy(s, cp, len);
|
||||
s[len] = 0;
|
||||
s = Erealloc(s, len + 2 + exelen);
|
||||
strcat(s, "/");
|
||||
#ifdef __EMX__
|
||||
if (s[len - 1] != '/')
|
||||
#endif
|
||||
strcat(s, "/");
|
||||
strcat(s, file);
|
||||
if (exists(s))
|
||||
#ifndef __EMX__
|
||||
EDBUG_RETURN(s);
|
||||
#else
|
||||
{
|
||||
free(p);
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
#endif
|
||||
Efree(s);
|
||||
}
|
||||
cp = ep + 1;
|
||||
|
@ -950,11 +1061,24 @@ pathtofile(char *file)
|
|||
strncpy(s, cp, len);
|
||||
s[len] = 0;
|
||||
s = Erealloc(s, len + 2 + exelen);
|
||||
strcat(s, "/");
|
||||
#ifdef __EMX__
|
||||
if (s[len - 1] != '/')
|
||||
#endif
|
||||
strcat(s, "/");
|
||||
strcat(s, file);
|
||||
if (exists(s))
|
||||
#ifndef __EMX__
|
||||
EDBUG_RETURN(s);
|
||||
#else
|
||||
{
|
||||
free(p);
|
||||
EDBUG_RETURN(s);
|
||||
}
|
||||
#endif
|
||||
Efree(s);
|
||||
}
|
||||
#ifdef __EMX__
|
||||
free(p);
|
||||
#endif
|
||||
EDBUG_RETURN(NULL);
|
||||
}
|
||||
|
|
|
@ -170,7 +170,11 @@ HandleSigChild(int num)
|
|||
|
||||
EDBUG(7, "HandleSigChild");
|
||||
num = 0;
|
||||
#ifndef __EMX__
|
||||
while (waitpid(-1, &status, WNOHANG) > 0);
|
||||
#else
|
||||
waitpid(-1, &status, WNOHANG);
|
||||
#endif
|
||||
EDBUG_RETURN_;
|
||||
}
|
||||
|
||||
|
|
|
@ -180,7 +180,11 @@ main(int argc, char **argv)
|
|||
if (file)
|
||||
{
|
||||
s[0] = 0;
|
||||
#ifndef __EMX__
|
||||
f = fopen(file, "r");
|
||||
#else
|
||||
f = fopen(file, "rt");
|
||||
#endif
|
||||
if (f)
|
||||
{
|
||||
if (fscanf(f, "%4000s", s) < 1)
|
||||
|
@ -355,8 +359,10 @@ main(int argc, char **argv)
|
|||
if ((bg = RemoveItem("STARTUP_BACKGROUND", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_BACKGROUND)))
|
||||
FreeDesktopBG(bg);
|
||||
#ifdef SIGCONT
|
||||
for (i = 0; i < child_count; i++)
|
||||
kill(e_children[i], SIGCONT);
|
||||
#endif
|
||||
|
||||
SetupUserInitialization();
|
||||
if (FindItem("", 0, LIST_FINDBY_NONE,
|
||||
|
|
27
src/menus.c
27
src/menus.c
|
@ -989,7 +989,13 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
|
|||
MenuItem *mi;
|
||||
struct stat st;
|
||||
const char *chmap =
|
||||
#ifndef __EMX__
|
||||
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
|
||||
|
||||
#else
|
||||
"0123456789abcdefghijklmnopqrstuvwxyz€<EFBFBD>‚ƒ„…†‡ˆŠ‹Œ<EFBFBD>Ž<EFBFBD><EFBFBD>‘’“”•–—˜™<EFBFBD>-_";
|
||||
|
||||
#endif
|
||||
FILE *f;
|
||||
|
||||
EDBUG(5, "CreateMenuFromDirectory");
|
||||
|
@ -1000,7 +1006,12 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
|
|||
{
|
||||
int aa, bb, cc;
|
||||
|
||||
aa = (int)st.st_ino;
|
||||
#ifndef __EMX__
|
||||
aa = (int)st.st_inode;
|
||||
#else
|
||||
list = ls(dir, &num);
|
||||
aa = (int)num;
|
||||
#endif
|
||||
bb = (int)st.st_dev;
|
||||
cc = 0;
|
||||
if (st.st_mtime > st.st_ctime)
|
||||
|
@ -1031,7 +1042,11 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
|
|||
/* cached dir listing - use it */
|
||||
if (exists(cs))
|
||||
{
|
||||
#ifndef __EMX__
|
||||
f = fopen(cs, "r");
|
||||
#else
|
||||
f = fopen(cs, "rt");
|
||||
#endif
|
||||
while (fgets(s, sizeof(s), f))
|
||||
{
|
||||
s[strlen(s) - 1] = 0;
|
||||
|
@ -1240,7 +1255,7 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
|
|||
char s2[4096], s3[512];
|
||||
int aa, bb, cc;
|
||||
|
||||
aa = (int)st.st_ino;
|
||||
aa = (int)st.st_nlink;
|
||||
bb = (int)st.st_dev;
|
||||
cc = 0;
|
||||
if (st.st_mtime > st.st_ctime)
|
||||
|
@ -1424,7 +1439,11 @@ FillFlatFileMenu(Menu * m, MenuStyle * ms, char *name, char *file, Menu * parent
|
|||
char first = 1;
|
||||
char s[4096];
|
||||
|
||||
#ifndef __EMX__
|
||||
f = fopen(file, "r");
|
||||
#else
|
||||
f = fopen(file, "rt");
|
||||
#endif
|
||||
while (fgets(s, 4096, f))
|
||||
{
|
||||
s[strlen(s) - 1] = 0;
|
||||
|
@ -1623,7 +1642,11 @@ CreateMenuFromGnome(char *name, MenuStyle * ms, char *dir)
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifndef __EMX__
|
||||
f = fopen(ss, "r");
|
||||
#else
|
||||
f = fopen(ss, "rt");
|
||||
#endif
|
||||
if (f)
|
||||
{
|
||||
char *iname = NULL, *exec = NULL, *texec = NULL,
|
||||
|
|
14
src/misc.c
14
src/misc.c
|
@ -32,7 +32,13 @@ BlumFlimFrub(void)
|
|||
int i;
|
||||
char s[1024];
|
||||
char *bins[3] =
|
||||
#ifndef __EMX__
|
||||
{"dox", "eesh", "epp"};
|
||||
|
||||
#else
|
||||
{"dox.exe", "eesh.exe", "epp.exe"};
|
||||
|
||||
#endif
|
||||
char *docs[4] =
|
||||
{"E-docs/MAIN", "E-docs/Edoc_bg.png", "E-docs/E_logo.png"};
|
||||
char *thms[1] =
|
||||
|
@ -171,7 +177,9 @@ EExit(void *code)
|
|||
signal(SIGUSR1, SIG_DFL);
|
||||
signal(SIGUSR2, SIG_DFL);
|
||||
signal(SIGCHLD, SIG_DFL);
|
||||
#ifdef SIGTSTP
|
||||
signal(SIGTSTP, SIG_DFL);
|
||||
#endif
|
||||
signal(SIGBUS, SIG_IGN);
|
||||
|
||||
if (master_pid == getpid())
|
||||
|
@ -184,7 +192,11 @@ EExit(void *code)
|
|||
{
|
||||
char sss[FILEPATH_LEN_MAX];
|
||||
|
||||
#ifndef __EMX__
|
||||
Esnprintf(sss, sizeof(sss), "/bin/rm -rf %s", themepath);
|
||||
#else
|
||||
Esnprintf(sss, sizeof(sss), "rm.exe -rf %s", themepath);
|
||||
#endif
|
||||
system(sss);
|
||||
}
|
||||
for (i = 0; i < child_count; i++)
|
||||
|
@ -440,12 +452,14 @@ SanitiseThemeDir(char *dir)
|
|||
badreason = "Theme does not contain a slideouts.cfg file\n";
|
||||
return 0;
|
||||
}
|
||||
#ifndef __EMX__ /* OS/2 Team will compile ESound after XMMS project */
|
||||
Esnprintf(s, sizeof(s), "%s/%s", dir, "sound.cfg");
|
||||
if (!isfile(s))
|
||||
{
|
||||
badreason = "Theme does not contain a sound.cfg file\n";
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
Esnprintf(s, sizeof(s), "%s/%s", dir, "tooltips.cfg");
|
||||
if (!isfile(s))
|
||||
{
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include "E.h"
|
||||
#include <io.h> /* for EMX select() */
|
||||
#ifdef HAVE_LIBXTST
|
||||
#include <X11/extensions/XTest.h>
|
||||
#endif
|
||||
|
@ -227,7 +228,9 @@ SC_Init(void)
|
|||
signal(SIGUSR1, SIG_DFL);
|
||||
signal(SIGUSR2, SIG_DFL);
|
||||
signal(SIGCHLD, SIG_DFL);
|
||||
#ifdef SIGTSTP
|
||||
signal(SIGTSTP, SIG_DFL);
|
||||
#endif
|
||||
signal(SIGBUS, SIG_IGN);
|
||||
sc_disp = XOpenDisplay(DisplayString(disp));
|
||||
XGrabServer(sc_disp);
|
||||
|
|
|
@ -46,7 +46,14 @@ int
|
|||
Emkstemp(char *template)
|
||||
{
|
||||
static const char letters[]
|
||||
#ifndef __EMX__
|
||||
= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
|
||||
#else
|
||||
= "abcdefghijklmnopqrstuvwxyz€<EFBFBD>‚ƒ„…†‡ˆŠ‹Œ<EFBFBD>Ž<EFBFBD><EFBFBD>Ž‘’“”•–—˜™0123456789";
|
||||
|
||||
#endif
|
||||
|
||||
static big_type value;
|
||||
struct timeval tv;
|
||||
char *XXXXXX;
|
||||
|
@ -251,7 +258,11 @@ LoadWindowStates(void)
|
|||
char s[4096], s1[4096];
|
||||
|
||||
Esnprintf(s, sizeof(s), "%s.clients.%i", GetSMFile(), root.scr);
|
||||
#ifndef __EMX__
|
||||
f = fopen(s, "r");
|
||||
#else
|
||||
f = fopen(s, "rt");
|
||||
#endif
|
||||
if (f)
|
||||
{
|
||||
while (fgets(s, sizeof(s), f))
|
||||
|
@ -525,11 +536,17 @@ doSMExit(void *params)
|
|||
if (params)
|
||||
{
|
||||
SoundExit();
|
||||
#ifndef __EMX__
|
||||
setsid();
|
||||
#endif
|
||||
sscanf(params, "%1000s", s);
|
||||
if (mustdel)
|
||||
{
|
||||
#ifndef __EMX__
|
||||
Esnprintf(sss, sizeof(sss), "/bin/rm -rf %s", themepath);
|
||||
#else
|
||||
Esnprintf(sss, sizeof(sss), "rm.exe -rf %s", themepath);
|
||||
#endif
|
||||
system(sss);
|
||||
}
|
||||
if (!strcmp(s, "restart"))
|
||||
|
|
22
src/setup.c
22
src/setup.c
|
@ -23,6 +23,12 @@
|
|||
#include "E.h"
|
||||
#include <X11/keysym.h>
|
||||
|
||||
#ifdef __EMX__
|
||||
extern char *__XOS2RedirRoot(const char *);
|
||||
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
void
|
||||
MapUnmap(int start)
|
||||
{
|
||||
|
@ -174,7 +180,11 @@ SetupSignals()
|
|||
sigaction(SIGUSR2, &sa, (struct sigaction *)0);
|
||||
|
||||
sa.sa_handler = HandleSigChild;
|
||||
#ifndef __EMX__
|
||||
sa.sa_flags = SA_RESTART;
|
||||
#else
|
||||
sa.sa_flags = 0;
|
||||
#endif
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sigaction(SIGCHLD, &sa, (struct sigaction *)0);
|
||||
|
||||
|
@ -251,7 +261,9 @@ SetupX()
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef SIGSTOP
|
||||
kill(getpid(), SIGSTOP);
|
||||
#endif
|
||||
/* Find the point to concatenate the screen onto */
|
||||
dispstr = strchr(subdisplay, ':');
|
||||
if (NULL != dispstr)
|
||||
|
@ -723,12 +735,20 @@ SetupEnv()
|
|||
if (master_pid != getpid())
|
||||
Esetenv("DISPLAY", DisplayString(disp), 1);
|
||||
Esetenv("EVERSION", ENLIGHTENMENT_VERSION, 1);
|
||||
#ifndef __EMX__
|
||||
Esetenv("EROOT", ENLIGHTENMENT_ROOT, 1);
|
||||
#else
|
||||
Esetenv("EROOT", __XOS2RedirRoot(ENLIGHTENMENT_ROOT), 1);
|
||||
#endif
|
||||
Esetenv("EROOT", ENLIGHTENMENT_ROOT, 1);
|
||||
Esetenv("EBIN", ENLIGHTENMENT_BIN, 1);
|
||||
Esnprintf(s, sizeof(s), "%i", getpid());
|
||||
Esetenv("EPID", s, 1);
|
||||
Esetenv("ETHEME", themepath, 1);
|
||||
|
||||
#ifdef __EMX__
|
||||
Esetenv("EMXSHELL", "sh.exe", 1);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -786,7 +806,9 @@ MakeExtInitWin(void)
|
|||
signal(SIGUSR1, SIG_DFL);
|
||||
signal(SIGUSR2, SIG_DFL);
|
||||
signal(SIGCHLD, SIG_DFL);
|
||||
#ifdef SIGTSTP
|
||||
signal(SIGTSTP, SIG_DFL);
|
||||
#endif
|
||||
signal(SIGBUS, SIG_IGN);
|
||||
d2 = XOpenDisplay(DisplayString(disp));
|
||||
close(ConnectionNumber(disp));
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include "E.h"
|
||||
#ifdef __EMX__
|
||||
#include <process.h>
|
||||
#endif
|
||||
|
||||
/* find a snapshot state that applies to this ewin */
|
||||
Snapshot *
|
||||
|
@ -834,7 +837,11 @@ LoadSnapInfo(void)
|
|||
Esnprintf(buf, sizeof(buf), "%s.snapshots.%i", GetSMFile(), root.scr);
|
||||
if (!exists(buf))
|
||||
Esnprintf(buf, sizeof(buf), "%s.snapshots.%i", GetGenericSMFile(), root.scr);
|
||||
#ifndef __EMX__
|
||||
f = fopen(buf, "r");
|
||||
#else
|
||||
f = fopen(buf, "rt");
|
||||
#endif
|
||||
if (!f)
|
||||
return;
|
||||
res_w = root.w;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
*/
|
||||
#include "E.h"
|
||||
|
||||
#ifndef __EMX__
|
||||
int
|
||||
AddEToFile(char *file)
|
||||
{
|
||||
|
@ -124,10 +125,12 @@ CreateEFile(char *file)
|
|||
fclose(f);
|
||||
EDBUG_RETURN(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
AddE()
|
||||
{
|
||||
#ifndef __EMX__
|
||||
char *h;
|
||||
char s[1024];
|
||||
int val;
|
||||
|
@ -153,6 +156,7 @@ AddE()
|
|||
if (h)
|
||||
Efree(h);
|
||||
EDBUG_RETURN_;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
55
src/theme.c
55
src/theme.c
|
@ -21,6 +21,11 @@
|
|||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include "E.h"
|
||||
#ifdef __EMX__
|
||||
#include <process.h>
|
||||
extern char *__XOS2RedirRoot(const char *);
|
||||
|
||||
#endif
|
||||
|
||||
char *
|
||||
append_merge_dir(char *dir, char ***list, int *count)
|
||||
|
@ -52,6 +57,7 @@ append_merge_dir(char *dir, char ***list, int *count)
|
|||
if (!strcmp(str[i], "DEFAULT"))
|
||||
{
|
||||
Esnprintf(ss, sizeof(ss), "%s/%s", dir, str[i]);
|
||||
#ifndef __EMX__
|
||||
if (readlink(ss, s, sizeof(s)) > 0)
|
||||
{
|
||||
if (s[0] == '/')
|
||||
|
@ -62,6 +68,16 @@ append_merge_dir(char *dir, char ***list, int *count)
|
|||
def = duplicate(s);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (isdir(ss))
|
||||
{
|
||||
def = duplicate(ss);
|
||||
(*count)++;
|
||||
(*list) = Erealloc(*list, (*count) * sizeof(char *));
|
||||
|
||||
(*list)[(*count) - 1] = duplicate(ss);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -96,7 +112,11 @@ ListThemes(int *number)
|
|||
|
||||
Esnprintf(s, sizeof(s), "%s/themes", UserEDir());
|
||||
def = append_merge_dir(s, &list, &count);
|
||||
#ifndef __EMX__
|
||||
Esnprintf(s, sizeof(s), "%s/themes", ENLIGHTENMENT_ROOT);
|
||||
#else
|
||||
Esnprintf(s, sizeof(s), "%s/themes", __XOS2RedirRoot(ENLIGHTENMENT_ROOT));
|
||||
#endif
|
||||
def2 = append_merge_dir(s, &list, &count);
|
||||
|
||||
if ((def) && (def2))
|
||||
|
@ -120,6 +140,7 @@ GetDefaultTheme(void)
|
|||
int count;
|
||||
|
||||
Esnprintf(ss, sizeof(ss), "%s/themes/DEFAULT", UserEDir());
|
||||
#ifndef __EMX__
|
||||
count = readlink(ss, s, sizeof(s));
|
||||
if ((exists(ss)) && (count > 0))
|
||||
{
|
||||
|
@ -132,9 +153,18 @@ GetDefaultTheme(void)
|
|||
def = duplicate(ss);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (isdir(ss))
|
||||
def = duplicate(ss);
|
||||
#endif
|
||||
if (!def)
|
||||
{
|
||||
#ifndef __EMX__
|
||||
Esnprintf(ss, sizeof(ss), "%s/themes/DEFAULT", ENLIGHTENMENT_ROOT);
|
||||
#else
|
||||
Esnprintf(ss, sizeof(ss), "%s/themes/DEFAULT", __XOS2RedirRoot(ENLIGHTENMENT_ROOT));
|
||||
#endif
|
||||
#ifndef __EMX__
|
||||
count = readlink(ss, s, sizeof(s));
|
||||
if ((exists(ss)) && (count > 0))
|
||||
{
|
||||
|
@ -147,6 +177,10 @@ GetDefaultTheme(void)
|
|||
def = duplicate(ss);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (isdir(ss))
|
||||
def = duplicate(ss);
|
||||
#endif
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
@ -154,6 +188,10 @@ GetDefaultTheme(void)
|
|||
void
|
||||
SetDefaultTheme(char *theme)
|
||||
{
|
||||
#ifndef __EMX__
|
||||
/* os2 has no symlink,
|
||||
* but it doesn't matter since we have ~/.enlightenment/user_theme.cfg
|
||||
*/
|
||||
char ss[FILEPATH_LEN_MAX];
|
||||
|
||||
Esnprintf(ss, sizeof(ss), "%s/themes/DEFAULT", UserEDir());
|
||||
|
@ -161,6 +199,7 @@ SetDefaultTheme(char *theme)
|
|||
rm(ss);
|
||||
if (theme)
|
||||
symlink(theme, ss);
|
||||
#endif
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -226,7 +265,11 @@ ExtractTheme(char *theme)
|
|||
{
|
||||
char sss[FILEPATH_LEN_MAX];
|
||||
|
||||
#ifndef __EMX__
|
||||
Esnprintf(sss, sizeof(sss), "/bin/rm -rf %s", themepath);
|
||||
#else
|
||||
Esnprintf(sss, sizeof(sss), "rm.exe -rf %s", themepath);
|
||||
#endif
|
||||
system(sss);
|
||||
mustdel = 0;
|
||||
EDBUG_RETURN(NULL);
|
||||
|
@ -246,10 +289,18 @@ FindTheme(char *theme)
|
|||
badreason = "Unknown\n";
|
||||
if (!theme[0])
|
||||
{
|
||||
#ifndef __EMX__
|
||||
Esnprintf(s, sizeof(s), "%s/themes/DEFAULT", ENLIGHTENMENT_ROOT);
|
||||
#else
|
||||
Esnprintf(s, sizeof(s), "%s/themes/DEFAULT", __XOS2RedirRoot(ENLIGHTENMENT_ROOT));
|
||||
#endif
|
||||
EDBUG_RETURN(duplicate(s));
|
||||
}
|
||||
#ifndef __EMX__
|
||||
if (theme[0] == '/')
|
||||
#else
|
||||
if (_fnisabs(theme))
|
||||
#endif
|
||||
ret = ExtractTheme(theme);
|
||||
if (!ret)
|
||||
{
|
||||
|
@ -260,7 +311,11 @@ FindTheme(char *theme)
|
|||
badreason = "Theme file/directory does not exist\n";
|
||||
if (!ret)
|
||||
{
|
||||
#ifndef __EMX__
|
||||
Esnprintf(s, sizeof(s), "%s/themes/%s", ENLIGHTENMENT_ROOT, theme);
|
||||
#else
|
||||
Esnprintf(s, sizeof(s), "%s/themes/%s", __XOS2RedirRoot(ENLIGHTENMENT_ROOT), theme);
|
||||
#endif
|
||||
if (exists(s))
|
||||
ret = ExtractTheme(s);
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue