PostgreSQL Source Code  git master
filter.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * filter.h
4  * Common header file for the parser of filter file
5  *
6  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * IDENTIFICATION
10  * src/bin/pg_dump/filter.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef FILTER_H
15 #define FILTER_H
16 
17 #include "lib/stringinfo.h"
18 
19 /* Function signature for exit_nicely functions */
20 typedef void (*exit_function) (int status);
21 
22 /*
23  * State data for reading filter items from stream
24  */
25 typedef struct
26 {
27  FILE *fp;
28  const char *filename;
30  int lineno;
33 
34 /*
35  * List of command types that can be specified in filter file
36  */
37 typedef enum
38 {
43 
44 /*
45  * List of objects that can be specified in filter file
46  */
47 typedef enum
48 {
62 
63 extern const char *filter_object_type_name(FilterObjectType fot);
64 extern void filter_init(FilterStateData *fstate, const char *filename, exit_function f_exit);
65 extern void filter_free(FilterStateData *fstate);
66 extern void pg_log_filter_error(FilterStateData *fstate, const char *fmt,...)
67  pg_attribute_printf(2, 3);
68 extern bool filter_read_item(FilterStateData *fstate, char **objname,
69  FilterCommandType *comtype, FilterObjectType *objtype);
70 
71 #endif /* FILTER_H */
#define pg_attribute_printf(f, a)
Definition: c.h:178
void filter_init(FilterStateData *fstate, const char *filename, exit_function f_exit)
Definition: filter.c:37
void filter_free(FilterStateData *fstate)
Definition: filter.c:61
void pg_log_filter_error(FilterStateData *fstate, const char *fmt,...) pg_attribute_printf(2
void bool filter_read_item(FilterStateData *fstate, char **objname, FilterCommandType *comtype, FilterObjectType *objtype)
Definition: filter.c:388
const char * filter_object_type_name(FilterObjectType fot)
Definition: filter.c:83
FilterObjectType
Definition: filter.h:48
@ FILTER_OBJECT_TYPE_TABLE_DATA_AND_CHILDREN
Definition: filter.h:51
@ FILTER_OBJECT_TYPE_SCHEMA
Definition: filter.h:57
@ FILTER_OBJECT_TYPE_INDEX
Definition: filter.h:56
@ FILTER_OBJECT_TYPE_TRIGGER
Definition: filter.h:60
@ FILTER_OBJECT_TYPE_FOREIGN_DATA
Definition: filter.h:54
@ FILTER_OBJECT_TYPE_DATABASE
Definition: filter.h:52
@ FILTER_OBJECT_TYPE_FUNCTION
Definition: filter.h:55
@ FILTER_OBJECT_TYPE_TABLE_DATA
Definition: filter.h:50
@ FILTER_OBJECT_TYPE_NONE
Definition: filter.h:49
@ FILTER_OBJECT_TYPE_TABLE_AND_CHILDREN
Definition: filter.h:59
@ FILTER_OBJECT_TYPE_EXTENSION
Definition: filter.h:53
@ FILTER_OBJECT_TYPE_TABLE
Definition: filter.h:58
FilterCommandType
Definition: filter.h:38
@ FILTER_COMMAND_TYPE_NONE
Definition: filter.h:39
@ FILTER_COMMAND_TYPE_EXCLUDE
Definition: filter.h:41
@ FILTER_COMMAND_TYPE_INCLUDE
Definition: filter.h:40
void(* exit_function)(int status)
Definition: filter.h:20
static void const char * fmt
static char * filename
Definition: pg_dumpall.c:121
exit_function exit_nicely
Definition: filter.h:29
StringInfoData linebuff
Definition: filter.h:31
const char * filename
Definition: filter.h:28
FILE * fp
Definition: filter.h:27