Browse code

cplc: use cpl_ prefix for internal time recurrence functions

- avoid global symbol conflicts with core tmrec.c
- GH #2827

(cherry picked from commit 431544864c97d1848db1c0c42a03251a214f04cd)
(cherry picked from commit 7e3e0a81bf458bd90bc1454c81bf21d64ed9212c)
(cherry picked from commit 9825c3da237394fb2b856e41a593b8e85b47abb6)

Daniel-Constantin Mierla authored on 18/08/2021 16:08:38 • Henning Westerholt committed on 22/10/2021 12:09:46
Showing 3 changed files
... ...
@@ -683,11 +683,11 @@ static inline char *run_time_switch( struct cpl_interpreter *intr )
683 683
 	int nr_attrs;
684 684
 	int i,j;
685 685
 	str user_tz = {0,0};
686
-	ac_tm_t att;
687
-	tmrec_t trt;
686
+	cpl_ac_tm_t att;
687
+	cpl_tmrec_t trt;
688 688
 
689
-	memset(&att, 0, sizeof(ac_tm_t));
690
-	memset(&trt, 0, sizeof(tmrec_t));
689
+	memset(&att, 0, sizeof(cpl_ac_tm_t));
690
+	memset(&trt, 0, sizeof(cpl_tmrec_t));
691 691
 
692 692
 	LM_DBG("checking recv. time stamp <%d>\n",
693 693
 		intr->recv_time);
... ...
@@ -735,7 +735,7 @@ static inline char *run_time_switch( struct cpl_interpreter *intr )
735 735
 				/* init structures */
736 736
 				memset( &att, 0, sizeof(att));
737 737
 				memset( &trt, 0, sizeof(trt));
738
-				if(ac_tm_set_time( &att, intr->recv_time))
738
+				if(cpl_ac_tm_set_time( &att, intr->recv_time))
739 739
 					goto runtime_error;
740 740
 				/* let's see how many attributes we have */
741 741
 				nr_attrs = NR_OF_ATTR(kid);
... ...
@@ -750,54 +750,54 @@ static inline char *run_time_switch( struct cpl_interpreter *intr )
750 750
 						"[%s]\n",attr_name, attr_str);
751 751
 					switch (attr_name) {
752 752
 						case DTSTART_ATTR:
753
-							if( !attr_str || tr_parse_dtstart(&trt, attr_str))
753
+							if( !attr_str || cpl_tr_parse_dtstart(&trt, attr_str))
754 754
 								goto parse_err;
755 755
 							flags ^= (1<<0);
756 756
 							break;
757 757
 						case DTEND_ATTR:
758
-							if( !attr_str || tr_parse_dtend(&trt, attr_str))
758
+							if( !attr_str || cpl_tr_parse_dtend(&trt, attr_str))
759 759
 								goto parse_err;
760 760
 							flags ^= (1<<1);
761 761
 							break;
762 762
 						case DURATION_ATTR:
763
-							if( !attr_str || tr_parse_duration(&trt, attr_str))
763
+							if( !attr_str || cpl_tr_parse_duration(&trt, attr_str))
764 764
 								goto parse_err;
765 765
 							flags ^= (1<<1);
766 766
 							break;
767 767
 						case FREQ_ATTR:
768
-							if( attr_str && tr_parse_freq(&trt, attr_str))
768
+							if( attr_str && cpl_tr_parse_freq(&trt, attr_str))
769 769
 								goto parse_err;
770 770
 							break;
771 771
 						case UNTIL_ATTR:
772
-							if( attr_str && tr_parse_until(&trt, attr_str))
772
+							if( attr_str && cpl_tr_parse_until(&trt, attr_str))
773 773
 								goto parse_err;
774 774
 							break;
775 775
 						case INTERVAL_ATTR:
776
-							if( attr_str && tr_parse_interval(&trt, attr_str))
776
+							if( attr_str && cpl_tr_parse_interval(&trt, attr_str))
777 777
 								goto parse_err;
778 778
 							break;
779 779
 						case BYDAY_ATTR:
780
-							if( attr_str && tr_parse_byday(&trt, attr_str))
780
+							if( attr_str && cpl_tr_parse_byday(&trt, attr_str))
781 781
 								goto parse_err;
782 782
 							break;
783 783
 						case BYMONTHDAY_ATTR:
784
-							if( attr_str && tr_parse_bymday(&trt, attr_str))
784
+							if( attr_str && cpl_tr_parse_bymday(&trt, attr_str))
785 785
 								goto parse_err;
786 786
 							break;
787 787
 						case BYYEARDAY_ATTR:
788
-							if( attr_str && tr_parse_byyday(&trt, attr_str))
788
+							if( attr_str && cpl_tr_parse_byyday(&trt, attr_str))
789 789
 								goto parse_err;
790 790
 							break;
791 791
 						case BYMONTH_ATTR:
792
-							if( attr_str && tr_parse_bymonth(&trt, attr_str))
792
+							if( attr_str && cpl_tr_parse_bymonth(&trt, attr_str))
793 793
 								goto parse_err;
794 794
 							break;
795 795
 						case BYWEEKNO_ATTR:
796
-							if( attr_str && tr_parse_byweekno(&trt, attr_str))
796
+							if( attr_str && cpl_tr_parse_byweekno(&trt, attr_str))
797 797
 								goto parse_err;
798 798
 							break;
799 799
 						case WKST_ATTR:
800
-							if( attr_str && tr_parse_wkst(&trt, attr_str))
800
+							if( attr_str && cpl_tr_parse_wkst(&trt, attr_str))
801 801
 								goto parse_err;
802 802
 							break;
803 803
 						default:
... ...
@@ -813,13 +813,13 @@ static inline char *run_time_switch( struct cpl_interpreter *intr )
813 813
 					goto script_error;
814 814
 				}
815 815
 				/* does the recv_time match the specified interval?  */
816
-				j = check_tmrec( &trt, &att, 0);
816
+				j = cpl_check_tmrec( &trt, &att, 0);
817 817
 				/* restore the orig TZ */
818 818
 				if ( flags&(1<<7) )
819 819
 					set_TZ(cpl_env.orig_tz.s);
820 820
 				/* free structs that I don't need any more */
821
-				ac_tm_free( &att );
822
-				tmrec_free( &trt );
821
+				cpl_ac_tm_free( &att );
822
+				cpl_tmrec_free( &trt );
823 823
 				/* let's see the result ;-) */
