File: men_getfile.c

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (56 lines) | stat: -rw-r--r-- 1,270 bytes parent folder | download
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
/* Copyright ENPC */
#ifdef WIN32 
#include "wmen_scilab.h"
#else
#include "men_scilab.h"
#endif

/*************************************************     
 * test function 
 **********************************************************/

#define MAXSTRGETF 256

int TestGetFile() 
{
  int ierr=0;
  static char *init ="*.sci";
  char *res;
  return(GetFileWindow(init,&res,".",0,&ierr,"Title"));
}

/****************************************************
 * Scilab getfile Menu
 * interface with scilab 
 * res is dynamically allocated in GetFileWindow 
 *     and the routines which use xgetfile must 
 *     clear the memory ( see xawelm.f ) 
 **********************************************************/
     
void C2F(xgetfile)(filemask,dirname,res,ires,ierr,idir,desc,ptrdesc,nd)
     char *filemask,**res,*dirname;
     integer *desc,*ptrdesc,*nd;
     integer *ierr,*ires,*idir;
{
  int flag=0,rep;
  char *description;
  *ierr=0;
  ScilabMStr2C(desc,nd,ptrdesc,&description,ierr);
  if ( *ierr == 1) return;
  *ierr = 0;
  if ( *idir == 1) flag =1 ;
  rep = GetFileWindow(filemask,res,dirname,flag,ierr,description);
  FREE(description);
  if ( *ierr >= 1 || rep == FALSE )
    {
      *ires = 0 ;
      return;
    }
  else 
    {
      *ires=strlen(*res);
    }
}