[JDEV] Doc on MIO API for Transport dev available?---> Modul e API or Transport API exists ?

Riviere Stéphane Stephane.SR.Riviere at atosorigin.com
Wed Jun 20 07:17:38 CDT 2001


Thanks for this help,

I started to write my own module and everything seems to be ok.
The Jabberd API doc is useful, but some doc on the jsm (the Module API) and
the structures it uses would be great (mapi, jpacket...). 

Do you know of there is some doc on the Service API, used to develop
transports ?


Stephane


-----Message d'origine-----
De : DJ Adams [mailto:dj.adams at pobox.com]
Envoyé : mercredi 20 juin 2001 01:36
À : jdev at jabber.org
Objet : Re: [JDEV] Doc on MIO API for Transport dev available?---> Modul
e API or Transport API exists ?



The JSM modules all follow the same pattern. The function that is called
when the module is loaded is the one specified in the load part of the
configuration, e.g. 

    <load main="jsm">
      <jsm>./jsm/jsm.so</jsm>
      <mod_echo>./jsm/jsm.so</mod_echo>
      <mod_roster>./jsm/jsm.so</mod_roster>
      <mod_time>./jsm/jsm.so</mod_time>
      ...

the tagname (e.g. 'mod_time') is the name of the function ('mod_time()')
called.

This function usually is to be found, by convention, at the end of the
source file, and returns a void:

void mod_xyz(jsmi si)
{
  js_mapi_register(e_ ...)
  ...
}

This function registers handlers for the master events (e_SERVER,
e_AUTH, and so on). The e_SESSION master event has 'sub-events'
es_IN, es_OUT and so on (see jsm/jsm.h), and handlers for these
sub-events (session events) are set up in a beautifully fractal
way - the handler function for the e_SESSION event actually sets
handlers for the es_* events using js_mapi_session() :

mreturn xyz_abc(...)
{
  js_mapi_session(es_ ...)
}

The rest of the functions do the actual work. You might want to
have a look at jsm/modules/mod_example.c as it's got some useful
comments in the code.

Good luck!

dj
_______________________________________________
jdev mailing list
jdev at jabber.org
http://mailman.jabber.org/listinfo/jdev



More information about the JDev mailing list