| 49 | } |
| 50 | |
| 51 | static int cicada_get_line(AVIOContext *s, char *buf, int maxlen) |
| 52 | { |
| 53 | int i = 0; |
| 54 | char c; |
| 55 | |
| 56 | do { |
| 57 | c = (char) avio_r8(s); |
| 58 | |
| 59 | if (c && i < maxlen - 1) { |
| 60 | buf[i++] = c; |
| 61 | } |
| 62 | } while (c != '\n' && c != '\r' && c); |
| 63 | |
| 64 | if (c == '\r' && avio_r8(s) != '\n' && !avio_feof(s)) { |
| 65 | avio_skip(s, -1); |
| 66 | } |
| 67 | |
| 68 | buf[i] = 0; |
| 69 | return i; |
| 70 | } |
| 71 | |
| 72 | int dataSourceIO::get_line(char *buf, int maxlen) |
| 73 | { |