00001 /*------------------------------------------------------------------------- 00002 * 00003 * isn.h 00004 * PostgreSQL type definitions for ISNs (ISBN, ISMN, ISSN, EAN13, UPC) 00005 * 00006 * Author: German Mendez Bravo (Kronuz) 00007 * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group 00008 * 00009 * IDENTIFICATION 00010 * contrib/isn/isn.h 00011 * 00012 *------------------------------------------------------------------------- 00013 */ 00014 00015 #ifndef ISN_H 00016 #define ISN_H 00017 00018 #include "fmgr.h" 00019 00020 #undef ISN_DEBUG 00021 #define ISN_WEAK_MODE 00022 00023 /* 00024 * uint64 is the internal storage format for ISNs. 00025 */ 00026 typedef uint64 ean13; 00027 00028 #define EAN13_FORMAT UINT64_FORMAT 00029 00030 #define PG_GETARG_EAN13(n) PG_GETARG_INT64(n) 00031 #define PG_RETURN_EAN13(x) PG_RETURN_INT64(x) 00032 00033 extern Datum isn_out(PG_FUNCTION_ARGS); 00034 extern Datum ean13_out(PG_FUNCTION_ARGS); 00035 extern Datum ean13_in(PG_FUNCTION_ARGS); 00036 extern Datum isbn_in(PG_FUNCTION_ARGS); 00037 extern Datum ismn_in(PG_FUNCTION_ARGS); 00038 extern Datum issn_in(PG_FUNCTION_ARGS); 00039 extern Datum upc_in(PG_FUNCTION_ARGS); 00040 00041 extern Datum isbn_cast_from_ean13(PG_FUNCTION_ARGS); 00042 extern Datum ismn_cast_from_ean13(PG_FUNCTION_ARGS); 00043 extern Datum issn_cast_from_ean13(PG_FUNCTION_ARGS); 00044 extern Datum upc_cast_from_ean13(PG_FUNCTION_ARGS); 00045 00046 extern Datum is_valid(PG_FUNCTION_ARGS); 00047 extern Datum make_valid(PG_FUNCTION_ARGS); 00048 00049 extern Datum accept_weak_input(PG_FUNCTION_ARGS); 00050 extern Datum weak_input_status(PG_FUNCTION_ARGS); 00051 00052 extern void initialize(void); 00053 00054 #endif /* ISN_H */