htslib.hfile

@file htslib/hfile.h Buffered low-level input/output streams.

Members

Aliases

off_t
alias off_t = size_t
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
ssize_t
alias ssize_t = size_t
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Functions

haddextension
char* haddextension(kstring_t* buffer, const(char)* filename, int replace, const(char)* extension)

@param buffer The kstring to be used to store the modified filename @param filename The filename to be (copied and) adjusted @param replace If non-zero, one extension (if any) is removed first @param extension The extension to be added (e.g. ".csi") @return The modified filename (i.e., buffer.s), or NULL on error. @since 1.10

hclearerr
void hclearerr(hFILE* fp)

Clear the stream's error indicator

hclose
int hclose(hFILE* fp)

@return 0 if successful, or EOF (with _errno_ set) if an error occurred.

hclose_abruptly
void hclose_abruptly(hFILE* fp)

For use while cleaning up after an error only. Preserves _errno_.

hdopen
hFILE* hdopen(int fd, const(char)* mode)

@return An hFILE pointer, or NULL (with _errno_ set) if an error occurred.

herrno
int herrno(hFILE* fp)

@return Non-zero (in fact, an _errno_ value) if an error has occurred.

hfile_has_plugin
int hfile_has_plugin(const(char)* name)

Tests for the presence of a specific hFILE plugin.

hfile_list_plugins
int hfile_list_plugins(const(char)** plist, int* nplugins)

Fills out plist[] with the list of known hFILE plugins.

hfile_list_schemes
int hfile_list_schemes(const(char)* plugin, const(char)** sc_list, int* nschemes)

@param plugin in Restricts schemes to only those from 'plugin. @param sc_list out Filled out with the scheme names @param nschemes [in/out] Size of sc_list (in) and number returned (out)

hfile_mem_get_buffer
char* hfile_mem_get_buffer(hFILE* file, size_t* length)

@return buffer if successful, or NULL if an error occurred

hfile_mem_steal_buffer
char* hfile_mem_steal_buffer(hFILE* file, size_t* length)

@return buffer if successful, or NULL if an error occurred

hfile_set_blksize
int hfile_set_blksize(hFILE* fp, size_t bufsiz)

set hfile blocksize

hflush
int hflush(hFILE* fp)

@return 0 if successful, or EOF if an error occurred.

hgetc
int hgetc(hFILE* fp)

@return The character read, or EOF on end-of-file or error.

hgetc2
int hgetc2(hFILE* )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
hgetdelim
ssize_t hgetdelim(char* buffer, size_t size, int delim, hFILE* fp)

@param buffer The buffer into which bytes will be written @param size The size of the buffer @param delim The delimiter (interpreted as an unsigned char) @param fp The file stream @return The number of bytes read, or negative on error. @since 1.4

hgetln
ssize_t hgetln(char* buffer, size_t size, hFILE* fp)

@param buffer The buffer into which bytes will be written @param size The size of the buffer @param fp The file stream @return The number of bytes read, or negative on error. @since 1.4

hgets
char* hgets(char* buffer, int size, hFILE* fp)

@param buffer The buffer into which bytes will be written @param size The size of the buffer (must be > 1 to be useful) @param fp The file stream @return _buffer_ on success, or NULL if an error occurred. @since 1.4

hisremote
int hisremote(const(char)* filename)

@return 0 if local, 1 if remote.

hopen
hFILE* hopen(const(char)* filename, const(char)* mode, ...)

@return An hFILE pointer, or NULL (with _errno_ set) if an error occurred.

hpeek
ssize_t hpeek(hFILE* fp, void* buffer, size_t nbytes)

@param fp The file stream @param buffer The buffer to which the peeked bytes will be written @param nbytes The number of bytes to peek at; limited by the size of the internal buffer, which could be as small as 4K. @return The number of bytes peeked, which may be less than _nbytes_ if EOF is encountered; or negative, if there was an I/O error.

hputc
int hputc(int c, hFILE* fp)
hputc2
int hputc2(int , hFILE* )

@return The character written, or EOF if an error occurred.

hputs
int hputs(const(char)* text, hFILE* fp)
hputs2
int hputs2(const(char)* , size_t , size_t , hFILE* )

@return 0 if successful, or EOF if an error occurred.

hread
ssize_t hread(hFILE* fp, void* buffer, size_t nbytes)
hread2
ssize_t hread2(hFILE* , void* , size_t , size_t )

@return The number of bytes read, or negative if an error occurred.

hseek
off_t hseek(hFILE* fp, off_t offset, int whence)

@return The resulting offset within the stream (as per lseek(2)), or negative if an error occurred.

htell
off_t htell(hFILE* fp)

@return The offset within the stream, starting from zero.

hwrite
ssize_t hwrite(hFILE* fp, const(void)* buffer, size_t nbytes)
hwrite2
ssize_t hwrite2(hFILE* , const(void)* , size_t , size_t )

@return Either _nbytes_, or negative if an error occurred.

Structs

hFILE
struct hFILE

The fields of this structure are declared here solely for the benefit of the hFILE-related inline functions. They may change in future releases. User code should not use them directly; you should imagine that hFILE is an opaque incomplete type.

hFILE_backend
struct hFILE_backend

internal

Meta