Example #1
0
int slsh_interactive (void)
{
    Slsh_Quit = 0;

    (void) SLang_add_cleanup_function (close_interactive);

    if (-1 == open_interactive ())
        return -1;

    (void) SLang_run_hooks ("slsh_interactive_hook", 0);

    while (Slsh_Quit == 0)
    {
        if (SLang_get_error ())
        {
            SLang_restart(1);
            /* SLang_set_error (0); */
        }

        SLKeyBoard_Quit = 0;
        SLang_load_object (Readline_Load_Object);
    }
    close_interactive ();

    return 0;
}
Example #2
0
static int readline_intrinsic_internal (Slsh_Readline_Type *sri, char *prompt, int noecho)
{
    char *line;

    if (sri == NULL)
        sri = Intrinsic_Rline_Info;

#if USE_SLANG_READLINE
    if ((sri == NULL) && Use_Readline)
    {
        Intrinsic_Rline_Info = open_slsh_readline (NULL, SL_RLINE_BLINK_MATCH);
        if (Intrinsic_Rline_Info == NULL)
            return -1;
        (void) SLang_add_cleanup_function (close_intrinsic_readline);
        sri = Intrinsic_Rline_Info;
    }
#endif
    enable_keyboard_interrupt ();

    line = read_input_line (sri, prompt, noecho);
    if (noecho == 0)
        (void) save_input_line (sri, line);
    (void) SLang_push_malloced_string (line);
    return 0;
}
Example #3
0
int SLang_init_import (void)
{
#if SLANG_HAS_DYNAMIC_LINKING
   (void) SLang_add_cleanup_function (delete_handles);
   return SLadd_intrin_fun_table (Module_Intrins, "__IMPORT__");
#else
   return 0;
#endif
}
Example #4
0
static void register_at_exit_fun (void)
{
   static int is_registered = 0;
   if (is_registered)
     return;
   is_registered = 1;

#ifdef SLDEBUG_DOUT
   if (dout == NULL) dout = fopen ("malloc.out", "w");
#endif
   SLang_add_cleanup_function (SLmalloc_dump_statistics);
}