OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2003-2008 Yuta Mori All Rights Reserved. |
| 2 // |
| 3 // For the terms under which this work may be distributed, please see |
| 4 // the adjoining file "LICENSE". |
| 5 // |
| 6 // ChangeLog: |
| 7 // 2016-07-22 - Initial commit and adaption to use PagedArray. |
| 8 // --Samuel Huang <huangs@chromium.org> |
| 9 |
| 10 #ifndef COURGETTE_BSDIFF_THIRD_PARTY_DIVSUFSORT_PRIVATE_H_ |
| 11 #define COURGETTE_BSDIFF_THIRD_PARTY_DIVSUFSORT_PRIVATE_H_ |
| 12 |
| 13 #include <assert.h> |
| 14 #include <stdint.h> |
| 15 #include <stdio.h> |
| 16 |
| 17 #include "courgette/third_party/divsufsort/divsufsort.h" |
| 18 |
| 19 namespace divsuf { |
| 20 |
| 21 /*- Constants -*/ |
| 22 #if !defined(UINT8_MAX) |
| 23 # define UINT8_MAX (255) |
| 24 #endif /* UINT8_MAX */ |
| 25 #if defined(ALPHABET_SIZE) && (ALPHABET_SIZE < 1) |
| 26 # undef ALPHABET_SIZE |
| 27 #endif |
| 28 #if !defined(ALPHABET_SIZE) |
| 29 # define ALPHABET_SIZE (UINT8_MAX + 1) |
| 30 #endif |
| 31 |
| 32 /*- Macros -*/ |
| 33 #ifndef SWAP |
| 34 # define SWAP(_a, _b) do { t = (_a); (_a) = (_b); (_b) = t; } while(0) |
| 35 #endif /* SWAP */ |
| 36 #ifndef MIN |
| 37 # define MIN(_a, _b) (((_a) < (_b)) ? (_a) : (_b)) |
| 38 #endif /* MIN */ |
| 39 #ifndef MAX |
| 40 # define MAX(_a, _b) (((_a) > (_b)) ? (_a) : (_b)) |
| 41 #endif /* MAX */ |
| 42 |
| 43 /*- Private Prototypes -*/ |
| 44 /* sssort.c */ |
| 45 void |
| 46 sssort(const sauchar_t *T, const_saidx_it PA, |
| 47 saidx_it first, saidx_it last, |
| 48 saidx_it buf, saidx_t bufsize, |
| 49 saidx_t depth, saidx_t n, saint_t lastsuffix); |
| 50 |
| 51 /* trsort.c */ |
| 52 void |
| 53 trsort(saidx_it ISA, saidx_it SA, saidx_t n, saidx_t depth); |
| 54 |
| 55 } // namespace divsuf |
| 56 |
| 57 #endif // COURGETTE_BSDIFF_THIRD_PARTY_DIVSUFSORT_PRIVATE_H_ |
OLD | NEW |