PostgreSQL Source Code  git master
indent_globs.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  parser_state
 

Macros

#define BACKSLASH   '\\'
 
#define bufsize   200 /* size of internal buffers */
 
#define sc_size   5000 /* size of save_com buffer */
 
#define label_offset
 
#define false   0
 
#define CHECK_SIZE_CODE(desired_size)
 
#define CHECK_SIZE_COM(desired_size)
 
#define CHECK_SIZE_LAB(desired_size)
 
#define CHECK_SIZE_TOKEN(desired_size)
 
#define token   s_token
 

Variables

FILE * input
 
FILE * output
 
char * labbuf
 
char * s_lab
 
char * e_lab
 
char * l_lab
 
char * codebuf
 
char * s_code
 
char * e_code
 
char * l_code
 
char * combuf
 
char * s_com
 
char * e_com
 
char * l_com
 
char * tokenbuf
 
char * s_token
 
char * e_token
 
char * l_token
 
char * in_buffer
 
char * in_buffer_limit
 
char * buf_ptr
 
char * buf_end
 
char sc_buf [sc_size]
 
char * save_com
 
char * sc_end
 
char * bp_save
 
char * be_save
 
int found_err
 
int blanklines_after_declarations
 
int blanklines_before_blockcomments
 
int blanklines_after_procs
 
int blanklines_around_conditional_compilation
 
int swallow_optional_blanklines
 
int n_real_blanklines
 
int prefix_blankline_requested
 
int postfix_blankline_requested
 
int break_comma
 
int btype_2
 
float case_ind
 
int code_lines
 
int had_eof
 
int line_no
 
int max_col
 
int verbose
 
int cuddle_else
 
int star_comment_cont
 
int comment_delimiter_on_blankline
 
int troff
 
int procnames_start_line
 
int proc_calls_space
 
int format_block_comments
 
int format_col1_comments
 
int inhibit_formatting
 
int suppress_blanklines
 
int continuation_indent
 
int lineup_to_parens
 
int lineup_to_parens_always
 
int Bill_Shannon
 
int blanklines_after_declarations_at_proctop
 
int block_comment_max_col
 
int extra_expression_indent
 
int function_brace_split
 
int use_tabs
 
int auto_typedefs
 
int space_after_cast
 
int postgres_tab_rules
 
int tabsize
 
int else_endif_com_ind
 
int ifdef_level
 
struct parser_state ps
 
struct parser_state state_stack [5]
 
struct parser_state match_state [5]
 

Macro Definition Documentation

◆ BACKSLASH

#define BACKSLASH   '\\'

Definition at line 35 of file indent_globs.h.

◆ bufsize

#define bufsize   200 /* size of internal buffers */

Definition at line 36 of file indent_globs.h.

◆ CHECK_SIZE_CODE

#define CHECK_SIZE_CODE (   desired_size)
Value:
if (e_code + (desired_size) >= l_code) { \
int nsize = l_code-s_code + 400 + desired_size; \
int code_len = e_code-s_code; \
codebuf = (char *) realloc(codebuf, nsize); \
if (codebuf == NULL) \
err(1, NULL); \
e_code = codebuf + code_len + 1; \
l_code = codebuf + nsize - 5; \
s_code = codebuf + 1; \
}
#define realloc(a, b)
Definition: header.h:60
char * codebuf
char * e_code
char * l_code
char * s_code

Definition at line 59 of file indent_globs.h.

◆ CHECK_SIZE_COM

#define CHECK_SIZE_COM (   desired_size)
Value:
if (e_com + (desired_size) >= l_com) { \
int nsize = l_com-s_com + 400 + desired_size; \
int com_len = e_com - s_com; \
int blank_pos; \
if (last_bl != NULL) \
blank_pos = last_bl - combuf; \
else \
blank_pos = -1; \
combuf = (char *) realloc(combuf, nsize); \
if (combuf == NULL) \
err(1, NULL); \
e_com = combuf + com_len + 1; \
if (blank_pos > 0) \
last_bl = combuf + blank_pos; \
l_com = combuf + nsize - 5; \
s_com = combuf + 1; \
}
char * e_com
char * l_com
char * s_com
char * combuf

Definition at line 70 of file indent_globs.h.

◆ CHECK_SIZE_LAB

#define CHECK_SIZE_LAB (   desired_size)
Value:
if (e_lab + (desired_size) >= l_lab) { \
int nsize = l_lab-s_lab + 400 + desired_size; \
int label_len = e_lab - s_lab; \
labbuf = (char *) realloc(labbuf, nsize); \
if (labbuf == NULL) \
err(1, NULL); \
e_lab = labbuf + label_len + 1; \
l_lab = labbuf + nsize - 5; \
s_lab = labbuf + 1; \
}
char * l_lab
char * e_lab
char * labbuf
char * s_lab

Definition at line 88 of file indent_globs.h.

◆ CHECK_SIZE_TOKEN

#define CHECK_SIZE_TOKEN (   desired_size)
Value:
if (e_token + (desired_size) >= l_token) { \
int nsize = l_token-s_token + 400 + desired_size; \
int token_len = e_token - s_token; \
tokenbuf = (char *) realloc(tokenbuf, nsize); \
if (tokenbuf == NULL) \
err(1, NULL); \
e_token = tokenbuf + token_len + 1; \
l_token = tokenbuf + nsize - 5; \
s_token = tokenbuf + 1; \
}
char * l_token
char * tokenbuf
char * e_token
char * s_token

Definition at line 99 of file indent_globs.h.

◆ false

#define false   0

Definition at line 42 of file indent_globs.h.

◆ label_offset

#define label_offset
Value:
2 /* number of levels a label is placed to left
* of code */

Definition at line 38 of file indent_globs.h.

◆ sc_size

#define sc_size   5000 /* size of save_com buffer */

Definition at line 37 of file indent_globs.h.

◆ token

#define token   s_token

Definition at line 126 of file indent_globs.h.

Variable Documentation

◆ auto_typedefs

int auto_typedefs
extern

Referenced by lexi().

◆ be_save

char* be_save
extern

Referenced by fill_buffer(), lookahead(), and main().

◆ Bill_Shannon

int Bill_Shannon
extern

Referenced by main().

◆ blanklines_after_declarations

int blanklines_after_declarations
extern

Referenced by dump_line().

◆ blanklines_after_declarations_at_proctop

int blanklines_after_declarations_at_proctop
extern

Referenced by main().

◆ blanklines_after_procs

int blanklines_after_procs
extern

Referenced by main().

◆ blanklines_around_conditional_compilation

int blanklines_around_conditional_compilation
extern

Referenced by main().

◆ blanklines_before_blockcomments

int blanklines_before_blockcomments
extern

Referenced by pr_comment().

◆ block_comment_max_col

int block_comment_max_col
extern

Referenced by main(), and pr_comment().

◆ bp_save

char* bp_save
extern

Referenced by fill_buffer(), lookahead_reset(), and main().

◆ break_comma

int break_comma
extern

Referenced by main(), and parse().

◆ btype_2

int btype_2
extern

Referenced by main(), and parse().

◆ buf_end

char* buf_end
extern

◆ buf_ptr

char* buf_ptr
extern

Referenced by fill_buffer(), lexi(), main(), and pr_comment().

◆ case_ind

float case_ind
extern

Referenced by compute_label_target(), parse(), and reduce().

◆ code_lines

int code_lines
extern

Referenced by dump_line(), and main().

◆ codebuf

char* codebuf
extern

Referenced by main().

◆ combuf

char* combuf
extern

Referenced by dump_line(), and main().

◆ comment_delimiter_on_blankline

int comment_delimiter_on_blankline
extern

Referenced by main(), and pr_comment().

◆ continuation_indent

int continuation_indent
extern

Referenced by compute_code_target(), and main().

◆ cuddle_else

int cuddle_else
extern

Referenced by main().

◆ e_code

char* e_code
extern

◆ e_com

char* e_com
extern

◆ e_lab

char* e_lab
extern

◆ e_token

char* e_token
extern

Referenced by lexi(), and main().

◆ else_endif_com_ind

int else_endif_com_ind
extern

Referenced by pr_comment().

◆ extra_expression_indent

int extra_expression_indent
extern

Referenced by main().

◆ format_block_comments

int format_block_comments
extern

Referenced by main(), and pr_comment().

◆ format_col1_comments

int format_col1_comments
extern

Referenced by main(), and pr_comment().

◆ found_err

int found_err
extern

Referenced by diag2(), diag3(), diag4(), and main().

◆ function_brace_split

int function_brace_split
extern

Referenced by main().

◆ had_eof

int had_eof
extern

Referenced by fill_buffer(), lexi(), main(), and pr_comment().

◆ ifdef_level

int ifdef_level
extern

Referenced by main().

◆ in_buffer

char* in_buffer
extern

Referenced by fill_buffer(), main(), and pr_comment().

◆ in_buffer_limit

char* in_buffer_limit
extern

Referenced by fill_buffer(), and main().

◆ inhibit_formatting

int inhibit_formatting
extern

Referenced by dump_line(), and fill_buffer().

◆ input

◆ l_code

char* l_code
extern

Referenced by main().

◆ l_com

char* l_com
extern

Referenced by main().

◆ l_lab

char* l_lab
extern

Referenced by main().

◆ l_token

char* l_token
extern

Referenced by main().

◆ labbuf

char* labbuf
extern

Referenced by main().

◆ line_no

int line_no
extern

Referenced by diag2(), diag3(), diag4(), lexi(), main(), and pr_comment().

