~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to ext/date/date_tmx.h

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
    VALUE (*offset)(void *dat);
 
22
    char *(*zone)(void *dat);
 
23
};
 
24
struct tmx {
 
25
    void *dat;
 
26
    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
/*
 
53
Local variables:
 
54
c-file-style: "ruby"
 
55
End:
 
56
*/