Skip to content

Commit 15f9cfc

Browse files
committed
Update devtools/import.py and import/pysam.* for 1.15
Exclude samtools/bam2bcf.[ch] which (starting in samtools 1.15) are only used by bam_tview.c (which we already exclude) and contain functions that collide with bcftools. Remove obsolete exclusions for removed items. In import/pysam.h, add prefixes to several more functions that otherwise conflict between libcsamtools and libcbcftools. Fixes pysam-developers#1081. In bcftools/regidx.h, add prefixes to all functions, as these conflict with those provided by htslib/htslib/regidx.h. This is done locally within bcftools (rather than via import/pysam.h) as this issue may be resolved in future bcftools imports by PR samtools/bcftools#865.
1 parent cb5d352 commit 15f9cfc

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

bcftools/regidx.h

+22
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,28 @@
6565
#include <stdio.h>
6666
#include <inttypes.h>
6767

68+
/* Avoid conflicts with HTSlib's regidx_* functions. */
69+
#define regidx_destroy bcftools_regidx_destroy
70+
#define regidx_init bcftools_regidx_init
71+
#define regidx_init_string bcftools_regidx_init_string
72+
#define regidx_insert bcftools_regidx_insert
73+
#define regidx_insert_list bcftools_regidx_insert_list
74+
#define regidx_nregs bcftools_regidx_nregs
75+
#define regidx_overlap bcftools_regidx_overlap
76+
#define regidx_parse_bed bcftools_regidx_parse_bed
77+
#define regidx_parse_reg bcftools_regidx_parse_reg
78+
#define regidx_parse_tab bcftools_regidx_parse_tab
79+
#define regidx_parse_vcf bcftools_regidx_parse_vcf
80+
#define regidx_push bcftools_regidx_push
81+
#define regidx_seq_names bcftools_regidx_seq_names
82+
#define regidx_seq_nregs bcftools_regidx_seq_nregs
83+
#define regitr_copy bcftools_regitr_copy
84+
#define regitr_destroy bcftools_regitr_destroy
85+
#define regitr_init bcftools_regitr_init
86+
#define regitr_loop bcftools_regitr_loop
87+
#define regitr_overlap bcftools_regitr_overlap
88+
#define regitr_reset bcftools_regitr_reset
89+
6890
#ifdef __cplusplus
6991
extern "C" {
7092
#endif

devtools/import.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
EXCLUDE = {
1919
"samtools": (
2020
"test", "misc",
21-
"razip.c",
2221
"bgzip.c",
2322
"main.c",
2423
"calDepth.c",
@@ -27,8 +26,8 @@
2726
"bam_tview.h",
2827
"bam_tview_html.c",
2928
"bam_tview_curses.c",
30-
"bamcheck.c",
31-
"chk_indel.c",
29+
"bam2bcf.c",
30+
"bam2bcf.h",
3231
"vcf-miniview.c",
3332
),
3433
"bcftools": (

import/pysam.h

+4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ extern int @pysam@_main(int argc, char *argv[]);
6565
to collisions and wrong functions being called. #define these names so the
6666
actual symbol names include distinct prefixes to avoid collisions.
6767
*/
68+
#define main_consensus @pysam@_main_consensus
6869
#define main_reheader @pysam@_main_reheader
70+
#define bam_smpl_init @pysam@_bam_smpl_init
71+
#define bam_smpl_destroy @pysam@_bam_smpl_destroy
72+
#define read_file_list @pysam@_read_file_list
6973

7074
#endif
7175

0 commit comments

Comments
 (0)