diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:19:15 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:19:15 +0000 |
commit | 6eb9c5a5657d1fe77b55cc261450f3538d35a94d (patch) | |
tree | 657d8194422a5daccecfd42d654b8a245ef7b4c8 /contrib/isn/ISSN.h | |
parent | Initial commit. (diff) | |
download | postgresql-13-6eb9c5a5657d1fe77b55cc261450f3538d35a94d.tar.xz postgresql-13-6eb9c5a5657d1fe77b55cc261450f3538d35a94d.zip |
Adding upstream version 13.4.upstream/13.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'contrib/isn/ISSN.h')
-rw-r--r-- | contrib/isn/ISSN.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/contrib/isn/ISSN.h b/contrib/isn/ISSN.h new file mode 100644 index 0000000..585f0e2 --- /dev/null +++ b/contrib/isn/ISSN.h @@ -0,0 +1,49 @@ +/* + * ISSN.h + * PostgreSQL type definitions for ISNs (ISBN, ISMN, ISSN, EAN13, UPC) + * + * Information recompiled by Kronuz on November 12, 2004 + * http://www.issn.org/ + * + * IDENTIFICATION + * contrib/isn/ISSN.h + * + * 1144-875X <=> 1144875(X) <=> 1144875 <=> (977)1144875 <=> 9771144875(00) <=> 977114487500(7) <=> 977-1144-875-00-7 + * + * + * ISSN 1 1 4 4 8 7 5 + * Weight 8 7 6 5 4 3 2 + * Product 8 + 7 + 24 + 20 + 32 + 21 + 10 = 122 + * 122 / 11 = 11 remainder 1 + * Check digit 11 - 1 = 10 = X + * => 1144-875X + * + * ISSN 9 7 7 1 1 4 4 8 7 5 0 0 + * Weight 1 3 1 3 1 3 1 3 1 3 1 3 + * Product 9 + 21 + 7 + 3 + 1 + 12 + 4 + 24 + 7 + 15 + 0 + 0 = 103 + * 103 / 10 = 10 remainder 3 + * Check digit 10 - 3 = 7 + * => 977-1144875-00-7 ?? <- supplemental number (number of the week, month, etc.) + * ^^ 00 for non-daily publications (01=Monday, 02=Tuesday, ...) + * + * The hyphenation is always in after the four digits of the ISSN code. + * + */ + +/* where the digit set begins, and how many of them are in the table */ +const unsigned ISSN_index[10][2] = { + {0, 1}, + {0, 1}, + {0, 1}, + {0, 1}, + {0, 1}, + {0, 1}, + {0, 1}, + {0, 1}, + {0, 1}, + {0, 1}, +}; +const char *ISSN_range[][2] = { + {"0000-000", "9999-999"}, + {NULL, NULL} +}; |