SCIHOME.h File Reference

#include "machine.h"

Include dependency graph for SCIHOME.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

BOOL setSCIHOME (void)
char * getSCIHOME (void)


Function Documentation

char* getSCIHOME ( void   ) 

Definition at line 87 of file SCIHOME.c.

References MALLOC, NULL, and SCIHOMEPATH.

Referenced by getfilenamelanguagepref(), and getscihome().

00088 {
00089         char *retSCIHOME=NULL;
00090         retSCIHOME=(char*)MALLOC(sizeof(char)*(strlen(SCIHOMEPATH)+1));
00091         strcpy(retSCIHOME,SCIHOMEPATH);
00092         return retSCIHOME;
00093 }

Here is the caller graph for this function:

BOOL setSCIHOME ( void   ) 

Definition at line 26 of file SCIHOME.c.

References BASEDIR, buflen, C2F, CreateDir(), DIRSEPARATOR, env, ExistDir(), FALSE, getenvc(), ierr, iflag, MAX_PATH, putenv, SCI_VERSION_STRING, SCIHOMEPATH, and TRUE.

Referenced by getscihome(), and SciEnv().

00027 {
00028         BOOL bOK=FALSE;
00029         int ierr=0;
00030         int buflen=MAX_PATH;
00031         int iflag=0;
00032         
00033         char SCIHOME[MAX_PATH];
00034         char USERPATHSCILAB[MAX_PATH];
00035         
00036         C2F(getenvc)(&ierr,"SCIHOME",SCIHOME,&buflen,&iflag);
00037 
00038         if (ierr) /* SCIHOME not define */
00039         {
00040                 #ifdef _MSC_VER
00041                         #define DIRSEPARATOR "\\"
00042                         #define BASEDIR "Scilab"
00043                 #else
00044                         #define DIRSEPARATOR "/"
00045                         #define BASEDIR ".Scilab"
00046                 #endif
00047 
00048                 char env[MAX_PATH+1+10];
00049                 char USERHOMESYSTEM[MAX_PATH];
00050                 iflag=1;
00051 
00052                 #ifdef _MSC_VER
00053                         C2F(getenvc)(&ierr,"USERPROFILE",USERHOMESYSTEM,&buflen,&iflag);
00054                 #else
00055                         C2F(getenvc)(&ierr,"HOME",USERHOMESYSTEM,&buflen,&iflag);
00056                 #endif
00057 
00058 
00059                 if (ierr) {return bOK; }
00060                 else
00061                 {
00062                         sprintf(USERPATHSCILAB,"%s%s%s",USERHOMESYSTEM,DIRSEPARATOR,BASEDIR);
00063                         sprintf(SCIHOMEPATH,"%s%s%s",USERPATHSCILAB,DIRSEPARATOR,SCI_VERSION_STRING);
00064                 }
00065                 sprintf(env,"SCIHOME=%s",SCIHOMEPATH);
00066                 putenv(env);
00067         }
00068         else
00069         {
00070                 strcpy(SCIHOMEPATH,SCIHOME);
00071         }
00072 
00073         if (!ExistDir(SCIHOMEPATH))
00074         {
00075                 if(!ExistDir(USERPATHSCILAB)) CreateDir(USERPATHSCILAB);
00076                 if (CreateDir(SCIHOMEPATH))
00077                 {
00078                         bOK=TRUE;
00079                         return bOK;
00080                 }
00081         }
00082         else bOK=TRUE;
00083         
00084         return bOK;
00085 }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Sun Mar 4 15:12:31 2007 for Scilab [trunk] by  doxygen 1.5.1