Debian Codegraph @

terps/tads/tads3/vmdate.h

raw symbols SCIP
1 /* $Header$ */
2
3 /*
4 * Copyright (c) 2012 Michael J. Roberts. All Rights Reserved.
5 *
6 * Please see the accompanying license file, LICENSE.TXT, for information
7 * on using and copying this software.
8 */
9 /*
10 Name
11 vmdate.h - CVmObjDate object
12 Function
13 Defines the Date intrinsic class
14 Notes
15
16 Modified
17 01/23/12 MJRoberts - Creation
18 */
19
20 #ifndef VMDATE_H
21 #define VMDATE_H
22
23 #include <math.h>
24
25 #include "t3std.h"
26 #include "vmtype.h"
27 #include "vmglob.h"
28 #include "vmobj.h"
29 #include "vmundo.h"
30
31
32 /* ------------------------------------------------------------------------ */
33 /*
34 * Service class for calendar date conversions. This converts between
35 * calendar dates and day number values, using our Epoch of March 1, year
36 * 0.
37 */
38 struct caldate_t
39 {
40 /* create at the Epoch (3/1/0000 midnight UTC) */
41 caldate_t() : y(0), m(3), d(1) { }
42
43 /* create from a calendar date */
44 caldate_t(int y, int m, int d) : y(y), m(m), d(d) { }
45
46 /* create from a day number */
47 caldate_t(int32_t dayno) { set_dayno(dayno); }
48
49 /* set to the current date (UTC) */
50 void set_now()
51 {
52 int32_t dayno, daytime;
53 now(dayno, daytime);
54 set_dayno(dayno);
55 }
56
57 /* get the Julian day number */
58 double julian_dayno() const { return dayno() + 1721119.5; }
59
60 /* figure the date on the Julian calendar */
61 void julian_date(int &jy, int &jm, int &jd)
62 {
63 int32_t z = (int32_t)floor(julian_dayno() + 0.5);
64
65 int32_t a = z;
66 int32_t b = a + 1524;
67 int32_t c = (int32_t)floor((b - 122.1) / 365.25);
68 int32_t d = (int32_t)floor(365.25 * c);
69 int32_t e = (int32_t)floor((b - d) / 30.6001);
70
71 jm = e < 14 ? e - 1 : e - 13;
72 jy = jm > 2 ? c - 4716 : c - 4715;
73 jd = b - d - (int32_t)floor(30.6001 * e);
74 }
75
76 /* set my internal (Gregorian) date from a Julian date */
77 void set_julian_date(int jy, int jm, int jd)
78 {
79 /* adjust the month to 1-12 range */
80 div_t mq = div(jm - 1, 12);
81 if (mq.rem <= 0)
82 mq.rem += 12, mq.quot -= 1;
83 jm = mq.rem + 1;
84 jy += mq.quot;
85
86
87 /*
88 * Calculate the Julian day number for the julian date, then
89 * subtract our Epoch's Julian day number to get our day number.
90 */
91 if (jm <= 2)
92 {
93 jy -= 1;
94 jm += 12;
95 }
96 set_dayno((int32_t)(floor(365.25 * (jy + 4716))
97 + floor(30.6001 * (jm + 1))
98 + jd - 1524.5 - 1721119.5));
99 }
100
101 /* set from a day number */
102 void set_dayno(int32_t dayno)
103 {
104 int32_t y = (int32_t)floor((10000*(double)dayno + 14780)/3652425.0);
105 int32_t d = dayno - (365*y + divfl(y, 4) - divfl(y, 100)
106 + divfl(y, 400));
107 if (d < 0)
108 {
109 y -= 1;
110 d = dayno - (365*y + divfl(y, 4) - divfl(y, 100) + divfl(y, 400));
111 }
112 int32_t m = (100*d + 52)/3060;
113
114 this->y = y + (m+2)/12;
115 this->m = (m + 2)%12 + 1;
116 this->d = d - (m*306 + 5)/10 + 1;
117 }
118
119 /*
120 * Normalize the date. This takes the current m/d/y setting,
121 * calculates the day number it represents, and then figure the m/d/y
122 * for that day number. This ensures that a date entered with an
123 * overflow in one of the fields (e.g., "February 30") is translated
124 * into a proper calendar date.
125 */
126 void normalize_date()
127 {
128 set_dayno(dayno());
129 }
130
131 /*
132 * Integer divide-and-get-floor calculation - i.e., round towards
133 * negative infinity. This is the same as ordinary C integer division
134 * for positive numbers, but for negative numbers most C
135 * implementations round towards zero.
136 */
137 static inline int32_t divfl(int32_t a, int32_t b)
138 {
139 ldiv_t ld = ldiv(a, b);
140 return (ld.rem < 0 ? ld.quot - 1 : ld.quot);
141 }
142
143 /* get the day number of this calendar date */
144 int32_t dayno() const
145 {
146 /*
147 * Adjust the month to our odd range where the year starts in
148 * March: 0 = March, 1 = April, ... 11 = Feb. (If this yields a
149 * negative remainder, adjust to a positive index by going back a
150 * year.)
151 */
152 div_t mq = div(this->m - 3, 12);
153 if (mq.rem < 0)
154 mq.rem += 12, mq.quot -= 1;
155
156 int m = mq.rem;
157 int y = this->y + mq.quot;
158 return 365*y + divfl(y, 4) - divfl(y, 100) + divfl(y, 400)
159 + (m*306 + 5)/10 + (d-1);
160 }
161
162 /* day number of the Unix Epoch (1/1/1970 UTC) */
163 static const int32_t UNIX_EPOCH_DAYNO = 719468;
164
165 /* get the weekday for this date (0=Sunday, 1=Monday, etc) */
166 int weekday() const
167 {
168 const static int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
169 int yy = y - (m < 3 ? 1 : 0);
170 return (yy + yy/4 - yy/100 + yy/400 + t[m-1] + d) % 7;
171 }
172
173 /* get the ISO weekday for this date (1=Monday, ... 7=Sunday) */
174 int iso_weekday() const
175 { int w = weekday(); return w == 0 ? 7 : w; }
176
177 /*
178 * Figure the week number, where week 1 starts on the first <weekday>
179 * of the year (0=Sunday).
180 */
181 int weekno(int weekday) const
182 {
183 /*
184 * Figure days until the first <weekday> of the year: that's the
185 * start of week 1, so the day number of the start of week 1 is the
186 * jan1 day number plus this delta. The start of week 0 is 7 days
187 * before that.
188 */
189 caldate_t jan1(y, 1, 1);
190 int delta = (7 + weekday - jan1.weekday()) % 7;
191 int week0_dayno = jan1.dayno() + delta - 7;
192
193 /* figure which week we're in and return the result */
194 return (dayno() - week0_dayno)/7;
195 }
196
197 /*
198 * Figure the ISO-8601 week number of this date. Week 1 is the week
199 * containing the year's first Thursday, and the first day of each week
200 * is Monday. Fills in 'year' (if provided) with the year the week
201 * belongs to, which might be the previous or next calendar year.
202 */
203 int iso_weekno(int *year) const
204 {
205 /*
206 * Find the Thursday of the current ISO week. To do this, figure
207 * our weekday, subtract the ISO weekday number minus 1 to get the
208 * nearest preceding Monday (the start of the ISO week), then add 3
209 * to get the following Thursday. The year containing the Thursday
210 * of a given week is by definition the year which that whole week
211 * (starting on Monday) belongs to.
212 */
213 int wday = iso_weekday();
214 int32_t this_thu_dayno = dayno() - (wday-1) + 3;
215 caldate_t this_thu(this_thu_dayno);
216
217 /* the year containing the Thursday is the week's calendar year */
218 if (year != 0)
219 *year = this_thu.y;
220
221 /*
222 * Find the first Thursday of the calendar year we just calculated.
223 * ISO week 1 of a given calendar year is the week that contains
224 * the first Thursday of the year. So find the first Thursday on
225 * or after Jan 1.
226 */
227 caldate_t jan1(this_thu.y, 1, 1);
228 int jan1_wday = jan1.weekday();
229 int32_t first_thu_dayno = jan1.dayno() + ((11 - jan1_wday) % 7);
230
231 /*
232 * Calculate the number of weeks (== the number of days divided by
233 * seven) between the Thursday of the target week and the Thursday
234 * of the first week. This gives us the difference in week
235 * numbers; since the first week is week #1, adding 1 to the
236 * difference gives us the target week number.
237 */
238 return ((this_thu_dayno - first_thu_dayno)/7) + 1;
239 }
240
241 /* get the current system date/time (UTC) */
242 static void now(int32_t &dayno, int32_t &daytime);
243
244 /* normalize a date/time to bring the time within 00:00-24:00 */
245 static void normalize(int32_t &dayno, int32_t &daytime);
246
247 /* calendar year, month (1=January), and day of month */
248 int y;
249 int m;
250 int d;
251 };
252
253
254 /* ------------------------------------------------------------------------ */
255 /*
256 * Multi-calendar interface. This virtualizes the calculations in
257 * caldate_t for different calendars.
258 */
259 struct multicaldate_t
260 {
261 virtual ~multicaldate_t() { }
262 virtual int32_t dayno() const = 0;
263 virtual void set_dayno(int32_t d) = 0;
264 virtual int weekday() const = 0;
265 virtual int iso_weekday() const = 0;
266 virtual int iso_weekno(int *year) const = 0;
267
268 /* get the day number of January 1 of year 'y' */
269 virtual int32_t jan1_dayno() const = 0;
270
271 /*
272 * get the week number for this date, for the week starting on the
273 * given weekday
274 */
275 int weekno(int weekday) const
276 {
277 /*
278 * Figure days until the first <weekday> of the year: that's the
279 * start of week 1, so the day number of the start of week 1 is the
280 * jan1 day number plus this delta. The start of week 0 is 7 days
281 * before that.
282 */
283 caldate_t jan1(jan1_dayno());
284 int delta = (7 + weekday - jan1.weekday()) % 7;
285 int week0_dayno = jan1.dayno() + delta - 7;
286
287 /* figure which week we're in and return the result */
288 return (dayno() - week0_dayno)/7;
289 }
290
291 virtual void set_date(int y, int m, int d) = 0;
292 int y() const { return y_; }
293 int m() const { return m_; }
294 int d() const { return d_; }
295
296 protected:
297 /* year, month, day on the subclass calendar */
298 int y_, m_, d_;
299 };
300
301 struct gregcaldate_t: multicaldate_t
302 {
303 gregcaldate_t() { }
304 gregcaldate_t(int32_t d) { gregcaldate_t::set_dayno(d); }
305
306 virtual int32_t dayno() const
307 {
308 return cd.dayno();
309 }
310
311 virtual void set_dayno(int32_t d)
312 {
313 cd.set_dayno(d);
314 y_ = cd.y;
315 d_ = cd.d;
316 m_ = cd.m;
317 }
318
319 virtual void set_date(int y, int m, int d)
320 {
321 y_ = cd.y = y;
322 m_ = cd.m = m;
323 d_ = cd.d = d;
324 }
325
326 virtual int32_t jan1_dayno() const
327 {
328 caldate_t jan1(y_, 1, 1);
329 return jan1.dayno();
330 }
331
332 virtual int weekday() const { return cd.weekday(); }
333 virtual int iso_weekday() const { return cd.iso_weekday(); }
334 virtual int iso_weekno(int *year) const { return cd.iso_weekno(year); }
335
336 caldate_t cd;
337 };
338
339 struct julcaldate_t: multicaldate_t
340 {
341 virtual int32_t dayno() const
342 {
343 return cd.dayno();
344 }
345
346 virtual void set_dayno(int32_t d)
347 {
348 cd.set_dayno(d);
349 cd.julian_date(y_, m_, d_);
350 }
351
352 virtual void set_date(int y, int m, int d)
353 {
354 cd.set_julian_date(y, m, d);
355 y_ = y;
356 m_ = m;
357 d_ = d;
358 }
359
360 virtual int32_t jan1_dayno() const
361 {
362 caldate_t jan1;
363 jan1.set_julian_date(y_, 1, 1);
364 return jan1.dayno();
365 }
366
367 virtual int weekday() const { return cd.weekday(); }
368 virtual int iso_weekday() const { return cd.iso_weekday(); }
369 virtual int iso_weekno(int *year) const { return cd.iso_weekno(year); }
370
371 caldate_t cd;
372 };
373
374
375
376 /* ------------------------------------------------------------------------ */
377 /*
378 * A Date value is stored internally as two 32-bit integers: the day number
379 * of the date, which is the number of days since March 1, year 0, midnight
380 * UTC; and the time of day as the number of milliseconds past midnight
381 * (UTC) on that day.
382 *
383 * The image file data block is arranged as follows:
384 *
385 *. UINT4 day_number
386 *. UINT2 time_of_day_ms
387 */
388
389 /* ------------------------------------------------------------------------ */
390 /*
391 * Forward declarations
392 */
393 typedef struct date_parse_result date_parse_result;
394
395
396 /* ------------------------------------------------------------------------ */
397 /*
398 * Our in-memory extension data structure. This contains the date (as a
399 * Gregorian day number since March 1, 0000 UTC), time of day (as the
400 * number of milliseconds past midnight), and the TimeZone object that we
401 * use to determine the local time zone for formatting the date as a string
402 * or extracting calendar or clock elements.
403 */
404 struct vm_date_ext
405 {
406 /* allocate the structure */
407 static vm_date_ext *alloc_ext(VMG_ class CVmObjDate *self);
408
409 /* day number - number of days since March 1, year 0000 UTC */
410 int32_t dayno;
411
412 /* time of day - number of milliseconds past midnight UTC on dayno*/
413 int32_t daytime;
414 };
415
416
417 /* ------------------------------------------------------------------------ */
418 /*
419 * CVmObjDate intrinsic class definition
420 */
421
422 class CVmObjDate: public CVmObject
423 {
424 friend class CVmMetaclassDate;
425
426 public:
427 /* metaclass registration object */
428 static class CVmMetaclass *metaclass_reg_;
429 class CVmMetaclass *get_metaclass_reg() const { return metaclass_reg_; }
430
431 /* am I of the given metaclass? */
432 virtual int is_of_metaclass(class CVmMetaclass *meta) const
433 {
434 /* try my own metaclass and my base class */
435 return (meta == metaclass_reg_
436 || CVmObject::is_of_metaclass(meta));
437 }
438
439 /* is this a CVmObjDate object? */
440 static int is_date_obj(VMG_ vm_obj_id_t obj)
441 { return vm_objp(vmg_ obj)->is_of_metaclass(metaclass_reg_); }
442
443 /* get my date and time values */
444 int32_t get_dayno() const { return get_ext()->dayno; }
445 int32_t get_daytime() const { return get_ext()->daytime; }
446
447 /* create dynamically using stack arguments */
448 static vm_obj_id_t create_from_stack(VMG_ const uchar **pc_ptr,
449 uint argc);
450
451 /* create with a given timestamp */
452 static vm_obj_id_t create(VMG_ int in_root_set,
453 int32_t dayno, int32_t daytime);
454
455 /* create from an os_time_t value */
456 static vm_obj_id_t create_from_time_t(VMG_ int in_root_set, os_time_t t);
457
458 /*
459 * call a static property - we don't have any of our own, so simply
460 * "inherit" the base class handling
461 */
462 static int call_stat_prop(VMG_ vm_val_t *result,
463 const uchar **pc_ptr, uint *argc,
464 vm_prop_id_t prop);
465
466
467 /* notify of deletion */
468 void notify_delete(VMG_ int in_root_set);
469
470 /* set a property */
471 void set_prop(VMG_ class CVmUndo *undo,
472 vm_obj_id_t self, vm_prop_id_t prop, const vm_val_t *val);
473
474 /* get a property */
475 int get_prop(VMG_ vm_prop_id_t prop, vm_val_t *val,
476 vm_obj_id_t self, vm_obj_id_t *source_obj, uint *argc);
477
478 /* cast to a string */
479 const char *cast_to_string(VMG_ vm_obj_id_t self, vm_val_t *newstr) const;
480
481 /* format into a string buffer */
482 void format_string_buf(VMG_ char *buf, size_t buflen) const;
483
484 /* format using a template */
485 size_t format_date(VMG_ char *buf, size_t buflen,
486 const char *fmt, size_t fmtlen,
487 class CVmDateLocale *lc,
488 const multicaldate_t *date,
489 int32_t dayno, int32_t daytime,
490 const char *tzabbr, int32_t tzofs) const;
491
492 /* date arithmetic - add an integer or BigNumber to add days */
493 int add_val(VMG_ vm_val_t *result, vm_obj_id_t self, const vm_val_t *val);
494
495 /*
496 * date arithmetic - subtract an integer or BigNumber to subtract days
497 * from the date, or subtract another Date to calculate the number of
498 * days between the dates
499 */
500 int sub_val(VMG_ vm_val_t *result, vm_obj_id_t self, const vm_val_t *val);
501
502 /* compare two dates */
503 int equals(VMG_ vm_obj_id_t self, const vm_val_t *val, int depth) const;
504 int compare_to(VMG_ vm_obj_id_t self, const vm_val_t *val) const;
505
506 /*
507 * receive savepoint notification - we don't keep any
508 * savepoint-relative records, so we don't need to do anything here
509 */
510 void notify_new_savept() { }
511
512 /* apply an undo record - we're immutable, so there's no undo */
513 void apply_undo(VMG_ struct CVmUndoRecord *) { }
514
515 /* discard an undo record */
516 void discard_undo(VMG_ struct CVmUndoRecord *) { }
517
518 /* mark our undo record references */
519 void mark_undo_ref(VMG_ struct CVmUndoRecord *) { }
520
521 /* mark our references (we have none) */
522 void mark_refs(VMG_ uint) { }
523
524 /* remove weak references */
525 void remove_stale_weak_refs(VMG0_) { }
526 void remove_stale_undo_weak_ref(VMG_ struct CVmUndoRecord *) { }
527
528 /* load from an image file */
529 void load_from_image(VMG_ vm_obj_id_t self, const char *ptr, size_t siz);
530
531 /* reload from an image file */
532 void reload_from_image(VMG_ vm_obj_id_t self,
533 const char *ptr, size_t siz);
534
535 /* rebuild for image file */
536 virtual ulong rebuild_image(VMG_ char *buf, ulong buflen);
537
538 /* save to a file */
539 void save_to_file(VMG_ class CVmFile *fp);
540
541 /* restore from a file */
542 void restore_from_file(VMG_ vm_obj_id_t self,
543 class CVmFile *fp, class CVmObjFixup *fixups);
544
545 /* Date objects are immutable, so they can't change after loading */
546 int is_changed_since_load() const { return FALSE; }
547
548 protected:
549 /* create a with no initial contents */
550 CVmObjDate() { ext_ = 0; }
551
552 /* create with a given timestamp */
553 CVmObjDate(VMG_ int32_t dayno, uint32_t daytime);
554
555 /* get my extension data */
556 vm_date_ext *get_ext() const { return (vm_date_ext *)ext_; }
557
558 /* get my date/time in the given time zone; returns the format abbr */
559 const char *get_local_time(
560 int32_t &dayno, int32_t &daytime, class CVmTimeZone *tz) const
561 { int32_t ofs; return get_local_time(dayno, daytime, ofs, tz); }
562
563 /*
564 * get my date/time in the given time zone, filling in the time zone's
565 * offset from UTC in milliseconds
566 */
567 const char *get_local_time(
568 int32_t &dayno, int32_t &daytime, int32_t &tzofs,
569 class CVmTimeZone *tz) const;
570
571 /* get my date (as a day number since 1/1/0000) in the local time zone */
572 int32_t get_local_date(class CVmTimeZone *tz) const
573 {
574 int32_t dayno, daytime;
575 (void)get_local_time(dayno, daytime, tz);
576 return dayno;
577 }
578
579 /* get a TimeZone argument to one of our methods */
580 static class CVmTimeZone *get_tz_arg(VMG_ uint argn, uint argc);
581
582 /* load or reload image data */
583 void load_image_data(VMG_ const char *ptr, size_t siz);
584
585 /* internal parsing routines */
586 static int parse_string_fmt(
587 VMG_ date_parse_result *res,
588 const char *&str, size_t &len,
589 const char *fmt, size_t fmtlen, class CVmDateLocale *lc);
590 static int parse_date_string(
591 VMG_ int32_t &dayno, int32_t &daytime,
592 const char *str, const vm_val_t *custom, class CVmDateLocale *lc,
593 multicaldate_t *cal,
594 int32_t refday, int32_t reftime, CVmTimeZone *reftz,
595 struct date_parse_result *resultp,
596 struct date_parse_string *fmtlist, int *nfmtlist);
597
598 /* property evaluator - undefined function */
599 int getp_undef(VMG_ vm_obj_id_t, vm_val_t *, uint *) { return FALSE; }
600
601 /* parseDate method */
602 int getp_parseDate(VMG_ vm_obj_id_t, vm_val_t *retval, uint *argc)
603 { return s_getp_parseDate(vmg_ retval, argc); }
604
605 /* static property evaluator for parseDate */
606 static int s_getp_parseDate(VMG_ vm_val_t *retval, uint *argc);
607
608 /* parseJulianDate method */
609 int getp_parseJulianDate(VMG_ vm_obj_id_t, vm_val_t *retval, uint *argc)
610 { return s_getp_parseJulianDate(vmg_ retval, argc); }
611
612 /* static property evaluator for parseDate */
613 static int s_getp_parseJulianDate(VMG_ vm_val_t *retval, uint *argc);
614
615 /* common handler for parseDate, parseJulianDate */
616 static int common_parseDate(VMG_ vm_val_t *retval, uint *argc,
617 multicaldate_t *cal);
618
619 /* general handler for formatDate, formatJulianDate */
620 int formatDateGen(VMG_ vm_obj_id_t self, vm_val_t *retval, uint *argc,
621 multicaldate_t *date);
622
623 /* formatDate method */
624 int getp_formatDate(VMG_ vm_obj_id_t self, vm_val_t *retval, uint *argc);
625
626 /* formatJulianDate method */
627 int getp_formatJulianDate(
628 VMG_ vm_obj_id_t self, vm_val_t *retval, uint *argc);
629
630 /* compareTo */
631 int getp_compareTo(VMG_ vm_obj_id_t self, vm_val_t *retval, uint *argc);
632
633 /* getDate method */
634 int getp_getDate(VMG_ vm_obj_id_t self, vm_val_t *retval, uint *argc);
635
636 /* getJulianDay method */
637 int getp_getJulianDay(
638 VMG_ vm_obj_id_t self, vm_val_t *retval, uint *argc);
639
640 /* getJulianDate method */
641 int getp_getJulianDate(
642 VMG_ vm_obj_id_t self, vm_val_t *retval, uint *argc);
643
644 /* getISOWeekDate */
645 int getp_getISOWeekDate(
646 VMG_ vm_obj_id_t self, vm_val_t *retval, uint *argc);
647
648 /* getTime method */
649 int getp_getTime(VMG_ vm_obj_id_t self, vm_val_t *retval, uint *argc);
650
651 /* addInterval method */
652 int getp_addInterval(VMG_ vm_obj_id_t self, vm_val_t *retval, uint *argc);
653
654 /* findWeekday method */
655 int getp_findWeekday(VMG_ vm_obj_id_t self, vm_val_t *retval, uint *argc);
656
657 /* setLocaleInfo method */
658 int getp_setLocaleInfo(VMG_ vm_obj_id_t, vm_val_t *retval, uint *argc)
659 { return s_getp_setLocaleInfo(vmg_ retval, argc); }
660
661 /* static property evaluator for setLocalInfo */
662 static int s_getp_setLocaleInfo(VMG_ vm_val_t *retval, uint *argc);
663
664 /* property evaluation function table */
665 static int (CVmObjDate::*func_table_[])(VMG_ vm_obj_id_t self,
666 vm_val_t *retval, uint *argc);
667 };
668
669
670 /* ------------------------------------------------------------------------ */
671 /*
672 * CVmObjDate metaclass registration table object
673 */
674 class CVmMetaclassDate: public CVmMetaclass
675 {
676 public:
677 /* get the global name */
678 const char *get_meta_name() const { return "date/030000"; }
679
680 /* create from image file */
681 void create_for_image_load(VMG_ vm_obj_id_t id)
682 {
683 new (vmg_ id) CVmObjDate();
684 G_obj_table->set_obj_gc_characteristics(id, FALSE, FALSE);
685 }
686
687 /* create from restoring from saved state */
688 void create_for_restore(VMG_ vm_obj_id_t id)
689 {
690 new (vmg_ id) CVmObjDate();
691 G_obj_table->set_obj_gc_characteristics(id, FALSE, FALSE);
692 }
693
694 /* create dynamically using stack arguments */
695 vm_obj_id_t create_from_stack(VMG_ const uchar **pc_ptr, uint argc)
696 { return CVmObjDate::create_from_stack(vmg_ pc_ptr, argc); }
697
698 /* call a static property */
699 int call_stat_prop(VMG_ vm_val_t *result,
700 const uchar **pc_ptr, uint *argc,
701 vm_prop_id_t prop)
702 {
703 return CVmObjDate::call_stat_prop(
704 vmg_ result, pc_ptr, argc, prop);
705 }
706
707 int set_stat_prop(VMG_ class CVmUndo *, vm_obj_id_t /*self*/,
708 vm_val_t * /* class_state */,
709 vm_prop_id_t /*prop*/, const vm_val_t * /*val*/)
710 {
711 return TRUE;
712 }
713 };
714
715 #endif /* VMDATE_H */
716
717 /*
718 * Register the class
719 */
720 VM_REGISTER_METACLASS(CVmObjDate)