Update C API: Add functions that simplify wrapper generation

This commit is contained in:
Joseph Henry
2021-03-24 12:20:39 -07:00
parent 4b190ee384
commit 9cd5fdee7b
8 changed files with 1895 additions and 554 deletions

View File

@@ -70,6 +70,7 @@ namespace ZeroTier
jobject objRef = NULL;
jmethodID _userCallbackMethodRef = NULL;
#endif
extern uint8_t _serviceStateFlags;
}
#ifdef __cplusplus
@@ -421,6 +422,9 @@ JNIEXPORT void JNICALL Java_com_zerotier_libzt_ZeroTier_restart(
int zts_free()
{
if (!(_serviceStateFlags & ZTS_STATE_NET_SERVICE_RUNNING)) {
return ZTS_ERR_SERVICE;
}
if (_getState(ZTS_STATE_FREE_CALLED)) {
return ZTS_ERR_SERVICE;
}