◆ lineup_to_parens

int lineup_to_parens
extern

Referenced by compute_code_target(), and main().

◆ lineup_to_parens_always

int lineup_to_parens_always
extern

Referenced by compute_code_target(), and main().

◆ match_state

◆ max_col

int max_col
extern

◆ n_real_blanklines

int n_real_blanklines
extern

Referenced by dump_line(), fill_buffer(), and main().

◆ output

static void output
extern

Definition at line 182 of file pg_test_timing.c.

183 {
184  int64 max_bit = 31,
185  i;
186  char *header1 = _("< us");
187  char *header2 = /* xgettext:no-c-format */ _("% of total");
188  char *header3 = _("count");
189  int len1 = strlen(header1);
190  int len2 = strlen(header2);
191  int len3 = strlen(header3);
192 
193  /* find highest bit value */
194  while (max_bit > 0 && histogram[max_bit] == 0)
195  max_bit--;
196 
197  printf(_("Histogram of timing durations:\n"));
198  printf("%*s %*s %*s\n",
199  Max(6, len1), header1,
200  Max(10, len2), header2,
201  Max(10, len3), header3);
202 
203  for (i = 0; i <= max_bit; i++)
204  printf("%*ld %*.5f %*lld\n",
205  Max(6, len1), 1l << i,
206  Max(10, len2) - 1, (double) histogram[i] * 100 / loop_count,
207  Max(10, len3), histogram[i]);
208 }
#define Max(x, y)
Definition: c.h:998
#define _(x)
Definition: elog.c:90
int i
Definition: isn.c:73
long long int histogram[32]
#define printf(...)
Definition: port.h:244

Referenced by _crypt_blowfish_rn(), _crypt_gensalt_blowfish_rn(), _crypt_gensalt_extended_rn(), _crypt_gensalt_md5_rn(), _crypt_gensalt_traditional_rn(), adjust_data_dir(), bakcopy(), be_gssapi_read(), be_gssapi_write(), brin_page_items(), CheckSASLAuth(), d2d(), dequoteAclUserName(), diag2(), diag3(), diag4(), dttoasc(), dttofmtasc(), dttofmtasc_replace(), dump_line(), exec_command_sf_sv(), f2d(), fill_buffer(), get_bin_version(), get_control_data(), GetSafeSnapshotBlockingPids(), main(), pad_output(), pg_checksum_final(), pg_GSS_read(), pg_GSS_write(), pg_SASL_continue(), pg_saslprep(), pgtypes_fmt_replace(), PGTYPEStimestamp_fmt_asc(), pqsecure_open_gss(), print_with_linenumbers(), printHistory(), px_crypt_des(), quoteAclUserName(), scram_exchange(), secure_open_gssapi(), set_option(), slashUsage(), statext_dependencies_serialize(), statext_ndistinct_serialize(), tbm_extract_page_tuple(), tbm_iterate(), tbm_shared_iterate(), test_shm_mq_setup(), to_chars(), to_chars_df(), to_chars_f(), transformJsonConstructorOutput(), transformJsonOutput(), transformJsonParseExpr(), transformJsonReturning(), transformJsonScalarExpr(), usage(), and worker_freeze_result_tape().

◆ postfix_blankline_requested

int postfix_blankline_requested
extern

Referenced by dump_line(), fill_buffer(), and main().

◆ postgres_tab_rules

int postgres_tab_rules
extern

Referenced by indent_declaration(), and pad_output().

◆ prefix_blankline_requested

int prefix_blankline_requested
extern

◆ proc_calls_space

int proc_calls_space
extern

Referenced by main().

◆ procnames_start_line

int procnames_start_line
extern

Referenced by main().

◆ ps

◆ s_code

◆ s_com

char* s_com
extern

◆ s_lab

char* s_lab
extern

◆ s_token

char* s_token
extern

Referenced by lexi(), and main().

◆ save_com

char* save_com
extern

Referenced by main(), and pr_comment().

◆ sc_buf

char sc_buf[sc_size]
extern

Referenced by main(), and pr_comment().

◆ sc_end

char* sc_end
extern

Referenced by main().

◆ space_after_cast

int space_after_cast
extern

Referenced by main().

◆ star_comment_cont

int star_comment_cont
extern

Referenced by main(), and pr_comment().

◆ state_stack

struct parser_state state_stack[5]
extern

Referenced by main().

◆ suppress_blanklines

int suppress_blanklines
extern

Referenced by dump_line(), and fill_buffer().

◆ swallow_optional_blanklines

int swallow_optional_blanklines
extern

Referenced by dump_line(), and main().

◆ tabsize

◆ tokenbuf

char* tokenbuf
extern

Referenced by main().

◆ troff

int troff
extern

◆ use_tabs

int use_tabs
extern

Referenced by main(), and pad_output().

◆ verbose