GRASS Programmer's Manual  6.4.3(2013)-r
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 }