1 (* wrappi -*- tuareg -*-
2 * Copyright (C) 2011-2012 Red Hat Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 return w->internal.error != NULL;
28 free (w->internal.error);
29 w->internal.error = NULL;
30 w->internal.errnum = 0;
31 w->internal.error_func = NULL;
35 static_string get_error ()
37 if (!w->internal.error) {
38 set_error ("no error on handle: do not call this function unless 'wrap_error' returns true");
41 return w->internal.error;
47 if (!w->internal.error) {
48 set_error ("no error on handle: do not call this function unless 'wrap_error' returns true");
51 return w->internal.errnum;
55 static_string get_error_func ()
57 if (!w->internal.error) {
58 set_error ("no error on handle: do not call this function unless 'wrap_error' returns true");
61 return w->internal.error_func;