Mercurial > pidgin.yaz
annotate plugins/perl/common/Gaim.xs @ 6539:1690791f0c70
[gaim-migrate @ 7057]
Improved the debug commands for perl scripts.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Thu, 21 Aug 2003 01:50:02 +0000 |
parents | 390807f638b1 |
children | fe0294504602 |
rev | line source |
---|---|
6508 | 1 #include "module.h" |
6520
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
2 #include "../perl-handlers.h" |
6508 | 3 |
4 MODULE = Gaim PACKAGE = Gaim | |
5 PROTOTYPES: ENABLE | |
6 | |
7 void | |
6520
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
8 timeout_add(plugin, seconds, func, arg) |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
9 Gaim::Plugin plugin |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
10 int seconds |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
11 const char *func |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
12 void *arg |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
13 CODE: |
6528
390807f638b1
[gaim-migrate @ 7045]
Christian Hammond <chipx86@chipx86.com>
parents:
6520
diff
changeset
|
14 gaim_perl_timeout_add(plugin, seconds, func, arg); |
6520
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
15 |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
16 void |
6539
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
17 debug(level, category, string) |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
18 const char *level |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
19 const char *category |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
20 const char *string |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
21 CODE: |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
22 if (!strcmp(level, "misc")) |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
23 gaim_debug(GAIM_DEBUG_MISC, category, string); |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
24 else if (!strcmp(level, "info")) |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
25 gaim_debug(GAIM_DEBUG_INFO, category, string); |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
26 else if (!strcmp(level, "warning")) |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
27 gaim_debug(GAIM_DEBUG_WARNING, category, string); |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
28 else if (!strcmp(level, "error")) |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
29 gaim_debug(GAIM_DEBUG_ERROR, category, string); |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
30 else if (!strcmp(level, "fatal")) |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
31 gaim_debug(GAIM_DEBUG_FATAL, category, string); |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
32 else |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
33 croak("Unknown debug level type '%s'", level); |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
34 |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
35 void |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
36 debug_misc(category, string) |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
37 const char *category |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
38 const char *string |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
39 CODE: |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
40 gaim_debug(GAIM_DEBUG_MISC, category, string); |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
41 |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
42 void |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
43 debug_info(category, string) |
6520
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
44 const char *category |
6508 | 45 const char *string |
46 CODE: | |
6520
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
47 gaim_debug(GAIM_DEBUG_INFO, category, string); |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
48 |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
49 void |
6539
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
50 debug_warning(category, string) |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
51 const char *category |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
52 const char *string |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
53 CODE: |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
54 gaim_debug(GAIM_DEBUG_WARNING, category, string); |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
55 |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
56 void |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
57 debug_error(category, string) |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
58 const char *category |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
59 const char *string |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
60 CODE: |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
61 gaim_debug(GAIM_DEBUG_ERROR, category, string); |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
62 |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
63 void |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
64 debug_fatal(category, string) |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
65 const char *category |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
66 const char *string |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
67 CODE: |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
68 gaim_debug(GAIM_DEBUG_FATAL, category, string); |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
69 |
1690791f0c70
[gaim-migrate @ 7057]
Christian Hammond <chipx86@chipx86.com>
parents:
6528
diff
changeset
|
70 void |
6520
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
71 deinit() |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
72 PREINIT: |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
73 GList *l; |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
74 CODE: |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
75 gaim_perl_timeout_clear(); |
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
76 |
6508 | 77 |
78 BOOT: | |
79 GAIM_PERL_BOOT(Account); | |
6520
2e2593d95121
[gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
80 |