libcoap  4.3.0rc1
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  * This file is part of the CoAP library libcoap. Please see README for terms
7  * of use.
8  */
9 
10 #ifndef COAP_LIBCOAP_H_
11 #define COAP_LIBCOAP_H_
12 
13 /* The non posix embedded platforms like Contiki, TinyOS, RIOT, ... doesn't have
14  * a POSIX compatible header structure so we have to slightly do some platform
15  * related things. Currently there is only Contiki available so we check for a
16  * CONTIKI environment and do *not* include the POSIX related network stuff. If
17  * there are other platforms in future there need to be analogous environments.
18  *
19  * The CONTIKI variable is within the Contiki build environment! */
20 
21 #if defined(_WIN32)
22 #pragma comment(lib,"Ws2_32.lib")
23 #include <ws2tcpip.h>
24 typedef SSIZE_T ssize_t;
25 typedef USHORT in_port_t;
26 #elif !defined (CONTIKI)
27 #include <netinet/in.h>
28 #include <sys/socket.h>
29 #endif /* CONTIKI */
30 
31 #ifndef COAP_STATIC_INLINE
32 # if defined(__cplusplus)
33 # define COAP_STATIC_INLINE inline
34 # else
35 # if defined(_MSC_VER)
36 # define COAP_STATIC_INLINE static __inline
37 # else
38 # define COAP_STATIC_INLINE static inline
39 # endif
40 # endif
41 #endif
42 #ifndef COAP_DEPRECATED
43 # if defined(_MSC_VER)
44 # define COAP_DEPRECATED __declspec(deprecated)
45 # else
46 # define COAP_DEPRECATED __attribute__ ((deprecated))
47 # endif
48 #endif
49 #ifndef COAP_UNUSED
50 # ifdef __GNUC__
51 # define COAP_UNUSED __attribute__((unused))
52 # else /* __GNUC__ */
53 # define COAP_UNUSED
54 # endif /* __GNUC__ */
55 #endif /* COAP_UNUSED */
56 
57 void coap_startup(void);
58 
59 void coap_cleanup(void);
60 
61 #endif /* COAP_LIBCOAP_H_ */
void coap_cleanup(void)
Definition: net.c:3126
void coap_startup(void)
Definition: net.c:3106