Re: error stack
| From: | Sascha Schumann | Date: | Thu, 01 Jul 1999 16:40:10 +0000 |
| Subject: | Re: error stack | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-7948@lists.php.net to get a copy of this message | ||
On Thu, Jul 01, 1999 at 12:12:04PM -0400, Chuck Hagenbuch wrote:
>
> Are there any functions that are called on page start and end? It seems like
> I'll need a global variable of some sort, or a symbol table entry. How do I
> clean it up/make sure it's initialized properly?
See the php3_module_entry struct. It has members for request
startup/shutdown handlers. These are the functions you need to
use.
It's declared in modules.h, and probably used somewhere in the
imap.c file.
> What do I replace "foo" with so that $foo = imap_init_error_queue() and $bar
> = imap_init_error_queue() both work? Or is there a different function I'm
> missing?
Instead of passing a constant string ("foo") build up a buffer,
i.e. char buf[256]; ... snprintf(buf, 255, "%s", "baz");
> The other thing I thought of was sticking:
> pval *imap_error_queue = NIL; in imap.c. Then mm_log would check that for
> NIL; if it was NIL it would php3_error(); if it was set to something then it
> would add an array entry to it. The problem seems to be making sure that
> it's always set to NIL on a page load. Also, where would I free() (efree?)
> the error queue?
That sounds confused. Just store the last error message. You
would efree then in the request shutdown handler.
Queueing probably makes no sense and increases complexity without
adding a considerable benefit for the end-user.
--
Regards,
Sascha Schumann
Consultant