J_PUT_PAIR(3)

FUNCTION
j_put_pair - Add a key-value pair to an associative array.

SYNOPSIS
#include <karma_j.h>

KJoinedPair j_put_pair

(KJoinedPairList list, CONST void *key, uaddr key_length, CONST void *value, uaddr value_length, void *(*value_copy_func) (CONST void *value, uaddr length, flag *ok), void (*value_destroy_func) (void *value), unsigned int replacement_policy, flag front)

DESCRIPTION
Add a key-value pair to an associative array.

list
    The associative array.

key The key.

key_length
    The length of the key, in bytes. If this is 0 and the <<key_copy_func>> is NULL, the key pointer is copied directly. If this is greater than zero and the <<key_copy_func>> is NULL, the specified number of bytes are copied.

value
    The value.

value_length
    The length of the value, in bytes. If this is 0 and the <<value_copy_func>> is NULL, the value pointer is copied directly. If this is greater than zero and the <<value_copy_func>> is NULL, the specified number of bytes are copied.

value_copy_func
    The function used to copy values. The prototype function is <-j_PROTO_value_copy_func->.

value_destroy_func
    The function used to destroy values. The prototype function is <-j_PROTO_value_destroy_func->.

replacement_policy
    The policy to use when adding the pair. See <-j_REPLACEMENT_POLICIES-> for a list of legal values.

front
    If TRUE and the key is new, place the pair at the front of the array. If FALSE and the key is new, place the pair at the end of the array.

RETURN VALUE
A KJoinedPair object on success, else NULL.

Multi-threading Level
Unsafe.

AUTHOR
Richard Gooch (rgooch@atnf.csiro.au)

AVAILABLITY
The Karma Distribution is available for anonymous ftp from: ftp://ftp.atnf.csiro.au/pub/software/karma/ ftp://wuarchive.wustl.edu/graphics/graphics/packages/karma/ ftp://ftp.pwr.wroc.pl/pub/karma/ The Karma Home Page is: http://www.atnf.csiro.au/karma/