<!-- Module Developer's Guide -->

<chapter>
    <chapterinfo>
	<revhistory>
	    <revision>
		<revnumber>$Revision: 1827 $</revnumber>
		<date>$Date: 2007-03-12 17:22:53 +0200 (Mon, 12 Mar 2007) $</date>
	    </revision>
	</revhistory>
    </chapterinfo>
    <title>Developer's Guide</title>
    <para>
		The module provides the following functions that can be used
		in other &ser; modules.
   </para>
 		<section>
				<title>
				<function moreinfo="none">bind_pua(pua_api_t* api)</function>
				</title>
			<para>
				This function binds the pua modules and fills the structure 
				with the two exported function.
			</para>
		<example>
		<title><function>pua_api</function> structure</title>
	<programlisting format="linespecific">
...
typedef struct pua_api {
	send_subscribe_t send_subscribe;
	send_publish_t send_publish;
} pua_api_t;
...
</programlisting>
		</example>

		</section>


	<section>
			<title>
			<function moreinfo="none">send_publish(publ_info_t*)</function>
			</title>
		<para>
			This function receives as a parameter a structure with Publish 
			required information and sends a Publish message.
		</para>
		<para>
		The structure received as a parameter:
			<programlisting format="linespecific">
...
typedef struct publ_info
{
  str id;            /*  an id value unique for one combination of 
                      *  pres_uri and flag */
  str* pres_uri;	 /*  the presentity uri */	
  str* body;		 /*  the body of the Publish message; 
                      *  can be NULL in case of an update */ 	
  time_t expires;	 /*  the absolute value at which the message expires*/	
  int flag;	         /*  it can be : INSERT_TYPE or UPDATE_TYPE
                      *  if missing it will be established according 
                      *  to the result of the search in hash table*/ 	
  int source_flag;   /*  flag identifying the resource ;
                      *  used values: UL_PUBLISH, MI_PUBLISH,
                      *  MI_SUBSCRIBE */
}publ_info_t;
...
		</programlisting>

		</para>
	</section>

	<section>
		<title>
			<function moreinfo="none">send_subscribe(subs_info_t*)</function>
		</title>
		<para>
			This function receives as a parameter a structure with Susbcribe 
			required information and sends a Subscribe message.
		</para>
		<para>
<programlisting format="linespecific">
...
The structure received as a parameter:
typedef struct subs_info
{
  str id;            /*  an id value unique for one combination
                      * of pres_uri and flag */
  str* pres_uri;     /*  the presentity uri */	
  str* watcher_uri;  /*  the watcher uri */
  time_t expires;    /*  the absolute value at which the message
						  expires */	
  int flag;          /*  it can be : INSERT_TYPE or UPDATE_TYPE
                      *  not compulsory */	
  int source_flag;   /*  flag identifying the resource ;
                      *  used values: UL_PUBLISH, MI_PUBLISH,
                      * MI_SUBSCRIBE */
}subs_info_t;
...
</programlisting>
		</para>
	</section>
</chapter>

<!-- Keep this element at the end of the file
Local Variables:
sgml-parent-document: ("pua.sgml" "book" "chapter")
End:
-->
