]> granicus.if.org Git - postgresql/blob - contrib/isn/isn.h
Update copyright notices for year 2012.
[postgresql] / contrib / isn / isn.h
1 /*-------------------------------------------------------------------------
2  *
3  * isn.h
4  *        PostgreSQL type definitions for ISNs (ISBN, ISMN, ISSN, EAN13, UPC)
5  *
6  * Author:      German Mendez Bravo (Kronuz)
7  * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
8  *
9  * IDENTIFICATION
10  *        contrib/isn/isn.h
11  *
12  *-------------------------------------------------------------------------
13  */
14
15 #ifndef ISN_H
16 #define ISN_H
17
18 #include "fmgr.h"
19
20 #undef ISN_DEBUG
21 #define ISN_WEAK_MODE
22
23 /*
24  *      uint64 is the internal storage format for ISNs.
25  */
26 typedef uint64 ean13;
27
28 #define EAN13_FORMAT UINT64_FORMAT
29
30 #define PG_GETARG_EAN13(n) PG_GETARG_INT64(n)
31 #define PG_RETURN_EAN13(x) PG_RETURN_INT64(x)
32
33 extern Datum isn_out(PG_FUNCTION_ARGS);
34 extern Datum ean13_out(PG_FUNCTION_ARGS);
35 extern Datum ean13_in(PG_FUNCTION_ARGS);
36 extern Datum isbn_in(PG_FUNCTION_ARGS);
37 extern Datum ismn_in(PG_FUNCTION_ARGS);
38 extern Datum issn_in(PG_FUNCTION_ARGS);
39 extern Datum upc_in(PG_FUNCTION_ARGS);
40
41 extern Datum isbn_cast_from_ean13(PG_FUNCTION_ARGS);
42 extern Datum ismn_cast_from_ean13(PG_FUNCTION_ARGS);
43 extern Datum issn_cast_from_ean13(PG_FUNCTION_ARGS);
44 extern Datum upc_cast_from_ean13(PG_FUNCTION_ARGS);
45
46 extern Datum is_valid(PG_FUNCTION_ARGS);
47 extern Datum make_valid(PG_FUNCTION_ARGS);
48
49 extern Datum accept_weak_input(PG_FUNCTION_ARGS);
50 extern Datum weak_input_status(PG_FUNCTION_ARGS);
51
52 extern void initialize(void);
53
54 #endif   /* ISN_H */