C API

See also:
- C API Changes for Release 0.9.0
- C API Changes for Release 0.9.3
- C API Changes for Release 0.9.5
- C API Changes for Release 0.9.8
- C API Changes for Release 0.9.9 - C API Changes for Release 1.0.0

Naming

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

Installation

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

  Header File Name   Contains
 ddcutil_types.h  typedefs, structs, enums, etc.
 ddcutil_c_api.h  API functions
 ddcutil_status_codes.h  ddcutil specific status codes
 ddcutil_macros.h  macros to specify ddcutil version at compile time


The API is exposed 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.


Documentation

C API documentation:
- The header files contain extensive documentation.
- Doxygen documentation can be generated (if Doxygen is installed) using scripts in the doxydoc directory. However, I think you'll find the comments in the header files and sample code easier to use.

Sample programs are found in directory src/sample_clients:

  Source file   Contents
 demo_capabilities.c   Query monitor capabilities string
 demo_display_selection.c   Select display
 demo_feature_list.c   Using DDCA_Feature_List
 demo_get_set_vcp.c   Read and write VCP feature values
 demo_global_settings.c   Query and change global settings
 demo_profile_features.c   Save and restore color profile related features
 demo_redirection.c   Capture program output
 demo_vcpinfo.c   Query VCP feature metadata

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