libexplain  1.4.D001
libexplain/time.h
Go to the documentation of this file.
00001 /*
00002  * libexplain - Explain errno values returned by libc functions
00003  * Copyright (C) 2009, 2012, 2013 Peter Miller
00004  *
00005  * This program is free software; you can redistribute it and/or modify it
00006  * under the terms of the GNU Lesser General Public License as published by
00007  * the Free Software Foundation; either version 3 of the License, or (at
00008  * your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public License
00016  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00017  */
00018 
00019 #ifndef LIBEXPLAIN_TIME_H
00020 #define LIBEXPLAIN_TIME_H
00021 
00030 #include <libexplain/gcc_attributes.h>
00031 
00032 /*
00033  * We include <libexplain/large_file_support.h> because <time.h>, on
00034  * _some_ systems, winds up including <sys/types.h> and that may,
00035  * in turn, define off_t and other file-size related types.  So the
00036  * necessary preparation has to be done or things will break.
00037  */
00038 #include <libexplain/large_file_support.h>
00039 
00040 #include <time.h>
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00066 time_t explain_time_or_die(time_t *t);
00067 
00090 time_t explain_time_on_error(time_t *t)
00091                                                   LIBEXPLAIN_WARN_UNUSED_RESULT;
00092 
00131 const char *explain_time(time_t *t)
00132                                                   LIBEXPLAIN_WARN_UNUSED_RESULT;
00133 
00176 const char *explain_errno_time(int errnum, time_t *t)
00177                                                   LIBEXPLAIN_WARN_UNUSED_RESULT;
00178 
00216 void explain_message_time(char *message, int message_size, time_t *t);
00217 
00259 void explain_message_errno_time(char *message, int message_size, int errnum,
00260     time_t *t);
00261 
00262 #ifdef __cplusplus
00263 }
00264 #endif
00265 
00266 /* vim: set ts=8 sw=4 et : */
00267 #endif /* LIBEXPLAIN_TIME_H */