Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add Sundown\Render\Base::getRenderFlags setRenderFlags and Sundown\Ma…

…rkdown::getRender methods.

array Sundown\Render\Base::getRenderFlags()

void Sundown\Render\Base::setRenderFlags(array $flags)

Sundown\Render\Base Sundown\Markdown::getRender()
  • Loading branch information...
commit e87c88923a4b6c7aded9f8a925c8cf463ac7f1cb 1 parent 862657d
@chobie authored
Showing with 46 additions and 0 deletions.
  1. +37 −0 render_base.c
  2. +9 −0 sundown_markdown.c
View
37 render_base.c
@@ -52,6 +52,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render___construct,0,0,1)
ZEND_ARG_INFO(0, render_flags)
ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_set_render_flags,0,0,1)
+ ZEND_ARG_INFO(0, render_flags)
+ZEND_END_ARG_INFO()
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_block_code, 0, 0, 2)
ZEND_ARG_INFO(0, code)
ZEND_ARG_INFO(0, language)
@@ -621,6 +625,37 @@ PHP_METHOD(sundown_render_base, __construct)
}
/* }}} */
+
+
+/* {{{ proto array Sundown\Render\Base::getRenderFlags()
+*/
+PHP_METHOD(sundown_render_base, getRenderFlags)
+{
+ if (Z_TYPE_P(zend_read_property(sundown_render_base_class_entry, getThis(),"render_flags",sizeof("render_flags")-1, 0 TSRMLS_CC)) != IS_NULL) {
+ zval *result, *tmp = NULL;
+
+ tmp = zend_read_property(sundown_render_base_class_entry, getThis(),"render_flags",sizeof("render_flags")-1, 0 TSRMLS_CC);
+ RETVAL_ZVAL(tmp, 1, 0);
+ }
+}
+/* }}} */
+
+/* {{{ proto void Sundown\Render\Base::setRenderFlags(array render_flags)
+*/
+PHP_METHOD(sundown_render_base, setRenderFlags)
+{
+ zval *render_flags, *c_render_flags = NULL;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ "a", &render_flags) == FAILURE) {
+ return;
+ }
+
+ add_property_zval_ex(getThis(),"render_flags",sizeof("render_flags"),render_flags TSRMLS_CC);
+}
+/* }}} */
+
+
/* {{{ proto Sundown\Render\Base::__destruct()
*/
PHP_METHOD(sundown_render_base, __destruct)
@@ -635,6 +670,8 @@ PHP_METHOD(sundown_render_base, __destruct)
static zend_function_entry php_sundown_render_base_methods[] = {
PHP_ME(sundown_render_base, __construct, arginfo_sundown_render___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
+ PHP_ME(sundown_render_base, getRenderFlags, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(sundown_render_base, setRenderFlags, arginfo_sundown_render_base_set_render_flags,ZEND_ACC_PUBLIC)
PHP_ME(sundown_render_base, block_code, arginfo_sundown_render_base_block_code, ZEND_ACC_PUBLIC)
PHP_ME(sundown_render_base, block_quote, arginfo_sundown_render_base_block_quote, ZEND_ACC_PUBLIC)
PHP_ME(sundown_render_base, block_html, arginfo_sundown_render_base_block_html, ZEND_ACC_PUBLIC)
View
9 sundown_markdown.c
@@ -553,11 +553,20 @@ PHP_METHOD(sundown_markdown, getExtensions)
}
}
+/* {{{ proto Sundown\Render\Base Sundown\Markdown::getRender()
+*/
+PHP_METHOD(sundown_markdown, getRender)
+{
+ php_sundown_markdown_t *object = (php_sundown_markdown_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
+ RETVAL_ZVAL(object->render, 1, 0);
+}
+/* }}} */
static zend_function_entry php_sundown_markdown_methods[] = {
PHP_ME(sundown_markdown, __construct, arginfo_sundown_markdown__construct, ZEND_ACC_PUBLIC)
PHP_ME(sundown_markdown, __destruct, NULL, ZEND_ACC_PUBLIC)
PHP_ME(sundown_markdown, render, arginfo_sundown_markdown_render, ZEND_ACC_PUBLIC)
+ PHP_ME(sundown_markdown, getRender, NULL, ZEND_ACC_PUBLIC)
PHP_ME(sundown_markdown, getExtensions, NULL, ZEND_ACC_PUBLIC)
PHP_ME(sundown_markdown, setExtensions, arginfo_sundown_markdown_set_extensions, ZEND_ACC_PUBLIC)
PHP_ME(sundown_markdown, hasExtension, arginfo_sundown_markdown_has_extension, ZEND_ACC_PUBLIC)
Please sign in to comment.
Something went wrong with that request. Please try again.