|
gwenhywfar 5.12.0
|
#include <gwenhywfar/gwenhywfarapi.h>#include <gwenhywfar/types.h>#include <gwenhywfar/logger.h>#include <gwenhywfar/buffer.h>#include <stdio.h>

Go to the source code of this file.
Macros | |
| #define | GWEN_TEXT_FLAGS_CHECK_BACKSLASH 0x00000040 |
| #define | GWEN_TEXT_FLAGS_DEL_LEADING_BLANKS 0x00000001 |
| #define | GWEN_TEXT_FLAGS_DEL_MULTIPLE_BLANKS 0x00000004 |
| #define | GWEN_TEXT_FLAGS_DEL_QUOTES 0x00000020 |
| #define | GWEN_TEXT_FLAGS_DEL_TRAILING_BLANKS 0x00000002 |
| #define | GWEN_TEXT_FLAGS_NEED_DELIMITER 0x00000008 |
| #define | GWEN_TEXT_FLAGS_NULL_IS_DELIMITER 0x00000010 |
| #define | GWEN_TEXT_FUZZY_SHIFT 10 |
Typedefs | |
| typedef int GWENHYWFAR_CB(* | GWEN_TEXT_REPLACE_VARS_CB) (void *cbPtr, const char *name, int index, int maxLen, GWEN_BUFFER *dstBuf) |
Functions | |
| GWENHYWFAR_API double | GWEN_Text_CheckSimilarity (const char *s1, const char *s2, int ign) |
| GWENHYWFAR_API int | GWEN_Text_Compare (const char *s1, const char *s2, int ign) |
| GWENHYWFAR_API int | GWEN_Text_ComparePattern (const char *w, const char *p, int sensecase) |
| GWENHYWFAR_API void | GWEN_Text_CondenseBuffer (GWEN_BUFFER *buf) |
| GWENHYWFAR_API int | GWEN_Text_ConvertCharset (const char *fromCharset, const char *toCharset, const char *text, int len, GWEN_BUFFER *tbuf) |
| GWENHYWFAR_API int | GWEN_Text_CountUtf8Chars (const char *s, int len) |
| GWENHYWFAR_API int | GWEN_Text_DoubleToBuffer (double num, GWEN_BUFFER *buf) |
| GWENHYWFAR_API void | GWEN_Text_DumpString (const char *s, unsigned int l, unsigned int insert) |
| GWENHYWFAR_API void | GWEN_Text_DumpString2Buffer (const char *s, unsigned int l, GWEN_BUFFER *mbuf, unsigned int insert) |
| GWENHYWFAR_API char * | GWEN_Text_Escape (const char *src, char *buffer, unsigned int maxsize) |
| GWENHYWFAR_API int | GWEN_Text_EscapeToBuffer (const char *src, GWEN_BUFFER *buf) |
| GWENHYWFAR_API int | GWEN_Text_EscapeToBufferTolerant (const char *src, GWEN_BUFFER *buf) |
| GWENHYWFAR_API int | GWEN_Text_EscapeToBufferTolerant2 (GWEN_BUFFER *src, GWEN_BUFFER *buf) |
| GWENHYWFAR_API char * | GWEN_Text_EscapeTolerant (const char *src, char *buffer, unsigned int maxsize) |
| GWENHYWFAR_API int | GWEN_Text_EscapeXmlToBuffer (const char *src, GWEN_BUFFER *buf) |
| GWENHYWFAR_API int | GWEN_Text_FromBcdBuffer (const char *src, GWEN_BUFFER *buf) |
| GWENHYWFAR_API int | GWEN_Text_FromHex (const char *src, char *buffer, unsigned maxsize) |
| GWENHYWFAR_API int | GWEN_Text_FromHexBuffer (const char *src, GWEN_BUFFER *buf) |
| GWENHYWFAR_API char * | GWEN_Text_GetWord (const char *src, const char *delims, char *buffer, unsigned int maxsize, uint32_t flags, const char **next) |
| GWENHYWFAR_API int | GWEN_Text_GetWordToBuffer (const char *src, const char *delims, GWEN_BUFFER *buf, uint32_t flags, const char **next) |
| GWENHYWFAR_API void | GWEN_Text_LogString (const char *s, unsigned int l, const char *logDomain, GWEN_LOGGER_LEVEL lv) |
| GWENHYWFAR_API int | GWEN_Text_NumToString (int num, char *buffer, unsigned int bufsize, int fillchar) |
| GWENHYWFAR_API int | GWEN_Text_ReplaceVars (const char *s, GWEN_BUFFER *dbuf, GWEN_TEXT_REPLACE_VARS_CB fn, void *ptr) |
| GWENHYWFAR_API const char * | GWEN_Text_StrCaseStr (const char *haystack, const char *needle) |
| GWENHYWFAR_API int | GWEN_Text_StringToDouble (const char *s, double *num) |
| GWENHYWFAR_API char * | GWEN_Text_strndup (const char *s, size_t n) |
| GWENHYWFAR_API int | GWEN_Text_ToBcdBuffer (const char *src, unsigned l, GWEN_BUFFER *buf, unsigned int groupsize, char delimiter, int skipLeadingZeroes) |
| GWENHYWFAR_API char * | GWEN_Text_ToHex (const char *src, unsigned l, char *buffer, unsigned int maxsize) |
| GWENHYWFAR_API int | GWEN_Text_ToHexBuffer (const char *src, unsigned l, GWEN_BUFFER *buf, unsigned int groupsize, char delimiter, int skipLeadingZeroes) |
| GWENHYWFAR_API char * | GWEN_Text_ToHexGrouped (const char *src, unsigned l, char *buffer, unsigned maxsize, unsigned int groupsize, char delimiter, int skipLeadingZeros) |
| GWENHYWFAR_API char * | GWEN_Text_Unescape (const char *src, char *buffer, unsigned int maxsize) |
| GWENHYWFAR_API char * | GWEN_Text_UnescapeN (const char *src, unsigned int srclen, char *buffer, unsigned int maxsize) |
| GWENHYWFAR_API int | GWEN_Text_UnescapeToBuffer (const char *src, GWEN_BUFFER *buf) |
| GWENHYWFAR_API int | GWEN_Text_UnescapeToBufferTolerant (const char *src, GWEN_BUFFER *buf) |
| GWENHYWFAR_API char * | GWEN_Text_UnescapeTolerant (const char *src, char *buffer, unsigned int maxsize) |
| GWENHYWFAR_API char * | GWEN_Text_UnescapeTolerantN (const char *src, unsigned int srclen, char *buffer, unsigned int maxsize) |
| GWENHYWFAR_API int | GWEN_Text_UnescapeXmlToBuffer (const char *src, GWEN_BUFFER *buf) |
| #define GWEN_TEXT_FLAGS_CHECK_BACKSLASH 0x00000040 |
Definition at line 50 of file text.h.
Referenced by _checkStringListOption(), _getPathBetween(), _readDepFile(), _readOptionsFromDb(), GWB_ParseOption(), GWBUILD_GetPathFromEnvironment(), GWEN_Path_GetPathBetween(), GWEN_Text_GetWord(), and GWEN_Text_GetWordToBuffer().
| #define GWEN_TEXT_FLAGS_DEL_LEADING_BLANKS 0x00000001 |
Definition at line 44 of file text.h.
Referenced by _csvImport(), _readCsvLine(), _readDepFile(), _stringListToDb(), GWBUILD_GetPathFromEnvironment(), GWEN_Text_GetWord(), and GWEN_Text_GetWordToBuffer().
| #define GWEN_TEXT_FLAGS_DEL_MULTIPLE_BLANKS 0x00000004 |
Definition at line 46 of file text.h.
Referenced by _readDepFile(), GWEN_Text_GetWord(), and GWEN_Text_GetWordToBuffer().
| #define GWEN_TEXT_FLAGS_DEL_QUOTES 0x00000020 |
Definition at line 49 of file text.h.
Referenced by _checkStringListOption(), _csvImport(), _getPathBetween(), _readCsvLine(), _readDepFile(), _readOptionsFromDb(), _stringListToDb(), GWB_ParseOption(), GWBUILD_GetPathFromEnvironment(), GWEN_Path_GetPathBetween(), GWEN_Text_GetWord(), and GWEN_Text_GetWordToBuffer().
| #define GWEN_TEXT_FLAGS_DEL_TRAILING_BLANKS 0x00000002 |
Definition at line 45 of file text.h.
Referenced by _csvImport(), _readCsvLine(), _readDepFile(), _stringListToDb(), GWBUILD_GetPathFromEnvironment(), GWEN_Text_GetWord(), and GWEN_Text_GetWordToBuffer().
| #define GWEN_TEXT_FLAGS_NEED_DELIMITER 0x00000008 |
Definition at line 47 of file text.h.
Referenced by GWEN_Text_GetWord(), and GWEN_Text_GetWordToBuffer().
| #define GWEN_TEXT_FLAGS_NULL_IS_DELIMITER 0x00000010 |
Definition at line 48 of file text.h.
Referenced by _csvImport(), _readCsvLine(), _stringListToDb(), GWEN_Text_GetWord(), and GWEN_Text_GetWordToBuffer().
| typedef int GWENHYWFAR_CB(* GWEN_TEXT_REPLACE_VARS_CB) (void *cbPtr, const char *name, int index, int maxLen, GWEN_BUFFER *dstBuf) |
| GWENHYWFAR_API double GWEN_Text_CheckSimilarity | ( | const char * | s1, |
| const char * | s2, | ||
| int | ign ) |
Compares two strings and returns the percentage of their equality. It is calculated by this formula: matches*100 / ((length of s1)+(length of s2)) Each match is weight like this:
| s1 | 1st of two strings to compare |
| s2 | 2nd of two strings to compare |
| ign | if !=0 then the cases are ignored |
Definition at line 1786 of file text.c.
References _checkSimilarity().

