PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ts_locale.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * ts_locale.h
4 * locale compatibility layer for tsearch
5 *
6 * Copyright (c) 1998-2024, PostgreSQL Global Development Group
7 *
8 * src/include/tsearch/ts_locale.h
9 *
10 *-------------------------------------------------------------------------
11 */
12#ifndef __TSLOCALE_H__
13#define __TSLOCALE_H__
14
15#include <ctype.h>
16#include <limits.h>
17#include <wctype.h>
18
19#include "lib/stringinfo.h"
20#include "mb/pg_wchar.h"
21#include "utils/pg_locale.h"
22
23/* working state for tsearch_readline (should be a local var in caller) */
24typedef struct
25{
26 FILE *fp;
27 const char *filename;
28 int lineno;
29 StringInfoData buf; /* current input line, in UTF-8 */
30 char *curline; /* current input line, in DB's encoding */
31 /* curline may be NULL, or equal to buf.data, or a palloc'd string */
34
35#define TOUCHAR(x) (*((const unsigned char *) (x)))
36
37/* The second argument of t_iseq() must be a plain ASCII character */
38#define t_iseq(x,c) (TOUCHAR(x) == (unsigned char) (c))
39
40#define COPYCHAR(d,s) memcpy(d, s, pg_mblen(s))
41
42extern int t_isalpha(const char *ptr);
43extern int t_isalnum(const char *ptr);
44
46 const char *filename);
49
50#endif /* __TSLOCALE_H__ */
static char * filename
Definition: pg_dumpall.c:119
StringInfoData buf
Definition: ts_locale.h:29
ErrorContextCallback cb
Definition: ts_locale.h:32
const char * filename
Definition: ts_locale.h:27
bool tsearch_readline_begin(tsearch_readline_state *stp, const char *filename)
Definition: ts_locale.c:89
int t_isalnum(const char *ptr)
Definition: ts_locale.c:50
char * tsearch_readline(tsearch_readline_state *stp)
Definition: ts_locale.c:112
int t_isalpha(const char *ptr)
Definition: ts_locale.c:35
void tsearch_readline_end(tsearch_readline_state *stp)
Definition: ts_locale.c:157