#ifndef bcftools_PYSAM_H
#define bcftools_PYSAM_H

#include <stdio.h>

#ifndef __has_attribute
#define __has_attribute(attribute) 0
#endif
#ifndef PYSAM_NORETURN
#if __has_attribute(__noreturn__) || __GNUC__ >= 3
#define PYSAM_NORETURN __attribute__((__noreturn__))
#else
#define PYSAM_NORETURN
#endif
#endif

extern FILE * bcftools_stderr;

extern FILE * bcftools_stdout;

extern const char * bcftools_stdout_fn;

/*! set pysam standard error to point to file descriptor

  Setting the stderr will close the previous stderr.
 */
FILE * bcftools_set_stderr(int fd);

/*! set pysam standard output to point to file descriptor

  Setting the stdout will close the previous stdout.
 */
FILE * bcftools_set_stdout(int fd);

/*! set pysam standard output to point to filename

 */
void bcftools_set_stdout_fn(const char * fn);

/*! close pysam standard error and set to NULL
  
 */
void bcftools_close_stderr(void);

/*! close pysam standard output and set to NULL
  
 */
void bcftools_close_stdout(void);

int bcftools_puts(const char *s);

int bcftools_dispatch(int argc, char *argv[]);

void PYSAM_NORETURN bcftools_exit(int status);

void bcftools_set_optind(int);

extern int bcftools_main(int argc, char *argv[]);
  
#define bam_smpl_destroy bcftools_bam_smpl_destroy
#define bam_smpl_init bcftools_bam_smpl_init
#define bcf_call2bcf bcftools_bcf_call2bcf
#define bcf_callaux_clean bcftools_bcf_callaux_clean
#define bcf_call_combine bcftools_bcf_call_combine
#define bcf_call_destroy bcftools_bcf_call_destroy
#define bcf_call_gap_prep bcftools_bcf_call_gap_prep
#define bcf_call_glfgen bcftools_bcf_call_glfgen
#define bcf_call_init bcftools_bcf_call_init
#define parse_format_flag bcftools_parse_format_flag
#define read_file_list bcftools_read_file_list

#endif
