'\" te .\" Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved .TH SSAStringCpy 3SNMP "30 Apr 2006" "SunOS 5.11" "SNMP Library Functions" .SH NAME SSAStringCpy, SSAStringInit, SSAStringToChar, SSAStringZero \- Sun Solstice Enterprise Agent string helper functions .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lssasnmp\fR [ \fIlibrary\fR .. ] #include \fBvoid *\fR\fBSSAStringZero\fR(\fBString *\fR\fIstring\fR); .fi .LP .nf \fBint\fR \fBSSAStringInit\fR(\fBString *\fR\fIstring\fR, \fBuchar_t *\fR\fIchars\fR, \fBint\fR \fIlen\fR, \fBchar *\fR\fIerror_label\fR); .fi .LP .nf \fBint\fR \fBSSAStringCpy\fR(\fBString *\fR\fIstring1\fR, \fBString *\fR\fIstring2\fR, \fBchar *\fR\fIerror_label\fR); .fi .LP .nf \fBchar *\fR\fBSSAStringToChar\fR(\fBString\fR \fIstring\fR); .fi .SH DESCRIPTION .sp .LP The \fBSSAStringCpy()\fR function makes a deep copy of \fIstring2\fR to \fIstring1\fR. This function assumes that \fIstring1\fR has been processed by the \fBSSAStringZero()\fR function. Memory is allocated inside the \fIstring1\fR and the contents of \fIstring2\fR, not just the pointer, is copied to the \fIstring1\fR. If an error is encountered, an error message is stored in the \fIerror_label\fR buffer. .sp .LP The \fBSSAStringInit()\fR function copies the char array from \fIchars\fR to the string instance with the specified length \fIlen\fR. This function assumes that the string instance has been processed by the \fBSSAStringZero()\fR function or no memory is allocated inside the string instance. If an error is encountered, an error message is stored in the \fIerror_label\fR buffer. .sp .LP The \fBSSAStringToChar()\fR function returns a temporary char array buffer for printing purposes. .sp .LP The \fBSSAStringZero()\fR function frees the memory inside of the String instance, but not the string object itself. .SH RETURN VALUES .sp .LP The \fBSSAStringInit()\fR and \fBSSAStringCpy()\fR functions return \fB0\fR if successful and \fB\(mi1\fR if error. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityObsolete _ MT-LevelUnsafe .TE .SH SEE ALSO .sp .LP \fBattributes\fR(5)