GRASS 8 Programmer's Manual  8.5.0dev(2025)-c070206eb1
sign.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1995. Bill Brown <brown@gis.uiuc.edu> & Michael Shapiro
3  *
4  * This program is free software under the GPL (>=v2)
5  * Read the file GPL.TXT coming with GRASS for details.
6  */
7 #include <grass/datetime.h>
8 
9 /*!
10  * \brief
11  *
12  * Returns:
13  * 1 if the Datetime is positive
14  * 0 otherwise
15  *
16  * \param dt
17  * \return int
18  */
20 {
21  return dt->positive != 0;
22 }
23 
24 /*!
25  * \brief
26  *
27  * Returns:
28  * 1 if the DateTime is negative
29  * 0 otherwise
30  *
31  * \param dt
32  * \return int
33  */
35 {
36  return dt->positive == 0;
37 }
38 
39 /*!
40  * \brief
41  *
42  * Makes the DateTime positive. (A.D. for ABSOLUTE DateTimes)
43  *
44  * \param dt
45  * \return void
46  */
48 {
49  dt->positive = 1;
50 }
51 
52 /*!
53  * \brief
54  *
55  * Makes the DateTime negative. (B.C. for ABSOLUTE DateTimes)
56  *
57  * \param dt
58  * \return void
59  */
61 {
62  dt->positive = 0;
63 }
64 
65 /*!
66  * \brief
67  *
68  * \param dt
69  * \return void
70  */
72 {
73  dt->positive = !dt->positive;
74 }
int datetime_is_negative(const DateTime *dt)
Returns: 1 if the DateTime is negative 0 otherwise.
Definition: sign.c:34
int datetime_is_positive(const DateTime *dt)
Returns: 1 if the Datetime is positive 0 otherwise.
Definition: sign.c:19
void datetime_set_negative(DateTime *dt)
Makes the DateTime negative. (B.C. for ABSOLUTE DateTimes)
Definition: sign.c:60
void datetime_set_positive(DateTime *dt)
Makes the DateTime positive. (A.D. for ABSOLUTE DateTimes)
Definition: sign.c:47
void datetime_invert_sign(DateTime *dt)
Definition: sign.c:71
int positive
Definition: datetime.h:24