| 1 |
#include <ctype.h> |
| 2 |
#include <assert.h> |
| 3 |
#include <unistd.h> |
| 4 |
#include <stdio.h> |
| 5 |
#include <stdlib.h> |
| 6 |
#include <string.h> |
| 7 |
|
| 8 |
#include "htslib/khash.h" |
| 9 |
#include "htslib/ksort.h" |
| 10 |
#include "htslib/knetfile.h" |
| 11 |
|
| 12 |
#if !(_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700) |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
ssize_t |
| 19 |
getline(char **line, size_t *linelen, FILE *fp) |
| 20 |
{ |
| 21 |
if (*linelen == 0) |
| 22 |
{ |
| 23 |
*linelen = BUFSIZ; |
| 24 |
*line = malloc(*linelen); |
| 25 |
} |
| 26 |
|
| 27 |
memset(*line, 0, *linelen); |
| 28 |
fgets(*line, *linelen, fp); |
| 29 |
|
| 30 |
return (strlen(*line)); |
| 31 |
|
| 32 |
} |
| 33 |
#endif |
| 34 |
|
| 35 |
|
| 36 |
|