~ubuntu-branches/ubuntu/trusty/lifelines/trusty

« back to all changes in this revision

Viewing changes to src/hdrs/date.h

  • Committer: Bazaar Package Importer
  • Author(s): Felipe Augusto van de Wiel (faw)
  • Date: 2007-05-23 23:49:53 UTC
  • mfrom: (3.1.3 edgy)
  • Revision ID: james.westby@ubuntu.com-20070523234953-ogno9rnbmth61i7p
Tags: 3.0.50-2etch1
* Changing docs/ll-reportmanual.xml and docs/ll-userguide.xml to fix
  documentation build problems (Closes: #418347).

* lifelines-reports
  - Adding a dependency to lifelines >= 3.0.50 to prevent file conflict.
    (Closes: #405500).

* Updating French translation. Thanks to Bernard Adrian. (Closes: #356671).

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#ifndef _DATE_H
30
30
#define _DATE_H
31
31
 
32
 
 
33
 
/* GEDCOM dates */
34
32
enum { BAD_YEAR=-99999 };
35
 
struct tag_dnum { INT val; INT val2; STRING str; };
36
 
struct tag_gdate {
37
 
        INT calendar;
38
 
        struct tag_dnum year;
39
 
        struct tag_dnum month;
40
 
        struct tag_dnum day;
41
 
        INT mod;
42
 
        INT eratime; /* eg, AD, BC */
43
 
};
44
 
struct tag_gdateval {
45
 
        struct tag_gdate date1;
46
 
        struct tag_gdate date2; /* used by period/from_to & range/bet_and */
47
 
        INT type;
48
 
        INT subtype;
49
 
        INT valid; /* -1=bad syntax, 0=freeform, 1=perfect GEDCOM date */
50
 
        STRING text; /* copy of original */
51
 
};
52
 
typedef struct tag_gdateval *GDATEVAL;
53
 
enum { GDV_PERIOD=1, GDV_RANGE, GDV_DATE, GDV_APPROX  };
54
 
enum { GDVP_FROM=1, GDVP_TO, GDVP_FROM_TO }; /* period subtype */
55
 
enum { GDVR_BEF=1, GDVR_AFT, GDVR_BET, GDVR_BET_AND }; /* range subtype */
56
 
enum { GDVA_ABT=1, GDVA_EST, GDVA_CAL }; /* approx subtype */
57
 
enum { GDV_GREGORIAN=1, GDV_JULIAN, GDV_HEBREW, GDV_FRENCH, GDV_ROMAN, GDV_CALENDARS_IX };
58
 
enum { GDV_AD=1, GDV_BC };
59
 
 
 
33
struct tag_dnum {
 
34
        INT val;    /* parsed value, eg, 2 for FEBRUARY */
 
35
        INT val2;   /* TODO: need comment explaining what this is */
 
36
        STRING str; /* raw string that was in date */
 
37
};
 
38
 
 
39
typedef struct tag_gdateval *GDATEVAL; /* definition of struct in datei.h */
 
40
 
 
41
ZSTR approx_time(INT seconds);
60
42
GDATEVAL create_gdateval(void);
61
43
STRING do_format_date(STRING, INT, INT, INT, INT, INT, INT);
62
44
void date_update_lang(void);
 
45
INT date_get_day(GDATEVAL gdv);
 
46
INT date_get_mod(GDATEVAL gdv);
 
47
INT date_get_month(GDATEVAL gdv);
 
48
INT date_get_year(GDATEVAL gdv);
 
49
STRING date_get_year_string(GDATEVAL gdv);
63
50
GDATEVAL extract_date(STRING);
64
51
void free_gdateval(GDATEVAL gdv);
65
52
BOOLEAN gdateval_isdual(GDATEVAL);
66
53
STRING get_todays_date(void);
 
54
BOOLEAN is_valid_dayfmt(INT dayfmt);
 
55
BOOLEAN is_valid_monthfmt(INT monthfmt);
 
56
BOOLEAN is_valid_yearfmt(INT yearfmt);
67
57
BOOLEAN set_cmplx_pic(INT ecmplx, STRING pic);
68
58
void set_date_pic(STRING pic);
69
59
STRING shorten_date(STRING);
70
60
void term_date(void);
71
61
 
72
62
 
 
63
 
73
64
#endif /* _DATE_H */