[ Previous ] [ Contents ] [ Index ] [ Next ]

Ns_SetGet

Overview

Return the value for a field

Syntax

    char *Ns_SetGet(
    Ns_Set *set,
    char *key
    );

Description

The Ns_SetGet function returns the value of the first field whose key name matches the given key. Ns_SetGet returns NULL if no field is found. If more than one field in the set has the same key name, Ns_SetGet returns just the first field.

The Ns_SetIGet function is this function's case-insensitive counterpart.

Examples

    Ns_Set *aSet;
    int index;
    
    aSet = Ns_SetCreate("");
    Ns_SetPut(aSet, "Foo", "foovalue");
    Ns_SetPut(aSet, "Bar", "barvalue");
    Ns_Log(Notice, "Value for Foo is %s", Ns_SetGet(aSet, "Foo"));
    Ns_SetFree(aSet);

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1998-99 America Online, Inc.