Zend Lists - Adding my own type
| From: | Mike Berry-Porter | Date: | Thu, 28 Sep 2000 01:27:59 +0000 |
| Subject: | Zend Lists - Adding my own type | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-33798@lists.php.net to get a copy of this message | ||
Hi,
I'm wanting to add support to PHP for a C based module I wrote (a self
contained module). It supports a special file type, and most of my functions
evolve around a "file pointer" of mine which is a simple structure. E.g:
MY_FILE *myFilePtr;
myFilePtr = my_file_open();
my_file_do_this(myFilePtr);
my_file_do_that(myFilePtr);
my_file_close(myFilePtr);
bla bla bla...
Looking through some of the extensions that come with PHP 4.0.2 (e.g. PDF,
OCI8, etc.) I can see the functions I need to use (at least I think they're
the right ones). They are:
zend_list_insert()
zend_list_find()
zend_list_delete()
This seems to make sense. However, I've had a bit of trouble understanding
some of the other functions that are needed to add my own type to the Zend
list, specifically my own "globals". Looking at the samples I can then
return an INT id to the user to use with other functions that will bring
back my "file pointer" for use in other functions. I also don't understand
the difference between ZTS (I'm assuming Zend Thread Safe) and no ZTS being
defined, and how that impacts the "globals". To be specific, my library does
NOT make use of globals itself, only a MY_FILE pointer that is sent to the
user to use. I would like to give the user the option to create two or more
files in one PHP "instance".
Can anyone out there help with this, or is there a ZEND function reference
page I can look at?
Thanks,
Mike Berry-Porter
mikebp@alverstone.com.au