AVR-LibC
2.2.0
Standard C library for AVR-GCC
AVR-LibC Documentation
AVR-LibC Development Pages
Main Page
User Manual
Library Reference
FAQ
Example Projects
File List
Loading...
Searching...
No Matches
include
util
usa_dst.h
Go to the documentation of this file.
1
/*
2
* (c)2012 Michael Duane Rice All rights reserved.
3
*
4
* Redistribution and use in source and binary forms, with or without
5
* modification, are permitted provided that the following conditions are
6
* met:
7
*
8
* Redistributions of source code must retain the above copyright notice, this
9
* list of conditions and the following disclaimer. Redistributions in binary
10
* form must reproduce the above copyright notice, this list of conditions
11
* and the following disclaimer in the documentation and/or other materials
12
* provided with the distribution. Neither the name of the copyright holders
13
* nor the names of contributors may be used to endorse or promote products
14
* derived from this software without specific prior written permission.
15
*
16
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26
* POSSIBILITY OF SUCH DAMAGE.
27
*/
28
29
/* $Id$ */
30
31
#ifndef USA_DST_H
32
#define USA_DST_H
33
34
#ifdef __cplusplus
35
extern
"C"
{
36
#endif
37
38
#include <
time.h
>
39
#include <
stdint.h
>
40
41
/** \file */
42
/** \defgroup usa_dst <util/usa_dst.h>: Daylight Saving function for the USA.
43
\code #include <util/usa_dst.h> \endcode
44
Daylight Saving function for the USA. */
45
46
/** \ingroup usa_dst
47
\fn int usa_dst (const time_t *timer, int32_t *z)
48
To utilize this function, call
49
\code set_dst(usa_dst); \endcode
50
51
Given the time stamp and time zone parameters provided, the Daylight
52
Saving function must return a value appropriate for the tm structures'
53
tm_isdst element. That is:
54
55
- \c 0 : If Daylight Saving is not in effect.
56
57
- \c -1 : If it cannot be determined if Daylight Saving is in effect.
58
59
- A positive integer : Represents the number of seconds a clock is
60
advanced for Daylight Saving. This will typically be ONE_HOUR.
61
62
Daylight Saving 'rules' are subject to frequent change. For production
63
applications it is recommended to write your own DST function, which
64
uses 'rules' obtained from, and modifiable by, the end user
65
(perhaps stored in EEPROM).
66
*/
67
int
usa_dst
(
const
time_t
*timer,
int32_t
*z);
68
69
#ifdef __cplusplus
70
}
71
#endif
72
73
#endif
int32_t
signed long int int32_t
Definition:
stdint.h:98
time_t
uint32_t time_t
Definition:
time.h:114
usa_dst
int usa_dst(const time_t *timer, int32_t *z)
Definition:
usa_dst.c:54
stdint.h
time.h
Generated on Sun Jun 9 2024 00:30:41 for AVR-LibC by
1.9.6