Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

encode.h File Reference

Functions to encode and decode URLs, and also to encode cookies and HTML text. More...

Go to the source code of this file.

Defines

#define ENCODE_H_VERSION   "$Id: encode.h,v 2.0 2002/06/04 14:34:21 jongfoster Exp $"

Functions

char * html_encode (const char *s)
char * cookie_encode (const char *s)
char * url_encode (const char *s)
char * url_decode (const char *str)
char * html_encode_and_free_original (char *s)

Variables

const char encode_rcs []
const char encode_h_rcs []


Detailed Description

Functions to encode and decode URLs, and also to encode cookies and HTML text.

Log:
encode.h,v
Revision 2.0 2002/06/04 14:34:21 jongfoster Moving source files to src/

Revision 1.5 2002/03/26 22:29:54 swa we have a new homepage!

Revision 1.4 2002/03/24 13:25:43 swa name change related issues

Revision 1.3 2002/01/22 23:28:07 jongfoster Adding convenience function html_encode_and_free_original() Making all functions accept NULL paramaters - in this case, they simply return NULL. This allows error-checking to be deferred.

Revision 1.2 2001/07/29 18:43:08 jongfoster Changing ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to ANSI C rules.

Revision 1.1.1.1 2001/05/15 13:58:51 oes Initial import of version 2.9.3 source tree


Function Documentation

char* cookie_encode const char *    s
 

Encodes a string so it can be used in a cookie.

Replaces " ", ",", and ";" with the appropriate codes.

Parameters:
s  String to encode. Null-terminated.
Returns:
Encoded string, newly allocated on the heap. Caller is responsible for freeing it with free(). If s is NULL, or on out-of memory, returns NULL.

char* html_encode const char *    s
 

Encodes a string so it's not interpreted as containing HTML tags or entities.

Replaces <, >, &, and " with the appropriate HTML entities.

Parameters:
s  String to encode. Null-terminated.
Returns:
Encoded string, newly allocated on the heap. Caller is responsible for freeing it with free(). If s is NULL, or on out-of memory, returns NULL.

char* html_encode_and_free_original char *    s
 

Encodes a string so it's not interpreted as containing HTML tags or entities.

Replaces <, >, &, and " with the appropriate HTML entities. Free()s original string. If original string is NULL, simply returns NULL.

Parameters:
s  String to encode. Null-terminated.
Returns:
Encoded string, newly allocated on the heap. Caller is responsible for freeing it with free(). If s is NULL, or on out-of memory, returns NULL.

char* url_decode const char *    s
 

Decodes a URL query string, replacing xx codes with their decoded form.

Parameters:
s  String to decode. Null-terminated.
Returns:
Decoded string, newly allocated on the heap. Caller is responsible for freeing it with free().

char* url_encode const char *    s
 

Encodes a string so it can be used in a URL query string.

Replaces special characters with the appropriate xx codes.

Parameters:
s  String to encode. Null-terminated.
Returns:
Encoded string, newly allocated on the heap. Caller is responsible for freeing it with free(). If s is NULL, or on out-of memory, returns NULL.


Variable Documentation

const char encode_h_rcs[]
 

Version information about encode.h.

const char encode_rcs[]
 

Version information about encode.c.


Generated on Tue Jun 4 18:54:49 2002 for Privoxy 3.1.1 by doxygen1.2.15