#include #include #include /* mmap() is defined in this header */ #include #include #include #include "../obitypes.h" #include "../obidmscolumn.h" /** * @brief Computes the size to map. * * * @param OBIDMSColumn_file The file to map. * @return The size to map. */ int get_size_to_map(int OBIDMSColumn_file) // compute size to map : file size minus size of the header { int size; struct stat s; fstat(OBIDMSColumn_file, &s); size = (s.st_size) - HEADER_SIZE; return(size); } /** * @brief Computes and prints the total number of sequences by summing their counts. * * * @param The count file. */ int main(int argc, char const *argv[]) { char* map; int size; int OBIDMSColumn_file; int count; char c; char num_str[10] = ""; int num_int; int i,j; // initialize variables OBIDMSColumn_file = open(argv[1], O_RDONLY); //read only count = 0; j = 0; // compute size to map size = get_size_to_map(OBIDMSColumn_file); // map the data map = obi_map_read_only(OBIDMSColumn_file, HEADER_SIZE, size); // sum the counts for (i=0; i