1 /*** rewrite.h ****************************************************************
2 **
3 ** This file is part of BibTool.
4 ** It is distributed under the GNU General Public License.
5 ** See the file COPYING for details.
6 **
7 ** (c) 1996-2020 Gerd Neugebauer
8 **
9 ** Net: gene@gerd-neugebauer.de
10 **
11 ** This program is free software; you can redistribute it and/or modify
12 ** it under the terms of the GNU General Public License as published by
13 ** the Free Software Foundation; either version 2, or (at your option)
14 ** any later version.
15 **
16 ** This program is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ** GNU General Public License for more details.
20 **
21 ** You should have received a copy of the GNU General Public License
22 ** along with this program; if not, write to the Free Software
23 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 **
25 ******************************************************************************/
26 
27 #include <bibtool/database.h>
28 
29 #ifdef __STDC__
30 #define _ARG(A) A
31 #else
32 #define _ARG(A) ()
33 #endif
34  bool is_selected _ARG((DB db, Record rec));	   /*                        */
35  bool foreach_addlist _ARG((bool (*fct)(Symbol,Symbol)));/* rewrite.c        */
36  int set_regex_syntax _ARG((char* name));	   /*                        */
37  void add_check_rule _ARG((String s,int flags));   /*                        */
38  void add_extract _ARG((Symbol s, int regexp, int notp));/*                  */
39  void add_field _ARG((String spec));		   /*                        */
40  void add_rewrite_rule _ARG((String s));	   /*                        */
41  void clear_addlist _ARG((void));		   /*                        */
42  void keep_field _ARG((Symbol spec));		   /*                        */
43  void remove_field _ARG((Symbol field, Record rec));/*                       */
44  void rename_field _ARG((Symbol spec));		   /*                        */
45  void rewrite_record _ARG((DB db, Record rec));	   /*                        */
46  void save_regex _ARG((String s));		   /*                        */
47  char* get_regex_syntax();			   /*                        */
48 
49 /*---------------------------------------------------------------------------*/
50 
51 #define RULE_NONE	0x00
52 #define RULE_ADD	0x01
53 #define RULE_REGEXP	0x02
54 #define RULE_NOT	0x04
55 #define RULE_RENAME	0x08
56 #define RULE_DELETE	0x10
57 #define RULE_KEEP	0x20
58 #define RULE_ERROR	0x100
59 #define RULE_WARNING	0x200
60