| OLD | NEW |
| (Empty) | |
| 1 /* |
| 2 * divsufsort_private.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_PRIVATE_H_ |
| 14 #define COURGETTE_BSDIFF_THIRD_PARTY_DIVSUFSORT_PRIVATE_H_ |
| 15 |
| 16 #include <assert.h> |
| 17 #include <stdint.h> |
| 18 #include <stdio.h> |
| 19 |
| 20 #include "courgette/third_party/divsufsort/divsufsort.h" |
| 21 |
| 22 namespace divsuf { |
| 23 |
| 24 /*- Constants -*/ |
| 25 #if !defined(UINT8_MAX) |
| 26 # define UINT8_MAX (255) |
| 27 #endif /* UINT8_MAX */ |
| 28 #if defined(ALPHABET_SIZE) && (ALPHABET_SIZE < 1) |
| 29 # undef ALPHABET_SIZE |
| 30 #endif |
| 31 #if !defined(ALPHABET_SIZE) |
| 32 # define ALPHABET_SIZE (UINT8_MAX + 1) |
| 33 #endif |
| 34 |
| 35 /*- Macros -*/ |
| 36 #ifndef SWAP |
| 37 # define SWAP(_a, _b) do { t = (_a); (_a) = (_b); (_b) = t; } while(0) |
| 38 #endif /* SWAP */ |
| 39 #ifndef MIN |
| 40 # define MIN(_a, _b) (((_a) < (_b)) ? (_a) : (_b)) |
| 41 #endif /* MIN */ |
| 42 #ifndef MAX |
| 43 # define MAX(_a, _b) (((_a) > (_b)) ? (_a) : (_b)) |
| 44 #endif /* MAX */ |
| 45 |
| 46 /*- Private Prototypes -*/ |
| 47 /* sssort.c */ |
| 48 void |
| 49 sssort(const sauchar_t *T, const_saidx_it PA, |
| 50 saidx_it first, saidx_it last, |
| 51 saidx_it buf, saidx_t bufsize, |
| 52 saidx_t depth, saidx_t n, saint_t lastsuffix); |
| 53 |
| 54 /* trsort.c */ |
| 55 void |
| 56 trsort(saidx_it ISA, saidx_it SA, saidx_t n, saidx_t depth); |
| 57 |
| 58 } // namespace divsuf |
| 59 |
| 60 #endif // COURGETTE_BSDIFF_THIRD_PARTY_DIVSUFSORT_PRIVATE_H_ |
| OLD | NEW |