![]() |
Oyranos
git-devel
Oyranos is a full featured Color Management System
|
Oyjl argument handling. More...
#include <stddef.h>#include <stdlib.h>#include <stdio.h>#include <string.h>#include <ctype.h>#include <wchar.h>#include <stdarg.h>#include <math.h>#include <stdint.h>#include <sys/stat.h>#include <errno.h>#include <sys/types.h>#include <time.h>Macros | |
| #define | OYJL_ARGS_C |
| #define | OYJL_VERSION_A 1 |
Functions | |
| const char * | oyjlTermColor (oyjlTEXTMARK_e rgb, const char *text) |
| text formating for terminals More... | |
| char * | oyjlReadCommandF (int *size, const char *mode, void *(*alloc)(size_t), const char *format,...) |
| Read a stream from shell command. More... | |
| void | oyjlTranslation_Release (oyjlTranslation_s **context_) |
| get flags More... | |
| oyjlTranslation_s * | oyjlTranslation_New (const char *loc, const char *domain, oyjl_val *catalog, oyjlTranslate_f translator, void *user_data, void(*deAlloc)(void *), int flags) |
| create i18n context More... | |
| const char * | oyjlTranslation_GetDomain (oyjlTranslation_s *context) |
| get domain More... | |
| const char * | oyjlTranslation_GetLang (oyjlTranslation_s *context) |
| get catalog lang More... | |
| void | oyjlTranslation_SetFlags (oyjlTranslation_s *context, int flags) |
| change flags More... | |
| oyjlTranslation_s * | oyjlTranslation_Get (const char *domain) |
| get message translation context More... | |
| void | oyjlLibRelease () |
| Reset and free all resources. More... | |
| void | oyjlTreeFree (oyjl_val v) |
| void | oyjlTranslation_SetLocale (oyjlTranslation_s *context, const char *loc) |
| change language More... | |
| const char * | oyjlLang (const char *loc) |
| change language More... | |
| int | oyjlTermColorInit (int flags) |
| setup 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... | |
Oyjl argument handling.
oyjl - UI helpers
Copyright (c) 2018-2022 Kai-Uwe Behrmann ku.b@gmx.de
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
| #define OYJL_ARGS_C |
This file can be included alone without any other file from the project. Then it provides init, i18n, i/o and cli parsing capabilities. With the OYJL_ARGS_BASE macro set, it omits init and i18n for smaller code. That might be helpful, in case init and i18n are provided by other means. The functionality fits then the oyjl_args_base.h header file and the libOyjlArgsBase shared library.
| #define OYJL_VERSION_A 1 |
version variable
| enum oyjlMSG_e |
| enum oyjlOBJECT_e |
| enum oyjlOPTIONSTATE_e |
| enum oyjlOPTIONTYPE_e |
| enum oyjlTEXTMARK_e |
| enum oyjlVARIABLETYPE_e |
| Enumerator | |
|---|---|
| oyjlNONE | no variable given, will be asked later with oyjlOptions_GetResult() |
| oyjlSTRING | pointer to a array of char |
| oyjlDOUBLE | IEEE floating point number with double precission |
| oyjlINT | integer number declared as int |
| const char * oyjlLang | ( | const char * | loc | ) |
change language
Call after oyjlTr().
| loc | locale name as from setlocale("")
|
References oyjlBT(), and oyjlTranslation_GetDomain().
| char * oyjlReadCommandF | ( | int * | size, |
| const char * | mode, | ||
| void *(*)(size_t) | alloc, | ||
| const char * | format, | ||
| ... | |||
| ) |
Read a stream from shell command.
References OYJL_CREATE_VA_STRING.
| oyjlTranslation_s * oyjlTranslation_Get | ( | const char * | domain | ) |
get message translation context
| domain | select domain of library or application |
| const char * oyjlTranslation_GetDomain | ( | oyjlTranslation_s * | context | ) |
get domain
Referenced by oyjlLang().
| const char * oyjlTranslation_GetLang | ( | oyjlTranslation_s * | context | ) |
get catalog lang
Fall back to loc from oyjlTranslation_New() otherwise NULL.
| oyjlTranslation_s * oyjlTranslation_New | ( | const char * | loc, |
| const char * | domain, | ||
| oyjl_val * | catalog, | ||
| oyjlTranslate_f | translator, | ||
| void * | user_data, | ||
| void(*)(void *) | deAlloc, | ||
| int | flags | ||
| ) |
create i18n context
The passed in catalog shall contain its translations in the "org/freedesktop/oyjl/translations/loc" path.
| loc | locale name as from setlocale(0,""), the special locale "back" will inverse the translation; optional | |
| translator | the function; optional | |
| catalog | the parsed catalog as tree; optional | |
| user_data | optional | |
| deAlloc | free user_data on oyjlTranslation_Release(); optional | |
| [in] | flags | supported:
|
| void oyjlTranslation_Release | ( | oyjlTranslation_s ** | context_ | ) |
get flags
Referenced by oyjlLibRelease().
| void oyjlTranslation_SetFlags | ( | oyjlTranslation_s * | context, |
| int | flags | ||
| ) |
change flags
| context | the translation context |
| flags | translation flags |
| void oyjlTranslation_SetLocale | ( | oyjlTranslation_s * | context, |
| const char * | loc | ||
| ) |
change language
| context | the translation context |
| loc | locale name as from setlocale("")
|
| OYJL_API void oyjlTreeFree | ( | oyjl_val | v | ) |
Free a parse tree returned by oyjlTreeParse().
| v | Pointer to a JSON value returned by oyjlTreeParse(). Passing NULL is valid and results in a no-op. |
1.8.13