![]() |
Oyranos
git-devel
Oyranos is a full featured Color Management System
|
Internationalisation, Terminal colors, I/O and String Handling. More...
|
Modules | |
| OyjlCore Internationalisation | |
| Language support and Translations for UI's. | |
| OyjlCore I/O | |
| File I/O. | |
| OyjlCore String | |
| String Handling. | |
Macros | |
| #define | OYJL_NO_BACKTRACE 0x02 |
| skip oyjlBT() output More... | |
| #define | OYJL_WRAP 0x1000 |
| wrap into format specifix code More... | |
| #define | OYJL_FORCE_COLORTERM 0x01 |
| skip environment checks and mark More... | |
| #define | OYJL_FORCE_NO_COLORTERM 0x02 |
| skip environment checks and do not mark More... | |
| #define | OYJL_RESET_COLORTERM 0x04 |
| skip cached checks and init again More... | |
Typedefs | |
| typedef int(* | oyjlMessage_f) (int error_code, const void *context, const char *format,...) |
| custom message function type More... | |
Enumerations | |
| enum | oyjlTEXTMARK_e { , oyjlNO_MARK = 1, oyjlRED, oyjlGREEN, oyjlBLUE, oyjlBOLD, oyjlITALIC, oyjlUNDERLINE } |
| types of terminal color markers More... | |
| enum | oyjlMSG_e { , oyjlMSG_INFO = 400, oyjlMSG_CLIENT_CANCELED, oyjlMSG_INSUFFICIENT_DATA, oyjlMSG_ERROR, oyjlMSG_PROGRAM_ERROR, oyjlMSG_SECURITY_ALERT } |
| message type More... | |
Functions | |
| int | oyjlTermColorInit (int flags) |
| setup formating for terminals More... | |
| const char * | oyjlTermColor (oyjlTEXTMARK_e rgb, const char *text) |
| text formating for terminals More... | |
| const char * | oyjlTermColorF (oyjlTEXTMARK_e rgb, const char *format,...) |
| variable text formating for terminals More... | |
| const char * | oyjlTermColorFPtr (oyjlTEXTMARK_e rgb, char **color_text, const char *format,...) |
| variable text formating for terminals More... | |
| const char * | oyjlTermColorFromHtml (const char *text, int flags) |
| convert a subset of HTML to terminal colors More... | |
| const char * | oyjlTermColorToHtml (const char *text, int flags) |
| convert internal used terminal colors to HTML More... | |
| void | oyjlDebugVariableSet (int *debug) |
| set own debug variable More... | |
| char * | oyjlBT (int stack_limit OYJL_UNUSED) |
| backtrace More... | |
| const char * | oyjlPrintTime (int flags, oyjlTEXTMARK_e mark) |
| print current date time More... | |
| const char * | oyjlTermColorToPlain (const char *text, int flags) |
| remove term color marks More... | |
| int | oyjlMessageFuncSet (oyjlMessage_f message_func) |
| set a custom message listener More... | |
| int | oyjlMessageFunc (int error_code, const void *context_object OYJL_UNUSED, const char *format,...) |
| the default message handler to stderr More... | |
Internationalisation, Terminal colors, I/O and String Handling.
The oyjlTermColor() function family provides text marking on terminal for command line interfaces.
A custom message function can be set by oyjlMessageFuncSet(). The default error function will print to stderr.
| #define OYJL_FORCE_COLORTERM 0x01 |
skip environment checks and mark
| #define OYJL_FORCE_NO_COLORTERM 0x02 |
skip environment checks and do not mark
| #define OYJL_NO_BACKTRACE 0x02 |
skip oyjlBT() output
| #define OYJL_RESET_COLORTERM 0x04 |
skip cached checks and init again
Referenced by oyjlTermColorInit().
| #define OYJL_WRAP 0x1000 |
wrap into format specifix code
| typedef int(* oyjlMessage_f) (int error_code, const void *context, const char *format,...) |
custom message function type
| error_code | oyjlMSG_e codes and possibly own defined ones |
| context | user defined data |
| format | your text |
| enum oyjlMSG_e |
| enum oyjlTEXTMARK_e |
| char* oyjlBT | ( | int stack_limit | OYJL_UNUSED | ) |
backtrace
Create backtrace of execution stack. Honour OYJL_NO_BACKTRACE environment variable.
| [in] | stack_limit | set limit of stack depth |
Referenced by oyImage_s::oyImage_WriteCUBE(), oyjlLang(), and oyjlTreeDeSerialise().
| void oyjlDebugVariableSet | ( | int * | debug | ) |
set own debug variable
| int oyjlMessageFunc | ( | int | error_code, |
| const void *context_object | OYJL_UNUSED, | ||
| const char * | format, | ||
| ... | |||
| ) |
the default message handler to stderr
| error_code | oyjlMSG_e codes |
| context_object | not used |
| format | your text |
| int oyjlMessageFuncSet | ( | oyjlMessage_f | message_func | ) |
set a custom message listener
| const char * oyjlPrintTime | ( | int | flags, |
| oyjlTEXTMARK_e | mark | ||
| ) |
print current date time
Create a static string to contain ISO conforming date/time string.
| [in] | flags | 0 default so ISO dateTtime+-TimeZoneDiff == OYJL_DATE | OYJL_TIME | OYJL_OYJL_TIME_ZONE_DIFF
|
| [in] | mark | set text marking |
One can use OYJL_BRACKETS alone and has dateTtime+-TimeZoneDiff included.
One can use OYJL_TIME_ZONE or OYJL_TIME_ZONE_DIFF alone and has dateTtime included.
| const char * oyjlTermColor | ( | oyjlTEXTMARK_e | rgb, |
| const char * | text | ||
| ) |
text formating for terminals
Input text can be up to 200 chars wide. The returned text is cached. So copy or flush the text before reusing this function.
Referenced by oyjlTreeToYaml().
| const char * oyjlTermColorF | ( | oyjlTEXTMARK_e | rgb, |
| const char * | format, | ||
| ... | |||
| ) |
variable text formating for terminals
References OYJL_CREATE_VA_STRING.
| const char * oyjlTermColorFPtr | ( | oyjlTEXTMARK_e | rgb, |
| char ** | color_text, | ||
| const char * | format, | ||
| ... | |||
| ) |
variable text formating for terminals
References OYJL_CREATE_VA_STRING.
| const char * oyjlTermColorFromHtml | ( | const char * | text, |
| int | flags | ||
| ) |
convert a subset of HTML to terminal colors
The supported codes are "<strong>", "<em>", "<u>" and " ".
References oyjlTermColorInit().
| int oyjlTermColorInit | ( | int | flags | ) |
setup formating for terminals
| [in] | flags | support |
References OYJL_OBSERVE, and OYJL_RESET_COLORTERM.
Referenced by oyjlTermColorFromHtml().
| const char * oyjlTermColorToHtml | ( | const char * | text, |
| int | flags | ||
| ) |
convert internal used terminal colors to HTML
Support OYJL_WRAP in flags
References oyjlStr_New(), oyjlStr_Push(), and oyjlStr_Replace().
| const char* oyjlTermColorToPlain | ( | const char * | text, |
| int flags | |||
| ) |
remove term color marks
The OYJL_REGEXP flag uses: int count = oyjlRegExpReplace( &t, "\033[[0-9;]*m", "" ); .
| [in] | text | input |
| [in] | flags | support OYJL_REGEXP slower but work as well outside Oyjl |
References OYJL_REGEXP, oyjlRegExpReplace(), and oyjlStringCopy().
1.8.13