# HG changeset patch # User roug # Date 1034363461 0 # Node ID 10d95ea9f14093a010cbe41ed070b506637f3c79 # Parent 85a3168ccab582655e2651b84065f2d2350fcb6b Finished these entries diff -r 85a3168ccab5 -r 10d95ea9f140 docs/ccguide/malloc.refentry --- a/docs/ccguide/malloc.refentry Fri Oct 11 18:49:02 2002 +0000 +++ b/docs/ccguide/malloc.refentry Fri Oct 11 19:11:01 2002 +0000 @@ -1,14 +1,27 @@ -malloc -Placeholder +Malloc +Free +Calloc +memory allocation - malloc - type arg1 + char *malloc + unsigned size + + + + free + char *ptr + + + + char *calloc + unsignednel + unsignedelsize @@ -16,7 +29,21 @@ Description -Placeholder +Malloc returns a pointer to a block of at least "size" free bytes. + + +Free requires a pointer to a block that has been allocated by +malloc; it frees the space to be allocated again. + + +Calloc allocates space for an array. Nel is the number of +elements in the arrary, and elsize is the size of each element. +Calloc initializes the space to zero. + +Diagnostics + +Malloc, free, and calloc return NULL(0) if no free memory can +be found or if there was an error. diff -r 85a3168ccab5 -r 10d95ea9f140 docs/ccguide/setbuf.refentry --- a/docs/ccguide/setbuf.refentry Fri Oct 11 18:49:02 2002 +0000 +++ b/docs/ccguide/setbuf.refentry Fri Oct 11 19:11:01 2002 +0000 @@ -1,7 +1,7 @@ -setbuf -Placeholder +Setbuf +fix file buffer @@ -11,7 +11,8 @@ setbuf - type arg1 + FILE *fp + char *buffer @@ -19,7 +20,33 @@ Description -Placeholder +When the first character is written to or read from a file +after it has been opened by "fopen()", a buffer is obtained +from the system if required and assigned to it. Setbuf may be +used to forestall this by assigning a user buffer to the file. + + +Setbuf must be used after the file has been opened and before +any I/O has taken place. + + +The buffer must be of sufficient size and a value for a +manifest constant, BUFSIZ, is defined in the header file for +use in declarations. + + +If the "buffer" argument is NULL (0), the file becomes unbuffered +and characters are read or written singly. + + +NOTE that the standard error output is unbuffered and the +standard output is buffered. + + +See Also + +fopen(),getc(),putc() +