libcoap 4.3.5-develop-19cef11
libcoap.h
Go to the documentation of this file.
1/*
2 * libcoap.h -- platform specific header file for CoAP stack
3 *
4 * Copyright (C) 2015 Carsten Schoenert <c.schoenert@t-online.de>
5 *
6 * SPDX-License-Identifier: BSD-2-Clause
7 *
8 * This file is part of the CoAP library libcoap. Please see README for terms
9 * of use.
10 */
11
17#ifndef COAP_LIBCOAP_H_
18#define COAP_LIBCOAP_H_
19
20/* The non posix embedded platforms like Contiki-NG, TinyOS, RIOT, ... don't have
21 * a POSIX compatible header structure so we have to slightly do some platform
22 * related things. Currently there is only Contiki-NG available so we check for a
23 * CONTIKI environment and do *not* include the POSIX related network stuff. If
24 * there are other platforms in future there need to be analogous environments.
25 *
26 * The CONTIKI variable is within the Contiki-NG build environment! */
27
28#if defined(_WIN32)
29#include <ws2tcpip.h>
30#if !defined(__MINGW32__)
31#pragma comment(lib,"Ws2_32.lib")
32#ifndef _SSIZE_T_DECLARED
33typedef SSIZE_T ssize_t;
34#define _SSIZE_T_DECLARED
35#endif
36#ifndef _IN_PORT_T_DECLARED
37typedef USHORT in_port_t;
38#define _IN_PORT_T_DECLARED
39#endif
40#endif /* !defined(__MINGW32__) */
41#elif !defined (CONTIKI) && !defined (WITH_LWIP) && !defined (RIOT_VERSION)
42#include <netinet/in.h>
43#include <sys/socket.h>
44#endif /* ! CONTIKI && ! WITH_LWIP && ! RIOT_VERSION */
45
46#ifndef COAP_STATIC_INLINE
47# if defined(__cplusplus)
48# define COAP_STATIC_INLINE inline
49# else
50# if defined(_MSC_VER)
51# define COAP_STATIC_INLINE static __inline
52# else
53# define COAP_STATIC_INLINE static inline
54# endif
55# endif
56#endif
57
58#ifndef COAP_DEPRECATED
59# if defined(_MSC_VER)
60# define COAP_DEPRECATED __declspec(deprecated)
61# else
62# define COAP_DEPRECATED __attribute__ ((deprecated))
63# endif
64#endif
65
66#ifndef COAP_UNUSED
67# ifdef __GNUC__
68# define COAP_UNUSED __attribute__((unused))
69# else /* __GNUC__ */
70# define COAP_UNUSED
71# endif /* __GNUC__ */
72#endif /* COAP_UNUSED */
73
74#ifndef COAP_API
75#define COAP_API
76#endif
77
78void coap_startup(void);
79
80void coap_cleanup(void);
81
82#endif /* COAP_LIBCOAP_H_ */
void coap_cleanup(void)
Definition: coap_net.c:4662
void coap_startup(void)
Definition: coap_net.c:4616