コード例 #1
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;
}
コード例 #2
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;
}