[ruby-oci8-commit] [251] trunk/ruby-oci8: * ext/oci8/apiwrap.c.tmpl, ext/oci8/apiwrap.rb, ext/ oci8/apiwrap.yml:

nobody at rubyforge.org nobody at rubyforge.org
Fri Mar 7 09:15:16 EST 2008


Revision: 251
Author:   kubo
Date:     2008-03-07 09:15:15 -0500 (Fri, 07 Mar 2008)

Log Message:
-----------
* ext/oci8/apiwrap.c.tmpl, ext/oci8/apiwrap.rb, ext/oci8/apiwrap.yml:
    add all OCI functions to 'apiwrap.yml'.
* ext/oci8/object.c: use OCIObjectPin_nb() instead of OCIObjectPin().
* ext/oci8/oci8lib.c: call OCIBreak in rb_thread_blocking_region()
    to prevent the thread from being blocked.

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/ext/oci8/apiwrap.c.tmpl
    trunk/ruby-oci8/ext/oci8/apiwrap.rb
    trunk/ruby-oci8/ext/oci8/apiwrap.yml
    trunk/ruby-oci8/ext/oci8/object.c
    trunk/ruby-oci8/ext/oci8/oci8lib.c

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2008-03-06 14:06:04 UTC (rev 250)
+++ trunk/ruby-oci8/ChangeLog	2008-03-07 14:15:15 UTC (rev 251)
@@ -1,3 +1,10 @@
+2008-03-07  KUBO Takehiro  <kubo at jiubao.org>
+	* ext/oci8/apiwrap.c.tmpl, ext/oci8/apiwrap.rb, ext/oci8/apiwrap.yml:
+	    add all OCI functions to 'apiwrap.yml'.
+	* ext/oci8/object.c: use OCIObjectPin_nb() instead of OCIObjectPin().
+	* ext/oci8/oci8lib.c: call OCIBreak in rb_thread_blocking_region()
+	    to prevent the thread from being blocked.
+
 2008-03-06  KUBO Takehiro  <kubo at jiubao.org>
 	* ext/oci8/apiwrap.c.tmpl, ext/oci8/apiwrap.h.tmpl:
 	    rewrite apiwrap.[ch].tmpl. All non-static variables

Modified: trunk/ruby-oci8/ext/oci8/apiwrap.c.tmpl
===================================================================
--- trunk/ruby-oci8/ext/oci8/apiwrap.c.tmpl	2008-03-06 14:06:04 UTC (rev 250)
+++ trunk/ruby-oci8/ext/oci8/apiwrap.c.tmpl	2008-03-07 14:15:15 UTC (rev 251)
@@ -33,7 +33,11 @@
  * <%=f.name%>_nb
  */
 typedef struct {
-<% f.args.each do |a|
+<%
+   f.ret != 'void'
+%>    <%= f.ret %> rv;
+<%
+   f.args.each do |a|
 %>    <%= a.dcl %>;
 <% end
 %>} oci8_<%=f.name%>_data_t;
@@ -47,11 +51,15 @@
 {
     oci8_<%=f.name%>_data_t *data = (oci8_<%=f.name%>_data_t *)user_data;
 <% if f.ret == 'void'
-%>    (VALUE)<%=f.name%>(<%= f.args.collect do |a| 'data->' + a.name; end.join(', ') %>);
-    return Qnil;
+%>    <%=f.name%>(<%= f.args.collect do |a| 'data->' + a.name; end.join(', ') %>);
 <% else
-%>    return (VALUE)<%=f.name%>(<%= f.args.collect do |a| 'data->' + a.name; end.join(', ') %>);
+%>    data->rv = <%=f.name%>(<%= f.args.collect do |a| 'data->' + a.name; end.join(', ') %>);
 <% end %>
+<% if f.ret == 'sword'
+%>    return (VALUE)data->rv;
+<% else
+%>    return (VALUE)0;
+<% end %>
 }
 #else
 #define oci8_<%=f.name%>_cb NULL
@@ -64,10 +72,9 @@
 <% f.args.each do |a|
 %>        data.<%=a.name%> = <%=a.name%>;
 <% end
-   if f.ret == 'void'
 %>        oci8_blocking_region(svcctx, oci8_<%=f.name%>_cb, &data);
