ObjFW  socket.h at [eaa612ad50]

File src/socket.h artifact 49c77e6e7b part of check-in eaa612ad50


/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "objfw-defs.h"

#ifndef OF_HAVE_SOCKETS
# error No sockets available!
#endif

#include <stdbool.h>

#ifdef OF_HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif

#ifdef _WIN32
# include <ws2tcpip.h>
#endif

#ifdef __wii__
# define BOOL OGC_BOOL
# include <network.h>
# undef BOOL

struct sockaddr_storage {
	u8 ss_len;
	u8 ss_family;
	u8 ss_data[14];
};
#endif

#ifdef _PSP
# include <stdint.h>

struct sockaddr_storage {
	uint8_t	       ss_len;
	sa_family_t    ss_family;
	in_port_t      ss_data1;
	struct in_addr ss_data2;
	int8_t	       ss_data3[8];
};
#endif

extern bool of_init_sockets(void);