diff -u -r GSMD-Gnokii-orig/Gnokii.xs GSMD-Gnokii-new/Gnokii.xs --- GSMD-Gnokii-orig/Gnokii.xs 2003-08-24 16:06:49.000000000 +0200 +++ GSMD-Gnokii-new/Gnokii.xs 2003-09-07 20:58:59.000000000 +0200 @@ -1,10 +1,17 @@ -/*#include -#include -#include */ -#include -#include #include +#ifndef false +# define false (0) +#endif + +#ifndef true +# define true (!false) +#endif + +#ifndef gn_bool +# define gn_bool int +#endif + #include "EXTERN.h" #include "perl.h" #include "XSUB.h" @@ -123,8 +130,8 @@ State.config.init_length = ((value = hv_fetch(ghash,"initlength",10,0)) == NULL) ? 0 : SvIV(*value); State.config.serial_baudrate = ((value = hv_fetch(ghash,"serial_baudrate",15,0)) == NULL) ? 19200 : SvIV(*value); State.config.serial_write_usleep = ((value = hv_fetch(ghash,"serial_write_usleep",19,0)) == NULL) ? -1 : SvIV(*value); - State.config.hardware_handshake = ((value = hv_fetch(ghash,"hardware_handshake",18,0)) == NULL) ? false : (bool)SvIV(*value); - State.config.require_dcd = ((value = hv_fetch(ghash,"require_dcd",11,0)) == NULL) ? false : (bool)SvIV(*value); + State.config.hardware_handshake = ((value = hv_fetch(ghash,"hardware_handshake",18,0)) == NULL) ? false : (gn_bool)SvIV(*value); + State.config.require_dcd = ((value = hv_fetch(ghash,"require_dcd",11,0)) == NULL) ? false : (gn_bool)SvIV(*value); State.config.smsc_timeout = ((value = hv_fetch(ghash,"smsc_timeout",12,0)) == NULL) ? 0 : (unsigned int)SvIV(*value); #ifdef DEBUG_MODULE printf("dcd: %d\n", State.config.require_dcd); @@ -1058,22 +1065,22 @@ hv_store(phash, "defaultname", 11, sv_2mortal(newSViv(p->default_name)), 0); switch(p->call_alert) { - case PROFILE_CALLALERT_RINGING: + case GN_PROFILE_CALLALERT_Ringing: hv_store(phash, "callalert", 9, sv_2mortal(newSVpv("Ringing", 0)), 0); break; - case PROFILE_CALLALERT_ASCENDING: + case GN_PROFILE_CALLALERT_Ascending: hv_store(phash, "callalert", 9, sv_2mortal(newSVpv("Ringing", 0)), 0); break; - case PROFILE_CALLALERT_RINGONCE: + case GN_PROFILE_CALLALERT_RingOnce: hv_store(phash, "callalert", 9, sv_2mortal(newSVpv("Ringing", 0)), 0); break; - case PROFILE_CALLALERT_BEEPONCE: + case GN_PROFILE_CALLALERT_BeepOnce: hv_store(phash, "callalert", 9, sv_2mortal(newSVpv("Ringing", 0)), 0); break; - case PROFILE_CALLALERT_CALLERGROUPS: + case GN_PROFILE_CALLALERT_CallerGroups: hv_store(phash, "callalert", 9, sv_2mortal(newSVpv("Ringing", 0)), 0); break; - case PROFILE_CALLALERT_OFF: + case GN_PROFILE_CALLALERT_Off: hv_store(phash, "callalert", 9, sv_2mortal(newSVpv("Off", 0)), 0); break; default: @@ -1082,19 +1089,19 @@ hv_store(phash, "ringtonenumber", 14, sv_2mortal(newSViv(p->ringtone)), 0); switch(p->volume) { - case PROFILE_VOLUME_LEVEL1: + case GN_PROFILE_VOLUME_Level1: hv_store(phash, "volume_level", 12, sv_2mortal(newSVpv("Level 1", 0)), 0); break; - case PROFILE_VOLUME_LEVEL2: + case GN_PROFILE_VOLUME_Level2: hv_store(phash, "volume_level", 12, sv_2mortal(newSVpv("Level 2", 0)), 0); break; - case PROFILE_VOLUME_LEVEL3: + case GN_PROFILE_VOLUME_Level3: hv_store(phash, "volume_level", 12, sv_2mortal(newSVpv("Level 3", 0)), 0); break; - case PROFILE_VOLUME_LEVEL4: + case GN_PROFILE_VOLUME_Level4: hv_store(phash, "volume_level", 12, sv_2mortal(newSVpv("Level 4", 0)), 0); break; - case PROFILE_VOLUME_LEVEL5: + case GN_PROFILE_VOLUME_Level5: hv_store(phash, "volume_level", 12, sv_2mortal(newSVpv("Level 5", 0)), 0); break; default: @@ -1102,19 +1109,19 @@ } switch(p->message_tone) { - case PROFILE_MESSAGE_NOTONE: + case GN_PROFILE_MESSAGE_NoTone: hv_store(phash, "message_tone", 12, sv_2mortal(newSVpv("No tone", 0)), 0); break; - case PROFILE_MESSAGE_STANDARD: + case GN_PROFILE_MESSAGE_Standard: hv_store(phash, "message_tone", 12, sv_2mortal(newSVpv("Standard", 0)), 0); break; - case PROFILE_MESSAGE_SPECIAL: + case GN_PROFILE_MESSAGE_Special: hv_store(phash, "message_tone", 12, sv_2mortal(newSVpv("Special", 0)), 0); break; - case PROFILE_MESSAGE_BEEPONCE: + case GN_PROFILE_MESSAGE_BeepOnce: hv_store(phash, "message_tone", 12, sv_2mortal(newSVpv("Beep once", 0)), 0); break; - case PROFILE_MESSAGE_ASCENDING: + case GN_PROFILE_MESSAGE_Ascending: hv_store(phash, "message_tone", 12, sv_2mortal(newSVpv("Ascending", 0)), 0); break; default: @@ -1122,16 +1129,16 @@ } switch(p->keypad_tone) { - case PROFILE_KEYPAD_OFF: + case GN_PROFILE_KEYVOL_Off: hv_store(phash, "keypad_tone", 11, sv_2mortal(newSVpv("Off", 0)), 0); break; - case PROFILE_KEYPAD_LEVEL1: + case GN_PROFILE_KEYVOL_Level1: hv_store(phash, "keypad_tone", 11, sv_2mortal(newSVpv("Level 1", 0)), 0); break; - case PROFILE_KEYPAD_LEVEL2: + case GN_PROFILE_KEYVOL_Level2: hv_store(phash, "keypad_tone", 11, sv_2mortal(newSVpv("Level 2", 0)), 0); break; - case PROFILE_KEYPAD_LEVEL3: + case GN_PROFILE_KEYVOL_Level3: hv_store(phash, "keypad_tone", 11, sv_2mortal(newSVpv("Level 3", 0)), 0); break; default: @@ -1139,10 +1146,10 @@ } switch(p->warning_tone) { - case PROFILE_WARNING_OFF: + case GN_PROFILE_WARNING_Off: hv_store(phash, "warning_tone", 12, sv_2mortal(newSVpv("Off", 0)), 0); break; - case PROFILE_WARNING_ON: + case GN_PROFILE_WARNING_On: hv_store(phash, "warning_tone", 12, sv_2mortal(newSVpv("On", 0)), 0); break; default: @@ -1150,10 +1157,10 @@ } switch(p->vibration) { - case PROFILE_VIBRATION_OFF: + case GN_PROFILE_VIBRATION_Off: hv_store(phash, "vibration", 9, sv_2mortal(newSVpv("Off", 0)), 0); break; - case PROFILE_VIBRATION_ON: + case GN_PROFILE_VIBRATION_On: hv_store(phash, "vibration", 9, sv_2mortal(newSVpv("On", 0)), 0); break; default: diff -u -r GSMD-Gnokii-orig/Makefile.PL GSMD-Gnokii-new/Makefile.PL --- GSMD-Gnokii-orig/Makefile.PL 2003-08-24 16:06:30.000000000 +0200 +++ GSMD-Gnokii-new/Makefile.PL 2003-09-07 21:22:45.000000000 +0200 @@ -1,14 +1,6 @@ use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. -if(!defined($ENV{"GNOKII_DIR"}) && !(-d '/var/tmp/gnokii')) -{ - print "Either unpack and compile gnokii in /var/tmp or set the ENVVAR GNOKII_DIR\n"; - exit(-1); -} - -$GNOKIIDIR=$ENV{"GNOKII_DIR"} || "/var/tmp/gnokii"; - WriteMakefile( @@ -16,10 +8,10 @@ 'VERSION_FROM' => 'Gnokii.pm', # finds $VERSION 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1 # 'LIBS' => ['-L/usr/local/lib -lgnokii'], # e.g., '-lm' - 'LIBS' => ["-L$GNOKIIDIR/common -L/usr/X11R6/lib -lgnokii -lXpm"], # e.g., '-lm' + 'LIBS' => ["-L/usr/local/lib -L/usr/X11R6/lib -lgnokii -lXpm"], # e.g., '-lm' 'TYPEMAPS' => ['perlobject.map' ], 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING' # 'INC' => '-I/home/elwood/netsrc/gnokii-0.4.3/include', # e.g., '-I/usr/include/other' - 'INC' => "-I$GNOKIIDIR/include -I$GNOKIIDIR/gnokii", # e.g., '-I/usr/include/other' + 'INC' => "-I/usr/local/include", # e.g., '-I/usr/include/other' 'OPTIMIZE' => '-g' );