Systemd/src/basic/gunicode.h
Zbigniew Jędrzejewski-Szmek 448e7440c2 headers: add spdx tags to imported files with a known license
I added the header in the cases where the license text is present and it is
easy to find the appropriate SPDX header.

For "public domain" stuff: SDPX treats each "public domain" license as unique [1],
but luckily the one in siphash24.c is one of the identified variants. There are
some other cases which specify "public domain" but there doesn't seem to be a
SPDX identifier.

[1] https://wiki.spdx.org/view/Legal_Team/Decisions/Dealing_with_Public_Domain_within_SPDX_Files

gunicode.[ch] are imported from glib, which is licensed as LGPL2.1+,
see https://gitlab.gnome.org/GNOME/glib/-/blob/master/glib/gunicode.h.
2020-10-29 11:32:24 +01:00

31 lines
923 B
C

/* SPDX-License-Identifier: LGPL-2.1+ */
/* gunicode.h - Unicode manipulation functions
*
* Copyright (C) 1999, 2000 Tom Tromey
* Copyright © 2000, 2005 Red Hat, Inc.
*/
#pragma once
#include <stdbool.h>
#include <stdint.h>
#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);