| GWENHYWFAR_API int GWEN_Text_Compare | ( | const char * | s1, |
| const char * | s2, | ||
| int | ign ) |
| GWENHYWFAR_API int GWEN_Text_ComparePattern | ( | const char * | w, |
| const char * | p, | ||
| int | sensecase ) |
This function compares two string and returns the number of matches or -1 on error.
| w | string to compare |
| p | pattern to compare against |
| sensecase | if 0 then cases are ignored |
Definition at line 1208 of file text.c.
References _cmpSegment(), and _findSegment().
Referenced by _addMatchingFiles(), _dbIfCharDataMatches(), _dbIfNotCharDataMatches(), _handleXmlIfCharDataMatches(), _handleXmlIfCharDataMatches(), _handleXmlIfNotCharDataMatches(), _handleXmlIfNotCharDataMatches(), _parseIfNotVarMatches(), _parseIfVarMatches(), _readFileListFromTagNode(), _varHasValue(), GWBUILD_GetArchFromTriplet(), GWBUILD_GetSystemFromTriplet(), GWEN_DB_FindFirstGroup(), GWEN_DB_FindFirstVar(), GWEN_DB_FindNextGroup(), GWEN_DB_FindNextVar(), GWEN_DBIO_XmlDb_CheckFile(), GWEN_Directory_GetAllEntries(), GWEN_Directory_GetDirEntries(), GWEN_Directory_GetFileEntries(), GWEN_Directory_GetFileEntriesWithType(), GWEN_Directory_GetMatchingFilesRecursively(), GWEN_SyncIo_Http_ParseHeader(), GWEN_SyncIo_Http_WriteHeader(), and GWEN_XMLNode_FindTag().


