Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
0a761375
Commit
0a761375
authored
Oct 31, 1996
by
Marc G. Fournier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move these files to ${SRCDIR}/include
parent
5565d32e
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
1179 deletions
+0
-1179
src/backend/include/c.h
src/backend/include/c.h
+0
-768
src/backend/include/miscadmin.h
src/backend/include/miscadmin.h
+0
-185
src/backend/include/postgres.h
src/backend/include/postgres.h
+0
-226
No files found.
src/backend/include/c.h
deleted
100644 → 0
View file @
5565d32e
This diff is collapsed.
Click to expand it.
src/backend/include/miscadmin.h
deleted
100644 → 0
View file @
5565d32e
/*-------------------------------------------------------------------------
*
* miscadmin.h--
* this file contains general postgres administration and initialization
* stuff that used to be spread out between the following files:
* globals.h global variables
* magic.h PG_RELEASE, PG_VERSION, etc defines
* pdir.h directory path crud
* pinit.h postgres initialization
* pmod.h processing modes
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: miscadmin.h,v 1.6 1996/10/31 05:53:43 momjian Exp $
*
* NOTES
* some of the information in this file will be moved to
* other files.
*
*-------------------------------------------------------------------------
*/
#ifndef MISCADMIN_H
#define MISCADMIN_H
/*****************************************************************************
* globals.h -- *
*****************************************************************************/
#include "postgres.h"
/* #include "storage/sinval.h" */
/*
* from postmaster/postmaster.c
*/
extern
int
PostmasterMain
(
int
argc
,
char
*
argv
[]);
/*
* from utils/init/globals.c
*/
extern
int
Portfd
;
extern
int
Noversion
;
/* moved from magic.c */
extern
int
MasterPid
;
/* declared and defined in utils/initglobals.c */
extern
int
Quiet
;
extern
char
*
DataDir
;
extern
char
OutputFileName
[];
extern
void
InitGlobals
(
void
);
/*
* done in storage/backendid.h for now.
*
* extern BackendId MyBackendId;
* extern BackendTag MyBackendTag;
*/
extern
bool
MyDatabaseIdIsInitialized
;
extern
Oid
MyDatabaseId
;
extern
bool
TransactionInitWasProcessed
;
extern
bool
IsUnderPostmaster
;
extern
bool
IsPostmaster
;
extern
short
DebugLvl
;
extern
Oid
LastOidProcessed
;
/* for query rewrite */
#define MAX_PARSE_BUFFER 8192
/*
* default number of buffers in buffer pool
*
*/
#define NDBUFS 64
/*****************************************************************************
* magic.h - definitions of the indexes of the magic numbers *
*****************************************************************************/
#define PG_RELEASE 6
#define PG_VERSION 0
#define PG_VERFILE "PG_VERSION"
/*****************************************************************************
* pdir.h -- *
* POSTGRES directory path definitions. *
*****************************************************************************/
/* now in utils/init/miscinit.c */
extern
char
*
GetDatabasePath
(
void
);
extern
char
*
GetDatabaseName
(
void
);
extern
void
SetDatabaseName
(
char
*
name
);
extern
void
SetDatabasePath
(
char
*
path
);
extern
char
*
GetPgUserName
(
void
);
extern
void
SetPgUserName
(
void
);
extern
Oid
GetUserId
(
void
);
extern
void
SetUserId
(
void
);
extern
char
*
GetPGHome
(
void
);
extern
char
*
GetPGData
(
void
);
extern
int
ValidateBackend
(
char
*
path
);
extern
int
FindBackend
(
char
*
backend
,
char
*
argv0
);
extern
int
CheckPathAccess
(
char
*
path
,
char
*
name
,
int
open_mode
);
/*****************************************************************************
* pmod.h -- *
* POSTGRES processing mode definitions. *
*****************************************************************************/
/*
* Description:
* There are four processing modes in POSTGRES. They are NoProcessing
* or "none," BootstrapProcessing or "bootstrap," InitProcessing or
* "initialization," and NormalProcessing or "normal."
*
* If a POSTGRES binary is in normal mode, then all code may be executed
* normally. In the none mode, only bookkeeping code may be called. In
* particular, access method calls may not occur in this mode since the
* execution state is outside a transaction.
*
* The final two processing modes are used during special times. When the
* system state indicates bootstrap processing, transactions are all given
* transaction id "one" and are consequently guarenteed to commit. This mode
* is used during the initial generation of template databases.
*
* Finally, the execution state is in initialization mode until all normal
* initialization is complete. Some code behaves differently when executed in
* this mode to enable system bootstrapping.
*/
typedef
enum
ProcessingMode
{
NoProcessing
,
/* "nothing" can be done */
BootstrapProcessing
,
/* bootstrap creation of template database */
InitProcessing
,
/* initializing system */
NormalProcessing
/* normal processing */
}
ProcessingMode
;
/*****************************************************************************
* pinit.h -- *
* POSTGRES initialization and cleanup definitions. *
*****************************************************************************/
/*
* Note:
* XXX AddExitHandler not defined yet.
*/
typedef
int16
ExitStatus
;
#define NormalExitStatus (0)
#define FatalExitStatus (127)
/* XXX are there any other meaningful exit codes? */
/* in utils/init/postinit.c */
extern
void
InitMyDatabaseId
(
void
);
extern
void
DoChdirAndInitDatabaseNameAndPath
(
char
*
name
,
char
*
path
);
extern
void
InitUserid
(
void
);
extern
void
InitCommunication
(
void
);
extern
void
InitStdio
(
void
);
extern
bool
PostgresIsInitialized
;
extern
void
InitPostgres
(
char
*
name
);
/* in miscinit.c */
extern
void
ExitPostgres
(
ExitStatus
status
);
extern
void
AbortPostgres
(
void
);
extern
void
StatusBackendExit
(
int
status
);
extern
void
StatusPostmasterExit
(
int
status
);
extern
bool
IsNoProcessingMode
(
void
);
extern
bool
IsBootstrapProcessingMode
(
void
);
extern
bool
IsInitProcessingMode
(
void
);
extern
bool
IsNormalProcessingMode
(
void
);
extern
void
SetProcessingMode
(
ProcessingMode
mode
);
extern
ProcessingMode
GetProcessingMode
(
void
);
/*
* Prototypes for utils/init/magic.c
*/
extern
int
DatabaseMetaGunkIsConsistent
(
const
char
*
database
,
char
*
path
);
extern
int
ValidPgVersion
(
const
char
*
path
);
extern
void
SetPgVersion
(
const
char
*
path
);
#endif
/* MISCADMIN_H */
src/backend/include/postgres.h
deleted
100644 → 0
View file @
5565d32e
/*-------------------------------------------------------------------------
*
* postgres.h--
* definition of (and support for) postgres system types.
* this file is included by almost every .c in the system
*
* Copyright (c) 1995, Regents of the University of California
*
* $Id: postgres.h,v 1.5 1996/10/18 18:28:33 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
/*
* NOTES
* this file will eventually contain the definitions for the
* following (and perhaps other) system types:
*
* int2 int4 float4 float8
* Oid regproc RegProcedure
* aclitem
* struct varlena
* char8 char16 int28 oid8
* bytea text
* NameData Name
* oidint4 oidint2 oidname
*
* TABLE OF CONTENTS
* 1) simple type definitions
* 2) varlena and array types
* 3) TransactionId and CommandId
* 4) genbki macros used by catalog/pg_xxx.h files
* 5) random SIGNBIT, MAXPGPATH, STATUS macros
*
* ----------------------------------------------------------------
*/
#ifndef POSTGRES_H
#define POSTGRES_H
#include "config.h"
#include "c.h"
#include "utils/elog.h"
/* ----------------------------------------------------------------
* Section 1: simple type definitions
* ----------------------------------------------------------------
*/
typedef
int16
int2
;
typedef
int32
int4
;
typedef
float
float4
;
typedef
double
float8
;
typedef
int4
aclitem
;
typedef
uint32
Oid
;
#define InvalidOid 0
#define OidIsValid(objectId) ((bool) (objectId != InvalidOid))
/* unfortunately, both regproc and RegProcedure are used */
typedef
Oid
regproc
;
typedef
Oid
RegProcedure
;
/* ptr to func returning (char *) */
typedef
char
*
((
*
func_ptr
)());
#define RegProcedureIsValid(p) OidIsValid(p)
/* ----------------------------------------------------------------
* Section 2: variable length and array types
* ----------------------------------------------------------------
*/
/* ----------------
* struct varlena
* ----------------
*/
struct
varlena
{
int32
vl_len
;
char
vl_dat
[
1
];
};
#define VARSIZE(PTR) (((struct varlena *)(PTR))->vl_len)
#define VARDATA(PTR) (((struct varlena *)(PTR))->vl_dat)
#define VARHDRSZ sizeof(int32)
typedef
struct
varlena
bytea
;
typedef
struct
varlena
text
;
typedef
struct
char8
{
char
data
[
8
];
}
char8
;
/* ----------------
* char16
* ----------------
*/
typedef
struct
char16
{
char
data
[
16
];
}
char16
;
typedef
char16
*
Char16
;
typedef
int2
int28
[
8
];
typedef
Oid
oid8
[
8
];
/* char16 is distinct from Name.
now, you can truly change the max length of system names
by altering the NAMEDATALEN define below.
don't set the value too high because tuples are still constrained
to be less than 8K
*/
/* NAMEDATALEN is the maximum string length (counting terminating null)
of a Name */
/* defined in Makefile.global */
/* if you change the value of NAMEDATALEN, you may need to change the
alignment of the 'name' type in pg_type.h */
#ifndef NAMEDATALEN
#define NAMEDATALEN 16
#endif
/* NAMEDATALEN */
/* OIDNAMELEN should be NAMEDATALEN + sizeof(Oid) */
#ifndef OIDNAMELEN
#define OIDNAMELEN 20
#endif
/* OIDNAMELEN */
typedef
struct
nameData
{
char
data
[
NAMEDATALEN
];
}
NameData
;
typedef
NameData
*
Name
;
/* ----------------
* oidint4
*
* this is a new system type used by the file interface.
* ----------------
*/
typedef
struct
OidInt4Data
{
Oid
oi_oid
;
int32
oi_int4
;
}
OidInt4Data
;
typedef
struct
OidInt4Data
*
OidInt4
;
/* ----------------
* oidint2
*
* this is a new system type used to define indices on two attrs.
* ----------------
*/
typedef
struct
OidInt2Data
{
Oid
oi_oid
;
int16
oi_int2
;
}
OidInt2Data
;
typedef
struct
OidInt2Data
*
OidInt2
;
/* ----------------
* oidname
*
* this is a new system type used to define indices on two attrs.
* ----------------
*/
typedef
struct
OidNameData
{
Oid
id
;
NameData
name
;
}
OidNameData
;
typedef
struct
OidNameData
*
OidName
;
/* ----------------------------------------------------------------
* Section 3: TransactionId and CommandId
* ----------------------------------------------------------------
*/
typedef
uint32
TransactionId
;
#define InvalidTransactionId 0
typedef
uint16
CommandId
;
#define FirstCommandId 0
/* ----------------------------------------------------------------
* Section 4: genbki macros used by the
* catalog/pg_xxx.h files
* ----------------------------------------------------------------
*/
#define CATALOG(x) \
typedef struct CppConcat(FormData_,x)
#define DATA(x) extern int errno
#define DECLARE_INDEX(x) extern int errno
#define BUILD_INDICES
#define BOOTSTRAP
#define BKI_BEGIN
#define BKI_END
/* ----------------------------------------------------------------
* Section 5: random stuff
* SIGNBIT, MAXPGPATH, STATUS...
* ----------------------------------------------------------------
*/
/* msb for int/unsigned */
#define SIGNBIT (0x8000)
/* msb for char */
#define CSIGNBIT (1 << 7)
/* ----------------
* global variables which should probably go someplace else.
* ----------------
*/
#define MAXPGPATH 128
#define STATUS_OK (0)
#define STATUS_ERROR (-1)
#define STATUS_NOT_FOUND (-2)
#define STATUS_INVALID (-3)
#define STATUS_UNCATALOGUED (-4)
#define STATUS_REPLACED (-5)
#define STATUS_NOT_DONE (-6)
#define STATUS_BAD_PACKET (-7)
#define STATUS_FOUND (1)
#endif
/* POSTGRES_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment