~ubuntu-branches/ubuntu/lucid/scilab/lucid

« back to all changes in this revision

Viewing changes to modules/windows_tools/src/c/winopen.c

  • Committer: Bazaar Package Importer
  • Author(s): Sylvestre Ledru
  • Date: 2009-04-28 18:47:03 UTC
  • mfrom: (1.1.7 upstream) (4.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090428184703-7thddz8vtwqmxmx2
Tags: 5.1.1-4
* librefblas3-dev does not exist (yet). Thanks to Jose Ramon
* Do not stop when ocamlopt is not available on the arch 
  (ocaml-not-available.diff)
* Provide a clear error message for archs where modelicac compiler is 
  not available (modelicac-not-available.diff)
* scilab startup script moved from package scilab => scilab-bin (because of
  the ocamlopt problem, I cannot predict if modelicac will be available or
  not. Therefor, I ship usr/bin/ instead of binary per binary. This will
  also simplifies the packaging of Scilab 5.2)

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
*/
12
12
 
13
13
/*--------------------------------------------------------------------------*/
 
14
#include <stdio.h>
14
15
#include <Windows.h>
15
16
#include "winopen.h"
16
17
#include "cluni0.h"
17
18
#include "Scierror.h"
18
 
/*--------------------------------------------------------------------------*/
19
 
#ifndef FILENAME_MAX
20
 
#define FILENAME_MAX 4096
21
 
#endif
 
19
#include "PATH_MAX.h"
22
20
/*--------------------------------------------------------------------------*/
23
21
BOOL winopen(char *scilabfilename)
24
22
{
25
23
        BOOL bOK = FALSE;
26
 
        char filename[FILENAME_MAX];
 
24
        char filename[PATH_MAX + FILENAME_MAX];
27
25
        int out_n = 0;
28
26
        long int lout = 0;
29
27
        HINSTANCE error = NULL;
30
28
 
31
 
        lout = FILENAME_MAX;
 
29
        lout = PATH_MAX + FILENAME_MAX;
32
30
        C2F(cluni0)(scilabfilename, filename, &out_n,(int)strlen(scilabfilename),lout);
33
31
        error = ShellExecute(NULL, "open", filename, NULL, NULL, SW_SHOWNORMAL);
34
32
        if ( error <= (HINSTANCE)32) bOK = FALSE;