<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML ><HEAD ><TITLE >An action</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="Gaby's documentation" HREF="index.html"><LINK REL="UP" TITLE="Actions" HREF="c782.html"><LINK REL="PREVIOUS" TITLE="Actions" HREF="c782.html"><LINK REL="NEXT" TITLE="Format" HREF="c842.html"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Gaby's documentation</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="c782.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Chapter 10. Actions</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="c842.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="AEN822" >10.2. An action</A ></H1 ><P >I didn't speak about <CODE CLASS="FUNCTION" >mail</CODE > and <CODE CLASS="FUNCTION" >phone</CODE > you read in the <CODE CLASS="FUNCTION" >get_function_by_name</CODE > example. They were defined just before the function as : <PRE CLASS="PROGRAMLISTING" >static void mail (struct action_param fields[3], int *dec); static void phone (struct action_param field[1], int *dec);</PRE > </P ><P >In fact, the common form is : <DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN830" ></A ><CODE CLASS="FUNCDEF" >static void action_foo</CODE >(struct action_param* params, int* dec);<P ></P ></DIV > </P ><P >I'll first speak about the second parameter which is simply a counter used by Gaby to know if it may free the plug-in. You only have to decrement it at the end(s) of the action and <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >not</I ></SPAN > before (i.e. this means that if you open a dialog you may only decrement it once the dialog is closed).</P ><DIV CLASS="NOTE" ><P ></P ><TABLE CLASS="NOTE" WIDTH="100%" BORDER="0" ><TR ><TD WIDTH="25" ALIGN="CENTER" VALIGN="TOP" ><IMG SRC="../images/note.gif" HSPACE="5" ALT="Note"></TD ><TD ALIGN="LEFT" VALIGN="TOP" ><P >You can read more about <CODE CLASS="STRUCTNAME" >action_param</CODE > in the chapter dedicated to structures.</P ></TD ></TR ></TABLE ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="c782.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="c842.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Actions</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="c782.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Format</TD ></TR ></TABLE ></DIV ></BODY ></HTML >