C2F(putlhsvar)(); => PutLhsVar();
[scilab.git] / scilab / modules / fileio / sci_gateway / c / sci_filesep.c
1 /*
2  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  * Copyright (C) 2007 - INRIA - Allan CORNET
4  * ...
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-en.txt
11  *
12  */
13 /*--------------------------------------------------------------------------*/
14 #include <string.h>
15 #include "gw_fileio.h"
16 #include "stack-c.h"
17 #include "MALLOC.h"
18 #include "Scierror.h"
19 #ifdef _MSC_VER
20 #include "strdup_windows.h"
21 #endif
22 /*--------------------------------------------------------------------------*/
23 int sci_filesep(char *fname,unsigned long fname_len)
24 {
25         static int n1,m1;
26         char *separator = NULL;
27
28         CheckRhs(0,0);
29         CheckLhs(1,1);
30
31         separator = strdup(DIR_SEPARATOR);
32
33         n1 = 1;
34         CreateVarFromPtr(Rhs+1,STRING_DATATYPE,(m1=(int)strlen(separator), &m1),&n1,&separator);
35         LhsVar(1)=Rhs+1;
36
37     if (separator) {FREE(separator);separator=NULL;}
38
39         PutLhsVar();
40
41     return 0;
42 }
43 /*--------------------------------------------------------------------------*/
44