gwenhywfar 5.12.0
text.c File Reference
#include "text.h"
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include <gwenhywfar/gwenhywfarapi.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/stringlist.h>
Include dependency graph for text.c:

Go to the source code of this file.

Data Structures

struct  GWEN_TEXT_ESCAPE_ENTRY

Macros

#define DISABLE_DEBUGLOG
#define GWEN_TEXT__APPENDCHAR(chr)
#define ICONV_CONST

Functions

static double _checkSimilarity (const char *s1, const char *s2, int ign)
static int _cmpSegment (const char *w, unsigned int *wpos, const char *p, unsigned int *ppos, int sensecase, unsigned int *matches)
static int _findSegment (const char *w, unsigned int *wpos, const char *p, unsigned int *ppos, int sensecase, unsigned int *matches)
static int _splitVariableNameInNameAndIndex (const char *s, char **pVariableName, int *pMaxLen)
double GWEN_Text_CheckSimilarity (const char *s1, const char *s2, int ign)
int GWEN_Text_Compare (const char *s1, const char *s2, int ign)
int GWEN_Text_ComparePattern (const char *w, const char *p, int sensecase)
void GWEN_Text_CondenseBuffer (GWEN_BUFFER *buf)
int GWEN_Text_ConvertCharset (const char *fromCharset, const char *toCharset, const char *text, int len, GWEN_BUFFER *tbuf)
int GWEN_Text_CountUtf8Chars (const char *s, int len)
int GWEN_Text_DoubleToBuffer (double num, GWEN_BUFFER *buf)
void GWEN_Text_DumpString (const char *s, unsigned int l, unsigned int insert)
void GWEN_Text_DumpString2Buffer (const char *s, unsigned int l, GWEN_BUFFER *mbuf, unsigned int insert)
char * GWEN_Text_Escape (const char *src, char *buffer, unsigned int maxsize)
int GWEN_Text_EscapeToBuffer (const char *src, GWEN_BUFFER *buf)
int GWEN_Text_EscapeToBufferTolerant (const char *src, GWEN_BUFFER *buf)
int GWEN_Text_EscapeToBufferTolerant2 (GWEN_BUFFER *src, GWEN_BUFFER *buf)
char * GWEN_Text_EscapeTolerant (const char *src, char *buffer, unsigned int maxsize)
int GWEN_Text_EscapeXmlToBuffer (const char *src, GWEN_BUFFER *buf)
int GWEN_Text_FromBcdBuffer (const char *src, GWEN_BUFFER *buf)
int GWEN_Text_FromHex (const char *src, char *buffer, unsigned maxsize)
int GWEN_Text_FromHexBuffer (const char *src, GWEN_BUFFER *buf)
char * GWEN_Text_GetWord (const char *src, const char *delims, char *buffer, unsigned int maxsize, uint32_t flags, const char **next)
int GWEN_Text_GetWordToBuffer (const char *src, const char *delims, GWEN_BUFFER *buf, uint32_t flags, const char **next)
void GWEN_Text_LogString (const char *s, unsigned int l, const char *logDomain, GWEN_LOGGER_LEVEL lv)
int GWEN_Text_NumToString (int num, char *buffer, unsigned int bufsize, int fillchar)
int GWEN_Text_ReplaceVars (const char *s, GWEN_BUFFER *dbuf, GWEN_TEXT_REPLACE_VARS_CB fn, void *ptr)
const char * GWEN_Text_StrCaseStr (const char *haystack, const char *needle)
int GWEN_Text_StringToDouble (const char *s, double *num)
char * GWEN_Text_strndup (const char *s, size_t n)
int GWEN_Text_ToBcdBuffer (const char *src, unsigned l, GWEN_BUFFER *buf, unsigned int groupsize, char delimiter, int skipLeadingZeroes)
char * GWEN_Text_ToHex (const char *src, unsigned l, char *buffer, unsigned int maxsize)
int GWEN_Text_ToHexBuffer (const char *src, unsigned l, GWEN_BUFFER *buf, unsigned int groupsize, char delimiter, int skipLeadingZeroes)
char * GWEN_Text_ToHexGrouped (const char *src, unsigned l, char *buffer, unsigned maxsize, unsigned int groupsize, char delimiter, int skipLeadingZeroes)
char * GWEN_Text_Unescape (const char *src, char *buffer, unsigned int maxsize)
char * GWEN_Text_UnescapeN (const char *src, unsigned int srclen, char *buffer, unsigned int maxsize)
int GWEN_Text_UnescapeToBuffer (const char *src, GWEN_BUFFER *buf)
int GWEN_Text_UnescapeToBufferTolerant (const char *src, GWEN_BUFFER *buf)
char * GWEN_Text_UnescapeTolerant (const char *src, char *buffer, unsigned int maxsize)
char * GWEN_Text_UnescapeTolerantN (const char *src, unsigned int srclen, char *buffer, unsigned int maxsize)
int GWEN_Text_UnescapeXmlToBuffer (const char *src, GWEN_BUFFER *buf)

