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
72e7f0d4
Commit
72e7f0d4
authored
Aug 01, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing file.
parent
cc07f8cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
154 additions
and
0 deletions
+154
-0
src/bin/pg_config/pg_config.c
src/bin/pg_config/pg_config.c
+154
-0
No files found.
src/bin/pg_config/pg_config.c
0 → 100644
View file @
72e7f0d4
/*-------------------------------------------------------------------------
*
* pg_config.c
*
* This program reports various pieces of information about the
* installed version of PostgreSQL. Packages that interface to
* PostgreSQL can use it to configure their build.
*
* This is a C implementation of the previous shell script written by
* Peter Eisentraut <peter_e@gmx.net>, with adjustments made to
* accomodate the possibility that the installation has been relocated from
* the place originally configured.
*
* author of C translation: Andrew Dunstan mailto:andrew@dunslane.net
*
* This code is released under the terms of the PostgreSQL License.
*
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.1 2004/08/01 13:54:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "port.h"
#include <stdio.h>
#define _(x) gettext((x))
char
*
progname
;
static
void
help
()
{
printf
(
_
(
"
\n
%s provides information about the installed version of PostgreSQL.
\n\n
"
),
progname
);
printf
(
_
(
"Usage:
\n
"
));
printf
(
_
(
" %s OPTION...
\n\n
"
),
progname
);
printf
(
_
(
"Options:
\n
"
));
printf
(
_
(
" --bindir show location of user executables
\n
"
));
printf
(
_
(
" --includedir show location of C header files of the client
\n
"
));
printf
(
_
(
" interfaces
\n
"
));
printf
(
_
(
" --includedir-server show location of C header files for the server
\n
"
));
printf
(
_
(
" --libdir show location of object code libraries
\n
"
));
printf
(
_
(
" --pkglibdir show location of dynamically loadable modules
\n
"
));
printf
(
_
(
" --configure show options given to 'configure' script when
\n
"
));
printf
(
_
(
" PostgreSQL was built
\n
"
));
printf
(
_
(
" --version show the PostgreSQL version, then exit
\n
"
));
printf
(
_
(
" --help show this help, then exit
\n\n
"
));
printf
(
_
(
"Report bugs to <pgsql-bugs@postgresql.org>.
\n
"
));
}
static
void
advice
()
{
fprintf
(
stderr
,
_
(
"
\n
Try
\"
%s --help
\"
for more information
\n
"
),
progname
);
}
int
main
(
int
argc
,
char
**
argv
)
{
int
i
;
int
ret
;
char
mypath
[
MAXPGPATH
];
char
otherpath
[
MAXPGPATH
];
progname
=
(
char
*
)
get_progname
(
argv
[
0
]);
if
(
argc
<
2
)
{
fprintf
(
stderr
,
_
(
"%s: argument required
\n
"
),
progname
);
advice
();
exit
(
1
);
}
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
strcmp
(
argv
[
i
],
"--bindir"
)
==
0
||
strcmp
(
argv
[
i
],
"--includedir"
)
==
0
||
strcmp
(
argv
[
i
],
"--includedir-server"
)
==
0
||
strcmp
(
argv
[
i
],
"--libdir"
)
==
0
||
strcmp
(
argv
[
i
],
"--pkglibdir"
)
==
0
||
strcmp
(
argv
[
i
],
"--configure"
)
==
0
)
{
/* come back to these later */
continue
;
}
if
(
strcmp
(
argv
[
i
],
"--version"
)
==
0
)
{
printf
(
"PostgreSQL "
PG_VERSION
"
\n
"
);
exit
(
0
);
}
if
(
strcmp
(
argv
[
i
],
"--help"
)
==
0
||
strcmp
(
argv
[
i
],
"-?"
)
==
0
)
{
help
();
exit
(
0
);
}
fprintf
(
stderr
,
_
(
"%s: invalid argument: %s
\n
"
),
progname
,
argv
[
i
]);
advice
();
exit
(
1
);
}
ret
=
find_my_exec
(
argv
[
0
],
mypath
);
if
(
ret
)
{
fprintf
(
stderr
,
"%s: could not locate my own executable
\n
"
,
progname
);
exit
(
1
);
}
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
strcmp
(
argv
[
i
],
"--configure"
)
==
0
)
{
/* the VAL_CONFIGURE macro must be defined by the Makefile */
printf
(
"%s
\n
"
,
VAL_CONFIGURE
);
continue
;
}
if
(
strcmp
(
argv
[
i
],
"--bindir"
)
==
0
)
{
/* assume we are located in the bindir */
char
*
lastsep
;
strcpy
(
otherpath
,
mypath
);
lastsep
=
strrchr
(
otherpath
,
'/'
);
if
(
lastsep
)
*
lastsep
=
'\0'
;
}
else
if
(
strcmp
(
argv
[
i
],
"--includedir"
)
==
0
)
get_include_path
(
mypath
,
otherpath
);
else
if
(
strcmp
(
argv
[
i
],
"--includedir-server"
)
==
0
)
get_includeserver_path
(
mypath
,
otherpath
);
else
if
(
strcmp
(
argv
[
i
],
"--libdir"
)
==
0
)
get_lib_path
(
mypath
,
otherpath
);
else
if
(
strcmp
(
argv
[
i
],
"--pkglibdir"
)
==
0
)
get_pkglib_path
(
mypath
,
otherpath
);
printf
(
"%s
\n
"
,
otherpath
);
}
return
0
;
}
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