MCPcopy Create free account
hub / github.com/3proxy/3proxy / timechanged

Function timechanged

src/3proxy.c:138–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136int wday = 0;
137
138int timechanged (time_t oldtime, time_t newtime, ROTATION lt){
139 struct tm tmold;
140 struct tm *tm;
141 tm = localtime(&oldtime);
142 tmold = *tm;
143 tm = localtime(&newtime);
144 switch(lt){
145 case MINUTELY:
146 if(tm->tm_min != tmold.tm_min)return 1;
147 break;
148 case HOURLY:
149 if(tm->tm_hour != tmold.tm_hour)return 1;
150 break;
151 case DAILY:
152 if(tm->tm_yday != tmold.tm_yday)return 1;
153 break;
154 case MONTHLY:
155 if(tm->tm_mon != tmold.tm_mon)return 1;
156 break;
157 case ANNUALLY:
158 if(tm->tm_year != tmold.tm_year)return 1;
159 break;
160 case WEEKLY:
161 if(((newtime - oldtime) > (60*60*24*7))
162 || tm->tm_wday < tmold.tm_wday
163 || (tm->tm_wday == tmold.tm_wday && (newtime - oldtime) > (60*60*24*6))
164 )return 1;
165 break;
166 default:
167 break;
168 }
169 return 0;
170}
171
172void doschedule(void){
173 struct schedule *sched, *prevsched = NULL, *nextsched;

Callers 3

doscheduleFunction · 0.85
dumpcountersFunction · 0.85
cyclestepFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected