PostgreSQL Source Code  git master
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 231 of file category_test.c.

232 {
234  printf("category_test: Postgres Unicode version:\t%s\n", PG_UNICODE_VERSION);
235 
236 #ifdef USE_ICU
237  icu_unicode_version = parse_unicode_version(U_UNICODE_VERSION);
238  printf("category_test: ICU Unicode version:\t\t%s\n", U_UNICODE_VERSION);
239 
240  icu_test();
241 #else
242  printf("category_test: ICU not available; skipping\n");
243 #endif
244 }
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:6277

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:185
#define Assert(condition)
Definition: c.h:861

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().