Skip to content

Commit 4dfc9e9

Browse files
committed
Remove obsolete source files and unnecessary includes
c{sam,bcf}tools_util.h are long since replaced by {sam,bcf}tools.pysam.h. Only this commented-out libctabix.pyx code used getline(), so remove its fallback definition in pysam_utils.c and hence remove the now-empty pysam_util.[ch]. Remove unused header inclusions from htslib_util.c.
1 parent 41f6b19 commit 4dfc9e9

File tree

7 files changed

+1
-123
lines changed

7 files changed

+1
-123
lines changed

pysam/cbcftools_util.h

Lines changed: 0 additions & 6 deletions
This file was deleted.

pysam/csamtools_util.h

Lines changed: 0 additions & 6 deletions
This file was deleted.

pysam/htslib_util.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
#include <ctype.h>
21
#include <assert.h>
32
#include "htslib/khash.h"
4-
#include "htslib/ksort.h"
53
#include "htslib/sam.h"
64
#include "htslib/hts.h"
7-
#include "htslib/knetfile.h"
8-
#include "htslib/kseq.h"
95
#include "htslib_util.h"
10-
#include <stdio.h>
116

127
#ifndef inline
138
#define inline __inline

pysam/libctabix.pyx

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,70 +1012,6 @@ def tabix_index(filename,
10121012

10131013
return filename
10141014

1015-
# #########################################################
1016-
# cdef class tabix_file_iterator_old:
1017-
# '''iterate over ``infile``.
1018-
1019-
# This iterator is not safe. If the :meth:`__next__()` method is called
1020-
# after ``infile`` is closed, the result is undefined (see ``fclose()``).
1021-
1022-
# The iterator might either raise a StopIteration or segfault.
1023-
# '''
1024-
1025-
1026-
# def __cinit__(self,
1027-
# infile,
1028-
# Parser parser,
1029-
# int buffer_size = 65536 ):
1030-
1031-
# cdef int fd = PyObject_AsFileDescriptor( infile )
1032-
# if fd == -1: raise ValueError( "I/O operation on closed file." )
1033-
# self.infile = fdopen( fd, 'r')
1034-
1035-
# if self.infile == NULL: raise ValueError( "I/O operation on closed file." )
1036-
1037-
# self.buffer = <char*>malloc( buffer_size )
1038-
# self.size = buffer_size
1039-
# self.parser = parser
1040-
1041-
# def __iter__(self):
1042-
# return self
1043-
1044-
# cdef __cnext__(self):
1045-
1046-
# cdef char * b
1047-
# cdef size_t nbytes
1048-
# b = self.buffer
1049-
1050-
# while not feof( self.infile ):
1051-
# nbytes = getline( &b, &self.size, self.infile)
1052-
1053-
# # stop at first error or eof
1054-
# if (nbytes == -1): break
1055-
# # skip comments
1056-
# if (b[0] == '#'): continue
1057-
1058-
# # skip empty lines
1059-
# if b[0] == '\0' or b[0] == '\n' or b[0] == '\r': continue
1060-
1061-
# # make sure that entry is complete
1062-
# if b[nbytes-1] != '\n' and b[nbytes-1] != '\r':
1063-
# result = b
1064-
# raise ValueError( "incomplete line at %s" % result )
1065-
1066-
# # make sure that this goes fully through C
1067-
# # otherwise buffer is copied to/from a
1068-
# # Python object causing segfaults as
1069-
# # the wrong memory is freed
1070-
# return self.parser.parse( b, nbytes )
1071-
1072-
# raise StopIteration
1073-
1074-
# def __dealloc__(self):
1075-
# free(self.buffer)
1076-
1077-
# def __next__(self):
1078-
# return self.__cnext__()
10791015

10801016
#########################################################
10811017
#########################################################

pysam/pysam_util.c

Lines changed: 0 additions & 36 deletions
This file was deleted.

pysam/pysam_util.h

Lines changed: 0 additions & 5 deletions
This file was deleted.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ def prebuild_libcsamtools(ext, force):
630630
extra_objects=separate_htslib_objects,
631631
libraries=external_htslib_libraries + internal_htslib_libraries),
632632
dict(name="pysam.libcutils",
633-
sources=[source_pattern % "utils", "pysam/pysam_util.c"] + os_c_files,
633+
sources=[source_pattern % "utils"] + os_c_files,
634634
extra_objects=separate_htslib_objects,
635635
libraries=external_htslib_libraries + internal_htslib_libraries + internal_samtools_libraries),
636636
dict(name="pysam.libcalignmentfile",

0 commit comments

Comments
 (0)