picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

readline.l (436B)


      1 # 05dec08abu
      2 # (c) Software Lab. Alexander Burger
      3 
      4 (load "@lib/gcc.l")
      5 
      6 (gcc "readline" '("-lreadline") '_led)
      7 
      8 #include <readline/readline.h>
      9 #include <readline/history.h>
     10 
     11 any _led(any ex __attribute__((unused))) {
     12    char *p;
     13    any x;
     14 
     15    rl_already_prompted = YES;
     16    if ((p = readline(": ")) && *p)
     17       add_history(p);
     18    x = mkStr(p);
     19    free(p);
     20    return x;
     21 }
     22 
     23 /**/
     24 
     25 # Enable line editing
     26 (de *Led (_led))
     27 
     28 # vi:et:ts=3:sw=3