/* Austrailian C Programming Conventions - Time Macros */ #ifndef OZ_TIME # define OZ_TIME #define IN_TWO_SHAKES(A,B) (B-A<15) ? 1 : 0 #define A_BIT(A,B) (B-A<120) ? 1 : 0 #define A_LONG_TIME(A,B) (B-A>600 && B-A<3600) ? 1 : 0 #define A_REALL_LONG_TIME(A,B) (B-A>3600) ? 1 : 0 #define LONG_AS_A_MONTH_OF_SUNDAYS (B-A>7200) ? 1 : 0 int gethour() { time_t ti = time(NULL); struct tm *t = localtime(&ti); return t->tm_hour; } int getmonth() { time_t ti = time(NULL); struct tm *t = localtime(&ti); return t->tm_mon; } #define AT_SPARROW_FART (gethour()>4 && gethour()<7) #define SILLY_SEASON (getmonth()==12) #define ya_got_the_time time(NULL) #endif