Comment line goes on 80 chars only
[scilab.git] / scilab / modules / fileio / sci_gateway / c / sci_filesep.c
1 /*--------------------------------------------------------------------------*/
2 /* INRIA 2007 */
3 /* Allan CORNET */
4 /*--------------------------------------------------------------------------*/
5 #include "gw_fileio.h"
6 #include "stack-c.h"
7 #include "MALLOC.h"
8 #include "Scierror.h"
9 /*--------------------------------------------------------------------------*/
10 int C2F(sci_filesep) _PARAMS((char *fname,unsigned long fname_len))
11 {
12         static int n1,m1;
13         char *separator=NULL;
14
15         CheckRhs(0,0);
16         CheckLhs(1,1);
17
18         separator=(char*)MALLOC(sizeof(char)*(strlen(DIR_SEPARATOR)+1));
19         if (separator) strcpy(separator,DIR_SEPARATOR);
20
21         n1 = 1;
22         CreateVarFromPtr(Rhs+1,STRING_DATATYPE,(m1=(int)strlen(separator), &m1),&n1,&separator);
23         LhsVar(1)=Rhs+1;
24         C2F(putlhsvar)();
25
26         if (separator) {FREE(separator);separator=NULL;}
27
28         return 0;
29 }
30 /*--------------------------------------------------------------------------*/
31