.\" Process this file with .\" groff -man -Tascii cryptday.1 .\" .TH js_str2js 3 "August 2000" JS "js library reference" .\" We don't want hyphenation (it's too ugly) .\" We also disable justification when using nroff .hy 0 .if n .na .SH NAME js_str2js \- convert a standard character array in to a js_string object .SH SYNOPSIS .nf .B #include "JsStr.h" .sp .B "int js_str2js(js_string *js, char *string, int count, int size);" .fi .SH DESCRIPTION .B js_str2js converts the string pointed to by .I string in to a .I js_string object. The .I js_string object in question needs to have been previously created, and any string currently in the .I js_string object will be cloberred. .SH ARGUMENTS .B js is a pointer to the .I js_string object we will place the converted character array in. .B string is the character array we are converting in to a .I js_string object. .B count is the length of the character array we are converting, measured in .I units. The size of a .I unit is one or more octets long, determined by .B size .B size is the number of octets a single unit of the .I js_string object is. This needs to agree with the internal value of .I unit length in the .I js_string object, otherwise the function will return an error and the string will not be converted. .B js_str2js returns .I JS_SUCCESS on successful conversion of the string, .I JS_ERROR otherwise. .SH EXAMPLE The following example creates a .B js_string object that is given the string "What's up doc?" .nf js_string *foo; foo = js_create(256,1); js_str2js(foo,"What's up doc?",14,1); .fi .SH AUTHOR Sam Trenholme <kiwi-zttfryb@koala.samiam.org>