C Programmer’s Checklist

Developers of EMS C programs can use this checklist during the five phases of the development cycle.

Install

Install the EMS software release, which includes the EMS client libraries, binaries, and header files.

Code

Application programs must:

  • Add EMS_HOME/include to the include path.
  • Include the tibems.h header file:
        #include <tibems/tibems.h>
  • Programs that use the C administration API must also include the emsadmin.h header file:
        #include <tibems/emsadmin.h>
  • Programs that use the unshared state failover API must also include the tibufo.h header file:
        #include <tibems/tibufo.h>
  • Call tibems_Open() to initialize the EMS C API and tibems_Close() to deallocate the memory used by EMS when complete.

Compile and Link

  • Compile programs with an ANSI-compliant C compiler.
  • Link with the appropriate EMS C library files; see Link These Library Files.

See the samples/c/readme.txt file for details.

Run

  • UNIX
    The environment variable $LD_LIBARY_PATH must include the EMS_HOME/lib directories (which contain the shared library files).
  • Windows
     The PATH must include the ems\10.1\bin directory.
  • All Platforms
     The application must be able to connect to a EMS server process (tibemsd).

Link These Library Files

EMS C programs must link the appropriate library files. The following sections describe which files to link for your operating system platform:

UNIX

Include EMS_HOME/lib in your library path.

Linker Flag Description

-ltibems

-lssl

-lcrypto

-lz

All programs must link using these library flags.

-ltibemslookup


Programs that reference the defunct EMS LDAP lookup API must link using this library flag. This is provided so as not to break builds but will no longer provide the feature. Non-LDAP JNDI lookups are still supported.
-ltibemsadmin Programs that use the C administration library must link using this library flag.
-ltibemsufo Programs that use the unshared state failover library must link using this library flag.

Microsoft Windows

Library File Description
Use the /MT compiler option.

tibems.lib

libssl.lib

libcrypto.lib

zdll.lib

All programs must link these libraries.
tibemslookup.lib Programs that reference the defunct EMS LDAP lookup API must link using this library. This is provided so as not break builds but will no longer provide the feature. Non-LDAP JNDI lookups are still supported.
tibemsadmin.lib Programs that use the C administration library must link using this library.
tibemsufo.lib Programs that use the C unshared state failover library must link using this library.