diff src/perl.c @ 3280:c98c1e0281ff

[gaim-migrate @ 3298] Perl can play sounds! committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 29 May 2002 01:44:40 +0000
parents dab4da8ca29a
children c731327dbc47
line wrap: on
line diff
--- a/src/perl.c	Wed May 29 01:23:38 2002 +0000
+++ b/src/perl.c	Wed May 29 01:44:40 2002 +0000
@@ -105,6 +105,9 @@
 XS(XS_GAIM_add_event_handler); /* when servers talk */
 XS(XS_GAIM_add_timeout_handler); /* figure it out */
 
+/* play sound */
+XS(XS_GAIM_play_sound); /*play a sound*/
+
 void xs_init()
 {
 	char *file = __FILE__;
@@ -238,6 +241,8 @@
 
 	newXS ("GAIM::add_event_handler", XS_GAIM_add_event_handler, "GAIM");
 	newXS ("GAIM::add_timeout_handler", XS_GAIM_add_timeout_handler, "GAIM");
+
+	newXS ("GAIM::play_sound", XS_GAIM_play_sound, "GAIM");
 }
 
 void perl_end()
@@ -617,6 +622,8 @@
 	XSRETURN(0);
 }
 
+
+	
 XS (XS_GAIM_print_to_chat)
 {
 	struct gaim_connection *gc;
@@ -833,6 +840,18 @@
 	XSRETURN_EMPTY;
 }
 
+XS (XS_GAIM_play_sound)
+{
+	int id;
+	dXSARGS;
+
+	id = SvIV(ST(0));
+
+	play_sound(id);
+
+	XSRETURN_EMPTY;
+}
+
 extern void unload_perl_scripts()
 {
 	perl_end();