PostgreSQL Source Code
git master
|
#include "c.h"
#include <ctype.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "indent_globs.h"
#include "indent.h"
Go to the source code of this file.
Functions | |
static int | pad_output (int current, int target) |
void | dump_line (void) |
int | compute_code_target (void) |
int | compute_label_target (void) |
int | lookahead (void) |
void | lookahead_reset (void) |
void | fill_buffer (void) |
int | count_spaces_until (int cur, char *buffer, char *end) |
int | count_spaces (int cur, char *buffer) |
void | diag4 (int level, const char *msg, int a, int b) |
void | diag3 (int level, const char *msg, int a) |
void | diag2 (int level, const char *msg) |
Variables | |
int | comment_open |
static int | paren_target |
static char * | lookahead_buf |
static char * | lookahead_buf_end |
static char * | lookahead_start |
static char * | lookahead_ptr |
static char * | lookahead_end |
static char * | lookahead_bp_save |
int compute_code_target | ( | void | ) |
Definition at line 223 of file io.c.
References continuation_indent, count_spaces(), parser_state::ind_level, parser_state::ind_size, parser_state::ind_stmt, lineup_to_parens, lineup_to_parens_always, max_col, parser_state::paren_level, paren_target, ps, and s_code.
Referenced by dump_line(), main(), and pr_comment().
int compute_label_target | ( | void | ) |
Definition at line 252 of file io.c.
References case_ind, parser_state::ind_level, parser_state::ind_size, label_offset, parser_state::pcase, ps, and s_lab.
Referenced by dump_line(), and pr_comment().
int count_spaces | ( | int | cur, |
char * | buffer | ||
) |
Definition at line 550 of file io.c.
References count_spaces_until(), and cur.
Referenced by compute_code_target(), dump_line(), and pr_comment().
int count_spaces_until | ( | int | cur, |
char * | buffer, | ||
char * | end | ||
) |
Definition at line 517 of file io.c.
References buf, cur, and tabsize.
Referenced by count_spaces(), main(), and pr_comment().
void diag2 | ( | int | level, |
const char * | msg | ||
) |
void diag3 | ( | int | level, |
const char * | msg, | ||
int | a | ||
) |
void diag4 | ( | int | level, |
const char * | msg, | ||
int | a, | ||
int | b | ||
) |
void dump_line | ( | void | ) |
Definition at line 61 of file io.c.
References parser_state::bl_line, blanklines_after_declarations, parser_state::block_init, parser_state::block_init_level, code_lines, parser_state::com_col, parser_state::com_lines, combuf, parser_state::comment_delta, comment_open, compute_code_target(), compute_label_target(), count_spaces(), parser_state::decl_on_line, parser_state::dumped_decl_indent, e_code, e_com, e_lab, fprintf, i, parser_state::i_l_follow, parser_state::in_decl, parser_state::in_stmt, parser_state::ind_level, parser_state::ind_stmt, inhibit_formatting, parser_state::just_saw_decl, parser_state::n_comment_delta, n_real_blanklines, parser_state::out_lines, output, parser_state::p_l_follow, pad_output(), parser_state::paren_indents, parser_state::paren_level, paren_target, parser_state::pcase, postfix_blankline_requested, prefix_blankline_requested, parser_state::procname, ps, s_code, s_com, s_lab, suppress_blanklines, swallow_optional_blanklines, tabsize, and parser_state::use_ff.
Referenced by fill_buffer(), main(), and pr_comment().
void fill_buffer | ( | void | ) |
Definition at line 346 of file io.c.
References be_save, bp_save, buf_end, buf_ptr, dump_line(), e_code, e_com, e_lab, errx(), fill_buffer(), had_eof, i, in_buffer, in_buffer_limit, inhibit_formatting, input, lookahead_bp_save, lookahead_buf, lookahead_end, lookahead_ptr, lookahead_start, n_real_blanklines, output, postfix_blankline_requested, prefix_blankline_requested, realloc, s_code, s_com, s_lab, size, and suppress_blanklines.
Referenced by fill_buffer(), lexi(), main(), and pr_comment().
int lookahead | ( | void | ) |
Definition at line 275 of file io.c.
References be_save, errx(), i, input, lookahead_bp_save, lookahead_buf, lookahead_buf_end, lookahead_end, lookahead_ptr, lookahead_start, malloc, and realloc.
Referenced by is_func_definition().
void lookahead_reset | ( | void | ) |
Definition at line 320 of file io.c.
References bp_save, lookahead_bp_save, lookahead_ptr, and lookahead_start.
Referenced by is_func_definition().
|
static |
Definition at line 468 of file io.c.
References output, postgres_tab_rules, tabsize, and use_tabs.
Referenced by dump_line().
int comment_open |
Definition at line 48 of file io.c.
Referenced by dump_line().
|
static |
Definition at line 56 of file io.c.
Referenced by fill_buffer(), lookahead(), and lookahead_reset().
|
static |
Definition at line 51 of file io.c.
Referenced by fill_buffer(), and lookahead().
|
static |
Definition at line 52 of file io.c.
Referenced by lookahead().
|
static |
Definition at line 55 of file io.c.
Referenced by fill_buffer(), and lookahead().
|
static |
Definition at line 54 of file io.c.
Referenced by fill_buffer(), lookahead(), and lookahead_reset().
|
static |
Definition at line 53 of file io.c.
Referenced by fill_buffer(), lookahead(), and lookahead_reset().
|
static |
Definition at line 49 of file io.c.
Referenced by compute_code_target(), and dump_line().