comparison srf2fastq/io_lib-1.12.2/progs/scf_update.c @ 0:d901c9f41a6a default tip

Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
author dawe
date Tue, 07 Jun 2011 17:48:05 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d901c9f41a6a
1 /*
2 * Copyright (c) Medical Research Council 1994. All rights reserved.
3 *
4 * Permission to use, copy, modify and distribute this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * this copyright and notice appears in all copies.
7 *
8 * This file was written by James Bonfield, Simon Dear, Rodger Staden,
9 * as part of the Staden Package at the MRC Laboratory of Molecular
10 * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
11 *
12 * MRC disclaims all warranties with regard to this software.
13 */
14
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <string.h>
18 #include <io_lib/scf.h>
19
20 /*
21 * Update a v2.x SCF files to a v3.x SCF files.
22 */
23
24 int main(int argc, char **argv) {
25 Scf *scf;
26 int version = 3;
27
28 if (argc > 2 && strcmp(argv[1], "-v") == 0) {
29 version = atoi(argv[2]);
30 if (version != 2 && version != 3) {
31 fprintf(stderr, "Please specify version 2 or version 3\n");
32 return 1;
33 }
34
35 argc-=2;
36 argv+=2;
37 }
38
39 if (argc != 3) {
40 fprintf(stderr, "Usage: scf_update [-v version] source destination\n");
41 return 1;
42 }
43
44 if (NULL == (scf = read_scf(argv[1]))) {
45 perror(argv[1]);
46 return 1;
47 }
48
49 set_scf_version(version);
50
51 if (-1 == write_scf(scf, argv[2])) {
52 perror(argv[2]);
53 return 1;
54 }
55
56 scf_deallocate(scf);
57 return 0;
58 }