summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2002-09-05 20:51:39 +0000
committerTom Lane2002-09-05 20:51:39 +0000
commit5d1c8a3b07253a42bf103dd717c9a3787a6b30a7 (patch)
tree96f2875760219560cca24247da07f013a14baddf
parentb73d8d22f7501ad517e7d8760ddfd32bd9f91be7 (diff)
Fix compile errors.
-rw-r--r--contrib/tsearch/morph.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/contrib/tsearch/morph.c b/contrib/tsearch/morph.c
index 477c3bf0699..4394448737d 100644
--- a/contrib/tsearch/morph.c
+++ b/contrib/tsearch/morph.c
@@ -6,11 +6,9 @@
*/
#include "postgres.h"
-#include "utils/elog.h"
-#include "utils/palloc.h"
+#include <locale.h>
+
#include "utils/builtins.h"
-#include "catalog/pg_control.h"
-#include "utils/pg_locale.h"
#include "morph.h"
#include "deflex.h"
@@ -25,7 +23,7 @@
*/
typedef struct
{
- char localename[LOCALE_NAME_BUFLEN];
+ char localename[NAMEDATALEN];
/* init dictionary */
void *(*init) (void);
/* close dictionary */
@@ -52,9 +50,8 @@ DICT dicts[] = {
#undef DICT_TABLE
-/* array for storing dictinary's objects (if needed) */
-void *dictobjs[
- lengthof(dicts)];
+/* array for storing dictionary's objects (if needed) */
+void *dictobjs[lengthof(dicts)];
#define STOPLEXEM -2
#define BYLOCALE -1
@@ -104,8 +101,7 @@ initmorph(void)
k;
MAPDICT *md;
bool needinit[lengthof(dicts)];
- PG_LocaleCategories lc;
-
+ const char *curlocale;
int bylocaledict = NODICT;
if (inited)
@@ -113,15 +109,16 @@ initmorph(void)
for (i = 1; i < lengthof(dicts); i++)
needinit[i] = false;
- PGLC_current(&lc);
- if (lc.lc_ctype)
+ curlocale = setlocale(LC_CTYPE, NULL);
+ if (curlocale)
+ {
for (i = 1; i < lengthof(dicts); i++)
- if (strcmp(dicts[i].localename, lc.lc_ctype) == 0)
+ if (strcmp(dicts[i].localename, curlocale) == 0)
{
bylocaledict = i;
break;
}
- PGLC_free_categories(&lc);
+ }
for (i = 1; i < lengthof(mapdict); i++)
{