Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
dc69c036
Commit
dc69c036
authored
Jun 17, 2008
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move USE_WIDE_UPPER_LOWER define to c.h, and remove TS_USE_WIDE and use
USE_WIDE_UPPER_LOWER instead.
parent
2e835a49
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
32 deletions
+31
-32
src/backend/tsearch/regis.c
src/backend/tsearch/regis.c
+2
-2
src/backend/tsearch/ts_locale.c
src/backend/tsearch/ts_locale.c
+5
-5
src/backend/tsearch/wparser_def.c
src/backend/tsearch/wparser_def.c
+7
-7
src/backend/utils/adt/formatting.c
src/backend/utils/adt/formatting.c
+2
-3
src/backend/utils/adt/oracle_compat.c
src/backend/utils/adt/oracle_compat.c
+2
-6
src/include/c.h
src/include/c.h
+9
-1
src/include/tsearch/ts_locale.h
src/include/tsearch/ts_locale.h
+4
-8
No files found.
src/backend/tsearch/regis.c
View file @
dc69c036
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tsearch/regis.c,v 1.
4 2008/01/21 02:46:10 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/tsearch/regis.c,v 1.
5 2008/06/17 16:09:06 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -178,7 +178,7 @@ RS_free(Regis *r)
r
->
node
=
NULL
;
}
#ifdef
TS_USE_WIDE
#ifdef
USE_WIDE_UPPER_LOWER
static
bool
mb_strchr
(
char
*
str
,
char
*
c
)
{
...
...
src/backend/tsearch/ts_locale.c
View file @
dc69c036
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tsearch/ts_locale.c,v 1.
7 2008/01/01 19:45:52
momjian Exp $
* $PostgreSQL: pgsql/src/backend/tsearch/ts_locale.c,v 1.
8 2008/06/17 16:09:06
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -17,7 +17,7 @@
#include "tsearch/ts_public.h"
#ifdef
TS_USE_WIDE
#ifdef
USE_WIDE_UPPER_LOWER
/*
* wchar2char --- convert wide characters to multibyte format
...
...
@@ -190,7 +190,7 @@ t_isprint(const char *ptr)
return
iswprint
((
wint_t
)
character
[
0
]);
}
#endif
/*
TS_USE_WIDE
*/
#endif
/*
USE_WIDE_UPPER_LOWER
*/
/*
...
...
@@ -260,7 +260,7 @@ lowerstr_with_len(const char *str, int len)
if
(
len
==
0
)
return
pstrdup
(
""
);
#ifdef
TS_USE_WIDE
#ifdef
USE_WIDE_UPPER_LOWER
/*
* Use wide char code only when max encoding length > 1 and ctype != C.
...
...
@@ -307,7 +307,7 @@ lowerstr_with_len(const char *str, int len)
Assert
(
wlen
<
len
);
}
else
#endif
/*
TS_USE_WIDE
*/
#endif
/*
USE_WIDE_UPPER_LOWER
*/
{
const
char
*
ptr
=
str
;
char
*
outptr
;
...
...
src/backend/tsearch/wparser_def.c
View file @
dc69c036
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.1
4 2008/01/01 19:45:52
momjian Exp $
* $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.1
5 2008/06/17 16:09:06
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -238,7 +238,7 @@ typedef struct TParser
/* string and position information */
char
*
str
;
/* multibyte string */
int
lenstr
;
/* length of mbstring */
#ifdef
TS_USE_WIDE
#ifdef
USE_WIDE_UPPER_LOWER
wchar_t
*
wstr
;
/* wide character string */
int
lenwstr
;
/* length of wsting */
#endif
...
...
@@ -291,7 +291,7 @@ TParserInit(char *str, int len)
prs
->
str
=
str
;
prs
->
lenstr
=
len
;
#ifdef
TS_USE_WIDE
#ifdef
USE_WIDE_UPPER_LOWER
/*
* Use wide char code only when max encoding length > 1.
...
...
@@ -328,7 +328,7 @@ TParserClose(TParser *prs)
prs
->
state
=
ptr
;
}
#ifdef
TS_USE_WIDE
#ifdef
USE_WIDE_UPPER_LOWER
if
(
prs
->
wstr
)
pfree
(
prs
->
wstr
);
#endif
...
...
@@ -344,7 +344,7 @@ TParserClose(TParser *prs)
* often are used for Asian languages
*/
#ifdef
TS_USE_WIDE
#ifdef
USE_WIDE_UPPER_LOWER
#define p_iswhat(type) \
static int \
...
...
@@ -439,7 +439,7 @@ p_iseq(TParser *prs, char c)
Assert
(
prs
->
state
);
return
((
prs
->
state
->
charlen
==
1
&&
*
(
prs
->
str
+
prs
->
state
->
posbyte
)
==
c
))
?
1
:
0
;
}
#else
/*
TS_USE_WIDE
*/
#else
/*
USE_WIDE_UPPER_LOWER
*/
#define p_iswhat(type) \
static int \
...
...
@@ -463,7 +463,7 @@ p_iseq(TParser *prs, char c)
p_iswhat
(
alnum
)
p_iswhat
(
alpha
)
#endif
/*
TS_USE_WIDE
*/
#endif
/*
USE_WIDE_UPPER_LOWER
*/
p_iswhat
(
digit
)
p_iswhat
(
lower
)
...
...
src/backend/utils/adt/formatting.c
View file @
dc69c036
/* -----------------------------------------------------------------------
* formatting.c
*
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.14
1 2008/05/20 01:41:02
momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.14
2 2008/06/17 16:09:06
momjian Exp $
*
*
* Portions Copyright (c) 1999-2008, PostgreSQL Global Development Group
...
...
@@ -948,8 +948,7 @@ static NUMCacheEntry *NUM_cache_search(char *str);
static
NUMCacheEntry
*
NUM_cache_getnew
(
char
*
str
);
static
void
NUM_cache_remove
(
NUMCacheEntry
*
ent
);
#if defined(HAVE_WCSTOMBS) && defined(HAVE_TOWLOWER)
#define USE_WIDE_UPPER_LOWER
#ifdef USE_WIDE_UPPER_LOWER
/* externs are in oracle_compat.c */
extern
char
*
wstring_upper
(
char
*
str
);
extern
char
*
wstring_lower
(
char
*
str
);
...
...
src/backend/utils/adt/oracle_compat.c
View file @
dc69c036
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/oracle_compat.c,v 1.
79 2008/05/19 18:08:16 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/oracle_compat.c,v 1.
80 2008/06/17 16:09:06 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -40,12 +40,8 @@
* functions, which of course will not work as desired in multibyte character
* sets. Note that in either case we are effectively assuming that the
* database character encoding matches the encoding implied by LC_CTYPE.
*
* We assume if we have these two functions, we have their friends too, and
* can use the wide-character method.
*/
#if defined(HAVE_WCSTOMBS) && defined(HAVE_TOWLOWER)
#define USE_WIDE_UPPER_LOWER
#ifdef USE_WIDE_UPPER_LOWER
char
*
wstring_lower
(
char
*
str
);
char
*
wstring_upper
(
char
*
str
);
wchar_t
*
texttowcs
(
const
text
*
txt
);
...
...
src/include/c.h
View file @
dc69c036
...
...
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/c.h,v 1.22
6 2008/04/21 00:26:46 tgl
Exp $
* $PostgreSQL: pgsql/src/include/c.h,v 1.22
7 2008/06/17 16:09:06 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -813,6 +813,14 @@ extern int fdatasync(int fildes);
#define HAVE_STRTOULL 1
#endif
/*
* We assume if we have these two functions, we have their friends too, and
* can use the wide-character functions.
*/
#if defined(HAVE_WCSTOMBS) && defined(HAVE_TOWLOWER)
#define USE_WIDE_UPPER_LOWER
#endif
/* EXEC_BACKEND defines */
#ifdef EXEC_BACKEND
#define NON_EXEC_STATIC
...
...
src/include/tsearch/ts_locale.h
View file @
dc69c036
...
...
@@ -5,7 +5,7 @@
*
* Copyright (c) 1998-2008, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/include/tsearch/ts_locale.h,v 1.
5 2008/01/01 19:45:59
momjian Exp $
* $PostgreSQL: pgsql/src/include/tsearch/ts_locale.h,v 1.
6 2008/06/17 16:09:06
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -29,13 +29,9 @@
#include <wctype.h>
#endif
#if defined(HAVE_WCSTOMBS) && defined(HAVE_TOWLOWER)
#define TS_USE_WIDE
#endif
#define TOUCHAR(x) (*((const unsigned char *) (x)))
#ifdef
TS_USE_WIDE
#ifdef
USE_WIDE_UPPER_LOWER
extern
size_t
wchar2char
(
char
*
to
,
const
wchar_t
*
from
,
size_t
tolen
);
extern
size_t
char2wchar
(
wchar_t
*
to
,
size_t
tolen
,
const
char
*
from
,
size_t
fromlen
);
...
...
@@ -49,7 +45,7 @@ extern int t_isprint(const char *ptr);
#define t_iseq(x,c) (TOUCHAR(x) == (unsigned char) (c))
#define COPYCHAR(d,s) memcpy(d, s, pg_mblen(s))
#else
/* not
TS_USE_WIDE
*/
#else
/* not
USE_WIDE_UPPER_LOWER
*/
#define t_isdigit(x) isdigit(TOUCHAR(x))
#define t_isspace(x) isspace(TOUCHAR(x))
...
...
@@ -58,7 +54,7 @@ extern int t_isprint(const char *ptr);
#define t_iseq(x,c) (TOUCHAR(x) == (unsigned char) (c))
#define COPYCHAR(d,s) (*((unsigned char *) (d)) = TOUCHAR(s))
#endif
/*
TS_USE_WIDE
*/
#endif
/*
USE_WIDE_UPPER_LOWER
*/
extern
char
*
lowerstr
(
const
char
*
str
);
extern
char
*
lowerstr_with_len
(
const
char
*
str
,
int
len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment