The

example APIs in this chapter represent two general functions of API

and

retrieve. It is typical for an

API

that

is not

retrieving informat

any

output to the caller other than

the error code parameter. If an

occur when using

APIs, the

requested

function

completed

successfully.

The

presentation

of the ILE

APIsSystemin APItheReferenceis similar

to

the

OPM

APIs. For a general discussion of

the

API

topics,

see

“Description

on

page 3-2.

 

 

 

 

 

 

 

 

Registration Facility

Using

ILE

APIs—Concepts

 

 

 

 

The

following

examples

illustrate

the use

of OS/400

ILE APIs. The

example

the registration facility APIs. The registration facility APIs provide

storing and

retrieving information about exit points

andexit exit programs. An

point

is

a

specific

point in a

system

function or

program where

contro

passed to

one or more exit programsexit . An is a

program to which

 

 

control

is

passed from an exit point. The

examples show how to manipulat

points

and

exit programs, how to retrieve

information

about

exit

points

grams

that

are

stored with

the registration

facility,

and

how

to

call

Several

of

the

registration

facility

APIs

manipulate

the

information

that

tion facility repository contains. One

API

is

provided

for

retrieving i

the repository.

 

 

 

 

 

 

 

 

 

 

The example programs are provided at the end of this chapter in the “Registration Facility Using ILE APIs—Examples” on page 4-9). The example makes use of a continuation handle. Following are portions of the code t illustrate concepts pertaining to the use of OS/400 ILE APIs. The followi cepts include:

Ÿ

Various

types

of

header files

Ÿ

The

use

of

keyed interfaces

Ÿ

Error

handling

and

the

error code parameter

Ÿ

The

use

of

receiver

variables for returned information

Generic Header Files

This topic shows how to use a generic header file from the QSYSINC ( include) library in a program. For information about the QSYSINC header f “APIs and the QSYSINC Library” on page 2-28.

In addition to the traditional C-library header files (such as stdio header file qusrgfa1.h is included in the following example. The qusrgf file defines the functions exported from service program QUSRGFA1. This program contains the APIs provided for manipulating the information in the tory. A second service program named QUSRGFA2 contains the ILE API for retrieving information from the registration facility repository. The hea qusec.h contains the definition for the error code structure that is code parameter. The following list shows the standard C header files ( includes) and a few AS/400-defined header files for APIs. This list doe all the header files used in the example programs starting on page 4

4-2System API Programming V4R1

Page 92
Image 92
IBM Version 4 manual APIs-Concepts, Generic Header Files, Point