2006-09-09 12:07:52 +08:00
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
*
|
|
|
|
|
* isn.h
|
|
|
|
|
* PostgreSQL type definitions for ISNs (ISBN, ISMN, ISSN, EAN13, UPC)
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) 2004-2006, Germ<EFBFBD>n M<EFBFBD>ndez Bravo (Kronuz)
|
2007-01-06 06:20:05 +08:00
|
|
|
|
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
2006-09-09 12:07:52 +08:00
|
|
|
|
*
|
|
|
|
|
* IDENTIFICATION
|
2007-06-06 05:31:09 +08:00
|
|
|
|
* $PostgreSQL: pgsql/contrib/isn/isn.h,v 1.4 2007/06/05 21:31:03 tgl Exp $
|
2006-09-09 12:07:52 +08:00
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef ISN_H
|
|
|
|
|
#define ISN_H
|
|
|
|
|
|
|
|
|
|
#include "fmgr.h"
|
|
|
|
|
|
|
|
|
|
#undef ISN_DEBUG
|
|
|
|
|
#define ISN_WEAK_MODE
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* uint64 is the internal storage format for ISNs.
|
|
|
|
|
*/
|
|
|
|
|
typedef uint64 ean13;
|
|
|
|
|
|
|
|
|
|
#define EAN13_FORMAT UINT64_FORMAT
|
|
|
|
|
|
2006-09-11 04:45:17 +08:00
|
|
|
|
#define PG_GETARG_EAN13(n) PG_GETARG_INT64((int64)n)
|
|
|
|
|
#define PG_RETURN_EAN13(x) PG_RETURN_INT64((int64)x)
|
2006-09-09 12:07:52 +08:00
|
|
|
|
|
|
|
|
|
extern Datum isn_out(PG_FUNCTION_ARGS);
|
|
|
|
|
extern Datum ean13_out(PG_FUNCTION_ARGS);
|
|
|
|
|
extern Datum ean13_in(PG_FUNCTION_ARGS);
|
|
|
|
|
extern Datum isbn_in(PG_FUNCTION_ARGS);
|
|
|
|
|
extern Datum ismn_in(PG_FUNCTION_ARGS);
|
|
|
|
|
extern Datum issn_in(PG_FUNCTION_ARGS);
|
|
|
|
|
extern Datum upc_in(PG_FUNCTION_ARGS);
|
|
|
|
|
|
2006-09-11 04:45:17 +08:00
|
|
|
|
extern Datum isbn_cast_from_ean13(PG_FUNCTION_ARGS);
|
|
|
|
|
extern Datum ismn_cast_from_ean13(PG_FUNCTION_ARGS);
|
|
|
|
|
extern Datum issn_cast_from_ean13(PG_FUNCTION_ARGS);
|
|
|
|
|
extern Datum upc_cast_from_ean13(PG_FUNCTION_ARGS);
|
2006-09-09 12:07:52 +08:00
|
|
|
|
|
|
|
|
|
extern Datum is_valid(PG_FUNCTION_ARGS);
|
|
|
|
|
extern Datum make_valid(PG_FUNCTION_ARGS);
|
|
|
|
|
|
|
|
|
|
extern Datum accept_weak_input(PG_FUNCTION_ARGS);
|
|
|
|
|
extern Datum weak_input_status(PG_FUNCTION_ARGS);
|
|
|
|
|
|
|
|
|
|
extern void initialize(void);
|
|
|
|
|
|
|
|
|
|
#endif /* ISN_H */
|