| GWENHYWFAR_API void GWEN_Text_CondenseBuffer | ( | GWEN_BUFFER * | buf | ) |
Condenses a buffer containing chars. This means removing unnecessary spaces.
Definition at line 1620 of file text.c.
References GWEN_Buffer_Crop(), GWEN_Buffer_GetStart(), and GWEN_Buffer_GetUsedBytes().
Referenced by _callPkgConfig(), _convertAndSetCharValue(), _convertAndSetCharValue(), and _readDepFile().


| GWENHYWFAR_API int GWEN_Text_ConvertCharset | ( | const char * | fromCharset, |
| const char * | toCharset, | ||
| const char * | text, | ||
| int | len, | ||
| GWEN_BUFFER * | tbuf ) |
This function converts a given text from one charset to another one. Currently, iconv is used for this conversion.
| fromCharset | charset of the source text |
| toCharset | charset of the source text |
| text | text to convert |
| len | length of the text (excluding trailing 0) |
| tbuf | destination buffer for the converted text |
Definition at line 2015 of file text.c.
References DBG_DEBUG, DBG_ERROR, DBG_INFO, GWEN_Buffer_AppendBytes(), GWEN_ERROR_GENERIC, GWEN_LOGDOMAIN, and ICONV_CONST.
Referenced by GWEN_XML__ReadData(), GWEN_XML__ReadTag(), GWEN_XMLNode__WriteCommentToStream(), GWEN_XMLNode__WriteDataToStream(), and GWEN_XMLNode__WritePropertiesToStream().


| GWENHYWFAR_API int GWEN_Text_CountUtf8Chars | ( | const char * | s, |
| int | len ) |
This function counts the number of characters in the given UTF-8 buffer.
| s | pointer to a buffer which contains UTF-8 characters |
| len | number of bytes (if 0 then all bytes up to a zero byte are counted) |
Definition at line 1799 of file text.c.
References DBG_ERROR, and GWEN_LOGDOMAIN.
| GWENHYWFAR_API int GWEN_Text_DoubleToBuffer | ( | double | num, |
| GWEN_BUFFER * | buf ) |
This functions transforms a string into a double float value. It always uses a decimal point (".") regardless of the current locale settings. This makes sure that a value can always be parsed regardless of the country settings of the producer of that string.
Definition at line 1663 of file text.c.
References GWEN_Buffer_AppendString(), and NULL.
Referenced by GWEN_Param_SetCurrentValueAsDouble().


| GWENHYWFAR_API void GWEN_Text_DumpString | ( | const char * | s, |
| unsigned int | l, | ||
| unsigned int | insert ) |
This is used for debugging purposes and it shows the given data as a classical hexdump.
Definition at line 1283 of file text.c.
Referenced by _groupReadElement(), cryptWithNew(), GWEN_Buffer_Dump(), GWEN_MsgEngine__ReadGroup(), GWEN_MsgEngine_ReadMessage(), GWEN_SyncIo_Socket_Read(), GWEN_SyncIo_Socket_Write(), GWEN_SyncIo_Tls_Read(), GWEN_SyncIo_Tls_Write(), and signWithNew().

| GWENHYWFAR_API void GWEN_Text_DumpString2Buffer | ( | const char * | s, |
| unsigned int | l, | ||
| GWEN_BUFFER * | mbuf, | ||
| unsigned int | insert ) |
Definition at line 1324 of file text.c.
References GWEN_Buffer_AppendByte(), and GWEN_Buffer_AppendString().
Referenced by GWEN_Msg_Dump(), and GWEN_Text_LogString().


