JavaScript-1.5 Reference

JS_NewStringCopyZ Function

Summary

Creates a new JS string and ensures that the resulting string is null-terminated.

Syntax

JSString * JS_NewStringCopyZ(JSContext *cx, const char *s);
NameTypeDescription
cxJSContext *Pointer to a JS context from which to derive runtime information.
sconst char *Pointer to the character array containing the text for the JS string to create.

Description

JS_NewStringCopyZ allocates space for a new JS string and its underlying storage, and then copies the contents of a C character array, s, into the new string. The new JS string is guaranteed to be null-terminated.

If the allocation is successful, JS_NewStringCopyZ returns a pointer to the JS string. Otherwise it returns an empty string.

See Also

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JS_CompareStrings | JS_ConvertValue | JS_GetEmptyStringValue | JS_GetStringBytes | JS_GetStringChars | JS_GetStringLength | JS_InternString | JS_InternUCString | JS_InternUCStringN | JS_NewArrayObject | JS_NewDouble | JS_NewFunction | JS_NewObject | JS_NewString | JS_NewStringCopyN | JS_NewUCString | JS_NewUCStringCopyN | JS_NewUCStringCopyZ | JS_ValueToString | JS_malloc ]

This page was generated by APIDOC