util/nvramtool: Remove "this file is part of" lines
[coreboot.git] / util / nvramtool / reg_expr.c
blob3c164e25d125195c1ac2158c72bb88867a027f42
1 /*****************************************************************************\
2 * reg_expr.c
3 *****************************************************************************
4 * Please also read the file DISCLAIMER which is included in this software
5 * distribution.
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License (as published by the
9 * Free Software Foundation) version 2, dated June 1991.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
14 * conditions of the GNU General Public License for more details.
15 \*****************************************************************************/
17 #include <stdarg.h>
18 #include "common.h"
19 #include "reg_expr.h"
21 /****************************************************************************
22 * compile_reg_expr
24 * Compile a regular expression.
25 ****************************************************************************/
26 void compile_reg_expr(int cflags, const char *expr, regex_t *reg)
28 static const size_t ERROR_BUF_SIZE = 256;
29 char error_msg[ERROR_BUF_SIZE];
30 int result;
32 if ((result = regcomp(reg, expr, cflags)) != 0) {
33 regerror(result, reg, error_msg, ERROR_BUF_SIZE);
34 fprintf(stderr, "%s: %s\n", prog_name, error_msg);
35 exit(1);