2010-06-01 10:03:17 +02:00
|
|
|
// Copyright (c) 2010, Amar Takhar <verm@aegisub.org>
|
|
|
|
//
|
|
|
|
// Permission to use, copy, modify, and distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice appear in all copies.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @file types.h
|
|
|
|
/// @brief Platform specific types.
|
|
|
|
/// @ingroup libaegisub
|
|
|
|
|
2010-06-24 03:49:48 +02:00
|
|
|
#ifndef LAGI_PRE
|
2010-06-16 09:49:35 +02:00
|
|
|
#ifdef HAVE_SYS_TIME_H
|
|
|
|
# include <sys/time.h>
|
|
|
|
#else
|
|
|
|
# include <time.h>
|
|
|
|
#endif
|
2010-06-09 04:07:43 +02:00
|
|
|
|
2010-06-16 09:49:35 +02:00
|
|
|
#endif // LAGI_PRE
|
2010-06-09 04:07:43 +02:00
|
|
|
|
2010-06-01 10:03:17 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace agi {
|
2010-06-05 20:17:55 +02:00
|
|
|
namespace type {
|
2010-06-01 10:03:17 +02:00
|
|
|
|
2010-06-05 20:17:55 +02:00
|
|
|
namespace win {
|
2010-06-01 10:03:17 +02:00
|
|
|
typedef struct timeval {
|
2010-06-05 20:17:55 +02:00
|
|
|
long tv_sec; ///< seconds
|
|
|
|
long tv_usec; ///< microseconds
|
2010-06-01 10:03:17 +02:00
|
|
|
} timeval;
|
|
|
|
|
2010-06-05 20:17:55 +02:00
|
|
|
|
|
|
|
typedef struct tm {
|
|
|
|
int tm_sec; ///< seconds (0-59)
|
|
|
|
int tm_min; ///< minutes (0-59)
|
|
|
|
int tm_hour; ///< hours (0-23)
|
|
|
|
int tm_mday; ///< day of the month (1-31)
|
|
|
|
int tm_mon; ///< months since january (0-11)
|
|
|
|
int tm_year; ///< years since 1900
|
|
|
|
int tm_wday; ///< day of the week since sunday (0-6)
|
|
|
|
int tm_yday; ///< days since january 1 (0-365)
|
|
|
|
int tm_isdst; ///< whether in DST or not
|
|
|
|
long tm_gmtoff; ///< GMT offset in seconds
|
|
|
|
char *tm_zone; ///< TZ abrivation
|
|
|
|
} tm;
|
|
|
|
|
|
|
|
} // namespace win
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-06 04:32:50 +02:00
|
|
|
// u_nix beacuse some compilers set "unix" to 1 if it's unix. -> ARGH.
|
|
|
|
namespace u_nix {
|
2010-06-05 20:17:55 +02:00
|
|
|
} // namespace unix
|
|
|
|
|
|
|
|
namespace osx {
|
|
|
|
} // namespace osx
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace type
|
2010-06-01 10:03:17 +02:00
|
|
|
} // namespace agi
|
2010-06-09 04:07:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
|
|
|
typedef agi::type::win::timeval agi_timeval;
|
|
|
|
|
|
|
|
#else // Unix / OSX
|
|
|
|
|
|
|
|
typedef timeval agi_timeval;
|
|
|
|
|
|
|
|
#endif // if _WIN32
|