-/* Copyright (C) 1991, 1992, 1996, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996, 1998, 2004 Free Software Foundation, Inc.
This file is derived from mkstemp.c from the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
#include "config.h"
#endif
+#include <sys/types.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#define TMP_MAX 16384
#endif
-/* Generate a unique temporary file name from TEMPLATE.
+/*
- TEMPLATE has the form:
+@deftypefn Replacement int mkstemps (char *@var{template}, int @var{suffix_len})
- <path>/ccXXXXXX<suffix>
+Generate a unique temporary file name from @var{template}.
+@var{template} has the form:
- SUFFIX_LEN tells us how long <suffix> is (it can be zero length).
+@example
+ @var{path}/ccXXXXXX@var{suffix}
+@end example
- The last six characters of TEMPLATE before <suffix> must be "XXXXXX";
- they are replaced with a string that makes the filename unique.
+@var{suffix_len} tells us how long @var{suffix} is (it can be zero
+length). The last six characters of @var{template} before @var{suffix}
+must be @samp{XXXXXX}; they are replaced with a string that makes the
+filename unique. Returns a file descriptor open on the file for
+reading and writing.
+
+@end deftypefn
+
+*/
- Returns a file descriptor open on the file for reading and writing. */
int
-mkstemps (template, suffix_len)
- char *template;
- int suffix_len;
+mkstemps (char *template, int suffix_len)
{
static const char letters[]
= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";