Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
221 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (C) 2013-2014 Jolla Ltd. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
*/ | ||
|
||
#include "mms_log.h" | ||
#include "mms_error.h" | ||
|
||
void | ||
mms_error_valist( | ||
const MMSLogModule* module, | ||
GError** error, | ||
MMSLibError code, | ||
const char* format, | ||
va_list args) | ||
{ | ||
if (error) { | ||
g_propagate_error(error, | ||
g_error_new_valist(MMS_LIB_ERROR, code, format, args)); | ||
} | ||
mms_logv(module, MMS_LOGLEVEL_ERR, format, args); | ||
} | ||
|
||
void | ||
mms_error( | ||
const MMSLogModule* module, | ||
GError** error, | ||
MMSLibError code, | ||
const char* format, | ||
...) | ||
{ | ||
va_list args; | ||
va_start(args, format); | ||
mms_error_valist(module, error, code, format, args); | ||
va_end (args); | ||
} | ||
|
||
/* | ||
* Local Variables: | ||
* mode: C | ||
* c-basic-offset: 4 | ||
* indent-tabs-mode: nil | ||
* End: | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (C) 2013-2014 Jolla Ltd. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
*/ | ||
|
||
#ifndef JOLLA_MMS_ERROR_H | ||
#define JOLLA_MMS_ERROR_H | ||
|
||
#ifndef JOLLA_MMS_LOG_H | ||
# error mms_log.h must be included before mms_error.h | ||
#endif | ||
|
||
#include "mms_lib_util.h" | ||
|
||
void | ||
mms_error( | ||
const MMSLogModule* module, | ||
GError** error, | ||
MMSLibError code, | ||
const char* format, | ||
...); | ||
|
||
void | ||
mms_error_valist( | ||
const MMSLogModule* module, | ||
GError** error, | ||
MMSLibError code, | ||
const char* format, | ||
va_list va); | ||
|
||
#ifdef MMS_LOG_VARARGS | ||
# define MMS_ERROR(error,code,format,args...) \ | ||
mms_error(MMS_LOG_MODULE_CURRENT, error, code, format, ##args) | ||
#else | ||
# define MMS_ERROR mms_error_static | ||
static inline void mms_error_static(GError** error, MMSLibError code, \ | ||
const char* format, ...) { \ | ||
va_list va; va_start(va,format); \ | ||
mms_error_valist(MMS_LOG_MODULE_CURRENT, error, code, format, va); \ | ||
va_end(va); \ | ||
} | ||
#endif /* MMS_LOG_VARARGS */ | ||
|
||
|
||
#endif /* JOLLA_MMS_ERROR_H */ | ||
|
||
/* | ||
* Local Variables: | ||
* mode: C | ||
* c-basic-offset: 4 | ||
* indent-tabs-mode: nil | ||
* End: | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.