14
14
#include <windows.h>
15
15
#include <string.h>
16
16
#include "gw_windows_tools.h"
18
18
#include "Scierror.h"
19
19
#include "FindFileAssociation.h"
20
20
#include "PATH_MAX.h"
21
21
#include "stack-c.h"
22
22
#include "localization.h"
23
23
/*--------------------------------------------------------------------------*/
24
int sci_findfileassociation(char *fname,unsigned long l)
28
char ExtraParam[PATH_MAX];
29
char AssocParam[PATH_MAX];
37
if (GetType(1) != sci_strings)
39
Scierror(999,_("%s: Wrong type for input argument #%d: String expected.\n") ,fname,1);
46
GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
48
strcpy(AssocParam,param);
50
strcpy(ExtraParam,"open");
55
if ( (GetType(1) != sci_strings) && (GetType(2) != sci_strings) )
57
Scierror(999,_("%s: Wrong type for input arguments: Strings expected.\n"),fname);
64
GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
67
strcpy(AssocParam,param);
69
GetRhsVar(2,STRING_DATATYPE,&m1,&n1,&l1);
72
strcpy(ExtraParam,param);
76
Output=FindFileAssociation(AssocParam,ExtraParam) ;
81
CreateVarFromPtr(Rhs+ 1,STRING_DATATYPE,(m1=(int)strlen(Output), &m1),&n1,&Output);
88
CreateVarFromPtr(Rhs+ 1,MATRIX_OF_DOUBLE_DATATYPE,&n1,&m1,&l1);
91
if (Output) {FREE(Output);Output=NULL;}
24
int sci_findfileassociation(char *fname, unsigned long l)
26
static int l1, n1, m1;
28
char ExtraParam[PATH_MAX];
29
char AssocParam[PATH_MAX];
37
if (GetType(1) != sci_strings)
39
Scierror(999, _("%s: Wrong type for input argument #%d: String expected.\n") , fname, 1);
46
GetRhsVar(1, STRING_DATATYPE, &m1, &n1, &l1);
48
strcpy(AssocParam, param);
50
strcpy(ExtraParam, "open");
55
if ( (GetType(1) != sci_strings) && (GetType(2) != sci_strings) )
57
Scierror(999, _("%s: Wrong type for input arguments: Strings expected.\n"), fname);
64
GetRhsVar(1, STRING_DATATYPE, &m1, &n1, &l1);
67
strcpy(AssocParam, param);
69
GetRhsVar(2, STRING_DATATYPE, &m1, &n1, &l1);
72
strcpy(ExtraParam, param);
76
Output = FindFileAssociation(AssocParam, ExtraParam) ;
81
m1 = (int)strlen(Output);
82
CreateVarFromPtr(Rhs + 1, STRING_DATATYPE, &m1, &n1, &Output);
89
CreateVarFromPtr(Rhs + 1, MATRIX_OF_DOUBLE_DATATYPE, &n1, &m1, &l1);
97
102
/*--------------------------------------------------------------------------*/