diff options
author | jacomi | 1999-03-18 11:33:53 +0000 |
---|---|---|
committer | jacomi | 1999-03-18 11:33:53 +0000 |
commit | 03a0143c0c6b55a97e910f229945620e81a756cb (patch) | |
tree | 2090762f1e70c06ee58117969168d7559f6b23d0 /doc/ivy-c.htm | |
parent | 7cfa818995332e8b54fc1831bacdf9c2d131155c (diff) | |
download | ivy-c-03a0143c0c6b55a97e910f229945620e81a756cb.zip ivy-c-03a0143c0c6b55a97e910f229945620e81a756cb.tar.gz ivy-c-03a0143c0c6b55a97e910f229945620e81a756cb.tar.bz2 ivy-c-03a0143c0c6b55a97e910f229945620e81a756cb.tar.xz |
*** empty log message ***
Diffstat (limited to 'doc/ivy-c.htm')
-rw-r--r-- | doc/ivy-c.htm | 70 |
1 files changed, 54 insertions, 16 deletions
diff --git a/doc/ivy-c.htm b/doc/ivy-c.htm index 5521560..8256c39 100644 --- a/doc/ivy-c.htm +++ b/doc/ivy-c.htm @@ -25,7 +25,8 @@ IvyChannelHandleExcpt, IvyXtChannelInit, IvyXtChannelSetUp IvyXtChannelClose, IvyXtHandleChannelRead, IvyXtHandleChannelDelete, IvyXtChannelAppContext, <H2><A NAME=SYNOPSIS>SYNOPSIS</A></H2> -useful library functions for communicating through a sofware bus +useful set of library functions for communicating between different +processes through a software bus <BR> <P> <B>IvyInit(</B><I>AppName, ready, callback, data, die_callback, die_data</I><B>)</B> @@ -116,6 +117,7 @@ static void void <B>IvyChannelAppContext(</B><I>cntx</I><B>)</B> <H2><A NAME=ARGUMENTS>ARGUMENTS</A></H2> +Only main functions are detailed in this section <H2><A NAME=Section0></A></H2> <B>IvyInit</B>: Initialisation of a connection @@ -134,16 +136,22 @@ Initialisation of a connection <DT><CODE>void *die_data</CODE> (in) <DD>user data </DL> +<H2><A NAME=Section1>Example:</A></H2> +<B>IvyInit ("PLN-SERVER", "PLN-READY", NULL, NULL, NULL);</B> <H2><A NAME=Section0></A></H2> <B>IvyStart</B>: Initialisation of TCP/UPD port and sending of a broadcast handshake on every network <DL> <DT><CODE>const_char *bus</CODE> -(in) <DD>Bus (format : network list followed by broadcast port) example : -123.231,123.123:2000 or 123.231 or :2000 -If no argument specified, check the environment variable <B>IVYBUS</B>, -else use the default value : 127.255.255.255:2010 +(in) <DD>Bus to be used (format : network list followed by broadcast port). </DL> +<H2><A NAME=Section1>Example:</A></H2> +the given bus can be a string like 123.231,123.123:2000 or 123.231 or +:2000. If no argument is specified, then the environment variable +<B>IVYBUS</B> is checked, else the default value : 127.255.255.255:2010 +is used (broadcast on the local machine). +<BR> +<B>IvyStart ("143.196.53.255:2001");</B> <H2><A NAME=Section0></A></H2> <B>IvyBindMsg</B>: Message binding @@ -153,15 +161,30 @@ Message binding (in) <DD><DT><CODE>const_char *regexp</CODE> (in) <DD><DT><CODE>MsgRcvPtr id</CODE> (out) <DD></DL> +<H2><A NAME=Section1>Example:</A></H2> +<B>IvyBindMsg (StartTimeCallback, 0, "^CLOCK Start time=(.*)");</B> +<BR> +In this example the function <B>StartTimeCallback</B> will be called +each time the string <B>CLOCK Start time=(.*)</B> will be emitted on +the bus. <H2><A NAME=Section0></A></H2> <B>IvyUnbindMsg</B>: Message unbinding <DL> <DT><CODE>MsgRcvPtr id</CODE> -(in) <DD></DL> +(in) <DD>ident of the message to unbind +</DL> +<H2><A NAME=Section0></A></H2> +<B>IvySendMsg</B>: +Sending a message +<DL> +<DT><CODE>const_char* fmt</CODE> +(in) <DD>String to be sent on the bus +</DL> +<H2><A NAME=Section1>Example:</A></H2> +<B>IvySendMsg ("SECTOR:%s.AIRCRAFT:%s Entered", sectorname, pln->indicatif);</B> <H2><A NAME=Section0></A></H2> <B>IvyChannelSetUp</B>: - <DL> <DT><CODE>HANDLE fd</CODE> (in) <DD><DT><CODE>void *data</CODE> @@ -169,15 +192,21 @@ Message unbinding (in) <DD><DT><CODE>ChannelHandleRead handle_read</CODE> (in) <DD><DT><CODE>Channel out</CODE> (out) <DD></DL> +<H2><A NAME=Section1>Example:</A></H2> +<B>IvyChannelSetUp (0, NULL, NULL, HandleStdin);</B>: <HR> <BR> <H2><A NAME=DESCRIPTION>DESCRIPTION</A></H2> <P> -These procedures provide facilities for connecting applications on a +These functions provide facilities for connecting applications on a software bus and managing messages exchanges among them. +Each time an application initializes a connection on the bus, a +"ready" message is sent to all other applications already connected, and the +list of the messages subscribed by this application is dispatched. +The format for the messages is free. -<H2><A NAME=EXAMPLES>EXAMPLES</A></H2> -Simple C code: +<H2><A NAME=EXAMPLE>EXAMPLE</A></H2> +Connection of the application <B>IVYPROBE</B> on a given bus <BR> <BR> @@ -188,35 +217,44 @@ Simple C code: #include "ivy.h" int main (int argc, char* argv[]){ +/* bus domain and port number to be used */ + const char* bus="127.255.255.255:2010"; +/* initialisation of the connection */ IvyInit ("IVYPROBE", bport, "IVYPROBE READY", ApplicationCallback, NULL, NULL, - NULL) + NULL); +/* keyboard's inputs management */ IvyChannelSetUp(0, NULL, NULL, HandleStdin); - IvyStart (domains); - IvyMainLoop(0) +/* starting the connection */ + IvyStart (bus); +/* Main loop */ + IvyMainLoop(0); }; <BR> </PRE> <H2><A NAME=FILES>FILES</A></H2> <I>/usr/include/ivy.h</I> +<BR> <I>/usr/include/ivyloop.h</I> +<BR> <I>/usr/include/ivysocket.h</I> <H2><A NAME=ENVIRONMENT>ENVIRONMENT</A></H2> -<I>IVYDOMAINS</I> <I>IVYBUS</I> +<BR> +<I>IVYDOMAINS</I> <H2><A NAME=DIAGNOSTICS>DIAGNOSTICS</A></H2> error messages displayed <H2><A NAME=BUGS>BUGS</A></H2> -none ! +none reported yet! <H2><A NAME=AUTHORS>AUTHORS</A></H2> Francois-Regis Colin <fcolin@cenatoulouse.dgac.fr> Stephane Chatty <chatty@cenatoulouse.dgac.fr> -<H2><A NAME=Section1>SEE ALSO</A></H2> +<H2><A NAME=Section2>SEE ALSO</A></H2> ivyprobe (1) <P> For further details, please refer to the Ivy html page at http://www.cenatls.cena.dgac.fr/pii/produits/Ivy.html |