2021-11-25 21:57:37 +00:00
|
|
|
// Copyright 2007-2009 Russ Cox. All Rights Reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "re1.5.h"
|
|
|
|
|
2021-12-14 19:08:27 +00:00
|
|
|
extern void berry_log_C(const char * berry_buf, ...);
|
|
|
|
|
2021-11-25 21:57:37 +00:00
|
|
|
void
|
2021-12-14 19:08:27 +00:00
|
|
|
re1_5_fatal(const char *msg)
|
2021-11-25 21:57:37 +00:00
|
|
|
{
|
2021-12-14 19:08:27 +00:00
|
|
|
berry_log_C("BRY: regex fatal error: %s", msg);
|
|
|
|
// fprintf(stderr, "fatal error: %s\n", msg);
|
2021-11-25 21:57:37 +00:00
|
|
|
exit(2);
|
|
|
|
}
|
|
|
|
|
|
|
|
void*
|
|
|
|
mal(int n)
|
|
|
|
{
|
|
|
|
void *v;
|
|
|
|
|
|
|
|
v = malloc(n);
|
|
|
|
if(v == nil)
|
|
|
|
re1_5_fatal("out of memory");
|
|
|
|
memset(v, 0, n);
|
|
|
|
return v;
|
|
|
|
}
|