| GWENHYWFAR_API char * GWEN_Text_Escape | ( | const char * | src, |
| char * | buffer, | ||
| unsigned int | maxsize ) |
This function does escaping like it is used for HTTP URL encoding. All characters which are not alphanumeric are escaped by XX where XX ist the hexadecimal code of the character.
Definition at line 349 of file text.c.
References DBG_ERROR, and GWEN_LOGDOMAIN.
| GWENHYWFAR_API int GWEN_Text_EscapeToBuffer | ( | const char * | src, |
| GWEN_BUFFER * | buf ) |
Definition at line 1376 of file text.c.
References GWEN_Buffer_AppendByte().
Referenced by GWEN_ConfigMgrDir__GetUniqueId(), GWEN_ConfigMgrDir__UpdateLastUniqueId(), GWEN_ConfigMgrDir_AddGroupDirName(), GWEN_ConfigMgrDir_AddGroupFileName(), GWEN_MDigest__HashFileTree(), GWEN_Path_Handle(), and GWEN_Path_HandleWithIdx().


| GWENHYWFAR_API int GWEN_Text_EscapeToBufferTolerant | ( | const char * | src, |
| GWEN_BUFFER * | buf ) |
Does the same as GWEN_Text_EscapeToBuffer does, but this version here does not escape some characters generally accepted within strings (such as space, comma, decimal point etc).
Definition at line 1471 of file text.c.
References GWEN_Buffer_AppendByte().
Referenced by GWEN_DB_WriteGroupToIoLayer(), GWEN_Gui_Internal_GetPassword(), GWEN_Gui_Internal_SetPasswordStatus(), GWEN_PasswordStore__GetPassword(), GWEN_PasswordStore__SetPassword(), GWEN_Path_Handle(), and GWEN_Path_HandleWithIdx().


| GWENHYWFAR_API int GWEN_Text_EscapeToBufferTolerant2 | ( | GWEN_BUFFER * | src, |
| GWEN_BUFFER * | buf ) |
Definition at line 1560 of file text.c.
References DBG_INFO, GWEN_Buffer_AppendByte(), GWEN_Buffer_GetBytesLeft(), GWEN_Buffer_ReadByte(), and GWEN_LOGDOMAIN.

| GWENHYWFAR_API char * GWEN_Text_EscapeTolerant | ( | const char * | src, |
| char * | buffer, | ||
| unsigned int | maxsize ) |
Definition at line 400 of file text.c.
References DBG_ERROR, and GWEN_LOGDOMAIN.
| GWENHYWFAR_API int GWEN_Text_EscapeXmlToBuffer | ( | const char * | src, |
| GWEN_BUFFER * | buf ) |
Replaces special characters which are used by XML (like "<", "&" etc) by known sequences (like "&").
Definition at line 1978 of file text.c.
References GWEN_TEXT_ESCAPE_ENTRY::character, GWEN_Buffer_AppendByte(), GWEN_Buffer_AppendString(), gwen_text__xml_escape_chars, and GWEN_TEXT_ESCAPE_ENTRY::replace.
Referenced by _convertAndSetCharValue(), GWEN_DBIO_XmlDb__ExportVar(), and GWEN_DlgProgress_AddLogText().


| GWENHYWFAR_API int GWEN_Text_FromBcdBuffer | ( | const char * | src, |
| GWEN_BUFFER * | buf ) |
Reads bcd bytes and stores them in the given buffer.
Definition at line 942 of file text.c.
References DBG_ERROR, GWEN_Buffer_AppendByte(), and GWEN_LOGDOMAIN.

| GWENHYWFAR_API int GWEN_Text_FromHex | ( | const char * | src, |
| char * | buffer, | ||
| unsigned | maxsize ) |
Definition at line 850 of file text.c.
References DBG_ERROR, and GWEN_LOGDOMAIN.
| GWENHYWFAR_API int GWEN_Text_FromHexBuffer | ( | const char * | src, |
| GWEN_BUFFER * | buf ) |
Reads hex bytes and stores them in the given buffer.
Definition at line 897 of file text.c.
References DBG_ERROR, GWEN_Buffer_AppendByte(), and GWEN_LOGDOMAIN.
Referenced by GWEN_Crypt_Token_KeyInfo_ReadXml(), GWEN_DB__ReadValues(), GWEN_DBIO__XmlDb_ImportVar(), and GWEN_MsgEngine__GetInline().


