* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "sigrokdecode.h" /* First, so we avoid a _POSIX_C_SOURCE warning. */
-#include "sigrokdecode-internal.h"
+#include "libsigrokdecode-internal.h" /* First, so we avoid a _POSIX_C_SOURCE warning. */
+#include "libsigrokdecode.h"
/* Function prototype. */
static int srd_logv(void *cb_data, int loglevel, const char *format,
va_list args);
/* Pointer to the currently selected log callback. Default: srd_logv(). */
/* Function prototype. */
static int srd_logv(void *cb_data, int loglevel, const char *format,
va_list args);
/* Pointer to the currently selected log callback. Default: srd_logv(). */
/*
* Pointer to private data that can be passed to the log callback.
* This can be used (for example) by C++ GUIs to pass a "this" pointer.
*/
/*
* Pointer to private data that can be passed to the log callback.
* This can be used (for example) by C++ GUIs to pass a "this" pointer.
*/
* SRD_LOG_WARN, SRD_LOG_INFO, SRD_LOG_DBG, or SRD_LOG_SPEW).
*
* @return SRD_OK upon success, SRD_ERR_ARG upon invalid loglevel.
* SRD_LOG_WARN, SRD_LOG_INFO, SRD_LOG_DBG, or SRD_LOG_SPEW).
*
* @return SRD_OK upon success, SRD_ERR_ARG upon invalid loglevel.
* the caller does not need to keep it around.
*
* @return SRD_OK upon success, SRD_ERR_ARG upon invalid logdomain.
* the caller does not need to keep it around.
*
* @return SRD_OK upon success, SRD_ERR_ARG upon invalid logdomain.
snprintf((char *)&srd_log_domain, LOGDOMAIN_MAXLEN, "%s", logdomain);
srd_dbg("Log domain set to '%s'.", (const char *)&srd_log_domain);
snprintf((char *)&srd_log_domain, LOGDOMAIN_MAXLEN, "%s", logdomain);
srd_dbg("Log domain set to '%s'.", (const char *)&srd_log_domain);
* @return A copy of the currently configured libsigrokdecode logdomain
* string. The caller is responsible for g_free()ing the string when
* it is no longer needed.
* @return A copy of the currently configured libsigrokdecode logdomain
* string. The caller is responsible for g_free()ing the string when
* it is no longer needed.
* Note: No log output in this function, as it should safely work
* even if the currently set log callback is buggy/broken.
*/
* Note: No log output in this function, as it should safely work
* even if the currently set log callback is buggy/broken.
*/
if (srd_log_domain[0] != '\0')
fprintf(stderr, "%s", srd_log_domain);
if (srd_log_domain[0] != '\0')
fprintf(stderr, "%s", srd_log_domain);
- ret = srd_log_callback(srd_log_callback_data, loglevel, format, args);
+ ret = srd_log_cb(srd_log_cb_data, loglevel, format, args);
- ret = srd_log_callback(srd_log_callback_data, SRD_LOG_SPEW,
- format, args);
+ ret = srd_log_cb(srd_log_cb_data, SRD_LOG_SPEW, format, args);
- ret = srd_log_callback(srd_log_callback_data, SRD_LOG_DBG,
- format, args);
+ ret = srd_log_cb(srd_log_cb_data, SRD_LOG_DBG, format, args);
- ret = srd_log_callback(srd_log_callback_data, SRD_LOG_INFO,
- format, args);
+ ret = srd_log_cb(srd_log_cb_data, SRD_LOG_INFO, format, args);
- ret = srd_log_callback(srd_log_callback_data, SRD_LOG_WARN,
- format, args);
+ ret = srd_log_cb(srd_log_cb_data, SRD_LOG_WARN, format, args);
- ret = srd_log_callback(srd_log_callback_data, SRD_LOG_ERR,
- format, args);
+ ret = srd_log_cb(srd_log_cb_data, SRD_LOG_ERR, format, args);