-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.c
More file actions
39 lines (29 loc) · 1.04 KB
/
main.c
File metadata and controls
39 lines (29 loc) · 1.04 KB
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
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "SuffixArray.h"
int
main(int argc, char *argv[])
{
char inputFileNamePrefix [MAX_PATH_LENGTH];
uint32_t availmemoryInputBuffersBytes;
uint32_t maxOutputBufferElements;
int result;
int totalInputFiles;
//need parameters for the following
//int mergeSuffixArraysIntoSA_LCP (char * inputFilePrefix, int numFiles, uint64_t memoryForInputBuffersBytes, uint64_t outputBufferCapacityNumberOfElements)
if(argc<5)
{
printf("./buildandmerge <inputfilenamefullpathprefix> <total_files> <memory_bytes_for_inputbuffers> <max_elements_output_buffer>\n");
return 1;
}
sprintf(inputFileNamePrefix,"%s", argv[1]);
totalInputFiles = atoi(argv[2]);
availmemoryInputBuffersBytes = atoi(argv[3]);
maxOutputBufferElements = atoi(argv[4]);
result = buildSuffixArraysForAllFiles(inputFileNamePrefix, totalInputFiles);
if(result!=0)
return 1;
return mergeSuffixArraysIntoSA_LCP (inputFileNamePrefix, totalInputFiles,
availmemoryInputBuffersBytes, maxOutputBufferElements);
}