Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: third_party/re2/util/utf.h

Issue 1544433002: Replace RE2 import with a dependency (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-Added LICENSE and OWNERS file Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/re2/util/threadwin.cc ('k') | third_party/re2/util/util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * The authors of this software are Rob Pike and Ken Thompson.
3 * Copyright (c) 2002 by Lucent Technologies.
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose without fee is hereby granted, provided that this entire notice
6 * is included in all copies of any software which is or includes a copy
7 * or modification of this software and in all copies of the supporting
8 * documentation for such software.
9 * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
10 * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE AN Y
11 * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
12 * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
13 *
14 * This file and rune.cc have been converted to compile as C++ code
15 * in name space re2.
16 */
17 #ifndef RE2_UTIL_UTF_H__
18 #define RE2_UTIL_UTF_H__
19
20 #include <stdint.h>
21
22 namespace re2 {
23
24 typedef signed int Rune; /* Code-point values in Unicode 4.0 are 21 bits wide.*/
25
26 enum
27 {
28 UTFmax = 4, /* maximum bytes per rune */
29 Runesync = 0x80, /* cannot represent part of a UTF sequence (<) * /
30 Runeself = 0x80, /* rune and UTF sequences are the same (<) */
31 Runeerror = 0xFFFD, /* decoding error in UTF */
32 Runemax = 0x10FFFF, /* maximum rune value */
33 };
34
35 int runetochar(char* s, const Rune* r);
36 int chartorune(Rune* r, const char* s);
37 int fullrune(const char* s, int n);
38 int utflen(const char* s);
39 char* utfrune(const char*, Rune);
40
41 } // namespace re2
42
43 #endif // RE2_UTIL_UTF_H__
OLDNEW
« no previous file with comments | « third_party/re2/util/threadwin.cc ('k') | third_party/re2/util/util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698