Path: blob/master/Utilities/cmzstd/lib/dictBuilder/divsufsort.h
3156 views
/*1* divsufsort.h for libdivsufsort-lite2* Copyright (c) 2003-2008 Yuta Mori All Rights Reserved.3*4* Permission is hereby granted, free of charge, to any person5* obtaining a copy of this software and associated documentation6* files (the "Software"), to deal in the Software without7* restriction, including without limitation the rights to use,8* copy, modify, merge, publish, distribute, sublicense, and/or sell9* copies of the Software, and to permit persons to whom the10* Software is furnished to do so, subject to the following11* conditions:12*13* The above copyright notice and this permission notice shall be14* included in all copies or substantial portions of the Software.15*16* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,17* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES18* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND19* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT20* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,21* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING22* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR23* OTHER DEALINGS IN THE SOFTWARE.24*/2526#ifndef _DIVSUFSORT_H27#define _DIVSUFSORT_H 12829#ifdef __cplusplus30extern "C" {31#endif /* __cplusplus */323334/*- Prototypes -*/3536/**37* Constructs the suffix array of a given string.38* @param T [0..n-1] The input string.39* @param SA [0..n-1] The output array of suffixes.40* @param n The length of the given string.41* @param openMP enables OpenMP optimization.42* @return 0 if no error occurred, -1 or -2 otherwise.43*/44int45divsufsort(const unsigned char *T, int *SA, int n, int openMP);4647/**48* Constructs the burrows-wheeler transformed string of a given string.49* @param T [0..n-1] The input string.50* @param U [0..n-1] The output string. (can be T)51* @param A [0..n-1] The temporary array. (can be NULL)52* @param n The length of the given string.53* @param num_indexes The length of secondary indexes array. (can be NULL)54* @param indexes The secondary indexes array. (can be NULL)55* @param openMP enables OpenMP optimization.56* @return The primary index if no error occurred, -1 or -2 otherwise.57*/58int59divbwt(const unsigned char *T, unsigned char *U, int *A, int n, unsigned char * num_indexes, int * indexes, int openMP);606162#ifdef __cplusplus63} /* extern "C" */64#endif /* __cplusplus */6566#endif /* _DIVSUFSORT_H */676869