hostlib.h
Go to the documentation of this file.
1 /****
2  * hostlib.h
3  *
4  * Copyright 2019 mikee47 <mike@sillyhouse.net>
5  *
6  * This file is part of the Sming Framework Project
7  *
8  * This library is free software: you can redistribute it and/or modify it under the terms of the
9  * GNU General Public License as published by the Free Software Foundation, version 3 or later.
10  *
11  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  * See the GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along with SHEM.
16  * If not, see <https://www.gnu.org/licenses/>.
17  *
18  ****/
19 
20 #pragma once
21 
22 #ifdef __WIN32
23 // Prevent early inclusion of winsock.h
24 #include <winsock2.h>
25 #endif
26 
27 #include <fcntl.h>
28 #include <limits.h>
29 #include <stdint.h>
30 #include <stdbool.h>
31 #include <stddef.h>
32 #include <unistd.h>
33 
34 #ifndef ARRAY_SIZE
35 #define ARRAY_SIZE(x) (int)(sizeof(x) / sizeof((x)[0]))
36 #endif
37 
38 // Used for parameterised token pasting
39 #ifndef JOIN
40 #define JOIN_AGAIN(_a, _b) _a##_b
41 #define JOIN(_a, _b) JOIN_AGAIN(_a, _b)
42 #endif
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 int msleep(unsigned ms);
49 
56 size_t getHostAppDir(char* path, size_t bufSize);
57 
58 #ifdef __cplusplus
59 }
60 #endif
size_t getHostAppDir(char *path, size_t bufSize)
Get directory where application is executing from.
int msleep(unsigned ms)