[dwm] dietline - minimalistic readline implementation

From: pancake <pancake_AT_youterm.com>
Date: Wed, 23 Jan 2008 16:31:57 +0100

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
Received on Wed Jan 23 2008 - 14:53:56 UTC

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