Create Application

To create an application using API-SMC(LNX), create the application as follows for each language.
Please do not edit the header file and definition module.

■gcc

- Copy the API-SMC(LNX) C header file (csmc/samples/inc/csmc.h) to the directory containing the program to be created.
- Include the header file in the source code.

Description example :

#include "csmc.h"

- Link with the linker option at compile time.

Description example :

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

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-SMC(LNX) definition module

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

Description example :

import csmc
 

Program execution

The description for executing program is as follows.

Description example (When executing the status sample in Python 3.8) :

python3.8 status.py

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