3 Star 9 Fork 0

Gitee 极速下载/cx-oracle

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.github
doc
samples
src
cxoApiType.c
cxoBuffer.c
cxoConnection.c
cxoCursor.c
cxoDbType.c
cxoDeqOptions.c
cxoEnqOptions.c
cxoError.c
cxoFuture.c
cxoJsonBuffer.c
cxoLob.c
cxoModule.c
cxoModule.h
cxoMsgProps.c
cxoObject.c
cxoObjectAttr.c
cxoObjectType.c
cxoQueue.c
cxoSessionPool.c
cxoSodaCollection.c
cxoSodaDatabase.c
cxoSodaDoc.c
cxoSodaDocCursor.c
cxoSodaOperation.c
cxoSubscr.c
cxoTransform.c
cxoUtils.c
cxoVar.c
test
.gitattributes
.gitignore
.gitmodules
.readthedocs.yaml
CONTRIBUTING.md
LICENSE.txt
MANIFEST.in
README.md
README.txt
SECURITY.md
pyproject.toml
setup.cfg
setup.py
tox.ini
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/oracle/python-cx_Oracle
克隆/下载
cxoApiType.c 3.14 KB
一键复制 编辑 原始数据 按行查看 历史
//-----------------------------------------------------------------------------
// Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// cxoApiType.c
// Defines the objects used for identifying types defined by the Python
// Database API.
//-----------------------------------------------------------------------------
#include "cxoModule.h"
//-----------------------------------------------------------------------------
// cxoApiType_free()
// Free the API type object.
//-----------------------------------------------------------------------------
static void cxoApiType_free(cxoApiType *apiType)
{
Py_CLEAR(apiType->dbTypes);
Py_TYPE(apiType)->tp_free((PyObject*) apiType);
}
//-----------------------------------------------------------------------------
// cxoApiType_repr()
// Return a string representation of a queue.
//-----------------------------------------------------------------------------
static PyObject *cxoApiType_repr(cxoApiType *apiType)
{
PyObject *module, *name, *apiTypeName, *result;
apiTypeName = PyUnicode_DecodeASCII(apiType->name, strlen(apiType->name),
NULL);
if (!apiTypeName)
return NULL;
if (cxoUtils_getModuleAndName(Py_TYPE(apiType), &module, &name) < 0) {
Py_DECREF(apiTypeName);
return NULL;
}
result = cxoUtils_formatString("<%s.%s %s>",
PyTuple_Pack(3, module, name, apiTypeName));
Py_DECREF(module);
Py_DECREF(name);
Py_DECREF(apiTypeName);
return result;
}
//-----------------------------------------------------------------------------
// cxoApiType_reduce()
// Method provided for pickling/unpickling of API types.
//-----------------------------------------------------------------------------
static PyObject *cxoApiType_reduce(cxoApiType *apiType)
{
return PyUnicode_DecodeASCII(apiType->name, strlen(apiType->name), NULL);
}
//-----------------------------------------------------------------------------
// declaration of methods
//-----------------------------------------------------------------------------
static PyMethodDef cxoMethods[] = {
{ "__reduce__", (PyCFunction) cxoApiType_reduce, METH_NOARGS },
{ NULL, NULL }
};
//-----------------------------------------------------------------------------
// declaration of members
//-----------------------------------------------------------------------------
static PyMemberDef cxoMembers[] = {
{ "name", T_STRING, offsetof(cxoApiType, name), READONLY },
{ NULL }
};
//-----------------------------------------------------------------------------
// Python type declaration
//-----------------------------------------------------------------------------
PyTypeObject cxoPyTypeApiType = {
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "cx_Oracle.ApiType",
.tp_basicsize = sizeof(cxoApiType),
.tp_dealloc = (destructor) cxoApiType_free,
.tp_repr = (reprfunc) cxoApiType_repr,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_members = cxoMembers,
.tp_methods = cxoMethods
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/mirrors/cx-oracle.git
git@gitee.com:mirrors/cx-oracle.git
mirrors
cx-oracle
cx-oracle
main

搜索帮助