Chapter 5. Hook Programs.

Hooks enable you to filter out unwanted binaries. If you don't uderstand this section, ignore it. Hooks are not vital to the operation of the program.

Hooks enable you to select which binaries gary decodes using your own software. If a Hook Program is specified, gary will invoke the program and supply it with subject line of the first piece of a binary that it can potentially decode via standard input. If the program returns true (zero), gary will decode the binary. If the program returns false (non-zero), gary will skip decoding the binary, and continue processing.

For example, the following sample program returns true if standard input contains the string "polish" (case insignificant), and false otherwise.

	#!/usr/local/bin/perl
	#
	# /tmp/sample_aub_hook: a simple, sample hook program
	#

	$sl = STDIN;                  # Get standard input
	exit(0) if ($sl =~ m/polish/i);   #Subject Contains "polish"
	exit(1);			# Didn't see "polish"

Suppose this program were set to the hook entry of a group, then gary would only decode binaries containing the string 'polish'.

You can write hook programs in any language you choose.

You may set a default Hook Program that will apply to all subscribed groups that do not specify their own Hook Program. Do this by setting File->Preferences->Defaults->Hook Program. You may set a Hook Program for a single group in the Hook Program entry on the subscribed page.