blob: 697294682ddb2e463a3e7ae2fb6c5f288059ef50 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
/*
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2007 - INRIA - Allan CORNET
*
* This file must be used under the terms of the CeCILL.
* This source file is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at
* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
*
*/
#ifndef __FILESMANAGEMENT_H__
#define __FILESMANAGEMENT_H__
#include <stdio.h>
#include "dynlib_fileio.h"
#include "BOOL.h"
/* ID returned if File is not defined */
#define FILE_ID_NOT_DEFINED -100
/**
* Default max of files opened in scilab
*/
#ifdef FOPEN_MAX
#define DEFAULT_MAX_FILES FOPEN_MAX
#else
#define DEFAULT_MAX_FILES 20
#endif
/**
* Get max of files opened in scilab
* @return max of files opened in scilab
*/
FILEIO_IMPEXP int GetMaximumFileOpenedInScilab(void);
/**
* Get the file associated to int Id
* @param Id
* @return FILE ptr
*/
FILEIO_IMPEXP FILE *GetFileOpenedInScilab(int Id);
/**
* Set the file associated to int Id
* @param FILE ptr
* @param Id
*/
FILEIO_IMPEXP void SetFileOpenedInScilab(int Id, FILE *fptr);
/**
* Get the current Id (current file)
* @return Id
*/
FILEIO_IMPEXP int GetCurrentFileId(void);
/**
* Get the previous Id (previous file)
* @return Id
*/
FILEIO_IMPEXP int GetPreviousFileId(void);
/**
* Set the current Id (current file)
* @param Id
*/
FILEIO_IMPEXP void SetCurrentFileId(int Id);
/**
* Get the swap status of file Id
* @param Id
* @return swap status
*/
FILEIO_IMPEXP int GetSwapStatus(int Id);
/**
* Set the swap status of file Id
* @param Id
* @param new swap
*/
FILEIO_IMPEXP void SetSwapStatus(int Id, int newswap);
/**
* Get the mode of file Id
* @param Id
* @return mode
*/
FILEIO_IMPEXP int GetFileModeOpenedInScilab(int Id);
/**
* Set the mode of file Id
* @param Id
* @param new mode
*/
FILEIO_IMPEXP void SetFileModeOpenedInScilab(int Id, int mode);
/**
* Get the type of file Id
* @param Id
* @return Type (Fortran,C)
*/
FILEIO_IMPEXP int GetFileTypeOpenedInScilab(int Id);
/**
* Get the type of file Id
* @param Id
* @return Type 'C' or 'F' (Fortran,C) (to free)
*/
FILEIO_IMPEXP char *GetFileTypeOpenedInScilabAsString(int Id);
/**
* Set the mode of file Id
* @param Id
* @param new Type (Fortran,C)
*/
FILEIO_IMPEXP void SetFileTypeOpenedInScilab(int Id, int Type);
/**
* Get the name of file Id
* @param Id
* @return name
*/
FILEIO_IMPEXP char* GetFileNameOpenedInScilab(int Id);
/**
* Set the name of file Id
* @param Id
* @param new name
* @return TRUE or FALSE
*/
FILEIO_IMPEXP BOOL SetFileNameOpenedInScilab(int Id, char *name);
/**
* Free filename of file Id
* @param Id
* @return TRUE or FALSE
*/
FILEIO_IMPEXP BOOL FreeFileNameOpenedInScilab(int Id);
/**
* Initialize Scilab's file list
* @return TRUE or FALSE
*/
FILEIO_IMPEXP BOOL InitializeScilabFilesList(void);
/**
* Terminate Scilab's file list
* @return TRUE or FALSE
*/
FILEIO_IMPEXP BOOL TerminateScilabFilesList(void);
/**
* Extend Scilab's file list
* @return TRUE or FALSE
*/
FILEIO_IMPEXP BOOL ExtendScilabFilesList(int NewSize);
/**
* Search if filename is already opened in Scilab
* @return TRUE or FALSE
*/
FILEIO_IMPEXP BOOL IsAlreadyOpenedInScilab(char *filename);
/**
* Get ID of a filename opened in scilab
* @param[in] filename
* @return file ID or FILE_ID_NOT_DEFINED
*/
FILEIO_IMPEXP int GetIdFromFilename(char *filename);
/**
* Get Ids opened in Scilab
* @param[out] size of returned array
* @return Array of Id
*/
FILEIO_IMPEXP double *GetFilesIdUsed(int *sizeArrayReturned);
/**
* Get Ids opened in Scilab
* @param[out] size of returned array
* @return Array of Id
*/
FILEIO_IMPEXP double *GetSwapsUsed(int *sizeArrayReturned);
/**
* Get Modes used in Scilab
* @param[out] size of returned array
* @return Modes associated to Id
*/
FILEIO_IMPEXP double *GetModesUsed(int *sizeArrayReturned);
/**
* Get Types used in Scilab
* @param[out] size of returned array
* @return Types associated to Id
*/
FILEIO_IMPEXP int *GetTypesUsed(int *sizeArrayReturned);
/**
* Get Types used in Scilab
* @param[out] size of returned array
* @return Types associated to Id as Strings (user reading)
*/
FILEIO_IMPEXP char **GetTypesUsedAsString(int *sizeArrayReturned);
/**
* Get filenames used in Scilab
* @param[out] size of returned array
* @return filenames
*/
FILEIO_IMPEXP char **GetFilenamesUsed(int *sizeArrayReturned);
/**
* Get number of Ids Used in Scilab
* @return number of Ids
*/
FILEIO_IMPEXP int GetNumberOfIdsUsed(void);
#endif /* __FILESMANAGEMENT_H__ */
/*--------------------------------------------------------------------------*/
|