824 824
 				switch  (j) {
825 825
 					case 0:
... ...
@@ -844,14 +844,14 @@ static inline char *run_time_switch( struct cpl_interpreter *intr )
844 844
 
845 845
 
846 846
 	/* none of the branches of TIME_SWITCH matched -> go for default */
847
-	ac_tm_free( &att );
848
-	tmrec_free( &trt );
847
+	cpl_ac_tm_free( &att );
848
+	cpl_tmrec_free( &trt );
849 849
 	return DEFAULT_ACTION;
850 850
 runtime_error:
851 851
 	if ( flags&(1<<7) )
852 852
 		set_TZ(cpl_env.orig_tz.s);
853
-	ac_tm_free( &att );
854
-	tmrec_free( &trt );
853
+	cpl_ac_tm_free( &att );
854
+	cpl_tmrec_free( &trt );
855 855
 	return CPL_RUNTIME_ERROR;
856 856
 parse_err:
857 857
 	LM_ERR("error parsing attr [%d][%s]\n",
... ...
@@ -859,8 +859,8 @@ parse_err:
859 859
 script_error:
860 860
 	if ( flags&(1<<7) )
861 861
 		set_TZ(cpl_env.orig_tz.s);
862
-	ac_tm_free( &att );
863
-	tmrec_free( &trt );
862
+	cpl_ac_tm_free( &att );
863
+	cpl_tmrec_free( &trt );
864 864
 	return CPL_SCRIPT_ERROR;
865 865
 }
866 866
 
... ...
@@ -101,21 +101,21 @@ static inline char* trim(char* _s)
101 101
 				((t)->tm_wday ? (t)->tm_wday - 1 : 6)) / 7)
102 102
 #endif
103 103
 
104
-#define ac_get_wday_yr(t) (int)((t)->tm_yday/7)
105
-#define ac_get_wday_mr(t) (int)(((t)->tm_mday-1)/7)
104
+#define cpl_ac_get_wday_yr(t) (int)((t)->tm_yday/7)
105
+#define cpl_ac_get_wday_mr(t) (int)(((t)->tm_mday-1)/7)
106 106
 
107
-ac_tm_p ac_tm_new(void)
107
+cpl_ac_tm_p cpl_ac_tm_new(void)
108 108
 {
109
-	ac_tm_p _atp = NULL;
110
-	_atp = (ac_tm_p)pkg_malloc(sizeof(ac_tm_t));
109
+	cpl_ac_tm_p _atp = NULL;
110
+	_atp = (cpl_ac_tm_p)pkg_malloc(sizeof(cpl_ac_tm_t));
111 111
 	if(!_atp)
112 112
 		return NULL;
113
-	memset(_atp, 0, sizeof(ac_tm_t));
114
-	
113
+	memset(_atp, 0, sizeof(cpl_ac_tm_t));
114
+
115 115
 	return _atp;
116 116
 }
117 117
 
118
-int ac_tm_fill(ac_tm_p _atp, struct tm* _tm)
118
+int cpl_ac_tm_fill(cpl_ac_tm_p _atp, struct tm* _tm)
119 119
 {
120 120
 	if(!_atp || !_tm)
121 121
 		return -1;
... ...
@@ -128,23 +128,23 @@ int ac_tm_fill(ac_tm_p _atp, struct tm* _tm)
128 128
 	_atp->t.tm_wday = _tm->tm_wday;     /* day of the week */
129 129
 	_atp->t.tm_yday = _tm->tm_yday;     /* day in the year */
130 130
 	_atp->t.tm_isdst = _tm->tm_isdst;   /* daylight saving time */
131
-	
132
-	_atp->mweek = ac_get_mweek(_tm);
133
-	_atp->yweek = ac_get_yweek(_tm);
134
-	_atp->ywday = ac_get_wday_yr(_tm);
135
-	_atp->mwday = ac_get_wday_mr(_tm);
131
+
132
+	_atp->mweek = cpl_ac_get_mweek(_tm);
133
+	_atp->yweek = cpl_ac_get_yweek(_tm);
134
+	_atp->ywday = cpl_ac_get_wday_yr(_tm);
135
+	_atp->mwday = cpl_ac_get_wday_mr(_tm);
136 136
 	return 0;
137 137
 }
138 138
 
139
-int ac_tm_set_time(ac_tm_p _atp, time_t _t)
139
+int cpl_ac_tm_set_time(cpl_ac_tm_p _atp, time_t _t)
140 140
 {
141 141
 	if(!_atp)
142 142
 		return -1;
143 143
 	_atp->time = _t;
144
-	return ac_tm_fill(_atp, localtime(&_t));
144
+	return cpl_ac_tm_fill(_atp, localtime(&_t));
145 145
 }
146 146
 
147
-int ac_get_mweek(struct tm* _tm)
147
+int cpl_ac_get_mweek(struct tm* _tm)
148 148
 {
149 149
 	if(!_tm)
150 150
 		return -1;
... ...
@@ -155,16 +155,16 @@ int ac_get_mweek(struct tm* _tm)
155 155
 #endif
156 156
 }
157 157
 
158
-int ac_get_yweek(struct tm* _tm)
158
+int cpl_ac_get_yweek(struct tm* _tm)
159 159
 {
160 160
 	int week = -1;
161 161
 #ifdef USE_YWEEK_V
162 162
 	int days;
163 163
 #endif
164
-	
164
+
165 165
 	if(!_tm)
166 166
 		return -1;
167
-	
167
+
168 168
 #ifdef USE_YWEEK_U
169 169
 	week = SUN_WEEK(_tm);
170 170
 #else
... ...
@@ -174,16 +174,16 @@ int ac_get_yweek(struct tm* _tm)
174 174
 #ifdef USE_YWEEK_V
175 175
 	days = ((_tm->tm_yday + 7 - (_tm->tm_wday ? _tm->tm_wday-1 : 6)) % 7);
176 176
 
177
-	if(days >= 4) 
177
+	if(days >= 4)
178 178
 		week++;
179
-	else 
180
-		if(week == 0) 
179
+	else
180
+		if(week == 0)
181 181
 			week = 53;
182 182
 #endif
183 183
 	return week;
184 184
 }
185 185
 
186
-int ac_get_wkst(void)
186
+int cpl_ac_get_wkst(void)
187 187
 {
188 188
 #ifdef USE_YWEEK_U
189 189
 	return 0;
... ...
@@ -192,15 +192,15 @@ int ac_get_wkst(void)
192 192
 #endif
193 193
 }
194 194
 
195
-int ac_tm_reset(ac_tm_p _atp)
195
+int cpl_ac_tm_reset(cpl_ac_tm_p _atp)
196 196
 {
197 197
 	if(!_atp)
198 198
 		return -1;
199
-	memset(_atp, 0, sizeof(ac_tm_t));
199
+	memset(_atp, 0, sizeof(cpl_ac_tm_t));
200 200
 	return 0;
201 201
 }
202 202
 
