cvs: /php3 ChangeLog configure.in php.h /php3/functions file.c file.h

From: Date: Mon, 15 Nov 1999 11:45:39 +0000
Subject: cvs: /php3 ChangeLog configure.in php.h /php3/functions file.c file.h
Groups: php.dev 
Request: Send a blank email to php-dev+get-12564@lists.php.net to get a copy of this message
ssb Mon Nov 15 06:45:39 1999 EDT Modified files: /php3 ChangeLog configure.in php.h /php3/functions file.c file.h Log: Added tmpfile() function. Index: php3/ChangeLog diff -u php3/ChangeLog:1.793 php3/ChangeLog:1.794 --- php3/ChangeLog:1.793 Fri Nov 12 18:26:20 1999 +++ php3/ChangeLog Mon Nov 15 06:45:37 1999 @@ -2,6 +2,7 @@ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Nov 15, 1999, Version 3.0.13 +- Added tmpfile() function (Stig) - fixed trim(), chop(), ltrim(), etc. to remove NULL characters as well. (Colin Viebrock) - krsort() added, although someone forgot to mention it ... (Thies) Index: php3/configure.in diff -u php3/configure.in:1.472 php3/configure.in:1.473 --- php3/configure.in:1.472 Wed Nov 10 14:54:11 1999 +++ php3/configure.in Mon Nov 15 06:45:37 1999 @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.472 1999/11/10 19:54:11 rasmus Exp $ +dnl $Id: configure.in,v 1.473 1999/11/15 11:45:37 ssb Exp $ dnl Process this file with autoconf to produce a configure script. AC_INIT(main.c) @@ -252,7 +252,7 @@ dnl Checks for library functions. AC_FUNC_VPRINTF -AC_CHECK_FUNCS(memcpy memmove strdup strerror strcasecmp strstr flock lockf putenv tempnam usleep setlocale gettimeofday setvbuf srand48 lrand48 srandom random link symlink regcomp getlogin cuserid vsnprintf gcvt utime crypt setitimer rint unsetenv strftime setsockopt tzset statvfs statfs inet_aton shutdown truncate getpgid getsid getrlimit snprintf ctermid setsid mkfifo mkstemp) +AC_CHECK_FUNCS(memcpy memmove strdup strerror strcasecmp strstr flock lockf putenv tempnam usleep setlocale gettimeofday setvbuf srand48 lrand48 srandom random link symlink regcomp getlogin cuserid vsnprintf gcvt utime crypt setitimer rint unsetenv strftime setsockopt tzset statvfs statfs inet_aton shutdown truncate getpgid getsid getrlimit snprintf ctermid setsid mkfifo) AC_FUNC_UTIME_NULL AC_FUNC_ALLOCA AC_BROKEN_SPRINTF Index: php3/php.h diff -u php3/php.h:1.63 php3/php.h:1.64 --- php3/php.h:1.63 Mon Nov 8 04:09:40 1999 +++ php3/php.h Mon Nov 15 06:45:37 1999 @@ -28,7 +28,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php.h,v 1.63 1999/11/08 09:09:40 ssb Exp $ */ +/* $Id: php.h,v 1.64 1999/11/15 11:45:37 ssb Exp $ */ #ifndef _PHP_H #define _PHP_H @@ -208,10 +208,6 @@ #ifndef HAVE_STRERROR extern char *strerror(int); -#endif - -#ifdef HAVE_MKSTEMP -# define mktemp mkstemp #endif #include "fopen-wrappers.h" Index: php3/functions/file.c diff -u php3/functions/file.c:1.226 php3/functions/file.c:1.227 --- php3/functions/file.c:1.226 Tue Sep 21 13:46:53 1999 +++ php3/functions/file.c Mon Nov 15 06:45:38 1999 @@ -26,7 +26,7 @@ | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.226 1999/09/21 17:46:53 rasmus Exp $ */ +/* $Id: file.c,v 1.227 1999/11/15 11:45:38 ssb Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif @@ -206,6 +206,7 @@ PHP_FE(rename, NULL) {"copy", php3_file_copy, NULL}, PHP_FE(tempnam, NULL) + PHP_FE(tmpfile, NULL) PHP_FE(file, NULL) PHP_FE(flock, NULL) PHP_FE(fgetcsv, NULL) @@ -469,6 +470,25 @@ RETURN_FALSE; } RETURN_STRING(t,1); +} +/* }}} */ + +/* {{{ proto int tmpfile() + Create a temporary file that will be deleted automatically after use. */ +PHP_FUNCTION(tmpfile) +{ + FILE *fp; + int id; + if (ARG_COUNT(ht) != 0) { + WRONG_PARAM_COUNT; + } + fp = tmpfile(); + if (fp == NULL) { + php3_error(E_WARNING, "tmpfile: %s", strerror(errno)); + RETURN_FALSE; + } + id = php3_list_insert(fp, GLOBAL(le_fp)); + RETURN_LONG(id); } /* }}} */ Index: php3/functions/file.h diff -u php3/functions/file.h:1.30 php3/functions/file.h:1.31 --- php3/functions/file.h:1.30 Sun Jun 13 06:07:43 1999 +++ php3/functions/file.h Mon Nov 15 06:45:38 1999 @@ -27,7 +27,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.h,v 1.30 1999/06/13 10:07:43 sas Exp $ */ +/* $Id: file.h,v 1.31 1999/11/15 11:45:38 ssb Exp $ */ #ifndef _FILE_H #define _FILE_H @@ -41,6 +41,7 @@ extern int php3_minit_file(INIT_FUNC_ARGS); extern void php3_tempnam(INTERNAL_FUNCTION_PARAMETERS); +PHP_FUNCTION(tmpfile); extern void php3_fopen(INTERNAL_FUNCTION_PARAMETERS); extern void php3_fclose(INTERNAL_FUNCTION_PARAMETERS); extern void php3_popen(INTERNAL_FUNCTION_PARAMETERS);

« previous php.dev (#12564) next »