| GWENHYWFAR_API char * GWEN_Text_GetWord | ( | const char * | src, |
| const char * | delims, | ||
| char * | buffer, | ||
| unsigned int | maxsize, | ||
| uint32_t | flags, | ||
| const char ** | next ) |
This function cuts out a word from a given string.
| src | pointer to the beginning of the source string |
| delims | pointer to a string containing all delimiters |
| buffer | pointer to the destination buffer |
| maxsize | length of the buffer. Actually up to this number of characters are copied to the buffer. If after this number of chars no delimiter follows the string will be terminated. You will have to check whether there is a delimiter directly after the copied string |
| flags | defines how the source string is to be processed |
| next | pointer to a pointer to receive the address up to which the source string has been handled. You can use this to continue with the source string behind the word we've just cut out. This variable is only modified upon successfull return |
Definition at line 100 of file text.c.
References DBG_DEBUG, DBG_ERROR, GWEN_LOGDOMAIN, GWEN_TEXT_FLAGS_CHECK_BACKSLASH, GWEN_TEXT_FLAGS_DEL_LEADING_BLANKS, GWEN_TEXT_FLAGS_DEL_MULTIPLE_BLANKS, GWEN_TEXT_FLAGS_DEL_QUOTES, GWEN_TEXT_FLAGS_DEL_TRAILING_BLANKS, GWEN_TEXT_FLAGS_NEED_DELIMITER, and GWEN_TEXT_FLAGS_NULL_IS_DELIMITER.
| GWENHYWFAR_API int GWEN_Text_GetWordToBuffer | ( | const char * | src, |
| const char * | delims, | ||
| GWEN_BUFFER * | buf, | ||
| uint32_t | flags, | ||
| const char ** | next ) |
Definition at line 226 of file text.c.
References DBG_ERROR, GWEN_Buffer_AppendByte(), GWEN_Buffer_Crop(), GWEN_Buffer_GetPos(), GWEN_LOGDOMAIN, GWEN_TEXT_FLAGS_CHECK_BACKSLASH, GWEN_TEXT_FLAGS_DEL_LEADING_BLANKS, GWEN_TEXT_FLAGS_DEL_MULTIPLE_BLANKS, GWEN_TEXT_FLAGS_DEL_QUOTES, GWEN_TEXT_FLAGS_DEL_TRAILING_BLANKS, GWEN_TEXT_FLAGS_NEED_DELIMITER, and GWEN_TEXT_FLAGS_NULL_IS_DELIMITER.
Referenced by _readCsvLine(), and GWEN_StringList_fromString2().


| GWENHYWFAR_API void GWEN_Text_LogString | ( | const char * | s, |
| unsigned int | l, | ||
| const char * | logDomain, | ||
| GWEN_LOGGER_LEVEL | lv ) |
Definition at line 1606 of file text.c.
References GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_Logger_Log(), and GWEN_Text_DumpString2Buffer().
Referenced by _recvPacket(), GWEN_Sar_ExtractAndDigestFileReg(), GWEN_SyncIo_Http_ReadHeader(), GWEN_SyncIo_Http_ReadStatus(), GWEN_SyncIo_Http_WriteCommand(), and GWEN_SyncIo_Http_WriteHeader().


| GWENHYWFAR_API int GWEN_Text_NumToString | ( | int | num, |
| char * | buffer, | ||
| unsigned int | bufsize, | ||
| int | fillchar ) |
| fillchar | if 0 then no filling takes place, positive values extend to the right, negative values to the left. |
Definition at line 1243 of file text.c.
References DBG_ERROR, and GWEN_LOGDOMAIN.
Referenced by _csvExport(), _writeVarValueToBuffer(), GWEN_DB_WriteGroupToIoLayer(), GWEN_MsgEngine__TransformValue(), and GWEN_MsgEngine__WriteElement().