203
-int ac_tm_free(ac_tm_p _atp)
203
+int cpl_ac_tm_free(cpl_ac_tm_p _atp)
204 204
 {
205 205
 	if(!_atp)
206 206
 		return -1;
... ...
@@ -210,18 +210,18 @@ int ac_tm_free(ac_tm_p _atp)
210 210
 	return 0;
211 211
 }
212 212
 
213
-ac_maxval_p ac_get_maxval(ac_tm_p _atp)
213
+cpl_ac_maxval_p cpl_ac_get_maxval(cpl_ac_tm_p _atp)
214 214
 {
215 215
 	struct tm _tm;
216 216
 	int _v;
217
-	ac_maxval_p _amp = NULL;
217
+	cpl_ac_maxval_p _amp = NULL;
218 218
 
219 219
 	if(!_atp)
220 220
 		return NULL;
221
-	_amp = (ac_maxval_p)pkg_malloc(sizeof(ac_maxval_t));
221
+	_amp = (cpl_ac_maxval_p)pkg_malloc(sizeof(cpl_ac_maxval_t));
222 222
 	if(!_amp)
223 223
 		return NULL;
224
-	
224
+
225 225
 	/* the number of the days in the year */
226 226
 	_amp->yday = 365 + is_leap_year(_atp->t.tm_year+1900);
227 227
 
... ...
@@ -240,7 +240,7 @@ ac_maxval_p ac_get_maxval(ac_tm_p _atp)
240 240
 		default:
241 241
 			_amp->mday = 31;
242 242
 	}
243
-	
243
+
244 244
 	/* maximum occurrences of a week day in the year */
245 245
 	memset(&_tm, 0, sizeof(struct tm));
246 246
 	_tm.tm_year = _atp->t.tm_year;
... ...
@@ -253,13 +253,13 @@ ac_maxval_p ac_get_maxval(ac_tm_p _atp)
253 253
 	else
254 254
 		_v = _tm.tm_wday - _atp->t.tm_wday;
255 255
 	_amp->ywday = (int)((_tm.tm_yday-_v)/7) + 1;
256
-	
256
+
257 257
 	/* maximum number of weeks in the year */
258
-	_amp->yweek = ac_get_yweek(&_tm) + 1;
259
-	
258
+	_amp->yweek = cpl_ac_get_yweek(&_tm) + 1;
259
+
260 260
 	/* maximum number of the week day in the month */
261 261
 	_amp->mwday=(int)((_amp->mday-1-(_amp->mday-_atp->t.tm_mday)%7)/7)+1;
262
-	
262
+
263 263
 	/* maximum number of weeks in the month */
264 264
 	_v = (_atp->t.tm_wday + (_amp->mday - _atp->t.tm_mday)%7)%7;
265 265
 #ifdef USE_YWEEK_U
... ...
@@ -272,15 +272,15 @@ ac_maxval_p ac_get_maxval(ac_tm_p _atp)
272 272
 	return _amp;
273 273
 }
274 274
 
