API -&nbspSmartSlog KP Library
Macros | Functions
kp_error.h File Reference

Interface for error handling. More...

#include "kp_bool.h"
#include "kp_errors_define_decl.txt"

Go to the source code of this file.

Macros

#define SSLOG_EXTERN

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.

Detailed Description

Interface for error handling.

Author:
Alaxandr A. Lomov lomov.nosp@m.@cs..nosp@m.karel.nosp@m.ia.r.nosp@m.u
Date:
20 December, 2009

LICENSE

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

DESCRIPTION

Interface for error handling. This file is part of PetrSU KP Library.

Copyright (C) 2009 - Alexandr A. Lomov.


Macro Definition Documentation

#define SSLOG_EXTERN

Function Documentation

SSLOG_EXTERN int get_error_code ( )

Return code of error.

Returns:
code of error.
SSLOG_EXTERN int get_error_code_and_reset ( )

Return code of error and reset error.

Returns:
code of error.
SSLOG_EXTERN const char* get_error_text ( )

Return error message.

Returns:
error description.
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.

Returns:
error description.
SSLOG_EXTERN const char* get_error_text_by_code ( int  error_code)

Gets error message by error code.

Parameters:
error_codecode of error.
Returns:
error description.
SSLOG_EXTERN int reset_error ( )

Sets code of error equals 0 (no errors) and message equals empty string.

Returns:
ERROR_NO code (equals 0), usefull for end function, if no errors (return reset_error()).