[Main]
Name=tmpnam
Type=Function
Subtype=tigcc.a
Header Files=stdio.h
Definition=char *tmpnam (char *s);

[Description]
Produces a unique random file name.

[Explanation]
tmpnam returns a random file name of 8 characters which does not exist on
the calculator. If <I>s</I> is <A HREF="$$LINK(alloc.h/NULL)">NULL</A>,
tmpnam returns a pointer to a static buffer, otherwise it fills <I>s</I> and
returns a pointer to it. When passing <A HREF="$$LINK(alloc.h/NULL)">NULL</A>
to tmpnam, it is best to treat the pointer returned as if it were pointing to
constant data. It is assumed that the buffer pointed to by <I>s</I> is at
least 9 bytes long.
<BR><BR>
tmpnam is capable of returning <A HREF="$$LINK(stdio.h/TMP_MAX)">TMP_MAX</A> or
<CODE>25^8</CODE> combinations. When nearing
<A HREF="$$LINK(stdio.h/TMP_MAX)">TMP_MAX</A>, performance decreases significantly,
and eventually, the function will run into an infinite loop. These factors,
however, should not pose any problems for the currently supported calculator
platforms. You will run into the maximum number of handles a lot sooner.
<BR><BR>
<B>Note:</B> tmpnam does not actually create any files. If you call it twice
without creating a file whose name equals the first result, it may,
in theory, return the same name again.

[References]
Out=stdlib.h/rand
