本文整理匯總了Golang中C.uword函數的典型用法代碼示例。如果您正苦於以下問題:Golang uword函數的具體用法?Golang uword怎麽用?Golang uword使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了uword函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: value
func (def *defFloat32) value() (value interface{}, err error) {
if def.isNullable {
oraFloat32Value := Float32{IsNull: def.null < C.sb2(0)}
if !oraFloat32Value.IsNull {
var float32Value float32
r := C.OCINumberToReal(
def.rset.stmt.ses.srv.env.ocierr, //OCIError *err,
&def.ociNumber, //const OCINumber *number,
C.uword(4), //uword rsl_length,
unsafe.Pointer(&oraFloat32Value.Value)) //void *rsl );
if r == C.OCI_ERROR {
err = def.rset.stmt.ses.srv.env.ociError()
}
value = float32Value
}
value = oraFloat32Value
} else {
if def.null > C.sb2(-1) {
var float32Value float32
r := C.OCINumberToReal(
def.rset.stmt.ses.srv.env.ocierr, //OCIError *err,
&def.ociNumber, //const OCINumber *number,
C.uword(4), //uword rsl_length,
unsafe.Pointer(&float32Value)) //void *rsl );
if r == C.OCI_ERROR {
err = def.rset.stmt.ses.srv.env.ociError()
}
value = float32Value
}
}
return value, err
}
示例2: value
func (def *defUint64) value() (value interface{}, err error) {
if def.isNullable {
oraUint64Value := Uint64{IsNull: def.null < C.sb2(0)}
if !oraUint64Value.IsNull {
r := C.OCINumberToInt(
def.rset.stmt.ses.srv.env.ocierr, //OCIError *err,
&def.ociNumber, //const OCINumber *number,
C.uword(8), //uword rsl_length,
C.OCI_NUMBER_UNSIGNED, //uword rsl_flag,
unsafe.Pointer(&oraUint64Value.Value)) //void *rsl );
if r == C.OCI_ERROR {
err = def.rset.stmt.ses.srv.env.ociError()
}
}
value = oraUint64Value
} else {
if def.null > C.sb2(-1) {
var uint64Value uint64
r := C.OCINumberToInt(
def.rset.stmt.ses.srv.env.ocierr, //OCIError *err,
&def.ociNumber, //const OCINumber *number,
C.uword(8), //uword rsl_length,
C.OCI_NUMBER_UNSIGNED, //uword rsl_flag,
unsafe.Pointer(&uint64Value)) //void *rsl );
if r == C.OCI_ERROR {
err = def.rset.stmt.ses.srv.env.ociError()
}
value = uint64Value
}
}
return value, err
}
示例3: StartTx
// StartTx starts an Oracle transaction returning a *Tx and possible error.
func (ses *Ses) StartTx() (tx *Tx, err error) {
ses.mu.Lock()
defer ses.mu.Unlock()
ses.log(_drv.cfg.Log.Ses.StartTx)
err = ses.checkClosed()
if err != nil {
return nil, errE(err)
}
// start transaction
// the number of seconds the transaction can be inactive
// before it is automatically terminated by the system.
// TODO: add timeout config value
var timeout C.uword = C.uword(60)
r := C.OCITransStart(
ses.srv.ocisvcctx, //OCISvcCtx *svchp,
ses.srv.env.ocierr, //OCIError *errhp,
timeout, //uword timeout,
C.OCI_TRANS_NEW) //ub4 flags );
if r == C.OCI_ERROR {
return nil, errE(ses.srv.env.ociError())
}
tx = _drv.txPool.Get().(*Tx) // set *Tx
tx.ses = ses
if tx.id == 0 {
tx.id = _drv.txId.nextId()
}
ses.openTxs.add(tx)
return tx, nil
}
示例4: numberFromInt
func (env *Environment) numberFromInt(value int64, dst unsafe.Pointer) error {
return env.CheckStatus(
C.OCINumberFromInt(env.errorHandle, unsafe.Pointer(&value),
C.uword(unsafe.Sizeof(value)), C.OCI_NUMBER_SIGNED,
(*C.OCINumber)(dst)),
"numberFromInt")
}
示例5: setPtr
func (bnd *bndFloat64Ptr) setPtr() error {
if bnd.isNull > C.sb2(-1) {
r := C.OCINumberToReal(
bnd.stmt.ses.srv.env.ocierr, //OCIError *err,
&bnd.ociNumber, //const OCINumber *number,
C.uword(8), //uword rsl_length,
unsafe.Pointer(bnd.value)) //void *rsl );
if r == C.OCI_ERROR {
return bnd.stmt.ses.srv.env.ociError()
}
}
return nil
}
示例6: setPtr
func (bnd *bndUint16Ptr) setPtr() error {
if bnd.isNull > C.sb2(-1) {
r := C.OCINumberToInt(
bnd.stmt.ses.srv.env.ocierr, //OCIError *err,
&bnd.ociNumber, //const OCINumber *number,
C.uword(2), //uword rsl_length,
C.OCI_NUMBER_UNSIGNED, //uword rsl_flag,
unsafe.Pointer(bnd.value)) //void *rsl );
if r == C.OCI_ERROR {
return bnd.stmt.ses.srv.env.ociError()
}
}
return nil
}
示例7: setPtr
func (bnd *bndInt32Ptr) setPtr() error {
if bnd.isNull > C.sb2(-1) {
r := C.OCINumberToInt(
bnd.stmt.ses.srv.env.ocierr, //OCIError *err,
&bnd.ociNumber, //const OCINumber *number,
C.uword(4), //uword rsl_length,
C.OCI_NUMBER_SIGNED, //uword rsl_flag,
unsafe.Pointer(bnd.value)) //void *rsl );
if r == C.OCI_ERROR {
return bnd.stmt.ses.srv.env.ociError()
}
bnd.stmt.logF(_drv.cfg.Log.Stmt.Bind,
"Int32Ptr.setPtr number=%#v => value=%d", bnd.ociNumber, *bnd.value)
}
return nil
}
示例8: numberFromFloat
func (env *Environment) numberFromFloat(value float64, dst unsafe.Pointer) error {
return env.CheckStatus(
C.OCINumberFromReal(env.errorHandle, unsafe.Pointer(&value),
C.uword(unsafe.Sizeof(value)), (*C.OCINumber)(dst)),
"numberFromReal")
}