Move the logging code to the examples.
With the application defined logging function, the actual logging is not performed by the library anymore, and the code belongs in the applications.
This commit is contained in:
parent
30feb3b3ed
commit
866e636e8c
@ -29,7 +29,8 @@ if IRDA
|
||||
bin_PROGRAMS += smart
|
||||
endif
|
||||
|
||||
COMMON = common.c common.h
|
||||
COMMON = common.c common.h \
|
||||
utils.c utils.h
|
||||
|
||||
universal_SOURCES = universal.c $(COMMON)
|
||||
|
||||
|
||||
@ -19,9 +19,8 @@
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "utils.h"
|
||||
|
||||
const char *
|
||||
errmsg (dc_status_t rc)
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/cressi_edy.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/hw_frog.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/hw_ostc.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/mares_darwin.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/mares_iconhd.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/mares_nemo.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/mares_puck.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/oceanic_atom2.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/oceanic_veo250.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/oceanic_vtpro.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
#include <time.h> // time
|
||||
|
||||
#include <libdivecomputer/reefnet_sensus.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
#include <time.h> // time
|
||||
|
||||
#include <libdivecomputer/reefnet_sensuspro.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
#include <time.h> // time
|
||||
|
||||
#include <libdivecomputer/reefnet_sensusultra.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/suunto_d9.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/suunto_eon.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/suunto.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/suunto_vyper2.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
#include <stdlib.h> // atoi
|
||||
|
||||
#include <libdivecomputer/suunto_vyper.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -37,8 +37,8 @@
|
||||
#include <libdivecomputer/context.h>
|
||||
#include <libdivecomputer/device.h>
|
||||
#include <libdivecomputer/parser.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
static const char *g_cachedir = NULL;
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <libdivecomputer/utils.h>
|
||||
#include "utils.h"
|
||||
|
||||
static FILE* g_logfile = NULL;
|
||||
|
||||
@ -19,8 +19,8 @@
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef DEBUG_H
|
||||
#define DEBUG_H
|
||||
#ifndef EXAMPLES_UTILS_H
|
||||
#define EXAMPLES_UTILS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -36,4 +36,4 @@ void message_set_logfile (const char* filename);
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* DEBUG_H */
|
||||
#endif /* EXAMPLES_UTILS_H */
|
||||
@ -1,8 +1,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/uwatec_aladin.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/uwatec_memomouse.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -24,8 +24,8 @@
|
||||
#include <string.h> // memset
|
||||
|
||||
#include <libdivecomputer/uwatec_smart.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
#include <stdio.h> // fopen, fwrite, fclose
|
||||
|
||||
#include <libdivecomputer/zeagle_n2ition3.h>
|
||||
#include <libdivecomputer/utils.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "common.h"
|
||||
|
||||
dc_status_t
|
||||
|
||||
@ -3,7 +3,6 @@ libdivecomputer_HEADERS = \
|
||||
version.h \
|
||||
common.h \
|
||||
context.h \
|
||||
utils.h \
|
||||
buffer.h \
|
||||
descriptor.h \
|
||||
iterator.h \
|
||||
|
||||
@ -47,8 +47,7 @@ libdivecomputer_la_SOURCES = \
|
||||
ringbuffer.h ringbuffer.c \
|
||||
checksum.h checksum.c \
|
||||
array.h array.c \
|
||||
buffer.c \
|
||||
utils.c
|
||||
buffer.c
|
||||
|
||||
if OS_WIN32
|
||||
libdivecomputer_la_SOURCES += serial.h serial_win32.c
|
||||
|
||||
@ -75,9 +75,6 @@ dc_device_set_fingerprint
|
||||
dc_device_version
|
||||
dc_device_write
|
||||
|
||||
message
|
||||
message_set_logfile
|
||||
|
||||
cressi_edy_device_open
|
||||
mares_nemo_device_open
|
||||
mares_nemo_extract_dives
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user