00001 /* 00002 Simple Messaging Interface 00003 AUP2, Sec. 7.03.2 00004 00005 Copyright 2003 by Marc J. Rochkind. All rights reserved. 00006 May be copied only for purposes and under conditions described 00007 on the Web page www.basepath.com/aup/copyright.htm. 00008 00009 The Example Files are provided "as is," without any warranty; 00010 without even the implied warranty of merchantability or fitness 00011 for a particular purpose. The author and his publisher are not 00012 responsible for any damages, direct or incidental, resulting 00013 from the use or non-use of these Example Files. 00014 00015 The Example Files may contain defects, and some contain deliberate 00016 coding mistakes that were included for educational reasons. 00017 You are responsible for determining if and how the Example Files 00018 are to be used. 00019 00020 */ 00021 #ifndef _SMI_H_ 00022 #define _SMI_H_ 00023 00024 /* 00025 Messages must begin with a long mtype. 00026 */ 00027 00028 /*[]*/ 00029 struct smi_msg { 00030 long smi_mtype; /* must be first */ 00031 struct client_id { 00032 long c_id1; 00033 long c_id2; 00034 } smi_client; 00035 char smi_data[1]; 00036 }; 00037 /*[]*/ 00038 typedef void *SMIQ; 00039 typedef enum {SMI_SERVER, SMI_CLIENT} SMIENTITY; 00040 #define SERVER_NAME_MAX 50 00041 00042 SMIQ *smi_open(const char *name, SMIENTITY entity, size_t msgsize); 00043 bool smi_close(SMIQ *sqp); 00044 bool smi_send_getaddr(SMIQ *sqp, struct client_id *client, void **addr); 00045 bool smi_send_release(SMIQ *sqp); 00046 bool smi_receive_getaddr(SMIQ *sqp, void **addr); 00047 bool smi_receive_release(SMIQ *sqp); 00048 #endif /* _SMI_H_ */