Ruby: ext/date/date_tmx.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

date_tmx.h
Go to the documentation of this file.
1#ifndef DATE_TMX_H
2#define DATE_TMX_H
3
4 struct tmx_funcs {
5 VALUE (*year)(void *dat);
6 int (*yday)(void *dat);
7 int (*mon)(void *dat);
8 int (*mday)(void *dat);
9 VALUE (*cwyear)(void *dat);
10 int (*cweek)(void *dat);
11 int (*cwday)(void *dat);
12 int (*wnum0)(void *dat);
13 int (*wnum1)(void *dat);
14 int (*wday)(void *dat);
15 int (*hour)(void *dat);
16 int (*min)(void *dat);
17 int (*sec)(void *dat);
18 VALUE (*sec_fraction)(void *dat);
19 VALUE (*secs)(void *dat);
20 VALUE (*msecs)(void *dat);
21 int (*offset)(void *dat);
22 char *(*zone)(void *dat);
23};
24 struct tmx {
25 void *dat;
26 const struct tmx_funcs *funcs;
27};
28
29#define tmx_attr(x) (tmx->funcs->x)(tmx->dat)
30
31#define tmx_year tmx_attr(year)
32#define tmx_yday tmx_attr(yday)
33#define tmx_mon tmx_attr(mon)
34#define tmx_mday tmx_attr(mday)
35#define tmx_cwyear tmx_attr(cwyear)
36#define tmx_cweek tmx_attr(cweek)
37#define tmx_cwday tmx_attr(cwday)
38#define tmx_wnum0 tmx_attr(wnum0)
39#define tmx_wnum1 tmx_attr(wnum1)
40#define tmx_wday tmx_attr(wday)
41#define tmx_hour tmx_attr(hour)
42#define tmx_min tmx_attr(min)
43#define tmx_sec tmx_attr(sec)
44#define tmx_sec_fraction tmx_attr(sec_fraction)
45#define tmx_secs tmx_attr(secs)
46#define tmx_msecs tmx_attr(msecs)
47#define tmx_offset tmx_attr(offset)
48#define tmx_zone tmx_attr(zone)
49
50#endif
51
52/*
53Local variables:
54c-file-style: "ruby"
55End:
56*/
offset
voidpf uLong offset
Definition: ioapi.h:144
int
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
tmx_funcs
Definition: date_tmx.h:4
tmx_funcs::cwyear
VALUE(* cwyear)(void *dat)
Definition: date_tmx.h:9
tmx_funcs::sec_fraction
VALUE(* sec_fraction)(void *dat)
Definition: date_tmx.h:18
tmx_funcs::min
int(* min)(void *dat)
Definition: date_tmx.h:16
tmx_funcs::mday
int(* mday)(void *dat)
Definition: date_tmx.h:8
tmx_funcs::wnum0
int(* wnum0)(void *dat)
Definition: date_tmx.h:12
tmx_funcs::wday
int(* wday)(void *dat)
Definition: date_tmx.h:14
tmx_funcs::mon
int(* mon)(void *dat)
Definition: date_tmx.h:7
tmx_funcs::sec
int(* sec)(void *dat)
Definition: date_tmx.h:17
tmx_funcs::cweek
int(* cweek)(void *dat)
Definition: date_tmx.h:10
tmx_funcs::cwday
int(* cwday)(void *dat)
Definition: date_tmx.h:11
tmx_funcs::year
VALUE(* year)(void *dat)
Definition: date_tmx.h:5
tmx_funcs::hour
int(* hour)(void *dat)
Definition: date_tmx.h:15
tmx_funcs::secs
VALUE(* secs)(void *dat)
Definition: date_tmx.h:19
tmx_funcs::wnum1
int(* wnum1)(void *dat)
Definition: date_tmx.h:13
tmx_funcs::msecs
VALUE(* msecs)(void *dat)
Definition: date_tmx.h:20
tmx_funcs::yday
int(* yday)(void *dat)
Definition: date_tmx.h:6
tmx
Definition: date_tmx.h:24
tmx::funcs
const struct tmx_funcs * funcs
Definition: date_tmx.h:26
tmx::dat
void * dat
Definition: date_tmx.h:25
VALUE
unsigned long VALUE
Definition: value.h:38