-<% else
-%>        return oci8_blocking_region(svcctx, oci8_<%=f.name%>_cb, &data);
+<%   if f.ret != 'void'
+%>        return data.rv;
 <% end
 %>    } else {
         rb_raise(rb_eRuntimeError, "undefined OCI function %s is called", "<%=f.name%>_nb");

Modified: trunk/ruby-oci8/ext/oci8/apiwrap.rb
===================================================================
--- trunk/ruby-oci8/ext/oci8/apiwrap.rb	2008-03-06 14:06:04 UTC (rev 250)
+++ trunk/ruby-oci8/ext/oci8/apiwrap.rb	2008-03-07 14:15:15 UTC (rev 251)
@@ -7,6 +7,7 @@
 
   def initialize(arg)
     /(\w+)\s*$/ =~ arg
+    /\(\*(\w+)\)/ =~ arg if $1.nil?
     @dcl = arg
     @name = $1
   end

Modified: trunk/ruby-oci8/ext/oci8/apiwrap.yml
===================================================================
--- trunk/ruby-oci8/ext/oci8/apiwrap.yml	2008-03-06 14:06:04 UTC (rev 250)
+++ trunk/ruby-oci8/ext/oci8/apiwrap.yml	2008-03-07 14:15:15 UTC (rev 251)
@@ -23,6 +23,159 @@
             - ub4 attrtype
             - OCIError *errhp
 
+OCIAttrSet:
+  :version: 800
+  :args:    - dvoid *trgthndlp
+            - ub4 trghndltyp
+            - dvoid *attributep
+            - ub4 size
+            - ub4 attrtype
+            - OCIError *errhp
+
+# round trip: 0
+OCIBindArrayOfStruct:
+  :version: 800
+  :args:    - OCIBind *bindp
+            - OCIError *errhp
+            - ub4 pvskip
+            - ub4 indskip
+            - ub4 alskip
+            - ub4 rcskip
+
+# round trip: 0
+OCIBindByName:
+  :version: 800
+  :args:    - OCIStmt *stmtp
+            - OCIBind **bindp
+            - OCIError *errhp
+            - const text *placeholder
+            - sb4 placeh_len
+            - dvoid *valuep
+            - sb4 value_sz
+            - ub2 dty
+            - dvoid *indp
+            - ub2 *alenp
+            - ub2 *rcodep
+            - ub4 maxarr_len
+            - ub4 *curelep
+            - ub4 mode
+
+# round trip: 0
+OCIBindByPos:
+  :version: 800
+  :args:    - OCIStmt *stmtp
+            - OCIBind **bindp
+            - OCIError *errhp
+            - ub4 position
+            - dvoid *valuep
+            - sb4 value_sz
+            - ub2 dty
+            - dvoid *indp
+            - ub2 *alenp
+            - ub2 *rcodep
+            - ub4 maxarr_len
+            - ub4 *curelep
+            - ub4 mode
+
+# round trip: 0
+OCIBindObject:
+  :version: 800
+  :args:    - OCIBind *bindp
+            - OCIError *errhp
+            - const OCIType *type
+            - dvoid **pgvpp
+            - ub4 *pvszsp
+            - dvoid **indpp
+            - ub4 *indszp
+
+# round trip: 1 but don't add _nb.
+OCIBreak:
+  :version: 800
+  :args:    - dvoid *hndlp
+            - OCIError *errhp
+
+# round trip: 0
+OCICollAppend:
+  :version: 800
+  :args:    - OCIEnv *env
+            - OCIError *err
+            - const dvoid *elem
+            - const dvoid *elemind
+            - OCIColl *coll
+
+# round trip: 0
+OCICollAssignElem:
+  :version: 800
+  :args:    - OCIEnv *env
+            - OCIError *err
+            - sb4 index
+            - const dvoid *elem
+            - const dvoid *elemind
+            - OCIColl *coll
+
+# round trip: 0
+OCICollGetElem:
+  :version: 800
+  :args:    - OCIEnv *env
+            - OCIError *err
+            - const OCIColl *coll
+            - sb4 index
+            - boolean *exists
+            - dvoid **elem
+            - dvoid **elemind
+
+# round trip: 0
+OCICollSize:
+  :version: 800
+  :args:    - OCIEnv *env
+            - OCIError *err
+            - const OCIColl *coll
+            - sb4 *size
+
+# round trip: 0
+OCICollTrim:
+  :version: 800
+  :args:    - OCIEnv *env
+            - OCIError *err
+            - sb4 trim_num
+            - OCIColl *coll
+
+# round trip: 0
+OCIDefineArrayOfStruct:
+  :version: 800
+  :args:    - OCIDefine *defnp
+            - OCIError *errhp
+            - ub4 pvskip
+            - ub4 indskip
+            - ub4 rlskip
+            - ub4 rcskip
+
+# round trip: 0
+OCIDefineByPos:
+  :version: 800
+  :args:    - OCIStmt *stmtp
+            - OCIDefine **defnp
+            - OCIError *errhp
+            - ub4 position
+            - dvoid *valuep
+            - sb4 value_sz
+            - ub2 dty
+            - dvoid *indp
+            - ub2 *rlenp
+            - ub2 *rcodep
+            - ub4 mode
+
+# round trip: 0
+OCIDefineObject:
+  :version: 800
+  :args:    - OCIDefine *defnp
+            - OCIError *errhp
+            - const OCIType *type
+            - dvoid **pgvpp
+            - ub4 *pvszsp
+            - dvoid **indpp
+            - ub4 *indszp
+
 # round trip: 1
 OCIDescribeAny_nb:
   :version: 800
@@ -35,6 +188,66 @@
             - ub1 objtyp
             - OCIDescribe *dschp
 
+OCIDescriptorAlloc:
+  :version: 800
+  :args:    - const dvoid *parenth
+            - dvoid **descpp
+            - ub4 type
+            - size_t xtramem_sz
+            - dvoid **usrmempp
+
+OCIDescriptorFree:
+  :version: 800
+  :args:    - dvoid *descp
+            - ub4 type
+
+OCIEnvInit:
+  :version: 800
+  :args:    - OCIEnv **envp
+            - ub4 mode
+            - size_t xtramem_sz
+            - dvoid **usrmempp
+
+OCIErrorGet:
+  :version: 800
+  :args:    - dvoid *hndlp
+            - ub4 recordno
+            - text *sqlstate
+            - sb4 *errcodep
+            - text *bufp
+            - ub4 bufsiz
+            - ub4 type
+
+OCIHandleAlloc:
+  :version: 800
+  :args:    - const dvoid *parenth
+            - dvoid **hndlpp
+            - ub4 type
+            - size_t xtramem_sz
+            - dvoid **usrmempp
+
+OCIHandleFree:
+  :version: 800
+  :args:    - dvoid *hndlp
+            - ub4 type
+
+# round trip: 0
+OCIInitialize:
+  :version: 800
+  :args:    - ub4 mode
+            - dvoid *ctxp
+            - dvoid *(*malocfp)(dvoid *ctxp, size_t size)
+            - dvoid *(*ralocfp)(dvoid *ctxp, dvoid *memptr, size_t newsize)
+            - void   (*mfreefp)(dvoid *ctxp, dvoid *memptr)
+
+# round trip: 0
+OCILobAssign:
+  :version: 800
+  :args:    - OCIEnv *envhp
+            - OCIError *errhp
+            - const OCILobLocator *src_locp
+            - OCILobLocator **dst_locpp
+
 # round trip: 1
 OCILobFileClose_nb:
   :version: 800
@@ -56,6 +269,17 @@
             - OCILobLocator *filep
             - boolean *flag
 
+# round trip: 0
+OCILobFileGetName:
+  :version: 800
+  :args:    - OCIEnv *envhp
+            - OCIError *errhp
+            - const OCILobLocator *filep
+            - text *dir_alias
+            - ub2 *d_length
+            - text *filename
+            - ub2 *f_length
+
 # round trip: 1
 OCILobFileOpen_nb:
   :version: 800
@@ -64,6 +288,17 @@
             - OCILobLocator *filep
             - ub1 mode
 
+# round trip: 0
+OCILobFileSetName:
+  :version: 800
+  :args:    - OCIEnv *envhp
+            - OCIError *errhp
+            - OCILobLocator **filepp
+            - const text *dir_alias
+            - ub2 d_length
+            - const text *filename
+            - ub2 f_length
+
 # round trip: 1
 OCILobGetLength_nb:
   :version: 800
@@ -72,6 +307,14 @@
             - OCILobLocator *locp
             - ub4 *lenp
 
+# round trip: 0
+OCILobLocatorIsInit:
+  :version: 800
+  :args:    - OCIEnv *envhp
+            - OCIError *errhp
+            - const OCILobLocator *locp
+            - boolean *is_initialized
+
 # round trip: 0 or 1
 OCILobRead_nb:
   :version: 800
@@ -130,6 +373,329 @@
             - const text *dbname
             - ub4 dbname_len
 
+# round trip: 0
+OCINumberAbs:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberAdd:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number1
+            - const OCINumber *number2
+            - OCINumber *result
+
+# round trip: 0
+OCINumberArcCos:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberArcSin:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberArcTan:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberArcTan2:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number1
+            - const OCINumber *number2
+            - OCINumber *result
+
+# round trip: 0
+OCINumberAssign:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *from
+            - OCINumber *to
+
+# round trip: 0
+OCINumberCeil:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberCmp:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number1
+            - const OCINumber *number2
+            - sword *result
+
+# round trip: 0
+OCINumberCos:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberDiv:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number1
+            - const OCINumber *number2
+            - OCINumber *result
+
+# round trip: 0
+OCINumberExp:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberFloor:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberFromInt:
+  :version: 800
+  :args:    - OCIError *err
+            - const dvoid *inum
+            - uword inum_length
+            - uword inum_s_flag
+            - OCINumber *number
+
+# round trip: 0
+OCINumberFromReal:
+  :version: 800
+  :args:    - OCIError *err
+            - const dvoid *rnum
+            - uword rnum_length
+            - OCINumber *number
+
+# round trip: 0
+OCINumberFromText:
+  :version: 800
+  :args:    - OCIError *err
+            - const text *str
+            - ub4 str_length
+            - const text *fmt
+            - ub4 fmt_length
+            - const text *nls_params
+            - ub4 nls_p_length
+            - OCINumber *number
+
+# round trip: 0
+OCINumberHypCos:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberHypSin:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberHypTan:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberIntPower:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *base
+            - const sword exp
+            - OCINumber *result
+
+# round trip: 0
+OCINumberIsZero:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - boolean *result
+
+# round trip: 0
+OCINumberLn:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberLog:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *base
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberMod:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number1
+            - const OCINumber *number2
+            - OCINumber *result
+
+# round trip: 0
+OCINumberMul:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number1
+            - const OCINumber *number2
+            - OCINumber *result
+
+# round trip: 0
+OCINumberNeg:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberPower:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *base
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberRound:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - sword decplace
+            - OCINumber *result
+
+# round trip: 0
+OCINumberSetZero:
+  :version: 800
+  :ret:     void
+  :args:    - OCIError *err
+            - OCINumber *num
+
+# round trip: 0
+OCINumberSign:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - sword *result
+
+# round trip: 0
+OCINumberSin:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberSub:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number1
+            - const OCINumber *number2
+            - OCINumber *result
+
+# round trip: 0
+OCINumberSqrt:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberTan:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - OCINumber *result
+
+# round trip: 0
+OCINumberToInt:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - uword rsl_length
+            - uword rsl_flag
+            - dvoid *rsl
+
+# round trip: 0
+OCINumberToReal:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - uword rsl_length
+            - dvoid *rsl
+
+# round trip: 0
+OCINumberToText:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - const text *fmt
+            - ub4 fmt_length
+            - const text *nls_params
+            - ub4 nls_p_length
+            - ub4 *buf_size
+            - text *buf
+
+# round trip: 0
+OCINumberTrunc:
+  :version: 800
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - sword decplace
+            - OCINumber *resulty
+
+# round trip: 0
+OCIObjectFree:
+  :version: 800
+  :args:    - OCIEnv *env
+            - OCIError *err
+            - dvoid *instance
+            - ub2 flags
+
+# round trip: 0
+OCIObjectGetInd:
+  :version: 800
+  :args:    - OCIEnv *env
+            - OCIError *err
+            - dvoid *instance
+            - dvoid **null_struct
+
+# round trip: 0
+OCIObjectNew:
+  :version: 800
+  :args:    - OCIEnv *env
+            - OCIError *err
+            - const OCISvcCtx *svc
+            - OCITypeCode typecode
+            - OCIType *tdo
+            - dvoid *table
+            - OCIDuration duration
+            - boolean value
+            - dvoid **instance
+
 # round trip: 0 or 1
 OCIObjectPin_nb:
   :version: 800
@@ -142,6 +708,22 @@
             - OCILockOpt lock_option
             - dvoid **object
 
+# round trip: 0
+OCIObjectUnpin:
+  :version: 800
+  :args:    - OCIEnv *env
+            - OCIError *err
+            - dvoid *object
+
+# round trip: ???
+OCIParamGet:
+  :version: 800
+  :args:    - const dvoid *hndlp
+            - ub4 htype
+            - OCIError *errhp
+            - dvoid **parmdpp
+            - ub4 pos
+
 # round trip: 1
 OCISessionBegin_nb:
   :version: 800
@@ -151,6 +733,29 @@
             - ub4 credt
             - ub4 mode
 
+# round trip: 0
+OCIRawAssignBytes:
+  :version: 800
+  :args:    - OCIEnv *env
+            - OCIError *err
+            - const ub1 *rhs
+            - ub4 rhs_len
+            - OCIRaw **lhs
+
+# round trip: 0
+OCIRawPtr:
+  :version: 800
+  :ret:     ub1 *
+  :args:    - OCIEnv *env
+            - const OCIRaw *raw
+
+# round trip: 0
+OCIRawSize:
+  :version: 800
+  :ret:     ub4
+  :args:    - OCIEnv *env
+            - const OCIRaw *raw
+
 # round trip: 1
 OCISessionEnd_nb:
   :version: 800
@@ -196,6 +801,60 @@
             - ub2 orientation
             - ub4 mode
 
+OCIStmtGetPieceInfo:
+  :version: 800
+  :args:    - OCIStmt *stmtp
+            - OCIError *errhp
+            - dvoid **hndlpp
+            - ub4 *typep
+            - ub1 *in_outp
+            - ub4 *iterp
+            - ub4 *idxp
+            - ub1 *piecep
+
+OCIStmtPrepare:
+  :version: 800
+  :args:    - OCIStmt *stmtp
+            - OCIError *errhp
+            - const text *stmt
+            - ub4 stmt_len
+            - ub4 language
+            - ub4 mode
+
+OCIStmtSetPieceInfo:
+  :version: 800
+  :args:    - dvoid *hndlp
+            - ub4 type
+            - OCIError *errhp
+            - const dvoid *bufp
+            - ub4 *alenp
+            - ub1 piece
+            - const dvoid *indp
+            - ub2 *rcodep
+
+# round trip: 0
+OCIStringAssignText:
+  :version: 800
+  :args:    - OCIEnv *env
+            - OCIError *err
+            - const text *rhs
+            - ub4 rhs_len
+            - OCIString **lhs
+
+# round trip: 0
+OCIStringPtr:
+  :version: 800
+  :ret:     text *
+  :args:    - OCIEnv *env
+            - const OCIString *vs
+
+# round trip: 0
+OCIStringSize:
+  :version: 800
+  :ret:     ub4
+  :args:    - OCIEnv *env
+            - const OCIString *vs
+
 # round trip: 1
 OCITransCommit_nb:
   :version: 800
@@ -210,7 +869,15 @@
             - OCIError *errhp
             - ub4 flags
 
+# round trip: 0 ?
+OCITypeTypeCode:
+  :version: 800
+  :ret:     OCITypeCode
+  :args:    - OCIEnv *env
+            - OCIError *err
+            - const OCIType *tdo
 
+
 #
 # Oracle 8.1
 #
@@ -267,6 +934,36 @@
             - ub1 mode
 
 # round trip: 0
+OCINumberIsInt:
+  :version: 810
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - boolean *result
+
+# round trip: 0
+OCINumberPrec:
+  :version: 810
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - eword nDigs
+            - OCINumber *result
+
+# round trip: 0
+OCINumberSetPi:
+  :version: 810
+  :ret:     void
+  :args:    - OCIError *err
+            - OCINumber *num
+
+# round trip: 0
+OCINumberShift:
+  :version: 810
+  :args:    - OCIError *err
+            - const OCINumber *number
+            - const sword nDig
+            - OCINumber *result
+
+# round trip: 0
 OCIReset:
   :version: 810
   :args:    - dvoid *hndlp
@@ -277,6 +974,94 @@
 #
 
 # round trip: 0 (not docmented. I guess.)
+OCIDateTimeConstruct:
+  :version: 900
+  :args:    - dvoid  *hndl
+            - OCIError *err
+            - OCIDateTime *datetime
+            - sb2 yr
+            - ub1 mnth
+            - ub1 dy
+            - ub1 hr
+            - ub1 mm
+            - ub1 ss
+            - ub4 fsec
+            - OraText *timezone
+            - size_t timezone_length
+
+# round trip: 0 (not docmented. I guess.)
+OCIDateTimeGetDate:
+  :version: 900
+  :args:    - dvoid *hndl
+            - OCIError *err
+            - const OCIDateTime *date
+            - sb2 *yr
+            - ub1 *mnth
+            - ub1 *dy
+
+# round trip: 0 (not docmented. I guess.)
+OCIDateTimeGetTime:
+  :version: 900
+  :args:    - dvoid *hndl
+            - OCIError *err
+            - OCIDateTime *datetime
+            - ub1 *hr
+            - ub1 *mm
+            - ub1 *ss
+            - ub4 *fsec
+
+# round trip: 0 (not docmented. I guess.)
+OCIDateTimeGetTimeZoneOffset:
+  :version: 900
+  :args:    - dvoid *hndl
+            - OCIError *err
+            - const OCIDateTime *datetime
+            - sb1 *hr
+            - sb1 *mm
+
+# round trip: 0 (not docmented. I guess.)
+OCIIntervalGetDaySecond:
+  :version: 900
+  :args:    - dvoid *hndl
+            - OCIError *err
+            - sb4 *dy
+            - sb4 *hr
+            - sb4 *mm
+            - sb4 *ss
+            - sb4 *fsec
+            - const OCIInterval *result
+
+# round trip: 0 (not docmented. I guess.)
+OCIIntervalGetYearMonth:
+  :version: 900
+  :args:    - dvoid *hndl
+            - OCIError *err
+            - sb4 *yr
+            - sb4 *mnth
+            - const OCIInterval *result
+
+# round trip: 0 (not docmented. I guess.)
+OCIIntervalSetDaySecond:
+  :version: 900
+  :args:    - dvoid *hndl
+            - OCIError *err
+            - sb4 dy
+            - sb4 hr
+            - sb4 mm
+            - sb4 ss
+            - sb4 fsec
+            - OCIInterval *result
+
+# round trip: 0 (not docmented. I guess.)
+OCIIntervalSetYearMonth:
+  :version: 900
+  :args:    - dvoid *hndl
+            - OCIError *err
+            - sb4 yr
+            - sb4 mnth
+            - OCIInterval *result
+
+# round trip: 0 (not docmented. I guess.)
 OCIRowidToChar:
   :version: 900
   :args:    - OCIRowid *rowidDesc

Modified: trunk/ruby-oci8/ext/oci8/object.c
===================================================================
--- trunk/ruby-oci8/ext/oci8/object.c	2008-03-06 14:06:04 UTC (rev 250)
+++ trunk/ruby-oci8/ext/oci8/object.c	2008-03-07 14:15:15 UTC (rev 251)
@@ -73,7 +73,7 @@
     oci_lc(OCIAttrGet(md->hp.ptr, OCI_DTYPE_PARAM, &tdo_ref, NULL, OCI_ATTR_REF_TDO, oci8_errhp));
     if (tdo_ref == NULL)
         return Qnil;
-    oci_lc(OCIObjectPin(oci8_envhp, oci8_errhp, tdo_ref, 0, OCI_PIN_ANY, OCI_DURATION_SESSION, OCI_LOCK_NONE, &tdo->hp.ptr));
+    oci_lc(OCIObjectPin_nb(svcctx, oci8_envhp, oci8_errhp, tdo_ref, 0, OCI_PIN_ANY, OCI_DURATION_SESSION, OCI_LOCK_NONE, &tdo->hp.ptr));
     oci8_link_to_parent(tdo, &svcctx->base);
     return self;
 }

