GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
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 /*!
11  * \brief
12  *
13  * Returns:
14  * 1 if the Datetime is positive
15  * 0 otherwise
16  *
17  * \param dt
18  * \return int
19  */
20 
22 {
23  return dt->positive != 0;
24 }
25 
26 /*!
27  * \brief
28  *
29  * Returns:
30  * 1 if the DateTime is negative
31  * 0 otherwise
32  *
33  * \param dt
34  * \return int
35  */
36 
38 {
39  return dt->positive == 0;
40 }
41 
42 
43 /*!
44  * \brief
45  *
46  * Makes the DateTime positive. (A.D. for ABSOLUTE DateTimes)
47  *
48  * \param dt
49  * \return void
50  */
51 
53 {
54  dt->positive = 1;
55 }
56 
57 
58 /*!
59  * \brief
60  *
61  * Makes the DateTime negative. (B.C. for ABSOLUTE DateTimes)
62  *
63  * \param dt
64  * \return void
65  */
66 
68 {
69  dt->positive = 0;
70 }
71 
72 
73 /*!
74  * \brief
75  *
76  * \param dt
77  * \return void
78  */
79 
81 {
82  dt->positive = !dt->positive;
83 }
int datetime_is_positive(const DateTime *dt)
Returns: 1 if the Datetime is positive 0 otherwise.
Definition: sign.c:21
int positive
Definition: datetime.h:25
void datetime_set_positive(DateTime *dt)
Makes the DateTime positive. (A.D. for ABSOLUTE DateTimes)
Definition: sign.c:52
void datetime_set_negative(DateTime *dt)
Makes the DateTime negative. (B.C. for ABSOLUTE DateTimes)
Definition: sign.c:67
int datetime_is_negative(const DateTime *dt)
Returns: 1 if the DateTime is negative 0 otherwise.
Definition: sign.c:37
void datetime_invert_sign(DateTime *dt)
Definition: sign.c:80