| OLD | NEW |
| (Empty) | |
| 1 /* |
| 2 * divsufsort.h for libdivsufsort |
| 3 * Copyright (c) 2003-2008 Yuta Mori All Rights Reserved. |
| 4 * |
| 5 * For the terms under which this work may be distributed, please see |
| 6 * the adjoining file "LICENSE". |
| 7 * |
| 8 * Changelog: |
| 9 * 2016-06-02 - Initial commit and adaption to use PagedArray. |
| 10 * --Samuel Huang <huangs@chromium.org> |
| 11 */ |
| 12 |
| 13 #ifndef COURGETTE_BSDIFF_THIRD_PARTY_DIVSUFSORT_H_ |
| 14 #define COURGETTE_BSDIFF_THIRD_PARTY_DIVSUFSORT_H_ |
| 15 |
| 16 #include <stdint.h> |
| 17 |
| 18 #include "courgette/third_party/bsdiff/paged_array.h" |
| 19 |
| 20 namespace divsuf { |
| 21 |
| 22 /*- Datatypes -*/ |
| 23 typedef int32_t saint_t; |
| 24 typedef int32_t saidx_t; |
| 25 typedef uint8_t sauchar_t; |
| 26 |
| 27 #ifdef DIVSUFSORT_NO_PAGED_ARRAY |
| 28 typedef saidx_t* saidx_it; |
| 29 typedef const saidx_t* const_saidx_it; |
| 30 #else |
| 31 typedef courgette::PagedArray<saidx_t>::iterator saidx_it; |
| 32 typedef courgette::PagedArray<saidx_t>::const_iterator const_saidx_it; |
| 33 #endif |
| 34 |
| 35 /*- Prototypes -*/ |
| 36 |
| 37 /** |
| 38 * Constructs the suffix array of a given string. |
| 39 * @param T[0:n-1] The input string. |
| 40 * @param SA[0:n-1] The output array of suffixes. |
| 41 * @param n The length of the given string, plus 1. |
| 42 * @return 0 if no error occurred, -1 or -2 otherwise. |
| 43 */ |
| 44 saint_t divsufsort(const sauchar_t *T, saidx_it SA, saidx_t n); |
| 45 |
| 46 } // namespace divsuf |
| 47 |
| 48 #endif // COURGETTE_BSDIFF_THIRD_PARTY_DIVSUFSORT_H_ |
| OLD | NEW |