Exemple #1
0
int jsi_SignalInit(Jsi_Interp *interp)
{
    static int isinit = 0;
    if (!isinit) {
        sigloc = &interp->sigmask;
        isinit = 1;
    }
    Jsi_CommandCreateSpecs(interp, "Signal",    signalCmds,    NULL, JSI_CMDSPEC_NOTOBJ);
    return JSI_OK;
}
Exemple #2
0
int jsi_Initsignal(Jsi_Interp *interp)
{
    static int isinit = 0;
    //interp->signal_set_result = signal_set_sigmask_result;
    if (!isinit) {
        sigloc = &interp->sigmask;
        isinit = 1;
    }
    Jsi_CommandCreateSpecs(interp, "signal",    signalCmds,    NULL, JSI_CMDSPEC_NOTOBJ);
    return JSI_OK;
}
Exemple #3
0
int jsi_NumberInit(Jsi_Interp *interp)
{
    Jsi_Value *val, *global = interp->csc;
    val = interp->Number_prototype = Jsi_CommandCreateSpecs(interp, "Number", numberCmds, NULL, 0);

    Jsi_Value *NaN = Jsi_ValueMakeNumber(interp, NULL, jsi_ieee_makenan());

    Jsi_Value *Inf = Jsi_ValueMakeNumber(interp, NULL, jsi_ieee_makeinf(1));
    
    Jsi_ValueInsertFixed(interp, global, "NaN", NaN);
    Jsi_ValueInsertFixed(interp, global, "Infinity", Inf);
    interp->NaNValue = NaN;
    interp->InfValue = Inf;
#define MCONST(name,v) Jsi_ValueInsert(interp, val, name, Jsi_ValueNewNumber(interp, v), JSI_OM_READONLY)
    MCONST("MAX_VALUE", DBL_MAX);
    MCONST("MIN_VALUE", DBL_MIN);
    MCONST("NEGATIVE_INFINITY", jsi_ieee_makeinf(-1));
    Jsi_ValueInsertFixed(interp, val, "POSITIVE_INFINITY", Inf);
    Jsi_ValueInsertFixed(interp, val, "NaN", NaN);
    return JSI_OK;
}
Exemple #4
0
int jsi_BooleanInit(Jsi_Interp *interp)
{
    interp->Boolean_prototype = Jsi_CommandCreateSpecs(interp, "Boolean", booleanCmds, NULL, 0);
    return JSI_OK;
}