1 // Copyright 2011 Juri Glass, Mathias Runge, Nadim El Sayed
2 // DAI-Labor, TU-Berlin
3 //
4 // This file is part of libSML.
5 //
6 // libSML is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // libSML 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 libSML.  If not, see <http://www.gnu.org/licenses/>.
18 
19 #ifndef SML_TIME_H_
20 #define	SML_TIME_H_
21 
22 #include "sml_shared.h"
23 #include "sml_number.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #define SML_TIME_SEC_INDEX 0x01
30 #define SML_TIME_TIMESTAMP 0x02
31 
32 typedef struct {
33 	u8 *tag;
34 	union {
35 		u32 *sec_index;
36 		u32 *timestamp;
37 	}
38 	data;
39 } sml_time;
40 
41 sml_time *sml_time_init();
42 sml_time *sml_time_parse(sml_buffer *buf);
43 void sml_time_write(sml_time *time, sml_buffer *buf);
44 void sml_time_free(sml_time *time);
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 
50 #endif /* SML_TIME_H_ */
51 
52