Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7a724a0

Browse files
author
Thomas G. Lockhart
committed
Include some Julian date declarations to share between various date/time
modules. Used to be in dt.c I think.
1 parent0925e5f commit7a724a0

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

‎src/include/utils/dt.h

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: dt.h,v 1.34 1999/01/20 16:26:45 thomas Exp $
11+
* $Id: dt.h,v 1.35 1999/02/13 04:15:33 thomas Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -262,6 +262,29 @@ extern intdatetime_is_epoch(double j);
262262
#defineJROUND(j) (rint(((double) (j))*TIME_PREC_INV)/TIME_PREC_INV)
263263

264264

265+
266+
/*
267+
* Date/time validation
268+
* Include check for leap year.
269+
*/
270+
271+
externintday_tab[2][13];
272+
273+
#defineisleap(y) (((y % 4) == 0 && (y % 100) != 0) || (y % 400) == 0)
274+
275+
/* Julian date support for date2j() and j2date()
276+
* Set the minimum year to one greater than the year of the first valid day
277+
* to avoid having to check year and day both. - tgl 97/05/08
278+
*/
279+
280+
#defineJULIAN_MINYEAR (-4713)
281+
#defineJULIAN_MINMONTH (11)
282+
#defineJULIAN_MINDAY (23)
283+
284+
#defineIS_VALID_JULIAN(y,m,d) ((y > JULIAN_MINYEAR) \
285+
|| ((y == JULIAN_MINYEAR) && ((m > JULIAN_MINMONTH) \
286+
|| ((m == JULIAN_MINMONTH) && (d >= JULIAN_MINDAY)))))
287+
265288
/*
266289
* Date/time validation
267290
* Include check for leap year.

‎src/include/utils/int8.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: int8.h,v 1.8 1998/09/11 17:16:11 momjian Exp $
9+
* $Id: int8.h,v 1.9 1999/02/13 04:13:56 thomas Exp $
1010
*
1111
* NOTES
1212
* These data types are supported on all 64-bit architectures, and may
@@ -88,13 +88,16 @@ extern int64 *int48div(int32 val1, int64 * val2);
8888
externint64*int48(int32val);
8989
externint32int84(int64*val);
9090

91-
#ifFALSE
91+
#ifNOT_USED
9292
externint64*int28 (int16val);
9393
externint16int82(int64*val);
94-
9594
#endif
9695

9796
externfloat64i8tod(int64*val);
9897
externint64*dtoi8(float64val);
9998

99+
externtext*int8_text(int64*val);
100+
externint64*text_int8(text*str);
101+
100102
#endif/* INT8_H */
103+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp