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