"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gui/osx_env.c" between
gretl-2020a.tar.xz and gretl-2020b.tar.xz

About: gretl (Gnu Regression, Econometrics and Time-series Library) is a cross-platform statistical package mainly for econometric analysis.

osx_env.c  (gretl-2020a.tar.xz):osx_env.c  (gretl-2020b.tar.xz)
#include <sys/param.h>
#include <mach-o/dyld.h>
/* Hopefully this function will provide an alternative to
starting gretl (quartz package) on macOS via a shell
script: get the environment set up via C code instead.
*/
void osx_setup_paths (void) void osx_setup_paths (void)
{ {
char *c, execpath[MAXPATHLEN + 1]; char *c, execpath[MAXPATHLEN + 1];
char respath[MAXPATHLEN + 1]; char respath[MAXPATHLEN + 1];
uint32_t pathsz = sizeof execpath; uint32_t pathsz = sizeof execpath;
char *rhome; char *rhome;
gchar *tmp; gchar *tmp;
getcwd(respath, sizeof respath); getcwd(respath, sizeof respath);
setenv("GRETL_STARTDIR", respath, 1); setenv("GRETL_STARTDIR", respath, 1);
_NSGetExecutablePath(execpath, &pathsz); _NSGetExecutablePath(execpath, &pathsz);
// fprintf(stderr, "EXECPATH: %s\n", execpath);
c = strrchr(execpath, '/'); c = strrchr(execpath, '/');
*c = '\0'; *c = '\0';
strcat(execpath, "/../Resources"); strcat(execpath, "/../Resources");
chdir(execpath); chdir(execpath);
getcwd(respath, sizeof respath); getcwd(respath, sizeof respath);
fprintf(stderr, "TOP: %s\n", respath);
tmp = g_strdup_printf("%s/share/gretl/", respath); tmp = g_strdup_printf("%s/share/gretl/", respath);
setenv("GRETL_HOME", tmp, 1); setenv("GRETL_HOME", tmp, 1);
g_free(tmp); g_free(tmp);
setenv("GTK_PATH", respath, 1); setenv("GTK_PATH", respath, 1);
setenv("GTK_DATA_PREFIX", respath, 1); setenv("GTK_DATA_PREFIX", respath, 1);
setenv("GTK_EXE_PREFIX", respath, 1); setenv("GTK_EXE_PREFIX", respath, 1);
setenv("G_FILENAME_ENCODING", "UTF-8", 1); setenv("G_FILENAME_ENCODING", "UTF-8", 1);
 End of changes. 3 change blocks. 
2 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)