File: DisableInteractiveMode.c

package info (click to toggle)
scilab 5.5.2-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 339,404 kB
  • ctags: 71,193
  • sloc: xml: 766,922; ansic: 295,260; java: 187,853; fortran: 155,904; cpp: 67,546; ml: 24,107; sh: 23,715; tcl: 14,792; makefile: 8,328; perl: 1,566; php: 690; cs: 614
file content (45 lines) | stat: -rw-r--r-- 1,172 bytes parent folder | download | duplicates (2)
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
/*
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) DIGITEO - 2009 - Sylvestre LEDRU
 *
 * This file is released under the 3-clause BSD license. See COPYING-BSD.
 *
 */
#include <stdio.h>
#include <string.h>

#include "call_scilab.h" /* Provide functions to call Scilab engine */

/*------------------------------------------------------------*/
int main(void)
{
#ifdef _MSC_VER
    if ( StartScilab(NULL, NULL, NULL) == FALSE )
#else
    if ( StartScilab(getenv("SCI"), NULL, NULL) == FALSE )
#endif
    {
        fprintf(stderr, "Error while calling StartScilab\n");
        return -1;
    }

    DisableInteractiveMode();
    int code = SendScilabJob("plot3d()"); /* This will failed since plot3d is
										   among the disable features*/
    if (code != 0)
    {
        char lastjob[4096];
        if (GetLastJob(lastjob, 4096))
        {
            printf("Failed command: %s\n", lastjob);
        }
    }

    if ( TerminateScilab(NULL) == FALSE )
    {
        fprintf(stderr, "Error while calling TerminateScilab\n");
        return -2;
    }
    return 0;
}
/*------------------------------------------------------------*/