PandA-2024.02
generate.c
Go to the documentation of this file.
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <string.h>
4 #include <sys/types.h>
5 #include <sys/stat.h>
6 #include <fcntl.h>
7 #include <unistd.h>
8 #include <assert.h>
9 
10 #include "nw.h"
11 int main(int argc, char **argv)
12 {
13  struct bench_args_t data;
14  // Must be exact length
15  char seqA[ALEN+1] = "tcgacgaaataggatgacagcacgttctcgtattagagggccgcggtacaaaccaaatgctgcggcgtacagggcacggggcgctgttcgggagatcgggggaatcgtggcgtgggtgattcgccggc";
16  char seqB[BLEN+1] = "ttcgagggcgcgtgtcgcggtccatcgacatgcccggtcggtgggacgtgggcgcctgatatagaggaatgcgattggaaggtcggacgggtcggcgagttgggcccggtgaatctgccatggtcgat";
17  int fd;
18 
19  assert( ALEN==strlen(seqA) && "String initializers must be exact length");
20  assert( BLEN==strlen(seqB) && "String initializers must be exact length");
21 
22  // Fill data structure
23  memcpy(data.seqA, seqA, ALEN);
24  memcpy(data.seqB, seqB, BLEN);
25 
26  // Open and write
27  fd = open("input.data", O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
28  assert( fd>0 && "Couldn't open input data file" );
29  data_to_input(fd, (void *)(&data));
30 
31  return 0;
32 }
void data_to_input(int fd, void *vdata)
Definition: local_support.c:34
#define BLEN
Definition: nw.h:6
#define ALEN
Definition: nw.h:5
char seqA[ALEN]
Definition: nw.h:15
int main(int argc, char **argv)
Definition: generate.c:12
char seqB[BLEN]
Definition: nw.h:16

Generated on Mon Feb 12 2024 13:02:49 for PandA-2024.02 by doxygen 1.8.13