cmdline (merge-intel): remove duplicated definitions of vt100 codes
[libcmdline.git] / src / lib / cmdline_rdline.h
index 702a0ab..1118b29 100644 (file)
 #include <cmdline_cirbuf.h>
 #include <cmdline_vt100.h>
 
-#define vt100_bell         "\007"
-#define vt100_bs           "\010"
-#define vt100_bs_clear     "\010 \010"
-#define vt100_tab          "\011"
-#define vt100_crnl         "\012\015"
-#define vt100_clear_right  "\033[0K"
-#define vt100_clear_left   "\033[1K"
-#define vt100_clear_down   "\033[0J"
-#define vt100_clear_up     "\033[1J"
-#define vt100_clear_line   "\033[2K"
-#define vt100_clear_screen "\033[2J"
-#define vt100_up_arr       "\033\133\101"
-#define vt100_down_arr     "\033\133\102"
-#define vt100_right_arr    "\033\133\103"
-#define vt100_left_arr     "\033\133\104"
-#define vt100_multi_right  "\033\133%uC"
-#define vt100_multi_left   "\033\133%uD"
-#define vt100_suppr        "\033\133\063\176"
-#define vt100_home         "\033M\033E"
-#define vt100_word_left    "\033\142"
-#define vt100_word_right   "\033\146"
-
 /* configuration */
 #define RDLINE_BUF_SIZE 256
 #define RDLINE_PROMPT_SIZE  32
@@ -208,13 +186,20 @@ void rdline_restart(struct rdline *rdl);
 void rdline_redisplay(struct rdline *rdl);
 
 
+/* return status for rdline_char_in() */
+#define RDLINE_RES_SUCCESS       0
+#define RDLINE_RES_VALIDATED     1
+#define RDLINE_RES_COMPLETE      2
+#define RDLINE_RES_NOT_RUNNING  -1
+#define RDLINE_RES_EOF          -2
+
 /**
  * append a char to the readline buffer.
- * Return 1 when the line has been validated.
- * Return 2 when the user asked to complete the buffer.
- * Return -1 if it is not running.
- * Return -2 if EOF (ctrl-d on an empty line).
- * Else return 0.
+ * Return RDLINE_RES_VALIDATE when the line has been validated.
+ * Return RDLINE_RES_COMPLETE when the user asked to complete the buffer.
+ * Return RDLINE_RES_NOT_RUNNING if it is not running.
+ * Return RDLINE_RES_EOF if EOF (ctrl-d on an empty line).
+ * Else return RDLINE_RES_SUCCESS.
  * XXX error case when the buffer is full ?
  *
  * \param rdl A pointer to a struct rdline