PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
category_test.c File Reference
#include "postgres_fe.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wctype.h>
#include "common/unicode_category.h"
#include "common/unicode_version.h"
Include dependency graph for category_test.c:

Go to the source code of this file.

Functions

static int parse_unicode_version (const char *version)
 
int main (int argc, char **argv)
 

Variables

static int pg_unicode_version = 0
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 223 of file category_test.c.

224{
226 printf("category_test: Postgres Unicode version:\t%s\n", PG_UNICODE_VERSION);
227
228#ifdef USE_ICU
229 icu_unicode_version = parse_unicode_version(U_UNICODE_VERSION);
230 printf("category_test: ICU Unicode version:\t\t%s\n", U_UNICODE_VERSION);
231
232 icu_test();
233#else
234 printf("category_test: ICU not available; skipping\n");
235#endif
236}
static int pg_unicode_version
Definition: category_test.c:26
static int parse_unicode_version(const char *version)
Definition: category_test.c:35
#define printf(...)
Definition: port.h:244
#define PG_UNICODE_VERSION
Datum icu_unicode_version(PG_FUNCTION_ARGS)
Definition: varlena.c:6315

References icu_unicode_version(), parse_unicode_version(), pg_unicode_version, PG_UNICODE_VERSION, and printf.

◆ parse_unicode_version()

static int parse_unicode_version ( const char *  version)
static

Definition at line 35 of file category_test.c.

36{
38 int major;
39 int minor;
40
41 n = sscanf(version, "%d.%d", &major, &minor);
42
43 Assert(n == 2);
44 Assert(minor < 100);
45
46 return major * 100 + minor;
47}
#define PG_USED_FOR_ASSERTS_ONLY
Definition: c.h:201
#define Assert(condition)
Definition: c.h:812

References Assert, and PG_USED_FOR_ASSERTS_ONLY.

Referenced by main().

Variable Documentation

◆ pg_unicode_version

int pg_unicode_version = 0
static

Definition at line 26 of file category_test.c.

Referenced by main().