Skip to content

Commit a41f447

Browse files
Improved documentation and code comments.
1 parent a098466 commit a41f447

File tree

7 files changed

+97
-58
lines changed

7 files changed

+97
-58
lines changed

doc/src/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44
#------------------------------------------------------------------------------
5-
# Copyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.
5+
# Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved.
66
# This program is free software: you can modify it and/or redistribute it
77
# under the terms of:
88
#
@@ -18,12 +18,12 @@
1818
# the suffix used for all source files
1919
source_suffix = '.rst'
2020

21-
# the name of the master document
21+
# the name of the main document
2222
master_doc = 'index'
2323

2424
# general information about the project
2525
project = 'ODPI-C'
26-
copyright = '2016, 2019, Oracle and/or its affiliates. All rights reserved.'
26+
copyright = '2016, 2020, Oracle and/or its affiliates. All rights reserved.'
2727
author = 'Oracle'
2828

2929
# the version info for the project, acts as replacement for |version| and

doc/src/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. ODPI-C documentation master file.
1+
.. ODPI-C documentation main file.
22
33
Welcome to ODPI-C's |release| documentation!
44
============================================

doc/src/installation.rst

Lines changed: 87 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,10 @@ To run ODPI-C applications with Oracle Instant Client zip files:
185185
``sqlnet.ora`` or ``oraaccess.xml``, put the files in an accessible
186186
directory. Then set the member
187187
:member:`dpiContextCreateParams.oracleClientConfigDir` when calling
188-
:func:`dpiContext_createWithParams()`, or set the environment variable
189-
``TNS_ADMIN`` to that directory name.
188+
:func:`dpiContext_createWithParams()`.
189+
190+
Alternatively, set the environment variable ``TNS_ADMIN`` to that directory
191+
name.
190192

191193
Alternatively, create a ``network/admin`` subdirectory of Instant Client, if
192194
it does not exist. For example::
@@ -248,8 +250,10 @@ To run ODPI-C applications with Oracle Instant Client RPMs:
248250
``sqlnet.ora`` or ``oraaccess.xml``, put the files in an accessible
249251
directory. Then set the member
250252
:member:`dpiContextCreateParams.oracleClientConfigDir` when calling
251-
:func:`dpiContext_createWithParams()`, or set the environment variable
252-
``TNS_ADMIN`` to that directory name.
253+
:func:`dpiContext_createWithParams()`.
254+
255+
Alternatively, set the environment variable ``TNS_ADMIN`` to that directory
256+
name.
253257

254258
Alternatively, create a ``network/admin`` subdirectory of Instant Client, if
255259
it does not exist. For example::
@@ -348,42 +352,46 @@ To run ODPI-C applications with Oracle Instant Client zip files:
348352
``instantclient-basic-windows.x64-19.6.0.0.0dbru.zip`` to
349353
``C:\oracle\instantclient_19_6``.
350354

351-
3. Either set this directory in the member
352-
:member:`dpiContextCreateParams.oracleClientLibDir` when calling
353-
:func:`dpiContext_createWithParams()`, or do the following.
355+
3. There are several alternative ways to tell your application where your Oracle
356+
Instant Client libraries are.
354357

355-
Add this directory to the ``PATH`` environment variable. For example, on
356-
Windows 7, update ``PATH`` in Control Panel -> System -> Advanced System
357-
Settings -> Advanced -> Environment Variables -> System Variables -> PATH.
358-
The Instant Client directory must occur in ``PATH`` before any other Oracle
359-
directories.
358+
* Set this directory in the member
359+
:member:`dpiContextCreateParams.oracleClientLibDir` when calling
360+
:func:`dpiContext_createWithParams()`.
360361

361-
Restart any open command prompt windows.
362+
* Alternatively, move the unzipped Instant Client files to the same
363+
directory as the ODPIC.DLL (or into the directory of the application's
364+
binary, if ODPI-C is compiled into the application).
365+
366+
* Alternatively, add the Instant Client directory to the ``PATH``
367+
environment variable. For example, on Windows 7, update ``PATH`` in
368+
Control Panel -> System -> Advanced System Settings -> Advanced ->
369+
Environment Variables -> System Variables -> PATH. The Instant Client
370+
directory must occur in ``PATH`` before any other Oracle directories.
362371

363-
To avoid interfering with existing tools that require other Oracle
364-
Client versions, instead of updating the system-wide ``PATH`` variable, you
365-
may prefer to write a batch file that sets ``PATH``, for example::
372+
Restart any open command prompt windows.
366373

