libcoap  4.3.1
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, TinyOS, RIOT, ... doesn't have
21  * a POSIX compatible header structure so we have to slightly do some platform
22  * related things. Currently there is only Contiki 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 build environment! */
27 
28 #if defined(_WIN32)
29 #pragma comment(lib,"Ws2_32.lib")
30 #include <ws2tcpip.h>
31 typedef SSIZE_T ssize_t;
32 typedef USHORT in_port_t;
33 #elif !defined (CONTIKI)
34 #include <netinet/in.h>
35 #include <sys/socket.h>
36 #endif /* CONTIKI */
37 
38 #ifndef COAP_STATIC_INLINE
39 # if defined(__cplusplus)
40 # define COAP_STATIC_INLINE inline
41 # else
42 # if defined(_MSC_VER)
43 # define COAP_STATIC_INLINE static __inline
44 # else
45 # define COAP_STATIC_INLINE static inline
46 # endif
47 # endif
48 #endif
49 #ifndef COAP_DEPRECATED
50 # if defined(_MSC_VER)
51 # define COAP_DEPRECATED __declspec(deprecated)
52 # else
53 # define COAP_DEPRECATED __attribute__ ((deprecated))
54 # endif
55 #endif
56 #ifndef COAP_UNUSED
57 # ifdef __GNUC__
58 # define COAP_UNUSED __attribute__((unused))
59 # else /* __GNUC__ */
60 # define COAP_UNUSED
61 # endif /* __GNUC__ */
62 #endif /* COAP_UNUSED */
63 
64 void coap_startup(void);
65 
66 void coap_cleanup(void);
67 
68 #endif /* COAP_LIBCOAP_H_ */
void coap_cleanup(void)
Definition: net.c:3445
void coap_startup(void)
Definition: net.c:3416