rcs: Fix gcc80 warnings (-Wdangling-else and -Wmisleading-indentation).
[dragonfly.git] / gnu / usr.bin / rcs / lib / partime.h
blob5d3983fbb048219d33cbf84a5f21360db49b1792
1 /* Parse a string, yielding a struct partime that describes it. */
3 /* Copyright 1993, 1994, 1995 Paul Eggert
4 Distributed under license by the Free Software Foundation, Inc.
6 This file is part of RCS.
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.
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.
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 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 Report problems and direct all questions to:
25 rcs-bugs@cs.purdue.edu
29 #define TM_UNDEFINED (-1)
30 #define TM_DEFINED(x) (0 <= (x))
32 #define TM_UNDEFINED_ZONE ((long) -24 * 60 * 60)
33 #define TM_LOCAL_ZONE (TM_UNDEFINED_ZONE - 1)
35 struct partime {
37 * This structure describes the parsed time.
38 * Only the following tm_* values in it are used:
39 * sec, min, hour, mday, mon, year, wday, yday.
40 * If TM_UNDEFINED(value), the parser never found the value.
41 * The tm_year field is the actual year, not the year - 1900;
42 * but see ymodulus below.
44 struct tm tm;
47 * If !TM_UNDEFINED(ymodulus),
48 * then tm.tm_year is actually modulo ymodulus.
50 int ymodulus;
53 * Week of year, ISO 8601 style.
54 * If TM_UNDEFINED(yweek), the parser never found yweek.
55 * Weeks start on Mondays.
56 * Week 1 includes Jan 4.
58 int yweek;
60 /* Seconds east of UTC; or TM_LOCAL_ZONE or TM_UNDEFINED_ZONE. */
61 long zone;
64 #if defined(__STDC__) || has_prototypes
65 # define __PARTIME_P(x) x
66 #else
67 # define __PARTIME_P(x) ()
68 #endif
70 char *partime __PARTIME_P((char const *, struct partime *));
71 char *parzone __PARTIME_P((char const *, long *));