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

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

Issue 1948843002: [Courgette Experimental] Replace QSufSort with libdivsufsort Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and merge. 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
« no previous file with comments | « courgette/third_party/divsufsort/README.chromium ('k') | courgette/third_party/divsufsort/divsufsort.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/third_party/divsufsort/divsufsort.h
diff --git a/courgette/third_party/divsufsort/divsufsort.h b/courgette/third_party/divsufsort/divsufsort.h
new file mode 100644
index 0000000000000000000000000000000000000000..1f55738e3b598dac03eef2188ad2198d26fc0147
--- /dev/null
+++ b/courgette/third_party/divsufsort/divsufsort.h
@@ -0,0 +1,48 @@
+/*
+ * divsufsort.h for libdivsufsort
+ * 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-06-02 - Initial commit and adaption to use PagedArray.
+ * --Samuel Huang <huangs@chromium.org>
+ */
+
+#ifndef COURGETTE_BSDIFF_THIRD_PARTY_DIVSUFSORT_H_
+#define COURGETTE_BSDIFF_THIRD_PARTY_DIVSUFSORT_H_
+
+#include <stdint.h>
+
+#include "courgette/third_party/bsdiff/paged_array.h"
+
+namespace divsuf {
+
+/*- Datatypes -*/
+typedef int32_t saint_t;
+typedef int32_t saidx_t;
+typedef uint8_t sauchar_t;
+
+#ifdef DIVSUFSORT_NO_PAGED_ARRAY
+typedef saidx_t* saidx_it;
+typedef const saidx_t* const_saidx_it;
+#else
+typedef courgette::PagedArray<saidx_t>::iterator saidx_it;
+typedef courgette::PagedArray<saidx_t>::const_iterator const_saidx_it;
+#endif
+
+/*- Prototypes -*/
+
+/**
+ * Constructs the suffix array of a given string.
+ * @param T[0:n-1] The input string.
+ * @param SA[0:n-1] The output array of suffixes.
+ * @param n The length of the given string, plus 1.
+ * @return 0 if no error occurred, -1 or -2 otherwise.
+ */
+saint_t divsufsort(const sauchar_t *T, saidx_it SA, saidx_t n);
+
+} // namespace divsuf
+
+#endif // COURGETTE_BSDIFF_THIRD_PARTY_DIVSUFSORT_H_
« no previous file with comments | « courgette/third_party/divsufsort/README.chromium ('k') | courgette/third_party/divsufsort/divsufsort.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698