get error when I run nullclient

A.TNG tang.jiyu at gmail.com
Sat Jun 7 10:22:56 EDT 2008


Hi,

I read source code of nullclient.c and try to write a protocol plugin and
write a IM client with libpurple. Then I met some problems. After I compile
the source code and run "./nullclient", I get following message:

*jiyu at beijing-atng /cygdrive/d/im/pidgin/src/pidgin-2.4.2/libpurple/example
$ ./nullclient
libpurple initialized.
Select the protocol [0--1]:*

I don't know what does it mean about "*Select the protocol*" and I find "*
[0--1]*" is totally wrong. Since the source code is :

*printf("Select the protocol [0-%d]: ", i-1);*

Please pay attention to the "*[0-%d]*". Because I get "*[0--1]*", so the
value of "*i*" is 0.

Then I try to find why I get a wrong value of i.

Check following source code in <pidgin>/libpurple/example/nullclient.c,
function main()

        init_libpurple();

        iter = purple_plugins_get_protocols();  // this function return NULL

        for (i = 0; iter; iter = iter->next) {
                PurplePlugin *plugin = iter->data;
                PurplePluginInfo *info = plugin->info;

                if (info && info->name) {
                        printf("\t%d: %s\n", i++, info->name);
                        names = g_list_append(names, info->id);
                }
        }

        printf("Select the protocol [0-%d]: ", i-1);

Now, I doubt that some wrong happened in *init_libpurple()*;

Could any nice people help me and tell me how initiate libpurple without
error and get the right GList of protocol.

Thanks in advance.

--------------------
Best Regard,
Tang, Jiyu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20080607/29387a10/attachment.html>


More information about the Devel mailing list