Back to index

webcit  8.12-dfsg
Functions
utils.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void StrEscPuts (const StrBuf *strbuf)
void StrEscputs1 (const StrBuf *strbuf, int nbsp, int nolinebreaks)
void urlescputs (const char *)
void hurlescputs (const char *)
 urlescape buffer and print it as header
long stresc (char *target, long tSize, char *strbuf, int nbsp, int nolinebreaks)
void escputs (const char *strbuf)

Function Documentation

void escputs ( const char *  strbuf)

Definition at line 133 of file utils.c.

{
       StrEscAppend(WC->WBuf, NULL, strbuf, 0, 0);
}

Here is the caller graph for this function:

void hurlescputs ( const char *  )

urlescape buffer and print it as header

Definition at line 150 of file utils.c.

{
       StrBufUrlescAppend(WC->HBuf, NULL, strbuf);
}

Here is the caller graph for this function:

long stresc ( char *  target,
long  tSize,
char *  strbuf,
int  nbsp,
int  nolinebreaks 
)

Definition at line 65 of file utils.c.

{
        char *aptr, *bptr, *eptr;
 
        *target = '\0';
        aptr = strbuf;
        bptr = target;
        eptr = target + tSize - 6; /* our biggest unit to put in...  */
 
 
        while ((bptr < eptr) && !IsEmptyStr(aptr) ){
                if (*aptr == '<') {
                        memcpy(bptr, "&lt;", 4);
                        bptr += 4;
                }
                else if (*aptr == '>') {
                        memcpy(bptr, "&gt;", 4);
                        bptr += 4;
                }
                else if (*aptr == '&') {
                        memcpy(bptr, "&amp;", 5);
                        bptr += 5;
                }
                else if (*aptr == '\"') {
                        memcpy(bptr, "&quot;", 6);
                        bptr += 6;
                }
                else if (*aptr == '\'') {
                        memcpy(bptr, "&#39;", 5);
                        bptr += 5;
                }
                else if (*aptr == LB) {
                        *bptr = '<';
                        bptr ++;
                }
                else if (*aptr == RB) {
                        *bptr = '>';
                        bptr ++;
                }
                else if (*aptr == QU) {
                        *bptr ='"';
                        bptr ++;
                }
                else if ((*aptr == 32) && (nbsp == 1)) {
                        memcpy(bptr, "&nbsp;", 6);
                        bptr += 6;
                }
                else if ((*aptr == '\n') && (nolinebreaks)) {
                        *bptr='\0';     /* nothing */
                }
                else if ((*aptr == '\r') && (nolinebreaks)) {
                        *bptr='\0';     /* nothing */
                }
                else{
                        *bptr = *aptr;
                        bptr++;
                }
                aptr ++;
        }
        *bptr = '\0';
        if ((bptr = eptr - 1 ) && !IsEmptyStr(aptr) )
                return -1;
        return (bptr - target);
}

Here is the caller graph for this function:

void StrEscPuts ( const StrBuf *  strbuf)
void StrEscputs1 ( const StrBuf *  strbuf,
int  nbsp,
int  nolinebreaks 
)
void urlescputs ( const char *  )

Definition at line 141 of file utils.c.

{
       StrBufUrlescAppend(WC->WBuf, NULL, strbuf);
}

Here is the caller graph for this function: