aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-10-29 02:09:32 +0100
committerTeddy Wing2018-10-29 02:09:32 +0100
commit1a6200e50f084ef310279198b3ec6ce9fcd6179d (patch)
treec2a970007006ea766827273b854856284d182a15
parent4ae21f20c5ba7761ce2a64d9169845b42e53fd3b (diff)
downloadDomeKey-1a6200e50f084ef310279198b3ec6ce9fcd6179d.tar.bz2
Update Rust library function calls to new API names
Use the new function names.
-rw-r--r--DomeKey/HeadphoneKey.m11
-rw-r--r--DomeKey/LicenseHandler.m4
-rw-r--r--DomeKey/main.m6
3 files changed, 11 insertions, 10 deletions
diff --git a/DomeKey/HeadphoneKey.m b/DomeKey/HeadphoneKey.m
index df31fec..122a2c6 100644
--- a/DomeKey/HeadphoneKey.m
+++ b/DomeKey/HeadphoneKey.m
@@ -16,14 +16,15 @@
if (self) {
_key_buffer = [[NSMutableArray alloc] initWithCapacity:5];
_in_mode = NULL;
- _state = state_new();
+ _state = dome_key_state_new();
// Should never be used. We initialise it just in case, but the real
// default should always come from a `Config`, set in the Rust library.
_timeout = TIMEOUT_DEFAULT;
- logger_init();
- state_load_map_group(_state);
+ // TODO: Think about moving this logger higher up
+ dome_key_logger_init();
+ dome_key_state_load_map_group(_state);
_mikeys = [DDHidAppleMikey allMikeys];
[_mikeys makeObjectsPerformSelector:@selector(setDelegate:)
@@ -46,7 +47,7 @@
- (void)dealloc
{
- state_free(_state);
+ dome_key_state_free(_state);
}
- (void)ddhidAppleMikey:(DDHidAppleMikey *)mikey
@@ -102,7 +103,7 @@
.length = count
};
- c_run_key_action(_state, trigger, _in_mode);
+ dome_key_run_key_action(_state, trigger, PlayAudio_No);
[_key_buffer removeAllObjects];
}
diff --git a/DomeKey/LicenseHandler.m b/DomeKey/LicenseHandler.m
index 20416b8..7cfbcbb 100644
--- a/DomeKey/LicenseHandler.m
+++ b/DomeKey/LicenseHandler.m
@@ -18,11 +18,11 @@ static NSString * const LICENSE_FILE_NAME = @"license.plist";
if (![self validateLicense]) {
[self printInvalidLicenseMessage];
- do_trial();
+ dome_key_do_trial();
}
}
else {
- do_trial();
+ dome_key_do_trial();
}
}
diff --git a/DomeKey/main.m b/DomeKey/main.m
index fed870a..360129a 100644
--- a/DomeKey/main.m
+++ b/DomeKey/main.m
@@ -18,14 +18,14 @@
static const char *VERSION = "1.0";
int main(int argc, const char * argv[]) {
- Config *config = config_get();
+ Config *config = dome_key_config_get();
if (!config) {
NSLog(@"Unable to get config");
return EX_CONFIG;
}
- config = c_parse_args(argv, argc, config);
+ config = dome_key_parse_args(argv, argc, config);
if (config->args.license) {
[LicenseHandler addLicense:[NSString
@@ -56,7 +56,7 @@ int main(int argc, const char * argv[]) {
printf("DomeKey version %s\n", VERSION);
}
- config_free(config);
+ dome_key_config_free(config);
return EX_OK;
}