Defined two functions that return the library name and version string.

This commit is contained in:
Olaf Bergmann committed 2014-02-18 13:38:34 +01:00
1 parent ef41ce5d02
commit 122200d3fd
2 files changed
+16 -2

No files matched your search

+9 -1
View File
@@ -1,6 +1,6 @@
/* debug.c -- debug utilities
*
* Copyright (C) 2010--2012 Olaf Bergmann <bergmann@tzi.org>
* Copyright (C) 2010--2012,2014 Olaf Bergmann <bergmann@tzi.org>
*
* This file is part of the CoAP library libcoap. Please see
* README for terms of use.
@@ -37,6 +37,14 @@
static coap_log_t maxlog = LOG_WARNING; /* default maximum log level */
const char *coap_package_name() {
return PACKAGE_NAME;
}
const char *coap_package_version() {
return PACKAGE_STRING;
}
coap_log_t
coap_get_log_level() {
return maxlog;
+7 -1
View File
@@ -1,6 +1,6 @@
/* debug.h -- debug utilities
*
* Copyright (C) 2010,2011 Olaf Bergmann <bergmann@tzi.org>
* Copyright (C) 2010,2011,2014 Olaf Bergmann <bergmann@tzi.org>
*
* This file is part of the CoAP library libcoap. Please see
* README for terms of use.
@@ -35,6 +35,12 @@ coap_log_t coap_get_log_level();
/** Sets the log level to the specified value. */
void coap_set_log_level(coap_log_t level);
/** Returns a zero-terminated string with the name of this library. */
const char *coap_package_name();
/** Returns a zero-terminated string with the library version. */
const char *coap_package_version();
/**
* Writes the given text to @c COAP_ERR_FD (for @p level <= @c
* LOG_CRIT) or @c COAP_DEBUG_FD (for @p level >= @c LOG_WARNING). The