Modified: trunk/ruby-oci8/ext/oci8/oci8lib.c
===================================================================
--- trunk/ruby-oci8/ext/oci8/oci8lib.c	2008-03-06 14:06:04 UTC (rev 250)
+++ trunk/ruby-oci8/ext/oci8/oci8lib.c	2008-03-07 14:15:15 UTC (rev 251)
@@ -223,11 +223,26 @@
 }
 
 #ifdef RUBY_VM
+typedef struct {
+    dvoid *hndlp;
+    OCIError *errhp;
+} ocibreak_arg_t;
+
+static VALUE call_OCIBreak(void *user_data)
+{
+    ocibreak_arg_t *arg = (ocibreak_arg_t *)user_data;
+    OCIBreak(arg->hndlp, arg->errhp);
+    return Qnil;
+}
+
 static void oci8_unblock_func(void *user_data)
 {
     oci8_svcctx_t *svcctx = (oci8_svcctx_t *)user_data;
     if (svcctx->base.hp.ptr != NULL) {
-        OCIBreak(svcctx->base.hp.ptr, oci8_errhp);
+        ocibreak_arg_t arg;
+        arg.hndlp = svcctx->base.hp.ptr;
+        arg.errhp = oci8_errhp;
+        rb_thread_blocking_region(call_OCIBreak, &arg, NULL, NULL);
     }
 }
 




More information about the ruby-oci8-commit mailing list