~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to routines/wsci/WINMAIN.H

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <stdlib.h>
 
3
#include <string.h>
 
4
#include <stdarg.h>
 
5
#include <windows.h>
 
6
#include <Winuser.h>
 
7
#include "..\version.h"
 
8
 
 
9
#include "wcommon.h"
 
10
#include "plot.h"
 
11
 
 
12
 
 
13
/*-----------------------------------------------------------------------------------*/
 
14
/* Les Definitions */
 
15
/*-----------------------------------------------------------------------------------*/
 
16
 
 
17
#define LCCEXE          "\\lcc\\bin\\lcc.exe" 
 
18
#define LCCBIN          "\\lcc\\bin" 
 
19
#define LCCINCLUDE      "\\lcc\\include" 
 
20
#define LCCLIB          "\\lcc\\lib" 
 
21
 
 
22
#if (defined __MSC__ ) || (defined __MINGW32__) 
 
23
#define putenv(x) _putenv(x)
 
24
#endif
 
25
 
 
26
#ifdef __ABSC__
 
27
#define putenv(x) abs_putenv(x)
 
28
#endif
 
29
 
 
30
/* limits */
 
31
//#define MAXSTR 255
 
32
#define MAXPRINTF 512
 
33
 
 
34
 
 
35
#define MENUNAME "wscilabE.mnu"
 
36
#define GRAPHMENUNAME "wgscilab.mnu"
 
37
 
 
38
#define MIN_STACKSIZE 180000
 
39
 
 
40
#define MAXCMDTOKENS 128
 
41
 
 
42
/** test if we are using a file or not **/
 
43
#define isterm(f) (f==stdin || f==stdout || f==stderr)
 
44
 
 
45
#define MORESTR "[More (y or n ) ?] "
 
46
 
 
47
/* replacement stdio routines that use Text Window for stdin/stdout */
 
48
/* WARNING: Do not write to stdout/stderr with functions not listed 
 
49
   in win/wtext.h */
 
50
#undef kbhit
 
51
#undef getche
 
52
#undef getch
 
53
#undef putch
 
54
 
 
55
#undef fgetc
 
56
#undef getchar
 
57
#undef getc
 
58
#undef fgets
 
59
#undef gets
 
60
 
 
61
#undef fputc
 
62
#undef putchar
 
63
#undef putc
 
64
#undef fputs
 
65
#undef puts
 
66
 
 
67
#undef fprintf
 
68
#undef printf
 
69
#undef vprintf
 
70
#undef vfprintf
 
71
 
 
72
#undef fwrite
 
73
#undef fread
 
74
 
 
75
 
 
76
 
 
77
/*-----------------------------------------------------------------------------------*/
 
78
/* Les Variables Globales */
 
79
/*-----------------------------------------------------------------------------------*/
 
80
TW textwin;
 
81
GW graphwin;
 
82
PW pausewin;
 
83
MW menuwin;
 
84
 
 
85
LPSTR szModuleName;
 
86
LPSTR szMenuName;
 
87
LPSTR szGraphMenuName;
 
88
 
 
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;
 
94
 
 
95
int  sci_show_banner=1;
 
96
int SciPlatformId;
 
97
 
 
98
char ScilexConsoleName[MAX_PATH];
 
99
 
 
100
/*-----------------------------------------------------------------------------------*/
 
101
/* Les Fonctions */
 
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) ;
 
108
 
 
109
 
 
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);
 
115
 
 
116
void set_sci_env(char *p, char *wsci) ;
 
117
int Pause (LPSTR str);
 
118
int SciWinGetPlatformId ();
 
119
 
 
120
 
 
121
 
 
122
void add_sci_argv(char *p);
 
123
int sci_iargc();
 
124
int sci_getarg(int *n,char *s,long int ls);
 
125
int InteractiveMode ();
 
126
int C2F(showlogo) ();
 
127
int MyPutCh (int ch);
 
128
int MyKBHit (void);
 
129
int MyGetCh (void);
 
130
int MyGetChE (void);
 
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 ();
 
146
void Xputchar (c);
 
147
void Xputstring (str, n);
 
148
void C2F (xscisncr) (str, n, dummy);
 
149
void C2F (xscistring) (str, n, dummy);
 
150
void C2F (xscimore) (n);
 
151
void Scisncr (str);
 
152
int ReadKey (void);
 
153
int WriteStr (char *s, FILE * file);
 
154
int WriteKey (char c, FILE * file);
 
155
 
 
156
 
 
157
int WINAPI Windows_Main (HINSTANCE hInstance, HINSTANCE hPrevInstance,PSTR szCmdLine, int iCmdShow);
 
158
int Console_Main(int argc, char **argv);
 
159
int MAIN__ ();
 
160
 
 
161
void WinExit (void);
 
162
void CreateSplashscreen(void);
 
163
 
 
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);
 
168
 
 
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);
 
172
 
 
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);
 
176
 
 
177
BOOL IsAGraphFile(char *chainefichier);
 
178
BOOL IsAGraphFilegraph(char *chainefichier);
 
179
BOOL IsAGraphFilegraphb(char *chainefichier);
 
180
 
 
181
BOOL IsAScicosFile(char *chainefichier);
 
182
BOOL IsAScicosFileCOS(char *chainefichier);
 
183
BOOL IsAScicosFileCOSF(char *chainefichier);
 
184
 
 
185
/* Retourne un num�ro valide pour nommer les fenetres associ�es � ce process */
 
186
int FindFreeScilexNumber(void);
 
187
 
 
188
void RenameConsole(void);
 
189
 
 
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);
 
193
 
 
194
BOOL IsWindowInterface();
 
195
 
 
196
void ExtensionFileIntoLowerCase(char *fichier);
 
197
 
 
198
void CreateScilabConsole(BOOL ShowBanner);
 
199
void CloseScilabConsole(void);
 
200
 
 
201
extern BOOL SendCommandToAnotherScilab(char *ScilabWindowNameSource,char *ScilabWindowNameDestination,char *CommandLine);
 
202
extern BOOL HaveAnotherWindowScilab(void);
 
203
extern char * ChooseAnotherWindowScilab(void);
 
204
/*-----------------------------------------------------------------------------------*/