PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include "common/logging.h"
#include "common/string.h"
#include "filter.h"
#include "lib/stringinfo.h"
#include "pqexpbuffer.h"
Go to the source code of this file.
Macros | |
#define | is_keyword_str(cstr, str, bytes) ((strlen(cstr) == (bytes)) && (pg_strncasecmp((cstr), (str), (bytes)) == 0)) |
Functions | |
void | filter_init (FilterStateData *fstate, const char *filename, exit_function f_exit) |
void | filter_free (FilterStateData *fstate) |
const char * | filter_object_type_name (FilterObjectType fot) |
static bool | get_object_type (const char *keyword, int size, FilterObjectType *objtype) |
void | pg_log_filter_error (FilterStateData *fstate, const char *fmt,...) |
static const char * | filter_get_keyword (const char **line, int *size) |
static const char * | read_quoted_string (FilterStateData *fstate, const char *str, PQExpBuffer pattern) |
static const char * | read_pattern (FilterStateData *fstate, const char *str, PQExpBuffer pattern) |
bool | filter_read_item (FilterStateData *fstate, char **objname, FilterCommandType *comtype, FilterObjectType *objtype) |
#define is_keyword_str | ( | cstr, | |
str, | |||
bytes | |||
) | ((strlen(cstr) == (bytes)) && (pg_strncasecmp((cstr), (str), (bytes)) == 0)) |
void filter_free | ( | FilterStateData * | fstate | ) |
Definition at line 60 of file filter.c.
References StringInfoData::data, FilterStateData::filename, FilterStateData::fp, free, FilterStateData::linebuff, and pg_log_error.
Referenced by read_dump_filters(), read_dumpall_filters(), and read_restore_filters().
|
static |
void filter_init | ( | FilterStateData * | fstate, |
const char * | filename, | ||
exit_function | f_exit | ||
) |
Definition at line 36 of file filter.c.
References FilterStateData::exit_nicely, FilterStateData::filename, filename, FilterStateData::fp, initStringInfo(), FilterStateData::linebuff, FilterStateData::lineno, and pg_log_error.
Referenced by read_dump_filters(), read_dumpall_filters(), and read_restore_filters().
const char* filter_object_type_name | ( | FilterObjectType | fot | ) |
Definition at line 82 of file filter.c.
References FILTER_OBJECT_TYPE_DATABASE, FILTER_OBJECT_TYPE_EXTENSION, FILTER_OBJECT_TYPE_FOREIGN_DATA, FILTER_OBJECT_TYPE_FUNCTION, FILTER_OBJECT_TYPE_INDEX, FILTER_OBJECT_TYPE_NONE, FILTER_OBJECT_TYPE_SCHEMA, FILTER_OBJECT_TYPE_TABLE, FILTER_OBJECT_TYPE_TABLE_AND_CHILDREN, FILTER_OBJECT_TYPE_TABLE_DATA, FILTER_OBJECT_TYPE_TABLE_DATA_AND_CHILDREN, FILTER_OBJECT_TYPE_TRIGGER, and pg_unreachable.
Referenced by read_dump_filters(), read_dumpall_filters(), and read_restore_filters().
bool filter_read_item | ( | FilterStateData * | fstate, |
char ** | objname, | ||
FilterCommandType * | comtype, | ||
FilterObjectType * | objtype | ||
) |
Definition at line 389 of file filter.c.
References _, StringInfoData::data, PQExpBufferData::data, FilterStateData::exit_nicely, FilterStateData::filename, FILTER_COMMAND_TYPE_EXCLUDE, FILTER_COMMAND_TYPE_INCLUDE, FILTER_COMMAND_TYPE_NONE, filter_get_keyword(), FILTER_OBJECT_TYPE_NONE, FilterStateData::fp, get_object_type(), initPQExpBuffer(), is_keyword_str, FilterStateData::linebuff, FilterStateData::lineno, pg_get_line_buf(), pg_log_error, pg_log_filter_error(), read_pattern(), size, and str.
Referenced by read_dump_filters(), read_dumpall_filters(), and read_restore_filters().
|
static |
Definition at line 122 of file filter.c.
References FILTER_OBJECT_TYPE_DATABASE, FILTER_OBJECT_TYPE_EXTENSION, FILTER_OBJECT_TYPE_FOREIGN_DATA, FILTER_OBJECT_TYPE_FUNCTION, FILTER_OBJECT_TYPE_INDEX, FILTER_OBJECT_TYPE_SCHEMA, FILTER_OBJECT_TYPE_TABLE, FILTER_OBJECT_TYPE_TABLE_AND_CHILDREN, FILTER_OBJECT_TYPE_TABLE_DATA, FILTER_OBJECT_TYPE_TABLE_DATA_AND_CHILDREN, FILTER_OBJECT_TYPE_TRIGGER, is_keyword_str, and size.
Referenced by filter_read_item().
void pg_log_filter_error | ( | FilterStateData * | fstate, |
const char * | fmt, | ||
... | |||
) |
Definition at line 154 of file filter.c.
References buf, FilterStateData::filename, fmt, FilterStateData::fp, FilterStateData::lineno, pg_log_error, va_end(), va_start(), and vsnprintf.
Referenced by filter_read_item(), read_dump_filters(), read_dumpall_filters(), read_pattern(), read_quoted_string(), and read_restore_filters().
|
static |
Definition at line 299 of file filter.c.
References _, appendPQExpBufferChar(), appendPQExpBufferStr(), FilterStateData::exit_nicely, pg_log_filter_error(), read_quoted_string(), and str.
Referenced by filter_read_item().
|
static |
Definition at line 214 of file filter.c.
References _, appendPQExpBufferChar(), Assert, StringInfoData::data, FilterStateData::exit_nicely, FilterStateData::filename, FilterStateData::fp, FilterStateData::linebuff, FilterStateData::lineno, pg_get_line_buf(), pg_log_error, pg_log_filter_error(), and str.
Referenced by read_pattern().