API

As of release 0.7.4, the C API underwent significant changes to regularize naming and better align with internal changes.

Not all ddcutil facilities are yet exposed in the C API.

The Python API is at proof of concept stage and is subject to major changes. Because these facilities are still in rapid development, library versioning has not yet been turned on.

If you are using the APIs, please contact ddcutil's author (rockowitz@minsoft.com>), both because your input on the API would be helpful and also so I can alert you of upcoming changes.

C API

Symbol names begin with "ddca_" or "DDCA_" (for DDCutil Api).

Header files are located in the src/public directory. They are normally installed to /usr/include or /usr/local/include.

Implemented using shared library libddcutil.so. Note that the command line version of ddcutil does not itself use the shared library, but instead links all services statically.

Installation (make install, package install) installs a Package Config file (ddcutil.pc).

Installation also saves a cmake file (FindDDCUtil.cmake) in directory /usr/share/ddcutil/data (or /usr/local/share/ddcutil/data if appropriate). To use this file, copy it to /usr/share/cmake/Modules.

C API documentation:

  • The header files contain extensive documentation.

  • Doxygen generated documentation may exist. However, I think you'll find the comments in the header files and sample code more informative.

configure options relating to the C API:

  • --enable-lib Build shared library. Required for API use.
  • --enable-doxygen Generate C API documentation using Doxygen (if it is installed). Note the are numerous options beginning with "--enable-doxygen-" to tailer Doxygen execution.
Option Function
--enable-lib Build shared library. Required for the C API
--enable-doxygen Generate C API documentation using Doxygen (if it is installed).

Note that there are numerous additional options beginning with "--enable-doxygen-" for tailoring Doxygen execution.

Sample programs are found in directory src/sample_programs:

Source file Contents
demo_global_settings.c Query and change global settings
demo_display_selection.c Select display
demo_vcpinfo.c Query VCP metadata
demo_get_set_vcp.c Read and write VCP feature values

To build the sample client programs, issue the command make check.

Python API

Symbol names begin with "ddcs_" or "DDCS_" (for DDCutil Swig).

Currently Python 2.7 only.

Generated files: - _ddc_swig.so - ddc_swig.py

Normally installed to ${pkgexecdir}/dist-packages ??

Issue: Depending on $(prefix) value, make install will install these files to ... If installed to /usr/local... python will not mormally see these files. Directory ... must be added to the Python path. This can be done in one several ways: - Modify PYTHONPATH globally. See generatd fragment src/swig/... - Modify PYTHONPATH for a single Python invocation. See generated script src/swig/... - Modify PTYHONPATH within a Python script. See commented out lines in sample script src/swig/test_swig.py

For a fuller discussion on modifying PYTHONPATH, see http://ask.xmodulo.com/change-syspath-pythonpath-python.html.

Vestigial GObject API

A vestigial proof of concept for impelmenting scripting language support using GObject instrospection remains in subidrectory src/gobject_api, pending removal from the source tree. Building this code is controlled by configuration options --enable-gobject-api and --enable-introspection. These options should be left disabled.