Implemented the cross-platform bits of uiInit().
This commit is contained in:
parent
5e45afd0a2
commit
74b1e2780d
|
@ -0,0 +1,36 @@
|
||||||
|
// 19 april 2019
|
||||||
|
#include <string.h>
|
||||||
|
#include "ui.h"
|
||||||
|
#include "uipriv.h"
|
||||||
|
|
||||||
|
static int initialized = 0;
|
||||||
|
|
||||||
|
int uiprivInitCheckParams(void *options, uiInitError *err)
|
||||||
|
{
|
||||||
|
if (err == NULL)
|
||||||
|
return 0;
|
||||||
|
if (err->Size != sizeof (uiInitError))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (initialized)
|
||||||
|
return uiprivInitReturnError(err, "xxxxxxxxx");
|
||||||
|
|
||||||
|
if (options != NULL)
|
||||||
|
return uiprivInitReturnError(err, "xxxxxxxx");
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int uiprivInitReturnError(uiInitError *err, const char *msg)
|
||||||
|
{
|
||||||
|
strncpy(err->Message, msg, 256);
|
||||||
|
if (err->Message[255] != '\0')
|
||||||
|
// TODO there should be some check to make sure this doesn't happen
|
||||||
|
err->Message[255] = '\0';
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void uiprivMarkInitialized(void)
|
||||||
|
{
|
||||||
|
initialized = 1;
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
# 23 march 2019
|
||||||
|
|
||||||
|
libui_sources += [
|
||||||
|
'common/init.c',
|
||||||
|
]
|
|
@ -0,0 +1,6 @@
|
||||||
|
// 19 april 2019
|
||||||
|
|
||||||
|
// init.c
|
||||||
|
extern int uiprivInitCheckParams(void *options, uiInitError *err);
|
||||||
|
extern int uiprivInitReturnError(uiInitError *err, const char *msg);
|
||||||
|
extern void uiprivMarkInitialized(void);
|
|
@ -140,8 +140,7 @@ libui_sources = []
|
||||||
libui_deps = []
|
libui_deps = []
|
||||||
libui_soversion = ''
|
libui_soversion = ''
|
||||||
libui_rpath = ''
|
libui_rpath = ''
|
||||||
#subdir('common')
|
subdir('common')
|
||||||
libui_sources+=['dummy.c']
|
|
||||||
if libui_OS == 'windows'
|
if libui_OS == 'windows'
|
||||||
# subdir('windows')
|
# subdir('windows')
|
||||||
install_headers('ui_windows.h')
|
install_headers('ui_windows.h')
|
||||||
|
|
Loading…
Reference in New Issue