Mercurial > pidgin
comparison libpurple/plugins/perl/common/Status.xs @ 21777:306ee626481d
Plug another leak or two, remove a comment, and reorganize a couple functions.
author | Etan Reisner <pidgin@unreliablesource.net> |
---|---|
date | Sat, 01 Dec 2007 06:46:25 +0000 |
parents | ab6d2763b8d8 |
children | 6f47135f5378 |
comparison
equal
deleted
inserted
replaced
21776:4b33d4185342 | 21777:306ee626481d |
---|---|
88 for (i = 0; i < t_len; i++) { | 88 for (i = 0; i < t_len; i++) { |
89 STRLEN t_sl; | 89 STRLEN t_sl; |
90 t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(source_list), i, 0), t_sl)); | 90 t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(source_list), i, 0), t_sl)); |
91 } | 91 } |
92 purple_presence_add_list(presence, t_GL); | 92 purple_presence_add_list(presence, t_GL); |
93 g_list_free(t_GL); | |
93 | 94 |
94 void | 95 void |
95 purple_presence_add_status(presence, status) | 96 purple_presence_add_status(presence, status) |
96 Purple::Presence presence | 97 Purple::Presence presence |
97 Purple::Status status | 98 Purple::Status status |
359 | 360 |
360 void | 361 void |
361 purple_status_type_destroy(status_type) | 362 purple_status_type_destroy(status_type) |
362 Purple::StatusType status_type | 363 Purple::StatusType status_type |
363 | 364 |
364 Purple::StatusType | |
365 purple_status_type_find_with_id(status_types, id) | |
366 SV *status_types | |
367 const char *id | |
368 PREINIT: | |
369 /* XXX Check that this function actually works, I think it might need a */ | |
370 /* status_type as it's first argument to work as $status_type->find_with_id */ | |
371 /* properly. */ | |
372 GList *t_GL; | |
373 int i, t_len; | |
374 CODE: | |
375 t_GL = NULL; | |
376 t_len = av_len((AV *)SvRV(status_types)); | |
377 | |
378 for (i = 0; i < t_len; i++) { | |
379 STRLEN t_sl; | |
380 t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(status_types), i, 0), t_sl)); | |
381 } | |
382 RETVAL = (PurpleStatusType *)purple_status_type_find_with_id(t_GL, id); | |
383 OUTPUT: | |
384 RETVAL | |
385 | |
386 Purple::StatusAttr | 365 Purple::StatusAttr |
387 purple_status_type_get_attr(status_type, id) | 366 purple_status_type_get_attr(status_type, id) |
388 Purple::StatusType status_type | 367 Purple::StatusType status_type |
389 const char *id | 368 const char *id |
390 | 369 |
396 PPCODE: | 375 PPCODE: |
397 for (l = purple_status_type_get_attrs(status_type); l != NULL; l = l->next) { | 376 for (l = purple_status_type_get_attrs(status_type); l != NULL; l = l->next) { |
398 XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::StatusAttr"))); | 377 XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::StatusAttr"))); |
399 } | 378 } |
400 | 379 |
380 Purple::StatusType | |
381 purple_status_type_find_with_id(status_types, id) | |
382 SV *status_types | |
383 const char *id | |
384 PREINIT: | |
385 GList *t_GL; | |
386 int i, t_len; | |
387 CODE: | |
388 t_GL = NULL; | |
389 t_len = av_len((AV *)SvRV(status_types)); | |
390 | |
391 for (i = 0; i < t_len; i++) { | |
392 STRLEN t_sl; | |
393 t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(status_types), i, 0), t_sl)); | |
394 } | |
395 RETVAL = (PurpleStatusType *)purple_status_type_find_with_id(t_GL, id); | |
396 g_list_free(t_GL); | |
397 OUTPUT: | |
398 RETVAL | |
399 | |
401 const char * | 400 const char * |
402 purple_status_type_get_id(status_type) | 401 purple_status_type_get_id(status_type) |
403 Purple::StatusType status_type | 402 Purple::StatusType status_type |
404 | 403 |
405 const char * | 404 const char * |