@ -40,24 +40,24 @@ static int le_ii_link,le_ii_plink;
/* Every user visible function must have an entry in ii_functions[].
*/
function_entry ii_functions [ ] = {
PHP_FE ( ii _connect , NULL )
PHP_FE ( ii _pconnect , NULL )
PHP_FE ( ii _close , NULL )
PHP_FE ( ii _query , NULL )
PHP_FE ( ii _num_rows , NULL )
PHP_FE ( ii _num_fields , NULL )
PHP_FE ( ii _field_name , NULL )
PHP_FE ( ii _field_type , NULL )
PHP_FE ( ii _field_nullable , NULL )
PHP_FE ( ii _field_length , NULL )
PHP_FE ( ii _field_precision , NULL )
PHP_FE ( ii _field_scale , NULL )
PHP_FE ( ii _fetch_array , NULL )
PHP_FE ( ii _fetch_row , NULL )
PHP_FE ( ii _fetch_object , NULL )
PHP_FE ( ii _rollback , NULL )
PHP_FE ( ii _commit , NULL )
PHP_FE ( ii _autocommit , NULL )
PHP_FE ( ingres _connect , NULL )
PHP_FE ( ingres _pconnect , NULL )
PHP_FE ( ingres _close , NULL )
PHP_FE ( ingres _query , NULL )
PHP_FE ( ingres _num_rows , NULL )
PHP_FE ( ingres _num_fields , NULL )
PHP_FE ( ingres _field_name , NULL )
PHP_FE ( ingres _field_type , NULL )
PHP_FE ( ingres _field_nullable , NULL )
PHP_FE ( ingres _field_length , NULL )
PHP_FE ( ingres _field_precision , NULL )
PHP_FE ( ingres _field_scale , NULL )
PHP_FE ( ingres _fetch_array , NULL )
PHP_FE ( ingres _fetch_row , NULL )
PHP_FE ( ingres _fetch_object , NULL )
PHP_FE ( ingres _rollback , NULL )
PHP_FE ( ingres _commit , NULL )
PHP_FE ( ingres _autocommit , NULL )
{ NULL , NULL , NULL } /* Must be the last line in ii_functions[] */
} ;
@ -79,12 +79,12 @@ ZEND_GET_MODULE(ingres_ii)
/* php.ini entries
*/
PHP_INI_BEGIN ( )
STD_PHP_INI_BOOLEAN ( " ii .allow_persistent " , " 1 " , PHP_INI_SYSTEM , OnUpdateInt , allow_persistent , zend_ii_globals , ii_globals )
STD_PHP_INI_ENTRY_EX ( " ii .max_persistent " , " -1 " , PHP_INI_SYSTEM , OnUpdateInt , max_persistent , zend_ii_globals , ii_globals , display_link_numbers )
STD_PHP_INI_ENTRY_EX ( " ii .max_links " , " -1 " , PHP_INI_SYSTEM , OnUpdateInt , max_links , zend_ii_globals , ii_globals , display_link_numbers )
STD_PHP_INI_ENTRY ( " ii .default_database " , NULL , PHP_INI_ALL , OnUpdateString , default_database , zend_ii_globals , ii_globals )
STD_PHP_INI_ENTRY ( " ii .default_user " , NULL , PHP_INI_ALL , OnUpdateString , default_user , zend_ii_globals , ii_globals )
STD_PHP_INI_ENTRY ( " ii .default_password " , NULL , PHP_INI_ALL , OnUpdateString , default_password , zend_ii_globals , ii_globals )
STD_PHP_INI_BOOLEAN ( " ingres .allow_persistent " , " 1 " , PHP_INI_SYSTEM , OnUpdateInt , allow_persistent , zend_ii_globals , ii_globals )
STD_PHP_INI_ENTRY_EX ( " ingres .max_persistent " , " -1 " , PHP_INI_SYSTEM , OnUpdateInt , max_persistent , zend_ii_globals , ii_globals , display_link_numbers )
STD_PHP_INI_ENTRY_EX ( " ingres .max_links " , " -1 " , PHP_INI_SYSTEM , OnUpdateInt , max_links , zend_ii_globals , ii_globals , display_link_numbers )
STD_PHP_INI_ENTRY ( " ingres .default_database " , NULL , PHP_INI_ALL , OnUpdateString , default_database , zend_ii_globals , ii_globals )
STD_PHP_INI_ENTRY ( " ingres .default_user " , NULL , PHP_INI_ALL , OnUpdateString , default_user , zend_ii_globals , ii_globals )
STD_PHP_INI_ENTRY ( " ingres .default_password " , NULL , PHP_INI_ALL , OnUpdateString , default_password , zend_ii_globals , ii_globals )
PHP_INI_END ( )
/* closes statement in given link
@ -360,9 +360,9 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
db = pass = NULL ;
user = php_get_current_user ( ) ;
hashed_details_length = strlen ( user ) + sizeof ( " ii ___ " ) - 1 ;
hashed_details_length = strlen ( user ) + sizeof ( " ingres ___ " ) - 1 ;
hashed_details = ( char * ) emalloc ( hashed_details_length + 1 ) ;
sprintf ( hashed_details , " ii __%s_ " , user ) ;
sprintf ( hashed_details , " ingres __%s_ " , user ) ;
} else {
db = IIG ( default_database ) ;
user = IIG ( default_user ) ;
@ -389,9 +389,9 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
break ;
}
hashed_details_length = sizeof ( " ii ___ " ) - 1 + strlen ( SAFE_STRING ( db ) ) + strlen ( SAFE_STRING ( user ) ) + strlen ( SAFE_STRING ( pass ) ) ;
hashed_details_length = sizeof ( " ingres ___ " ) - 1 + strlen ( SAFE_STRING ( db ) ) + strlen ( SAFE_STRING ( user ) ) + strlen ( SAFE_STRING ( pass ) ) ;
hashed_details = ( char * ) emalloc ( hashed_details_length + 1 ) ;
sprintf ( hashed_details , " ii _%s_%s_%s " , SAFE_STRING ( db ) , SAFE_STRING ( user ) , SAFE_STRING ( pass ) ) ;
sprintf ( hashed_details , " ingres _%s_%s_%s " , SAFE_STRING ( db ) , SAFE_STRING ( user ) , SAFE_STRING ( pass ) ) ;
}
/* if asked for unauthorized persistency, issue a warning
@ -546,25 +546,25 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
php_ii_set_default_link ( return_value - > value . lval ) ;
}
/* {{{ proto resource ii _connect([string database [, string username [, string password]]])
/* {{{ proto resource ingres _connect([string database [, string username [, string password]]])
Open a connection to an Ingres II database the syntax of database is [ node_id : : ] dbname [ / svr_class ] */
PHP_FUNCTION ( ii _connect )
PHP_FUNCTION ( ingres _connect )
{
php_ii_do_connect ( INTERNAL_FUNCTION_PARAM_PASSTHRU , 0 ) ;
}
/* }}} */
/* {{{ proto resource ii _pconnect([string database [, string username [, string password]]])
/* {{{ proto resource ingres _pconnect([string database [, string username [, string password]]])
Open a persistent connection to an Ingres II database the syntax of database is [ node_id : : ] dbname [ / svr_class ] */
PHP_FUNCTION ( ii _pconnect )
PHP_FUNCTION ( ingres _pconnect )
{
php_ii_do_connect ( INTERNAL_FUNCTION_PARAM_PASSTHRU , 1 ) ;
}
/* }}} */
/* {{{ proto bool ii _close([resource link])
/* {{{ proto bool ingres _close([resource link])
Close an Ingres II database connection */
PHP_FUNCTION ( ii _close )
PHP_FUNCTION ( ingres _close )
{
zval * * link ;
int argc ;
@ -587,7 +587,7 @@ PHP_FUNCTION(ii_close)
}
/* }}} */
/* {{{ proto bool ii _query(string query [, resource link])
/* {{{ proto bool ingres _query(string query [, resource link])
Send a SQL query to Ingres II */
/* This should go into the documentation */
/* Unsupported query types:
@ -602,7 +602,7 @@ PHP_FUNCTION(ii_close)
- set autocommit
- < all cursor related queries >
( look for dedicated functions instead ) */
PHP_FUNCTION ( ii _query )
PHP_FUNCTION ( ingres _query )
{
zval * * query , * * link ;
int argc ;
@ -671,12 +671,12 @@ PHP_FUNCTION(ii_query)
}
/* }}} */
/* {{{ proto int ii _num_rows([resource link])
/* {{{ proto int ingres _num_rows([resource link])
Return the number of rows affected / returned by the last query */
/* Warning : don't call ii_num_rows() before ii _fetch_xx(),
or ii _fetch_xx ( ) wouldn ' t find any data */
PHP_FUNCTION ( ii _num_rows )
/* Warning : don't call ingres_num_rows() before ingres _fetch_xx(),
or ingres _fetch_xx ( ) wouldn ' t find any data */
PHP_FUNCTION ( ingres _num_rows )
{
zval * * link ;
int argc ;
@ -717,9 +717,9 @@ PHP_FUNCTION(ii_num_rows)
}
/* }}} */
/* {{{ proto int ii _num_fields([resource link])
/* {{{ proto int ingres _num_fields([resource link])
Return the number of fields returned by the last query */
PHP_FUNCTION ( ii _num_fields )
PHP_FUNCTION ( ingres _num_fields )
{
zval * * link ;
int argc ;
@ -866,49 +866,49 @@ static char *php_ii_field_name(II_LINK *ii_link, int index)
return ( ii_link - > descriptor [ index - 1 ] ) . ds_columnName ;
}
/* {{{ proto string ii _field_name(int index [, resource link])
Return the name of a field in a query result index must be > 0 and < = ii _num_fields ( ) */
PHP_FUNCTION ( ii _field_name )
/* {{{ proto string ingres _field_name(int index [, resource link])
Return the name of a field in a query result index must be > 0 and < = ingres _num_fields ( ) */
PHP_FUNCTION ( ingres _field_name )
{
php_ii_field_info ( INTERNAL_FUNCTION_PARAM_PASSTHRU , II_FIELD_INFO_NAME ) ;
}
/* }}} */
/* {{{ proto string ii _field_type(int index [, resource link])
Return the type of a field in a query result index must be > 0 and < = ii _num_fields ( ) */
PHP_FUNCTION ( ii _field_type )
/* {{{ proto string ingres _field_type(int index [, resource link])
Return the type of a field in a query result index must be > 0 and < = ingres _num_fields ( ) */
PHP_FUNCTION ( ingres _field_type )
{
php_ii_field_info ( INTERNAL_FUNCTION_PARAM_PASSTHRU , II_FIELD_INFO_TYPE ) ;
}
/* }}} */
/* {{{ proto string ii _field_nullable(int index [, resource link])
Return true if the field is nullable and false otherwise index must be > 0 and < = ii _num_fields ( ) */
PHP_FUNCTION ( ii _field_nullable )
/* {{{ proto string ingres _field_nullable(int index [, resource link])
Return true if the field is nullable and false otherwise index must be > 0 and < = ingres _num_fields ( ) */
PHP_FUNCTION ( ingres _field_nullable )
{
php_ii_field_info ( INTERNAL_FUNCTION_PARAM_PASSTHRU , II_FIELD_INFO_NULLABLE ) ;
}
/* }}} */
/* {{{ proto string ii _field_length(int index [, resource link])
Return the length of a field in a query result index must be > 0 and < = ii _num_fields ( ) */
PHP_FUNCTION ( ii _field_length )
/* {{{ proto string ingres _field_length(int index [, resource link])
Return the length of a field in a query result index must be > 0 and < = ingres _num_fields ( ) */
PHP_FUNCTION ( ingres _field_length )
{
php_ii_field_info ( INTERNAL_FUNCTION_PARAM_PASSTHRU , II_FIELD_INFO_LENGTH ) ;
}
/* }}} */
/* {{{ proto string ii _field_precision(int index [, resource link])
Return the precision of a field in a query result index must be > 0 and < = ii _num_fields ( ) */
PHP_FUNCTION ( ii _field_precision )
/* {{{ proto string ingres _field_precision(int index [, resource link])
Return the precision of a field in a query result index must be > 0 and < = ingres _num_fields ( ) */
PHP_FUNCTION ( ingres _field_precision )
{
php_ii_field_info ( INTERNAL_FUNCTION_PARAM_PASSTHRU , II_FIELD_INFO_PRECISION ) ;
}
/* }}} */
/* {{{ proto string ii _field_scale(int index [, resource link])
Return the scale of a field in a query result index must be > 0 and < = ii _num_fields ( ) */
PHP_FUNCTION ( ii _field_scale )
/* {{{ proto string ingres _field_scale(int index [, resource link])
Return the scale of a field in a query result index must be > 0 and < = ingres _num_fields ( ) */
PHP_FUNCTION ( ingres _field_scale )
{
php_ii_field_info ( INTERNAL_FUNCTION_PARAM_PASSTHRU , II_FIELD_INFO_SCALE ) ;
}
@ -1134,9 +1134,9 @@ static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int res
}
/* {{{ proto array ii _fetch_array([int result_type [, resource link]])
/* {{{ proto array ingres _fetch_array([int result_type [, resource link]])
Fetch a row of result into an array result_type can be II_NUM for enumerated array , II_ASSOC for associative array , or II_BOTH ( default ) */
PHP_FUNCTION ( ii _fetch_array )
PHP_FUNCTION ( ingres _fetch_array )
{
zval * * result_type , * * link ;
int argc ;
@ -1164,9 +1164,9 @@ PHP_FUNCTION(ii_fetch_array)
}
/* }}} */
/* {{{ proto array ii _fetch_row([resource link])
/* {{{ proto array ingres _fetch_row([resource link])
Fetch a row of result into an enumerated array */
PHP_FUNCTION ( ii _fetch_row )
PHP_FUNCTION ( ingres _fetch_row )
{
zval * * link ;
int argc ;
@ -1189,9 +1189,9 @@ PHP_FUNCTION(ii_fetch_row)
}
/* }}} */
/* {{{ proto array ii _fetch_object([int result_type [, resource link]])
/* {{{ proto array ingres _fetch_object([int result_type [, resource link]])
Fetch a row of result into an object result_type can be II_NUM for enumerated object , II_ASSOC for associative object , or II_BOTH ( default ) */
PHP_FUNCTION ( ii _fetch_object )
PHP_FUNCTION ( ingres _fetch_object )
{
zval * * result_type , * * link ;
int argc ;
@ -1222,9 +1222,9 @@ PHP_FUNCTION(ii_fetch_object)
}
/* }}} */
/* {{{ proto bool ii _rollback([resource link])
/* {{{ proto bool ingres _rollback([resource link])
Roll back a transaction */
PHP_FUNCTION ( ii _rollback )
PHP_FUNCTION ( ingres _rollback )
{
zval * * link ;
int argc ;
@ -1249,9 +1249,9 @@ PHP_FUNCTION(ii_rollback)
}
/* }}} */
/* {{{ proto bool ii _commit([resource link])
/* {{{ proto bool ingres _commit([resource link])
Commit a transaction */
PHP_FUNCTION ( ii _commit )
PHP_FUNCTION ( ingres _commit )
{
zval * * link ;
int argc ;
@ -1291,9 +1291,9 @@ PHP_FUNCTION(ii_commit)
}
/* }}} */
/* {{{ proto bool ii _autocommit([resource link])
/* {{{ proto bool ingres _autocommit([resource link])
Switch autocommit on or off */
PHP_FUNCTION ( ii _autocommit )
PHP_FUNCTION ( ingres _autocommit )
{
zval * * link ;
int argc ;