CERN org.glite.Gfal
2.0.1
|
00001 #pragma once 00002 /* 00003 * Copyright (c) Members of the EGEE Collaboration. 2004. 00004 * See http://www.eu-egee.org/partners/ for details on the copyright holders. 00005 * 00006 * Licensed under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 00029 #include <stdarg.h> 00030 #include <stdio.h> 00031 #include <string.h> 00032 #include <errno.h> 00033 #include <glib.h> 00034 #include <common/gfal_constants.h> 00035 00036 00037 00038 #ifdef __cplusplus 00039 extern "C" 00040 { 00041 #endif 00042 00043 00044 extern const char* no_err; 00045 00049 #define g_return_val_err_if_fail(exp,val,err,msg) if(!(exp)){ g_set_error(err,0,EINVAL,msg); return val; } 00050 00054 #define G_RETURN_ERR(ret, tmp_err, err) \ 00055 if(tmp_err)\ 00056 g_propagate_prefixed_error(err, tmp_err, "[%s]", __func__);\ 00057 return ret 00058 00059 00060 void gfal_print_verbose(int verbose_lvl,const char* msg, ...); 00066 int gfal_set_verbose (int value); 00067 00068 int gfal_get_verbose(); 00069 00070 00071 void gfal_release_GError(GError** err); 00072 00073 gboolean gfal_check_GError(GError** err); 00074 00075 char* gfal_str_GError(GError** err); 00076 00077 char* gfal_str_GError_r(GError** err, char* buff_err, size_t s_err); 00078 00079 00080 #if (GLIB_CHECK_VERSION(2,16,0) != TRUE) // add a advanced functions of glib for the old versions 00081 00082 #define ERROR_OVERWRITTEN_WARNING "GError set over the top of a previous GError or uninitialized memory.\n" 00083 00084 void g_propagate_prefixed_error (GError **dest, 00085 GError *src, 00086 const gchar *format, 00087 ...) G_GNUC_PRINTF (3, 4); 00088 00089 void g_prefix_error(GError **err, 00090 const gchar *format, 00091 ...); 00092 00093 00094 #endif 00095 00096 00097 #if (GLIB_CHECK_VERSION(2,28,0) != TRUE) 00098 void g_list_free_full(GList *list, GDestroyNotify free_func); 00099 #endif 00100 00101 #ifdef __cplusplus 00102 } 00103 #endif