divsufsort 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.txt +77 -0
- data/ext/Makefile +149 -0
- data/ext/divsufsort.c +398 -0
- data/ext/divsufsort.h +191 -0
- data/ext/divsufsort.o +0 -0
- data/ext/divsufsort.so +0 -0
- data/ext/divsufsort_private.h +207 -0
- data/ext/divsufsort_ruby.c +227 -0
- data/ext/divsufsort_ruby.o +0 -0
- data/ext/extconf.rb +18 -0
- data/ext/lfs.h +56 -0
- data/ext/mkmf.log +266 -0
- data/ext/sssort.c +815 -0
- data/ext/sssort.o +0 -0
- data/ext/trsort.c +586 -0
- data/ext/trsort.o +0 -0
- data/ext/utils.c +381 -0
- data/ext/utils.o +0 -0
- data/libdivsufsort/COPYING +27 -0
- data/libdivsufsort/divsufsort.c +398 -0
- data/libdivsufsort/divsufsort.h +191 -0
- data/libdivsufsort/divsufsort_private.h +207 -0
- data/libdivsufsort/lfs.h +56 -0
- data/libdivsufsort/sssort.c +815 -0
- data/libdivsufsort/trsort.c +586 -0
- data/libdivsufsort/utils.c +381 -0
- metadata +80 -0
@@ -0,0 +1,191 @@
|
|
1
|
+
/*
|
2
|
+
* divsufsort.h for libdivsufsort
|
3
|
+
* Copyright (c) 2003-2008 Yuta Mori All Rights Reserved.
|
4
|
+
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person
|
6
|
+
* obtaining a copy of this software and associated documentation
|
7
|
+
* files (the "Software"), to deal in the Software without
|
8
|
+
* restriction, including without limitation the rights to use,
|
9
|
+
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the
|
11
|
+
* Software is furnished to do so, subject to the following
|
12
|
+
* conditions:
|
13
|
+
*
|
14
|
+
* The above copyright notice and this permission notice shall be
|
15
|
+
* included in all copies or substantial portions of the Software.
|
16
|
+
*
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
18
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
19
|
+
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
20
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
21
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
22
|
+
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
23
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
24
|
+
* OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
*/
|
26
|
+
|
27
|
+
#ifndef _DIVSUFSORT_H
|
28
|
+
#define _DIVSUFSORT_H 1
|
29
|
+
|
30
|
+
#ifdef __cplusplus
|
31
|
+
extern "C" {
|
32
|
+
#endif /* __cplusplus */
|
33
|
+
|
34
|
+
// modified by SUGAWARA Genki <sgwr_dts@yahoo.co.jp>
|
35
|
+
#define PROJECT_VERSION_FULL "2.0.0"
|
36
|
+
|
37
|
+
#ifdef _WIN32
|
38
|
+
#include <stdlib.h>
|
39
|
+
#include <stdint.h>
|
40
|
+
#define INLINE _inline
|
41
|
+
#define PRId32 "ld"
|
42
|
+
#else
|
43
|
+
#define INLINE inline
|
44
|
+
#include <inttypes.h>
|
45
|
+
#endif
|
46
|
+
|
47
|
+
#ifndef DIVSUFSORT_API
|
48
|
+
# ifdef DIVSUFSORT_BUILD_DLL
|
49
|
+
# define DIVSUFSORT_API
|
50
|
+
# else
|
51
|
+
# define DIVSUFSORT_API
|
52
|
+
# endif
|
53
|
+
#endif
|
54
|
+
|
55
|
+
/*- Datatypes -*/
|
56
|
+
#ifndef SAUCHAR_T
|
57
|
+
#define SAUCHAR_T
|
58
|
+
typedef uint8_t sauchar_t;
|
59
|
+
#endif /* SAUCHAR_T */
|
60
|
+
#ifndef SAINT_T
|
61
|
+
#define SAINT_T
|
62
|
+
typedef int32_t saint_t;
|
63
|
+
#endif /* SAINT_T */
|
64
|
+
#ifndef SAIDX_T
|
65
|
+
#define SAIDX_T
|
66
|
+
typedef int32_t saidx_t;
|
67
|
+
#endif /* SAIDX_T */
|
68
|
+
#ifndef PRIdSAINT_T
|
69
|
+
#define PRIdSAINT_T PRId32
|
70
|
+
#endif /* PRIdSAINT_T */
|
71
|
+
#ifndef PRIdSAIDX_T
|
72
|
+
#define PRIdSAIDX_T PRId32
|
73
|
+
#endif /* PRIdSAIDX_T */
|
74
|
+
|
75
|
+
|
76
|
+
/*- Prototypes -*/
|
77
|
+
|
78
|
+
/**
|
79
|
+
* Constructs the suffix array of a given string.
|
80
|
+
* @param T[0..n-1] The input string.
|
81
|
+
* @param SA[0..n-1] The output array of suffixes.
|
82
|
+
* @param n The length of the given string.
|
83
|
+
* @return 0 if no error occurred, -1 or -2 otherwise.
|
84
|
+
*/
|
85
|
+
DIVSUFSORT_API
|
86
|
+
saint_t
|
87
|
+
divsufsort(const sauchar_t *T, saidx_t *SA, saidx_t n);
|
88
|
+
|
89
|
+
/**
|
90
|
+
* Constructs the burrows-wheeler transformed string of a given string.
|
91
|
+
* @param T[0..n-1] The input string.
|
92
|
+
* @param U[0..n-1] The output string. (can be T)
|
93
|
+
* @param A[0..n-1] The temporary array. (can be NULL)
|
94
|
+
* @param n The length of the given string.
|
95
|
+
* @return The primary index if no error occurred, -1 or -2 otherwise.
|
96
|
+
*/
|
97
|
+
DIVSUFSORT_API
|
98
|
+
saidx_t
|
99
|
+
divbwt(const sauchar_t *T, sauchar_t *U, saidx_t *A, saidx_t n);
|
100
|
+
|
101
|
+
/**
|
102
|
+
* Returns the version of the divsufsort library.
|
103
|
+
* @return The version number string.
|
104
|
+
*/
|
105
|
+
DIVSUFSORT_API
|
106
|
+
const char *
|
107
|
+
divsufsort_version(void);
|
108
|
+
|
109
|
+
|
110
|
+
/**
|
111
|
+
* Constructs the burrows-wheeler transformed string of a given string and suffix array.
|
112
|
+
* @param T[0..n-1] The input string.
|
113
|
+
* @param U[0..n-1] The output string. (can be T)
|
114
|
+
* @param SA[0..n-1] The suffix array. (can be NULL)
|
115
|
+
* @param n The length of the given string.
|
116
|
+
* @param idx The output primary index.
|
117
|
+
* @return 0 if no error occurred, -1 or -2 otherwise.
|
118
|
+
*/
|
119
|
+
DIVSUFSORT_API
|
120
|
+
saint_t
|
121
|
+
bw_transform(const sauchar_t *T, sauchar_t *U,
|
122
|
+
saidx_t *SA /* can NULL */,
|
123
|
+
saidx_t n, saidx_t *idx);
|
124
|
+
|
125
|
+
/**
|
126
|
+
* Inverse BW-transforms a given BWTed string.
|
127
|
+
* @param T[0..n-1] The input string.
|
128
|
+
* @param U[0..n-1] The output string. (can be T)
|
129
|
+
* @param A[0..n-1] The temporary array. (can be NULL)
|
130
|
+
* @param n The length of the given string.
|
131
|
+
* @param idx The primary index.
|
132
|
+
* @return 0 if no error occurred, -1 or -2 otherwise.
|
133
|
+
*/
|
134
|
+
DIVSUFSORT_API
|
135
|
+
saint_t
|
136
|
+
inverse_bw_transform(const sauchar_t *T, sauchar_t *U,
|
137
|
+
saidx_t *A /* can NULL */,
|
138
|
+
saidx_t n, saidx_t idx);
|
139
|
+
|
140
|
+
/**
|
141
|
+
* Checks the correctness of a given suffix array.
|
142
|
+
* @param T[0..n-1] The input string.
|
143
|
+
* @param SA[0..n-1] The input suffix array.
|
144
|
+
* @param n The length of the given string.
|
145
|
+
* @param verbose The verbose mode.
|
146
|
+
* @return 0 if no error occurred.
|
147
|
+
*/
|
148
|
+
DIVSUFSORT_API
|
149
|
+
saint_t
|
150
|
+
sufcheck(const sauchar_t *T, const saidx_t *SA, saidx_t n, saint_t verbose);
|
151
|
+
|
152
|
+
/**
|
153
|
+
* Search for the pattern P in the string T.
|
154
|
+
* @param T[0..Tsize-1] The input string.
|
155
|
+
* @param Tsize The length of the given string.
|
156
|
+
* @param P[0..Psize-1] The input pattern string.
|
157
|
+
* @param Psize The length of the given pattern string.
|
158
|
+
* @param SA[0..SAsize-1] The input suffix array.
|
159
|
+
* @param SAsize The length of the given suffix array.
|
160
|
+
* @param idx The output index.
|
161
|
+
* @return The count of matches if no error occurred, -1 otherwise.
|
162
|
+
*/
|
163
|
+
DIVSUFSORT_API
|
164
|
+
saidx_t
|
165
|
+
sa_search(const sauchar_t *T, saidx_t Tsize,
|
166
|
+
const sauchar_t *P, saidx_t Psize,
|
167
|
+
const saidx_t *SA, saidx_t SAsize,
|
168
|
+
saidx_t *left);
|
169
|
+
|
170
|
+
/**
|
171
|
+
* Search for the character c in the string T.
|
172
|
+
* @param T[0..Tsize-1] The input string.
|
173
|
+
* @param Tsize The length of the given string.
|
174
|
+
* @param SA[0..SAsize-1] The input suffix array.
|
175
|
+
* @param SAsize The length of the given suffix array.
|
176
|
+
* @param c The input character.
|
177
|
+
* @param idx The output index.
|
178
|
+
* @return The count of matches if no error occurred, -1 otherwise.
|
179
|
+
*/
|
180
|
+
DIVSUFSORT_API
|
181
|
+
saidx_t
|
182
|
+
sa_simplesearch(const sauchar_t *T, saidx_t Tsize,
|
183
|
+
const saidx_t *SA, saidx_t SAsize,
|
184
|
+
saint_t c, saidx_t *left);
|
185
|
+
|
186
|
+
|
187
|
+
#ifdef __cplusplus
|
188
|
+
} /* extern "C" */
|
189
|
+
#endif /* __cplusplus */
|
190
|
+
|
191
|
+
#endif /* _DIVSUFSORT_H */
|
@@ -0,0 +1,207 @@
|
|
1
|
+
/*
|
2
|
+
* divsufsort_private.h for libdivsufsort
|
3
|
+
* Copyright (c) 2003-2008 Yuta Mori All Rights Reserved.
|
4
|
+
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person
|
6
|
+
* obtaining a copy of this software and associated documentation
|
7
|
+
* files (the "Software"), to deal in the Software without
|
8
|
+
* restriction, including without limitation the rights to use,
|
9
|
+
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the
|
11
|
+
* Software is furnished to do so, subject to the following
|
12
|
+
* conditions:
|
13
|
+
*
|
14
|
+
* The above copyright notice and this permission notice shall be
|
15
|
+
* included in all copies or substantial portions of the Software.
|
16
|
+
*
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
18
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
19
|
+
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
20
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
21
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
22
|
+
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
23
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
24
|
+
* OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
*/
|
26
|
+
|
27
|
+
#ifndef _DIVSUFSORT_PRIVATE_H
|
28
|
+
#define _DIVSUFSORT_PRIVATE_H 1
|
29
|
+
|
30
|
+
#ifdef __cplusplus
|
31
|
+
extern "C" {
|
32
|
+
#endif /* __cplusplus */
|
33
|
+
|
34
|
+
#if HAVE_CONFIG_H
|
35
|
+
# include "config.h"
|
36
|
+
#endif
|
37
|
+
#include <assert.h>
|
38
|
+
#include <stdio.h>
|
39
|
+
#if HAVE_STRING_H
|
40
|
+
# include <string.h>
|
41
|
+
#endif
|
42
|
+
#if HAVE_STDLIB_H
|
43
|
+
# include <stdlib.h>
|
44
|
+
#endif
|
45
|
+
#if HAVE_MEMORY_H
|
46
|
+
# include <memory.h>
|
47
|
+
#endif
|
48
|
+
#if HAVE_STDDEF_H
|
49
|
+
# include <stddef.h>
|
50
|
+
#endif
|
51
|
+
#if HAVE_STRINGS_H
|
52
|
+
# include <strings.h>
|
53
|
+
#endif
|
54
|
+
#if HAVE_INTTYPES_H
|
55
|
+
# include <inttypes.h>
|
56
|
+
#else
|
57
|
+
# if HAVE_STDINT_H
|
58
|
+
# include <stdint.h>
|
59
|
+
# endif
|
60
|
+
#endif
|
61
|
+
#if defined(BUILD_DIVSUFSORT64)
|
62
|
+
# include "divsufsort64.h"
|
63
|
+
# ifndef SAIDX_T
|
64
|
+
# define SAIDX_T
|
65
|
+
# define saidx_t saidx64_t
|
66
|
+
# endif /* SAIDX_T */
|
67
|
+
# ifndef PRIdSAIDX_T
|
68
|
+
# define PRIdSAIDX_T PRIdSAIDX64_T
|
69
|
+
# endif /* PRIdSAIDX_T */
|
70
|
+
# define divsufsort divsufsort64
|
71
|
+
# define divbwt divbwt64
|
72
|
+
# define divsufsort_version divsufsort64_version
|
73
|
+
# define bw_transform bw_transform64
|
74
|
+
# define inverse_bw_transform inverse_bw_transform64
|
75
|
+
# define sufcheck sufcheck64
|
76
|
+
# define sa_search sa_search64
|
77
|
+
# define sa_simplesearch sa_simplesearch64
|
78
|
+
# define sssort sssort64
|
79
|
+
# define trsort trsort64
|
80
|
+
#else
|
81
|
+
# include "divsufsort.h"
|
82
|
+
#endif
|
83
|
+
|
84
|
+
|
85
|
+
/*- Constants -*/
|
86
|
+
#if !defined(UINT8_MAX)
|
87
|
+
# define UINT8_MAX (255)
|
88
|
+
#endif /* UINT8_MAX */
|
89
|
+
#if defined(ALPHABET_SIZE) && (ALPHABET_SIZE < 1)
|
90
|
+
# undef ALPHABET_SIZE
|
91
|
+
#endif
|
92
|
+
#if !defined(ALPHABET_SIZE)
|
93
|
+
# define ALPHABET_SIZE (UINT8_MAX + 1)
|
94
|
+
#endif
|
95
|
+
/* for divsufsort.c */
|
96
|
+
#define BUCKET_A_SIZE (ALPHABET_SIZE)
|
97
|
+
#define BUCKET_B_SIZE (ALPHABET_SIZE * ALPHABET_SIZE)
|
98
|
+
/* for sssort.c */
|
99
|
+
#if defined(SS_INSERTIONSORT_THRESHOLD)
|
100
|
+
# if SS_INSERTIONSORT_THRESHOLD < 1
|
101
|
+
# undef SS_INSERTIONSORT_THRESHOLD
|
102
|
+
# define SS_INSERTIONSORT_THRESHOLD (1)
|
103
|
+
# endif
|
104
|
+
#else
|
105
|
+
# define SS_INSERTIONSORT_THRESHOLD (8)
|
106
|
+
#endif
|
107
|
+
#if defined(SS_BLOCKSIZE)
|
108
|
+
# if SS_BLOCKSIZE < 0
|
109
|
+
# undef SS_BLOCKSIZE
|
110
|
+
# define SS_BLOCKSIZE (0)
|
111
|
+
# elif 32768 <= SS_BLOCKSIZE
|
112
|
+
# undef SS_BLOCKSIZE
|
113
|
+
# define SS_BLOCKSIZE (32767)
|
114
|
+
# endif
|
115
|
+
#else
|
116
|
+
# define SS_BLOCKSIZE (1024)
|
117
|
+
#endif
|
118
|
+
/* minstacksize = log(SS_BLOCKSIZE) / log(3) * 2 */
|
119
|
+
#if SS_BLOCKSIZE == 0
|
120
|
+
# if defined(BUILD_DIVSUFSORT64)
|
121
|
+
# define SS_MISORT_STACKSIZE (96)
|
122
|
+
# else
|
123
|
+
# define SS_MISORT_STACKSIZE (64)
|
124
|
+
# endif
|
125
|
+
#elif SS_BLOCKSIZE <= 4096
|
126
|
+
# define SS_MISORT_STACKSIZE (16)
|
127
|
+
#else
|
128
|
+
# define SS_MISORT_STACKSIZE (24)
|
129
|
+
#endif
|
130
|
+
#if defined(BUILD_DIVSUFSORT64)
|
131
|
+
# define SS_SMERGE_STACKSIZE (64)
|
132
|
+
#else
|
133
|
+
# define SS_SMERGE_STACKSIZE (32)
|
134
|
+
#endif
|
135
|
+
/* for trsort.c */
|
136
|
+
#define TR_INSERTIONSORT_THRESHOLD (8)
|
137
|
+
#if defined(BUILD_DIVSUFSORT64)
|
138
|
+
# define TR_STACKSIZE (96)
|
139
|
+
#else
|
140
|
+
# define TR_STACKSIZE (64)
|
141
|
+
#endif
|
142
|
+
|
143
|
+
|
144
|
+
/*- Macros -*/
|
145
|
+
#ifndef SWAP
|
146
|
+
# define SWAP(_a, _b) do { t = (_a); (_a) = (_b); (_b) = t; } while(0)
|
147
|
+
#endif /* SWAP */
|
148
|
+
#ifndef MIN
|
149
|
+
# define MIN(_a, _b) (((_a) < (_b)) ? (_a) : (_b))
|
150
|
+
#endif /* MIN */
|
151
|
+
#ifndef MAX
|
152
|
+
# define MAX(_a, _b) (((_a) > (_b)) ? (_a) : (_b))
|
153
|
+
#endif /* MAX */
|
154
|
+
#define STACK_PUSH(_a, _b, _c, _d)\
|
155
|
+
do {\
|
156
|
+
assert(ssize < STACK_SIZE);\
|
157
|
+
stack[ssize].a = (_a), stack[ssize].b = (_b),\
|
158
|
+
stack[ssize].c = (_c), stack[ssize++].d = (_d);\
|
159
|
+
} while(0)
|
160
|
+
#define STACK_PUSH5(_a, _b, _c, _d, _e)\
|
161
|
+
do {\
|
162
|
+
assert(ssize < STACK_SIZE);\
|
163
|
+
stack[ssize].a = (_a), stack[ssize].b = (_b),\
|
164
|
+
stack[ssize].c = (_c), stack[ssize].d = (_d), stack[ssize++].e = (_e);\
|
165
|
+
} while(0)
|
166
|
+
#define STACK_POP(_a, _b, _c, _d)\
|
167
|
+
do {\
|
168
|
+
assert(0 <= ssize);\
|
169
|
+
if(ssize == 0) { return; }\
|
170
|
+
(_a) = stack[--ssize].a, (_b) = stack[ssize].b,\
|
171
|
+
(_c) = stack[ssize].c, (_d) = stack[ssize].d;\
|
172
|
+
} while(0)
|
173
|
+
#define STACK_POP5(_a, _b, _c, _d, _e)\
|
174
|
+
do {\
|
175
|
+
assert(0 <= ssize);\
|
176
|
+
if(ssize == 0) { return; }\
|
177
|
+
(_a) = stack[--ssize].a, (_b) = stack[ssize].b,\
|
178
|
+
(_c) = stack[ssize].c, (_d) = stack[ssize].d, (_e) = stack[ssize].e;\
|
179
|
+
} while(0)
|
180
|
+
/* for divsufsort.c */
|
181
|
+
#define BUCKET_A(_c0) bucket_A[(_c0)]
|
182
|
+
#if ALPHABET_SIZE == 256
|
183
|
+
#define BUCKET_B(_c0, _c1) (bucket_B[((_c1) << 8) | (_c0)])
|
184
|
+
#define BUCKET_BSTAR(_c0, _c1) (bucket_B[((_c0) << 8) | (_c1)])
|
185
|
+
#else
|
186
|
+
#define BUCKET_B(_c0, _c1) (bucket_B[(_c1) * ALPHABET_SIZE + (_c0)])
|
187
|
+
#define BUCKET_BSTAR(_c0, _c1) (bucket_B[(_c0) * ALPHABET_SIZE + (_c1)])
|
188
|
+
#endif
|
189
|
+
|
190
|
+
|
191
|
+
/*- Private Prototypes -*/
|
192
|
+
/* sssort.c */
|
193
|
+
void
|
194
|
+
sssort(const sauchar_t *Td, const saidx_t *PA,
|
195
|
+
saidx_t *first, saidx_t *last,
|
196
|
+
saidx_t *buf, saidx_t bufsize,
|
197
|
+
saidx_t depth, saidx_t n, saint_t lastsuffix);
|
198
|
+
/* trsort.c */
|
199
|
+
void
|
200
|
+
trsort(saidx_t *ISA, saidx_t *SA, saidx_t n, saidx_t depth);
|
201
|
+
|
202
|
+
|
203
|
+
#ifdef __cplusplus
|
204
|
+
} /* extern "C" */
|
205
|
+
#endif /* __cplusplus */
|
206
|
+
|
207
|
+
#endif /* _DIVSUFSORT_PRIVATE_H */
|
data/libdivsufsort/lfs.h
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
/*
|
2
|
+
* lfs.h for libdivsufsort
|
3
|
+
* Copyright (c) 2003-2008 Yuta Mori All Rights Reserved.
|
4
|
+
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person
|
6
|
+
* obtaining a copy of this software and associated documentation
|
7
|
+
* files (the "Software"), to deal in the Software without
|
8
|
+
* restriction, including without limitation the rights to use,
|
9
|
+
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the
|
11
|
+
* Software is furnished to do so, subject to the following
|
12
|
+
* conditions:
|
13
|
+
*
|
14
|
+
* The above copyright notice and this permission notice shall be
|
15
|
+
* included in all copies or substantial portions of the Software.
|
16
|
+
*
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
18
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
19
|
+
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
20
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
21
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
22
|
+
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
23
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
24
|
+
* OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
*/
|
26
|
+
|
27
|
+
#ifndef _LFS_H
|
28
|
+
#define _LFS_H 1
|
29
|
+
|
30
|
+
#ifdef __cplusplus
|
31
|
+
extern "C" {
|
32
|
+
#endif /* __cplusplus */
|
33
|
+
|
34
|
+
#ifndef __STRICT_ANSI__
|
35
|
+
# define LFS_OFF_T long
|
36
|
+
# define LFS_FOPEN fopen
|
37
|
+
# define LFS_FTELL ftell
|
38
|
+
# define LFS_FSEEK fseek
|
39
|
+
# define LFS_PRId "ld"
|
40
|
+
#else
|
41
|
+
# define LFS_OFF_T long
|
42
|
+
# define LFS_FOPEN fopen
|
43
|
+
# define LFS_FTELL ftell
|
44
|
+
# define LFS_FSEEK fseek
|
45
|
+
# define LFS_PRId "ld"
|
46
|
+
#endif
|
47
|
+
#ifndef PRIdOFF_T
|
48
|
+
# define PRIdOFF_T LFS_PRId
|
49
|
+
#endif
|
50
|
+
|
51
|
+
|
52
|
+
#ifdef __cplusplus
|
53
|
+
} /* extern "C" */
|
54
|
+
#endif /* __cplusplus */
|
55
|
+
|
56
|
+
#endif /* _LFS_H */
|