summaryrefslogtreecommitdiff
path: root/ext/sablot/php_sablot.h
diff options
context:
space:
mode:
authorSterling Hughes <sterling@php.net>2000-11-21 12:12:19 +0000
committerSterling Hughes <sterling@php.net>2000-11-21 12:12:19 +0000
commit0a1f0ea22eccdc666df117f9b686ffaab231c149 (patch)
tree04d2c4f36941b762a20c07b74dc17a9eb87f2c34 /ext/sablot/php_sablot.h
parent358731195fd8d60e9e5e63d77430c96d32300412 (diff)
downloadphp-git-0a1f0ea22eccdc666df117f9b686ffaab231c149.tar.gz
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)
Diffstat (limited to 'ext/sablot/php_sablot.h')
-rw-r--r--ext/sablot/php_sablot.h53
1 files changed, 39 insertions, 14 deletions
diff --git a/ext/sablot/php_sablot.h b/ext/sablot/php_sablot.h
index 3879965668..fff7ddab6c 100644
--- a/ext/sablot/php_sablot.h
+++ b/ext/sablot/php_sablot.h
@@ -32,34 +32,53 @@ extern zend_module_entry sablot_module_entry;
#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_fetch_result);
-PHP_FUNCTION(xslt_openlog);
-PHP_FUNCTION(xslt_closelog);
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 {
- long index;
+
+ /* Error Handling */
+ zval *errorHandler;
+ php_sablot_error *errors;
+ php_sablot_error errors_start;
int last_errno;
- php_sablot_error *errors, errors_start;
+
+ /* SAX Handling */
+ long index;
zval *startDocHandler;
zval *startElementHandler;
zval *endElementHandler;
@@ -69,37 +88,43 @@ typedef struct {
zval *PIHandler;
zval *charactersHandler;
zval *endDocHandler;
+
+ /* Sablotron Related */
SablotHandle p;
+
} php_sablot;
+
+/* Sablotron Globals */
typedef struct {
- char *output_transform_file;
- int le_sablot;
- int last_errno;
- int processor;
+ 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:
- */
+ */ \ No newline at end of file