added qse_ntprd_t

This commit is contained in:
hyung-hwan 2011-11-24 07:48:11 +00:00
parent 9550c71096
commit cd124ecf6a
2 changed files with 11 additions and 5 deletions

View File

@ -69,6 +69,12 @@
*/
typedef qse_long_t qse_ntime_t;
/**
* The qse_ntprd_t type represents a time period between two time points.
* This is period is defined to be unsigned since a time point is signed.
*/
typedef qse_ulong_t qse_ntprd_t;
/**
* The qse_ntoff_t type represents the amount of increment or decrement
* from a certain time point. It is defined to be type-compatible with
@ -90,7 +96,7 @@ struct qse_btime_t
int year; /* the number of years since QSE_BTIME_YEAR_BASE */
int wday; /* 0(sun)-6(sat) */
int yday; /* 0(jan 1) to 365 */
int isdst;
int isdst; /* -1(unknown), 0(not in effect), 1 (in effect) */
/*int offset;*/
};

View File

@ -116,7 +116,7 @@ int qse_gettime (qse_ntime_t* t)
bt.min = dt.minutes;
bt.sec = dt.seconds;
bt.msec = dt.hundredths * 10;
bt.isdst = -1;
bt.isdst = -1; /* determine dst for me */
if (qse_timelocal (&bt, t) <= -1) return -1;
return 0;
@ -137,7 +137,7 @@ int qse_gettime (qse_ntime_t* t)
bt.min = dt.minute;
bt.sec = dt.second;
bt.msec = dt.hsecond * 10;
bt.isdst = -1;
bt.isdst = -1; /* determine dst for me */
if (qse_timelocal (&bt, t) <= -1) return -1;
return 0;
@ -231,7 +231,7 @@ int qse_settime (qse_ntime_t t)
#endif
}
static void breakdown_time (qse_ntime_t nt, qse_btime_t* bt, qse_ntime_t offset)
static void breakdown_time (qse_ntime_t nt, qse_btime_t* bt, qse_ntoff_t offset)
{
int midx;
qse_ntime_t days; /* total days */
@ -295,7 +295,7 @@ static void breakdown_time (qse_ntime_t nt, qse_btime_t* bt, qse_ntime_t offset)
}
bt->mday = days + 1;
bt->isdst = 0;
bt->isdst = 0; /* TODO: this may vary depeding on offset and time */
/*bt->offset = offset;*/
}