Create Application

To create an application using API-DIO(LNX), create the application as follows for each language.

Please do not edit the header file and definition module.

■gcc

- Copy the API-DIO(LNX) C header file (cdio/samples/inc/cdio.h) to the directory containing the program to be created.

- Include the header file in the source code.

Description example :

#include "cdio.h"

- Link with the linker option at compile time.

Description example :

gcc -Wall filename.c -o filename -lcdio
                                              ~~~~

For more information, refer to the sample program source code, Makefile, and so on.
 

■Python

Module include

- External function library module

To call the functions in our shared library with Python program, the external function library module (ctypes) is required.
Therefore, import the external function library module in the source code.

Description example :

import ctypes

- API-DIO(LNX) definition module

To use the API-DIO(LNX) functions in Python, the cdio.Py file is required.
Copy the API-DIO(LNX) definition module (cdio/samples/inc/cdio.py) to the directory containing the program to be created.
Import the API-DIO(LNX) definition module in the source code.

Description example :

import cdio
 

Program execution

The description for executing program is as follows.

Description example (When executing the inout sample in Python 3.10) :

python3.10 inout.py

For more information, refer to the sample program source code.