PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
ISSN.h
Go to the documentation of this file.
1 /*
2  * ISSN.h
3  * PostgreSQL type definitions for ISNs (ISBN, ISMN, ISSN, EAN13, UPC)
4  *
5  * Information recompiled by Kronuz on November 12, 2004
6  * http://www.issn.org/
7  *
8  * IDENTIFICATION
9  * contrib/isn/ISSN.h
10  *
11  * 1144-875X <=> 1144875(X) <=> 1144875 <=> (977)1144875 <=> 9771144875(00) <=> 977114487500(7) <=> 977-1144-875-00-7
12  *
13  *
14  * ISSN 1 1 4 4 8 7 5
15  * Weight 8 7 6 5 4 3 2
16  * Product 8 + 7 + 24 + 20 + 32 + 21 + 10 = 122
17  * 122 / 11 = 11 remainder 1
18  * Check digit 11 - 1 = 10 = X
19  * => 1144-875X
20  *
21  * ISSN 9 7 7 1 1 4 4 8 7 5 0 0
22  * Weight 1 3 1 3 1 3 1 3 1 3 1 3
23  * Product 9 + 21 + 7 + 3 + 1 + 12 + 4 + 24 + 7 + 15 + 0 + 0 = 103
24  * 103 / 10 = 10 remainder 3
25  * Check digit 10 - 3 = 7
26  * => 977-1144875-00-7 ?? <- supplemental number (number of the week, month, etc.)
27  * ^^ 00 for non-daily publications (01=Monday, 02=Tuesday, ...)
28  *
29  * The hyphenation is always in after the four digits of the ISSN code.
30  *
31  */
32 
33 /* where the digit set begins, and how many of them are in the table */
34 const unsigned ISSN_index[10][2] = {
35  {0, 1},
36  {0, 1},
37  {0, 1},
38  {0, 1},
39  {0, 1},
40  {0, 1},
41  {0, 1},
42  {0, 1},
43  {0, 1},
44  {0, 1},
45 };
46 const char *ISSN_range[][2] = {
47  {"0000-000", "9999-999"},
48  {NULL, NULL}
49 };
const unsigned ISSN_index[10][2]
Definition: ISSN.h:34
const char * ISSN_range[][2]
Definition: ISSN.h:46
#define NULL
Definition: c.h:226