Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 699 lines (593 sloc) 20.355 kb
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
1 /*
798c4cf Shuhei Tanuma change license to PHP License from MIT.
authored
2 +----------------------------------------------------------------------+
3 | PHP Version 5 |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1997-2011 The PHP Group |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.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 | Authors: Shuhei Tanuma <chobieee@gmail.com> |
16 +----------------------------------------------------------------------+
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
17 */
18
19 #include "php_sundown.h"
20
21 zend_class_entry *sundown_render_base_class_entry;
22
d2a67c7 Shuhei Tanuma add create object functions to render_base
authored
23 static void php_sundown_render_base_free_storage(php_sundown_render_base_t *obj TSRMLS_DC)
24 {
25 zend_object_std_dtor(&obj->zo TSRMLS_CC);
26 efree(obj);
27 }
28
29 zend_object_value php_sundown_render_base_new(zend_class_entry *ce TSRMLS_DC)
30 {
31 zend_object_value retval;
32 php_sundown_render_base_t *obj;
33 zval *tmp;
34
35 obj = ecalloc(1, sizeof(*obj));
36 zend_object_std_init( &obj->zo, ce TSRMLS_CC);
4482819 Shuhei Tanuma PHP5.4 compatibility
authored
37 #if ZEND_MODULE_API_NO >= 20100525
38 object_properties_init(&(obj->zo), ce);
39 #else
d2a67c7 Shuhei Tanuma add create object functions to render_base
authored
40 zend_hash_copy(obj->zo.properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
4482819 Shuhei Tanuma PHP5.4 compatibility
authored
41 #endif
d2a67c7 Shuhei Tanuma add create object functions to render_base
authored
42
43 retval.handle = zend_objects_store_put(obj,
44 (zend_objects_store_dtor_t)zend_objects_destroy_object,
45 (zend_objects_free_object_storage_t)php_sundown_render_base_free_storage,
46 NULL TSRMLS_CC);
47 retval.handlers = zend_get_std_object_handlers();
48 return retval;
49 }
50
498992e Shuhei Tanuma divided render_flags and extensions.
authored
51 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render___construct,0,0,1)
52 ZEND_ARG_INFO(0, render_flags)
53 ZEND_END_ARG_INFO()
54
e87c889 Shuhei Tanuma add Sundown\Render\Base::getRenderFlags setRenderFlags and Sundown\Markd...
authored
55 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_set_render_flags,0,0,1)
56 ZEND_ARG_INFO(0, render_flags)
57 ZEND_END_ARG_INFO()
58
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
59 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_block_code, 0, 0, 2)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
60 ZEND_ARG_INFO(0, code)
61 ZEND_ARG_INFO(0, language)
62 ZEND_END_ARG_INFO()
63
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
64 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_block_quote, 0, 0, 1)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
65 ZEND_ARG_INFO(0, quote)
66 ZEND_END_ARG_INFO()
67
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
68 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_block_html, 0, 0, 1)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
69 ZEND_ARG_INFO(0, raw_html)
70 ZEND_END_ARG_INFO()
71
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
72 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_header, 0, 0, 2)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
73 ZEND_ARG_INFO(0, htext)
74 ZEND_ARG_INFO(0, header_level)
75 ZEND_END_ARG_INFO()
76
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
77 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_hrule, 0, 0, 0)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
78 ZEND_END_ARG_INFO()
79
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
80 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_list_box, 0, 0, 2)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
81 ZEND_ARG_INFO(0, contents)
82 ZEND_ARG_INFO(0, list_type)
83 ZEND_END_ARG_INFO()
84
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
85 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_list_item, 0, 0, 2)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
86 ZEND_ARG_INFO(0, text)
87 ZEND_ARG_INFO(0, list_type)
88 ZEND_END_ARG_INFO()
89
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
90 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_paragraph, 0, 0, 1)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
91 ZEND_ARG_INFO(0, text)
92 ZEND_END_ARG_INFO()
93
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
94 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_table, 0, 0, 2)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
95 ZEND_ARG_INFO(0, header)
96 ZEND_ARG_INFO(0, body)
97 ZEND_END_ARG_INFO()
98
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
99 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_table_row, 0, 0, 1)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
100 ZEND_ARG_INFO(0, content)
101 ZEND_END_ARG_INFO()
102
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
103 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_table_cell, 0, 0, 2)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
104 ZEND_ARG_INFO(0, content)
105 ZEND_ARG_INFO(0, alignment)
106 ZEND_END_ARG_INFO()
107
e9bbe20 Shuhei Tanuma fixed misunderstood parameter count in Sundown\Render\Base and Sundown\R...
authored
108 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_autolink, 0, 0, 2)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
109 ZEND_ARG_INFO(0, link)
110 ZEND_ARG_INFO(0, link_type)
111 ZEND_END_ARG_INFO()
112
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
113 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_codespan, 0, 0, 1)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
114 ZEND_ARG_INFO(0, code)
115 ZEND_END_ARG_INFO()
116
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
117 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_double_emphasis, 0, 0, 1)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
118 ZEND_ARG_INFO(0, text)
119 ZEND_END_ARG_INFO()
120
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
121 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_emphasis, 0, 0, 1)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
122 ZEND_ARG_INFO(0, text)
123 ZEND_END_ARG_INFO()
124
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
125 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_image, 0, 0, 3)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
126 ZEND_ARG_INFO(0, link)
127 ZEND_ARG_INFO(0, title)
128 ZEND_ARG_INFO(0, alt_text)
129 ZEND_END_ARG_INFO()
130
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
131 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_linebreak, 0, 0, 0)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
132 ZEND_END_ARG_INFO()
133
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
134 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_link, 0, 0, 3)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
135 ZEND_ARG_INFO(0, link)
136 ZEND_ARG_INFO(0, title)
137 ZEND_ARG_INFO(0, content)
138 ZEND_END_ARG_INFO()
139
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
140 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_raw_html, 0, 0, 1)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
141 ZEND_ARG_INFO(0, raw_html)
142 ZEND_END_ARG_INFO()
143
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
144 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_triple_emphasis, 0, 0, 1)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
145 ZEND_ARG_INFO(0, text)
146 ZEND_END_ARG_INFO()
147
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
148 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_strikethrough, 0, 0, 1)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
149 ZEND_ARG_INFO(0, text)
150 ZEND_END_ARG_INFO()
151
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
152 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_superscript, 0, 0, 1)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
153 ZEND_ARG_INFO(0, text)
154 ZEND_END_ARG_INFO()
155
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
156 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_entity, 0, 0, 1)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
157 ZEND_ARG_INFO(0, text)
158 ZEND_END_ARG_INFO()
159
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
160 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_normal_text, 0, 0, 1)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
161 ZEND_ARG_INFO(0, text)
162 ZEND_END_ARG_INFO()
163
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
164 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_doc_header, 0, 0, 0)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
165 ZEND_END_ARG_INFO()
166
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
167 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_doc_footer, 0, 0, 0)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
168 ZEND_END_ARG_INFO()
169
caea2a8 Shuhei Tanuma fixed strict standards warnigs
authored
170 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_preprocess, 0, 0, 1)
171 ZEND_ARG_INFO(0, full_document)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
172 ZEND_END_ARG_INFO()
173
caea2a8 Shuhei Tanuma fixed strict standards warnigs
authored
174 ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_postprocess, 0, 0, 1)
175 ZEND_ARG_INFO(0, full_document)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
176 ZEND_END_ARG_INFO()
177
ed2e32a Shuhei Tanuma adjust method naming
authored
178 /* {{{ proto string Sundown\Render\Base::blockCode($code, $language)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
179 */
ed2e32a Shuhei Tanuma adjust method naming
authored
180 PHP_METHOD(sundown_render_base, blockCode)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
181 {
182 char *code, *block_code;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
183 int code_len, block_code_len;
4b10a7e Shuhei Tanuma add Sundown\Buffer class.
authored
184
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
185 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
186 "ss", &code, &code_len, &block_code, &block_code_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
187 return;
188 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
189 RETVAL_STRINGL(code,code_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
190 }
191 /* }}} */
192
ed2e32a Shuhei Tanuma adjust method naming
authored
193 /* {{{ proto string Sundown\Render\Base::blockQuote($quote)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
194 */
ed2e32a Shuhei Tanuma adjust method naming
authored
195 PHP_METHOD(sundown_render_base, blockQuote)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
196 {
197 char *quote;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
198 int quote_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
199
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
200 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
201 "s", &quote, &quote_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
202 return;
203 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
204 RETVAL_STRINGL(quote,quote_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
205 }
206 /* }}} */
207
ed2e32a Shuhei Tanuma adjust method naming
authored
208 /* {{{ proto string Sundown\Render\Base::blockHtml($raw_html)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
209 */
ed2e32a Shuhei Tanuma adjust method naming
authored
210 PHP_METHOD(sundown_render_base, blockHtml)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
211 {
212 char *raw;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
213 int raw_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
214
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
215 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
216 "s", &raw, &raw_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
217 return;
218 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
219 RETVAL_STRINGL(raw,raw_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
220 }
221 /* }}} */
222
77af627 Shuhei Tanuma modified method comments
authored
223 /* {{{ proto string Sundown\Render\Base::header($htext,$header_level)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
224 */
225 PHP_METHOD(sundown_render_base, header)
226 {
227 char *htext;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
228 int htext_len, header_level;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
229
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
230 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
231 "sl",&htext, &htext_len, &header_level) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
232 return;
233 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
234 RETVAL_STRINGL(htext,htext_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
235 }
236 /* }}} */
237
77af627 Shuhei Tanuma modified method comments
authored
238 /* {{{ proto string Sundown\Render\Base::hrule()
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
239 */
240 PHP_METHOD(sundown_render_base, hrule)
241 {
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
242 /**
243 * on Sundown\Render\Base, actually this method do nothing.
244 **/
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
245 }
246 /* }}} */
247
ed2e32a Shuhei Tanuma adjust method naming
authored
248 /* {{{ proto string Sundown\Render\Base::listBox($contents, $list_type)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
249 */
ed2e32a Shuhei Tanuma adjust method naming
authored
250 PHP_METHOD(sundown_render_base, listBox)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
251 {
8016e3f Shuhei Tanuma fixed #3 Sundown\Render\HTML::list_box specifies unexpected variable typ...
authored
252 char *contents;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
253 int contents_len;
254 long list_type;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
255
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
256 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
257 "sl", &contents, &contents_len, &list_type) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
258 return;
259 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
260 RETVAL_STRINGL(contents,contents_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
261 }
262 /* }}} */
263
ed2e32a Shuhei Tanuma adjust method naming
authored
264 /* {{{ proto string Sundown\Render\Base::listItem($text, $list_type)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
265 */
ed2e32a Shuhei Tanuma adjust method naming
authored
266 PHP_METHOD(sundown_render_base, listItem)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
267 {
8016e3f Shuhei Tanuma fixed #3 Sundown\Render\HTML::list_box specifies unexpected variable typ...
authored
268 char *text;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
269 int text_len;
270 long list_type;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
271
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
272 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
273 "sl",&text, &text_len, &list_type) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
274 return;
275 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
276 RETVAL_STRINGL(text,text_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
277 }
278 /* }}} */
279
77af627 Shuhei Tanuma modified method comments
authored
280 /* {{{ proto string Sundown\Render\Base::paragraph($text)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
281 */
282 PHP_METHOD(sundown_render_base, paragraph)
283 {
284 char *text;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
285 int text_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
286
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
287 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
288 "s", &text, &text_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
289 return;
290 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
291 RETVAL_STRINGL(text,text_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
292 }
293 /* }}} */
294
77af627 Shuhei Tanuma modified method comments
authored
295 /* {{{ proto string Sundown\Render\Base::table($header, $body)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
296 */
297 PHP_METHOD(sundown_render_base, table)
298 {
299 char *header, *body;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
300 int header_len, body_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
301
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
302 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
303 "ss", &header, &header_len, &body, &body_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
304 return;
305 }
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
306 RETVAL_STRINGL(body,body_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
307 }
308 /* }}} */
309
ed2e32a Shuhei Tanuma adjust method naming
authored
310 /* {{{ proto string Sundown\Render\Base::tableRow($content)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
311 */
ed2e32a Shuhei Tanuma adjust method naming
authored
312 PHP_METHOD(sundown_render_base, tableRow)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
313 {
314 char *contents;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
315 int contents_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
316
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
317 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
318 "s", &contents, &contents_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
319 return;
320 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
321 RETVAL_STRINGL(contents,contents_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
322 }
323 /* }}} */
324
ed2e32a Shuhei Tanuma adjust method naming
authored
325 /* {{{ proto string Sundown\Render\Base::tableCell($content, $alignment)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
326 */
ed2e32a Shuhei Tanuma adjust method naming
authored
327 PHP_METHOD(sundown_render_base, tableCell)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
328 {
329 char *content, *alignment;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
330 int content_len, alignment_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
331
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
332 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
333 "ss", &content, &content_len, &alignment, &alignment_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
334 return;
335 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
336 RETVAL_STRINGL(content,content_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
337 }
338 /* }}} */
339
77af627 Shuhei Tanuma modified method comments
authored
340 /* {{{ proto string Sundown\Render\Base::autolink($link, $link_type)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
341 */
342 PHP_METHOD(sundown_render_base, autolink)
343 {
517619a Shuhei Tanuma fix #19 Autolink is broken for emails
authored
344 char *link;
345 int link_len;
346 long link_type;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
347
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
348 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
517619a Shuhei Tanuma fix #19 Autolink is broken for emails
authored
349 "sl",&link, &link_len, &link_type) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
350 return;
351 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
352 RETVAL_STRINGL(link,link_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
353 }
354 /* }}} */
355
77af627 Shuhei Tanuma modified method comments
authored
356 /* {{{ proto string Sundown\Render\Base::codespan($code)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
357 */
358 PHP_METHOD(sundown_render_base, codespan)
359 {
360 char *code;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
361 int code_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
362
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
363 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
364 "s", &code, &code_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
365 return;
366 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
367 RETVAL_STRINGL(code,code_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
368 }
369 /* }}} */
370
ed2e32a Shuhei Tanuma adjust method naming
authored
371 /* {{{ proto string Sundown\Render\Base::doubleEmphasis($text)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
372 */
ed2e32a Shuhei Tanuma adjust method naming
authored
373 PHP_METHOD(sundown_render_base, doubleEmphasis)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
374 {
375 char *text;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
376 int text_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
377
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
378 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
379 "s", &text, &text_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
380 return;
381 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
382 RETVAL_STRINGL(text,text_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
383 }
384 /* }}} */
385
77af627 Shuhei Tanuma modified method comments
authored
386 /* {{{ proto string Sundown\Render\Base::emphasis($text)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
387 */
388 PHP_METHOD(sundown_render_base, emphasis)
389 {
390 char *text;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
391 int text_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
392
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
393 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
394 "s", &text, &text_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
395 return;
396 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
397 RETVAL_STRINGL(text,text_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
398 }
399 /* }}} */
400
77af627 Shuhei Tanuma modified method comments
authored
401 /* {{{ proto string Sundown\Render\Base::image($link, $title, $alt_text)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
402 */
403 PHP_METHOD(sundown_render_base, image)
404 {
405 char *link, *title, *alt_text;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
406 int link_len, title_len, alt_text_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
407
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
408 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
409 "sss",&link, &link_len, &title, &title_len, &alt_text, &alt_text_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
410 return;
411 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
412 RETVAL_STRINGL(link,link_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
413 }
414 /* }}} */
415
77af627 Shuhei Tanuma modified method comments
authored
416 /* {{{ proto string Sundown\Render\Base::linebreak()
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
417 */
418 PHP_METHOD(sundown_render_base, linebreak)
419 {
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
420 /**
421 * on Sundown\Render\Base, actually this method do nothing.
422 **/
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
423 }
424 /* }}} */
425
77af627 Shuhei Tanuma modified method comments
authored
426 /* {{{ proto string Sundown\Render\Base::link($link,$title,$content)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
427 */
428 PHP_METHOD(sundown_render_base, link)
429 {
430 char *link, *title, *content;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
431 int link_len, title_len, content_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
432
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
433 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
434 "sss",&link, &link_len, &title, &title_len, &content, &content_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
435 return;
436 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
437 RETVAL_STRINGL(link,link_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
438 }
439 /* }}} */
440
ed2e32a Shuhei Tanuma adjust method naming
authored
441 /* {{{ proto string Sundown\Render\Base::rawHtml($raw_html)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
442 */
ed2e32a Shuhei Tanuma adjust method naming
authored
443 PHP_METHOD(sundown_render_base, rawHtml)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
444 {
445 char *raw;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
446 int raw_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
447
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
448 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
449 "s", &raw, &raw_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
450 return;
451 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
452 RETVAL_STRINGL(raw,raw_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
453 }
454 /* }}} */
455
ed2e32a Shuhei Tanuma adjust method naming
authored
456 /* {{{ proto string Sundown\Render\Base::tripleEmphasis($text)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
457 */
ed2e32a Shuhei Tanuma adjust method naming
authored
458 PHP_METHOD(sundown_render_base, tripleEmphasis)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
459 {
460 char *text;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
461 int text_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
462
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
463 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
464 "s", &text, &text_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
465 return;
466 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
467 RETVAL_STRINGL(text,text_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
468 }
469 /* }}} */
470
77af627 Shuhei Tanuma modified method comments
authored
471 /* {{{ proto string Sundown\Render\Base::strikethrough($text)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
472 */
473 PHP_METHOD(sundown_render_base, strikethrough)
474 {
475 char *text;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
476 int text_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
477
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
478 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
479 "s", &text, &text_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
480 return;
481 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
482 RETVAL_STRINGL(text,text_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
483 }
484 /* }}} */
485
77af627 Shuhei Tanuma modified method comments
authored
486 /* {{{ proto string Sundown\Render\Base::superscript($text)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
487 */
488 PHP_METHOD(sundown_render_base, superscript)
489 {
490 char *text;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
491 int text_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
492
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
493 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
494 "s", &text, &text_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
495 return;
496 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
497 RETVAL_STRINGL(text,text_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
498 }
499 /* }}} */
500
77af627 Shuhei Tanuma modified method comments
authored
501 /* {{{ proto string Sundown\Render\Base::entity($text)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
502 */
503 PHP_METHOD(sundown_render_base, entity)
504 {
505 char *text;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
506 int text_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
507
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
508 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
509 "s", &text, &text_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
510 return;
511 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
512 RETVAL_STRINGL(text,text_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
513 }
514 /* }}} */
515
ed2e32a Shuhei Tanuma adjust method naming
authored
516 /* {{{ proto string Sundown\Render\Base::normalText($text)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
517 */
ed2e32a Shuhei Tanuma adjust method naming
authored
518 PHP_METHOD(sundown_render_base, normalText)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
519 {
520 char *text;
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
521 int text_len;
4b10a7e Shuhei Tanuma add Sundown\Buffer class.
authored
522
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
523 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
524 "s",&text, &text_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
525 return;
526 }
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
527 RETVAL_STRINGL(text,text_len,1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
528 }
529 /* }}} */
530
ed2e32a Shuhei Tanuma adjust method naming
authored
531 /* {{{ proto string Sundown\Render\Base::docHeader()
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
532 */
ed2e32a Shuhei Tanuma adjust method naming
authored
533 PHP_METHOD(sundown_render_base, docHeader)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
534 {
535 RETURN_FALSE;
536 }
537 /* }}} */
538
ed2e32a Shuhei Tanuma adjust method naming
authored
539 /* {{{ proto string Sundown\Render\Base::docFooter()
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
540 */
ed2e32a Shuhei Tanuma adjust method naming
authored
541 PHP_METHOD(sundown_render_base, docFooter)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
542 {
543 RETURN_FALSE;
544 }
545 /* }}} */
546
77af627 Shuhei Tanuma modified method comments
authored
547 /* {{{ proto string Sundown\Render\Base::preprocess($full_document)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
548 */
549 PHP_METHOD(sundown_render_base, preprocess)
550 {
551 char *text;
ecc3f86 Shuhei Tanuma re-enable SmartyPants feature.
authored
552 int text_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
553
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
554 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
555 "s", &text, &text_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
556 return;
557 }
558
206b2ba Shuhei Tanuma improve Sundown\Render\Base method signature.
authored
559 RETVAL_STRINGL(text,text_len, 1);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
560 }
561 /* }}} */
562
77af627 Shuhei Tanuma modified method comments
authored
563 /* {{{ proto string Sundown\Render\Base::postprocess($full_document)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
564 */
565 PHP_METHOD(sundown_render_base, postprocess)
566 {
567 char *text;
ecc3f86 Shuhei Tanuma re-enable SmartyPants feature.
authored
568 int text_len;
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
569
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
570 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
571 "s", &text, &text_len) == FAILURE) {
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
572 return;
573 }
ecc3f86 Shuhei Tanuma re-enable SmartyPants feature.
authored
574
575 if (Z_BVAL_P(zend_read_property(Z_OBJCE_P(getThis()), getThis(),"enable_pants",sizeof("enable_pants")-1, 1 TSRMLS_CC))) {
576 struct buf *smart_buf = bufnew(128);
577 sdhtml_smartypants(smart_buf, text,text_len);
578 RETVAL_STRINGL(smart_buf->data, smart_buf->size,1);
579 bufrelease(smart_buf);
580 } else {
581 RETVAL_STRINGL(text,text_len, 1);
582 }
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
583 }
584 /* }}} */
585
77af627 Shuhei Tanuma modified method comments
authored
586 /* {{{ proto Sundown\Render\Base::__construct([array render_flags])
498992e Shuhei Tanuma divided render_flags and extensions.
authored
587 */
588 PHP_METHOD(sundown_render_base, __construct)
589 {
3331433 Shuhei Tanuma fixed segv
authored
590 zval *render_flags = NULL, *c_flags = NULL;
498992e Shuhei Tanuma divided render_flags and extensions.
authored
591
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
592 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
593 "|z", &render_flags) == FAILURE) {
498992e Shuhei Tanuma divided render_flags and extensions.
authored
594 return;
595 }
596
80337e6 Shuhei Tanuma fixed segv
authored
597 if (render_flags != NULL && Z_TYPE_P(render_flags) == IS_ARRAY) {
665039a Shuhei Tanuma now, preprocess and postprocess methods are able to use.
authored
598 ALLOC_INIT_ZVAL(c_flags);
84e991b Shuhei Tanuma fix reference count and add test cases.
authored
599 ZVAL_ZVAL(c_flags, render_flags, 1, 0);
600 } else {
601 MAKE_STD_ZVAL(c_flags);
602 array_init(c_flags);
498992e Shuhei Tanuma divided render_flags and extensions.
authored
603 }
84e991b Shuhei Tanuma fix reference count and add test cases.
authored
604 add_property_zval_ex(getThis(),"render_flags",sizeof("render_flags"),c_flags TSRMLS_CC);
605
498992e Shuhei Tanuma divided render_flags and extensions.
authored
606 }
607 /* }}} */
608
e87c889 Shuhei Tanuma add Sundown\Render\Base::getRenderFlags setRenderFlags and Sundown\Markd...
authored
609
610
611 /* {{{ proto array Sundown\Render\Base::getRenderFlags()
612 */
613 PHP_METHOD(sundown_render_base, getRenderFlags)
614 {
615 if (Z_TYPE_P(zend_read_property(sundown_render_base_class_entry, getThis(),"render_flags",sizeof("render_flags")-1, 0 TSRMLS_CC)) != IS_NULL) {
648445f stealth35 fix serveral compile warnings
stealth35 authored
616 zval *tmp = NULL;
e87c889 Shuhei Tanuma add Sundown\Render\Base::getRenderFlags setRenderFlags and Sundown\Markd...
authored
617
618 tmp = zend_read_property(sundown_render_base_class_entry, getThis(),"render_flags",sizeof("render_flags")-1, 0 TSRMLS_CC);
619 RETVAL_ZVAL(tmp, 1, 0);
620 }
621 }
622 /* }}} */
623
624 /* {{{ proto void Sundown\Render\Base::setRenderFlags(array render_flags)
625 */
626 PHP_METHOD(sundown_render_base, setRenderFlags)
627 {
84e991b Shuhei Tanuma fix reference count and add test cases.
authored
628 zval *render_flags, *c_render_flags, *tmp = NULL;
e87c889 Shuhei Tanuma add Sundown\Render\Base::getRenderFlags setRenderFlags and Sundown\Markd...
authored
629
630 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
631 "a", &render_flags) == FAILURE) {
632 return;
633 }
84e991b Shuhei Tanuma fix reference count and add test cases.
authored
634 MAKE_STD_ZVAL(c_render_flags);
635 ZVAL_ZVAL(c_render_flags,render_flags,1,0);
636 tmp = zend_read_property(sundown_render_base_class_entry, getThis(), "render_flags", sizeof("render_flags")-1, 0 TSRMLS_CC);
637 zval_ptr_dtor(&tmp);
638
639 add_property_zval_ex(getThis(),"render_flags",sizeof("render_flags"),c_render_flags TSRMLS_CC);
e87c889 Shuhei Tanuma add Sundown\Render\Base::getRenderFlags setRenderFlags and Sundown\Markd...
authored
640 }
641 /* }}} */
642
643
77af627 Shuhei Tanuma modified method comments
authored
644 /* {{{ proto Sundown\Render\Base::__destruct()
498992e Shuhei Tanuma divided render_flags and extensions.
authored
645 */
646 PHP_METHOD(sundown_render_base, __destruct)
647 {
648 zval *render_flags;
649 render_flags = zend_read_property(sundown_render_base_class_entry, getThis(),"render_flags",sizeof("render_flags")-1, 0 TSRMLS_CC);
9273baa Shuhei Tanuma following K&R coding style and fix misunderstood zend_parameter_parse va...
authored
650 if (Z_TYPE_P(render_flags) == IS_ARRAY) {
498992e Shuhei Tanuma divided render_flags and extensions.
authored
651 zval_ptr_dtor(&render_flags);
652 }
653 }
654
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
655 static zend_function_entry php_sundown_render_base_methods[] = {
16a4388 Shuhei Tanuma change function scopes
authored
656 PHP_ME(sundown_render_base, __construct, arginfo_sundown_render___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
e87c889 Shuhei Tanuma add Sundown\Render\Base::getRenderFlags setRenderFlags and Sundown\Markd...
authored
657 PHP_ME(sundown_render_base, getRenderFlags, NULL, ZEND_ACC_PUBLIC)
658 PHP_ME(sundown_render_base, setRenderFlags, arginfo_sundown_render_base_set_render_flags,ZEND_ACC_PUBLIC)
ed2e32a Shuhei Tanuma adjust method naming
authored
659 PHP_ME(sundown_render_base, blockCode, arginfo_sundown_render_base_block_code, ZEND_ACC_PUBLIC)
660 PHP_ME(sundown_render_base, blockQuote, arginfo_sundown_render_base_block_quote, ZEND_ACC_PUBLIC)
661 PHP_ME(sundown_render_base, blockHtml, arginfo_sundown_render_base_block_html, ZEND_ACC_PUBLIC)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
662 PHP_ME(sundown_render_base, header, arginfo_sundown_render_base_header, ZEND_ACC_PUBLIC)
663 PHP_ME(sundown_render_base, hrule, arginfo_sundown_render_base_hrule, ZEND_ACC_PUBLIC)
ed2e32a Shuhei Tanuma adjust method naming
authored
664 PHP_ME(sundown_render_base, listBox, arginfo_sundown_render_base_list_box, ZEND_ACC_PUBLIC)
665 PHP_ME(sundown_render_base, listItem, arginfo_sundown_render_base_list_item, ZEND_ACC_PUBLIC)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
666 PHP_ME(sundown_render_base, paragraph, arginfo_sundown_render_base_paragraph, ZEND_ACC_PUBLIC)
667 PHP_ME(sundown_render_base, table, arginfo_sundown_render_base_table, ZEND_ACC_PUBLIC)
ed2e32a Shuhei Tanuma adjust method naming
authored
668 PHP_ME(sundown_render_base, tableRow, arginfo_sundown_render_base_table_row, ZEND_ACC_PUBLIC)
669 PHP_ME(sundown_render_base, tableCell, arginfo_sundown_render_base_table_cell, ZEND_ACC_PUBLIC)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
670 PHP_ME(sundown_render_base, autolink, arginfo_sundown_render_base_autolink, ZEND_ACC_PUBLIC)
671 PHP_ME(sundown_render_base, codespan, arginfo_sundown_render_base_codespan, ZEND_ACC_PUBLIC)
ed2e32a Shuhei Tanuma adjust method naming
authored
672 PHP_ME(sundown_render_base, doubleEmphasis, arginfo_sundown_render_base_double_emphasis, ZEND_ACC_PUBLIC)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
673 PHP_ME(sundown_render_base, emphasis, arginfo_sundown_render_base_emphasis, ZEND_ACC_PUBLIC)
674 PHP_ME(sundown_render_base, image, arginfo_sundown_render_base_image, ZEND_ACC_PUBLIC)
675 PHP_ME(sundown_render_base, linebreak, arginfo_sundown_render_base_linebreak, ZEND_ACC_PUBLIC)
676 PHP_ME(sundown_render_base, link, arginfo_sundown_render_base_link, ZEND_ACC_PUBLIC)
ed2e32a Shuhei Tanuma adjust method naming
authored
677 PHP_ME(sundown_render_base, rawHtml, arginfo_sundown_render_base_raw_html, ZEND_ACC_PUBLIC)
678 PHP_ME(sundown_render_base, tripleEmphasis, arginfo_sundown_render_base_triple_emphasis, ZEND_ACC_PUBLIC)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
679 PHP_ME(sundown_render_base, strikethrough, arginfo_sundown_render_base_strikethrough, ZEND_ACC_PUBLIC)
680 PHP_ME(sundown_render_base, superscript, arginfo_sundown_render_base_superscript, ZEND_ACC_PUBLIC)
681 PHP_ME(sundown_render_base, entity, arginfo_sundown_render_base_entity, ZEND_ACC_PUBLIC)
ed2e32a Shuhei Tanuma adjust method naming
authored
682 PHP_ME(sundown_render_base, normalText, arginfo_sundown_render_base_normal_text, ZEND_ACC_PUBLIC)
683 PHP_ME(sundown_render_base, docHeader, arginfo_sundown_render_base_doc_header, ZEND_ACC_PUBLIC)
684 PHP_ME(sundown_render_base, docFooter, arginfo_sundown_render_base_doc_footer, ZEND_ACC_PUBLIC)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
685 PHP_ME(sundown_render_base, preprocess, arginfo_sundown_render_base_preprocess, ZEND_ACC_PUBLIC)
686 PHP_ME(sundown_render_base, postprocess, arginfo_sundown_render_base_postprocess, ZEND_ACC_PUBLIC)
498992e Shuhei Tanuma divided render_flags and extensions.
authored
687 PHP_ME(sundown_render_base, __destruct, NULL, ZEND_ACC_PUBLIC)
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
688 {NULL,NULL,NULL}
689 };
690
691 void php_sundown_render_base_init(TSRMLS_D)
692 {
693 zend_class_entry ce;
694 INIT_NS_CLASS_ENTRY(ce, ZEND_NS_NAME("Sundown","Render"),"Base", php_sundown_render_base_methods);
695 sundown_render_base_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
d2a67c7 Shuhei Tanuma add create object functions to render_base
authored
696 sundown_render_base_class_entry->create_object = php_sundown_render_base_new;
498992e Shuhei Tanuma divided render_flags and extensions.
authored
697 zend_declare_property_null(sundown_render_base_class_entry, "render_flags", sizeof("render_flags")-1, ZEND_ACC_PUBLIC TSRMLS_CC);
c2e0d3a Shuhei Tanuma for now, adding base render.
authored
698 }
Something went wrong with that request. Please try again.