summaryrefslogtreecommitdiff
path: root/lib/tempname.h
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* tempname: remove incorrect commentPaul Eggert2022-08-151-1/+1
| | | | | * lib/tempname.c, lib/tempname.h: Remove incorrect comment, as the names are not necessarily hard to predict (Bug#57129).
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* Put LGPLv2+ notices in source files where appropriate.Bruno Haible2021-06-041-7/+7
| | | | | * lib/**.{h,c,gperf}: Use LGPLv2+ notice whenever the module description says so.
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* tempname: merge from glibc and coreutilsPaul Eggert2020-05-311-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Also, merge in Gnulib’s more-recent methods of making it easier to share between Gnulib and glibc, and fix a few randomness glitches. * lib/tempname.c: Include libc-config.h, not config.h, if !_LIBC. (__set_errno): Remove; libc-config.h does that for us. Do not include <sys/time.h>. (__secure_getenv) [_LIBC]: New macro. (__try_tempname, __getpid, __gettimeofday) [!_LIBC]: Remove macros. (RANDOM_BITS): Rewrite. (RANDOM_VALUE_MAX, BASE_62_DIGITS, BASE_62_POWER): New macros. (random_value): New typedef. (try_file, try_dir, try_nocreate): Move up. (gen_tempname_len, try_tempname_len): New functions. (gen_tempname_len): Use a constant array rather than a switch. (try_tempname_len): Don’t assume string length fits in int. Generalize use of RANDOM_BITS. If _LIBC, don’t assume RANDOM_BITS has enough entropy (it’s a bit short). (__gen_tempname): Rewrite in terms of gen_tempname_len. (__try_tempname): Rewrite in terms of try_tempname_len. * lib/tempname.h (gen_tempname_len, try_tempname_len): New decls. * modules/tempname (Depends-on): Remove gettimeofday, sys_time. Add getentropy, libc-config.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* tempname: allow compilation with C++ (trivial)Mike Miller2015-02-171-3/+11
| | | | | | | * lib/tempname.h [C++]: Specify extern "C" linkage. * lib/tempname.h (try_tempname): * lib/tempname.c (__try_tempname, __gen_tempname): Rename 'try' to 'tryfunc'.
* maint: various whitespace cleanups in tempnamePádraig Brady2015-02-111-2/+2
| | | | | | | | | | Recent changes to the tempname module, introduced whitespace inconsistencies that are triggering issues in coreutils diffs generated against the new files. * lib/tempname.c: Normalize spacing and line length. * lib/tempname.h: Likewise. * modules/tempname: Likewise.
* tempname: new try_tempname functionAndreas Gruenbacher2015-02-041-0/+7
| | | | | | | | | | | | | The way how gen_tempname() creates files is not always sufficient. For example, it may make sense to create directories when creating the temporary file or directory fails with errno set to ENOENT. Add a try_tempname() variant of gen_tempname() that allows that. Implement gen_tempname() on top of it. * lib/tempname.c (try_tempname): New function and backend of gen_tempname(). (try_file, try_dir, try_nocreate): Callbacks to use for the different kinds that gen_tempname supports (GT_FILE, GT_DIR, GT_NOCREATE). * lib/tempname.h (try_tempname): Declare here. * modules/tempname: Mention try_tempname.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* Use spaces for indentation, not tabs.Bruno Haible2009-12-101-5/+5
|
* tempname: resync from glibcEric Blake2009-11-041-7/+20
| | | | | | | | | | | | | | | * lib/tempname.c (__gen_tempname): Add suffixlen argument. Use same values for __GT_FILE as glibc. Abort even when assertions are disabled. * lib/tempname.h (GT_FILE): Use glibc __GT_FILE, if available, and match its value otherwise. Allow idempotent inclusion. * lib/mkdtemp.c (mkdtemp): Adjust caller. * lib/mkostemp.c (mkostemp): Likewise. * lib/mkstemp.c (mkstemp): Likewise. * lib/tmpfile.c (tmpfile): Likewise. * NEWS: Document this. Signed-off-by: Eric Blake <ebb9@byu.net>
* New module 'mkostemp'.Bruno Haible2009-08-231-4/+2
|
* Change copyright notice from GPLv2+ to GPLv3+.Bruno Haible2007-10-071-5/+4
|
* * MODULES.html.sh: Document tempname.Eric Blake2006-10-271-0/+40
* modules/mkstemp (Depends-on): Add tempname, and drop transitive dependencies. (Files): Move lib/tempname.c... * modules/tempname: ...to this new module. * m4/mkstemp.m4 (gl_FUNC_MKSTEMP): Remove tempname checks. (gl_PREREQ_TEMPNAME): Move... * m4/tempname.m4: ...to this new file. * lib/mkstemp.c (includes) [!_LIBC]: Use tempname.h. * modules/sys_stat (Depends-on): Add stat-macros. * lib/stat_.h (includes): Pick up stat macros. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Replace <sys/stat.h> if stat macros are broken. * lib/tempname.c (includes): No need to include "stat-macros.h". (__gen_tempname) [!_LIBC]: Expose as gen_tempname. (direxists, __path_search) [!_LIBC]: Don't compile these in gnulib; the tmpdir module covers that. * lib/tempname.h: New file.