PAM Programming Manual
Link-Level Programming Examples
PAM Programming Manual—142482
B-13
Sample C Calling Sequences
report^buf^ptr[46] ’:=’ [” Sec “];
CALL Write ( report^file^num, INT^report^buf^ptr, 60 );
END;
Sample C Calling Sequences
The following paragraphs present an L2S Access Point exercise using C coding
examples that are functionally similar to the preceding TAL coding examples. In this
sample exercise, the test program communicates with a node in an attached LAN by way
of a PORT. Once the PORT has been OPENed, the application program communicates
with the link-level interface by sending and receiving SDUs. Refer to a C manual for
detailed information on the conventions used in this example.
Data Definitions and Declarations
The sample calling sequences assume the presence of the following data definitions and
declarations:
#pragma section Definitions
#pragma page
“L2 Service Access Point Exercise Program: Definitions”
/* ----------------------------------------------------------------
Hard Coded Limits
---------------------------------------------------------------- */
#define Max_Req_Size 5000
#define Max_NoWait_Depth 5
#define True -1
#define False 0
#define condition_ok 1
#define Abend_exit -1
struct Buffer_Lst_Entry_Template {
int in_use_flag;
int user_data_size_b;
int test_char;
char buffer[Max_Req_Size];
};
#pragma section Declarations
#pragma page
“L2 Service Access Point Exercise Program: Declarations”
/* ----------------------------------------------------------------
L2SAP File Information
---------------------------------------------------------------- */
char L2SAP_file_name[23];
int L2SAP_file_num;
/* ----------------------------------------------------------------
Aggregate SDU Buffer List
---------------------------------------------------------------- */
struct Buffer_Lst_Entry_Template buffer_lst[Max_NoWait_Depth];
/* ----------------------------------------------------------------
Startup Message Parameters
---------------------------------------------------------------- */
int Port_Type,
Command_Code,
P_F_Flag,