[PHP-DEV] CVS update: php3/functions From: rasmus (php-dev <email protected>)
Date: 05/14/98

Date: Thursday May 14, 1998 @ 16:50
Author: rasmus

Update of /repository/php3/functions
In directory asf:/tmp/cvs-serv22104/functions

Modified Files:
        oracle.c oracle.h
Log Message:
Add ora_numcols() function

Index: php3/functions/oracle.c
diff -c php3/functions/oracle.c:1.62 php3/functions/oracle.c:1.63
*** php3/functions/oracle.c:1.62 Thu May 14 15:18:30 1998
--- php3/functions/oracle.c Thu May 14 16:50:39 1998
***************
*** 98,103 ****
--- 98,104 ----
          {"ora_columnname", php3_Ora_ColumnName, NULL},
          {"ora_columnsize", php3_Ora_ColumnSize, NULL},
          {"ora_getcolumn", php3_Ora_GetColumn, NULL},
+ {"ora_numcols", php3_Ora_NumCols, NULL},
          {"ora_logoff", php3_Ora_Logoff, NULL},
          {"ora_logon", php3_Ora_Logon, NULL},
          {"ora_plogon", php3_Ora_PLogon, NULL},
***************
*** 759,764 ****
--- 760,783 ----
          }
  
          RETVAL_TRUE;
+ }
+
+ void php3_Ora_NumCols(INTERNAL_FUNCTION_PARAMETERS)
+ { /* cursor_index */
+ YYSTYPE *arg;
+ oraCursor *cursor = NULL;
+ int numArgs;
+
+ 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->ncols);
  }
  
  /* prepares/executes/fetches 1st row if avail*/
Index: php3/functions/oracle.h
diff -c php3/functions/oracle.h:1.29 php3/functions/oracle.h:1.30
*** php3/functions/oracle.h:1.29 Thu May 14 15:18:30 1998
--- php3/functions/oracle.h Thu May 14 16:50:40 1998
***************
*** 123,128 ****
--- 123,129 ----
  extern void php3_Ora_ColumnName(INTERNAL_FUNCTION_PARAMETERS);
  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_Logoff(INTERNAL_FUNCTION_PARAMETERS);
  extern void php3_Ora_Logon(INTERNAL_FUNCTION_PARAMETERS);
  extern void php3_Ora_PLogon(INTERNAL_FUNCTION_PARAMETERS);