]> granicus.if.org Git - php/commitdiff
MFB (made mbstring compile on windows again).
authorEdin Kadribasic <edink@php.net>
Wed, 13 Nov 2002 23:11:14 +0000 (23:11 +0000)
committerEdin Kadribasic <edink@php.net>
Wed, 13 Nov 2002 23:11:14 +0000 (23:11 +0000)
ext/mbstring/mbstring.c
ext/mbstring/mbstring.dsp
ext/mbstring/mbstring.h
ext/mbstring/php_mbregex.c
ext/mbstring/php_mbregex.h
ext/mbstring/php_unicode.c
ext/mbstring/php_unicode.h

index 30fb0650fff77f55eb2dd2df825c84f7a360e8c5..bbbf9b6df0abba81e959c06e70a09438a1d7114e 100644 (file)
@@ -415,8 +415,8 @@ php_mb_parse_encoding_list(const char *value, int value_length, int **return_lis
 }
 /* }}} */
 
-/* {{{ PHPAPI php_mb_check_encoding_list */
-PHPAPI int php_mb_check_encoding_list(const char *encoding_list TSRMLS_DC) {
+/* {{{ MBSTRING_API php_mb_check_encoding_list */
+MBSTRING_API int php_mb_check_encoding_list(const char *encoding_list TSRMLS_DC) {
        return php_mb_parse_encoding_list(encoding_list, strlen(encoding_list), NULL, NULL, 0); 
 }
 /* }}} */
@@ -1525,9 +1525,9 @@ SAPI_POST_HANDLER_FUNC(php_mbstr_post_handler)
 #define IS_SJIS1(c) ((((c)>=0x81 && (c)<=0x9f) || ((c)>=0xe0 && (c)<=0xf5)) ? 1 : 0)
 #define IS_SJIS2(c) ((((c)>=0x40 && (c)<=0x7e) || ((c)>=0x80 && (c)<=0xfc)) ? 1 : 0)
 
-/* {{{ SAPI_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
+/* {{{ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
  * http input processing */
-SAPI_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
+MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
 {
        char *res = NULL, *separator=NULL;
        const char *c_var;
@@ -2458,8 +2458,8 @@ PHP_FUNCTION(mb_strimwidth)
 }
 /* }}} */
 
-/* {{{ PHPAPI char *php_mb_convert_encoding() */
-PHPAPI char * php_mb_convert_encoding(char *input, size_t length, char *_to_encoding, char *_from_encodings, size_t *output_len TSRMLS_DC)
+/* {{{ MBSTRING_API char *php_mb_convert_encoding() */
+MBSTRING_API char * php_mb_convert_encoding(char *input, size_t length, char *_to_encoding, char *_from_encodings, size_t *output_len TSRMLS_DC)
 {
        mbfl_string string, result, *ret;
        enum mbfl_no_encoding from_encoding, to_encoding;
@@ -3495,15 +3495,15 @@ PHP_FUNCTION(mb_get_info)
 }
 /* }}} */
 
-/* {{{ PHPAPI int php_mb_encoding_translation() */
-PHPAPI int php_mb_encoding_translation(TSRMLS_D) 
+/* {{{ MBSTRING_API int php_mb_encoding_translation() */
+MBSTRING_API int php_mb_encoding_translation(TSRMLS_D) 
 {
        return MBSTRG(encoding_translation);
 }
 /* }}} */
 
-/* {{{ PHPAPI size_t php_mb_mbchar_bytes_ex() */
-PHPAPI size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc)
+/* {{{ MBSTRING_API size_t php_mb_mbchar_bytes_ex() */
+MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc)
 {
        if (enc != NULL) {
                if (enc->flag & MBFL_ENCTYPE_MBCS) {
@@ -3520,16 +3520,16 @@ PHPAPI size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc)
 }
 /* }}} */
 
-/* {{{ PHPAPI size_t php_mb_mbchar_bytes() */
-PHPAPI size_t php_mb_mbchar_bytes(const char *s TSRMLS_DC)
+/* {{{ MBSTRING_API size_t php_mb_mbchar_bytes() */
+MBSTRING_API size_t php_mb_mbchar_bytes(const char *s TSRMLS_DC)
 {
        return php_mb_mbchar_bytes_ex(s,
                mbfl_no2encoding(MBSTRG(internal_encoding)));
 }
 /* }}} */
 
-/* {{{ PHPAPI char *php_mb_safe_strrchr_ex() */
-PHPAPI char *php_mb_safe_strrchr_ex(const char *s, unsigned int c, size_t nbytes, const mbfl_encoding *enc)
+/* {{{ MBSTRING_API char *php_mb_safe_strrchr_ex() */
+MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c, size_t nbytes, const mbfl_encoding *enc)
 {
        register const char *p = s;
        char *last=NULL;
@@ -3560,24 +3560,24 @@ PHPAPI char *php_mb_safe_strrchr_ex(const char *s, unsigned int c, size_t nbytes
 }
 /* }}} */
 
-/* {{{ PHPAPI char *php_mb_safe_strrchr() */
-PHPAPI char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nbytes TSRMLS_DC)
+/* {{{ MBSTRING_API char *php_mb_safe_strrchr() */
+MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nbytes TSRMLS_DC)
 {
        return php_mb_safe_strrchr_ex(s, c, nbytes,
                mbfl_no2encoding(MBSTRG(internal_encoding)));
 }
 /* }}} */
 
-/* {{{ PHPAPI char *php_mb_strrchr() */
-PHPAPI char *php_mb_strrchr(const char *s, char c TSRMLS_DC)
+/* {{{ MBSTRING_API char *php_mb_strrchr() */
+MBSTRING_API char *php_mb_strrchr(const char *s, char c TSRMLS_DC)
 {
        return php_mb_safe_strrchr(s, c, -1 TSRMLS_CC);
 }
 /* }}} */
 
 #ifdef ZEND_MULTIBYTE
-/* {{{ PHPAPI int php_mb_set_zend_encoding() */
-PHPAPI int php_mb_set_zend_encoding(TSRMLS_D)
+/* {{{ MBSTRING_API int php_mb_set_zend_encoding() */
+MBSTRING_API int php_mb_set_zend_encoding(TSRMLS_D)
 {
        /* 'd better use mbfl_memory_device? */
        char *name, *list = NULL;
index 4f60ba36909b0f306856795081cc2078a3504bbf..d1238738663a83ab10295fc6b367b92541aade54 100644 (file)
@@ -43,7 +43,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MBSTRING_EXPORTS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D ZTS=1 /D "COMPILE_DL_MBSTRING" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MBSTRING=1 /FR /YX /FD /c\r
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "_MBCS" /D "_USRDLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D MBSTRING_EXPORTS=1 /D HAVE_MBSTRING=1 /D HAVE_MBREGEX=1 /D HAVE_MBSTR_CN=1 /D HAVE_MBSTR_JA=1 /D HAVE_MBSTR_KR=1 /D HAVE_MBSTR_RU=1 /D HAVE_MBSTR_TW=1 /FR /YX /FD /c\r
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
 # ADD BASE RSC /l 0x407 /d "NDEBUG"\r
@@ -69,7 +69,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MBSTRING_EXPORTS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "MBSTRING_EXPORTS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MBSTRING=1 /YX /FD /GZ /c\r
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "MBSTRING_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D MBSTRING_EXPORTS=1 /D HAVE_MBSTRING=1 /D HAVE_MBREGEX=1 /D HAVE_MBSTR_CN=1 /D HAVE_MBSTR_JA=1 /D HAVE_MBSTR_KR=1 /D HAVE_MBSTR_RU=1 /D HAVE_MBSTR_TW=1 /YX /FD /GZ /c\r
 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
 # ADD BASE RSC /l 0x407 /d "_DEBUG"\r
@@ -92,6 +92,10 @@ LINK32=link.exe
 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
 # Begin Source File\r
 \r
+SOURCE=.\html_entities.c\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=.\mbfilter.c\r
 # End Source File\r
 # Begin Source File\r
@@ -130,10 +134,6 @@ SOURCE=.\php_mbregex.c
 \r
 SOURCE=.\php_unicode.c\r
 # End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\html_entities.c\r
-# End Source File\r
 # End Group\r
 # Begin Group "Header Files"\r
 \r
@@ -199,6 +199,5 @@ SOURCE=.\unicode_table_kr.h
 SOURCE=.\unicode_table_tw.h\r
 # End Source File\r
 # End Group\r
-\r
 # End Target\r
 # End Project\r
index 6668e2ebf3cb088fddd8105681b6e6aa0f3a2d93..b5c3d65280693be680088726498b218643edcafb 100644 (file)
 #ifdef COMPILE_DL_MBSTRING
 #undef HAVE_MBSTRING
 #define HAVE_MBSTRING 1
-#undef PHPAPI
-#define PHPAPI
+#undef MBSTRING_API
+#define MBSTRING_API
+
+#endif
+
+#ifdef PHP_WIN32
+#undef MBSTRING_API
+#ifdef MBSTRING_EXPORTS
+#define MBSTRING_API __declspec(dllexport)
+#else
+#define MBSTRING_API __declspec(dllimport)
+#endif
 #endif
 
+
 #if HAVE_MBSTRING
 
 #include "mbfilter.h"
@@ -107,23 +118,23 @@ PHP_FUNCTION(mb_decode_numericentity);
 PHP_FUNCTION(mb_send_mail);
 PHP_FUNCTION(mb_get_info);
 
-PHPAPI int php_mb_encoding_translation(TSRMLS_D);
+MBSTRING_API int php_mb_encoding_translation(TSRMLS_D);
 
-PHPAPI char *php_mb_safe_strrchr_ex(const char *s, unsigned int c,
+MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c,
                                     size_t nbytes, const mbfl_encoding *enc);
-PHPAPI char *php_mb_safe_strrchr(const char *s, unsigned int c,
+MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c,
                                  size_t nbytes TSRMLS_DC);
-PHPAPI char *php_mb_strrchr(const char *s, char c TSRMLS_DC);
+MBSTRING_API char *php_mb_strrchr(const char *s, char c TSRMLS_DC);
 
-PHPAPI char * php_mb_convert_encoding(char *input, size_t length,
+MBSTRING_API char * php_mb_convert_encoding(char *input, size_t length,
                                       char *_to_encoding,
                                       char *_from_encodings,
                                       size_t *output_len TSRMLS_DC);
 
-PHPAPI int php_mb_check_encoding_list(const char *encoding_list TSRMLS_DC);
+MBSTRING_API int php_mb_check_encoding_list(const char *encoding_list TSRMLS_DC);
 
-PHPAPI size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc);
-PHPAPI size_t php_mb_mbchar_bytes(const char *s TSRMLS_DC);
+MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc);
+MBSTRING_API size_t php_mb_mbchar_bytes(const char *s TSRMLS_DC);
 
 
 ZEND_BEGIN_MODULE_GLOBALS(mbstring)
@@ -178,7 +189,7 @@ struct mb_overload_def {
 #endif
 
 #ifdef ZEND_MULTIBYTE
-PHPAPI int php_mb_set_zend_encoding(TSRMLS_D);
+MBSTRING_API int php_mb_set_zend_encoding(TSRMLS_D);
 char* php_mb_encoding_detector(const char *string, int length, char *list
                TSRMLS_DC);
 int php_mb_encoding_converter(char **to, int *to_length, const char *from,
@@ -188,7 +199,7 @@ int php_mb_oddlen(const char *string, int length, const char *encoding TSRMLS_DC
 #endif /* ZEND_MULTIBYTE */
 
 SAPI_POST_HANDLER_FUNC(php_mbstr_post_handler);
-SAPI_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data);
+MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data);
 
 #else  /* HAVE_MBSTRING */
 
index dfa93f4eefaa2c5c1d10b3e5778fd53715f6a262..8d4dd20ccb6c432fd21018ec1d3628582eb565e7 100644 (file)
@@ -1027,7 +1027,7 @@ PHP_FUNCTION(mb_ereg_search_setpos)
 /* }}} */
 
 /* {{{ php_mb_regex_set_options */
-PHPAPI int php_mb_regex_set_options( int options TSRMLS_DC) 
+int php_mb_regex_set_options( int options TSRMLS_DC) 
 {
        int prev_opt = MBSTRG(regex_default_options);
        MBSTRG(regex_default_options) = options;
@@ -1036,7 +1036,7 @@ PHPAPI int php_mb_regex_set_options( int options TSRMLS_DC)
 /* }}} */
 
 /* {{{ php_mb_regex_set_options_by_string */
-PHPAPI int php_mb_regex_set_options_by_string( const char *opt_str, int len TSRMLS_DC)
+int php_mb_regex_set_options_by_string( const char *opt_str, int len TSRMLS_DC)
 {
        int new_opt = 0;
        _php_mb_regex_init_options( opt_str, len, &new_opt, NULL);
index 4ced465071edd50416a092841b4afc855af908d7..e0620a2a83d674e1d7c42e5ffbfe17d74b9168ce 100644 (file)
@@ -26,7 +26,7 @@
 #include "php.h"
 #include "zend.h"
 #include "mbregex.h"
+
 /* {{{ PHP_MBREGEX_GLOBALS */
 #define PHP_MBREGEX_GLOBALS \
        int default_mbctype; \
@@ -42,9 +42,9 @@
 
 #define PHP_MBREGEX_MAXCACHE 50
 
-PHPAPI int php_mb_regex_name2mbctype(const char *pname);
-PHPAPI int php_mb_regex_set_options(int options TSRMLS_DC);
-PHPAPI int php_mb_regex_set_options_by_string(const char *optstr, int len TSRMLS_DC);
+int php_mb_regex_name2mbctype(const char *pname);
+int php_mb_regex_set_options(int options TSRMLS_DC);
+int php_mb_regex_set_options_by_string(const char *optstr, int len TSRMLS_DC);
 
 PHP_FUNCTION(mb_regex_encoding);
 PHP_FUNCTION(mb_ereg);
index fd07520c408b228844be90fcd63324ae126ac675..d7010337a13870c591bd864ca4be3510a9dfe753 100644 (file)
@@ -96,7 +96,7 @@ static int prop_lookup(unsigned long code, unsigned long n)
 
 }
 
-PHPAPI int php_unicode_is_prop(unsigned long code, unsigned long mask1,
+MBSTRING_API int php_unicode_is_prop(unsigned long code, unsigned long mask1,
                unsigned long mask2)
 {
        unsigned long i;
@@ -142,7 +142,7 @@ static unsigned long case_lookup(unsigned long code, long l, long r, int field)
        return code;
 }
 
-PHPAPI unsigned long php_unicode_toupper(unsigned long code)
+MBSTRING_API unsigned long php_unicode_toupper(unsigned long code)
 {
        int field;
        long l, r;
@@ -168,7 +168,7 @@ PHPAPI unsigned long php_unicode_toupper(unsigned long code)
        return case_lookup(code, l, r, field);
 }
 
-PHPAPI unsigned long php_unicode_tolower(unsigned long code)
+MBSTRING_API unsigned long php_unicode_tolower(unsigned long code)
 {
        int field;
        long l, r;
@@ -194,7 +194,7 @@ PHPAPI unsigned long php_unicode_tolower(unsigned long code)
        return case_lookup(code, l, r, field);
 }
 
-PHPAPI unsigned long php_unicode_totitle(unsigned long code)
+MBSTRING_API unsigned long php_unicode_totitle(unsigned long code)
 {
        int field;
        long l, r;
@@ -239,7 +239,7 @@ PHPAPI unsigned long php_unicode_totitle(unsigned long code)
        ((unsigned char*)(ptr))[3] = (v    ) & 0xff;\
 }
 
-PHPAPI char *php_unicode_convert_case(int case_mode, char *srcstr, size_t srclen, size_t *ret_len,
+MBSTRING_API char *php_unicode_convert_case(int case_mode, char *srcstr, size_t srclen, size_t *ret_len,
                char *src_encoding TSRMLS_DC)
 {
        char *unicode, *newstr;
index cf2882cda1f1be1a142f013d8d6c44af7aa605e3..b4c25132d85158bdef7870167a3f30b2e931d051 100644 (file)
 #define UC_PI 0x00008000 /* Punctuation, Initial       */
 #define UC_PF 0x00010000 /* Punctuation, Final         */
 
-PHPAPI int php_unicode_is_prop(unsigned long code, unsigned long mask1,
+MBSTRING_API int php_unicode_is_prop(unsigned long code, unsigned long mask1,
                unsigned long mask2);
-PHPAPI char *php_unicode_convert_case(int case_mode, char *srcstr, size_t srclen, size_t *retlen,
+MBSTRING_API char *php_unicode_convert_case(int case_mode, char *srcstr, size_t srclen, size_t *retlen,
                char *src_encoding TSRMLS_DC);
 
 #define PHP_UNICODE_CASE_UPPER 0