URLENCODE

Section: MidWay Programmer's Manual (3C)
Updated: DATE
Index Return to Main Contents
 

NAME

urlmapencode, urlmapnencode,urlmapdecode - Encode and decode of an URL encoded field list  

SYNOPSIS

#include <urlencode.h>

urlmap * urlmapdecode (char * list);
char * urlmapencode (urlmap * map);
int urlmapnencode (char * list, int len, urlmap * map);
void urlmapfree (urlmap * map);

 

DESCRIPTION

urlmapdecode() takes a URL encoded list buffer and unpack and unescape it into a map. The map should be freed afterward with urlmapfree(). It will return NULL, if list is NULL, or not legally url formatted.

urlmapencode() take a map, and urlescape the keys and values and pack it into a list buffer allocated with malloc. You should therefore use free on the returned buffer.

urlmapnencode() works just like urlmapencode but are passed a buffer the list is written to, NULL terminated. Len shall indicate the length of the buffer. It returns the actual number of bytes written, or -1 if the list exceeds len.

urlmapfree() free up the memory used by a urlmap array, as returned by urlmapdecode and it's key and value buffers.

 

RETURN VALUES

urlmapdecode returns a pointer to a map array allocated with malloc. If the list is not propperly formated, or NULL, NULL is returned. urlmapencode return a malloc`ed buffer containing the list. urlmapnencode return the number of bytes actually writen in the list buffer, or -1 on error.

 

ERRORS

EOVERFLOW
The given buffer to urlmapnencode was too short.
EINVAL
In the case a parameter is NULL, or illegaly formated urllist.

 

WARNINGS

 

EXAMPLES

 

BUGS

 

NOTES

The urlencode library is not within the MidWay namespace, nor is it neccessary to include the library when compiling a MidWay client or server. It is provided since many of these functions are used in the MidWay libraries, and are used extensivly within MidWay to implement the SRB protocol.

 

SEE ALSO

urlmapnset(3C), urlmapset(3C), urlmapget(3C), urlmapnadd(3C), urlmapadd(3C), urlmapaddi(3C), urlmapdel(3C)

 

STANDARDS

NONE


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUES
ERRORS
WARNINGS
EXAMPLES
BUGS
NOTES
SEE ALSO
STANDARDS

This document was created by man2html, using the manual pages.
Time: 11:18:51 GMT, October 24, 2000