275
-int ac_print(ac_tm_p _atp)
275
+int cpl_ac_print(cpl_ac_tm_p _atp)
276 276
 {
277
-	static char *_wdays[] = {"SU", "MO", "TU", "WE", "TH", "FR", "SA"}; 
277
+	static char *_wdays[] = {"SU", "MO", "TU", "WE", "TH", "FR", "SA"};
278 278
 	if(!_atp)
279 279
 	{
280 280
 		printf("\n(null)\n");
281 281
 		return -1;
282 282
 	}
283
-	
283
+
284 284
 	printf("\nSys time: %d\nTime: %02d:%02d:%02d\n", (int)_atp->time,
285 285
 				_atp->t.tm_hour, _atp->t.tm_min, _atp->t.tm_sec);
286 286
 	printf("Date: %s, %04d-%02d-%02d\n", _wdays[_atp->t.tm_wday],
... ...
@@ -306,17 +306,17 @@ int ac_print(ac_tm_p _atp)
306 306
 
307 307
 #define _D(c) ((c) -'0')
308 308
 
309
-tr_byxxx_p tr_byxxx_new(void)
309
+cpl_tr_byxxx_p cpl_tr_byxxx_new(void)
310 310
 {
311
-	tr_byxxx_p _bxp = NULL;
312
-	_bxp = (tr_byxxx_p)pkg_malloc(sizeof(tr_byxxx_t));
311
+	cpl_tr_byxxx_p _bxp = NULL;
312
+	_bxp = (cpl_tr_byxxx_p)pkg_malloc(sizeof(cpl_tr_byxxx_t));
313 313
 	if(!_bxp)
314 314
 		return NULL;
315
-	memset(_bxp, 0, sizeof(tr_byxxx_t));
315
+	memset(_bxp, 0, sizeof(cpl_tr_byxxx_t));
316 316
 	return _bxp;
317 317
 }
318 318
 
319
-int tr_byxxx_init(tr_byxxx_p _bxp, int _nr)
319
+int cpl_tr_byxxx_init(cpl_tr_byxxx_p _bxp, int _nr)
320 320
 {
321 321
 	if(!_bxp)
322 322
 		return -1;
... ...
@@ -331,15 +331,15 @@ int tr_byxxx_init(tr_byxxx_p _bxp, int _nr)
331 331
 		_bxp->xxx = NULL;
332 332
 		return -1;
333 333
 	}
334
-	
334
+
335 335
 	memset(_bxp->xxx, 0, _nr*sizeof(int));
336 336
 	memset(_bxp->req, 0, _nr*sizeof(int));
337
-	
337
+
338 338
 	return 0;
339 339
 }
340 340
 
341 341
 
342
-int tr_byxxx_free(tr_byxxx_p _bxp)
342
+int cpl_tr_byxxx_free(cpl_tr_byxxx_p _bxp)
343 343
 {
344 344
 	if(!_bxp)
345 345
 		return -1;
... ...
@@ -351,67 +351,67 @@ int tr_byxxx_free(tr_byxxx_p _bxp)
351 351
 	return 0;
352 352
 }
353 353
 
354
-tmrec_p tmrec_new(void)
354
+cpl_tmrec_p cpl_tmrec_new(void)
355 355
 {
356
-	tmrec_p _trp = NULL;
357
-	_trp = (tmrec_p)pkg_malloc(sizeof(tmrec_t));
356
+	cpl_tmrec_p _trp = NULL;
357
+	_trp = (cpl_tmrec_p)pkg_malloc(sizeof(cpl_tmrec_t));
358 358
 	if(!_trp)
359 359
 		return NULL;
360
-	memset(_trp, 0, sizeof(tmrec_t));
360
+	memset(_trp, 0, sizeof(cpl_tmrec_t));
361 361
 	localtime_r(&_trp->dtstart,&(_trp->ts));
362 362
 	return _trp;
363 363
 }
364 364
 
365
-int tmrec_free(tmrec_p _trp)
365
+int cpl_tmrec_free(cpl_tmrec_p _trp)
366 366
 {
367 367
 	if(!_trp)
368 368
 		return -1;
369
-	
370
-	tr_byxxx_free(_trp->byday);
371
-	tr_byxxx_free(_trp->bymday);
372
-	tr_byxxx_free(_trp->byyday);
373
-	tr_byxxx_free(_trp->bymonth);
374
-	tr_byxxx_free(_trp->byweekno);
369
+
370
+	cpl_tr_byxxx_free(_trp->byday);
371
+	cpl_tr_byxxx_free(_trp->bymday);
372
+	cpl_tr_byxxx_free(_trp->byyday);
373
+	cpl_tr_byxxx_free(_trp->bymonth);
374
+	cpl_tr_byxxx_free(_trp->byweekno);
375 375
 
376 376
 	/*pkg_free(_trp);*/
377 377
 	return 0;
378 378
 }
379 379
 
380
-int tr_parse_dtstart(tmrec_p _trp, char *_in)
380
+int cpl_tr_parse_dtstart(cpl_tmrec_p _trp, char *_in)
381 381
 {
382 382
 	if(!_trp || !_in)
383 383
 		return -1;
384
-	_trp->dtstart = ic_parse_datetime(_in, &(_trp->ts));
384
+	_trp->dtstart = cpl_ic_parse_datetime(_in, &(_trp->ts));
385 385
 	return (_trp->dtstart==0)?-1:0;
386 386
 }
387 387
 
388
-int tr_parse_dtend(tmrec_p _trp, char *_in)
388
+int cpl_tr_parse_dtend(cpl_tmrec_p _trp, char *_in)
389 389
 {
390 390
 	struct tm _tm;
391 391
 	if(!_trp || !_in)
392 392
 		return -1;
393
-	_trp->dtend = ic_parse_datetime(_in,&_tm);
393
+	_trp->dtend = cpl_ic_parse_datetime(_in,&_tm);
394 394
 	return (_trp->dtend==0)?-1:0;
395 395
 }
396 396
 
397
-int tr_parse_duration(tmrec_p _trp, char *_in)
397
+int cpl_tr_parse_duration(cpl_tmrec_p _trp, char *_in)
398 398
 {
399 399
 	if(!_trp || !_in)
400 400
 		return -1;
401
-	_trp->duration = ic_parse_duration(_in);
401
+	_trp->duration = cpl_ic_parse_duration(_in);
402 402
 	return (_trp->duration==0)?-1:0;
403 403
 }
404 404
 
405
-int tr_parse_until(tmrec_p _trp, char *_in)
405
+int cpl_tr_parse_until(cpl_tmrec_p _trp, char *_in)
406 406
 {
407 407
 	struct tm _tm;
408 408
 	if(!_trp || !_in)
409 409
 		return -1;
410
-	_trp->until = ic_parse_datetime(_in, &_tm);
410
+	_trp->until = cpl_ic_parse_datetime(_in, &_tm);
411 411
 	return (_trp->until==0)?-1:0;
412 412
 }
413 413
 
414
-int tr_parse_freq(tmrec_p _trp, char *_in)
414
+int cpl_tr_parse_freq(cpl_tmrec_p _trp, char *_in)
415 415
 {
416 416
 	if(!_trp || !_in)
417 417
 		return -1;
... ...
@@ -440,7 +440,7 @@ int tr_parse_freq(tmrec_p _trp, char *_in)
440 440
 	return 0;
441 441
 }
442 442
 
443
-int tr_parse_interval(tmrec_p _trp, char *_in)
443
+int cpl_tr_parse_interval(cpl_tmrec_p _trp, char *_in)
444 444
 {
445 445
 	if(!_trp || !_in)
446 446
 		return -1;
... ...
@@ -448,59 +448,59 @@ int tr_parse_interval(tmrec_p _trp, char *_in)
448 448
 	return 0;
449 449
 }
450 450
 
451
-int tr_parse_byday(tmrec_p _trp, char *_in)
451
+int cpl_tr_parse_byday(cpl_tmrec_p _trp, char *_in)
452 452
 {
453 453
 	if(!_trp || !_in)
454 454
 		return -1;
455
-	_trp->byday = ic_parse_byday(_in); 
455
+	_trp->byday = cpl_ic_parse_byday(_in);
456 456
 	return 0;
457 457
 }
458 458
 
459
-int tr_parse_bymday(tmrec_p _trp, char *_in)
459
+int cpl_tr_parse_bymday(cpl_tmrec_p _trp, char *_in)
460 460
 {
461 461
 	if(!_trp || !_in)
462 462
 		return -1;
463
-	_trp->bymday = ic_parse_byxxx(_in); 
463
+	_trp->bymday = cpl_ic_parse_byxxx(_in);
464 464
 	return 0;
465 465
 }
466 466
 
467
-int tr_parse_byyday(tmrec_p _trp, char *_in)
467
+int cpl_tr_parse_byyday(cpl_tmrec_p _trp, char *_in)
468 468
 {
469 469
 	if(!_trp || !_in)
470 470
 		return -1;
471
-	_trp->byyday = ic_parse_byxxx(_in); 
471
+	_trp->byyday = cpl_ic_parse_byxxx(_in);
472 472
 	return 0;
473 473
 }
474 474
 
475
-int tr_parse_bymonth(tmrec_p _trp, char *_in)
475
+int cpl_tr_parse_bymonth(cpl_tmrec_p _trp, char *_in)
476 476
 {
477 477
 	if(!_trp || !_in)
478 478
 		return -1;
479
-	_trp->bymonth = ic_parse_byxxx(_in); 
479
+	_trp->bymonth = cpl_ic_parse_byxxx(_in);
480 480
 	return 0;
481 481
 }
482 482
 
483
-int tr_parse_byweekno(tmrec_p _trp, char *_in)
483
+int cpl_tr_parse_byweekno(cpl_tmrec_p _trp, char *_in)
484 484
 {
485 485
 	if(!_trp || !_in)
486 486
 		return -1;
487
-	_trp->byweekno = ic_parse_byxxx(_in); 
487
+	_trp->byweekno = cpl_ic_parse_byxxx(_in);
488 488
 	return 0;
489 489
 }
490 490
 
491
-int tr_parse_wkst(tmrec_p _trp, char *_in)
491
+int cpl_tr_parse_wkst(cpl_tmrec_p _trp, char *_in)
492 492
 {
493 493
 	if(!_trp || !_in)
494 494
 		return -1;
495
-	_trp->wkst = ic_parse_wkst(_in);
495
+	_trp->wkst = cpl_ic_parse_wkst(_in);
496 496
 	return 0;
497 497
 }
498 498
 
499
-int tr_print(tmrec_p _trp)
499
+int cpl_tr_print(cpl_tmrec_p _trp)
500 500
 {
501
-	static char *_wdays[] = {"SU", "MO", "TU", "WE", "TH", "FR", "SA"}; 
501
+	static char *_wdays[] = {"SU", "MO", "TU", "WE", "TH", "FR", "SA"};
502 502
 	int i;
503
-	
503
+
504 504
 	if(!_trp)
505 505
 	{
506 506
 		printf("\n(null)\n");
... ...
@@ -508,7 +508,7 @@ int tr_print(tmrec_p _trp)
508 508
 	}
509 509
 	printf("Recurrence definition\n-- start time ---\n");
510 510
 	printf("Sys time: %d\n", (int)_trp->dtstart);
511
-	printf("Time: %02d:%02d:%02d\n", _trp->ts.tm_hour, 
511
+	printf("Time: %02d:%02d:%02d\n", _trp->ts.tm_hour,
512 512
 				_trp->ts.tm_min, _trp->ts.tm_sec);
513 513
 	printf("Date: %s, %04d-%02d-%02d\n", _wdays[_trp->ts.tm_wday],
514 514
 				_trp->ts.tm_year+1900, _trp->ts.tm_mon+1, _trp->ts.tm_mday);
... ...
@@ -557,13 +557,13 @@ int tr_print(tmrec_p _trp)
557 557
 	return 0;
558 558
 }
559 559
 
560
-time_t ic_parse_datetime(char *_in, struct tm *_tm)
560
+time_t cpl_ic_parse_datetime(char *_in, struct tm *_tm)
561 561
 {
562 562
 	if(!_in || !_tm || strlen(_in)!=15)
563 563
 		return 0;
564
-	
564
+
565 565
 	memset(_tm, 0, sizeof(struct tm));
566
-	_tm->tm_year = _D(_in[0])*1000 + _D(_in[1])*100 
566
+	_tm->tm_year = _D(_in[0])*1000 + _D(_in[1])*100
567 567
 			+ _D(_in[2])*10 + _D(_in[3]) - 1900;
568 568
 	_tm->tm_mon = _D(_in[4])*10 + _D(_in[5]) - 1;
569 569
 	_tm->tm_mday = _D(_in[6])*10 + _D(_in[7]);
... ...
@@ -574,15 +574,15 @@ time_t ic_parse_datetime(char *_in, struct tm *_tm)
574 574
 	return mktime(_tm);
575 575
 }
576 576
 
577
-time_t ic_parse_duration(char *_in)
577
+time_t cpl_ic_parse_duration(char *_in)
578 578
 {
579 579
 	time_t _t, _ft;
580 580
 	char *_p;
581 581
 	int _fl;
582
-	
582
+
583 583
 	if(!_in || (*_in!='+' && *_in!='-' && *_in!='P' && *_in!='p'))
584 584
 		return 0;
585
-	
585
+
586 586
 	if(*_in == 'P' || *_in=='p')
587 587
 		_p = _in+1;
588 588
 	else
... ...
@@ -591,10 +591,10 @@ time_t ic_parse_duration(char *_in)
591 591
 			return 0;
592 592
 		_p = _in+2;
593 593
 	}
594
-	
594
+
595 595
 	_t = _ft = 0;
596 596
 	_fl = 1;
597
-	
597
+
598 598
 	while(*_p)
599 599
 	{
600 600
 		switch(*_p)
... ...
@@ -605,7 +605,7 @@ time_t ic_parse_duration(char *_in)
605 605
 			case '9':
606 606
 				_t = _t*10 + *_p - '0';
607 607
 			break;
608
-			
608
+
609 609
 			case 'w':
610 610
 			case 'W':
611 611
 				if(!_fl)
... ...
@@ -656,15 +656,15 @@ time_t ic_parse_duration(char *_in)
656 656
 	return _ft;
657 657
 }
658 658
 
659
-tr_byxxx_p ic_parse_byday(char *_in)
659
+cpl_tr_byxxx_p cpl_ic_parse_byday(char *_in)
660 660
 {
661
-	tr_byxxx_p _bxp = NULL;
661
+	cpl_tr_byxxx_p _bxp = NULL;
662 662
 	int _nr, _s, _v;
663 663
 	char *_p;
664 664
 
665 665
 	if(!_in)
666 666
 		return NULL;
667
-	_bxp = tr_byxxx_new();
667
+	_bxp = cpl_tr_byxxx_new();
668 668
 	if(!_bxp)
669 669
 		return NULL;
670 670
 	_p = _in;
... ...
@@ -675,9 +675,9 @@ tr_byxxx_p ic_parse_byday(char *_in)
675 675
 			_nr++;
676 676
 		_p++;
677 677
 	}
678
-	if(tr_byxxx_init(_bxp, _nr) < 0)
678
+	if(cpl_tr_byxxx_init(_bxp, _nr) < 0)
679 679
 	{
680
-		tr_byxxx_free(_bxp);
680
+		cpl_tr_byxxx_free(_bxp);
681 681
 		return NULL;
682 682
 	}
683 683
 	_p = _in;
... ...
@@ -693,7 +693,7 @@ tr_byxxx_p ic_parse_byday(char *_in)
693 693
 			case '9':
694 694
 				_v = _v*10 + *_p - '0';
695 695
 			break;
696
-			
696
+
697 697
 			case 's':
698 698
 			case 'S':
699 699
 				_p++;
... ...
@@ -785,19 +785,19 @@ tr_byxxx_p ic_parse_byday(char *_in)
785 785
 	return _bxp;
786 786
 
787 787
 error:
788
-	tr_byxxx_free(_bxp);
788
+	cpl_tr_byxxx_free(_bxp);
789 789
 	return NULL;
790 790
 }
791 791
 
792
-tr_byxxx_p ic_parse_byxxx(char *_in)
792
+cpl_tr_byxxx_p cpl_ic_parse_byxxx(char *_in)
793 793
 {
794
-	tr_byxxx_p _bxp = NULL;
794
+	cpl_tr_byxxx_p _bxp = NULL;
795 795
 	int _nr, _s, _v;
796 796
 	char *_p;
797 797
 
798 798
 	if(!_in)
799 799
 		return NULL;
800
-	_bxp = tr_byxxx_new();
800
+	_bxp = cpl_tr_byxxx_new();
801 801
 	if(!_bxp)
802 802
 		return NULL;
803 803
 	_p = _in;
... ...
@@ -808,9 +808,9 @@ tr_byxxx_p ic_parse_byxxx(char *_in)
808 808
 			_nr++;
809 809
 		_p++;
810 810
 	}
811
-	if(tr_byxxx_init(_bxp, _nr) < 0)
811
+	if(cpl_tr_byxxx_init(_bxp, _nr) < 0)
812 812
 	{
813
-		tr_byxxx_free(_bxp);
813
+		cpl_tr_byxxx_free(_bxp);
814 814
 		return NULL;
815 815
 	}
816 816
 	_p = _in;
... ...
@@ -826,7 +826,7 @@ tr_byxxx_p ic_parse_byxxx(char *_in)
826 826
 			case '9':
827 827
 				_v = _v*10 + *_p - '0';
828 828
 			break;
829
-			
829
+
830 830
 			case '-':
831 831
 				_s = -1;
832 832
 			break;
... ...
@@ -854,15 +854,15 @@ tr_byxxx_p ic_parse_byxxx(char *_in)
854 854
 	return _bxp;
855 855
 
856 856
 error:
857
-	tr_byxxx_free(_bxp);
857
+	cpl_tr_byxxx_free(_bxp);
858 858
 	return NULL;
859 859
 }
