|
| 1 | +/// @file ref_internal.h |
| 2 | +/// Internal declarations from ref.c |
| 3 | +/* |
| 4 | + Copyright (C) 2017 Genome Research Ltd. |
| 5 | +
|
| 6 | + Author: Thomas Hickman <[email protected]> |
| 7 | +
|
| 8 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 9 | +of this software and associated documentation files (the "Software"), to deal |
| 10 | +in the Software without restriction, including without limitation the rights |
| 11 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 12 | +copies of the Software, and to permit persons to whom the Software is |
| 13 | +furnished to do so, subject to the following conditions: |
| 14 | +
|
| 15 | +The above copyright notice and this permission notice shall be included in |
| 16 | +all copies or substantial portions of the Software. |
| 17 | +
|
| 18 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 21 | +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 22 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 23 | +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 24 | +DEALINGS IN THE SOFTWARE. */ |
| 25 | + |
| 26 | + |
| 27 | +#ifndef REF_INTERNAL_H |
| 28 | +#define REF_INTERNAL_H |
| 29 | + |
| 30 | +#include "htslib/hfile.h" |
| 31 | +#include "cram/mFILE.h" |
| 32 | + |
| 33 | +#ifdef __cplusplus |
| 34 | +extern "C" { |
| 35 | +#endif |
| 36 | + |
| 37 | +/** |
| 38 | + * Internal struct containing information about hFILEs created by m5_to_ref. Intended to be |
| 39 | + * consumed by cram_populate_ref |
| 40 | + */ |
| 41 | +typedef struct { |
| 42 | + hFILE_wrapper base; |
| 43 | + int length; |
| 44 | + char* file_name; // NOTE: this is set to NULL if this is an in-memory hFILE |
| 45 | + mFILE* mf; |
| 46 | + int is_mem_hfile; |
| 47 | +} hFILE_ref; |
| 48 | + |
| 49 | + |
| 50 | +#ifdef __cplusplus |
| 51 | +} |
| 52 | +#endif |
| 53 | + |
| 54 | +#endif |
0 commit comments