archiveList complete with gateways, primitives, test and help
[scilab.git] / scilab / modules / fileio / sci_gateway / c / gw_fileio.c
1 /*
2  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  * Copyright (C) 2006 - INRIA - Allan CORNET
4  * Copyright (C) 2010 - DIGITEO - Allan CORNET
5  *
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at
10  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
11  *
12  */
13 /*--------------------------------------------------------------------------*/
14 #include "gw_fileio.h"
15 #include "callFunctionFromGateway.h"
16 #include "MALLOC.h"
17 #include "api_scilab.h"
18 /*--------------------------------------------------------------------------*/
19 /*  interface function */
20 /*--------------------------------------------------------------------------*/
21 static gw_generic_table Tab[] =
22 {
23     {sci_mopen, "mopen"},
24     {sci_mputstr, "mputstr"},
25     {sci_mclose, "mclose"},
26     {sci_mput, "mput"},
27     {sci_mget, "mget"},
28     {sci_mgetstr, "mgetstr"},
29     {sci_meof, "meof"},
30     {sci_mseek, "mseek"},
31     {sci_mtell, "mtell"},
32     {sci_mclearerr, "mclearerr"},
33     {sci_mfprintf, "mfprintf"},
34     {sci_scanf, "mscanf"},
35     {sci_fscanf, "mfscanf"},
36     {sci_sscanf, "msscanf"},
37     {sci_fscanfMat, "fscanfMat"},
38     {sci_fprintfMat, "fprintfMat"},
39     {sci_merror, "merror"},
40     {sci_findfiles, "findfiles"},
41     {sci_maxfiles, "maxfiles"},
42     {sci_getdrives, "getdrives"},
43     {sci_fullpath, "fullpath"},
44     {sci_deletefile, "deletefile"},
45     {sci_pathsep, "pathsep"},
46     {sci_filesep, "filesep"},
47     {sci_getlongpathname, "getlongpathname"},
48     {sci_getshortpathname, "getshortpathname"},
49     {sci_fileext, "fileext"},
50     {sci_isdir, "isdir"},
51     {sci_removedir, "removedir"},
52     {sci_createdir, "createdir"},
53     {sci_pwd, "pwd"},
54     {sci_chdir, "chdir"},
55     {sci_fileinfo, "fileinfo"},
56     {sci_newest, "newest"},
57     {sci_getrelativefilename, "getrelativefilename"},
58     {sci_get_absolute_file_path, "get_absolute_file_path"},
59     {sci_copyfile, "copyfile"},
60     {sci_isfile, "isfile"},
61     {sci_fileparts, "fileparts"},
62     {sci_movefile, "movefile"},
63     {sci_basename, "basename"},
64     {sci_pathconvert, "pathconvert"},
65     {sci_chdir, "cd"},
66     {sci_mgetl, "mgetl"},
67     {sci_mputl, "mputl"},
68     {sci_tempname, "tempname"},
69     {sci_getURL, "getURL"},
70     {sci_splitURL, "splitURL"},
71     {sci_archive_list,"archiveList"}
72 };
73 /*--------------------------------------------------------------------------*/
74 int gw_fileio(void)
75 {
76     Rhs = Max(0, Rhs);
77
78     if (pvApiCtx == NULL)
79     {
80         pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
81     }
82
83     pvApiCtx->pstName = (char*)Tab[Fin - 1].name;
84     callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
85     return 0;
86 }
87 /*--------------------------------------------------------------------------*/
88