libowfat/stralloc/stralloc_copys.3
leitner 5eb1cdf888 cleanups in stralloc and buffer:
int -> long for sizes
    char -> unsigned char for strings
2004-11-25 21:29:35 +00:00

21 lines
667 B
Groff

.TH stralloc_copys 3
.SH NAME
stralloc_copys \- copy data into a stralloc
.SH SYNTAX
.B #include <stralloc.h>
int \fBstralloc_copys\fP(stralloc* \fIsa\fR,const unsigned char* \fIbuf\fR);
.SH DESCRIPTION
stralloc_copys copies a \\0-terminated string from \fIbuf\fR into
\fIsa\fR, without the \\0. It is the same as
\fBstralloc_copyb\fR(&\fIsa\fR, \fIbuf\fR, str_len(\fIbuf\fR)).
The data that \fIsa\fR previously contained is overwritten and truncated.
If stralloc_copys runs out of memory, stralloc_copys leaves \fIsa\fR
alone and return 0, otherwise it returns 1.
.SH "RETURN VALUE"
1 for success, 0 on memory allocation failure.
.SH "SEE ALSO"
stralloc_copyb(3)