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

Ns_DStringValue

Overview

Return the current value of an Ns_DString

Syntax

    char *Ns_DStringValue(
    	Ns_DString *dsPtr
    );

Description

The Ns_DStringValue macro returns a pointer to the current value of an Ns_DString. This may be a pointer to the Ns_DString's static space or to a string allocated on the heap if the static space has overflowed. It is not safe to use the value returned by this macro after an intervening call to Ns_DStringAppend because the Ns_DString string could overflow to or move within the heap.

Example

    Ns_DString ds;
    Ns_DStringInit(&ds);
    Ns_DStringAppend(&ds, "foo");
    /* do something with the dstring */
    printf ("%s\n", Ns_DStringValue(&ds));
    Ns_DStringFree(&ds); /* finished with dstring */

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1996 America Online, Inc.