"Fossies" - the Fresh Open Source Software Archive

Member "libgphoto2-2.5.27/camlibs/ptp2/ptpip-private.h" (13 Dec 2020, 1540 Bytes) of package /linux/privat/libgphoto2-2.5.27.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ptpip-private.h" see the Fossies "Dox" file reference documentation.

    1 /* ptpip-private.h
    2  *
    3  * Copyright (C) 2020 Daniel Schulte <trilader@schroedingers-bit.net>
    4  *
    5  * This library is free software; you can redistribute it and/or
    6  * modify it under the terms of the GNU Lesser General Public
    7  * License as published by the Free Software Foundation; either
    8  * version 2 of the License, or (at your option) any later version.
    9  *
   10  * This library is distributed in the hope that it will be useful,
   11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   13  * Lesser General Public License for more details.
   14  *
   15  * You should have received a copy of the GNU Lesser General Public
   16  * License along with this library; if not, write to the
   17  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   18  * Boston, MA  02110-1301  USA
   19  */
   20 
   21 /* Definitions for PTP/IP to work with WinSock and regular BSD-style sockets */
   22 
   23 #ifdef WIN32
   24 # define PTPSOCK_SOCKTYPE SOCKET
   25 # define PTPSOCK_INVALID INVALID_SOCKET
   26 # define PTPSOCK_CLOSE closesocket
   27 # define PTPSOCK_ERR SOCKET_ERROR
   28 # define PTPSOCK_READ(fd, buf, size) recv((fd), ((char*)(buf)), (size), 0)
   29 # define PTPSOCK_WRITE(fd, buf, size) send((fd), ((char*)(buf)), (size), 0)
   30 # define PTPSOCK_PROTO IPPROTO_TCP
   31 #else
   32 # define PTPSOCK_SOCKTYPE int
   33 # define PTPSOCK_INVALID -1
   34 # define PTPSOCK_CLOSE close
   35 # define PTPSOCK_ERR -1
   36 # define PTPSOCK_READ(fd, buf, size) read((fd), (buf), (size))
   37 # define PTPSOCK_WRITE(fd, buf, size) write((fd), (buf), (size))
   38 # define PTPSOCK_PROTO 0
   39 #endif