Pathmaker Programming Guide
Coding Custom Services
Creating Services and Servers
067868 Tandem Computers Incorporated 4–41
Example 5: Delete.
?section svc-005
/*
Transaction logic module for service : SVC-005
Delete employee record
*/
%INVOKE "defines" <−− Macro invocation.
void svc_005setup ( T9154_SERVICE_CONTROL *control )
{
}
void svc_005cleanup ( T9154_SERVICE_CONTROL *control )
{
}
void svc_005 ( T9154_SERVICE_REQUEST *request,
T9154_SERVICE_REPLY *reply,
T9154_SERVICE_CONTROL *control )
{
#include <string.h>
reply->t9154_header.reply_code = REPLY_SHORT;
if ( lfseekkey ( &control->file.employee_file,
(short) 0,
LFSK_EXACT,
&request->employee_rec.emp_no,
sizeof request->employee_rec.emp_no,
NULL,
0,
0 ))
{
return;
}
if ( lfdeleterec ( &control->file.employee_file))
{
return;
}
else
svc_advisory (REPLY_NORMAL, "Record deleted successfully");
}
}