mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-17 16:38:54 +00:00
neaten
This commit is contained in:
parent
e0cbe1849c
commit
70a0c35ba3
22 changed files with 81 additions and 40 deletions
|
|
@ -1,4 +1,4 @@
|
|||
Copyright (c) 2015 John Kerl
|
||||
Copyright (c) 2015- John Kerl
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// ================================================================
|
||||
// Argument-parsing library, with non-getopt semantics.
|
||||
// ================================================================
|
||||
|
||||
#ifndef ARGPARSE_H
|
||||
#define ARGPARSE_H
|
||||
#include "containers/slls.h"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// ================================================================
|
||||
// Miller command-line parsing
|
||||
// ================================================================
|
||||
|
||||
#ifndef MLRCLI_H
|
||||
#define MLRCLI_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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// ================================================================
|
||||
// Data structures for mlr join
|
||||
// ================================================================
|
||||
|
||||
#ifndef JOIN_BUCKET_KEEPER_H
|
||||
#define JOIN_BUCKET_KEEPER_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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
// ================================================================
|
||||
// Functions involving more than one container type
|
||||
// ================================================================
|
||||
|
||||
#ifndef MIXUTIL_H
|
||||
#define MIXUTIL_H
|
||||
#include "containers/lrec.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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
// ================================================================
|
||||
// Singly linked list of string, with tail for append.
|
||||
// ================================================================
|
||||
|
||||
#ifndef SLLS_H
|
||||
#define SLLS_H
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
// ================================================================
|
||||
// Singly-linked list of void-star, with tail for append.
|
||||
// ================================================================
|
||||
|
||||
#ifndef SLLV_H
|
||||
#define SLLV_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"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// ================================================================
|
||||
// Abstraction layer for mmapped file-read logic.
|
||||
// ================================================================
|
||||
|
||||
#ifndef FILE_READER_MMAP_H
|
||||
#define FILE_READER_MMAP_H
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
// ================================================================
|
||||
// Abstraction layer for stdio file-read logic.
|
||||
// ================================================================
|
||||
|
||||
#ifndef FILE_READER_STDIO_H
|
||||
#define FILE_READER_STDIO_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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue