diff options
author | krakjoe <joe.watkins@live.co.uk> | 2013-11-24 17:50:22 +0000 |
---|---|---|
committer | krakjoe <joe.watkins@live.co.uk> | 2013-11-24 17:50:22 +0000 |
commit | c85f247eacccec99d531109732bb3ba757806ecc (patch) | |
tree | a3bfdd34b34c550f1d312868817fef90f40ab3dc /phpdbg_utils.h | |
parent | bb134a40593b9b9556ff4db9c697bc3b6fc68806 (diff) | |
download | php-git-c85f247eacccec99d531109732bb3ba757806ecc.tar.gz |
make api function and format structure for color management
Diffstat (limited to 'phpdbg_utils.h')
-rw-r--r-- | phpdbg_utils.h | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/phpdbg_utils.h b/phpdbg_utils.h index b014319041..07ff8712a4 100644 --- a/phpdbg_utils.h +++ b/phpdbg_utils.h @@ -20,16 +20,31 @@ #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 */ -int phpdbg_is_numeric(const char*); -int phpdbg_is_empty(const char*); -int phpdbg_is_addr(const char*); -int phpdbg_is_class_method(const char*, size_t, char**, char**); -const char *phpdbg_current_file(TSRMLS_D); -char *phpdbg_resolve_path(const char* TSRMLS_DC); -char *phpdbg_trim(const char*, size_t, size_t*); +PHPDBG_API int phpdbg_is_numeric(const char*); +PHPDBG_API int phpdbg_is_empty(const char*); +PHPDBG_API int phpdbg_is_addr(const char*); +PHPDBG_API int phpdbg_is_class_method(const char*, size_t, char**, char**); +PHPDBG_API const char *phpdbg_current_file(TSRMLS_D); +PHPDBG_API char *phpdbg_resolve_path(const char* TSRMLS_DC); +PHPDBG_API char *phpdbg_trim(const char*, size_t, size_t*); /** * Error/notice/formatting helper @@ -43,9 +58,9 @@ enum { }; #ifdef ZTS -int phpdbg_print(int TSRMLS_DC, FILE*, const char*, ...) PHP_ATTRIBUTE_FORMAT(printf, 4, 5); +PHPDBG_API int phpdbg_print(int TSRMLS_DC, FILE*, const char*, ...) PHP_ATTRIBUTE_FORMAT(printf, 4, 5); #else -int phpdbg_print(int TSRMLS_DC, FILE*, const char*, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPDBG_API int phpdbg_print(int TSRMLS_DC, FILE*, const char*, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); #endif #define phpdbg_error(fmt, ...) phpdbg_print(P_ERROR TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT], fmt, ##__VA_ARGS__) |