include/pantheios/util/be/time.h

Go to the documentation of this file.
00001 /* /////////////////////////////////////////////////////////////////////////
00002  * File:        pantheios/util/be/time.h
00003  *
00004  * Purpose:     Time functions for use in Pantheios back-ends
00005  *
00006  * Created:     22nd August 2006
00007  * Updated:     27th August 2006
00008  *
00009  * Author:      Matthew Wilson
00010  *
00011  * Home:        http://www.pantheios.org/
00012  *
00013  * Copyright:   Matthew Wilson and Synesis Software Pty Ltd, 2006.
00014  *
00015  * Redistribution and use in source and binary forms, with or without
00016  * modification, are permitted provided that the following conditions are met:
00017  *
00018  * - Redistributions of source code must retain the above copyright notice, this
00019  *   list of conditions and the following disclaimer.
00020  * - Redistributions in binary form must reproduce the above copyright notice,
00021  *   this list of conditions and the following disclaimer in the documentation
00022  *   and/or other materials provided with the distribution.
00023  * - Neither the names of Matthew Wilson and Synesis Software nor the names of
00024  *   any contributors may be used to endorse or promote products derived from
00025  *   this software without specific prior written permission.
00026  *
00027  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00028  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00029  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00030  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00031  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00032  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00033  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00034  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00035  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00036  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00037  * POSSIBILITY OF SUCH DAMAGE.
00038  *
00039  * ////////////////////////////////////////////////////////////////////// */
00040 
00041 
00048 #ifndef PANTHEIOS_INCL_PANTHEIOS_UTIL_BE_H_TIME
00049 #define PANTHEIOS_INCL_PANTHEIOS_UTIL_BE_H_TIME
00050 
00051 /* /////////////////////////////////////////////////////////////////////////
00052  * Version information
00053  */
00054 
00055 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00056 # define PANTHEIOS_VER_PANTHEIOS_UTIL_BE_H_TIME_MAJOR       1
00057 # define PANTHEIOS_VER_PANTHEIOS_UTIL_BE_H_TIME_MINOR       0
00058 # define PANTHEIOS_VER_PANTHEIOS_UTIL_BE_H_TIME_REVISION    1
00059 # define PANTHEIOS_VER_PANTHEIOS_UTIL_BE_H_TIME_EDIT        1
00060 #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00061 
00062 /* /////////////////////////////////////////////////////////////////////////
00063  * Includes
00064  */
00065 
00066 #include <pantheios/pantheios.h>
00067 
00071 struct pan_beutil_time_t
00072 {
00073     size_t      capacity;       
00074     size_t      len;            
00075     char        *str;           
00076     char const  *strftimeFmt;   
00078 #ifdef __cplusplus
00079     pan_beutil_time_t(size_t cap, char *s, char const *f = NULL)
00080         : capacity(cap)
00081         , len(0)
00082         , str(s)
00083         , strftimeFmt(f)
00084     {}
00085 #endif /* __cplusplus */
00086 };
00087 
00106 PANTHEIOS_CALL(size_t) pantheios_util_getCurrentTime(pan_beutil_time_t *tm, int bUseSystemTime);
00107 
00108 /* ////////////////////////////////////////////////////////////////////// */
00109 
00110 #endif /* !PANTHEIOS_INCL_PANTHEIOS_UTIL_BE_H_TIME */
00111 
00112 /* ////////////////////////////////////////////////////////////////////// */

pantheios Library documentation © Matthew Wilson, 2006 SourceForge.net Logo