7
#include "..\version.h"
13
/*-----------------------------------------------------------------------------------*/
15
/*-----------------------------------------------------------------------------------*/
17
#define LCCEXE "\\lcc\\bin\\lcc.exe"
18
#define LCCBIN "\\lcc\\bin"
19
#define LCCINCLUDE "\\lcc\\include"
20
#define LCCLIB "\\lcc\\lib"
22
#if (defined __MSC__ ) || (defined __MINGW32__)
23
#define putenv(x) _putenv(x)
27
#define putenv(x) abs_putenv(x)
35
#define MENUNAME "wscilabE.mnu"
36
#define GRAPHMENUNAME "wgscilab.mnu"
38
#define MIN_STACKSIZE 180000
40
#define MAXCMDTOKENS 128
42
/** test if we are using a file or not **/
43
#define isterm(f) (f==stdin || f==stdout || f==stderr)
45
#define MORESTR "[More (y or n ) ?] "
47
/* replacement stdio routines that use Text Window for stdin/stdout */
48
/* WARNING: Do not write to stdout/stderr with functions not listed
77
/*-----------------------------------------------------------------------------------*/
78
/* Les Variables Globales */
79
/*-----------------------------------------------------------------------------------*/
87
LPSTR szGraphMenuName;
89
static int startupf = 0; /** 0 if we execute startup else 1 **/
90
static int nointeractive = 0;
91
static int show_logo = 1;
92
static int memory = MIN_STACKSIZE;
93
static int my_argc = -1;
95
int sci_show_banner=1;
98
char ScilexConsoleName[MAX_PATH];
100
/*-----------------------------------------------------------------------------------*/
102
/*-----------------------------------------------------------------------------------*/
103
extern void PrintFile(char *filename);
104
extern void C2F (tmpdirc) ();
105
extern void C2F (getwins) (integer *, integer *, integer *);
106
//extern void C2F (diary) (char *, int *, int);
107
extern void set_sci_env(char *p, char *wsci) ;
110
static void CheckMemory (LPSTR str);
111
static void AllGraphWinDelete ();
112
static LPSTR my_argv[MAXCMDTOKENS];
113
static void SciEnv ();
114
EXPORT int CALLBACK ShutDown (void);
116
void set_sci_env(char *p, char *wsci) ;
117
int Pause (LPSTR str);
118
int SciWinGetPlatformId ();
122
void add_sci_argv(char *p);
124
int sci_getarg(int *n,char *s,long int ls);
125
int InteractiveMode ();
126
int C2F(showlogo) ();
127
int MyPutCh (int ch);
131
int MyFGetC (FILE * file);
132
char *MyGetS (char *str);
133
char * MyFGetS (char *str, unsigned int size, FILE * file);
134
int MyFPutC (int ch, FILE * file);
135
int MyFPutS (char *str, FILE * file);
136
int MyPutS (char *str);
137
void Scistring (char *str);
138
int MyFPrintF (FILE * file, char *fmt,...);
139
int MyPrintF (char *fmt,...);
140
void sciprint (char *fmt,...);
141
void sciprint_nd (char *fmt,...);
142
int sciprint2 (int iv, char *fmt,...);
143
size_t MyFWrite (const void *ptr, size_t size, size_t n, FILE * file);
144
size_t MyFRead (void *ptr, size_t size, size_t n, FILE * file);
145
extern void Xputchar ();
147
void Xputstring (str, n);
148
void C2F (xscisncr) (str, n, dummy);
149
void C2F (xscistring) (str, n, dummy);
150
void C2F (xscimore) (n);
153
int WriteStr (char *s, FILE * file);
154
int WriteKey (char c, FILE * file);
157
int WINAPI Windows_Main (HINSTANCE hInstance, HINSTANCE hPrevInstance,PSTR szCmdLine, int iCmdShow);
158
int Console_Main(int argc, char **argv);
162
void CreateSplashscreen(void);
164
/* Tue le Process Scilex si OS est Windows 9x */
165
void Kill_Scilex_Win98(void);
166
/* Tue le Process Scilex */
167
void Kill_Scilex(void);
169
/* Teste si la chaine de caractere correspond � un fichier existant*/
170
/* retourne TRUE si c'est le cas sinon FALSE */
171
BOOL IsAFile(char *chainefichier);
173
/* Teste si le fichier a une extension .sav ou .bin*/
174
/* retourne TRUE si c'est le cas sinon FALSE */
175
BOOL IsABinOrSavFile(char *chainefichier);
177
BOOL IsAGraphFile(char *chainefichier);
178
BOOL IsAGraphFilegraph(char *chainefichier);
179
BOOL IsAGraphFilegraphb(char *chainefichier);
181
BOOL IsAScicosFile(char *chainefichier);
182
BOOL IsAScicosFileCOS(char *chainefichier);
183
BOOL IsAScicosFileCOSF(char *chainefichier);
185
/* Retourne un num�ro valide pour nommer les fenetres associ�es � ce process */
186
int FindFreeScilexNumber(void);
188
void RenameConsole(void);
190
/* Suivant la commande Via menu ouvre, edit, imprime ...*/
191
extern void ReplaceSlash(char *pathout,char *pathin);
192
int CommandByFileExtension(char *fichier,int OpenCode,char *Cmd);
194
BOOL IsWindowInterface();
196
void ExtensionFileIntoLowerCase(char *fichier);
198
void CreateScilabConsole(BOOL ShowBanner);
199
void CloseScilabConsole(void);
201
extern BOOL SendCommandToAnotherScilab(char *ScilabWindowNameSource,char *ScilabWindowNameDestination,char *CommandLine);
202
extern BOOL HaveAnotherWindowScilab(void);
203
extern char * ChooseAnotherWindowScilab(void);
204
/*-----------------------------------------------------------------------------------*/