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

Unified Diff: courgette/third_party/divsufsort/divsufsort_private.h

Issue 2156223002: [Courgette] Add third party-library: libdivsufsort. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restrict CL to third_party code addition only. Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: courgette/third_party/divsufsort/divsufsort_private.h
diff --git a/courgette/third_party/divsufsort/divsufsort_private.h b/courgette/third_party/divsufsort/divsufsort_private.h
new file mode 100644
index 0000000000000000000000000000000000000000..4113625952e2971af6aed7e92aa8aa7648f6a9ae
--- /dev/null
+++ b/courgette/third_party/divsufsort/divsufsort_private.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2003-2008 Yuta Mori All Rights Reserved.
+//
+// For the terms under which this work may be distributed, please see
+// the adjoining file "LICENSE".
+//
+// ChangeLog:
+// 2016-07-18 - Initial commit and adaption to use PagedArray.
+// --Samuel Huang <huangs@chromium.org>
+
+#ifndef COURGETTE_BSDIFF_THIRD_PARTY_DIVSUFSORT_PRIVATE_H_
+#define COURGETTE_BSDIFF_THIRD_PARTY_DIVSUFSORT_PRIVATE_H_
+
+#include <assert.h>
+#include <stdint.h>
+#include <stdio.h>
+
+#include "courgette/third_party/divsufsort/divsufsort.h"
+
+namespace divsuf {
+
+/*- Constants -*/
+#if !defined(UINT8_MAX)
+# define UINT8_MAX (255)
+#endif /* UINT8_MAX */
+#if defined(ALPHABET_SIZE) && (ALPHABET_SIZE < 1)
+# undef ALPHABET_SIZE
+#endif
+#if !defined(ALPHABET_SIZE)
+# define ALPHABET_SIZE (UINT8_MAX + 1)
+#endif
+
+/*- Macros -*/
+#ifndef SWAP
+# define SWAP(_a, _b) do { t = (_a); (_a) = (_b); (_b) = t; } while(0)
+#endif /* SWAP */
+#ifndef MIN
+# define MIN(_a, _b) (((_a) < (_b)) ? (_a) : (_b))
+#endif /* MIN */
+#ifndef MAX
+# define MAX(_a, _b) (((_a) > (_b)) ? (_a) : (_b))
+#endif /* MAX */
+
+/*- Private Prototypes -*/
+/* sssort.c */
+void
+sssort(const sauchar_t *T, const_saidx_it PA,
+ saidx_it first, saidx_it last,
+ saidx_it buf, saidx_t bufsize,
+ saidx_t depth, saidx_t n, saint_t lastsuffix);
+
+/* trsort.c */
+void
+trsort(saidx_it ISA, saidx_it SA, saidx_t n, saidx_t depth);
+
+} // namespace divsuf
+
+#endif // COURGETTE_BSDIFF_THIRD_PARTY_DIVSUFSORT_PRIVATE_H_

Powered by Google App Engine
This is Rietveld 408576698