Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

modified method comments

  • Loading branch information...
commit 77af627caa4f0a9369658df91118b3ce055e3f47 1 parent 9273baa
Shuhei Tanuma authored
12 src/php_sundown.c
View
@@ -274,7 +274,7 @@ static void sundown__render(SundownRendererType render_type, INTERNAL_FUNCTION_P
}
}
-/* {{{ proto string __construct(string $string [, array $extensions])
+/* {{{ proto string Sundonw::__construct(string $string [, array $extensions])
setup Sundown extension */
PHP_METHOD(sundown, __construct)
{
@@ -299,7 +299,7 @@ PHP_METHOD(sundown, __construct)
}
/* }}} */
-/* {{{ proto void __destruct()
+/* {{{ proto void Sundonw::__destruct()
cleanup variables */
PHP_METHOD(sundown, __destruct)
{
@@ -310,7 +310,7 @@ PHP_METHOD(sundown, __destruct)
}
/* }}} */
-/* {{{ proto string to_html()
+/* {{{ proto string Sundonw::to_html()
Returns converted HTML string */
PHP_METHOD(sundown, to_html)
{
@@ -318,7 +318,7 @@ PHP_METHOD(sundown, to_html)
}
/* }}} */
-/* {{{ proto string __toString()
+/* {{{ proto string Sundonw::__toString()
Returns converted HTML string */
PHP_METHOD(sundown, __toString)
{
@@ -326,7 +326,7 @@ PHP_METHOD(sundown, __toString)
}
/* }}} */
-/* {{{ proto string to_toc()
+/* {{{ proto string Sundonw::to_toc()
Returns table of contents*/
PHP_METHOD(sundown, to_toc)
{
@@ -336,6 +336,7 @@ PHP_METHOD(sundown, to_toc)
static zend_function_entry php_sundown_methods[] = {
PHP_ME(sundown, __construct, arginfo_sundown__construct, ZEND_ACC_PUBLIC)
PHP_ME(sundown, __destruct, NULL, ZEND_ACC_PUBLIC)
+ /* to_html and to_toc methods are compatible with Redcarpet */
PHP_ME(sundown, to_html, NULL, ZEND_ACC_PUBLIC)
PHP_ME(sundown, to_toc, NULL, ZEND_ACC_PUBLIC)
PHP_ME(sundown, __toString, NULL, ZEND_ACC_PUBLIC)
@@ -382,6 +383,7 @@ zend_module_entry sundown_module_entry = {
void php_sundown_init(TSRMLS_D)
{
zend_class_entry ce;
+
INIT_CLASS_ENTRY(ce, "Sundown", php_sundown_methods);
sundown_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
zend_declare_property_null(sundown_class_entry, "extensions", sizeof("extensions")-1, ZEND_ACC_PUBLIC TSRMLS_CC);
60 src/render_base.c
View
@@ -178,7 +178,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_base_postprocess, 0, 0, 1)
ZEND_ARG_INFO(0, full_document)
ZEND_END_ARG_INFO()
-/* {{{ proto string block_code($code, $language)
+/* {{{ proto string Sundown\Render\Base::block_code($code, $language)
*/
PHP_METHOD(sundown_render_base, block_code)
{
@@ -194,7 +194,7 @@ PHP_METHOD(sundown_render_base, block_code)
}
/* }}} */
-/* {{{ proto string block_quote($quote)
+/* {{{ proto string Sundown\Render\Base::block_quote($quote)
*/
PHP_METHOD(sundown_render_base, block_quote)
{
@@ -210,7 +210,7 @@ PHP_METHOD(sundown_render_base, block_quote)
}
/* }}} */
-/* {{{ proto string block_html($raw_html)
+/* {{{ proto string Sundown\Render\Base::block_html($raw_html)
*/
PHP_METHOD(sundown_render_base, block_html)
{
@@ -226,7 +226,7 @@ PHP_METHOD(sundown_render_base, block_html)
}
/* }}} */
-/* {{{ proto string header($htext,$header_level)
+/* {{{ proto string Sundown\Render\Base::header($htext,$header_level)
*/
PHP_METHOD(sundown_render_base, header)
{
@@ -242,7 +242,7 @@ PHP_METHOD(sundown_render_base, header)
}
/* }}} */
-/* {{{ proto string hrule()
+/* {{{ proto string Sundown\Render\Base::hrule()
*/
PHP_METHOD(sundown_render_base, hrule)
{
@@ -252,7 +252,7 @@ PHP_METHOD(sundown_render_base, hrule)
}
/* }}} */
-/* {{{ proto string list_box($contents, $list_type)
+/* {{{ proto string Sundown\Render\Base::list_box($contents, $list_type)
*/
PHP_METHOD(sundown_render_base, list_box)
{
@@ -269,7 +269,7 @@ PHP_METHOD(sundown_render_base, list_box)
}
/* }}} */
-/* {{{ proto string list_item($text, $list_type)
+/* {{{ proto string Sundown\Render\Base::list_item($text, $list_type)
*/
PHP_METHOD(sundown_render_base, list_item)
{
@@ -286,7 +286,7 @@ PHP_METHOD(sundown_render_base, list_item)
}
/* }}} */
-/* {{{ proto string paragraph($text)
+/* {{{ proto string Sundown\Render\Base::paragraph($text)
*/
PHP_METHOD(sundown_render_base, paragraph)
{
@@ -303,7 +303,7 @@ PHP_METHOD(sundown_render_base, paragraph)
}
/* }}} */
-/* {{{ proto string table($header, $body)
+/* {{{ proto string Sundown\Render\Base::table($header, $body)
*/
PHP_METHOD(sundown_render_base, table)
{
@@ -319,7 +319,7 @@ PHP_METHOD(sundown_render_base, table)
}
/* }}} */
-/* {{{ proto string table_row($content)
+/* {{{ proto string Sundown\Render\Base::table_row($content)
*/
PHP_METHOD(sundown_render_base, table_row)
{
@@ -335,7 +335,7 @@ PHP_METHOD(sundown_render_base, table_row)
}
/* }}} */
-/* {{{ proto string table_cell($content, $alignment)
+/* {{{ proto string Sundown\Render\Base::table_cell($content, $alignment)
*/
PHP_METHOD(sundown_render_base, table_cell)
{
@@ -351,7 +351,7 @@ PHP_METHOD(sundown_render_base, table_cell)
}
/* }}} */
-/* {{{ proto string autolink($link, $link_type)
+/* {{{ proto string Sundown\Render\Base::autolink($link, $link_type)
*/
PHP_METHOD(sundown_render_base, autolink)
{
@@ -367,7 +367,7 @@ PHP_METHOD(sundown_render_base, autolink)
}
/* }}} */
-/* {{{ proto string codespan($code)
+/* {{{ proto string Sundown\Render\Base::codespan($code)
*/
PHP_METHOD(sundown_render_base, codespan)
{
@@ -383,7 +383,7 @@ PHP_METHOD(sundown_render_base, codespan)
}
/* }}} */
-/* {{{ proto string double_emphasis($text)
+/* {{{ proto string Sundown\Render\Base::double_emphasis($text)
*/
PHP_METHOD(sundown_render_base, double_emphasis)
{
@@ -399,7 +399,7 @@ PHP_METHOD(sundown_render_base, double_emphasis)
}
/* }}} */
-/* {{{ proto string emphasis($text)
+/* {{{ proto string Sundown\Render\Base::emphasis($text)
*/
PHP_METHOD(sundown_render_base, emphasis)
{
@@ -416,7 +416,7 @@ PHP_METHOD(sundown_render_base, emphasis)
}
/* }}} */
-/* {{{ proto string image($link, $title, $alt_text)
+/* {{{ proto string Sundown\Render\Base::image($link, $title, $alt_text)
*/
PHP_METHOD(sundown_render_base, image)
{
@@ -432,7 +432,7 @@ PHP_METHOD(sundown_render_base, image)
}
/* }}} */
-/* {{{ proto string linebreak()
+/* {{{ proto string Sundown\Render\Base::linebreak()
*/
PHP_METHOD(sundown_render_base, linebreak)
{
@@ -442,7 +442,7 @@ PHP_METHOD(sundown_render_base, linebreak)
}
/* }}} */
-/* {{{ proto string link($link,$title,$content)
+/* {{{ proto string Sundown\Render\Base::link($link,$title,$content)
*/
PHP_METHOD(sundown_render_base, link)
{
@@ -458,7 +458,7 @@ PHP_METHOD(sundown_render_base, link)
}
/* }}} */
-/* {{{ proto string raw_html($raw_html)
+/* {{{ proto string Sundown\Render\Base::raw_html($raw_html)
*/
PHP_METHOD(sundown_render_base, raw_html)
{
@@ -474,7 +474,7 @@ PHP_METHOD(sundown_render_base, raw_html)
}
/* }}} */
-/* {{{ proto string triple_emphasis($text)
+/* {{{ proto string Sundown\Render\Base::triple_emphasis($text)
*/
PHP_METHOD(sundown_render_base, triple_emphasis)
{
@@ -490,7 +490,7 @@ PHP_METHOD(sundown_render_base, triple_emphasis)
}
/* }}} */
-/* {{{ proto string strikethrough($text)
+/* {{{ proto string Sundown\Render\Base::strikethrough($text)
*/
PHP_METHOD(sundown_render_base, strikethrough)
{
@@ -506,7 +506,7 @@ PHP_METHOD(sundown_render_base, strikethrough)
}
/* }}} */
-/* {{{ proto string superscript($text)
+/* {{{ proto string Sundown\Render\Base::superscript($text)
*/
PHP_METHOD(sundown_render_base, superscript)
{
@@ -522,7 +522,7 @@ PHP_METHOD(sundown_render_base, superscript)
}
/* }}} */
-/* {{{ proto string entity($text)
+/* {{{ proto string Sundown\Render\Base::entity($text)
*/
PHP_METHOD(sundown_render_base, entity)
{
@@ -538,7 +538,7 @@ PHP_METHOD(sundown_render_base, entity)
}
/* }}} */
-/* {{{ proto string normal_text($text)
+/* {{{ proto string Sundown\Render\Base::normal_text($text)
*/
PHP_METHOD(sundown_render_base, normal_text)
{
@@ -554,7 +554,7 @@ PHP_METHOD(sundown_render_base, normal_text)
}
/* }}} */
-/* {{{ proto string doc_header()
+/* {{{ proto string Sundown\Render\Base::doc_header()
*/
PHP_METHOD(sundown_render_base, doc_header)
{
@@ -562,7 +562,7 @@ PHP_METHOD(sundown_render_base, doc_header)
}
/* }}} */
-/* {{{ proto string doc_footer()
+/* {{{ proto string Sundown\Render\Base::doc_footer()
*/
PHP_METHOD(sundown_render_base, doc_footer)
{
@@ -570,7 +570,7 @@ PHP_METHOD(sundown_render_base, doc_footer)
}
/* }}} */
-/* {{{ proto string preprocess($full_document)
+/* {{{ proto string Sundown\Render\Base::preprocess($full_document)
*/
PHP_METHOD(sundown_render_base, preprocess)
{
@@ -586,7 +586,7 @@ PHP_METHOD(sundown_render_base, preprocess)
}
/* }}} */
-/* {{{ proto string postprocess($full_document)
+/* {{{ proto string Sundown\Render\Base::postprocess($full_document)
*/
PHP_METHOD(sundown_render_base, postprocess)
{
@@ -609,7 +609,7 @@ PHP_METHOD(sundown_render_base, postprocess)
}
/* }}} */
-/* {{{ proto __construct([array render_flags])
+/* {{{ proto Sundown\Render\Base::__construct([array render_flags])
*/
PHP_METHOD(sundown_render_base, __construct)
{
@@ -628,7 +628,7 @@ PHP_METHOD(sundown_render_base, __construct)
}
/* }}} */
-/* {{{ proto __destruct()
+/* {{{ proto Sundown\Render\Base::__destruct()
*/
PHP_METHOD(sundown_render_base, __destruct)
{
56 src/render_html.c
View
@@ -172,7 +172,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render_html_doc_footer, 0, 0, 0)
ZEND_END_ARG_INFO()
-/* {{{ proto void block_code($language, $code)
+/* {{{ proto stirng Sundown\Render\HTML::block_code($language, $code)
*/
PHP_METHOD(sundown_render_html, block_code)
{
@@ -200,7 +200,7 @@ PHP_METHOD(sundown_render_html, block_code)
}
/* }}} */
-/* {{{ proto void block_quote($quote)
+/* {{{ proto string Sundown\Render\HTML::block_quote($quote)
*/
PHP_METHOD(sundown_render_html, block_quote)
{
@@ -226,7 +226,7 @@ PHP_METHOD(sundown_render_html, block_quote)
}
/* }}} */
-/* {{{ proto void block_html()
+/* {{{ proto string Sundown\Render\HTML::block_html()
*/
PHP_METHOD(sundown_render_html, block_html)
{
@@ -252,7 +252,7 @@ PHP_METHOD(sundown_render_html, block_html)
}
/* }}} */
-/* {{{ proto void header($htext,$header_level)
+/* {{{ proto string Sundown\Render\HTML::header($htext,$header_level)
*/
PHP_METHOD(sundown_render_html, header)
{
@@ -279,7 +279,7 @@ PHP_METHOD(sundown_render_html, header)
}
/* }}} */
-/* {{{ proto string hrule()
+/* {{{ proto string Sundown\Render\HTML::hrule()
*/
PHP_METHOD(sundown_render_html, hrule)
{
@@ -296,7 +296,7 @@ PHP_METHOD(sundown_render_html, hrule)
}
/* }}} */
-/* {{{ proto string list_box($contents, $list_type)
+/* {{{ proto string Sundown\Render\HTML::list_box($contents, $list_type)
*/
PHP_METHOD(sundown_render_html, list_box)
{
@@ -324,7 +324,7 @@ PHP_METHOD(sundown_render_html, list_box)
}
/* }}} */
-/* {{{ proto string list_item($text, $list_type)
+/* {{{ proto string Sundown\Render\HTML::list_item($text, $list_type)
*/
PHP_METHOD(sundown_render_html, list_item)
{
@@ -354,7 +354,7 @@ PHP_METHOD(sundown_render_html, list_item)
}
/* }}} */
-/* {{{ proto string paragraph($text)
+/* {{{ proto string Sundown\Render\HTML::paragraph($text)
*/
PHP_METHOD(sundown_render_html, paragraph)
{
@@ -380,7 +380,7 @@ PHP_METHOD(sundown_render_html, paragraph)
}
/* }}} */
-/* {{{ proto string table($header, $body)
+/* {{{ proto string Sundown\Render\HTML::table($header, $body)
*/
PHP_METHOD(sundown_render_html, table)
{
@@ -408,7 +408,7 @@ PHP_METHOD(sundown_render_html, table)
}
/* }}} */
-/* {{{ proto string table_row($content)
+/* {{{ proto string Sundown\Render\HTML::table_row($content)
*/
PHP_METHOD(sundown_render_html, table_row)
{
@@ -433,7 +433,7 @@ PHP_METHOD(sundown_render_html, table_row)
}
/* }}} */
-/* {{{ proto string table_cell($content, $alignment)
+/* {{{ proto string Sundown\Render\HTML::table_cell($content, $alignment)
*/
PHP_METHOD(sundown_render_html, table_cell)
{
@@ -460,7 +460,7 @@ PHP_METHOD(sundown_render_html, table_cell)
}
/* }}} */
-/* {{{ proto string autolink($link, $link_type)
+/* {{{ proto string Sundown\Render\HTML::autolink($link, $link_type)
*/
PHP_METHOD(sundown_render_html, autolink)
{
@@ -488,7 +488,7 @@ PHP_METHOD(sundown_render_html, autolink)
}
/* }}} */
-/* {{{ proto string codespan($code)
+/* {{{ proto string Sundown\Render\HTML::codespan($code)
*/
PHP_METHOD(sundown_render_html, codespan)
{
@@ -513,7 +513,7 @@ PHP_METHOD(sundown_render_html, codespan)
}
/* }}} */
-/* {{{ proto string double_emphasis($text)
+/* {{{ proto string Sundown\Render\HTML::double_emphasis($text)
*/
PHP_METHOD(sundown_render_html, double_emphasis)
{
@@ -539,7 +539,7 @@ PHP_METHOD(sundown_render_html, double_emphasis)
}
/* }}} */
-/* {{{ proto string emphasis($text)
+/* {{{ proto string Sundown\Render\HTML::emphasis($text)
*/
PHP_METHOD(sundown_render_html, emphasis)
{
@@ -565,7 +565,7 @@ PHP_METHOD(sundown_render_html, emphasis)
}
/* }}} */
-/* {{{ proto string image($link, $title, $alt_text)
+/* {{{ proto string Sundown\Render\HTML::image($link, $title, $alt_text)
*/
PHP_METHOD(sundown_render_html, image)
{
@@ -595,7 +595,7 @@ PHP_METHOD(sundown_render_html, image)
}
/* }}} */
-/* {{{ proto string linebreak()
+/* {{{ proto string Sundown\Render\HTML::linebreak()
*/
PHP_METHOD(sundown_render_html, linebreak)
{
@@ -611,7 +611,7 @@ PHP_METHOD(sundown_render_html, linebreak)
}
/* }}} */
-/* {{{ proto string link($link,$title,$content)
+/* {{{ proto string Sundown\Render\HTML::link($link,$title,$content)
*/
PHP_METHOD(sundown_render_html, link)
{
@@ -640,7 +640,7 @@ PHP_METHOD(sundown_render_html, link)
}
/* }}} */
-/* {{{ proto string raw_html($raw_html)
+/* {{{ proto string Sundown\Render\HTML::raw_html($raw_html)
*/
PHP_METHOD(sundown_render_html, raw_html)
{
@@ -665,7 +665,7 @@ PHP_METHOD(sundown_render_html, raw_html)
}
/* }}} */
-/* {{{ proto string triple_emphasis($text)
+/* {{{ proto string Sundown\Render\HTML::triple_emphasis($text)
*/
PHP_METHOD(sundown_render_html, triple_emphasis)
{
@@ -690,7 +690,7 @@ PHP_METHOD(sundown_render_html, triple_emphasis)
}
/* }}} */
-/* {{{ proto string strikethrough($text)
+/* {{{ proto string Sundown\Render\HTML::strikethrough($text)
*/
PHP_METHOD(sundown_render_html, strikethrough)
{
@@ -715,7 +715,7 @@ PHP_METHOD(sundown_render_html, strikethrough)
}
/* }}} */
-/* {{{ proto string superscript($text)
+/* {{{ proto string Sundown\Render\HTML::superscript($text)
*/
PHP_METHOD(sundown_render_html, superscript)
{
@@ -740,7 +740,7 @@ PHP_METHOD(sundown_render_html, superscript)
}
/* }}} */
-/* {{{ proto string entity($text)
+/* {{{ proto string Sundown\Render\HTML::entity($text)
*/
PHP_METHOD(sundown_render_html, entity)
{
@@ -769,7 +769,7 @@ PHP_METHOD(sundown_render_html, entity)
}
/* }}} */
-/* {{{ proto string normal_text($text)
+/* {{{ proto string Sundown\Render\HTML::normal_text($text)
*/
PHP_METHOD(sundown_render_html, normal_text)
{
@@ -794,7 +794,7 @@ PHP_METHOD(sundown_render_html, normal_text)
}
/* }}} */
-/* {{{ proto string doc_header()
+/* {{{ proto string Sundown\Render\HTML::doc_header()
*/
PHP_METHOD(sundown_render_html, doc_header)
{
@@ -802,7 +802,7 @@ PHP_METHOD(sundown_render_html, doc_header)
}
/* }}} */
-/* {{{ proto string doc_footer()
+/* {{{ proto string Sundown\Render\HTML::doc_footer()
*/
PHP_METHOD(sundown_render_html, doc_footer)
{
@@ -810,7 +810,7 @@ PHP_METHOD(sundown_render_html, doc_footer)
}
/* }}} */
-/* {{{ proto string __construct($render_flags)
+/* {{{ proto string Sundown\Render\HTML::__construct($render_flags)
*/
PHP_METHOD(sundown_render_html, __construct)
{
@@ -835,7 +835,7 @@ PHP_METHOD(sundown_render_html, __construct)
}
/* }}} */
-/* {{{ proto __destruct()
+/* {{{ proto Sundown\Render\HTML::__destruct()
*/
PHP_METHOD(sundown_render_html, __destruct)
{
7 src/render_xhtml.c
View
@@ -58,7 +58,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_sundown_render___construct,0,0,1)
ZEND_ARG_INFO(0, render_flags)
ZEND_END_ARG_INFO()
-/* {{{ proto __construct([array render_flags])
+/* {{{ proto Sundown\Render\XHTML::__construct([array render_flags])
*/
PHP_METHOD(sundown_render_xhtml, __construct)
{
@@ -97,7 +97,7 @@ PHP_METHOD(sundown_render_xhtml, __construct)
zend_hash_add(hash, key, length,&t,sizeof(zval *),NULL);
Z_ADDREF_P(t);
} else {
- if (Z_BVAL_P(*data) == NULL || !Z_BVAL_P(*data)) {
+ if (!Z_BVAL_P(*data)) {
zval *t;
MAKE_STD_ZVAL(t);
ZVAL_TRUE(t);
@@ -110,7 +110,7 @@ PHP_METHOD(sundown_render_xhtml, __construct)
}
/* }}} */
-/* {{{ proto __destruct()
+/* {{{ proto Sundown\Render\XHTML::__destruct()
*/
PHP_METHOD(sundown_render_xhtml, __destruct)
{
@@ -131,6 +131,7 @@ static zend_function_entry php_sundown_render_xhtml_methods[] = {
void php_sundown_render_xhtml_init(TSRMLS_D)
{
zend_class_entry ce;
+
INIT_NS_CLASS_ENTRY(ce, ZEND_NS_NAME("Sundown","Render"),"XHTML", php_sundown_render_xhtml_methods);
sundown_render_xhtml_class_entry = zend_register_internal_class_ex(&ce, sundown_render_html_class_entry, NULL TSRMLS_CC);
sundown_render_xhtml_class_entry->create_object = php_sundown_render_xhtml_new;
25 src/sundown_markdown.c
View
@@ -306,7 +306,7 @@ zend_object_value php_sundown_markdown_new(zend_class_entry *ce TSRMLS_DC)
}
-/* {{{ proto string __construct($render [, $extensions])
+/* {{{ proto string Sundown\Markdown::__construct(Sundown\Render\Base $render [, array $extensions])
*/
PHP_METHOD(sundown_markdown, __construct)
{
@@ -317,7 +317,7 @@ PHP_METHOD(sundown_markdown, __construct)
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
"z|a", &render, &extensions) == FAILURE) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC," Sundown\Markdown::__construct() expects parameter 2 to be array");
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC," Sundown\\Markdown::__construct() expects parameter 2 to be array");
return;
}
@@ -342,7 +342,7 @@ PHP_METHOD(sundown_markdown, __construct)
Z_ADDREF_P(render);
}
- if (instanceof_function_ex(Z_OBJCE_P(render), sundown_render_base_class_entry, 0 TSRMLS_CC) == FAILURE) {
+ if (instanceof_function_ex(Z_OBJCE_P(render), sundown_render_base_class_entry, 0 TSRMLS_CC) == false) {
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC,"Render class must extend Sundown\\Render\\Base");
return;
}
@@ -360,7 +360,7 @@ PHP_METHOD(sundown_markdown, __construct)
/* }}} */
-/* {{{ proto void __destruct()
+/* {{{ proto void Sundown\Markdown::__destruct()
cleanup variables */
PHP_METHOD(sundown_markdown, __destruct)
{
@@ -373,7 +373,7 @@ PHP_METHOD(sundown_markdown, __destruct)
-/* {{{ proto string render($body)
+/* {{{ proto string Sundown\Markdown::render(string $body)
*/
PHP_METHOD(sundown_markdown, render)
{
@@ -389,6 +389,9 @@ PHP_METHOD(sundown_markdown, render)
int buffer_len = 0;
zend_class_entry *ce;
HashTable *table;
+ void **source, **dest;
+ size_t i;
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &buffer, &buffer_len) == FAILURE) {
@@ -398,7 +401,6 @@ PHP_METHOD(sundown_markdown, render)
output_buf = bufnew(128);
bufgrow(output_buf, buffer_len * 1.2f);
-
if (Z_TYPE_P(zend_read_property(Z_OBJCE_P(object->render), object->render,"render_flags",sizeof("render_flags")-1, 0 TSRMLS_CC)) != IS_NULL) {
table = Z_ARRVAL_P(zend_read_property(Z_OBJCE_P(object->render), object->render,"render_flags",sizeof("render_flags")-1, 0 TSRMLS_CC));
php_sundown__get_render_flags(table, &render_flags);
@@ -426,10 +428,8 @@ PHP_METHOD(sundown_markdown, render)
ce = Z_OBJCE_P(object->render);
opt.self = object->render;
- /* @todo: move definitions to top */
- void **source = (void **)&php_sundown_callbacks;
- void **dest = (void **)&sundown_render;
- size_t i;
+ source = (void **)&php_sundown_callbacks;
+ dest = (void **)&sundown_render;
for (i = 0; i < php_sundown_method_count; ++i) {
if (zend_hash_exists(&ce->function_table, php_sundown_method_names[i], strlen(php_sundown_method_names[i])+1)) {
dest[i] = source[i];
@@ -454,13 +454,13 @@ PHP_METHOD(sundown_markdown, render)
}
zval_ptr_dtor(&params[0]);
- // proceess markdown
+ /* proceess markdown */
markdown = sd_markdown_new(enabled_extensions, 16, &sundown_render, &opt);
sd_markdown_render(output_buf, input_buf.data, input_buf.size, markdown);
sd_markdown_free(markdown);
zval_ptr_dtor(&ret);
- // postprocess
+ /* postprocess */
MAKE_STD_ZVAL(ret);
MAKE_STD_ZVAL(params[0]);
ZVAL_STRINGL(params[0], output_buf->data,output_buf->size, 1);
@@ -491,6 +491,7 @@ static zend_function_entry php_sundown_markdown_methods[] = {
void php_sundown_markdown_init(TSRMLS_D)
{
zend_class_entry ce;
+
INIT_NS_CLASS_ENTRY(ce, "Sundown","Markdown", php_sundown_markdown_methods);
sundown_markdown_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
sundown_markdown_class_entry->create_object = php_sundown_markdown_new;
Please sign in to comment.
Something went wrong with that request. Please try again.