URLMAPADD

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

NAME

urlmapadd, urlmapnaddn, urlmapaddi, urlmapdel - Add and delete entries in an urlmap array.  

SYNOPSIS

#include <urlencode.h>

urlmap * urlmapnadd (urlmap * map, char * key, void * value, int len);
urlmap * urlmapadd (urlmap * map, char * key, char * value);
urlmap * urlmapaddi (urlmap * map, char * key, int value);
int urlmapdel (urlmap * map, char * key);

 

DESCRIPTION

The base function is urlmapnadd(). It places a new entry at the end of the map array where key is a NULL terminated string. value may contain NULL's since the length of the value buffer is given by len.

urlmapadd() is a convenience version of urlmapnadd() where value is a NULL terminated string.

urlmapaddi() is another convenience function where value is an integer.

If the key already exists we fail with errno = EEXIST.

If the map argument is NULL, a new map is created.

urlmapdel() should now be self explanatory. Note that the order in the map may no longer be the same.

 

RETURN VALUES

All the add functions return the pointer to the map, which may not be the same as passed. As the array are increased in size, it has been realloc'ed.

urlmapdel returns 1 if the key existed (and was deleted) and 0 if it didn't (and no deletion was done.)

 

ERRORS

ENOMEM
From malloc()/realloc(), out of memory.
EEXIST
You tries to add a key that already exists in the map, use urlmapset().

 

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

urlmapdecode(3C), urlmapencode(3C), urlmapnencode(3C), urlmapfree(3C), urlmapnset(3C), urlmapset(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