367-
REM mywrapper.bat
368-
SET PATH=C:\oracle\instantclient_19_6;%PATH%
369-
myapp %*
374+
To avoid interfering with existing tools that require other Oracle Client
375+
versions, instead of updating the system-wide ``PATH`` variable, you may
376+
prefer to write a batch file that sets ``PATH``, for example::
370377

371-
Invoke this batch file everytime you want to run your application.
378+
REM mywrapper.bat
379+
SET PATH=C:\oracle\instantclient_19_6;%PATH%
380+
myapp %*
372381

373-
Alternatively use ``SET`` to change your ``PATH`` in each command
374-
prompt window before you run python.
382+
Invoke this batch file every time you want to run your application.
375383

376-
Another option is to move the unzipped Instant Client files to the
377-
same directory as the ODPIC.DLL (or into the directory of the
378-
application's binary, if ODPI-C is compiled into application). If
379-
you do this, then ``PATH`` does not need to be set.
384+
Or simply use ``SET`` to change your ``PATH`` in each command prompt window
385+
before you run your application.
380386

381387
4. If you use optional Oracle configuration files such as ``tnsnames.ora``,
382388
``sqlnet.ora`` or ``oraaccess.xml``, put the files in an accessible
383389
directory. Then set the member
384390
:member:`dpiContextCreateParams.oracleClientConfigDir` when calling
385-
:func:`dpiContext_createWithParams()`, or set the environment variable
386-
``TNS_ADMIN`` to that directory name.
391+
:func:`dpiContext_createWithParams()`.
392+
393+
Alternatively, set the environment variable ``TNS_ADMIN`` to that directory
394+
name.
387395

388396
Alternatively, create a ``network\admin`` subdirectory of Instant Client, if
389397
it does not exist. For example ``C:\oracle\instantclient_19_6\network\admin``.
@@ -445,42 +453,72 @@ To run ODPI-C applications with Oracle Instant Client zip files:
445453
application architecture. Most applications use 64-bit.
446454

447455
2. Unzip the package into a single directory that is accessible to your
448-
application. For example, in Terminal you could unzip in your home directory::
456+
application. For example, in Terminal you could unzip:
457+
458+
.. code-block:: shell
449459
450-
cd ~
451-
unzip instantclient-basic-macos.x64-19.3.0.0.0dbru.zip
460+
mkdir /opt/oracle
461+
cd /opt/oracle
462+
unzip /your/path/to/instantclient-basic-macos.x64-19.3.0.0.0dbru.zip
463+
464+
3. There are several alternative ways to tell your application where your Oracle
465+
Instant Client libraries are.
466+
467+
* Use the extracted directory for the member
468+
:member:`dpiContextCreateParams.oracleClientLibDir` in a call to
469+
:func:`dpiContext_createWithParams()`
470+
471+
* Alternatively, copy Oracle Instant Client to the directory containing the
472+
ODPI-C module binary. For example, if ``libodpic.dylib`` (or your binary
473+
containing the ODPI-C code) is in ``~/myprograms`` you can then run ``ln -s
474+
~/instantclient_19_3/libclntsh.dylib ~/myprograms``. You can also copy the
475+
Instant Client libraries to that directory.
476+
477+
* Alternatively, set ``DYLD_LIBRARY_PATH`` to the Instant Client directory. Note this
478+
variable does not propagate to sub-shells.
479+
480+
* Alternatively, you might decide to compile the ODPI-C library with an RPATH
481+
option like ``-Wl,-rpath,/usr/local/lib``. Then you can link Oracle
482+
Instant Client to this directory, for example::
452483

453-
3. Either use this directory as the member
454-
:member:`dpiContextCreateParams.oracleClientLibDir` is specified when calling
455-
:func:`dpiContext_createWithParams()`, or do the following.
484+
ln -s /opt/oracle/instantclient_19_3/libclntsh.dylib /usr/local/lib/
456485

457-
Add a link to ``$HOME/lib`` or ``/usr/local/lib`` to enable applications to
458-
find Instant Client. If the ``lib`` sub-directory does not exist, you can
459-
create it. For example::
486+
Or, instead of a link you can copy the required OCI libraries. For example::
460487

461-
mkdir ~/lib
462-
ln -s ~/instantclient_19_3/libclntsh.dylib ~/lib/
488+
cp /opt/oracle/instantclient_19_3/{libclntsh.dylib.19.1,libclntshcore.dylib.19.1,libons.dylib,libnnz12.dylib,libociei.dylib} /usr/local/lib/
463489

464-
If you now run ``ls -l ~/lib/libclntsh.dylib`` you will see something like::
490+
* Alternatively, on older versions of macOS, you could add a link to
491+
``$HOME/lib`` or ``/usr/local/lib`` to enable applications to find Instant
492+
Client. If the ``lib`` sub-directory does not exist, you can create
493+
it. For example:
465494

466-
lrwxr-xr-x 1 yourname staff 48 12 Nov 15:04 /Users/yourname/lib/libclntsh.dylib -> /Users/yourname/instantclient_19_3/libclntsh.dylib
495+
.. code-block:: shell
467496
468-
Alternatively, copy the required OCI libraries. For example::
497+
mkdir ~/lib
498+
ln -s ~/instantclient_19_3/libclntsh.dylib ~/lib/
469499
470-
mkdir ~/lib
471-
cp ~/instantclient_19_3/{libclntsh.dylib.19.1,libclntshcore.dylib.19.1,libons.dylib,libnnz12.dylib,libociei.dylib} ~/lib/
500+
Instead of linking, you can copy the required OCI libraries. For example:
472501

473-
For Instant Client 11.2, the OCI libraries must be copied. For example::
502+
.. code-block:: shell
474503
475-
mkdir ~/lib
476-
cp ~/instantclient_11_2/{libclntsh.dylib.11.1,libnnz11.dylib,libociei.dylib} ~/lib/
504+
mkdir ~/lib
505+
cp ~/instantclient_19_3/{libclntsh.dylib.19.1,libclntshcore.dylib.19.1,libnnz19.dylib,libociei.dylib} ~/lib/
506+
507+
For Instant Client 11.2, the OCI libraries must be copied. For example:
508+
509+
.. code-block:: shell
510+
511+
mkdir ~/lib
512+
cp ~/instantclient_11_2/{libclntsh.dylib.11.1,libnnz11.dylib,libociei.dylib} ~/lib/
477513
478514
4. If you use optional Oracle configuration files such as ``tnsnames.ora``,
479515
``sqlnet.ora`` or ``oraaccess.xml``, put the files in an accessible
480516
directory. Then set the member
481517
:member:`dpiContextCreateParams.oracleClientConfigDir` when calling
482-
:func:`dpiContext_createWithParams()`, or set the environment variable
483-
``TNS_ADMIN`` to that directory name.
518+
:func:`dpiContext_createWithParams()`.
519+
520+
Alternatively, set the environment variable ``TNS_ADMIN`` to that directory
521+
name.
484522

485523
Alternatively, create a ``network/admin`` subdirectory of Instant Client, if
486524
it does not exist. For example::

doc/src/releasenotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Version 4.0.2 (TBD)
66

77
#) Adjusted check for GNU version of strerror_r() on Cygwin as suggested
88
(`issue 138 <https://github.com/oracle/odpi/issues/138>`__).
9+
#) Improved documentation.
910

1011

1112
Version 4.0.1 (June 26, 2020)

include/dpi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
//-----------------------------------------------------------------------------
1313
// dpi.h
14-
// Master include file for ODPI-C library.
14+
// Include file for users of the ODPI-C library.
1515
//-----------------------------------------------------------------------------
1616

1717
#ifndef DPI_PUBLIC

src/dpiImpl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
//-----------------------------------------------------------------------------
1313
// dpiImpl.h
14-
// Master include file for implementation of ODPI-C library. The definitions
15-
// in this file are subject to change without warning. Only the definitions in
16-
// the file dpi.h are intended to be used publicly.
14+
// Include file for implementation of ODPI-C library. The definitions in this
15+
// file are subject to change without warning. Only the definitions in the file
16+
// dpi.h are intended to be used publicly.
1717
//-----------------------------------------------------------------------------
1818

1919
#ifndef DPI_IMPL

src/dpiSodaDb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ int dpiSodaDb_createCollection(dpiSodaDb *db, const char *name,
197197
//-----------------------------------------------------------------------------
198198
// dpiSodaDb_createDocument() [PUBLIC]
199199
// Create a SODA document that can be inserted in the collection or can be
200-
// used to replace and existing document in the collection.
200+
// used to replace an existing document in the collection.
201201
//-----------------------------------------------------------------------------
202202
int dpiSodaDb_createDocument(dpiSodaDb *db, const char *key,
203203
uint32_t keyLength, const char *content, uint32_t contentLength,

0 commit comments

Comments
 (0)