libpurple/plugins/perl/common/Debug.xs

Tue, 01 May 2007 02:34:22 +0000

author
Etan Reisner <deryni@pidgin.im>
date
Tue, 01 May 2007 02:34:22 +0000
changeset 16773
e1171eb45f07
parent 15894
765ec644ac47
child 18068
b6554e3c8224
permissions
-rw-r--r--

Remove the const-c and const-xs stuff and replace it with real constants
exposed to perl.

13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
1 #include "module.h"
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
2
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
3 MODULE = Purple::Debug PACKAGE = Purple::Debug PREFIX = purple_debug_
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
4 PROTOTYPES: ENABLE
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
5
16773
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
6 BOOT:
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
7 {
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
8 HV *stash = gv_stashpv("Purple::Debug", 1);
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
9
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
10 static const constiv *civ, const_iv[] = {
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
11 #define const_iv(name) {#name, (IV)PURPLE_DEBUG_##name}
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
12 const_iv(ALL),
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
13 const_iv(MISC),
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
14 const_iv(INFO),
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
15 const_iv(WARNING),
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
16 const_iv(ERROR),
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
17 const_iv(FATAL),
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
18 };
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
19
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
20 for (civ = const_iv + sizeof(const_iv) / sizeof(const_iv[0]); civ-- > const_iv; )
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
21 newCONSTSUB(stash, (char *)civ->name, newSViv(civ->iv));
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
22 }
e1171eb45f07 Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents: 15894
diff changeset
23
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
24 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
25 purple_debug(level, category, string)
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
26 Purple::DebugLevel level
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
27 const char *category
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
28 const char *string
15257
c94113912aca [gaim-migrate @ 17984]
Mark Doliner <markdoliner@pidgin.im>
parents: 14254
diff changeset
29 CODE:
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
30 purple_debug(level, category, "%s", string);
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
31
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
32 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
33 purple_debug_misc(category, string)
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
34 const char *category
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
35 const char *string
15257
c94113912aca [gaim-migrate @ 17984]
Mark Doliner <markdoliner@pidgin.im>
parents: 14254
diff changeset
36 CODE:
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
37 purple_debug_misc(category, "%s", string);
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
38
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
39 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
40 purple_debug_info(category, string)
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
41 const char *category
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
42 const char *string
15257
c94113912aca [gaim-migrate @ 17984]
Mark Doliner <markdoliner@pidgin.im>
parents: 14254
diff changeset
43 CODE:
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
44 purple_debug_info(category, "%s", string);
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
45
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
46 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
47 purple_debug_warning(category, string)
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
48 const char *category
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
49 const char *string
15257
c94113912aca [gaim-migrate @ 17984]
Mark Doliner <markdoliner@pidgin.im>
parents: 14254
diff changeset
50 CODE:
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
51 purple_debug_warning(category, "%s", string);
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
52
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
53 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
54 purple_debug_error(category, string)
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
55 const char *category
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
56 const char *string
15257
c94113912aca [gaim-migrate @ 17984]
Mark Doliner <markdoliner@pidgin.im>
parents: 14254
diff changeset
57 CODE:
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
58 purple_debug_error(category, "%s", string);
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
59
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
60 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
61 purple_debug_fatal(category, string)
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
62 const char *category
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
63 const char *string
15257
c94113912aca [gaim-migrate @ 17984]
Mark Doliner <markdoliner@pidgin.im>
parents: 14254
diff changeset
64 CODE:
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
65 purple_debug_fatal(category, "%s", string);
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
66
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
67 void
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
68 purple_debug_set_enabled(enabled)
13191
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
69 gboolean enabled
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
70
6c98c6130701 [gaim-migrate @ 15553]
Etan Reisner <deryni@pidgin.im>
parents:
diff changeset
71 gboolean
15894
765ec644ac47 Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents: 15435
diff changeset
72 purple_debug_is_enabled()

mercurial