Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / socket / cpp / sk_constants.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        ext/socket/cpp/sk_constants.cpp
3 // Purpose:     constants for Wx::Socket
4 // Author:      Graciliano M. P.
5 // Created:     27/02/2003
6 // RCS-ID:      $Id: sk_constants.cpp 2517 2008-11-30 20:14:22Z mbarbon $
7 // Copyright:   (c) 2003, 2007 Graciliano M. P.
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 #include "cpp/constants.h"
13
14 double socket_constant( const char* name, int arg )
15 {
16     // !package: Wx
17     // !parser: sub { $_[0] =~ m<^\s*r\w*\(\s*(\w+)\s*\);\s*(?://(.*))?$> }
18     // !tag: socket
19 #define r( n ) \
20     if( strEQ( name, #n ) ) \
21         return n;
22
23     WX_PL_CONSTANT_INIT();
24
25     switch( fl )
26     {
27         case 'E':
28         r( wxEVT_SOCKET );
29         case 'S':
30         r( wxSOCKET_BLOCK );
31         r( wxSOCKET_NONE );
32         r( wxSOCKET_NOWAIT );
33         r( wxSOCKET_WAITALL );
34         r( wxSOCKET_REUSEADDR );
35 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
36         r( wxSOCKET_NOBIND );
37         r( wxSOCKET_BROADCAST );
38 #endif
39         
40         r( wxSOCKET_CONNECTION_FLAG );
41         r( wxSOCKET_INPUT_FLAG );
42         r( wxSOCKET_LOST_FLAG );
43         r( wxSOCKET_OUTPUT_FLAG );
44         
45         /// wxSocketNotify
46         r( wxSOCKET_INPUT );
47         r( wxSOCKET_OUTPUT );
48         r( wxSOCKET_CONNECTION );
49         r( wxSOCKET_LOST );
50         
51         /// wxSocketType:
52         r( wxSOCKET_UNINIT );
53         r( wxSOCKET_CLIENT );
54         r( wxSOCKET_SERVER );
55         r( wxSOCKET_BASE );
56         r( wxSOCKET_DATAGRAM );
57         
58         /// wxSocketError
59         r( wxSOCKET_NOERROR );
60         r( wxSOCKET_INVOP );
61         r( wxSOCKET_IOERR );
62         r( wxSOCKET_INVADDR );
63         r( wxSOCKET_INVSOCK );                
64         r( wxSOCKET_NOHOST );
65         r( wxSOCKET_INVPORT );
66         r( wxSOCKET_WOULDBLOCK );
67         r( wxSOCKET_TIMEDOUT );
68         r( wxSOCKET_MEMERR );
69     break;
70     }
71 #undef r
72
73     WX_PL_CONSTANT_CLEANUP();
74 }
75
76 wxPlConstants socket_module( &socket_constant );
77
78