File: date_tmx.h

package info (click to toggle)
ruby3.4 3.4.5-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 154,784 kB
  • sloc: ruby: 1,259,653; ansic: 829,955; yacc: 28,233; pascal: 7,359; sh: 3,864; python: 1,799; cpp: 1,158; asm: 808; makefile: 801; javascript: 414; lisp: 109; perl: 62; awk: 36; sed: 4; xml: 4
file content (56 lines) | stat: -rw-r--r-- 1,367 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef DATE_TMX_H
#define DATE_TMX_H

struct tmx_funcs {
    VALUE (*year)(void *dat);
    int (*yday)(void *dat);
    int (*mon)(void *dat);
    int (*mday)(void *dat);
    VALUE (*cwyear)(void *dat);
    int (*cweek)(void *dat);
    int (*cwday)(void *dat);
    int (*wnum0)(void *dat);
    int (*wnum1)(void *dat);
    int (*wday)(void *dat);
    int (*hour)(void *dat);
    int (*min)(void *dat);
    int (*sec)(void *dat);
    VALUE (*sec_fraction)(void *dat);
    VALUE (*secs)(void *dat);
    VALUE (*msecs)(void *dat);
    int (*offset)(void *dat);
    char *(*zone)(void *dat);
};
struct tmx {
    void *dat;
    const struct tmx_funcs *funcs;
};

#define tmx_attr(x) (tmx->funcs->x)(tmx->dat)

#define tmx_year tmx_attr(year)
#define tmx_yday tmx_attr(yday)
#define tmx_mon tmx_attr(mon)
#define tmx_mday tmx_attr(mday)
#define tmx_cwyear tmx_attr(cwyear)
#define tmx_cweek tmx_attr(cweek)
#define tmx_cwday tmx_attr(cwday)
#define tmx_wnum0 tmx_attr(wnum0)
#define tmx_wnum1 tmx_attr(wnum1)
#define tmx_wday tmx_attr(wday)
#define tmx_hour tmx_attr(hour)
#define tmx_min tmx_attr(min)
#define tmx_sec tmx_attr(sec)
#define tmx_sec_fraction tmx_attr(sec_fraction)
#define tmx_secs tmx_attr(secs)
#define tmx_msecs tmx_attr(msecs)
#define tmx_offset tmx_attr(offset)
#define tmx_zone tmx_attr(zone)

#endif

/*
Local variables:
c-file-style: "ruby"
End:
*/