~ubuntu-branches/ubuntu/lucid/patch/lucid

« back to all changes in this revision

Viewing changes to src/partime.h

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Berg
  • Date: 2009-12-02 10:25:26 UTC
  • mfrom: (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20091202102526-5luk0zsqhghu58l2
Tags: 2.6-2
* Update watch file.
* Section: vcs.
* Suggests: diffutils-doc instead of diff-doc, thanks Christoph Anton
  Mitterer for spotting. Closes: #558974.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Parse a string, yielding a struct partime that describes it.  */
 
2
 
 
3
/* Copyright (C) 1993, 1994, 1995, 1997, 2003, 2006 Paul Eggert
 
4
   Distributed under license by the Free Software Foundation, Inc.
 
5
 
 
6
   This file is part of RCS.
 
7
 
 
8
   RCS is free software; you can redistribute it and/or modify
 
9
   it under the terms of the GNU General Public License as published by
 
10
   the Free Software Foundation; either version 2, or (at your option)
 
11
   any later version.
 
12
 
 
13
   RCS is distributed in the hope that it will be useful,
 
14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
   GNU General Public License for more details.
 
17
 
 
18
   You should have received a copy of the GNU General Public License
 
19
   along with RCS; see the file COPYING.
 
20
   If not, write to the Free Software Foundation,
 
21
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
22
 
 
23
   Report problems and direct all questions to:
 
24
 
 
25
   rcs-bugs@cs.purdue.edu
 
26
 
 
27
 */
 
28
 
 
29
#include <limits.h>
 
30
#include <time.h>
 
31
 
 
32
#define TM_UNDEFINED (-1)
 
33
#define TM_DEFINED(x) (0 <= (x))
 
34
 
 
35
#define TM_LOCAL_ZONE LONG_MIN
 
36
#define TM_UNDEFINED_ZONE (LONG_MIN + 1)
 
37
 
 
38
struct partime
 
39
  {
 
40
    /* This structure describes the parsed time.
 
41
       Only the following tm_* members are used:
 
42
                sec, min, hour, mday, mon, year, wday, yday.
 
43
       If ! TM_DEFINED (value), the parser never found the value.
 
44
       The tm_year field is the actual year, not the year - 1900;
 
45
       but see ymodulus below.  */
 
46
    struct tm tm;
 
47
 
 
48
    /* Like tm, but values are relative to the value in tm,
 
49
       and values are initialized to 0 rather than to TM_UNDEFINED.
 
50
       Only the following tm_* members are used:
 
51
                sec, min, hour, mday, mon, year.  */
 
52
    struct tm tmr;
 
53
 
 
54
    /* If TM_DEFINED (wday_ordinal),
 
55
       then day number (e.g. 3 in "3rd Sunday").  */
 
56
    int wday_ordinal;
 
57
 
 
58
    /* If TM_DEFINED (ymodulus),
 
59
       then tm.tm_year is actually modulo ymodulus.  */
 
60
    int ymodulus;
 
61
 
 
62
    /* Week of year, ISO 8601 style.
 
63
       If ! TM_DEFINED (yweek), the parser never found yweek.
 
64
       Weeks start on Mondays.
 
65
       Week 1 includes Jan 4.  */
 
66
    int yweek;
 
67
 
 
68
    /* Seconds east of UTC; or TM_LOCAL_ZONE or TM_UNDEFINED_ZONE.  */
 
69
    long zone;
 
70
  };
 
71
 
 
72
char *partime (char const *, struct partime *);
 
73
char *parzone (char const *, long *);