timer.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Simple timing program for regcomp().
*
* Copyright (c) 1986 by University of Toronto.
* Written by Henry Spencer. Not derived from licensed software.
*
* Permission is granted to anyone to use this software for any
* purpose on any computer system, and to redistribute it freely,
* subject to the following restrictions:
*
* 1. The author is not responsible for the consequences of use of
* this software, no matter how awful, even if they arise
* from defects in it.
*
* 2. The origin of this software must not be misrepresented, either
* by explicit claim or by omission.
*
* 3. Altered versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
*
* Usage: timer ncomp nexec nsub
* or
* timer ncomp nexec nsub regexp string [ answer [ sub ] ]
*
* The second form is for timing repetitions of a single test case.
* The first form's test data is a compiled-in copy of the "tests" file.
* Ncomp, nexec, nsub are how many times to do each regcomp, regexec,
* and regsub. The way to time an operation individually is to do something
* like "timer 1 50 1".
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
struct try {
} tests[] = {
#include "timer.t.h"
};
#include <tptregexp.h>
int errreport = 0; /* Report errors via errseen? */
char *progname;
/* ARGSUSED */
int argc;
char *argv[];
{
char dummy[512];
if (argc < 4) {
ncomp = 1;
nexec = 1;
nsub = 1;
} else {
}
if (argc > 5) {
if (argc > 6)
else
if (argc > 7) {
} else {
}
errreport = 1;
} else
exit(0);
}
void
tpt_regerror(s)
char *s;
{
if (errreport)
errseen = s;
else
error(s, "");
}
#ifndef ERRAVAIL
char *s1;
char *s2;
{
exit(1);
}
#endif
int lineno = 0;
{
register int i;
extern char *strchr();
errreport = 1;
lineno++;
}
}
{
regexp *r;
register int i;
if (r == NULL) {
return;
}
free((char *)r);
return;
}
for (i = ncomp-1; i > 0; i--) {
free((char *)r);
}
free((char *)r);
return;
}
free((char *)r);
return;
}
for (i = nexec-1; i > 0; i--)
for (i = nsub; i > 0; i--)
free((char *)r);
return;
}
free((char *)r);
}
char *s1;
char *s2;
{
}