{"action":"created","issue":{"url":"https://api.github.com/repos/samtools/htslib/issues/788","repository_url":"https://api.github.com/repos/samtools/htslib","labels_url":"https://api.github.com/repos/samtools/htslib/issues/788/labels{/name}","comments_url":"https://api.github.com/repos/samtools/htslib/issues/788/comments","events_url":"https://api.github.com/repos/samtools/htslib/issues/788/events","html_url":"https://github.com/samtools/htslib/pull/788","id":375493751,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2OTI1MDE0","number":788,"title":"New filename extension modification API function in htslib/hfile.h ","user":{"login":"jmarshall","id":70921,"node_id":"MDQ6VXNlcjcwOTIx","avatar_url":"https://avatars3.githubusercontent.com/u/70921?v=4","gravatar_id":"","url":"https://api.github.com/users/jmarshall","html_url":"https://github.com/jmarshall","followers_url":"https://api.github.com/users/jmarshall/followers","following_url":"https://api.github.com/users/jmarshall/following{/other_user}","gists_url":"https://api.github.com/users/jmarshall/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarshall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarshall/subscriptions","organizations_url":"https://api.github.com/users/jmarshall/orgs","repos_url":"https://api.github.com/users/jmarshall/repos","events_url":"https://api.github.com/users/jmarshall/events{/privacy}","received_events_url":"https://api.github.com/users/jmarshall/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-30T13:39:07Z","updated_at":"2018-11-01T10:05:16Z","closed_at":"2018-11-01T10:05:16Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/samtools/htslib/pulls/788","html_url":"https://github.com/samtools/htslib/pull/788","diff_url":"https://github.com/samtools/htslib/pull/788.diff","patch_url":"https://github.com/samtools/htslib/pull/788.patch"},"body":"As noted in #784, HTSlib would benefit from an URL-aware function to add/replace filename extensions.\r\n\r\n`hisremote()` is precedent for _hfile.h_ functions not directly associated with I/O, and similarly `haddextension()` can reuse the same URL-detection infrastructure — so _hfile.c_ is a good place for it. So here is a suggested API.\r\n\r\nI previously tried to keep `kstring_t` out of _hfile.h_ :smile:, but with the first commit enabling better forward `struct kstring_t` declarations it's less invasive.\r\n\r\nThis will misrecognise filenames like `foo:bar?baz` as URLs, but there's not much that can be done about it (the library doesn't know which if any file should exist, so `access(2)` doesn't help), such filenames deserve what they get, and `./foo:bar?baz` is a workaround to ensure it's recognised as a file path."},"comment":{"url":"https://api.github.com/repos/samtools/htslib/issues/comments/434992894","html_url":"https://github.com/samtools/htslib/pull/788#issuecomment-434992894","issue_url":"https://api.github.com/repos/samtools/htslib/issues/788","id":434992894,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDk5Mjg5NA==","user":{"login":"jkbonfield","id":2210525,"node_id":"MDQ6VXNlcjIyMTA1MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/2210525?v=4","gravatar_id":"","url":"https://api.github.com/users/jkbonfield","html_url":"https://github.com/jkbonfield","followers_url":"https://api.github.com/users/jkbonfield/followers","following_url":"https://api.github.com/users/jkbonfield/following{/other_user}","gists_url":"https://api.github.com/users/jkbonfield/gists{/gist_id}","starred_url":"https://api.github.com/users/jkbonfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkbonfield/subscriptions","organizations_url":"https://api.github.com/users/jkbonfield/orgs","repos_url":"https://api.github.com/users/jkbonfield/repos","events_url":"https://api.github.com/users/jkbonfield/events{/privacy}","received_events_url":"https://api.github.com/users/jkbonfield/received_events","type":"User","site_admin":false},"created_at":"2018-11-01T10:05:16Z","updated_at":"2018-11-01T10:05:16Z","author_association":"CONTRIBUTOR","body":"Thanks.  Rebased and merged as c852a3fea3ab143d61d4e5b818c50ea6cc189edc.\r\n\r\nI'll look at fixing #784 now."}}
{"actor":{"display_login":"jkbonfield"}}