diff options
Diffstat (limited to 'src/backend/utils')
-rw-r--r-- | src/backend/utils/Makefile | 14 | ||||
-rw-r--r-- | src/backend/utils/adt/cash.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/like.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/like_match.c | 7 | ||||
-rw-r--r-- | src/backend/utils/adt/quote.c | 16 | ||||
-rw-r--r-- | src/backend/utils/adt/selfuncs.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/varchar.c | 8 | ||||
-rw-r--r-- | src/backend/utils/adt/varlena.c | 9 | ||||
-rw-r--r-- | src/backend/utils/init/postinit.c | 9 | ||||
-rw-r--r-- | src/backend/utils/mb/README | 4 | ||||
-rw-r--r-- | src/backend/utils/mb/encnames.c | 4 | ||||
-rw-r--r-- | src/backend/utils/mb/mbutils.c | 16 | ||||
-rw-r--r-- | src/backend/utils/mb/wchar.c | 10 |
13 files changed, 48 insertions, 61 deletions
diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile index 3cd88d5e45f..efc86391255 100644 --- a/src/backend/utils/Makefile +++ b/src/backend/utils/Makefile @@ -1,17 +1,14 @@ # # Makefile for utils # -# $Header: /cvsroot/pgsql/src/backend/utils/Makefile,v 1.19 2002/08/10 17:59:28 petere Exp $ +# $Header: /cvsroot/pgsql/src/backend/utils/Makefile,v 1.20 2002/09/03 21:45:42 petere Exp $ # subdir = src/backend/utils/ top_builddir = ../../.. include $(top_builddir)/src/Makefile.global -SUBDIRS := adt cache error fmgr hash init misc mmgr sort time -ifdef MULTIBYTE -SUBDIRS += mb -endif +SUBDIRS := adt cache error fmgr hash init misc mmgr sort time mb SUBDIROBJS := $(SUBDIRS:%=%/SUBSYS.o) @@ -33,10 +30,3 @@ fmgroids.h fmgrtab.c: Gen_fmgrtab.sh $(top_srcdir)/src/include/catalog/pg_proc.h clean: for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@ || exit; done rm -f SUBSYS.o fmgrtab.o fmgroids.h fmgrtab.c - -dep depend: fmgroids.h fmgrtab.c - for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@ || exit; done - -ifeq (depend,$(wildcard depend)) -include depend -endif diff --git a/src/backend/utils/adt/cash.c b/src/backend/utils/adt/cash.c index e4d6350e815..3664a6053f4 100644 --- a/src/backend/utils/adt/cash.c +++ b/src/backend/utils/adt/cash.c @@ -9,7 +9,7 @@ * workings can be found in the book "Software Solutions in C" by * Dale Schumacher, Academic Press, ISBN: 0-12-632360-7. * - * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.54 2002/08/20 16:46:29 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.55 2002/09/03 21:45:42 petere Exp $ */ #include "postgres.h" @@ -61,7 +61,7 @@ CashGetDatum(Cash value) * XXX HACK It looks as though some of the symbols for * monetary values returned by localeconv() can be multiple * bytes/characters. This code assumes one byte only. - tgl 97/04/14 - * XXX UNHACK Allow the currency symbol to be multi-byte. + * XXX UNHACK Allow the currency symbol to be multibyte. * - thomas 1998-03-01 */ Datum diff --git a/src/backend/utils/adt/like.c b/src/backend/utils/adt/like.c index fab47e37fa2..fca4fc77b30 100644 --- a/src/backend/utils/adt/like.c +++ b/src/backend/utils/adt/like.c @@ -11,7 +11,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/like.c,v 1.52 2002/09/02 06:22:19 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/like.c,v 1.53 2002/09/03 21:45:42 petere Exp $ * *------------------------------------------------------------------------- */ @@ -93,7 +93,7 @@ iwchareq(unsigned char *p1, unsigned char *p2) return (0); /* - * ok, p1 and p2 are both > CHARMAX, then they must be multi-byte + * ok, p1 and p2 are both > CHARMAX, then they must be multibyte * characters */ l = pg_mblen(p1); diff --git a/src/backend/utils/adt/like_match.c b/src/backend/utils/adt/like_match.c index 54ac32dcc53..60bc186c7e0 100644 --- a/src/backend/utils/adt/like_match.c +++ b/src/backend/utils/adt/like_match.c @@ -3,8 +3,9 @@ * like_match.c * like expression handling internal code. * - * This file is included by like.c *twice* if multibyte is enabled. - * This is for an optimization of single byte encodings. + * This file is included by like.c *twice*, to provide an optimization + * for single-byte encodings. + * * Before the inclusion, we need to define following macros: * * CHAREQ @@ -18,7 +19,7 @@ * Copyright (c) 1996-2002, PostgreSQL Global Development Group * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/like_match.c,v 1.3 2002/06/20 20:29:37 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/like_match.c,v 1.4 2002/09/03 21:45:42 petere Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/adt/quote.c b/src/backend/utils/adt/quote.c index 97946866d01..d41856c8478 100644 --- a/src/backend/utils/adt/quote.c +++ b/src/backend/utils/adt/quote.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/quote.c,v 1.8 2002/08/29 07:22:27 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/quote.c,v 1.9 2002/09/03 21:45:42 petere Exp $ * *------------------------------------------------------------------------- */ @@ -64,13 +64,9 @@ quote_literal(PG_FUNCTION_ARGS) PG_RETURN_TEXT_P(result); } - /* - * MULTIBYTE dependant internal functions follow - * + * Check if a given identifier needs quoting */ - -/* Check if a given identifier needs quoting (MULTIBYTE version) */ static bool quote_ident_required(text *iptr) { @@ -106,7 +102,9 @@ quote_ident_required(text *iptr) return false; } -/* Return a properly quoted identifier (MULTIBYTE version) */ +/* + * Return a properly quoted identifier + */ static text * do_quote_ident(text *iptr) { @@ -147,7 +145,9 @@ do_quote_ident(text *iptr) return result; } -/* Return a properly quoted literal value (MULTIBYTE version) */ +/* + * Return a properly quoted literal value + */ static text * do_quote_literal(text *lptr) { diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index dc0b520b925..44037b1a376 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.115 2002/09/02 06:22:19 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.116 2002/09/03 21:45:42 petere Exp $ * *------------------------------------------------------------------------- */ @@ -3367,7 +3367,7 @@ make_greater_string(const Const *str_const) /* * Truncate off the last character, which might be more than 1 - * byte in MULTIBYTE case. + * byte, depending on the character encoding. */ if (datatype != BYTEAOID && pg_database_encoding_max_length() > 1) len = pg_mbcliplen((const unsigned char *) workstr, len, len - 1); diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c index e1181dd375f..819e3122c3c 100644 --- a/src/backend/utils/adt/varchar.c +++ b/src/backend/utils/adt/varchar.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.92 2002/08/29 07:22:27 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.93 2002/09/03 21:45:42 petere Exp $ * *------------------------------------------------------------------------- */ @@ -350,8 +350,8 @@ name_bpchar(PG_FUNCTION_ARGS) * Convert a C string to VARCHAR internal representation. atttypmod * is the declared length of the type plus VARHDRSZ. * - * Note that if MULTIBYTE is enabled, atttypmod is regarded as the - * number of characters, rather than number of bytes. + * Note that atttypmod is regarded as the number of characters, which + * is not necessarily the same as the number of bytes. * * If the C string is too long, * raise an error, unless the extra characters are spaces, in which @@ -450,7 +450,7 @@ varchar(PG_FUNCTION_ARGS) { size_t maxmblen; - /* truncate multi-byte string preserving multi-byte boundary */ + /* truncate multibyte string preserving multibyte boundary */ maxmblen = pg_mbcharcliplen(VARDATA(source), len - VARHDRSZ, maxlen - VARHDRSZ) + VARHDRSZ; diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index 6e00a3e2835..12230a70655 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.90 2002/08/29 07:22:27 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.91 2002/09/03 21:45:42 petere Exp $ * *------------------------------------------------------------------------- */ @@ -412,9 +412,9 @@ textcat(PG_FUNCTION_ARGS) * If the length is less than zero, return the remaining string. * * Note that the arguments operate on octet length, - * so not aware of multi-byte character sets. + * so not aware of multibyte character sets. * - * Added multi-byte support. + * Added multibyte support. * - Tatsuo Ishii 1998-4-21 * Changed behavior if starting position is less than one to conform to SQL92 behavior. * Formerly returned the entire string; now returns a portion. @@ -624,9 +624,6 @@ text_substring(Datum str, int32 start, int32 length, bool length_not_specified) * Implements the SQL92 POSITION() function. * Ref: A Guide To The SQL Standard, Date & Darwen, 1997 * - thomas 1997-07-27 - * - * Added multi-byte support. - * - Tatsuo Ishii 1998-4-21 */ Datum textpos(PG_FUNCTION_ARGS) diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index 8be88ac259f..7de6eb2595d 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.114 2002/09/02 02:47:05 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.115 2002/09/03 21:45:42 petere Exp $ * * *------------------------------------------------------------------------- @@ -69,7 +69,7 @@ static bool ThereIsAtLeastOneUser(void); * creating any serious problems. * * This is also a handy place to fetch the database encoding info out - * of pg_database, if we are in MULTIBYTE mode. + * of pg_database. * * To avoid having to read pg_database more times than necessary * during session startup, this place is also fitting to set up any @@ -124,9 +124,8 @@ ReverifyMyDatabase(const char *name) name); /* - * OK, we're golden. Only other to-do item is to save the MULTIBYTE - * encoding info out of the pg_database tuple --- or complain, if we - * can't support it. + * OK, we're golden. Only other to-do item is to save the + * encoding info out of the pg_database tuple. */ SetDatabaseEncoding(dbform->encoding); /* If we have no other source of client_encoding, use server encoding */ diff --git a/src/backend/utils/mb/README b/src/backend/utils/mb/README index f0d4df95892..8ee732ca048 100644 --- a/src/backend/utils/mb/README +++ b/src/backend/utils/mb/README @@ -2,7 +2,7 @@ common.c: public functions for both the backend and the frontend. requires conv.c and wchar.c conv.c: static functions and a public table for code conversion wchar.c: mostly static functions and a public table for mb string and - multi-byte conversion + multibyte conversion mbutilc.c: public functions for the backend only. requires conv.c and wchar.c wstrcmp.c: strcmp for mb @@ -12,4 +12,4 @@ iso.c: a tool to generate KOI8 <--> ISO8859-5 conversion table win.c: a tool to generate KOI8 <--> CP1251 conversion table big5.c: conversion between BIG5 and Mule Internal Code(CNS 116643-1992 plane 1 and plane 2). -utftest.c: test driver for utf2wchar()
\ No newline at end of file +utftest.c: test driver for utf2wchar() diff --git a/src/backend/utils/mb/encnames.c b/src/backend/utils/mb/encnames.c index a5ff3e357f3..8c000383043 100644 --- a/src/backend/utils/mb/encnames.c +++ b/src/backend/utils/mb/encnames.c @@ -2,7 +2,7 @@ * Encoding names and routines for work with it. All * in this file is shared bedween FE and BE. * - * $Id: encnames.c,v 1.8 2002/06/13 08:28:54 ishii Exp $ + * $Id: encnames.c,v 1.9 2002/09/03 21:45:43 petere Exp $ */ #ifdef FRONTEND #include "postgres_fe.h" @@ -44,7 +44,7 @@ pg_encname pg_encname_tbl[] = }, /* IBM866 */ { "big5", PG_BIG5 - }, /* Big5; Chinese for Taiwan Multi-byte set */ + }, /* Big5; Chinese for Taiwan multibyte set */ { "euccn", PG_EUC_CN }, /* EUC-CN; Extended Unix Code for diff --git a/src/backend/utils/mb/mbutils.c b/src/backend/utils/mb/mbutils.c index ef96f7d04b4..24f3d4486a9 100644 --- a/src/backend/utils/mb/mbutils.c +++ b/src/backend/utils/mb/mbutils.c @@ -3,7 +3,7 @@ * client encoding and server internal encoding. * (currently mule internal code (mic) is used) * Tatsuo Ishii - * $Id: mbutils.c,v 1.33 2002/08/29 07:22:28 ishii Exp $ + * $Id: mbutils.c,v 1.34 2002/09/03 21:45:43 petere Exp $ */ #include "postgres.h" #include "access/xact.h" @@ -347,28 +347,28 @@ perform_default_encoding_conversion(unsigned char *src, int len, bool is_client_ return result; } -/* convert a multi-byte string to a wchar */ +/* convert a multibyte string to a wchar */ int pg_mb2wchar(const unsigned char *from, pg_wchar *to) { return (*pg_wchar_table[DatabaseEncoding->encoding].mb2wchar_with_len) (from, to, strlen(from)); } -/* convert a multi-byte string to a wchar with a limited length */ +/* convert a multibyte string to a wchar with a limited length */ int pg_mb2wchar_with_len(const unsigned char *from, pg_wchar *to, int len) { return (*pg_wchar_table[DatabaseEncoding->encoding].mb2wchar_with_len) (from, to, len); } -/* returns the byte length of a multi-byte word */ +/* returns the byte length of a multibyte word */ int pg_mblen(const unsigned char *mbstr) { return ((*pg_wchar_table[DatabaseEncoding->encoding].mblen) (mbstr)); } -/* returns the length (counted as a wchar) of a multi-byte string */ +/* returns the length (counted as a wchar) of a multibyte string */ int pg_mbstrlen(const unsigned char *mbstr) { @@ -386,7 +386,7 @@ pg_mbstrlen(const unsigned char *mbstr) return (len); } -/* returns the length (counted as a wchar) of a multi-byte string +/* returns the length (counted as a wchar) of a multibyte string (not necessarily NULL terminated) */ int pg_mbstrlen_with_len(const unsigned char *mbstr, int limit) @@ -405,10 +405,10 @@ pg_mbstrlen_with_len(const unsigned char *mbstr, int limit) } /* - * returns the byte length of a multi-byte string + * returns the byte length of a multibyte string * (not necessarily NULL terminated) * that is no longer than limit. - * this function does not break multi-byte word boundary. + * this function does not break multibyte word boundary. */ int pg_mbcliplen(const unsigned char *mbstr, int len, int limit) diff --git a/src/backend/utils/mb/wchar.c b/src/backend/utils/mb/wchar.c index 8d3f4a6dbd2..50d90f30d65 100644 --- a/src/backend/utils/mb/wchar.c +++ b/src/backend/utils/mb/wchar.c @@ -1,7 +1,7 @@ /* - * conversion functions between pg_wchar and multi-byte streams. + * conversion functions between pg_wchar and multibyte streams. * Tatsuo Ishii - * $Id: wchar.c,v 1.28 2002/06/13 08:28:54 ishii Exp $ + * $Id: wchar.c,v 1.29 2002/09/03 21:45:43 petere Exp $ * * WIN1250 client encoding updated by Pavel Behal * @@ -580,7 +580,7 @@ pg_mic_mblen(const unsigned char *mbstr) } /* - * Returns the byte length of a multi-byte word. + * Returns the byte length of a multibyte word. */ int pg_encoding_mblen(int encoding, const unsigned char *mbstr) @@ -638,7 +638,7 @@ pg_verifymbstr(const unsigned char *mbstr, int len) l = pg_mblen(mbstr); - /* multi-byte letter? */ + /* multibyte letter? */ if (l > 1) { for (i = 1; i < l; i++) @@ -646,7 +646,7 @@ pg_verifymbstr(const unsigned char *mbstr, int len) if (i > len || *(mbstr + i) == '\0' || /* - * we assume that every muti-byte letter consists of bytes + * we assume that every multibyte letter consists of bytes * being the 8th bit set */ ((*(mbstr + i) & 0x80) == 0)) |