comparison ezBAMQC/src/htslib/cram/misc.h @ 0:dfa3745e5fd8

Uploaded
author youngkim
date Thu, 24 Mar 2016 17:12:52 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:dfa3745e5fd8
1 /*
2 Copyright (c) 1994-1997, 2001-2002 MEDICAL RESEARCH COUNCIL
3 All rights reserved
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7
8 1 Redistributions of source code must retain the above copyright notice,
9 this list of conditions and the following disclaimer.
10
11 2 Redistributions in binary form must reproduce the above copyright notice,
12 this list of conditions and the following disclaimer in the documentation
13 and/or other materials provided with the distribution.
14
15 3 Neither the name of the MEDICAL RESEARCH COUNCIL, THE LABORATORY OF
16 MOLECULAR BIOLOGY nor the names of its contributors may be used to endorse or
17 promote products derived from this software without specific prior written
18 permission.
19
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
24 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 /*
33 Copyright (c) 2003-2013 Genome Research Ltd.
34
35 Author: James Bonfield <jkb@sanger.ac.uk>
36
37 Redistribution and use in source and binary forms, with or without
38 modification, are permitted provided that the following conditions are met:
39
40 1. Redistributions of source code must retain the above copyright notice,
41 this list of conditions and the following disclaimer.
42
43 2. Redistributions in binary form must reproduce the above copyright notice,
44 this list of conditions and the following disclaimer in the documentation
45 and/or other materials provided with the distribution.
46
47 3. Neither the names Genome Research Ltd and Wellcome Trust Sanger
48 Institute nor the names of its contributors may be used to endorse or promote
49 products derived from this software without specific prior written permission.
50
51 THIS SOFTWARE IS PROVIDED BY GENOME RESEARCH LTD AND CONTRIBUTORS "AS IS" AND
52 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
53 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
54 DISCLAIMED. IN NO EVENT SHALL GENOME RESEARCH LTD OR CONTRIBUTORS BE LIABLE
55 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
56 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
57 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
58 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
59 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
60 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 */
62
63 #ifndef _misc_h
64 #define _misc_h
65
66 #include "cram/os.h"
67
68 #include <stdio.h>
69 #include <stdarg.h> /* varargs needed for v*printf() prototypes */
70 #include <sys/types.h>
71
72 #ifdef __cplusplus
73 extern "C" {
74 #endif
75
76 /*
77 * This informs gcc that crash() doesn't return, so it doesn't need to
78 * concern itself that code paths going via crash could mean some variables
79 * being undefined and then issuing uninitialised variable warnings.
80 * This particularly affected convert.
81 */
82 #ifdef __GNUC__
83 # define __NORETURN__ __attribute__ ((__noreturn__))
84 #else
85 # define __NORETURN__
86 #endif
87
88 /*
89 * Used for printf style argument checking. We can request a function such
90 * as vTcl_SetResult does argument checking, avoiding bugs with using
91 * %d and passing in a 64-bit record.
92 */
93 #ifdef __GNUC__
94 # define __PRINTF_FORMAT__(a,b) __attribute__ ((format (printf, a, b)))
95 #else
96 # define __PRINTF_FORMAT__(a,b)
97 #endif
98
99 extern int is_directory(char * fn);
100 extern int is_file(char * fn);
101 extern int file_size(char * fn);
102
103 #define MIN(A,B) ( ( (A) < (B) ) ? (A) : (B) )
104 #define MAX(A,B) ( ( (A) > (B) ) ? (A) : (B) )
105
106 #ifdef __cplusplus
107 }
108 #endif
109
110 #endif /*_misc_h*/