Header And Logo

PostgreSQL
| The world's most advanced open source database.

Functions | Variables

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)
static void latin12mic (const unsigned char *l, unsigned char *p, int len)
static void mic2latin1 (const unsigned char *mic, unsigned char *p, int len)
static void latin32mic (const unsigned char *l, unsigned char *p, int len)
static void mic2latin3 (const unsigned char *mic, unsigned char *p, int len)
static void latin42mic (const unsigned char *l, unsigned char *p, int len)
static void mic2latin4 (const unsigned char *mic, unsigned char *p, int len)

Variables

 PG_MODULE_MAGIC

Function Documentation

static void latin12mic ( const unsigned char *  l,
unsigned char *  p,
int  len 
) [static]

Definition at line 137 of file latin_and_mic.c.

References latin2mic(), LC_ISO8859_1, and PG_LATIN1.

Referenced by latin1_to_mic().

{
    latin2mic(l, p, len, LC_ISO8859_1, PG_LATIN1);
}

Datum latin1_to_mic ( PG_FUNCTION_ARGS   ) 

Definition at line 53 of file latin_and_mic.c.

References CHECK_ENCODING_CONVERSION_ARGS, latin12mic(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_LATIN1, PG_MULE_INTERNAL, and PG_RETURN_VOID.

{
    unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2);
    unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3);
    int         len = PG_GETARG_INT32(4);

    CHECK_ENCODING_CONVERSION_ARGS(PG_LATIN1, PG_MULE_INTERNAL);

    latin12mic(src, dest, len);

    PG_RETURN_VOID();
}

static void latin32mic ( const unsigned char *  l,
unsigned char *  p,
int  len 
) [static]

Definition at line 149 of file latin_and_mic.c.

References latin2mic(), LC_ISO8859_3, and PG_LATIN3.

Referenced by latin3_to_mic().

{
    latin2mic(l, p, len, LC_ISO8859_3, PG_LATIN3);
}

Datum latin3_to_mic ( PG_FUNCTION_ARGS   ) 

Definition at line 81 of file latin_and_mic.c.

References CHECK_ENCODING_CONVERSION_ARGS, latin32mic(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_LATIN3, PG_MULE_INTERNAL, and PG_RETURN_VOID.

{
    unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2);
    unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3);
    int         len = PG_GETARG_INT32(4);

    CHECK_ENCODING_CONVERSION_ARGS(PG_LATIN3, PG_MULE_INTERNAL);

    latin32mic(src, dest, len);

    PG_RETURN_VOID();
}

static void latin42mic ( const unsigned char *  l,
unsigned char *  p,
int  len 
) [static]

Definition at line 161 of file latin_and_mic.c.

References latin2mic(), LC_ISO8859_4, and PG_LATIN4.

Referenced by latin4_to_mic().

{
    latin2mic(l, p, len, LC_ISO8859_4, PG_LATIN4);
}

Datum latin4_to_mic ( PG_FUNCTION_ARGS   ) 

Definition at line 109 of file latin_and_mic.c.

References CHECK_ENCODING_CONVERSION_ARGS, latin42mic(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_LATIN4, PG_MULE_INTERNAL, and PG_RETURN_VOID.

{
    unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2);
    unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3);
    int         len = PG_GETARG_INT32(4);

    CHECK_ENCODING_CONVERSION_ARGS(PG_LATIN4, PG_MULE_INTERNAL);

    latin42mic(src, dest, len);

    PG_RETURN_VOID();
}

static void mic2latin1 ( const unsigned char *  mic,
unsigned char *  p,
int  len 
) [static]

Definition at line 143 of file latin_and_mic.c.

References LC_ISO8859_1, mic2latin(), and PG_LATIN1.

Referenced by mic_to_latin1().

{
    mic2latin(mic, p, len, LC_ISO8859_1, PG_LATIN1);
}

static void mic2latin3 ( const unsigned char *  mic,
unsigned char *  p,
int  len 
) [static]

Definition at line 155 of file latin_and_mic.c.

References LC_ISO8859_3, mic2latin(), and PG_LATIN3.

Referenced by mic_to_latin3().

{
    mic2latin(mic, p, len, LC_ISO8859_3, PG_LATIN3);
}

static void mic2latin4 ( const unsigned char *  mic,
unsigned char *  p,
int  len 
) [static]

Definition at line 167 of file latin_and_mic.c.

References LC_ISO8859_4, mic2latin(), and PG_LATIN4.

Referenced by mic_to_latin4().

{
    mic2latin(mic, p, len, LC_ISO8859_4, PG_LATIN4);
}

Datum mic_to_latin1 ( PG_FUNCTION_ARGS   ) 

Definition at line 67 of file latin_and_mic.c.

References CHECK_ENCODING_CONVERSION_ARGS, mic2latin1(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_LATIN1, PG_MULE_INTERNAL, and PG_RETURN_VOID.

{
    unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2);
    unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3);
    int         len = PG_GETARG_INT32(4);

    CHECK_ENCODING_CONVERSION_ARGS(PG_MULE_INTERNAL, PG_LATIN1);

    mic2latin1(src, dest, len);

    PG_RETURN_VOID();
}

Datum mic_to_latin3 ( PG_FUNCTION_ARGS   ) 

Definition at line 95 of file latin_and_mic.c.

References CHECK_ENCODING_CONVERSION_ARGS, mic2latin3(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_LATIN3, PG_MULE_INTERNAL, and PG_RETURN_VOID.

{
    unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2);
    unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3);
    int         len = PG_GETARG_INT32(4);

    CHECK_ENCODING_CONVERSION_ARGS(PG_MULE_INTERNAL, PG_LATIN3);

    mic2latin3(src, dest, len);

    PG_RETURN_VOID();
}

Datum mic_to_latin4 ( PG_FUNCTION_ARGS   ) 

Definition at line 123 of file latin_and_mic.c.

References CHECK_ENCODING_CONVERSION_ARGS, mic2latin4(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_LATIN4, PG_MULE_INTERNAL, and PG_RETURN_VOID.

{
    unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2);
    unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3);
    int         len = PG_GETARG_INT32(4);

    CHECK_ENCODING_CONVERSION_ARGS(PG_MULE_INTERNAL, PG_LATIN4);

    mic2latin4(src, dest, len);

    PG_RETURN_VOID();
}

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

Variable Documentation

Definition at line 18 of file latin_and_mic.c.