コード例 #1
0
ファイル: gw_integer.c プロジェクト: rossdrummond/scilab
/*--------------------------------------------------------------------------*/
int gw_integer(void)
{  
    if(pvApiCtx == NULL)
	{
		pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
	}

	pvApiCtx->pstName = (char*)Tab[Fin-1].name;

#ifdef _MSC_VER
#ifndef _DEBUG
    if  ( BuildWithVS8ExpressF2C() )
    {
        /* Bug 4123 F2C code (i_prod.f) returns a wrong exception after callFunctionFromGateway */
        /* and it crashs with release mode */
        /* workaround disabled callFunctionFromGateway and call function without check */
        if (*(Tab[Fin-1].f) != NULL) (*(Tab[Fin-1].f)) ((char*)Tab[Fin-1].name,(unsigned long)strlen(Tab[Fin-1].name));
    }
    else
#endif
#endif
    {
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
    }
	return 0;
}
コード例 #2
0
ファイル: gw_ui_data.c プロジェクト: rossdrummond/scilab
/*--------------------------------------------------------------------------*/
int gw_ui_data(void)
{
	Rhs = Max(0, Rhs);

	if ( getScilabMode() == SCILAB_NWNI)
	{
		Scierror(999,_("Scilab '%s' module disabled in -nogui or -nwni mode.\n"), "ui_data");
		return 0;
	}

/*	if (!loadedDep)
	{
		loadOnUseClassPath("ui_data");
		loadedDep = TRUE;
	}
*/

    if(pvApiCtx == NULL)
	{
		pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
	}

	pvApiCtx->pstName = (char*)Tab[Fin-1].name;
	callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
	return 0;
}
コード例 #3
0
ファイル: gw_xcos.c プロジェクト: ASP1234/Scilabv5.5.2
/*--------------------------------------------------------------------------*/
int gw_xcos(void)
{
    Rhs = Max(0, Rhs);

    if (getScilabMode() == SCILAB_NWNI)
    {
        Scierror(999, _("Scilab '%s' module disabled in -nogui or -nwni mode.\n"), "xcos");
        return 0;
    }

    if (!loadedDep              // never reload
            && Tab[Fin - 1].f != sci_closeXcosFromScilab)   // do not load on close
    {
        loadOnUseClassPath("Xcos");
        loadedDep = TRUE;
    }


    if (pvApiCtx == NULL)
    {
        pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
    }

    pvApiCtx->pstName = (char*)Tab[Fin - 1].name;
    callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
    return 0;
}
コード例 #4
0
ファイル: gw_call_scilab.c プロジェクト: ZhanlinWang/scilab
/*--------------------------------------------------------------------------*/
int gw_call_scilab(void)
{
    if (pvApiCtx == NULL)
    {
        pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
    }

    pvApiCtx->pstName = (char*)Tab[Fin - 1].name;
    callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
    return 0;
}
コード例 #5
0
/*--------------------------------------------------------------------------*/
int gw_interpolation(void)
{
	Rhs = Max(0, Rhs);

    if(pvApiCtx == NULL)
	{
		pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
	}

	pvApiCtx->pstName = (char*)Tab[Fin-1].name;
	callFunctionFromGateway(Tab,SIZE_CURRENT_GENERIC_TABLE(Tab));
	return 0;
}
コード例 #6
0
/*--------------------------------------------------------------------------*/
int gw_graphic_objects(void)
{
	Rhs = Max(0, Rhs);

	if ( getScilabMode() == SCILAB_NWNI)
	{
		Scierror(999,_("Scilab '%s' module disabled in -nogui or -nwni mode.\n"), "graphic_objects");
		return 0;
	}

	callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
	return 0;
}
コード例 #7
0
ファイル: gw_graphics.c プロジェクト: tempbottle/scilab
/* interface for the previous function Table */
int gw_graphics(void)
{
    nbInputArgument(pvApiCtx) = Max(0, nbInputArgument(pvApiCtx));

    if (pvApiCtx == NULL)
    {
        pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
    }

    pvApiCtx->pstName = (char*)Tab[Fin - 1].name;
    if (getScilabMode() != SCILAB_NWNI)
    {
        if (!loadedDep)
        {
            loadOnUseClassPath("graphics");
            loadedDep = TRUE;
        }
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
    }
    else
    {
        if ((strcmp(Tab[Fin - 1].name, "set") == 0 ||
                strcmp(Tab[Fin - 1].name, "delete") == 0 ||
                strcmp(Tab[Fin - 1].name, "get") == 0) &&
                (getInputArgumentType(pvApiCtx, 1) == sci_tlist || getInputArgumentType(pvApiCtx, 1) == sci_mlist))
        {
            callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
            return 0;
        }
        else
        {
            Scierror(999, _("Scilab '%s' module disabled in -nogui or -nwni mode.\n"), "graphics");
        }
    }

    return 0;
}
コード例 #8
0
ファイル: gw_symbolic.c プロジェクト: rossdrummond/scilab
/*--------------------------------------------------------------------------*/
int gw_symbolic(void)
{
	if (Rhs != 2)
	{
		Scierror(39,_("%s: Wrong number of input arguments: %d expected.\n"),Tab[Fin-1].name, 2);
		return 0;
	}

    if(pvApiCtx == NULL)
	{
		pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
	}

	pvApiCtx->pstName = (char*)Tab[Fin-1].name;
	callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
	return 0;
}
コード例 #9
0
/*--------------------------------------------------------------------------*/
int gw_linear_algebra2(void)
{
    Rhs = Max(0, Rhs);

    if (pvApiCtx == NULL)
    {
        pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
    }

    pvApiCtx->pstName = (char*)Tab[Fin - 1].name;
    callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
    if (Err <= 0 && C2F(errgst).err1 <= 0)
    {
        PutLhsVar();
    }
    return 0;
}
コード例 #10
0
/*--------------------------------------------------------------------------*/
int gw_special_functions(void)
{
    Rhs = Max(0, Rhs);
    if (setjmp_slatec_jmp_env())
    {
        Scierror(999, "%s: Wrong value for input argument: Positive expected.\n", Tab[Fin - 1].name);
        return 0;
    }

    if (pvApiCtx == NULL)
    {
        pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
    }

    pvApiCtx->pstName = (char*)Tab[Fin - 1].name;
    callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
    return 0;
}
コード例 #11
0
/*--------------------------------------------------------------------------*/
int gw_data_structures2(void)
{
    Rhs=Max(Rhs,0);
    if (Top - Rhs + Lhs + 1 >= Bot)
    {
        static int codeerror = 18;
        SciError(codeerror);
        return 0;
    }

    if(pvApiCtx == NULL)
    {
        pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
    }

    pvApiCtx->pstName = (char*)Tab[Fin-1].name;
    callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
    return 0;
}
コード例 #12
0
ファイル: gw_jvm.c プロジェクト: rossdrummond/scilab
/*--------------------------------------------------------------------------*/
int gw_jvm(void)
{  
	Rhs = Max(0, Rhs);

    if(pvApiCtx == NULL)
	{
		pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
	}

	pvApiCtx->pstName = (char*)Tab[Fin-1].name;
	if ( (getScilabMode() != SCILAB_NWNI) )
	{
		callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));	
	}
	else
	{
		Scierror(999,_("JVM interface disabled in -nogui or -nwni modes.\n"));
	}

	return 0;
}
コード例 #13
0
ファイル: gw_io.c プロジェクト: ASP1234/Scilabv5.5.2
/*--------------------------------------------------------------------------*/
int gw_io(void)
{
    /* Recursion from a function */
    if (pvApiCtx == NULL)
    {
        pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
    }

    if ( isRecursionCallToFunction() )
    {
        switch ( getRecursionFunctionToCall() )
        {
            case RECURSION_CALL_SAVE:
            {
                pvApiCtx->pstName = "save";
                C2F(intsave)();
                return 0;
            }
            break;
            case RECURSION_CALL_LOAD:
            {
                pvApiCtx->pstName = "load";
                sci_load("load", (unsigned long)strlen("load"));
                return 0;
            }
            break;
            default:
                break;
        }
    }
    else
    {
        Rhs = Max(0, Rhs);
        pvApiCtx->pstName = (char*)Tab[Fin - 1].name;
        callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
    }
    return 0;
}
コード例 #14
0
ファイル: gw_functions.c プロジェクト: rossdrummond/scilab
/*--------------------------------------------------------------------------*/
int gw_functions(void)
{  
	Rhs = Max(0, Rhs);

	if ( isRecursionCallToFunction() )
	{
		switch ( getRecursionFunctionToCall() )
		{
			case RECURSION_CALL_DEFF:
				#define deff_fname "deff"
				C2F(sci_deff)(deff_fname,(unsigned long)strlen(deff_fname));
				return 0;

			case RECURSION_CALL_EXEC1: case RECURSION_CALL_EXEC2:
				#define exec_fname "exec"
				C2F(sci_exec)(exec_fname,(unsigned long)strlen(exec_fname));
				return 0;

			case RECURSION_CALL_EXECSTR:
				#define execstr_fname "execstr"
				C2F(sci_execstr)(execstr_fname,(unsigned long)strlen(execstr_fname));
				return 0;

			default:
				return 0;
		}
	}
	
	if(pvApiCtx == NULL)
	{
		pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
	}

	pvApiCtx->pstName = (char*)Tab[Fin-1].name;
	callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
	return 0;
}