Re: [dwm] dietline - minimalistic readline implementation

From: Enno \ <gottox_AT_gmail.com>
Date: Wed, 23 Jan 2008 15:13:28 +0100

Very nice idea. What about collecting all these "baseutilities" and
put them on suckless.org? If we can write more utilities we may get a
complete suckless userspace... :)

2008/1/23, pancake <pancake_AT_youterm.com>:
> Oops I forgot to say that it supports a dmenu-mode (this code inherits from
> the old eread program I send to the list few months ago).
>
> Usage is quite simple:
>
> int main(int argc, char **argv)
> {
> char *ret;
>
> dl_init();
> dl_prompt = "$ ";
>
> do {
> ret = dl_readline(argc, argv);
> if (ret) {
> printf(" [line] '%s'\n", ret);
> dl_hist_add(ret);
> }
> } while(ret!=NULL);
>
> dl_free();
> }
>
> Have fun!
>
>
> --pancake
>
> On Wed, Jan 23, 2008 at 04:31:57PM +0100, pancake wrote:
> > As I request in a previous mail I have developed a readline-like
> > library in a minimalistic way avoiding the unnecessary overhead
> > and dependency with a single portable c file.
> >
> > I have tested this on NetBSD, GNU/linux and native w32 and works
> > pretty fine.
> >
> > The library currently supports autocompletion of a single word
> > using argc, argv (this is just a PoC). Allows to change the prompt,
> > and change some configuration stuff for it.
> >
> > No vi or emacs mode yet (should i read inputrc?).
> >
> > Current support:
> >
> > - history log
> > - navigate history with ^n/^p or up/down keys
> > - autocompletion for one keyword (no nested yet)
> > - tab key hooked for autocompletion
> > - support to change the prompt
> > - handle ^C and ^D
> >
> > You can download the implementation here:
> >
> > http://news.nopcode.org/dietline.c
> >
> > To test it on w32 just put __UNIX__ to 0 and __WINDOWS__ to 1 :)
> >
> > $ gcc dietline.c
> > $ ./a.out foo bar foobar foocowblob foocowguai
> > = foo<tab>
> > foo foobar foocowblob foocowguai
> > = foocow<tab>
> > foocowblob foocowguai
> > = foocowb<tab>
> > = foocowblob
> >
> > I plan to use this library instead of readline for radare (radare.nopcode.org)
> > so I plan to continue working on it.
> >
> > Patches and ideas are welcome.
> >
> > --pancake
> >
>
>

-- 
http://www.gnuffy.org - Real Community Distro
http://www.gnuffy.org/index.php/GnuEm - Gnuffy on Ipaq (Codename Peggy)
Received on Wed Jan 23 2008 - 15:13:32 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:16:53 UTC