summaryrefslogtreecommitdiff
path: root/firmware/export/load_code.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/load_code.h')
-rw-r--r--firmware/export/load_code.h20
1 files changed, 4 insertions, 16 deletions
diff --git a/firmware/export/load_code.h b/firmware/export/load_code.h
index 6f8505aba7..cca577044e 100644
--- a/firmware/export/load_code.h
+++ b/firmware/export/load_code.h
@@ -25,10 +25,11 @@
25 25
26#include "config.h" 26#include "config.h"
27 27
28extern void *lc_open(const char *filename, unsigned char *buf, size_t buf_size);
29
28#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 30#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
29#include "system.h" 31#include "system.h"
30 32
31extern void *lc_open(const char *filename, unsigned char *buf, size_t buf_size);
32/* header is always at the beginning of the blob, and handle actually points 33/* header is always at the beginning of the blob, and handle actually points
33 * to the start of the blob (the header is there) */ 34 * to the start of the blob (the header is there) */
34static inline void *lc_open_from_mem(void* addr, size_t blob_size) 35static inline void *lc_open_from_mem(void* addr, size_t blob_size)
@@ -44,23 +45,10 @@ static inline void lc_close(void *handle) { (void)handle; }
44 45
45#elif (CONFIG_PLATFORM & PLATFORM_HOSTED) 46#elif (CONFIG_PLATFORM & PLATFORM_HOSTED)
46 47
47/* don't call these directly for loading code 48extern void *lc_open_from_mem(void* addr, size_t blob_size);
48 * they're to be wrapped by platform specific functions */
49#ifdef WIN32
50/* windows' LoadLibrary can only handle ucs2, no utf-8 */
51#define _lc_open_char wchar_t
52#else
53#define _lc_open_char char
54#endif
55extern void *_lc_open(const _lc_open_char *filename, unsigned char *buf, size_t buf_size);
56extern void *_lc_get_header(void *handle);
57extern void _lc_close(void *handle);
58
59extern void *lc_open(const char *filename, unsigned char *buf, size_t buf_size);
60extern void *lc_open_from_mem(void *addr, size_t blob_size);
61extern void *lc_get_header(void *handle); 49extern void *lc_get_header(void *handle);
62extern void lc_close(void *handle); 50extern void lc_close(void *handle);
63extern const char* lc_last_error(void); 51
64#endif 52#endif
65 53
66/* this struct needs to be the first part of other headers 54/* this struct needs to be the first part of other headers