Thanks to visit codestin.com
Credit goes to doxygen.postgresql.org

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

return 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

FILE* input
extern

Referenced by _crypt_gensalt_blowfish_rn(), _crypt_gensalt_extended_rn(), _crypt_gensalt_md5_rn(), _crypt_gensalt_sha(), _crypt_gensalt_sha256_rn(), _crypt_gensalt_sha512_rn(), _crypt_gensalt_traditional_rn(), bakcopy(), be_gssapi_read(), be_gssapi_write(), CheckSASLAuth(), count_comma_separated_elems(), cryptohash_internal(), cvt_date_timestamp(), cvt_date_timestamptz(), cvt_float4_float8(), cvt_float8_float4(), cvt_int2_int4(), cvt_int2_int8(), cvt_int4_int2(), cvt_int4_int8(), cvt_int8_int2(), cvt_int8_int4(), cvt_name_text(), cvt_text_name(), cvt_timestamp_date(), cvt_timestamp_timestamptz(), cvt_timestamptz_date(), cvt_timestamptz_timestamp(), date_test_defmt(), date_test_strdate(), dequoteAclUserName(), descriptor_variable(), ECPGdescribe(), fill_buffer(), hexdecode_string(), init_tsvector_parser(), lookahead(), main(), oauth_exchange(), parse_kvpairs_for_auth(), parse_xlogrecptr(), pg_checksum_update(), pg_GSS_read(), pg_GSS_write(), pg_saslprep(), pg_sha1_update(), pglz_find_match(), pqsecure_open_gss(), quoteAclUserName(), read_any_attr(), read_attr_value(), read_client_final_message(), read_client_first_message(), read_server_final_message(), read_server_first_message(), reset_tsvector_parser(), scram_exchange(), scram_H(), secure_open_gssapi(), select_loop(), set_option(), setop_load_group(), test_gb18030_json(), test_gb18030_page_multiple(), test_shm_mq_setup(), unicode_assigned(), unicode_is_normalized(), unicode_is_normalized_quickcheck(), unicode_normalize(), unicode_normalize_func(), and wait_on_slots().

◆ 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 235 of file pg_test_timing.c.

236{
237 int max_bit = 31;
238 const char *header1 = _("<= ns");
239 const char *header1b = _("ns");
240 const char *header2 = /* xgettext:no-c-format */ _("% of total");
241 const char *header3 = /* xgettext:no-c-format */ _("running %");
242 const char *header4 = _("count");
243 int len1 = strlen(header1);
244 int len2 = strlen(header2);
245 int len3 = strlen(header3);
246 int len4 = strlen(header4);
247 double rprct;
248 bool stopped = false;
249
250 /* find highest bit value */
251 while (max_bit > 0 && histogram[max_bit] == 0)
252 max_bit--;
253
254 /* set minimum column widths */
255 len1 = Max(8, len1);
256 len2 = Max(10, len2);
257 len3 = Max(10, len3);
258 len4 = Max(10, len4);
259
260 printf(_("Histogram of timing durations:\n"));
261 printf("%*s %*s %*s %*s\n",
262 len1, header1,
263 len2, header2,
264 len3, header3,
265 len4, header4);
266
267 rprct = 0;
268 for (int i = 0; i <= max_bit; i++)
269 {
270 double prct = (double) histogram[i] * 100 / loop_count;
271
272 rprct += prct;
273 printf("%*ld %*.4f %*.4f %*lld\n",
274 len1, (1L << i) - 1,
275 len2, prct,
276 len3, rprct,
277 len4, histogram[i]);
278 }
279
280 printf(_("\nObserved timing durations up to %.4f%%:\n"), max_rprct);
281 printf("%*s %*s %*s %*s\n",
282 len1, header1b,
283 len2, header2,
284 len3, header3,
285 len4, header4);
286
287 rprct = 0;
288 for (int i = 0; i < NUM_DIRECT; i++)
289 {
290 if (direct_histogram[i])
291 {
292 double prct = (double) direct_histogram[i] * 100 / loop_count;
293 bool print_it = !stopped;
294
295 rprct += prct;
296
297 /* if largest diff is < NUM_DIRECT, be sure we print it */
298 if (i == largest_diff)
299 {
300 if (stopped)
301 printf("...\n");
302 print_it = true;
303 }
304
305 if (print_it)
306 printf("%*d %*.4f %*.4f %*lld\n",
307 len1, i,
308 len2, prct,
309 len3, rprct,
310 len4, direct_histogram[i]);
311 if (rprct >= max_rprct)
312 stopped = true;
313 }
314 }
315
316 /* print largest diff when it's outside the array range */
318 {
319 double prct = (double) largest_diff_count * 100 / loop_count;
320
321 printf("...\n");
322 printf("%*d %*.4f %*.4f %*lld\n",
323 len1, largest_diff,
324 len2, prct,
325 len3, 100.0,
326 len4, largest_diff_count);
327 }
328}
#define Max(x, y)
Definition: c.h:998
#define _(x)
Definition: elog.c:91
int i
Definition: isn.c:77
static long long int histogram[32]
static int32 largest_diff
static long long int largest_diff_count
static double max_rprct
#define NUM_DIRECT
static long long int direct_histogram[NUM_DIRECT]
#define printf(...)
Definition: port.h:245

Referenced by _crypt_blowfish_rn(), _crypt_gensalt_blowfish_rn(), _crypt_gensalt_extended_rn(), _crypt_gensalt_md5_rn(), _crypt_gensalt_sha(), _crypt_gensalt_sha256_rn(), _crypt_gensalt_sha512_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(), generate_error_response(), get_bin_version(), get_control_data(), GetSafeSnapshotBlockingPids(), helpSQL(), helpVariables(), main(), oauth_exchange(), pad_output(), pg_checksum_final(), pg_GSS_read(), pg_GSS_write(), pg_localeconv_r(), 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(), select_loop(), set_option(), slashUsage(), statext_dependencies_serialize(), statext_ndistinct_serialize(), test_shm_mq_setup(), to_chars(), to_chars_df(), to_chars_f(), transformJsonConstructorOutput(), transformJsonOutput(), transformJsonParseExpr(), transformJsonReturning(), transformJsonScalarExpr(), usage(), wait_on_slots(), 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