/* CpSc 824 countchar.x: RPCGEN program for example with two procedures served by the same RPC server. Note also that program COUNTALLCHARS demonstrates passing a linked list from the server back to the client. Description: COUNTCHAR counts the number of occurrences of a given character in a passed character string. The parameter passed to countchar is a pointer to a structure that contains two strings: 1) the character string to be searched, 2) the character to be searched for. COUNTALLCHARS returns a linked list of counts for all characters that occurred the string, each entry containg the character and its associated occurrence count. The parameter is a pointer to the string. */ typedef string buftype<80>; struct stringdata { buftype buf; char findch; }; typedef struct countdata *nextcount; struct countdata { char character; int count; nextcount next; }; program COUNTCHARPROG { version COUNTVERS { int COUNTCHAR(stringdata) = 1; nextcount COUNTALLCHARS(buftype buf) = 2; } = 1; } = 0x30000825;