Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / socket / XS / DatagramSocket.xsp
1 #############################################################################
2 ## Name:        ext/socket/XS/DatagramSocket.xsp
3 ## Purpose:     XS++ for Wx::DatagramSocket
4 ## Author:      Mattia Barbon
5 ## Created:     24/01/2004
6 ## RCS-ID:      $Id: DatagramSocket.xsp 2079 2007-07-08 21:18:04Z mbarbon $
7 ## Copyright:   (c) 2004 Mattia Barbon
8 ## Licence:     This program is free software; you can redistribute it and/or
9 ##              modify it under the same terms as Perl itself
10 #############################################################################
11
12 %module{Wx};
13
14 %typemap{wxSockAddress&}{reference};
15 %typemap{wxDatagramSocket*}{simple};
16 %typemap{wxSocketFlags}{simple};
17
18 %name{Wx::DatagramSocket} class wxDatagramSocket
19 {
20     wxDatagramSocket(wxSockAddress& addr, wxSocketFlags flags = wxSOCKET_NONE)
21         %code{% RETVAL = new wxPliDatagramSocket( CLASS , *addr, flags ); %};
22 };
23
24 %{
25
26 size_t
27 wxDatagramSocket::RecvFrom( addr, buf, nBytes )
28     wxSockAddress* addr
29     SV* buf
30     wxUint32 nBytes
31   CODE:
32     DO_READ( THIS->RecvFrom( *addr, buffer, nBytes ), buf, nBytes, 0 );
33   OUTPUT: RETVAL
34
35 size_t
36 wxDatagramSocket::SendTo( addr, buf, nBytes )
37     wxSockAddress* addr
38     SV* buf
39     wxUint32 nBytes
40   CODE:
41     DO_WRITE( THIS->SendTo( *addr, buffer, nBytes ), buf, nBytes );
42   OUTPUT: RETVAL
43
44 %}