georg           Tue Jul 12 05:35:17 2005 EDT

  Modified files:              
    /php-src/ext/mysqli php_mysqli.h mysqli_nonapi.c 
  Log:
  removed charset structure. libmysql now provides a function 
  mysqli_get_character_set_info (Vers. 5.0.10) 
  
  
http://cvs.php.net/diff.php/php-src/ext/mysqli/php_mysqli.h?r1=1.50&r2=1.51&ty=u
Index: php-src/ext/mysqli/php_mysqli.h
diff -u php-src/ext/mysqli/php_mysqli.h:1.50 
php-src/ext/mysqli/php_mysqli.h:1.51
--- php-src/ext/mysqli/php_mysqli.h:1.50        Wed Jun 22 05:12:43 2005
+++ php-src/ext/mysqli/php_mysqli.h     Tue Jul 12 05:35:16 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: php_mysqli.h,v 1.50 2005/06/22 09:12:43 georg Exp $ 
+  $Id: php_mysqli.h,v 1.51 2005/07/12 09:35:16 georg Exp $ 
 */
 
 /* A little hack to prevent build break, when mysql is used together with
@@ -26,6 +26,12 @@
 #endif
 
 #include <mysql.h>
+
+/* character set support */
+#if MYSQL_VERSION_ID > 50009
+#define HAVE_MYSQLI_SET_CHARSET
+#endif
+
 #include <errmsg.h>
 
 #ifndef PHP_MYSQLI_H
@@ -96,32 +102,6 @@
        void    *userdata;
 } mysqli_local_infile;
 
-typedef struct {
-  uint                         number;
-  uint                         primary_number;
-  uint                         binary_number;
-  uint                         state;
-  const char           *csname;
-  const char           *name;
-  const char           *comment;
-  const char           *tailoring;
-  unsigned char                *ctype;
-  unsigned char                *to_lower;
-  unsigned char                *to_upper;
-  unsigned char                *sort_order;
-  unsigned short       *contractions;
-  unsigned short       **sort_order_big;
-  unsigned short       *tab_to_uni;
-  void                         *tab_from_uni;
-  unsigned char                *state_map;
-  unsigned char                *ident_map;
-  uint                         strxfrm_multiply;
-  uint                         mbminlen;
-  uint                         mbmaxlen;
-  unsigned short       min_sort_char;
-  unsigned short       max_sort_char; /* For LIKE optimization */
-} CHARSET_INFO;
-
 #define phpext_mysqli_ptr &mysqli_module_entry
 
 #ifdef PHP_WIN32
@@ -130,10 +110,6 @@
 #define PHP_MYSQLI_API
 #endif
 
-#if (MYSQL_VERSION_ID > 40112 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID 
> 50005
-#define HAVE_MYSQLI_SET_CHARSET
-#endif
-
 #ifdef ZTS
 #include "TSRM.h"
 #endif
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli_nonapi.c?r1=1.48&r2=1.49&ty=u
Index: php-src/ext/mysqli/mysqli_nonapi.c
diff -u php-src/ext/mysqli/mysqli_nonapi.c:1.48 
php-src/ext/mysqli/mysqli_nonapi.c:1.49
--- php-src/ext/mysqli/mysqli_nonapi.c:1.48     Mon Jun 27 13:33:56 2005
+++ php-src/ext/mysqli/mysqli_nonapi.c  Tue Jul 12 05:35:16 2005
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli_nonapi.c,v 1.48 2005/06/27 17:33:56 tony2001 Exp $ 
+  $Id: mysqli_nonapi.c,v 1.49 2005/07/12 09:35:16 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -329,7 +329,7 @@
 {
        MY_MYSQL                                *mysql;
        zval                                    *mysql_link;
-       CHARSET_INFO                    *cs;
+       MY_CHARSET_INFO                 cs;
 
        if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
"O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
                return;
@@ -338,13 +338,16 @@
 
        object_init(return_value);
 
-       cs = (CHARSET_INFO *)mysql->mysql->charset;
+       mysql_get_character_set_info(mysql->mysql, &cs);
 
-       add_property_string(return_value, "charset", (cs->name) ? (char 
*)cs->csname : "", 1);
-       add_property_string(return_value, "collation",(cs->name) ? (char 
*)cs->name : "", 1);
-       add_property_string(return_value, "comment", (cs->comment) ? (char 
*)cs->comment : "", 1);
-       add_property_long(return_value, "min_length", cs->mbminlen);
-       add_property_long(return_value, "max_length", cs->mbmaxlen);
+       add_property_string(return_value, "charset", (cs.name) ? (char 
*)cs.csname : "", 1);
+       add_property_string(return_value, "collation",(cs.name) ? (char 
*)cs.name : "", 1);
+       add_property_string(return_value, "comment", (cs.comment) ? (char 
*)cs.comment : "", 1);
+       add_property_string(return_value, "dir", (cs.dir) ? (char *)cs.dir : 
"", 1);
+       add_property_long(return_value, "min_length", cs.mbminlen);
+       add_property_long(return_value, "max_length", cs.mbmaxlen);
+       add_property_long(return_value, "number", cs.number);
+       add_property_long(return_value, "state", cs.state);
 }
 /* }}} */
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to