3 * This file is part of fastq-tools.
5 * Copyright (c) 2011 by Daniel C. Jones <dcjones@cs.washington.edu>
15 void print_version(FILE *f, const char* prog_name)
17 fprintf(f, "%s (fastq-tools) %s\n",
18 prog_name, FASTQ_TOOLS_VERSION);
22 void or_die(int b, const char* msg)
31 void* malloc_or_die(size_t n)
35 fprintf(stderr, "Can not allocate %zu bytes.\n", n);
42 void* realloc_or_die(void* ptr, size_t n)
44 void* p = realloc(ptr, n);
46 fprintf(stderr, "Can not allocate %zu bytes.\n", n);
53 FILE* fopen_or_die(const char* path, const char* mode)
55 FILE* f = fopen(path, mode);
57 fprintf(stderr, "Can not open file %s with mode %s.\n", path, mode);