1114402Sru/* Copyright (C) 2001 Free Software Foundation, Inc.
2114402Sru     Written by Werner Lemberg (wl@gnu.org)
3114402Sru
4114402SruThis file is part of groff.
5114402Sru
6114402Srugroff is free software; you can redistribute it and/or modify it under
7114402Sruthe terms of the GNU General Public License as published by the Free
8114402SruSoftware Foundation; either version 2, or (at your option) any later
9114402Sruversion.
10114402Sru
11114402Srugroff is distributed in the hope that it will be useful, but WITHOUT ANY
12114402SruWARRANTY; without even the implied warranty of MERCHANTABILITY or
13114402SruFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14114402Srufor more details.
15114402Sru
16114402SruYou should have received a copy of the GNU General Public License along
17114402Sruwith groff; see the file COPYING.  If not, write to the Free Software
18151497SruFoundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
19114402Sru
20114402Sru
21114402Sru/* This file is heavily based on the file mkstemp.c which is part of the
22114402Sru   fileutils package. */
23114402Sru
24114402Sru
25114402Sruextern int gen_tempname(char *, int = 0);
26114402Sru
27114402Sru/* Generate a unique temporary directory name from TEMPLATE.
28114402Sru   The last six characters of TEMPLATE must be "XXXXXX";
29114402Sru   they are replaced with a string that makes the filename unique.
30114402Sru   Then open the directory and return a fd. */
31114402Sruint mksdir(char *tmpl)
32114402Sru{
33114402Sru  return gen_tempname(tmpl, 1);
34114402Sru}
35