/* * * RemoteCall.c * */ #include "DataExch.h" #define RCALL 16 #define RREGISTER 17 typedef int (*funcPtr)(); typedef int *intPtr; typedef struct {funcPtr func; int level} ProcDesc; typedef struct {char *base; int startIndex; int count} UnsafeBlock; void PutPacket(), WatchPacketsIn(); unsigned getTextLength(); static void action_rcall(chars, len, type, data1, data2) char *chars; unsigned len, type, data1, data2; { unsigned (*proc)(); unsigned result; proc = (unsigned (*)()) data1; result = (*proc)(chars, len); (void) PutPacket(RCALL, data2, result, (char *) 0, 0); } int registerProc(key, procD) char *key; ProcDesc *procD; { int (*proc)(); unsigned len; if (procD->level!=0) { PutText(1, "Error in RemoteCall_registerProc : non top level function\n"); return(-1); /*non top level procedure */ }; registration[RCALL].a = action_rcall; registration[RCALL].t = -1; len = getTextLength(key); proc = procD->func; (void) PutPacket(RREGISTER, (unsigned) proc, 0, key, len); return(0); } Êş˜J˜˜J˜J˜J˜J˜J˜—J˜J˜J˜J˜J˜J˜J˜J˜2J˜CJ˜J˜#J˜J˜J˜8J˜ J˜!˜J˜J˜J˜J˜J˜6—J˜J˜˜J˜ J˜—˜J˜J˜ ˜J˜JJ˜(J˜—J˜%J˜J˜J˜J˜:J˜ —J˜J˜J˜J˜J˜—…—è¨