This took WAY too long to see. The logs shouldn't be sorted while we're
still in the outer loop. Sort at the end once we've collected all the logs
we can.
/* Extended regular expression matching and search library,
version 0.12.
(Implements POSIX draft P10003.2/D11.2, except for
internationalization features.)
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* AIX requires this to be the first thing in the file. */
#if defined (_AIX) && !defined (REGEX_MALLOC)
#pragma alloca
#endif
#define _GNU_SOURCE
/* We need this for `regex.h', and perhaps for the Emacs include files. */
#include<sys/types.h>
#ifdef HAVE_CONFIG_H
#include"../ig_config.h"
#endif
/* The `emacs' switch turns on certain matching commands
that make sense only in Emacs. */
#ifdef emacs
#include"lisp.h"
#include"buffer.h"
#include"syntax.h"
/* Emacs uses `NULL' as a predicate. */
#undef NULL
#else /* not emacs */
/* We used to test for `BSTRING' here, but only GCC and Emacs define
`BSTRING', as far as I know, and neither of them use this code. */
#if HAVE_STRING_H || STDC_HEADERS
#include<string.h>
#ifndef bcmp
#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
#endif
#ifndef bcopy
#define bcopy(s, d, n) memcpy ((d), (s), (n))
#endif
#ifndef bzero
#define bzero(s, n) memset ((s), 0, (n))
#endif
#else
#include<strings.h>
#endif
#ifdef STDC_HEADERS
#include<stdlib.h>
#else
char*malloc();
char*realloc();
#endif
/* Define the syntax stuff for \<, \>, etc. */
/* This must be nonzero for the wordchar and notwordchar pattern
commands in re_match_2. */
#ifndef Sword
#define Sword 1
#endif
#ifdef SYNTAX_TABLE
externchar*re_syntax_table;
#else /* not SYNTAX_TABLE */
/* How many characters in the character set. */
#define CHAR_SET_SIZE 256
staticcharre_syntax_table[CHAR_SET_SIZE];
staticvoid
init_syntax_once()
{
registerintc;
staticintdone=0;
if(done)
return;
bzero(re_syntax_table,sizeofre_syntax_table);
for(c='a';c<='z';c++)
re_syntax_table[c]=Sword;
for(c='A';c<='Z';c++)
re_syntax_table[c]=Sword;
for(c='0';c<='9';c++)
re_syntax_table[c]=Sword;
re_syntax_table['_']=Sword;
done=1;
}
#endif /* not SYNTAX_TABLE */
#define SYNTAX(c) re_syntax_table[c]
#endif /* not emacs */
/* Get the interface, including the syntax bits. */
#include"regex.h"
/* isalpha etc. are used for the character classes. */