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