/*
 * Copyright (C) Birb Developers
 *
 * Birb is the legal property of its developers, whose names are too numerous
 * to list here. Please refer to the AUTHORS file distributed with this source
 * distribution
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by the
 * Free Software Foundation; either version 2.1 of the License, or (at your
 * option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library; if not, see <https://www.gnu.org/licenses/>.
 */

#if !defined(BIRB_GLOBAL_HEADER_INSIDE) && !defined(BIRB_COMPILATION)
# error "only <birb.h> may be included directly"
#endif

#ifndef BIRB_UTF8_H
#define BIRB_UTF8_H

#include <glib.h>

#include "birbversion.h"

G_BEGIN_DECLS

/**
 * birb_utf8_equal:
 * @str1: (nullable): the first string
 * @str2: (nullable): the second string
 *
 * Checks if strings are equal.
 *
 * This is a simple wrapper around [func@utf8_compare].
 *
 * Returns: true if the strings are equal.
 *
 * Since: 0.9
 */
BIRB_AVAILABLE_IN_0_9
gboolean birb_utf8_equal(const char *str1, const char *str2);

/**
 * birb_utf8_compare:
 * @str1: (nullable): the first string
 * @str2: (nullable): the second string
 *
 * Compares two UTF8 strings for sorting.
 *
 * The strings will be normalized with NFKC using [func@GLib.utf8_normalize],
 * then have their cases folded with [func@GLib.utf8_casefold], and finally
 * compared with [func@GLib.utf8_collate].
 *
 * The strings need not be valid UTF8. If one is UTF8 and the other is not,
 * then the UTF8 string will be given precedence. If comparing %null and an
 * invalid UTF8 string, the invalid UTF8 string will be given precedence. If
 * neither are valid UTF8 they will be considered equal regardless of contents.
 *
 * Returns: -1, 0, 1 if @str1 is less than, equal to, or greater than @str2.
 *
 * Since: 0.9
 */
BIRB_AVAILABLE_IN_0_9
int birb_utf8_compare(const char *str1, const char *str2);

G_END_DECLS

#endif /* BIRB_UTF8_H */
