libpurple/plugins/perl/common/Debug.xs

Thu, 30 Oct 2008 22:40:49 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Thu, 30 Oct 2008 22:40:49 +0000
changeset 24569
5dbd0617a27d
parent 16773
e1171eb45f07
child 18068
b6554e3c8224
permissions
-rw-r--r--

Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
to detect when we're still using deprecated functions internally (and by
extension, when we've deprecated something we shouldn't have). In the
course of developing this changeset, I fixed a few such cases.

Given that the plan is to switch from PURPLE_HIDE_STRUCTS to
PURPLE_DISABLE_DEPRECATED as each struct is fully dealt with, this will
also ensure we have no regressions on the struct hiding work.

Deprecated functions are still available to the respective .c file, to
avoid missing prototype errors. Also, Perl and DBus undef the
*_DISABLE_DEPRECATED defines as appropriate so that deprecated functions
will still be exported to Perl plugins and via DBus. (Otherwise, we'd
be breaking backwards compatibility.)

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