PostgreSQL Source Code  git master
latin_and_mic.c File Reference
#include "postgres.h"
#include "fmgr.h"
#include "mb/pg_wchar.h"
Include dependency graph for latin_and_mic.c:

Go to the source code of this file.

Functions

 PG_FUNCTION_INFO_V1 (latin1_to_mic)
 
 PG_FUNCTION_INFO_V1 (mic_to_latin1)
 
 PG_FUNCTION_INFO_V1 (latin3_to_mic)
 
 PG_FUNCTION_INFO_V1 (mic_to_latin3)
 
 PG_FUNCTION_INFO_V1 (latin4_to_mic)
 
 PG_FUNCTION_INFO_V1 (mic_to_latin4)
 
Datum latin1_to_mic (PG_FUNCTION_ARGS)
 
Datum mic_to_latin1 (PG_FUNCTION_ARGS)
 
Datum latin3_to_mic (PG_FUNCTION_ARGS)
 
Datum mic_to_latin3 (PG_FUNCTION_ARGS)
 
Datum latin4_to_mic (PG_FUNCTION_ARGS)
 
Datum mic_to_latin4 (PG_FUNCTION_ARGS)
 

Variables

 PG_MODULE_MAGIC
 

Function Documentation

◆ latin1_to_mic()

Datum latin1_to_mic ( PG_FUNCTION_ARGS  )

Definition at line 40 of file latin_and_mic.c.

References CHECK_ENCODING_CONVERSION_ARGS, generate_unaccent_rules::dest, latin2mic(), LC_ISO8859_1, PG_GETARG_CSTRING, PG_GETARG_INT32, PG_LATIN1, PG_MULE_INTERNAL, and PG_RETURN_VOID.

41 {
42  unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2);
43  unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3);
44  int len = PG_GETARG_INT32(4);
45 
47 
48  latin2mic(src, dest, len, LC_ISO8859_1, PG_LATIN1);
49 
51 }
#define PG_GETARG_INT32(n)
Definition: fmgr.h:234
#define LC_ISO8859_1
Definition: pg_wchar.h:102
void latin2mic(const unsigned char *l, unsigned char *p, int len, int lc, int encoding)
Definition: conv.c:71
#define PG_RETURN_VOID()
Definition: fmgr.h:309
#define CHECK_ENCODING_CONVERSION_ARGS(srcencoding, destencoding)
Definition: pg_wchar.h:503
#define PG_GETARG_CSTRING(n)
Definition: fmgr.h:242

◆ latin3_to_mic()

Datum latin3_to_mic ( PG_FUNCTION_ARGS  )

Definition at line 68 of file latin_and_mic.c.

References CHECK_ENCODING_CONVERSION_ARGS, generate_unaccent_rules::dest, latin2mic(), LC_ISO8859_3, PG_GETARG_CSTRING, PG_GETARG_INT32, PG_LATIN3, PG_MULE_INTERNAL, and PG_RETURN_VOID.

69 {
70  unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2);
71  unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3);
72  int len = PG_GETARG_INT32(4);
73 
75 
76  latin2mic(src, dest, len, LC_ISO8859_3, PG_LATIN3);
77 
79 }
#define PG_GETARG_INT32(n)
Definition: fmgr.h:234
#define LC_ISO8859_3
Definition: pg_wchar.h:104
void latin2mic(const unsigned char *l, unsigned char *p, int len, int lc, int encoding)
Definition: conv.c:71
#define PG_RETURN_VOID()
Definition: fmgr.h:309
#define CHECK_ENCODING_CONVERSION_ARGS(srcencoding, destencoding)
Definition: pg_wchar.h:503
#define PG_GETARG_CSTRING(n)
Definition: fmgr.h:242

◆ latin4_to_mic()

Datum latin4_to_mic ( PG_FUNCTION_ARGS  )

Definition at line 96 of file latin_and_mic.c.

References CHECK_ENCODING_CONVERSION_ARGS, generate_unaccent_rules::dest, latin2mic(), LC_ISO8859_4, PG_GETARG_CSTRING, PG_GETARG_INT32, PG_LATIN4, PG_MULE_INTERNAL, and PG_RETURN_VOID.

97 {
98  unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2);
99  unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3);
100  int len = PG_GETARG_INT32(4);
101 
103 
104  latin2mic(src, dest, len, LC_ISO8859_4, PG_LATIN4);
105 
106  PG_RETURN_VOID();
107 }
#define PG_GETARG_INT32(n)
Definition: fmgr.h:234
#define LC_ISO8859_4
Definition: pg_wchar.h:105
void latin2mic(const unsigned char *l, unsigned char *p, int len, int lc, int encoding)
Definition: conv.c:71
#define PG_RETURN_VOID()
Definition: fmgr.h:309
#define CHECK_ENCODING_CONVERSION_ARGS(srcencoding, destencoding)
Definition: pg_wchar.h:503
#define PG_GETARG_CSTRING(n)
Definition: fmgr.h:242

◆ mic_to_latin1()

Datum mic_to_latin1 ( PG_FUNCTION_ARGS  )

Definition at line 54 of file latin_and_mic.c.

References CHECK_ENCODING_CONVERSION_ARGS, generate_unaccent_rules::dest, LC_ISO8859_1, mic2latin(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_LATIN1, PG_MULE_INTERNAL, and PG_RETURN_VOID.

55 {
56  unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2);
57  unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3);
58  int len = PG_GETARG_INT32(4);
59 
61 
62  mic2latin(src, dest, len, LC_ISO8859_1, PG_LATIN1);
63 
65 }
#define PG_GETARG_INT32(n)
Definition: fmgr.h:234
#define LC_ISO8859_1
Definition: pg_wchar.h:102
void mic2latin(const unsigned char *mic, unsigned char *p, int len, int lc, int encoding)
Definition: conv.c:99
#define PG_RETURN_VOID()
Definition: fmgr.h:309
#define CHECK_ENCODING_CONVERSION_ARGS(srcencoding, destencoding)
Definition: pg_wchar.h:503
#define PG_GETARG_CSTRING(n)
Definition: fmgr.h:242

◆ mic_to_latin3()

Datum mic_to_latin3 ( PG_FUNCTION_ARGS  )

Definition at line 82 of file latin_and_mic.c.

References CHECK_ENCODING_CONVERSION_ARGS, generate_unaccent_rules::dest, LC_ISO8859_3, mic2latin(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_LATIN3, PG_MULE_INTERNAL, and PG_RETURN_VOID.

83 {
84  unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2);
85  unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3);
86  int len = PG_GETARG_INT32(4);
87 
89 
90  mic2latin(src, dest, len, LC_ISO8859_3, PG_LATIN3);
91 
93 }
#define PG_GETARG_INT32(n)
Definition: fmgr.h:234
#define LC_ISO8859_3
Definition: pg_wchar.h:104
void mic2latin(const unsigned char *mic, unsigned char *p, int len, int lc, int encoding)
Definition: conv.c:99
#define PG_RETURN_VOID()
Definition: fmgr.h:309
#define CHECK_ENCODING_CONVERSION_ARGS(srcencoding, destencoding)
Definition: pg_wchar.h:503
#define PG_GETARG_CSTRING(n)
Definition: fmgr.h:242

◆ mic_to_latin4()

Datum mic_to_latin4 ( PG_FUNCTION_ARGS  )

Definition at line 110 of file latin_and_mic.c.

References CHECK_ENCODING_CONVERSION_ARGS, generate_unaccent_rules::dest, LC_ISO8859_4, mic2latin(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_LATIN4, PG_MULE_INTERNAL, and PG_RETURN_VOID.

111 {
112  unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2);
113  unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3);
114  int len = PG_GETARG_INT32(4);
115 
117 
118  mic2latin(src, dest, len, LC_ISO8859_4, PG_LATIN4);
119 
120  PG_RETURN_VOID();
121 }
#define PG_GETARG_INT32(n)
Definition: fmgr.h:234
#define LC_ISO8859_4
Definition: pg_wchar.h:105
void mic2latin(const unsigned char *mic, unsigned char *p, int len, int lc, int encoding)
Definition: conv.c:99
#define PG_RETURN_VOID()
Definition: fmgr.h:309
#define CHECK_ENCODING_CONVERSION_ARGS(srcencoding, destencoding)
Definition: pg_wchar.h:503
#define PG_GETARG_CSTRING(n)
Definition: fmgr.h:242

◆ PG_FUNCTION_INFO_V1() [1/6]

PG_FUNCTION_INFO_V1 ( latin1_to_mic  )

◆ PG_FUNCTION_INFO_V1() [2/6]

PG_FUNCTION_INFO_V1 ( mic_to_latin1  )

◆ PG_FUNCTION_INFO_V1() [3/6]

PG_FUNCTION_INFO_V1 ( latin3_to_mic  )

◆ PG_FUNCTION_INFO_V1() [4/6]

PG_FUNCTION_INFO_V1 ( mic_to_latin3  )

◆ PG_FUNCTION_INFO_V1() [5/6]

PG_FUNCTION_INFO_V1 ( latin4_to_mic  )

◆ PG_FUNCTION_INFO_V1() [6/6]

PG_FUNCTION_INFO_V1 ( mic_to_latin4  )

Variable Documentation

◆ PG_MODULE_MAGIC

PG_MODULE_MAGIC

Definition at line 18 of file latin_and_mic.c.