Calling the Api Through a C or C++ Program - Documentation for Bmc Ami Defender for Z/Os 6.1

This topic discusses how to call the API using a C or C++ program.

Environment

To call the API, the calling program must be:

  • Language Environment AMODE 31
  • Enabled for interrupts
  • Not holding any locks
  • In primary ASC mode (can also be in cross-memory mode)
  • The event record and API1 control block must reside in the calling program’s primary address space (PAS)

These are normal conditions for a C or C++ program. The calling program must also be APF-authorized.

To compile and bind a C program with APF authorization, use the following example:

c89 –Wl,AC=1,EXTATTR=APF –o Sample Sample.c

Format

#include “CZAPI1.h”

int CZAPI1(const void *record, const struct CZAPI1CB *ctl_block) 
James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest