ast2firm: Implement casting from complex to real types.
[cparser] / string_rep.h
1 /*
2  * This file is part of cparser.
3  * Copyright (C) 2012 Matthias Braun <matze@braunis.de>
4  */
5 #ifndef STRING_REP_H
6 #define STRING_REP_H
7
8 #include <stdlib.h>
9 #include "unicode.h"
10
11 enum string_encoding_t {
12         STRING_ENCODING_CHAR,
13         STRING_ENCODING_CHAR16,
14         STRING_ENCODING_CHAR32,
15         STRING_ENCODING_UTF8,
16         STRING_ENCODING_WIDE
17 };
18 typedef enum string_encoding_t string_encoding_t;
19
20 typedef struct string_t {
21         char const       *begin; /**< UTF-8 encoded string, the last character is guaranteed to be \0. */
22         size_t            size;  /**< size of string in bytes (not characters), without terminating \0. */
23         string_encoding_t encoding;
24 } string_t;
25
26 size_t get_string_len(string_t const *str);
27
28 #endif