Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put hts_ prefix in front of various klib functions #881

Closed
wants to merge 4 commits into from

Conversation

daviesrob
Copy link
Member

Put hts_ prefix in front of various klib functions and add wrappers to preserve the existing API. This is so we don't get clashes with the Attarctive Chaos versions of these functions, in case anyone links against both.

Fixes #693 (Duplicate symbols with libbwa)

N.B. Breaks ABI, so TWO_TO_THREE_TRANSITION_COUNT needs to be incremented on merge (which should not be done as a fast-forward).

Prevent clashes with other libraries that use the Attactive Chaos
version of kstring.h by putting an hts_ prefix in front of all
the external symbols.  The API is preserved by adding static
inline wrappers around the renamed symbols.

Relatively trivial functions ksprintf(), kstrstr() and kstrnstr()
are moved into the header file.

Fixes samtools#693 (Duplicate symbols with libbwa)
Pattern is limited to size INT_MAX.

Fix memory leak found by tests.
Prevent clashes with other libraries that use the Attactive Chaos
version of kfunc.h by putting an hts_ prefix in front of all
the external symbols.  The API is preserved by adding static
inline wrappers around the renamed symbols.

Changes a few leading underscores to trailing ones.
Also makes all functions in knetfile.c that are not included in
the knetfile.h header static as they are not part of the public
api.
@jmarshall
Copy link
Member

IMHO this complexity is a mistake. HTSlib is the 800-pound gorilla here.

#693 could be very easily worked around in bwa, as suggested in #693 (comment).

People using the Attractive Chaos versions of gamma functions etc who add HTSlib usage to their project can be expected to use the HTSlib-supplied versions of such functions and remove their own copied-in klib headers.

And rather than contemplate such changes in knetfile.[ch], perhaps it is time to remove them from HTSlib (as services are said to be moving to HTTPS, which knetfile does not support, and knetfile has long been superseded by hfile_libcurl in HTSlib).

@daviesrob daviesrob closed this Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate symbols with libbwa
2 participants