pilot-link/pilot-link-0.11.2-malsync.patch
2006-03-29 13:43:24 +00:00

96 lines
2.2 KiB
Diff

--- pilot-link-0.11.2/bindings/Perl/Makefile.PL.in.malsync 2002-08-06 22:04:46.000000000 +0200
+++ pilot-link-0.11.2/bindings/Perl/Makefile.PL.in 2002-08-06 22:08:12.000000000 +0200
@@ -11,7 +11,7 @@
WriteMakefile(
'NAME' => 'PDA::Pilot',
'VERSION' => '@PILOT_LINK_VERS@.@PILOT_LINK_MAJOR@.@PILOT_LINK_MINOR@',
- 'LIBS' => $lib,
+ 'LDFROM' => "Pilot.o $lib",
'XSPROTOARG' => '-noprototypes',
'INC' => '-I../../include',
);
--- pilot-link-0.11.2/bindings/Perl/Pilot.pm.malsync 2001-12-30 21:26:00.000000000 +0100
+++ pilot-link-0.11.2/bindings/Perl/Pilot.pm 2002-08-06 22:04:46.000000000 +0200
@@ -755,8 +755,16 @@
Returns last DLP error, resetting error to zero.
+=item PDA::Pilot::DLP::socket()
+
+Returns DLP socket.
+
=item PDA::Pilot::DLP::GetSysDateTime(socket)
+=item PDA::Pilot::DLP::socket()
+
+Returns the socket in use by DLP.
+
Same as DLP call dlp_GetSysDateTime. If successfull, returns time, otherwise
returns undef.
--- pilot-link-0.11.2/bindings/Perl/Pilot.xs.malsync 2002-08-06 22:04:46.000000000 +0200
+++ pilot-link-0.11.2/bindings/Perl/Pilot.xs 2002-08-06 22:04:46.000000000 +0200
@@ -23,6 +23,10 @@
#include "XSUB.h"
#include "patchlevel.h"
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <netinet/tcp.h>
+
#include "pi-macros.h"
#include "pi-file.h"
#include "pi-datebook.h"
@@ -2270,7 +2274,7 @@
if (len > sizeof(mybuf))
len = sizeof(mybuf);
result = pi_read(socket, mybuf, len);
- if (result >=0)
+ if (result > 0)
RETVAL = newSVpv(mybuf, result);
else
RETVAL = &PL_sv_undef;
@@ -2353,6 +2357,26 @@
OUTPUT:
RETVAL
+int
+connect(port)
+ char * port
+ CODE:
+ {
+ struct pi_sockaddr a;
+ int socket;
+
+ socket = pi_socket(PI_AF_PILOT, PI_SOCK_STREAM, PI_PF_PADP);
+ strcpy(a.pi_device, port);
+ a.pi_family = PI_AF_PILOT;
+
+ if (pi_connect(socket, (struct sockaddr*)&a, sizeof(a)))
+ RETVAL = 0;
+ else
+ RETVAL = socket;
+ }
+ OUTPUT:
+ RETVAL
+
SV *
accept(socket)
int socket
@@ -3020,6 +3044,15 @@
OUTPUT:
RETVAL
+int
+socket(self)
+ PDA::Pilot::DLP * self
+ CODE:
+ RETVAL = self->socket;
+ OUTPUT:
+ RETVAL
+
+
SV *
getTime(self)
PDA::Pilot::DLP * self