Revision 58b9ee41 mongoose.h

View differences:

mongoose.h
1532 1532
#define CS_COMMON_PLATFORMS_PLATFORM_STM32_H_
1533 1533
#if CS_PLATFORM == CS_P_STM32
1534 1534

  
1535
#include <sys/types.h>
1535 1536
#include <stdint.h>
1537
#include <inttypes.h>
1536 1538
#include <stdio.h>
1537 1539
#include <ctype.h>
1538 1540
#include <errno.h>
1539 1541
#include <memory.h>
1540 1542

  
1541
/*
1542
 * Fake declarations to get c_hello compiling w/out network
1543
 * TODO(alashkin): remove this during working on stm32/cude networking
1544
 */
1545

  
1546
typedef int sock_t;
1547

  
1548
struct in_addr{
1549
  int s_addr;
1550
};
1551

  
1552
struct sockaddr {
1553
  int sa_family;
1554
};
1555

  
1556
struct sockaddr_in {
1557
  int sin_family;
1558
  int sin_port;
1559
  struct in_addr sin_addr;
1560
};
1561

  
1562
#define INVALID_SOCKET -1
1563
#define SOCK_DGRAM -1
1564
#define SOCK_STREAM -1
1565
#define AF_INET -1
1566

  
1567 1543
#define to64(x) strtoll(x, NULL, 10)
1568

  
1569
#define INT64_FMT "ld"
1544
#define INT64_FMT PRId64
1570 1545
#define SIZE_T_FMT "u"
1571 1546

  
1572
#define htonl(x) (x)
1573
#define htons(x) (x)
1574
#define ntohs(x) (x)
1575
#define ntohl(x) (x)
1576

  
1577
#define F_GETFL -1
1578
#define F_SETFL -1
1579
#define O_NONBLOCK -1
1580
#define fcntl(x1, x2, x3) (-1)
1581
#define socket(x1, x2, x3) (-1)
1582
#define connect(x1, x2, x3) (-1)
1583
#define setsockopt(x1, x2, x3, x4, x5) (-1)
1584
#define closesocket(x)
1585
typedef int socklen_t;
1586
#define accept(x1, x2, x3) (-1)
1587
#define SOMAXCONN -1
1588
#define listen(x1, x2) (-1)
1589
#define bind(x1, x2, x3) (-1)
1590
#define getsockname(x1, x2, x3) (-1)
1591
#define sendto(x1, x2, x3, x4, x5, x6) (-1)
1592
#define send(x1, x2, x3, x4) (-1)
1593
#define recvfrom(x1, x2, x3, x4, x5, x6) (-1)
1594
#define getsockopt(x1, x2, x3, x4, x5) (-1)
1595
#define getpeername(x1, x2, x3) (-1)
1596
#define recv(s, b, l, f) (-1)
1597
#define select(x1, x2, x3, x4, x5) (0)
1598

  
1599
const char *inet_ntop(int af, const void *src, char *dst, int size);
1600

  
1601 1547
#endif /* CS_PLATFORM == CS_P_STM32 */
1602 1548
#endif /* CS_COMMON_PLATFORMS_PLATFORM_STM32_H_ */
1603 1549
#ifdef MG_MODULE_LINES

Also available in: Unified diff