#ifndef __pattern_h
#define __pattern_h

#include "OS:os.h"

extern os_error const *load_patterns(char const *filename);

extern void free_patterns(void);

extern bool match_pattern(char const *directory, char const *pattern);

/* Test against all patterns, returning CMOS flag mask/set value */
extern int match_patterns(char const *);

/* Call above and set CMOS if not -1 */
extern bool match_and_set(char const *);

/* Convert original command to "%Filer_OpenDir ... " and set CMOS options.
   If there is an error, newcommand will (should) still point to a valid
   %Filer_OpenDir command if non-0 */
extern os_error const *convert_command(char const *cmd_tail, char **newcommand);

extern const os_error nomem_error;
extern const os_error nofile_error;
extern const os_error syntax_error;

#endif
