Understanding the C interface

Available on Windows and Unix, Synergy DBL’s C interface enables you to add user-designed C and Assembly routines to your Synergy application by building a Windows DLL or Unix shared object that contains your C routines. (The Synergy DBL C interface is not needed on OpenVMS, because on OpenVMS, you can simply write a routine in C, compile it, link it into your program, and call it directly from your Synergy code without doing anything special.)

Important

All data and routine access is accomplished with the Synergy DBL C interface routines. Any other routine or data access is not supported.

The runtime object code is distributed and can be linked at your site. Parts of the runtime are distributed as object modules; other parts are distributed as object libraries.

Synergy DBL distributions have a default runtime that contains all Synergy DBL system-supplied external subroutines. Any C routines that you include in your DLL or shared object can also access interface functions in the runtime. See Runtime interface functions for a list of the runtime interface functions you can access.

You must include the file xcall.h at the beginning of your C routine. For example:

#include "xcall.h"

The xcall.h file defines the following typedefs:

DESCRIP

Synergy DBL data descriptor

SEGENTRY

Synergy DBL routine access structure

MEMENTRY

C routine access structure

GBLENTRY

Global data access structure

DBL_CSTAT

Synergy DBL channel status structure

Because xcall.h may change between releases, we recommend that you recompile and relink your C routines.

The following routines can be called from a C language routine on OpenVMS. They are described further in the xcallv.h file that came with your Synergy DBL distribution:

dblerror

Issue a Synergy DBL error.

dscr_to_cstr

Load a string into a field.

str_to_dscr

Get a subroutine argument as a null-terminated string.

dscr_to_int

Get a subroutine argument as a value.

dscr_to_dscr

Do a Synergy DBL store operation.

int_to_dscr

Load an integer value into a field.