860 860
 
861
-int ic_parse_wkst(char *_in)
861
+int cpl_ic_parse_wkst(char *_in)
862 862
 {
863 863
 	if(!_in || strlen(_in)!=2)
864 864
 		goto error;
865
-	
865
+
866 866
 	switch(_in[0])
867 867
 	{
868 868
 		case 's':
... ...
@@ -910,7 +910,7 @@ int ic_parse_wkst(char *_in)
910 910
 		default:
911 911
 			goto error;
912 912
 	}
913
-	
913
+
914 914
 error:
915 915
 #ifdef USE_YWEEK_U
916 916
 	return WDAY_SU;
... ...
@@ -933,10 +933,10 @@ error:
933 933
 #define _IS_SET(x) (((x)>0)?1:0)
934 934
 
935 935
 /*** local headers ***/
936
-int get_min_interval(tmrec_p);
937
-int check_min_unit(tmrec_p, ac_tm_p, tr_res_p);
938
-int check_freq_interval(tmrec_p _trp, ac_tm_p _atp);
939
-int check_byxxx(tmrec_p, ac_tm_p);
936
+int cpl_get_min_interval(cpl_tmrec_p);
937
+int cpl_check_min_unit(cpl_tmrec_p, cpl_ac_tm_p, cpl_tr_res_p);
938
+int cpl_check_freq_interval(cpl_tmrec_p _trp, cpl_ac_tm_p _atp);
939
+int cpl_check_byxxx(cpl_tmrec_p, cpl_ac_tm_p);
940 940
 
941 941
 /**
942 942
  *
... ...
@@ -944,7 +944,7 @@ int check_byxxx(tmrec_p, ac_tm_p);
944 944
  *       -1/REC_ERR - error
945 945
  *        1/REC_NOMATCH - the time falls out
946 946
  */
947
-int check_tmrec(tmrec_p _trp, ac_tm_p _atp, tr_res_p _tsw)
947
+int cpl_check_tmrec(cpl_tmrec_p _trp, cpl_ac_tm_p _atp, cpl_tr_res_p _tsw)
948 948
 {
949 949
 	if(!_trp || !_atp || (!_IS_SET(_trp->duration) && !_IS_SET(_trp->dtend)))
950 950
 		return REC_ERR;
... ...
@@ -952,11 +952,11 @@ int check_tmrec(tmrec_p _trp, ac_tm_p _atp, tr_res_p _tsw)
952 952
 	/* it is before start date */
953 953
 	if(_atp->time < _trp->dtstart)
954 954
 		return REC_NOMATCH;
955
-	
955
+
956 956
 	/* compute the duration of the recurrence interval */
957 957
 	if(!_IS_SET(_trp->duration))
958 958
 		_trp->duration = _trp->dtend - _trp->dtstart;
959
-	
959
+
960 960
 	if(_atp->time <= _trp->dtstart+_trp->duration)
961 961
 	{
962 962
 		if(_tsw)
... ...
@@ -974,38 +974,38 @@ int check_tmrec(tmrec_p _trp, ac_tm_p _atp, tr_res_p _tsw)
974 974
 		}
975 975
 		return REC_MATCH;
976 976
 	}
977
-	
977
+
978 978
 	/* after the bound of recurrence */
979 979
 	if(_IS_SET(_trp->until) && _atp->time >= _trp->until + _trp->duration)
980 980
 		return REC_NOMATCH;
981
-	
981
+
982 982
 	/* check if the instance of recurrence matches the 'interval' */
983
-	if(check_freq_interval(_trp, _atp)!=REC_MATCH)
983
+	if(cpl_check_freq_interval(_trp, _atp)!=REC_MATCH)
984 984
 		return REC_NOMATCH;
985 985
 
986
-	if(check_min_unit(_trp, _atp, _tsw)!=REC_MATCH)
986
+	if(cpl_check_min_unit(_trp, _atp, _tsw)!=REC_MATCH)
987 987
 		return REC_NOMATCH;
988 988
 
989
-	if(check_byxxx(_trp, _atp)!=REC_MATCH)
989
+	if(cpl_check_byxxx(_trp, _atp)!=REC_MATCH)
990 990
 		return REC_NOMATCH;
991 991
 
992 992
 	return REC_MATCH;
993 993
 }
