Mercurial > hg > Members > kono > nitros9-code
changeset 527:10d95ea9f140
Finished these entries
author | roug |
---|---|
date | Fri, 11 Oct 2002 19:11:01 +0000 |
parents | 85a3168ccab5 |
children | 85f6bd08ee7e |
files | docs/ccguide/malloc.refentry docs/ccguide/setbuf.refentry |
diffstat | 2 files changed, 63 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ <refentry id="malloc"> <refnamediv> -<refname>malloc</refname> -<refpurpose>Placeholder</refpurpose> +<refname>Malloc</refname> +<refname>Free</refname> +<refname>Calloc</refname> +<refpurpose>memory allocation</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> - <funcdef><function>malloc</function></funcdef> - <paramdef>type <parameter>arg1</parameter></paramdef> + <funcdef>char *<function>malloc</function></funcdef> + <paramdef>unsigned <parameter>size</parameter></paramdef> +</funcprototype> + +<funcprototype> + <funcdef><function>free</function></funcdef> + <paramdef>char *<parameter>ptr</parameter></paramdef> +</funcprototype> + +<funcprototype> + <funcdef>char *<function>calloc</function></funcdef> + <paramdef>unsigned<parameter>nel</parameter></paramdef> + <paramdef>unsigned<parameter>elsize</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -16,7 +29,21 @@ <refsect1><title>Description</title> <para> -Placeholder +Malloc returns a pointer to a block of at least "size" free bytes. +</para> +<para> +Free requires a pointer to a block that has been allocated by +malloc; it frees the space to be allocated again. +</para> +<para> +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. +</para> +<refsect1><title>Diagnostics</title> +<para> +Malloc, free, and calloc return NULL(0) if no free memory can +be found or if there was an error. </para> </refsect1> </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 @@ <refentry id="setbuf"> <refnamediv> -<refname>setbuf</refname> -<refpurpose>Placeholder</refpurpose> +<refname>Setbuf</refname> +<refpurpose>fix file buffer</refpurpose> </refnamediv> <refsynopsisdiv> @@ -11,7 +11,8 @@ </funcsynopsisinfo> <funcprototype> <funcdef><function>setbuf</function></funcdef> - <paramdef>type <parameter>arg1</parameter></paramdef> + <paramdef>FILE *<parameter>fp</parameter></paramdef> + <paramdef>char *<parameter>buffer</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -19,7 +20,33 @@ <refsect1><title>Description</title> <para> -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. +</para> +<para> +Setbuf must be used after the file has been opened and before +any I/O has taken place. +</para> +<para> +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. +</para> +<para> +If the "buffer" argument is NULL (0), the file becomes unbuffered +and characters are read or written singly. +</para> +<para> +NOTE that the standard error output is unbuffered and the +standard output is buffered. +</para> +</refsect1> +<refsect1><title>See Also</title> +<para> +fopen(),getc(),putc() </para> </refsect1> </refentry> +</refentry>