| 1 | /* |
| 2 | * Legal Notice |
| 3 | * |
| 4 | * This document and associated source code (the "Work") is a part of a |
| 5 | * benchmark specification maintained by the TPC. |
| 6 | * |
| 7 | * The TPC reserves all right, title, and interest to the Work as provided |
| 8 | * under U.S. and international laws, including without limitation all patent |
| 9 | * and trademark rights therein. |
| 10 | * |
| 11 | * No Warranty |
| 12 | * |
| 13 | * 1.1 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE INFORMATION |
| 14 | * CONTAINED HEREIN IS PROVIDED "AS IS" AND WITH ALL FAULTS, AND THE |
| 15 | * AUTHORS AND DEVELOPERS OF THE WORK HEREBY DISCLAIM ALL OTHER |
| 16 | * WARRANTIES AND CONDITIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, |
| 17 | * INCLUDING, BUT NOT LIMITED TO, ANY (IF ANY) IMPLIED WARRANTIES, |
| 18 | * DUTIES OR CONDITIONS OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR |
| 19 | * PURPOSE, OF ACCURACY OR COMPLETENESS OF RESPONSES, OF RESULTS, OF |
| 20 | * WORKMANLIKE EFFORT, OF LACK OF VIRUSES, AND OF LACK OF NEGLIGENCE. |
| 21 | * ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, |
| 22 | * QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT |
| 23 | * WITH REGARD TO THE WORK. |
| 24 | * 1.2 IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THE WORK BE LIABLE TO |
| 25 | * ANY OTHER PARTY FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO THE |
| 26 | * COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS |
| 27 | * OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, |
| 28 | * INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, |
| 29 | * OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT |
| 30 | * RELATING TO THE WORK, WHETHER OR NOT SUCH AUTHOR OR DEVELOPER HAD |
| 31 | * ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. |
| 32 | * |
| 33 | * Contributors: |
| 34 | * Gradient Systems |
| 35 | */ |
| 36 | /* |
| 37 | * DATE table structure |
| 38 | */ |
| 39 | #ifndef W_DATETBL_H |
| 40 | #define W_DATETBL_H |
| 41 | #include "constants.h" |
| 42 | struct W_DATE_TBL { |
| 43 | ds_key_t d_date_sk; |
| 44 | char d_date_id[RS_BKEY + 1]; |
| 45 | /* this is generated at output from d_date_sk */ |
| 46 | /* date_t d_date; */ |
| 47 | int d_month_seq; |
| 48 | int d_week_seq; |
| 49 | int d_quarter_seq; |
| 50 | int d_year; |
| 51 | int d_dow; |
| 52 | int d_moy; |
| 53 | int d_dom; |
| 54 | int d_qoy; |
| 55 | int d_fy_year; |
| 56 | int d_fy_quarter_seq; |
| 57 | int d_fy_week_seq; |
| 58 | char *d_day_name; |
| 59 | /* char d_quarter_name[RS_D_QUARTER_NAME + 1]; derived at print time */ |
| 60 | int d_holiday; |
| 61 | int d_weekend; |
| 62 | int d_following_holiday; |
| 63 | int d_first_dom; |
| 64 | int d_last_dom; |
| 65 | int d_same_day_ly; |
| 66 | int d_same_day_lq; |
| 67 | int d_current_day; |
| 68 | int d_current_week; |
| 69 | int d_current_month; |
| 70 | int d_current_quarter; |
| 71 | int d_current_year; |
| 72 | }; |
| 73 | |
| 74 | int mk_w_date(void *info_arr, ds_key_t kIndex); |
| 75 | |
| 76 | int vld_w_date(int nTable, ds_key_t kRow, int *Permutation); |
| 77 | #endif |
| 78 | |