php-src/ext/sablot/php_sablot.h
Sterling Hughes 0a1f0ea22e Major rework of the basic api which provides:
- All Sablotron errors are now caught meaning nothing is
          ever outputted directly to the screen allowing you to
          catch all errors.
        - A mechanism is provided for you to have an error function
          which recieves all sablotron errors.
        - All of the basic functions re-use a single processor increasing
          performance (especially with high loads).
        - Added a bunch of comments, more to come (this way other people
          can easily modify my source).

@ Added the xslt_set_error_handler() function to the Sablotron extension.
@ (Sterling)

@ Improved Sablotron's error handling system allowing you to catch all
@ errors before they are outputted to the screen. (Sterling)
2000-11-21 12:12:19 +00:00

130 lines
3.4 KiB
C

/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_02.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Sterling Hughes <Sterling.Hughes@pentap.net> |
+----------------------------------------------------------------------+
*/
#ifndef PHP_SABLOT_H
#define PHP_SABLOT_H
#if HAVE_SABLOT
#include <sablot.h>
extern zend_module_entry sablot_module_entry;
#define phpext_sablot_ptr &sablot_module_entry
#ifdef PHP_WIN32
#define PHP_SABLOT_API __declspec(dllexport)
#else
#define PHP_SABLOT_API
#endif
/* Module functions */
PHP_MINIT_FUNCTION(sablot);
PHP_MSHUTDOWN_FUNCTION(sablot);
PHP_MINFO_FUNCTION(sablot);
/* Output transformation functions */
PHP_FUNCTION(xslt_output_begintransform);
PHP_FUNCTION(xslt_output_endtransform);
/* Basic transformation functions */
PHP_FUNCTION(xslt_transform);
PHP_FUNCTION(xslt_process);
/* Advanced API transformation functions */
PHP_FUNCTION(xslt_create);
PHP_FUNCTION(xslt_run);
PHP_FUNCTION(xslt_set_sax_handler);
PHP_FUNCTION(xslt_set_error_handler);
PHP_FUNCTION(xslt_fetch_result);
PHP_FUNCTION(xslt_free);
/* Error Handling functions */
PHP_FUNCTION(xslt_error);
PHP_FUNCTION(xslt_errno);
PHP_FUNCTION(xslt_openlog);
PHP_FUNCTION(xslt_closelog);
/* Sablotron error structure */
struct _php_sablot_error {
char *key;
char *value;
struct _php_sablot_error *next;
};
typedef struct _php_sablot_error php_sablot_error;
/* Sablotron Handle */
typedef struct {
/* Error Handling */
zval *errorHandler;
php_sablot_error *errors;
php_sablot_error errors_start;
int last_errno;
/* SAX Handling */
long index;
zval *startDocHandler;
zval *startElementHandler;
zval *endElementHandler;
zval *startNamespaceHandler;
zval *endNamespaceHandler;
zval *commentHandler;
zval *PIHandler;
zval *charactersHandler;
zval *endDocHandler;
/* Sablotron Related */
SablotHandle p;
} php_sablot;
/* Sablotron Globals */
typedef struct {
zval *errorHandler;
SablotHandle processor;
php_sablot_error *errors;
php_sablot_error errors_start;
char *output_transform_file; /* For output transformations */
int last_errno; /* Global last_errno, if no handle is found */
} php_sablot_globals;
#ifdef ZTS
#define SABLOTG(v) (sablot_globals->v)
#define SABLOTLS_FETCH() php_sablot_globals *sablot_globals = ts_resource(sablot_globals_id)
#define SABLOTG_HANDLE (*sablot_globals)
#else
#define SABLOTG(v) (sablot_globals.v)
#define SABLOTG_HANDLE sablot_globals
#define SABLOTLS_FETCH()
#endif
#else
#define phpext_sablot_ptr NULL
#endif
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/