Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
09bb369d
Commit
09bb369d
authored
28 years ago
by
Bryan Henderson
Browse files
Options
Downloads
Patches
Plain Diff
Separate general purpose functions from portal functions so they may be
used in test drivers.
parent
6d70d550
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/backend/libpq/Makefile.inc
+5
-3
5 additions, 3 deletions
src/backend/libpq/Makefile.inc
src/backend/libpq/portal.c
+5
-71
5 additions, 71 deletions
src/backend/libpq/portal.c
src/backend/libpq/util.c
+101
-0
101 additions, 0 deletions
src/backend/libpq/util.c
with
111 additions
and
74 deletions
src/backend/libpq/Makefile.inc
+
5
−
3
View file @
09bb369d
...
...
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/libpq/Attic/Makefile.inc,v 1.
1.1.1
1996/
07/09 06:21:30 scrappy
Exp $
# $Header: /cvsroot/pgsql/src/backend/libpq/Attic/Makefile.inc,v 1.
2
1996/
10/11 09:47:11 bryanh
Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -21,6 +21,8 @@ SRCS_LIBPQ= be-dumpdata.c be-fsstubs.c be-pqexec.c
#
# These files are shared with the frontend library.
#
SRCS_LIBPQ
+=
auth.c pqcomm.c portal.c portalbuf.c pqpacket.c pqsignal.c
SRCS_LIBPQ
+=
auth.c hba.c pqcomm.c portal.c util.c portalbuf.c
\
pqpacket.c pqsignal.c
HEADERS
+=
auth.h be-fsstubs.h libpq-be.h libpq-fs.h libpq.h pqcomm.h pqsignal.h
HEADERS
+=
auth.h hba.h be-fsstubs.h libpq-be.h libpq-fs.h libpq.h
\
pqcomm.h pqsignal.h
This diff is collapsed.
Click to expand it.
src/backend/libpq/portal.c
+
5
−
71
View file @
09bb369d
...
...
@@ -7,17 +7,11 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.
1.1.1
1996/
07/09 06:21:30 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.
2
1996/
10/11 09:47:13 bryanh
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
*
* INTERFACE ROUTINES
* PQnportals - Return the number of open portals.
* PQpnames - Return all the portal names
...
...
@@ -70,18 +64,11 @@
#include
"utils/exc.h"
#include
"utils/palloc.h"
/* ----------------
* 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
];
int
PQtracep
=
0
;
/* 1 to print out debugging messages */
FILE
*
debug_port
=
(
FILE
*
)
NULL
;
/* ----------------------------------------------------------------
* Helper routines for PQ portal interface routines below
* ----------------------------------------------------------------
*/
static
int
in_range
(
char
*
msg
,
int
value
,
int
min
,
int
max
)
...
...
@@ -108,59 +95,6 @@ valid_pointer(char *msg, void *ptr)
return
(
1
);
}
/* ----------------------------------------------------------------
* 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
"
);
}
}
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
"
);
}
}
/* --------------------------------
* PQtrace() / PQuntrace()
* --------------------------------
*/
void
PQtrace
()
{
PQtracep
=
1
;
}
void
PQuntrace
()
{
PQtracep
=
0
;
}
/* ----------------------------------------------------------------
* PQ portal interface routines
...
...
This diff is collapsed.
Click to expand it.
src/backend/libpq/util.c
0 → 100644
+
101
−
0
View file @
09bb369d
/*-------------------------------------------------------------------------
*
* util.c--
* 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.1 1996/10/11 09:47:14 bryanh 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
*/
#include
<stdio.h>
/* for sprintf() */
#include
<string.h>
#include
"c.h"
#include
"lib/dllist.h"
#include
"libpq/libpq.h"
/* where the declarations go */
#include
"utils/exc.h"
#include
"utils/palloc.h"
/* ----------------
* 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
];
int
PQtracep
=
0
;
/* 1 to print out debugging messages */
FILE
*
debug_port
=
(
FILE
*
)
NULL
;
/* ----------------------------------------------------------------
* 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
"
);
}
}
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
"
);
}
}
/* --------------------------------
* PQtrace() / PQuntrace()
* --------------------------------
*/
void
PQtrace
()
{
PQtracep
=
1
;
}
void
PQuntrace
()
{
PQtracep
=
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment