[php-i18n-commits] cvs commit: php4/ext/mbstring php_mb.h

アーカイブの一覧に戻る

Tsukada ttsuk****@users*****
2002年 5月 23日 (木) 05:15:00 JST


ttsukada    02/05/23 05:15:00

  Modified:    ext/mbstring php_mb.h
  Log:
  MBFL update
  
  Revision  Changes    Path
  1.2       +61 -33    php4/ext/mbstring/php_mb.h
  
  Index: php_mb.h
  ===================================================================
  RCS file: /cvsroot/php-i18n/php4/ext/mbstring/php_mb.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- php_mb.h	20 May 2002 11:15:54 -0000	1.1
  +++ php_mb.h	22 May 2002 20:15:00 -0000	1.2
  @@ -50,7 +50,16 @@
   
   #include "php_mb_enc.h"
   #include "php_mb_lang.h"
  -#include "mbfl_filter.h"
  +#include "php_mb_buf.h"
  +#include "php_mb_str.h"
  +#include "php_mb_filter.h"
  +#include "php_mb_function.h"
  +
  +#ifdef HAVE_MBREGEX
  +#include "mbregex.h"
  +#endif
  +
  +#define PHP_MBSTRING_API 20020522
   
   #define PHP_MB_MEMORY_TYPE_CONST  1
   #define PHP_MB_MEMORY_TYPE_SALLOC 2
  @@ -58,46 +67,38 @@
   
   #define PHP_MB_CACHE_SIZE 8
   
  -/* mbbuffer */
  -typedef struct _php_mb_buf {
  -	void *global_resource;
  -	int *value;
  -	int length;
  -	int size;
  -	int realloc;
  -	int refcount;
  -	char memory_type_value;
  -	char memory_type_self;
  -} php_mb_buf;
  -
  -
  -/* mbstring */
  -typedef struct _php_mb_str {
  -	void *global_resource;
  -	php_mb_enc *encoding;
  -	unsigned char *value;
  -	int length;
  -	int size;
  -	int realloc;
  -	int refcount;
  -	char memory_type_value;
  -	char memory_type_self;
  -} php_mb_str;
  +#ifndef PHP_MB_LANGID_DEFAULT
  +#define PHP_MB_LANGID_DEFAULT php_mb_langid_uni
  +#endif
   
  +#ifndef PHP_MB_ENCID_DEFAULT
  +#define PHP_MB_ENCID_DEFAULT php_mb_encid_utf8
  +#endif
   
   /* module global */
  -ZEND_BEGIN_MODULE_GLOBALS(ombstring)
  +ZEND_BEGIN_MODULE_GLOBALS(mbstring)
   	php_mb_lang *language_m;		/* master value */
   	php_mb_lang *language_r;		/* per request */
   	php_mb_enc *internal_encoding_m;
   	php_mb_enc *internal_encoding_r;
   	php_mb_enc *cstring_encoding;
   	php_mb_enc *wchar_encoding;
  +	php_mb_enc *http_input_identify;
  +	php_mb_enc *http_input_identify_get;
  +	php_mb_enc *http_input_identify_post;
  +	php_mb_enc *http_input_identify_cookie;
  +	php_mb_enc *http_input_identify_string;
  +	char *detect_order;
  +	char *http_input;
  +	char *http_output;
  +	char *script_encoding;
   	int filter_illegal_mode_m;
   	int filter_illegal_mode_r;
   	int filter_illegal_substchar_m;
   	int filter_illegal_substchar_r;
  +	long func_overload;
   	int last_errno;
  +	php_mb_bufconv *outconv;
   
   	mbfl_pair_table **pair_table_list_m;
   	mbfl_pair_table **pair_table_list_r;
  @@ -113,17 +114,44 @@
   	php_mb_enc *encoding_cache[PHP_MB_CACHE_SIZE];
   	mbfl_convert_collection *convert_cache[PHP_MB_CACHE_SIZE];
   	mbfl_identify_function *identify_cache[PHP_MB_CACHE_SIZE];
  -ZEND_END_MODULE_GLOBALS(ombstring);
   
  -ZEND_EXTERN_MODULE_GLOBALS(ombstring)
  +#ifdef HAVE_MBREGEX
  +	int regex_mbctype_m;
  +	int regex_mbctype_r;
  +	HashTable ht_rc;
  +	zval **search_str;
  +	zval *search_str_val;
  +	unsigned int search_pos;
  +	mb_regex_t *search_re;
  +	struct mbre_registers *search_regs;
  +#endif
  +ZEND_END_MODULE_GLOBALS(mbstring);
  +
  +ZEND_EXTERN_MODULE_GLOBALS(mbstring)
   
   #ifdef ZTS
  -#define MBG(v) TSRMG(ombstring_globals_id, zend_ombstring_globals *, v)
  +#define MBSTRG(v) TSRMG(mbstring_globals_id, zend_mbstring_globals *, v)
   #else
  -#define MBG(v) (ombstring_globals.v)
  +#define MBSTRG(v) (mbstring_globals.v)
   #endif
   
   
  +#if HAVE_MBREGEX
  +#define PHP_MBREGEX_MAXCACHE 50
  +int php_mbregex_name2mbctype(const char *pname);
  +#endif
  +
  +#define MB_OVERLOAD_MAIL 1
  +#define MB_OVERLOAD_STRING 2
  +#define MB_OVERLOAD_REGEX 4
  +
  +struct mb_overload_def {
  +	int type;
  +	char *orig_func;
  +	char *ovld_func;
  +	char *save_func;
  +};
  +
   /*
    * error
    */
  @@ -141,9 +169,9 @@
   	PHP_MB_ERR_INDEX_OUT_OF_BOUNDS
   };
   
  -#define PHP_MB_IS_ERROR() (MBG(last_errno) != PHP_MB_SUCCESS)
  +#define PHP_MB_IS_ERROR() (MBSTRG(last_errno) != PHP_MB_SUCCESS)
   
  -#define PHP_MB_ERRRST() { MBG(last_errno) = PHP_MB_SUCCESS; }
  +#define PHP_MB_ERRRST() { MBSTRG(last_errno) = PHP_MB_SUCCESS; }
   
   PHPAPI char *
   php_mb_error_getstring(int last_errno);
  
  
  



php-i18n-commits メーリングリストの案内
アーカイブの一覧に戻る