Mercurial > pidgin
comparison libpurple/plugins/perl/common/Roomlist.xs @ 16739:39c7bb133a9f
Remove the const-c and const-xs stuff and replace it with real constants
exposed to perl.
author | Etan Reisner <pidgin@unreliablesource.net> |
---|---|
date | Tue, 01 May 2007 02:34:22 +0000 |
parents | 2f8274ce570a |
children | 6f47135f5378 |
comparison
equal
deleted
inserted
replaced
16700:79bc35a19de5 | 16739:39c7bb133a9f |
---|---|
1 #include "module.h" | 1 #include "module.h" |
2 | 2 |
3 MODULE = Purple::Roomlist PACKAGE = Purple::Roomlist PREFIX = purple_roomlist_ | 3 MODULE = Purple::Roomlist PACKAGE = Purple::Roomlist PREFIX = purple_roomlist_ |
4 PROTOTYPES: ENABLE | 4 PROTOTYPES: ENABLE |
5 | |
6 BOOT: | |
7 { | |
8 HV *room_stash = gv_stashpv("Purple::Roomlist::Room::Type", 1); | |
9 HV *field_stash = gv_stashpv("Purple::Roomlist::Field::Type", 1); | |
10 | |
11 static const constiv *civ, room_const_iv[] = { | |
12 #define const_iv(name) {#name, (IV)PURPLE_ROOMLIST_ROOMTYPE_##name} | |
13 const_iv(CATEGORY), | |
14 const_iv(ROOM), | |
15 }; | |
16 static const constiv field_const_iv[] = { | |
17 #undef const_iv | |
18 #define const_iv(name) {#name, (IV)PURPLE_ROOMLIST_FIELD_##name} | |
19 const_iv(BOOL), | |
20 const_iv(INT), | |
21 const_iv(STRING), | |
22 }; | |
23 | |
24 for (civ = room_const_iv + sizeof(room_const_iv) / sizeof(room_const_iv[0]); civ-- > room_const_iv; ) | |
25 newCONSTSUB(room_stash, (char *)civ->name, newSViv(civ->iv)); | |
26 | |
27 for (civ = field_const_iv + sizeof(field_const_iv) / sizeof(field_const_iv[0]); civ-- > field_const_iv; ) | |
28 newCONSTSUB(field_stash, (char *)civ->name, newSViv(civ->iv)); | |
29 } | |
5 | 30 |
6 void | 31 void |
7 purple_roomlist_cancel_get_list(list) | 32 purple_roomlist_cancel_get_list(list) |
8 Purple::Roomlist list | 33 Purple::Roomlist list |
9 | 34 |