Back to index

glibc  2.9
Defines | Functions
wfiledoalloc.c File Reference
#include "libioP.h"
#include <sys/types.h>
#include <sys/stat.h>

Go to the source code of this file.




int _IO_wfile_doallocate (_IO_FILE *fp)

Define Documentation


Definition at line 61 of file wfiledoalloc.c.

Function Documentation

Definition at line 85 of file wfiledoalloc.c.

  _IO_size_t size;
  wchar_t *p;

  /* Allocate room for the external buffer.  */
  if (fp->_IO_buf_base == NULL)
    INTUSE(_IO_file_doallocate) (fp);

  /* If narrow buffer is user allocated (set by setvbuf etc.),
     use that size as the size of the wide buffer, when it is
     allocated by _IO_file_doallocate, multiply that by size
     of the wide character.  */
  size = fp->_IO_buf_end - fp->_IO_buf_base;
  if ((fp->_flags & _IO_USER_BUF))
    size = (size + sizeof (wchar_t) - 1) / sizeof (wchar_t);
  ALLOC_WBUF (p, size * sizeof (wchar_t), EOF);
  INTUSE(_IO_wsetb) (fp, p, p + size, 1);
  return 1;

Here is the call graph for this function:

Here is the caller graph for this function: