From 2354c458a8ab6b50990c53b9901e0966cb44ffc9 Mon Sep 17 00:00:00 2001 From: leitner Date: Thu, 17 Oct 2002 18:43:19 +0000 Subject: [PATCH] better return value documentation --- stralloc/stralloc_copyb.3 | 3 +++ stralloc/stralloc_copys.3 | 3 +++ stralloc/stralloc_ready.3 | 3 +++ stralloc/stralloc_readyplus.3 | 3 +++ 4 files changed, 12 insertions(+) diff --git a/stralloc/stralloc_copyb.3 b/stralloc/stralloc_copyb.3 index 93dd1f3..551782c 100644 --- a/stralloc/stralloc_copyb.3 +++ b/stralloc/stralloc_copyb.3 @@ -11,3 +11,6 @@ stralloc_copyb makes sure that \fIsa\fR has enough space allocated to hold \fIbuf\fR into the stralloc. The data that \fIsa\fR previously contained is overwritten and truncated. +.SH "RETURN VALUE" +If stralloc_copys runs out of memory, stralloc_copys leaves \fIsa\fR +alone and return 0, otherwise it returns 1. diff --git a/stralloc/stralloc_copys.3 b/stralloc/stralloc_copys.3 index f6f339d..2181f95 100644 --- a/stralloc/stralloc_copys.3 +++ b/stralloc/stralloc_copys.3 @@ -11,5 +11,8 @@ stralloc_copys copies a \\0-terminated string from \fIbuf\fR into \fBstralloc_copyb\fR(&\fIsa\fR, \fIbuf\fR, str_len(\fIbuf\fR)). The data that \fIsa\fR previously contained is overwritten and truncated. +.SH "RETURN VALUE" +If stralloc_copys runs out of memory, stralloc_copys leaves \fIsa\fR +alone and return 0, otherwise it returns 1. .SH "SEE ALSO" stralloc_copyb(3) diff --git a/stralloc/stralloc_ready.3 b/stralloc/stralloc_ready.3 index e6c68ae..8e33b0d 100644 --- a/stralloc/stralloc_ready.3 +++ b/stralloc/stralloc_ready.3 @@ -12,5 +12,8 @@ stralloc_ready makes sure that \fIsa\fR has enough space allocated to hold not enough to hold \fIlen\fR bytes, stralloc_ready allocates at least \fIlen\fR bytes of space, copies the old string into the new space, frees the old space, and returns 1. Note that this changes \fIsa\fR.s. + +If stralloc_ready runs out of memory, it leaves \fIsa\fR alone and +returns 0. .SH "SEE ALSO" stralloc_readyplus(3) diff --git a/stralloc/stralloc_readyplus.3 b/stralloc/stralloc_readyplus.3 index 5c6ba0a..70437ba 100644 --- a/stralloc/stralloc_readyplus.3 +++ b/stralloc/stralloc_readyplus.3 @@ -14,5 +14,8 @@ additional bytes, stralloc_ready allocates at least \fIsa\fR->len+\fIlen\fR bytes of space, copies the old string into the new space, frees the old space, and returns 1. Note that this changes \fIsa\fR.s. + +If stralloc_readyplus runs out of memory, it leaves \fIsa\fR alone and +returns 0. .SH "SEE ALSO" stralloc_ready(3)