API - SmartSlog KP Library
|
Functions for work with kp errors. More...
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "kp_error.h"
#include "kp_errors_define_decl.txt"
Macros | |
#define | KP_ERROR_DECLARATION(enum_code_decl, code_value, error_text) { enum_code_decl, error_text }, |
#define | KP_ERROR_DECLARATION_LAST(enum_code_decl, code_value, error_text) { enum_code_decl, error_text }, |
Functions | |
SSLOG_EXTERN int | get_error_code () |
Return code of error. | |
SSLOG_EXTERN int | get_error_code_and_reset () |
Return code of error and reset error. | |
SSLOG_EXTERN const char * | get_error_text () |
Return error message. | |
SSLOG_EXTERN char * | get_error_text_and_reset () |
Return error message and reset error. | |
SSLOG_EXTERN const char * | get_error_text_by_code (int error_code) |
Gets error message by error code. | |
SSLOG_EXTERN int | reset_error () |
Sets code of error equals 0 (no errors) and message equals empty string. |
Functions for work with kp errors.
PetrSU KP Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
PetrSU KP Library 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.
You should have received a copy of the GNU General Public License along with PetrSU KP Library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Contains functions for work with kp errors. This file is part of PetrSU KP Library.
Copyright (C) 2009 - Alexandr A. Lomov.
#define KP_ERROR_DECLARATION | ( | enum_code_decl, | |
code_value, | |||
error_text | |||
) | { enum_code_decl, error_text }, |
#define KP_ERROR_DECLARATION_LAST | ( | enum_code_decl, | |
code_value, | |||
error_text | |||
) | { enum_code_decl, error_text }, |
SSLOG_EXTERN int get_error_code | ( | ) |
Return code of error.
SSLOG_EXTERN int get_error_code_and_reset | ( | ) |
Return code of error and reset error.
SSLOG_EXTERN const char* get_error_text | ( | ) |
Return error message.
SSLOG_EXTERN char* get_error_text_and_reset | ( | ) |
Return error message and reset error.
Return error message and reset error. You need free message text after using.
SSLOG_EXTERN const char* get_error_text_by_code | ( | int | error_code | ) |
Gets error message by error code.
error_code | code of error. |
SSLOG_EXTERN int reset_error | ( | ) |
Sets code of error equals 0 (no errors) and message equals empty string.