cvs: /php4 NEWS /php4/ext/standard file.c

From: Date: Mon, 24 Apr 2000 14:18:42 +0000
Subject: cvs: /php4 NEWS /php4/ext/standard file.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-13964@lists.php.net to get a copy of this message
andrei Mon Apr 24 07:18:42 2000 EDT Modified files: /php4 NEWS /php4/ext/standard file.c Log: The third argument to fseek() is now one of the standard SEEK_* constants. # The previous change to support seekfrom stuff was incorrect. Index: php4/NEWS diff -u php4/NEWS:1.214 php4/NEWS:1.215 --- php4/NEWS:1.214 Sun Apr 23 18:09:13 2000 +++ php4/NEWS Mon Apr 24 07:18:11 2000 @@ -2,7 +2,8 @@ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2000, Version 4.0.0 Release -- Add an optional third argument to fseek to indicate were to seek from. (Sterling) +- Add an optional third argument to fseek to indicate were to seek from. + (Andrei) - OCIBindByName() will no longer complain about bindlength beeing zero. (Thies) - Converted the IMAP module to the high performance API (Zeev) - The fgetcsv() function now handles embedded end-of-line in a quoted field Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.74 php4/ext/standard/file.c:1.75 --- php4/ext/standard/file.c:1.74 Sun Apr 23 12:16:24 2000 +++ php4/ext/standard/file.c Mon Apr 24 07:18:11 2000 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.74 2000/04/23 19:16:24 sterling Exp $ */ +/* $Id: file.c,v 1.75 2000/04/24 14:18:11 andrei Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -286,6 +286,10 @@ FIL(pclose_ret) = 0; #endif + REGISTER_LONG_CONSTANT("SEEK_SET", SEEK_SET, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SEEK_CUR", SEEK_CUR, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SEEK_END", SEEK_END, CONST_CS | CONST_PERSISTENT); + return SUCCESS; } @@ -1183,13 +1187,13 @@ } /* }}} */ -/* {{{ proto int fseek(int fp, int offset [, int seekfrom]) +/* {{{ proto int fseek(int fp, int offset [, int whence]) Seek on a file pointer */ PHP_FUNCTION(fseek) { - pval **arg1, **arg2, **arg3; - int argcount = ARG_COUNT(ht), seekfrom = 0; + zval **arg1, **arg2, **arg3; + int argcount = ARG_COUNT(ht), whence = SEEK_SET; void *what; if (argcount < 2 || argcount > 3 || @@ -1203,10 +1207,10 @@ convert_to_long_ex(arg2); if (argcount > 2) { convert_to_long_ex(arg3); - seekfrom = (*arg3)->value.lval; + whence = (*arg3)->value.lval; } - RETURN_LONG(fseek((FILE*)what,(*arg2)->value.lval+seekfrom,SEEK_SET)); + RETURN_LONG(fseek((FILE*)what, (*arg2)->value.lval, whence)); } /* }}} */

« previous php.version4 (#13964) next »