diff --git a/c/mapping/lrec_evaluators.c b/c/mapping/lrec_evaluators.c index c752af1b4..cd05cd2ea 100644 --- a/c/mapping/lrec_evaluators.c +++ b/c/mapping/lrec_evaluators.c @@ -518,6 +518,7 @@ lrec_evaluator_t* lrec_evaluator_alloc_from_unary_func_name(char* function_name, } else if (streq(function_name, "toupper")) { return lrec_evaluator_alloc_from_s_s_func(s_s_toupper_func, parg1); } else if (streq(function_name, "sec2gmt")) { return lrec_evaluator_alloc_from_s_f_func(s_f_sec2gmt_func, parg1); } else if (streq(function_name, "gmt2sec")) { return lrec_evaluator_alloc_from_f_s_func(f_s_gmt2sec_func, parg1); + } else if (streq(function_name, "strlen")) { return lrec_evaluator_alloc_from_s_f_func(f_s_strlen_func, parg1); } else return NULL; // xxx handle me better } diff --git a/c/mapping/mlr_val.c b/c/mapping/mlr_val.c index 5e0e01ff3..7c5d39042 100644 --- a/c/mapping/mlr_val.c +++ b/c/mapping/mlr_val.c @@ -214,6 +214,12 @@ mlr_val_t f_s_gmt2sec_func(mlr_val_t* pval1) { return rv; } +// ---------------------------------------------------------------- +mlr_val_t f_s_strlen_func(mlr_val_t* pval1) { + mlr_val_t rv = {.type = MT_DOUBLE, .u.double_val = strlen(pval1->u.string_val)}; + return rv; +} + // ---------------------------------------------------------------- // xxx cmt us!!!! diff --git a/c/mapping/mlr_val.h b/c/mapping/mlr_val.h index 7b41ba1f7..a638b6d00 100644 --- a/c/mapping/mlr_val.h +++ b/c/mapping/mlr_val.h @@ -180,6 +180,7 @@ mlr_val_t s_sss_sub_func(mlr_val_t* pval1, mlr_val_t* pval2, mlr_val_t* pval3); // ---------------------------------------------------------------- mlr_val_t s_f_sec2gmt_func(mlr_val_t* pval1); mlr_val_t f_s_gmt2sec_func(mlr_val_t* pval1); +mlr_val_t f_s_strlen_func(mlr_val_t* pval1); // ---------------------------------------------------------------- mlr_val_t eq_op_func(mlr_val_t* pval1, mlr_val_t* pval2); diff --git a/c/todo.txt b/c/todo.txt index e35478ded..f48f48fb8 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -35,15 +35,10 @@ FEATURES/+ -> move datadirs too ..... unify c & doc data dirs to parent? -> remove/coalesce/gzip the large data files -* readme @ each level incl. sof et al. @ base - -> & perfopt: lrec_t not hashmap per se; stdio backings with minimal copying; mmap entirely; ... ? - ! mlr sort CLI opt for choice of heap/merge/quick -- ? * mod op (either c-like, or sane) and put into wikidoc if so. -? rip through filenames @ start & abend unless -f each: fail fast. - ================================================================ NEATEN @@ -123,6 +118,7 @@ UT/REG * tac/X/tac for all X * multi-csv I/O: include --icsv --odkvp and --idkvp --ocsv, as well as --csv cases * het-xtab out +* modulus ================================================================ INTERNAL DOCS (e.g. README)