Mercurial > hg > octave-lojdl
changeset 10178:6bd86b6287b1
provide wrapper for tempnam
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 21 Jan 2010 02:53:37 -0500 |
parents | cb3d926b4d9e |
children | 326746625a51 |
files | liboctave/ChangeLog liboctave/file-ops.cc liboctave/lo-cutils.c liboctave/lo-utils.h |
diffstat | 4 files changed, 16 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2010-01-21 John W. Eaton <jwe@octave.org> + + * lo-cutils.c (octave_tempnam): New funtion. + * lo-utils.h: Provide decl. + * file-ops.cc (file_ops::tempnam): Call octave_tempnam. + 2010-01-21 John W. Eaton <jwe@octave.org> * lo-cutils.c (octave_readlink): New funtion.
--- a/liboctave/file-ops.cc +++ b/liboctave/file-ops.cc @@ -523,7 +523,7 @@ const char *ppfx = pfx.empty () ? 0 : pfx.c_str (); - char *tmp = ::tempnam (pdir, ppfx); + char *tmp = octave_tempnam (pdir, ppfx); if (tmp) {
--- a/liboctave/lo-cutils.c +++ b/liboctave/lo-cutils.c @@ -145,6 +145,12 @@ return strncasecmp (s1, s2, n); } +OCTAVE_API char * +octave_tempnam (const char *pdir, const char *ppfx) +{ + return tempnam (pdir, ppfx); +} + OCTAVE_API mode_t octave_umask (mode_t mode) {
--- a/liboctave/lo-utils.h +++ b/liboctave/lo-utils.h @@ -78,6 +78,9 @@ extern "C" OCTINTERP_API int octave_strncasecmp (const char *s1, const char *s2, size_t n); +extern "C" OCTAVE_API char * +octave_tempnam (const char *pdir, const char *ppfx); + extern "C" OCTAVE_API mode_t octave_umask (mode_t); extern "C" OCTAVE_API int octave_unlink (const char *name);