cmdline (merge-intel): replace harcoded return values with defines
[libcmdline.git] / src / lib / cmdline_rdline.h
index 702a0ab..1129cb8 100644 (file)
@@ -208,13 +208,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