rfc1738.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RFC1738_ESCAPE_CTRLS   1
 
#define RFC1738_ESCAPE_UNSAFE   2
 
#define RFC1738_ESCAPE_RESERVED   4
 
#define RFC1738_ESCAPE_ALL   (RFC1738_ESCAPE_UNSAFE|RFC1738_ESCAPE_RESERVED|RFC1738_ESCAPE_CTRLS)
 
#define RFC1738_ESCAPE_NOSPACE   128
 
#define RFC1738_ESCAPE_NOPERCENT   256
 
#define RFC1738_ESCAPE_UNESCAPED   (RFC1738_ESCAPE_UNSAFE|RFC1738_ESCAPE_CTRLS|RFC1738_ESCAPE_NOPERCENT)
 
#define rfc1738_escape(x)   rfc1738_do_escape(x, RFC1738_ESCAPE_UNSAFE|RFC1738_ESCAPE_CTRLS)
 
#define rfc1738_escape_part(x)   rfc1738_do_escape(x, RFC1738_ESCAPE_ALL)
 
#define rfc1738_escape_unescaped(x)   rfc1738_do_escape(x, RFC1738_ESCAPE_UNSAFE|RFC1738_ESCAPE_CTRLS|RFC1738_ESCAPE_NOPERCENT)
 

Functions

char * rfc1738_do_escape (const char *url, int flags)
 
void rfc1738_unescape (char *url)
 

Macro Definition Documentation

Definition at line 20 of file rfc1738.h.

#define RFC1738_ESCAPE_CTRLS   1

Definition at line 17 of file rfc1738.h.

Referenced by rfc1738_do_escape().

#define RFC1738_ESCAPE_NOPERCENT   256

Definition at line 23 of file rfc1738.h.

Referenced by rfc1738_do_escape().

#define RFC1738_ESCAPE_NOSPACE   128

Definition at line 22 of file rfc1738.h.

Referenced by rfc1738_do_escape(), and setLogUri().

#define RFC1738_ESCAPE_RESERVED   4

Definition at line 19 of file rfc1738.h.

Referenced by rfc1738_do_escape(), and testRFC1738::testUrlEncode().

#define RFC1738_ESCAPE_UNESCAPED   (RFC1738_ESCAPE_UNSAFE|RFC1738_ESCAPE_CTRLS|RFC1738_ESCAPE_NOPERCENT)

Definition at line 25 of file rfc1738.h.

Referenced by setLogUri(), and testRFC1738::testUrlEncode().

#define RFC1738_ESCAPE_UNSAFE   2

Definition at line 18 of file rfc1738.h.

Referenced by rfc1738_do_escape(), and testRFC1738::testUrlEncode().

Function Documentation

char* rfc1738_do_escape ( const char *  url,
int  flags 
)

rfc1738 RFC 1738 URL-escaping library

Public API is formed of a triplet of encode functions mapping to the rfc1738_do_encode() engine.

ASCII characters are split into four groups: SAFE Characters which are safe to occur in any URL. For example A,B,C CTRLS Binary control codes. Dangerous to include in URLs. UNSAFE Characters which are completely usafe to occur in any URL. For example; backspace, tab, space, newline. RESERVED Characters which are reserved for special meaning and may only occur in certain parts of a URL.

Returns a static buffer containing the RFC 1738 compliant, escaped version of the given url.

Parameters
flagsRFC1738_ESCAPE_CTRLS Encode the blatantly dangerous binary codes.
flagsRFC1738_ESCAPE_UNSAFE Encode printable unsafe characters (excluding CTRLs).
flagsRFC1738_ESCAPE_RESERVED Encode reserved characters.
flagsRFC1738_ESCAPE_ALL Encode all binary CTRL, unsafe and reserved characters.
flagsRFC1738_ESCAPE_NOSPACE Ignore the space whitespace character.
flagsRFC1738_ESCAPE_NOPERCENT Ignore the escaping delimiter ''.

Definition at line 56 of file rfc1738.c.

References buf, i, NULL, RFC1738_ESCAPE_CTRLS, RFC1738_ESCAPE_NOPERCENT, RFC1738_ESCAPE_NOSPACE, RFC1738_ESCAPE_RESERVED, RFC1738_ESCAPE_UNSAFE, rfc1738_reserved_chars, rfc1738_unsafe_chars, xcalloc, and xfree.

Referenced by Ftp::Gateway::parseListing(), setLogUri(), and testRFC1738::testUrlEncode().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors