#include <glib.h>
#include "config.h"

#define GLOB_CHAR		0	/* literal character */
#define GLOB_RANGE	1	/* character range */
#define GLOB_STAR		2	/* asterisk */
#define GLOB_PTN		3	/* subpattern */

#define CHARSPERRANGE	((int) ( 1 << CHAR_BIT))
#define RANGESIZE		(CHARSPERRANGE / CHAR_BIT)

typedef struct Aglob Aglob;
typedef struct Aglob { 
	unsigned int invert: 1;
	unsigned int type: 2;
	union { 
		char	*cp;
		char	*rp;
		Aglob	*ptn;
		char	*str;
	} u;
};

static char *range(char *string, char **rpp);
static char *subglob_parse (char *string, int inner, Aglob **ptnp);
Aglob *glob_parse (char *string);
gboolean globsto (char *string, Aglob ptn[]);

