Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
extractor
gesa
Commits
5b0c6da1
Commit
5b0c6da1
authored
Jan 16, 2018
by
jkvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More childtab examples
parent
e1824607
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
src/gesa.c
src/gesa.c
+3
-1
tests/test_1.c
tests/test_1.c
+13
-3
No files found.
src/gesa.c
View file @
5b0c6da1
...
...
@@ -33,7 +33,9 @@ int GESA_create(GESA* const gesa,
for
(
size_t
i
=
0
;
i
<
length
;
++
i
)
{
gesa
->
da
[
i
]
=
0
;
gesa
->
sa
[
i
]
=
0
;
gesa
->
lcp
[
i
]
=
0
;
gesa
->
da
[
i
]
=
0
;
}
// for
return
sais
((
GESA_char_t
*
)
string
,
gesa
->
sa
,
gesa
->
lcp
,
(
int
)
length
);
}
// GESA_create
...
...
tests/test_1.c
View file @
5b0c6da1
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../include/gesa.h"
#include "utils.h"
...
...
@@ -17,19 +18,28 @@ int main(int argc, char* argv[])
GESA
gesa
;
assert
(
GESA_create
(
&
gesa
,
(
GESA_char_t
*
)
"accttacgacgaccttcca~"
,
21
)
==
0
);
//char const* const string = "accttacgacgaccttcca~";
char
const
*
const
string
=
"acaaacatat~"
;
size_t
const
length
=
strlen
(
string
)
+
1
;
printf
(
"%ld
\n
"
,
length
);
assert
(
GESA_create
(
&
gesa
,
(
GESA_char_t
*
)
string
,
length
)
==
0
);
GESA_print
(
&
gesa
,
stdout
);
GESA_index_t
*
childtab
=
malloc
(
21
*
sizeof
(
*
childtab
));
GESA_index_t
*
childtab
=
malloc
(
length
*
sizeof
(
*
childtab
));
assert
(
childtab
!=
0
);
GESA_calculate_childtab
(
&
gesa
,
childtab
);
for
(
size_t
i
=
0
;
i
<
2
1
;
++
i
)
for
(
size_t
i
=
0
;
i
<
length
-
1
;
++
i
)
{
printf
(
"%5ld %5d
\n
"
,
i
,
childtab
[
i
]);
}
// for
free
(
childtab
);
GESA_destroy
(
&
gesa
,
GESA_KEEP_STRINGS
);
return
EXIT_SUCCESS
;
}
// main
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment