| 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_
|
|
|