994 994
 
995 995
 
996
-int check_freq_interval(tmrec_p _trp, ac_tm_p _atp)
996
+int cpl_check_freq_interval(cpl_tmrec_p _trp, cpl_ac_tm_p _atp)
997 997
 {
998 998
 	int _t0, _t1;
999 999
 	struct tm _tm;
1000 1000
 	if(!_trp || !_atp)
1001 1001
 		return REC_ERR;
1002
-	
1002
+
1003 1003
 	if(!_IS_SET(_trp->freq))
1004 1004
 		return REC_NOMATCH;
1005
-	
1005
+
1006 1006
 	if(!_IS_SET(_trp->interval) || _trp->interval==1)
1007 1007
 		return REC_MATCH;
1008
-	
1008
+
1009 1009
 	switch(_trp->freq)
1010 1010
 	{
1011 1011
 		case FREQ_DAILY:
... ...
@@ -1040,33 +1040,33 @@ int check_freq_interval(tmrec_p _trp, ac_tm_p _atp)
1040 1040
 			return ((_atp->t.tm_year-_trp->ts.tm_year)%_trp->interval==0)?
1041 1041
 					REC_MATCH:REC_NOMATCH;
1042 1042
 	}
1043
-	
1043
+
1044 1044
 	return REC_NOMATCH;
1045 1045
 }
1046 1046
 
