mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Massive commit to run PGINDENT on all *.c and *.h files.
This commit is contained in:
@@ -1,100 +1,100 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* util.c--
|
||||
* general routines for libpq backend
|
||||
* general routines for libpq backend
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/util.c,v 1.3 1996/11/06 08:48:33 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/util.c,v 1.4 1997/09/07 04:42:31 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
/*
|
||||
* UTILITY ROUTINES
|
||||
* pqdebug - send a string to the debugging output port
|
||||
* pqdebug2 - send two strings to stdout
|
||||
* PQtrace - turn on pqdebug() tracing
|
||||
* PQuntrace - turn off pqdebug() tracing
|
||||
* UTILITY ROUTINES
|
||||
* pqdebug - send a string to the debugging output port
|
||||
* pqdebug2 - send two strings to stdout
|
||||
* PQtrace - turn on pqdebug() tracing
|
||||
* PQuntrace - turn off pqdebug() tracing
|
||||
*/
|
||||
|
||||
#include <stdio.h> /* for sprintf() */
|
||||
#include <stdio.h> /* for sprintf() */
|
||||
#include <string.h>
|
||||
|
||||
#include <postgres.h>
|
||||
#include <lib/dllist.h>
|
||||
#include <libpq/libpq.h> /* where the declarations go */
|
||||
#include <libpq/libpq.h> /* where the declarations go */
|
||||
#include <utils/exc.h>
|
||||
|
||||
|
||||
/* ----------------
|
||||
* exceptions
|
||||
* exceptions
|
||||
* ----------------
|
||||
*/
|
||||
Exception MemoryError = {"Memory Allocation Error"};
|
||||
Exception PortalError = {"Invalid arguments to portal functions"};
|
||||
Exception PostquelError = {"Sql Error"};
|
||||
Exception ProtocolError = {"Protocol Error"};
|
||||
char PQerrormsg[ERROR_MSG_LENGTH];
|
||||
Exception MemoryError = {"Memory Allocation Error"};
|
||||
Exception PortalError = {"Invalid arguments to portal functions"};
|
||||
Exception PostquelError = {"Sql Error"};
|
||||
Exception ProtocolError = {"Protocol Error"};
|
||||
char PQerrormsg[ERROR_MSG_LENGTH];
|
||||
|
||||
int PQtracep = 0; /* 1 to print out debugging messages */
|
||||
FILE *debug_port = (FILE *) NULL;
|
||||
int PQtracep = 0; /* 1 to print out debugging messages */
|
||||
FILE *debug_port = (FILE *) NULL;
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* PQ utility routines
|
||||
* PQ utility routines
|
||||
* ----------------------------------------------------------------
|
||||
*/
|
||||
void
|
||||
pqdebug(char *target, char *msg)
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
if (PQtracep) {
|
||||
/*
|
||||
* if nothing else was suggested default to stdout
|
||||
*/
|
||||
if (!debug_port)
|
||||
debug_port = stdout;
|
||||
fprintf(debug_port, target, msg);
|
||||
fprintf(debug_port, "\n");
|
||||
}
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
if (PQtracep)
|
||||
{
|
||||
|
||||
/*
|
||||
* if nothing else was suggested default to stdout
|
||||
*/
|
||||
if (!debug_port)
|
||||
debug_port = stdout;
|
||||
fprintf(debug_port, target, msg);
|
||||
fprintf(debug_port, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
pqdebug2(char *target, char *msg1, char *msg2)
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
if (PQtracep) {
|
||||
/*
|
||||
* if nothing else was suggested default to stdout
|
||||
*/
|
||||
if (!debug_port)
|
||||
debug_port = stdout;
|
||||
fprintf(debug_port, target, msg1, msg2);
|
||||
fprintf(debug_port, "\n");
|
||||
}
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
if (PQtracep)
|
||||
{
|
||||
|
||||
/*
|
||||
* if nothing else was suggested default to stdout
|
||||
*/
|
||||
if (!debug_port)
|
||||
debug_port = stdout;
|
||||
fprintf(debug_port, target, msg1, msg2);
|
||||
fprintf(debug_port, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* --------------------------------
|
||||
* PQtrace() / PQuntrace()
|
||||
* PQtrace() / PQuntrace()
|
||||
* --------------------------------
|
||||
*/
|
||||
void
|
||||
PQtrace()
|
||||
{
|
||||
PQtracep = 1;
|
||||
PQtracep = 1;
|
||||
}
|
||||
|
||||
void
|
||||
PQuntrace()
|
||||
{
|
||||
PQtracep = 0;
|
||||
PQtracep = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user