Eskil

plugins.wiki at [11415d1712]
Login

File htdocs/plugins.wiki artifact 238e2d7d45 part of check-in 11415d1712


Plugins

Introduction

Eskil provides a plugin system where a plugin can preprocess data before being compared and displayed.

A plugin is a Tcl script that must follow a specific format. Example plugins are included in the kit. Dump one of the included plugins to see what it looks like.

When searching for a plugin "x", files "x" and "x.tcl" will match. The search path is current directory, "plugins" directory, the directory where Eskil is installed, "plugins" directory where Eskil is installed, and also the internal "plugins" wrapped into Eskil.

Usage

The command line options for plugins are:

General Format

A plugin is a Tcl script file that must start with the verbatim sequence "##Eskil Plugin :". A plugin is sourced and used in its own safe interpreter and thus have free access to its own global space. Hookup points are defined by declaring specifically named procedures as specified below, and apart from those, a plugin can define and do whatever within the limits of a safe interpreter.

In addition to the standard safe interpreter environment, a plugin has access to stdout as well.

A plugin is set up with these global variables filled in:

File plugin

To process the files being compared, the following procedure should be defined in the plugin file:

proc PreProcess {side chi cho} {...}

The arguments given to PrePrecess are:

A plugin may give a result that has a line-by-line correspondence to the original, in which case the preprocessed data is used for comparing while the original is used for displaying. The PreProcess procedure should return 0 to signify this case.

If the PreProcess procedure returns 1, the processed data is used also for displaying.

Directory plugin

To be used for file comparison in a directory diff, the following procedure should be defined in the plugin file:

proc FileCompare {ch1 ch2 info1 info2} {...}

The arguments given to FileCompare are:

Info dictionaries contain at least elements "name" and "size".

The FileCompare procedure can give the following return values: