comparison libpurple/plugins/perl/common/Proxy.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 8e54f40a60f3
comparison
equal deleted inserted replaced
16700:79bc35a19de5 16739:39c7bb133a9f
1 #include "module.h" 1 #include "module.h"
2 2
3 MODULE = Purple::Proxy PACKAGE = Purple::Proxy PREFIX = purple_proxy_ 3 MODULE = Purple::Proxy PACKAGE = Purple::Proxy PREFIX = purple_proxy_
4 PROTOTYPES: ENABLE 4 PROTOTYPES: ENABLE
5
6 BOOT:
7 {
8 HV *stash = gv_stashpv("Purple::ProxyType::", 1);
9
10 static const constiv *civ, const_iv[] = {
11 #define const_iv(name) {#name, (IV)PURPLE_PROXY_##name}
12 const_iv(USE_GLOBAL),
13 const_iv(NONE),
14 const_iv(HTTP),
15 const_iv(SOCKS4),
16 const_iv(SOCKS5),
17 const_iv(USE_ENVVAR),
18 };
19
20 for (civ = const_iv + sizeof(const_iv) / sizeof(const_iv[0]); civ-- > const_iv; )
21 newCONSTSUB(stash, (char *)civ->name, newSViv(civ->iv));
22 }
5 23
6 Purple::ProxyInfo 24 Purple::ProxyInfo
7 purple_global_proxy_get_info() 25 purple_global_proxy_get_info()
8 26
9 Purple::Handle 27 Purple::Handle