mirror of
https://github.com/postgres/postgres.git
synced 2026-02-18 18:25:17 -05:00
Don't move parenthesized lines to the left, even if that means they flow past the right margin. By default, BSD indent lines up statement continuation lines that are within parentheses so that they start just to the right of the preceding left parenthesis. However, traditionally, if that resulted in the continuation line extending to the right of the desired right margin, then indent would push it left just far enough to not overrun the margin, if it could do so without making the continuation line start to the left of the current statement indent. That makes for a weird mix of indentations unless one has been completely rigid about never violating the 80-column limit. This behavior has been pretty universally panned by Postgres developers. Hence, disable it with indent's new -lpl switch, so that parenthesized lines are always lined up with the preceding left paren. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
58 lines
1.5 KiB
C
58 lines
1.5 KiB
C
/*
|
|
* common.h
|
|
* Common support routines for bin/scripts/
|
|
*
|
|
* Copyright (c) 2003-2017, PostgreSQL Global Development Group
|
|
*
|
|
* src/bin/scripts/common.h
|
|
*/
|
|
#ifndef COMMON_H
|
|
#define COMMON_H
|
|
|
|
#include "common/username.h"
|
|
#include "libpq-fe.h"
|
|
#include "getopt_long.h" /* pgrminclude ignore */
|
|
#include "pqexpbuffer.h" /* pgrminclude ignore */
|
|
|
|
enum trivalue
|
|
{
|
|
TRI_DEFAULT,
|
|
TRI_NO,
|
|
TRI_YES
|
|
};
|
|
|
|
extern bool CancelRequested;
|
|
|
|
typedef void (*help_handler) (const char *progname);
|
|
|
|
extern void handle_help_version_opts(int argc, char *argv[],
|
|
const char *fixed_progname,
|
|
help_handler hlp);
|
|
|
|
extern PGconn *connectDatabase(const char *dbname, const char *pghost,
|
|
const char *pgport, const char *pguser,
|
|
enum trivalue prompt_password, const char *progname,
|
|
bool fail_ok, bool allow_password_reuse);
|
|
|
|
extern PGconn *connectMaintenanceDatabase(const char *maintenance_db,
|
|
const char *pghost, const char *pgport, const char *pguser,
|
|
enum trivalue prompt_password, const char *progname);
|
|
|
|
extern PGresult *executeQuery(PGconn *conn, const char *query,
|
|
const char *progname, bool echo);
|
|
|
|
extern void executeCommand(PGconn *conn, const char *query,
|
|
const char *progname, bool echo);
|
|
|
|
extern bool executeMaintenanceCommand(PGconn *conn, const char *query,
|
|
bool echo);
|
|
|
|
extern bool yesno_prompt(const char *question);
|
|
|
|
extern void setup_cancel_handler(void);
|
|
|
|
extern void SetCancelConn(PGconn *conn);
|
|
extern void ResetCancelConn(void);
|
|
|
|
|
|
#endif /* COMMON_H */
|