JavaScript-1.5 Reference

JS_strdup Function

Summary

Duplicates a specified string within a specific JS executable script context.

Syntax

char * JS_strdup(JSContext *cx, const char *s);
NameTypeDescription
cxJSContext *Pointer to a JS context from which to derive runtime information.
schar *Pointer to an existing string to duplicate.

Description

JS_strdup duplicates a specified string, s, within a specified JSContext, cx. To duplicate the string, JS_strdup allocates space from the malloc heap for the a copy of the string, and then copies s to the newly allocated location. If the allocation fails, JS_strdup returns a null pointer. Otherwise, it returns a pointer to the duplicate string.

See Also

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JS_NewDouble ]

This page was generated by APIDOC