Apple AppleShare 3.0 File Server Controls User Manual
Page 7

Determining if server control calls are available
Before using any of the other control calls, use the TrapAvailable call to
make sure that the server dispatch trap is available. The following line of
code tests directly for the existence of the server dispatch trap:
gHasServerDispatch := TrapAvailable(ServerDispatch)
The "Compatibility Guidelines" chapter of Inside Macintosh, Volume VI,
contains the source code for the TrapAvailable call.
Calling conventions
After assuring that server control calls are available, issue the
SyncServerDispatch call with the following code:
scErr:=SyncServerDispatch(@scPB);
The actual interface for the SyncServerDispatch call is defined by the server
control call interface file. See Appendix B for a listing of that file. The
SyncServerDispatch call appears in the "Server Control Routine" section of
Appendix B.
Getting and modifying server
configuration information
This section describes the server control calls that you use to get and to
modify server configuration information.
SCServerVersion
The following function calls SCServerVersion to get the name of the file
server extension and the server's type and version.
FUNCTION MySCServerVersion (ExtNamePtr: StringPtr;
VAR ServerType: Integer;
VAR ServerVersion: Integer):
OSErr;
VAR
scPB: SCParamBlockRec;
BEGIN
scPB.versionPB.scCode := SCServerVersion;
scPB.versionPB.scExtNamePtr := ExtNamePtr;
MySCServerVersion := SyncServerDispatch(@scPB);
ServerType := scPB.versionPB.scServerType;
ServerVersion := scPB.versionPB.scServerVersion;