An action

I didn't speak about mail and phone you read in the get_function_by_name example. They were defined just before the function as :
static void mail (struct action_param fields[3], int *dec);
static void phone (struct action_param field[1], int *dec);

In fact, the common form is :

static void action_foo(struct action_param* params, int* dec);

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 not before (i.e. this means that if you open a dialog you may only decrement it once the dialog is closed).

Note: You can read more about action_param in the chapter dedicated to structures.