Doc fixes.
[bertos.git] / mware / readline.h
index 8bf95d1d40c8377a1a047a9d1103c747eb2fdc22..9219bfd7945e6931d8ea498edaaf19534a41953f 100644 (file)
  * \author Giovanni Bajo <rasky@develer.com>
  */
 
-/*#*
- *#* $Log$
- *#* Revision 1.2  2006/07/19 12:56:28  bernie
- *#* Convert to new Doxygen style.
- *#*
- *#* Revision 1.1  2006/06/01 12:27:39  marco
- *#* Added utilities for protocols
- *#*
- *#*/
 
 #ifndef MWARE_READLINE_H
 #define MWARE_READLINE_H
@@ -67,6 +58,7 @@
 typedef int (*getc_hook)(void* user_data);
 typedef void (*putc_hook)(char ch, void* user_data);
 typedef const char* (*match_hook)(void* user_data, const char* word, int word_len);
+typedef void (*clear_hook)(void* user_data);
 
 struct RLContext
 {
@@ -79,11 +71,15 @@ struct RLContext
        match_hook match;
        void* match_param;
 
+       clear_hook clear;
+       void* clear_param;
+
        const char* prompt;
 
        char real_history[HISTORY_SIZE];
        char* history;
        size_t history_pos;
+       size_t line_pos;
 };
 
 INLINE void rl_init_ctx(struct RLContext *ctx)
@@ -108,6 +104,9 @@ INLINE void rl_sethook_put(struct RLContext* ctx, putc_hook put, void* put_param
 INLINE void rl_sethook_match(struct RLContext* ctx, match_hook match, void* match_param)
 { ctx->match = match; ctx->match_param = match_param; }
 
+INLINE void rl_sethook_clear(struct RLContext* ctx, clear_hook clear, void* clear_param)
+{ ctx->clear = clear; ctx->clear_param = clear_param; }
+
 INLINE void rl_setprompt(struct RLContext* ctx, const char* prompt)
 { ctx->prompt = prompt; }