diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/libdivecomputer.c | 3 | ||||
-rw-r--r-- | core/libdivecomputer.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c index a44e4a1ca..6361a593e 100644 --- a/core/libdivecomputer.c +++ b/core/libdivecomputer.c @@ -37,6 +37,7 @@ char *dumpfile_name; char *logfile_name; const char *progress_bar_text = ""; +void (*progress_callback)(const char *text) = NULL; double progress_bar_fraction = 0.0; static int stoptime, stopdepth, ndl, po2, cns; @@ -484,6 +485,8 @@ static void dev_info(device_data_t *devdata, const char *fmt, ...) vsnprintf(buffer, sizeof(buffer), fmt, ap); va_end(ap); progress_bar_text = buffer; + if (progress_callback) + (*progress_callback)(buffer); } static int import_dive_number = 0; diff --git a/core/libdivecomputer.h b/core/libdivecomputer.h index 83a6bab79..3986b629e 100644 --- a/core/libdivecomputer.h +++ b/core/libdivecomputer.h @@ -52,6 +52,7 @@ dc_descriptor_t *get_descriptor(dc_family_t type, unsigned int model); extern int import_thread_cancelled; extern const char *progress_bar_text; +extern void (*progress_callback)(const char *text); extern double progress_bar_fraction; extern char *logfile_name; extern char *dumpfile_name; |