env.c File Reference

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>

Include dependency graph for env.c:

Go to the source code of this file.

Functions

void SciEnv ()


Function Documentation

void SciEnv ( void   ) 

Define SCI and some others Environments variables

Definition at line 17 of file env.c.

References env, getenv(), MAX_PATH, NULL, p, and putenv.

Referenced by InitializeCore(), and main().

00018 {
00019   char *p,*p1;
00020   char modname[MAX_PATH+1];
00021   char env[MAX_PATH+1+10];
00022   if (!GetModuleFileName (NULL, modname+1, MAX_PATH))
00023     return;
00024   if ((p = strrchr (modname+1, '\\')) == NULL)
00025     return;
00026   *p = 0;
00027 
00028   /* Set SCI variable */
00029   if ((p = strrchr (modname+1, '\\')))
00030     {
00031       *p = 0;
00032       for (p = modname+1; *p; p++)
00033         {
00034           if (*p == '\\') *p = '/';
00035         }
00036     p = modname + 1;
00037     if ( ( p1 = getenv("SCI"))  == (char *) 0 )
00038         {
00039                 sprintf(env,"SCI=%s",p);
00040                 #ifdef _MSC_VER
00041                         _putenv(env);
00042                 #else
00043                         putenv(env);
00044                 #endif
00045         }
00046   }
00047 }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Sun Mar 4 16:14:19 2007 for Scilab [trunk] by  doxygen 1.5.1