https://github.com/pysam-developers/pysam
Tip revision: 9218de6bb523f43667520fde740067124c48745f authored by Andreas Heger on 09 April 2023, 21:52:23 UTC
move release to tag section
move release to tag section
Tip revision: 9218de6
pysam_util.c
#include <ctype.h>
#include <assert.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "htslib/khash.h"
#include "htslib/ksort.h"
#include "htslib/knetfile.h"
#if !(_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700)
/*
* A rudimentary emulation of getline() for systems that dont support it
* natively. Since this is used for PPD file reading, it assumes (possibly
* falsely) that BUFSIZ is big enough.
*/
ssize_t
getline(char **line, size_t *linelen, FILE *fp)
{
if (*linelen == 0)
{
*linelen = BUFSIZ;
*line = malloc(*linelen);
}
memset(*line, 0, *linelen);
fgets(*line, *linelen, fp);
return (strlen(*line));
}
#endif