1 /*
2  * SYSTEMTIME functions
3  *
4  * Copyright (C) 2009-2018, Joachim Metz <joachim.metz@gmail.com>
5  *
6  * Refer to AUTHORS for acknowledgements.
7  *
8  * This software is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This software is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this software.  If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #if !defined( _LIBFDATETIME_INTERNAL_SYSTEMTIME_H )
23 #define _LIBFDATETIME_INTERNAL_SYSTEMTIME_H
24 
25 #include <common.h>
26 #include <types.h>
27 
28 #include "libfdatetime_extern.h"
29 #include "libfdatetime_libcerror.h"
30 #include "libfdatetime_types.h"
31 
32 #if defined( __cplusplus )
33 extern "C" {
34 #endif
35 
36 typedef struct libfdatetime_internal_systemtime libfdatetime_internal_systemtime_t;
37 
38 struct libfdatetime_internal_systemtime
39 {
40 	/* The year
41 	 */
42 	uint16_t year;
43 
44 	/* The month
45 	 */
46 	uint16_t month;
47 
48 	/* The day of week
49 	 */
50 	uint16_t day_of_week;
51 
52 	/* The day of month
53 	 */
54 	uint16_t day_of_month;
55 
56 	/* The hours
57 	 */
58 	uint16_t hours;
59 
60 	/* The minutes
61 	 */
62 	uint16_t minutes;
63 
64 	/* The seconds
65 	 */
66 	uint16_t seconds;
67 
68 	/* The milli seconds
69 	 */
70 	uint16_t milli_seconds;
71 };
72 
73 LIBFDATETIME_EXTERN \
74 int libfdatetime_systemtime_initialize(
75      libfdatetime_systemtime_t **systemtime,
76      libcerror_error_t **error );
77 
78 LIBFDATETIME_EXTERN \
79 int libfdatetime_systemtime_free(
80      libfdatetime_systemtime_t **systemtime,
81      libcerror_error_t **error );
82 
83 LIBFDATETIME_EXTERN \
84 int libfdatetime_systemtime_copy_from_byte_stream(
85      libfdatetime_systemtime_t *systemtime,
86      const uint8_t *byte_stream,
87      size_t byte_stream_size,
88      int byte_order,
89      libcerror_error_t **error );
90 
91 int libfdatetime_internal_systemtime_copy_to_date_time_values(
92      libfdatetime_internal_systemtime_t *internal_systemtime,
93      libfdatetime_date_time_values_t *date_time_values,
94      libcerror_error_t **error );
95 
96 LIBFDATETIME_EXTERN \
97 int libfdatetime_systemtime_get_string_size(
98      libfdatetime_systemtime_t *systemtime,
99      size_t *string_size,
100      uint32_t string_format_flags,
101      libcerror_error_t **error );
102 
103 int libfdatetime_internal_systemtime_copy_to_utf8_string_in_hexadecimal(
104      libfdatetime_internal_systemtime_t *internal_systemtime,
105      uint8_t *utf8_string,
106      size_t utf8_string_size,
107      size_t *utf8_string_index,
108      libcerror_error_t **error );
109 
110 LIBFDATETIME_EXTERN \
111 int libfdatetime_systemtime_copy_to_utf8_string(
112      libfdatetime_systemtime_t *systemtime,
113      uint8_t *utf8_string,
114      size_t utf8_string_size,
115      uint32_t string_format_flags,
116      libcerror_error_t **error );
117 
118 LIBFDATETIME_EXTERN \
119 int libfdatetime_systemtime_copy_to_utf8_string_with_index(
120      libfdatetime_systemtime_t *systemtime,
121      uint8_t *utf8_string,
122      size_t utf8_string_size,
123      size_t *utf8_string_index,
124      uint32_t string_format_flags,
125      libcerror_error_t **error );
126 
127 int libfdatetime_internal_systemtime_copy_to_utf16_string_in_hexadecimal(
128      libfdatetime_internal_systemtime_t *internal_systemtime,
129      uint16_t *utf16_string,
130      size_t utf16_string_size,
131      size_t *utf16_string_index,
132      libcerror_error_t **error );
133 
134 LIBFDATETIME_EXTERN \
135 int libfdatetime_systemtime_copy_to_utf16_string(
136      libfdatetime_systemtime_t *systemtime,
137      uint16_t *utf16_string,
138      size_t utf16_string_size,
139      uint32_t string_format_flags,
140      libcerror_error_t **error );
141 
142 LIBFDATETIME_EXTERN \
143 int libfdatetime_systemtime_copy_to_utf16_string_with_index(
144      libfdatetime_systemtime_t *systemtime,
145      uint16_t *utf16_string,
146      size_t utf16_string_size,
147      size_t *utf16_string_index,
148      uint32_t string_format_flags,
149      libcerror_error_t **error );
150 
151 int libfdatetime_internal_systemtime_copy_to_utf32_string_in_hexadecimal(
152      libfdatetime_internal_systemtime_t *internal_systemtime,
153      uint32_t *utf32_string,
154      size_t utf32_string_size,
155      size_t *utf32_string_index,
156      libcerror_error_t **error );
157 
158 LIBFDATETIME_EXTERN \
159 int libfdatetime_systemtime_copy_to_utf32_string(
160      libfdatetime_systemtime_t *systemtime,
161      uint32_t *utf32_string,
162      size_t utf32_string_size,
163      uint32_t string_format_flags,
164      libcerror_error_t **error );
165 
166 LIBFDATETIME_EXTERN \
167 int libfdatetime_systemtime_copy_to_utf32_string_with_index(
168      libfdatetime_systemtime_t *systemtime,
169      uint32_t *utf32_string,
170      size_t utf32_string_size,
171      size_t *utf32_string_index,
172      uint32_t string_format_flags,
173      libcerror_error_t **error );
174 
175 #if defined( __cplusplus )
176 }
177 #endif
178 
179 #endif /* !defined( _LIBFDATETIME_INTERNAL_SYSTEMTIME_H ) */
180 
181