
/* tmpfile.c - ryb */

#include <stdio.h>
#include <string.h>


FILE *
tmpfile (void)
{
  static int count;
  char name[16];
  FILE *temp_file;
  char *n;

  __tmpnam (name, __get_temp_path (), "F", &count);
  n = strdup (name);
  if (n == NULL)
    return NULL;
  temp_file = fopen (name, "wb+");
  if (!temp_file)
    return NULL;
  temp_file->_tempname = n;

  return temp_file;
}
