mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-26 01:15:27 +00:00
renames
This commit is contained in:
parent
034d628053
commit
bdb18d6f21
14 changed files with 91 additions and 111 deletions
|
|
@ -52,7 +52,7 @@ typedef struct _lrec_reader_mmap_csv_state_t {
|
|||
//
|
||||
// etc.
|
||||
|
||||
static lrec_t* lrec_reader_mmap_csv_func(file_reader_mmap_state_t* phandle, void* pvstate, context_t* pctx) {
|
||||
static lrec_t* lrec_reader_mmap_csv_process(file_reader_mmap_state_t* phandle, void* pvstate, context_t* pctx) {
|
||||
return NULL; // xxx stub
|
||||
// lrec_reader_mmap_csv_state_t* pstate = pvstate;
|
||||
//
|
||||
|
|
@ -105,7 +105,7 @@ static lrec_t* lrec_reader_mmap_csv_func(file_reader_mmap_state_t* phandle, void
|
|||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
static void reset_mmap_csv_func(void* pvstate) {
|
||||
static void lrec_reader_mmap_csv_sof(void* pvstate) {
|
||||
lrec_reader_mmap_csv_state_t* pstate = pvstate;
|
||||
pstate->ifnr = 0LL;
|
||||
pstate->ilno = 0LL;
|
||||
|
|
@ -126,11 +126,10 @@ lrec_reader_mmap_t* lrec_reader_mmap_csv_alloc(char irs, char ifs, int allow_rep
|
|||
pstate->expect_header_line_next = TRUE;
|
||||
pstate->phdr_keeper = NULL;
|
||||
pstate->phdr_keepers = lhmslv_alloc();
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
|
||||
// xxx homogenize these names, for all readers & writers
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_mmap_csv_func;
|
||||
plrec_reader_stdio->psof_func = &reset_mmap_csv_func;
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_mmap_csv_process;
|
||||
plrec_reader_stdio->psof_func = &lrec_reader_mmap_csv_sof;
|
||||
|
||||
return plrec_reader_stdio;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ typedef struct _lrec_reader_mmap_dkvp_state_t {
|
|||
} lrec_reader_mmap_dkvp_state_t;
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
static lrec_t* lrec_reader_mmap_dkvp_func(file_reader_mmap_state_t* phandle, void* pvstate, context_t* pctx) {
|
||||
static lrec_t* lrec_reader_mmap_dkvp_process(file_reader_mmap_state_t* phandle, void* pvstate, context_t* pctx) {
|
||||
lrec_reader_mmap_dkvp_state_t* pstate = pvstate;
|
||||
if (phandle->sol >= phandle->eof) // xxx encapsulate a method for this ...
|
||||
return NULL;
|
||||
|
|
@ -22,21 +22,21 @@ static lrec_t* lrec_reader_mmap_dkvp_func(file_reader_mmap_state_t* phandle, voi
|
|||
}
|
||||
|
||||
// No-op for stateless readers such as this one.
|
||||
static void reset_mmap_dkvp_func(void* pvstate) {
|
||||
static void lrec_reader_mmap_dkvp_sof(void* pvstate) {
|
||||
}
|
||||
|
||||
lrec_reader_mmap_t* lrec_reader_mmap_dkvp_alloc(char irs, char ifs, char ips, int allow_repeat_ifs) {
|
||||
lrec_reader_mmap_t* plrec_reader_stdio = mlr_malloc_or_die(sizeof(lrec_reader_mmap_t));
|
||||
|
||||
lrec_reader_mmap_dkvp_state_t* pstate = mlr_malloc_or_die(sizeof(lrec_reader_mmap_dkvp_state_t));
|
||||
pstate->irs = irs;
|
||||
pstate->ifs = ifs;
|
||||
pstate->ips = ips;
|
||||
pstate->irs = irs;
|
||||
pstate->ifs = ifs;
|
||||
pstate->ips = ips;
|
||||
pstate->allow_repeat_ifs = allow_repeat_ifs;
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_mmap_dkvp_func;
|
||||
plrec_reader_stdio->psof_func = &reset_mmap_dkvp_func;
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_mmap_dkvp_process;
|
||||
plrec_reader_stdio->psof_func = &lrec_reader_mmap_dkvp_sof;
|
||||
|
||||
return plrec_reader_stdio;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ typedef struct _lrec_reader_mmap_nidx_state_t {
|
|||
} lrec_reader_mmap_nidx_state_t;
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
static lrec_t* lrec_reader_mmap_nidx_func(file_reader_mmap_state_t* phandle, void* pvstate, context_t* pctx) {
|
||||
static lrec_t* lrec_reader_mmap_nidx_process(file_reader_mmap_state_t* phandle, void* pvstate, context_t* pctx) {
|
||||
lrec_reader_mmap_nidx_state_t* pstate = pvstate;
|
||||
if (phandle->sol >= phandle->eof) // xxx encapsulate a method for this ...
|
||||
return NULL;
|
||||
|
|
@ -20,20 +20,20 @@ static lrec_t* lrec_reader_mmap_nidx_func(file_reader_mmap_state_t* phandle, voi
|
|||
}
|
||||
|
||||
// No-op for stateless readers such as this one.
|
||||
static void reset_nidx_func(void* pvstate) {
|
||||
static void lrec_reader_mmap_nidx_sof(void* pvstate) {
|
||||
}
|
||||
|
||||
lrec_reader_mmap_t* lrec_reader_mmap_nidx_alloc(char irs, char ifs, int allow_repeat_ifs) {
|
||||
lrec_reader_mmap_t* plrec_reader_stdio = mlr_malloc_or_die(sizeof(lrec_reader_mmap_t));
|
||||
|
||||
lrec_reader_mmap_nidx_state_t* pstate = mlr_malloc_or_die(sizeof(lrec_reader_mmap_nidx_state_t));
|
||||
pstate->irs = irs;
|
||||
pstate->ifs = ifs;
|
||||
pstate->allow_repeat_ifs = allow_repeat_ifs;
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
pstate->irs = irs;
|
||||
pstate->ifs = ifs;
|
||||
pstate->allow_repeat_ifs = allow_repeat_ifs;
|
||||
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_mmap_nidx_func;
|
||||
plrec_reader_stdio->psof_func = &reset_nidx_func;
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_mmap_nidx_process;
|
||||
plrec_reader_stdio->psof_func = &lrec_reader_mmap_nidx_sof;
|
||||
|
||||
return plrec_reader_stdio;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ typedef struct _lrec_reader_mmap_xtab_state_t {
|
|||
} lrec_reader_mmap_xtab_state_t;
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
static lrec_t* lrec_reader_mmap_xtab_func(file_reader_mmap_state_t* phandle, void* pvstate, context_t* pctx) {
|
||||
static lrec_t* lrec_reader_mmap_xtab_process(file_reader_mmap_state_t* phandle, void* pvstate, context_t* pctx) {
|
||||
lrec_reader_mmap_xtab_state_t* pstate = pvstate;
|
||||
|
||||
if (pstate->at_eof)
|
||||
|
|
@ -24,7 +24,7 @@ static lrec_t* lrec_reader_mmap_xtab_func(file_reader_mmap_state_t* phandle, voi
|
|||
}
|
||||
|
||||
// xxx rename resets to sof_reset or some such
|
||||
static void reset_xtab_func(void* pvstate) {
|
||||
static void lrec_reader_mmap_xtab_sof(void* pvstate) {
|
||||
lrec_reader_mmap_xtab_state_t* pstate = pvstate;
|
||||
pstate->at_eof = FALSE;
|
||||
}
|
||||
|
|
@ -35,14 +35,14 @@ lrec_reader_mmap_t* lrec_reader_mmap_xtab_alloc(char irs, char ips, int allow_re
|
|||
lrec_reader_mmap_xtab_state_t* pstate = mlr_malloc_or_die(sizeof(lrec_reader_mmap_xtab_state_t));
|
||||
//pstate->ips = ips;
|
||||
//pstate->allow_repeat_ips = allow_repeat_ips;
|
||||
pstate->irs = irs;
|
||||
pstate->ips = ' ';
|
||||
pstate->allow_repeat_ips = TRUE;
|
||||
pstate->at_eof = FALSE;
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
pstate->irs = irs;
|
||||
pstate->ips = ' ';
|
||||
pstate->allow_repeat_ips = TRUE;
|
||||
pstate->at_eof = FALSE;
|
||||
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_mmap_xtab_func;
|
||||
plrec_reader_stdio->psof_func = &reset_xtab_func;
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_mmap_xtab_process;
|
||||
plrec_reader_stdio->psof_func = &lrec_reader_mmap_xtab_sof;
|
||||
|
||||
return plrec_reader_stdio;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ typedef struct _lrec_reader_stdio_csv_state_t {
|
|||
//
|
||||
// etc.
|
||||
|
||||
static lrec_t* lrec_reader_stdio_csv_func(FILE* input_stream, void* pvstate, context_t* pctx) {
|
||||
static lrec_t* lrec_reader_stdio_csv_process(FILE* input_stream, void* pvstate, context_t* pctx) {
|
||||
lrec_reader_stdio_csv_state_t* pstate = pvstate;
|
||||
|
||||
while (TRUE) {
|
||||
|
|
@ -105,7 +105,7 @@ static lrec_t* lrec_reader_stdio_csv_func(FILE* input_stream, void* pvstate, con
|
|||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
static void reset_csv_func(void* pvstate) {
|
||||
static void lrec_reader_stdio_sof(void* pvstate) {
|
||||
lrec_reader_stdio_csv_state_t* pstate = pvstate;
|
||||
pstate->ifnr = 0LL;
|
||||
pstate->ilno = 0LL;
|
||||
|
|
@ -133,12 +133,11 @@ lrec_reader_stdio_t* lrec_reader_stdio_csv_alloc(char irs, char ifs, int allow_r
|
|||
pstate->expect_header_line_next = TRUE;
|
||||
pstate->phdr_keeper = NULL;
|
||||
pstate->phdr_keepers = lhmslv_alloc();
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
|
||||
// xxx homogenize these names, for all readers & writers
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_stdio_csv_func;
|
||||
plrec_reader_stdio->psof_func = &reset_csv_func;
|
||||
plrec_reader_stdio->pfree_func = &lrec_reader_stdio_csv_free;
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_stdio_csv_process;
|
||||
plrec_reader_stdio->psof_func = &lrec_reader_stdio_sof;
|
||||
plrec_reader_stdio->pfree_func = &lrec_reader_stdio_csv_free;
|
||||
|
||||
return plrec_reader_stdio;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ typedef struct _lrec_reader_stdio_dkvp_state_t {
|
|||
} lrec_reader_stdio_dkvp_state_t;
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
static lrec_t* lrec_reader_stdio_dkvp_func(FILE* input_stream, void* pvstate, context_t* pctx) {
|
||||
static lrec_t* lrec_reader_stdio_dkvp_process(FILE* input_stream, void* pvstate, context_t* pctx) {
|
||||
lrec_reader_stdio_dkvp_state_t* pstate = pvstate;
|
||||
|
||||
char* line = mlr_get_line(input_stream, pstate->irs);
|
||||
|
|
@ -24,7 +24,7 @@ static lrec_t* lrec_reader_stdio_dkvp_func(FILE* input_stream, void* pvstate, co
|
|||
}
|
||||
|
||||
// No-op for stateless readers such as this one.
|
||||
static void reset_dkvp_func(void* pvstate) {
|
||||
static void lrec_reader_csv_sof(void* pvstate) {
|
||||
}
|
||||
|
||||
// No-op for stateless readers such as this one.
|
||||
|
|
@ -35,15 +35,15 @@ lrec_reader_stdio_t* lrec_reader_stdio_dkvp_alloc(char irs, char ifs, char ips,
|
|||
lrec_reader_stdio_t* plrec_reader_stdio = mlr_malloc_or_die(sizeof(lrec_reader_stdio_t));
|
||||
|
||||
lrec_reader_stdio_dkvp_state_t* pstate = mlr_malloc_or_die(sizeof(lrec_reader_stdio_dkvp_state_t));
|
||||
pstate->irs = irs;
|
||||
pstate->ifs = ifs;
|
||||
pstate->ips = ips;
|
||||
pstate->irs = irs;
|
||||
pstate->ifs = ifs;
|
||||
pstate->ips = ips;
|
||||
pstate->allow_repeat_ifs = allow_repeat_ifs;
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_stdio_dkvp_func;
|
||||
plrec_reader_stdio->psof_func = &reset_dkvp_func;
|
||||
plrec_reader_stdio->pfree_func = &lrec_reader_stdio_dkvp_free;;
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_stdio_dkvp_process;
|
||||
plrec_reader_stdio->psof_func = &lrec_reader_csv_sof;
|
||||
plrec_reader_stdio->pfree_func = &lrec_reader_stdio_dkvp_free;
|
||||
|
||||
return plrec_reader_stdio;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ typedef struct _lrec_reader_stdio_nidx_state_t {
|
|||
} lrec_reader_stdio_nidx_state_t;
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
static lrec_t* lrec_reader_stdio_nidx_func(FILE* input_stream, void* pvstate, context_t* pctx) {
|
||||
static lrec_t* lrec_reader_stdio_nidx_process(FILE* input_stream, void* pvstate, context_t* pctx) {
|
||||
lrec_reader_stdio_nidx_state_t* pstate = pvstate;
|
||||
char* line = mlr_get_line(input_stream, pstate->irs);
|
||||
if (line == NULL)
|
||||
|
|
@ -20,24 +20,24 @@ static lrec_t* lrec_reader_stdio_nidx_func(FILE* input_stream, void* pvstate, co
|
|||
}
|
||||
|
||||
// No-op for stateless readers such as this one.
|
||||
static void reset_nidx_func(void* pvstate) {
|
||||
static void lrec_reader_stdio_nidx_sof(void* pvstate) {
|
||||
}
|
||||
|
||||
static void lrec_reader_stdio_nidx_free_func(void* pvstate) {
|
||||
static void lrec_reader_stdio_nidx_free(void* pvstate) {
|
||||
}
|
||||
|
||||
lrec_reader_stdio_t* lrec_reader_stdio_nidx_alloc(char irs, char ifs, int allow_repeat_ifs) {
|
||||
lrec_reader_stdio_t* plrec_reader_stdio = mlr_malloc_or_die(sizeof(lrec_reader_stdio_t));
|
||||
|
||||
lrec_reader_stdio_nidx_state_t* pstate = mlr_malloc_or_die(sizeof(lrec_reader_stdio_nidx_state_t));
|
||||
pstate->irs = irs;
|
||||
pstate->ifs = ifs;
|
||||
pstate->allow_repeat_ifs = allow_repeat_ifs;
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
pstate->irs = irs;
|
||||
pstate->ifs = ifs;
|
||||
pstate->allow_repeat_ifs = allow_repeat_ifs;
|
||||
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_stdio_nidx_func;
|
||||
plrec_reader_stdio->psof_func = &reset_nidx_func;
|
||||
plrec_reader_stdio->pfree_func = &lrec_reader_stdio_nidx_free_func;
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_stdio_nidx_process;
|
||||
plrec_reader_stdio->psof_func = &lrec_reader_stdio_nidx_sof;
|
||||
plrec_reader_stdio->pfree_func = &lrec_reader_stdio_nidx_free;
|
||||
|
||||
return plrec_reader_stdio;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ typedef struct _lrec_reader_stdio_xtab_state_t {
|
|||
} lrec_reader_stdio_xtab_state_t;
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
static lrec_t* lrec_reader_stdio_xtab_func(FILE* input_stream, void* pvstate, context_t* pctx) {
|
||||
static lrec_t* lrec_reader_stdio_xtab_process(FILE* input_stream, void* pvstate, context_t* pctx) {
|
||||
lrec_reader_stdio_xtab_state_t* pstate = pvstate;
|
||||
|
||||
if (pstate->at_eof)
|
||||
|
|
@ -41,8 +41,7 @@ static lrec_t* lrec_reader_stdio_xtab_func(FILE* input_stream, void* pvstate, co
|
|||
}
|
||||
}
|
||||
|
||||
// xxx rename resets to sof_reset or some such
|
||||
static void reset_xtab_func(void* pvstate) {
|
||||
static void lrec_reader_stdio_xtab_sof(void* pvstate) {
|
||||
lrec_reader_stdio_xtab_state_t* pstate = pvstate;
|
||||
pstate->at_eof = FALSE;
|
||||
}
|
||||
|
|
@ -59,11 +58,11 @@ lrec_reader_stdio_t* lrec_reader_stdio_xtab_alloc(char ips, int allow_repeat_ips
|
|||
pstate->ips = ' ';
|
||||
pstate->allow_repeat_ips = TRUE;
|
||||
pstate->at_eof = FALSE;
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_stdio_xtab_func;
|
||||
plrec_reader_stdio->psof_func = &reset_xtab_func;
|
||||
plrec_reader_stdio->pfree_func = &lrec_reader_stdio_xtab_free;;
|
||||
plrec_reader_stdio->pvstate = (void*)pstate;
|
||||
plrec_reader_stdio->pprocess_func = &lrec_reader_stdio_xtab_process;
|
||||
plrec_reader_stdio->psof_func = &lrec_reader_stdio_xtab_sof;
|
||||
plrec_reader_stdio->pfree_func = &lrec_reader_stdio_xtab_free;
|
||||
|
||||
return plrec_reader_stdio;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ typedef struct _lrec_writer_csv_state_t {
|
|||
// ----------------------------------------------------------------
|
||||
// xxx cmt mem-mgmt
|
||||
|
||||
static void lrec_writer_csv_func(FILE* output_stream, lrec_t* prec, void* pvstate) {
|
||||
static void lrec_writer_csv_process(FILE* output_stream, lrec_t* prec, void* pvstate) {
|
||||
if (prec == NULL)
|
||||
return;
|
||||
lrec_writer_csv_state_t* pstate = pvstate;
|
||||
|
|
@ -76,10 +76,10 @@ lrec_writer_t* lrec_writer_csv_alloc(char ors, char ofs) {
|
|||
pstate->ofs = ofs;
|
||||
pstate->num_header_lines_output = 0LL;
|
||||
pstate->plast_header_output = NULL;
|
||||
plrec_writer->pvstate = (void*)pstate;
|
||||
|
||||
plrec_writer->pprocess_func = lrec_writer_csv_func;
|
||||
plrec_writer->pfree_func = lrec_writer_csv_free;
|
||||
plrec_writer->pvstate = (void*)pstate;
|
||||
plrec_writer->pprocess_func = lrec_writer_csv_process;
|
||||
plrec_writer->pfree_func = lrec_writer_csv_free;
|
||||
|
||||
return plrec_writer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ typedef struct _lrec_writer_dkvp_state_t {
|
|||
} lrec_writer_dkvp_state_t;
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
static void lrec_writer_dkvp_func(FILE* output_stream, lrec_t* prec, void* pvstate) {
|
||||
static void lrec_writer_dkvp_process(FILE* output_stream, lrec_t* prec, void* pvstate) {
|
||||
if (prec == NULL)
|
||||
return;
|
||||
lrec_writer_dkvp_state_t* pstate = pvstate;
|
||||
|
|
@ -40,10 +40,10 @@ lrec_writer_t* lrec_writer_dkvp_alloc(char rs, char fs, char ps) {
|
|||
pstate->rs = rs;
|
||||
pstate->fs = fs;
|
||||
pstate->ps = ps;
|
||||
plrec_writer->pvstate = (void*)pstate;
|
||||
|
||||
plrec_writer->pprocess_func = &lrec_writer_dkvp_func;
|
||||
plrec_writer->pfree_func = &lrec_writer_dkvp_free;
|
||||
plrec_writer->pvstate = (void*)pstate;
|
||||
plrec_writer->pprocess_func = &lrec_writer_dkvp_process;
|
||||
plrec_writer->pfree_func = &lrec_writer_dkvp_free;
|
||||
|
||||
return plrec_writer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ typedef struct _lrec_writer_nidx_state_t {
|
|||
} lrec_writer_nidx_state_t;
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
static void lrec_writer_nidx_func(FILE* output_stream, lrec_t* prec, void* pvstate) {
|
||||
static void lrec_writer_nidx_process(FILE* output_stream, lrec_t* prec, void* pvstate) {
|
||||
if (prec == NULL)
|
||||
return;
|
||||
lrec_writer_nidx_state_t* pstate = pvstate;
|
||||
|
|
@ -35,10 +35,10 @@ lrec_writer_t* lrec_writer_nidx_alloc(char rs, char fs) {
|
|||
lrec_writer_nidx_state_t* pstate = mlr_malloc_or_die(sizeof(lrec_writer_nidx_state_t));
|
||||
pstate->rs = rs;
|
||||
pstate->fs = fs;
|
||||
plrec_writer->pvstate = (void*)pstate;
|
||||
|
||||
plrec_writer->pprocess_func = &lrec_writer_nidx_func;
|
||||
plrec_writer->pfree_func = &lrec_writer_nidx_free;
|
||||
plrec_writer->pvstate = (void*)pstate;
|
||||
plrec_writer->pprocess_func = &lrec_writer_nidx_process;
|
||||
plrec_writer->pfree_func = &lrec_writer_nidx_free;
|
||||
|
||||
return plrec_writer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ typedef struct _lrec_writer_pprint_state_t {
|
|||
static void print_and_free_record_list(sllv_t* precords, FILE* output_stream, int left_align);
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
static void lrec_writer_pprint_func(FILE* output_stream, lrec_t* prec, void* pvstate) {
|
||||
static void lrec_writer_pprint_process(FILE* output_stream, lrec_t* prec, void* pvstate) {
|
||||
lrec_writer_pprint_state_t* pstate = pvstate;
|
||||
|
||||
int drain = FALSE;
|
||||
|
|
@ -140,10 +140,10 @@ lrec_writer_t* lrec_writer_pprint_alloc(int left_align) {
|
|||
pstate->pprev_keys = NULL;
|
||||
pstate->left_align = left_align;
|
||||
pstate->num_blocks_written = 0LL;
|
||||
plrec_writer->pvstate = pstate;
|
||||
|
||||
plrec_writer->pprocess_func = &lrec_writer_pprint_func;
|
||||
plrec_writer->pfree_func = &lrec_writer_pprint_free;
|
||||
plrec_writer->pvstate = pstate;
|
||||
plrec_writer->pprocess_func = &lrec_writer_pprint_process;
|
||||
plrec_writer->pfree_func = &lrec_writer_pprint_free;
|
||||
|
||||
return plrec_writer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ typedef struct _lrec_writer_xtab_state_t {
|
|||
} lrec_writer_xtab_state_t;
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
static void lrec_writer_xtab_func(FILE* output_stream, lrec_t* prec, void* pvstate) {
|
||||
static void lrec_writer_xtab_process(FILE* output_stream, lrec_t* prec, void* pvstate) {
|
||||
if (prec == NULL)
|
||||
return;
|
||||
lrec_writer_xtab_state_t* pstate = pvstate;
|
||||
|
|
@ -37,10 +37,10 @@ lrec_writer_t* lrec_writer_xtab_alloc() {
|
|||
|
||||
lrec_writer_xtab_state_t* pstate = mlr_malloc_or_die(sizeof(lrec_writer_xtab_state_t));
|
||||
pstate->record_count = 0LL;
|
||||
plrec_writer->pvstate = pstate;
|
||||
|
||||
plrec_writer->pprocess_func = &lrec_writer_xtab_func;
|
||||
plrec_writer->pfree_func = &lrec_writer_xtab_free;
|
||||
plrec_writer->pvstate = pstate;
|
||||
plrec_writer->pprocess_func = &lrec_writer_xtab_process;
|
||||
plrec_writer->pfree_func = &lrec_writer_xtab_free;
|
||||
|
||||
return plrec_writer;
|
||||
}
|
||||
|
|
|
|||
37
c/ren.txt
37
c/ren.txt
|
|
@ -1,39 +1,22 @@
|
|||
* \s+= alignment ... :/
|
||||
* also look for mapper funcs ...
|
||||
* search for "xxx rename"
|
||||
* pvstate paragraphing
|
||||
----------------------------------------------------------------
|
||||
rid of "_func" suffixes for non typedefs/ptrs
|
||||
readers
|
||||
writers
|
||||
mappers
|
||||
|
||||
lrec_reader_stdio_func_t
|
||||
plrec_reader_stdio_func
|
||||
lrec_reader_stdio_csv_func
|
||||
lrec_reader_stdio_dkvp_func
|
||||
lrec_reader_stdio_nidx_func
|
||||
lrec_reader_stdio_xtab_func
|
||||
mmap.*stdio & v.v. ???
|
||||
|
||||
lrec_reader_mmap_func_t
|
||||
lrec_reader_mmap_csv_func
|
||||
lrec_reader_mmap_dkvp_func
|
||||
lrec_reader_mmap_nidx_func
|
||||
lrec_reader_mmap_xtab_func
|
||||
|
||||
lrec_writer_func_t
|
||||
lrec_writer_csv_func
|
||||
lrec_writer_dkvp_func
|
||||
lrec_writer_nidx_func
|
||||
lrec_writer_pprint_func
|
||||
lrec_writer_xtab_func
|
||||
|
||||
--> also rename to include stdio
|
||||
--> also rename to include sof
|
||||
reset_func_t
|
||||
reset_csv_func
|
||||
reset_csv_mmap_func
|
||||
reset_dkvp_func
|
||||
reset_dkvp_mmap_func
|
||||
reset_nidx_func
|
||||
reset_xtab_func
|
||||
|
||||
_reset_mmap > _mmap_reset ...
|
||||
and double-checks for reset funcs
|
||||
and double-checks for all funcs
|
||||
|
||||
free without free func?
|
||||
|
||||
----------------------------------------------------------------
|
||||
xxx file renames too!!!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue