summaryrefslogtreecommitdiff
path: root/external/mit/libcbor/dist/src/cbor/internal/unicode.h
blob: fc3a50512234ad9d345a1e700cc8c74630344200 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * Copyright (c) 2014-2019 Pavel Kalvoda <me@pavelkalvoda.com>
 *
 * libcbor is free software; you can redistribute it and/or modify
 * it under the terms of the MIT license. See LICENSE for details.
 */

#ifndef LIBCBOR_UNICODE_H
#define LIBCBOR_UNICODE_H

#include "cbor/common.h"

#ifdef __cplusplus
extern "C" {
#endif

enum _cbor_unicode_status_error { _CBOR_UNICODE_OK, _CBOR_UNICODE_BADCP };

/** Signals unicode validation error and possibly its location */
struct _cbor_unicode_status {
  enum _cbor_unicode_status_error status;
  size_t location;
};

size_t _cbor_unicode_codepoint_count(cbor_data source, size_t source_length,
                                     struct _cbor_unicode_status* status);

#ifdef __cplusplus
}
#endif

#endif  // LIBCBOR_UNICODE_H