mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-24 00:18:39 +00:00
[csv iterate] peek-reader iterate
This commit is contained in:
parent
36ca7ccf2a
commit
aeac9f97fa
2 changed files with 51 additions and 0 deletions
31
c/input/peek_file_reader.c
Normal file
31
c/input/peek_file_reader.c
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#include "lib/mlrutil.h"
|
||||
#include "peek_file_reader.h"
|
||||
|
||||
// typedef struct _peek_file_reader_t {
|
||||
// FILE* fp;
|
||||
// int peekbuflen;
|
||||
// char* peekbuf;
|
||||
// int npeeked;
|
||||
// } peek_file_reader_t;
|
||||
|
||||
int pfr_at_eof(peek_file_reader_t* pfr) {
|
||||
return TRUE; // xxx stub
|
||||
}
|
||||
|
||||
int pfr_next_is(peek_file_reader_t* pfr, char* string, int len) {
|
||||
return FALSE; // xxx stub
|
||||
}
|
||||
|
||||
char pfr_read_char(peek_file_reader_t* pfr) {
|
||||
// xxx stub
|
||||
return 'x';
|
||||
}
|
||||
|
||||
void pfr_advance_past(peek_file_reader_t* pfr, char* string) {
|
||||
// xxx stub
|
||||
}
|
||||
|
||||
void pfr_close(peek_file_reader_t* pfr) {
|
||||
fclose(pfr->fp);
|
||||
pfr->fp = NULL;
|
||||
}
|
||||
20
c/input/peek_file_reader.h
Normal file
20
c/input/peek_file_reader.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef PEEK_FILE_READER_H
|
||||
#define PEEK_FILE_READER_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct _peek_file_reader_t {
|
||||
FILE* fp;
|
||||
int peekbuflen;
|
||||
char* peekbuf;
|
||||
int npeeked;
|
||||
} peek_file_reader_t;
|
||||
|
||||
// xxx needing contextual comments here.
|
||||
int pfr_at_eof(peek_file_reader_t* pfr);
|
||||
int pfr_next_is(peek_file_reader_t* pfr, char* string, int len);
|
||||
char pfr_read_char(peek_file_reader_t* pfr);
|
||||
void pfr_advance_past(peek_file_reader_t* pfr, char* string);
|
||||
void pfr_close(peek_file_reader_t* pfr);
|
||||
|
||||
#endif // PEEK_FILE_READER_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue