## Macintosh Run Time Support Turbo Pascal, on Mac MPW, Macintosh Programmer's Workshop PC, Macintosh , Run time support RPC is available for the Macintosh, using either TurboPascal or MPW Pascal.

### Program building. The stubs should be generted with the CMACTURBO or SMACTURBO option, and compiled using TurboPascal or MPW Pascal. (No INCLUDE preprocessing is required.) The program should declare the name of any stubs which it uses in a "USES" clause. The stubs will be automatically initialised under TurboPascal The NOAUTOINIT option of the compiler may be used to inhibit this. See the chapter on "Running the compiler". at run time, but not under MPW, when initialisation calls should be inserted in the main program as shown in he examples. The library files provided in the release must be made available to turbopascal or MPW for linking. The dependecies between the modules are as follows:

                    Client                     Server
                    program                   program
                       |                         |
                       |                _________|__________
                       |                |                  |
                 CLIENT STUB        SERVER STUB          Server
                       |________________|                routines
                                |
                              RPCRTS
                     ___________|___________
                    |                       |
                RPCSTUB                 TSTURBO
                    |_______________________|
                                |
                            RPCMACPAS

Because of the 32kbyte limitation on the size of any one program segment, you will need to put at least one RPC library module into its own segment using the $S directive as shown below. The client program header will be of the form:

    ..tb 9 17 25 33 41 49 57 65 73
    program Client;              {Main client program}

    {$S+}                        {Enable segmentation}
    {$U RPCMacPas}               { Mac-specific runtime support }
    {$U RPCStub}                 { Run time support for stubs }
    {$U TSTurbo}                 { Run time support transport }
    {$U RPCRTS}                  { Run time support kernel }
    {$U clitest}		     { Client stub in this example }

    uses MemTypes,
         QuickDraw,
         OSIntf,
         ToolIntf,
         RPCMacPas,               { RPC system starts here }
         RPCStub,
         TSTurbo,
         {$S SEGRTS}  RPCRTS,     { Put RPC RTS into different segment }
         clitest;                 { The client stub }

    var
           ...

    begin
        RPCMacPas_Init;	{ MPW only }
        RPC_Init;		{ MPW only }
        Open_test;		{ MPW only }

        ...

        if (rpc_trace) then close(errlog);
    end.

A typeical server program is:

    ..tb 9 17 25 33 41 49 57 65 73
    program Server;		{Main server program}

    {$S+}			{Enable segmentation}
    {$U RPCMacPas}
    {$U RPCStub}
    {$U TSTurbo}
    {$U RPCRTS}
    {$U test}
    {$U sertest}

    uses MemTypes,
         QuickDraw,
         OSIntf,
         ToolIntf,
         RPCMacPas,
         RPCStub,
         TSTurbo,
         {$S SEGRTS}  RPCRTS,	{ RPC runtime system }
         test,			{ Server subroutines }
         {$S testseg} sertest;	{ Server stub }

    var
        status :    RPC_status;
        address :   RPC_name;

    begin
        RPCMacPas_Init;	{ MPW only }
        RPC_Init;		{ MPW only }
        Open_test;		{ MPW only }
        Attach_test;	{ MPW only }

        address := 'test                                    ';
        RPC_Loop_Server (status,address);
        RPC_Report_Error (status);
        close(errlog);
    end.

### Configuration file Configuation file (Mac) As there is no shell environment on the Mac, RPC addresses must be defined in a file called RPC_Cfg. You can edit this with the turbopascal editor. The format is

            < name > = < address >
            < name > = < address >
            . . .

For example,

    	RPC_TRACE_FLAG=rpc_trace_file
    	TEST=0@TT1:F.V24

A file in this case is produced for trace information. The user program must close this file, if it is used, before exiting the program (or it will be unreadable). Communication may be over RS232 only at the moment, and the address modifiers for changing baud rate, etc., are not supported. ..pa