[Crossfire-wiki] [Crossfire DokuWiki] page changed: server_plugin

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Thu Mar 22 06:09:01 CDT 2007


A page in your DokuWiki was added or changed. Here are the details:

Date        : 2007/03/22 06:09
User        : ryo
Edit Summary: update

@@ -202,13 +202,28 @@
  
  FIXME link to common plugin documentation (generated from doxygen hopefully)
  
  FIXME specific Windows stuff / workspace/project issue
+ 
  
  ====== Plugin internals ======
  This paragraph only concerns people wishing to write a plugin without using the ''common'' interface, or extending it. It is not intended for everyday use.
  
  All functions available to plugins share the same prototype, ''f_plug_api'', defined in ''[[http://crossfire.svn.sourceforge.net/viewvc/crossfire/server/trunk/include/plugin.h?view=markup|include/plugin.h]]''.
+ 
+ ===== Parameters sending =====
+ All parameters are sent through the use of variable argument lists, using the macros ''va_start'', ''va_arg'' and ''va_end''.
+ 
+ ===== Data type =====
+ All functions accept as first parameter an ''int* type''. This parameter is used by server and plugin to exchange the type of a modified/returned value. Apart its presence for the variable argument list handling, it is used to check data coherence.
+ 
+ Data is exchanged as either a value or a pointer to a Crossfire structure. When the server needs to return a value to the plugin (for function wrapping, properties getting, ...), it expects the last argument to be a pointer to a variable of the returned value's type.
+ 
+ Data types available are defined in ''[[http://crossfire.svn.sourceforge.net/viewvc/crossfire/server/trunk/include/plugin.h?view=markup|include/plugin.h]]''.
+ 
+ Special case: when a ''CFAPI_STRING'' needs to be transferred, 2 parameters are expected, a pointer to the buffer and an integer to the buffer's size (which can't be always be determined automatically).
+ 
+ Note that signed/unsigned variables are transferred as signed, and should be cast appropriately when needed.
  
  ===== Basic data access =====
  Access (get/set) to properties of the Crossfire objects, maps, structures is done through property wrappers.
  


IP-Address  : 172.186.46.252
Old Revision: http://wiki.metalforge.net/doku.php/server_plugin?rev=1174561030
New Revision: http://wiki.metalforge.net/doku.php/server_plugin

-- 
This mail was generated by DokuWiki at
http://wiki.metalforge.net/




More information about the crossfire-wiki mailing list