Accessing System Manager Services From C

Each source file containing services calls must include the header file INTERFAC.H which contains macro definitions for each System Manager service. The macro expands the call to be a call to a common System Service request function. In addition, the macro adds a service number to the argument list and casts near pointers to far pointers as appropriate.

For example, the m_disp call in the source

#include         "interfac.h" 
int              row, col, style, ostyle; 
char             *str; 
m_disp(x, y, str, strlen(str), style, ostyle); 
expands to
 
c_service(F_M_DISP, x, y, (void far *)str, strlen(str), style, ostyle); 
where F_M_DISP is the function code for m_disp and is defined in INTERFAC.H.

The function c_service is provided in the object module CSVC.OBJ (which is in SCSVC_HP.LIB) and converts the call into a software interrupt that transfers control to the System Manager Dispatch table.