| 1 | /* |
| 2 | * Copyright (C) 1998 Mark Baysinger ([email protected]) |
| 3 | * Copyright (C) 1998,1999 Ross Combs ([email protected]) |
| 4 | * Copyright (C) 1999 Rob Crittenden ([email protected]) |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version 2 |
| 9 | * of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 19 | */ |
| 20 | #ifndef INCLUDED_BNETTIME_TYPES |
| 21 | #define INCLUDED_BNETTIME_TYPES |
| 22 | |
| 23 | namespace pvpgn |
| 24 | { |
| 25 | |
| 26 | typedef struct |
| 27 | { |
| 28 | #ifdef BNETTIME_INTERNAL_ACCESS |
| 29 | unsigned int u; |
| 30 | unsigned int l; |
| 31 | #else |
| 32 | unsigned int _private1; |
| 33 | unsigned int _private2; |
| 34 | #endif |
| 35 | } t_bnettime; |
| 36 | |
| 37 | } |
| 38 | |
| 39 | #endif |
| 40 | |
| 41 | |
| 42 | /*****/ |
| 43 | #ifndef JUST_NEED_TYPES |
| 44 | #ifndef INCLUDED_BNETTIME_PROTOS |
| 45 | #define INCLUDED_BNETTIME_PROTOS |
| 46 | |
| 47 | #include <ctime> |
| 48 | #define JUST_NEED_TYPES |
| 49 | #include "common/bn_type.h" |
| 50 | #undef JUST_NEED_TYPES |
| 51 | |
| 52 | namespace pvpgn |
| 53 | { |
| 54 | |
| 55 | extern t_bnettime secs_to_bnettime(double secs); |
| 56 | extern double bnettime_to_secs(t_bnettime bntime); |
| 57 | extern t_bnettime time_to_bnettime(std::time_t stdtime, unsigned int usec); |
| 58 | extern std::time_t bnettime_to_time(t_bnettime bntime); |
| 59 | extern t_bnettime bnettime(void); |
| 60 | extern char const * bnettime_get_str(t_bnettime bntime); |
| 61 | extern int bnettime_set_str(t_bnettime * bntime, char const * timestr); |
| 62 | extern int local_tzbias(void); |
| 63 | extern t_bnettime bnettime_add_tzbias(t_bnettime bntime, int tzbias); |
| 64 | extern void bnettime_to_bn_long(t_bnettime in, bn_long * out); |
| 65 | extern void bn_long_to_bnettime(bn_long in, t_bnettime * out); |
| 66 | |
| 67 | } |
| 68 | |
| 69 | #endif |
| 70 | #endif |