2016-02-16 20:05:15 +01:00
|
|
|
#pragma once
|
|
|
|
|
2013-09-21 03:37:33 +02:00
|
|
|
/* gunicode.h - Unicode manipulation functions
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999, 2000 Tom Tromey
|
2018-06-12 19:00:24 +02:00
|
|
|
* Copyright © 2000, 2005 Red Hat, Inc.
|
2013-09-21 03:37:33 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2015-11-18 22:46:33 +01:00
|
|
|
#include <stdint.h>
|
2013-09-21 03:37:33 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
char *utf8_prev_char (const char *p);
|
|
|
|
|
|
|
|
extern const char utf8_skip_data[256];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* g_utf8_next_char:
|
|
|
|
* @p: Pointer to the start of a valid UTF-8 character
|
|
|
|
*
|
|
|
|
* Skips to the next character in a UTF-8 string. The string must be
|
|
|
|
* valid; this macro is as fast as possible, and has no error-checking.
|
|
|
|
* You would use this macro to iterate over a string character by
|
|
|
|
* character. The macro returns the start of the next UTF-8 character.
|
|
|
|
* Before using this macro, use g_utf8_validate() to validate strings
|
|
|
|
* that may contain invalid UTF-8.
|
|
|
|
*/
|
|
|
|
#define utf8_next_char(p) (char *)((p) + utf8_skip_data[*(const unsigned char *)(p)])
|
|
|
|
|
|
|
|
bool unichar_iswide (uint32_t c);
|