GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 
21 int datetime_is_positive(const DateTime * dt)
22 {
23  return dt->positive != 0;
24 }
25 
37 int datetime_is_negative(const DateTime * dt)
38 {
39  return dt->positive == 0;
40 }
41 
42 
52 void datetime_set_positive(DateTime * dt)
53 {
54  dt->positive = 1;
55 }
56 
57 
67 void datetime_set_negative(DateTime * dt)
68 {
69  dt->positive = 0;
70 }
71 
72 
80 void datetime_invert_sign(DateTime * dt)
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
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