From a78c9ddf39cd57145f96c9813479292119b49a90 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Tue, 18 Oct 2016 20:36:52 -0400 Subject: [PATCH] Added is_loaded function to C binding --- src/bindings/c/alpr_c.cpp | 5 +++++ src/bindings/c/alpr_c.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/bindings/c/alpr_c.cpp b/src/bindings/c/alpr_c.cpp index cd207e5..0f8cef4 100644 --- a/src/bindings/c/alpr_c.cpp +++ b/src/bindings/c/alpr_c.cpp @@ -30,6 +30,11 @@ OPENALPRC_DLL_EXPORT OPENALPR* openalpr_init(const char* country, const char* co return (OPENALPR*) alpr_inst; } +OPENALPRC_DLL_EXPORT int is_loaded(OPENALPR* instance) +{ + return (int) ((alpr::Alpr*) instance)->isLoaded(); +} + // Set the country used for plate recognition OPENALPRC_DLL_EXPORT void openalpr_set_country(OPENALPR* instance, const char* country) { diff --git a/src/bindings/c/alpr_c.h b/src/bindings/c/alpr_c.h index 5212886..278b7a5 100644 --- a/src/bindings/c/alpr_c.h +++ b/src/bindings/c/alpr_c.h @@ -44,6 +44,9 @@ struct AlprCRegionOfInterest // Initializes the openALPR library and returns a pointer to the OpenALPR instance OPENALPR* openalpr_init(const char* country, const char* configFile, const char* runtimeDir); +// Returns 1 if the library was loaded successfully, 0 otherwise +int is_loaded(OPENALPR* instance); + // Set the country used for plate recognition void openalpr_set_country(OPENALPR* instance, const char* country);