diff --git a/LICENSE.txt b/LICENSE.txt index e83d6e64b..3ccff7b2a 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2015 John Kerl +Copyright (c) 2015- John Kerl All rights reserved. diff --git a/c/cli/argparse.h b/c/cli/argparse.h index 6cf82d643..a0355ecf6 100644 --- a/c/cli/argparse.h +++ b/c/cli/argparse.h @@ -1,3 +1,7 @@ +// ================================================================ +// Argument-parsing library, with non-getopt semantics. +// ================================================================ + #ifndef ARGPARSE_H #define ARGPARSE_H #include "containers/slls.h" diff --git a/c/cli/mlrcli.h b/c/cli/mlrcli.h index 65c095864..e4a5c5e02 100644 --- a/c/cli/mlrcli.h +++ b/c/cli/mlrcli.h @@ -1,3 +1,7 @@ +// ================================================================ +// Miller command-line parsing +// ================================================================ + #ifndef MLRCLI_H #define MLRCLI_H diff --git a/c/containers/header_keeper.h b/c/containers/header_keeper.h index 74f617228..6fb7bc4d4 100644 --- a/c/containers/header_keeper.h +++ b/c/containers/header_keeper.h @@ -1,10 +1,13 @@ +// ================================================================ +// Retains field names from CSV header lines across record reads. +// See also c/README.md. +// ================================================================ + #ifndef HEADER_KEEPER_H #define HEADER_KEEPER_H #include "containers/slls.h" -// xxx cmt w/ xref - typedef struct _header_keeper_t { char* line; slls_t* pkeys; diff --git a/c/containers/hss.h b/c/containers/hss.h index 6c2ea2785..c8db570db 100644 --- a/c/containers/hss.h +++ b/c/containers/hss.h @@ -1,6 +1,3 @@ -#ifndef HSS_H -#define HSS_H - // ================================================================ // Array-only (open addressing) string-valued hash set with linear probing for // collisions. @@ -13,6 +10,9 @@ // * http://docs.oracle.com/javase/6/docs/api/java/util/Map.html // ================================================================ +#ifndef HSS_H +#define HSS_H + // ---------------------------------------------------------------- typedef struct _hsse_t { char* key; @@ -28,6 +28,7 @@ typedef struct _hss_t { hsse_t* array; } hss_t; +// ---------------------------------------------------------------- hss_t* hss_alloc(); void hss_free(hss_t* pset); void hss_add(hss_t* pset, char* key); diff --git a/c/containers/join_bucket_keeper.h b/c/containers/join_bucket_keeper.h index f547c81f1..b2df8fcbb 100644 --- a/c/containers/join_bucket_keeper.h +++ b/c/containers/join_bucket_keeper.h @@ -1,3 +1,7 @@ +// ================================================================ +// Data structures for mlr join +// ================================================================ + #ifndef JOIN_BUCKET_KEEPER_H #define JOIN_BUCKET_KEEPER_H diff --git a/c/containers/lhms2v.h b/c/containers/lhms2v.h index bc1cb4928..fc3364d7f 100644 --- a/c/containers/lhms2v.h +++ b/c/containers/lhms2v.h @@ -1,8 +1,3 @@ -#ifndef LHMS2V_H -#define LHMS2V_H - -#include "containers/slls.h" - // ================================================================ // Array-only (open addressing) string-pair-to-void-star linked hash map with // linear probing for collisions. @@ -18,6 +13,9 @@ // * http://docs.oracle.com/javase/6/docs/api/java/util/Map.html // ================================================================ +#ifndef LHMS2V_H +#define LHMS2V_H + // ---------------------------------------------------------------- typedef struct _lhms2ve_t { int ideal_index; diff --git a/c/containers/lhmsi.h b/c/containers/lhmsi.h index 6b39b37af..4deaed1a9 100644 --- a/c/containers/lhmsi.h +++ b/c/containers/lhmsi.h @@ -1,8 +1,3 @@ -#ifndef LHMSI_H -#define LHMSI_H - -#include "containers/sllv.h" - // ================================================================ // Array-only (open addressing) string-to-int linked hash map with linear // probing for collisions. @@ -18,6 +13,9 @@ // * http://docs.oracle.com/javase/6/docs/api/java/util/Map.html // ================================================================ +#ifndef LHMSI_H +#define LHMSI_H + // ---------------------------------------------------------------- typedef struct _lhmsie_t { int ideal_index; diff --git a/c/containers/lhmslv.h b/c/containers/lhmslv.h index 88ca90bc5..91a3a6a09 100644 --- a/c/containers/lhmslv.h +++ b/c/containers/lhmslv.h @@ -1,8 +1,3 @@ -#ifndef LHMSLV_H -#define LHMSLV_H - -#include "containers/slls.h" - // ================================================================ // Array-only (open addressing) string-list-to-void-star linked hash map with // linear probing for collisions. @@ -18,6 +13,11 @@ // * http://docs.oracle.com/javase/6/docs/api/java/util/Map.html // ================================================================ +#ifndef LHMSLV_H +#define LHMSLV_H + +#include "containers/slls.h" + // ---------------------------------------------------------------- typedef struct _lhmslve_t { int ideal_index; diff --git a/c/containers/lhmss.h b/c/containers/lhmss.h index 607e5a38c..0cd5bd43f 100644 --- a/c/containers/lhmss.h +++ b/c/containers/lhmss.h @@ -1,8 +1,3 @@ -#ifndef LHMSS_H -#define LHMSS_H - -#include "containers/sllv.h" - // ================================================================ // Array-only (open addressing) string-to-string linked hash map with linear // probing for collisions. @@ -18,6 +13,11 @@ // * http://docs.oracle.com/javase/6/docs/api/java/util/Map.html // ================================================================ +#ifndef LHMSS_H +#define LHMSS_H + +#include "containers/sllv.h" + // ---------------------------------------------------------------- typedef struct _lhmsse_t { int ideal_index; diff --git a/c/containers/lhmsv.h b/c/containers/lhmsv.h index c12dc225f..3a1a6355f 100644 --- a/c/containers/lhmsv.h +++ b/c/containers/lhmsv.h @@ -1,8 +1,3 @@ -#ifndef LHMSV_H -#define LHMSV_H - -#include "containers/sllv.h" - // ================================================================ // Array-only (open addressing) string-to-void linked hash map with linear // probing for collisions. @@ -18,6 +13,11 @@ // * http://docs.oracle.com/javase/6/docs/api/java/util/Map.html // ================================================================ +#ifndef LHMSV_H +#define LHMSV_H + +#include "containers/sllv.h" + // ---------------------------------------------------------------- typedef struct _lhmsve_t { int ideal_index; diff --git a/c/containers/mixutil.h b/c/containers/mixutil.h index a02116058..d88680aa0 100644 --- a/c/containers/mixutil.h +++ b/c/containers/mixutil.h @@ -1,4 +1,7 @@ +// ================================================================ // Functions involving more than one container type +// ================================================================ + #ifndef MIXUTIL_H #define MIXUTIL_H #include "containers/lrec.h" diff --git a/c/containers/mlr_dsl_ast.h b/c/containers/mlr_dsl_ast.h index dada232e0..2b2e2ac53 100644 --- a/c/containers/mlr_dsl_ast.h +++ b/c/containers/mlr_dsl_ast.h @@ -1,11 +1,11 @@ -#ifndef MLR_DSL_AST_H -#define MLR_DSL_AST_H -#include "sllv.h" - // ================================================================ // Miller abstract syntax tree for put and filter. // ================================================================ +#ifndef MLR_DSL_AST_H +#define MLR_DSL_AST_H +#include "sllv.h" + #define MLR_DSL_AST_NODE_TYPE_LITERAL 0xaaaa #define MLR_DSL_AST_NODE_TYPE_FIELD_NAME 0xbbbb #define MLR_DSL_AST_NODE_TYPE_FUNCTION_NAME 0xcccc diff --git a/c/containers/percentile_keeper.h b/c/containers/percentile_keeper.h index 0d10bf6e8..f737c5adc 100644 --- a/c/containers/percentile_keeper.h +++ b/c/containers/percentile_keeper.h @@ -1,9 +1,11 @@ +// ================================================================ +// For mlr stats1 percentiles +// ================================================================ + #ifndef PERCENTILE_KEEPER_H #define PERCENTILE_KEEPER_H #include "containers/lrec.h" -// For mlr stats1 percentiles - typedef struct _percentile_keeper_t { double* data; int size; diff --git a/c/containers/slls.h b/c/containers/slls.h index a37869b8f..a3f1ddf61 100644 --- a/c/containers/slls.h +++ b/c/containers/slls.h @@ -1,4 +1,7 @@ +// ================================================================ // Singly linked list of string, with tail for append. +// ================================================================ + #ifndef SLLS_H #define SLLS_H diff --git a/c/containers/sllv.h b/c/containers/sllv.h index 90708dc67..c50277406 100644 --- a/c/containers/sllv.h +++ b/c/containers/sllv.h @@ -1,4 +1,7 @@ +// ================================================================ // Singly-linked list of void-star, with tail for append. +// ================================================================ + #ifndef SLLV_H #define SLLV_H diff --git a/c/containers/top_keeper.h b/c/containers/top_keeper.h index 3aa3f3987..c657c8a9c 100644 --- a/c/containers/top_keeper.h +++ b/c/containers/top_keeper.h @@ -1,3 +1,7 @@ +// ================================================================ +// Data structure for mlr top: just a decorated array. +// ================================================================ + #ifndef TOP_KEEPER_H #define TOP_KEEPER_H #include "containers/lrec.h" diff --git a/c/input/file_reader_mmap.h b/c/input/file_reader_mmap.h index 648064efe..3a3fbce9e 100644 --- a/c/input/file_reader_mmap.h +++ b/c/input/file_reader_mmap.h @@ -1,3 +1,7 @@ +// ================================================================ +// Abstraction layer for mmapped file-read logic. +// ================================================================ + #ifndef FILE_READER_MMAP_H #define FILE_READER_MMAP_H diff --git a/c/input/file_reader_stdio.h b/c/input/file_reader_stdio.h index 24a5a6a95..f313dadaf 100644 --- a/c/input/file_reader_stdio.h +++ b/c/input/file_reader_stdio.h @@ -1,3 +1,7 @@ +// ================================================================ +// Abstraction layer for stdio file-read logic. +// ================================================================ + #ifndef FILE_READER_STDIO_H #define FILE_READER_STDIO_H diff --git a/c/lib/minunit.h b/c/lib/minunit.h index 9aca34e45..ba3c373e2 100644 --- a/c/lib/minunit.h +++ b/c/lib/minunit.h @@ -1,6 +1,8 @@ +// ================================================================ // http://www.jera.com/techinfo/jtns/jtn002.html // MinUnit license: // "You may use the code in this tech note for any purpose, with the understanding that it comes with NO WARRANTY." +// ================================================================ #ifndef MINUNIT_H #define MINUNIT_H diff --git a/c/lib/mlrmath.h b/c/lib/mlrmath.h index 843b85578..742bea835 100644 --- a/c/lib/mlrmath.h +++ b/c/lib/mlrmath.h @@ -9,6 +9,7 @@ void mlr_get_real_symmetric_eigensystem( double eigenvector_2[2]); // Output: corresponding to less-dominant eigenvalue double qnorm(double x); + double invqnorm(double x); #endif // MLRMATH_H diff --git a/c/todo.txt b/c/todo.txt index 2301a5cd0..09b8bc60f 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -14,9 +14,6 @@ TOP OF LIST * doc w/ very specific examples of sed/grep/etc preprocessing to structurize semi-structured data (e.g. logs) -!! join: cleanup of xxx cmts - -!! mmap cleanup, especially csv ! doc stats1/stats2 accums via then-statements ... !! update t1.rb including numeric sort; fix appropriateness of -t= @@ -123,6 +120,12 @@ UT/REG * mmap/stdio UTs; run all cases with --mmap and again with --no-mmap * all __X_MAIN__ instances -> UT code (effectively all-but-dead code at present) +================================================================ +HYGIENE + +!! join: cleanup of xxx cmts +!! mmap cleanup, especially csv + ================================================================ HARDER HYGIENE * eliminate compiler warnings for lemon & its autogenerated code