[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-user: [PCB] action context patch
On Mon, 23 Mar 2009, Gabriel Paubert wrote:
>On Mon, Mar 23, 2009 at 06:36:39AM +0100, igor2 wrote:
>> fixed typo and added more comments (about intention of the new calls)
>>
>> --
>> .O.
>> ..O
>> OOO
>>
>
>> --- pcb.orig/src/hid.h 2009-02-21 18:51:54.000000000 +0100
>> +++ pcb/src/hid.h 2009-03-23 06:34:54.000000000 +0100
>> @@ -86,7 +86,25 @@
>> const char *syntax;
>> } HID_Action;
>>
>> + /* This global variable is always set to the action context,
>> + before an action callback is called. Action context can
>> + be specified when registering an action with hid_register_action()
>> + Intended for plugins with hub action callbacks. */
>> + extern void *hid_action_context;
>> +
>> + /* Register a singe action associated with an action context
>> + Intended for plugins to register actions with a hub callback. */
>> + extern void hid_register_action(HID_Action *, void *);
>> +
>> + /* Deregister an action; returns 0 on success. Action context pointer is copied
> ^^^^^^^^^
>> + in the 2nd argument if it's not NULL.
>> + Intended for plugins to deregister actions registered earlier
>> + with hid_register_action() */
>> + extern void hid_deregister_action(const char *, void **);
> ^^^^
>Hmmm, how can a void returning function return 0 on success?
>
>Maybe I'm just nitpicking, but...
>
>> +
>> + /* Register a list of actions without action context */
>> extern void hid_register_actions (HID_Action *, int);
>> +
>> #define REGISTER_ACTIONS(a) HIDCONCAT(void register_,a) ()\
>> { hid_register_actions(a, sizeof(a)/sizeof(a[0])); }
>>
>
> Regards,
> Gabriel
>
>
Ooops :) Thanx for the warning, probably it won't return anything and if
the user tries to delete a non-existing action, it will be silently
dismissed.
Regards,
Tibor Palinkas
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user