summaryrefslogtreecommitdiff
path: root/phpdbg_utils.h
diff options
context:
space:
mode:
authorkrakjoe <joe.watkins@live.co.uk>2013-11-24 19:34:18 +0000
committerkrakjoe <joe.watkins@live.co.uk>2013-11-24 19:34:18 +0000
commitddcfa42f15217d8e8e21248cc5c7e1ee2007e7f6 (patch)
tree2bc89b90458ae52d810eb7ab597e7d200195cc37 /phpdbg_utils.h
parentc85f247eacccec99d531109732bb3ba757806ecc (diff)
downloadphp-git-ddcfa42f15217d8e8e21248cc5c7e1ee2007e7f6.tar.gz
get good control over colors and prompt
Diffstat (limited to 'phpdbg_utils.h')
-rw-r--r--phpdbg_utils.h42
1 files changed, 27 insertions, 15 deletions
diff --git a/phpdbg_utils.h b/phpdbg_utils.h
index 07ff8712a4..18b6a47141 100644
--- a/phpdbg_utils.h
+++ b/phpdbg_utils.h
@@ -20,21 +20,6 @@
#ifndef PHPDBG_UTILS_H
#define PHPDBG_UTILS_H
-/* {{{ color management */
-#define PHPDBG_COLOR_LEN 12
-#define PHPDBG_COLOR_D(color, code) \
- {color, sizeof(color), code}
-#define PHPDBG_COLOR_END \
- {NULL, 0L, {0}}
-
-typedef struct _phpdbg_color_t {
- char *name;
- size_t name_length;
- const char code[PHPDBG_COLOR_LEN];
-} phpdbg_color_t;
-
-PHPDBG_API const phpdbg_color_t* phpdbg_get_color(const char *name, size_t name_length); /* }}} */
-
/**
* Input scan functions
*/
@@ -90,4 +75,31 @@ PHPDBG_API int phpdbg_print(int TSRMLS_DC, FILE*, const char*, ...) PHP_ATTRIBUT
/* {{{ For separation */
#define SEPARATE "------------------------------------------------" /* }}} */
+/* {{{ Color Management */
+#define PHPDBG_COLOR_LEN 12
+#define PHPDBG_COLOR_D(color, code) \
+ {color, sizeof(color)-1, code}
+#define PHPDBG_COLOR_END \
+ {NULL, 0L, {0}}
+
+#define PHPDBG_COLOR_INVALID -1
+#define PHPDBG_COLOR_PROMPT 0
+#define PHPDBG_COLOR_ERROR 1
+#define PHPDBG_COLOR_NOTICE 2
+#define PHPDBG_COLORS 3
+
+typedef struct _phpdbg_color_t {
+ char *name;
+ size_t name_length;
+ const char code[PHPDBG_COLOR_LEN];
+} phpdbg_color_t;
+
+PHPDBG_API const phpdbg_color_t* phpdbg_get_color(const char *name, size_t name_length TSRMLS_DC);
+PHPDBG_API void phpdbg_set_color(int element, const phpdbg_color_t *color TSRMLS_DC);
+PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length TSRMLS_DC); /* }}} */
+
+/* {{{ Prompt Management */
+PHPDBG_API void phpdbg_set_prompt(const char* TSRMLS_DC);
+PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D); /* }}} */
+
#endif /* PHPDBG_UTILS_H */