TIMEDATE.H
[目次 | マクロ]
1|/************************************************************************
2|* 1. <<< 時間/日付 (TimeDate) >>>
3|*************************************************************************/
4|
5|#ifndef __TIMEDATE_H
6|#define __TIMEDATE_H
7|
8|#include <time.h>
9|
10|/*----------------------------------------------------------------------
11|[Module Property]
12|name = TimeDate
13|title = 時間/日付
14|category = 基本型
15|src = timedate.c
16|depend = Types
17|priority =
18|accord =
19|----------------------------------------------------------------------*/
20|
21|#ifndef USES_PRIORITY_HEADER
22|/*[START_OF_PRIORITY_HEADER]*/
23|
24|#define USES_TIMEDATE
25|
26|#define STDLIBS_INCLUDE_TIME_H
27|
28|/*[END_OF_PRIORITY_HEADER]*/
29|#endif /* USES_~PRIORITY_HEADER */
30|
31|
32|
33|
34|/************************************************************************
35|* 2. <<< 時間/日付 [TimeDate, time_t] >>>
36|*************************************************************************/
37|
38|#ifdef __cplusplus
39|extern "C" {
40|#endif
41|
42|/* 3. <<< [TimeDate_loadBuf_size] >>> */
43|#define TimeDate_loadBuf_size 20
44|
45|char* TimeDate_getStr( time_t* time, char* str, int str_sizeof );
46|char* TimeDate_getStrF( time_t* time, const char* fmt, char* str,
47| int str_sizeof );
48|char* TimeDate_getNowStr();
49|char* TimeDate_getNowStrF( char* fmt );
50|char* TimeDate_getCompileStrF( char* fmt );
51|char* TimeDate_saveStr( time_t* t, char* str );
52|int TimeDate_loadStr( time_t* t, const char* str );
53|int TimeDate_set( time_t*, int year, int month, int day,
54| int hour, int min, int sec );
55|
56|int TimeDate_cmp( time_t* timeA, bool existA, time_t* timeB, bool existB );
57|void TimeDate_getOldest( time_t* time );
58|void TimeDate_setFromDouble( struct tm* t, double diff );
59|void TimeDate_wait( int msec );
60|
61|#define TimeDate_Delete -2
62|#define TimeDate_Resume -1
63|#define TimeDate_Equal 0
64|#define TimeDate_Update 1
65|#define TimeDate_Create 2
66|
67|/* 内部用 */
68|char* TimeDate_getCompileStrF_imp( char* __date__, char* __time__,
69| char* fmt );
70|
71|#ifdef __cplusplus
72|}
73|#endif
74|
75|
76|
77|/***********************************************************************
78|* 4. <<< [TimeDate_getCompileStrF] コンパイルした日時を指定した書式で取得する >>>
79|*【引数】
80|* ・char* fmt; 日時の書式(TimeDate_fmt 書式、後記)
81|* ・char* 返り値; 日時の文字列
82|*【補足】
83|*・この関数は、この関数を呼び出す特定の1つのファイルをコンパイルした日時を
84|* 取得するので、メイン関数などわかりやすい場所で呼び出してください。
85|*・返される文字列は、変更しないでください。
86|*・返される文字列が 99文字以内になるように注意してください。
87|************************************************************************/
88|#define TimeDate_getCompileStrF( fmt ) \
89| TimeDate_getCompileStrF_imp( __DATE__, __TIME__, fmt )
90|
91|#endif /* __TIMEDATE_H */
92|
93|