libexplain
1.4.D001
|
00001 /* 00002 * libexplain - Explain errno values returned by libc functions 00003 * Copyright (C) 2008-2010, 2013 Peter Miller 00004 * Written by Peter Miller <pmiller@opensource.org.au> 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU Lesser General Public License as 00008 * published by the Free Software Foundation; either version 3 of the 00009 * License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public License 00017 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #ifndef LIBEXPLAIN_EXPLANATION_H 00021 #define LIBEXPLAIN_EXPLANATION_H 00022 00023 #include <libexplain/ac/limits.h> /* for PATH_MAX except Solaris */ 00024 #include <libexplain/ac/sys/param.h> /* for PATH_MAX except Solaris */ 00025 00026 #include <libexplain/string_buffer.h> 00027 00028 typedef struct explain_explanation_t explain_explanation_t; 00029 struct explain_explanation_t 00030 { 00031 char system_call[PATH_MAX * 3 + 200]; 00032 explain_string_buffer_t system_call_sb; 00033 int errnum; 00034 char explanation[PATH_MAX * 2 + 200]; 00035 explain_string_buffer_t explanation_sb; 00036 char footnotes[1000]; 00037 explain_string_buffer_t footnotes_sb; 00038 }; 00039 00049 void explain_explanation_init(explain_explanation_t *exp, int errnum); 00050 00063 void explain_explanation_assemble(explain_explanation_t *exp, 00064 explain_string_buffer_t *result); 00065 00078 void explain_explanation_assemble_gai(explain_explanation_t *exp, 00079 explain_string_buffer_t *result); 00080 00093 void explain_explanation_assemble_netdb(explain_explanation_t *exp, 00094 explain_string_buffer_t *result); 00095 00096 #endif /* LIBEXPLAIN_EXPLANATION_H */ 00097 /* vim: set ts=8 sw=4 et : */