forked from IlyaGrebnov/libsais
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libsais64.h
71 lines (55 loc) · 2.02 KB
/
libsais64.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*--
This file is a part of libsais, a library for linear time suffix array,
longest common prefix array and burrows wheeler transform construction.
Copyright (c) 2021-2024 Ilya Grebnov <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Please see the file LICENSE for full copyright information.
--*/
/*--
Modifications made by team Unipept as of 18/10/2024 and ongoing.
--*/
#ifndef LIBSAIS64_H
#define LIBSAIS64_H 1
#define LIBSAIS64_VERSION_MAJOR 2
#define LIBSAIS64_VERSION_MINOR 8
#define LIBSAIS64_VERSION_PATCH 5
#define LIBSAIS64_VERSION_STRING "2.8.5"
#ifdef _WIN32
#ifdef LIBSAIS_SHARED
#ifdef LIBSAIS_EXPORTS
#define LIBSAIS64_API __declspec(dllexport)
#else
#define LIBSAIS64_API __declspec(dllimport)
#endif
#else
#define LIBSAIS64_API
#endif
#else
#define LIBSAIS64_API
#endif
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/**
* Constructs the suffix array of a given string.
* @param T [0..n-1] The input string.
* @param SA [0..n-1+fs] The output array of suffixes.
* @param n The length of the given string.
* @param fs The extra space available at the end of SA array (0 should be enough for most cases).
* @param freq [0..255] The output symbol frequency table (can be NULL).
* @return 0 if no error occurred, -1 or -2 otherwise.
*/
LIBSAIS64_API int64_t libsais64(const uint8_t * T, int64_t * SA, int64_t n, int64_t fs, int64_t * freq);
#ifdef __cplusplus
}
#endif
#endif