Listing 1 (message.h)
/*********************************************************** *** *** This header file contains the definitions that are *** used by the sender.c (<a href="/showArticle.jhtml?documentID=cuj9109busigin&pgno=3">listing 2</a>) and holder.c *** (<a href="/showArticle.jhtml?documentID=cuj9109busigin&pgno=4">listing 3</a>) programs. *** ***********************************************************/ /* HOLDER_NAME defines the name that this program will register with the operating system. sender.c will determine the task id of this program by using the name_locate function. */ #define HOLDER_NAME "holder" /* The following manifests define the types of messages that will be assigned to the .mssg_type field of the following structure. */ #define STORE 1 #define STORED 10 #define RETRIEVE 2 #define RETRIEVED 20 #define KILL 3 #define ERROR -1 #define MAX_MSG_SIZE 81 struct message { int mssg_type; char text[MAX_MSG_SIZE]; };