commit
c6d26f18e9
@ -0,0 +1,389 @@
|
||||
# ---> VisualStudio
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUnit
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Coverlet is a free, cross platform Code Coverage Tool
|
||||
coverage*[.json, .xml, .info]
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# ---> C++
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
|
||||
# Fortran module files
|
||||
*.mod
|
||||
*.smod
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
||||
*.lib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
|
||||
@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="头文件">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="common">
|
||||
<UniqueIdentifier>{ca041e83-7fab-47f9-b6e5-089441e62ecf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="handler">
|
||||
<UniqueIdentifier>{48795282-4973-45c1-8088-ec3dc4f3c98c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="tinyxml">
|
||||
<UniqueIdentifier>{6f6034c0-2af0-4b17-bb50-1d9606d6c892}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Util">
|
||||
<UniqueIdentifier>{6836d814-428d-41e9-b85b-7377b8514455}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="connor_custom_main.cxx">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="epm_register_handler.cxx">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ocilib.cxx">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tinystr.cpp">
|
||||
<Filter>tinyxml</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tinyxml.cpp">
|
||||
<Filter>tinyxml</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tinyxmlerror.cpp">
|
||||
<Filter>tinyxml</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tinyxmlparser.cpp">
|
||||
<Filter>tinyxml</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StringUtil.cxx">
|
||||
<Filter>Util</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TCMethodUtil.cxx">
|
||||
<Filter>Util</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RB_SendErpBom.cxx">
|
||||
<Filter>handler</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RB_SendErpItem.cxx">
|
||||
<Filter>handler</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RB_AutoSignServer.cpp">
|
||||
<Filter>handler</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RB_PLM2LIMS_JCSY.cpp">
|
||||
<Filter>handler</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RB_testquery_ID.cpp">
|
||||
<Filter>handler</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RB_CheckForCompletion.cxx">
|
||||
<Filter>handler</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RB_SendErpBom_Rule.cxx">
|
||||
<Filter>handler</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RB_SendErpItem_New_Rule.cxx">
|
||||
<Filter>handler</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RB_SendErpItem_New_Rule_Release.cxx">
|
||||
<Filter>handler</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RB_SendErpBom_Rule_Release.cxx">
|
||||
<Filter>handler</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="OracleDB.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="connor_itk_util.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RB_BOM_TO_ERP.cpp">
|
||||
<Filter>handler</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="epm_handler_common.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="epm_register_handler.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ocilib.h">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tinystr.h">
|
||||
<Filter>tinyxml</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tinyxml.h">
|
||||
<Filter>tinyxml</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="RB_AutoSignServer.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ocilib2.h">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ocilib2.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="OracleDB.h">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="connor_itk_util.h">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@ -0,0 +1,156 @@
|
||||
// OracleDB.cpp
|
||||
#include "OracleDB.h"
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
OracleDB::OracleDB() : conn(nullptr), stmt(nullptr), isConnected(false) {}
|
||||
|
||||
OracleDB::~OracleDB() {
|
||||
disconnect();
|
||||
}
|
||||
|
||||
bool OracleDB::connect(const char* user, const char* pwd, const char* host) {
|
||||
if (isConnected) return true;
|
||||
|
||||
|
||||
|
||||
// 创建连接
|
||||
conn = OCI_ConnectionCreate(host, user, pwd, OCI_SESSION_DEFAULT);
|
||||
if (!conn) {
|
||||
printf("连接数据库失败: %s\n", OCI_GetLastError() ? OCI_ErrorGetString(OCI_GetLastError()) : "Unknown error");
|
||||
return false;
|
||||
}
|
||||
|
||||
stmt = OCI_StatementCreate(conn);
|
||||
if (!stmt) {
|
||||
printf("创建语句对象失败\n");
|
||||
OCI_ConnectionFree(conn);
|
||||
conn = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
isConnected = true;
|
||||
printf("数据库连接成功\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
void OracleDB::disconnect() {
|
||||
if (stmt) {
|
||||
OCI_StatementFree(stmt);
|
||||
stmt = nullptr;
|
||||
}
|
||||
if (conn) {
|
||||
OCI_ConnectionFree(conn);
|
||||
conn = nullptr;
|
||||
}
|
||||
isConnected = false;
|
||||
}
|
||||
|
||||
int OracleDB::executeQuery(
|
||||
const char* sql,
|
||||
int* outputColumn,
|
||||
int* outputRow,
|
||||
char**** outputValue
|
||||
) {
|
||||
// 初始化输出参数
|
||||
*outputColumn = 0;
|
||||
*outputRow = 0;
|
||||
*outputValue = nullptr;
|
||||
|
||||
printf("初始化输出参数完成\n");
|
||||
|
||||
if (!isConnected || !stmt) {
|
||||
printf("数据库未连接或语句对象无效\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("检查数据库连接成功\n");
|
||||
|
||||
if (!OCI_ExecuteStmt(stmt, sql)) {
|
||||
printf("SQL执行失败: %s\n", OCI_ErrorGetString(OCI_GetLastError()));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("SQL语句执行成功\n");
|
||||
|
||||
OCI_Resultset* rs = OCI_GetResultset(stmt);
|
||||
if (!rs) {
|
||||
printf("无法获取结果集\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("获取结果集成功\n");
|
||||
|
||||
int colCount = (int)OCI_GetColumnCount(rs);
|
||||
printf("列数: %d\n", colCount);
|
||||
|
||||
// 使用 vector 临时存储所有数据
|
||||
std::vector<std::vector<std::string>> tempData;
|
||||
|
||||
int rowCount = 0;
|
||||
while (OCI_FetchNext(rs)) {
|
||||
std::vector<std::string> row;
|
||||
for (int j = 0; j < colCount; j++) {
|
||||
const char* val = OCI_GetString(rs, j + 1);
|
||||
if (val) {
|
||||
row.push_back(std::string(val));
|
||||
}
|
||||
else {
|
||||
row.push_back("NULL");
|
||||
}
|
||||
}
|
||||
tempData.push_back(row);
|
||||
rowCount++;
|
||||
}
|
||||
|
||||
printf("遍历结果集完成,行数: %d\n", rowCount);
|
||||
|
||||
// 分配 outputValue
|
||||
char*** result = (char***)calloc(rowCount, sizeof(char**));
|
||||
if (!result) {
|
||||
printf("内存分配失败\n");
|
||||
return -1;
|
||||
}
|
||||
printf("为结果分配内存完成\n");
|
||||
|
||||
for (int i = 0; i < rowCount; i++) {
|
||||
result[i] = (char**)calloc(colCount, sizeof(char*));
|
||||
if (!result[i]) {
|
||||
// 清理已分配内存
|
||||
for (int j = 0; j < i; j++) {
|
||||
for (int k = 0; k < colCount; k++) {
|
||||
free(result[j][k]);
|
||||
}
|
||||
free(result[j]);
|
||||
}
|
||||
free(result);
|
||||
printf("内存分配失败\n");
|
||||
return -1;
|
||||
}
|
||||
printf("为第 %d 行分配内存完成\n", i + 1);
|
||||
|
||||
for (int j = 0; j < colCount; j++) {
|
||||
const std::string& val = tempData[i][j];
|
||||
result[i][j] = (char*)malloc(val.length() + 1);
|
||||
if (result[i][j]) {
|
||||
strcpy(result[i][j], val.c_str());
|
||||
printf("复制第 %d 行第 %d 列的数据: %s\n", i + 1, j + 1, result[i][j]);
|
||||
}
|
||||
else {
|
||||
result[i][j] = nullptr;
|
||||
printf("内存分配失败,设置第 %d 行第 %d 列为空指针\n", i + 1, j + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 设置输出参数
|
||||
*outputColumn = colCount;
|
||||
*outputRow = rowCount;
|
||||
*outputValue = result;
|
||||
|
||||
printf("executeQuery 成功返回\n");
|
||||
return 0; // 成功
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
// OracleDB.h
|
||||
#ifndef ORACLEDB_H
|
||||
#define ORACLEDB_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "ocilib2.h"
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
class OracleDB {
|
||||
private:
|
||||
OCI_Connection* conn;
|
||||
OCI_Statement* stmt;
|
||||
bool isConnected;
|
||||
|
||||
public:
|
||||
OracleDB();
|
||||
~OracleDB();
|
||||
|
||||
// 连接数据库
|
||||
bool OracleDB::connect(const char* user, const char* pwd, const char* host);
|
||||
|
||||
// 执行查询,按你要求的接口
|
||||
int executeQuery(
|
||||
const char* sql,
|
||||
int* outputColumn,
|
||||
int* outputRow,
|
||||
char**** outputValue
|
||||
);
|
||||
|
||||
// 断开连接
|
||||
void disconnect();
|
||||
};
|
||||
|
||||
#endif // ORACLEDB_H
|
||||
@ -0,0 +1,116 @@
|
||||
#include <tc\folder.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <tc\preferences.h>
|
||||
#include <winsock2.h>
|
||||
#include <tc/prm.h>
|
||||
#include <comdef.h>
|
||||
#include <windows.h>
|
||||
#include "epm_handler_common.h"
|
||||
|
||||
#include "RB_AutoSignServer.h";
|
||||
#define DOFREE(obj) \
|
||||
{ \
|
||||
if(obj) \
|
||||
{ \
|
||||
MEM_free(obj); \
|
||||
obj = NULL; \
|
||||
} \
|
||||
}
|
||||
|
||||
//提取流程节点自动跳过
|
||||
int RB_AutoSignServer(void *returnValue)
|
||||
{
|
||||
int ifail = 0;
|
||||
char * myResult = NULL,
|
||||
*myType = NULL;
|
||||
char * signoffUid = NULL;
|
||||
char * parentUid = NULL;
|
||||
string resultString;
|
||||
tag_t parentTag = NULLTAG, signoffTag = NULLTAG;
|
||||
POM_AM__set_application_bypass(true);
|
||||
ITKCALL(ifail = USERARG_get_string_argument(&signoffUid));
|
||||
ITKCALL(ifail = USERARG_get_string_argument(&parentUid));
|
||||
myResult = (char *)MEM_alloc(8 * sizeof(char));
|
||||
printf("signoffUid=%s\n", signoffUid);
|
||||
printf("parentUid=%s\n", parentUid);
|
||||
tc_strcpy(myResult, "-1");
|
||||
ITK__convert_uid_to_tag(parentUid, &parentTag);
|
||||
if (parentTag == NULLTAG) {
|
||||
tc_strcpy(myResult, "0");
|
||||
}
|
||||
ITK__convert_uid_to_tag(signoffUid, &signoffTag);
|
||||
if (signoffTag == NULLTAG) {
|
||||
tc_strcpy(myResult, "0");
|
||||
}
|
||||
char * taskname = NULL, *type = NULL;
|
||||
ITKCALL(AOM_ask_value_string(parentTag, "object_type", &type));
|
||||
printf("name=%s\n", taskname);
|
||||
printf("type=%s\n", type);
|
||||
if (strcmp(type, "EPMReviewTask") == 0)
|
||||
{
|
||||
//int num = 0;
|
||||
//tag_t *sub_tags = NULL;
|
||||
//ITKCALL(EPM_ask_sub_tasks(task_tag, &num, &sub_tags));
|
||||
//for (int j = 0; j < num; j++)
|
||||
//{
|
||||
//char * taskname2 = NULL, *type2 = NULL;
|
||||
//ITKCALL(EPM_ask_name2(sub_tags[j], &taskname2));
|
||||
//ITKCALL(AOM_ask_value_string(sub_tags[j], "object_type", &type2));
|
||||
//if (strcmp(type2, "EPMPerformSignoffTask") == 0)
|
||||
//{
|
||||
//printf("name2=%s,type2=%s\n", taskname2, type2);
|
||||
ITKCALL(EPM_promote_task(parentTag, ""));
|
||||
//}
|
||||
//DOFREE(taskname2);
|
||||
//DOFREE(type2);
|
||||
|
||||
// }
|
||||
//DOFREE(sub_tags);
|
||||
}
|
||||
DOFREE(taskname);
|
||||
DOFREE(type);
|
||||
POM_AM__set_application_bypass(false);
|
||||
/*if (parentTag != NULLTAG && signoffTag != NULLTAG) {
|
||||
POM_AM__set_application_bypass(true);
|
||||
char *realState = NULL;
|
||||
logical isPexist = false;
|
||||
logical isAexist = false;
|
||||
ITKCALL(POM_instance_exists(parentTag, &isPexist));
|
||||
ITKCALL(POM_instance_exists(signoffTag, &isAexist));
|
||||
if (isPexist && isAexist) {
|
||||
ITKCALL(ifail = AOM_refresh(parentTag, 0));
|
||||
ITKCALL(ifail = AOM_refresh(signoffTag, 0));
|
||||
ITKCALL(AOM_ask_value_string(parentTag, "real_state", &realState));
|
||||
printf("realState=%s\n", realState);
|
||||
if (strcmp(realState, "Started") == 0) {
|
||||
ITKCALL(ifail = EPM_set_task_decision2(parentTag, signoffTag, CR_approve_decision, "跳过"));
|
||||
if (ifail == ITK_ok) {
|
||||
tc_strcpy(myResult, "0");
|
||||
printf("执行跳过成功,跳过");
|
||||
}
|
||||
else {
|
||||
printf("执行跳过失败,不跳过");
|
||||
}
|
||||
//MEM_free(realState);
|
||||
//realState = NULL;
|
||||
}
|
||||
else if (strcmp(realState, "Completed") == 0) {
|
||||
tc_strcpy(myResult, "0");
|
||||
printf("节点状态为完成,跳过\n");
|
||||
}
|
||||
MEM_free(realState);
|
||||
realState = NULL;
|
||||
POM_AM__set_application_bypass(false);
|
||||
}
|
||||
else {
|
||||
tc_strcpy(myResult, "0");
|
||||
printf("对象不存在,跳过\n");
|
||||
}
|
||||
}
|
||||
*/
|
||||
*((char**)returnValue) = myResult;
|
||||
return 0;
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
#include <tc/tc.h>
|
||||
#include <ict/ict_userservice.h>
|
||||
#include <tccore/custom.h>
|
||||
#include <epm/epm_toolkit_tc_utils.h>
|
||||
#include <tccore/aom.h>
|
||||
#include <tccore/aom_prop.h>
|
||||
#include <tccore/item.h>
|
||||
#include <bom/bom.h>
|
||||
#include <ps/ps.h>;
|
||||
#include <ps/vrule.h>
|
||||
#include <sstream>
|
||||
#include <cfm\cfm.h>
|
||||
#include <tccore/grm.h>
|
||||
#include <epm/epm.h>
|
||||
#include <sa/sa.h>
|
||||
#include <map>
|
||||
#include <epm/signoff.h>
|
||||
#include <ctime>
|
||||
#include <vector>
|
||||
#include <locale>
|
||||
#include <codecvt>
|
||||
#include <ae/dataset.h>
|
||||
#include <iostream>
|
||||
#include <regex>
|
||||
#include <list>
|
||||
#include <set>
|
||||
#include <stdlib.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <tc\folder.h>
|
||||
#include <tc/tc.h>
|
||||
#include <ict/ict_userservice.h>
|
||||
#include <tccore/custom.h>
|
||||
#include <epm/epm_toolkit_tc_utils.h>
|
||||
#include <tccore/aom.h>
|
||||
#include <tccore/aom_prop.h>
|
||||
#include <tccore/item.h>
|
||||
#include <bom/bom.h>
|
||||
#include <ps/ps.h>;
|
||||
#include <ps/vrule.h>
|
||||
#include <sstream>
|
||||
#include <cfm\cfm.h>
|
||||
#include <tccore/grm.h>
|
||||
#include <epm/epm.h>
|
||||
#include <sa/sa.h>
|
||||
#include <map>
|
||||
#include <epm/signoff.h>
|
||||
#include <ctime>
|
||||
#include <vector>
|
||||
#include <locale>
|
||||
#include <codecvt>
|
||||
#include <ae/dataset.h>
|
||||
#include <iostream>
|
||||
#include <regex>
|
||||
#include <list>
|
||||
#include <set>
|
||||
#include <string.h>
|
||||
|
||||
int RB_AutoSignServer(void *returnValue);
|
||||
@ -0,0 +1,92 @@
|
||||
#include <epm\epm.h>
|
||||
#include <tccore\grm.h>
|
||||
#include <tccore\grmtype.h>
|
||||
#include <tccore\aom_prop.h>
|
||||
#include <ae\dataset.h>
|
||||
#include <tccore\aom.h>
|
||||
#include <fclasses\tc_date.h>
|
||||
#include <epm\signoff.h>
|
||||
#include <tccore\item.h>
|
||||
#include <tccore\item.h>
|
||||
#include <sa\user.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <time.h>
|
||||
#include <bom/bom.h>
|
||||
#include <tc\folder.h>
|
||||
#include <curl\curl.h>
|
||||
#include "ocilib.h"
|
||||
#include "connor_itk_util.h"
|
||||
#include "epm_handler_common.h"
|
||||
using namespace std;
|
||||
#define EPM_HANDLER_COMMON
|
||||
#define MAX_PATH_LENGTH 200
|
||||
#define MAX_PRINTLINE_LENGTH 400000
|
||||
|
||||
int RB_BOM_TO_ERP(EPM_action_message_t msg) {
|
||||
|
||||
tag_t task_tag = NULL_TAG,
|
||||
root_task_tag = NULLTAG,
|
||||
*attachments;;
|
||||
task_tag = msg.task;
|
||||
int att_cnt = 0, ifail = 0;
|
||||
int c_sql_value_count = 0;
|
||||
char** c_sql_values;
|
||||
ITKCALL(PREF_ask_char_values("RB3_SQL_Connect2", &c_sql_value_count, &c_sql_values));
|
||||
if (c_sql_value_count != 3)
|
||||
{
|
||||
WriteLog("首选项 RB3_SQL_Connect2 配置错误 数量%d ", c_sql_value_count);
|
||||
CloseLog();
|
||||
return 1;
|
||||
}
|
||||
printf("------------------------------------------------------------------------------------");
|
||||
printf("=========================");
|
||||
printf("RB_BOM_TO_ERP start");
|
||||
printf("=========================");
|
||||
|
||||
EPM_ask_root_task(task_tag, &root_task_tag);
|
||||
EPM_ask_attachments(root_task_tag, EPM_target_attachment, &att_cnt, &attachments);
|
||||
printf("流程目标下的对象数量:%d", att_cnt);
|
||||
|
||||
|
||||
char* tempValue = NULL;
|
||||
char taskpuid[56] = "\0";
|
||||
ITK__convert_tag_to_uid(task_tag, &tempValue);
|
||||
tc_strcpy(taskpuid, tempValue);
|
||||
|
||||
time_t curtime1;
|
||||
time(&curtime1);
|
||||
tm* nowtime1 = localtime(&curtime1);
|
||||
string dealBeginTime;
|
||||
dealBeginTime.append(std::to_string(1900 + nowtime1->tm_year)).append("-").append(std::to_string(1 + nowtime1->tm_mon)).append("-").append(std::to_string(nowtime1->tm_mday)).append(" ").append(std::to_string(nowtime1->tm_hour)).append(":").append(std::to_string(nowtime1->tm_min)).append(":").append(std::to_string(nowtime1->tm_sec));
|
||||
|
||||
if (ConnServer(c_sql_values[1], c_sql_values[2], c_sql_values[0]))//"tc11","infodba","//172.16.50.40/tc11" "TC12","infodba","172.16.68.13/tc1"
|
||||
{
|
||||
printf("提示:中间数据表访问失败\n");
|
||||
return ifail;
|
||||
}
|
||||
else {
|
||||
printf("提示:中间数据表访问成功\n");
|
||||
char sql1[1024] = "\0";
|
||||
|
||||
|
||||
sprintf(sql1, "insert into RB_BOM_TO_ERP(flowid,status,starttime) values ('%s','%s',TO_DATE('%s', 'YYYY-MM-DD HH24:MI:SS'))", taskpuid, "0",dealBeginTime.c_str());
|
||||
printf("提示:sql1==%s\n", sql1);
|
||||
if (ExecuteSQLNoInputParam(sql1) == -1)
|
||||
{
|
||||
printf("提示:数据插入 失败, %s \n", sql1);
|
||||
ifail = 1;
|
||||
}
|
||||
else {
|
||||
ExecuteSQLNoInputParam("commit");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DOFREE(attachments);
|
||||
printf("=========================");
|
||||
printf("RB_BOM_TO_ERP end");
|
||||
printf("=========================");
|
||||
return ifail;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,69 @@
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#include "epm_handler_common.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "ocilib.h"
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <tccore/item.h>
|
||||
#include <curl/curl.h>
|
||||
#include <regex>
|
||||
#include <fstream>
|
||||
#include <chrono>
|
||||
#include <ctime>
|
||||
#include <memory>
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
#include <exception>
|
||||
#define ITK_err 919821
|
||||
using namespace std;
|
||||
|
||||
int RB_testquery_ID(EPM_action_message_t msg)
|
||||
{
|
||||
int ifail = ITK_ok;
|
||||
int attachments_num = 0;
|
||||
tag_t rootTask = NULLTAG, * attachments = NULLTAG;
|
||||
//获取任务对象
|
||||
EPM_ask_root_task(msg.task, &rootTask);
|
||||
//获取任务目标对象
|
||||
EPM_ask_attachments(rootTask, EPM_target_attachment, &attachments_num, &attachments);
|
||||
//获取参数
|
||||
char* url = NULL, * name = NULL, * password = NULL;
|
||||
char* argflag = NULL, * argvalue = NULL, * arg = NULL;
|
||||
int arg_cnt = TC_number_of_arguments(msg.arguments);
|
||||
|
||||
tag_t item;
|
||||
//根据id查找零组件
|
||||
ITKCALL(ITEM_find_item("JCSY-000011", &item));
|
||||
if (item == NULL) {
|
||||
// 调用查询构建器,第一步获取查询构建器对象
|
||||
tag_t query_tag1 = NULLTAG;
|
||||
ITKCALL(QRY_find2("零组件...", &query_tag1));
|
||||
if (query_tag1 == NULLTAG)
|
||||
{
|
||||
printf("没找到 [%s]查询构建器!\n", "零组件...");
|
||||
return 0;
|
||||
}
|
||||
int querynum = 0;
|
||||
tag_t* queryresults = NULLTAG;
|
||||
char* quvalue[1];
|
||||
char* querykey[1];
|
||||
quvalue[0] = "零组件 ID";
|
||||
querykey[0] = "JCSY-000011";
|
||||
ITKCALL(QRY_execute(query_tag1, 1, quvalue, querykey, &querynum, &queryresults));
|
||||
if (querynum > 0) {
|
||||
item = queryresults[0];
|
||||
}
|
||||
}
|
||||
if (item!=NULL) {
|
||||
char* name;
|
||||
AOM_ask_value_string(item, "object_string", &name);
|
||||
printf("找到零组件了%s\n", name);
|
||||
}
|
||||
else {
|
||||
printf("没有找到零组件\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
|
||||
|
||||
#pragma warning (disable: 4819)
|
||||
|
||||
|
||||
#include <tcinit/tcinit.h>
|
||||
#include <tccore/custom.h>
|
||||
#include "epm_register_handler.h"
|
||||
#include "epm_handler_common.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
DLLAPI int rb_register_callbacks()
|
||||
{
|
||||
int ifail = ITK_ok;
|
||||
ifail = CUSTOM_register_exit(
|
||||
"rb",
|
||||
"USERSERVICE_register_methods",
|
||||
(CUSTOM_EXIT_ftn_t)USERSERVICE_custom_register_methods);
|
||||
|
||||
|
||||
ifail = CUSTOM_register_exit(
|
||||
"rb",
|
||||
"USER_gs_shell_init_module",
|
||||
(CUSTOM_EXIT_ftn_t)CUST_init_module);
|
||||
|
||||
return ifail;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@ -0,0 +1,71 @@
|
||||
#pragma once
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
#include <stdlib.h>
|
||||
//#include <io.h>
|
||||
#include <time.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include<algorithm>
|
||||
#include <epm/epm.h>
|
||||
#include <epm/epm_toolkit_tc_utils.h>
|
||||
#include <ict/ict_userservice.h>
|
||||
#include <tccore/item.h>
|
||||
#include <ae/ae.h>
|
||||
#include <tc/folder.h>
|
||||
#include <tccore/aom.h>
|
||||
#include <sa/sa.h>
|
||||
#include <tccore/aom_prop.h>
|
||||
#include <property/prop_errors.h>
|
||||
#include <tccore/workspaceobject.h>
|
||||
#include <tc/preferences.h>
|
||||
#include <tccore//grm.h>
|
||||
#include <tccore/grmtype.h>
|
||||
#include <sa/am.h>
|
||||
#include <cfm/cfm.h>
|
||||
#include <bom/bom.h>
|
||||
#include <tccore/uom.h>
|
||||
#include <ps/ps.h>
|
||||
#include <epm/signoff.h>
|
||||
#include <fclasses/tc_date.h>
|
||||
#include <objbase.h>
|
||||
using namespace std;
|
||||
//#include <tccore/imantype.h>
|
||||
//#include <textsrv/textserver.h>
|
||||
//#include <user_exits/epm_toolkit_utils.h>
|
||||
//#include <ss/ss_errors.h>
|
||||
|
||||
//#include <direct.h>
|
||||
//#include <unistd.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define DOFREE(obj) \
|
||||
{ \
|
||||
if(obj) \
|
||||
{ \
|
||||
MEM_free(obj); \
|
||||
obj = NULL; \
|
||||
} \
|
||||
}
|
||||
void ECHO(char* format, ...);
|
||||
void CreateLogFile(char* FunctionName, char** fullname);
|
||||
void WriteLog(const char* format, ...);
|
||||
void CloseLog(void);
|
||||
string getUUid();
|
||||
void current_time(date_t* date_tag);
|
||||
char* getTime();
|
||||
char* GbkToUtf8(const char* src_str);
|
||||
char* Utf8ToGbk(const char* src_str);
|
||||
void starTime();
|
||||
logical checkIsItemRevision(tag_t objtag);
|
||||
int checkIsInType(tag_t objtag, string parentType);
|
||||
int getPrefStrings(const char* preference, vector<string>& pref_vec);
|
||||
bool isTypeOf(tag_t objtag, const char* type_name);
|
||||
void Split(string strArg, string spliter, vector<string>& ans);
|
||||
string dealPre(tag_t attachment, char* item_id, char* form_name, char* deal_type, tag_t classificationObject,char* typePref);
|
||||
int Supor_create_signinfo_file(char* file_content, char* item_id, char** file_name);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@ -0,0 +1,98 @@
|
||||
|
||||
|
||||
|
||||
#ifndef EPM_HANDLER_COMMON
|
||||
#define EPM_HANDLER_COMMON
|
||||
|
||||
#include "tinyxml.h"
|
||||
#include <string>
|
||||
#include <xstring>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <ctime>
|
||||
#include<iostream>
|
||||
#include <fstream>
|
||||
#include <res\res_itk.h>
|
||||
#include <tc\preferences.h>
|
||||
#include <tc\tc_macros.h>
|
||||
#include <tc\folder.h>
|
||||
#include <qry\qry.h>
|
||||
#include <fclasses/tc_date.h>
|
||||
#include <epm/signoff.h>
|
||||
#include <schmgt\schmgt_bridge_itk.h>
|
||||
#include <epm/epm.h>
|
||||
#include <epm/epm_task_template_itk.h>
|
||||
#include <ae/ae.h>
|
||||
#include <ics/ics.h>
|
||||
#include <ict/ict_userservice.h>
|
||||
#include <bom/bom.h>
|
||||
#include <tccore\aom_prop.h>
|
||||
#include <tccore//grm.h>
|
||||
#include <tccore/grmtype.h>
|
||||
#include <tccore\item.h>
|
||||
#include <tccore\aom.h>
|
||||
#include <sa/user.h>
|
||||
#include <ics/ics2.h>
|
||||
#include <wininet.h>
|
||||
#include<io.h>
|
||||
#include "ocilib.h"
|
||||
#include "connor_itk_util.h"
|
||||
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")
|
||||
|
||||
#pragma comment(lib, "WinInet.lib")
|
||||
|
||||
using namespace std;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define DOFREE(obj);
|
||||
extern "C" int POM_AM__set_application_bypass(logical bypass);
|
||||
bool create_adhoc_signoff(tag_t current_task, vector<tag_t> userID);
|
||||
const char * inputFileToFtp(char * filePath);
|
||||
char * getLineCode(char * lineCode);
|
||||
//void removeChar(char* str, char c);
|
||||
char* U2G(const char* utf8);
|
||||
const char* newGUID();
|
||||
string replace_all_distinct(char* strC, char* old_valueC, char* new_valueC);
|
||||
void split(char *src, const char *separator, char **dest, int *num);
|
||||
int gbk_strlen(const char* str);
|
||||
void stringToLenth(int value, int num, char ** result);
|
||||
bool count(vector<char *> values, char * value);
|
||||
void BOMSendToWeixin(char * userId, tag_t rootTask_tag, string message);
|
||||
void itemSendToWeixin(char * userId, tag_t rootTask_tag, string message);
|
||||
void TCFindItem(char * queryName, int n_entries, char ** qry_entries, char ** qry_values, int * n_found, tag_t ** dba_mbrs);
|
||||
void TCGetPropertyValue(tag_t item, char * type, char * propertyName, char ** propertyValue);
|
||||
int ORIGIN_set_bypass(void *returnValue);
|
||||
int ORIGIN_close_bypass(void *returnValue);
|
||||
int RB_SendErpItem(EPM_action_message_t msg);
|
||||
int RB_SendErpBom(EPM_action_message_t msg);
|
||||
int RB_CheckForCompletion(EPM_action_message_t msg);
|
||||
int RB_PLM2LIMS_JCSY(EPM_action_message_t msg);
|
||||
int RB_testquery_ID(EPM_action_message_t msg);
|
||||
bool startsWith(const char* str, char first, char second);
|
||||
char* removeChar(char* str, char charToRemove);
|
||||
char* removeSpaces(char* str);
|
||||
void removeFirstFourChars(char* str);
|
||||
char* getFirstStr(const char* str, int index);
|
||||
void getClassValue(char* value, int id, char** disValue);
|
||||
int RB_SendErpItem_New(EPM_action_message_t msg);
|
||||
int RB_SendErpBom_New(EPM_action_message_t msg);
|
||||
int RB_Send_MDM_GYLX_New(EPM_action_message_t msg);
|
||||
int RB_SendGX_New(EPM_action_message_t msg);
|
||||
int RB_SendErpItem_New_Rule(EPM_rule_message_t msg);
|
||||
int RB_SendErpBom_New_Rule(EPM_rule_message_t msg);
|
||||
int RB_SendErpItem_New_Rule_Release(EPM_rule_message_t msg);
|
||||
int RB_SendErpBom_New_Rule_Release(EPM_rule_message_t msg);
|
||||
int RB_BOM_TO_ERP(EPM_action_message_t msg);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@ -0,0 +1,247 @@
|
||||
#include <server_exits/user_server_exits.h>
|
||||
#include <epm/epm.h>
|
||||
|
||||
|
||||
#include <time.h>
|
||||
#include <bom/bom_msg.h>
|
||||
#include <tccore/item_msg.h>
|
||||
#include <vector>
|
||||
#include <string.h>
|
||||
/**
|
||||
* @headerfile user's header files
|
||||
*/
|
||||
#include "epm_register_handler.h"
|
||||
#include "epm_handler_common.h"
|
||||
#include "RB_AutoSignServer.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Method and Workflow Handler
|
||||
extern DLLAPI int CUST_init_module(int *decision, va_list args)
|
||||
{
|
||||
int ifail = ITK_ok;
|
||||
|
||||
|
||||
//检查交付和物料关系
|
||||
ifail = EPM_register_action_handler("RB_CheckForCompletion", "RB_CheckForCompletion",
|
||||
(EPM_action_handler_t)RB_CheckForCompletion);
|
||||
if (ifail == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_CheckForCompletion completed!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_CheckForCompletion failed %d!\n", ifail);
|
||||
}
|
||||
|
||||
|
||||
//对象下发到SAP
|
||||
ifail = EPM_register_action_handler("RB_SendSapItem", "RB_SendSapItem",
|
||||
(EPM_action_handler_t)RB_SendErpItem);
|
||||
if (ifail == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_SendSapItem completed!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_SendSapItem failed %d!\n", ifail);
|
||||
}
|
||||
//对象下发到SAP-新版本
|
||||
ifail = EPM_register_action_handler("RB_SendErpItem_New", "RB_SendErpItem_New",
|
||||
(EPM_action_handler_t)RB_SendErpItem_New);
|
||||
if (ifail == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_SendErpItem_New completed!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_SendErpItem_New failed %d!\n", ifail);
|
||||
}
|
||||
|
||||
//对象下发到SAP-新版本 Rule
|
||||
ifail = EPM_register_rule_handler("RB_SendErpItem_New_Rule", "RB_SendErpItem_New_Rule",
|
||||
(EPM_rule_handler_t)RB_SendErpItem_New_Rule);
|
||||
if (ifail == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering rule handler RB_SendErpItem_New_Rule completed!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stdout, "Registering rule handler RB_SendErpItem_New_Rule failed %d!\n", ifail);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//对象下发到SAP-新版本 Rule Release
|
||||
ifail = EPM_register_rule_handler("RB_SendErpItem_New_Rule_Release", "RB_SendErpItem_New_Rule_Release",
|
||||
(EPM_rule_handler_t)RB_SendErpItem_New_Rule_Release);
|
||||
if (ifail == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering rule handler RB_SendErpItem_New_Rule_Release completed!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stdout, "Registering rule handler RB_SendErpItem_New_Rule_Release failed %d!\n", ifail);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//BOM下发到SAP
|
||||
ifail = EPM_register_action_handler("RB_SendSapBom", "RB_SendSapBom",
|
||||
(EPM_action_handler_t)RB_SendErpBom);
|
||||
if (ifail == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_SendSapBom completed!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_SendSapBom failed %d!\n", ifail);
|
||||
}
|
||||
//BOM下发到SAP--新版本
|
||||
ifail = EPM_register_action_handler("RB_SendErpBom_New", "RB_SendErpBom_New",
|
||||
(EPM_action_handler_t)RB_SendErpBom_New);
|
||||
if (ifail == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_SendErpBom_New completed!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_SendErpBom_New failed %d!\n", ifail);
|
||||
}
|
||||
|
||||
//BOM下发到SAP--新版本rule
|
||||
ifail = EPM_register_rule_handler("RB_SendErpBom_New_Rule", "RB_SendErpBom_New_Rule",
|
||||
(EPM_rule_handler_t)RB_SendErpBom_New_Rule);
|
||||
if (ifail == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering rule handler RB_SendErpBom_New_Rule completed!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stdout, "Registering rule handler RB_SendErpBom_New_Rule failed %d!\n", ifail);
|
||||
}
|
||||
|
||||
|
||||
//BOM下发到SAP--新版本rule Release
|
||||
ifail = EPM_register_rule_handler("RB_SendErpBom_New_Rule_Release", "RB_SendErpBom_New_Rule_Release",
|
||||
(EPM_rule_handler_t)RB_SendErpBom_New_Rule_Release);
|
||||
if (ifail == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering rule handler RB_SendErpBom_New_Rule_Release completed!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stdout, "Registering rule handler RB_SendErpBom_New_Rule_Release failed %d!\n", ifail);
|
||||
}
|
||||
|
||||
//工序下发到SAP--新版本
|
||||
ifail = EPM_register_action_handler("RB_SendGX_New", "RB_SendGX_New",
|
||||
(EPM_action_handler_t)RB_SendGX_New);
|
||||
if (ifail == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_SendGX_New completed!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_SendGX_New failed %d!\n", ifail);
|
||||
}
|
||||
//工艺路线下发到SAP--新版本
|
||||
ifail = EPM_register_action_handler("RB_Send_MDM_GYLX_New", "RB_Send_MDM_GYLX_New",
|
||||
(EPM_action_handler_t)RB_Send_MDM_GYLX_New);
|
||||
if (ifail == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_Send_MDM_GYLX_New completed!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_Send_MDM_GYLX_New failed %d!\n", ifail);
|
||||
}
|
||||
//传递TC检测分析委托单信息至LIMS
|
||||
ifail = EPM_register_action_handler("RB_PLM2LIMS_JCSY", "RB_PLM2LIMS_JCSY",
|
||||
(EPM_action_handler_t)RB_PLM2LIMS_JCSY);
|
||||
if (ifail == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_PLM2LIMS_JCSY completed!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_PLM2LIMS_JCSY failed %d!\n", ifail);
|
||||
}
|
||||
|
||||
//传递TC检测分析委托单信息至LIMS
|
||||
ifail = EPM_register_action_handler("RB_testquery_ID", "RB_testquery_ID",
|
||||
(EPM_action_handler_t)RB_testquery_ID);
|
||||
if (ifail == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_testquery_ID completed!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_testquery_ID failed %d!\n", ifail);
|
||||
}
|
||||
|
||||
ifail = EPM_register_action_handler("RB_BOM_TO_ERP", "RB_BOM_TO_ERP",
|
||||
(EPM_action_handler_t)RB_BOM_TO_ERP);
|
||||
if (ifail == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_BOM_TO_ERP completed!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stdout, "Registering action handler RB_BOM_TO_ERP failed %d!\n", ifail);
|
||||
}
|
||||
|
||||
return ifail;
|
||||
}
|
||||
//
|
||||
////register service method
|
||||
extern DLLAPI int USERSERVICE_custom_register_methods()
|
||||
{
|
||||
int
|
||||
status = ITK_ok,
|
||||
numberOfArguments = 0,
|
||||
returnValueType = USERARG_STRING_TYPE,
|
||||
*argumentList = NULL;
|
||||
USER_function_t functionPtr;
|
||||
|
||||
METHOD_id_t mth_tag;
|
||||
|
||||
//===========================================
|
||||
|
||||
/*METHOD_find_method("ScheduleTask", ITEM_create_msg, &mth_tag);
|
||||
if (mth_tag.id)
|
||||
{
|
||||
status = METHOD_add_action(mth_tag, METHOD_post_action_type, (METHOD_function_t)ML_Test, NULL);
|
||||
if (status == ITK_ok)
|
||||
{
|
||||
printf("register wx3_tzcpxh_check successfully\n ");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("register wx3_tzcpxh_check failed\n ");
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
//===========================================
|
||||
//提取流程节点自动跳过
|
||||
numberOfArguments = 2;
|
||||
functionPtr = RB_AutoSignServer;
|
||||
argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int));
|
||||
argumentList[0] = USERARG_STRING_TYPE; //需要执行的signoff的puid
|
||||
argumentList[1] = USERARG_STRING_TYPE; //跳过的节点的PUID
|
||||
returnValueType = USERARG_STRING_TYPE; //返回值
|
||||
ITKCALL(status = USERSERVICE_register_method("RB_AutoSignServer", functionPtr, numberOfArguments, argumentList, returnValueType));
|
||||
MEM_free(argumentList);
|
||||
if (status == ITK_ok)
|
||||
{
|
||||
fprintf(stdout, "Registering userservice RB_AutoSignServer successful !\n");
|
||||
}
|
||||
else {
|
||||
fprintf(stdout, "Registering userservice RB_AutoSignServer failed %d\n", status);
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
|
||||
|
||||
#ifndef EPM_REGISTER_HANDLER_CUSTOM
|
||||
#define EPM_REGISTER_HANDLER_CUSTOM
|
||||
|
||||
#include <ict/ict_userservice.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern DLLAPI int CUST_init_module(int *, va_list);
|
||||
extern DLLAPI int USERSERVICE_custom_register_methods();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -0,0 +1,95 @@
|
||||
#pragma once
|
||||
#include <windows.h>
|
||||
#include <ctime>
|
||||
#include <mutex>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <direct.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
static std::mutex _mtx;
|
||||
|
||||
class Log
|
||||
{
|
||||
public:
|
||||
Log();
|
||||
~Log();
|
||||
|
||||
static void info(std::string log)
|
||||
{
|
||||
string type = "INFO";
|
||||
write(log, type);
|
||||
}
|
||||
|
||||
static void debug(std::string log)
|
||||
{
|
||||
string type = "DEBUG";
|
||||
write(log, type);
|
||||
}
|
||||
|
||||
static void warning(std::string log)
|
||||
{
|
||||
string type = "WARNING";
|
||||
write(log, type);
|
||||
}
|
||||
|
||||
static void error(std::string log)
|
||||
{
|
||||
string type = "ERROR";
|
||||
write(log, type);
|
||||
}
|
||||
|
||||
static void critical(std::string log)
|
||||
{
|
||||
string type = "CRITICAL";
|
||||
write(log, type);
|
||||
}
|
||||
|
||||
static std::string getTimestamp()
|
||||
{
|
||||
time_t timep;
|
||||
time(&timep);
|
||||
char tmp[64];
|
||||
struct tm nowTime;
|
||||
localtime_s(&nowTime, &timep);
|
||||
strftime(tmp, sizeof(tmp), "%Y-%m-%d-%H:%M:%S", &nowTime);
|
||||
return std::string(tmp);
|
||||
}
|
||||
|
||||
static void string_replace(string& s1, const string& s2, const string& s3)
|
||||
{
|
||||
string::size_type pos = 0;
|
||||
string::size_type a = s2.size();
|
||||
string::size_type b = s3.size();
|
||||
|
||||
while ((pos = s1.find(s2, pos)) != string::npos)
|
||||
{
|
||||
s1.replace(pos, a, s3);
|
||||
pos += b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void write(std::string log, std::string type)
|
||||
{
|
||||
string filePath = "C:/test.log"; //´æÈÕÖ¾ÎļþµÄ·¾¶
|
||||
std::ofstream ofs;
|
||||
|
||||
_mtx.lock();
|
||||
|
||||
ofs.open(filePath, std::ofstream::app);
|
||||
|
||||
ofs << getTimestamp().c_str() << "-";
|
||||
ofs << "[" << type.c_str() << "]-";
|
||||
|
||||
ofs.write(log.c_str(), log.size());
|
||||
ofs << std::endl;
|
||||
ofs.close();
|
||||
|
||||
_mtx.unlock();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,115 @@
|
||||
/*=====================================================================================================================
|
||||
Copyright(c) 2012 ORIGIN.
|
||||
Unpublished - All rights reserved
|
||||
=======================================================================================================================
|
||||
File description:
|
||||
|
||||
Filename: ocilib.h
|
||||
Module : OCI
|
||||
|
||||
This Header file of OCI library Package.
|
||||
|
||||
=======================================================================================================================
|
||||
Date Name Description of Change
|
||||
1-Feb-2015 Ray Initialize creation
|
||||
$HISTORY$
|
||||
=====================================================================================================================*/
|
||||
#include <oci.h>
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
//#include <limits.h>
|
||||
|
||||
#define OCI_FAIL 1
|
||||
#define OCI_OK 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
/**
|
||||
* 连接数据库.
|
||||
* @param username - <I> 用户名
|
||||
* @param password - <I> 密码
|
||||
* @param dbname - <I> 数据库SID
|
||||
* @return - OCI_OK or error code
|
||||
*
|
||||
* ORACLE 数据库的连接与封装函数
|
||||
*/
|
||||
extern int ConnServer(char *username,char *password,char *dbname);
|
||||
|
||||
|
||||
/**
|
||||
* 不带输入参数的执行SQL语句.
|
||||
* @param SQL - <I> SQL语句
|
||||
* @return - OCI_OK or error code
|
||||
*
|
||||
* ORACLE 数据库的连接与封装函数
|
||||
*/
|
||||
extern int ExecuteSQLNoInputParam(char *SQL);
|
||||
|
||||
/**
|
||||
* 不带输入参数的执行SQL语句2.
|
||||
* @param SQL - <I> SQL语句
|
||||
* @return - OCI_OK or error code
|
||||
*
|
||||
* ORACLE 数据库的连接与封装函数
|
||||
*/
|
||||
extern int ExecuteSQLNoInputParam2(char *SQL);
|
||||
|
||||
/**
|
||||
* 带输入参数的执行SQL语句.
|
||||
* @param SQL - <I> SQL语句
|
||||
* @param inputValueCount - <I> 输入参数数量
|
||||
* @param inputValue - <I> 输入参数值
|
||||
* @return - OCI_OK or error code
|
||||
*
|
||||
* ORACLE 数据库的连接与封装函数
|
||||
*/
|
||||
extern int ExecuteSQL(char *SQL,int inputValueCount,char **inputValue);
|
||||
|
||||
/**
|
||||
* 不带输入参数的查询SQL语句.
|
||||
* @param SQL - <I> SQL语句
|
||||
* @param outputColumn - <O> 输出表的列的数量
|
||||
* @param outputValueCount - <O> 输出表的行的数量
|
||||
* @param outputValue - <O> 输出表内容
|
||||
* @return - OCI_OK or error code
|
||||
*
|
||||
* ORACLE 数据库的连接与封装函数
|
||||
*/
|
||||
extern int QuerySQLNoInputParam(char *SQL, int * outputColumn, int * outputValueCount, char **** outputValue);
|
||||
|
||||
/**
|
||||
* 带输入参数的查询SQL语句.
|
||||
* @param SQL - <I> SQL语句
|
||||
* @param inputValueCount - <I> 输入参数数量
|
||||
* @param inputValue - <I> 输入参数值
|
||||
* @param outputColumn - <O> 输出表的列的数量
|
||||
* @param outputValueCount - <O> 输出表的行的数量
|
||||
* @param outputValue - <O> 输出表内容
|
||||
* @return - OCI_OK or error code
|
||||
*
|
||||
* ORACLE 数据库的连接与封装函数
|
||||
*/
|
||||
extern int QuerySQL(char *SQL, int inputValueCount, char ** inputValue, int * outputColumn, int * outputValueCount, char **** outputValue);
|
||||
|
||||
/**
|
||||
* 断开数据库连接.
|
||||
*
|
||||
* ORACLE 数据库的连接与封装函数
|
||||
*/
|
||||
extern void DisConnServer();
|
||||
|
||||
|
||||
/**
|
||||
* 回滚当前数据库操作.
|
||||
*
|
||||
* ORACLE 数据库的连接与封装函数
|
||||
*/
|
||||
extern int ExecuteRollback();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* OCILIB - C Driver for Oracle (C Wrapper for Oracle OCI)
|
||||
*
|
||||
* Website: http://www.ocilib.net
|
||||
*
|
||||
* Copyright (c) 2007-2020 Vincent ROGIER <vince.rogier@ocilib.net>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* IMPORTANT NOTICE
|
||||
*
|
||||
* This file contains explanations about Oracle and OCI technologies.
|
||||
* OCILIB is a wrapper around OCI and thus exposes OCI features.
|
||||
* The OCILIB documentation intends to explain Oracle / OCI concepts
|
||||
* and is naturally based on the official Oracle OCI documentation.
|
||||
*
|
||||
* Some parts of OCILIB documentation may include some information
|
||||
* taken and adapted from the following Oracle documentations :
|
||||
* - Oracle Call Interface Programmer's Guide
|
||||
* - Oracle Streams - Advanced Queuing User's Guide
|
||||
*/
|
||||
|
||||
#ifndef OCILIB_H_INCLUDED
|
||||
#define OCILIB_H_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* @defgroup OcilibCApi C API
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup OcilibCApiSupportedCharsets Character sets
|
||||
* @defgroup OcilibCApiDatatypes Data types
|
||||
* @defgroup OcilibCApiEnvironmentVariables Environment Variables
|
||||
*/
|
||||
|
||||
#include "ocilibc/platform.h"
|
||||
#include "ocilibc/defines.h"
|
||||
#include "ocilibc/types.h"
|
||||
#include "ocilibc/api.h"
|
||||
#include "ocilibc/compat.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @} OcilibCApi
|
||||
*/
|
||||
|
||||
|
||||
#endif /* OCILIB_H_INCLUDED */
|
||||
@ -0,0 +1,218 @@
|
||||
/*
|
||||
* OCILIB - C Driver for Oracle (C Wrapper for Oracle OCI)
|
||||
*
|
||||
* Website: http://www.ocilib.net
|
||||
*
|
||||
* Copyright (c) 2007-2020 Vincent ROGIER <vince.rogier@ocilib.net>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* IMPORTANT NOTICE
|
||||
*
|
||||
* This C++ header defines C++ wrapper classes around the OCILIB C API
|
||||
* It requires a compatible version of OCILIB
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef OCILIBCPP_H_INCLUDED
|
||||
#define OCILIBCPP_H_INCLUDED
|
||||
|
||||
/**
|
||||
* @namespace ocilib
|
||||
* @brief OCILIB ++ Namespace
|
||||
*
|
||||
*/
|
||||
|
||||
namespace ocilib
|
||||
{
|
||||
|
||||
/**
|
||||
* @defgroup OcilibCppApi C++ API
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup OcilibCppApiOverview Overview
|
||||
* @{
|
||||
*
|
||||
* @par Introduction
|
||||
* OCILIB++ is a C++ API for Oracle built on top of the C OCILIB API:
|
||||
* - Full C API ported to C++
|
||||
* - Implemented as a set of header files, no library compilation needed
|
||||
* - Based on C++ and STL paradigms (Strong typing, templates, containers, RAII, exception handling, operators, stack objects)
|
||||
* - Based on design patterns (RAII, delegation, reference counting, smart pointers, proxies, singleton)
|
||||
* - No user dynamic object allocation required
|
||||
* - The only dependencies are : STL and OCILIB C API
|
||||
*
|
||||
* @par C++ language requirements
|
||||
* - The OCILIB C++ API requires only C++03 features.
|
||||
* - It does not required C++11/14/17 but uses some CXX features when target compiler support them
|
||||
*
|
||||
* @par Reference counting model
|
||||
* - API usage is very simple, based on stack objects wrapping OCILIB handles using reference counting.
|
||||
* - OCILIB handles are automatically allocated internally by C++ objects constructors or methods.
|
||||
* - They are also automatically freed when the last C++ object referencing it goes out of scope.
|
||||
* - Dynamic memory allocation is not required at all.
|
||||
* - OCILIB++ allows simple and safe usage of Oracle client without the worries of memory leakages.
|
||||
* - Using stack objects also makes error handling easier and program logic more robust
|
||||
*
|
||||
* @par C++ API classes usage
|
||||
* Most C++ API classes wrap C API handles.
|
||||
* When instances are created using the default constructors, they hold no C handles and have
|
||||
* their method IsNull() returning true.
|
||||
* Any use of other methods and functions on such object methods will throw an C++ exception.
|
||||
* Thus, in order to have a valid object :
|
||||
* - use a parametrized constructor
|
||||
* - use the default constructor and then later assign a value to the instance using assignment operator.
|
||||
* In the later case, the value can be provided by a function return value or using the object class constructor
|
||||
*
|
||||
* @par Exception model
|
||||
* - Any failure occurring within an OCILIB C API call will throw a ocilib::Exception
|
||||
* - For conformance reasons, this class derives from std::Exception
|
||||
*
|
||||
* @warning
|
||||
* - OCILIB++ wraps the whole OCILIB C API.
|
||||
* - Each C OCILIB object handle has its C++ class counter part.
|
||||
* - The whole OCILIB C Documentation (concepts, use cases, features) is still valid for OCILIB++
|
||||
*
|
||||
* @} OcilibCppApiOverview
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup OcilibCppApiMainDemoApplication OCILIB main C++ demo application code
|
||||
* @{
|
||||
*
|
||||
* Main C++ demo source
|
||||
* @include ocilib_demo.cpp
|
||||
*
|
||||
* @} OcilibCppApiMainDemoApplication
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup OcilibCppApiDemoListApplication Some OCILIB C++ sample codes
|
||||
* @{
|
||||
*
|
||||
* Here are some C++ samples code. More samples can be found under the demo folder of ocilib packages.
|
||||
*
|
||||
* @par Fetching data
|
||||
* @include fetch.cpp
|
||||
*
|
||||
* @par Binding vectors
|
||||
* @include array.cpp
|
||||
*
|
||||
* @par Using collections
|
||||
* @include coll.cpp
|
||||
*
|
||||
* @par Using connection pools
|
||||
* @include pool.cpp
|
||||
*
|
||||
* @par Oracle 12c Implicit resultsets
|
||||
* @include implicit_resultset.cpp
|
||||
*
|
||||
* @par Using Oracle objects
|
||||
* @include object.cpp
|
||||
*
|
||||
* @par Database notifications
|
||||
* @include notification.cpp
|
||||
*
|
||||
* @} OcilibCppApiDemoListApplication
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @} OcilibCppApi
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* IMPORTANT NOTICE
|
||||
*
|
||||
* This C++ header defines C++ wrapper classes around the OCILIB C API
|
||||
* It requires a compatible version of OCILIB
|
||||
*
|
||||
*/
|
||||
|
||||
/* Including declarations */
|
||||
|
||||
#include "ocilibcpp/config.hpp"
|
||||
#include "ocilibcpp/core.hpp"
|
||||
#include "ocilibcpp/support.hpp"
|
||||
#include "ocilibcpp/types.hpp"
|
||||
|
||||
/* Including core implementations */
|
||||
|
||||
#include "ocilibcpp/detail/core/Utils.hpp"
|
||||
#include "ocilibcpp/detail/core/Enum.hpp"
|
||||
#include "ocilibcpp/detail/core/Flags.hpp"
|
||||
#include "ocilibcpp/detail/core/ManagedBuffer.hpp"
|
||||
#include "ocilibcpp/detail/core/HandleHolder.hpp"
|
||||
#include "ocilibcpp/detail/core/Locker.hpp"
|
||||
#include "ocilibcpp/detail/core/Lockable.hpp"
|
||||
#include "ocilibcpp/detail/core/ConcurrentMap.hpp"
|
||||
#include "ocilibcpp/detail/core/ConcurrentList.hpp"
|
||||
#include "ocilibcpp/detail/core/SmartHandle.hpp"
|
||||
#include "ocilibcpp/detail/core/MemoryDebugInfo.hpp"
|
||||
|
||||
/* Including support implementations */
|
||||
|
||||
#include "ocilibcpp/detail/support/BindResolver.hpp"
|
||||
#include "ocilibcpp/detail/support/BindObject.hpp"
|
||||
#include "ocilibcpp/detail/support/BindArray.hpp"
|
||||
#include "ocilibcpp/detail/support/BindObjectAdaptor.hpp"
|
||||
#include "ocilibcpp/detail/support/BindTypeAdaptor.hpp"
|
||||
#include "ocilibcpp/detail/support/BindsHolder.hpp"
|
||||
#include "ocilibcpp/detail/support/NumericTypeResolver.hpp"
|
||||
|
||||
/* Including types implementations */
|
||||
|
||||
#include "ocilibcpp/detail/Exception.hpp"
|
||||
#include "ocilibcpp/detail/Environment.hpp"
|
||||
#include "ocilibcpp/detail/Mutex.hpp"
|
||||
#include "ocilibcpp/detail/Thread.hpp"
|
||||
#include "ocilibcpp/detail/ThreadKey.hpp"
|
||||
#include "ocilibcpp/detail/Pool.hpp"
|
||||
#include "ocilibcpp/detail/Connection.hpp"
|
||||
#include "ocilibcpp/detail/Transaction.hpp"
|
||||
#include "ocilibcpp/detail/Number.hpp"
|
||||
#include "ocilibcpp/detail/Date.hpp"
|
||||
#include "ocilibcpp/detail/Interval.hpp"
|
||||
#include "ocilibcpp/detail/Timestamp.hpp"
|
||||
#include "ocilibcpp/detail/Lob.hpp"
|
||||
#include "ocilibcpp/detail/File.hpp"
|
||||
#include "ocilibcpp/detail/TypeInfo.hpp"
|
||||
#include "ocilibcpp/detail/Object.hpp"
|
||||
#include "ocilibcpp/detail/Reference.hpp"
|
||||
#include "ocilibcpp/detail/Collection.hpp"
|
||||
#include "ocilibcpp/detail/CollectionIterator.hpp"
|
||||
#include "ocilibcpp/detail/CollectionElement.hpp"
|
||||
#include "ocilibcpp/detail/Long.hpp"
|
||||
#include "ocilibcpp/detail/BindInfo.hpp"
|
||||
#include "ocilibcpp/detail/Statement.hpp"
|
||||
#include "ocilibcpp/detail/Resultset.hpp"
|
||||
#include "ocilibcpp/detail/Column.hpp"
|
||||
#include "ocilibcpp/detail/Subscription.hpp"
|
||||
#include "ocilibcpp/detail/Event.hpp"
|
||||
#include "ocilibcpp/detail/Agent.hpp"
|
||||
#include "ocilibcpp/detail/Message.hpp"
|
||||
#include "ocilibcpp/detail/Enqueue.hpp"
|
||||
#include "ocilibcpp/detail/Dequeue.hpp"
|
||||
#include "ocilibcpp/detail/DirectPath.hpp"
|
||||
#include "ocilibcpp/detail/Queue.hpp"
|
||||
#include "ocilibcpp/detail/QueueTable.hpp"
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@ -0,0 +1,111 @@
|
||||
/*
|
||||
www.sourceforge.net/projects/tinyxml
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product documentation
|
||||
would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TIXML_USE_STL
|
||||
|
||||
#include "tinystr.h"
|
||||
|
||||
// Error value for find primitive
|
||||
const TiXmlString::size_type TiXmlString::npos = static_cast< TiXmlString::size_type >(-1);
|
||||
|
||||
|
||||
// Null rep.
|
||||
TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, { '\0' } };
|
||||
|
||||
|
||||
void TiXmlString::reserve (size_type cap)
|
||||
{
|
||||
if (cap > capacity())
|
||||
{
|
||||
TiXmlString tmp;
|
||||
tmp.init(length(), cap);
|
||||
memcpy(tmp.start(), data(), length());
|
||||
swap(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TiXmlString& TiXmlString::assign(const char* str, size_type len)
|
||||
{
|
||||
size_type cap = capacity();
|
||||
if (len > cap || cap > 3*(len + 8))
|
||||
{
|
||||
TiXmlString tmp;
|
||||
tmp.init(len);
|
||||
memcpy(tmp.start(), str, len);
|
||||
swap(tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
memmove(start(), str, len);
|
||||
set_size(len);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
TiXmlString& TiXmlString::append(const char* str, size_type len)
|
||||
{
|
||||
size_type newsize = length() + len;
|
||||
if (newsize > capacity())
|
||||
{
|
||||
reserve (newsize + capacity());
|
||||
}
|
||||
memmove(finish(), str, len);
|
||||
set_size(newsize);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
TiXmlString operator + (const TiXmlString & a, const TiXmlString & b)
|
||||
{
|
||||
TiXmlString tmp;
|
||||
tmp.reserve(a.length() + b.length());
|
||||
tmp += a;
|
||||
tmp += b;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
TiXmlString operator + (const TiXmlString & a, const char* b)
|
||||
{
|
||||
TiXmlString tmp;
|
||||
TiXmlString::size_type b_len = static_cast<TiXmlString::size_type>( strlen(b) );
|
||||
tmp.reserve(a.length() + b_len);
|
||||
tmp += a;
|
||||
tmp.append(b, b_len);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
TiXmlString operator + (const char* a, const TiXmlString & b)
|
||||
{
|
||||
TiXmlString tmp;
|
||||
TiXmlString::size_type a_len = static_cast<TiXmlString::size_type>( strlen(a) );
|
||||
tmp.reserve(a_len + b.length());
|
||||
tmp.append(a, a_len);
|
||||
tmp += b;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
#endif // TIXML_USE_STL
|
||||
@ -0,0 +1,305 @@
|
||||
/*
|
||||
www.sourceforge.net/projects/tinyxml
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product documentation
|
||||
would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TIXML_USE_STL
|
||||
|
||||
#ifndef TIXML_STRING_INCLUDED
|
||||
#define TIXML_STRING_INCLUDED
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
/* The support for explicit isn't that universal, and it isn't really
|
||||
required - it is used to check that the TiXmlString class isn't incorrectly
|
||||
used. Be nice to old compilers and macro it here:
|
||||
*/
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1200 )
|
||||
// Microsoft visual studio, version 6 and higher.
|
||||
#define TIXML_EXPLICIT explicit
|
||||
#elif defined(__GNUC__) && (__GNUC__ >= 3 )
|
||||
// GCC version 3 and higher.s
|
||||
#define TIXML_EXPLICIT explicit
|
||||
#else
|
||||
#define TIXML_EXPLICIT
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
TiXmlString is an emulation of a subset of the std::string template.
|
||||
Its purpose is to allow compiling TinyXML on compilers with no or poor STL support.
|
||||
Only the member functions relevant to the TinyXML project have been implemented.
|
||||
The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase
|
||||
a string and there's no more room, we allocate a buffer twice as big as we need.
|
||||
*/
|
||||
class TiXmlString
|
||||
{
|
||||
public :
|
||||
// The size type used
|
||||
typedef size_t size_type;
|
||||
|
||||
// Error value for find primitive
|
||||
static const size_type npos; // = -1;
|
||||
|
||||
|
||||
// TiXmlString empty constructor
|
||||
TiXmlString () : rep_(&nullrep_)
|
||||
{
|
||||
}
|
||||
|
||||
// TiXmlString copy constructor
|
||||
TiXmlString ( const TiXmlString & copy) : rep_(0)
|
||||
{
|
||||
init(copy.length());
|
||||
memcpy(start(), copy.data(), length());
|
||||
}
|
||||
|
||||
// TiXmlString constructor, based on a string
|
||||
TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0)
|
||||
{
|
||||
init( static_cast<size_type>( strlen(copy) ));
|
||||
memcpy(start(), copy, length());
|
||||
}
|
||||
|
||||
// TiXmlString constructor, based on a string
|
||||
TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0)
|
||||
{
|
||||
init(len);
|
||||
memcpy(start(), str, len);
|
||||
}
|
||||
|
||||
// TiXmlString destructor
|
||||
~TiXmlString ()
|
||||
{
|
||||
quit();
|
||||
}
|
||||
|
||||
TiXmlString& operator = (const char * copy)
|
||||
{
|
||||
return assign( copy, (size_type)strlen(copy));
|
||||
}
|
||||
|
||||
TiXmlString& operator = (const TiXmlString & copy)
|
||||
{
|
||||
return assign(copy.start(), copy.length());
|
||||
}
|
||||
|
||||
|
||||
// += operator. Maps to append
|
||||
TiXmlString& operator += (const char * suffix)
|
||||
{
|
||||
return append(suffix, static_cast<size_type>( strlen(suffix) ));
|
||||
}
|
||||
|
||||
// += operator. Maps to append
|
||||
TiXmlString& operator += (char single)
|
||||
{
|
||||
return append(&single, 1);
|
||||
}
|
||||
|
||||
// += operator. Maps to append
|
||||
TiXmlString& operator += (const TiXmlString & suffix)
|
||||
{
|
||||
return append(suffix.data(), suffix.length());
|
||||
}
|
||||
|
||||
|
||||
// Convert a TiXmlString into a null-terminated char *
|
||||
const char * c_str () const { return rep_->str; }
|
||||
|
||||
// Convert a TiXmlString into a char * (need not be null terminated).
|
||||
const char * data () const { return rep_->str; }
|
||||
|
||||
// Return the length of a TiXmlString
|
||||
size_type length () const { return rep_->size; }
|
||||
|
||||
// Alias for length()
|
||||
size_type size () const { return rep_->size; }
|
||||
|
||||
// Checks if a TiXmlString is empty
|
||||
bool empty () const { return rep_->size == 0; }
|
||||
|
||||
// Return capacity of string
|
||||
size_type capacity () const { return rep_->capacity; }
|
||||
|
||||
|
||||
// single char extraction
|
||||
const char& at (size_type index) const
|
||||
{
|
||||
assert( index < length() );
|
||||
return rep_->str[ index ];
|
||||
}
|
||||
|
||||
// [] operator
|
||||
char& operator [] (size_type index) const
|
||||
{
|
||||
assert( index < length() );
|
||||
return rep_->str[ index ];
|
||||
}
|
||||
|
||||
// find a char in a string. Return TiXmlString::npos if not found
|
||||
size_type find (char lookup) const
|
||||
{
|
||||
return find(lookup, 0);
|
||||
}
|
||||
|
||||
// find a char in a string from an offset. Return TiXmlString::npos if not found
|
||||
size_type find (char tofind, size_type offset) const
|
||||
{
|
||||
if (offset >= length()) return npos;
|
||||
|
||||
for (const char* p = c_str() + offset; *p != '\0'; ++p)
|
||||
{
|
||||
if (*p == tofind) return static_cast< size_type >( p - c_str() );
|
||||
}
|
||||
return npos;
|
||||
}
|
||||
|
||||
void clear ()
|
||||
{
|
||||
//Lee:
|
||||
//The original was just too strange, though correct:
|
||||
// TiXmlString().swap(*this);
|
||||
//Instead use the quit & re-init:
|
||||
quit();
|
||||
init(0,0);
|
||||
}
|
||||
|
||||
/* Function to reserve a big amount of data when we know we'll need it. Be aware that this
|
||||
function DOES NOT clear the content of the TiXmlString if any exists.
|
||||
*/
|
||||
void reserve (size_type cap);
|
||||
|
||||
TiXmlString& assign (const char* str, size_type len);
|
||||
|
||||
TiXmlString& append (const char* str, size_type len);
|
||||
|
||||
void swap (TiXmlString& other)
|
||||
{
|
||||
Rep* r = rep_;
|
||||
rep_ = other.rep_;
|
||||
other.rep_ = r;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void init(size_type sz) { init(sz, sz); }
|
||||
void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; }
|
||||
char* start() const { return rep_->str; }
|
||||
char* finish() const { return rep_->str + rep_->size; }
|
||||
|
||||
struct Rep
|
||||
{
|
||||
size_type size, capacity;
|
||||
char str[1];
|
||||
};
|
||||
|
||||
void init(size_type sz, size_type cap)
|
||||
{
|
||||
if (cap)
|
||||
{
|
||||
// Lee: the original form:
|
||||
// rep_ = static_cast<Rep*>(operator new(sizeof(Rep) + cap));
|
||||
// doesn't work in some cases of new being overloaded. Switching
|
||||
// to the normal allocation, although use an 'int' for systems
|
||||
// that are overly picky about structure alignment.
|
||||
const size_type bytesNeeded = sizeof(Rep) + cap;
|
||||
const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int );
|
||||
rep_ = reinterpret_cast<Rep*>( new int[ intsNeeded ] );
|
||||
|
||||
rep_->str[ rep_->size = sz ] = '\0';
|
||||
rep_->capacity = cap;
|
||||
}
|
||||
else
|
||||
{
|
||||
rep_ = &nullrep_;
|
||||
}
|
||||
}
|
||||
|
||||
void quit()
|
||||
{
|
||||
if (rep_ != &nullrep_)
|
||||
{
|
||||
// The rep_ is really an array of ints. (see the allocator, above).
|
||||
// Cast it back before delete, so the compiler won't incorrectly call destructors.
|
||||
delete [] ( reinterpret_cast<int*>( rep_ ) );
|
||||
}
|
||||
}
|
||||
|
||||
Rep * rep_;
|
||||
static Rep nullrep_;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
inline bool operator == (const TiXmlString & a, const TiXmlString & b)
|
||||
{
|
||||
return ( a.length() == b.length() ) // optimization on some platforms
|
||||
&& ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare
|
||||
}
|
||||
inline bool operator < (const TiXmlString & a, const TiXmlString & b)
|
||||
{
|
||||
return strcmp(a.c_str(), b.c_str()) < 0;
|
||||
}
|
||||
|
||||
inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); }
|
||||
inline bool operator > (const TiXmlString & a, const TiXmlString & b) { return b < a; }
|
||||
inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); }
|
||||
inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); }
|
||||
|
||||
inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; }
|
||||
inline bool operator == (const char* a, const TiXmlString & b) { return b == a; }
|
||||
inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); }
|
||||
inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); }
|
||||
|
||||
TiXmlString operator + (const TiXmlString & a, const TiXmlString & b);
|
||||
TiXmlString operator + (const TiXmlString & a, const char* b);
|
||||
TiXmlString operator + (const char* a, const TiXmlString & b);
|
||||
|
||||
|
||||
/*
|
||||
TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString.
|
||||
Only the operators that we need for TinyXML have been developped.
|
||||
*/
|
||||
class TiXmlOutStream : public TiXmlString
|
||||
{
|
||||
public :
|
||||
|
||||
// TiXmlOutStream << operator.
|
||||
TiXmlOutStream & operator << (const TiXmlString & in)
|
||||
{
|
||||
*this += in;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// TiXmlOutStream << operator.
|
||||
TiXmlOutStream & operator << (const char * in)
|
||||
{
|
||||
*this += in;
|
||||
return *this;
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
#endif // TIXML_STRING_INCLUDED
|
||||
#endif // TIXML_USE_STL
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,52 @@
|
||||
/*
|
||||
www.sourceforge.net/projects/tinyxml
|
||||
Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product documentation
|
||||
would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
*/
|
||||
|
||||
#include "tinyxml.h"
|
||||
|
||||
// The goal of the seperate error file is to make the first
|
||||
// step towards localization. tinyxml (currently) only supports
|
||||
// english error messages, but the could now be translated.
|
||||
//
|
||||
// It also cleans up the code a bit.
|
||||
//
|
||||
|
||||
const char* TiXmlBase::errorString[ TiXmlBase::TIXML_ERROR_STRING_COUNT ] =
|
||||
{
|
||||
"No error",
|
||||
"Error",
|
||||
"Failed to open file",
|
||||
"Error parsing Element.",
|
||||
"Failed to read Element name",
|
||||
"Error reading Element value.",
|
||||
"Error reading Attributes.",
|
||||
"Error: empty tag.",
|
||||
"Error reading end tag.",
|
||||
"Error parsing Unknown.",
|
||||
"Error parsing Comment.",
|
||||
"Error parsing Declaration.",
|
||||
"Error document empty.",
|
||||
"Error null (0) or unexpected EOF found in input stream.",
|
||||
"Error parsing CDATA.",
|
||||
"Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.",
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,92 @@
|
||||
#ifndef LIBXL_IBOOKT_H
|
||||
#define LIBXL_IBOOKT_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "setup.h"
|
||||
#include "enum.h"
|
||||
|
||||
namespace libxl {
|
||||
|
||||
template<class TCHAR> struct ISheetT;
|
||||
template<class TCHAR> struct IFormatT;
|
||||
template<class TCHAR> struct IFontT;
|
||||
|
||||
template<class TCHAR>
|
||||
struct IBookT
|
||||
{
|
||||
virtual bool XLAPIENTRY load(const TCHAR* filename) = 0;
|
||||
virtual bool XLAPIENTRY save(const TCHAR* filename) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY loadRaw(const char* data, unsigned size) = 0;
|
||||
virtual bool XLAPIENTRY saveRaw(const char** data, unsigned* size) = 0;
|
||||
|
||||
virtual ISheetT<TCHAR>* XLAPIENTRY addSheet(const TCHAR* name, ISheetT<TCHAR>* initSheet = 0) = 0;
|
||||
virtual ISheetT<TCHAR>* XLAPIENTRY insertSheet(int index, const TCHAR* name, ISheetT<TCHAR>* initSheet = 0) = 0;
|
||||
virtual ISheetT<TCHAR>* XLAPIENTRY getSheet(int index) const = 0;
|
||||
virtual SheetType XLAPIENTRY sheetType(int index) const = 0;
|
||||
virtual bool XLAPIENTRY delSheet(int index) = 0;
|
||||
virtual int XLAPIENTRY sheetCount() const = 0;
|
||||
|
||||
virtual IFormatT<TCHAR>* XLAPIENTRY addFormat(IFormatT<TCHAR>* initFormat = 0) = 0;
|
||||
virtual IFontT<TCHAR>* XLAPIENTRY addFont(IFontT<TCHAR>* initFont = 0) = 0;
|
||||
virtual int XLAPIENTRY addCustomNumFormat(const TCHAR* customNumFormat) = 0;
|
||||
virtual const TCHAR* XLAPIENTRY customNumFormat(int fmt) = 0;
|
||||
|
||||
virtual IFormatT<TCHAR>* XLAPIENTRY format(int index) = 0;
|
||||
virtual int XLAPIENTRY formatSize() = 0;
|
||||
|
||||
virtual IFontT<TCHAR>* XLAPIENTRY font(int index) = 0;
|
||||
virtual int XLAPIENTRY fontSize() = 0;
|
||||
|
||||
virtual double XLAPIENTRY datePack(int year, int month, int day, int hour = 0, int min = 0, int sec = 0, int msec = 0) = 0;
|
||||
virtual bool XLAPIENTRY dateUnpack(double value, int* year, int* month, int* day, int* hour = 0, int* min = 0, int* sec = 0, int* msec = 0) = 0;
|
||||
|
||||
virtual Color XLAPIENTRY colorPack(int red, int green, int blue) = 0;
|
||||
virtual void XLAPIENTRY colorUnpack(Color color, int* red, int* green, int* blue) = 0;
|
||||
|
||||
virtual int XLAPIENTRY activeSheet() const = 0;
|
||||
virtual void XLAPIENTRY setActiveSheet(int index) = 0;
|
||||
|
||||
virtual int XLAPIENTRY pictureSize() const = 0;
|
||||
virtual PictureType XLAPIENTRY getPicture(int index, const char** data, unsigned* size) const = 0;
|
||||
|
||||
virtual int XLAPIENTRY addPicture(const TCHAR* filename) = 0;
|
||||
virtual int XLAPIENTRY addPicture2(const char* data, unsigned size) = 0;
|
||||
|
||||
virtual const TCHAR* XLAPIENTRY defaultFont(int* fontSize) = 0;
|
||||
virtual void XLAPIENTRY setDefaultFont(const TCHAR* fontName, int fontSize) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY refR1C1() const = 0;
|
||||
virtual void XLAPIENTRY setRefR1C1(bool refR1C1 = true) = 0;
|
||||
|
||||
virtual void XLAPIENTRY setKey(const TCHAR* name, const TCHAR* key) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY rgbMode() = 0;
|
||||
virtual void XLAPIENTRY setRgbMode(bool rgbMode = true) = 0;
|
||||
|
||||
virtual int XLAPIENTRY version() const = 0;
|
||||
virtual int XLAPIENTRY biffVersion() const = 0;
|
||||
|
||||
virtual bool XLAPIENTRY isDate1904() const = 0;
|
||||
virtual void XLAPIENTRY setDate1904(bool date1904 = true) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY isTemplate() const = 0;
|
||||
virtual void XLAPIENTRY setTemplate(bool tmpl = true) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY setLocale(const char* locale) = 0;
|
||||
virtual const char* XLAPIENTRY errorMessage() const = 0;
|
||||
|
||||
virtual void XLAPIENTRY release() = 0;
|
||||
|
||||
virtual ~IBookT() {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
extern "C" XLAPI libxl::IBookT<char>* XLAPIENTRY xlCreateBookA();
|
||||
extern "C" XLAPI libxl::IBookT<wchar_t>* XLAPIENTRY xlCreateBookW();
|
||||
|
||||
extern "C" XLAPI libxl::IBookT<char>* XLAPIENTRY xlCreateXMLBookA();
|
||||
extern "C" XLAPI libxl::IBookT<wchar_t>* XLAPIENTRY xlCreateXMLBookW();
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,41 @@
|
||||
#ifndef LIBXL_IFONTT_H
|
||||
#define LIBXL_IFONTT_H
|
||||
|
||||
#include "setup.h"
|
||||
#include "enum.h"
|
||||
|
||||
namespace libxl {
|
||||
|
||||
template<class TCHAR>
|
||||
struct IFontT
|
||||
{
|
||||
virtual int XLAPIENTRY size() const = 0;
|
||||
virtual void XLAPIENTRY setSize(int size) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY italic() const = 0;
|
||||
virtual void XLAPIENTRY setItalic(bool italic = true) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY strikeOut() const = 0;
|
||||
virtual void XLAPIENTRY setStrikeOut(bool strikeOut = true) = 0;
|
||||
|
||||
virtual Color XLAPIENTRY color() const = 0;
|
||||
virtual void XLAPIENTRY setColor(Color color) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY bold() const = 0;
|
||||
virtual void XLAPIENTRY setBold(bool bold = true) = 0;
|
||||
|
||||
virtual Script XLAPIENTRY script() const = 0;
|
||||
virtual void XLAPIENTRY setScript(Script script) = 0;
|
||||
|
||||
virtual Underline XLAPIENTRY underline() const = 0;
|
||||
virtual void XLAPIENTRY setUnderline(Underline underline) = 0;
|
||||
|
||||
virtual const TCHAR* XLAPIENTRY name() const = 0;
|
||||
virtual bool XLAPIENTRY setName(const TCHAR* name) = 0;
|
||||
|
||||
virtual ~IFontT() {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,94 @@
|
||||
#ifndef LIBXL_IFORMATT_H
|
||||
#define LIBXL_IFORMATT_H
|
||||
|
||||
#include "setup.h"
|
||||
#include "enum.h"
|
||||
|
||||
namespace libxl {
|
||||
|
||||
template<class TCHAR> struct IFontT;
|
||||
|
||||
template<class TCHAR>
|
||||
struct IFormatT
|
||||
{
|
||||
virtual IFontT<TCHAR>* XLAPIENTRY font() const = 0;
|
||||
virtual bool XLAPIENTRY setFont(IFontT<TCHAR>* font) = 0;
|
||||
|
||||
virtual int XLAPIENTRY numFormat() const = 0;
|
||||
virtual void XLAPIENTRY setNumFormat(int numFormat) = 0;
|
||||
|
||||
virtual AlignH XLAPIENTRY alignH() const = 0;
|
||||
virtual void XLAPIENTRY setAlignH(AlignH align) = 0;
|
||||
|
||||
virtual AlignV XLAPIENTRY alignV() const = 0;
|
||||
virtual void XLAPIENTRY setAlignV(AlignV align) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY wrap() const = 0;
|
||||
virtual void XLAPIENTRY setWrap(bool wrap = true) = 0;
|
||||
|
||||
virtual int XLAPIENTRY rotation() const = 0;
|
||||
virtual bool XLAPIENTRY setRotation(int rotation) = 0;
|
||||
|
||||
virtual int XLAPIENTRY indent() const = 0;
|
||||
virtual void XLAPIENTRY setIndent(int indent) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY shrinkToFit() const = 0;
|
||||
virtual void XLAPIENTRY setShrinkToFit(bool shrinkToFit = true) = 0;
|
||||
|
||||
virtual void XLAPIENTRY setBorder(BorderStyle style = BORDERSTYLE_THIN) = 0;
|
||||
virtual void XLAPIENTRY setBorderColor(Color color) = 0;
|
||||
|
||||
virtual BorderStyle XLAPIENTRY borderLeft() const = 0;
|
||||
virtual void XLAPIENTRY setBorderLeft(BorderStyle style = BORDERSTYLE_THIN) = 0;
|
||||
|
||||
virtual BorderStyle XLAPIENTRY borderRight() const = 0;
|
||||
virtual void XLAPIENTRY setBorderRight(BorderStyle style = BORDERSTYLE_THIN) = 0;
|
||||
|
||||
virtual BorderStyle XLAPIENTRY borderTop() const = 0;
|
||||
virtual void XLAPIENTRY setBorderTop(BorderStyle style = BORDERSTYLE_THIN) = 0;
|
||||
|
||||
virtual BorderStyle XLAPIENTRY borderBottom() const = 0;
|
||||
virtual void XLAPIENTRY setBorderBottom(BorderStyle style = BORDERSTYLE_THIN) = 0;
|
||||
|
||||
virtual Color XLAPIENTRY borderLeftColor() const = 0;
|
||||
virtual void XLAPIENTRY setBorderLeftColor(Color color) = 0;
|
||||
|
||||
virtual Color XLAPIENTRY borderRightColor() const = 0;
|
||||
virtual void XLAPIENTRY setBorderRightColor(Color color) = 0;
|
||||
|
||||
virtual Color XLAPIENTRY borderTopColor() const = 0;
|
||||
virtual void XLAPIENTRY setBorderTopColor(Color color) = 0;
|
||||
|
||||
virtual Color XLAPIENTRY borderBottomColor() const = 0;
|
||||
virtual void XLAPIENTRY setBorderBottomColor(Color color) = 0;
|
||||
|
||||
virtual BorderDiagonal XLAPIENTRY borderDiagonal() const = 0;
|
||||
virtual void XLAPIENTRY setBorderDiagonal(BorderDiagonal border) = 0;
|
||||
|
||||
virtual BorderStyle XLAPIENTRY borderDiagonalStyle() const = 0;
|
||||
virtual void XLAPIENTRY setBorderDiagonalStyle(BorderStyle style) = 0;
|
||||
|
||||
virtual Color XLAPIENTRY borderDiagonalColor() const = 0;
|
||||
virtual void XLAPIENTRY setBorderDiagonalColor(Color color) = 0;
|
||||
|
||||
virtual FillPattern XLAPIENTRY fillPattern() const = 0;
|
||||
virtual void XLAPIENTRY setFillPattern(FillPattern pattern) = 0;
|
||||
|
||||
virtual Color XLAPIENTRY patternForegroundColor() const = 0;
|
||||
virtual void XLAPIENTRY setPatternForegroundColor(Color color) = 0;
|
||||
|
||||
virtual Color XLAPIENTRY patternBackgroundColor() const = 0;
|
||||
virtual void XLAPIENTRY setPatternBackgroundColor(Color color) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY locked() const = 0;
|
||||
virtual void XLAPIENTRY setLocked(bool locked = true) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY hidden() const = 0;
|
||||
virtual void XLAPIENTRY setHidden(bool hidden = true) = 0;
|
||||
|
||||
virtual ~IFormatT() {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,203 @@
|
||||
#ifndef LIBXL_ISHEETT_H
|
||||
#define LIBXL_ISHEETT_H
|
||||
|
||||
#include "setup.h"
|
||||
#include "enum.h"
|
||||
|
||||
namespace libxl
|
||||
{
|
||||
|
||||
template<class TCHAR> struct IFormatT;
|
||||
|
||||
template<class TCHAR>
|
||||
struct ISheetT
|
||||
{
|
||||
virtual CellType XLAPIENTRY cellType(int row, int col) const = 0;
|
||||
virtual bool XLAPIENTRY isFormula(int row, int col) const = 0;
|
||||
|
||||
virtual IFormatT<TCHAR>* XLAPIENTRY cellFormat(int row, int col) const = 0;
|
||||
virtual void XLAPIENTRY setCellFormat(int row, int col, IFormatT<TCHAR>* format) = 0;
|
||||
|
||||
virtual const TCHAR* XLAPIENTRY readStr(int row, int col, IFormatT<TCHAR>** format = 0) = 0;
|
||||
virtual bool XLAPIENTRY writeStr(int row, int col, const TCHAR* value, IFormatT<TCHAR>* format = 0) = 0;
|
||||
|
||||
virtual double XLAPIENTRY readNum(int row, int col, IFormatT<TCHAR>** format = 0) const = 0;
|
||||
virtual bool XLAPIENTRY writeNum(int row, int col, double value, IFormatT<TCHAR>* format = 0) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY readBool(int row, int col, IFormatT<TCHAR>** format = 0) const = 0;
|
||||
virtual bool XLAPIENTRY writeBool(int row, int col, bool value, IFormatT<TCHAR>* format = 0) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY readBlank(int row, int col, IFormatT<TCHAR>** format) const = 0;
|
||||
virtual bool XLAPIENTRY writeBlank(int row, int col, IFormatT<TCHAR>* format) = 0;
|
||||
|
||||
virtual const TCHAR* XLAPIENTRY readFormula(int row, int col, IFormatT<TCHAR>** format = 0) = 0;
|
||||
virtual bool XLAPIENTRY writeFormula(int row, int col, const TCHAR* value, IFormatT<TCHAR>* format = 0) = 0;
|
||||
|
||||
virtual const TCHAR* XLAPIENTRY readComment(int row, int col) const = 0;
|
||||
virtual void XLAPIENTRY writeComment(int row, int col, const TCHAR* value, const TCHAR* author = 0, int width = 129, int height = 75) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY isDate(int row, int col) const = 0;
|
||||
virtual ErrorType XLAPIENTRY readError(int row, int col) const = 0;
|
||||
|
||||
virtual double XLAPIENTRY colWidth(int col) const = 0;
|
||||
virtual double XLAPIENTRY rowHeight(int row) const = 0;
|
||||
|
||||
virtual bool XLAPIENTRY setCol(int colFirst, int colLast, double width, IFormatT<TCHAR>* format = 0, bool hidden = false) = 0;
|
||||
virtual bool XLAPIENTRY setRow(int row, double height, IFormatT<TCHAR>* format = 0, bool hidden = false) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY rowHidden(int row) const = 0;
|
||||
virtual bool XLAPIENTRY setRowHidden(int row, bool hidden) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY colHidden(int col) const = 0;
|
||||
virtual bool XLAPIENTRY setColHidden(int col, bool hidden) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY getMerge(int row, int col, int* rowFirst, int* rowLast, int* colFirst, int* colLast) = 0;
|
||||
virtual bool XLAPIENTRY setMerge(int rowFirst, int rowLast, int colFirst, int colLast) = 0;
|
||||
virtual bool XLAPIENTRY delMerge(int row, int col) = 0;
|
||||
|
||||
virtual int XLAPIENTRY mergeSize() const = 0;
|
||||
virtual bool XLAPIENTRY merge(int index, int* rowFirst, int* rowLast, int* colFirst, int* colLast) = 0;
|
||||
virtual bool XLAPIENTRY delMergeByIndex(int index) = 0;
|
||||
|
||||
virtual int XLAPIENTRY pictureSize() const = 0;
|
||||
virtual int XLAPIENTRY getPicture(int index, int* rowTop = 0, int* colLeft = 0, int* rowBottom = 0, int* colRight = 0,
|
||||
int* width = 0, int* height = 0, int* offset_x = 0, int* offset_y = 0) const = 0;
|
||||
|
||||
virtual void XLAPIENTRY setPicture(int row, int col, int pictureId, double scale = 1.0, int offset_x = 0, int offset_y = 0, Position pos = POSITION_MOVE_AND_SIZE) = 0;
|
||||
virtual void XLAPIENTRY setPicture2(int row, int col, int pictureId, int width = -1, int height = -1, int offset_x = 0, int offset_y = 0, Position pos = POSITION_MOVE_AND_SIZE) = 0;
|
||||
|
||||
virtual int XLAPIENTRY getHorPageBreak(int index) const = 0;
|
||||
virtual int XLAPIENTRY getHorPageBreakSize() const = 0;
|
||||
|
||||
virtual int XLAPIENTRY getVerPageBreak(int index) const = 0;
|
||||
virtual int XLAPIENTRY getVerPageBreakSize() const = 0;
|
||||
|
||||
virtual bool XLAPIENTRY setHorPageBreak(int row, bool pageBreak = true) = 0;
|
||||
virtual bool XLAPIENTRY setVerPageBreak(int col, bool pageBreak = true) = 0;
|
||||
|
||||
virtual void XLAPIENTRY split(int row, int col) = 0;
|
||||
virtual bool XLAPIENTRY splitInfo(int* row, int* col) const = 0;
|
||||
|
||||
virtual bool XLAPIENTRY groupRows(int rowFirst, int rowLast, bool collapsed = true) = 0;
|
||||
virtual bool XLAPIENTRY groupCols(int colFirst, int colLast, bool collapsed = true) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY groupSummaryBelow() const = 0;
|
||||
virtual void XLAPIENTRY setGroupSummaryBelow(bool below) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY groupSummaryRight() const = 0;
|
||||
virtual void XLAPIENTRY setGroupSummaryRight(bool right) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY clear(int rowFirst = 0, int rowLast = 1048575, int colFirst = 0, int colLast = 16383) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY insertCol(int colFirst, int colLast) = 0;
|
||||
virtual bool XLAPIENTRY insertRow(int rowFirst, int rowLast) = 0;
|
||||
virtual bool XLAPIENTRY removeCol(int colFirst, int colLast) = 0;
|
||||
virtual bool XLAPIENTRY removeRow(int rowFirst, int rowLast) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY copyCell(int rowSrc, int colSrc, int rowDst, int colDst) = 0;
|
||||
|
||||
virtual int XLAPIENTRY firstRow() const = 0;
|
||||
virtual int XLAPIENTRY lastRow() const = 0;
|
||||
virtual int XLAPIENTRY firstCol() const = 0;
|
||||
virtual int XLAPIENTRY lastCol() const = 0;
|
||||
|
||||
virtual bool XLAPIENTRY displayGridlines() const = 0;
|
||||
virtual void XLAPIENTRY setDisplayGridlines(bool show = true) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY printGridlines() const = 0;
|
||||
virtual void XLAPIENTRY setPrintGridlines(bool print = true) = 0;
|
||||
|
||||
virtual int XLAPIENTRY zoom() const = 0;
|
||||
virtual void XLAPIENTRY setZoom(int zoom) = 0;
|
||||
|
||||
virtual int XLAPIENTRY printZoom() const = 0;
|
||||
virtual void XLAPIENTRY setPrintZoom(int zoom) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY getPrintFit(int* wPages, int* hPages) const = 0;
|
||||
virtual void XLAPIENTRY setPrintFit(int wPages = 1, int hPages = 1) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY landscape() const = 0;
|
||||
virtual void XLAPIENTRY setLandscape(bool landscape = true) = 0;
|
||||
|
||||
virtual Paper XLAPIENTRY paper() const = 0;
|
||||
virtual void XLAPIENTRY setPaper(Paper paper = PAPER_DEFAULT) = 0;
|
||||
|
||||
virtual const TCHAR* XLAPIENTRY header() const = 0;
|
||||
virtual bool XLAPIENTRY setHeader(const TCHAR* header, double margin = 0.5) = 0;
|
||||
virtual double XLAPIENTRY headerMargin() const = 0;
|
||||
|
||||
virtual const TCHAR* XLAPIENTRY footer() const = 0;
|
||||
virtual bool XLAPIENTRY setFooter(const TCHAR* footer, double margin = 0.5) = 0;
|
||||
virtual double XLAPIENTRY footerMargin() const = 0;
|
||||
|
||||
virtual bool XLAPIENTRY hCenter() const = 0;
|
||||
virtual void XLAPIENTRY setHCenter(bool hCenter = true) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY vCenter() const = 0;
|
||||
virtual void XLAPIENTRY setVCenter(bool vCenter = true) = 0;
|
||||
|
||||
virtual double XLAPIENTRY marginLeft() const = 0;
|
||||
virtual void XLAPIENTRY setMarginLeft(double margin) = 0;
|
||||
|
||||
virtual double XLAPIENTRY marginRight() const = 0;
|
||||
virtual void XLAPIENTRY setMarginRight(double margin) = 0;
|
||||
|
||||
virtual double XLAPIENTRY marginTop() const = 0;
|
||||
virtual void XLAPIENTRY setMarginTop(double margin) = 0;
|
||||
|
||||
virtual double XLAPIENTRY marginBottom() const = 0;
|
||||
virtual void XLAPIENTRY setMarginBottom(double margin) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY printRowCol() const = 0;
|
||||
virtual void XLAPIENTRY setPrintRowCol(bool print = true) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY printRepeatRows(int* rowFirst, int* rowLast) = 0;
|
||||
virtual void XLAPIENTRY setPrintRepeatRows(int rowFirst, int rowLast) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY printRepeatCols(int* colFirst, int* colLast) = 0;
|
||||
virtual void XLAPIENTRY setPrintRepeatCols(int colFirst, int colLast) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY printArea(int* rowFirst, int* rowLast, int* colFirst, int* colLast) = 0;
|
||||
virtual void XLAPIENTRY setPrintArea(int rowFirst, int rowLast, int colFirst, int colLast) = 0;
|
||||
|
||||
virtual void XLAPIENTRY clearPrintRepeats() = 0;
|
||||
virtual void XLAPIENTRY clearPrintArea() = 0;
|
||||
|
||||
virtual bool XLAPIENTRY getNamedRange(const TCHAR* name, int* rowFirst, int* rowLast, int* colFirst, int* colLast, int scopeId = SCOPE_UNDEFINED, bool* hidden = 0) = 0;
|
||||
virtual bool XLAPIENTRY setNamedRange(const TCHAR* name, int rowFirst, int rowLast, int colFirst, int colLast, int scopeId = SCOPE_UNDEFINED) = 0;
|
||||
virtual bool XLAPIENTRY delNamedRange(const TCHAR* name, int scopeId = SCOPE_UNDEFINED) = 0;
|
||||
|
||||
virtual int XLAPIENTRY namedRangeSize() const = 0;
|
||||
virtual const TCHAR* XLAPIENTRY namedRange(int index, int* rowFirst, int* rowLast, int* colFirst, int* colLast, int* scopeId = 0, bool* hidden = 0) = 0;
|
||||
|
||||
virtual int XLAPIENTRY hyperlinkSize() const = 0;
|
||||
virtual const TCHAR* XLAPIENTRY hyperlink(int index, int* rowFirst, int* rowLast, int* colFirst, int* colLast) = 0;
|
||||
virtual bool XLAPIENTRY delHyperlink(int index) = 0;
|
||||
virtual void XLAPIENTRY addHyperlink(const TCHAR* hyperlink, int rowFirst, int rowLast, int colFirst, int colLast) = 0;
|
||||
|
||||
virtual const TCHAR* XLAPIENTRY name() const = 0;
|
||||
virtual void XLAPIENTRY setName(const TCHAR* name) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY protect() const = 0;
|
||||
virtual void XLAPIENTRY setProtect(bool protect = true) = 0;
|
||||
|
||||
virtual SheetState XLAPIENTRY hidden() const = 0;
|
||||
virtual bool XLAPIENTRY setHidden(SheetState state = SHEETSTATE_HIDDEN) = 0;
|
||||
|
||||
virtual void XLAPIENTRY getTopLeftView(int* row, int* col) const = 0;
|
||||
virtual void XLAPIENTRY setTopLeftView(int row, int col) = 0;
|
||||
|
||||
virtual bool XLAPIENTRY rightToLeft() const = 0;
|
||||
virtual void XLAPIENTRY setRightToLeft(bool rightToLeft = true) = 0;
|
||||
|
||||
virtual void XLAPIENTRY setAutoFitArea(int rowFirst = 0, int colFirst = 0, int rowLast = -1, int colLast = -1) = 0;
|
||||
|
||||
virtual void XLAPIENTRY addrToRowCol(const TCHAR* addr, int* row, int* col, bool* rowRelative = 0, bool* colRelative = 0) = 0;
|
||||
virtual const TCHAR* XLAPIENTRY rowColToAddr(int row, int col, bool rowRelative = true, bool colRelative = true) = 0;
|
||||
|
||||
virtual ~ISheetT() {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,31 @@
|
||||
#ifndef LIBXL_CPP_H
|
||||
#define LIBXL_CPP_H
|
||||
|
||||
#define LIBXL_VERSION 0x03060500
|
||||
|
||||
#include "IBookT.h"
|
||||
#include "ISheetT.h"
|
||||
#include "IFormatT.h"
|
||||
#include "IFontT.h"
|
||||
|
||||
namespace libxl {
|
||||
|
||||
#ifdef _UNICODE
|
||||
typedef IBookT<wchar_t> Book;
|
||||
typedef ISheetT<wchar_t> Sheet;
|
||||
typedef IFormatT<wchar_t> Format;
|
||||
typedef IFontT<wchar_t> Font;
|
||||
#define xlCreateBook xlCreateBookW
|
||||
#define xlCreateXMLBook xlCreateXMLBookW
|
||||
#else
|
||||
typedef IBookT<char> Book;
|
||||
typedef ISheetT<char> Sheet;
|
||||
typedef IFormatT<char> Format;
|
||||
typedef IFontT<char> Font;
|
||||
#define xlCreateBook xlCreateBookA
|
||||
#define xlCreateXMLBook xlCreateXMLBookA
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,674 @@
|
||||
/* DISABLE check_long_lines */
|
||||
|
||||
/*
|
||||
* $Header: security_src/public/nzerror.h /st_ldap_db11.2/1 2009/07/15 13:57:04 rchahal Exp $
|
||||
*
|
||||
* Copyright (c) 1995, 2009, Oracle and/or its affiliates.
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
/* ENABLE check_long_lines */
|
||||
/*
|
||||
NAME
|
||||
nzerror.h - error numbers for the Oracle Security Server
|
||||
DESCRIPTION
|
||||
None.
|
||||
PUBLIC FUNCTION(S)
|
||||
None.
|
||||
PRIVATE FUNCTION(S)
|
||||
None.
|
||||
NOTES
|
||||
A pragma is used to silence olint about the enum value names not being
|
||||
unique within 7 characters. This limit is being changed to 30.
|
||||
MODIFIED
|
||||
rchahal 06/12/06 -
|
||||
skalyana 01/30/05 -
|
||||
rchahal 07/16/04 - add cert label
|
||||
rchahal 07/06/04 -
|
||||
rchahal 10/15/03 - bug 2513821
|
||||
rchahal 08/14/03 - new error range (43000 - 43499)
|
||||
skalyana 08/25/03 - Error changes
|
||||
rchahal 06/27/03 - RSA errors
|
||||
rchahal 05/27/03 - convert wallet
|
||||
skalyana 03/07/03 - Move FIPS errors
|
||||
rchahal 02/28/03 - bug 2648177
|
||||
rchahal 01/20/03 - use sltsky
|
||||
rchahal 11/11/02 - pkcs11 support
|
||||
skalyana 11/29/02 - Add mutex errors
|
||||
akoyfman 11/01/02 - adding crl cache
|
||||
rchahal 10/23/02 - crldp error
|
||||
rchahal 10/15/02 - fetch crl from ldap
|
||||
rchahal 10/07/02 - crl support
|
||||
akoyfman 10/16/02 - Update with SSL PLus 4.2 errors
|
||||
skalyana 10/04/02 - Certicom SSL Plus 4.2 Upgrade changes
|
||||
akoyfman 08/06/02 - adding sso wallet errors
|
||||
akoyfman 07/12/02 - adding secret store errors
|
||||
skalyana 07/07/02 - Add more errors for FIPS self tests
|
||||
skalyana 07/01/02 - Add more errors
|
||||
skalyana 06/03/02 - Add NZ error for self test failure.
|
||||
ajacobs 02/22/01 - Add some entrust errors
|
||||
vle 02/09/01 - add error mesg
|
||||
lkethana 08/11/00 - Extension Errors
|
||||
lkethana 07/30/00 - add pkcs12 errors
|
||||
lkethana 06/17/00 - mult cert errors
|
||||
lkethana 06/11/00 - multiple cert support
|
||||
rturlapa 03/29/00 - Add error meesage for Entrust Login failure.
|
||||
rwessman 07/07/99 - Deleted include of sslerrs.h. It caused the RDBMS bu
|
||||
rwessman 07/02/99 - fixed merge errors
|
||||
rwessman 07/01/99 - moved NZOS errors to nzerror to make them visible
|
||||
supriya 12/16/98 - add new error for cert chain.
|
||||
arswamin 12/04/98 - add NZERROR_NO_MATCHING_PRIVATE_KEY
|
||||
qdinh 11/12/98 - add NZERROR_VALIDITY_EXPIRED.
|
||||
arswamin 06/17/98 - add INIT_FAILED
|
||||
sdange 06/10/98 - change wrong password to bad password
|
||||
amthakur 06/09/98 - adding error messages
|
||||
wliau 03/10/97 - Add new error message for snzdfo.c.
|
||||
rwessman 03/14/97 - Consolidated PL/SQL toolkit errors into generic erro
|
||||
rwessman 02/26/97 - Added NZERROR_UNSUPPORTED. Corrected values of
|
||||
errors outside the valid range.
|
||||
asriniva 03/02/97 - Fix olint warning
|
||||
rwessman 02/26/97 - Added NZERROR_UNSUPPORTED
|
||||
rwessman 01/02/97 - Changed PLSQL package errors to be TK_PLSQL to
|
||||
separate them from the errors generated by the
|
||||
Oracle interface.
|
||||
rwessman 12/30/96 - Merged in PL/SQL toolkit errors
|
||||
sdange 11/14/96 - (Added NZERROR_DECRYPT_FAILED to the enum list)
|
||||
rwessman 12/02/96 -
|
||||
rwessman 11/25/96 - Added error messages for PL/SQL functions.
|
||||
asriniva 10/31/96 - Include oratypes.h
|
||||
asriniva 10/29/96 - Fix numbering.
|
||||
asriniva 10/29/96 - Fix error numbers
|
||||
asriniva 10/29/96 - Correct type-o
|
||||
asriniva 10/28/96 - Add more TK errors
|
||||
asriniva 10/28/96 - Convert OKAPI errors to TK errors.
|
||||
rwessman 10/17/96 - still more OSS TK errors
|
||||
asriniva 10/16/96 - OKAPI errors
|
||||
asriniva 10/15/96 - OSSTK errors
|
||||
rwessman 10/15/96 - Added more OSS TK errors
|
||||
asriniva 10/09/96 - Add OSSTK errors.
|
||||
rwessman 09/05/96 - Added errors for PL/SQL functions.
|
||||
wliau 09/05/96 - correct error numbers.
|
||||
$Log: $
|
||||
* Revision 1.26 1996/07/15 23:07:23 wliau
|
||||
* Added NZERROR_AUTH_SHARED_MEMORY
|
||||
*
|
||||
* Revision 1.25 1996/07/01 20:40:15 asriniva
|
||||
* Finished RSA verify/sign.
|
||||
*
|
||||
* Revision 1.24 1996/06/27 20:39:41 rwessman
|
||||
* Added more errors.
|
||||
*
|
||||
* Revision 1.23 1996/05/31 17:33:40 rwessman
|
||||
* Updated nzerror.h to contain bug # for olint enum bug.
|
||||
*
|
||||
* Revision 1.22 1996/05/31 17:12:30 rwessman
|
||||
* Assigned values to the various errors.
|
||||
*
|
||||
* Revision 1.21 1996/05/13 20:46:58 ggilchri
|
||||
* Added more attribute related error conditions
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef NZERROR_ORACLE
|
||||
# define NZERROR_ORACLE
|
||||
|
||||
#ifndef ORATYPES
|
||||
# include <oratypes.h>
|
||||
#endif /* ORATYPES */
|
||||
|
||||
/*
|
||||
** Errors - when an error is added here, a message corresponding to the
|
||||
** error number must be added to the message file.
|
||||
** New errors must be assigned numbers, otherwise the compiler can assign any
|
||||
** value that it wants, which may lead to invalid error numbers being
|
||||
** generated.
|
||||
** The number range currently assigned to the OSS is 28750 - 29249
|
||||
** New number range 43000 - 43499
|
||||
*/
|
||||
|
||||
typedef enum nzerror
|
||||
{
|
||||
NZERROR_OK = 0,
|
||||
NZERROR_GENERIC = 28750, /* A catchall for errors */
|
||||
NZERROR_NO_MEMORY = 28751, /* No more memory */
|
||||
NZERROR_DATA_SOURCE_INIT_FAILED = 28752, /* Failed to init data source */
|
||||
NZERROR_DATA_SOURCE_TERM_FAILED = 28753,/* Failed to terminate data source */
|
||||
NZERROR_OBJECT_STORE_FAILED = 28754, /* Store object in data source failed */
|
||||
NZERROR_OBJECT_GET_FAILED = 28755,
|
||||
/* Failed to obtain object from data source */
|
||||
NZERROR_MEMORY_ALLOC_FAILED = 28756,
|
||||
/* Callback failed to allocate memory */
|
||||
NZERROR_MEMORY_ALLOC_0_BYTES = 28757,
|
||||
/* Attempted to ask for 0 bytes of memory */
|
||||
NZERROR_MEMORY_FREE_FAILED = 28758,
|
||||
/* Callback failed to free memory */
|
||||
NZERROR_FILE_OPEN_FAILED = 28759,
|
||||
/* Open of file failed */
|
||||
NZERROR_LIST_CREATION_FAILED = 28760,
|
||||
/* Creation of list failed */
|
||||
NZERROR_NO_ELEMENT = 28761,
|
||||
/* No list element found */
|
||||
NZERROR_ELEMENT_ADD_FAILED = 28762,
|
||||
/* Addition of list element failed */
|
||||
NZERROR_PARAMETER_BAD_TYPE = 28763,
|
||||
/* Retrieval of an unknown parameter type */
|
||||
NZERROR_PARAMETER_RETRIEVAL = 28764, /* Retrieval of parameter failed */
|
||||
|
||||
NZERROR_NO_LIST = 28765, /* Data method list does not exist */
|
||||
NZERROR_TERMINATE_FAIL = 28766, /* Failed to terminate */
|
||||
NZERROR_BAD_VERSION_NUMBER = 28767, /* Bad version number */
|
||||
NZERROR_BAD_MAGIC_NUMBER = 28768, /* Bad magic number */
|
||||
NZERROR_METHOD_NOT_FOUND = 28769,
|
||||
/* Data retrieval method specified does not exist */
|
||||
NZERROR_ALREADY_INITIALIZED = 28770,
|
||||
/*The data source is already initialized */
|
||||
NZERROR_NOT_INITIALIZED = 28771, /* The data source is not initialized */
|
||||
NZERROR_BAD_FILE_ID = 28772, /* File ID is bad */
|
||||
NZERROR_WRITE_MAGIC_VERSION = 28773, /* Failed to write magic and version */
|
||||
NZERROR_FILE_WRITE_FAILED = 28774, /* Failed to write to file */
|
||||
NZERROR_FILE_CLOSE_FAILED = 28775, /* Failed to close file */
|
||||
NZERROR_OUTPUT_BUFFER_TOO_SMALL = 28776,
|
||||
/* The buffer supplied by the caller is too small */
|
||||
NZERROR_BINDING_CREATION_FAILED = 28777,/* NL failed in creating a binding */
|
||||
NZERROR_PARAMETER_MALFORMED = 28778, /* A parameter was in a bad format */
|
||||
NZERROR_PARAMETER_NO_METHOD = 28779,
|
||||
/* No method was specified for a data type */
|
||||
NZERROR_BAD_PARAMETER_METHOD = 28780, /* Illegal method for data type */
|
||||
NZERROR_PARAMETER_NO_DATA = 28781, /* No method specified when required */
|
||||
NZERROR_NOT_ALLOCATED = 28782, /* Data source is not allocated */
|
||||
NZERROR_INVALID_PARAMETER = 28783, /* Invalid parameter name */
|
||||
NZERROR_FILE_NAME_TRANSLATION = 28784,/* Could not translate OSD file name */
|
||||
NZERROR_NO_SUCH_PARAMETER = 28785, /* Selected parameter is non-existent */
|
||||
|
||||
NZERROR_DECRYPT_FAILED = 28786,
|
||||
/* Encrypted private key decryption failure */
|
||||
NZERROR_ENCRYPT_FAILED = 28787, /* Private key encryption failed */
|
||||
|
||||
NZERROR_INVALID_INPUT = 28788, /* Incorrect input or unknown error */
|
||||
|
||||
NZERROR_NAME_TYPE_NOT_FOUND = 28789,
|
||||
/* Type of name requested is not available */
|
||||
NZERROR_NLS_STRING_OPEN_FAILED = 28790,
|
||||
/* Failure to generate an NLS string */
|
||||
NZERROR_CERTIFICATE_VERIFY = 28791, /* Failed to verify a certificate */
|
||||
NZERROR_OCI_PLSQL_FAILED = 28792,
|
||||
/* an OCI call to process some plsql failed */
|
||||
NZERROR_OCI_BIND_FAILED = 28793,
|
||||
/* an OCI call to bind an internal var. failed */
|
||||
NZERROR_ATTRIBUTE_INIT = 28794, /* failed to init role retrieval */
|
||||
NZERROR_ATTRIBUTE_FINISH_FAILED = 28795,/* Did not complete role retrieval */
|
||||
NZERROR_UNSUPPORTED_METHOD = 28796, /* Data method specified not supported */
|
||||
NZERROR_INVALID_KEY_DATA_TYPE = 28797,
|
||||
/* Invalid data type specified for key */
|
||||
NZEROR_BIND_SUBKEY_COUNT = 28798,
|
||||
/* Number of sub-keys to bind does not match count in initialized key */
|
||||
NZERROR_AUTH_SHARED_MEMORY = 28799,
|
||||
/* Failed to retreieve authentication information from the shared memory */
|
||||
NZERROR_RIO_OPEN = 28800, /* RIO Open Failed */
|
||||
NZERROR_RIO_OBJECT_TYPE = 28801, /* RIO object type invalid */
|
||||
NZERROR_RIO_MODE = 28802, /* RIO mode invalid */
|
||||
NZERROR_RIO_IO = 28803, /* RIO io set or numberinvalid */
|
||||
NZERROR_RIO_CLOSE = 28804, /* RIO close failed */
|
||||
NZERROR_RIO_RETRIEVE = 28805, /* RIO retrieve failed */
|
||||
NZERROR_RIO_STORE = 28806, /* RIO store failed */
|
||||
NZERROR_RIO_UPDATE = 28807, /* RIO update failed */
|
||||
NZERROR_RIO_INFO = 28808, /* RIO info failed */
|
||||
NZERROR_RIO_DELETE = 28809, /* RIO delete failed */
|
||||
NZERROR_KD_CREATE = 28810, /* Key descriptor create failed */
|
||||
NZERROR_RIO_ACCESS_DESCRIPTOR = 28811, /* access descriptor invalid */
|
||||
NZERROR_RIO_RECORD = 28812, /* record invalid */
|
||||
NZERROR_RIO_RECORD_TYPE = 28813, /* record type and AD type not matched */
|
||||
NZERROR_PLSQL_ORACLE_TO_REAL = 28814,
|
||||
/* A number passed to PL/SQL could not be converted to real format */
|
||||
NZERROR_PLSQL_REAL_TO_ORACLE = 28815,
|
||||
/* A number in machine format could not be converted to Oracle format */
|
||||
NZERROR_TK_PLSQL_NO_PASSWORD = 28816,
|
||||
/* A password was not provided to a PL/SQL function */
|
||||
NZERROR_TK_PLSQL_GENERIC = 28817,
|
||||
/* A PL/SQL function returned an error */
|
||||
NZERROR_TK_PLSQL_NO_CONTEXT = 28818,
|
||||
/* The package context was not specified to a PL/SQL function */
|
||||
NZERROR_TK_PLSQL_NO_DIST_NAME = 28819,
|
||||
/* The user's distinguished name was not provided to a PL/SQL function */
|
||||
NZERROR_TK_PLSQL_NO_STATE = 28820,
|
||||
/* The state of either a signature or decryption/encryption was not provided */
|
||||
NZERROR_TK_PLSQL_NO_INPUT = 28821,
|
||||
/* An input buffer was specified to a PL/SQL function */
|
||||
NZERROR_TK_PLSQL_NO_SEED = 28822,
|
||||
/* No seed was specified to the PL/SQL seed initialization function */
|
||||
NZERROR_TK_PLSQL_NO_BYTES = 28823,
|
||||
/* Number of bytes was not specified to the PL/SQL random number generator */
|
||||
NZERROR_TK_INVALID_STATE = 28824,
|
||||
/* Invalid encryption/decryption/signature state passed */
|
||||
NZERROR_TK_PLSQL_NO_ENG_FUNC = 28825,
|
||||
/* No crypto engine function was passed in */
|
||||
NZERROR_TK_INV_ENG_FUNC = 28826,
|
||||
/* An invalid crypto engine function was passed in */
|
||||
NZERROR_TK_INV_CIPHR_TYPE = 28827,
|
||||
/* An invalid cipher type was passed in */
|
||||
NZERROR_TK_INV_IDENT_TYPE = 28828,
|
||||
/* An invalid identity type was specified */
|
||||
NZERROR_TK_PLSQL_NO_CIPHER_TYPE = 28829,
|
||||
/* No cipher type was specified */
|
||||
NZERROR_TK_PLSQL_NO_IDENT_TYPE = 28830,
|
||||
/* No identity type was specified */
|
||||
NZERROR_TK_PLSQL_NO_DATA_FMT = 28831,
|
||||
/* No data unit format was specified */
|
||||
NZERROR_TK_INV_DATA_FMT = 28832,
|
||||
/* Invalid data unit format was provided to function */
|
||||
NZERROR_TK_PLSQL_INSUFF_INFO = 28833,
|
||||
/* Not enough info (usually parameters) provided to a PL/SQL function */
|
||||
NZERROR_TK_PLSQL_BUF_TOO_SMALL = 28834,
|
||||
/* Buffer provided by PL/SQL is too small for data to be returned */
|
||||
NZERROR_TK_PLSQL_INV_IDENT_DESC = 28835,
|
||||
/* Identity descriptor not present or too small */
|
||||
NZERROR_TK_PLSQL_WALLET_NOTOPEN = 28836,
|
||||
/* Wallet has not been opened yet */
|
||||
NZERROR_TK_PLSQL_NO_WALLET = 28837,
|
||||
/* No wallet descriptor specified to PL/SQL function */
|
||||
NZERROR_TK_PLSQL_NO_IDENTITY = 28838,
|
||||
/* No identity descriptor specified to PL/SQL function */
|
||||
NZERROR_TK_PLSQL_NO_PERSONA = 28839,
|
||||
/* No persona descriptor was specified to PL/SQL function */
|
||||
NZERROR_TK_PLSQL_WALLET_OPEN = 28840,
|
||||
/* Wallet was already opened */
|
||||
NZERROR_UNSUPPORTED = 28841, /* Operation is not supported */
|
||||
NZERROR_FILE_BAD_PERMISSION = 28842, /* Bad file permission specified */
|
||||
NZERROR_FILE_OSD_ERROR = 28843, /* OSD error when opening file */
|
||||
NZERROR_NO_WALLET = 28844, /* cert + privkey + tp files do not exist */
|
||||
NZERROR_NO_CERTIFICATE_ALERT = 28845, /* no certificate */
|
||||
NZERROR_NO_PRIVATE_KEY = 28846, /* no private-key */
|
||||
NZERROR_NO_CLEAR_PRIVATE_KEY_FILE = 28847, /* no clear key-file */
|
||||
NZERROR_NO_ENCRYPTED_PRIVATE_KEY_FILE = 28848, /* no encrypted priv key */
|
||||
NZERROR_NO_TRUSTPOINTS = 28849, /* no trustpoints */
|
||||
NZERROR_NO_CLEAR_TRUSTPOINT_FILE = 28850, /* no clear trustpoints */
|
||||
NZERROR_NO_ENCRYPTED_TRUSTPOINT_FILE = 28851, /* no encrypted trustpoints */
|
||||
NZERROR_BAD_PASSWORD = 28852, /* bad password */
|
||||
NZERROR_INITIALIZATION_FAILED = 28853, /* init failed or
|
||||
module loading failed */
|
||||
/******************************* SSL ERRORS ********************************/
|
||||
/*
|
||||
* In order to allow SSL errors to be mapped to Oracle errors, space is
|
||||
* provided here. One Oracle error is provided for each SSL error to make
|
||||
* error handling easier. A macro is provided to do the conversion.
|
||||
* NOTE: ANY CHANGE IN SSL ERRORS MUST BE REFLECTED HERE.
|
||||
* To add an SSL error, use the following formula to calculate the Oracle
|
||||
* error:
|
||||
* new_oracle_error = (new_ssl_error - SSLMemoryError) + NZERROR_SSLMemoryErr
|
||||
* or numerically:
|
||||
* new_oracle_error = (new_ssl_error - -7000) + 28854
|
||||
*/
|
||||
NZERROR_SSLMemoryErr = 28854,
|
||||
NZERROR_SSLUnsupportedErr = 28855,
|
||||
NZERROR_SSLOverflowErr = 28856,
|
||||
NZERROR_SSLUnknownErr = 28857,
|
||||
NZERROR_SSLProtocolErr = 28858,
|
||||
NZERROR_SSLNegotiationErr = 28859,
|
||||
NZERROR_SSLFatalAlert = 28860,
|
||||
NZERROR_SSLWouldBlockErr = 28861,
|
||||
NZERROR_SSLIOErr = 28862,
|
||||
NZERROR_SSLSessionNotFoundErr = 28863,
|
||||
NZERROR_SSLConnectionClosedGraceful = 28864,
|
||||
NZERROR_SSLConnectionClosedError = 28865,
|
||||
NZERROR_ASNBadEncodingErr = 28866,
|
||||
NZERROR_ASNIntegerTooBigErr = 28867,
|
||||
NZERROR_X509CertChainInvalidErr = 28868,
|
||||
NZERROR_X509CertExpiredErr = 28869,
|
||||
NZERROR_X509NamesNotEqualErr = 28870,
|
||||
NZERROR_X509CertChainIncompleteErr = 28871,
|
||||
NZERROR_X509DataNotFoundErr = 28872,
|
||||
NZERROR_SSLBadParameterErr = 28873,
|
||||
NZERROR_SSLIOClosedOverrideGoodbyeKiss = 28874,
|
||||
NZERROR_X509MozillaSGCErr = 28875,
|
||||
NZERROR_X509IESGCErr = 28876,
|
||||
NZERROR_ImproperServerCredentials = 28877,
|
||||
NZERROR_ImproperClientCredentials = 28878,
|
||||
NZERROR_NoProtocolSideSet = 28879,
|
||||
NZERROR_setPersonaFailed = 28880,
|
||||
NZERROR_setCertFailed = 28881,
|
||||
NZERROR_setVKeyFailed = 28882,
|
||||
NZERROR_setTPFailed = 28883,
|
||||
NZERROR_BadCipherSuite = 28884,
|
||||
NZERROR_NoKeyPairForKeyUsage = 28885,
|
||||
|
||||
/* ============>>> ENTRUST ERRORS */
|
||||
NZERROR_EntrustLoginFailed = 28890,
|
||||
NZERROR_EntrustGetInfoFailed = 28891,
|
||||
NZERROR_EntrustLoadCertificateFailed = 28892,
|
||||
NZERROR_EntrustGetNameFailed = 28893,
|
||||
|
||||
/* ============>>> NZERRORS CONTINUED */
|
||||
NZERROR_CertNotInstalled = 29000,
|
||||
NZERROR_ServerDNMisMatched = 29002,
|
||||
NZERROR_ServerDNMisConfigured = 29003,
|
||||
|
||||
/* ============>>> PKI VENDORS ERRORS 29050 - 29099 */
|
||||
|
||||
/* ============>>> SSL Errors CONTINUED */
|
||||
NZERROR_CIC_ERR_SSL_ALERT_CB_FAILURE = 29004,
|
||||
NZERROR_CIC_ERR_SSL_BAD_CERTIFICATE = 29005,
|
||||
NZERROR_CIC_ERR_SSL_BAD_CERTIFICATE_REQUEST = 29006,
|
||||
NZERROR_CIC_ERR_SSL_BAD_CLEAR_KEY_LEN = 29007,
|
||||
NZERROR_CIC_ERR_SSL_BAD_DHPARAM_KEY_LENGTH = 29008,
|
||||
NZERROR_CIC_ERR_SSL_BAD_ENCRYPTED_KEY_LEN = 29009,
|
||||
NZERROR_CIC_ERR_SSL_BAD_EXPORT_KEY_LENGTH = 29010,
|
||||
NZERROR_CIC_ERR_SSL_BAD_FINISHED_MESSAGE = 29011,
|
||||
NZERROR_CIC_ERR_SSL_BAD_KEY_ARG_LEN = 29012,
|
||||
NZERROR_CIC_ERR_SSL_BAD_MAC = 29013,
|
||||
NZERROR_CIC_ERR_SSL_BAD_MAX_FRAGMENT_LENGTH_EXTENSION = 29014,
|
||||
NZERROR_CIC_ERR_SSL_BAD_MESSAGE_LENGTH = 29015,
|
||||
NZERROR_CIC_ERR_SSL_BAD_PKCS1_PADDING = 29016,
|
||||
NZERROR_CIC_ERR_SSL_BAD_PREMASTER_SECRET_LENGTH = 29017,
|
||||
NZERROR_CIC_ERR_SSL_BAD_PREMASTER_SECRET_VERSION = 29018,
|
||||
NZERROR_CIC_ERR_SSL_BAD_PROTOCOL_VERSION = 29019,
|
||||
NZERROR_CIC_ERR_SSL_BAD_RECORD_LENGTH = 29020,
|
||||
NZERROR_CIC_ERR_SSL_BAD_SECRET_KEY_LEN = 29021,
|
||||
NZERROR_CIC_ERR_SSL_BAD_SIDE = 29022,
|
||||
NZERROR_CIC_ERR_SSL_BUFFERS_NOT_EMPTY = 29023,
|
||||
NZERROR_CIC_ERR_SSL_CERTIFICATE_VALIDATE_FAILED = 29024,
|
||||
NZERROR_CIC_ERR_SSL_CERT_CHECK_CALLBACK = 29025,
|
||||
NZERROR_CIC_ERR_SSL_DECRYPT_FAILED = 29026,
|
||||
NZERROR_CIC_ERR_SSL_ENTROPY_COLLECTION = 29027,
|
||||
NZERROR_CIC_ERR_SSL_FAIL_SERVER_VERIFY = 29028,
|
||||
NZERROR_CIC_ERR_SSL_HANDSHAKE_ALREADY_COMPLETED = 29029,
|
||||
NZERROR_CIC_ERR_SSL_HANDSHAKE_REQUESTED = 29030,
|
||||
NZERROR_CIC_ERR_SSL_HANDSHAKE_REQUIRED = 29031,
|
||||
NZERROR_CIC_ERR_SSL_INCOMPLETE_IDENTITY = 29032,
|
||||
NZERROR_CIC_ERR_SSL_INVALID_PFX = 29033,
|
||||
NZERROR_CIC_ERR_SSL_NEEDS_CIPHER_OR_CLIENTAUTH = 29034,
|
||||
NZERROR_CIC_ERR_SSL_NEEDS_PRNG = 29035,
|
||||
NZERROR_CIC_ERR_SSL_NOT_SUPPORTED = 29036,
|
||||
NZERROR_CIC_ERR_SSL_NO_CERTIFICATE = 29037,
|
||||
NZERROR_CIC_ERR_SSL_NO_MATCHING_CERTIFICATES = 29038,
|
||||
NZERROR_CIC_ERR_SSL_NO_MATCHING_CIPHER_SUITES = 29039,
|
||||
NZERROR_CIC_ERR_SSL_NO_SUPPORTED_CIPHER_SUITES = 29040,
|
||||
NZERROR_CIC_ERR_SSL_NULL_CB = 29041,
|
||||
NZERROR_CIC_ERR_SSL_READ_BUFFER_NOT_EMPTY = 29042,
|
||||
NZERROR_CIC_ERR_SSL_READ_REQUIRED = 29043,
|
||||
NZERROR_CIC_ERR_SSL_RENEGOTIATION_ALREADY_REQUESTED = 29044,
|
||||
NZERROR_CIC_ERR_SSL_RENEGOTIATION_REFUSED = 29045,
|
||||
NZERROR_CIC_ERR_SSL_RESUMABLE_SESSION = 29046,
|
||||
NZERROR_CIC_ERR_SSL_TLS_EXTENSION_MISMATCH = 29047,
|
||||
NZERROR_CIC_ERR_SSL_UNEXPECTED_MSG = 29048,
|
||||
NZERROR_CIC_ERR_SSL_UNKNOWN_RECORD = 29049,
|
||||
NZERROR_CIC_ERR_SSL_UNSUPPORTED_CLIENT_AUTH_MODE = 29050,
|
||||
NZERROR_CIC_ERR_SSL_UNSUPPORTED_PUBKEY_TYPE = 29051,
|
||||
NZERROR_CIC_ERR_SSL_WRITE_BUFFER_NOT_EMPTY = 29052,
|
||||
NZERROR_CIC_ERR_PKCS12_MISSING_ALG = 29053,
|
||||
NZERROR_CIC_ERR_PKCS_AUTH_FAILED = 29054,
|
||||
NZERROR_CIC_ERR_PKCS_BAD_CONTENT_TYPE = 29055,
|
||||
NZERROR_CIC_ERR_PKCS_BAD_INPUT = 29056,
|
||||
NZERROR_CIC_ERR_PKCS_BAD_PADDING = 29057,
|
||||
NZERROR_CIC_ERR_PKCS_BAD_SN = 29058,
|
||||
NZERROR_CIC_ERR_PKCS_BAD_SN_LENGTH = 29059,
|
||||
NZERROR_CIC_ERR_PKCS_BAD_VERSION = 29060,
|
||||
NZERROR_CIC_ERR_PKCS_BASE = 29061,
|
||||
NZERROR_CIC_ERR_PKCS_FIELD_NOT_PRESENT = 29062,
|
||||
NZERROR_CIC_ERR_PKCS_NEED_CERTVAL = 29063,
|
||||
NZERROR_CIC_ERR_PKCS_NEED_PASSWORD = 29064,
|
||||
NZERROR_CIC_ERR_PKCS_NEED_PKC = 29065,
|
||||
NZERROR_CIC_ERR_PKCS_NEED_PRV_KEY = 29066,
|
||||
NZERROR_CIC_ERR_PKCS_NEED_TRUSTED = 29067,
|
||||
NZERROR_CIC_ERR_PKCS_UNSUPPORTED_CERT_FORMAT = 29068,
|
||||
NZERROR_CIC_ERR_PKCS_UNSUP_PRVKEY_TYPE = 29069,
|
||||
NZERROR_CIC_ERR_CODING_BAD_PEM = 29070,
|
||||
NZERROR_CIC_ERR_CODING_BASE = 29071,
|
||||
NZERROR_CIC_ERR_DER_BAD_ENCODING = 29072,
|
||||
NZERROR_CIC_ERR_DER_BAD_ENCODING_LENGTH = 29073,
|
||||
NZERROR_CIC_ERR_DER_BASE = 29074,
|
||||
NZERROR_CIC_ERR_DER_ELEMENT_TOO_LONG = 29075,
|
||||
NZERROR_CIC_ERR_DER_INDEFINITE_LENGTH = 29076,
|
||||
NZERROR_CIC_ERR_DER_NO_MORE_ELEMENTS = 29077,
|
||||
NZERROR_CIC_ERR_DER_OBJECT_TOO_LONG = 29078,
|
||||
NZERROR_CIC_ERR_DER_TAG_SIZE = 29079,
|
||||
NZERROR_CIC_ERR_DER_TIME_OUT_OF_RANGE = 29080,
|
||||
NZERROR_CIC_ERR_DER_UNUSED_BITS_IN_BIT_STR = 29081,
|
||||
NZERROR_CIC_ERR_GENERAL_BASE = 29082,
|
||||
NZERROR_CIC_ERR_HASH_BASE = 29083,
|
||||
NZERROR_CIC_ERR_ILLEGAL_PARAM = 29084,
|
||||
NZERROR_CIC_ERR_MEM_NOT_OURS = 29085,
|
||||
NZERROR_CIC_ERR_MEM_OVERRUN = 29086,
|
||||
NZERROR_CIC_ERR_MEM_UNDERRUN = 29087,
|
||||
NZERROR_CIC_ERR_MEM_WAS_FREED = 29088,
|
||||
NZERROR_CIC_ERR_NOT_FOUND = 29090,
|
||||
NZERROR_CIC_ERR_NO_PTR = 29091,
|
||||
NZERROR_CIC_ERR_TIMEOUT = 29092,
|
||||
NZERROR_CIC_ERR_UNIT_MASK = 29093,
|
||||
NZERROR_CIC_ERR_BAD_CTX = 29094,
|
||||
NZERROR_CIC_ERR_BAD_INDEX = 29095,
|
||||
NZERROR_CIC_ERR_BAD_LENGTH = 29096,
|
||||
NZERROR_CIC_ERR_CODING_BAD_ENCODING = 29097,
|
||||
NZERROR_CIC_ERR_SSL_NO_CLIENT_AUTH_MODES = 29098,
|
||||
|
||||
/* ============>>> PKCS12 error 29100 - 29149 */
|
||||
|
||||
NZERROR_LOCKEYID_CREATE_FAILED = 29100,
|
||||
NZERROR_P12_ADD_PVTKEY_FAILED = 29101,
|
||||
NZERROR_P12_ADD_CERT_FAILED = 29102,
|
||||
NZERROR_P12_WLT_CREATE_FAILED = 29103,
|
||||
NZERROR_P12_ADD_CERTREQ_FAILED = 29104,
|
||||
NZERROR_P12_WLT_EXP_FAILED = 29105,
|
||||
NZERROR_P12_WLT_IMP_FAILED = 29106,
|
||||
NZERROR_P12_CREATE_FAILED = 29107,
|
||||
NZERROR_P12_DEST_FAILED = 29107,
|
||||
NZERROR_P12_RAND_ERROR = 29108,
|
||||
NZERROR_P12_PVTKEY_CRT_FAILED = 29109,
|
||||
NZERROR_P12_INVALID_BAG = 29110,
|
||||
NZERROR_P12_INVALID_INDEX = 29111,
|
||||
NZERROR_P12_GET_CERT_FAILED = 29112,
|
||||
NZERROR_P12_GET_PVTKEY_FAILED = 29113,
|
||||
NZERROR_P12_IMP_PVTKEY_FAILED = 29114,
|
||||
NZERROR_P12_EXP_PVTKEY_FAILED = 29115,
|
||||
NZERROR_P12_GET_ATTRIB_FAILED = 29116,
|
||||
NZERROR_P12_ADD_ATTRIB_FAILED = 29117,
|
||||
NZERROR_P12_CRT_ATTRIB_FAILED = 29118,
|
||||
NZERROR_P12_IMP_CERT_FAILED = 29119,
|
||||
NZERROR_P12_EXP_CERT_FAILED = 29120,
|
||||
NZERROR_P12_ADD_SECRET_FAILED = 29121,
|
||||
NZERROR_P12_ADD_PKCS11INFO_FAILED = 29122,
|
||||
NZERROR_P12_GET_PKCS11INFO_FAILED = 29123,
|
||||
NZERROR_P12_MULTIPLE_PKCS11_LIBNAME = 29124,
|
||||
NZERROR_P12_MULTIPLE_PKCS11_TOKENLABEL = 29125,
|
||||
NZERROR_P12_MULTIPLE_PKCS11_TOKENPASSPHRASE = 29126,
|
||||
NZERROR_P12_UNKNOWN_PKCS11INFO = 29127,
|
||||
NZERROR_P12_PKCS11_LIBNAME_NOT_SET = 29128,
|
||||
NZERROR_P12_PKCS11_TOKENLABEL_NOT_SET = 29129,
|
||||
NZERROR_P12_PKCS11_TOKENPASSPHRASE_NOT_SET = 29130,
|
||||
NZERROR_P12_MULTIPLE_PKCS11_CERTLABEL = 29131,
|
||||
|
||||
/* ===========>>> SSL Errors CONTINUED 29135 - 29139 */
|
||||
NZERROR_CIC_ERR_RANDOM = 29135,
|
||||
NZERROR_CIC_ERR_SMALL_BUFFER = 29136,
|
||||
NZERROR_CIC_ERR_SSL_BAD_CONTEXT = 29137,
|
||||
|
||||
/* ==========>>> Mutex Errors 29138 - 29139 */
|
||||
NZERROR_MUTEX_INITIALIZE_FAILED = 29138,
|
||||
NZERROR_MUTEX_DESTROY_FAILED = 29139,
|
||||
|
||||
|
||||
/* ============>>> EXTENSIONS Errors 29140 - 29149 */
|
||||
NZERROR_BS_CERTOBJ_CREAT_FAILED = 29140,
|
||||
NZERROR_BS_DER_IMP_FAILED = 29141,
|
||||
|
||||
|
||||
/* ============>>> FIPS ERRORS 29150 - 29175 */
|
||||
NZERROR_DES_SELF_TEST_FAILED = 29150,
|
||||
NZERROR_3DES_SELF_TEST_FAILED = 29151,
|
||||
NZERROR_SHA_SELF_TEST_FAILED = 29152,
|
||||
NZERROR_RSA_SELF_TEST_FAILED = 29153,
|
||||
NZERROR_DRNG_SELF_TEST_FAILED = 29154,
|
||||
NZERROR_CKEYPAIR_SELF_TEST_FAILED = 29155,
|
||||
NZERROR_CRNG_SELF_TEST_FAILED = 29156,
|
||||
NZERROR_FIPS_PATHNAME_ERROR = 29157,
|
||||
NZERROR_FIPS_LIB_OPEN_FAILED = 29158,
|
||||
NZERROR_FIPS_LIB_READ_ERROR = 29159,
|
||||
NZERROR_FIPS_LIB_DIFFERS = 29160,
|
||||
NZERROR_DAC_SELF_TEST_FAILED = 29161,
|
||||
NZERROR_NONFIPS_CIPHERSUITE = 29162,
|
||||
NZERROR_VENDOR_NOT_SUPPORTED_FIPS_MODE = 29163,
|
||||
NZERROR_EXTERNAL_PKCS12_NOT_SUPPORTED_FIPS_MODE = 29164,
|
||||
NZERROR_AES_SELF_TEST_FAILED = 29165,
|
||||
|
||||
/* ============>>> CRL ERRORS 29176 - 29200 */
|
||||
NZERROR_CRL_SIG_VERIFY_FAILED = 29176, /*CRL signature verification failed*/
|
||||
NZERROR_CERT_NOT_IN_CRL = 29177,
|
||||
/*Cert is not in CRL - cert is not revoked*/
|
||||
NZERROR_CERT_IN_CRL = 29178, /*Cert is in CRL - cert is revoked*/
|
||||
NZERROR_CERT_IN_CRL_CHECK_FAILED = 29179, /*Cert revocation check failed */
|
||||
NZERROR_INVALID_CERT_STATUS_PROTOCOL = 29180,
|
||||
NZERROR_LDAP_OPEN_FAILED = 29181, /* ldap_open failed */
|
||||
NZERROR_LDAP_BIND_FAILED = 29182, /* ldap_bind failed */
|
||||
NZERROR_LDAP_SEARCH_FAILED = 29183, /* ldap_search failed */
|
||||
NZERROR_LDAP_RESULT_FAILED = 29184, /* ldap_result failed */
|
||||
NZERROR_LDAP_FIRSTATTR_FAILED = 29185, /* ldap_first_attribute failed */
|
||||
NZERROR_LDAP_GETVALUESLEN_FAILED = 29186, /* ldap_get_values_len failed */
|
||||
NZERROR_LDAP_UNSUPPORTED_VALMEC = 29187,
|
||||
/* unsupported validation mechanism */
|
||||
NZERROR_LDAP_COUNT_ENTRIES_FAILED = 29188,/* ldap_count_entries failed */
|
||||
NZERROR_LDAP_NO_ENTRY_FOUND = 29189, /* No entry found in OID */
|
||||
NZERROR_LDAP_MULTIPLE_ENTRIES_FOUND = 29190, /* Multiple entries in OID*/
|
||||
NZERROR_OID_INFO_NOT_SET = 29191,
|
||||
NZERROR_LDAP_VALMEC_NOT_SET = 29192,
|
||||
/* Validation mechanism not set in OID*/
|
||||
NZERROR_CRLDP_NO_CRL_FOUND = 29193,
|
||||
/* No CRL found using CRLDP mechanism */
|
||||
NZERROR_CRL_NOT_IN_CACHE = 29194, /* No CRL found in the cache*/
|
||||
NZERROR_CRL_EXPIRED = 29195, /* CRL nextUpdate time is in the past */
|
||||
|
||||
/* ============>>> ADD ERRORS HERE -- NOTE DECREASING numbers */
|
||||
NZERROR_DN_MATCH = 29222, /* for nztCompareDN */
|
||||
NZERROR_CERT_CHAIN_CREATION = 29223, /* unable to create a cert chain
|
||||
* with the existing TPs for the
|
||||
* cert to be installed.
|
||||
*/
|
||||
NZERROR_NO_MATCHING_CERT_REQ = 29224, /* No matching cert_req was
|
||||
* found the corresponding to
|
||||
* the privatekey which
|
||||
* matches the cert to be
|
||||
* installed */
|
||||
NZERROR_CERT_ALREADY_INSTALLED = 29225, /* we are attempting to
|
||||
* install a cert again into
|
||||
* a persona which already
|
||||
* has it installed.
|
||||
*/
|
||||
NZERROR_NO_MATCHING_PRIVATE_KEY = 29226, /* could not find a matching
|
||||
* persona-private(privatekey) in
|
||||
* the Persona, for the given
|
||||
* cert(public key).
|
||||
*/
|
||||
NZERROR_VALIDITY_EXPIRED = 29227, /* certificate validity date expired */
|
||||
NZERROR_TK_BYTES_NEEDED = 29228, /* Couldn't determine # of bytes needed */
|
||||
NZERROR_TK_BAD_MAGIC_NUMBER = 29229,
|
||||
/* Magic number found in header does not match expected */
|
||||
NZERROR_TK_BAD_HEADER_LENGTH = 29230,
|
||||
/* Header length passed in not sufficient for message header */
|
||||
NZERROR_TK_CE_INIT = 29231, /* Crypto engine failed to initialize */
|
||||
NZERROR_TK_CE_KEYINIT = 29232, /* Crypto engine key initialization failed */
|
||||
NZERROR_TK_CE_ENCODE_KEY = 29233, /* Count not encode key object */
|
||||
NZERROR_TK_CE_DECODE_KEY = 29234, /* Could not decode key into object */
|
||||
NZERROR_TK_CE_GEYKEYINFO = 29235, /* Crypto engine failed to get key info */
|
||||
NZERROR_TK_SEED_RANDOM = 29236, /* Couldn't seed random number generator */
|
||||
NZERROR_TK_CE_ALGFINISH = 29237, /* Couldn't finish algorithm */
|
||||
NZERROR_TK_CE_ALGAPPLY = 29238, /* Couldn't apply algorithm to data */
|
||||
NZERROR_TK_CE_ALGINIT = 29239, /* Couldn't init CE for algorithm */
|
||||
NZERROR_TK_ALGORITHM = 29240, /* Have no idea what algorithm you want */
|
||||
NZERROR_TK_CANNOT_GROW = 29241, /* Cannot grow output buffer block */
|
||||
NZERROR_TK_KEYSIZE = 29242, /* Key not large enough for data */
|
||||
NZERROR_TK_KEYTYPE = 29243, /* Unknown key type. */
|
||||
|
||||
NZERROR_TK_PLSQL_NO_WRL = 29244,
|
||||
/* Wallet resource locator not specified to PL/SQL function */
|
||||
|
||||
NZERROR_TK_CE_FUNC = 29245, /* Unknown crypto engine function */
|
||||
NZERROR_TK_TDU_FORMAT = 29246, /* Unknown TDU format */
|
||||
NZERROR_TK_NOTOPEN = 29247, /* Object must be open */
|
||||
NZERROR_TK_WRLTYPE = 29248, /* Bad WRL type */
|
||||
NZERROR_TK_CE_STATE = 29249, /* Bad state specified for the crypto engine */
|
||||
|
||||
/* After 29249, use error numbers in block 43000 - 43499 */
|
||||
NZERROR_PKCS11_LIBRARY_NOT_FOUND = 43000, /* PKCS #11 library not found */
|
||||
NZERROR_PKCS11_TOKEN_NOT_FOUND = 43001,
|
||||
/* can't find token with given label*/
|
||||
NZERROR_PKCS11_BAD_PASSPHRASE = 43002, /* passphrase is incorrect/expired */
|
||||
NZERROR_PKCS11_GET_FUNC_LIST = 43003, /* C_GetFunctionList returned error */
|
||||
NZERROR_PKCS11_INITIALIZE = 43004, /* C_Initialize returned error */
|
||||
NZERROR_PKCS11_NO_TOKENS_PRESENT = 43005, /* No tokens present */
|
||||
NZERROR_PKCS11_GET_SLOT_LIST = 43006, /* C_GetSlotList returned error */
|
||||
|
||||
NZERROR_PKCS11_GET_TOKEN_INFO = 43008, /* C_GetTokenInfo returned error */
|
||||
NZERROR_PKCS11_SYMBOL_NOT_FOUND = 43009, /* Symbol not found in PKCS11 lib */
|
||||
|
||||
NZERROR_PKCS11_TOKEN_LOGIN_FAILED = 43011, /* Token login failed */
|
||||
|
||||
NZERROR_PKCS11_CHANGE_PROVIDERS_ERROR = 43013, /* Change providers error */
|
||||
NZERROR_PKCS11_GET_PRIVATE_KEY_ERROR = 43014,
|
||||
/* Error trying to find private key on token */
|
||||
NZERROR_PKCS11_CREATE_KEYPAIR_ERROR = 43015, /* Key pair gen error */
|
||||
NZERROR_PKCS11_WALLET_CONTAINS_P11_INFO = 43016, /* Wallet already contains
|
||||
pkcs11 info */
|
||||
NZERROR_PKCS11_NO_CERT_ON_TOKEN = 43017, /* No cert found on token */
|
||||
NZERROR_PKCS11_NO_USER_CERT_ON_TOKEN = 43018, /*No user cert found on token*/
|
||||
NZERROR_PKCS11_NO_CERT_ON_TOKEN_WITH_GIVEN_LABEL = 43019, /*No cert found on token with given certificate label.*/
|
||||
NZERROR_PKCS11_MULTIPLE_CERTS_ON_TOKEN_WITH_GIVEN_LABEL = 43020, /*Multiple certs found on token with given certificate label.*/
|
||||
NZERROR_PKCS11_CERT_WITH_LABEL_NOT_USER_CERT = 43021, /*Cert with given cert is not a user cert because no corresponding pvt key found on token */
|
||||
|
||||
/* RSA ERRORS 43050 - 43059 */
|
||||
NZERROR_BIND_SERVICE_ERROR = 43050, /* C_BindService returned error */
|
||||
NZERROR_CREATE_KEY_OBJ_ERROR = 43051, /* B_CreateKeyObject returned error */
|
||||
NZERROR_GET_CERT_FIELDS = 43052, /* C_GetCertFields returned error */
|
||||
NZERROR_CREATE_PKCS10_OBJECT = 43053,
|
||||
/* C_CreatePKCS10Object returned error */
|
||||
NZERROR_SET_PKCS10_FIELDS = 43054, /* C_SetPKCS10Fields returned error */
|
||||
NZERROR_SIGN_CERT_REQUEST = 43055, /* C_SignCertRequest returned error */
|
||||
NZERROR_GET_PKCS10_DER = 43056, /* C_GetPKCS10DER returned error */
|
||||
NZERROR_INITIALIZE_CERTC = 43057, /* C_InitializeCertC returned error */
|
||||
NZERROR_INSERT_PRIVATE_KEY = 43058, /* C_InsertPrivateKey returned error */
|
||||
NZERROR_RSA_ERROR = 43059, /* RSA error. See trace output */
|
||||
|
||||
/* slts ERRORS 43060 - 43069 */
|
||||
NZERROR_SLTSCTX_INIT_FAILED = 43060, /* sltsini() returned error */
|
||||
NZERROR_SLTSKYC_FAILED = 43061, /* sltskyc() returned error */
|
||||
NZERROR_SLTSCTX_TERM_FAILED = 43062, /* sltster() returned error */
|
||||
NZERROR_SLTSKYS_FAILED = 43063, /* sltskys() returned error */
|
||||
|
||||
NZERROR_INVALID_HEADER_LENGTH = 43070, /* bad sso header length */
|
||||
NZERROR_WALLET_CONTAINS_USER_CREDENTIALS = 43071, /* wallet not empty */
|
||||
NZERROR_CANNOT_MODIFY_AL = 43072, /* Cannot modify AL wallet */
|
||||
NZERROR_FILE_LOCK_FAILED = 43073, /* Cannot lock wallet file */
|
||||
|
||||
NZERROR_CSF_ALIAS_INVALID = 43100, /* alias is invalid */
|
||||
NZERROR_CSF_KEY_INVALID = 43101, /* key invalid */
|
||||
NZERROR_CSF_CRED_NOT_SUPPORTED = 43102, /* only pwd cred supported */
|
||||
NZERROR_CSF_HOSTNAME = 43103, /* hostname error */
|
||||
NZERROR_CSF_XML = 43104, /* XmlCreate error. See trace */
|
||||
NZERROR_CSF_WALLET_NOT_SPECIFIED = 43105, /* no wallet specified */
|
||||
NZERROR_CSF_MAP_NOT_IN_STORE = 43106, /* map does not exist in store */
|
||||
NZERROR_CSF_KEY_NOT_IN_STORE = 43107, /* key does not exist in store */
|
||||
NZERROR_CSF_ENTRY_EXISTS = 43108, /* entry with map/key exists */
|
||||
|
||||
NZERROR_LX_ERROR = 43120, /* lx api returned error */
|
||||
|
||||
NZERROR_LAST_ERROR = 43499, /* Last available error */
|
||||
/* MAXIMUM ERROR NUMBER IS 43499 */
|
||||
|
||||
/*
|
||||
* DO NOT JUST INSERT NEW ERRORS IN ANY OLD PLACE. New errors should be
|
||||
* added such the current error retains their integer values. Duplicate
|
||||
* values will cause compiler errors.
|
||||
*/
|
||||
NZERROR_THIS_MUST_BE_LAST
|
||||
|
||||
} nzerror;
|
||||
|
||||
/*
|
||||
* Macro to convert SSL errors to Oracle errors. As SSL errors are negative
|
||||
* and Oracle numbers are positive, the following needs to be done.
|
||||
* 1. The base error number, which is the highest, is added to the
|
||||
* SSL error to get the index into the number range.
|
||||
* 2. The result is added to the base Oracle number to get the Oracle error.
|
||||
*/
|
||||
#define NZERROR_SSL_TO_ORACLE(ssl_error_) \
|
||||
((ssl_error_ == SSLNoErr) \
|
||||
? NZERROR_OK \
|
||||
: (nzerror) ((ssl_error_ - SSLMemoryErr) + (uword) NZERROR_SSLMemoryErr))
|
||||
#endif /* NZERROR_ORACLE */
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,78 @@
|
||||
/* Copyright (c) 2000, 2002, Oracle Corporation. All rights reserved. */
|
||||
|
||||
/*
|
||||
NAME
|
||||
occi.h - Oracle C++ Interface header files.
|
||||
|
||||
DESCRIPTION
|
||||
<short description of facility this file declares/defines>
|
||||
|
||||
RELATED DOCUMENTS
|
||||
<note any documents related to this facility>
|
||||
|
||||
EXPORT FUNCTION(S)
|
||||
<external functions declared for use outside package - one-line
|
||||
descriptions>
|
||||
|
||||
INTERNAL FUNCTION(S)
|
||||
<other external functions declared - one-line descriptions>
|
||||
|
||||
EXAMPLES
|
||||
|
||||
NOTES
|
||||
<other useful comments, qualifications, etc.>
|
||||
|
||||
MODIFIED (MM/DD/YY)
|
||||
vvinay 08/19/02 -
|
||||
aahluwal 06/03/02 - bug 2360115
|
||||
gayyappa 01/03/01 - removed inclusions before occiCommon.h
|
||||
kmohan 04/11/00 - include oci.h and occiCommon.h also
|
||||
rkasamse 04/03/00 - header file for all the OCCI classes
|
||||
rkasamse 04/03/00 - Creation
|
||||
|
||||
*/
|
||||
|
||||
#ifndef OCCI_ORACLE
|
||||
# define OCCI_ORACLE
|
||||
|
||||
#ifndef OCCICOMMON_ORACLE
|
||||
#include <occiCommon.h>
|
||||
#endif
|
||||
|
||||
#ifndef OCCIDATA_ORACLE
|
||||
#include <occiData.h>
|
||||
#endif
|
||||
|
||||
#ifndef OCCICONTROL_ORACLE
|
||||
#include <occiControl.h>
|
||||
#endif
|
||||
|
||||
#ifndef OCCIOBJECTS_ORACLE
|
||||
#include <occiObjects.h>
|
||||
#endif
|
||||
|
||||
#ifndef OCCIAQ_ORACLE
|
||||
#include <occiAQ.h>
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PUBLIC TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PRIVATE TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
EXPORT FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
INTERNAL FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#endif /* OCCI_ORACLE */
|
||||
@ -0,0 +1,374 @@
|
||||
/* Copyright (c) 2002, 2005, Oracle. All rights reserved. */
|
||||
|
||||
/*
|
||||
NAME
|
||||
occiAQ.h - Header file for occi AQ classes
|
||||
|
||||
DESCRIPTION
|
||||
Class declarations for Producer, Consumer, Message, Agent
|
||||
Listener, Subscription
|
||||
|
||||
RELATED DOCUMENTS
|
||||
<note any documents related to this facility>
|
||||
|
||||
EXPORT FUNCTION(S)
|
||||
<external functions declared for use outside package - one-line
|
||||
descriptions>
|
||||
|
||||
INTERNAL FUNCTION(S)
|
||||
<other external functions declared - one-line descriptions>
|
||||
|
||||
EXAMPLES
|
||||
|
||||
NOTES
|
||||
<other useful comments, qualifications, etc.>
|
||||
|
||||
MODIFIED (MM/DD/YY)
|
||||
cparampa 10/12/02 - creation
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _olint /* disable olint check */
|
||||
|
||||
#ifndef OCCIAQ_ORACLE
|
||||
# define OCCIAQ_ORACLE
|
||||
|
||||
#ifndef OCCICOMMON_ORACLE
|
||||
#include <occiCommon.h>
|
||||
#endif
|
||||
|
||||
namespace oracle {
|
||||
namespace occi {
|
||||
namespace aq{
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PUBLIC TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
class Message
|
||||
{
|
||||
public:
|
||||
|
||||
enum MessageState
|
||||
{
|
||||
MSG_READY = OCI_MSG_READY,
|
||||
MSG_WAITING = OCI_MSG_WAITING,
|
||||
MSG_PROCESSED = OCI_MSG_PROCESSED,
|
||||
MSG_EXPIRED = OCI_MSG_EXPIRED
|
||||
};
|
||||
enum PayloadType
|
||||
{
|
||||
RAW,
|
||||
ANYDATA,
|
||||
OBJECT
|
||||
};
|
||||
|
||||
Message( const Environment *env );
|
||||
Message( const Message& rhs);
|
||||
~Message();
|
||||
|
||||
void operator=(const Message& rhs);
|
||||
int getAttemptsToDequeue() const ;
|
||||
void setCorrelationId( const OCCI_STD_NAMESPACE::string& corr_id ) ;
|
||||
OCCI_STD_NAMESPACE::string getCorrelationId() const ;
|
||||
void setDelay( int delay ) ;
|
||||
int getDelay() const ;
|
||||
Date getMessageEnqueuedTime() const ;
|
||||
void setExceptionQueueName( const OCCI_STD_NAMESPACE::string& queue ) ;
|
||||
OCCI_STD_NAMESPACE::string getExceptionQueueName() const ;
|
||||
void setExpiration( int exp ) ;
|
||||
int getExpiration() const ;
|
||||
MessageState getMessageState() const ;
|
||||
void setPriority( int priority ) ;
|
||||
int getPriority() const ;
|
||||
void setRecipientList( OCCI_STD_NAMESPACE::vector<Agent>& ag_list ) ;
|
||||
void setSenderId( const Agent& sender ) ;
|
||||
Agent getSenderId() const ;
|
||||
void setOriginalMessageId( const Bytes& queue ) ;
|
||||
Bytes getOriginalMessageId() const ;
|
||||
void setNull();
|
||||
bool isNull() const;
|
||||
|
||||
void setBytes( const Bytes& bytes);
|
||||
void setObject( PObject* pobj);
|
||||
void setAnyData( const AnyData& any);
|
||||
|
||||
Bytes getBytes() const ;
|
||||
PObject *getObject() ;
|
||||
AnyData getAnyData() const ;
|
||||
|
||||
PayloadType getPayloadType( ) const;
|
||||
|
||||
private:
|
||||
Ptr<MessageImpl> ptr;
|
||||
OCIAQMsgProperties* getOCIMsgProperties() const;
|
||||
Message( const Environment *env, const Connection *con,
|
||||
OCIAQMsgProperties *msgprop, void *data, unsigned int dataLen,
|
||||
bool isNull, PayloadType pType);
|
||||
friend class ConsumerImpl;
|
||||
friend class ProducerImpl;
|
||||
friend class NotifyResult;
|
||||
};
|
||||
|
||||
class Producer
|
||||
{
|
||||
public:
|
||||
|
||||
enum EnqueueSequence
|
||||
{
|
||||
ENQ_BEFORE = OCI_ENQ_BEFORE,
|
||||
ENQ_TOP = OCI_ENQ_TOP
|
||||
};
|
||||
enum Visibility
|
||||
{
|
||||
ENQ_IMMEDIATE = OCI_ENQ_IMMEDIATE,
|
||||
ENQ_ON_COMMIT = OCI_ENQ_ON_COMMIT
|
||||
};
|
||||
|
||||
Producer( const Connection *conn );
|
||||
Producer( const Connection *conn,
|
||||
const OCCI_STD_NAMESPACE::string& queue );
|
||||
Producer( const Producer& rhs);
|
||||
~Producer();
|
||||
|
||||
void operator=(const Producer& prod);
|
||||
void setRelativeMessageId( const Bytes& msgid );
|
||||
Bytes getRelativeMessageId() const;
|
||||
void setSequenceDeviation( EnqueueSequence option );
|
||||
EnqueueSequence getSequenceDeviation() const;
|
||||
void setVisibility( Visibility option );
|
||||
Visibility getVisibility() const;
|
||||
void setQueueName( const OCCI_STD_NAMESPACE::string& queue );
|
||||
OCCI_STD_NAMESPACE::string getQueueName() const;
|
||||
void setTransformation( const OCCI_STD_NAMESPACE::string& fName);
|
||||
OCCI_STD_NAMESPACE::string getTransformation() const;
|
||||
Bytes send( Message& msg, const OCCI_STD_NAMESPACE::string& queue );
|
||||
Bytes send( Message& msg );
|
||||
void setNull();
|
||||
bool isNull() const;
|
||||
|
||||
private:
|
||||
Ptr<ProducerImpl> ptr;
|
||||
};
|
||||
|
||||
class Consumer
|
||||
{
|
||||
public:
|
||||
|
||||
enum DequeueMode
|
||||
{
|
||||
DEQ_BROWSE = OCI_DEQ_BROWSE,
|
||||
DEQ_LOCKED = OCI_DEQ_LOCKED,
|
||||
DEQ_REMOVE = OCI_DEQ_REMOVE,
|
||||
DEQ_REMOVE_NODATA = OCI_DEQ_REMOVE_NODATA
|
||||
};
|
||||
enum Navigation
|
||||
{
|
||||
DEQ_FIRST_MSG = OCI_DEQ_FIRST_MSG,
|
||||
DEQ_NEXT_TRANSACTION = OCI_DEQ_NEXT_TRANSACTION,
|
||||
DEQ_NEXT_MSG = OCI_DEQ_NEXT_MSG
|
||||
};
|
||||
enum Visibility
|
||||
{
|
||||
DEQ_IMMEDIATE = OCI_DEQ_IMMEDIATE,
|
||||
DEQ_ON_COMMIT = OCI_DEQ_ON_COMMIT
|
||||
};
|
||||
enum
|
||||
{
|
||||
DEQ_WAIT_FOREVER = OCI_DEQ_WAIT_FOREVER,
|
||||
DEQ_NO_WAIT = OCI_DEQ_NO_WAIT
|
||||
};
|
||||
|
||||
Consumer( const Connection *conn );
|
||||
Consumer( const Connection * conn, const Agent& agent);
|
||||
Consumer( const Connection *conn,
|
||||
const OCCI_STD_NAMESPACE::string& queue );
|
||||
Consumer(const Consumer& con);
|
||||
~Consumer();
|
||||
|
||||
void operator=(const Consumer& con);
|
||||
void setAgent(const Agent& agent);
|
||||
void setConsumerName( const OCCI_STD_NAMESPACE::string& name );
|
||||
OCCI_STD_NAMESPACE::string getConsumerName() const;
|
||||
void setCorrelationId( const OCCI_STD_NAMESPACE::string& cor_id );
|
||||
OCCI_STD_NAMESPACE::string getCorrelationId() const;
|
||||
void setDequeueMode( DequeueMode mode );
|
||||
DequeueMode getDequeueMode() const;
|
||||
void setMessageIdToDequeue( const Bytes& msgid );
|
||||
Bytes getMessageIdToDequeue() const;
|
||||
void setPositionOfMessage( Navigation pos );
|
||||
Navigation getPositionOfMessage() const;
|
||||
void setVisibility( Visibility option );
|
||||
Visibility getVisibility() const;
|
||||
void setWaitTime( unsigned int wait );
|
||||
unsigned int getWaitTime() const;
|
||||
void setQueueName( const OCCI_STD_NAMESPACE::string& queue );
|
||||
OCCI_STD_NAMESPACE::string getQueueName() const;
|
||||
void setTransformation( const OCCI_STD_NAMESPACE::string& fName);
|
||||
OCCI_STD_NAMESPACE::string getTransformation() const;
|
||||
Message receive( Message::PayloadType pType,
|
||||
const OCCI_STD_NAMESPACE::string& type="",
|
||||
const OCCI_STD_NAMESPACE::string& schema="");
|
||||
void setNull();
|
||||
bool isNull() const;
|
||||
|
||||
private:
|
||||
Ptr<ConsumerImpl> ptr;
|
||||
};
|
||||
|
||||
class Agent
|
||||
{
|
||||
public:
|
||||
Agent( const Environment *env );
|
||||
Agent( const Environment *env,
|
||||
const OCCI_STD_NAMESPACE::string& name,
|
||||
const OCCI_STD_NAMESPACE::string& address,
|
||||
unsigned int protocol=0 ) ;
|
||||
Agent(const Agent& a);
|
||||
~Agent() ;
|
||||
|
||||
void operator=(const Agent& a);
|
||||
void setName( const OCCI_STD_NAMESPACE::string& name );
|
||||
OCCI_STD_NAMESPACE::string getName() const;
|
||||
void setAddress( const OCCI_STD_NAMESPACE::string& addr );
|
||||
OCCI_STD_NAMESPACE::string getAddress() const;
|
||||
void setProtocol(unsigned int protocol = 0);
|
||||
unsigned int getProtocol() const;
|
||||
void setNull();
|
||||
bool isNull() const;
|
||||
OCIAQAgent* getOCIAQAgent() const;
|
||||
|
||||
private:
|
||||
Ptr<AgentImpl> ptr;
|
||||
Agent( const Environment *env, OCIAQAgent *rhs, bool toFree = false );
|
||||
friend class Listener;
|
||||
friend class MessageImpl;
|
||||
};
|
||||
|
||||
class Listener
|
||||
{
|
||||
public:
|
||||
Listener( const Connection *conn );
|
||||
Listener( const Connection *conn,
|
||||
OCCI_STD_NAMESPACE::vector<Agent> &agList,
|
||||
int waitTime=0 );
|
||||
~Listener();
|
||||
|
||||
Agent listen();
|
||||
void setAgentList(OCCI_STD_NAMESPACE::vector<Agent> &agList);
|
||||
void setTimeOutForListen(int waitTime);
|
||||
OCCI_STD_NAMESPACE::vector<Agent> getAgentList() const;
|
||||
int getTimeOutForListen() const;
|
||||
|
||||
private:
|
||||
const ConnectionImpl *conn;
|
||||
OCIAQAgent** agentList;
|
||||
unsigned int numAgents;
|
||||
int timeOut;
|
||||
void *listenerExt;
|
||||
};
|
||||
|
||||
|
||||
class Subscription
|
||||
{
|
||||
public:
|
||||
enum Presentation
|
||||
{
|
||||
PRES_DEFAULT = OCI_SUBSCR_PRES_DEFAULT,
|
||||
PRES_XML = OCI_SUBSCR_PRES_XML
|
||||
};
|
||||
enum Protocol
|
||||
{
|
||||
PROTO_CBK = OCI_SUBSCR_PROTO_OCI,
|
||||
PROTO_MAIL = OCI_SUBSCR_PROTO_MAIL,
|
||||
PROTO_SERVER = OCI_SUBSCR_PROTO_SERVER,
|
||||
PROTO_HTTP = OCI_SUBSCR_PROTO_HTTP
|
||||
};
|
||||
enum Namespace
|
||||
{
|
||||
NS_ANONYMOUS = OCI_SUBSCR_NAMESPACE_ANONYMOUS,
|
||||
NS_AQ = OCI_SUBSCR_NAMESPACE_AQ
|
||||
};
|
||||
|
||||
Subscription(const Environment* env);
|
||||
Subscription(const Environment* env, OCISubscription* sub);
|
||||
Subscription(const Subscription& sub);
|
||||
~Subscription();
|
||||
|
||||
void operator=(const Subscription& sub);
|
||||
unsigned int getDatabaseServersCount() const;
|
||||
void setDatabaseServerNames(
|
||||
const OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string>& dbsrv);
|
||||
OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string>
|
||||
getDatabaseServerNames() const ;
|
||||
void setNotifyCallback(unsigned int (*callback)(Subscription& sub,
|
||||
NotifyResult *nr));
|
||||
unsigned int (*getNotifyCallback() const)(Subscription& sub,
|
||||
NotifyResult *nr);
|
||||
void setCallbackContext(void* ctx);
|
||||
void* getCallbackContext() const;
|
||||
void setSubscriptionName(const OCCI_STD_NAMESPACE::string& name);
|
||||
OCCI_STD_NAMESPACE::string getSubscriptionName() const ;
|
||||
void setSubscriptionNamespace(Namespace nameSpace);
|
||||
Namespace getSubscriptionNamespace() const ;
|
||||
void setPayload(const Bytes& payload);
|
||||
Bytes getPayload() const ;
|
||||
void setRecipientName( const OCCI_STD_NAMESPACE::string& name);
|
||||
OCCI_STD_NAMESPACE::string getRecipientName() const;
|
||||
void setPresentation( Presentation pres) ;
|
||||
Presentation getPresentation() const ;
|
||||
void setProtocol( Protocol prot) ;
|
||||
Protocol getProtocol() const ;
|
||||
OCISubscription* getOCISubscription() const;
|
||||
void setNull();
|
||||
bool isNull() const;
|
||||
Environment* getEnvironment() const;
|
||||
|
||||
private:
|
||||
Ptr<SubscriptionImpl> ptr;
|
||||
};
|
||||
|
||||
class NotifyResult
|
||||
{
|
||||
public:
|
||||
Bytes getPayload() const;
|
||||
Message getMessage() const;
|
||||
Bytes getMessageId() const;
|
||||
OCCI_STD_NAMESPACE::string getConsumerName() const;
|
||||
OCCI_STD_NAMESPACE::string getQueueName() const;
|
||||
|
||||
private:
|
||||
const EnvironmentImpl *env;
|
||||
void *payload;
|
||||
unsigned int payloadLen;
|
||||
void *desc;
|
||||
ub4 mode;
|
||||
void *notifyResultExt;
|
||||
|
||||
//private constructor
|
||||
NotifyResult(const Environment *env, void *payload, ub4 payloadLen,
|
||||
void *pdescriptor, ub4 mode);
|
||||
|
||||
friend class SubscriptionImpl;
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PRIVATE TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
EXPORT FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
INTERNAL FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
} /* end of namespace aq */
|
||||
} /* end of namespace occi */
|
||||
} /* end of namespace oracle */
|
||||
|
||||
#endif /* OCCIAQ_ORACLE */
|
||||
|
||||
#endif /* _olint */
|
||||
@ -0,0 +1,982 @@
|
||||
/* Copyright (c) 2000, 2008, Oracle. All rights reserved. */
|
||||
|
||||
/*
|
||||
NAME
|
||||
occiCommon.h - header file for doing forward references
|
||||
|
||||
DESCRIPTION
|
||||
Just declare all the classes
|
||||
|
||||
RELATED DOCUMENTS
|
||||
OCCI Programmer's Guide
|
||||
|
||||
EXPORT FUNCTION(S)
|
||||
none
|
||||
|
||||
INTERNAL FUNCTION(S)
|
||||
none
|
||||
|
||||
EXAMPLES
|
||||
|
||||
NOTES
|
||||
none
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef OCCICOMMON_ORACLE
|
||||
# define OCCICOMMON_ORACLE
|
||||
|
||||
#ifndef _olint
|
||||
|
||||
#ifndef OCI_ORACLE
|
||||
#include <oci.h>
|
||||
#endif
|
||||
|
||||
#ifndef ORASTRINGSTL
|
||||
#define ORASTRINGSTL
|
||||
#include <string>
|
||||
#endif
|
||||
|
||||
#ifndef ORAVECTORSTL
|
||||
#include <vector>
|
||||
#define ORAVECTORSTL
|
||||
#endif
|
||||
|
||||
#ifndef ORALISTSTL
|
||||
#include <list>
|
||||
#define ORALISTSTL
|
||||
#endif
|
||||
|
||||
#define OCCI_STD_NAMESPACE std
|
||||
#define OCCI_HAVE_STD_NAMESPACE 1
|
||||
|
||||
// version definitions
|
||||
#define OCCI_MAJOR_VERSION OCI_MAJOR_VERSION
|
||||
#define OCCI_MINOR_VERSION OCI_MINOR_VERSION
|
||||
|
||||
namespace oracle {
|
||||
namespace occi {
|
||||
|
||||
//UString is the class for UTF16 characterset
|
||||
//check for version = 3.2 or 3.3
|
||||
#if (__GNUC__ == 3 && (__GNUC_MINOR__ == 2 || __GNUC_MINOR__ == 3))
|
||||
//char_traits<T> specialization for utext for gcc 3.2.3
|
||||
struct utext_char_traits
|
||||
{
|
||||
typedef utext char_type;
|
||||
typedef unsigned int int_type;
|
||||
|
||||
typedef OCCI_STD_NAMESPACE::streampos pos_type;
|
||||
typedef OCCI_STD_NAMESPACE::streamoff off_type;
|
||||
typedef OCCI_STD_NAMESPACE::mbstate_t state_type;
|
||||
|
||||
//assign one char to another
|
||||
static void assign(char_type& c1, const char_type& c2)
|
||||
{
|
||||
c1 = c2;
|
||||
}
|
||||
|
||||
//are 2 chars equal ?
|
||||
static bool eq(const char_type& c1, const char_type& c2)
|
||||
{
|
||||
return c1 == c2;
|
||||
}
|
||||
|
||||
//is char c1 less then c2 ?
|
||||
static bool lt(const char_type& c1, const char_type& c2)
|
||||
{
|
||||
return c1 < c2;
|
||||
}
|
||||
|
||||
//compare 2 strings of char
|
||||
static int compare(const char_type* s1, const char_type* s2, size_t n)
|
||||
{
|
||||
for (size_t i = 0; i < n; ++i)
|
||||
if (!eq(s1[i], s2[i]))
|
||||
return s1[i] < s2[i] ? -1 : 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//length of a char string
|
||||
static size_t length(const char_type* s)
|
||||
{
|
||||
const char_type nullchar = char_type(0);
|
||||
size_t i = 0;
|
||||
|
||||
while (!eq(*s++, nullchar)) i++;
|
||||
return i;
|
||||
}
|
||||
|
||||
//find a character in the char string
|
||||
static const char_type* find(const char_type* s,
|
||||
size_t n, const char_type& c)
|
||||
{
|
||||
for ( ; n > 0 ; ++s, --n)
|
||||
if (eq(*s, c))
|
||||
return s;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//move n chars from s2 to s1
|
||||
static char_type* move(char_type* s1, const char_type* s2, size_t n)
|
||||
{
|
||||
memmove(s1, s2, n * sizeof(char_type));
|
||||
return s1;
|
||||
}
|
||||
|
||||
//copy n chars from s2 to s1
|
||||
static char_type* copy(char_type* s1, const char_type* s2, size_t n)
|
||||
{
|
||||
memcpy(s1, s2, n * sizeof(char_type));
|
||||
return s1;
|
||||
}
|
||||
|
||||
//fill char c into s
|
||||
static char_type* assign(char_type* s, size_t n, char_type c)
|
||||
{
|
||||
for (size_t i = 0; i < n; ++i)
|
||||
assign(s[i], c);
|
||||
return s;
|
||||
}
|
||||
|
||||
//is the int representation eof ?
|
||||
static int_type not_eof(const int_type& c)
|
||||
{
|
||||
if (c == eof())
|
||||
return 0;
|
||||
else
|
||||
return c;
|
||||
}
|
||||
|
||||
//cast a int type to char
|
||||
static char_type to_char_type(const int_type& c)
|
||||
{
|
||||
return static_cast<char_type>(c);
|
||||
}
|
||||
|
||||
//cast char to int type
|
||||
static int_type to_int_type(const char_type& c)
|
||||
{
|
||||
return static_cast<int_type>(c);
|
||||
}
|
||||
|
||||
//eq operator when the chars are represented as ints
|
||||
static bool eq_int_type(const int_type& c1, const int_type& c2)
|
||||
{
|
||||
return c1 == c2;
|
||||
}
|
||||
|
||||
//eof character
|
||||
static int_type eof()
|
||||
{
|
||||
return static_cast<int_type>(-1);
|
||||
}
|
||||
|
||||
|
||||
}; //end char_traits<unsigned short>
|
||||
|
||||
typedef OCCI_STD_NAMESPACE::basic_string<utext, utext_char_traits> UString;
|
||||
#else
|
||||
//for non gcc 3.2.3 platforms
|
||||
typedef OCCI_STD_NAMESPACE::basic_string<utext> UString;
|
||||
#endif /* if gcc 3.2.3 */
|
||||
|
||||
class Environment;
|
||||
class EnvironmentImpl;
|
||||
class Connection;
|
||||
class ConnectionImpl;
|
||||
class ConnectionPool;
|
||||
class ConnectionPoolImpl;
|
||||
class StatelessConnectionPool;
|
||||
class StatelessConnectionPoolImpl;
|
||||
class Statement;
|
||||
class StatementImpl;
|
||||
class ResultSet;
|
||||
class ResultSetImpl;
|
||||
class SQLException;
|
||||
class SQLExceptionImpl;
|
||||
class BatchSQLException;
|
||||
class BatchSQLExceptionImpl;
|
||||
class Stream;
|
||||
class PObject;
|
||||
class Number;
|
||||
class Bytes;
|
||||
class BytesImpl;
|
||||
class Date;
|
||||
class Timestamp;
|
||||
|
||||
class MetaData;
|
||||
class MetaDataImpl;
|
||||
template <class T> class Ref;
|
||||
class RefImpl;
|
||||
class RefAny;
|
||||
class Blob;
|
||||
class Bfile;
|
||||
class Clob;
|
||||
class LobStreamImpl;
|
||||
class AnyData;
|
||||
class AnyDataImpl;
|
||||
class Map;
|
||||
class IntervalDS;
|
||||
class IntervalYM;
|
||||
|
||||
namespace aq {
|
||||
class Message;
|
||||
class MessageImpl;
|
||||
class Agent;
|
||||
class AgentImpl;
|
||||
class Producer;
|
||||
class ProducerImpl;
|
||||
class Consumer;
|
||||
class ConsumerImpl;
|
||||
class Listener;
|
||||
class Subscription;
|
||||
class SubscriptionImpl;
|
||||
class NotifyResult;
|
||||
}
|
||||
|
||||
typedef struct BFloat BFloat;
|
||||
typedef struct BDouble BDouble;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
ENUMERATORS
|
||||
---------------------------------------------------------------------------*/
|
||||
enum Type
|
||||
{
|
||||
OCCI_SQLT_CHR=SQLT_CHR,
|
||||
OCCI_SQLT_NUM=SQLT_NUM,
|
||||
OCCIINT = SQLT_INT,
|
||||
OCCIFLOAT = SQLT_FLT,
|
||||
OCCIBFLOAT = SQLT_BFLOAT,
|
||||
OCCIBDOUBLE = SQLT_BDOUBLE,
|
||||
OCCIIBFLOAT = SQLT_IBFLOAT,
|
||||
OCCIIBDOUBLE = SQLT_IBDOUBLE,
|
||||
OCCI_SQLT_STR=SQLT_STR,
|
||||
OCCI_SQLT_VNU=SQLT_VNU,
|
||||
OCCI_SQLT_PDN=SQLT_PDN,
|
||||
OCCI_SQLT_LNG=SQLT_LNG,
|
||||
OCCI_SQLT_VCS=SQLT_VCS,
|
||||
OCCI_SQLT_NON=SQLT_NON,
|
||||
OCCI_SQLT_RID=SQLT_RID,
|
||||
OCCI_SQLT_DAT=SQLT_DAT,
|
||||
OCCI_SQLT_VBI=SQLT_VBI,
|
||||
OCCI_SQLT_BIN=SQLT_BIN,
|
||||
OCCI_SQLT_LBI=SQLT_LBI,
|
||||
OCCIUNSIGNED_INT = SQLT_UIN,
|
||||
OCCI_SQLT_SLS=SQLT_SLS,
|
||||
OCCI_SQLT_LVC=SQLT_LVC,
|
||||
OCCI_SQLT_LVB=SQLT_LVB,
|
||||
OCCI_SQLT_AFC=SQLT_AFC,
|
||||
OCCI_SQLT_AVC=SQLT_AVC,
|
||||
OCCI_SQLT_CUR=SQLT_CUR,
|
||||
OCCI_SQLT_RDD=SQLT_RDD,
|
||||
OCCI_SQLT_LAB=SQLT_LAB,
|
||||
OCCI_SQLT_OSL=SQLT_OSL,
|
||||
OCCI_SQLT_NTY=SQLT_NTY,
|
||||
OCCI_SQLT_REF=SQLT_REF,
|
||||
OCCI_SQLT_CLOB=SQLT_CLOB,
|
||||
OCCI_SQLT_BLOB=SQLT_BLOB,
|
||||
OCCI_SQLT_BFILEE=SQLT_BFILEE,
|
||||
OCCI_SQLT_CFILEE=SQLT_CFILEE,
|
||||
OCCI_SQLT_RSET=SQLT_RSET,
|
||||
OCCI_SQLT_NCO=SQLT_NCO,
|
||||
OCCI_SQLT_VST=SQLT_VST,
|
||||
OCCI_SQLT_ODT=SQLT_ODT,
|
||||
OCCI_SQLT_DATE=SQLT_DATE,
|
||||
OCCI_SQLT_TIME=SQLT_TIME,
|
||||
OCCI_SQLT_TIME_TZ=SQLT_TIME_TZ,
|
||||
OCCI_SQLT_TIMESTAMP=SQLT_TIMESTAMP,
|
||||
OCCI_SQLT_TIMESTAMP_TZ=SQLT_TIMESTAMP_TZ,
|
||||
OCCI_SQLT_INTERVAL_YM=SQLT_INTERVAL_YM,
|
||||
OCCI_SQLT_INTERVAL_DS=SQLT_INTERVAL_DS,
|
||||
OCCI_SQLT_TIMESTAMP_LTZ=SQLT_TIMESTAMP_LTZ,
|
||||
OCCI_SQLT_FILE=SQLT_FILE,
|
||||
OCCI_SQLT_CFILE=SQLT_CFILE,
|
||||
OCCI_SQLT_BFILE=SQLT_BFILE,
|
||||
|
||||
OCCICHAR = 32 *1024,
|
||||
OCCIDOUBLE,
|
||||
OCCIBOOL,
|
||||
OCCIANYDATA ,
|
||||
OCCINUMBER,
|
||||
OCCIBLOB,
|
||||
OCCIBFILE,
|
||||
OCCIBYTES,
|
||||
OCCICLOB ,
|
||||
OCCIVECTOR,
|
||||
OCCIMETADATA,
|
||||
OCCIPOBJECT,
|
||||
OCCIREF ,
|
||||
OCCIREFANY,
|
||||
OCCISTRING ,
|
||||
OCCISTREAM ,
|
||||
OCCIDATE ,
|
||||
OCCIINTERVALDS ,
|
||||
OCCIINTERVALYM ,
|
||||
OCCITIMESTAMP,
|
||||
OCCIROWID,
|
||||
OCCICURSOR
|
||||
|
||||
|
||||
};
|
||||
|
||||
enum LockOptions {OCCI_LOCK_NONE = OCI_LOCK_NONE,
|
||||
OCCI_LOCK_X = OCI_LOCK_X,
|
||||
OCCI_LOCK_X_NOWAIT = OCI_LOCK_X_NOWAIT
|
||||
};
|
||||
|
||||
enum {OCCI_MAX_PREFETCH_DEPTH = UB4MAXVAL};
|
||||
|
||||
enum TypeCode
|
||||
{
|
||||
|
||||
OCCI_TYPECODE_REF = OCI_TYPECODE_REF,
|
||||
OCCI_TYPECODE_DATE = OCI_TYPECODE_DATE,
|
||||
OCCI_TYPECODE_REAL = OCI_TYPECODE_REAL,
|
||||
OCCI_TYPECODE_DOUBLE = OCI_TYPECODE_DOUBLE,
|
||||
OCCI_TYPECODE_BDOUBLE = OCI_TYPECODE_BDOUBLE,
|
||||
OCCI_TYPECODE_FLOAT = OCI_TYPECODE_FLOAT,
|
||||
OCCI_TYPECODE_BFLOAT = OCI_TYPECODE_BFLOAT,
|
||||
OCCI_TYPECODE_NUMBER = OCI_TYPECODE_NUMBER,
|
||||
OCCI_TYPECODE_DECIMAL = OCI_TYPECODE_DECIMAL,
|
||||
OCCI_TYPECODE_OCTET = OCI_TYPECODE_OCTET,
|
||||
OCCI_TYPECODE_INTEGER = OCI_TYPECODE_INTEGER,
|
||||
OCCI_TYPECODE_SMALLINT= OCI_TYPECODE_SMALLINT,
|
||||
OCCI_TYPECODE_RAW = OCI_TYPECODE_RAW,
|
||||
OCCI_TYPECODE_VARCHAR2 = OCI_TYPECODE_VARCHAR2,
|
||||
OCCI_TYPECODE_VARCHAR = OCI_TYPECODE_VARCHAR,
|
||||
OCCI_TYPECODE_CHAR = OCI_TYPECODE_CHAR,
|
||||
OCCI_TYPECODE_VARRAY= OCI_TYPECODE_VARRAY,
|
||||
OCCI_TYPECODE_TABLE = OCI_TYPECODE_TABLE,
|
||||
OCCI_TYPECODE_CLOB = OCI_TYPECODE_CLOB,
|
||||
OCCI_TYPECODE_BLOB = OCI_TYPECODE_BLOB,
|
||||
OCCI_TYPECODE_BFILE = OCI_TYPECODE_BFILE,
|
||||
OCCI_TYPECODE_OBJECT = OCI_TYPECODE_OBJECT,
|
||||
OCCI_TYPECODE_NAMEDCOLLECTION = OCI_TYPECODE_NAMEDCOLLECTION
|
||||
};
|
||||
|
||||
enum CharSetForm
|
||||
{
|
||||
OCCI_SQLCS_IMPLICIT = SQLCS_IMPLICIT // use local db char set
|
||||
,OCCI_SQLCS_NCHAR = SQLCS_NCHAR // use local db nchar set
|
||||
,OCCI_SQLCS_EXPLICIT = SQLCS_EXPLICIT // char set explicitly specified
|
||||
,OCCI_SQLCS_FLEXIBLE = SQLCS_FLEXIBLE // pl/sql flexible parameter
|
||||
};
|
||||
|
||||
enum LobOpenMode
|
||||
{ OCCI_LOB_READONLY = OCI_LOB_READONLY
|
||||
,OCCI_LOB_READWRITE = OCI_LOB_READWRITE
|
||||
,OCCI_LOB_WRITEONLY = OCI_LOB_WRITEONLY
|
||||
,OCCI_LOB_APPENDONLY = OCI_LOB_APPENDONLY
|
||||
,OCCI_LOB_FULLOVERWRITE = OCI_LOB_FULLOVERWRITE
|
||||
,OCCI_LOB_FULLREAD = OCI_LOB_FULLREAD
|
||||
};
|
||||
|
||||
enum LobOptionType
|
||||
{
|
||||
OCCI_LOB_OPT_NONE = 0,
|
||||
OCCI_LOB_OPT_COMPRESS = OCI_LOB_OPT_COMPRESS,
|
||||
OCCI_LOB_OPT_ENCRYPT = OCI_LOB_OPT_ENCRYPT,
|
||||
OCCI_LOB_OPT_DEDUPLICATE = OCI_LOB_OPT_DEDUPLICATE,
|
||||
OCCI_LOB_OPT_ALLOCSIZE = OCI_LOB_OPT_ALLOCSIZE,
|
||||
OCCI_LOB_OPT_CONTENTTYPE = OCI_LOB_OPT_CONTENTTYPE,
|
||||
OCCI_LOB_OPT_MODTIME = OCI_LOB_OPT_MODTIME
|
||||
};
|
||||
|
||||
enum LobOptionValue
|
||||
{
|
||||
// Compression Options
|
||||
OCCI_LOB_COMPRESS_OFF = OCI_LOB_COMPRESS_OFF,
|
||||
OCCI_LOB_COMPRESS_ON = OCI_LOB_COMPRESS_ON,
|
||||
// Encryption Options
|
||||
OCCI_LOB_ENCRYPT_OFF = OCI_LOB_ENCRYPT_OFF,
|
||||
OCCI_LOB_ENCRYPT_ON = OCI_LOB_ENCRYPT_ON,
|
||||
// Sharing Options
|
||||
OCCI_LOB_DEDUPLICATE_OFF = OCI_LOB_DEDUPLICATE_OFF,
|
||||
OCCI_LOB_DEDUPLICATE_ON = OCI_LOB_DEDUPLICATE_ON
|
||||
};
|
||||
|
||||
class RefCounted {
|
||||
public:
|
||||
RefCounted();
|
||||
virtual ~RefCounted(){}
|
||||
const RefCounted * newRef() const;
|
||||
void deleteRef() const;
|
||||
|
||||
private:
|
||||
|
||||
void onZeroReferences();
|
||||
unsigned long references_;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class ConstPtr
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
ConstPtr( const T* ptr = 0 );
|
||||
ConstPtr( const ConstPtr<T>& mp );
|
||||
~ConstPtr();
|
||||
const T * operator->() const;
|
||||
const T* rawPtr() const;
|
||||
|
||||
#ifdef MEMBER_TEMPLATE
|
||||
template<class OtherType> operator ConstPtr<OtherType>();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
void operator=( const ConstPtr<T>& mp );
|
||||
const T* rawPtr_;
|
||||
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class Ptr : public ConstPtr<T> {
|
||||
|
||||
public:
|
||||
|
||||
Ptr( T* ptr = 0 );
|
||||
Ptr( const Ptr<T>& mp );
|
||||
void operator=( const Ptr<T>& mp );
|
||||
const T * operator->() const;
|
||||
T * operator->();
|
||||
T* rawPtr() ;
|
||||
const T* rawPtr() const;
|
||||
|
||||
|
||||
|
||||
#ifdef MEMBER_TEMPLATE
|
||||
template<class OtherType>
|
||||
operator Ptr<OtherType>();
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
EXPORT FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
void getVector(const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect);
|
||||
void getVector(const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<UString> &vect);
|
||||
void getVector( const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<Blob> &vect) ;
|
||||
void getVector( const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<Clob> &vect) ;
|
||||
void getVector( const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<Bfile> &vect) ;
|
||||
void getVector( const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<Number> &vect) ;
|
||||
void getVector( const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<BFloat> &vect);
|
||||
void getVector(const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<BDouble> &vect);
|
||||
void getVector( const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<Bytes> &vect) ;
|
||||
void getVector( const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<Date> &vect) ;
|
||||
void getVector( const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
|
||||
void getVector( const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
|
||||
void getVector( const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
|
||||
template <class T>
|
||||
void getVectorOfRefs( const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector< Ref<T> > &vect) ;
|
||||
|
||||
#if !defined(WIN32COMMON) && !defined(__MVS__)
|
||||
template <class T>
|
||||
void getVector(const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector< Ref<T> > &vect) ;
|
||||
#endif
|
||||
#if defined(WIN32COMMON) || defined(__MVS__)
|
||||
template <class T>
|
||||
void getVector(const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<T> &vect,
|
||||
void *(*rSQL)(void *));
|
||||
#else
|
||||
template <class T>
|
||||
void getVector(const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<T *> &vect,
|
||||
void *(*rSQL)(void *));
|
||||
#endif
|
||||
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect) ;
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector<UString> &vect) ;
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector<Blob> &vect) ;
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector<Clob> &vect) ;
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector<Bfile> &vect) ;
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector<BFloat> &vect) ;
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector<BDouble> &vect) ;
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector<Number> &vect) ;
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector<Bytes> &vect) ;
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector<Date> &vect) ;
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
|
||||
template <class T>
|
||||
void setVectorOfRefs( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector< Ref<T> > &vect) ;
|
||||
#if !defined(WIN32COMMON) && !defined(__MVS__)
|
||||
template <class T>
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector< Ref<T> > &vect) ;
|
||||
#endif
|
||||
#if defined(WIN32COMMON) || defined(__MVS__)
|
||||
template <class T>
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector< T > &vect) ;
|
||||
#else
|
||||
template <class T>
|
||||
void setVector( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector< T* > &vect) ;
|
||||
#endif
|
||||
|
||||
void getVector( ResultSet *rs, unsigned int index,
|
||||
OCCI_STD_NAMESPACE::vector<int> &vect) ;
|
||||
void getVector( ResultSet *rs, unsigned int index,
|
||||
OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect) ;
|
||||
void getVector( ResultSet *rs, unsigned int index,
|
||||
OCCI_STD_NAMESPACE::vector<UString> &vect) ;//UTF16 support
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<unsigned int> &vect) ;
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<float> &vect);
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<BFloat> &vect);
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<double> &vect);
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<BDouble> &vect);
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Date> &vect) ;
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<RefAny> &vect) ;
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Blob> &vect) ;
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Clob> &vect) ;
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Bfile> &vect) ;
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Number> &vect) ;
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
|
||||
template <class T>
|
||||
void getVectorOfRefs(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) ;
|
||||
#if !defined(WIN32COMMON) && !defined(__MVS__)
|
||||
template <class T>
|
||||
void getVector(ResultSet *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) ;
|
||||
#endif
|
||||
#if defined(WIN32COMMON) || defined(__MVS__)
|
||||
template <class T>
|
||||
void getVector( ResultSet *rs, unsigned int index,
|
||||
OCCI_STD_NAMESPACE::vector< T > &vect) ;
|
||||
#else
|
||||
template <class T>
|
||||
void getVector( ResultSet *rs, unsigned int index,
|
||||
OCCI_STD_NAMESPACE::vector< T* > &vect) ;
|
||||
#endif
|
||||
|
||||
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<RefAny> &vect) ;
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Blob> &vect) ;
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Clob> &vect) ;
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Bfile> &vect) ;
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Number> &vect) ;
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
|
||||
void getVector( Statement *rs, unsigned int index,
|
||||
OCCI_STD_NAMESPACE::vector<int> &vect) ;
|
||||
void getVector( Statement *rs, unsigned int index,
|
||||
OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect) ;
|
||||
void getVector( Statement *rs, unsigned int index,
|
||||
OCCI_STD_NAMESPACE::vector<UString> &vect) ;//UTF16 support
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<unsigned int> &vect) ;
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<float> &vect) ;
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<BFloat> &vect) ;
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<double> &vect) ;
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<BDouble> &vect) ;
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Date> &vect) ;
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
|
||||
template <class T>
|
||||
void getVectorOfRefs(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) ;
|
||||
#if !defined(WIN32COMMON) && !defined(__MVS__)
|
||||
template <class T>
|
||||
void getVector(Statement *rs, unsigned int,
|
||||
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) ;
|
||||
#endif
|
||||
#if defined(WIN32COMMON) || defined(__MVS__)
|
||||
template <class T>
|
||||
void getVector( Statement *rs, unsigned int index,
|
||||
OCCI_STD_NAMESPACE::vector< T > &vect) ;
|
||||
#else
|
||||
template <class T>
|
||||
void getVector( Statement *rs, unsigned int index,
|
||||
OCCI_STD_NAMESPACE::vector< T* > &vect) ;
|
||||
#endif
|
||||
|
||||
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<int> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<unsigned int> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<double> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<BDouble> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<float> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<BFloat> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Number> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype);
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<RefAny> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Blob> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Clob> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Bfile> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Timestamp> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<IntervalDS> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<IntervalYM> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Date> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
template <class T>
|
||||
void setVectorOfRefs(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
#if !defined(WIN32COMMON) && !defined(__MVS__)
|
||||
template <class T>
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
#endif
|
||||
#if defined(WIN32COMMON) || defined(__MVS__)
|
||||
template <class T>
|
||||
void setVector( Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector< T > &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
#else
|
||||
template <class T>
|
||||
void setVector( Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<T* > &vect,
|
||||
const OCCI_STD_NAMESPACE::string &sqltype) ;
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------------
|
||||
Statement setVector functions, schema & type separate
|
||||
arguments - multibyte support
|
||||
------------------------------------------------------------------------
|
||||
*/
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<int> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<unsigned int> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<double> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<BDouble> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<float> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<BFloat> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Number> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName);
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<RefAny> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Blob> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Clob> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Bfile> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Timestamp> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<IntervalDS> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<IntervalYM> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Date> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
template <class T>
|
||||
void setVectorOfRefs(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
|
||||
#if !defined(WIN32COMMON) && !defined(__MVS__)
|
||||
template <class T>
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
#endif
|
||||
|
||||
#if defined(WIN32COMMON) || defined(__MVS__)
|
||||
template <class T>
|
||||
void setVector( Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector< T > &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
#else
|
||||
template <class T>
|
||||
void setVector( Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<T* > &vect, const OCCI_STD_NAMESPACE::string
|
||||
&schemaName, const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
Statement setVector function - UTF16 support
|
||||
-------------------------------------------------------------------------
|
||||
*/
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<int> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<unsigned int> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<double> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<BDouble> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<float> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<BFloat> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Number> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName);
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<UString> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<UString> &vect,
|
||||
const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<RefAny> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Blob> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Clob> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Bfile> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Timestamp> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<IntervalDS> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<IntervalYM> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Date> &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
template <class T>
|
||||
void setVectorOfRefs(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
|
||||
#if !defined(WIN32COMMON) && !defined(__MVS__)
|
||||
template <class T>
|
||||
void setVector(Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
#endif
|
||||
|
||||
#if defined(WIN32COMMON) || defined(__MVS__)
|
||||
template <class T>
|
||||
void setVector( Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector< T > &vect,
|
||||
const UString &schemaName,
|
||||
const UString &typeName) ;
|
||||
#else
|
||||
template <class T>
|
||||
void setVector( Statement *stmt, unsigned int paramIndex,
|
||||
const OCCI_STD_NAMESPACE::vector<T* > &vect, const UString
|
||||
&schemaName, const UString &typeName) ;
|
||||
#endif
|
||||
|
||||
|
||||
/* Global method for array pins */
|
||||
template <class T>
|
||||
void pinVectorOfRefs( const Connection *conn,
|
||||
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
|
||||
OCCI_STD_NAMESPACE::vector<T* > &vectObj,
|
||||
LockOptions lockOpt = OCCI_LOCK_NONE );
|
||||
|
||||
template <class T>
|
||||
void pinVectorOfRefs( const Connection *conn,
|
||||
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
|
||||
LockOptions lockOpt = OCCI_LOCK_NONE );
|
||||
|
||||
#ifdef ORAXB8_DEFINED
|
||||
void readVectorOfBfiles(const Connection *conn,
|
||||
OCCI_STD_NAMESPACE::vector<Bfile> &vec,
|
||||
oraub8 *byte_amts, oraub8 *offsets,
|
||||
unsigned char *buffers[], oraub8 *buffer_lens);
|
||||
|
||||
void readVectorOfBlobs(const Connection *conn,
|
||||
OCCI_STD_NAMESPACE::vector<Blob> &vec,
|
||||
oraub8 *byte_amts, oraub8 *offsets,
|
||||
unsigned char *buffers[], oraub8 *buffer_lens);
|
||||
void writeVectorOfBlobs(const Connection *conn,
|
||||
OCCI_STD_NAMESPACE::vector<Blob> &vec,
|
||||
oraub8 *byte_amts, oraub8 *offsets,
|
||||
unsigned char *buffers[], oraub8 *buffer_lens);
|
||||
|
||||
void readVectorOfClobs(const Connection *conn,
|
||||
OCCI_STD_NAMESPACE::vector<Clob> &vec,
|
||||
oraub8 *byte_amts, oraub8 *char_amts, oraub8 *offsets,
|
||||
unsigned char *buffers[], oraub8 *buffer_lens);
|
||||
void writeVectorOfClobs(const Connection *conn,
|
||||
OCCI_STD_NAMESPACE::vector<Clob> &vec,
|
||||
oraub8 *byte_amts, oraub8 *char_amts, oraub8 *offsets,
|
||||
unsigned char *buffers[], oraub8 *buffer_lens);
|
||||
void readVectorOfClobs(const Connection *conn,
|
||||
OCCI_STD_NAMESPACE::vector<Clob> &vec,
|
||||
oraub8 *byte_amts, oraub8 *char_amts, oraub8 *offsets,
|
||||
utext *buffers[], oraub8 *buffer_lens);
|
||||
void writeVectorOfClobs(const Connection *conn,
|
||||
OCCI_STD_NAMESPACE::vector<Clob> &vec,
|
||||
oraub8 *byte_amts, oraub8 *char_amts, oraub8 *offsets,
|
||||
utext *buffers[], oraub8 *buffer_lens);
|
||||
#endif
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
INTERNAL FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
} /* end of namespace occi */
|
||||
} /* end of namespace oracle */
|
||||
|
||||
|
||||
#endif /* _olint */
|
||||
|
||||
#endif /* OCCICOMMON_ORACLE */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,910 @@
|
||||
/* Copyright (c) 2000, 2007, Oracle. All rights reserved. */
|
||||
|
||||
/*
|
||||
NAME
|
||||
occiObjects.h - header file for OCCI object classes
|
||||
|
||||
DESCRIPTION
|
||||
Class definitions for Ref, RefAny, AnyData
|
||||
|
||||
RELATED DOCUMENTS
|
||||
<note any documents related to this facility>
|
||||
|
||||
EXPORT FUNCTION(S)
|
||||
<external functions declared for use outside package - one-line
|
||||
descriptions>
|
||||
|
||||
INTERNAL FUNCTION(S)
|
||||
<other external functions declared - one-line descriptions>
|
||||
|
||||
EXAMPLES
|
||||
|
||||
NOTES
|
||||
<other useful comments, qualifications, etc.>
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _olint /* disable olint check */
|
||||
|
||||
#ifndef OCCIOBJECTS_ORACLE
|
||||
# define OCCIOBJECTS_ORACLE
|
||||
|
||||
#ifndef OCCICOMMON_ORACLE
|
||||
#include <occiCommon.h>
|
||||
#endif
|
||||
|
||||
namespace oracle {
|
||||
namespace occi {
|
||||
struct AnyDataCtx {
|
||||
ConnectionImpl *occiSession;
|
||||
OCIAnyData *anyData;
|
||||
void *objHeader;
|
||||
ub4 errNum;
|
||||
};
|
||||
typedef struct AnyDataCtx AnyDataCtx;
|
||||
|
||||
class PObject
|
||||
{
|
||||
public:
|
||||
enum LockOption {OCCI_LOCK_WAIT, OCCI_LOCK_NOWAIT};
|
||||
enum UnpinOption {OCCI_PINCOUNT_DECR, OCCI_PINCOUNT_RESET};
|
||||
static void destroy(void *);
|
||||
static void refresh(void *);
|
||||
PObject();
|
||||
PObject(const void *ctx);
|
||||
PObject(const PObject& obj);
|
||||
virtual ~PObject();
|
||||
PObject& operator=(const PObject& obj);
|
||||
void *operator new(size_t size);
|
||||
void *operator new(size_t size, const Connection *x,
|
||||
const OCCI_STD_NAMESPACE::string& tablename,
|
||||
const char *typeName);
|
||||
void *operator new(size_t size, const Connection *sess,
|
||||
const OCCI_STD_NAMESPACE::string& tablename,
|
||||
const OCCI_STD_NAMESPACE::string& typName ,
|
||||
const OCCI_STD_NAMESPACE::string& schTabName="",
|
||||
const OCCI_STD_NAMESPACE::string& schTypName = "");
|
||||
void *operator new(size_t size, const Connection *sess,
|
||||
const UString& tablename, const UString &typName,
|
||||
const UString& schTabName, const UString& schTypName);
|
||||
void *operator new(size_t size, void *adctx);
|
||||
void operator delete(void *obj, size_t size);
|
||||
RefAny getRef() const;
|
||||
bool isLocked() const;
|
||||
void unpin(UnpinOption mode=OCCI_PINCOUNT_DECR);
|
||||
void pin();
|
||||
void lock(PObject::LockOption lock_option);
|
||||
void unmark();
|
||||
void flush();
|
||||
void markDelete();
|
||||
void markModified();
|
||||
bool isNull() const;
|
||||
void setNull();
|
||||
const Connection *getConnection() const;
|
||||
virtual OCCI_STD_NAMESPACE::string getSQLTypeName() const = 0;
|
||||
virtual void getSQLTypeName(Environment *env, void **schName,
|
||||
unsigned int &schNameLen, void **typeName,
|
||||
unsigned int &typeNameLen) const = 0;
|
||||
void getSQLTypeName(Environment *env, void *(*rSQL)(void *),
|
||||
void **schname, unsigned int &schnamelen,
|
||||
void **typname, unsigned int &typnamelen) const;
|
||||
virtual void writeSQL(AnyData& stream) = 0;
|
||||
virtual void readSQL(AnyData& stream) = 0;
|
||||
private:
|
||||
static void initialise( void * obj, const Connection * sess,
|
||||
void *schTabName, unsigned int schTabLen,
|
||||
void *tableName, unsigned int tabLen,
|
||||
void *schTypName, unsigned int schTypLen,
|
||||
void *typeName, unsigned int typLen);
|
||||
|
||||
ConnectionImpl *occiSession_;
|
||||
void *objHeader_;
|
||||
ub2 customNewed_;
|
||||
enum {CUSTOM_NEWED = 0x5cde};
|
||||
ub2 flags_;
|
||||
enum {NULL_INFO = 0x0001, GARBAGE_COLLECTED = 0x0002,
|
||||
REFRESH_OBJECT = 0x0004,
|
||||
CACHED_OBJECT = 0xBAF8};
|
||||
//check PObject implementation for CACHED_OBJECT flag
|
||||
// for future use
|
||||
void *pobjectExt;
|
||||
friend class RefImpl;
|
||||
};
|
||||
|
||||
class AnyData
|
||||
{
|
||||
public:
|
||||
~AnyData();
|
||||
AnyData(void *any) ;
|
||||
AnyData(const Connection *sessp);
|
||||
AnyData(const Connection *sessp, OCIAnyData *any, bool freeImg = true) ;
|
||||
|
||||
AnyData(const AnyData &src);
|
||||
AnyData& operator = (const AnyData &src);
|
||||
|
||||
OCIAnyData* getOCIAnyData() const;
|
||||
const Connection* getConnection() const;
|
||||
|
||||
|
||||
bool isNull() const ;
|
||||
void setNull() ;
|
||||
OCCI_STD_NAMESPACE::string getString() const ;
|
||||
UString getUString() const ;
|
||||
Blob getBlob() const ;
|
||||
Clob getClob() const ;
|
||||
Bfile getBfile() const ;
|
||||
BFloat getBFloat() const ;
|
||||
BDouble getBDouble() const ;
|
||||
Number getNumber() const ;
|
||||
Bytes getBytes() const ;
|
||||
Date getDate() const ;
|
||||
Timestamp getTimestamp() const ;
|
||||
IntervalYM getIntervalYM() const ;
|
||||
IntervalDS getIntervalDS() const ;
|
||||
PObject *getObject(void *(*rSQL)(void *)) const ;
|
||||
RefAny getRef() const ;
|
||||
|
||||
void setString(const OCCI_STD_NAMESPACE::string &str) ;
|
||||
void setUString(const UString &str) ;
|
||||
void setBlob(const Blob &blob) ;
|
||||
void setClob(const Clob &clob) ;
|
||||
void setBfile(const Bfile &bfile) ;
|
||||
void setBFloat(const BFloat &n) ;
|
||||
void setBDouble(const BDouble &n) ;
|
||||
void setNumber(const Number &n) ;
|
||||
void setBytes(const Bytes &bytes) ;
|
||||
void setDate(const Date &date) ;
|
||||
void setTimestamp(const Timestamp ×tamp) ;
|
||||
void setIntervalYM(const IntervalYM &intervalym) ;
|
||||
void setIntervalDS(const IntervalDS &intervalds) ;
|
||||
void setObject(const PObject *objptr) ;
|
||||
void setRef(const RefAny &ref) ;
|
||||
|
||||
void setFromString(const OCCI_STD_NAMESPACE::string &str) ;
|
||||
void setFromBfile(const Bfile &bfile) ;
|
||||
void setFromBFloat(const BFloat &n) ;
|
||||
void setFromBDouble(const BDouble &n) ;
|
||||
void setFromNumber(const Number &n) ;
|
||||
void setFromBytes(const Bytes &bytes) ;
|
||||
void setFromDate(const Date &date) ;
|
||||
void setFromTimestamp(const Timestamp ×tamp) ;
|
||||
void setFromIntervalYM(const IntervalYM &intervalym) ;
|
||||
void setFromIntervalDS(const IntervalDS &intervalds) ;
|
||||
void setFromObject(const PObject *objptr) ;
|
||||
void setFromRef(const RefAny &ref,
|
||||
const OCCI_STD_NAMESPACE::string &typname,
|
||||
const OCCI_STD_NAMESPACE::string &schname) ;
|
||||
|
||||
OCCI_STD_NAMESPACE::string getAsString() const ;
|
||||
Bfile getAsBfile() const ;
|
||||
BFloat getAsBFloat() const ;
|
||||
BDouble getAsBDouble() const ;
|
||||
Number getAsNumber() const ;
|
||||
Bytes getAsBytes() const ;
|
||||
Date getAsDate() const ;
|
||||
Timestamp getAsTimestamp() const ;
|
||||
IntervalYM getAsIntervalYM() const ;
|
||||
IntervalDS getAsIntervalDS() const ;
|
||||
PObject *getAsObject() const ;
|
||||
RefAny getAsRef() const ;
|
||||
|
||||
TypeCode getType() const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
// private data members
|
||||
Ptr<AnyDataImpl> anyDataImplPtr;
|
||||
|
||||
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class Ref
|
||||
{
|
||||
public:
|
||||
|
||||
Ref();
|
||||
Ref(const T *obj) ;
|
||||
Ref(const RefAny &refAny) ;
|
||||
Ref(const Ref<T> &src) ;
|
||||
Ref(const Connection *sessp, OCIRef *tref, bool copy=TRUE)
|
||||
;
|
||||
~Ref();
|
||||
Ref<T>& operator=(const Ref<T> &src)
|
||||
;
|
||||
Ref<T>& operator=(const T *obj) ;
|
||||
Ref<T>& operator=(const RefAny &src);
|
||||
T * operator->() ;
|
||||
T * ptr() ;
|
||||
T & operator *() ;
|
||||
const T * operator->() const;
|
||||
const T * ptr() const;
|
||||
const T & operator *() const ;
|
||||
void markDelete() ;
|
||||
void unmarkDelete() ;
|
||||
void setNull();
|
||||
bool isNull() const;
|
||||
void clear() ;
|
||||
bool isClear() const;
|
||||
void setPrefetch(const OCCI_STD_NAMESPACE::string &typeName,
|
||||
unsigned int depth);
|
||||
void setPrefetch(const OCCI_STD_NAMESPACE::string &schName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName,
|
||||
unsigned int depth);
|
||||
void setPrefetch(const UString &schName,
|
||||
const UString &typeName,
|
||||
unsigned int depth);
|
||||
void setPrefetch(unsigned int depth) ;
|
||||
void setLock(LockOptions );
|
||||
operator RefAny() const;
|
||||
OCIRef *getRef() const;
|
||||
const Connection *getConnection() const;
|
||||
bool operator == (const Ref<T> &ref) const;
|
||||
bool operator != (const Ref<T> &ref) const;
|
||||
bool operator == (const RefAny &refAnyR) const ;
|
||||
bool operator != (const RefAny &refAnyR) const ;
|
||||
OCIComplexObject *getCor() const;
|
||||
void setPinnedObject(PObject *objPtr);
|
||||
private:
|
||||
|
||||
RefImpl *rimplPtr;
|
||||
};
|
||||
|
||||
|
||||
class RefImpl
|
||||
{
|
||||
public:
|
||||
|
||||
RefImpl();
|
||||
RefImpl(PObject *obj) ;
|
||||
RefImpl(const RefAny &refAny) ;
|
||||
RefImpl(const RefImpl &src) ;
|
||||
RefImpl(const Connection *sessp, OCIRef *tref,
|
||||
bool copy=TRUE) ;
|
||||
~RefImpl();
|
||||
bool isNull() const ;
|
||||
void setNull() ;
|
||||
void markDelete() ;
|
||||
void unmarkDelete() ;
|
||||
void clear() ;
|
||||
bool isClear() const ;
|
||||
void setPrefetch(const OCCI_STD_NAMESPACE::string &typeName,
|
||||
unsigned int depth) ;
|
||||
void setPrefetch(const OCCI_STD_NAMESPACE::string &schName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName,
|
||||
unsigned int depth);
|
||||
void setPrefetch(const UString &schName,
|
||||
const UString &typeName,
|
||||
unsigned int depth);
|
||||
void setPrefetch(unsigned int depth) ;
|
||||
void setLock(LockOptions lckOption) ;
|
||||
PObject *pin() ;
|
||||
void unpin(PObject *obj) ;
|
||||
void setRefFromObjPtr(const PObject *obj) ;
|
||||
OCIRef* getRef() const;
|
||||
void setRefImpl(RefImpl *rptr);
|
||||
const Connection * getConnection() const;
|
||||
bool operator == (const RefImpl &refI) const ;
|
||||
bool operator == (const RefAny &refAnyR) const ;
|
||||
void assignObj(PObject *newObjPtr) ;
|
||||
void assignRefAny(const RefAny &src) ;
|
||||
// added following methods
|
||||
bool isEqual(PObject *obj);
|
||||
void operator = ( const RefImpl &src);
|
||||
OCIComplexObject *getCor() const;
|
||||
void setPinnedObject( PObject *objPtr);
|
||||
private:
|
||||
|
||||
OCIRef *ref;
|
||||
const ConnectionImpl *sessp;
|
||||
OCIComplexObject *corhp;
|
||||
OCCI_STD_NAMESPACE::list<void *> descriptorList;
|
||||
LockOptions lockOption;
|
||||
// added data member for object header
|
||||
void *objHeader;
|
||||
//common implementation function for setPrefetch
|
||||
void do_setPrefetch(void *schName, unsigned int schNameLen,
|
||||
void *typeName, unsigned int typeNameLen,
|
||||
unsigned int depth);
|
||||
};
|
||||
|
||||
|
||||
class RefAny
|
||||
{
|
||||
public:
|
||||
|
||||
RefAny();
|
||||
RefAny (const Connection *sessptr, const OCIRef *ref);
|
||||
RefAny (const Connection *sessptr, const OCIRef *ref, bool isowner);
|
||||
~RefAny() ;
|
||||
RefAny(const RefAny& src) ;
|
||||
RefAny& operator=(const RefAny& src) ;
|
||||
void markDelete() ;
|
||||
void unmarkDelete() ;
|
||||
void clear() ;
|
||||
bool isNull() const;
|
||||
OCIRef * getRef() const;
|
||||
const Connection * getConnection() const;
|
||||
bool operator == (const RefAny &refAnyR) const;
|
||||
bool operator != (const RefAny &refAnyR) const;
|
||||
bool isOwner() const;
|
||||
|
||||
private:
|
||||
|
||||
OCIRef *ref;
|
||||
const ConnectionImpl *sessp;
|
||||
// for future use
|
||||
void *refanyExt;
|
||||
bool owner;
|
||||
|
||||
friend RefAny MetaData::getRef(MetaData::AttrId) const;
|
||||
friend RefAny PObject::getRef() const;
|
||||
friend class AnyDataImpl;
|
||||
friend class ResultSetImpl;
|
||||
friend class StatementImpl;
|
||||
friend void getVector(const ResultSet *rs,
|
||||
unsigned int colIndex,
|
||||
OCCI_STD_NAMESPACE::vector<RefAny> &vect) ;
|
||||
friend void getVector(const Statement *stmt,
|
||||
unsigned int colIndex,
|
||||
OCCI_STD_NAMESPACE::vector<RefAny> &vect) ;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
Ref<T>::Ref()
|
||||
{
|
||||
rimplPtr = new RefImpl();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
Ref<T>::Ref(const T *obj)
|
||||
{
|
||||
rimplPtr = new RefImpl((PObject *)obj);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
Ref<T>::Ref(const RefAny &refAny)
|
||||
|
||||
{
|
||||
rimplPtr = new RefImpl(refAny);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
Ref<T>::Ref(const Ref<T>& src)
|
||||
|
||||
{
|
||||
rimplPtr = new RefImpl(*(src.rimplPtr));
|
||||
}
|
||||
|
||||
template <class T>
|
||||
Ref<T>::Ref(const Connection *sessp, OCIRef *tref, bool copy)
|
||||
|
||||
{
|
||||
rimplPtr = new RefImpl(sessp, tref, copy);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
Ref<T>::~Ref()
|
||||
{
|
||||
delete rimplPtr;
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
Ref<T>& Ref<T>::operator=(const Ref<T> &src)
|
||||
{
|
||||
if (&src == this)
|
||||
return *this;
|
||||
*rimplPtr = *(src.rimplPtr);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
Ref<T>& Ref<T>::operator=(const T *obj)
|
||||
{
|
||||
if (rimplPtr->isEqual((PObject *)obj))
|
||||
return *this;
|
||||
rimplPtr->assignObj((PObject *)obj);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
Ref<T>& Ref<T>::operator=(const RefAny &src)
|
||||
{
|
||||
rimplPtr->assignRefAny(src);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
T* Ref<T>::operator->()
|
||||
{
|
||||
return ((T *)rimplPtr->pin());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
T* Ref<T>::ptr()
|
||||
{
|
||||
return ((T *)rimplPtr->pin());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
T& Ref<T>::operator * ()
|
||||
{
|
||||
return ((T &)(*(rimplPtr->pin())));
|
||||
}
|
||||
|
||||
template <class T>
|
||||
const T* Ref<T>::operator->() const
|
||||
{
|
||||
return ((const T *)rimplPtr->pin());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
const T* Ref<T>::ptr() const
|
||||
{
|
||||
return ((const T *)rimplPtr->pin());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
const T& Ref<T>::operator * () const
|
||||
{
|
||||
return ((const T &)(*(rimplPtr->pin())));
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void Ref<T>::markDelete ()
|
||||
{
|
||||
rimplPtr->markDelete();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void Ref<T>::unmarkDelete ()
|
||||
{
|
||||
rimplPtr->unmarkDelete();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void Ref<T>::setNull()
|
||||
{
|
||||
rimplPtr->setNull();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool Ref<T>::isNull() const
|
||||
{
|
||||
return rimplPtr->isNull();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void Ref<T>::clear ()
|
||||
{
|
||||
rimplPtr->clear();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool Ref<T>::isClear() const
|
||||
{
|
||||
return rimplPtr->isClear();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void Ref<T>::setPrefetch (const OCCI_STD_NAMESPACE::string &typeName,
|
||||
unsigned int depth)
|
||||
|
||||
{
|
||||
rimplPtr->setPrefetch(typeName,depth);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void Ref<T>::setPrefetch (const OCCI_STD_NAMESPACE::string &schemaName,
|
||||
const OCCI_STD_NAMESPACE::string &typeName,
|
||||
unsigned int depth)
|
||||
|
||||
{
|
||||
rimplPtr->setPrefetch(schemaName,typeName,depth);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void Ref<T>::setPrefetch (const UString &schemaName,
|
||||
const UString &typeName,
|
||||
unsigned int depth)
|
||||
|
||||
{
|
||||
rimplPtr->setPrefetch(schemaName,typeName,depth);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void Ref<T>::setPrefetch (unsigned int depth)
|
||||
|
||||
{
|
||||
rimplPtr->setPrefetch(depth);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void Ref<T>::setLock (LockOptions lckOption)
|
||||
{
|
||||
rimplPtr->setLock(lckOption);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
OCIRef* Ref<T>::getRef() const
|
||||
{
|
||||
return (rimplPtr->getRef());
|
||||
}
|
||||
|
||||
template<class T>
|
||||
const Connection* Ref<T>::getConnection () const
|
||||
{
|
||||
return (rimplPtr->getConnection());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
Ref<T>::operator RefAny () const
|
||||
{
|
||||
if (isNull())
|
||||
return RefAny();
|
||||
return (RefAny(rimplPtr->getConnection(), rimplPtr->getRef()));
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool Ref<T>::operator ==(const Ref<T> &ref) const
|
||||
|
||||
{
|
||||
return ( (*rimplPtr) == (*(ref.rimplPtr)) );
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool Ref<T>::operator !=(const Ref<T> &ref) const
|
||||
|
||||
{
|
||||
return ( !((*rimplPtr) == (*(ref.rimplPtr))) );
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool Ref<T>::operator == (const RefAny & refAnyR) const
|
||||
|
||||
{
|
||||
return ( (*rimplPtr) == refAnyR );
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool Ref<T>::operator != (const RefAny & refAnyR) const
|
||||
|
||||
{
|
||||
return ( !((*rimplPtr) == refAnyR ));
|
||||
}
|
||||
|
||||
template <class T>
|
||||
OCIComplexObject * Ref<T>::getCor() const
|
||||
{
|
||||
return (rimplPtr->getCor());
|
||||
}
|
||||
|
||||
template < class T>
|
||||
void Ref<T>::setPinnedObject( PObject *objPtr)
|
||||
{
|
||||
rimplPtr->setPinnedObject(objPtr);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PROTOTYPES USED BY FUNCTION TEMPLATES
|
||||
---------------------------------------------------------------------------*/
|
||||
void getVectorOfOCIRefs( const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector<void *> &vect);
|
||||
void getVectorOfPObjects( const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector< PObject* > &vect,
|
||||
void *(*rSQL)(void *)) ;
|
||||
void setVectorOfOCIRefs( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector<void *> &vect,
|
||||
const OCCI_STD_NAMESPACE::vector< OCIInd> &vec_ind) ;
|
||||
void setVectorOfPObjects( AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector< PObject* > &vect) ;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
EXPORT FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
/*------------------- getVector for POBject----------------------------*/
|
||||
/*
|
||||
NAME
|
||||
getVector - overloaded function. Retrieves the attribute in the
|
||||
current position as a vector of PObject
|
||||
|
||||
PARAMETERS
|
||||
any - AnyData
|
||||
vect- reference to vector of PObject (OUT parameter).
|
||||
|
||||
DESCRIPTION
|
||||
Retrieves the attribute in the current position as a vector
|
||||
of PObject
|
||||
The attribute at the current position should be a collection
|
||||
type (varray or nested table). The SQL type of the elements in
|
||||
the collection should be compatible with PObject
|
||||
|
||||
RETURNS
|
||||
nothing
|
||||
|
||||
NOTES
|
||||
compatible SQL types : user defined types (SQLT_NTY) etc.
|
||||
*/
|
||||
|
||||
#if defined(WIN32COMMON) || defined(__MVS__)
|
||||
// and other platforms that do not support
|
||||
// partial function template specialization
|
||||
template <class T>
|
||||
void getVector(const AnyData &any, OCCI_STD_NAMESPACE::vector<T> &vect,
|
||||
void *(*rSQL)(void *))
|
||||
{
|
||||
OCCI_STD_NAMESPACE::vector< PObject *> vec_pobj;
|
||||
getVectorOfPObjects( any, vec_pobj, rSQL);
|
||||
|
||||
vect.clear();
|
||||
unsigned int size= vec_pobj.size();
|
||||
vect.reserve( size );
|
||||
for( unsigned int i=0; i< size; i++)
|
||||
vect.push_back( (T)vec_pobj[i] );
|
||||
}
|
||||
#else
|
||||
template <class T>
|
||||
void getVector(const AnyData &any, OCCI_STD_NAMESPACE::vector<T*> &vect,
|
||||
void *(*rSQL)(void *))
|
||||
{
|
||||
OCCI_STD_NAMESPACE::vector< PObject *> vec_pobj;
|
||||
getVectorOfPObjects( any, vec_pobj, rSQL);
|
||||
|
||||
vect.clear();
|
||||
unsigned int size= vec_pobj.size();
|
||||
vect.reserve( size );
|
||||
for( unsigned int i=0; i< size; i++)
|
||||
vect.push_back( (T*)vec_pobj[i] );
|
||||
}
|
||||
#endif /* end of #ifdef WIN32COMMON */
|
||||
|
||||
/*------------------- getVector for Ref<T>----------------------------*/
|
||||
/*
|
||||
NAME
|
||||
getVector - overloaded function. Retrieves the attribute in the
|
||||
current position as a vector of PObject
|
||||
|
||||
PARAMETERS
|
||||
any - AnyData
|
||||
vect- reference to vector of PObject (OUT parameter).
|
||||
|
||||
DESCRIPTION
|
||||
Retrieves the attribute in the current position as a vector
|
||||
of PObject
|
||||
The attribute at the current position should be a collection
|
||||
type (varray or nested table). The SQL type of the elements in
|
||||
the collection should be compatible with PObject
|
||||
|
||||
RETURNS
|
||||
nothing
|
||||
|
||||
NOTES
|
||||
compatible SQL types : user defined types (SQLT_NTY) etc.
|
||||
*/
|
||||
#if !defined(WIN32COMMON) && !defined(__MVS__)
|
||||
template <class T>
|
||||
void getVector(const AnyData &any,OCCI_STD_NAMESPACE::vector< Ref<T> > &vect)
|
||||
{
|
||||
OCCI_STD_NAMESPACE::vector< void *> vec_ref;
|
||||
getVectorOfOCIRefs( any, vec_ref);
|
||||
|
||||
vect.clear();
|
||||
unsigned int size = vec_ref.size();
|
||||
vect.reserve( size );
|
||||
const Connection *sess = any.getConnection();
|
||||
|
||||
for (unsigned int i=0; i< size; i++)
|
||||
{
|
||||
if (vec_ref[i] == (OCIRef *)0)
|
||||
vect.push_back(Ref<T>()); // pushing a default-constructed Ref
|
||||
else
|
||||
vect.push_back(Ref<T>(sess, (OCIRef *)vec_ref[i], FALSE));
|
||||
}
|
||||
}
|
||||
#endif /* end of #ifndef WIN32COMMON */
|
||||
|
||||
/*-----------------------setVector for PObject--------------------------*/
|
||||
/*
|
||||
NAME
|
||||
setVector - overloaded function. sets the attribute in the current
|
||||
position of anydata with the vector elements.
|
||||
|
||||
PARAMETERS
|
||||
none.
|
||||
|
||||
DESCRIPTION
|
||||
sets the attribute in the current position in anydata with the
|
||||
vector elements.
|
||||
The attribute in the current position of anydata should be a
|
||||
collection type. If the collection type is a varray, the input vector
|
||||
size should be equal to the size of the varray. Also the SQL type of
|
||||
the collection's elements should be compatible with PObject.
|
||||
|
||||
RETURNS
|
||||
nothing.
|
||||
|
||||
NOTES
|
||||
compatible SQL types : SQLT_NTY (user defined types).
|
||||
*/
|
||||
#if defined(WIN32COMMON) || defined(__MVS__)
|
||||
// and other platforms that do not support
|
||||
// partial function template specialization
|
||||
|
||||
template <class T>
|
||||
void setVector(AnyData &any, const OCCI_STD_NAMESPACE::vector<T> &vect)
|
||||
{
|
||||
OCCI_STD_NAMESPACE::vector< PObject *> vec_pobj;
|
||||
unsigned int size= vect.size();
|
||||
vec_pobj.reserve( size );
|
||||
for( unsigned int i=0; i< size; i++)
|
||||
vec_pobj.push_back( vect[i] );
|
||||
setVectorOfPObjects( any, vec_pobj);
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
template <class T>
|
||||
void setVector(AnyData &any, const OCCI_STD_NAMESPACE::vector<T*> &vect)
|
||||
{
|
||||
OCCI_STD_NAMESPACE::vector< PObject *> vec_pobj;
|
||||
unsigned int size= vect.size();
|
||||
vec_pobj.reserve( size );
|
||||
for( unsigned int i=0; i< size; i++)
|
||||
vec_pobj.push_back( vect[i] );
|
||||
setVectorOfPObjects( any, vec_pobj);
|
||||
|
||||
}
|
||||
#endif /* end of #ifdef WIN32COMMON */
|
||||
|
||||
/*-----------------------setVector for Ref<T>--------------------------*/
|
||||
/*
|
||||
NAME
|
||||
setVector - overloaded function. sets the attribute in the current
|
||||
position of anydata with the vector elements.
|
||||
|
||||
PARAMETERS
|
||||
none.
|
||||
|
||||
DESCRIPTION
|
||||
sets the attribute in the current position in anydata with the
|
||||
vector elements.
|
||||
The attribute in the current position of anydata should be a
|
||||
collection type. If the collection type is a varray, the input vector
|
||||
size should be equal to the size of the varray. Also the SQL type of
|
||||
the collection's elements should be compatible with PObject.
|
||||
|
||||
RETURNS
|
||||
nothing.
|
||||
|
||||
NOTES
|
||||
compatible SQL types : SQLT_NTY (user defined types).
|
||||
*/
|
||||
#if !defined(WIN32COMMON) && !defined(__MVS__)
|
||||
template <class T>
|
||||
void setVector(AnyData &any, const OCCI_STD_NAMESPACE::vector< Ref<T> > &vect)
|
||||
{
|
||||
OCCI_STD_NAMESPACE::vector< void *> vec_ref;
|
||||
OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
|
||||
|
||||
unsigned int size= vect.size();
|
||||
vec_ref.reserve( size );
|
||||
vec_ind.reserve( size );
|
||||
for( unsigned int i=0; i< size; i++)
|
||||
{
|
||||
vec_ref.push_back( vect[i].getRef() );
|
||||
vec_ind.push_back(vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
|
||||
}
|
||||
setVectorOfOCIRefs( any, vec_ref, vec_ind);
|
||||
|
||||
}
|
||||
#endif /* end of #ifndef WIN32COMMON */
|
||||
|
||||
// Platform independent get/setVectorOfRefs method added
|
||||
// get(set)Vector of Ref<T> and get(set)VectorOfRefs are identical
|
||||
// in functionality.
|
||||
|
||||
/*------------------- getVectorOfRefs for Ref<T>----------------------------*/
|
||||
/*
|
||||
NAME
|
||||
getVectorOfRefs - overloaded function. Retrieves the attribute in the
|
||||
current position as a vector of PObject
|
||||
|
||||
PARAMETERS
|
||||
any - AnyData
|
||||
vect- reference to vector of PObject (OUT parameter).
|
||||
|
||||
DESCRIPTION
|
||||
Retrieves the attribute in the current position as a vector
|
||||
of PObject
|
||||
The attribute at the current position should be a collection
|
||||
type (varray or nested table). The SQL type of the elements in
|
||||
the collection should be compatible with PObject
|
||||
|
||||
RETURNS
|
||||
nothing
|
||||
|
||||
NOTES
|
||||
compatible SQL types : user defined types (SQLT_NTY) etc.
|
||||
*/
|
||||
|
||||
template <class T>
|
||||
void getVectorOfRefs(const AnyData &any,
|
||||
OCCI_STD_NAMESPACE::vector< Ref<T> > &vect)
|
||||
{
|
||||
OCCI_STD_NAMESPACE::vector< void *> vec_ref;
|
||||
getVectorOfOCIRefs( any, vec_ref);
|
||||
|
||||
vect.clear();
|
||||
unsigned int size = vec_ref.size();
|
||||
vect.reserve( size );
|
||||
const Connection *sess = any.getConnection();
|
||||
|
||||
for (unsigned int i=0; i< size; i++)
|
||||
{
|
||||
if (vec_ref[i] == (OCIRef *)0)
|
||||
vect.push_back(Ref<T>()); // pushing a default-constructed Ref
|
||||
else
|
||||
vect.push_back(Ref<T>(sess, (OCIRef *)vec_ref[i], FALSE));
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------setVectorOfRefs for Ref<T>--------------------------*/
|
||||
/*
|
||||
NAME
|
||||
setVectorOfRefs - overloaded function. sets the attribute in the current
|
||||
position of anydata with the vector elements.
|
||||
|
||||
PARAMETERS
|
||||
none.
|
||||
|
||||
DESCRIPTION
|
||||
sets the attribute in the current position in anydata with the
|
||||
vector elements.
|
||||
The attribute in the current position of anydata should be a
|
||||
collection type. If the collection type is a varray, the input vector
|
||||
size should be equal to the size of the varray. Also the SQL type of
|
||||
the collection's elements should be compatible with PObject.
|
||||
|
||||
RETURNS
|
||||
nothing.
|
||||
|
||||
NOTES
|
||||
compatible SQL types : SQLT_NTY (user defined types).
|
||||
*/
|
||||
|
||||
template <class T>
|
||||
void setVectorOfRefs(AnyData &any,
|
||||
const OCCI_STD_NAMESPACE::vector< Ref<T> > &vect)
|
||||
|
||||
{
|
||||
OCCI_STD_NAMESPACE::vector< void *> vec_ref;
|
||||
OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
|
||||
|
||||
unsigned int size= vect.size();
|
||||
vec_ref.reserve( size );
|
||||
vec_ind.reserve( size );
|
||||
for( unsigned int i=0; i< size; i++)
|
||||
{
|
||||
vec_ref.push_back( vect[i].getRef() );
|
||||
vec_ind.push_back(vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
|
||||
}
|
||||
setVectorOfOCIRefs( any, vec_ref, vec_ind);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
INTERNAL FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
} /* end of namespace occi */
|
||||
} /* end of namespace oracle */
|
||||
#endif /* OCCIOBJECTS_ORACLE */
|
||||
|
||||
#endif /* _olint */
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,182 @@
|
||||
|
||||
/* Copyright (c) 1997, 2005, Oracle. All rights reserved. */
|
||||
|
||||
/* NOTE: See 'header_template.doc' in the 'doc' dve under the 'forms'
|
||||
directory for the header file template that includes instructions.
|
||||
*/
|
||||
|
||||
/*
|
||||
NAME
|
||||
oci1.h - Cartridge Service definitions
|
||||
|
||||
DESCRIPTION
|
||||
<short description of component this file declares/defines>
|
||||
|
||||
RELATED DOCUMENTS
|
||||
|
||||
INSPECTION STATUS
|
||||
Inspection date:
|
||||
Inspection status:
|
||||
Estimated increasing cost defects per page:
|
||||
Rule sets:
|
||||
|
||||
ACCEPTANCE REVIEW STATUS
|
||||
Review date:
|
||||
Review status:
|
||||
Reviewers:
|
||||
|
||||
PUBLIC FUNCTION(S)
|
||||
<list of external functions declared/defined - with one-line descriptions>
|
||||
|
||||
PRIVATE FUNCTION(S)
|
||||
<list of static functions defined in .c file - with one-line descriptions>
|
||||
|
||||
EXAMPLES
|
||||
|
||||
NOTES
|
||||
<other useful comments, qualifications, etc.>
|
||||
|
||||
MODIFIED (MM/DD/YY)
|
||||
mbastawa 09/16/05 - dbhygiene
|
||||
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
|
||||
nramakri 01/16/98 - remove #ifdef NEVER clause
|
||||
ewaugh 12/18/97 - Turn type wrappers into functions.
|
||||
skabraha 12/02/97 - Adding data structures & constants for OCIFile
|
||||
rhwu 12/02/97 - OCI Thread
|
||||
nramakri 12/15/97 - move to core4
|
||||
ewaugh 12/11/97 - add OCIFormat package constants
|
||||
ssamu 12/10/97 - do not include s.h
|
||||
nramakri 11/19/97 - add OCIExtract definitions
|
||||
ssamu 11/14/97 - creation
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef OCI1_ORACLE
|
||||
# define OCI1_ORACLE
|
||||
|
||||
# ifndef ORATYPES
|
||||
# include <oratypes.h>
|
||||
# endif
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PUBLIC TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
/* Constants required by the OCIFormat package. */
|
||||
|
||||
#define OCIFormatUb1(variable) OCIFormatTUb1(), &(variable)
|
||||
#define OCIFormatUb2(variable) OCIFormatTUb2(), &(variable)
|
||||
#define OCIFormatUb4(variable) OCIFormatTUb4(), &(variable)
|
||||
#define OCIFormatUword(variable) OCIFormatTUword(), &(variable)
|
||||
#define OCIFormatUbig_ora(variable) OCIFormatTUbig_ora(), &(variable)
|
||||
#define OCIFormatSb1(variable) OCIFormatTSb1(), &(variable)
|
||||
#define OCIFormatSb2(variable) OCIFormatTSb2(), &(variable)
|
||||
#define OCIFormatSb4(variable) OCIFormatTSb4(), &(variable)
|
||||
#define OCIFormatSword(variable) OCIFormatTSword(), &(variable)
|
||||
#define OCIFormatSbig_ora(variable) OCIFormatTSbig_ora(), &(variable)
|
||||
#define OCIFormatEb1(variable) OCIFormatTEb1(), &(variable)
|
||||
#define OCIFormatEb2(variable) OCIFormatTEb2(), &(variable)
|
||||
#define OCIFormatEb4(variable) OCIFormatTEb4(), &(variable)
|
||||
#define OCIFormatEword(variable) OCIFormatTEword(), &(variable)
|
||||
#define OCIFormatChar(variable) OCIFormatTChar(), &(variable)
|
||||
#define OCIFormatText(variable) OCIFormatTText(), (variable)
|
||||
#define OCIFormatDouble(variable) OCIFormatTDouble(), &(variable)
|
||||
#define OCIFormatDvoid(variable) OCIFormatTDvoid(), (variable)
|
||||
#define OCIFormatEnd OCIFormatTEnd()
|
||||
|
||||
#define OCIFormatDP 6
|
||||
|
||||
|
||||
/*----------------- Public Constants for OCIFile -------------------------*/
|
||||
|
||||
/* flags for open.*/
|
||||
/* flags for mode */
|
||||
#define OCI_FILE_READ_ONLY 1 /* open for read only */
|
||||
#define OCI_FILE_WRITE_ONLY 2 /* open for write only */
|
||||
#define OCI_FILE_READ_WRITE 3 /* open for read & write */
|
||||
/* flags for create */
|
||||
#define OCI_FILE_EXIST 0 /* the file should exist */
|
||||
#define OCI_FILE_CREATE 1 /* create if the file doesn't exist */
|
||||
#define OCI_FILE_EXCL 2 /* the file should not exist */
|
||||
#define OCI_FILE_TRUNCATE 4 /* create if the file doesn't exist,
|
||||
else truncate file the file to 0 */
|
||||
#define OCI_FILE_APPEND 8 /* open the file in append mode */
|
||||
|
||||
/* flags for seek */
|
||||
#define OCI_FILE_SEEK_BEGINNING 1 /* seek from the beginning of the file */
|
||||
#define OCI_FILE_SEEK_CURRENT 2 /* seek from the current position */
|
||||
#define OCI_FILE_SEEK_END 3 /* seek from the end of the file */
|
||||
|
||||
#define OCI_FILE_FORWARD 1 /* seek forward */
|
||||
#define OCI_FILE_BACKWARD 2 /* seek backward */
|
||||
|
||||
/* file type */
|
||||
#define OCI_FILE_BIN 0 /* binary file */
|
||||
#define OCI_FILE_TEXT 1 /* text file */
|
||||
#define OCI_FILE_STDIN 2 /* standard i/p */
|
||||
#define OCI_FILE_STDOUT 3 /* standard o/p */
|
||||
#define OCI_FILE_STDERR 4 /* standard error */
|
||||
|
||||
/* Represents an open file */
|
||||
typedef struct OCIFileObject OCIFileObject;
|
||||
|
||||
|
||||
/*--------------------- OCI Thread Object Definitions------------------------*/
|
||||
|
||||
/* OCIThread Context */
|
||||
typedef struct OCIThreadContext OCIThreadContext;
|
||||
|
||||
/* OCIThread Mutual Exclusion Lock */
|
||||
typedef struct OCIThreadMutex OCIThreadMutex;
|
||||
|
||||
/* OCIThread Key for Thread-Specific Data */
|
||||
typedef struct OCIThreadKey OCIThreadKey;
|
||||
|
||||
/* OCIThread Thread ID */
|
||||
typedef struct OCIThreadId OCIThreadId;
|
||||
|
||||
/* OCIThread Thread Handle */
|
||||
typedef struct OCIThreadHandle OCIThreadHandle;
|
||||
|
||||
|
||||
/*-------------------- OCI Thread Callback Function Pointers ----------------*/
|
||||
|
||||
/* OCIThread Key Destructor Function Type */
|
||||
typedef void (*OCIThreadKeyDestFunc)( void * );
|
||||
|
||||
|
||||
/* Flags passed into OCIExtractFromXXX routines to direct processing */
|
||||
#define OCI_EXTRACT_CASE_SENSITIVE 0x1 /* matching is case sensitive */
|
||||
#define OCI_EXTRACT_UNIQUE_ABBREVS 0x2 /* unique abbreviations for keys
|
||||
are allowed */
|
||||
#define OCI_EXTRACT_APPEND_VALUES 0x4 /* if multiple values for a key
|
||||
exist, this determines if the
|
||||
new value should be appended
|
||||
to (or replace) the current
|
||||
list of values */
|
||||
|
||||
/* Constants passed into OCIExtractSetKey routine */
|
||||
#define OCI_EXTRACT_MULTIPLE 0x8 /* key can accept multiple values */
|
||||
#define OCI_EXTRACT_TYPE_BOOLEAN 1 /* key type is boolean */
|
||||
#define OCI_EXTRACT_TYPE_STRING 2 /* key type is string */
|
||||
#define OCI_EXTRACT_TYPE_INTEGER 3 /* key type is integer */
|
||||
#define OCI_EXTRACT_TYPE_OCINUM 4 /* key type is ocinum */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PRIVATE TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PUBLIC FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PRIVATE FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#endif /* OCI1_ORACLE */
|
||||
@ -0,0 +1,317 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
/* Copyright (c) 1998, 2005, Oracle. All rights reserved. */
|
||||
|
||||
/*
|
||||
NAME
|
||||
oci8dp.h - OCI: Direct Path API interface prototypes.
|
||||
|
||||
DESCRIPTION
|
||||
Public types, constants, and interfaces to the direct path API.
|
||||
|
||||
RELATED DOCUMENTS
|
||||
|
||||
NOTES
|
||||
This file is not directly included by the application, this file
|
||||
is included by "oci.h", which the application should include.
|
||||
|
||||
MODIFIED (MM/DD/YY)
|
||||
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
|
||||
rphillip 02/27/04 - Add OCI_DIRPATH_COL_ERROR
|
||||
srseshad 03/12/03 - convert oci public api to ansi
|
||||
msakayed 10/28/02 - Bug #2643907: add OCI_ATTR_DIRPATH_SKIPINDEX_METHOD
|
||||
cmlim 04/13/01 - remove OCIDirPathStreamToStream - not used by dpapi
|
||||
cmlim 04/02/01 - OCI_DIRPATH_EXPR_OPQ_SQL_FN to OCI_DIRPATH_EXPR_SQL
|
||||
ebatbout 01/22/01 - PARTIAL value for OCIDirPathDataSave action parameter
|
||||
cmlim 07/20/00 - support opaques/sql strings in 8.2 dpapi
|
||||
cmlim 08/14/00 - support refs in 8.2 dpapi
|
||||
cmlim 04/17/00 - add defines for OCIDirPathFuncCtx handle & OCI_ATTR_D
|
||||
whe 09/01/99 - 976457:check __cplusplus for C++ code
|
||||
abrumm 04/16/99 - dpapi: more attributes
|
||||
abrumm 02/26/99 - add defines for DataSave action
|
||||
abrumm 10/04/98 - clen must be a ub4
|
||||
abrumm 05/27/98 - add column array flag values
|
||||
abrumm 05/12/98 - direct path api support
|
||||
abrumm 03/31/98 - OCI direct path interface support
|
||||
abrumm 03/18/98 - Creation
|
||||
|
||||
*/
|
||||
|
||||
#ifndef OCI8DP_ORACLE
|
||||
# define OCI8DP_ORACLE
|
||||
|
||||
#ifndef ORATYPES
|
||||
#include <oratypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef OCIDFN
|
||||
#include <ocidfn.h>
|
||||
#endif
|
||||
|
||||
#ifndef OCI_ORACLE
|
||||
#include <oci.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PUBLIC TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
/*----- Handles and descriptors for direct path operations (OCIDirPath*) ----*/
|
||||
|
||||
typedef struct OCIDirPathCtx OCIDirPathCtx; /* context */
|
||||
typedef struct OCIDirPathFuncCtx OCIDirPathFuncCtx; /* function context */
|
||||
typedef struct OCIDirPathColArray OCIDirPathColArray; /* column array */
|
||||
typedef struct OCIDirPathStream OCIDirPathStream; /* stream */
|
||||
typedef struct OCIDirPathDesc OCIDirPathDesc; /* direct path descriptor */
|
||||
|
||||
/*----- Defines for Direct Path Options -----*/
|
||||
|
||||
/* values for OCI_ATTR_DIRPATH_MODE attribute */
|
||||
#define OCI_DIRPATH_LOAD 1 /* direct path load operation */
|
||||
#define OCI_DIRPATH_UNLOAD 2 /* direct path unload operation */
|
||||
#define OCI_DIRPATH_CONVERT 3 /* direct path convert only operation */
|
||||
|
||||
/*----- values for OCI_ATTR_DIRPATH_INDEX_MAINT_METHOD attribute -----*/
|
||||
#define OCI_DIRPATH_INDEX_MAINT_SINGLE_ROW 1
|
||||
|
||||
/* Note that there are two attributes dealing with index maintenance -
|
||||
* OCI_ATTR_DIRPATH_INDEX_MAINT_METHOD and OCI_ATTR_DIRPATH_SKIPINDEX_METHOD.
|
||||
* OCI_ATTR_DIRPATH_SKIPINDEX_METHOD exists to isolate the behavior for
|
||||
* skipping index maintenance since maintenance of unusable indexes is
|
||||
* orthogonal to that of single row insertion.
|
||||
* For backwards compatibility we still allow users to specify skip
|
||||
* methods in OCI_ATTR_DIRPATH_INDEX_MAINT_METHOD so make sure the
|
||||
* enumerations for the two attributes are distinct.
|
||||
*/
|
||||
/*----- values for OCI_ATTR_DIRPATH_SKIPINDEX_METHOD attribute -----*/
|
||||
#define OCI_DIRPATH_INDEX_MAINT_SKIP_UNUSABLE 2
|
||||
#define OCI_DIRPATH_INDEX_MAINT_DONT_SKIP_UNUSABLE 3
|
||||
#define OCI_DIRPATH_INDEX_MAINT_SKIP_ALL 4
|
||||
|
||||
/* values for OCI_ATTR_STATE attribute of OCIDirPathCtx */
|
||||
#define OCI_DIRPATH_NORMAL 1 /* can accept rows, last row complete */
|
||||
#define OCI_DIRPATH_PARTIAL 2 /* last row was partial */
|
||||
#define OCI_DIRPATH_NOT_PREPARED 3 /* direct path context is not prepared */
|
||||
|
||||
/*----- values for cflg argument to OCIDirpathColArrayEntrySet -----*/
|
||||
#define OCI_DIRPATH_COL_COMPLETE 0 /* column data is complete */
|
||||
#define OCI_DIRPATH_COL_NULL 1 /* column is null */
|
||||
#define OCI_DIRPATH_COL_PARTIAL 2 /* column data is partial */
|
||||
#define OCI_DIRPATH_COL_ERROR 3 /* column error, ignore row */
|
||||
/*----- values for action parameter to OCIDirPathDataSave -----*/
|
||||
#define OCI_DIRPATH_DATASAVE_SAVEONLY 0 /* data save point only */
|
||||
#define OCI_DIRPATH_DATASAVE_FINISH 1 /* execute finishing logic */
|
||||
/* save portion of input data (before space error occurred) and finish */
|
||||
#define OCI_DIRPATH_DATASAVE_PARTIAL 2
|
||||
|
||||
/*- OCI_ATTR_DIRPATH_EXPR_TYPE values (describes OCI_ATTR_NAME expr type) -*/
|
||||
#define OCI_DIRPATH_EXPR_OBJ_CONSTR 1 /* NAME is an object constructor */
|
||||
#define OCI_DIRPATH_EXPR_SQL 2 /* NAME is an opaque or sql function */
|
||||
#define OCI_DIRPATH_EXPR_REF_TBLNAME 3 /* NAME is table name if ref is scoped*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PUBLIC FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
/*------------------------ OCIDirPathCtx Operations -------------------------*/
|
||||
|
||||
/*
|
||||
NAME
|
||||
OCIDirPathAbort - OCI: Abort a direct path operation.
|
||||
|
||||
DESCRIPTION
|
||||
Aborts a direct path operation. Upon successful completion
|
||||
the direct path context is no longer valid.
|
||||
|
||||
RETURNS
|
||||
An OCI error code, Oracle errors are returned via the error handle.
|
||||
NOTES
|
||||
*/
|
||||
sword
|
||||
OCIDirPathAbort( OCIDirPathCtx *dpctx, OCIError *errhp );
|
||||
|
||||
/*
|
||||
NAME
|
||||
OCIDirPathDataSave - OCI: Execute a data save point.
|
||||
|
||||
DESCRIPTION
|
||||
Successful return of this function indicates that a data save
|
||||
point has been executed.
|
||||
|
||||
RETURNS
|
||||
An OCI error code, Oracle errors are returned via the error handle.
|
||||
NOTES
|
||||
*/
|
||||
sword
|
||||
OCIDirPathDataSave( OCIDirPathCtx *dpctx, OCIError *errhp, ub4 action );
|
||||
|
||||
/*
|
||||
NAME
|
||||
OCIDirPathFinish - OCI: Finish a direct path operation.
|
||||
|
||||
DESCRIPTION
|
||||
Finishes a direct path operation.
|
||||
|
||||
RETURNS
|
||||
An OCI error code, Oracle errors are returned via the error handle.
|
||||
NOTES
|
||||
*/
|
||||
sword
|
||||
OCIDirPathFinish( OCIDirPathCtx *dpctx, OCIError *errhp );
|
||||
|
||||
/*
|
||||
NAME
|
||||
OCIDirPathFlushRow - OCI: Flush a partial row from the server.
|
||||
|
||||
DESCRIPTION
|
||||
Flushes a partially loaded row from the server.
|
||||
|
||||
RETURNS
|
||||
An OCI error code, Oracle errors are returned via the error handle.
|
||||
NOTES
|
||||
*/
|
||||
sword
|
||||
OCIDirPathFlushRow( OCIDirPathCtx *dpctx, OCIError *errhp );
|
||||
|
||||
/*
|
||||
NAME
|
||||
OCIDirPathPrepare - OCI: Prepare a direct path operation.
|
||||
|
||||
DESCRIPTION
|
||||
Prepares a table/partition for a direct path operation.
|
||||
|
||||
RETURNS
|
||||
An OCI error code, Oracle errors are returned via the error handle.
|
||||
NOTES
|
||||
*/
|
||||
sword
|
||||
OCIDirPathPrepare( OCIDirPathCtx *dpctx, OCISvcCtx *svchp,
|
||||
OCIError *errhp );
|
||||
|
||||
/*
|
||||
NAME
|
||||
OCIDirPathLoadStream - OCI: Load a direct path stream.
|
||||
|
||||
DESCRIPTION
|
||||
Load a direct path stream to the object associated with
|
||||
the direct path context.
|
||||
|
||||
RETURNS
|
||||
An OCI error code, Oracle errors are returned via the error handle.
|
||||
NOTES
|
||||
*/
|
||||
sword
|
||||
OCIDirPathLoadStream( OCIDirPathCtx *dpctx, OCIDirPathStream *dpstr,
|
||||
OCIError *errhp );
|
||||
|
||||
|
||||
/*---------------------- OCIDirPathColArray Operations ----------------------*/
|
||||
|
||||
/*
|
||||
NAME
|
||||
OCIDirPathColArrayEntryGet - OCI: Get column array entry.
|
||||
|
||||
DESCRIPTION
|
||||
Column array function which is used to get a specified entry in
|
||||
a column array.
|
||||
|
||||
RETURNS
|
||||
An OCI error code, Oracle errors are returned via the error handle.
|
||||
NOTES
|
||||
*/
|
||||
sword
|
||||
OCIDirPathColArrayEntryGet( OCIDirPathColArray *dpca, OCIError *errhp,
|
||||
ub4 rownum, ub2 colIdx, ub1 **cvalpp, ub4 *clenp,
|
||||
ub1 *cflgp );
|
||||
|
||||
/*
|
||||
NAME
|
||||
OCIDirPathColArrayEntrySet - OCI: Set column array entry.
|
||||
|
||||
DESCRIPTION
|
||||
Column array function which is used to set a specified entry in
|
||||
a column array.
|
||||
|
||||
RETURNS
|
||||
An OCI error code, Oracle errors are returned via the error handle.
|
||||
NOTES
|
||||
*/
|
||||
sword
|
||||
OCIDirPathColArrayEntrySet( OCIDirPathColArray *dpca, OCIError *errhp,
|
||||
ub4 rownum, ub2 colIdx, ub1 *cvalp, ub4 clen,
|
||||
ub1 cflg );
|
||||
|
||||
/*
|
||||
NAME
|
||||
OCIDirPathColArrayRowGet - OCI: Get column array row pointers.
|
||||
|
||||
DESCRIPTION
|
||||
Column array function which is used to get the base row pointers
|
||||
for a specified row in a column array.
|
||||
To be used in lieu of OCIDirPathColArrayEntryGet() and
|
||||
OCIDirPathColArrayEntrySet().
|
||||
|
||||
RETURNS
|
||||
An OCI error code, Oracle errors are returned via the error handle.
|
||||
NOTES
|
||||
*/
|
||||
sword
|
||||
OCIDirPathColArrayRowGet( OCIDirPathColArray *dpca, OCIError *errhp,
|
||||
ub4 rownum, ub1 ***cvalppp, ub4 **clenpp,
|
||||
ub1 **cflgpp );
|
||||
|
||||
/*
|
||||
NAME
|
||||
OCIDirPathColArrayReset - OCI: Reset Column Array State
|
||||
|
||||
DESCRIPTION
|
||||
Function which resets the column array state.
|
||||
|
||||
RETURNS
|
||||
An OCI error code, Oracle errors are returned via the error handle.
|
||||
NOTES
|
||||
Resetting the column array state is necessary when piecing in a large
|
||||
column and an error occurs in the middle of loading the column.
|
||||
*/
|
||||
sword
|
||||
OCIDirPathColArrayReset( OCIDirPathColArray *dpca, OCIError *errhp );
|
||||
|
||||
/*
|
||||
NAME
|
||||
OCIDirPathColArrayToStream - OCI: Convert Column Array to Stream Format.
|
||||
|
||||
DESCRIPTION
|
||||
Convert from column array format to stream format which is suitable
|
||||
for loading via OCIDirPathLoadStream().
|
||||
|
||||
RETURNS
|
||||
An OCI error code, Oracle errors are returned via the error handle.
|
||||
NOTES
|
||||
*/
|
||||
sword
|
||||
OCIDirPathColArrayToStream( OCIDirPathColArray *dpca, OCIDirPathCtx *dpctx,
|
||||
OCIDirPathStream *dpstr, OCIError *errhp,
|
||||
ub4 rowcnt, ub4 rowoff );
|
||||
|
||||
|
||||
|
||||
/*----------------------- OCIDirPathStream Operations -----------------------*/
|
||||
|
||||
/*
|
||||
NAME
|
||||
OCIDirPathStreamReset - OCI:
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
RETURNS
|
||||
An OCI error code, Oracle errors are returned via the error handle.
|
||||
NOTES
|
||||
*/
|
||||
sword
|
||||
OCIDirPathStreamReset( OCIDirPathStream *dpstr, OCIError *errhp );
|
||||
|
||||
#endif /* OCI8DP_ORACLE */
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,155 @@
|
||||
/* Copyright (c) 1991, 2005, Oracle. All rights reserved. */
|
||||
/*
|
||||
NAME
|
||||
ociapr.h
|
||||
MODIFIED (MM/DD/YY)
|
||||
mbastawa 09/16/05 - dbhygiene
|
||||
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
|
||||
dsaha 05/19/00 - Fix lint
|
||||
sgollapu 05/19/98 - Change text to OraText
|
||||
dchatter 11/10/95 - add ognfd() - get native fd
|
||||
lchidamb 04/06/95 - drop maxdsz from obindps/odefinps
|
||||
slari 04/07/95 - add opinit
|
||||
dchatter 03/08/95 - osetpi and ogetpi
|
||||
lchidamb 12/09/94 - add obindps() and odefinps()
|
||||
dchatter 03/06/95 - merge changes from branch 1.1.720.2
|
||||
dchatter 11/14/94 - merge changes from branch 1.1.720.1
|
||||
dchatter 02/08/95 - olog call; drop onblon
|
||||
dchatter 10/31/94 - new functions for non-blocking oci
|
||||
rkooi2 11/27/92 - Changing datatypes to agree with ocidef.h
|
||||
rkooi2 10/26/92 - More portability mods
|
||||
rkooi2 10/18/92 - Changed to agree with oci.c
|
||||
sjain 03/16/92 - Creation
|
||||
*/
|
||||
/*
|
||||
* Declare the OCI functions.
|
||||
* Prototype information is included.
|
||||
* Use this header for ANSI C compilers.
|
||||
*/
|
||||
|
||||
#ifndef OCIAPR
|
||||
#define OCIAPR
|
||||
|
||||
#ifndef ORATYPES
|
||||
#include <oratypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef OCIDFN
|
||||
#include <ocidfn.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Oci BIND (Piecewise or with Skips)
|
||||
*/
|
||||
sword obindps(struct cda_def *cursor, ub1 opcode, OraText *sqlvar,
|
||||
sb4 sqlvl, ub1 *pvctx, sb4 progvl,
|
||||
sword ftype, sword scale,
|
||||
sb2 *indp, ub2 *alen, ub2 *arcode,
|
||||
sb4 pv_skip, sb4 ind_skip, sb4 alen_skip, sb4 rc_skip,
|
||||
ub4 maxsiz, ub4 *cursiz,
|
||||
OraText *fmt, sb4 fmtl, sword fmtt);
|
||||
sword obreak(struct cda_def *lda);
|
||||
sword ocan (struct cda_def *cursor);
|
||||
sword oclose(struct cda_def *cursor);
|
||||
sword ocof (struct cda_def *lda);
|
||||
sword ocom (struct cda_def *lda);
|
||||
sword ocon (struct cda_def *lda);
|
||||
|
||||
|
||||
/*
|
||||
* Oci DEFINe (Piecewise or with Skips)
|
||||
*/
|
||||
sword odefinps(struct cda_def *cursor, ub1 opcode, sword pos,ub1 *bufctx,
|
||||
sb4 bufl, sword ftype, sword scale,
|
||||
sb2 *indp, OraText *fmt, sb4 fmtl, sword fmtt,
|
||||
ub2 *rlen, ub2 *rcode,
|
||||
sb4 pv_skip, sb4 ind_skip, sb4 alen_skip, sb4 rc_skip);
|
||||
sword odessp(struct cda_def *cursor, OraText *objnam, size_t onlen,
|
||||
ub1 *rsv1, size_t rsv1ln, ub1 *rsv2, size_t rsv2ln,
|
||||
ub2 *ovrld, ub2 *pos, ub2 *level, OraText **argnam,
|
||||
ub2 *arnlen, ub2 *dtype, ub1 *defsup, ub1* mode,
|
||||
ub4 *dtsiz, sb2 *prec, sb2 *scale, ub1 *radix,
|
||||
ub4 *spare, ub4 *arrsiz);
|
||||
sword odescr(struct cda_def *cursor, sword pos, sb4 *dbsize,
|
||||
sb2 *dbtype, sb1 *cbuf, sb4 *cbufl, sb4 *dsize,
|
||||
sb2 *prec, sb2 *scale, sb2 *nullok);
|
||||
sword oerhms (struct cda_def *lda, sb2 rcode, OraText *buf,
|
||||
sword bufsiz);
|
||||
sword oermsg (sb2 rcode, OraText *buf);
|
||||
sword oexec (struct cda_def *cursor);
|
||||
sword oexfet (struct cda_def *cursor, ub4 nrows,
|
||||
sword cancel, sword exact);
|
||||
sword oexn (struct cda_def *cursor, sword iters, sword rowoff);
|
||||
sword ofen (struct cda_def *cursor, sword nrows);
|
||||
sword ofetch (struct cda_def *cursor);
|
||||
sword oflng (struct cda_def *cursor, sword pos, ub1 *buf,
|
||||
sb4 bufl, sword dtype, ub4 *retl, sb4 offset);
|
||||
sword ogetpi (struct cda_def *cursor, ub1 *piecep, void **ctxpp,
|
||||
ub4 *iterp, ub4 *indexp);
|
||||
sword oopt (struct cda_def *cursor, sword rbopt, sword waitopt);
|
||||
sword opinit (ub4 mode);
|
||||
sword olog (struct cda_def *lda, ub1* hda,
|
||||
OraText *uid, sword uidl,
|
||||
OraText *pswd, sword pswdl,
|
||||
OraText *conn, sword connl,
|
||||
ub4 mode);
|
||||
sword ologof (struct cda_def *lda);
|
||||
sword oopen (struct cda_def *cursor, struct cda_def *lda,
|
||||
OraText *dbn, sword dbnl, sword arsize,
|
||||
OraText *uid, sword uidl);
|
||||
sword oparse (struct cda_def *cursor, OraText *sqlstm, sb4 sqllen,
|
||||
sword defflg, ub4 lngflg);
|
||||
sword orol (struct cda_def *lda);
|
||||
sword osetpi (struct cda_def *cursor, ub1 piece, void *bufp, ub4 *lenp);
|
||||
|
||||
void sqlld2 (struct cda_def *lda, OraText *cname, sb4 *cnlen);
|
||||
void sqllda (struct cda_def *lda);
|
||||
|
||||
/* non-blocking functions */
|
||||
sword onbset (struct cda_def *lda );
|
||||
sword onbtst (struct cda_def *lda );
|
||||
sword onbclr (struct cda_def *lda );
|
||||
sword ognfd (struct cda_def *lda, void *fdp);
|
||||
|
||||
|
||||
/*
|
||||
* OBSOLETE CALLS
|
||||
*/
|
||||
|
||||
/*
|
||||
* OBSOLETE BIND CALLS
|
||||
*/
|
||||
sword obndra(struct cda_def *cursor, OraText *sqlvar, sword sqlvl,
|
||||
ub1 *progv, sword progvl, sword ftype, sword scale,
|
||||
sb2 *indp, ub2 *alen, ub2 *arcode, ub4 maxsiz,
|
||||
ub4 *cursiz, OraText *fmt, sword fmtl, sword fmtt);
|
||||
sword obndrn(struct cda_def *cursor, sword sqlvn, ub1 *progv,
|
||||
sword progvl, sword ftype, sword scale, sb2 *indp,
|
||||
OraText *fmt, sword fmtl, sword fmtt);
|
||||
sword obndrv(struct cda_def *cursor, OraText *sqlvar, sword sqlvl,
|
||||
ub1 *progv, sword progvl, sword ftype, sword scale,
|
||||
sb2 *indp, OraText *fmt, sword fmtl, sword fmtt);
|
||||
|
||||
/*
|
||||
* OBSOLETE DEFINE CALLS
|
||||
*/
|
||||
sword odefin(struct cda_def *cursor, sword pos, ub1 *buf,
|
||||
sword bufl, sword ftype, sword scale, sb2 *indp,
|
||||
OraText *fmt, sword fmtl, sword fmtt, ub2 *rlen, ub2 *rcode);
|
||||
|
||||
/* older calls ; preferred equivalent calls above */
|
||||
|
||||
sword oname (struct cda_def *cursor, sword pos, sb1 *tbuf,
|
||||
sb2 *tbufl, sb1 *buf, sb2 *bufl);
|
||||
sword orlon (struct cda_def *lda, ub1 *hda,
|
||||
OraText *uid, sword uidl,
|
||||
OraText *pswd, sword pswdl,
|
||||
sword audit);
|
||||
sword olon (struct cda_def *lda, OraText *uid, sword uidl,
|
||||
OraText *pswd, sword pswdl, sword audit);
|
||||
sword osql3 (struct cda_def *cda, OraText *sqlstm, sword sqllen);
|
||||
sword odsc (struct cda_def *cursor, sword pos, sb2 *dbsize,
|
||||
sb2 *fsize, sb2 *rcode, sb2 *dtype, sb1 *buf,
|
||||
sb2 *bufl, sb2 *dsize);
|
||||
|
||||
#endif /* OCIAPR */
|
||||
@ -0,0 +1,886 @@
|
||||
/* Copyright (c) 1981, 2005, Oracle. All rights reserved. */
|
||||
/* Copyright (c) 1984, 2005, Oracle. All rights reserved. */
|
||||
|
||||
/*
|
||||
NAME
|
||||
ocidef
|
||||
CONTENTS
|
||||
Oracle Call Interface cursor area and LDA definitions
|
||||
NOTES
|
||||
none
|
||||
OWNER
|
||||
Oates
|
||||
DATE
|
||||
09/07/82
|
||||
MODIFIED
|
||||
mbastawa 09/16/05 - dbhygiene
|
||||
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
|
||||
srseshad 03/25/03 - convert oci public api to ansi
|
||||
csteinba 11/05/02 - bug 2521931: redefine OTYACL
|
||||
aahluwal 06/03/02 - bug 2360115
|
||||
bpalaval 02/08/01 - Change text to oratext.
|
||||
chliang 02/01/01 - fix olint error.
|
||||
bpalaval 11/16/00 - Bug 1244685 : Fix ALTER CLUSTER issue..
|
||||
slari 11/08/00 - remove functions duplicated in ociapr.h
|
||||
whe 09/01/99 - 976457:check __cplusplus for C++ code
|
||||
skmishra 04/23/97 - Provide C++ compatibility
|
||||
lchidamb 06/26/96 - put upidef.h, riddef.h within #ifndef
|
||||
slari 06/12/96 - add ocigft_getFcnType
|
||||
dchatter 11/10/95 - ocignfd - oci get native file descriptor
|
||||
slari 05/11/95 - change OCIEVDEF/OCIEVTSF to UPIEVDEF/UPIEVTSF
|
||||
dchatter 04/06/95 - add ifdef flags around OCI_flags
|
||||
lchidamb 04/06/95 - drop maxdsz from ocibndps/ocidfnps
|
||||
slari 04/07/95 - rename opinit to ocipin
|
||||
slari 03/13/95 - thread safety changes
|
||||
dchatter 03/08/95 - piece definitions OCI_*_PIECE
|
||||
lchidamb 12/06/94 - add support for binding/defining with skips
|
||||
dchatter 03/06/95 - merge changes from branch 1.12.720.1
|
||||
dchatter 02/06/95 - add defines for login mode parameters
|
||||
dchatter 07/06/94 - Deleting CRSCHK, with refcursor, no way to set this
|
||||
dchatter 06/13/94 - add a new LDA flag LDANBL
|
||||
rkooi 11/18/92 - update ocidpr interface
|
||||
mmoore 10/31/92 - add ocidpr
|
||||
gpongrac 11/17/92 - fix oexfet prototype
|
||||
sjain 01/03/92 - Add ocibra
|
||||
rjenkins 11/04/91 - adding prototypes for oparse and oexfet
|
||||
sjain 04/15/91 - Change ocistf proto
|
||||
sjain 04/01/91 - Rearrange oty codes. Add new ones
|
||||
Jain 12/03/90 - Add #define for new describe call
|
||||
Jain 11/29/90 - Add new function code for the new oci calls
|
||||
Mendels 01/20/89 - fix 19170: make ocitbl CONST_DATA
|
||||
Kabcene 01/27/88 - change interfaces to match V5
|
||||
Navab 12/09/87 - add a parameter to ocierr call
|
||||
Navab 11/30/87 - add ocierr, rename ocioer
|
||||
Navab 10/08/87 - add prototypes for procedure declarations
|
||||
Howard 09/07/87 - endif blah
|
||||
Howard 05/11/87 - Add OTY types
|
||||
Howard 04/27/87 - move ocldef defines here
|
||||
Oates 10/15/85 - Add OCANCEL
|
||||
Oates 09/30/85 - Implement ORA*Net
|
||||
Oates 06/27/85 - Make datatype compatible with upidef.h
|
||||
Andy 05/07/85 - delete CSRFBPIC
|
||||
*/
|
||||
|
||||
#ifndef UPIDEF
|
||||
#include <upidef.h>
|
||||
#endif
|
||||
|
||||
#ifndef RIDDEF
|
||||
#include <riddef.h>
|
||||
#endif
|
||||
|
||||
#include <ociapr.h>
|
||||
|
||||
#ifndef OCIDEF
|
||||
#define OCIDEF
|
||||
|
||||
|
||||
#define CSRCHECK 172 /* csrdef is a cursor */
|
||||
#define LDACHECK 202 /* csrdef is a login data area */
|
||||
struct csrdef
|
||||
{
|
||||
sb2 csrrc; /* return code: v2 codes, v4 codes negative */
|
||||
ub2 csrft; /* function type */
|
||||
ub4 csrrpc; /* rows processed count */
|
||||
ub2 csrpeo; /* parse error offset */
|
||||
ub1 csrfc; /* function code */
|
||||
ub1 csrlfl; /* lda flag to indicate type of login */
|
||||
ub2 csrarc; /* actual untranslated return code */
|
||||
ub1 csrwrn; /* warning flags */
|
||||
ub1 csrflg; /* error action */
|
||||
sword csrcn; /* cursor number */
|
||||
riddef csrrid; /* rowid structure */
|
||||
sword csrose; /* os dependent error code */
|
||||
ub1 csrchk; /* check byte = CSRCHECK - in cursor */
|
||||
/* check byte = LDACHECK - in LDA */
|
||||
struct hstdef *csrhst; /* pointer to the hst */
|
||||
};
|
||||
typedef struct csrdef csrdef;
|
||||
typedef struct csrdef ldadef; /* lda is the same as a csr */
|
||||
|
||||
|
||||
/* values for csrlfl */
|
||||
#define LDAFLG 1 /* ...via ologon */
|
||||
#define LDAFLO 2 /* ...via olon or orlon */
|
||||
#define LDANBL 3 /* ...nb logon in progress */
|
||||
|
||||
/* valuses for crsfc */
|
||||
#define csrfpa 2 /* ...OSQL */
|
||||
#define csrfex 4 /* ...OEXEC */
|
||||
#define csrfbi 6 /* ...OBIND */
|
||||
#define csrfdb 8 /* ...ODFINN */
|
||||
#define csrfdi 10 /* ...ODSRBN */
|
||||
#define csrffe 12 /* ...OFETCH */
|
||||
#define csrfop 14 /* ...OOPEN */
|
||||
#define csrfcl 16 /* ...OCLOSE */
|
||||
#define csrfds 22 /* ...ODSC */
|
||||
#define csrfnm 24 /* ...ONAME */
|
||||
#define csrfp3 26 /* ...OSQL3 */
|
||||
#define csrfbr 28 /* ...OBNDRV */
|
||||
#define csrfbx 30 /* ...OBNDRN */
|
||||
/*#defe csrfdf 32*/ /* ???? */
|
||||
#define csrfso 34 /* ...OOPT */
|
||||
#define csrfre 36 /* ...ORESUM */
|
||||
#define csrfbn 50 /* ...OBINDN */
|
||||
#define csrfca 52 /* ..OCANCEL */
|
||||
#define csrfsd 54 /* ..OSQLD */
|
||||
#define csrfef 56 /* ..OEXFEN */
|
||||
#define csrfln 58 /* ..OFLNG */
|
||||
#define csrfdp 60 /* ..ODSCSP */
|
||||
#define csrfba 62 /* ..OBNDRA */
|
||||
#define csrfbps 63 /*..OBINDPS */
|
||||
#define csrfdps 64 /*..ODEFINPS */
|
||||
#define csrfgpi 65 /* ...OGETPI */
|
||||
#define csrfspi 66 /* ...OSETPI */
|
||||
|
||||
/* values for csrwrn */
|
||||
#define CSRWANY 0x01 /* there is a warning flag set */
|
||||
#define CSRWTRUN 0x02 /* a data item was truncated */
|
||||
#define CSRWNVIC 0x04 /* NULL values were used in an aggregate function */
|
||||
#define CSRWITCE 0x08 /* column count not equal to into list count */
|
||||
#define CSRWUDNW 0x10 /* update or delete without where clause */
|
||||
#define CSRWRSV0 0x20
|
||||
#define CSRWROLL 0x40 /* rollback required */
|
||||
#define CSRWRCHG 0x80 /* change after query start on select for update */
|
||||
|
||||
/* values fro csrflg */
|
||||
#define CSRFSPND 0x01 /* current operation suspended */
|
||||
#define CSRFATAL 0x02 /* fatal operation: transaction rolled back */
|
||||
#define CSRFBROW 0x04 /* current row backed out */
|
||||
#define CSRFREFC 0x08 /* ref cursor type CRSCHK disabled for this cursor */
|
||||
#define CSRFNOAR 0x10 /* ref cursor type binds, so no array bind/execute */
|
||||
|
||||
/* define function codes; in order of octdef.h */
|
||||
#define OTYCTB 1 /* CREATE TABLE */
|
||||
#define OTYSER 2 /* set role */
|
||||
#define OTYINS 3 /* INSERT */
|
||||
#define OTYSEL 4 /* SELECT */
|
||||
#define OTYUPD 5 /* UPDATE */
|
||||
#define OTYDRO 6 /* drop role */
|
||||
#define OTYDVW 7 /* DROP VIEW */
|
||||
/* once was validate index */
|
||||
/* once was create partition */
|
||||
/* once was alter partition */
|
||||
#define OTYDTB 8 /* DROP TABLE */
|
||||
/* once was alter space */
|
||||
/* once was drop space */
|
||||
#define OTYDEL 9 /* DELETE */
|
||||
#define OTYCVW 10 /* create view */
|
||||
#define OTYDUS 11 /* drop user */
|
||||
#define OTYCRO 12 /* create role */
|
||||
#define OTYCSQ 13 /* create sequence */
|
||||
#define OTYASQ 14 /* alter sequence */
|
||||
#define OTYACL 15 /* alter cluster */
|
||||
#define OTYDSQ 16 /* drop sequence */
|
||||
#define OTYCSC 17 /* create schema */
|
||||
#define OTYCCL 18 /* CREATE CLUSTER */
|
||||
/* once was alter cluster */
|
||||
#define OTYCUS 19 /* create user */
|
||||
#define OTYCIX 20 /* CREATE INDEX */
|
||||
#define OTYDIX 21 /* DROP INDEX */
|
||||
#define OTYDCL 22 /* DROP CLUSTER */
|
||||
#define OTYVIX 23 /* validate index */
|
||||
#define OTYCPR 24 /* create procedure */
|
||||
#define OTYAPR 25 /* alter procedure */
|
||||
#define OTYATB 26 /* alter table */
|
||||
/* once was evaluate */
|
||||
#define OTYXPL 27 /* explain */
|
||||
#define OTYGRA 28 /* grant */
|
||||
#define OTYREV 29 /* revoke */
|
||||
#define OTYCSY 30 /* create synonym */
|
||||
#define OTYDSY 31 /* drop synonym */
|
||||
#define OTYASY 32 /* alter system switch log */
|
||||
#define OTYSET 33 /* set transaction */
|
||||
#define OTYPLS 34 /* pl/sql execute */
|
||||
#define OTYLTB 35 /* lock */
|
||||
#define OTYNOP 36 /* noop */
|
||||
#define OTYRNM 37 /* rename */
|
||||
#define OTYCMT 38 /* comment */
|
||||
#define OTYAUD 39 /* audit */
|
||||
#define OTYNOA 40 /* no audit */
|
||||
#define OTYAIX 41 /* ALTER INDEX */
|
||||
#define OTYCED 42 /* create external database */
|
||||
#define OTYDED 43 /* drop external database */
|
||||
#define OTYCDB 44 /* create database */
|
||||
#define OTYADB 45 /* alter database */
|
||||
#define OTYCRS 46 /* create rollback segment */
|
||||
#define OTYARS 47 /* alter rollback segment */
|
||||
#define OTYDRS 48 /* drop rollback segment */
|
||||
#define OTYCTS 49 /* create tablespace */
|
||||
#define OTYATS 50 /* alter tablespace */
|
||||
#define OTYDTS 51 /* drop tablespace */
|
||||
#define OTYASE 52 /* alter session */
|
||||
#define OTYAUR 53 /* alter user */
|
||||
#define OTYCWK 54 /* commit (work) */
|
||||
#define OTYROL 55 /* rollback */
|
||||
#define OTYSPT 56 /* savepoint */
|
||||
|
||||
/* For number greater than 56 the the type is the same as defined in
|
||||
** octdef.h for that number. So for completion look at octdef.h
|
||||
*/
|
||||
|
||||
#define OTYDEV OTYCVW /* old DEFINE VIEW = create view */
|
||||
|
||||
/* FUNCTION CODES */
|
||||
#define OCLFPA 2 /* parse - OSQL */
|
||||
#define OCLFEX 4 /* execute - OEXEC */
|
||||
#define OCLFBI 6 /* BIND by name - OBIND */
|
||||
#define OCLFDB 8 /* define buffer - ODEFIN */
|
||||
#define OCLFDI 10 /* describe item - ODSC */
|
||||
#define OCLFFE 12 /* fetch - OFETCH */
|
||||
#define OCLFOC 14 /* open cursor - OOPEN */
|
||||
# define OCLFLI OCLFOC /* old name for open cursor - OOPEN */
|
||||
#define OCLFCC 16 /* close cursor - OCLOSE */
|
||||
# define OCLFLO OCLFCC /* old name for close cursor - OCLOSE */
|
||||
#define OCLFDS 22 /* describe - ODSC */
|
||||
#define OCLFON 24 /* get table and column names - ONAME */
|
||||
#define OCLFP3 26 /* parse - OSQL3 */
|
||||
#define OCLFBR 28 /* bind reference by name - OBNDRV */
|
||||
#define OCLFBX 30 /* bind referecne numeric - OBNDRN */
|
||||
#define OCLFSO 34 /* special function - OOPT */
|
||||
#define OCLFRE 36 /* resume - ORESUM */
|
||||
#define OCLFBN 50 /* bindn */
|
||||
#define OCLFMX 52 /* maximum function number */
|
||||
|
||||
#ifdef NEVER /* unused codes */
|
||||
# define OCLFLK 18 /* open for kernel operations */
|
||||
# define OCLFEK 20 /* execute kernel operations */
|
||||
# define OCLFOK 22 /* kernel close */
|
||||
# define OCLFIN 28 /* logon to oracle */
|
||||
# define OCLFOF 30 /* logoff from oracle */
|
||||
# define OCLFAX 32 /* allocate a context area */
|
||||
# define OCLFPI 34 /* page in context area */
|
||||
# define OCLFIS 36 /* special system logon */
|
||||
# define OCLFCO 38 /* cancel the current operation */
|
||||
# define OCLFGI 40 /* get database id */
|
||||
# define OCLFJN 42 /* journal operation */
|
||||
# define OCLFCL 44 /* cleanup prior execute operation */
|
||||
# define OCLFMC 46 /* map a cursor area */
|
||||
# define OCLFUC 48 /* unmap cursor and restore user maping */
|
||||
#endif /*NEVER *//* obsolete codes */
|
||||
|
||||
|
||||
/* values for ocimode in ocipin call */
|
||||
|
||||
#define OCIEVDEF UPIEVDEF /* default : non-thread safe enivronment */
|
||||
#define OCIEVTSF UPIEVTSF /* thread-safe environment */
|
||||
|
||||
|
||||
/* OCIL* flags used to determine the mode of login, using ocilog().
|
||||
** Currently defined only for non-blocking and thread-safe logins.
|
||||
*/
|
||||
|
||||
#define OCILMDEF UPILMDEF /* default, regular login */
|
||||
#define OCILMNBL UPILMNBL /* non-blocking logon */
|
||||
#define OCILMESY UPILMESY /* thread safe but external sync */
|
||||
#define OCILMISY UPILMISY /* internal sync, we do it */
|
||||
#define OCILMTRY UPILMTRY /* try to, but do not block on mutex */
|
||||
|
||||
|
||||
/*
|
||||
* since sqllib uses both ocidef and ocidfn the following defines
|
||||
* need to be guarded
|
||||
*/
|
||||
#ifndef OCI_FLAGS
|
||||
#define OCI_FLAGS
|
||||
|
||||
/* OCI_*_PIECE defines the piece types that are returned or set
|
||||
*/
|
||||
|
||||
#define OCI_ONE_PIECE UPI_ONE_PIECE /* there or this is the only piece */
|
||||
#define OCI_FIRST_PIECE UPI_FIRST_PIECE /* the first of many pieces */
|
||||
#define OCI_NEXT_PIECE UPI_NEXT_PIECE /* the next of many pieces */
|
||||
#define OCI_LAST_PIECE UPI_LAST_PIECE /* the last piece of this column */
|
||||
#endif
|
||||
|
||||
/*
|
||||
** OCITAB: define return code pairs for version 2 to 3 conversions
|
||||
*/
|
||||
struct ocitab
|
||||
{
|
||||
sb2 ocitv3; /* Version 3/4 return code */
|
||||
sb2 ocitv2; /* Version 2 equivalent return code */
|
||||
};
|
||||
typedef struct ocitab ocitab;
|
||||
|
||||
externref const ocitab ocitbl[];
|
||||
|
||||
/* macros to check cursors and LDA's. */
|
||||
/* macros to set error codes */
|
||||
|
||||
# define CRSCHK(c) if ((c->csrchk != CSRCHECK)\
|
||||
&& !bit(c->csrflg, CSRFREFC))\
|
||||
return(ocir32(c, OER(1001)))
|
||||
# define ldaerr(l, e) ( l->csrrc = (sb2)(-( l->csrarc = (ub2)(e)) ) )
|
||||
# define LDACHK(l) if (l->csrchk != LDACHECK) \
|
||||
return(ldaerr(l, OER(1001)))
|
||||
|
||||
|
||||
/************************************************/
|
||||
/* OCI PROCEDURE DECLARATIONS */
|
||||
/************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************/
|
||||
/* Database logon/logout */
|
||||
/*****************************/
|
||||
sword ocilog( ldadef *lda, struct hstdef *hst, oratext *uid, sword uidl,
|
||||
oratext *psw, sword pswl, oratext* conn, sword connl,
|
||||
ub4 mode );
|
||||
sword ocilon( ldadef *lda, oratext *uid, sword uidl, oratext *psw,
|
||||
sword pswl, sword audit );
|
||||
sword ocilgi( ldadef *lda, sb2 areacount );
|
||||
sword ocirlo( ldadef *lda, struct hstdef *hst, oratext *uid, sword uidl,
|
||||
oratext *psw, sword pswl, sword audit );
|
||||
/* ocilon - logon to oracle
|
||||
** ocilgi - version 2 compatible ORACLE logon call.
|
||||
** no login to ORACLE is performed: the LDA is initialized
|
||||
** ocirlo - version 5 compatible ORACLE Remote Login call,
|
||||
** oracle login is executed.
|
||||
** lda - pointer to ldadef
|
||||
** uid - user id [USER[/PASSWORD]]
|
||||
** uidl - length of uid, if -1 strlen(uid) is used
|
||||
** psw - password string; ignored if specified in uid
|
||||
** pswl - length of psw, if -1 strlen(psw) is used
|
||||
** audit - is not supported; the only permissible value is 0
|
||||
** areacount - unused
|
||||
*/
|
||||
|
||||
sword ocilof( ldadef *lda );
|
||||
/*
|
||||
** ocilof - disconnect from ORACLE
|
||||
** lda - pointer to ldadef
|
||||
*/
|
||||
|
||||
|
||||
/*********************/
|
||||
/* Error Messages */
|
||||
/*********************/
|
||||
sword ocierr( ldadef *lda, sb2 rcode, oratext *buffer, sword bufl );
|
||||
sword ocidhe( sb2 rcode, oratext *buffer );
|
||||
/*
|
||||
** Move the text explanation for an ORACLE error to a user defined buffer
|
||||
** ocierr - will return the message associated with the hstdef stored
|
||||
** in the lda.
|
||||
** ocidhe - will return the message associated with the default host.
|
||||
** lda - lda associated with the login session
|
||||
** rcode - error code as returned by V3 call interface
|
||||
** buffer - address of a user buffer of at least 132 characters
|
||||
*/
|
||||
|
||||
|
||||
/***********************/
|
||||
/* Cursor Open/Close */
|
||||
/***********************/
|
||||
sword ociope( struct csrdef *cursor, ldadef *lda, oratext *dbn, sword dbnl,
|
||||
sword areasize, oratext *uid, sword uidl );
|
||||
|
||||
sword ociclo( struct csrdef *cursor );
|
||||
/*
|
||||
** open or close a cursor.
|
||||
** cursor - pointer to csrdef
|
||||
** ldadef - pointer to ldadef
|
||||
** dbn - unused
|
||||
** dbnl - unused
|
||||
** areasize - if (areasize == -1) areasize <- system default initial size
|
||||
** else if (areasize IN [1..256]) areasize <- areasize * 1024;
|
||||
** most applications should use the default size since context
|
||||
** areas are extended as needed until memory is exhausted.
|
||||
** uid - user id
|
||||
** uidl - userid length
|
||||
*/
|
||||
|
||||
/***********************************/
|
||||
/* CONTROL AND OPTIONS */
|
||||
/***********************************/
|
||||
sword ocibre( ldadef *lda );
|
||||
/*
|
||||
** ocibrk - Oracle Call Interface send BReaK Sends a break to
|
||||
** oracle. If oracle is active, the current operation is
|
||||
** cancelled. May be called asynchronously. DOES NOT SET
|
||||
** OERRCD in the hst. This is because ocibrk may be called
|
||||
** asynchronously. Callers must test the return code.
|
||||
** lda - pointer to a ldadef
|
||||
*/
|
||||
|
||||
sword ocican( struct csrdef *cursor );
|
||||
/*
|
||||
** cancel the operation on the cursor, no additional OFETCH calls
|
||||
** will be issued for the existing cursor without an intervening
|
||||
** OEXEC call.
|
||||
** cursor - pointer to csrdef
|
||||
*/
|
||||
|
||||
sword ocisfe( struct csrdef *cursor, sword erropt, sword waitopt );
|
||||
/*
|
||||
** ocisfe - user interface set error options
|
||||
** set the error and cursor options.
|
||||
** allows user to set the options for dealing with fatal dml errors
|
||||
** and other cursor related options
|
||||
** see oerdef for valid settings
|
||||
** cursor - pointer to csrdef
|
||||
** erropt - error optionsn
|
||||
** waitopr - wait options
|
||||
*/
|
||||
|
||||
|
||||
/***************************************/
|
||||
/* COMMIT/ROLLBACK/AUTOCOMMIT */
|
||||
/***************************************/
|
||||
sword ocicom( ldadef *lda );
|
||||
sword ocirol( ldadef *lda );
|
||||
/*
|
||||
** ocicom - commit the current transaction
|
||||
** ocirol - roll back the current transaction
|
||||
*/
|
||||
|
||||
sword ocicon( ldadef *lda );
|
||||
sword ocicof( ldadef *lda );
|
||||
/*
|
||||
** ocicon - auto Commit ON
|
||||
** ocicof - auto Commit OFf
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/************************/
|
||||
/* parsing */
|
||||
/************************/
|
||||
sword ocisq3(struct csrdef *cursor, oratext * /* sqlstm */, sword sqllen);
|
||||
/*
|
||||
** ocisq3 - user interface parse sql statement
|
||||
** cursor - pointer to csrdef
|
||||
** sqlstm - pointer to SQL statement
|
||||
** sqllen - length of SQL statement. if -1, strlen(sqlstm) is used
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/***************************/
|
||||
/* BINDING */
|
||||
/***************************/
|
||||
/* these are for the opcode in ocibndps, ocidfnps */
|
||||
#define OCI_PCWS 0
|
||||
#define OCI_SKIP 1
|
||||
|
||||
sword ocibin( struct csrdef *cursor, oratext *sqlvar, sword sqlvl,
|
||||
ub1 *progv, sword progvl, sword ftype, sword scale,
|
||||
oratext *fmt, sword fmtl, sword fmtt );
|
||||
sword ocibrv( struct csrdef *cursor, oratext *sqlvar, sword sqlvl,
|
||||
ub1 *progv, sword progvl, sword ftype, sword scale, sb2 *indp,
|
||||
oratext *fmt, sword fmtl, sword fmtt );
|
||||
sword ocibra( struct csrdef *cursor, oratext *sqlvar, sword sqlvl,
|
||||
ub1 *progv, sword progvl, sword ftype, sword scale,
|
||||
sb2 *indp, ub2 *aln, ub2 *rcp, ub4 mal, ub4 *cal,
|
||||
oratext *fmt, sword fmtl, sword fmtt );
|
||||
sword ocibndps( struct csrdef *cursor, ub1 opcode, oratext *sqlvar,
|
||||
sb4 sqlvl, ub1 *progv, sb4 progvl, sword ftype,
|
||||
sword scale, sb2 *indp, ub2 *aln, ub2 *rcp, sb4 pv_skip,
|
||||
sb4 ind_skip, sb4 len_skip, sb4 rc_skip, ub4 mal,
|
||||
ub4 *cal, oratext *fmt, sb4 fmtl, sword fmtt );
|
||||
sword ocibnn ( struct csrdef *cursor, ub2 sqlvn, ub1 *progv, sword progvl,
|
||||
sword ftype, sword scale, oratext *fmt, sword fmtl,
|
||||
sword fmtt );
|
||||
sword ocibrn( struct csrdef *cursor, sword sqlvn, ub1 *progv, sword progvl,
|
||||
sword ftype, sword scale, sb2 *indp, oratext *fmt, sword fmtl,
|
||||
sword fmtt );
|
||||
/*
|
||||
** ocibin - bind by value by name
|
||||
** ocibrv - bind by reference by name
|
||||
** ocibra - bind by reference by name (array)
|
||||
** ocibndps - bind by reference by name (array) piecewise or with skips
|
||||
** ocibnn - bind by value numeric
|
||||
** ocibrn - bind by reference numeric
|
||||
**
|
||||
** the contents of storage specified in bind-by-value calls are
|
||||
** evaluated immediately.
|
||||
** the addresses of storage specified in bind-by-reference calls are
|
||||
** remembered, and the contents are examined at every execute.
|
||||
**
|
||||
** cursor - pointer to csrdef
|
||||
** sqlvn - the number represented by the name of the bind variables
|
||||
** for variables of the form :n or &n for n in [1..256)
|
||||
** (i.e. &1, :234). unnecessarily using larger numbers
|
||||
** in the range wastes space.
|
||||
** sqlvar - the name of the bind variable (:name or &name)
|
||||
** sqlval - the length of the name;
|
||||
** in bindif -1, strlen(bvname) is used
|
||||
** progv - pointer to the object to bind.
|
||||
** progvl - length of object to bind.
|
||||
** in bind-by-value if specified as -1 then strlen(bfa) is
|
||||
** used (really only makes sends with character types)
|
||||
** in bind-by-value, if specified as -1 then UB2MAXVAL
|
||||
** is used. Again this really makes sense only with
|
||||
** SQLT_STR.
|
||||
** ftype - datatype of object
|
||||
** indp - pointer to indicator variable.
|
||||
** -1 means to ignore bfa/bfl and bind NULL;
|
||||
** not -1 means to bind the contents of bfa/bfl
|
||||
** bind the contents pointed to by bfa
|
||||
** aln - Alternate length pointer
|
||||
** rcp - Return code pointer
|
||||
** mal - Maximum array length
|
||||
** cal - Current array length pointer
|
||||
** fmt - format string
|
||||
** fmtl - length of format string; if -1, strlen(fmt) is used
|
||||
** fmtt - desired output type after applying forat mask. Not
|
||||
** really yet implemented
|
||||
** scale - number of decimal digits in a cobol packed decimal (type 7)
|
||||
**
|
||||
** Note that the length of bfa when bound as SQLT_STR is reduced
|
||||
** to strlen(bfa).
|
||||
** Note that trailing blanks are stripped of storage of SQLT_STR.
|
||||
*/
|
||||
|
||||
/***************************/
|
||||
/* DESCRIBING */
|
||||
/***************************/
|
||||
sword ocidsc ( struct csrdef *cursor, sword pos, sb2 *dbsize, sb2 *fsize,
|
||||
sb2 *rcode, sb2 *dtype, sb1 *buf, sb2 *bufl, sb2 *dsize );
|
||||
sword ocidsr( struct csrdef *cursor, sword pos, sb2 *dbsize, sb2 *dtype,
|
||||
sb2 *fsize );
|
||||
sword ocinam( struct csrdef *cursor, sword pos, sb1 *tbuf, sb2 *tbufl,
|
||||
sb1 *buf, sb2 *bufl );
|
||||
/*
|
||||
** ocidsc, ocidsr: Obtain information about a column
|
||||
** ocinam : get the name of a column
|
||||
** cursor - pointer to csrdef
|
||||
** pos - position in select list from [1..N]
|
||||
** dbsize - place to store the database size
|
||||
** fsize - place to store the fetched size
|
||||
** rcode - place to store the fetched column returned code
|
||||
** dtype - place to store the data type
|
||||
** buf - array to store the column name
|
||||
** bufl - place to store the column name length
|
||||
** dsize - maximum display size
|
||||
** tbuf - place to store the table name
|
||||
** tbufl - place to store the table name length
|
||||
*/
|
||||
|
||||
sword ocidsp ( struct csrdef *cursor, sword pos, sb4 *dbsize, sb2 *dbtype,
|
||||
sb1 *cbuf, sb4 *cbufl, sb4 *dsize, sb2 *pre, sb2 *scl,
|
||||
sb2 *nul );
|
||||
|
||||
sword ocidpr( ldadef *lda, oratext *object_name, size_t object_length,
|
||||
void * reserved1, size_t reserved1_length, void * reserved2,
|
||||
size_t reserved2_length, ub2 *overload, ub2 *position,
|
||||
ub2 *level, oratext **argument_name, ub2 *argument_length,
|
||||
ub2 *datatype, ub1 *default_supplied, ub1 *in_out,
|
||||
ub4 *length, sb2 *precision, sb2 *scale, ub1 *radix,
|
||||
ub4 *spare, ub4 *total_elements );
|
||||
/*
|
||||
** OCIDPR - User Program Interface: Describe Stored Procedure
|
||||
**
|
||||
** This routine is used to obtain information about the calling
|
||||
** arguments of a stored procedure. The client provides the
|
||||
** name of the procedure using "object_name" and "database_name"
|
||||
** (database name is optional). The client also supplies the
|
||||
** arrays for OCIDPR to return the values and indicates the
|
||||
** length of array via the "total_elements" parameter. Upon return
|
||||
** the number of elements used in the arrays is returned in the
|
||||
** "total_elements" parameter. If the array is too small then
|
||||
** an error will be returned and the contents of the return arrays
|
||||
** are invalid.
|
||||
**
|
||||
**
|
||||
** EXAMPLE :
|
||||
**
|
||||
** Client provides -
|
||||
**
|
||||
** object_name - SCOTT.ACCOUNT_UPDATE@BOSTON
|
||||
** total_elements - 100
|
||||
**
|
||||
**
|
||||
** ACCOUNT_UPDATE is an overloaded function with specification :
|
||||
**
|
||||
** type number_table is table of number index by binary_integer;
|
||||
** table account (account_no number, person_id number,
|
||||
** balance number(7,2))
|
||||
** table person (person_id number(4), person_nm varchar2(10))
|
||||
**
|
||||
** function ACCOUNT_UPDATE (account number,
|
||||
** person person%rowtype, amounts number_table,
|
||||
** trans_date date) return accounts.balance%type;
|
||||
**
|
||||
** function ACCOUNT_UPDATE (account number,
|
||||
** person person%rowtype, amounts number_table,
|
||||
** trans_no number) return accounts.balance%type;
|
||||
**
|
||||
**
|
||||
** Values returned -
|
||||
**
|
||||
** overload position argument level datatype length prec scale rad
|
||||
** -------------------------------------------------------------------
|
||||
** 0 0 0 NUMBER 22 7 2 10
|
||||
** 0 1 ACCOUNT 0 NUMBER 22 0 0 0
|
||||
** 0 2 PERSON 0 RECORD 0 0 0 0
|
||||
** 0 2 PERSON_ID 1 NUMBER 22 4 0 10
|
||||
** 0 2 PERSON_NM 1 VARCHAR2 10 0 0 0
|
||||
** 0 3 AMOUNTS 0 TABLE 0 0 0 0
|
||||
** 0 3 1 NUMBER 22 0 0 0
|
||||
** 0 4 TRANS_NO 0 NUMBER 22 0 0 0
|
||||
**
|
||||
** 1 0 0 NUMBER 22 7 2 10
|
||||
** 1 1 ACCOUNT 0 NUMBER 22 0 0 0
|
||||
** 1 2 PERSON 0 RECORD 0 0 0 0
|
||||
** 1 2 PERSON_ID 1 NUMBER 22 4 0 10
|
||||
** 1 2 PERSON_NM 1 VARCHAR2 10 0 0 0
|
||||
** 1 3 AMOUNTS 0 TABLE 0 0 0 0
|
||||
** 1 3 1 NUMBER 22 0 0 0
|
||||
** 1 4 TRANS_DATE 0 NUMBER 22 0 0 0
|
||||
**
|
||||
**
|
||||
** OCIDPR Argument Descriptions -
|
||||
**
|
||||
** ldadef - pointer to ldadef
|
||||
** object_name - object name, synonyms are also accepted and will
|
||||
** be translate, currently only procedure and function
|
||||
** names are accepted, also NLS names are accepted.
|
||||
** Currently, the accepted format of a name is
|
||||
** [[part1.]part2.]part3[@dblink] (required)
|
||||
** object_length - object name length (required)
|
||||
** reserved1 - reserved for future use
|
||||
** reserved1_length - reserved for future use
|
||||
** reserved2 - reserved for future use
|
||||
** reserved2_length - reserved for future use
|
||||
** overload - array indicating overloaded procedure # (returned)
|
||||
** position - array of argument positions, position 0 is a
|
||||
** function return argument (returned)
|
||||
** level - array of argument type levels, used to describe
|
||||
** sub-datatypes of data structures like records
|
||||
** and arrays (returned)
|
||||
** argument_name - array of argument names, only returns first
|
||||
** 30 characters of argument names, note storage
|
||||
** for 30 characters is allocated by client (returned)
|
||||
** argument_length - array of argument name lengths (returned)
|
||||
** datatype - array of oracle datatypes (returned)
|
||||
** default_supplied - array indicating parameter has default (returned)
|
||||
** 0 = no default, 1 = default supplied
|
||||
** in_out - array indicating if argument is IN or OUT (returned
|
||||
** 0 = IN param, 1 = OUT param, 2 = IN/OUT param
|
||||
** length - array of argument lengths (returned)
|
||||
** precision - array of precisions (if number type)(returned)
|
||||
** scale - array of scales (if number type)(returned)
|
||||
** radix - array of radix (if number type)(returned)
|
||||
** spare - array of spares.
|
||||
** total_elements - size of arrays supplied by client (required),
|
||||
** total number of elements filled (returned)
|
||||
*/
|
||||
|
||||
/*************************************/
|
||||
/* DEFINING */
|
||||
/*************************************/
|
||||
sword ocidfi( struct csrdef *cursor, sword pos, ub1 *buf, sword bufl,
|
||||
sword ftype, sb2 *rc, sword scale );
|
||||
sword ocidfn( struct csrdef *cursor, sword pos, ub1 *buf, sword bufl,
|
||||
sword ftype, sword scale, sb2 *indp, oratext *fmt, sword fmtl,
|
||||
sword fmtt, ub2 *rl, ub2 *rc );
|
||||
sword ocidfnps( struct csrdef *cursor, ub1 opcode, sword pos, ub1 *buf,
|
||||
sb4 bufl, sword ftype, sword scale,
|
||||
sb2 *indp, oratext *fmt, sb4 fmtl,
|
||||
sword fmtt, ub2 *rl, ub2 *rc,
|
||||
sb4 pv_skip, sb4 ind_skip, sb4 len_skip,
|
||||
sb4 rc_skip );
|
||||
|
||||
|
||||
/* Define a user data buffer using upidfn
|
||||
** cursor - pointer to csrdef
|
||||
** pos - position of a field or exp in the select list of a query
|
||||
** bfa/bfl - address and length of client-supplied storage
|
||||
to receive data
|
||||
** ftype - user datatype
|
||||
** scale - number of fractional digits for cobol packed decimals
|
||||
** indp - place to store the length of the returned value. If returned
|
||||
** value is:
|
||||
** negative, the field fetched was NULL
|
||||
** zero , the field fetched was same length or shorter than
|
||||
** the buffer provided
|
||||
** positive, the field fetched was truncated
|
||||
** fmt - format string
|
||||
** fmtl - length of format string, if -1 strlent(fmt) used
|
||||
** rl - place to store column length after each fetch
|
||||
** rc - place to store column error code after each fetch
|
||||
** fmtt - fomat type
|
||||
*/
|
||||
|
||||
/********************************/
|
||||
/* PIECE INFORMATION GET/SET */
|
||||
/********************************/
|
||||
sword ocigetpi( struct csrdef *cursor, ub1 *piecep,
|
||||
void **ctxpp, ub4 *iterp, ub4 *indexp );
|
||||
sword ocisetpi( struct csrdef *cursor, ub1 piece,
|
||||
void *bufp, ub4 *lenp );
|
||||
|
||||
|
||||
/********************************/
|
||||
/* EXECUTE */
|
||||
/********************************/
|
||||
sword ociexe( struct csrdef *cursor );
|
||||
sword ociexn( struct csrdef *cursor, sword iters, sword roff );
|
||||
sword ociefn( struct csrdef *cursor, ub4 nrows, sword can, sword exact );
|
||||
/*
|
||||
** ociexe - execute a cursor
|
||||
** ociexn - execute a cursosr N times
|
||||
** cursor - pointer to a csrdef
|
||||
** iters - number of times to execute cursor
|
||||
** roff - offset within the bind variable array at which to begin
|
||||
** operations.
|
||||
*/
|
||||
|
||||
|
||||
/*********************************/
|
||||
/* FETCHING */
|
||||
/*********************************/
|
||||
sword ocifet( struct csrdef *cursor );
|
||||
sword ocifen( struct csrdef *cursor, sword nrows );
|
||||
/* ocifet - fetch the next row
|
||||
** ocifen - fetch n rows
|
||||
** cursor - pointer to csrdef
|
||||
** nrows - number of rows to be fetched
|
||||
*/
|
||||
|
||||
sword ocilng( struct csrdef *cursor, sword posit, ub1 *bfa, sb4 bfl,
|
||||
sword dty, ub4 *rln, sb4 off );
|
||||
|
||||
/*********************************/
|
||||
/* CONVERSION */
|
||||
/*********************************/
|
||||
sword ocic32( struct csrdef *cursor );
|
||||
/*
|
||||
** Convert selected version 3 return codes to the equivalent
|
||||
** version 2 code.
|
||||
** csrdef->csrrc is set to the converted code
|
||||
** csrdef->csrft is set to v2 oracle statment type
|
||||
** csrdef->csrrpc is set to the rows processed count
|
||||
** csrdef->csrpeo is set to error postion
|
||||
**
|
||||
** cursor - pointer to csrdef
|
||||
*/
|
||||
|
||||
|
||||
sword ocir32( struct csrdef *cursor, sword retcode );
|
||||
/*
|
||||
** Convert selected version 3 return codes to the equivalent version 2
|
||||
** code.
|
||||
**
|
||||
** cursor - pointer to csrdef
|
||||
** retcode - place to store the return code
|
||||
*/
|
||||
|
||||
|
||||
void ociscn( sword **arglst, char *mask_addr, sword **newlst );
|
||||
/*
|
||||
** Convert call-by-ref to call-by-value:
|
||||
** takes an arg list and a mask address, determines which args need
|
||||
** conversion to a value, and creates a new list begging at the address
|
||||
** of newlst.
|
||||
**
|
||||
** arglst - list of arguments
|
||||
** mast_addr _ mask address determines args needing conversion
|
||||
** newlst - new list of args
|
||||
*/
|
||||
|
||||
sword ocistf ( sword typ, sword bufl, sword rdig, oratext *fmt,
|
||||
struct csrdef *cursor, sword *err );
|
||||
/* Convert a packed decimal buffer length (bytes) and scale to a format
|
||||
** string of the form mm.+/-nn, where mm is the number of packed
|
||||
** decimal digits, and nn is the scaling factor. A positive scale name
|
||||
** nn digits to the rights of the decimal; a negative scale means nn zeros
|
||||
** should be supplied to the left of the decimal.
|
||||
** bufl - length of the packed decimal buffer
|
||||
** rdig - number of fractional digits
|
||||
** fmt - pointer to a string holding the conversion format
|
||||
** cursor - pointer to csrdef
|
||||
** err - pointer to word storing error code
|
||||
*/
|
||||
|
||||
|
||||
/******************************************/
|
||||
/* Non-blocking operations */
|
||||
/******************************************/
|
||||
sword ocinbs( ldadef *lda ); /* set a connection to non-blocking */
|
||||
sword ocinbt( ldadef *lda ); /* test if connection is non-blocking */
|
||||
sword ocinbc( ldadef *lda ); /* clear a connection to blocking */
|
||||
sword ocinlo( ldadef *lda, struct hstdef *hst, oratext *conn,
|
||||
sword connl, oratext *uid, sword uidl,
|
||||
oratext *psw, sword pswl, sword audit );
|
||||
/* logon in non-blocking fashion */
|
||||
/* ocinlo allows an application to logon in non-blocking fashion.
|
||||
** lda - pointer to ldadef
|
||||
** hst - pointer to a 256 byte area, must be cleared to zero before call
|
||||
** conn - the database link (if specified @LINK in uid will be ignored)
|
||||
** connl - length of conn; if -1 strlen(conn) is used
|
||||
** uid - user id [USER[/PASSWORD][@LINK]]
|
||||
** uidl - length of uid, if -1 strlen(uid) is used
|
||||
** psw - password string; ignored if specified in uid
|
||||
** pswl - length of psw, if -1 strlen(psw) is used
|
||||
** audit - is not supported; the only permissible value is 0
|
||||
*/
|
||||
|
||||
/***************************************************/
|
||||
/* Procedure Declaration for Pro*C */
|
||||
/***************************************************/
|
||||
/* Note: The following routines are used in Pro*C and have the
|
||||
same interface as their couterpart in OCI.
|
||||
Althought the interface follows for more details please refer
|
||||
to the above routines */
|
||||
|
||||
/******************************************/
|
||||
/* initialization/logon/logof */
|
||||
/******************************************/
|
||||
sword ocipin( ub4 mode );
|
||||
|
||||
sword ologin( ldadef *lda, sb2 areacount );
|
||||
sword ologon( ldadef *lda, sb2 areacount );
|
||||
|
||||
/*****************************************/
|
||||
/* Open/Close/Parse Cursor */
|
||||
/*****************************************/
|
||||
|
||||
/*
|
||||
** ocisqd - oci delayed parse (Should be used only with deferred upi/oci)
|
||||
** FUNCTION: Call upidpr to delay the parse of the sql statement till the
|
||||
** time that a call needs to be made to the kernel (execution or
|
||||
** describe time )
|
||||
** RETURNS: Oracle return code.
|
||||
*/
|
||||
sword ocisq7( struct csrdef *cursor, oratext * /* sqlstm */, sb4 sqllen,
|
||||
sword defflg, ub4 sqlt );
|
||||
|
||||
/*****************************************/
|
||||
/* Bind */
|
||||
/*****************************************/
|
||||
sword obind( struct csrdef *cursor, oratext *sqlvar, sword sqlvl,
|
||||
ub1 *progv, sword progvl, sword ftype, sword scale,
|
||||
oratext *fmt, sword fmtl, sword fmtt );
|
||||
sword obindn( struct csrdef *cursor, ub2 sqlvn, ub1 *progv, sword progvl,
|
||||
sword ftype, sword scale, oratext *fmt, sword fmtl,
|
||||
sword fmtt );
|
||||
|
||||
/**********************************************/
|
||||
/* Define */
|
||||
/**********************************************/
|
||||
sword odfinn( struct csrdef *cursor, sword pos, ub1 *buf, sword bufl,
|
||||
sword ftype, sb2 *rc, sword scale );
|
||||
|
||||
/**********************************************/
|
||||
/* Describe */
|
||||
/**********************************************/
|
||||
sword odsrbn( struct csrdef *cursor, sword pos, sb2 *dbsize, sb2 *dtype,
|
||||
sb2 *fsize );
|
||||
|
||||
|
||||
/******************************************/
|
||||
/* Non-blocking operations */
|
||||
/******************************************/
|
||||
sword onblon( ldadef *lda, struct hstdef *hst, oratext *conn,
|
||||
sword connl, oratext *uid, sword uidl,
|
||||
oratext *psw, sword pswl, sword audit );
|
||||
/* logon in non-blocking fashion */
|
||||
sword ocignfd( ldadef *lda, void *nfdp ); /* get native fd */
|
||||
|
||||
ub2 ocigft_getFcnType( ub2 oertyp ); /* get sql function code */
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,113 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
/* Copyright (c) 1991, 2005, Oracle. All rights reserved. */
|
||||
/* Copyright (c) 1991, 2005, Oracle. All rights reserved. */
|
||||
/*
|
||||
NAME
|
||||
ocidem.h - OCI demo header
|
||||
MODIFIED (MM/DD/YY)
|
||||
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
|
||||
whe 04/07/99 - bug#810071
|
||||
whe 03/19/99 - lrg 32079 etc.: putting static back for oci_func_tab
|
||||
nmacnaug 02/02/99 - static declarations should not be in header files
|
||||
mygopala 09/22/97 - Fix for bug 550351
|
||||
surman 03/14/97 - Merge 413362 to 8.0.3
|
||||
surman 11/08/96 - 413362: Add SS_64BIT_SERVER macro
|
||||
emendez 04/07/94 - merge changes from branch 1.6.710.1
|
||||
emendez 02/02/94 - Fix for bug 157576
|
||||
jnlee 01/05/93 - include oratypes.h once, make oci_func_tab static
|
||||
rkooi2 10/26/92 - More portability mods
|
||||
rkooi2 10/22/92 - Change text back to char to avoid casts
|
||||
rkooi2 10/20/92 - Changes to make it portable
|
||||
sjain 03/16/92 - Creation
|
||||
*/
|
||||
|
||||
/*
|
||||
* ocidem.h
|
||||
*
|
||||
* Declares additional functions and data structures
|
||||
* used in the OCI C sample programs.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ORATYPES
|
||||
#include <oratypes.h>
|
||||
#endif /* ORATYPES */
|
||||
|
||||
#ifndef OCIDFN
|
||||
#include <ocidfn.h>
|
||||
#endif /* OCIDFN */
|
||||
|
||||
#ifndef OCIDEM
|
||||
#define OCIDEM
|
||||
|
||||
|
||||
/* internal/external datatype codes */
|
||||
#define VARCHAR2_TYPE 1
|
||||
#define NUMBER_TYPE 2
|
||||
#define INT_TYPE 3
|
||||
#define FLOAT_TYPE 4
|
||||
#define STRING_TYPE 5
|
||||
#define ROWID_TYPE 11
|
||||
#define DATE_TYPE 12
|
||||
|
||||
/* ORACLE error codes used in demonstration programs */
|
||||
#define VAR_NOT_IN_LIST 1007
|
||||
#ifndef NO_DATA_FOUND
|
||||
# define NO_DATA_FOUND 1403
|
||||
#endif
|
||||
#define NULL_VALUE_RETURNED 1405
|
||||
|
||||
/* some SQL and OCI function codes */
|
||||
#define FT_INSERT 3
|
||||
#define FT_SELECT 4
|
||||
#define FT_UPDATE 5
|
||||
#define FT_DELETE 9
|
||||
|
||||
#define FC_OOPEN 14
|
||||
|
||||
/*
|
||||
* OCI function code labels,
|
||||
* corresponding to the fc numbers
|
||||
* in the cursor data area.
|
||||
*/
|
||||
static const text *oci_func_tab[] = {(text *) "not used",
|
||||
/* 1-2 */ (text *) "not used", (text *) "OSQL",
|
||||
/* 3-4 */ (text *) "not used", (text *) "OEXEC, OEXN",
|
||||
/* 5-6 */ (text *) "not used", (text *) "OBIND",
|
||||
/* 7-8 */ (text *) "not used", (text *) "ODEFIN",
|
||||
/* 9-10 */ (text *) "not used", (text *) "ODSRBN",
|
||||
/* 11-12 */ (text *) "not used", (text *) "OFETCH, OFEN",
|
||||
/* 13-14 */ (text *) "not used", (text *) "OOPEN",
|
||||
/* 15-16 */ (text *) "not used", (text *) "OCLOSE",
|
||||
/* 17-18 */ (text *) "not used", (text *) "not used",
|
||||
/* 19-20 */ (text *) "not used", (text *) "not used",
|
||||
/* 21-22 */ (text *) "not used", (text *) "ODSC",
|
||||
/* 23-24 */ (text *) "not used", (text *) "ONAME",
|
||||
/* 25-26 */ (text *) "not used", (text *) "OSQL3",
|
||||
/* 27-28 */ (text *) "not used", (text *) "OBNDRV",
|
||||
/* 29-30 */ (text *) "not used", (text *) "OBNDRN",
|
||||
/* 31-32 */ (text *) "not used", (text *) "not used",
|
||||
/* 33-34 */ (text *) "not used", (text *) "OOPT",
|
||||
/* 35-36 */ (text *) "not used", (text *) "not used",
|
||||
/* 37-38 */ (text *) "not used", (text *) "not used",
|
||||
/* 39-40 */ (text *) "not used", (text *) "not used",
|
||||
/* 41-42 */ (text *) "not used", (text *) "not used",
|
||||
/* 43-44 */ (text *) "not used", (text *) "not used",
|
||||
/* 45-46 */ (text *) "not used", (text *) "not used",
|
||||
/* 47-48 */ (text *) "not used", (text *) "not used",
|
||||
/* 49-50 */ (text *) "not used", (text *) "not used",
|
||||
/* 51-52 */ (text *) "not used", (text *) "OCAN",
|
||||
/* 53-54 */ (text *) "not used", (text *) "OPARSE",
|
||||
/* 55-56 */ (text *) "not used", (text *) "OEXFET",
|
||||
/* 57-58 */ (text *) "not used", (text *) "OFLNG",
|
||||
/* 59-60 */ (text *) "not used", (text *) "ODESCR",
|
||||
/* 61-62 */ (text *) "not used", (text *) "OBNDRA",
|
||||
/* 63-64 */ (text *) "OBINDPS", (text *) "ODEFINPS",
|
||||
/* 65-66 */ (text *) "OGETPI", (text *) "OSETPI"
|
||||
};
|
||||
|
||||
#endif /* OCIDEM */
|
||||
|
||||
@ -0,0 +1,249 @@
|
||||
/* Copyright (c) 1991, 2005, Oracle. All rights reserved. */
|
||||
/* Copyright (c) 1991, 2005, Oracle. All rights reserved. */
|
||||
/*
|
||||
NAME
|
||||
ocidfn.h - OCI Definations
|
||||
NOTES
|
||||
Shipped to users.
|
||||
MODIFIED (MM/DD/YY)
|
||||
mbastawa 09/16/05 - dbhygiene
|
||||
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
|
||||
srseshad 11/25/02 - change binary float/double codes
|
||||
srseshad 11/14/02 - Add SQLT_IBFLOAT, SQLT_IBDOUBLE
|
||||
mxyang 09/17/02 - grabtrans 'mmorsi_obj_float'
|
||||
srseshad 09/06/02 - Add binary float/double
|
||||
aahluwal 06/04/02 - bug 2360115
|
||||
kmuthukk 05/02/00 - add SQLT_PNTY
|
||||
amangal 07/30/99 - Merge into 8.1.6 : Bug 879031
|
||||
tnbui 07/28/99 - Remove SQLT_TIMESTAMP_ITZ
|
||||
tnbui 07/21/99 - SQLT_TIMESTAMP_LTZ
|
||||
tnbui 06/16/99 - TIMESTAMP WITH IMPLICIT TIME ZONE
|
||||
whe 04/07/99 - bug#810075
|
||||
whe 03/19/99 - lrg 32079 etc.: move HDA def from ocidem.h to ocidfn.
|
||||
skmishra 05/10/98 -
|
||||
vyanaman 04/16/98 - update sql92 datatypes
|
||||
khnguyen 01/16/98 -
|
||||
khnguyen 12/23/97 - SQLT* for datetimes and intervals
|
||||
tanguyen 08/19/97 -
|
||||
dchatter 03/18/97 - porting exception 390897
|
||||
dchatter 05/02/97 - merge porting exception
|
||||
dalpern 12/04/96 - SQLCS_LIT_NULL added
|
||||
cxcheng 11/14/96 - add SQLT_BFILE/SQLT_CFILE to fix compile prob
|
||||
cxcheng 11/12/96 - add SQLT_NCO for named collection
|
||||
lchidamb 10/17/96 - add SQLT_VST and SQLT_ODT
|
||||
sgollapu 10/14/96 - Mutual exclusion of ocidfn and sqldef
|
||||
sgollapu 10/07/96 - OCI Simplification
|
||||
aroy 09/09/96 - add SQLCS* definitions
|
||||
slari 08/07/96 - add SQLT_RDD, rowid descriptor
|
||||
slari 06/12/96 - remove SQLT_TTBL
|
||||
dchatter 04/21/96 - prepare for merge into main
|
||||
slari 08/24/95 - b299432, define CDA_SIZE
|
||||
zwalcott 02/28/96 - add SQLT_BFILEE and SQLT_CFILEE.
|
||||
lchidamb 02/22/96 - make dtys consistent with dtydef.h
|
||||
lchidamb 02/16/96 - add SQLT_BFILEE and SQLT_CFILEE
|
||||
lchidamb 01/30/96 - rename new datatypes for v8
|
||||
lchidamb 09/06/95 - add new datatypes
|
||||
slari 05/11/95 - add OCI_EV_DEF and OCI_EV_TSF
|
||||
dchatter 04/06/95 - add ifdef flags around OCI_flags
|
||||
dchatter 03/08/95 - piece values
|
||||
dchatter 03/06/95 - merge changes from branch 1.2.720.3
|
||||
jfbrown 02/17/95 - merge changes from branch 1.2.720.2
|
||||
dchatter 02/08/95 - olog call modes
|
||||
jfbrown 02/03/95 - remove non-printable characters
|
||||
lchidamb 12/06/94 - merge changes from branch 1.2.720.1
|
||||
lchidamb 10/04/94 - added field chk to cda_head, cda_def
|
||||
dchatter 07/05/94 - SQLT_CUR added
|
||||
rkooi2 11/27/92 - Changing e* datatypes to s*
|
||||
rkooi2 10/26/92 - More portability mods
|
||||
rkooi2 10/22/92 - Added #ifndef ORATYPES ...
|
||||
rkooi2 10/18/92 - Changes to make it portable.
|
||||
sjain 03/16/92 - Creation
|
||||
*/
|
||||
|
||||
/*
|
||||
* ocidfn.h
|
||||
*
|
||||
* Common header file for OCI C sample programs.
|
||||
* This header declares the cursor and logon data area structure.
|
||||
* The types used are defined in <oratypes.h>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef OCIDFN
|
||||
#define OCIDFN
|
||||
|
||||
#include <oratypes.h>
|
||||
|
||||
/* The cda_head struct is strictly PRIVATE. It is used
|
||||
internally only. Do not use this struct in OCI programs. */
|
||||
|
||||
struct cda_head {
|
||||
sb2 v2_rc;
|
||||
ub2 ft;
|
||||
ub4 rpc;
|
||||
ub2 peo;
|
||||
ub1 fc;
|
||||
ub1 rcs1;
|
||||
ub2 rc;
|
||||
ub1 wrn;
|
||||
ub1 rcs2;
|
||||
sword rcs3;
|
||||
struct {
|
||||
struct {
|
||||
ub4 rcs4;
|
||||
ub2 rcs5;
|
||||
ub1 rcs6;
|
||||
} rd;
|
||||
ub4 rcs7;
|
||||
ub2 rcs8;
|
||||
} rid;
|
||||
sword ose;
|
||||
ub1 chk;
|
||||
void *rcsp;
|
||||
};
|
||||
|
||||
/*
|
||||
** Size of HDA area:
|
||||
** 512 for 64 bit arquitectures
|
||||
** 256 for 32 bit arquitectures
|
||||
*/
|
||||
|
||||
#if defined(SS_64BIT_SERVER) || defined(__64BIT__)
|
||||
# define HDA_SIZE 512
|
||||
#else
|
||||
# define HDA_SIZE 256
|
||||
#endif
|
||||
|
||||
#if defined(SS_64BIT_SERVER) || defined(__64BIT__)
|
||||
#define CDA_SIZE 88
|
||||
#else
|
||||
# define CDA_SIZE 64
|
||||
#endif
|
||||
|
||||
/* the real CDA, padded to CDA_SIZE bytes in size */
|
||||
struct cda_def {
|
||||
sb2 v2_rc; /* V2 return code */
|
||||
ub2 ft; /* SQL function type */
|
||||
ub4 rpc; /* rows processed count */
|
||||
ub2 peo; /* parse error offset */
|
||||
ub1 fc; /* OCI function code */
|
||||
ub1 rcs1; /* filler area */
|
||||
ub2 rc; /* V7 return code */
|
||||
ub1 wrn; /* warning flags */
|
||||
ub1 rcs2; /* reserved */
|
||||
sword rcs3; /* reserved */
|
||||
struct { /* rowid structure */
|
||||
struct {
|
||||
ub4 rcs4;
|
||||
ub2 rcs5;
|
||||
ub1 rcs6;
|
||||
} rd;
|
||||
ub4 rcs7;
|
||||
ub2 rcs8;
|
||||
} rid;
|
||||
sword ose; /* OSD dependent error */
|
||||
ub1 chk;
|
||||
void *rcsp; /* pointer to reserved area */
|
||||
ub1 rcs9[CDA_SIZE - sizeof (struct cda_head)]; /* filler */
|
||||
};
|
||||
|
||||
typedef struct cda_def Cda_Def;
|
||||
|
||||
/* the logon data area (LDA)
|
||||
is the same shape as the CDA */
|
||||
typedef struct cda_def Lda_Def;
|
||||
|
||||
/* OCI Environment Modes for opinit call */
|
||||
#define OCI_EV_DEF 0 /* default single-threaded environment */
|
||||
#define OCI_EV_TSF 1 /* thread-safe environment */
|
||||
|
||||
/* OCI Logon Modes for olog call */
|
||||
#define OCI_LM_DEF 0 /* default login */
|
||||
#define OCI_LM_NBL 1 /* non-blocking logon */
|
||||
|
||||
/*
|
||||
* since sqllib uses both ocidef and ocidfn the following defines
|
||||
* need to be guarded
|
||||
*/
|
||||
#ifndef OCI_FLAGS
|
||||
#define OCI_FLAGS
|
||||
|
||||
/* OCI_*_PIECE defines the piece types that are returned or set
|
||||
*/
|
||||
#define OCI_ONE_PIECE 0 /* there or this is the only piece */
|
||||
#define OCI_FIRST_PIECE 1 /* the first of many pieces */
|
||||
#define OCI_NEXT_PIECE 2 /* the next of many pieces */
|
||||
#define OCI_LAST_PIECE 3 /* the last piece of this column */
|
||||
#endif
|
||||
|
||||
#ifndef SQLDEF
|
||||
|
||||
/* input data types */
|
||||
#define SQLT_CHR 1 /* (ORANET TYPE) character string */
|
||||
#define SQLT_NUM 2 /* (ORANET TYPE) oracle numeric */
|
||||
#define SQLT_INT 3 /* (ORANET TYPE) integer */
|
||||
#define SQLT_FLT 4 /* (ORANET TYPE) Floating point number */
|
||||
#define SQLT_STR 5 /* zero terminated string */
|
||||
#define SQLT_VNU 6 /* NUM with preceding length byte */
|
||||
#define SQLT_PDN 7 /* (ORANET TYPE) Packed Decimal Numeric */
|
||||
#define SQLT_LNG 8 /* long */
|
||||
#define SQLT_VCS 9 /* Variable character string */
|
||||
#define SQLT_NON 10 /* Null/empty PCC Descriptor entry */
|
||||
#define SQLT_RID 11 /* rowid */
|
||||
#define SQLT_DAT 12 /* date in oracle format */
|
||||
#define SQLT_VBI 15 /* binary in VCS format */
|
||||
#define SQLT_BFLOAT 21 /* Native Binary float*/
|
||||
#define SQLT_BDOUBLE 22 /* NAtive binary double */
|
||||
#define SQLT_BIN 23 /* binary data(DTYBIN) */
|
||||
#define SQLT_LBI 24 /* long binary */
|
||||
#define SQLT_UIN 68 /* unsigned integer */
|
||||
#define SQLT_SLS 91 /* Display sign leading separate */
|
||||
#define SQLT_LVC 94 /* Longer longs (char) */
|
||||
#define SQLT_LVB 95 /* Longer long binary */
|
||||
#define SQLT_AFC 96 /* Ansi fixed char */
|
||||
#define SQLT_AVC 97 /* Ansi Var char */
|
||||
#define SQLT_IBFLOAT 100 /* binary float canonical */
|
||||
#define SQLT_IBDOUBLE 101 /* binary double canonical */
|
||||
#define SQLT_CUR 102 /* cursor type */
|
||||
#define SQLT_RDD 104 /* rowid descriptor */
|
||||
#define SQLT_LAB 105 /* label type */
|
||||
#define SQLT_OSL 106 /* oslabel type */
|
||||
|
||||
#define SQLT_NTY 108 /* named object type */
|
||||
#define SQLT_REF 110 /* ref type */
|
||||
#define SQLT_CLOB 112 /* character lob */
|
||||
#define SQLT_BLOB 113 /* binary lob */
|
||||
#define SQLT_BFILEE 114 /* binary file lob */
|
||||
#define SQLT_CFILEE 115 /* character file lob */
|
||||
#define SQLT_RSET 116 /* result set type */
|
||||
#define SQLT_NCO 122 /* named collection type (varray or nested table) */
|
||||
#define SQLT_VST 155 /* OCIString type */
|
||||
#define SQLT_ODT 156 /* OCIDate type */
|
||||
|
||||
/* datetimes and intervals */
|
||||
#define SQLT_DATE 184 /* ANSI Date */
|
||||
#define SQLT_TIME 185 /* TIME */
|
||||
#define SQLT_TIME_TZ 186 /* TIME WITH TIME ZONE */
|
||||
#define SQLT_TIMESTAMP 187 /* TIMESTAMP */
|
||||
#define SQLT_TIMESTAMP_TZ 188 /* TIMESTAMP WITH TIME ZONE */
|
||||
#define SQLT_INTERVAL_YM 189 /* INTERVAL YEAR TO MONTH */
|
||||
#define SQLT_INTERVAL_DS 190 /* INTERVAL DAY TO SECOND */
|
||||
#define SQLT_TIMESTAMP_LTZ 232 /* TIMESTAMP WITH LOCAL TZ */
|
||||
|
||||
#define SQLT_PNTY 241 /* pl/sql representation of named types */
|
||||
|
||||
/* cxcheng: this has been added for backward compatibility -
|
||||
it needs to be here because ocidfn.h can get included ahead of sqldef.h */
|
||||
#define SQLT_FILE SQLT_BFILEE /* binary file lob */
|
||||
#define SQLT_CFILE SQLT_CFILEE
|
||||
#define SQLT_BFILE SQLT_BFILEE
|
||||
|
||||
/* CHAR/NCHAR/VARCHAR2/NVARCHAR2/CLOB/NCLOB char set "form" information */
|
||||
#define SQLCS_IMPLICIT 1 /* for CHAR, VARCHAR2, CLOB w/o a specified set */
|
||||
#define SQLCS_NCHAR 2 /* for NCHAR, NCHAR VARYING, NCLOB */
|
||||
#define SQLCS_EXPLICIT 3 /* for CHAR, etc, with "CHARACTER SET ..." syntax */
|
||||
#define SQLCS_FLEXIBLE 4 /* for PL/SQL "flexible" parameters */
|
||||
#define SQLCS_LIT_NULL 5 /* for typecheck of NULL and empty_clob() lits */
|
||||
|
||||
#endif /* SQLDEF */
|
||||
#endif /* OCIDFN */
|
||||
@ -0,0 +1,282 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
/* Copyright (c) 1996, 2005, Oracle. All rights reserved. */
|
||||
|
||||
/*
|
||||
NAME
|
||||
ociextp.h - Interface Definitions for PL/SQL External Procedures
|
||||
|
||||
DESCRIPTION
|
||||
This header file contains C language callable interface from
|
||||
PL/SQL External Procedures.
|
||||
|
||||
PUBLIC FUNCTION(S)
|
||||
OCIExtProcAllocCallMemory - Allocate Call memory
|
||||
OCIExtProcRaiseExcp - Raise Exception
|
||||
OCIExtProcRaiseExcpWithMsg - Raise Exception with message
|
||||
OCIExtProcGetEnv - Get OCI Environment
|
||||
|
||||
PRIVATE FUNCTION(S)
|
||||
<list of static functions defined in .c file - with one-line descriptions>
|
||||
|
||||
EXAMPLES
|
||||
|
||||
NOTES
|
||||
<other useful comments, qualifications, etc.>
|
||||
|
||||
MODIFIED (MM/DD/YY)
|
||||
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
|
||||
srseshad 03/12/03 - convert oci public api to ansi
|
||||
rdecker 01/10/02 - change 32k to MAX_OEN for error numbers
|
||||
sagrawal 07/20/01 - Statement Handle to safe cal outs
|
||||
abrumm 04/19/01 - move include of oci.h after defines/typedef
|
||||
rdecker 02/22/01 - lint fix
|
||||
bpalaval 02/08/01 - Change text to oratext.
|
||||
sagrawal 06/16/00 - ref cursor in callouts
|
||||
whe 09/01/99 - 976457:check __cplusplus for C++ code
|
||||
asethi 04/15/99 - Created (by moving ociextp.h from /vobs/plsql/public)
|
||||
rhari 03/25/97 - Use ifndef
|
||||
rhari 12/18/96 - Include oratypes.h
|
||||
rhari 12/11/96 - #416977, Flip values of return codes
|
||||
rhari 12/02/96 - Define Return Code Macros
|
||||
rhari 11/18/96 - Error number is int
|
||||
rhari 10/30/96 - Fix OCIExtProcRaiseExcpWithMsg
|
||||
rhari 10/30/96 - Get rid of warnings
|
||||
rhari 10/04/96 - Fix OCIExtProcRaiseExcpWithMsg
|
||||
rhari 09/23/96 - Creation
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef OCIEXTP_ORACLE
|
||||
# define OCIEXTP_ORACLE
|
||||
|
||||
# ifndef ORATYPES
|
||||
# include <oratypes.h>
|
||||
# endif
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PUBLIC TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/* ----------------------------- Return Codes ----------------------------- */
|
||||
/* Success and Error return codes for certain external procedure interface
|
||||
* functions. If a particular interface function returns OCIEXTPROC_SUCCESS
|
||||
* or OCIEXTPROC_ERROR, then applications must use these macros to check
|
||||
* for return values.
|
||||
*
|
||||
* OCIEXTPROC_SUCCESS -- External Procedure Success Return Code
|
||||
* OCIEXTPROC_ERROR -- External Procedure Failure Return Code
|
||||
*/
|
||||
#define OCIEXTPROC_SUCCESS 0
|
||||
#define OCIEXTPROC_ERROR 1
|
||||
|
||||
|
||||
/* --------------------------- With-Context Type --------------------------- */
|
||||
/*
|
||||
* The C callable interface to PL/SQL External Procedures require the
|
||||
* With-Context parameter to be passed. The type of this structure is
|
||||
* OCIExtProcContext is is opaque to the user.
|
||||
*
|
||||
* The user can declare the With-Context parameter in the application as
|
||||
*
|
||||
* OCIExtProcContext *with_context;
|
||||
*/
|
||||
typedef struct OCIExtProcContext OCIExtProcContext;
|
||||
|
||||
/* NOTE: OCIExtProcContext must be visible prior to including <oci.h> */
|
||||
|
||||
# ifndef OCI_ORACLE
|
||||
# include <oci.h>
|
||||
# endif
|
||||
|
||||
|
||||
/* ----------------------- OCIExtProcAllocCallMemory ----------------------- */
|
||||
/* OCIExtProcAllocCallMemory
|
||||
* Allocate N bytes of memory for the duration of the External Procedure.
|
||||
*
|
||||
* Memory thus allocated will be freed by PL/SQL upon return from the
|
||||
* External Procedure. You must not use any kind of 'free' function on
|
||||
* memory allocated by OCIExtProcAllocCallMemory.
|
||||
* Use this function to allocate memory for function returns.
|
||||
*
|
||||
* PARAMETERS
|
||||
* Input :
|
||||
* with_context - The with_context pointer that is passed to the C
|
||||
* External Procedure.
|
||||
* Type of with_context : OCIExtProcContext *
|
||||
* amount - The number of bytes to allocate.
|
||||
* Type of amount : size_t
|
||||
*
|
||||
* Output :
|
||||
* Nothing
|
||||
*
|
||||
* Return :
|
||||
* An untyped (opaque) Pointer to the allocated memory.
|
||||
*
|
||||
* Errors :
|
||||
* A 0 return value should be treated as an error
|
||||
*
|
||||
* EXAMPLE
|
||||
* text *ptr = (text *)OCIExtProcAllocCallMemory(wctx, 1024)
|
||||
*
|
||||
*/
|
||||
#define OCIExtProcAllocCallMemory(with_context, amount) \
|
||||
ociepacm(with_context, (size_t)amount)
|
||||
|
||||
|
||||
|
||||
|
||||
/* -------------------------- OCIExtProcRaiseExcp -------------------------- */
|
||||
/* OCIExtProcRaiseExcp
|
||||
* Raise an Exception to PL/SQL.
|
||||
*
|
||||
* Calling this function signalls an exception back to PL/SQL. After a
|
||||
* successful return from this function, the External Procedure must start
|
||||
* its exit handling and return back to PL/SQL. Once an exception is
|
||||
* signalled to PL/SQL, INOUT and OUT arguments, if any, are not processed
|
||||
* at all.
|
||||
*
|
||||
* PARAMETERS
|
||||
* Input :
|
||||
* with_context - The with_context pointer that is passed to the C
|
||||
* External Procedure.
|
||||
* Type of with_context : OCIExtProcContext *
|
||||
* errnum - Oracle Error number to signal to PL/SQL. errnum
|
||||
* must be a positive number and in the range 1 to MAX_OEN
|
||||
* Type of errnum : int
|
||||
* Output :
|
||||
* Nothing
|
||||
*
|
||||
* Return :
|
||||
* OCIEXTPROC_SUCCESS - If the call was successful.
|
||||
* OCIEXTPROC_ERROR - If the call failed.
|
||||
*
|
||||
*/
|
||||
#define OCIExtProcRaiseExcp(with_context, errnum) \
|
||||
ocieperr(with_context, (int)errnum)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* ---------------------- OCIExtProcRaiseExcpWithMsg ---------------------- */
|
||||
/* OCIExtProcRaiseExcpWithMsg
|
||||
* Raise an exception to PL/SQL. In addition, substitute the
|
||||
* following error message string within the standard Oracle error
|
||||
* message string. See note for OCIExtProcRaiseExcp
|
||||
*
|
||||
* PARAMETERS
|
||||
* Input :
|
||||
* with_context - The with_context pointer that is passed to the C
|
||||
* External Procedure.
|
||||
* Type of with_context : OCIExtProcContext *
|
||||
* errnum - Oracle Error number to signal to PL/SQL. errnum
|
||||
* must be a positive number and in the range 1 to MAX_OEN
|
||||
* Type of errnum : int
|
||||
* errmsg - The error message associated with the errnum.
|
||||
* Type of errmsg : char *
|
||||
* len - The length of the error message. 0 if errmsg is
|
||||
* null terminated string.
|
||||
* Type of len : size_t
|
||||
* Output :
|
||||
* Nothing
|
||||
*
|
||||
* Return :
|
||||
* OCIEXTPROC_SUCCESS - If the call was successful.
|
||||
* OCIEXTPROC_ERROR - If the call failed.
|
||||
*
|
||||
*/
|
||||
#define OCIExtProcRaiseExcpWithMsg(with_context, errnum, errmsg, msglen) \
|
||||
ociepmsg(with_context, (int)errnum, errmsg, (size_t)msglen)
|
||||
|
||||
|
||||
|
||||
/* --------------------------- OCIExtProcGetEnv --------------------------- */
|
||||
/* OCIExtProcGetEnv
|
||||
* Get OCI Environment
|
||||
*
|
||||
* PARAMETERS
|
||||
* Input :
|
||||
* with_context - The with_context pointer that is passed to the C
|
||||
* External Procedure.
|
||||
*
|
||||
* Output :
|
||||
* envh - The OCI Environment handle.
|
||||
* svch - The OCI Service handle.
|
||||
* errh - The OCI Error handle.
|
||||
*
|
||||
* Return :
|
||||
* OCI_SUCCESS - Successful completion of the function.
|
||||
* OCI_ERROR - Error.
|
||||
*
|
||||
*/
|
||||
#define OCIExtProcGetEnv(with_context, envh, svch, errh) \
|
||||
ociepgoe(with_context, envh, svch, errh)
|
||||
|
||||
|
||||
|
||||
/* ------------------------ OCIInitializeStatementHandle ------------------- */
|
||||
/* OCIreateStatementHandle
|
||||
* Initialize Statement Handle
|
||||
*
|
||||
* PARAMETERS
|
||||
* Input :
|
||||
* wctx - The
|
||||
* cursorno - The cursor number for which we need to initialize
|
||||
* the statement handle
|
||||
* svch - The OCI Service handle.
|
||||
*
|
||||
* Output :
|
||||
* stmthp - The OCI Statement handle.
|
||||
* errh - The OCI Error handle.
|
||||
*
|
||||
* Return :
|
||||
* OCI_SUCCESS - Successful completion of the function.
|
||||
* OCI_ERROR - Error.
|
||||
*
|
||||
*/
|
||||
#define OCIInitializeStatementHandle(wctx, cursorno, svch, stmthp, errh) \
|
||||
ociepish(wctx, cursor, svch, stmthp, errh)
|
||||
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PRIVATE TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PUBLIC FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PRIVATE FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
void *ociepacm(OCIExtProcContext *with_context, size_t amount);
|
||||
|
||||
|
||||
|
||||
size_t ocieperr(OCIExtProcContext *with_context, int error_number);
|
||||
|
||||
|
||||
|
||||
size_t ociepmsg(OCIExtProcContext *with_context, int error_number,
|
||||
oratext *error_message, size_t len );
|
||||
|
||||
|
||||
|
||||
sword ociepgoe(OCIExtProcContext *with_context, OCIEnv **envh,
|
||||
OCISvcCtx **svch, OCIError **errh);
|
||||
|
||||
|
||||
#endif /* OCIEXTP_ORACLE */
|
||||
@ -0,0 +1,165 @@
|
||||
/* Copyright (c) 1991, 2005, Oracle. All rights reserved. */
|
||||
/*
|
||||
NAME
|
||||
ocikpr.h - header of K & R compilers
|
||||
MODIFIED (MM/DD/YY)
|
||||
mbastawa 09/16/05 - dbhygiene
|
||||
porangas 12/04/00 - Forward merge bug#974710 to 9i
|
||||
sgollapu 05/19/98 - Change text to OraText
|
||||
dchatter 04/21/96 -
|
||||
dchatter 11/10/95 - add ognfd() - get native fd
|
||||
lchidamb 04/06/95 - drop maxdsz from obindps/odefinps
|
||||
slari 04/07/95 - add opinit
|
||||
dchatter 03/08/95 - osetpi and ogetpi
|
||||
lchidamb 12/09/94 - add obindps() and odefinps()
|
||||
dchatter 03/06/95 - merge changes from branch 1.1.720.2
|
||||
dchatter 11/14/94 - merge changes from branch 1.1.720.1
|
||||
dchatter 02/08/95 - olog call; drop onblon
|
||||
dchatter 10/31/94 - new functions for non-blocking oci
|
||||
rkooi2 11/27/92 - Changing datatypes (in comments) and return types
|
||||
rkooi2 10/26/92 - More portability mods
|
||||
rkooi2 10/18/92 - Changed to agree with oci.c
|
||||
sjain 03/16/92 - Creation
|
||||
*/
|
||||
|
||||
/*
|
||||
* Declare the OCI functions.
|
||||
* Prototype information is commented out.
|
||||
* Use this header for non-ANSI C compilers.
|
||||
* Note that you will need to include ocidfn.h in the .c files
|
||||
* to get the definition for cda_def.
|
||||
*/
|
||||
|
||||
#ifndef OCIKPR
|
||||
#define OCIKPR
|
||||
|
||||
#include <oratypes.h>
|
||||
|
||||
/*
|
||||
* Oci BIND (Piecewise or with Skips)
|
||||
*/
|
||||
sword obindps( struct cda_def *cursor, ub1 opcode, OraText *sqlvar,
|
||||
sb4 sqlvl, ub1 *pvctx, sb4 progvl,
|
||||
sword ftype, sword scale,
|
||||
sb2 *indp, ub2 *alen, ub2 *arcode,
|
||||
sb4 pv_skip, sb4 ind_skip, sb4 alen_skip, sb4 rc_skip,
|
||||
ub4 maxsiz, ub4 *cursiz,
|
||||
OraText *fmt, sb4 fmtl, sword fmtt );
|
||||
sword obreak( struct cda_def *lda );
|
||||
sword ocan ( struct cda_def *cursor );
|
||||
sword oclose( struct cda_def *cursor );
|
||||
sword ocof ( struct cda_def *lda );
|
||||
sword ocom ( struct cda_def *lda );
|
||||
sword ocon ( struct cda_def *lda );
|
||||
|
||||
|
||||
/*
|
||||
* Oci DEFINe (Piecewise or with Skips)
|
||||
*/
|
||||
sword odefinps( struct cda_def *cursor, ub1 opcode, sword pos,ub1 *bufctx,
|
||||
sb4 bufl, sword ftype, sword scale,
|
||||
sb2 *indp, OraText *fmt, sb4 fmtl, sword fmtt,
|
||||
ub2 *rlen, ub2 *rcode,
|
||||
sb4 pv_skip, sb4 ind_skip, sb4 alen_skip, sb4 rc_skip );
|
||||
sword odescr( struct cda_def *cursor, sword pos, sb4 *dbsize,
|
||||
sb2 *dbtype, sb1 *cbuf, sb4 *cbufl, sb4 *dsize,
|
||||
sb2 *prec, sb2 *scale, sb2 *nullok );
|
||||
sword odessp( struct cda_def *cursor, OraText *objnam, size_t onlen,
|
||||
ub1 *rsv1, size_t rsv1ln, ub1 *rsv2, size_t rsv2ln,
|
||||
ub2 *ovrld, ub2 *pos, ub2 *level, OraText **argnam,
|
||||
ub2 *arnlen, ub2 *dtype, ub1 *defsup, ub1* mode,
|
||||
ub4 *dtsiz, sb2 *prec, sb2 *scale, ub1 *radix,
|
||||
ub4 *spare, ub4 *arrsiz );
|
||||
sword oerhms( struct cda_def *lda, sb2 rcode, OraText *buf,
|
||||
sword bufsiz );
|
||||
sword oermsg( sb2 rcode, OraText *buf );
|
||||
sword oexec ( struct cda_def *cursor );
|
||||
sword oexfet( struct cda_def *cursor, ub4 nrows,
|
||||
sword cancel, sword exact );
|
||||
sword oexn ( struct cda_def *cursor, sword iters, sword rowoff );
|
||||
sword ofen ( struct cda_def *cursor, sword nrows );
|
||||
sword ofetch( struct cda_def *cursor );
|
||||
sword oflng ( struct cda_def *cursor, sword pos, ub1 *buf,
|
||||
sb4 bufl, sword dtype, ub4 *retl, sb4 offset );
|
||||
sword ogetpi( struct cda_def *cursor, ub1 *piecep, void **ctxpp,
|
||||
ub4 *iterp, ub4 *indexp );
|
||||
sword opinit( ub4 mode );
|
||||
sword olog ( struct cda_def *lda, ub1 *hst,
|
||||
OraText *uid, sword uidl,
|
||||
OraText *psw, sword pswl,
|
||||
OraText *conn, sword connl,
|
||||
ub4 mode );
|
||||
sword ologof( struct cda_def *lda );
|
||||
sword oopen ( struct cda_def *cursor, struct cda_def *lda,
|
||||
OraText *dbn, sword dbnl, sword arsize,
|
||||
OraText *uid, sword uidl );
|
||||
sword oopt ( struct cda_def *cursor, sword rbopt, sword waitopt );
|
||||
sword oparse( struct cda_def *cursor, OraText *sqlstm, sb4 sqllen,
|
||||
sword defflg, ub4 lngflg );
|
||||
sword orol ( struct cda_def *lda );
|
||||
sword osetpi( struct cda_def *cursor, ub1 piece, void *bufp,
|
||||
ub4 *lenp );
|
||||
void sqlld2 ( struct cda_def *lda, OraText *cname, sb4 *cnlen );
|
||||
void sqllda ( struct cda_def *lda );
|
||||
|
||||
/* non-blocking functions */
|
||||
sword onbset( struct cda_def *lda );
|
||||
sword onbtst( struct cda_def *lda );
|
||||
sword onbclr( struct cda_def *lda );
|
||||
sword ognfd ( struct cda_def *lda, void *fdp );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* OBSOLETE FUNCTIONS
|
||||
*/
|
||||
|
||||
/*
|
||||
* OBSOLETE BIND CALLS-- use obindps()
|
||||
*/
|
||||
sword obndra( struct cda_def *cursor, OraText *sqlvar, sword sqlvl,
|
||||
ub1 *progv, sword progvl, sword ftype, sword scale,
|
||||
sb2 *indp, ub2 *alen, ub2 *arcode, ub4 maxsiz,
|
||||
ub4 *cursiz, OraText *fmt, sword fmtl, sword fmtt );
|
||||
sword obndrn( struct cda_def *cursor, sword sqlvn, ub1 *progv,
|
||||
sword progvl, sword ftype, sword scale, sb2 *indp,
|
||||
OraText *fmt, sword fmtl, sword fmtt );
|
||||
sword obndrv( struct cda_def *cursor, OraText *sqlvar, sword sqlvl,
|
||||
ub1 *progv, sword progvl, sword ftype, sword scale,
|
||||
sb2 *indp, OraText *fmt, sword fmtl, sword fmtt );
|
||||
|
||||
/*
|
||||
* OBSOLETE DEFINE CALLS-- use odefinps()
|
||||
*/
|
||||
sword odefin( struct cda_def *cursor, sword pos, ub1 *buf,
|
||||
sword bufl, sword ftype, sword scale, sb2 *indp,
|
||||
OraText *fmt, sword fmtl, sword fmtt, ub2 *rlen,
|
||||
ub2 *rcode );
|
||||
|
||||
|
||||
/* older calls ; preferred equivalent calls above */
|
||||
sword odsc ( struct cda_def *cursor, sword pos, sb2 *dbsize,
|
||||
sb2 *fsize, sb2 *rcode, sb2 *dtype, sb1 *buf,
|
||||
sb2 *bufl, sb2 *dsize );
|
||||
sword oname ( struct cda_def *cursor, sword pos, sb1 *tbuf,
|
||||
sb2 *tbufl, sb1 *buf, sb2 *bufl );
|
||||
sword olon ( struct cda_def *lda, OraText *uid, sword uidl,
|
||||
OraText *pswd, sword pswdl, sword audit );
|
||||
sword orlon ( struct cda_def *lda, ub1 *hda, OraText *uid,
|
||||
sword uidl, OraText *pswd, sword pswdl, sword audit );
|
||||
sword osql3 ( struct cda_def *cda, OraText *sqlstm, sword sqllen );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* OCIKPR */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,98 @@
|
||||
/*=====================================================================================================================
|
||||
Copyright(c) 2012 ORIGIN.
|
||||
Unpublished - All rights reserved
|
||||
=======================================================================================================================
|
||||
File description:
|
||||
|
||||
Filename: ocilib.h
|
||||
Module : OCI
|
||||
|
||||
This Header file of OCI library Package.
|
||||
|
||||
=======================================================================================================================
|
||||
Date Name Description of Change
|
||||
1-Feb-2015 Ray Initialize creation
|
||||
$HISTORY$
|
||||
=====================================================================================================================*/
|
||||
#include <oci.h>
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
//#include <limits.h>
|
||||
|
||||
#define OCI_FAIL 1
|
||||
#define OCI_OK 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
/**
|
||||
* 连接数据库.
|
||||
* @param username - <I> 用户名
|
||||
* @param password - <I> 密码
|
||||
* @param dbname - <I> 数据库SID
|
||||
* @return - OCI_OK or error code
|
||||
*
|
||||
* ORACLE 数据库的连接与封装函数
|
||||
*/
|
||||
extern int ConnServer(char* username, char* password, char* dbname);
|
||||
|
||||
|
||||
/**
|
||||
* 不带输入参数的执行SQL语句.
|
||||
* @param SQL - <I> SQL语句
|
||||
* @return - OCI_OK or error code
|
||||
*
|
||||
* ORACLE 数据库的连接与封装函数
|
||||
*/
|
||||
extern int ExecuteSQLNoInputParam(char* SQL);
|
||||
|
||||
/**
|
||||
* 带输入参数的执行SQL语句.
|
||||
* @param SQL - <I> SQL语句
|
||||
* @param inputValueCount - <I> 输入参数数量
|
||||
* @param inputValue - <I> 输入参数值
|
||||
* @return - OCI_OK or error code
|
||||
*
|
||||
* ORACLE 数据库的连接与封装函数
|
||||
*/
|
||||
extern int ExecuteSQL(char* SQL, int inputValueCount, char** inputValue);
|
||||
|
||||
/**
|
||||
* 不带输入参数的查询SQL语句.
|
||||
* @param SQL - <I> SQL语句
|
||||
* @param outputColumn - <O> 输出表的列的数量
|
||||
* @param outputValueCount - <O> 输出表的行的数量
|
||||
* @param outputValue - <O> 输出表内容
|
||||
* @return - OCI_OK or error code
|
||||
*
|
||||
* ORACLE 数据库的连接与封装函数
|
||||
*/
|
||||
extern int QuerySQLNoInputParam(char* SQL, int* outputColumn, int* outputValueCount, char**** outputValue);
|
||||
|
||||
/**
|
||||
* 带输入参数的查询SQL语句.
|
||||
* @param SQL - <I> SQL语句
|
||||
* @param inputValueCount - <I> 输入参数数量
|
||||
* @param inputValue - <I> 输入参数值
|
||||
* @param outputColumn - <O> 输出表的列的数量
|
||||
* @param outputValueCount - <O> 输出表的行的数量
|
||||
* @param outputValue - <O> 输出表内容
|
||||
* @return - OCI_OK or error code
|
||||
*
|
||||
* ORACLE 数据库的连接与封装函数
|
||||
*/
|
||||
extern int QuerySQL(char* SQL, int inputValueCount, char** inputValue, int* outputColumn, int* outputValueCount, char**** outputValue);
|
||||
|
||||
/**
|
||||
* 断开数据库连接.
|
||||
*
|
||||
* ORACLE 数据库的连接与封装函数
|
||||
*/
|
||||
extern void DisConnServer();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@ -0,0 +1,188 @@
|
||||
/* Copyright (c) 2003, 2009, Oracle and/or its affiliates.
|
||||
All rights reserved. */
|
||||
|
||||
/*
|
||||
NAME
|
||||
ocixml.h - OCIXMLType functions
|
||||
|
||||
DESCRIPTION
|
||||
This file contains all OCIXMLType functions defined in ocixml.c
|
||||
|
||||
|
||||
****************************IMPORTANT***********************************
|
||||
*** If you change the signatures of any fucntions in this file, make sure
|
||||
*** to make same changes to Windows OSD file ociclnt.c. Otherwise, users
|
||||
*** of OCI instant client like ODP.NET will have build issues or crashes
|
||||
****************************IMPORTANT***********************************
|
||||
|
||||
PUBLIC FUNCTION(S)
|
||||
OCIXMLTypeNew()
|
||||
OCIXMLTypeCreateFromSrc()
|
||||
OCIXMLTypeCreateFromSrcWithSchema()
|
||||
OCIXMLTypeTransform()
|
||||
OCIXMLTypeExtract()
|
||||
OCIXMLTypeIsSchemaBased()
|
||||
OCIXMLTypeValidate()
|
||||
OCIXMLTypeExists()
|
||||
OCIXMLTypeGetDOM()
|
||||
OCIXMLTypeGetFromDOM()
|
||||
OCIDOMFree()
|
||||
OCIXMLSEMutexAcq()
|
||||
OCIXMLSEMutexRel()
|
||||
OCIXMLUpdateNodeValues()
|
||||
|
||||
INTERNAL FUNCTION(S)
|
||||
|
||||
EXAMPLES
|
||||
|
||||
NOTES
|
||||
|
||||
MODIFIED (MM/DD/YY)
|
||||
spetride 03/02/09 - add isdoc to OCIXMLTypeCreateFromSrc*
|
||||
bsthanik 01/17/07 - 5753599: wrappers for service mutex acq/rel
|
||||
bkhaladk 05/10/06 - add setpicklepref
|
||||
nitgupta 01/30/06 - add signatures for OCIBinXMl*
|
||||
dmukhin 06/16/05 - ANSI prototypes; miscellaneous cleanup
|
||||
dmukhin 06/14/05 - ANSI prototypes; miscellaneous cleanup
|
||||
ataracha 12/04/03 - convert public oci api to ansi
|
||||
ataracha 01/21/03 - ataracha_uni_capi_cleanup
|
||||
ataracha 01/08/03 - Creation
|
||||
|
||||
*/
|
||||
#ifndef OCI_ORACLE
|
||||
# include <oci.h>
|
||||
#endif
|
||||
|
||||
#ifndef XML0_ORACLE
|
||||
# include <xml0.h>
|
||||
#endif
|
||||
|
||||
#ifndef OCIXML_ORACLE
|
||||
# define OCIXML_ORACLE
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PUBLIC TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
/* parameters for OCIXMLUpdateNodeValues */
|
||||
struct OCIXMLunv
|
||||
{
|
||||
void * xpth_OCIXMLunv; /* xpath expression */
|
||||
void * val_OCIXMLunv; /* value - string literal or xmltype */
|
||||
ub4 xpthL_OCIXMLunv; /* length of xpath expression string */
|
||||
ub4 valL_OCIXMLunv; /* length of value string */
|
||||
ub1 tp_OCIXMLunv; /* type of value - xmltype of string */
|
||||
|
||||
#define OCIXMLUNV_XTP 0x00 /* param is xmltype */
|
||||
#define OCIXMLUNV_STP 0x01 /* param is string literal */
|
||||
#define OCIXMLUNV_STM 0x02 /* param is a stream (kghsstream *) */
|
||||
#define OCIXMLUNV_CLOB 0x03 /* param is a CLOB locator (kolblc *) */
|
||||
#define OCIXMLUNV_BLOB 0x04 /* param is a BLOB locator (kolblc *) */
|
||||
};
|
||||
typedef struct OCIXMLunv OCIXMLunv;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PRIVATE TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
EXPORT FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
sword OCIXMLTypeNew(OCISvcCtx *svchp, OCIError *errhp, OCIDuration dur,
|
||||
OraText *elname, ub4 elname_Len,
|
||||
OraText *schemaURL, ub4 schemaURL_Len,
|
||||
OCIXMLType **retInstance);
|
||||
|
||||
sword OCIXMLTypeCreateFromSrc(OCISvcCtx *svchp, OCIError *errhp,
|
||||
OCIDuration dur, ub1 src_type, void *src_ptr,
|
||||
sb4 ind, OCIXMLType **retInstance, ub4 csid);
|
||||
sword OCIXMLTypeCreateFromSrcInt(OCISvcCtx *svchp, OCIError *errhp,
|
||||
OCIDuration dur, ub1 src_type, void *src_ptr,
|
||||
sb4 ind, OCIXMLType **retInstance, ub4 csid,
|
||||
boolean isdoc);
|
||||
|
||||
sword OCIXMLTypeCreateFromSrcWithSchema(OCISvcCtx *svchp, OCIError *errhp,
|
||||
OCIDuration dur, ub1 src_type, void *src_ptr,
|
||||
sb4 ind, OraText *schemaURL, ub4 schemaURL_Len,
|
||||
boolean wellformed, boolean valid,
|
||||
OCIXMLType **retInstance, ub4 csid);
|
||||
sword OCIXMLTypeCreateFromSrcWithSchemaInt(OCISvcCtx *svchp, OCIError *errhp,
|
||||
OCIDuration dur, ub1 src_type, void *src_ptr,
|
||||
sb4 ind, OraText *schemaURL, ub4 schemaURL_Len,
|
||||
boolean wellformed, boolean valid,
|
||||
OCIXMLType **retInstance, ub4 csid,
|
||||
boolean isdoc);
|
||||
|
||||
sword OCIXMLTypeExtract(OCIError *errhp,
|
||||
OCIXMLType *doc, OCIDuration dur,
|
||||
OraText *xpathexpr, ub4 xpathexpr_Len,
|
||||
OraText *nsmap, ub4 nsmap_Len,
|
||||
OCIXMLType **retDoc);
|
||||
|
||||
sword OCIXMLTypeTransform(OCIError *errhp, OCIDuration dur,
|
||||
OCIXMLType *doc, OCIXMLType *xsldoc,
|
||||
OCIXMLType **retDoc);
|
||||
|
||||
/* Note: xpathexpr is case sensitive */
|
||||
sword OCIXMLTypeExists(OCIError *errhp, OCIXMLType *doc,
|
||||
OraText *xpathexpr, ub4 xpathexpr_Len,
|
||||
OraText *nsmap, ub4 nsmap_Len,
|
||||
boolean *retval);
|
||||
|
||||
sword OCIXMLTypeIsSchemaBased(OCIError *errhp,
|
||||
OCIXMLType *doc, boolean *retval);
|
||||
|
||||
sword OCIXMLTypeIsFragment(OCIError *errhp, OCIXMLType *doc, boolean *retval);
|
||||
|
||||
sword OCIXMLTypeGetSchema(OCIError *errhp, OCIXMLType *doc,
|
||||
OCIXMLType **schemadoc,
|
||||
OraText **schemaURL, ub4 *schemaURL_Len,
|
||||
OraText **rootelem, ub4 *rootelem_Len);
|
||||
|
||||
sword OCIXMLTypeValidate(OCIError *errhp, OCIXMLType *doc,
|
||||
OraText *schemaURL, ub4 schemaURL_Len, boolean *retval);
|
||||
|
||||
sword OCIXMLTypeGetDOM(OCIError *errhp, OCIXMLType *doc, OCIDuration dur,
|
||||
OCIDOMDocument **retDom);
|
||||
|
||||
sword OCIXMLTypeGetFromDOM(OCIError *errhp, OCIDOMDocument *domdoc,
|
||||
OCIXMLType **retXMLType);
|
||||
|
||||
sword OCIXMLTypeGetNS(OCIError *errhp, OCIXMLType *domdoc,
|
||||
OraText **ns, ub4 *ns_len);
|
||||
|
||||
sword OCIDOMFree(OCIError *errhp, OCIDOMDocument *domdoc);
|
||||
|
||||
sword OCIBinXmlCreateReposCtxFromConn(OCIEnv *env, OCISvcCtx *svcctx,
|
||||
OCIError *err, OCIBinXmlReposCtx **ctx);
|
||||
sword OCIBinXmlCreateReposCtxFromCPool(OCIEnv *env, OCICPool *cpool,
|
||||
OCIError *err, OCIBinXmlReposCtx **ctx);
|
||||
sword OCIBinXmlSetReposCtxForConn(OCISvcCtx *dataconn,
|
||||
OCIBinXmlReposCtx *reposctx);
|
||||
|
||||
#define OCIXML_FORMATTYPE_TEXT 0
|
||||
#define OCIXML_FORMATTYPE_BINXML 1
|
||||
|
||||
sword OCIBinXmlSetFormatPref(xmldocnode *doc, ub4 format);
|
||||
|
||||
/* OCI Wrapper to acquire mutex associated with service handle and
|
||||
* env handle
|
||||
*/
|
||||
sword OCIXMLSEMutexAcq(OCISvcCtx *svchp, OCIError *errhp);
|
||||
|
||||
/* release wrapper corresponding to OCIXMLSEMutexAcq */
|
||||
sword OCIXMLSEMutexRel(OCISvcCtx *svchp, OCIError *errhp);
|
||||
|
||||
/* acquires OCI svc and env mutexes, updates values of nodes pointed to by
|
||||
* given XPATH locations, and releases mutexes.
|
||||
*/
|
||||
sword OCIXMLUpdateNodeValues(OCISvcCtx *svchp, OCIError *errhp, OCIXMLType
|
||||
**docp, struct OCIXMLunv *values, ub4 numvalues, oratext *nsmap,
|
||||
ub4 nsmapl);
|
||||
/*---------------------------------------------------------------------------
|
||||
INTERNAL FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#endif /* OCIXML_ORACLE */
|
||||
@ -0,0 +1,141 @@
|
||||
/* Copyright (c) 2003, 2009, Oracle and/or its affiliates.
|
||||
All rights reserved. */
|
||||
|
||||
/*
|
||||
NAME
|
||||
ocixmldb.h - XDB public functions
|
||||
|
||||
DESCRIPTION
|
||||
This file contains XDB specific public functions required for DOM C-API.
|
||||
|
||||
RELATED DOCUMENTS
|
||||
|
||||
|
||||
EXPORT FUNCTION(S)
|
||||
struct xmlctx *OCIXmlDbInitXmlCtx(OCIEnv *, OCISvcCtx *, OCIError *,
|
||||
ocixmldbparam *params, int num_params);
|
||||
|
||||
void OCIXmlDbFreeXmlCtx(struct xmlctx *xctx);
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
EXAMPLES
|
||||
|
||||
NOTES
|
||||
|
||||
MODIFIED (MM/DD/YY)
|
||||
ataracha 12/11/03 - remove redundant definitions
|
||||
ataracha 05/28/03 - change names
|
||||
ataracha 02/18/03 - add oratypes, remove XMLERR_*
|
||||
imacky 02/01/03 - remove xml.h; xdbs fix
|
||||
ataracha 01/24/03 - use "struct xmlctx" instead of xmlctx
|
||||
imacky 01/28/03 - fix XMLERR defs
|
||||
ataracha 01/21/03 - ataracha_uni_capi_cleanup
|
||||
ataracha 01/09/03 - Creation
|
||||
|
||||
*/
|
||||
|
||||
#ifndef ORATYPES
|
||||
#include <oratypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef OCI_ORACLE
|
||||
# include <oci.h>
|
||||
#endif
|
||||
|
||||
#ifndef OCIXMLDB_ORACLE
|
||||
# define OCIXMLDB_ORACLE
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PUBLIC TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef XMLCTX_DEFINED
|
||||
# define XMLCTX_DEFINED
|
||||
/* DATATYPE xmlctx - XML top-level context
|
||||
*/
|
||||
struct xmlctx; typedef struct xmlctx xmlctx;
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
XCTXINIT_OCIDUR = 1,
|
||||
XCTXINIT_ERRHDL = 2
|
||||
} ocixmldbpname;
|
||||
|
||||
typedef struct ocixmldbparam
|
||||
{
|
||||
ocixmldbpname name_ocixmldbparam;
|
||||
void *value_ocixmldbparam;
|
||||
} ocixmldbparam;
|
||||
|
||||
#define NUM_OCIXMLDBPARAMS 2
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PRIVATE TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
EXPORT FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
/*****************************************************************************
|
||||
DESCRIPTION
|
||||
|
||||
-----------------------------OCIXmlDbInitXmlCtx---------------------------------
|
||||
Name
|
||||
OCIXmlDbInitXmlCtx
|
||||
Purpose
|
||||
To get a xmlctx structure initialized with error-handler and XDB callbacks.
|
||||
Syntax
|
||||
struct xmlctx *OCIXmlDbInitXmlCtx (OCIEnv *envhp,
|
||||
OCISvcCtx *svchp,
|
||||
OCIError *err,
|
||||
params_ocixmldb *params,
|
||||
int num_params);
|
||||
Parameters
|
||||
envhp (IN) - The OCI environment handle
|
||||
svchp (IN) - The OCI service handle
|
||||
errhp (IN) - The OCI error handle
|
||||
params (IN)- This contains the following optional parameters :
|
||||
(a) OCIDuration dur (IN - The OCI Duration (Default: OCI_DURATION_SESSION)
|
||||
(b) void (*err_handler) (sword, (const oratext *) (IN) -
|
||||
Pointer to the error handling function (Default: null)
|
||||
num_params (IN) - Number of parameters to be read from parameter params.
|
||||
If the value of num_params exceeds the size of array
|
||||
"params", unexpected behavior will result.
|
||||
|
||||
Returns
|
||||
A pointer to xmlctx structure, with xdb context, error handler and callbacks
|
||||
populated with appropriate values. This is later used for all API calls. NULL
|
||||
if no database connection available.
|
||||
|
||||
-----------------------------OCIXmlDbFreeXmlCtx----------------------------
|
||||
Name
|
||||
OCIXmlDbFreeXmlCtx
|
||||
Pupose
|
||||
To free any allocations done during OCIXmlDbInitXmlCtx.
|
||||
Syntax
|
||||
void OCIXmlDbFreeXmlCtx (struct xmlctx *xctx)
|
||||
Parameters
|
||||
xctx (IN) - The xmlctx to terminate
|
||||
Returns
|
||||
-
|
||||
******************************************************************************/
|
||||
|
||||
struct xmlctx *OCIXmlDbInitXmlCtx(OCIEnv *, OCISvcCtx *, OCIError *,
|
||||
ocixmldbparam *, int);
|
||||
|
||||
void OCIXmlDbFreeXmlCtx(struct xmlctx *xctx);
|
||||
sword OCIXmlDbStreamFromXMLType(OCIError *errhp, void **stream,
|
||||
OCIXMLType *doc, ub4 mode);
|
||||
sword OCIXmlDbStreamRead(OCIError *errhp, void *stream,
|
||||
void *bufp, sb8 *len, ub4 mode);
|
||||
sword OCIXmlDbStreamClose(OCIError *errhp, void *stream);
|
||||
/*---------------------------------------------------------------------------
|
||||
INTERNAL FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#endif /* OCIXMLDB_ORACLE */
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,798 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
/* Copyright (c) 1998, 2006, Oracle. All rights reserved. */
|
||||
|
||||
/*
|
||||
NAME
|
||||
odci.h - Oracle Data Cartridge Interface definitions
|
||||
|
||||
DESCRIPTION
|
||||
This file contains Oracle Data Cartridge Interface definitions. These
|
||||
include the ODCI Types and Constants.
|
||||
|
||||
RELATED DOCUMENTS
|
||||
|
||||
INSPECTION STATUS
|
||||
Inspection date:
|
||||
Inspection status:
|
||||
Estimated increasing cost defects per page:
|
||||
Rule sets:
|
||||
|
||||
ACCEPTANCE REVIEW STATUS
|
||||
Review date:
|
||||
Review status:
|
||||
Reviewers:
|
||||
|
||||
PUBLIC FUNCTION(S)
|
||||
None.
|
||||
|
||||
PRIVATE FUNCTION(S)
|
||||
None.
|
||||
|
||||
EXAMPLES
|
||||
|
||||
NOTES
|
||||
- The constants defined here are replica of the constants defined
|
||||
in ODCIConst Package defined as part of catodci.sql. If you change
|
||||
these do make the similar change in catodci.sql.
|
||||
|
||||
MODIFIED (MM/DD/YY)
|
||||
spsundar 09/13/07 -
|
||||
yhu 06/02/06 - add callproperty for statistics
|
||||
yhu 05/22/06 - add ODCI_NODATA to speed rebuild empty index or ind.
|
||||
part.
|
||||
srirkris 05/09/06 - change ODCIOrderByInfo_ind
|
||||
srirkris 02/06/06 - add definitions for CDI query.
|
||||
spsundar 02/17/06 - add fields/types for system managed domain idx
|
||||
yhu 02/08/06 - add RenameCol Na d RenameTopADT
|
||||
yhu 03/11/05 - add flags for rename column and rename table
|
||||
spsundar 11/28/05 - add fields/types for composite domain idx
|
||||
yhu 12/06/05 - mapping table for local text indexes
|
||||
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
|
||||
ayoaz 04/21/03 - add CursorNum to ODCIEnv
|
||||
abrumm 12/30/02 - Bug #2223225: add define for
|
||||
ODCI_ARG_DESC_LIST_MAXSIZE
|
||||
ayoaz 10/14/02 - Add Cardinality to ODCIArgDesc
|
||||
ayoaz 09/11/02 - add ODCIQueryInfo to ODCIIndexCtx
|
||||
yhu 09/19/02 - add ODCI_DEBUGGING_ON for ODCIEnv.EnvFlags
|
||||
hsbedi 10/10/02 - add object number into ODCIExtTableInfo
|
||||
ayoaz 08/30/02 - add ODCITable2 types
|
||||
tchorma 07/29/02 - Add ODCIFuncCallInfo type for WITH COLUMN CONTEXT
|
||||
hsbedi 06/29/02 - External table populate
|
||||
yhu 07/20/01 - add parallel degree in ODCIIndexInfo.
|
||||
abrumm 02/20/01 - ODCIExtTableInfo: add AccessParmBlob attribute
|
||||
abrumm 01/18/01 - ODCIExtTableInfo: add default directory
|
||||
spsundar 08/24/00 - Update attrbiute positions
|
||||
abrumm 08/04/00 - external tables changes: ODCIExtTableInfo, constants
|
||||
tchorma 09/11/00 - Add return code ODCI_FATAL
|
||||
tchorma 08/08/00 - Add Update Block References Option for Alter Index
|
||||
ayoaz 08/01/00 - Add ODCI_AGGREGATE_REUSE_CTX
|
||||
spsundar 06/19/00 - add ODCIEnv type
|
||||
abrumm 06/27/00 - add defines for ODCIExtTable flags
|
||||
abrumm 06/04/00 - external tables: ODCIExtTableInfo change; add ODCIEnv
|
||||
ddas 04/28/00 - extensible optimizer enhancements for 8.2
|
||||
yhu 06/05/00 - add a bit in IndexInfoFlags for trans. tblspc
|
||||
yhu 04/10/00 - add ODCIPartInfo & remove ODCIIndexPartList
|
||||
abrumm 03/29/00 - external table support
|
||||
spsundar 02/14/00 - update odci definitions for 8.2
|
||||
nagarwal 03/07/99 - bug# 838308 - set estimate_stats=1
|
||||
rmurthy 11/09/98 - add blocking flag
|
||||
ddas 10/31/98 - add ODCI_QUERY_SORT_ASC and ODCI_QUERY_SORT_DESC
|
||||
ddas 05/26/98 - fix ODCIPredInfo flag bits
|
||||
rmurthy 06/03/98 - add macro for RegularCall
|
||||
spsundar 05/08/98 - add constants related to ODCIIndexAlter options
|
||||
rmurthy 04/30/98 - remove include s.h
|
||||
rmurthy 04/20/98 - name fixes
|
||||
rmurthy 04/13/98 - add C mappings for odci types
|
||||
alsrivas 04/10/98 - adding defines for ODCI_INDEX1
|
||||
jsriniva 04/04/98 - Creation
|
||||
|
||||
*/
|
||||
|
||||
#ifndef OCI_ORACLE
|
||||
# include <oci.h>
|
||||
#endif
|
||||
#ifndef ODCI_ORACLE
|
||||
# define ODCI_ORACLE
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* SHORT NAMES SUPPORT SECTION */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef SLSHORTNAME
|
||||
|
||||
/* The following are short names that are only supported on IBM mainframes
|
||||
* with the SLSHORTNAME defined.
|
||||
* With this all subsequent long names will actually be substituted with
|
||||
* the short names here
|
||||
*/
|
||||
|
||||
#define ODCIColInfo_ref odcicir
|
||||
#define ODCIColInfoList odcicil
|
||||
#define ODCIColInfoList2 odcicil2
|
||||
#define ODCIIndexInfo_ref odciiir
|
||||
#define ODCIPredInfo_ref odcipir
|
||||
#define ODCIRidList odcirl
|
||||
#define ODCIIndexCtx_ref odciicr
|
||||
#define ODCIObject_ref odcior
|
||||
#define ODCIObjectList odciol
|
||||
#define ODCIQueryInfo_ref odciqir
|
||||
#define ODCIFuncInfo_ref odcifir
|
||||
#define ODCICost_ref odcicr
|
||||
#define ODCIArgDesc_ref odciadr
|
||||
#define ODCIArgDescList odciadl
|
||||
#define ODCIStatsOptions_ref odcisor
|
||||
#define ODCIColInfo odcici
|
||||
#define ODCIColInfo_ind odcicii
|
||||
#define ODCIIndexInfo odciii
|
||||
#define ODCIIndexInfo_ind odciiii
|
||||
#define ODCIPredInfo odcipi
|
||||
#define ODCIPredInfo_ind odcipii
|
||||
#define ODCIIndexCtx odciic
|
||||
#define ODCIIndexCtx_ind odciici
|
||||
#define ODCIObject odcio
|
||||
#define ODCIObject_ind odcioi
|
||||
#define ODCIQueryInfo odciqi
|
||||
#define ODCIQueryInfo_ind odciqii
|
||||
#define ODCIFuncInfo odcifi
|
||||
#define ODCIFuncInfo_infd odcifii
|
||||
#define ODCICost odcic
|
||||
#define ODCICost_ind odcici
|
||||
#define ODCIArgDesc odciad
|
||||
#define ODCIArgDesc_ind odciadi
|
||||
#define ODCIStatsOptions odciso
|
||||
#define ODCIStatsOptions_ind odcisoi
|
||||
#define ODCIPartInfo odcipti
|
||||
#define ODCIPartInfo_ind odciptii
|
||||
#define ODCIPartInfo_ref odciptir
|
||||
#define ODCIExtTableInfo odcixt
|
||||
#define ODCIExtTableInfo_ind odcixti
|
||||
#define ODCIExtTableInfo_ref odcixtr
|
||||
#define ODCIExtTableQCInfo odcixq
|
||||
#define ODCIExtTableQCInfo_ind odcixqi
|
||||
#define ODCIExtTableQCInfo_ref odcixqr
|
||||
#define ODCIFuncCallInfo odcifc
|
||||
#define ODCIFuncCall_ind odcifci
|
||||
#define ODCIFuncCall_ref odcifcr
|
||||
#define ODCIColValList odcicvl
|
||||
#define ODCIColArrayList odcical
|
||||
#define ODCIFilterInfoList odciflil
|
||||
#define ODCIOrderByInfoList odciobil
|
||||
#define ODCIFilterInfo_ref odciflir
|
||||
#define ODCIOrderByInfo_ref odciobir
|
||||
#define ODCICompQueryInfo_ref odcicqir
|
||||
#define ODCIFilterInfo odcifli
|
||||
#define ODCIOrderByInfo odciobi
|
||||
#define ODCICompQueryInfo odcicqi
|
||||
#define ODCIFilterInfo_ind odciflii
|
||||
#define ODCIOrderByInfo_ind odciobii
|
||||
#define ODCICompQueryInfo_ind odcicqii
|
||||
|
||||
#endif /* SLSHORTNAME */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PUBLIC TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
/* Constants for Return Status */
|
||||
#define ODCI_SUCCESS 0
|
||||
#define ODCI_ERROR 1
|
||||
#define ODCI_WARNING 2
|
||||
#define ODCI_ERROR_CONTINUE 3
|
||||
#define ODCI_FATAL 4
|
||||
|
||||
/* Constants for ODCIPredInfo.Flags */
|
||||
#define ODCI_PRED_EXACT_MATCH 0x0001
|
||||
#define ODCI_PRED_PREFIX_MATCH 0x0002
|
||||
#define ODCI_PRED_INCLUDE_START 0x0004
|
||||
#define ODCI_PRED_INCLUDE_STOP 0x0008
|
||||
#define ODCI_PRED_OBJECT_FUNC 0x0010
|
||||
#define ODCI_PRED_OBJECT_PKG 0x0020
|
||||
#define ODCI_PRED_OBJECT_TYPE 0x0040
|
||||
#define ODCI_PRED_MULTI_TABLE 0x0080
|
||||
#define ODCI_PRED_NOT_EQUAL 0x0100
|
||||
|
||||
/* Constants for QueryInfo.Flags */
|
||||
#define ODCI_QUERY_FIRST_ROWS 0x01
|
||||
#define ODCI_QUERY_ALL_ROWS 0x02
|
||||
#define ODCI_QUERY_SORT_ASC 0x04
|
||||
#define ODCI_QUERY_SORT_DESC 0x08
|
||||
#define ODCI_QUERY_BLOCKING 0x10
|
||||
|
||||
/* Constants for ScnFlg(Func /w Index Context) */
|
||||
#define ODCI_CLEANUP_CALL 1
|
||||
#define ODCI_REGULAR_CALL 2
|
||||
|
||||
/* Constants for ODCIFuncInfo.Flags */
|
||||
#define ODCI_OBJECT_FUNC 0x01
|
||||
#define ODCI_OBJECT_PKG 0x02
|
||||
#define ODCI_OBJECT_TYPE 0x04
|
||||
|
||||
/* Constants for ODCIArgDesc.ArgType */
|
||||
#define ODCI_ARG_OTHER 1
|
||||
#define ODCI_ARG_COL 2 /* column */
|
||||
#define ODCI_ARG_LIT 3 /* literal */
|
||||
#define ODCI_ARG_ATTR 4 /* object attribute */
|
||||
#define ODCI_ARG_NULL 5
|
||||
#define ODCI_ARG_CURSOR 6
|
||||
|
||||
/* Maximum size of ODCIArgDescList array */
|
||||
#define ODCI_ARG_DESC_LIST_MAXSIZE 32767
|
||||
|
||||
/* Constants for ODCIStatsOptions.Options */
|
||||
#define ODCI_PERCENT_OPTION 1
|
||||
#define ODCI_ROW_OPTION 2
|
||||
|
||||
/* Constants for ODCIStatsOptions.Flags */
|
||||
#define ODCI_ESTIMATE_STATS 0x01
|
||||
#define ODCI_COMPUTE_STATS 0x02
|
||||
#define ODCI_VALIDATE 0x04
|
||||
|
||||
/* Constants for ODCIIndexAlter parameter alter_option */
|
||||
#define ODCI_ALTIDX_NONE 0
|
||||
#define ODCI_ALTIDX_RENAME 1
|
||||
#define ODCI_ALTIDX_REBUILD 2
|
||||
#define ODCI_ALTIDX_REBUILD_ONL 3
|
||||
#define ODCI_ALTIDX_MODIFY_COL 4
|
||||
#define ODCI_ALTIDX_UPDATE_BLOCK_REFS 5
|
||||
#define ODCI_ALTIDX_RENAME_COL 6
|
||||
#define ODCI_ALTIDX_RENAME_TAB 7
|
||||
#define ODCI_ALTIDX_MIGRATE 8
|
||||
|
||||
/* Constants for ODCIIndexInfo.IndexInfoFlags */
|
||||
#define ODCI_INDEX_LOCAL 0x0001
|
||||
#define ODCI_INDEX_RANGE_PARTN 0x0002
|
||||
#define ODCI_INDEX_HASH_PARTN 0x0004
|
||||
#define ODCI_INDEX_ONLINE 0x0008
|
||||
#define ODCI_INDEX_PARALLEL 0x0010
|
||||
#define ODCI_INDEX_UNUSABLE 0x0020
|
||||
#define ODCI_INDEX_ONIOT 0x0040
|
||||
#define ODCI_INDEX_TRANS_TBLSPC 0x0080
|
||||
#define ODCI_INDEX_FUNCTION_IDX 0x0100
|
||||
#define ODCI_INDEX_LIST_PARTN 0x0200
|
||||
|
||||
/* Constants for ODCIIndexInfo.IndexParaDegree */
|
||||
#define ODCI_INDEX_DEFAULT_DEGREE 32767
|
||||
|
||||
/* Constants for ODCIEnv.EnvFlags */
|
||||
#define ODCI_DEBUGGING_ON 0x01
|
||||
#define ODCI_NODATA 0x02
|
||||
|
||||
/* Constants for ODCIEnv.CallProperty */
|
||||
#define ODCI_CALL_NONE 0
|
||||
#define ODCI_CALL_FIRST 1
|
||||
#define ODCI_CALL_INTERMEDIATE 2
|
||||
#define ODCI_CALL_FINAL 3
|
||||
#define ODCI_CALL_REBUILD_INDEX 4
|
||||
#define ODCI_CALL_REBUILD_PMO 5
|
||||
#define ODCI_CALL_STATSGLOBAL 6
|
||||
#define ODCI_CALL_STATSGLOBALANDPARTITION 7
|
||||
#define ODCI_CALL_STATSPARTITION 8
|
||||
|
||||
/* Constants for ODCIExtTableInfo.OpCode */
|
||||
#define ODCI_EXTTABLE_INFO_OPCODE_FETCH 1
|
||||
#define ODCI_EXTTABLE_INFO_OPCODE_POPULATE 2
|
||||
|
||||
/* Constants (bit definitions) for ODCIExtTableInfo.Flag */
|
||||
/* sampling type: row or block */
|
||||
#define ODCI_EXTTABLE_INFO_FLAG_SAMPLE 0x00000001
|
||||
#define ODCI_EXTTABLE_INFO_FLAG_SAMPLE_BLOCK 0x00000002
|
||||
/* AccessParmClob, AccessParmBlob discriminator */
|
||||
#define ODCI_EXTTABLE_INFO_FLAG_ACCESS_PARM_CLOB 0x00000004
|
||||
#define ODCI_EXTTABLE_INFO_FLAG_ACCESS_PARM_BLOB 0x00000008
|
||||
|
||||
/* Constants for ODCIExtTableInfo.IntraSourceConcurrency */
|
||||
#define ODCI_TRUE 1
|
||||
#define ODCI_FALSE 0
|
||||
|
||||
/* Constants (bit definitions) for ODCIExtTable{Open,Fetch,Populate,Close}
|
||||
* Flag argument.
|
||||
*/
|
||||
#define ODCI_EXTTABLE_OPEN_FLAGS_QC 0x00000001 /* caller is Query Coord */
|
||||
#define ODCI_EXTTABLE_OPEN_FLAGS_SHADOW 0x00000002 /* caller is shadow proc */
|
||||
#define ODCI_EXTTABLE_OPEN_FLAGS_SLAVE 0x00000004 /* caller is slave proc */
|
||||
|
||||
#define ODCI_EXTTABLE_FETCH_FLAGS_EOS 0x00000001 /* end-of-stream on fetch */
|
||||
|
||||
/* Constants for Flags argument to ODCIAggregateTerminate */
|
||||
#define ODCI_AGGREGATE_REUSE_CTX 1
|
||||
|
||||
/* Constants for ODCIColInfo.Flags */
|
||||
#define ODCI_COMP_FILTERBY_COL 0x0001
|
||||
#define ODCI_COMP_ORDERBY_COL 0x0002
|
||||
#define ODCI_COMP_ORDERDSC_COL 0x0004
|
||||
#define ODCI_COMP_UPDATED_COL 0x0008
|
||||
#define ODCI_COMP_RENAMED_COL 0x0010
|
||||
#define ODCI_COMP_RENAMED_TOPADT 0x0020
|
||||
|
||||
/* Constants for ODCIOrderByInfo.ExprType */
|
||||
#define ODCI_COLUMN_EXPR 1
|
||||
#define ODCI_ANCOP_EXPR 2
|
||||
|
||||
/* Constants for ODCIOrderByInfo.SortOrder */
|
||||
#define ODCI_SORT_ASC 1
|
||||
#define ODCI_SORT_DESC 2
|
||||
#define ODCI_NULLS_FIRST 4
|
||||
|
||||
/* Constants for ODCIPartInfo.PartOp */
|
||||
#define ODCI_ADD_PARTITION 1
|
||||
#define ODCI_DROP_PARTITION 2
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
ODCI TYPES
|
||||
---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* These are C mappings for the OTS types defined in catodci.sql
|
||||
*/
|
||||
|
||||
typedef OCIRef ODCIColInfo_ref;
|
||||
typedef OCIArray ODCIColInfoList;
|
||||
typedef OCIArray ODCIColInfoList2;
|
||||
typedef OCIRef ODCIIndexInfo_ref;
|
||||
typedef OCIRef ODCIPredInfo_ref;
|
||||
typedef OCIArray ODCIRidList;
|
||||
typedef OCIRef ODCIIndexCtx_ref;
|
||||
typedef OCIRef ODCIObject_ref;
|
||||
typedef OCIArray ODCIObjectList;
|
||||
typedef OCIRef ODCIQueryInfo_ref;
|
||||
typedef OCIRef ODCIFuncInfo_ref;
|
||||
typedef OCIRef ODCICost_ref;
|
||||
typedef OCIRef ODCIArgDesc_ref;
|
||||
typedef OCIArray ODCIArgDescList;
|
||||
typedef OCIRef ODCIStatsOptions_ref;
|
||||
typedef OCIRef ODCIPartInfo_ref;
|
||||
typedef OCIRef ODCIEnv_ref;
|
||||
typedef OCIRef ODCIExtTableInfo_ref; /* external table support */
|
||||
typedef OCIArray ODCIGranuleList; /* external table support */
|
||||
typedef OCIRef ODCIExtTableQCInfo_ref; /* external table support */
|
||||
typedef OCIRef ODCIFuncCallInfo_ref;
|
||||
typedef OCIArray ODCINumberList;
|
||||
typedef OCIArray ODCIPartInfoList;
|
||||
typedef OCIArray ODCIColValList;
|
||||
typedef OCIArray ODCIColArrayList;
|
||||
typedef OCIArray ODCIFilterInfoList;
|
||||
typedef OCIArray ODCIOrderByInfoList;
|
||||
typedef OCIRef ODCIFilterInfo_ref;
|
||||
typedef OCIRef ODCIOrderByInfo_ref;
|
||||
typedef OCIRef ODCICompQueryInfo_ref;
|
||||
|
||||
struct ODCIColInfo
|
||||
{
|
||||
OCIString* TableSchema;
|
||||
OCIString* TableName;
|
||||
OCIString* ColName;
|
||||
OCIString* ColTypName;
|
||||
OCIString* ColTypSchema;
|
||||
OCIString* TablePartition;
|
||||
OCINumber ColFlags;
|
||||
OCINumber ColOrderPos;
|
||||
OCINumber TablePartitionIden;
|
||||
OCINumber TablePartitionTotal;
|
||||
};
|
||||
typedef struct ODCIColInfo ODCIColInfo;
|
||||
|
||||
struct ODCIColInfo_ind
|
||||
{
|
||||
OCIInd atomic;
|
||||
OCIInd TableSchema;
|
||||
OCIInd TableName;
|
||||
OCIInd ColName;
|
||||
OCIInd ColTypName;
|
||||
OCIInd ColTypSchema;
|
||||
OCIInd TablePartition;
|
||||
OCIInd ColFlags;
|
||||
OCIInd ColOrderPos;
|
||||
OCIInd TablePartitionIden;
|
||||
OCIInd TablePartitionTotal;
|
||||
};
|
||||
typedef struct ODCIColInfo_ind ODCIColInfo_ind;
|
||||
|
||||
struct ODCIFuncCallInfo
|
||||
{
|
||||
struct ODCIColInfo ColInfo;
|
||||
};
|
||||
|
||||
struct ODCIFuncCallInfo_ind
|
||||
{
|
||||
struct ODCIColInfo_ind ColInfo;
|
||||
};
|
||||
|
||||
struct ODCIIndexInfo
|
||||
{
|
||||
OCIString* IndexSchema;
|
||||
OCIString* IndexName;
|
||||
ODCIColInfoList* IndexCols;
|
||||
OCIString* IndexPartition;
|
||||
OCINumber IndexInfoFlags;
|
||||
OCINumber IndexParaDegree;
|
||||
OCINumber IndexPartitionIden;
|
||||
OCINumber IndexPartitionTotal;
|
||||
};
|
||||
typedef struct ODCIIndexInfo ODCIIndexInfo;
|
||||
|
||||
struct ODCIIndexInfo_ind
|
||||
{
|
||||
OCIInd atomic;
|
||||
OCIInd IndexSchema;
|
||||
OCIInd IndexName;
|
||||
OCIInd IndexCols;
|
||||
OCIInd IndexPartition;
|
||||
OCIInd IndexInfoFlags;
|
||||
OCIInd IndexParaDegree;
|
||||
OCIInd IndexPartitionIden;
|
||||
OCIInd IndexPartitionTotal;
|
||||
};
|
||||
typedef struct ODCIIndexInfo_ind ODCIIndexInfo_ind;
|
||||
|
||||
struct ODCIPredInfo
|
||||
{
|
||||
OCIString* ObjectSchema;
|
||||
OCIString* ObjectName;
|
||||
OCIString* MethodName;
|
||||
OCINumber Flags;
|
||||
};
|
||||
typedef struct ODCIPredInfo ODCIPredInfo;
|
||||
|
||||
struct ODCIPredInfo_ind
|
||||
{
|
||||
OCIInd atomic;
|
||||
OCIInd ObjectSchema;
|
||||
OCIInd ObjectName;
|
||||
OCIInd MethodName;
|
||||
OCIInd Flags;
|
||||
};
|
||||
typedef struct ODCIPredInfo_ind ODCIPredInfo_ind;
|
||||
|
||||
struct ODCIFilterInfo
|
||||
{
|
||||
ODCIColInfo ColInfo;
|
||||
OCINumber Flags;
|
||||
OCIAnyData *strt;
|
||||
OCIAnyData *stop;
|
||||
};
|
||||
typedef struct ODCIFilterInfo ODCIFilterInfo;
|
||||
|
||||
struct ODCIFilterInfo_ind
|
||||
{
|
||||
OCIInd atomic;
|
||||
ODCIColInfo_ind ColInfo;
|
||||
OCIInd Flags;
|
||||
OCIInd strt;
|
||||
OCIInd stop;
|
||||
};
|
||||
typedef struct ODCIFilterInfo_ind ODCIFilterInfo_ind;
|
||||
|
||||
|
||||
struct ODCIOrderByInfo
|
||||
{
|
||||
OCINumber ExprType;
|
||||
OCIString *ObjectSchema;
|
||||
OCIString *TableName;
|
||||
OCIString *ExprName;
|
||||
OCINumber SortOrder;
|
||||
};
|
||||
typedef struct ODCIOrderByInfo ODCIOrderByInfo;
|
||||
|
||||
struct ODCIOrderByInfo_ind
|
||||
{
|
||||
OCIInd atomic;
|
||||
OCIInd ExprType;
|
||||
OCIInd ObjectSchema;
|
||||
OCIInd TableName;
|
||||
OCIInd ExprName;
|
||||
OCIInd SortOrder;
|
||||
};
|
||||
typedef struct ODCIOrderByInfo_ind ODCIOrderByInfo_ind;
|
||||
|
||||
|
||||
struct ODCICompQueryInfo
|
||||
{
|
||||
ODCIFilterInfoList *PredInfo;
|
||||
ODCIOrderByInfoList *ObyInfo;
|
||||
};
|
||||
typedef struct ODCICompQueryInfo ODCICompQueryInfo;
|
||||
|
||||
struct ODCICompQueryInfo_ind
|
||||
{
|
||||
OCIInd atomic;
|
||||
OCIInd PredInfo;
|
||||
OCIInd ObyInfo;
|
||||
};
|
||||
typedef struct ODCICompQueryInfo_ind ODCICompQueryInfo_ind;
|
||||
|
||||
|
||||
struct ODCIObject
|
||||
{
|
||||
OCIString* ObjectSchema;
|
||||
OCIString* ObjectName;
|
||||
};
|
||||
typedef struct ODCIObject ODCIObject;
|
||||
|
||||
struct ODCIObject_ind
|
||||
{
|
||||
OCIInd atomic;
|
||||
OCIInd ObjectSchema;
|
||||
OCIInd ObjectName;
|
||||
};
|
||||
typedef struct ODCIObject_ind ODCIObject_ind;
|
||||
|
||||
struct ODCIQueryInfo
|
||||
{
|
||||
OCINumber Flags;
|
||||
ODCIObjectList* AncOps;
|
||||
ODCICompQueryInfo CompInfo;
|
||||
};
|
||||
typedef struct ODCIQueryInfo ODCIQueryInfo;
|
||||
|
||||
|
||||
struct ODCIQueryInfo_ind
|
||||
{
|
||||
OCIInd atomic;
|
||||
OCIInd Flags;
|
||||
OCIInd AncOps;
|
||||
ODCICompQueryInfo_ind CompInfo;
|
||||
};
|
||||
typedef struct ODCIQueryInfo_ind ODCIQueryInfo_ind;
|
||||
|
||||
struct ODCIIndexCtx
|
||||
{
|
||||
struct ODCIIndexInfo IndexInfo;
|
||||
OCIString* Rid;
|
||||
struct ODCIQueryInfo QueryInfo;
|
||||
};
|
||||
typedef struct ODCIIndexCtx ODCIIndexCtx;
|
||||
|
||||
struct ODCIIndexCtx_ind
|
||||
{
|
||||
OCIInd atomic;
|
||||
struct ODCIIndexInfo_ind IndexInfo;
|
||||
OCIInd Rid;
|
||||
struct ODCIQueryInfo_ind QueryInfo;
|
||||
};
|
||||
typedef struct ODCIIndexCtx_ind ODCIIndexCtx_ind;
|
||||
|
||||
struct ODCIFuncInfo
|
||||
{
|
||||
OCIString* ObjectSchema;
|
||||
OCIString* ObjectName;
|
||||
OCIString* MethodName;
|
||||
OCINumber Flags;
|
||||
};
|
||||
typedef struct ODCIFuncInfo ODCIFuncInfo;
|
||||
|
||||
struct ODCIFuncInfo_ind
|
||||
{
|
||||
OCIInd atomic;
|
||||
OCIInd ObjectSchema;
|
||||
OCIInd ObjectName;
|
||||
OCIInd MethodName;
|
||||
OCIInd Flags;
|
||||
};
|
||||
typedef struct ODCIFuncInfo_ind ODCIFuncInfo_ind;
|
||||
|
||||
struct ODCICost
|
||||
{
|
||||
OCINumber CPUcost;
|
||||
OCINumber IOcost;
|
||||
OCINumber NetworkCost;
|
||||
OCIString* IndexCostInfo;
|
||||
};
|
||||
typedef struct ODCICost ODCICost;
|
||||
|
||||
struct ODCICost_ind
|
||||
{
|
||||
OCIInd atomic;
|
||||
OCIInd CPUcost;
|
||||
OCIInd IOcost;
|
||||
OCIInd NetworkCost;
|
||||
OCIInd IndexCostInfo;
|
||||
};
|
||||
typedef struct ODCICost_ind ODCICost_ind;
|
||||
|
||||
struct ODCIArgDesc
|
||||
{
|
||||
OCINumber ArgType;
|
||||
OCIString* TableName;
|
||||
OCIString* TableSchema;
|
||||
OCIString* ColName;
|
||||
OCIString* TablePartitionLower;
|
||||
OCIString* TablePartitionUpper;
|
||||
OCINumber Cardinality;
|
||||
};
|
||||
typedef struct ODCIArgDesc ODCIArgDesc;
|
||||
|
||||
struct ODCIArgDesc_ind
|
||||
{
|
||||
OCIInd atomic;
|
||||
OCIInd ArgType;
|
||||
OCIInd TableName;
|
||||
OCIInd TableSchema;
|
||||
OCIInd ColName;
|
||||
OCIInd TablePartitionLower;
|
||||
OCIInd TablePartitionUpper;
|
||||
OCIInd Cardinality;
|
||||
};
|
||||
typedef struct ODCIArgDesc_ind ODCIArgDesc_ind;
|
||||
|
||||
struct ODCIStatsOptions
|
||||
{
|
||||
OCINumber Sample;
|
||||
OCINumber Options;
|
||||
OCINumber Flags;
|
||||
};
|
||||
typedef struct ODCIStatsOptions ODCIStatsOptions;
|
||||
|
||||
struct ODCIStatsOptions_ind
|
||||
{
|
||||
OCIInd atomic;
|
||||
OCIInd Sample;
|
||||
OCIInd Options;
|
||||
OCIInd Flags;
|
||||
};
|
||||
typedef struct ODCIStatsOptions_ind ODCIStatsOptions_ind;
|
||||
|
||||
struct ODCIEnv
|
||||
{
|
||||
OCINumber EnvFlags;
|
||||
OCINumber CallProperty;
|
||||
OCINumber DebugLevel;
|
||||
OCINumber CursorNum;
|
||||
};
|
||||
typedef struct ODCIEnv ODCIEnv;
|
||||
|
||||
struct ODCIEnv_ind
|
||||
{
|
||||
OCIInd _atomic;
|
||||
OCIInd EnvFlags;
|
||||
OCIInd CallProperty;
|
||||
OCIInd DebugLevel;
|
||||
OCIInd CursorNum;
|
||||
};
|
||||
typedef struct ODCIEnv_ind ODCIEnv_ind;
|
||||
|
||||
struct ODCIPartInfo
|
||||
{
|
||||
OCIString* TablePartition;
|
||||
OCIString* IndexPartition;
|
||||
OCINumber IndexPartitionIden;
|
||||
OCINumber PartOp;
|
||||
};
|
||||
typedef struct ODCIPartInfo ODCIPartInfo;
|
||||
|
||||
struct ODCIPartInfo_ind
|
||||
{
|
||||
OCIInd atomic;
|
||||
OCIInd TablePartition;
|
||||
OCIInd IndexPartition;
|
||||
OCIInd IndexPartitionIden;
|
||||
OCIInd PartOp;
|
||||
};
|
||||
typedef struct ODCIPartInfo_ind ODCIPartInfo_ind;
|
||||
|
||||
/*---------- External Tables ----------*/
|
||||
struct ODCIExtTableInfo
|
||||
{
|
||||
OCIString* TableSchema;
|
||||
OCIString* TableName;
|
||||
ODCIColInfoList* RefCols;
|
||||
OCIClobLocator* AccessParmClob;
|
||||
OCIBlobLocator* AccessParmBlob;
|
||||
ODCIArgDescList* Locations;
|
||||
ODCIArgDescList* Directories;
|
||||
OCIString* DefaultDirectory;
|
||||
OCIString* DriverType;
|
||||
OCINumber OpCode;
|
||||
OCINumber AgentNum;
|
||||
OCINumber GranuleSize;
|
||||
OCINumber Flag;
|
||||
OCINumber SamplePercent;
|
||||
OCINumber MaxDoP;
|
||||
OCIRaw* SharedBuf;
|
||||
OCIString* MTableName;
|
||||
OCIString* MTableSchema;
|
||||
OCINumber TableObjNo;
|
||||
};
|
||||
typedef struct ODCIExtTableInfo ODCIExtTableInfo;
|
||||
|
||||
struct ODCIExtTableInfo_ind
|
||||
{
|
||||
OCIInd _atomic;
|
||||
OCIInd TableSchema;
|
||||
OCIInd TableName;
|
||||
OCIInd RefCols;
|
||||
OCIInd AccessParmClob;
|
||||
OCIInd AccessParmBlob;
|
||||
OCIInd Locations;
|
||||
OCIInd Directories;
|
||||
OCIInd DefaultDirectory;
|
||||
OCIInd DriverType;
|
||||
OCIInd OpCode;
|
||||
OCIInd AgentNum;
|
||||
OCIInd GranuleSize;
|
||||
OCIInd Flag;
|
||||
OCIInd SamplePercent;
|
||||
OCIInd MaxDoP;
|
||||
OCIInd SharedBuf;
|
||||
OCIInd MTableName;
|
||||
OCIInd MTableSchema;
|
||||
OCIInd TableObjNo;
|
||||
};
|
||||
typedef struct ODCIExtTableInfo_ind ODCIExtTableInfo_ind;
|
||||
|
||||
struct ODCIExtTableQCInfo
|
||||
{
|
||||
OCINumber NumGranules;
|
||||
OCINumber NumLocations;
|
||||
ODCIGranuleList* GranuleInfo;
|
||||
OCINumber IntraSourceConcurrency;
|
||||
OCINumber MaxDoP;
|
||||
OCIRaw* SharedBuf;
|
||||
};
|
||||
typedef struct ODCIExtTableQCInfo ODCIExtTableQCInfo;
|
||||
|
||||
struct ODCIExtTableQCInfo_ind
|
||||
{
|
||||
OCIInd _atomic;
|
||||
OCIInd NumGranules;
|
||||
OCIInd NumLocations;
|
||||
OCIInd GranuleInfo;
|
||||
OCIInd IntraSourceConcurrency;
|
||||
OCIInd MaxDoP;
|
||||
OCIInd SharedBuf;
|
||||
};
|
||||
typedef struct ODCIExtTableQCInfo_ind ODCIExtTableQCInfo_ind;
|
||||
|
||||
/*********************************************************/
|
||||
/* Table Function Info types (used by ODCITablePrepare) */
|
||||
/*********************************************************/
|
||||
|
||||
struct ODCITabFuncInfo
|
||||
{
|
||||
ODCINumberList* Attrs;
|
||||
OCIType* RetType;
|
||||
};
|
||||
typedef struct ODCITabFuncInfo ODCITabFuncInfo;
|
||||
|
||||
struct ODCITabFuncInfo_ind
|
||||
{
|
||||
OCIInd _atomic;
|
||||
OCIInd Attrs;
|
||||
OCIInd RetType;
|
||||
};
|
||||
typedef struct ODCITabFuncInfo_ind ODCITabFuncInfo_ind;
|
||||
|
||||
/*********************************************************************/
|
||||
/* Table Function Statistics types (used by ODCIStatsTableFunction) */
|
||||
/*********************************************************************/
|
||||
|
||||
struct ODCITabFuncStats
|
||||
{
|
||||
OCINumber num_rows;
|
||||
};
|
||||
typedef struct ODCITabFuncStats ODCITabFuncStats;
|
||||
|
||||
struct ODCITabFuncStats_ind
|
||||
{
|
||||
OCIInd _atomic;
|
||||
OCIInd num_rows;
|
||||
};
|
||||
typedef struct ODCITabFuncStats_ind ODCITabFuncStats_ind;
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PRIVATE TYPES AND CONSTANTS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PUBLIC FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
PRIVATE FUNCTIONS
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#endif /* ODCI_ORACLE */
|
||||
@ -0,0 +1,322 @@
|
||||
/*
|
||||
Copyright (c) 1982, 2008, Oracle and/or its affiliates.All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Header: oracore3/public/oratypes.h /nt/21 2009/01/01 19:48:06 sabchoud Exp $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef ORATYPES
|
||||
# define ORATYPES
|
||||
# define SX_ORACLE
|
||||
# define SX3_ORACLE
|
||||
|
||||
|
||||
#ifndef ORASTDDEF
|
||||
# include <stddef.h>
|
||||
# define ORASTDDEF
|
||||
#endif
|
||||
|
||||
#ifndef ORALIMITS
|
||||
# include <limits.h>
|
||||
# define ORALIMITS
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef TRUE
|
||||
# define TRUE 1
|
||||
# define FALSE 0
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef lint
|
||||
typedef unsigned char ub1;
|
||||
typedef signed char sb1;
|
||||
#else
|
||||
#define ub1 unsigned char
|
||||
#define sb1 signed char
|
||||
#endif
|
||||
|
||||
#define UB1MAXVAL ((ub1)UCHAR_MAX)
|
||||
#define UB1MINVAL ((ub1) 0)
|
||||
#define SB1MAXVAL ((sb1)SCHAR_MAX)
|
||||
#define SB1MINVAL ((sb1)SCHAR_MIN)
|
||||
#define MINUB1MAXVAL ((ub1) 255)
|
||||
#define MAXUB1MINVAL ((ub1) 0)
|
||||
#define MINSB1MAXVAL ((sb1) 127)
|
||||
#define MAXSB1MINVAL ((sb1) -127)
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef lint
|
||||
typedef unsigned short ub2;
|
||||
typedef signed short sb2;
|
||||
#else
|
||||
#define ub2 unsigned short
|
||||
#define sb2 signed short
|
||||
#endif
|
||||
|
||||
#define UB2MAXVAL ((ub2)USHRT_MAX)
|
||||
#define UB2MINVAL ((ub2) 0)
|
||||
#define SB2MAXVAL ((sb2) SHRT_MAX)
|
||||
#define SB2MINVAL ((sb2) SHRT_MIN)
|
||||
#define MINUB2MAXVAL ((ub2) 65535)
|
||||
#define MAXUB2MINVAL ((ub2) 0)
|
||||
#define MINSB2MAXVAL ((sb2) 32767)
|
||||
#define MAXSB2MINVAL ((sb2)-32767)
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef lint
|
||||
typedef unsigned int ub4;
|
||||
typedef signed int sb4;
|
||||
#else
|
||||
#define eb4 int
|
||||
#define ub4 unsigned int
|
||||
#define sb4 signed int
|
||||
#endif
|
||||
|
||||
#define UB4MAXVAL ((ub4)UINT_MAX)
|
||||
#define UB4MINVAL ((ub4) 0)
|
||||
#define SB4MAXVAL ((sb4) INT_MAX)
|
||||
#define SB4MINVAL ((sb4) INT_MIN)
|
||||
#define MINUB4MAXVAL ((ub4) 4294967295)
|
||||
#define MAXUB4MINVAL ((ub4) 0)
|
||||
#define MINSB4MAXVAL ((sb4) 2147483647)
|
||||
#define MAXSB4MINVAL ((sb4)-2147483647)
|
||||
|
||||
|
||||
/* --- Signed/Unsigned eight-byte scalar (orasb8/oraub8) --- */
|
||||
|
||||
#define ORAXB8_DEFINED
|
||||
#ifndef lint
|
||||
#ifndef __GNUC__
|
||||
#ifdef __BORLANDC__
|
||||
typedef unsigned __int64 oraub8;
|
||||
typedef signed __int64 orasb8;
|
||||
#else
|
||||
typedef unsigned _int64 oraub8;
|
||||
typedef signed _int64 orasb8;
|
||||
#endif /* __BORLANDC__ */
|
||||
#else
|
||||
typedef unsigned long long oraub8;
|
||||
typedef signed long long orasb8;
|
||||
#endif
|
||||
typedef oraub8 ub8;
|
||||
typedef orasb8 sb8;
|
||||
#else
|
||||
# define ub8 oraub8
|
||||
# define sb8 orasb8
|
||||
# define oraub8 unsigned _int64
|
||||
# define orasb8 signed _int64
|
||||
#endif /* !lint */
|
||||
|
||||
#define ORAUB8MINVAL ((oraub8)0)
|
||||
#define ORAUB8MAXVAL ((oraub8)18446744073709551615)
|
||||
#define ORASB8MINVAL ((orasb8)-9223372036854775808)
|
||||
#define ORASB8MAXVAL ((orasb8) 9223372036854775807)
|
||||
|
||||
#define MAXORAUB8MINVAL ((oraub8)0)
|
||||
#define MINORAUB8MAXVAL ((oraub8)18446744073709551615)
|
||||
#define MAXORASB8MINVAL ((orasb8)-9223372036854775807)
|
||||
#define MINORASB8MAXVAL ((orasb8) 9223372036854775807)
|
||||
|
||||
|
||||
#define UB1BITS CHAR_BIT
|
||||
#define UB1MASK ((1 << ((uword)CHAR_BIT)) - 1)
|
||||
|
||||
|
||||
#ifdef lint
|
||||
# define oratext unsigned char
|
||||
#else
|
||||
typedef unsigned char oratext;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef lint
|
||||
typedef char eb1;
|
||||
typedef short eb2;
|
||||
typedef int eb4;
|
||||
#else
|
||||
# define eb1 char
|
||||
# define eb2 short
|
||||
# define eb4 int
|
||||
#endif
|
||||
|
||||
#define EB1MAXVAL ((eb1)SCHAR_MAX)
|
||||
#define EB1MINVAL ((eb1) 0)
|
||||
#define MINEB1MAXVAL ((eb1) 127)
|
||||
#define MAXEB1MINVAL ((eb1) 0)
|
||||
#define EB2MAXVAL ((eb2) SHRT_MAX)
|
||||
#define EB2MINVAL ((eb2) 0)
|
||||
#define MINEB2MAXVAL ((eb2) 32767)
|
||||
#define MAXEB2MINVAL ((eb2) 0)
|
||||
#define EB4MAXVAL ((eb4) INT_MAX)
|
||||
#define EB4MINVAL ((eb4) 0)
|
||||
#define MINEB4MAXVAL ((eb4) 2147483647)
|
||||
#define MAXEB4MINVAL ((eb4) 0)
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef lint
|
||||
typedef sb1 b1;
|
||||
#else
|
||||
#define b1 sb1
|
||||
#endif
|
||||
#define B1MAXVAL SB1MAXVAL
|
||||
#define B1MINVAL SB1MINVAL
|
||||
|
||||
#ifndef lint
|
||||
typedef sb2 b2;
|
||||
#else
|
||||
#define b2 sb2
|
||||
#endif
|
||||
#define B2MAXVAL SB2MAXVAL
|
||||
#define B2MINVAL SB2MINVAL
|
||||
|
||||
#ifndef lint
|
||||
typedef sb4 b4;
|
||||
#else
|
||||
#define b4 sb4
|
||||
#endif
|
||||
# define B4MAXVAL SB4MAXVAL
|
||||
# define B4MINVAL SB4MINVAL
|
||||
|
||||
|
||||
#if !defined(LUSEMFC)
|
||||
# ifdef lint
|
||||
# define text unsigned char
|
||||
# else
|
||||
typedef oratext text;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef lint
|
||||
# define OraText unsigned char
|
||||
#else
|
||||
typedef oratext OraText;
|
||||
#endif
|
||||
|
||||
#ifndef lint
|
||||
typedef int eword;
|
||||
typedef unsigned int uword;
|
||||
typedef signed int sword;
|
||||
#else
|
||||
#define eword int
|
||||
#define uword unsigned int
|
||||
#define sword signed int
|
||||
#endif
|
||||
|
||||
#define EWORDMAXVAL ((eword) INT_MAX)
|
||||
#define EWORDMINVAL ((eword) 0)
|
||||
#define UWORDMAXVAL ((uword)UINT_MAX)
|
||||
#define UWORDMINVAL ((uword) 0)
|
||||
#define SWORDMAXVAL ((sword) INT_MAX)
|
||||
#define SWORDMINVAL ((sword) INT_MIN)
|
||||
#define MINEWORDMAXVAL ((eword) 2147483647)
|
||||
#define MAXEWORDMINVAL ((eword) 0)
|
||||
#define MINUWORDMAXVAL ((uword) 4294967295)
|
||||
#define MAXUWORDMINVAL ((uword) 0)
|
||||
#define MINSWORDMAXVAL ((sword) 2147483647)
|
||||
#define MAXSWORDMINVAL ((sword) -2147483647)
|
||||
|
||||
|
||||
#ifdef _WIN64
|
||||
|
||||
#ifndef lint
|
||||
#ifdef __BORLANDC__
|
||||
typedef unsigned __int64 ubig_ora;
|
||||
typedef signed __int64 sbig_ora;
|
||||
#else
|
||||
typedef unsigned _int64 ubig_ora;
|
||||
typedef signed _int64 sbig_ora;
|
||||
#endif /* End of __BORLANDC__ */
|
||||
#else
|
||||
#define ubig_ora unsigned _int64
|
||||
#define sbig_ora signed _int64
|
||||
#endif /* End of lint */
|
||||
|
||||
#define UBIG_ORAMAXVAL ((ubig_ora)_UI64_MAX)
|
||||
#define UBIG_ORAMINVAL ((ubig_ora) 0)
|
||||
#define SBIG_ORAMAXVAL ((sbig_ora) _I64_MAX)
|
||||
#define SBIG_ORAMINVAL ((sbig_ora) _I64_MIN)
|
||||
#define MINUBIG_ORAMAXVAL ((ubig_ora) 4294967295)
|
||||
#define MAXUBIG_ORAMINVAL ((ubig_ora) 0)
|
||||
#define MINSBIG_ORAMAXVAL ((sbig_ora) 2147483647)
|
||||
#define MAXSBIG_ORAMINVAL ((sbig_ora)-2147483647)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef lint
|
||||
typedef unsigned long ubig_ora;
|
||||
typedef signed long sbig_ora;
|
||||
#else
|
||||
#define ubig_ora unsigned long
|
||||
#define sbig_ora signed long
|
||||
#endif
|
||||
|
||||
#define UBIG_ORAMAXVAL ((ubig_ora)ULONG_MAX)
|
||||
#define UBIG_ORAMINVAL ((ubig_ora) 0)
|
||||
#define SBIG_ORAMAXVAL ((sbig_ora) LONG_MAX)
|
||||
#define SBIG_ORAMINVAL ((sbig_ora) LONG_MIN)
|
||||
#define MINUBIG_ORAMAXVAL ((ubig_ora) 4294967295)
|
||||
#define MAXUBIG_ORAMINVAL ((ubig_ora) 0)
|
||||
#define MINSBIG_ORAMAXVAL ((sbig_ora) 2147483647)
|
||||
#define MAXSBIG_ORAMINVAL ((sbig_ora)-2147483647)
|
||||
|
||||
#endif /* _WIN64 */
|
||||
|
||||
#define UBIGORABITS (UB1BITS * sizeof(ubig_ora))
|
||||
|
||||
|
||||
#undef CONST
|
||||
#define CONST const
|
||||
|
||||
|
||||
#define dvoid void
|
||||
|
||||
|
||||
typedef void (*lgenfp_t)( void );
|
||||
|
||||
|
||||
|
||||
#ifndef ORASYS_TYPES
|
||||
# include <sys/types.h>
|
||||
# define ORASYS_TYPES
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef boolean
|
||||
# define boolean int
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef sparc
|
||||
# define SIZE_TMAXVAL SB4MAXVAL
|
||||
#else
|
||||
# define SIZE_TMAXVAL UB4MAXVAL
|
||||
#endif
|
||||
|
||||
#define MINSIZE_TMAXVAL (size_t)4294967295
|
||||
|
||||
|
||||
#if !defined(MOTIF) && !defined(LISPL) && !defined(__cplusplus) && !defined(LUSEMFC)
|
||||
typedef oratext *string;
|
||||
#endif
|
||||
|
||||
#ifndef lint
|
||||
typedef unsigned short utext;
|
||||
#else
|
||||
#define utext unsigned short
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,373 @@
|
||||
/* Copyright (c) 1994, 2006, Oracle. All rights reserved. */
|
||||
|
||||
/*
|
||||
Author: Tin Nguyen
|
||||
Date: 02/07/94
|
||||
Source documents: "Functional Specification for C Object Interface, Object
|
||||
Management Subsystem", "Oracle C Coding Standards
|
||||
version 2.2", and the header file template
|
||||
Rule sets: the generic and .h file rule sets
|
||||
Quality status: not exited
|
||||
Identification tag: [ one or more letters to identify the .h file ]
|
||||
Revision code: [ date of the last revision of the .h file ]
|
||||
|
||||
Note to the user of this header file:
|
||||
|
||||
Anything in this header file that is marked private is not supported and
|
||||
must not be used. Private sections are included in the header file to
|
||||
improve internal maintenance.
|
||||
|
||||
NAME
|
||||
|
||||
ORID - Oracle Object Interface for Dynamic Data Access
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
This file contains declarations for C object interface functions including
|
||||
the dynamic object data access operations that allow callers to dynamically
|
||||
access and manipulate objects; these operations include getting and setting
|
||||
attributes of an object. These dynamic object operations are for accessing
|
||||
and manipulation objects whose types are not known at compile-time.
|
||||
|
||||
RELATED DOCUMENTS
|
||||
|
||||
Functional Specification for C Object Interface / Object Management System
|
||||
|
||||
PUBLIC FUNCTIONS
|
||||
|
||||
OCIObjectSetAttr - ORID SET attribute value
|
||||
OCIObjectGetAttr - ORID GET attribute value
|
||||
|
||||
PRIVATE FUNCTIONS
|
||||
|
||||
None
|
||||
|
||||
EXAMPLES
|
||||
|
||||
EXAMPLE 1
|
||||
|
||||
/o
|
||||
o This example illustrates how an interative program can use the dynamic
|
||||
o attribute access to display and modify attributes of an ADT instance.
|
||||
o The interactive program does not know the type of the object at
|
||||
o compile time.
|
||||
o/
|
||||
|
||||
void display(adt_ref, object, null_struct, names, names_count,
|
||||
names_length, indexes, indexes_count)
|
||||
{
|
||||
/o Pin the ADT o/
|
||||
if (OCIObjectPin(env, &adt_ref, OROOPOCUR, OROOPDTRA, OROOLMNON, &adt)
|
||||
!= OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
/o
|
||||
o Call the type manager to obtain all the attributes in the object.
|
||||
o Display the content of each attribute in the ADT instance. If the
|
||||
o attribute is an array, display each element of the array. If the
|
||||
o attribute is an ADT instance, recursively call this routine to
|
||||
o display the embedded ADT instance.
|
||||
o/
|
||||
numAttrs = OCITypeAttrs(env, adt);
|
||||
for (i= 1; i <= numAttrs; i++)
|
||||
{
|
||||
/o get attribute descriptor o/
|
||||
if (ortgabp(env, adt, i, &ado_ref, &ado) != OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
/o get attribute name o/
|
||||
names[names_count] = OCITypeElemName(env, ado,
|
||||
&names_length[names_count]);
|
||||
|
||||
/o dynamically get the attr o/
|
||||
if (OCIObjectGetAttr(env, object, null_struct, 0, adt_ref, names,
|
||||
names_length, names_count+1, indexes, indexes_count, 0,
|
||||
&null, &null_info, &attr) != OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
/o check if attribute is null o/
|
||||
if (null) continue;
|
||||
|
||||
/o get typecode of attribute o/
|
||||
typecode = OCITypeElemTypeCode(env, ado);
|
||||
|
||||
/o if attribute is a varray, display each element in varray o/
|
||||
if (typecode == OCI_TYPECODE_VARRAY)
|
||||
{
|
||||
/o get the reference to the type of the element of the array o/
|
||||
if (OCITypeElemParameterizedTyper(env, ado, &attr_type_ref)
|
||||
!= OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
/o get the size of array o/
|
||||
if (orlasiz(env, &attr_type_ref, (orlva *)attr,
|
||||
&numElm) != OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
/o get the typecode of the element of the array o/
|
||||
if (ortty2r(env, attr_type_ref, &typecode) != OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
/o iterate the array o/
|
||||
for (j=0; j < numElm; j++)
|
||||
{
|
||||
/o get an element in the array o/
|
||||
if (OCIObjectGetAttr(env, attr, null_info, j+1, attr_type_ref,
|
||||
names, names_length, 0, indexes, 0, 0, &null, &null_info,
|
||||
&element) != OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
/o check if element is null o/
|
||||
if (null) continue;
|
||||
|
||||
/o if attr is an ADT instance, recursively call this routine o/
|
||||
if (typecode == OCI_TYPECODE_ADT || typecode ==
|
||||
OCI_TYPECODE_UNNAMEDADT)
|
||||
{
|
||||
/o display the element as an adt o/
|
||||
display(attr_type_ref, element, null_info, names, lengths,
|
||||
0, indexes, 0);
|
||||
}
|
||||
|
||||
/o if attribute is scalar, print the value to the screen o/
|
||||
else output_to_screen(element, typecode);
|
||||
}
|
||||
}
|
||||
|
||||
/o if attribute is an ADT instance, recursively call this routine o/
|
||||
else if (typecode == OCI_TYPECODE_ADT || typecode ==
|
||||
OCI_TYPECODE_UNNAMEDADT)
|
||||
{
|
||||
/o get the type ref of the attribute o/
|
||||
if (ortgarf(env, ado, &attr_type_ref) != OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
display(attr_type_ref, attr, null_info, 0, names, 0, names_length,
|
||||
indexes, 0);
|
||||
}
|
||||
|
||||
/o if attribute is scalar, print the value to the screen o/
|
||||
else output_to_screen(attr, typecode);
|
||||
}
|
||||
}
|
||||
|
||||
/o ******** main routine *********** o/
|
||||
....
|
||||
|
||||
/o
|
||||
o Allocate the arrays for storing the path expression
|
||||
o/
|
||||
|
||||
/o get the tdo of type 'long' o/
|
||||
if (orttypget(&env, con, "SYS", sizeof("SYS"), "SINT32", sizeof("SINT32"),
|
||||
OROOPDSES, &long_ref, &long_tdo) != OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
/o get the tdo of type 'varchar' o/
|
||||
if (orttypget(&env, con, "SYS", sizeof("SYS"), "SQL_VARCHAR2",
|
||||
sizeof("SQL_VARCHAR2"), OROOPDSES, &vchar_ref, &vchar_tdo)
|
||||
!= OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
/o allocate the varrays for the path expression o/
|
||||
if (orlalloc(env, &vchar_ref, MAX_ARR_SIZE, &attr_names) != OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
if (orlalloc(env, &long_ref, MAX_ARR_SIZE, &attr_name_lengths)
|
||||
!= OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
if (orlalloc(env, &long_ref, MAX_ARR_SIZE, &attr_name_indexes)
|
||||
!= OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
/o
|
||||
o Get an ADT instance. The ref to the ADT instance can be obtained
|
||||
o by through ORI or OSCI.
|
||||
o/
|
||||
if (OCIObjectPin(env, &obj_ref, OROOPOCUR, OROOPDTRA, OROOLMUPD, &object)
|
||||
!= OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
/o get the null structure of the ADT instance o/
|
||||
if (OCIObjectGetInd(gp, object, &null_struct) != OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
/o
|
||||
o Get the type of the ADT instance
|
||||
o/
|
||||
|
||||
/o find out the type of the ADT instance o/
|
||||
if (oriogto(env, object, &adt_ref) != OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
/o display the object o/
|
||||
display(adt_ref, object, null_struct, attr_names, 0, attr_names_lengths,
|
||||
attr_names_indexes, 0);
|
||||
|
||||
/o After the object is displayed, the program waits for the user to
|
||||
o respond. The user modifies the values of an attribute and the
|
||||
o program generates a path expression for the attribute and calls
|
||||
o OCIObjectSetAttr() to set the value.
|
||||
o/
|
||||
|
||||
if (OCIObjectSetAttr(env, object, null_struct, adt_ref,
|
||||
(text **)attr_names, (ub4 *)attr_name_lengths,
|
||||
attr_names_count, (ub4 *)attr_array_indexes,
|
||||
attr_array_indexes_count,
|
||||
(void *)0, FALSE, (void *)value) != OROSTASUC)
|
||||
/o error handling code o/
|
||||
|
||||
END OF EXAMPLE 1
|
||||
|
||||
NOTES
|
||||
|
||||
This file has been subsetted to contain only the routines that will
|
||||
be in the first release.
|
||||
|
||||
MODIFIED
|
||||
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
|
||||
srseshad 03/12/03 - convert oci public api to ansi
|
||||
aahluwal 06/03/02 - bug 2360115
|
||||
bpalaval 02/09/01 - Change text to oratext.
|
||||
whe 09/01/99 - 976457:check __cplusplus for C++ code
|
||||
sthakur 09/18/97 - collection indexing not supported
|
||||
cxcheng 08/05/97 - fix compile with short names
|
||||
skrishna 03/18/97 - fix ifdef for supporting ansi and k&r proto-types
|
||||
cxcheng 02/06/97 - take out short name support except with SLSHORTNAME
|
||||
cxcheng 10/17/96 - final renaming of functions
|
||||
jboonleu 10/07/96 - beautify with OCI long names
|
||||
cxcheng 10/07/96 - change short names to long names for readability
|
||||
jboonleu 09/27/96 - fix lint
|
||||
jwijaya 07/03/96 - add ANSI prototypes
|
||||
jboonleu 04/13/95 - new interface
|
||||
jwijaya 10/11/94 - fix the sccs header and add namespace
|
||||
tanguyen 08/22/94 - fix example
|
||||
tanguyen 08/09/94 - remove Sccsid declaration
|
||||
tanguyen 07/20/94 - fix OCIObjectSetAttr and OCIObjectGetAttr to
|
||||
use position descriptor
|
||||
tanguyen 07/18/94 - change 'object' type to become ptr to object
|
||||
tanguyen 06/30/94 - Fix the ORID_ORACLE ifdef
|
||||
tanguyen 06/27/94 - update to template format
|
||||
skotsovo 05/12/94 - replace ado with attribute position
|
||||
jweisz 05/11/94 - test new checkin facility
|
||||
jwijaya 05/05/94 - orienv/ref/typ -> oroenv/ref/typ
|
||||
jwijaya 02/07/94 - Creation
|
||||
|
||||
*/
|
||||
|
||||
#ifndef ORATYPES
|
||||
#include <oratypes.h>
|
||||
#endif
|
||||
#ifndef ORO_ORACLE
|
||||
#include <oro.h>
|
||||
#endif
|
||||
#ifndef OCI_ORACLE
|
||||
#include <oci.h>
|
||||
#endif
|
||||
|
||||
#ifndef ORID_ORACLE
|
||||
#define ORID_ORACLE
|
||||
|
||||
#ifdef SLSHORTNAME
|
||||
|
||||
#define OCIObjectSetAttr oridset
|
||||
#define OCIObjectGetAttr oridget
|
||||
|
||||
#endif /* SLSHORTNAME */
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* PUBLIC FUNCTIONS */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*-------------------------- OCIObjectSetAttr ----------------------------*/
|
||||
sword OCIObjectSetAttr( OCIEnv *env, OCIError *err, void *instance,
|
||||
void *null_struct, struct OCIType *tdo,
|
||||
const oratext **names, const ub4 *lengths,
|
||||
const ub4 name_count, const ub4 *indexes,
|
||||
const ub4 index_count, const OCIInd null_status,
|
||||
const void *attr_null_struct, const void *attr_value );
|
||||
/*
|
||||
NAME: OCIObjectSetAttr - ORID SET value
|
||||
PARAMETERS:
|
||||
env (IN) - OCI environment handle initialized in object mode
|
||||
err (IN) - error handle. If there is an error, it is
|
||||
recorded in 'err' and this function returns OCI_ERROR.
|
||||
The error recorded in 'err' can be retrieved by calling
|
||||
OCIErrorGet().
|
||||
instance (IN) - pointer to an ADT instance
|
||||
null_struct (IN) - the null structure of the ADT instance or array
|
||||
tdo (IN) - pointer to the TDO
|
||||
names (IN) - array of attribute names. This is used to specify
|
||||
the names of the attributes in the path expression.
|
||||
lengths (IN) - array of lengths of attribute names.
|
||||
name_count (IN) - number of element in the array 'names'.
|
||||
indexes (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4 *)0.
|
||||
index_count (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4)0.
|
||||
attr_null_status (IN) - the null status of the attribute if the type of
|
||||
attribute is primitive.
|
||||
attr_null_struct (IN) - the null structure of an ADT or collection
|
||||
attribute.
|
||||
attr_value (IN) - pointer to the attribute value.
|
||||
REQUIRES:
|
||||
DESCRIPTION:
|
||||
This function set the attribute of the given object with the given
|
||||
value. The position of the attribute is specified as a path
|
||||
expression which is an array of names and an array of indexes.
|
||||
RETURNS:
|
||||
one of OROSTA*
|
||||
EXAMPLES:
|
||||
For path expression stanford.cs.stu[5].addr, the arrays will look like
|
||||
names = {"stanford", "cs", "stu", "addr"}
|
||||
lengths = {8, 2, 3, 4}
|
||||
indexes = {5}
|
||||
|
||||
Also see the above example.
|
||||
*/
|
||||
|
||||
/*-------------------------- OCIObjectGetAttr ----------------------------*/
|
||||
sword OCIObjectGetAttr( OCIEnv *env, OCIError *err, void *instance,
|
||||
void *null_struct, struct OCIType *tdo,
|
||||
const oratext **names, const ub4 *lengths,
|
||||
const ub4 name_count, const ub4 *indexes,
|
||||
const ub4 index_count, OCIInd *attr_null_status,
|
||||
void **attr_null_struct, void **attr_value,
|
||||
struct OCIType **attr_tdo );
|
||||
/*
|
||||
NAME: OCIObjectGetAttr - ORID GET value
|
||||
PARAMETERS:
|
||||
env (IN) - OCI environment handle initialized in object mode
|
||||
err (IN) - error handle. If there is an error, it is
|
||||
recorded in 'err' and this function returns OCI_ERROR.
|
||||
The error recorded in 'err' can be retrieved by calling
|
||||
OCIErrorGet().
|
||||
instance (IN) - pointer to an ADT instance
|
||||
null_struct (IN) - the null structure of the ADT instance or array
|
||||
tdo (IN) - pointer to the TDO
|
||||
names (IN) - array of attribute names. This is used to specify
|
||||
the names of the attributes in the path expression.
|
||||
lengths (IN) - array of lengths of attribute names.
|
||||
name_count (IN) - number of element in the array 'names'.
|
||||
indexes (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4 *)0.
|
||||
index_count (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4)0.
|
||||
attr_null_status (OUT) - the null status of the attribute if the type
|
||||
of attribute is primitive.
|
||||
attr_null_struct (OUT) - the null structure of an ADT or collection
|
||||
attribute.
|
||||
attr_value (OUT) - pointer to the attribute value.
|
||||
attr_tdo (OUT) - pointer to the TDO of the attribute.
|
||||
REQUIRES:
|
||||
- a valid OCI environment handle must be given.
|
||||
DESCRIPTION:
|
||||
This function gets a value from an ADT instance or from an array.
|
||||
If the parameter 'instance' points to an ADT instance, then the path
|
||||
expression specifies the location of the attribute in the ADT.
|
||||
It is assumed that the object is pinned and that the value returned
|
||||
is valid until the object is unpinned.
|
||||
RETURNS:
|
||||
one of OROSTA*
|
||||
EXAMPLES:
|
||||
See example in OCIObjectSetAttr(). Also see the above example.
|
||||
*/
|
||||
|
||||
#endif /* ORID_ORACLE */
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,883 @@
|
||||
/* Copyright (c) 1994, 2003, Oracle Corporation. All rights reserved. */
|
||||
|
||||
/*
|
||||
NAME
|
||||
OCI - Oracle Object Interface for External/Internal/Kernel Clients
|
||||
|
||||
DESCRIPTION
|
||||
This header file contains Oracle object interface definitions which
|
||||
can be included by external user applications, tools, as well as
|
||||
the kernel. It defines types and constants that are common to all
|
||||
object interface which is being defined in several other header files
|
||||
(e.g., ori.h, ort.h, and orl.h).
|
||||
|
||||
RELATED DOCUMENTS
|
||||
TBD
|
||||
|
||||
INSPECTION STATUS [[ deletable if no inspection ]]
|
||||
Inspection date: [[ date of the last logging meeting ]]
|
||||
Inspection status: [[ exited, not exited, or N/A if exit is not a goal ]]
|
||||
Estimated increasing cost defects per page:
|
||||
Rule sets: [[ rule sets inspected against or planned to be
|
||||
inspected against ]]
|
||||
|
||||
ACCEPTANCE REVIEW STATUS [[ deletable if no approval review ]]
|
||||
Review date: [[ date of the meeting where issues were logged and the
|
||||
approval status was decided ]]
|
||||
Review status: [[ current status: accepted, conditionally accepted,
|
||||
major revision required, rejected ]]
|
||||
Reviewers: [[ names of the members on the review team ]]
|
||||
|
||||
PUBLIC FUNCTIONS
|
||||
|
||||
EXAMPLES
|
||||
Examples are given in the description of each function or macro where
|
||||
relevant.
|
||||
|
||||
MODIFIED
|
||||
mnanal 06/09/03 - backout of fix 2836388
|
||||
mnanal 05/14/03 - bug-2836388
|
||||
srseshad 11/27/02 - Change OCI_TYPECODE_BFLOAT/BDOUBLE codes
|
||||
rxgovind 10/09/02 - add OCI_TYPECODE_UROWID
|
||||
mxyang 09/17/02 - grabtrans 'mmorsi_obj_float'
|
||||
srseshad 09/11/02 -
|
||||
srseshad 09/01/02 -
|
||||
aahluwal 06/03/02 - bug 2360115
|
||||
celsbern 10/19/01 - merge LOG to MAIN
|
||||
rxgovind 10/16/01 - update typecodes
|
||||
rxgovind 09/19/01 - add typecodes
|
||||
rkasamse 08/15/01 - add OCI_DURATION_USER_CALLBACK
|
||||
jchai 09/24/01 - add type code for PLS_INTEGER
|
||||
porangas 08/22/01 - Fix bug#1776434
|
||||
schatter 04/09/01 - merge 1456235: define OCI_DURATION_INVALID
|
||||
rdani 10/12/00 - 1449943 NOCOPY and PIPELINE
|
||||
ciyer 05/26/00 - short names for abstract, overriding
|
||||
rkasamse 05/25/00 - OCCI enhancements
|
||||
smuralid 05/11/00 - OCITypeMethodFlags - add NOT INSTANTIABLE, OVERRIDING
|
||||
rxgovind 05/09/00 - add OCI_TYPECODE_NONE
|
||||
tnbui 07/28/99 - Remove OCI_TYPECODE_TIMESTAMP_ITZ
|
||||
tnbui 07/21/99 - TS LOCAL TZ
|
||||
thoang 06/21/99 - Add OCI_TYPECODE_TIMESTAMP_ITZ
|
||||
thoang 03/04/99 - Add datetime datatypes
|
||||
rkasamse 10/20/98 - add OCI_ATTR_CACHE_ARRAYFLUSH
|
||||
rkasamse 10/29/98 - add OCI_DURATION_CALLOUT
|
||||
rkasamse 04/28/98 - OCI_OBJECT_DETECTCHANGE -> OCI_ATTR_OBJECT_DETECTCHAN
|
||||
rkasamse 04/28/98 - OCI_OBJECT_NEWNOTNULL -> OCI_ATTR_OBJECT_NEWNOTNULL
|
||||
rkasamse 04/23/98 - add OCI_OBJECT_DETECTCHANGE
|
||||
rkasamse 04/03/98 - add OCI_OBJECT_NEWNOTNULL
|
||||
pmitra 04/01/98 - OCI_LOCK_X_NOWAIT added
|
||||
rxgovind 02/18/98 - add OCI_TYPECODE_OPAQUE
|
||||
rkasamse 02/13/98 - Add OCI_DURATION_PROCESS
|
||||
cxcheng 07/28/97 - fix compile with SLSHORTNAME
|
||||
skrishna 07/14/97 - add OCIObjectGetProperty
|
||||
cxcheng 04/30/97 - make OCITypeParamMode values consistent with PL/SQL
|
||||
skrishna 04/28/97 - undocument OCIObjectProperty & OCIObjectEvent
|
||||
cxcheng 03/29/97 - remove all remaining short names
|
||||
sthakur 03/20/97 - add casts to constants
|
||||
cxcheng 02/21/97 - temporarily put SLSHORTNAME for PL/SQL
|
||||
cxcheng 02/06/97 - take out short name support except with SLSHORTNAME
|
||||
lchidamb 01/20/97 - update OCIRef comments
|
||||
sgollapu 11/19/96 - Add OCI type codes for BOOL,REC,and TAB
|
||||
cxcheng 11/19/96 - more typecode changes
|
||||
cxcheng 11/13/96 - add #include for ocidfn.h
|
||||
cxcheng 11/13/96 - add OCI_TYPECODE_ADT for compatibility
|
||||
cxcheng 11/12/96 - add SQLT_NCO for named collection
|
||||
cxcheng 11/11/96 - more changes to typecodes
|
||||
cxcheng 11/07/96 - #define OCI_TYPECODE_MLSLABEL to SQLT_LAB
|
||||
cxcheng 11/06/96 - fix #define omission for OROTCNAT
|
||||
cxcheng 10/30/96 - move OCI_TYPECODE_* to ocidfn.h as SQLT_*
|
||||
cxcheng 10/28/96 - more beautification changes
|
||||
jboonleu 10/29/96 - add flags for freeing object
|
||||
dchatter 10/26/96 - delete redef of OCISvcCtx, OCIError, OCIEnv
|
||||
cxcheng 10/15/96 - more changes
|
||||
cxcheng 10/14/96 - more final fixes to constants
|
||||
mluong 10/11/96 -
|
||||
mluong 10/11/96 - KOCON and KONSP are in lowercase
|
||||
mluong 10/11/96 - add some define per Calvin
|
||||
cxcheng 10/09/96 - add #define for OROOCOSFN to OCI_COPY_NOREF
|
||||
jboonleu 10/08/96 - change OROOCOSFN to OCICopyFlag
|
||||
jboonleu 10/07/96 - use new OCI names for cache options
|
||||
cxcheng 10/07/96 - add OROTCS02 for KOTTCBRI and OROTCS03 as spare
|
||||
cxcheng 10/07/96 - more lint fixes
|
||||
cxcheng 10/02/96 - move oronsp to ko.h as konsp
|
||||
cxcheng 10/01/96 - add long names for readability
|
||||
cxcheng 10/01/96 - remove orotty and orotal
|
||||
rjenkins 09/28/96 - 2k char 4k varchar2
|
||||
jboonleu 09/27/96 - add macro used only in beta2
|
||||
cxcheng 09/27/96 - move oroenv to oroenv.h
|
||||
cxcheng 09/24/96 - remove unnecessary orotyp
|
||||
cxcheng 09/25/96 - add typecode OROTCS01 as placeholder for lob pointer
|
||||
cxcheng 09/20/96 - add TDO load option orotgo
|
||||
jboonleu 09/18/96 - add OROOPOREC
|
||||
jboonleu 09/10/96 - add OROOPODFL
|
||||
jweisz 08/27/96 - add SQL internal typecode OROTCS00
|
||||
cxcheng 08/02/96 - add PLSQL internal typecodes OROTCP..
|
||||
cxcheng 08/01/96 - add OROTCFAR to fill up space left by OROTCCAR
|
||||
jboonleu 07/16/96 - new pin option
|
||||
cxcheng 06/18/96 - add casts to OROTNOPRE and OROTNOSCL
|
||||
cxcheng 05/29/96 - change OROTCNPT back to OROTCDOM
|
||||
vkrishna 05/27/96 - add OROTCCAR
|
||||
cxcheng 05/17/96 - replace OROTCFAR with OROTCCAR
|
||||
cxcheng 05/08/96 - change orotmf from ub1 to ub2
|
||||
cxcheng 05/07/96 - fix public defines for method types
|
||||
cxcheng 04/30/96 - change OROTCDOM to OROTCNPT
|
||||
cxcheng 04/15/96 - remove obsolete OROTTYICT
|
||||
jboonleu 04/12/96 - add new pin option
|
||||
sthakur 04/12/96 - add indicator type and indicator status
|
||||
cxcheng 04/10/96 - add function parameter codes for ORT/KOT
|
||||
cxcheng 04/03/96 - replace OROTCFAR as OROTCCAR
|
||||
jwijaya 03/29/96 - add OROTTCCAR
|
||||
jwijaya 03/27/96 - better comments for orotc
|
||||
cxcheng 02/23/96 - add typecodes for SMALLINT and VARCHAR2
|
||||
skrishna 02/22/96 - add oroind - null indicator type
|
||||
cxcheng 02/21/96 - change lob character codes to OROTCCLB, OROTCBLB...
|
||||
jboonleu 02/06/96 - new value for predefined duration
|
||||
cxcheng 01/12/96 - add OROTCCLO, OROTCBLO, OROTCFIL to orotc
|
||||
cxcheng 12/05/95 - add OROTCDOM and OROTCAAT to orotc
|
||||
skotsovo 10/30/95 - reserve space for internal 'oid' type
|
||||
jwijaya 10/20/95 - support variable-length ref
|
||||
cxcheng 10/03/95 - add OROTMFOR for ordering function to orotmf
|
||||
cxcheng 10/03/95 - Adding the ordering function type to orotmf
|
||||
jboonleu 09/28/95 - set OROODTPRE
|
||||
jboonleu 09/25/95 - add oroodt
|
||||
skotsovo 03/10/95 - update to only include release 1
|
||||
jboonleu 02/15/95 - add OROOPOREC, remove orocro, oroolo
|
||||
skotsovo 01/30/95 - add default max lengths for varrays and vstrings
|
||||
skotsovo 01/24/95 - categorize sint32, double, and real as number types
|
||||
(with precision and scale) instead of scalar types.
|
||||
skotsovo 12/20/94 - add release 1 types
|
||||
skotsovo 12/12/94 - update according to new ots doc
|
||||
skotsovo 12/01/94 - add default precision and scale
|
||||
jwijaya 11/15/94 - rename ORONSPTAB to ORONSPEXT
|
||||
jwijaya 10/25/94 - tint
|
||||
jwijaya 10/06/94 - add namespace
|
||||
jwijaya 10/02/94 - connection handle -> connection number
|
||||
skotsovo 09/12/94 - keep 0 as uninitialized value for ORT consts
|
||||
skotsovo 08/24/94 - fix orotec
|
||||
skotsovo 08/17/94 - modify type code names
|
||||
skotsovo 08/12/94 - fix 141 lint errors
|
||||
skotsovo 07/25/94 - modify categorization of complex types (orotc)
|
||||
skotsovo 07/07/94 - change typecode enum values & add decimal type
|
||||
skotsovo 07/01/94 - change order of typecodes
|
||||
jwijaya 06/15/94 - review
|
||||
jboonleu 06/13/94 - add comments for the object cache options
|
||||
jwijaya 06/13/94 - adhere to the header file template
|
||||
skotsovo 06/09/94 - make ots scalar type names consistent with the ots
|
||||
document
|
||||
jwijaya 06/07/94 - include oratypes.h instead of s.h
|
||||
skotsovo 05/24/94 - change typecodes
|
||||
jwijaya 05/23/94 - fix comments of ororef
|
||||
skotsovo 05/19/94 - remove type composition
|
||||
skotsovo 05/09/94 - modified orotc according to new OTS document
|
||||
jwijaya 05/03/94 - oroid and ororef
|
||||
jwijaya 01/26/94 - Creation
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ORATYPES
|
||||
#include <oratypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef OCIDFN_ORACLE
|
||||
#include <ocidfn.h>
|
||||
#endif
|
||||
|
||||
#ifndef ORO_ORACLE
|
||||
#define ORO_ORACLE
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* SHORT NAMES SUPPORT SECTION */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef SLSHORTNAME
|
||||
|
||||
/* the following are short names that are only supported on IBM mainframes
|
||||
with the SLSHORTNAME defined.
|
||||
With this all subsequent long names will actually be substituted with
|
||||
the short names here */
|
||||
|
||||
#define OCIDuration oroodt
|
||||
#define OCIInd oroind
|
||||
#define OCILockOpt oroolm
|
||||
#define OCIMarkOpt oroomo
|
||||
#define OCIObjectEvent orocev
|
||||
#define OCIObjectProperty oroopr
|
||||
#define OCIPinOpt oroopo
|
||||
#define OCIRef ororef
|
||||
#define OCIRefreshOpt orooro
|
||||
#define OCITypeCode orotc
|
||||
#define OCITypeEncap orotec
|
||||
#define OCITypeGetOpt orotgo
|
||||
#define OCITypeMethodFlag orotmf
|
||||
#define OCITypeParamMode orotpm
|
||||
#define OCIObjectPropId oroopi
|
||||
#define OCIObjectLifetime oroolft
|
||||
#define OCIObjectMarkstatus oroomst
|
||||
#define OCI_LOCK_NONE OROOLMNUL
|
||||
#define OCI_LOCK_X OROOLMX
|
||||
#define OCI_LOCK_X_NOWAIT OROOLMXNW
|
||||
#define OCI_MARK_DEFAULT OROOMODFL
|
||||
#define OCI_MARK_NONE OROOMONON
|
||||
#define OCI_MARK_UPDATE OROOMOUPD
|
||||
#define OCI_OBJECTEVENT_AFTER_FLUSH OROCEVAFL
|
||||
#define OCI_OBJECTEVENT_AFTER_REFRESH OROCEVARF
|
||||
#define OCI_OBJECTEVENT_BEFORE_FLUSH OROCEVBFL
|
||||
#define OCI_OBJECTEVENT_BEFORE_REFRESH OROCEVBRF
|
||||
#define OCI_OBJECTEVENT_WHEN_LOCK OROCEVWLK
|
||||
#define OCI_OBJECTEVENT_WHEN_MARK_DELETED OROCEVWDL
|
||||
#define OCI_OBJECTEVENT_WHEN_MARK_UPDATED OROCEVWUP
|
||||
#define OCI_OBJECTEVENT_WHEN_UNMARK OROCEVWUM
|
||||
#define OCI_OBJECTPROP_DIRTIED OROOPRDRT
|
||||
#define OCI_OBJECTPROP_LOADED OROOPRLOD
|
||||
#define OCI_OBJECTPROP_LOCKED OROOPRLCK
|
||||
#define OCI_PIN_ANY OROOPOANY
|
||||
#define OCI_PIN_DEFAULT OROOPODFL
|
||||
#define OCI_PIN_LATEST OROOPOLST
|
||||
#define OCI_PIN_RECENT OROOPOREC
|
||||
#define OCI_REFRESH_LOADED OROOROLOD
|
||||
#define OCI_TYPEENCAP_PRIVATE OROTECPVT
|
||||
#define OCI_TYPEENCAP_PUBLIC OROTECPUB
|
||||
#define OCI_TYPEGET_ALL OROTGOALL
|
||||
#define OCI_TYPEGET_HEADER OROTGOHDR
|
||||
#define OCI_TYPEMETHOD_CONSTANT OROTMCON
|
||||
#define OCI_TYPEMETHOD_CONSTRUCTOR OROTMCSTR
|
||||
#define OCI_TYPEMETHOD_DESTRUCTOR OROTMDSTR
|
||||
#define OCI_TYPEMETHOD_INLINE OROTMINL
|
||||
#define OCI_TYPEMETHOD_MAP OROTMMAP
|
||||
#define OCI_TYPEMETHOD_OPERATOR OROTMOP
|
||||
#define OCI_TYPEMETHOD_ORDER OROTMOR
|
||||
#define OCI_TYPEMETHOD_RNDS OROTMRDS
|
||||
#define OCI_TYPEMETHOD_RNPS OROTMRPS
|
||||
#define OCI_TYPEMETHOD_SELFISH OROTMSLF
|
||||
#define OCI_TYPEMETHOD_VIRTUAL OROTMVRT
|
||||
#define OCI_TYPEMETHOD_WNDS OROTMWDS
|
||||
#define OCI_TYPEMETHOD_WNPS OROTMWPS
|
||||
#define OCI_TYPEMETHOD_ABSTRACT OROTMABSTRACT
|
||||
#define OCI_TYPEMETHOD_OVERRIDING OROTMOVERRIDING
|
||||
#define OCI_TYPEMETHOD_PIPELINED OROTMPIPELINED
|
||||
#define OCI_TYPEPARAM_BYREF OROTPMREF
|
||||
#define OCI_TYPEPARAM_IN OROTPMIN
|
||||
#define OCI_TYPEPARAM_INOUT OROTPMIO
|
||||
#define OCI_TYPEPARAM_OUT OROTPMOUT
|
||||
#define OCI_TYPEPARAM_OUTNCPY OROTPMOUTNCPY
|
||||
#define OCI_TYPEPARAM_INOUTNCPY OROTPMIONCPY
|
||||
|
||||
#endif /* SLSHORTNAME */
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* PUBLIC TYPES, CONSTANTS AND MACROS */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* GENERAL OBJECT TYPES, CONSTANTS, MACROS */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*------------------------- OBJECT REFERENCE (REF) --------------------------*/
|
||||
|
||||
typedef struct OCIRef OCIRef;
|
||||
/*
|
||||
* OCIRef - OCI object REFerence
|
||||
*
|
||||
* In the Oracle object runtime environment, an object is identified by an
|
||||
* object reference (ref) which contains the object identifier plus other
|
||||
* runtime information. The contents of a ref is opaque to clients. Use
|
||||
* OCIObjectNew() to construct a ref.
|
||||
*/
|
||||
|
||||
|
||||
/*--------------------------- OBJECT INDICATOR ------------------------------*/
|
||||
|
||||
typedef sb2 OCIInd;
|
||||
/*
|
||||
* OCIInd -- a variable of this type contains (null) indicator information
|
||||
*/
|
||||
|
||||
#define OCI_IND_NOTNULL (OCIInd)0 /* not NULL */
|
||||
#define OCI_IND_NULL (OCIInd)(-1) /* NULL */
|
||||
#define OCI_IND_BADNULL (OCIInd)(-2) /* BAD NULL */
|
||||
#define OCI_IND_NOTNULLABLE (OCIInd)(-3) /* not NULLable */
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* OBJECT CACHE */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/* To enable object change detection mode, set this to TRUE */
|
||||
#define OCI_ATTR_OBJECT_DETECTCHANGE 0x00000020
|
||||
|
||||
/* To enable object creation with non-NULL attributes by default, set the
|
||||
following to TRUE.
|
||||
By default, object is created with NULL attributes
|
||||
*/
|
||||
#define OCI_ATTR_OBJECT_NEWNOTNULL 0x00000010
|
||||
|
||||
/* To enable sorting of the objects that belong to the same table
|
||||
before being flushed through OCICacheFlush.
|
||||
Please note that by enabling this object cache will not be flushing
|
||||
the objects in the same order they were dirtied */
|
||||
#define OCI_ATTR_CACHE_ARRAYFLUSH 0x00000040
|
||||
|
||||
/*--------------------------- OBJECT PIN OPTION -----------------------------*/
|
||||
|
||||
enum OCIPinOpt
|
||||
{
|
||||
/* 0 = uninitialized */
|
||||
OCI_PIN_DEFAULT = 1, /* default pin option */
|
||||
OCI_PIN_ANY = 3, /* pin any copy of the object */
|
||||
OCI_PIN_RECENT = 4, /* pin recent copy of the object */
|
||||
OCI_PIN_LATEST = 5 /* pin latest copy of the object */
|
||||
};
|
||||
typedef enum OCIPinOpt OCIPinOpt;
|
||||
|
||||
/*
|
||||
* OCIPinOpt - OCI object Pin Option
|
||||
*
|
||||
* In the Oracle object runtime environment, the program has the option to
|
||||
* specify which copy of the object to pin.
|
||||
*
|
||||
* OCI_PINOPT_DEFAULT pins an object using the default pin option. The default
|
||||
* pin option can be set as an attribute of the OCI environment handle
|
||||
* (OCI_ATTR_PINTOPTION). The value of the default pin option can be
|
||||
* OCI_PINOPT_ANY, OCI_PINOPT_RECENT, or OCI_PIN_LATEST. The default option
|
||||
* is initialized to OCI_PINOPT_ANY.
|
||||
*
|
||||
* OCI_PIN_ANY pins any copy of the object. The object is pinned
|
||||
* using the following criteria:
|
||||
* If the object copy is not loaded, load it from the persistent store.
|
||||
* Otherwise, the loaded object copy is returned to the program.
|
||||
*
|
||||
* OCI_PIN_RECENT pins the latest copy of an object. The object is
|
||||
* pinned using the following criteria:
|
||||
* If the object is not loaded, load the object from the persistent store
|
||||
* from the latest version.
|
||||
* If the object is not loaded in the current transaction and it is not
|
||||
* dirtied, the object is refreshed from the latest version.
|
||||
* Otherwise, the loaded object copy is returned to the program.
|
||||
*
|
||||
* OCI_PINOPT_LATEST pins the latest copy of an object. The object copy is
|
||||
* pinned using the following criteria:
|
||||
* If the object copy is not loaded, load it from the persistent store.
|
||||
* If the object copy is loaded and dirtied, it is returned to the program.
|
||||
* Otherwise, the loaded object copy is refreshed from the persistent store.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*--------------------------- OBJECT LOCK OPTION ----------------------------*/
|
||||
|
||||
enum OCILockOpt
|
||||
{
|
||||
/* 0 = uninitialized */
|
||||
OCI_LOCK_NONE = 1, /* null (same as no lock) */
|
||||
OCI_LOCK_X = 2, /* exclusive lock */
|
||||
OCI_LOCK_X_NOWAIT = 3 /* exclusive lock, do not wait */
|
||||
};
|
||||
typedef enum OCILockOpt OCILockOpt;
|
||||
/*
|
||||
* OCILockOpt - OCI object LOCK Option
|
||||
*
|
||||
* This option is used to specify the locking preferences when an object is
|
||||
* loaded from the server.
|
||||
*/
|
||||
|
||||
|
||||
/*------------------------- OBJECT MODIFYING OPTION -------------------------*/
|
||||
|
||||
enum OCIMarkOpt
|
||||
{
|
||||
/* 0 = uninitialized */
|
||||
OCI_MARK_DEFAULT = 1, /* default (the same as OCI_MARK_NONE) */
|
||||
OCI_MARK_NONE = OCI_MARK_DEFAULT, /* object has not been modified */
|
||||
OCI_MARK_UPDATE /* object is to be updated */
|
||||
};
|
||||
typedef enum OCIMarkOpt OCIMarkOpt;
|
||||
/*
|
||||
* OCIMarkOpt - OCI object Mark option
|
||||
*
|
||||
* When the object is marked updated, the client has to specify how the
|
||||
* object is intended to be changed.
|
||||
*/
|
||||
|
||||
/*-------------------------- OBJECT Duration --------------------------------*/
|
||||
|
||||
typedef ub2 OCIDuration;
|
||||
|
||||
#define OCI_DURATION_INVALID 0xFFFF /* Invalid duration */
|
||||
#define OCI_DURATION_BEGIN (OCIDuration)10
|
||||
/* beginning sequence of duration */
|
||||
#define OCI_DURATION_NULL (OCIDuration)(OCI_DURATION_BEGIN-1)
|
||||
/* null duration */
|
||||
#define OCI_DURATION_DEFAULT (OCIDuration)(OCI_DURATION_BEGIN-2) /* default */
|
||||
#define OCI_DURATION_USER_CALLBACK (OCIDuration)(OCI_DURATION_BEGIN-3)
|
||||
#define OCI_DURATION_NEXT (OCIDuration)(OCI_DURATION_BEGIN-4)
|
||||
/* next special duration */
|
||||
#define OCI_DURATION_SESSION (OCIDuration)(OCI_DURATION_BEGIN)
|
||||
/* the end of user session */
|
||||
#define OCI_DURATION_TRANS (OCIDuration)(OCI_DURATION_BEGIN+1)
|
||||
/* the end of user transaction */
|
||||
/******************************************************************************
|
||||
** DO NOT USE OCI_DURATION_CALL. IT IS UNSUPPORTED **
|
||||
** WILL BE REMOVED/CHANGED IN A FUTURE RELEASE **
|
||||
******************************************************************************/
|
||||
#define OCI_DURATION_CALL (OCIDuration)(OCI_DURATION_BEGIN+2)
|
||||
/* the end of user client/server call */
|
||||
#define OCI_DURATION_STATEMENT (OCIDuration)(OCI_DURATION_BEGIN+3)
|
||||
|
||||
/* This is to be used only during callouts. It is similar to that
|
||||
of OCI_DURATION_CALL, but lasts only for the duration of a callout.
|
||||
Its heap is from PGA */
|
||||
#define OCI_DURATION_CALLOUT (OCIDuration)(OCI_DURATION_BEGIN+4)
|
||||
|
||||
#define OCI_DURATION_LAST OCI_DURATION_CALLOUT
|
||||
/* last of predefined durations */
|
||||
|
||||
/* This is not being treated as other predefined durations such as
|
||||
SESSION, CALL etc, because this would not have an entry in the duration
|
||||
table and its functionality is primitive such that only allocate, free,
|
||||
resize memory are allowed, but one cannot create subduration out of this
|
||||
*/
|
||||
#define OCI_DURATION_PROCESS (OCIDuration)(OCI_DURATION_BEGIN-5)
|
||||
|
||||
/*
|
||||
* OCIDuration - OCI object duration
|
||||
*
|
||||
* A client can specify the duration of which an object is pinned (pin
|
||||
* duration) and the duration of which the object is in memory (allocation
|
||||
* duration). If the objects are still pinned at the end of the pin duration,
|
||||
* the object cache manager will automatically unpin the objects for the
|
||||
* client. If the objects still exist at the end of the allocation duration,
|
||||
* the object cache manager will automatically free the objects for the client.
|
||||
*
|
||||
* Objects that are pinned with the option OCI_DURATION_TRANS will get unpinned
|
||||
* automatically at the end of the current transaction.
|
||||
*
|
||||
* Objects that are pinned with the option OCI_DURATION_SESSION will get
|
||||
* unpinned automatically at the end of the current session (connection).
|
||||
*
|
||||
* The option OCI_DURATION_NULL is used when the client does not want to set
|
||||
* the pin duration. If the object is already loaded into the cache, then the
|
||||
* pin duration will remain the same. If the object is not yet loaded, the
|
||||
* pin duration of the object will be set to OCI_DURATION_DEFAULT.
|
||||
*/
|
||||
|
||||
/*----------------------------- OBJECT PROPERTY -----------------------------*/
|
||||
|
||||
/******************************************************************************
|
||||
** DO NOT USE OCIObjectProperty. IT IS UNSUPPORTED **
|
||||
** WILL BE REMOVED/CHANGED IN A FUTURE RELEASE **
|
||||
******************************************************************************/
|
||||
enum OCIObjectProperty
|
||||
{
|
||||
/* 0 = uninitialized */
|
||||
OCI_OBJECTPROP_DIRTIED = 1, /* dirty objects */
|
||||
OCI_OBJECTPROP_LOADED, /* objects loaded in the transaction */
|
||||
OCI_OBJECTPROP_LOCKED /* locked objects */
|
||||
};
|
||||
typedef enum OCIObjectProperty OCIObjectProperty;
|
||||
/*
|
||||
* OCIObjectProperty -- OCI Object Property
|
||||
* This specifies the properties of objects in the object cache.
|
||||
*/
|
||||
|
||||
/*------------------------- CACHE REFRESH OPTION ---------------------------*/
|
||||
|
||||
enum OCIRefreshOpt
|
||||
{
|
||||
/* 0 = uninitialized */
|
||||
OCI_REFRESH_LOADED = 1 /* refresh objects loaded in the transaction */
|
||||
};
|
||||
typedef enum OCIRefreshOpt OCIRefreshOpt;
|
||||
/*
|
||||
* OCIRefreshOpt - OCI cache Refresh Option
|
||||
* This option is used to specify the set of objects to be refreshed.
|
||||
*
|
||||
* OCI_REFRESH_LOAD refreshes the objects that are loaded in the current
|
||||
* transaction.
|
||||
*/
|
||||
|
||||
/*-------------------------------- OBJECT EVENT -----------------------------*/
|
||||
|
||||
/******************************************************************************
|
||||
** DO NOT USE OCIObjectEvent. IT IS UNSUPPORTED **
|
||||
** WILL BE REMOVED/CHANGED IN A FUTURE RELEASE **
|
||||
******************************************************************************/
|
||||
enum OCIObjectEvent
|
||||
{
|
||||
/* 0 = uninitialized */
|
||||
OCI_OBJECTEVENT_BEFORE_FLUSH = 1, /* before flushing the cache */
|
||||
OCI_OBJECTEVENT_AFTER_FLUSH, /* after flushing the cache */
|
||||
OCI_OBJECTEVENT_BEFORE_REFRESH, /* before refreshing the cache */
|
||||
OCI_OBJECTEVENT_AFTER_REFRESH, /* after refreshing the cache */
|
||||
OCI_OBJECTEVENT_WHEN_MARK_UPDATED, /* when an object is marked updated */
|
||||
OCI_OBJECTEVENT_WHEN_MARK_DELETED, /* when an object is marked deleted */
|
||||
OCI_OBJECTEVENT_WHEN_UNMARK, /* when an object is being unmarked */
|
||||
OCI_OBJECTEVENT_WHEN_LOCK /* when an object is being locked */
|
||||
};
|
||||
typedef enum OCIObjectEvent OCIObjectEvent;
|
||||
/*
|
||||
* OCIObjectEvent -- OCI Object Event
|
||||
* This specifies the kind of event that is supported by the object
|
||||
* cache. The program can register a callback that is invoked when the
|
||||
* specified event occurs.
|
||||
*/
|
||||
|
||||
/*----------------------------- OBJECT COPY OPTION --------------------------*/
|
||||
#define OCI_OBJECTCOPY_NOREF (ub1)0x01
|
||||
/*
|
||||
* OCIObjectCopyFlag - Object copy flag
|
||||
*
|
||||
* If OCI_OBJECTCOPY_NOREF is specified when copying an instance, the
|
||||
* reference and lob will not be copied to the target instance.
|
||||
*/
|
||||
|
||||
/*----------------------------- OBJECT FREE OPTION --------------------------*/
|
||||
#define OCI_OBJECTFREE_FORCE (ub2)0x0001
|
||||
#define OCI_OBJECTFREE_NONULL (ub2)0x0002
|
||||
#define OCI_OBJECTFREE_HEADER (ub2)0x0004
|
||||
/*
|
||||
* OCIObjectFreeFlag - Object free flag
|
||||
*
|
||||
* If OCI_OBJECTCOPY_FORCE is specified when freeing an instance, the instance
|
||||
* is freed regardless it is pinned or diritied.
|
||||
* If OCI_OBJECTCOPY_NONULL is specified when freeing an instance, the null
|
||||
* structure is not freed.
|
||||
*/
|
||||
|
||||
/*----------------------- OBJECT PROPERTY ID -------------------------------*/
|
||||
|
||||
typedef ub1 OCIObjectPropId;
|
||||
#define OCI_OBJECTPROP_LIFETIME 1 /* persistent or transient or value */
|
||||
#define OCI_OBJECTPROP_SCHEMA 2 /* schema name of table containing object */
|
||||
#define OCI_OBJECTPROP_TABLE 3 /* table name of table containing object */
|
||||
#define OCI_OBJECTPROP_PIN_DURATION 4 /* pin duartion of object */
|
||||
#define OCI_OBJECTPROP_ALLOC_DURATION 5 /* alloc duartion of object */
|
||||
#define OCI_OBJECTPROP_LOCK 6 /* lock status of object */
|
||||
#define OCI_OBJECTPROP_MARKSTATUS 7 /* mark status of object */
|
||||
#define OCI_OBJECTPROP_VIEW 8 /* is object a view object or not? */
|
||||
|
||||
/*
|
||||
* OCIObjectPropId - OCI Object Property Id
|
||||
* Identifies the different properties of objects.
|
||||
*/
|
||||
|
||||
/*----------------------- OBJECT LIFETIME ----------------------------------*/
|
||||
|
||||
enum OCIObjectLifetime
|
||||
{
|
||||
/* 0 = uninitialized */
|
||||
OCI_OBJECT_PERSISTENT = 1, /* persistent object */
|
||||
OCI_OBJECT_TRANSIENT, /* transient object */
|
||||
OCI_OBJECT_VALUE /* value object */
|
||||
};
|
||||
typedef enum OCIObjectLifetime OCIObjectLifetime;
|
||||
/*
|
||||
* OCIObjectLifetime - OCI Object Lifetime
|
||||
* Classifies objects depending upon the lifetime and referenceability
|
||||
* of the object.
|
||||
*/
|
||||
|
||||
/*----------------------- OBJECT MARK STATUS -------------------------------*/
|
||||
|
||||
typedef uword OCIObjectMarkStatus;
|
||||
#define OCI_OBJECT_NEW 0x0001 /* new object */
|
||||
#define OCI_OBJECT_DELETED 0x0002 /* object marked deleted */
|
||||
#define OCI_OBJECT_UPDATED 0x0004 /* object marked updated */
|
||||
/*
|
||||
* OCIObjectMarkStatus - OCI Object Mark Status
|
||||
* Status of the object - new or updated or deleted
|
||||
*/
|
||||
|
||||
/* macros to test the object mark status */
|
||||
#define OCI_OBJECT_IS_UPDATED(flag) bit((flag), OCI_OBJECT_UPDATED)
|
||||
#define OCI_OBJECT_IS_DELETED(flag) bit((flag), OCI_OBJECT_DELETED)
|
||||
#define OCI_OBJECT_IS_NEW(flag) bit((flag), OCI_OBJECT_NEW)
|
||||
#define OCI_OBJECT_IS_DIRTY(flag) \
|
||||
bit((flag), OCI_OBJECT_UPDATED|OCI_OBJECT_NEW|OCI_OBJECT_DELETED)
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TYPE MANAGER */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*------------------------------ TYPE CODE ----------------------------------*/
|
||||
|
||||
/*
|
||||
* Type manager typecodes
|
||||
*
|
||||
* These are typecodes designed to be used with the type manager;
|
||||
* they also include longer, more readable versions of existing SQLT names.
|
||||
* Those types that are directly related to existing SQLT types are #define'd
|
||||
* to their SQLT equivalents.
|
||||
*
|
||||
* The type manager typecodes are designed to be useable for all OCI calls.
|
||||
* They are in the range from 192 to 320 for typecodes, so as not to conflict
|
||||
* with existing OCI SQLT typecodes (see ocidfn.h).
|
||||
*/
|
||||
|
||||
#define OCI_TYPECODE_REF SQLT_REF /* SQL/OTS OBJECT REFERENCE */
|
||||
#define OCI_TYPECODE_DATE SQLT_DAT /* SQL DATE OTS DATE */
|
||||
#define OCI_TYPECODE_SIGNED8 27 /* SQL SIGNED INTEGER(8) OTS SINT8 */
|
||||
#define OCI_TYPECODE_SIGNED16 28 /* SQL SIGNED INTEGER(16) OTS SINT16 */
|
||||
#define OCI_TYPECODE_SIGNED32 29 /* SQL SIGNED INTEGER(32) OTS SINT32 */
|
||||
#define OCI_TYPECODE_REAL 21 /* SQL REAL OTS SQL_REAL */
|
||||
#define OCI_TYPECODE_DOUBLE 22 /* SQL DOUBLE PRECISION OTS SQL_DOUBLE */
|
||||
#define OCI_TYPECODE_BFLOAT SQLT_IBFLOAT /* Binary float */
|
||||
#define OCI_TYPECODE_BDOUBLE SQLT_IBDOUBLE /* Binary double */
|
||||
#define OCI_TYPECODE_FLOAT SQLT_FLT /* SQL FLOAT(P) OTS FLOAT(P) */
|
||||
#define OCI_TYPECODE_NUMBER SQLT_NUM/* SQL NUMBER(P S) OTS NUMBER(P S) */
|
||||
#define OCI_TYPECODE_DECIMAL SQLT_PDN
|
||||
/* SQL DECIMAL(P S) OTS DECIMAL(P S) */
|
||||
#define OCI_TYPECODE_UNSIGNED8 SQLT_BIN
|
||||
/* SQL UNSIGNED INTEGER(8) OTS UINT8 */
|
||||
#define OCI_TYPECODE_UNSIGNED16 25 /* SQL UNSIGNED INTEGER(16) OTS UINT16 */
|
||||
#define OCI_TYPECODE_UNSIGNED32 26 /* SQL UNSIGNED INTEGER(32) OTS UINT32 */
|
||||
#define OCI_TYPECODE_OCTET 245 /* SQL ??? OTS OCTET */
|
||||
#define OCI_TYPECODE_SMALLINT 246 /* SQL SMALLINT OTS SMALLINT */
|
||||
#define OCI_TYPECODE_INTEGER SQLT_INT /* SQL INTEGER OTS INTEGER */
|
||||
#define OCI_TYPECODE_RAW SQLT_LVB /* SQL RAW(N) OTS RAW(N) */
|
||||
#define OCI_TYPECODE_PTR 32 /* SQL POINTER OTS POINTER */
|
||||
#define OCI_TYPECODE_VARCHAR2 SQLT_VCS
|
||||
/* SQL VARCHAR2(N) OTS SQL_VARCHAR2(N) */
|
||||
#define OCI_TYPECODE_CHAR SQLT_AFC /* SQL CHAR(N) OTS SQL_CHAR(N) */
|
||||
#define OCI_TYPECODE_VARCHAR SQLT_CHR
|
||||
/* SQL VARCHAR(N) OTS SQL_VARCHAR(N) */
|
||||
#define OCI_TYPECODE_MLSLABEL SQLT_LAB /* OTS MLSLABEL */
|
||||
#define OCI_TYPECODE_VARRAY 247 /* SQL VARRAY OTS PAGED VARRAY */
|
||||
#define OCI_TYPECODE_TABLE 248 /* SQL TABLE OTS MULTISET */
|
||||
#define OCI_TYPECODE_OBJECT SQLT_NTY /* SQL/OTS NAMED OBJECT TYPE */
|
||||
#define OCI_TYPECODE_OPAQUE 58 /* SQL/OTS Opaque Types */
|
||||
#define OCI_TYPECODE_NAMEDCOLLECTION SQLT_NCO
|
||||
/* SQL/OTS NAMED COLLECTION TYPE */
|
||||
#define OCI_TYPECODE_BLOB SQLT_BLOB /* SQL/OTS BINARY LARGE OBJECT */
|
||||
#define OCI_TYPECODE_BFILE SQLT_BFILE /* SQL/OTS BINARY FILE OBJECT */
|
||||
#define OCI_TYPECODE_CLOB SQLT_CLOB /* SQL/OTS CHARACTER LARGE OBJECT */
|
||||
#define OCI_TYPECODE_CFILE SQLT_CFILE /* SQL/OTS CHARACTER FILE OBJECT */
|
||||
|
||||
/* the following are ANSI datetime datatypes added in 8.1 */
|
||||
#define OCI_TYPECODE_TIME SQLT_TIME /* SQL/OTS TIME */
|
||||
#define OCI_TYPECODE_TIME_TZ SQLT_TIME_TZ /* SQL/OTS TIME_TZ */
|
||||
#define OCI_TYPECODE_TIMESTAMP SQLT_TIMESTAMP /* SQL/OTS TIMESTAMP */
|
||||
#define OCI_TYPECODE_TIMESTAMP_TZ SQLT_TIMESTAMP_TZ /* SQL/OTS TIMESTAMP_TZ */
|
||||
|
||||
#define OCI_TYPECODE_TIMESTAMP_LTZ SQLT_TIMESTAMP_LTZ /* TIMESTAMP_LTZ */
|
||||
|
||||
#define OCI_TYPECODE_INTERVAL_YM SQLT_INTERVAL_YM /* SQL/OTS INTRVL YR-MON */
|
||||
#define OCI_TYPECODE_INTERVAL_DS SQLT_INTERVAL_DS /* SQL/OTS INTRVL DAY-SEC */
|
||||
#define OCI_TYPECODE_UROWID SQLT_RDD /* Urowid type */
|
||||
|
||||
|
||||
#define OCI_TYPECODE_OTMFIRST 228 /* first Open Type Manager typecode */
|
||||
#define OCI_TYPECODE_OTMLAST 320 /* last OTM typecode */
|
||||
#define OCI_TYPECODE_SYSFIRST 228 /* first OTM system type (internal) */
|
||||
#define OCI_TYPECODE_SYSLAST 235 /* last OTM system type (internal) */
|
||||
#define OCI_TYPECODE_PLS_INTEGER 266 /* type code for PLS_INTEGER */
|
||||
|
||||
/* the following are PL/SQL-only internal. They should not be used */
|
||||
#define OCI_TYPECODE_ITABLE SQLT_TAB /* PLSQL indexed table */
|
||||
#define OCI_TYPECODE_RECORD SQLT_REC /* PLSQL record */
|
||||
#define OCI_TYPECODE_BOOLEAN SQLT_BOL /* PLSQL boolean */
|
||||
|
||||
/* NOTE : The following NCHAR related codes are just short forms for saying
|
||||
OCI_TYPECODE_VARCHAR2 with a charset form of SQLCS_NCHAR. These codes are
|
||||
intended for use in the OCIAnyData API only and nowhere else. */
|
||||
#define OCI_TYPECODE_NCHAR 286
|
||||
#define OCI_TYPECODE_NVARCHAR2 287
|
||||
#define OCI_TYPECODE_NCLOB 288
|
||||
|
||||
|
||||
/* To indicate absence of typecode being specified */
|
||||
#define OCI_TYPECODE_NONE 0
|
||||
/* To indicate error has to be taken from error handle - reserved for
|
||||
sqlplus use */
|
||||
#define OCI_TYPECODE_ERRHP 283
|
||||
|
||||
/* The OCITypeCode type is interchangeable with the existing SQLT type
|
||||
which is a ub2 */
|
||||
typedef ub2 OCITypeCode;
|
||||
|
||||
|
||||
/*----------------------- GET OPTIONS FOR TDO ------------------------------*/
|
||||
|
||||
enum OCITypeGetOpt
|
||||
{
|
||||
OCI_TYPEGET_HEADER,
|
||||
/* load only the header portion of the TDO when getting type */
|
||||
OCI_TYPEGET_ALL /* load all attribute and method descriptors as well */
|
||||
};
|
||||
typedef enum OCITypeGetOpt OCITypeGetOpt;
|
||||
|
||||
/*
|
||||
* OCITypeGetOpt
|
||||
*
|
||||
* This is the flag passed to OCIGetTypeArray() to indicate how the TDO is
|
||||
* going to be loaded into the object cache.
|
||||
* OCI_TYPEGET_HEADER implies that only the header portion is to be loaded
|
||||
* initially, with the rest loaded in on a 'lazy' basis. Only the header is
|
||||
* needed for PL/SQL and OCI operations. OCI_TYPEGET_ALL implies that ALL
|
||||
* the attributes and methods belonging to a TDO will be loaded into the
|
||||
* object cache in one round trip. Hence it will take much longer to execute,
|
||||
* but will ensure that no more loading needs to be done when pinning ADOs
|
||||
* etc. This is only needed if your code needs to examine and manipulate
|
||||
* attribute and method information.
|
||||
*
|
||||
* The default is OCI_TYPEGET_HEADER.
|
||||
*/
|
||||
|
||||
|
||||
/*------------------------ TYPE ENCAPSULTATION LEVEL ------------------------*/
|
||||
|
||||
enum OCITypeEncap
|
||||
{
|
||||
/* 0 = uninitialized */
|
||||
OCI_TYPEENCAP_PRIVATE, /* private: only internally visible */
|
||||
OCI_TYPEENCAP_PUBLIC /* public: visible to both internally and externally */
|
||||
};
|
||||
typedef enum OCITypeEncap OCITypeEncap;
|
||||
/*
|
||||
* OCITypeEncap - OCI Encapsulation Level
|
||||
*/
|
||||
|
||||
|
||||
/*---------------------------- TYPE METHOD FLAGS ----------------------------*/
|
||||
|
||||
enum OCITypeMethodFlag
|
||||
{
|
||||
OCI_TYPEMETHOD_INLINE = 0x0001, /* inline */
|
||||
OCI_TYPEMETHOD_CONSTANT = 0x0002, /* constant */
|
||||
OCI_TYPEMETHOD_VIRTUAL = 0x0004, /* virtual */
|
||||
OCI_TYPEMETHOD_CONSTRUCTOR = 0x0008, /* constructor */
|
||||
OCI_TYPEMETHOD_DESTRUCTOR = 0x0010, /* destructor */
|
||||
OCI_TYPEMETHOD_OPERATOR = 0x0020, /* operator */
|
||||
OCI_TYPEMETHOD_SELFISH = 0x0040, /* selfish method (generic otherwise) */
|
||||
|
||||
OCI_TYPEMETHOD_MAP = 0x0080, /* map (relative ordering) */
|
||||
OCI_TYPEMETHOD_ORDER = 0x0100, /* order (relative ordering) */
|
||||
/* OCI_TYPEMETHOD_MAP and OCI_TYPEMETHOD_ORDER are mutually exclusive */
|
||||
|
||||
OCI_TYPEMETHOD_RNDS= 0x0200, /* Read no Data State (default) */
|
||||
OCI_TYPEMETHOD_WNDS= 0x0400, /* Write no Data State */
|
||||
OCI_TYPEMETHOD_RNPS= 0x0800, /* Read no Process State */
|
||||
OCI_TYPEMETHOD_WNPS= 0x1000, /* Write no Process State */
|
||||
OCI_TYPEMETHOD_ABSTRACT = 0x2000, /* abstract (not instantiable) method */
|
||||
OCI_TYPEMETHOD_OVERRIDING = 0x4000, /* overriding method */
|
||||
OCI_TYPEMETHOD_PIPELINED = 0x8000 /* method is pipelined */
|
||||
};
|
||||
typedef enum OCITypeMethodFlag OCITypeMethodFlag;
|
||||
|
||||
/* macros to test the type method flags */
|
||||
#define OCI_METHOD_IS_INLINE(flag) bit((flag), OCI_TYPEMETHOD_INLINE)
|
||||
#define OCI_METHOD_IS_CONSTANT(flag) bit((flag), OCI_TYPEMETHOD_CONSTANT)
|
||||
#define OCI_METHOD_IS_VIRTUAL(flag) bit((flag), OCI_TYPEMETHOD_VIRTUAL)
|
||||
#define OCI_METHOD_IS_CONSTRUCTOR(flag) bit((flag), OCI_TYPEMETHOD_CONSTRUCTOR)
|
||||
#define OCI_METHOD_IS_DESTRUCTOR(flag) bit((flag), OCI_TYPEMETHOD_DESTRUCTOR)
|
||||
#define OCI_METHOD_IS_OPERATOR(flag) bit((flag), OCI_TYPEMETHOD_OPERATOR)
|
||||
#define OCI_METHOD_IS_SELFISH(flag) bit((flag), OCI_TYPEMETHOD_SELFISH)
|
||||
#define OCI_METHOD_IS_MAP(flag) bit((flag), OCI_TYPEMETHOD_MAP)
|
||||
#define OCI_METHOD_IS_ORDER(flag) bit((flag), OCI_TYPEMETHOD_ORDER)
|
||||
#define OCI_METHOD_IS_RNDS(flag) bit((flag), OCI_TYPEMETHOD_RNDS)
|
||||
#define OCI_METHOD_IS_WNDS(flag) bit((flag), OCI_TYPEMETHOD_WNDS)
|
||||
#define OCI_METHOD_IS_RNPS(flag) bit((flag), OCI_TYPEMETHOD_RNPS)
|
||||
#define OCI_METHOD_IS_WNPS(flag) bit((flag), OCI_TYPEMETHOD_WNPS)
|
||||
#define OCI_METHOD_IS_ABSTRACT(flag) bit((flag), OCI_TYPEMETHOD_ABSTRACT)
|
||||
#define OCI_METHOD_IS_OVERRIDING(flag) bit((flag), OCI_TYPEMETHOD_OVERRIDING)
|
||||
#define OCI_METHOD_IS_PIPELINED(flag) bit((flag), OCI_TYPEMETHOD_PIPELINED)
|
||||
|
||||
#define OCI_TYPEMETHOD_IS_INLINE(flag) bit((flag), OCI_TYPEMETHOD_INLINE)
|
||||
#define OCI_TYPEMETHOD_IS_CONSTANT(flag) bit((flag), OCI_TYPEMETHOD_CONSTANT)
|
||||
#define OCI_TYPEMETHOD_IS_VIRTUAL(flag) bit((flag), OCI_TYPEMETHOD_VIRTUAL)
|
||||
#define OCI_TYPEMETHOD_IS_CONSTRUCTOR(flag) \
|
||||
bit((flag), OCI_TYPEMETHOD_CONSTRUCTOR)
|
||||
#define OCI_TYPEMETHOD_IS_DESTRUCTOR(flag) \
|
||||
bit((flag), OCI_TYPEMETHOD_DESTRUCTOR)
|
||||
#define OCI_TYPEMETHOD_IS_OPERATOR(flag) bit((flag), OCI_TYPEMETHOD_OPERATOR)
|
||||
#define OCI_TYPEMETHOD_IS_SELFISH(flag) bit((flag), OCI_TYPEMETHOD_SELFISH)
|
||||
#define OCI_TYPEMETHOD_IS_MAP(flag) bit((flag), OCI_TYPEMETHOD_MAP)
|
||||
#define OCI_TYPEMETHOD_IS_ORDER(flag) bit((flag), OCI_TYPEMETHOD_ORDER)
|
||||
#define OCI_TYPEMETHOD_IS_RNDS(flag) bit((flag), OCI_TYPEMETHOD_RNDS)
|
||||
#define OCI_TYPEMETHOD_IS_WNDS(flag) bit((flag), OCI_TYPEMETHOD_WNDS)
|
||||
#define OCI_TYPEMETHOD_IS_RNPS(flag) bit((flag), OCI_TYPEMETHOD_RNPS)
|
||||
#define OCI_TYPEMETHOD_IS_WNPS(flag) bit((flag), OCI_TYPEMETHOD_WNPS)
|
||||
#define OCI_TYPEMETHOD_IS_ABSTRACT(flag) bit((flag), OCI_TYPEMETHOD_ABSTRACT)
|
||||
#define OCI_TYPEMETHOD_IS_OVERRIDING(flag) \
|
||||
bit((flag), OCI_TYPEMETHOD_OVERRIDING)
|
||||
#define OCI_TYPEMETHOD_IS_PIPELINED(flag) bit((flag), OCI_TYPEMETHOD_PIPELINED)
|
||||
|
||||
/* macros to set the type method flags */
|
||||
#define OCI_TYPEMETHOD_SET_INLINE(flag) bis((flag), OCI_TYPEMETHOD_INLINE)
|
||||
#define OCI_TYPEMETHOD_SET_CONSTANT(flag) bis((flag), OCI_TYPEMETHOD_CONSTANT)
|
||||
#define OCI_TYPEMETHOD_SET_VIRTUAL(flag) bis((flag), OCI_TYPEMETHOD_VIRTUAL)
|
||||
#define OCI_TYPEMETHOD_SET_CONSTRUCTOR(flag) \
|
||||
bis((flag), OCI_TYPEMETHOD_CONSTRUCTOR)
|
||||
#define OCI_TYPEMETHOD_SET_DESTRUCTOR(flag) \
|
||||
bis((flag), OCI_TYPEMETHOD_DESTRUCTOR)
|
||||
#define OCI_TYPEMETHOD_SET_OPERATOR(flag) bis((flag), OCI_TYPEMETHOD_OPERATOR)
|
||||
#define OCI_TYPEMETHOD_SET_SELFISH(flag) bis((flag), OCI_TYPEMETHOD_SELFISH)
|
||||
#define OCI_TYPEMETHOD_SET_MAP(flag) bis((flag), OCI_TYPEMETHOD_MAP)
|
||||
#define OCI_TYPEMETHOD_SET_ORDER(flag) bis((flag), OCI_TYPEMETHOD_ORDER)
|
||||
#define OCI_TYPEMETHOD_SET_RNDS(flag) bis((flag), OCI_TYPEMETHOD_RNDS)
|
||||
#define OCI_TYPEMETHOD_SET_WNDS(flag) bis((flag), OCI_TYPEMETHOD_WNDS)
|
||||
#define OCI_TYPEMETHOD_SET_RNPS(flag) bis((flag), OCI_TYPEMETHOD_RNPS)
|
||||
#define OCI_TYPEMETHOD_SET_WNPS(flag) bis((flag), OCI_TYPEMETHOD_WNPS)
|
||||
|
||||
/* macros to clear the type method flags */
|
||||
#define OCI_TYPEMETHOD_CLEAR_INLINE(flag) bic((flag), OCI_TYPEMETHOD_INLINE)
|
||||
#define OCI_TYPEMETHOD_CLEAR_CONSTANT(flag) \
|
||||
bic((flag), OCI_TYPEMETHOD_CONSTANT)
|
||||
#define OCI_TYPEMETHOD_CLEAR_VIRTUAL(flag) bic((flag), OCI_TYPEMETHOD_VIRTUAL)
|
||||
#define OCI_TYPEMETHOD_CLEAR_CONSTRUCTOR(flag) \
|
||||
bic((flag), OCI_TYPEMETHOD_CONSTRUCTOR)
|
||||
#define OCI_TYPEMETHOD_CLEAR_DESTRUCTOR(flag) \
|
||||
bic((flag), OCI_TYPEMETHOD_DESTRUCTOR)
|
||||
#define OCI_TYPEMETHOD_CLEAR_OPERATOR(flag) \
|
||||
bic((flag), OCI_TYPEMETHOD_OPERATOR)
|
||||
#define OCI_TYPEMETHOD_CLEAR_SELFISH(flag) bic((flag), OCI_TYPEMETHOD_SELFISH)
|
||||
#define OCI_TYPEMETHOD_CLEAR_MAP(flag) bic((flag), OCI_TYPEMETHOD_MAP)
|
||||
#define OCI_TYPEMETHOD_CLEAR_ORDER(flag) bic((flag), OCI_TYPEMETHOD_ORDER)
|
||||
#define OCI_TYPEMETHOD_CLEAR_RNDS(flag) bic((flag), OCI_TYPEMETHOD_RNDS)
|
||||
#define OCI_TYPEMETHOD_CLEAR_WNDS(flag) bic((flag), OCI_TYPEMETHOD_WNDS)
|
||||
#define OCI_TYPEMETHOD_CLEAR_RNPS(flag) bic((flag), OCI_TYPEMETHOD_RNPS)
|
||||
#define OCI_TYPEMETHOD_CLEAR_WNPS(flag) bic((flag), OCI_TYPEMETHOD_WNPS)
|
||||
|
||||
/*--------------------------- TYPE PARAMETER MODE ---------------------------*/
|
||||
|
||||
enum OCITypeParamMode
|
||||
{
|
||||
/* PL/SQL starts this from 0 */
|
||||
OCI_TYPEPARAM_IN = 0, /* in */
|
||||
OCI_TYPEPARAM_OUT, /* out */
|
||||
OCI_TYPEPARAM_INOUT, /* in-out */
|
||||
OCI_TYPEPARAM_BYREF, /* call by reference (implicitly in-out) */
|
||||
OCI_TYPEPARAM_OUTNCPY, /* OUT with NOCOPY modifier */
|
||||
OCI_TYPEPARAM_INOUTNCPY /* IN OUT with NOCOPY modifier */
|
||||
};
|
||||
typedef enum OCITypeParamMode OCITypeParamMode;
|
||||
|
||||
|
||||
/*-------------------------------- DEFAULTS ---------------------------------*/
|
||||
|
||||
/* default binary and decimal precision and scale */
|
||||
|
||||
#define OCI_NUMBER_DEFAULTPREC ((ub1)0) /* no precision specified */
|
||||
#define OCI_NUMBER_DEFAULTSCALE ((sb1)MAXSB1MINVAL)
|
||||
/* no binary/decimal scale specified */
|
||||
|
||||
/* default maximum length for varrays and vstrings (used in sql.bsq) */
|
||||
|
||||
#define OCI_VARRAY_MAXSIZE 4000
|
||||
/* default maximum number of elements for a varray */
|
||||
#define OCI_STRING_MAXLEN 4000 /* default maximum length of a vstring */
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* This set of macro is used only in beta2. They should be removed as soon as
|
||||
* PLSQL has made the changes of not using these macros.
|
||||
*/
|
||||
|
||||
/* Special duration for allocating memory only. No instance can be allocated
|
||||
* given these durations.
|
||||
*/
|
||||
#define OCICoherency OCIRefreshOpt
|
||||
#define OCI_COHERENCY_NONE (OCIRefreshOpt)2
|
||||
#define OCI_COHERENCY_NULL (OCIRefreshOpt)4
|
||||
#define OCI_COHERENCY_ALWAYS (OCIRefreshOpt)5
|
||||
|
||||
#endif /* ORO_ORACLE */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,200 @@
|
||||
/* Copyright (c) 1992, 2006, Oracle. All rights reserved. */
|
||||
|
||||
/*
|
||||
NAME
|
||||
xa.h - <one-line expansion of the name>
|
||||
DESCRIPTION
|
||||
<short description of component this file declares/defines>
|
||||
PUBLIC FUNCTION(S)
|
||||
<list of external functions declared/defined - with one-line descriptions>
|
||||
PRIVATE FUNCTION(S)
|
||||
<list of static functions defined in .c file - with one-line descriptions>
|
||||
RETURNS
|
||||
<function return values, for .c file with single function>
|
||||
NOTES
|
||||
<other useful comments, qualifications, etc.>
|
||||
|
||||
This is the public XA .h file
|
||||
|
||||
MODIFIED (MM/DD/YY)
|
||||
yohu 08/27/06 - XA/RAC project changes: XAER_AFFINITY
|
||||
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
|
||||
whe 09/01/99 - 976457:check __cplusplus for C++ code
|
||||
ntang 10/20/98 - Remove TMCACHE & TMFORCL
|
||||
abhide 08/04/97 - implement xaoforcl
|
||||
abhide 07/23/97 - XA OTS project changes
|
||||
schandra 02/20/96 - lint
|
||||
abhide 04/07/94 - merge changes from branch 1.1.710.1
|
||||
abhide 02/14/94 - Creation
|
||||
abhide 02/10/94 - Creation
|
||||
abhide 02/10/94 - Creation
|
||||
*/
|
||||
/*
|
||||
* xa.h header
|
||||
* Typed in from X/Open doc of March 13, 1990
|
||||
* Updated to Parsippany II draft, March, 1991
|
||||
* Updated to Co Review draft, 19 Sep 1991
|
||||
*/
|
||||
|
||||
#ifndef XA_H
|
||||
#define XA_H
|
||||
|
||||
|
||||
/*
|
||||
* Transaction branch identification: XID and NULLXID:
|
||||
*/
|
||||
|
||||
|
||||
#define XIDDATASIZE 128 /* size in bytes */
|
||||
#define MAXGTRIDSIZE 64 /* maximum size in bytes of gtrid */
|
||||
#define MAXBQUALSIZE 64 /* maximum size in bytes of bqual */
|
||||
struct xid_t {
|
||||
long formatID; /* format identifier */
|
||||
long gtrid_length; /* value from 1 through 64 */
|
||||
long bqual_length; /* value from 1 through 64 */
|
||||
char data[XIDDATASIZE];
|
||||
};
|
||||
typedef struct xid_t XID;
|
||||
|
||||
/*
|
||||
* A value of -1 in formatID means that the XID is null.
|
||||
*/
|
||||
/*
|
||||
* Declarations of routines by which RMs call TMs:
|
||||
*/
|
||||
|
||||
int ax_reg(int, XID *, long);
|
||||
int ax_unreg(int, long);
|
||||
/*
|
||||
* XA Switch Data Structure
|
||||
*/
|
||||
#define RMNAMESZ 32 /* length of resource manager name, */
|
||||
/* including the null terminator */
|
||||
#define MAXINFOSIZE 256 /* maximum size in bytes of xa_info strings, */
|
||||
/* including the null terminator */
|
||||
struct xa_switch_t {
|
||||
char name[RMNAMESZ]; /* name of resource manager */
|
||||
long flags; /* resource manager specific options */
|
||||
long version; /* must be 0 */
|
||||
|
||||
int (*xa_open_entry)(char *, int, long); /*xa_open function pointer*/
|
||||
int (*xa_close_entry)(char *, int, long); /*xa_close function pointer*/
|
||||
int (*xa_start_entry)(XID *, int, long); /*xa_start function pointer*/
|
||||
int (*xa_end_entry)(XID *, int, long); /*xa_end function pointer*/
|
||||
int (*xa_rollback_entry)(XID *, int, long);
|
||||
/*xa_rollback function pointer*/
|
||||
int (*xa_prepare_entry)(XID *, int, long); /*xa_prepare function pointer*/
|
||||
int (*xa_commit_entry)(XID *, int, long); /*xa_commit function pointer*/
|
||||
int (*xa_recover_entry)(XID *, long, int, long);
|
||||
/*xa_recover function pointer*/
|
||||
int (*xa_forget_entry)(XID *, int, long); /*xa_forget function pointer*/
|
||||
int (*xa_complete_entry)(int *, int *, int, long);
|
||||
};
|
||||
|
||||
/*
|
||||
* Flag definition for the RM switch
|
||||
*/
|
||||
#define TMNOFLAGS 0x00000000L /* no resource manager features
|
||||
selected */
|
||||
#define TMREGISTER 0x00000001L /* resource manager dynamically
|
||||
registers */
|
||||
#define TMNOMIGRATE 0x00000002L /* resource manager does not support
|
||||
association migration */
|
||||
#define TMUSEASYNC 0x00000004L /* resource manager supports
|
||||
asynchronous operations */
|
||||
/*
|
||||
* Flag definitions for xa_ and ax_ routines
|
||||
*/
|
||||
/* Use TMNOFLAGS, defined above, when not specifying other flags */
|
||||
#define TMASYNC 0x80000000L /* perform routine asynchronously */
|
||||
#define TMONEPHASE 0x40000000L /* caller is using one-phase commit
|
||||
optimisation */
|
||||
#define TMFAIL 0x20000000L /* dissociates caller and marks
|
||||
transaction branch rollback-only */
|
||||
#define TMNOWAIT 0x10000000L /* return if blocking condition
|
||||
exists */
|
||||
#define TMRESUME 0x08000000L /* caller is resuming association
|
||||
with suspended transaction branch */
|
||||
#define TMSUCCESS 0x04000000L /* dissociate caller from transaction
|
||||
branch */
|
||||
#define TMSUSPEND 0x02000000L /* caller is suspending, not ending,
|
||||
association */
|
||||
#define TMSTARTRSCAN 0x01000000L /* start a recovery scan */
|
||||
#define TMENDRSCAN 0x00800000L /* end a recovery scan */
|
||||
#define TMMULTIPLE 0x00400000L /* wait for any asynchronous
|
||||
operation */
|
||||
#define TMJOIN 0x00200000L /* caller is joining existing
|
||||
transaction branch */
|
||||
#define TMMIGRATE 0x00100000L /* caller intends to perform
|
||||
migration */
|
||||
|
||||
/*
|
||||
* ax_() return codes (transaction manager reports to resource manager)
|
||||
*/
|
||||
#define TM_JOIN 2 /* caller is joining existing transaction
|
||||
branch */
|
||||
#define TM_RESUME 1 /* caller is resuming association with
|
||||
suspended transaction branch */
|
||||
#define TM_OK 0 /* normal execution */
|
||||
#define TMER_TMERR -1 /* an error occurred in the transaction
|
||||
manager */
|
||||
#define TMER_INVAL -2 /* invalid arguments were given */
|
||||
#define TMER_PROTO -3 /* routine invoked in an improper context */
|
||||
|
||||
/*
|
||||
* xa_() return codes (resource manager reports to transaction manager)
|
||||
*/
|
||||
#define XA_RBBASE 100 /* The inclusive lower bound of the
|
||||
rollback codes */
|
||||
#define XA_RBROLLBACK XA_RBBASE /* The rollback was caused by an
|
||||
unspecified reason */
|
||||
#define XA_RBCOMMFAIL XA_RBBASE+1 /* The rollback was caused by a
|
||||
communication failure */
|
||||
#define XA_RBDEADLOCK XA_RBBASE+2 /* A deadlock was detected */
|
||||
#define XA_RBINTEGRITY XA_RBBASE+3 /* A condition that violates the
|
||||
integrity of the resources was
|
||||
detected */
|
||||
#define XA_RBOTHER XA_RBBASE+4 /* The resource manager rolled back the
|
||||
transaction for a reason not on this
|
||||
list */
|
||||
#define XA_RBPROTO XA_RBBASE+5 /* A protocal error occurred in the
|
||||
resource manager */
|
||||
#define XA_RBTIMEOUT XA_RBBASE+6 /* A transaction branch took too long*/
|
||||
#define XA_RBTRANSIENT XA_RBBASE+7 /* May retry the transaction branch */
|
||||
#define XA_RBEND XA_RBTRANSIENT /* The inclusive upper bound of the
|
||||
rollback codes */
|
||||
|
||||
#define XA_NOMIGRATE 9 /* resumption must occur where
|
||||
suspension occurred */
|
||||
#define XA_HEURHAZ 8 /* the transaction branch may have been
|
||||
heuristically completed */
|
||||
#define XA_HEURCOM 7 /* the transaction branch has been
|
||||
heuristically comitted */
|
||||
#define XA_HEURRB 6 /* the transaction branch has been
|
||||
heuristically rolled back */
|
||||
#define XA_HEURMIX 5 /* the transaction branch has been
|
||||
heuristically committed and rolled
|
||||
back */
|
||||
#define XA_RETRY 4 /* routine returned with no effect
|
||||
and may be re-issued */
|
||||
#define XA_RDONLY 3 /* the transaction was read-only
|
||||
and has been committed */
|
||||
#define XA_OK 0 /* normal execution */
|
||||
#define XAER_ASYNC -2 /* asynchronous operation already
|
||||
outstanding */
|
||||
#define XAER_RMERR -3 /* a resource manager error occurred
|
||||
in the transaction branch */
|
||||
#define XAER_NOTA -4 /* the XID is not valid */
|
||||
#define XAER_INVAL -5 /* invalid arguments were given */
|
||||
#define XAER_PROTO -6 /* routine invoked in an improper
|
||||
context */
|
||||
#define XAER_RMFAIL -7 /* resource manager unavailable */
|
||||
#define XAER_DUPID -8 /* the XID already exists */
|
||||
#define XAER_OUTSIDE -9 /* resource manager doing work */
|
||||
/* outside global transaction */
|
||||
|
||||
#define XAER_AFFINITY -10 /* XA on RAC: resumption must occur on
|
||||
RAC instance where the transaction
|
||||
branch was created */
|
||||
|
||||
#endif /* ifndef XA_H */
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,17 @@
|
||||
arm_container:
|
||||
image: gcc:latest
|
||||
|
||||
check_task:
|
||||
check_script:
|
||||
- wget https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2.tar.gz
|
||||
- tar xfz cmake-3.20.2.tar.gz
|
||||
- cd cmake-3.20.2
|
||||
- ./configure
|
||||
- make cmake ctest -j4
|
||||
- cd ..
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ../cmake-3.20.2/bin/cmake .. -DJSON_FastTests=ON
|
||||
- make -j4
|
||||
- cd tests
|
||||
- ../../cmake-3.20.2/bin/ctest -j4
|
||||
@ -0,0 +1,84 @@
|
||||
#AccessModifierOffset: 2
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
#AlignConsecutiveBitFields: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignConsecutiveMacros: false
|
||||
AlignEscapedNewlines: Right
|
||||
#AlignOperands: AlignAfterOperator
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
AllowAllConstructorInitializersOnNextLine: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Empty
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
#AllowShortEnumsOnASingleLine: true
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: Empty
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
#BitFieldColonSpacing: Both
|
||||
BreakBeforeBraces: Custom # or Allman
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: true
|
||||
AfterClass: true
|
||||
AfterControlStatement: Always
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: false
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterExternBlock: false
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
#BeforeLambdaBody: false
|
||||
#BeforeWhile: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: false
|
||||
SplitEmptyNamespace: false
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
BreakStringLiterals: false
|
||||
ColumnLimit: 0
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerIndentWidth: 2
|
||||
Cpp11BracedListStyle: true
|
||||
PointerAlignment: Left
|
||||
FixNamespaceComments: true
|
||||
IncludeBlocks: Preserve
|
||||
#IndentCaseBlocks: false
|
||||
IndentCaseLabels: true
|
||||
IndentGotoLabels: false
|
||||
IndentPPDirectives: BeforeHash
|
||||
IndentWidth: 4
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
ReflowComments: false
|
||||
SortIncludes: true
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceBeforeSquareBrackets: false
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 2
|
||||
SpacesInAngles: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: c++11
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
@ -0,0 +1,59 @@
|
||||
Checks: '*,
|
||||
-altera-id-dependent-backward-branch,
|
||||
-altera-struct-pack-align,
|
||||
-altera-unroll-loops,
|
||||
-android-cloexec-fopen,
|
||||
-bugprone-easily-swappable-parameters,
|
||||
-cert-err58-cpp,
|
||||
-concurrency-mt-unsafe,
|
||||
-cppcoreguidelines-avoid-const-or-ref-data-members,
|
||||
-cppcoreguidelines-avoid-do-while,
|
||||
-cppcoreguidelines-avoid-goto,
|
||||
-cppcoreguidelines-avoid-magic-numbers,
|
||||
-cppcoreguidelines-avoid-non-const-global-variables,
|
||||
-cppcoreguidelines-macro-usage,
|
||||
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
|
||||
-cppcoreguidelines-pro-bounds-constant-array-index,
|
||||
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
|
||||
-cppcoreguidelines-pro-type-reinterpret-cast,
|
||||
-cppcoreguidelines-pro-type-union-access,
|
||||
-cppcoreguidelines-virtual-class-destructor,
|
||||
-fuchsia-default-arguments-calls,
|
||||
-fuchsia-default-arguments-declarations,
|
||||
-fuchsia-overloaded-operator,
|
||||
-google-explicit-constructor,
|
||||
-google-readability-function-size,
|
||||
-google-runtime-int,
|
||||
-google-runtime-references,
|
||||
-hicpp-avoid-goto,
|
||||
-hicpp-explicit-conversions,
|
||||
-hicpp-function-size,
|
||||
-hicpp-no-array-decay,
|
||||
-hicpp-no-assembler,
|
||||
-hicpp-signed-bitwise,
|
||||
-hicpp-uppercase-literal-suffix,
|
||||
-llvm-header-guard,
|
||||
-llvm-include-order,
|
||||
-llvmlibc-*,
|
||||
-misc-confusable-identifiers,
|
||||
-misc-no-recursion,
|
||||
-misc-non-private-member-variables-in-classes,
|
||||
-modernize-concat-nested-namespaces,
|
||||
-modernize-use-nodiscard,
|
||||
-modernize-use-trailing-return-type,
|
||||
-readability-function-cognitive-complexity,
|
||||
-readability-function-size,
|
||||
-readability-identifier-length,
|
||||
-readability-magic-numbers,
|
||||
-readability-redundant-access-specifiers,
|
||||
-readability-simplify-boolean-expr,
|
||||
-readability-uppercase-literal-suffix'
|
||||
|
||||
CheckOptions:
|
||||
- key: hicpp-special-member-functions.AllowSoleDefaultDtor
|
||||
value: 1
|
||||
|
||||
WarningsAsErrors: '*'
|
||||
|
||||
#HeaderFilterRegex: '.*nlohmann.*'
|
||||
HeaderFilterRegex: '.*hpp$'
|
||||
@ -0,0 +1,6 @@
|
||||
# JSON for Modern C++ has been originally written by Niels Lohmann.
|
||||
# Since 2013 over 140 contributors have helped to improve the library.
|
||||
# This CODEOWNERS file is only to make sure that @nlohmann is requested
|
||||
# for a code review in case of a pull request.
|
||||
|
||||
* @nlohmann
|
||||
@ -0,0 +1,46 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at mail@nlohmann.me. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
@ -0,0 +1,71 @@
|
||||
[](http://issuestats.com/github/nlohmann/json) [](http://issuestats.com/github/nlohmann/json)
|
||||
|
||||
# How to contribute
|
||||
|
||||
This project started as a little excuse to exercise some of the cool new C++11 features. Over time, people actually started to use the JSON library (yey!) and started to help improve it by proposing features, finding bugs, or even fixing my mistakes. I am really [thankful](https://github.com/nlohmann/json/blob/master/README.md#thanks) for this and try to keep track of all the helpers.
|
||||
|
||||
To make it as easy as possible for you to contribute and for me to keep an overview, here are a few guidelines which should help us avoid all kinds of unnecessary work or disappointment. And of course, this document is subject to discussion, so please [create an issue](https://github.com/nlohmann/json/issues/new/choose) or a pull request if you find a way to improve it!
|
||||
|
||||
## Private reports
|
||||
|
||||
Usually, all issues are tracked publicly on [GitHub](https://github.com/nlohmann/json/issues). If you want to make a private report (e.g., for a vulnerability or to attach an example that is not meant to be published), please send an email to <mail@nlohmann.me>.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Please [create an issue](https://github.com/nlohmann/json/issues/new/choose), assuming one does not already exist, and describe your concern. Note you need a [GitHub account](https://github.com/signup/free) for this.
|
||||
|
||||
## Describe your issue
|
||||
|
||||
Clearly describe the issue:
|
||||
|
||||
- If it is a bug, please describe how to **reproduce** it. If possible, attach a complete example which demonstrates the error. Please also state what you **expected** to happen instead of the error.
|
||||
- If you propose a change or addition, try to give an **example** how the improved code could look like or how to use it.
|
||||
- If you found a compilation error, please tell us which **compiler** (version and operating system) you used and paste the (relevant part of) the error messages to the ticket.
|
||||
|
||||
Please stick to the provided issue template ([bug report](https://github.com/nlohmann/json/blob/develop/.github/ISSUE_TEMPLATE/bug.yml) if possible. For questions, feature or support requests, please [open a discussion](https://github.com/nlohmann/json/discussions/new).
|
||||
|
||||
## Files to change
|
||||
|
||||
:exclamation: Before you make any changes, note the single-header files [`single_include/nlohmann/json.hpp`](https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp) and [`single_include/nlohmann/json_fwd.hpp`](https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json_fwd.hpp) are **generated** from the source files in the [`include/nlohmann` directory](https://github.com/nlohmann/json/tree/develop/include/nlohmann). Please **do not** edit the files `single_include/nlohmann/json.hpp` and `single_include/nlohmann/json_fwd.hpp` directly, but change the `include/nlohmann` sources and regenerate the files by executing `make amalgamate`.
|
||||
|
||||
To make changes, you need to edit the following files:
|
||||
|
||||
1. [`include/nlohmann/*`](https://github.com/nlohmann/json/tree/develop/include/nlohmann) - These files are the sources of the library. Before testing or creating a pull request, execute `make amalgamate` to regenerate `single_include/nlohmann/json.hpp` and `single_include/nlohmann/json_fwd.hpp`.
|
||||
|
||||
2. [`tests/src/unit-*.cpp`](https://github.com/nlohmann/json/tree/develop/tests/src) - These files contain the [doctest](https://github.com/onqtam/doctest) unit tests which currently cover [100 %](https://coveralls.io/github/nlohmann/json) of the library's code.
|
||||
|
||||
If you add or change a feature, please also add a unit test to this file. The unit tests can be compiled and executed with
|
||||
|
||||
```sh
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake ..
|
||||
$ cmake --build .
|
||||
$ ctest
|
||||
```
|
||||
|
||||
The test cases are also executed with several different compilers on [Travis](https://travis-ci.org/nlohmann/json) once you open a pull request.
|
||||
|
||||
|
||||
## Note
|
||||
|
||||
- If you open a pull request, the code will be automatically tested with [Valgrind](http://valgrind.org)'s Memcheck tool to detect memory leaks. Please be aware that the execution with Valgrind _may_ in rare cases yield different behavior than running the code directly. This can result in failing unit tests which run successfully without Valgrind.
|
||||
- There is a Makefile target `make pretty` which runs [Artistic Style](http://astyle.sourceforge.net) to fix indentation. If possible, run it before opening the pull request. Otherwise, we shall run it afterward.
|
||||
|
||||
## Please don't
|
||||
|
||||
- The C++11 support varies between different **compilers** and versions. Please note the [list of supported compilers](https://github.com/nlohmann/json/blob/master/README.md#supported-compilers). Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with `#ifdef`s or other means.
|
||||
- Specifically, I am aware of compilation problems with **Microsoft Visual Studio** (there even is an [issue label](https://github.com/nlohmann/json/issues?utf8=✓&q=label%3A%22visual+studio%22+) for this kind of bug). I understand that even in 2016, complete C++11 support isn't there yet. But please also understand that I do not want to drop features or uglify the code just to make Microsoft's sub-standard compiler happy. The past has shown that there are ways to express the functionality such that the code compiles with the most recent MSVC - unfortunately, this is not the main objective of the project.
|
||||
- Please refrain from proposing changes that would **break [JSON](https://json.org) conformance**. If you propose a conformant extension of JSON to be supported by the library, please motivate this extension.
|
||||
- We shall not extend the library to **support comments**. There is quite some [controversy](https://www.reddit.com/r/programming/comments/4v6chu/why_json_doesnt_support_comments_douglas_crockford/) around this topic, and there were quite some [issues](https://github.com/nlohmann/json/issues/376) on this. We believe that JSON is fine without comments.
|
||||
- We do not preserve the **insertion order of object elements**. The [JSON standard](https://tools.ietf.org/html/rfc8259.html) defines objects as "an unordered collection of zero or more name/value pairs". To this end, this library does not preserve insertion order of name/value pairs. (In fact, keys will be traversed in alphabetical order as `std::map` with `std::less` is used by default.) Note this behavior conforms to the standard, and we shall not change it to any other order. If you do want to preserve the insertion order, you can specialize the object type with containers like [`tsl::ordered_map`](https://github.com/Tessil/ordered-map) or [`nlohmann::fifo_map`](https://github.com/nlohmann/fifo_map).
|
||||
|
||||
- Please do not open pull requests that address **multiple issues**.
|
||||
|
||||
## Wanted
|
||||
|
||||
The following areas really need contribution:
|
||||
|
||||
- Extending the **continuous integration** toward more exotic compilers such as Android NDK, Intel's Compiler, or the bleeding-edge versions Clang.
|
||||
- Improving the efficiency of the **JSON parser**. The current parser is implemented as a naive recursive descent parser with hand coded string handling. More sophisticated approaches like LALR parsers would be really appreciated. That said, parser generators like Bison or ANTLR do not play nice with single-header files -- I really would like to keep the parser inside the `json.hpp` header, and I am not aware of approaches similar to [`re2c`](http://re2c.org) for parsing.
|
||||
- Extending and updating existing **benchmarks** to include (the most recent version of) this library. Though efficiency is not everything, speed and memory consumption are very important characteristics for C++ developers, so having proper comparisons would be interesting.
|
||||
@ -0,0 +1,2 @@
|
||||
github: nlohmann
|
||||
custom: http://paypal.me/nlohmann
|
||||
@ -0,0 +1,93 @@
|
||||
name: Bug Report
|
||||
description: Create a bug report
|
||||
labels:
|
||||
- 'kind: bug'
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >
|
||||
Thanks for taking the time to fill out this bug report!
|
||||
|
||||
Make sure you give it a short and specific **title** so that the report
|
||||
is searchable and uniquely identifiable.
|
||||
|
||||
Note that this form is for bug reports only. Please
|
||||
[open a discussion](https://github.com/nlohmann/json/discussions/new)
|
||||
for questions, feature requests, or support requests
|
||||
- type: textarea
|
||||
id: summary
|
||||
attributes:
|
||||
label: Description
|
||||
description: >
|
||||
Please provide an abstract description of the issue to the developers,
|
||||
and why you consider it to be a bug. Please include any specific links
|
||||
to the documentation, JSON specification, or code.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: Reproduction steps
|
||||
description: >
|
||||
How do you trigger the bug? Please walk us through step by step. Be as
|
||||
specific as possible.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: results
|
||||
attributes:
|
||||
label: Expected vs. actual results
|
||||
description: >
|
||||
Please describe what you expected to happen after the steps above and
|
||||
what actually happened.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: code
|
||||
attributes:
|
||||
label: Minimal code example
|
||||
description: >
|
||||
If possible, provide a small and self-contained example that triggers
|
||||
the bug. Please understand that we cannot analyze and debug large code
|
||||
bases. Please do not paste screenshots here.
|
||||
render: Shell
|
||||
- type: textarea
|
||||
id: output
|
||||
attributes:
|
||||
label: Error messages
|
||||
description: >
|
||||
Please provide any kind of error output (compilation errors, exception
|
||||
messages, stack traces, etc.) which can help to diagnose the error.
|
||||
render: Shell
|
||||
- type: input
|
||||
id: compiler
|
||||
attributes:
|
||||
label: Compiler and operating system
|
||||
description: >
|
||||
On which operating systems and compilers have you observed the issue?
|
||||
Include as many relevant details about the environment you experienced
|
||||
the bug in. Make sure you use a
|
||||
[supported compiler](https://github.com/nlohmann/json#supported-compilers).
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: Library version
|
||||
description: >
|
||||
Which version of the library did you use? If it is a released version,
|
||||
please enter the version number (e.g., 3.11.2). Otherwise, please enter
|
||||
the commit hash. If you got the library from another source as the
|
||||
GitHub repository (e.g., via a package manager), please also state
|
||||
this.
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
id: validation
|
||||
attributes:
|
||||
label: Validation
|
||||
description: >
|
||||
Please check these additional steps:
|
||||
options:
|
||||
- label: The bug also occurs if the latest version from the [`develop`](https://github.com/nlohmann/json/tree/develop) branch is used.
|
||||
- label: I can successfully [compile and run the unit tests](https://github.com/nlohmann/json#execute-unit-tests).
|
||||
@ -0,0 +1,5 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Ask a question
|
||||
url: https://github.com/nlohmann/json/discussions
|
||||
about: Ask questions and discuss with other community members
|
||||
@ -0,0 +1,19 @@
|
||||
[Describe your pull request here. Please read the text below the line, and make sure you follow the checklist.]
|
||||
|
||||
* * *
|
||||
|
||||
## Pull request checklist
|
||||
|
||||
Read the [Contribution Guidelines](https://github.com/nlohmann/json/blob/develop/.github/CONTRIBUTING.md) for detailed information.
|
||||
|
||||
- [ ] Changes are described in the pull request, or an [existing issue is referenced](https://github.com/nlohmann/json/issues).
|
||||
- [ ] The test suite [compiles and runs](https://github.com/nlohmann/json/blob/develop/README.md#execute-unit-tests) without error.
|
||||
- [ ] [Code coverage](https://coveralls.io/github/nlohmann/json) is 100%. Test cases can be added by editing the [test suite](https://github.com/nlohmann/json/tree/develop/test/src).
|
||||
- [ ] The source code is amalgamated; that is, after making changes to the sources in the `include/nlohmann` directory, run `make amalgamate` to create the single-header files `single_include/nlohmann/json.hpp` and `single_include/nlohmann/json_fwd.hpp`. The whole process is described [here](https://github.com/nlohmann/json/blob/develop/.github/CONTRIBUTING.md#files-to-change).
|
||||
|
||||
## Please don't
|
||||
|
||||
- The C++11 support varies between different **compilers** and versions. Please note the [list of supported compilers](https://github.com/nlohmann/json/blob/master/README.md#supported-compilers). Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with `#ifdef`s or other means.
|
||||
- Specifically, I am aware of compilation problems with **Microsoft Visual Studio** (there even is an [issue label](https://github.com/nlohmann/json/issues?utf8=✓&q=label%3A%22visual+studio%22+) for this kind of bug). I understand that even in 2016, complete C++11 support isn't there yet. But please also understand that I do not want to drop features or uglify the code just to make Microsoft's sub-standard compiler happy. The past has shown that there are ways to express the functionality such that the code compiles with the most recent MSVC - unfortunately, this is not the main objective of the project.
|
||||
- Please refrain from proposing changes that would **break [JSON](https://json.org) conformance**. If you propose a conformant extension of JSON to be supported by the library, please motivate this extension.
|
||||
- Please do not open pull requests that address **multiple issues**.
|
||||
@ -0,0 +1,5 @@
|
||||
# Security Policy
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Usually, all issues are tracked publicly on [GitHub](https://github.com/nlohmann/json/issues). If you want to make a private report (e.g., for a vulnerability or to attach an example that is not meant to be published), please send an email to <mail@nlohmann.me>. You can use [this key](https://keybase.io/nlohmann/pgp_keys.asc?fingerprint=797167ae41c0a6d9232e48457f3cea63ae251b69) for encryption.
|
||||
@ -0,0 +1,19 @@
|
||||
# Configuration for sentiment-bot - https://github.com/behaviorbot/sentiment-bot
|
||||
|
||||
# *Required* toxicity threshold between 0 and .99 with the higher numbers being the most toxic
|
||||
# Anything higher than this threshold will be marked as toxic and commented on
|
||||
sentimentBotToxicityThreshold: .7
|
||||
|
||||
# *Required* Comment to reply with
|
||||
sentimentBotReplyComment: >
|
||||
Please be sure to review the [code of conduct](https://github.com/nlohmann/json/blob/develop/CODE_OF_CONDUCT.md) and be respectful of other users. cc/ @nlohmann
|
||||
|
||||
|
||||
# Configuration for request-info - https://github.com/behaviorbot/request-info
|
||||
|
||||
# *Required* Comment to reply with
|
||||
requestInfoReplyComment: >
|
||||
We would appreciate it if you could provide us with more info about this issue or pull request! Please check the [issue template](https://github.com/nlohmann/json/blob/develop/.github/ISSUE_TEMPLATE.md) and the [pull request template](https://github.com/nlohmann/json/blob/develop/.github/PULL_REQUEST_TEMPLATE.md).
|
||||
|
||||
# *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given
|
||||
requestInfoLabelToAdd: "state: needs more info"
|
||||
@ -0,0 +1,91 @@
|
||||
version: '{build}'
|
||||
|
||||
# only build PRs and commits to develop branch
|
||||
# (see https://help.appveyor.com/discussions/questions/55079-two-builds-per-commit-to-pull-request)
|
||||
branches:
|
||||
only:
|
||||
- develop
|
||||
|
||||
only_commits:
|
||||
files:
|
||||
- .github/external_ci/appveyor.yml
|
||||
- cmake/
|
||||
- include/
|
||||
- tests/
|
||||
- CMakeLists.txt
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
configuration: Debug
|
||||
platform: x86
|
||||
CXX_FLAGS: "/W4 /WX"
|
||||
CMAKE_OPTIONS: ""
|
||||
GENERATOR: Visual Studio 14 2015
|
||||
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
configuration: Release
|
||||
platform: x86
|
||||
CXX_FLAGS: "/W4 /WX"
|
||||
CMAKE_OPTIONS: ""
|
||||
GENERATOR: Visual Studio 14 2015
|
||||
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
configuration: Release
|
||||
platform: x86
|
||||
name: with_win_header
|
||||
CXX_FLAGS: "/W4 /WX"
|
||||
CMAKE_OPTIONS: ""
|
||||
GENERATOR: Visual Studio 14 2015
|
||||
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
configuration: Release
|
||||
platform: x86
|
||||
CXX_FLAGS: "/permissive- /std:c++latest /utf-8 /W4 /WX"
|
||||
CMAKE_OPTIONS: ""
|
||||
GENERATOR: Visual Studio 15 2017
|
||||
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
configuration: Release
|
||||
platform: x86
|
||||
CXX_FLAGS: "/W4 /WX"
|
||||
CMAKE_OPTIONS: "-DJSON_ImplicitConversions=OFF"
|
||||
GENERATOR: Visual Studio 16 2019
|
||||
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
configuration: Release
|
||||
platform: x64
|
||||
CXX_FLAGS: "/W4 /WX"
|
||||
CMAKE_OPTIONS: ""
|
||||
GENERATOR: Visual Studio 14 2015
|
||||
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
configuration: Release
|
||||
platform: x64
|
||||
CXX_FLAGS: "/permissive- /std:c++latest /Zc:__cplusplus /utf-8 /W4 /WX"
|
||||
CMAKE_OPTIONS: ""
|
||||
GENERATOR: Visual Studio 15 2017
|
||||
|
||||
init:
|
||||
- cmake --version
|
||||
- msbuild /version
|
||||
|
||||
install:
|
||||
- if "%platform%"=="x86" set GENERATOR_PLATFORM=Win32
|
||||
|
||||
before_build:
|
||||
# for with_win_header build, inject the inclusion of Windows.h to the single-header library
|
||||
- ps: if ($env:name -Eq "with_win_header") { $header_path = "single_include\nlohmann\json.hpp" }
|
||||
- ps: if ($env:name -Eq "with_win_header") { "#include <Windows.h>`n" + (Get-Content $header_path | Out-String) | Set-Content $header_path }
|
||||
- cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On "%CMAKE_OPTIONS%"
|
||||
|
||||
build_script:
|
||||
- cmake --build . --config "%configuration%" --parallel 2
|
||||
|
||||
test_script:
|
||||
- if "%configuration%"=="Release" ctest -C "%configuration%" --parallel 2 --output-on-failure
|
||||
# On Debug builds, skip test-unicode_all
|
||||
# as it is extremely slow to run and cause
|
||||
# occasional timeouts on AppVeyor.
|
||||
# More info: https://github.com/nlohmann/json/pull/1570
|
||||
- if "%configuration%"=="Debug" ctest --exclude-regex "test-unicode" -C "%configuration%" --parallel 2 --output-on-failure
|
||||
@ -0,0 +1,38 @@
|
||||
version: 1
|
||||
|
||||
labels:
|
||||
- label: "documentation"
|
||||
files:
|
||||
- "README.md"
|
||||
|
||||
- label: "documentation"
|
||||
files:
|
||||
- "docs/.*"
|
||||
|
||||
- label: "tests"
|
||||
files:
|
||||
- "tests/.*"
|
||||
|
||||
- label: "CMake"
|
||||
files:
|
||||
- ".*CMakeLists.txt"
|
||||
|
||||
- label: "CMake"
|
||||
files:
|
||||
- "cmake/.*"
|
||||
|
||||
- label: "CI"
|
||||
files:
|
||||
- "github/workflows/.*"
|
||||
|
||||
- label: "CI"
|
||||
files:
|
||||
- "github/external_ci/.*"
|
||||
|
||||
- label: "S"
|
||||
size-below: 10
|
||||
- label: "M"
|
||||
size-above: 9
|
||||
size-below: 100
|
||||
- label: "L"
|
||||
size-above: 100
|
||||
@ -0,0 +1,17 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 30
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- security
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: "state: stale"
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
@ -0,0 +1,70 @@
|
||||
name: "Check amalgamation"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
save:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Save PR number
|
||||
run: |
|
||||
mkdir -p ./pr
|
||||
echo ${{ github.event.number }} > ./pr/number
|
||||
echo ${{ github.event.pull_request.user.login }} > ./pr/author
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: pr
|
||||
path: pr/
|
||||
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
MAIN_DIR: ${{ github.workspace }}/main
|
||||
INCLUDE_DIR: ${{ github.workspace }}/main/single_include/nlohmann
|
||||
TOOL_DIR: ${{ github.workspace }}/tools/tools/amalgamate
|
||||
ASTYLE_FLAGS: >
|
||||
--style=allman --indent=spaces=4 --indent-modifiers --indent-switches --indent-preproc-block
|
||||
--indent-preproc-define --indent-col1-comments --pad-oper --pad-header --align-pointer=type
|
||||
--align-reference=type --add-brackets --convert-tabs --close-templates --lineend=linux --preserve-date
|
||||
--formatted
|
||||
|
||||
steps:
|
||||
- name: Checkout pull request
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: main
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Checkout tools
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: tools
|
||||
ref: develop
|
||||
|
||||
- name: Install astyle
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install astyle
|
||||
|
||||
- name: Check amalgamation
|
||||
run: |
|
||||
cd $MAIN_DIR
|
||||
|
||||
rm -fr $INCLUDE_DIR/json.hpp~ $INCLUDE_DIR/json_fwd.hpp~
|
||||
cp $INCLUDE_DIR/json.hpp $INCLUDE_DIR/json.hpp~
|
||||
cp $INCLUDE_DIR/json_fwd.hpp $INCLUDE_DIR/json_fwd.hpp~
|
||||
|
||||
python3 $TOOL_DIR/amalgamate.py -c $TOOL_DIR/config_json.json -s .
|
||||
python3 $TOOL_DIR/amalgamate.py -c $TOOL_DIR/config_json_fwd.json -s .
|
||||
echo "Format (1)"
|
||||
astyle $ASTYLE_FLAGS --suffix=none --quiet $INCLUDE_DIR/json.hpp $INCLUDE_DIR/json_fwd.hpp
|
||||
|
||||
diff $INCLUDE_DIR/json.hpp~ $INCLUDE_DIR/json.hpp
|
||||
diff $INCLUDE_DIR/json_fwd.hpp~ $INCLUDE_DIR/json_fwd.hpp
|
||||
|
||||
astyle $ASTYLE_FLAGS $(find docs/examples include tests -type f \( -name '*.hpp' -o -name '*.cpp' -o -name '*.cu' \) -not -path 'tests/thirdparty/*' -not -path 'tests/abi/include/nlohmann/*' | sort)
|
||||
echo Check
|
||||
find $MAIN_DIR -name '*.orig' -exec false {} \+
|
||||
@ -0,0 +1,30 @@
|
||||
name: CIFuzz
|
||||
on: [pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
Fuzzing:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Build Fuzzers
|
||||
id: build
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'json'
|
||||
dry-run: false
|
||||
language: c++
|
||||
- name: Run Fuzzers
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'json'
|
||||
fuzz-seconds: 300
|
||||
dry-run: false
|
||||
language: c++
|
||||
- name: Upload Crash
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure() && steps.build.outcome == 'success'
|
||||
with:
|
||||
name: artifacts
|
||||
path: ./out/artifacts
|
||||
@ -0,0 +1,42 @@
|
||||
name: "Code scanning - action"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- master
|
||||
- release/*
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '0 19 * * 1'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
security-events: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
@ -0,0 +1,75 @@
|
||||
name: Comment Check Amalgamation
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Check amalgamation"]
|
||||
types:
|
||||
- completed
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
issues: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: 'Download artifact'
|
||||
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
|
||||
with:
|
||||
script: |
|
||||
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
run_id: ${{github.event.workflow_run.id }},
|
||||
});
|
||||
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
|
||||
return artifact.name == "pr"
|
||||
})[0];
|
||||
var download = await github.rest.actions.downloadArtifact({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
artifact_id: matchArtifact.id,
|
||||
archive_format: 'zip',
|
||||
});
|
||||
var fs = require('fs');
|
||||
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
|
||||
- run: unzip pr.zip
|
||||
|
||||
- name: 'Comment on PR'
|
||||
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
var fs = require('fs');
|
||||
const author = fs.readFileSync('./author')
|
||||
const issue_number = Number(fs.readFileSync('./number'));
|
||||
const opts = github.rest.issues.listForRepo.endpoint.merge({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
creator: author,
|
||||
state: 'all'
|
||||
})
|
||||
let first = true
|
||||
const issues = await github.paginate(opts)
|
||||
for (const issue of issues) {
|
||||
if (issue.number === issue_number) {
|
||||
continue
|
||||
}
|
||||
if (issue.pull_request) {
|
||||
first = false
|
||||
break
|
||||
}
|
||||
}
|
||||
await github.rest.issues.createComment({
|
||||
issue_number: issue_number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: '## 🔴 Amalgamation check failed! 🔴\nThe source code has not been amalgamated.'
|
||||
+ (first ? ' @' + author + ' Please read and follow the [Contribution Guidelines]'
|
||||
+ '(https://github.com/nlohmann/json/blob/develop/.github/CONTRIBUTING.md#files-to-change).'
|
||||
: '')
|
||||
})
|
||||
@ -0,0 +1,20 @@
|
||||
name: "Pull Request Labeler"
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, synchronize]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
label:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: srvaroa/labeler@master
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
@ -0,0 +1,67 @@
|
||||
name: macOS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- master
|
||||
- release/*
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
xcode_1:
|
||||
runs-on: macos-11
|
||||
strategy:
|
||||
matrix:
|
||||
xcode: ['11.7', '12.4', '12.5.1', '13.0']
|
||||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run CMake
|
||||
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
|
||||
- name: Build
|
||||
run: cmake --build build --parallel 10
|
||||
- name: Test
|
||||
run: cd build ; ctest -j 10 --output-on-failure
|
||||
|
||||
xcode_2:
|
||||
runs-on: macos-12
|
||||
strategy:
|
||||
matrix:
|
||||
xcode: ['13.1', '13.2.1', '13.3.1', '13.4.1', '14.0', '14.0.1', '14.1']
|
||||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run CMake
|
||||
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
|
||||
- name: Build
|
||||
run: cmake --build build --parallel 10
|
||||
- name: Test
|
||||
run: cd build ; ctest -j 10 --output-on-failure
|
||||
|
||||
xcode_standards:
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
standard: [11, 14, 17, 20]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run CMake
|
||||
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_TestStandards=${{ matrix.standard }}
|
||||
- name: Build
|
||||
run: cmake --build build --parallel 10
|
||||
- name: Test
|
||||
run: cd build ; ctest -j 10 --output-on-failure
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue