]> git.donarmstrong.com Git - fastq-tools.git/blob - src/common.h
Fix the weird output behavior of fastq-sample.
[fastq-tools.git] / src / common.h
1 /*
2  * This file is part of fastq-tools.
3  *
4  * Copyright (c) 2011 by Daniel C. Jones <dcjones@cs.washington.edu>
5  *
6  * common :
7  * A few common functions, primarily for crashing whilst retaining our dignity.
8  *
9  */
10
11 #ifndef FASTQ_TOOLS_COMMON_H
12 #define FASTQ_TOOLS_COMMON_H
13
14 #include <stdio.h>
15
16 void print_version(FILE* f, const char* prog_name);
17
18 void or_die(int b, const char* msg);
19
20 void* malloc_or_die(size_t);
21 void* realloc_or_die(void*, size_t);
22 FILE* fopen_or_die(const char*, const char*);
23
24 /* Open a file for reading, creating it if it doesn't exist, and complaining if
25  * it does. */
26 FILE* open_without_clobber(const char* filename);
27
28 #endif
29