| GWENHYWFAR_API int GWEN_Text_ReplaceVars | ( | const char * | s, |
| GWEN_BUFFER * | dbuf, | ||
| GWEN_TEXT_REPLACE_VARS_CB | fn, | ||
| void * | ptr ) |
Read the given string and replace every variable in that string ( noted as "$(varname)") with the value of the mentioned variable. Uses a callback to actually retrieve the data.
Definition at line 2110 of file text.c.
References _splitVariableNameInNameAndIndex(), DBG_ERROR, DBG_INFO, GWEN_Buffer_AppendByte(), GWEN_Buffer_Crop(), GWEN_Buffer_GetPos(), GWEN_ERROR_BAD_DATA, GWEN_ERROR_NO_ADDRESS, GWEN_ERROR_NO_DATA, GWEN_LOGDOMAIN, and NULL.
Referenced by GWEN_DB_ReplaceVars().


| GWENHYWFAR_API const char * GWEN_Text_StrCaseStr | ( | const char * | haystack, |
| const char * | needle ) |
This function provides the functionality of strcasestr() which is not available on some systems.
Definition at line 1083 of file text.c.
References NULL.
Referenced by GWEN_Buffer_KeepTextBetweenStrings().

| GWENHYWFAR_API int GWEN_Text_StringToDouble | ( | const char * | s, |
| double * | num ) |
This functions transforms a double float value into a string. It always uses a decimal point (".") regardless of the current locale settings. This makes sure that a value can always be parsed regardless of the country settings of the producer of that string.
Definition at line 1688 of file text.c.
References NULL.
Referenced by GWEN_Param_GetCurrentValueAsDouble().

| GWENHYWFAR_API char * GWEN_Text_strndup | ( | const char * | s, |
| size_t | n ) |
This function provides the functionality of strndup() which is not available on Windows (uses strndup() on all other systems).
Definition at line 2088 of file text.c.
References NULL.
Referenced by _setupAfterAddingFirstInputFile(), _twoStrings_fromString(), and GWEN_Tag16_GetTagDataAsNewString().

| GWENHYWFAR_API int GWEN_Text_ToBcdBuffer | ( | const char * | src, |
| unsigned | l, | ||
| GWEN_BUFFER * | buf, | ||
| unsigned int | groupsize, | ||
| char | delimiter, | ||
| int | skipLeadingZeroes ) |
Writes the given BCD data as a hex string to the destination buffer.
| groupsize | if !=0 then after this many characters in the destination buffer the delimiter is inserted |
| delimiter | character to write after groupsize characters |
| skipLeadingZeroes | if !=0 then leading zeroes are suppressed |
Definition at line 988 of file text.c.
References DBG_INFO, GWEN_Buffer_AppendByte(), and GWEN_LOGDOMAIN.

| GWENHYWFAR_API char * GWEN_Text_ToHex | ( | const char * | src, |
| unsigned | l, | ||
| char * | buffer, | ||
| unsigned int | maxsize ) |
Definition at line 657 of file text.c.
References DBG_ERROR, and GWEN_LOGDOMAIN.
Referenced by GWEN_DB_Dump(), GWEN_DB_WriteGroupToIoLayer(), and GWEN_TLV_Buffer_To_DB().

| GWENHYWFAR_API int GWEN_Text_ToHexBuffer | ( | const char * | src, |
| unsigned | l, | ||
| GWEN_BUFFER * | buf, | ||
| unsigned int | groupsize, | ||
| char | delimiter, | ||
| int | skipLeadingZeroes ) |
Writes the given binary data as a hex string to the destination buffer.
| groupsize | if !=0 then after this many characters in the destination buffer the delimiter is inserted |
| delimiter | character to write after groupsize characters |
| skipLeadingZeroes | if !=0 then leading zeroes are suppressed |
Definition at line 777 of file text.c.
References DBG_INFO, GWEN_Buffer_AppendByte(), and GWEN_LOGDOMAIN.
Referenced by GWEN_Crypt_Token_KeyInfo_WriteXml(), GWEN_DBIO_XmlDb__ExportVar(), GWEN_Gui__HashPair(), GWEN_MDigest__HashFile(), GWEN_SyncIo_Tls_GetPeerCert(), and showKey().


