From 85439b97dd4984c5efb84ce954b85088e781dae8 Mon Sep 17 00:00:00 2001 From: Steven Sloboda Date: Thu, 30 Nov 2017 15:39:35 -0500 Subject: [PATCH] Make minmea_isfield public. This function is useful when writing libraries that use minmea and support NMEA as well as other sentence types. --- minmea.c | 5 ----- minmea.h | 9 +++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/minmea.c b/minmea.c index aadc9ca..c96b392 100644 --- a/minmea.c +++ b/minmea.c @@ -10,7 +10,6 @@ #include #include -#include #include #define boolstr(s) ((s) ? "true" : "false") @@ -85,10 +84,6 @@ bool minmea_check(const char *sentence, bool strict) return true; } -static inline bool minmea_isfield(char c) { - return isprint((unsigned char) c) && c != ',' && c != '*'; -} - bool minmea_scan(const char *sentence, const char *format, ...) { bool result = false; diff --git a/minmea.h b/minmea.h index 967e7b1..494b218 100644 --- a/minmea.h +++ b/minmea.h @@ -13,6 +13,7 @@ extern "C" { #endif +#include #include #include #include @@ -277,6 +278,14 @@ static inline float minmea_tocoord(const struct minmea_float *f) return (float) degrees + (float) minutes / (60 * f->scale); } +/** + * Check whether a character belongs to the set of characters allowed in a + * sentence data field. + */ +static inline bool minmea_isfield(char c) { + return isprint((unsigned char) c) && c != ',' && c != '*'; +} + #ifdef __cplusplus } #endif