Skip to content

Commit

Permalink
Added notes about locking functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia Alshanetsky committed Mar 4, 2003
1 parent cf7101d commit 6efd9ea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.STREAMS
Expand Up @@ -37,9 +37,10 @@ PHPAPI int php_stream_close(php_stream * stream);
PHPAPI int php_stream_flush(php_stream * stream); PHPAPI int php_stream_flush(php_stream * stream);
PHPAPI int php_stream_seek(php_stream * stream, off_t offset, int whence); PHPAPI int php_stream_seek(php_stream * stream, off_t offset, int whence);
PHPAPI off_t php_stream_tell(php_stream * stream); PHPAPI off_t php_stream_tell(php_stream * stream);
PHPAPI int php_stream_lock(php_stream * stream, int mode);


These (should) behave in the same way as the ANSI stdio functions with similar These (should) behave in the same way as the ANSI stdio functions with similar
names: fread, fwrite, fprintf, feof, fgetc, fgets, fclose, fflush, fseek, ftell. names: fread, fwrite, fprintf, feof, fgetc, fgets, fclose, fflush, fseek, ftell, flock.


Opening Streams Opening Streams
=============== ===============
Expand Down Expand Up @@ -157,6 +158,11 @@ can lead to a crash when the resource is later used/released.
NOTE: If you are opening a stream and need it to be seekable, use the NOTE: If you are opening a stream and need it to be seekable, use the
STREAM_MUST_SEEK option to php_stream_open_wrapper(); STREAM_MUST_SEEK option to php_stream_open_wrapper();


PHPAPI int php_stream_supports_lock(php_stream * stream);

This function will return either 1 (success) or 0 (failure) indicating whether or
not a lock can be set on this stream. Typically you can only set locks on stdio streams.

Casting Streams Casting Streams
=============== ===============
What if your extension needs to access the FILE* of a user level file pointer? What if your extension needs to access the FILE* of a user level file pointer?
Expand Down

0 comments on commit 6efd9ea

Please sign in to comment.