CERN org.glite.Gfal  2.0.1
Defines | Functions | Variables
/builddir/build/BUILD/gfal2-2.0.0/src/common/gfal_common_errverbose.h File Reference

the header file of the common lib for error management and verbose display More...

#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <glib.h>
#include <common/gfal_constants.h>

Go to the source code of this file.

Defines

#define g_return_val_err_if_fail(exp, val, err, msg)   if(!(exp)){ g_set_error(err,0,EINVAL,msg); return val; }
#define G_RETURN_ERR(ret, tmp_err, err)

Functions

void gfal_print_verbose (int verbose_lvl, const char *msg,...)
 display a verbose message
int gfal_set_verbose (int value)
 set the verbose mode for the current program
int gfal_get_verbose ()
 return verbose mode level
void gfal_release_GError (GError **err)
 display the full GError message on stderr and free the memory associated
gboolean gfal_check_GError (GError **err)
 convenient way to manage Gerror If error does not exist, just return FALSE else print error on stderr, clear it and return TRUE
char * gfal_str_GError (GError **err)
char * gfal_str_GError_r (GError **err, char *buff_err, size_t s_err)

Variables

const char * no_err

Detailed Description

the header file of the common lib for error management and verbose display

Author:
Devresse Adrien
Version:
0.0.1
Date:
8/04/2011

Define Documentation

#define G_RETURN_ERR (   ret,
  tmp_err,
  err 
)
Value:
if(tmp_err)\
        g_propagate_prefixed_error(err, tmp_err, "[%s]", __func__);\
return ret

Function Documentation

void gfal_print_verbose ( int  verbose_lvl,
const char *  msg,
  ... 
)
int gfal_set_verbose ( int  value)

set the verbose mode for the current program

set the verbose level of gfal 2

char* gfal_str_GError ( GError **  err)

return a valid string of the current error,

Warning:
Modifications or free() on this string can lead to an undefined behaviors.
: like strerror, not thread safe.

References gfal_str_GError_r().

char* gfal_str_GError_r ( GError **  err,
char *  buff_err,
size_t  s_err 
)

set buff_err to the current gfal error, reentrant function

Returns:
pointer to buff_err for convenience

References gfal_print_verbose().

Referenced by gfal_str_GError(), and gfal_posix_strerror_r().