| GWENHYWFAR_API char * GWEN_Text_ToHexGrouped | ( | const char * | src, |
| unsigned | l, | ||
| char * | buffer, | ||
| unsigned | maxsize, | ||
| unsigned int | groupsize, | ||
| char | delimiter, | ||
| int | skipLeadingZeros ) |
Converts a string to Hex. After "groupsize" bytes the "delimiter" is inserted.
Definition at line 691 of file text.c.
References DBG_ERROR, and GWEN_LOGDOMAIN.
| GWENHYWFAR_API char * GWEN_Text_Unescape | ( | const char * | src, |
| char * | buffer, | ||
| unsigned int | maxsize ) |
Definition at line 542 of file text.c.
References GWEN_Text_UnescapeN().

| GWENHYWFAR_API char * GWEN_Text_UnescapeN | ( | const char * | src, |
| unsigned int | srclen, | ||
| char * | buffer, | ||
| unsigned int | maxsize ) |
Definition at line 458 of file text.c.
References DBG_ERROR, and GWEN_LOGDOMAIN.
Referenced by GWEN_Text_Unescape().

| GWENHYWFAR_API int GWEN_Text_UnescapeToBuffer | ( | const char * | src, |
| GWEN_BUFFER * | buf ) |
Definition at line 1411 of file text.c.
References DBG_ERROR, GWEN_Buffer_AppendByte(), and GWEN_LOGDOMAIN.
Referenced by GWEN_ConfigMgrDir_ListSubGroups(), GWEN_Path_Handle(), and GWEN_Path_HandleWithIdx().


| GWENHYWFAR_API int GWEN_Text_UnescapeToBufferTolerant | ( | const char * | src, |
| GWEN_BUFFER * | buf ) |
This function does the same as GWEN_Text_UnescapeToBuffer but it doesn't complain about unescaped characters in the source string.
Definition at line 1515 of file text.c.
References GWEN_Buffer_AppendByte().
Referenced by GWEN_PasswordStore_EncryptWriteFile(), GWEN_PasswordStore_GetTokenList(), GWEN_PasswordStore_ReadDecryptFile(), GWEN_Path_Handle(), and GWEN_Path_HandleWithIdx().


| GWENHYWFAR_API char * GWEN_Text_UnescapeTolerant | ( | const char * | src, |
| char * | buffer, | ||
| unsigned int | maxsize ) |
Definition at line 645 of file text.c.
References GWEN_Text_UnescapeTolerantN().

| GWENHYWFAR_API char * GWEN_Text_UnescapeTolerantN | ( | const char * | src, |
| unsigned int | srclen, | ||
| char * | buffer, | ||
| unsigned int | maxsize ) |
Definition at line 554 of file text.c.
References DBG_ERROR, and GWEN_LOGDOMAIN.
Referenced by GWEN_Text_UnescapeTolerant().

| GWENHYWFAR_API int GWEN_Text_UnescapeXmlToBuffer | ( | const char * | src, |
| GWEN_BUFFER * | buf ) |
Replaces special character sequences to their coresponding character.
Definition at line 1856 of file text.c.
References GWEN_TEXT_ESCAPE_ENTRY::character, GWEN_Buffer_AdjustUsedBytes(), GWEN_Buffer_GetMaxUnsegmentedWrite(), GWEN_Buffer_GetPosPointer(), GWEN_Buffer_IncrementPos(), GWEN_TEXT__APPENDCHAR, gwen_text__xml_escape_chars, and GWEN_TEXT_ESCAPE_ENTRY::replace.
Referenced by GWEN_DBIO__XmlDb_ReadDataTags(), GWEN_XmlCtxStore_AddAttr(), GWEN_XmlCtxStore_AddData(), and HtmlCtx_SanitizeData().

