资源简介
达梦数据库dmPython 安装包,可在python 虚拟环境中用于安装 dmPython 实现Python 适配DM7,可与Python3.6适配

代码片段和文件信息
//-----------------------------------------------------------------------------
// Buffer.c
// Defines buffer structure and routines for populating it. These are used
// to translate Python objects into the buffers needed for Dameng including
// Unicode or buffer objects.
//-----------------------------------------------------------------------------
#include “Buffer.h“
//-----------------------------------------------------------------------------
// pyBuffer_Init()
// Initialize the buffer with an empty string. Returns 0 as a convenience to
// the caller.
//-----------------------------------------------------------------------------
static
sdint2
dmBuffer_Init(
udt_Buffer* buf // buffer to initialize
)
{
buf->ptr = NULL;
buf->size = 0;
buf->numCharacters = 0;
buf->obj = NULL;
return 0;
}
//-----------------------------------------------------------------------------
// cxBuffer_Copy()
// Copy the contents of the buffer.
//-----------------------------------------------------------------------------
static
int
dmBuffer_Copy(
udt_Buffer* buf // buffer to copy into
udt_Buffer* copyFromBuf // buffer to copy from
)
{
buf->ptr = copyFromBuf->ptr;
buf->size = copyFromBuf->size;
buf->numCharacters = copyFromBuf->numCharacters;
Py_XINCREF(copyFromBuf->obj);
buf->obj = copyFromBuf->obj;
return 0;
}
//-----------------------------------------------------------------------------
// cxBuffer_Fromobject()
// Populate the string buffer from a unicode object.
//-----------------------------------------------------------------------------
sdint2
dmBuffer_Fromobject(
udt_Buffer* buf // buffer to fill
Pyobject* obj // object (string or Unicode object)
const char* encoding // encoding to use if applicable
)
{
if (!obj)
return dmBuffer_Init(buf);
if (encoding && PyUnicode_Check(obj)) {
buf->obj = PyUnicode_AsEncodedString(obj encoding NULL);
if (!buf->obj)
return -1;
buf->ptr = PyBytes_AS_STRING(buf->obj);
buf->size = PyBytes_GET_SIZE(buf->obj);
buf->numCharacters = PyUnicode_GET_SIZE(obj);
} else if (PyBytes_Check(obj)) {
Py_INCREF(obj);
buf->obj = obj;
buf->ptr = PyBytes_AS_STRING(buf->obj);
buf->size = buf->numCharacters = PyBytes_GET_SIZE(buf->obj);
#if PY_MAJOR_VERSION < 3
} else if (PyBuffer_Check(obj)) {
if (Pyobject_AsReadBuffer(obj &buf->ptr &buf->size) < 0)
return -1;
Py_INCREF(obj);
buf->obj = obj;
buf->numCharacters = buf->size;
#endif
} else {
PyErr_SetString(PyExc_TypeError “buffer type error!“);
return -1;
}
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-11-22 10:34 dmPython\
文件 2977 2018-10-18 14:17 dmPython\Buffer.c
文件 635 2018-10-18 14:17 dmPython\Buffer.h
文件 58896 2018-10-18 14:17 dmPython\Connection.c
文件 78098 2018-10-18 14:17 dmPython\Cursor.c
文件 9991 2018-10-18 14:17 dmPython\dmPython.vcxproj
文件 3098 2018-10-18 14:17 dmPython\dmPython.vcxproj.filters
文件 782 2018-10-18 14:17 dmPython\dmPython.vcxproj.user
文件 12707 2018-10-18 14:17 dmPython\Environment.c
文件 3480 2018-10-18 14:17 dmPython\Error.c
文件 861 2018-10-18 14:17 dmPython\Error.h
文件 13366 2018-10-18 14:17 dmPython\exBfile.c
文件 17176 2018-10-18 14:17 dmPython\exLob.c
文件 57107 2018-10-18 14:17 dmPython\exob
文件 21650 2018-10-18 14:17 dmPython\py_Dameng.c
文件 8566 2018-10-18 14:17 dmPython\py_Dameng.h
文件 2417 2018-10-18 14:17 dmPython\README.txt
文件 15823 2018-10-18 14:17 dmPython\row.c
文件 1553 2018-10-18 14:17 dmPython\row.h
文件 9971 2018-10-18 14:17 dmPython\setup.py
文件 5911 2018-10-18 14:17 dmPython\strct.h
文件 23313 2018-10-18 14:17 dmPython\tob
文件 44351 2018-10-18 14:17 dmPython\var.c
文件 15744 2018-10-18 14:17 dmPython\var_pub.h
文件 11014 2018-10-18 14:17 dmPython\vBfile.c
文件 6759 2018-10-18 14:17 dmPython\vCursor.c
文件 19590 2018-10-18 14:17 dmPython\vDateTime.c
文件 10478 2018-10-18 14:17 dmPython\vInterval.c
文件 11293 2018-10-18 14:17 dmPython\vLob.c
文件 10777 2018-10-18 14:17 dmPython\vlong.c
文件 32446 2018-10-18 14:17 dmPython\vNumber.c
............此处省略2个文件信息
相关资源
- 二级考试python试题12套(包括选择题和
- pywin32_python3.6_64位
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
评论
共有 条评论