1047
-int get_min_interval(tmrec_p _trp)
1047
+int cpl_get_min_interval(cpl_tmrec_p _trp)
1048 1048
 {
1049 1049
 	if(!_trp)
1050 1050
 		return FREQ_NOFREQ;
1051
-	
1051
+
1052 1052
 	if(_trp->freq == FREQ_DAILY || _trp->byday || _trp->bymday || _trp->byyday)
1053 1053
 		return FREQ_DAILY;
1054
-	if(_trp->freq == FREQ_WEEKLY || _trp->byweekno) 
1054
+	if(_trp->freq == FREQ_WEEKLY || _trp->byweekno)
1055 1055
 		return FREQ_WEEKLY;
1056 1056
 	if(_trp->freq == FREQ_MONTHLY || _trp->bymonth)
1057 1057
 		return FREQ_MONTHLY;
1058 1058
 	if(_trp->freq == FREQ_YEARLY)
1059 1059
 		return FREQ_YEARLY;
1060
-	
1060
+
1061 1061
 	return FREQ_NOFREQ;
1062 1062
 }
1063 1063
 
1064
-int check_min_unit(tmrec_p _trp, ac_tm_p _atp, tr_res_p _tsw)
1064
+int cpl_check_min_unit(cpl_tmrec_p _trp, cpl_ac_tm_p _atp, cpl_tr_res_p _tsw)
1065 1065
 {
1066 1066
 	int _v0, _v1;
1067 1067
 	if(!_trp || !_atp)
1068 1068
 		return REC_ERR;
1069
-	switch(get_min_interval(_trp))
1069
+	switch(cpl_get_min_interval(_trp))
1070 1070
 	{
1071 1071
 		case FREQ_DAILY:
1072 1072
 		break;
... ...
@@ -1079,7 +1079,7 @@ int check_min_unit(tmrec_p _trp, ac_tm_p _atp, tr_res_p _tsw)
1079 1079
 				return REC_NOMATCH;
1080 1080
 		break;
1081 1081
 		case FREQ_YEARLY:
1082
-			if(_trp->ts.tm_mon != _atp->t.tm_mon 
1082
+			if(_trp->ts.tm_mon != _atp->t.tm_mon
1083 1083
 					|| _trp->ts.tm_mday != _atp->t.tm_mday)
1084 1084
 				return REC_NOMATCH;
1085 1085
 		break;
... ...
@@ -1105,29 +1105,29 @@ int check_min_unit(tmrec_p _trp, ac_tm_p _atp, tr_res_p _tsw)
1105 1105
 		}
1106 1106
 		return REC_MATCH;
1107 1107
 	}
1108
-	
1108
+
1109 1109
 	return REC_NOMATCH;
1110 1110
 }
1111 1111
 
