Documentation ¶
Index ¶
- Constants
- Variables
- func AddHook(env *zygo.Zlisp, name string, args []zygo.Sexp) (zygo.Sexp, error)
- func Exists[K comparable, V any](m map[K]V, v K) bool
- func FilterByPattern(conf cfg.Config, input io.Reader) (io.Reader, error)
- func HookExists(key string) bool
- func LoadAndEvalFile(env *zygo.Zlisp, path string) error
- func PrepareColumns(conf *cfg.Config, data *Tabdata) error
- func ProcessFiles(conf *cfg.Config, args []string) error
- func RegisterLib(env *zygo.Zlisp)
- func RunFilterHooks(conf cfg.Config, line string) (bool, error)
- func SetupLisp(conf *cfg.Config) error
- func Splice2SexpList(list []string) zygo.Sexp
- func String2Int(env *zygo.Zlisp, name string, args []zygo.Sexp) (zygo.Sexp, error)
- func StringReSplit(env *zygo.Zlisp, name string, args []zygo.Sexp) (zygo.Sexp, error)
- type Tabdata
Constants ¶
const RWRR = 0755
Variables ¶
var Hooks map[string][]*zygo.SexpSymbol
needs to be global because we can't feed an cfg object to AddHook() which is being called from user lisp code
Functions ¶
func AddHook ¶ added in v1.0.17
AddHook() (called addhook from lisp code) can be used by the user to add a function to one of the available hooks provided by tablizer.
func Exists ¶ added in v1.2.0
func Exists[K comparable, V any](m map[K]V, v K) bool
generic map.Exists(key)
func FilterByPattern ¶ added in v1.2.0
func LoadAndEvalFile ¶ added in v1.2.0
* Basic sanity checks and load lisp file
func PrepareColumns ¶
parse columns list given with -c, modifies config.UseColumns based on eventually given regex
func RegisterLib ¶ added in v1.0.17
func RunFilterHooks ¶ added in v1.0.17
Execute every user lisp function registered as filter hook.
Each function is given the current line as argument and is expected to return a boolean. True indicates to keep the line, false to skip it.
If there are multiple such functions registered, then the first one returning false wins, that is if each function returns true the line will be kept, if at least one of them returns false, it will be skipped.
func Splice2SexpList ¶ added in v1.0.17
func String2Int ¶ added in v1.0.17
Types ¶
type Tabdata ¶
type Tabdata struct {
// contains filtered or unexported fields
}
contains a whole parsed table
func FilterByFields ¶ added in v1.2.0
* Filter parsed data by fields. The filter is positive, so if one or * more filters match on a row, it will be kept, otherwise it will be * excluded.
func RunProcessHooks ¶ added in v1.0.17
These hooks get the data (Tabdata) readily processed by tablizer as argument. They are expected to return a SexpPair containing a boolean denoting if the data has been modified and the actual modified data. Columns must be the same, rows may differ. Cells may also have been modified.
Replaces the internal data structure Tabdata with the user supplied version.
Only one process hook function is supported.
The somewhat complicated code is being caused by the fact, that we need to convert our internal structure to a lisp variable and vice versa afterwards.