Variables

static const GWEN_TEXT_ESCAPE_ENTRY gwen_text__xml_escape_chars []

Macro Definition Documentation

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 29 of file text.c.

◆ GWEN_TEXT__APPENDCHAR

#define GWEN_TEXT__APPENDCHAR ( chr)
Value:
if (roomLeft<2) { \
if (bytesAdded) { \
GWEN_Buffer_IncrementPos(buf, bytesAdded); \
GWEN_Buffer_AdjustUsedBytes(buf); \
} \
GWEN_Buffer_AllocRoom(buf, 2); \
bytesAdded=0; \
} \
*(pdst++)=(unsigned char)chr; \
*pdst=0; \
bytesAdded++; \
roomLeft--
uint32_t GWEN_Buffer_GetMaxUnsegmentedWrite(GWEN_BUFFER *bf)
Definition buffer.c:527
char * GWEN_Buffer_GetPosPointer(const GWEN_BUFFER *bf)
Definition buffer.c:548

Referenced by GWEN_Text_UnescapeXmlToBuffer().

◆ ICONV_CONST

#define ICONV_CONST

Definition at line 43 of file text.c.

Function Documentation

◆ _checkSimilarity()

double _checkSimilarity ( const char * s1,
const char * s2,
int ign )
static

Definition at line 1711 of file text.c.

Referenced by GWEN_Text_CheckSimilarity().

Here is the caller graph for this function:

◆ _cmpSegment()

int _cmpSegment ( const char * w,
unsigned int * wpos,
const char * p,
unsigned int * ppos,
int sensecase,
unsigned int * matches )
static

Definition at line 1118 of file text.c.

Referenced by _findSegment(), and GWEN_Text_ComparePattern().

Here is the caller graph for this function:

◆ _findSegment()

int _findSegment ( const char * w,
unsigned int * wpos,
const char * p,
unsigned int * ppos,
int sensecase,
unsigned int * matches )
static

Definition at line 1184 of file text.c.

References _cmpSegment().

Referenced by GWEN_Text_ComparePattern().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _splitVariableNameInNameAndIndex()

int _splitVariableNameInNameAndIndex ( const char * s,
char ** pVariableName,
int * pMaxLen )
static

Definition at line 2192 of file text.c.

References DBG_ERROR, GWEN_ERROR_BAD_DATA, GWEN_ERROR_NO_ADDRESS, GWEN_LOGDOMAIN, and NULL.

Referenced by GWEN_Text_ReplaceVars().

Here is the caller graph for this function:

◆ GWEN_Text_CheckSimilarity()

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==*s2: 2
  • toupper(*s1)==toupper(*s2): 2 if ign, 1 otherwise
  • isalnum(*s1)==isalnum(*s2): 1
Returns
percentage of equality between both strings
Parameters
s11st of two strings to compare
s22nd of two strings to compare
ignif !=0 then the cases are ignored

Definition at line 1786 of file text.c.

References _checkSimilarity().

Here is the call graph for this function:

◆ GWEN_Text_Compare()

int GWEN_Text_Compare ( const char * s1,
const char * s2,
int ign )

Compares two strings. If either of them is given but empty, that string will be treaten as not given. This way a string NOT given equals a string which is given but empty.

Parameters
ignset to !=0 to ignore cases

Definition at line 1061 of file text.c.

◆ GWEN_Text_ComparePattern()

◆ GWEN_Text_CondenseBuffer()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Text_ConvertCharset()

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.

Parameters
fromCharsetcharset of the source text
toCharsetcharset of the source text
texttext to convert
lenlength of the text (excluding trailing 0)
tbufdestination 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Text_CountUtf8Chars()

int GWEN_Text_CountUtf8Chars ( const char * s,
int len )

This function counts the number of characters in the given UTF-8 buffer.

Parameters
spointer to a buffer which contains UTF-8 characters
lennumber 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.

◆ GWEN_Text_DoubleToBuffer()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Text_DumpString()

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().

Here is the caller graph for this function:

◆ GWEN_Text_DumpString2Buffer()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Text_Escape()

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.

◆ GWEN_Text_EscapeToBuffer()

int GWEN_Text_EscapeToBuffer ( const char * src,
GWEN_BUFFER * buf )

◆ GWEN_Text_EscapeToBufferTolerant()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Text_EscapeToBufferTolerant2()

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.

Here is the call graph for this function:

◆ GWEN_Text_EscapeTolerant()

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.

◆ GWEN_Text_EscapeXmlToBuffer()

int GWEN_Text_EscapeXmlToBuffer ( const char * src,
GWEN_BUFFER * buf )

Replaces special characters which are used by XML (like "<", "&" etc) by known sequences (like "&amp;").

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Text_FromBcdBuffer()

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.

Here is the call graph for this function:

◆ GWEN_Text_FromHex()

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.

◆ GWEN_Text_FromHexBuffer()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Text_GetWord()

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.

Returns
address of the new word, 0 on error
Parameters
srcpointer to the beginning of the source string
delimspointer to a string containing all delimiters
bufferpointer to the destination buffer
maxsizelength 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
flagsdefines how the source string is to be processed
nextpointer 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.

◆ GWEN_Text_GetWordToBuffer()

int GWEN_Text_GetWordToBuffer ( const char * src,
const char * delims,
GWEN_BUFFER * buf,
uint32_t flags,
const char ** next )

◆ GWEN_Text_LogString()

void GWEN_Text_LogString ( const char * s,
unsigned int l,
const char * logDomain,
GWEN_LOGGER_LEVEL lv )

◆ GWEN_Text_NumToString()

int GWEN_Text_NumToString ( int num,
char * buffer,
unsigned int bufsize,
int fillchar )
Returns
number of bytes in the buffer (-1 on error)
Parameters
fillcharif 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().

Here is the caller graph for this function:

◆ GWEN_Text_ReplaceVars()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Text_StrCaseStr()

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().

Here is the caller graph for this function:

◆ GWEN_Text_StringToDouble()

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().

Here is the caller graph for this function:

◆ GWEN_Text_strndup()

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().

Here is the caller graph for this function:

◆ GWEN_Text_ToBcdBuffer()

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.

Parameters
groupsizeif !=0 then after this many characters in the destination buffer the delimiter is inserted
delimitercharacter to write after groupsize characters
skipLeadingZeroesif !=0 then leading zeroes are suppressed

Definition at line 988 of file text.c.

References DBG_INFO, GWEN_Buffer_AppendByte(), and GWEN_LOGDOMAIN.

Here is the call graph for this function:

◆ GWEN_Text_ToHex()

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().

Here is the caller graph for this function:

◆ GWEN_Text_ToHexBuffer()

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.

Parameters
groupsizeif !=0 then after this many characters in the destination buffer the delimiter is inserted
delimitercharacter to write after groupsize characters
skipLeadingZeroesif !=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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Text_ToHexGrouped()

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.

◆ GWEN_Text_Unescape()

char * GWEN_Text_Unescape ( const char * src,
char * buffer,
unsigned int maxsize )

Definition at line 542 of file text.c.

References GWEN_Text_UnescapeN().

Here is the call graph for this function:

◆ GWEN_Text_UnescapeN()

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().

Here is the caller graph for this function:

◆ GWEN_Text_UnescapeToBuffer()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Text_UnescapeToBufferTolerant()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Text_UnescapeTolerant()

char * GWEN_Text_UnescapeTolerant ( const char * src,
char * buffer,
unsigned int maxsize )

Definition at line 645 of file text.c.

References GWEN_Text_UnescapeTolerantN().

Here is the call graph for this function:

◆ GWEN_Text_UnescapeTolerantN()

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().

Here is the caller graph for this function:

◆ GWEN_Text_UnescapeXmlToBuffer()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ gwen_text__xml_escape_chars

const GWEN_TEXT_ESCAPE_ENTRY gwen_text__xml_escape_chars[]
static
Initial value:
= {
{'&', "&amp;"},
{'<', "&lt;"},
{'>', "&gt;"},
{'\'', "&apos;"},
{'\"', "&quot;"},
{0, 0}
}

Definition at line 62 of file text.c.

Referenced by GWEN_Text_EscapeXmlToBuffer(), and GWEN_Text_UnescapeXmlToBuffer().