[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: zed: When will the new PI be done?



> > It'd be nice to have a list of fields, and some way to know
> > what each type is going to be. This would make it easy for
> > higher level interfaces to wrap this information into
> > smart objects, avoiding specific code for each list.
> 
> There's no list available in the code, so I'd have to add
> one in especially for this. Can't you just pass whatever the
> python coder gives you to xchat_get_int/str? Python coders can then just use
> the same docs as for the C-plugin interface to find out what fields
> are available.

It shouldn't be hard to add one, a NULL terminated array of strings
(probably staticaly allocated for each list) would do the job. I can
help you if you're busy with other stuff.

Being able to access data types is also highly advisable. It's not
confortable (and dangerous!) for high level developers to convert
between different types.

I can imagine something like:

void xchat_list_get_fields(xchat_plugin *ph, char *list,
                           char **name, int **type);

These requirements are not 100% necessary, and they will probably be
unuseful for C plugin developers. OTOH, they will be a big difference
for the python interface and for other languages using similar concepts.
My idea is to return a list of objects with attributes, so one'd be able
to call list_get() and access "user.nick" and "user.host", for example.
I can't imagine anything easier.

PS. The documentation mentions dcc->context list attribute as being
a string. This should probably be a long, given the data nature.

-- 
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]
--
XChat-discuss: mailing list for XChat users
Archive:       http://mail.nl.linux.org/xchat-discuss/