/* this object will call a specified function whenever
   a registered string is detected in it's input */

#import <objc/Object.h>

typedef struct elt {
  struct elt *next;       // link for the list
  char *s;                // registered string
  int strlen;             // length of s
  int tag;                // value returned when seen (cannot be zero)
  int matchedChars;       // current length of submatch
} listElt;

@interface StringResponder:Object
{
  listElt *list;  // list of registered strings and functions
  int maxlen;     // length of largest registered string
}

+ new;
- free;
- addString:(char *)string returnValue:(int)tag;
- (int) inputString:(char *)input;   // this is how input is provided
- (int) inputChar:(char)ichar;

@end
