cvs: php3 / ChangeLog /functions sybase.c

From: Date: Mon, 07 Aug 2000 00:09:54 +0000
Subject: cvs: php3 / ChangeLog /functions sybase.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-1077@lists.php.net to get a copy of this message
rasmus Sun Aug 6 17:09:54 2000 EDT Modified files: /php3 ChangeLog /php3/functions sybase.c Log: Add optional charset parameter to sybase_[p]connect Index: php3/ChangeLog diff -u php3/ChangeLog:1.845 php3/ChangeLog:1.846 --- php3/ChangeLog:1.845 Sat Jul 15 07:15:31 2000 +++ php3/ChangeLog Sun Aug 6 17:09:54 2000 @@ -2,6 +2,7 @@ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?, 200x, Version 3.0.17 +- Add optional charset parameter to sybase_[p]connect (alf@alpha.ulatina.ac.cr) - Fixed incorrect handling of 0-precision strings (e.g., %4.0s) in printf (Ken Coar) - You can now call Ora_Error() without prameters to get the reason Index: php3/functions/sybase.c diff -u php3/functions/sybase.c:1.113 php3/functions/sybase.c:1.114 --- php3/functions/sybase.c:1.113 Mon Feb 7 15:54:51 2000 +++ php3/functions/sybase.c Sun Aug 6 17:09:54 2000 @@ -31,7 +31,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sybase.c,v 1.113 2000/02/07 23:54:51 zeev Exp $ */ +/* $Id: sybase.c,v 1.114 2000/08/07 00:09:54 rasmus Exp $ */ #ifndef MSVC5 @@ -260,7 +260,7 @@ static void php3_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) { - char *user,*passwd,*host; + char *user,*passwd,*host,*charset; char *hashed_details; int hashed_details_length; sybase_link sybase,*sybase_ptr; @@ -322,6 +322,25 @@ sprintf(hashed_details,"sybase_%s_%s_%s",yyhost->value.str.val,yyuser->value.str.val,yypasswd->value.str.val); /* SAFE */ } break; + case 4: { + pval *yyhost,*yyuser,*yypasswd,*yycharset; + if (getParameters(ht, 4, &yyhost, &yyuser, &yypasswd, &yycharset) == FAILURE) { + RETURN_FALSE; + } + convert_to_string(yyhost); + convert_to_string(yyuser); + convert_to_string(yypasswd); + convert_to_string(yycharset); + host = yyhost->value.str.val; + user = yyuser->value.str.val; + passwd = yypasswd->value.str.val; + charset = yycharset->value.str.val; + hashed_details_length = yyhost->value.str.len+yyuser->value.str.len+yypasswd->value.str.len+yycharset->value.str.len+6+3; + hashed_details = (char *) emalloc(hashed_details_length+1); + sprintf(hashed_details,"sybase_%s_%s_%s_%s",yyhost->value.str.val,yyuser->value.str.val,yypasswd->value.str.val,yycharset->value.str.val); /* SAFE */ + } + break; + default: WRONG_PARAM_COUNT; break; @@ -340,6 +359,9 @@ if (passwd) { DBSETLPWD(sybase.login,passwd); } + if (charset) { + DBSETLCHARSET(sybase.login,charset); + } DBSETLAPP(sybase.login,php3_sybase_module.appname); sybase.valid = 1; @@ -510,7 +532,7 @@ } -/* {{{ proto int sybase_connect([string host [, string user [, string password]]]) +/* {{{ proto int sybase_connect([string host [, string user [, string password [, string charset]]]]) Open Sybase server connection */ void php3_sybase_connect(INTERNAL_FUNCTION_PARAMETERS) { @@ -518,7 +540,7 @@ } /* }}} */ -/* {{{ proto int sybase_pconnect([string host [, string user [, string password]]]) +/* {{{ proto int sybase_pconnect([string host [, string user [, string password [, string charset]]]]) Open persistent Sybase connection */ void php3_sybase_pconnect(INTERNAL_FUNCTION_PARAMETERS) {

« previous php.cvs (#1077) next »