1112
-int check_byxxx(tmrec_p _trp, ac_tm_p _atp)
1112
+int cpl_check_byxxx(cpl_tmrec_p _trp, cpl_ac_tm_p _atp)
1113 1113
 {
1114 1114
 	int i;
1115
-	ac_maxval_p _amp = NULL;
1115
+	cpl_ac_maxval_p _amp = NULL;
1116 1116
 	if(!_trp || !_atp)
1117 1117
 		return REC_ERR;
1118
-	if(!_trp->byday && !_trp->bymday && !_trp->byyday && !_trp->bymonth 
1118
+	if(!_trp->byday && !_trp->bymday && !_trp->byyday && !_trp->bymonth
1119 1119
 			&& !_trp->byweekno)
1120 1120
 		return REC_MATCH;
1121
-	
1122
-	_amp = ac_get_maxval(_atp);
1121
+
1122
+	_amp = cpl_ac_get_maxval(_atp);
1123 1123
 	if(!_amp)
1124 1124
 		return REC_NOMATCH;
1125
-	
1125
+
1126 1126
 	if(_trp->bymonth)
1127 1127
 	{
1128 1128
 		for(i=0; i<_trp->bymonth->nr; i++)
1129 1129
 		{
1130
-			if(_atp->t.tm_mon == 
1130
+			if(_atp->t.tm_mon ==
1131 1131
 					(_trp->bymonth->xxx[i]*_trp->bymonth->req[i]+12)%12)
1132 1132
 				break;
1133 1133
 		}
... ...
@@ -1180,7 +1180,7 @@ int check_byxxx(tmrec_p _trp, ac_tm_p _atp)
1180 1180
 			{
1181 1181
 #ifdef EXTRA_DEBUG
1182 1182
 				DBG("Req:byday:y: %d==%d && %d==%d\n", _atp->t.tm_wday,
1183
-					_trp->byday->xxx[i], _atp->ywday+1, 
1183
+					_trp->byday->xxx[i], _atp->ywday+1,
1184 1184
 					(_trp->byday->req[i]+_amp->ywday)%_amp->ywday);
1185 1185
 #endif
1186 1186
 				if(_atp->t.tm_wday == _trp->byday->xxx[i] &&
... ...
@@ -1194,7 +1194,7 @@ int check_byxxx(tmrec_p _trp, ac_tm_p _atp)
1194 1194
 				{
1195 1195
 #ifdef EXTRA_DEBUG
1196 1196
 					DBG("Req:byday:m: %d==%d && %d==%d\n", _atp->t.tm_wday,
1197
-						_trp->byday->xxx[i], _atp->mwday+1, 
1197
+						_trp->byday->xxx[i], _atp->mwday+1,
1198 1198
 						(_trp->byday->req[i]+_amp->mwday)%_amp->mwday);
1199 1199
 #endif
1200 1200
 					if(_atp->t.tm_wday == _trp->byday->xxx[i] &&
... ...
@@ -1215,5 +1215,3 @@ int check_byxxx(tmrec_p _trp, ac_tm_p _atp)
1215 1215
 
1216 1216
 	return REC_MATCH;
1217 1217
 }
1218
-
1219
-
... ...
@@ -51,7 +51,7 @@
51 51
 #define is_leap_year(yyyy) ((((yyyy)%400))?(((yyyy)%100)?(((yyyy)%4)?0:1):0):1)
52 52
 
53 53
 
54
-typedef struct _ac_maxval
54
+typedef struct _cpl_ac_maxval
55 55
 {
56 56
 	int yweek;
57 57
 	int yday;
... ...
@@ -59,9 +59,9 @@ typedef struct _ac_maxval
59 59
 	int mweek;
60 60
 	int mday;
61 61
 	int mwday;
62
-} ac_maxval_t, *ac_maxval_p;
62
+} cpl_ac_maxval_t, *cpl_ac_maxval_p;
63 63
 
64
-typedef struct _ac_tm
64
+typedef struct _cpl_ac_tm
65 65
 {
66 66
 	time_t time;
67 67
 	struct tm t;
... ...
@@ -69,22 +69,22 @@ typedef struct _ac_tm
69 69
 	int yweek;
70 70
 	int ywday;
71 71
 	int mwday;
72
-	ac_maxval_p mv;
73
-} ac_tm_t, *ac_tm_p;
72
+	cpl_ac_maxval_p mv;
73
+} cpl_ac_tm_t, *cpl_ac_tm_p;
74 74
 
75
-ac_tm_p ac_tm_new(void);
75
+cpl_ac_tm_p cpl_ac_tm_new(void);
76 76
 
77
-int ac_tm_set_time(ac_tm_p, time_t);
77
+int cpl_ac_tm_set_time(cpl_ac_tm_p, time_t);
78 78
 
79
-int ac_tm_reset(ac_tm_p);
80
-int ac_tm_free(ac_tm_p);
79
+int cpl_ac_tm_reset(cpl_ac_tm_p);
80
+int cpl_ac_tm_free(cpl_ac_tm_p);
81 81
 
82
-int ac_get_mweek(struct tm*);
83
-int ac_get_yweek(struct tm*);
84
-ac_maxval_p ac_get_maxval(ac_tm_p);
85
-int ac_get_wkst(void);
82
+int cpl_ac_get_mweek(struct tm*);
83
+int cpl_ac_get_yweek(struct tm*);
84
+cpl_ac_maxval_p cpl_ac_get_maxval(cpl_ac_tm_p);
85
+int cpl_ac_get_wkst(void);
86 86
 
87
-int ac_print(ac_tm_p);
87
+int cpl_ac_print(cpl_ac_tm_p);
88 88
 
89 89
 
90 90
 
... ...
@@ -110,14 +110,14 @@ int ac_print(ac_tm_p);
110 110
 #define TSW_TSET	1
111 111
 #define TSW_RSET	2
112 112
 
113
-typedef struct _tr_byxxx
113
+typedef struct _cpl_tr_byxxx
114 114
 {
115 115
 	int nr;
116 116
 	int *xxx;
117 117
 	int *req;
118
-} tr_byxxx_t, *tr_byxxx_p;
118
+} cpl_tr_byxxx_t, *cpl_tr_byxxx_p;
119 119
 
120
-typedef struct _tmrec
120
+typedef struct _cpl_tmrec
121 121
 {
122 122
 	time_t dtstart;
123 123
 	struct tm ts;
... ...
@@ -126,50 +126,48 @@ typedef struct _tmrec
126 126
 	time_t until;
127 127
 	int freq;
128 128
 	int interval;
129
-	tr_byxxx_p byday;
130
-	tr_byxxx_p bymday;
131
-	tr_byxxx_p byyday;
132
-	tr_byxxx_p bymonth;
133
-	tr_byxxx_p byweekno;
129
+	cpl_tr_byxxx_p byday;
130
+	cpl_tr_byxxx_p bymday;
131
+	cpl_tr_byxxx_p byyday;
132
+	cpl_tr_byxxx_p bymonth;
133
+	cpl_tr_byxxx_p byweekno;
134 134
 	int wkst;
135
-} tmrec_t, *tmrec_p;
135
+} cpl_tmrec_t, *cpl_tmrec_p;
136 136
 
137
-typedef struct _tr_res
137
+typedef struct _cpl_tr_res
138 138
 {
139 139
 	int flag;
140 140
 	time_t rest;
141
-} tr_res_t, *tr_res_p;
142
-
143
-tr_byxxx_p tr_byxxx_new(void);
144
-int tr_byxxx_init(tr_byxxx_p, int);
145
-int tr_byxxx_free(tr_byxxx_p);
146
-
147
-tmrec_p tmrec_new(void);
148
-int tmrec_free(tmrec_p);
149
-
150
-int tr_parse_dtstart(tmrec_p, char*);
151
-int tr_parse_dtend(tmrec_p, char*);
152
-int tr_parse_duration(tmrec_p, char*);
153
-int tr_parse_until(tmrec_p, char*);
154
-int tr_parse_freq(tmrec_p, char*);
155
-int tr_parse_interval(tmrec_p, char*);
156
-int tr_parse_byday(tmrec_p, char*);
157
-int tr_parse_bymday(tmrec_p, char*);
158
-int tr_parse_byyday(tmrec_p, char*);
159
-int tr_parse_bymonth(tmrec_p, char*);
160
-int tr_parse_byweekno(tmrec_p, char*);
161
-int tr_parse_wkst(tmrec_p, char*);
162
-
163
-int tr_print(tmrec_p);
164
-time_t ic_parse_datetime(char*,struct tm*);
165
-time_t ic_parse_duration(char*);
166
-
167
-tr_byxxx_p ic_parse_byday(char*);
168
-tr_byxxx_p ic_parse_byxxx(char*);
169
-int ic_parse_wkst(char*);
170
-
171
-int check_tmrec(tmrec_p, ac_tm_p, tr_res_p);
172
-
141
+} cpl_tr_res_t, *cpl_tr_res_p;
142
+
143
+cpl_tr_byxxx_p cpl_tr_byxxx_new(void);
144
+int cpl_tr_byxxx_init(cpl_tr_byxxx_p, int);
145
+int cpl_tr_byxxx_free(cpl_tr_byxxx_p);
146
+
147
+cpl_tmrec_p cpl_tmrec_new(void);
148
+int cpl_tmrec_free(cpl_tmrec_p);
149
+
150
+int cpl_tr_parse_dtstart(cpl_tmrec_p, char*);
151
+int cpl_tr_parse_dtend(cpl_tmrec_p, char*);
152
+int cpl_tr_parse_duration(cpl_tmrec_p, char*);
153
+int cpl_tr_parse_until(cpl_tmrec_p, char*);
154
+int cpl_tr_parse_freq(cpl_tmrec_p, char*);
155
+int cpl_tr_parse_interval(cpl_tmrec_p, char*);
156
+int cpl_tr_parse_byday(cpl_tmrec_p, char*);
157
+int cpl_tr_parse_bymday(cpl_tmrec_p, char*);
158
+int cpl_tr_parse_byyday(cpl_tmrec_p, char*);
159
+int cpl_tr_parse_bymonth(cpl_tmrec_p, char*);
160
+int cpl_tr_parse_byweekno(cpl_tmrec_p, char*);
161
+int cpl_tr_parse_wkst(cpl_tmrec_p, char*);
162
+
163
+int cpl_tr_print(cpl_tmrec_p);
164
+time_t cpl_ic_parse_datetime(char*,struct tm*);
165
+time_t cpl_ic_parse_duration(char*);
166
+
167
+cpl_tr_byxxx_p cpl_ic_parse_byday(char*);
168
+cpl_tr_byxxx_p cpl_ic_parse_byxxx(char*);
169
+int cpl_ic_parse_wkst(char*);
170
+
171
+int cpl_check_tmrec(cpl_tmrec_p, cpl_ac_tm_p, cpl_tr_res_p);
173 172
 
174 173
 #endif
175
-