| version 1.2, 2003/04/21 23:51:36 |
version 1.3, 2003/04/22 14:22:53 |
|
|
| /** |
/** |
| * CGI related string functions. |
* CGI related string functions |
| * |
* |
| * @file platon/str/strcgi.h |
* @file platon/str/strcgi.h |
| * @author Rafael Steil <rafael@insanecorp.com> |
|
| * @author Ondrej Jombik <nepto@platon.sk> |
* @author Ondrej Jombik <nepto@platon.sk> |
| * @version \$Platon: libplaton/platon/str/strcgi.h,v 1.1 2003/04/21 00:48:36 nepto Exp $ |
* @author Rafael Steil <rafael@insanecorp.com> |
| |
* @version \$Platon: libplaton/platon/str/strcgi.h,v 1.2 2003/04/21 23:51:36 nepto Exp $ |
| * @date 2001-2003 |
* @date 2001-2003 |
| * |
* |
| * This part is mostly based on the libcgi 0.7.2 library by Rafael Steil. |
* This part is mostly based on the libcgi 0.7.2 library by Rafael Steil |
| |
* and PHP: Hypertext Preprocessor source codes (http://www.php.net/). |
| */ |
*/ |
| |
|
| #ifndef _PLATON_STR_STRCGI_H |
#ifndef _PLATON_STR_STRCGI_H |
|
|
| * @return allocated encoded string |
* @return allocated encoded string |
| * or NULL on memory allocation error |
* or NULL on memory allocation error |
| * |
* |
| * This function transform special characters into their appropriate |
* Function transform special characters into their appropriate hexadecimal |
| * hexadecimal form (like "%E1"). Original code was from PHP: Hypertext |
* form (like "\%E1"). It is encoded the same way that the posted data from |
| * preprocessor sources. See http://www.php.net/ for more info. |
* a WWW form is encoded, that is the same way as in the media type called |
| |
* application/x-www-form-urlencoded. This differs from the RFC1738 |
| |
* encoding (see rawurlencode() function) in that for historical reasons, |
| |
* spaces are encoded as plus (+) signs. |
| |
* |
| |
* Original code was from PHP: Hypertext preprocessor sources. See |
| |
* http://www.php.net/ for more information. |
| */ |
*/ |
| char *PLATON_FUNC(urlencode)(const char *str); |
char *PLATON_FUNC(urlencode)(const char *str); |
| |
|
|
|
| * @return allocated decoded string |
* @return allocated decoded string |
| * or NULL on memory allocation error |
* or NULL on memory allocation error |
| * |
* |
| * This function searches for special character sequences (like "%E1") |
* Function searches for special character sequences (like "\%E1") in str |
| * in str variable and converts them to the their apropriate ASCII |
* variable and converts them to the their apropriate ASCII character |
| * character correspondent. |
* correspondent. For more information about how data are encoded, see |
| |
* urlencode() function. |
| */ |
*/ |
| char *PLATON_FUNC(urldecode)(const char *str); |
char *PLATON_FUNC(urldecode)(const char *str); |
| |
|
| /** |
/** |
| |
* URL-encodes string according to RFC1738 |
| |
* |
| |
* @param str string to encode |
| |
* @return allocated encoded string |
| |
* or NULL on memory allocation error |
| |
* |
| |
* Function transform special characters into their appropriate hexadecimal |
| |
* form (like "\%E1"). This is the encoding described in RFC1738 for |
| |
* protecting literal characters from being interpreted as special URL |
| |
* delimiters, and for protecting URL's from being mangled by transmission |
| |
* media with character conversions (like some e-mail systems). This |
| |
* differs from the urlencode() function, where spaces are not encoded as |
| |
* plus (+) signs. |
| |
* |
| |
* Original code was from PHP: Hypertext preprocessor sources. See |
| |
* http://www.php.net/ for more information. |
| |
*/ |
| |
char *PLATON_FUNC(rawurlencode)(const char *str); |
| |
|
| |
/** |
| |
* Decodes URL-encoded string according to RFC1738 |
| |
* |
| |
* @param str string to decode |
| |
* @return allocated decoded string |
| |
* or NULL on memory allocation error |
| |
* |
| |
* This function searches for special character sequences (like "\%E1") in |
| |
* str variable and converts them to the their apropriate ASCII character |
| |
* correspondent. For more information about how data are encoded, see |
| |
* rawurlencode() function. |
| |
*/ |
| |
char *PLATON_FUNC(rawurldecode)(const char *str); |
| |
|
| |
/** |
| * Adds slashes to a string when necessary |
* Adds slashes to a string when necessary |
| * |
* |
| * @param __s string where to add slashes |
* @param __s string where to add slashes |