#if !defined(EVENTINSTANCE_H) #define EVENTINSTANCE_H /* ** To send an event to an active instance you can used either ** EventInstanceCreate or GenerateEvent. In both cases you must specify ** The Active Instance sending the event, the Active Instance to ** receive the event, and the label of the event to send. If you have ** the internal keys of these three things, use EventInstanceCreate. ** If you only have the names of these things, use GenerateEvent. ** ** Whichever you choose, you must also specify 5 pieces of event data. ** Each event carries with it two integer pieces of data, two float ** pieces of data (though users see them as doubles), and one character ** string of data. ** ** The text data is copied so you are resposible for the memory management ** of the text you send in. The text may contain a maximum of 40 characters ** (EVENTINSTANCEMAXSTRINGLEN). Text you send in will be silently truncated ** to this size if too long. Text will not be space padded. ** ** If you do not wish to supply a piece of information, supply 0 in its ** place. Specifying 0 for the text data is equivalent to specifying ** the null string, "". The receiver of the event will not be able to ** determine whether you specified 0 or "". */ #include /* #include "f93olc.h" */ #include "Hominid.h" # if !defined OLC3COMMON_H # include "olc3common.h" # endif enum { EventInstanceMaxStringLen = 80 }; PROTOTYPE(void EventInstanceCreate, (hcg_key FromThisActiveInstance, hcg_key ToThisActiveInstance, hcg_key ThisTypeOfEvent, int FirstIntData, int SecondIntData, double FirstFloatData, double SecondFloatData, const char *Text)) PROTOTYPE(void GenerateEvent, (const char * FromThisNamedActiveInstance, const char * ToThisNamedActiveInstance, const char * EventLabel, int FirstIntData, int SecondIntData, double FirstFloatData, double SecondFloatData, const char * Text)) /* ** Use the following routines to access information from an event. ** ** EventInstanceGetText returns a pointer to the text in the event instance. ** If you need to get a copy of the text for long term use, use ** EventInstanceCopyText. Be sure that there is enough space in the ** destination buffer for the maximum size event instance text. */ PROTOTYPE(hcg_key EventInstanceGetETid, (hcg_key EIid)) PROTOTYPE(hcg_key EventInstanceGetAIid1, (hcg_key EIid)) PROTOTYPE(hcg_key EventInstanceGetAIid2, (hcg_key EIid)) PROTOTYPE(int EventInstanceGetInt1, (hcg_key EIid)) PROTOTYPE(int EventInstanceGetInt2, (hcg_key EIid)) PROTOTYPE(double EventInstanceGetFlt1, (hcg_key EIid)) PROTOTYPE(double EventInstanceGetFlt2, (hcg_key EIid)) PROTOTYPE(const char *EventInstanceGetText, (hcg_key EIid)) PROTOTYPE(void EventInstanceCopyText, (hcg_key EIid, char *CopyDst)) /* ** Use this routine to delete an event instance. Deleting an event instance ** will invalidate the text pointer returned by EventInstanceGetText */ PROTOTYPE(void EventInstanceDelete, (hcg_key EIid)) /* ** The following routines return active instances */ PROTOTYPE(hcg_key EventInstanceFirst, (void)) PROTOTYPE(hcg_key EventInstanceNext, (hcg_key EIid)) #endif