[PHP-DEV] CVS update: php31/ext/oracle From: ssb (php-dev <email protected>)
Date: 06/26/98

Date: Friday June 26, 1998 @ 9:21
Author: ssb

Update of /repository/php31/ext/oracle
In directory asf:/tmp/cvs-serv7261

Modified Files:
        oracle.c oracle.h
Log Message:
applied changes to 3.0 since june 3.
Index: php31/ext/oracle/oracle.c
diff -c php31/ext/oracle/oracle.c:1.3 php31/ext/oracle/oracle.c:1.4
*** php31/ext/oracle/oracle.c:1.3 Mon Jun 1 22:31:57 1998
--- php31/ext/oracle/oracle.c Fri Jun 26 09:21:18 1998
***************
*** 45,51 ****
  
  #ifdef THREAD_SAFE
  
! void *uodbc_mutex;
  DWORD ORACLETls;
  static int numthreads=0;
  
--- 45,51 ----
  
  #ifdef THREAD_SAFE
  
! void *oracle_mutex;
  DWORD ORACLETls;
  static int numthreads=0;
  
***************
*** 69,75 ****
  #define DB_SIZE 65536
  
  static oraConnection *ora_get_conn(HashTable *, int);
- static void ora_del_conn(HashTable *, int);
  static int ora_add_cursor(HashTable *, oraCursor *);
  static oraCursor *ora_get_cursor(HashTable *, int);
  static void ora_del_cursor(HashTable *, int);
--- 69,74 ----
***************
*** 80,89 ****
--- 79,90 ----
  static void _close_orapconn(oraConnection *conn);
  static void _close_oracur(oraCursor *cur);
  static int _ora_ping(oraConnection *conn);
+ int ora_set_param_values(oraCursor *cursor, int isout);
  
  void php3_Ora_Do_Logon(INTERNAL_FUNCTION_PARAMETERS, int persistent);
  
  function_entry oracle_functions[] = {
+ {"ora_bind", php3_Ora_Bind, NULL},
          {"ora_close", php3_Ora_Close, NULL},
          {"ora_commit", php3_Ora_Commit, NULL},
          {"ora_commitoff", php3_Ora_CommitOff, NULL},
***************
*** 99,104 ****
--- 100,106 ----
          {"ora_columnsize", php3_Ora_ColumnSize, NULL},
          {"ora_getcolumn", php3_Ora_GetColumn, NULL},
          {"ora_numcols", php3_Ora_NumCols, NULL},
+ {"ora_numrows", php3_Ora_NumRows, NULL},
          {"ora_logoff", php3_Ora_Logoff, NULL},
          {"ora_logon", php3_Ora_Logon, NULL},
          {"ora_plogon", php3_Ora_PLogon, NULL},
***************
*** 177,182 ****
--- 179,191 ----
  #endif
  #endif
  
+ static void yystype_ora_param_destructor(oraParam *param)
+ {
+ if(param && param->progv){
+ efree(param->progv);
+ }
+ }
+
  static int _cursors_cleanup(list_entry *le)
  {
    ORACLE_TLS_VARS;
***************
*** 198,204 ****
    ORACLE_TLS_VARS;
    
    conn->open = 0;
! hash_apply(ORACLE_GLOBAL(php3_oracle_module).resource_list,
               (int (*)(void *))_cursors_cleanup);
    
    ologof(&conn->lda);
--- 207,213 ----
    ORACLE_TLS_VARS;
    
    conn->open = 0;
! _php3_hash_apply(ORACLE_GLOBAL(php3_oracle_module).resource_list,
               (int (*)(void *))_cursors_cleanup);
    
    ologof(&conn->lda);
***************
*** 212,218 ****
    ORACLE_TLS_VARS;
    
    conn->open = 0;
! hash_apply(ORACLE_GLOBAL(php3_oracle_module).resource_plist,
               (int (*)(void *))_cursors_cleanup);
    
    ologof(&conn->lda);
--- 221,227 ----
    ORACLE_TLS_VARS;
    
    conn->open = 0;
! _php3_hash_apply(ORACLE_GLOBAL(php3_oracle_module).resource_plist,
               (int (*)(void *))_cursors_cleanup);
    
    ologof(&conn->lda);
***************
*** 229,234 ****
--- 238,246 ----
                  if (cur->query){
                          efree(cur->query);
                  }
+ if (cur->params){
+ _php3_hash_destroy(cur->params);
+ }
                  if (cur->columns){
                          for(i = 0; i < cur->ncols; i++){
                                  if (cur->columns[i].buf)
***************
*** 299,304 ****
--- 311,320 ----
          ORACLE_GLOBAL(php3_oracle_module).le_pconn =
                  register_list_destructors(NULL, _close_orapconn);
  
+ REGISTER_LONG_CONSTANT("ORA_BIND_INOUT", 0, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("ORA_BIND_IN", 1, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("ORA_BIND_OUT", 2, CONST_CS | CONST_PERSISTENT);
+
          return SUCCESS;
  }
  
***************
*** 433,442 ****
           * no matter if it is to be persistent or not
           */
  
! if (hash_find(plist, hashed_details, hashed_len + 1,
                                    (void **) &index_ptr) == FAILURE) {
                  /* the link is not in the persistent list */
! list_entry new_le, new_index_ptr;
  
                  if (persistent)
                          db_conn = (oraConnection *)malloc(sizeof(oraConnection));
--- 449,458 ----
           * no matter if it is to be persistent or not
           */
  
! if (_php3_hash_find(plist, hashed_details, hashed_len + 1,
                                    (void **) &index_ptr) == FAILURE) {
                  /* the link is not in the persistent list */
! list_entry new_index_ptr;
  
                  if (persistent)
                          db_conn = (oraConnection *)malloc(sizeof(oraConnection));
***************
*** 469,475 ****
                                  php3_plist_insert(db_conn, ORACLE_GLOBAL(php3_oracle_module).le_pconn);
                          new_index_ptr.ptr = (void *) return_value->value.lval;
                          new_index_ptr.type = le_index_ptr;
! if (hash_update(plist,hashed_details,hashed_len + 1,(void *) &new_index_ptr,
                                                          sizeof(list_entry),NULL) == FAILURE) {
                                  ologof(&db_conn->lda);
                                  free(db_conn);
--- 485,491 ----
                                  php3_plist_insert(db_conn, ORACLE_GLOBAL(php3_oracle_module).le_pconn);
                          new_index_ptr.ptr = (void *) return_value->value.lval;
                          new_index_ptr.type = le_index_ptr;
! if (_php3_hash_update(plist,hashed_details,hashed_len + 1,(void *) &new_index_ptr,
                                                          sizeof(list_entry),NULL) == FAILURE) {
                                  ologof(&db_conn->lda);
                                  free(db_conn);
***************
*** 487,493 ****
                  ORACLE_GLOBAL(php3_oracle_module).num_links++;
      
          } else {
- /*void *ptr;*/
                  int type;
      
                  /* the link is already in the persistent list */
--- 503,508 ----
***************
*** 501,521 ****
      
                  if (db_conn && (type == ORACLE_GLOBAL(php3_oracle_module).le_conn ||
                                          type == ORACLE_GLOBAL(php3_oracle_module).le_pconn)){
! if (!_ora_ping(db_conn)) {
! if (orlon(&db_conn->lda, db_conn->hda, user,
                                                   strlen(user), pwd, strlen(pwd), 0)) {
                                          php3_error(E_WARNING, "Unable to reconnect to ORACLE (%s)",
                                                             ora_error(&db_conn->lda));
                                          /* Delete list entry for this connection */
                                          php3_plist_delete(id);
! /* FIXME Delete hashed list entry for this dead connection*/
                                          efree(hashed_details);
                                          RETURN_FALSE;
                                  }
- return_value->value.lval = id;
- } else {
- return_value->value.lval = id;
                          }
                  }
          }
          efree(hashed_details);
--- 516,536 ----
      
                  if (db_conn && (type == ORACLE_GLOBAL(php3_oracle_module).le_conn ||
                                          type == ORACLE_GLOBAL(php3_oracle_module).le_pconn)){
! if(!_ora_ping(db_conn)) {
! /* XXX Reinitialize lda, hda ? */
! if(orlon(&db_conn->lda, db_conn->hda, user,
                                                   strlen(user), pwd, strlen(pwd), 0)) {
                                          php3_error(E_WARNING, "Unable to reconnect to ORACLE (%s)",
                                                             ora_error(&db_conn->lda));
                                          /* Delete list entry for this connection */
                                          php3_plist_delete(id);
! /* Delete hashed list entry for this dead connection */
! _php3_hash_del(plist, hashed_details, hashed_len);
                                          efree(hashed_details);
                                          RETURN_FALSE;
                                  }
                          }
+ return_value->value.lval = id;
                  }
          }
          efree(hashed_details);
***************
*** 582,588 ****
  void php3_Ora_Close(INTERNAL_FUNCTION_PARAMETERS)
  { /* conn_index */
          pval *arg;
- oraCursor *cursor;
  
          if (getParameters(ht, 1, &arg) == FAILURE) {
                  WRONG_PARAM_COUNT;
--- 597,602 ----
***************
*** 721,726 ****
--- 735,747 ----
                  efree(cursor->query);
          }
          cursor->query = query;
+ cursor->fetched = 0;
+ if(cursor->params && cursor->nparams > 0){
+ _php3_hash_destroy(cursor->params);
+ efree(cursor->params);
+ cursor->params = NULL;
+ cursor->nparams = 0;
+ }
  
          if (oparse(&cursor->cda, query, (sb4) - 1, defer, VERSION_7)) {
                  php3_error(E_WARNING, "Ora_Parse failed (%s)",
***************
*** 730,743 ****
          RETURN_TRUE;
  }
  
  /*
   */
  void php3_Ora_Exec(INTERNAL_FUNCTION_PARAMETERS)
  { /* cursor_index */
          pval *arg;
          oraCursor *cursor = NULL;
- int numArgs;
-
          if (getParameters(ht, 1, &arg) == FAILURE)
                  WRONG_PARAM_COUNT;
  
--- 751,846 ----
          RETURN_TRUE;
  }
  
+ void php3_Ora_Bind(INTERNAL_FUNCTION_PARAMETERS)
+ { /* cursor_ind, php_var_name, sql_var_name, data_len [, inout]*/
+ /* inout: 0 = in/out, 1 = in, 2 = out */
+ int argc;
+ pval *argv[5];
+ oraParam *newparam, *paramptr;
+ oraCursor *cursor;
+ char *paramname;
+
+ argc = ARG_COUNT(ht);
+ if (argc < 4 || getParametersArray(ht, argc, argv) == FAILURE){
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_long(argv[0]);
+ convert_to_string(argv[1]);
+ convert_to_string(argv[2]);
+ convert_to_long(argv[3]);
+
+ cursor = ora_get_cursor(list, argv[0]->value.lval);
+ if (cursor == NULL) {
+ php3_error(E_WARNING, "Invalid cursor index %d",
+ argv[0]->value.lval);
+ RETURN_FALSE;
+ }
+
+ if(cursor->params == NULL){
+ cursor->params = (HashTable *)emalloc(sizeof(HashTable));
+ if (!cursor->params ||
+ _php3_hash_init(cursor->params, 19, NULL,
+ (void (*)(void *))yystype_ora_param_destructor, 0) ==
+ FAILURE){
+ php3_error(E_ERROR, "Unable to initialize parameter list");
+ RETURN_FALSE;
+ }
+ }
+ if((newparam = (oraParam *)emalloc(sizeof(oraParam))) == NULL){
+ php3_error(E_WARNING, "Out of memory for parameter");
+ RETURN_FALSE;
+ }
+
+ if((paramname = estrndup(argv[1]->value.str.val, argv[1]->value.str.len)) == NULL){
+ php3_error(E_WARNING, "Out of memory for parametername");
+ efree(newparam);
+ RETURN_FALSE;
+ }
+
+ if (_php3_hash_add(cursor->params, paramname, argv[1]->value.str.len + 1, newparam, sizeof(oraParam), (void **)&paramptr) == FAILURE) {
+ /* XXX _php3_hash_destroy */
+ efree(paramname);
+ efree(newparam);
+ php3_error(E_ERROR, "Could not make parameter placeholder");
+ RETURN_FALSE;
+ }
+
+ efree(newparam);
+ efree(paramname);
+
+ paramptr->progvl = argv[3]->value.lval + 1;
+ if(argc > 4){
+ convert_to_long(argv[4]);
+ paramptr->type = argv[4]->value.lval;
+ }else{
+ paramptr->type = 0;
+ }
+
+ if((paramptr->progv = (text *)emalloc(paramptr->progvl)) == NULL){
+ php3_error(E_WARNING, "Out of memory for parameter value");
+ RETURN_FALSE;
+ }
+
+ /* XXX Maximum for progvl */
+ paramptr->alen = paramptr->progvl;
+ if(obndra(&cursor->cda, argv[2]->value.str.val, -1,
+ (ub1 *)paramptr->progv, paramptr->progvl, SQLT_STR,
+ -1, 0, &paramptr->alen, 0, 0, 0, 0, -1, -1)){
+ php3_error(E_WARNING, "Ora_Bind failed (%s)",
+ ora_error(&cursor->cda));
+ RETURN_FALSE;
+ }
+
+ cursor->nparams++;
+ RETURN_TRUE;
+ }
+
  /*
   */
  void php3_Ora_Exec(INTERNAL_FUNCTION_PARAMETERS)
  { /* cursor_index */
          pval *arg;
          oraCursor *cursor = NULL;
          if (getParameters(ht, 1, &arg) == FAILURE)
                  WRONG_PARAM_COUNT;
  
***************
*** 753,772 ****
                          RETURN_FALSE;
                  }
          }
          if (oexec(&cursor->cda)) {
                  php3_error(E_WARNING, "Ora_Exec failed (%s)",
                                     ora_error(&cursor->cda));
                  RETURN_FALSE;
          }
!
! RETVAL_TRUE;
  }
  
  void php3_Ora_NumCols(INTERNAL_FUNCTION_PARAMETERS)
  { /* cursor_index */
          pval *arg;
          oraCursor *cursor = NULL;
- int numArgs;
  
          if (getParameters(ht, 1, &arg) == FAILURE)
                  WRONG_PARAM_COUNT;
--- 856,886 ----
                          RETURN_FALSE;
                  }
          }
+
+ if(cursor->nparams > 0){
+ if(!ora_set_param_values(cursor, 0)){
+ RETURN_FALSE;
+ }
+ }
+
          if (oexec(&cursor->cda)) {
                  php3_error(E_WARNING, "Ora_Exec failed (%s)",
                                     ora_error(&cursor->cda));
                  RETURN_FALSE;
          }
!
! if(cursor->nparams > 0){
! if(!ora_set_param_values(cursor, 1)){
! RETURN_FALSE;
! }
! }
! RETURN_TRUE;
  }
  
  void php3_Ora_NumCols(INTERNAL_FUNCTION_PARAMETERS)
  { /* cursor_index */
          pval *arg;
          oraCursor *cursor = NULL;
  
          if (getParameters(ht, 1, &arg) == FAILURE)
                  WRONG_PARAM_COUNT;
***************
*** 780,785 ****
--- 894,916 ----
          RETURN_LONG(cursor->ncols);
  }
  
+ void php3_Ora_NumRows(INTERNAL_FUNCTION_PARAMETERS)
+ { /* cursor_index */
+ pval *arg;
+ oraCursor *cursor = NULL;
+
+ if(getParameters(ht, 1, &arg) == FAILURE)
+ WRONG_PARAM_COUNT;
+
+ convert_to_long(arg);
+
+ if((cursor = ora_get_cursor(list, arg->value.lval)) == NULL) {
+ RETURN_FALSE;
+ }
+
+ RETURN_LONG(cursor->cda.rpc);
+ }
+
  /* prepares/executes/fetches 1st row if avail*/
  
  void php3_Ora_Do(INTERNAL_FUNCTION_PARAMETERS)
***************
*** 848,853 ****
--- 979,985 ----
                          _close_oracur(cursor);
                          RETURN_FALSE;
                  }
+ cursor->fetched = 1;
          } else {
                  if (oexec(&cursor->cda)) {
                          php3_error(E_WARNING, "Ora_Do failed (%s)",
***************
*** 855,861 ****
                          _close_oracur(cursor);
                          RETURN_FALSE;
                  }
- cursor->fetched = 1;
          }
  
          RETURN_LONG(ora_add_cursor(list, cursor));
--- 987,992 ----
***************
*** 865,871 ****
  { /* cursor_index */
          pval *arg;
          oraCursor *cursor;
- sword err;
  
          if (getParameters(ht, 1, &arg) == FAILURE) {
                  WRONG_PARAM_COUNT;
--- 996,1001 ----
***************
*** 966,972 ****
                                  }
                          tmp.value.str.val = estrndup(cursor->columns[i].buf, tmp.value.str.len);
                  }
! hash_index_update(arr->value.ht, i, (void *) &tmp, sizeof(pval), NULL);
          }
  
          RETURN_LONG(cursor->ncols);
--- 1096,1102 ----
                                  }
                          tmp.value.str.val = estrndup(cursor->columns[i].buf, tmp.value.str.len);
                  }
! _php3_hash_index_update(arr->value.ht, i, (void *) &tmp, sizeof(pval), NULL);
          }
  
          RETURN_LONG(cursor->ncols);
***************
*** 975,983 ****
  void php3_Ora_ColumnName(INTERNAL_FUNCTION_PARAMETERS)
  { /* cursor_index, column_index */
          pval *argv[2];
! int cursor_ind, found;
          oraCursor *cursor = NULL;
- oraColumn *column = NULL;
  
          if (ARG_COUNT(ht) != 2 || getParametersArray(ht, 2, argv) == FAILURE) {
                  WRONG_PARAM_COUNT;
--- 1105,1112 ----
  void php3_Ora_ColumnName(INTERNAL_FUNCTION_PARAMETERS)
  { /* cursor_index, column_index */
          pval *argv[2];
! int cursor_ind;
          oraCursor *cursor = NULL;
  
          if (ARG_COUNT(ht) != 2 || getParametersArray(ht, 2, argv) == FAILURE) {
                  WRONG_PARAM_COUNT;
***************
*** 1016,1022 ****
          pval *argv[2];
          int cursor_ind, colno;
          oraCursor *cursor = NULL;
- oraColumn *column = NULL;
  
          if (ARG_COUNT(ht) != 2 || getParametersArray(ht, 2, argv) == FAILURE) {
                  WRONG_PARAM_COUNT;
--- 1145,1150 ----
***************
*** 1085,1093 ****
  void php3_Ora_ColumnSize(INTERNAL_FUNCTION_PARAMETERS)
  { /* cursor_index, column_index */
          pval *argv[2];
! int cursor_ind, found;
          oraCursor *cursor = NULL;
- oraColumn *column = NULL;
  
          if (ARG_COUNT(ht) != 2 || getParametersArray(ht, 2, argv) == FAILURE) {
                  WRONG_PARAM_COUNT;
--- 1213,1220 ----
  void php3_Ora_ColumnSize(INTERNAL_FUNCTION_PARAMETERS)
  { /* cursor_index, column_index */
          pval *argv[2];
! int cursor_ind;
          oraCursor *cursor = NULL;
  
          if (ARG_COUNT(ht) != 2 || getParametersArray(ht, 2, argv) == FAILURE) {
                  WRONG_PARAM_COUNT;
***************
*** 1287,1299 ****
          php3_error(E_WARNING,"Bad Oracle connection number (%d)", ind);
          return NULL;
  }
!
  static void
  ora_del_conn(HashTable *list, int ind)
  {
          php3_list_delete(ind);
  }
!
  int ora_add_cursor(HashTable *list, oraCursor *cursor)
  {
          ORACLE_TLS_VARS;
--- 1414,1426 ----
          php3_error(E_WARNING,"Bad Oracle connection number (%d)", ind);
          return NULL;
  }
! /*
  static void
  ora_del_conn(HashTable *list, int ind)
  {
          php3_list_delete(ind);
  }
! */
  int ora_add_cursor(HashTable *list, oraCursor *cursor)
  {
          ORACLE_TLS_VARS;
***************
*** 1442,1452 ****
          return 1;
  }
  
  /* Scan statement for parameters and setup hash if any found. Currently only named
     parameters are supported (e.g. :foo). Returns number of distinct parameters.
  */
  #if 0
! int ora_preparse(char *sql, oraCursor *curs)
  {
          while(*sql) {
                  if (*sql == '\'')
--- 1569,1630 ----
          return 1;
  }
  
+ int ora_set_param_values(oraCursor *cursor, int isout)
+ {
+ char *paramname;
+ oraParam *param;
+ pval *pdata;
+ int i, len;
+ _php3_hash_internal_pointer_reset(cursor->params);
+
+ if(_php3_hash_num_elements(cursor->params) != cursor->nparams){
+ php3_error(E_WARNING, "Mismatch in number of parameters");
+ return 0;
+ }
+
+ for(i = 0; i < cursor->nparams; i++, _php3_hash_move_forward(cursor->params)){
+ if(_php3_hash_get_current_key(cursor->params, &paramname, NULL) != HASH_KEY_IS_STRING){
+ php3_error(E_WARNING, "Can't get parameter name");
+ return 0;
+ }
+ if(_php3_hash_get_current_data(cursor->params, (void **)&param) == FAILURE){
+ php3_error(E_WARNING, "Can't get parameter data");
+ return 0;
+ }
+
+ if(isout){
+ /* XXX param->alen + 1 ?? */
+ if(param->type != 1 && param->alen > 0){
+ SET_VAR_STRINGL(paramname, param->progv, param->alen);
+ }
+ continue;
+ }else if(param->type == 2){
+ continue;
+ }
+
+ if(_php3_hash_find(&GLOBAL(symbol_table), paramname, strlen(paramname) + 1, (void **)&pdata) == FAILURE){
+ php3_error(E_WARNING, "Can't find variable for parameter");
+ return 0;
+ }
+ convert_to_string(pdata);
+ if(param->progvl <= pdata->value.str.len){
+ php3_error(E_NOTICE, "Input value will be truncated");
+ }
+
+ len = min(param->progvl - 1, pdata->value.str.len);
+ strncpy(param->progv, pdata->value.str.val, len);
+
+ param->progv[len] = '\0';
+ }
+ return 1;
+
+ }
+
  /* Scan statement for parameters and setup hash if any found. Currently only named
     parameters are supported (e.g. :foo). Returns number of distinct parameters.
  */
  #if 0
! int ora_numparams(char *sql, oraCursor *curs)
  {
          while(*sql) {
                  if (*sql == '\'')
***************
*** 1473,1479 ****
                                   php3_error(E_WARNING, "Out of memory");
                                   return -1;
                           }
! if (hash_init(cursor->params, 19, NULL,
                                   (void (*)(void *))yystype_ora_param_destructor, 0) ==
                                   FAILURE){
                                   php3_error(E_WARNING, "Unable to initialize parameter list");
--- 1651,1657 ----
                                   php3_error(E_WARNING, "Out of memory");
                                   return -1;
                           }
! if (_php3_hash_init(cursor->params, 19, NULL,
                                   (void (*)(void *))yystype_ora_param_destructor, 0) ==
                                   FAILURE){
                                   php3_error(E_WARNING, "Unable to initialize parameter list");
***************
*** 1482,1488 ****
                                   return -1;
                           }
                  }
! hash_add(curs->params, start, namelen, ptr, size, (void **)&pDest)
                  
  }
  #endif
--- 1660,1666 ----
                                   return -1;
                           }
                  }
! _php3_hash_add(curs->params, start, namelen, ptr, size, (void **)&pDest)
                  
  }
  #endif
Index: php31/ext/oracle/oracle.h
diff -c php31/ext/oracle/oracle.h:1.1.1.1 php31/ext/oracle/oracle.h:1.2
*** php31/ext/oracle/oracle.h:1.1.1.1 Tue May 26 22:26:56 1998
--- php31/ext/oracle/oracle.h Fri Jun 26 09:21:19 1998
***************
*** 50,76 ****
          ub1 hda[HDA_SIZE];
  } oraConnection;
  
- #if 0
- typedef struct oraParam {
- char *progv;
- sword maxlen; /* max possible len (=allocated buffer progvl) */
- sword ftype; /* external OCI field type */
- int is_inout;
-
- sb2 indp; /* null indicator */
- ub2 arcode; /* column rc */
- ub2 alen; /* effective length ( <= maxlen ) */
- }
-
- /*
- obndra(Cda_Def *cursor, text *sqlvar, -1,
- ub1 *progv, sword progvl, sword ftype,
- -1, sb2 *indp, ub2 *alen,
- ub2 *arcode, 0, (ub4 *)0,
- (text *)0, -1, -1);
- */
- #endif
-
  typedef struct oraColumn {
          sb4 dbsize;
          sb2 dbtype;
--- 50,55 ----
***************
*** 85,94 ****
--- 64,82 ----
          ub2 col_retlen, col_retcode;
  } oraColumn;
  
+ typedef struct oraParam {
+ text *progv;
+ sword progvl;
+ sb2 type;
+ ub2 alen;
+ } oraParam;
+
  typedef struct oraCursor {
          int open;
          Cda_Def cda;
          text *query;
+ HashTable *params;
+ int nparams;
          oraColumn *columns;
          int ncols;
          int fetched;
***************
*** 109,114 ****
--- 97,103 ----
          HashTable *resource_plist;
  } oracle_module;
  
+ extern void php3_Ora_Bind(INTERNAL_FUNCTION_PARAMETERS);
  extern void php3_Ora_Close(INTERNAL_FUNCTION_PARAMETERS);
  extern void php3_Ora_Commit(INTERNAL_FUNCTION_PARAMETERS);
  extern void php3_Ora_CommitOff(INTERNAL_FUNCTION_PARAMETERS);
***************
*** 124,129 ****
--- 113,119 ----
  extern void php3_Ora_ColumnSize(INTERNAL_FUNCTION_PARAMETERS);
  extern void php3_Ora_GetColumn(INTERNAL_FUNCTION_PARAMETERS);
  extern void php3_Ora_NumCols(INTERNAL_FUNCTION_PARAMETERS);
+ extern void php3_Ora_NumRows(INTERNAL_FUNCTION_PARAMETERS);
  extern void php3_Ora_Logoff(INTERNAL_FUNCTION_PARAMETERS);
  extern void php3_Ora_Logon(INTERNAL_FUNCTION_PARAMETERS);
  extern void php3_Ora_PLogon(INTERNAL_FUNCTION_PARAMETERS);