Octave-Forge - Extra packages for GNU Octave | |
Home · Packages · Developers · Documentation · FAQ · Bugs · Mailing Lists · Links · Code |
00001 /* -*- buffer-read-only: t -*- vi: set ro: */ 00002 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 00003 /* sockets.h - wrappers for Windows socket functions 00004 00005 Copyright (C) 2008-2011 Free Software Foundation, Inc. 00006 00007 This program is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00019 00020 /* Written by Simon Josefsson */ 00021 00022 #ifndef SOCKETS_H 00023 # define SOCKETS_H 1 00024 00025 #define SOCKETS_1_0 0x100 /* don't use - does not work on Windows XP */ 00026 #define SOCKETS_1_1 0x101 00027 #define SOCKETS_2_0 0x200 /* don't use - does not work on Windows XP */ 00028 #define SOCKETS_2_1 0x201 00029 #define SOCKETS_2_2 0x202 00030 00031 int gl_sockets_startup (int version); 00032 int gl_sockets_cleanup (void); 00033 00034 /* This function is useful it you create a socket using gnulib's 00035 Winsock wrappers but needs to pass on the socket handle to some 00036 other library that only accepts sockets. */ 00037 #if WINDOWS_SOCKETS 00038 00039 #include <sys/socket.h> 00040 00041 static inline SOCKET 00042 gl_fd_to_handle (int fd) 00043 { 00044 return _get_osfhandle (fd); 00045 } 00046 00047 #else 00048 00049 #define gl_fd_to_handle(x) (x) 00050 00051 #endif /* WINDOWS_SOCKETS */ 00052 00053 #endif /* SOCKETS_H */