Skip to content

Commit

Permalink
Merge branch 'win32-support' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
chobie committed May 23, 2012
2 parents 24c09c9 + 6161555 commit 69638de
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 97 deletions.
10 changes: 9 additions & 1 deletion config.w32
@@ -1,6 +1,14 @@
ARG_WITH('sundown', 'sundown extension', 'no');

if (PHP_SUNDOWN != "no") {
if (CHECK_HEADER_ADD_INCLUDE("markdown.h", "CFLAGS_SUNDOWN", ".\\sundown\\src") &&
CHECK_HEADER_ADD_INCLUDE("html.h", "CFLAGS_SUNDOWN", ".\\sundown\\html")) {
ADD_SOURCES(configure_module_dirname + ".\\sundown\\src","buffer.c markdown.c autolink.c stack.c", "sundown");
ADD_SOURCES(configure_module_dirname + ".\\sundown\\html","html.c html_smartypants.c houdini_href_e.c houdini_html_e.c", "sundown");

EXTENSION("sundown", "php_sundown.c sundown_markdown.c render_base.c render_html.c render_xhtml.c buffer.c markdown.c html.c html_smartypants.c autolink.c stack.c houdini_href_e.c houdini_html_e.c");
EXTENSION("sundown", "php_sundown.c sundown_markdown.c render_base.c render_html.c render_html_toc.c render_xhtml.c");
} else {
WARNING( "sundown not enabled: headers not found");
}
ADD_EXTENSION_DEP('sundown','spl',true);
}
3 changes: 2 additions & 1 deletion php_sundown.c
Expand Up @@ -18,7 +18,9 @@


#include "php_sundown.h"
#include "ext/standard/info.h"

extern void php_sundown_render_base_init(TSRMLS_D);
extern void php_sundown_render_html_init(TSRMLS_D);
extern void php_sundown_render_html_toc_init(TSRMLS_D);
extern void php_sundown_render_xhtml_init(TSRMLS_D);
Expand Down Expand Up @@ -51,7 +53,6 @@ static void sundown__render(SundownRendererType render_type, INTERNAL_FUNCTION_P
unsigned int enabled_extensions = 0, render_flags = 0;
char *buffer;
int buffer_len = 0;
zend_class_entry *ce;
HashTable *table;

object = getThis();
Expand Down
11 changes: 3 additions & 8 deletions php_sundown.h
Expand Up @@ -12,8 +12,9 @@
#include "php.h"
#include "markdown.h"
#include "html.h"
#include "ext/spl/spl_exceptions.h"

#include "zend_interfaces.h"
#include "zend_exceptions.h"

#ifndef SUNDOWN_VERSION
#define SUNDOWN_VERSION UPSKIRT_VERSION
Expand All @@ -25,7 +26,7 @@
extern zend_module_entry sundown_module_entry;
#define phpext_sundown_ptr &sundown_module_entry;

extern zend_class_entry *sundown_class_entry, *sundown_buffer_class_entry, *php_sundown_buffer_class_entry;
extern zend_class_entry *sundown_class_entry, *php_sundown_buffer_class_entry;

typedef enum
{
Expand All @@ -49,11 +50,6 @@ typedef struct{
zval *render;
} php_sundown_markdown_t;

typedef struct{
zend_object zo;
struct buf *buffer;
} php_sundown_buffer_t;

typedef struct{
zend_object zo;
struct html_renderopt html;
Expand Down Expand Up @@ -143,7 +139,6 @@ static int call_user_function_v(HashTable *function_table, zval **object_pp, zva
size_t i;
int ret;
zval **params;
zval *tmp;
TSRMLS_FETCH();

if (param_count > 0) {
Expand Down
26 changes: 1 addition & 25 deletions render_base.c
Expand Up @@ -181,7 +181,6 @@ PHP_METHOD(sundown_render_base, blockCode)
{
char *code, *block_code;
int code_len, block_code_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"ss", &code, &code_len, &block_code, &block_code_len) == FAILURE) {
Expand All @@ -197,7 +196,6 @@ PHP_METHOD(sundown_render_base, blockQuote)
{
char *quote;
int quote_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &quote, &quote_len) == FAILURE) {
Expand All @@ -213,7 +211,6 @@ PHP_METHOD(sundown_render_base, blockHtml)
{
char *raw;
int raw_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &raw, &raw_len) == FAILURE) {
Expand All @@ -229,7 +226,6 @@ PHP_METHOD(sundown_render_base, header)
{
char *htext;
int htext_len, header_level;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"sl",&htext, &htext_len, &header_level) == FAILURE) {
Expand All @@ -256,7 +252,6 @@ PHP_METHOD(sundown_render_base, listBox)
char *contents;
int contents_len;
long list_type;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"sl", &contents, &contents_len, &list_type) == FAILURE) {
Expand All @@ -273,7 +268,6 @@ PHP_METHOD(sundown_render_base, listItem)
char *text;
int text_len;
long list_type;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"sl",&text, &text_len, &list_type) == FAILURE) {
Expand All @@ -289,8 +283,6 @@ PHP_METHOD(sundown_render_base, paragraph)
{
char *text;
int text_len;
zval *buffer;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &text, &text_len) == FAILURE) {
Expand All @@ -306,7 +298,6 @@ PHP_METHOD(sundown_render_base, table)
{
char *header, *body;
int header_len, body_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"ss", &header, &header_len, &body, &body_len) == FAILURE) {
Expand All @@ -322,7 +313,6 @@ PHP_METHOD(sundown_render_base, tableRow)
{
char *contents;
int contents_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &contents, &contents_len) == FAILURE) {
Expand All @@ -338,7 +328,6 @@ PHP_METHOD(sundown_render_base, tableCell)
{
char *content, *alignment;
int content_len, alignment_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"ss", &content, &content_len, &alignment, &alignment_len) == FAILURE) {
Expand All @@ -355,7 +344,6 @@ PHP_METHOD(sundown_render_base, autolink)
char *link;
int link_len;
long link_type;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"sl",&link, &link_len, &link_type) == FAILURE) {
Expand All @@ -371,7 +359,6 @@ PHP_METHOD(sundown_render_base, codespan)
{
char *code;
int code_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &code, &code_len) == FAILURE) {
Expand All @@ -387,7 +374,6 @@ PHP_METHOD(sundown_render_base, doubleEmphasis)
{
char *text;
int text_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &text, &text_len) == FAILURE) {
Expand All @@ -403,8 +389,6 @@ PHP_METHOD(sundown_render_base, emphasis)
{
char *text;
int text_len;
zval *buffer;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &text, &text_len) == FAILURE) {
Expand All @@ -420,7 +404,6 @@ PHP_METHOD(sundown_render_base, image)
{
char *link, *title, *alt_text;
int link_len, title_len, alt_text_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"sss",&link, &link_len, &title, &title_len, &alt_text, &alt_text_len) == FAILURE) {
Expand All @@ -446,7 +429,6 @@ PHP_METHOD(sundown_render_base, link)
{
char *link, *title, *content;
int link_len, title_len, content_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"sss",&link, &link_len, &title, &title_len, &content, &content_len) == FAILURE) {
Expand All @@ -462,7 +444,6 @@ PHP_METHOD(sundown_render_base, rawHtml)
{
char *raw;
int raw_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &raw, &raw_len) == FAILURE) {
Expand All @@ -478,7 +459,6 @@ PHP_METHOD(sundown_render_base, tripleEmphasis)
{
char *text;
int text_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &text, &text_len) == FAILURE) {
Expand All @@ -494,7 +474,6 @@ PHP_METHOD(sundown_render_base, strikethrough)
{
char *text;
int text_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &text, &text_len) == FAILURE) {
Expand All @@ -510,7 +489,6 @@ PHP_METHOD(sundown_render_base, superscript)
{
char *text;
int text_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &text, &text_len) == FAILURE) {
Expand All @@ -526,7 +504,6 @@ PHP_METHOD(sundown_render_base, entity)
{
char *text;
int text_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &text, &text_len) == FAILURE) {
Expand All @@ -542,7 +519,6 @@ PHP_METHOD(sundown_render_base, normalText)
{
char *text;
int text_len;
php_sundown_buffer_t *object;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s",&text, &text_len) == FAILURE) {
Expand Down Expand Up @@ -637,7 +613,7 @@ PHP_METHOD(sundown_render_base, __construct)
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;
zval *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);
Expand Down

0 comments on commit 69638de

Please sign in to comment.