root/trunk/php_fastxsl.h

Revision 30, 3.2 kB (checked in by jesus, 7 years ago)

Add fastxsl.replace_document_function option to replace the libxslt provided 'document' function with 'cached_document'

Line 
1 /*
2   +----------------------------------------------------------------------+
3   | PHP Version 4                                                        |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 1997-2003 The PHP Group                                |
6   +----------------------------------------------------------------------+
7   | This source file is subject to version 2.02 of the PHP license,      |
8   | that is bundled with this package in the file LICENSE, and is        |
9   | available at through the world-wide-web at                           |
10   | http://www.php.net/license/2_02.txt.                                 |
11   | If you did not receive a copy of the PHP license and are unable to   |
12   | obtain it through the world-wide-web, please send a note to          |
13   | license@php.net so we can mail you a copy immediately.               |
14   +----------------------------------------------------------------------+
15   | Author: Sterling Hughes <sterling@php.net>                           |
16   |         George Schlossnagle <george@omniti.com>                      |
17   +----------------------------------------------------------------------+
18
19   $Id: php_fastxsl.h,v 1.1.1.1 2004/02/17 23:31:44 sterling Exp $
20 */
21
22 #include "php.h"
23
24 #ifndef PHP_FASTXSL_H
25 #define PHP_FASTXSL_H
26
27 #include <libxml/xmlmemory.h>
28 #include <libxml/debugXML.h>
29 #include <libxml/HTMLtree.h>
30 #include <libxml/xmlIO.h>
31 #include <libxml/xinclude.h>
32 #include <libxml/catalog.h>
33 #include <libxslt/xslt.h>
34 #include <libxslt/xsltInternals.h>
35 #include <libxslt/transform.h>
36 #include <libxslt/xsltutils.h>
37
38 #if HAVE_DOMEXSLT
39 #include <libexslt/exslt.h>
40 #include <libexslt/exsltconfig.h>
41 #endif
42
43 #ifdef FASTXSL_MM
44 #include <mm.h>
45 #endif
46
47 #include <sys/types.h>
48 #include <unistd.h>
49
50 #include "fl_hash.h"
51
52 extern zend_module_entry fastxsl_module_entry;
53 #define phpext_fastxsl_ptr &fastxsl_module_entry
54
55 #ifdef PHP_WIN32
56 #define PHP_FASTXSL_API __declspec(dllexport)
57 #else
58 #define PHP_FASTXSL_API
59 #endif
60
61 #ifdef ZTS
62 #include "TSRM.h"
63 #endif
64
65 PHP_MINIT_FUNCTION(fastxsl);
66 PHP_MSHUTDOWN_FUNCTION(fastxsl);
67 PHP_RINIT_FUNCTION(fastxsl);
68 PHP_RSHUTDOWN_FUNCTION(fastxsl);
69 PHP_MINFO_FUNCTION(fastxsl);
70
71 #define FASTXSL_PRMALLOC 0
72 #define FASTXSL_SHMALLOC 1
73
74 typedef struct {
75 #ifdef FASTXSL_MM
76         MM   *mm;
77 #endif
78         FL_Hash *table;
79         pid_t owner;
80         FL_Hash *prmtable;
81 } fl_cache;
82
83 typedef struct {
84         xmlDocPtr xd;
85         int alloc_type;
86 } php_xd_wrapper;
87
88 #define FASTXSL_STYLESHEET 1
89 #define FASTXSL_XPATHOBJ   2
90 typedef struct {
91         union {
92                 xsltStylesheetPtr ss;
93                 xmlXPathObjectPtr op;
94         } data;
95         int data_type;
96         int allocsize;
97         time_t mtime;
98         int hits;
99         int persistant;
100         int alloc_type;
101 } php_ss_wrapper;
102
103 typedef struct {
104         fl_cache *cache;
105         char     *shmpath;
106         char     *errbuf;
107         long      nostat;
108         long      replace_document_function;
109         long      memalloc;
110         long      register_functions;
111         long      tmp_allocated_size;
112 } zend_fastxsl_globals;
113
114 #define PHP_FASTXSL_VERSION "1.0"
115
116 #ifdef ZTS
117 #define FASTXSL_G(v) TSRMG(fastxsl_globals_id, zend_fastxsl_globals *, v)
118 #else
119 #define FASTXSL_G(v) (fastxsl_globals.v)
120 #endif
121
122 #endif
123
124
125 /*
126  * Local variables:
127  * tab-width: 4
128  * c-basic-offset: 4
129  * indent-tabs-mode: t
130  * End:
131  */
Note: See TracBrowser for help on using the browser.