/*---------------------------------------------------------------
 *   FILE
 *	main.c
 *
 *   DESCRIPTION
 *	Stub main() routine for the postgres backend.
 *
 *   NOTES
 *	Old comments:
 *	The reason that `main()' is defined in a separate file in a
 *	separate directory is to be able to easily link all the postgres
 *	code (as opposed to just cinterface.a) with test programs (which
 *	have their own `main').
 *
 *   IDENTIFICATION
 *	/usr/local/devel/postgres-4.2-devel/src/backend/main/RCS/main.c,v 1.9 1993/08/10 20:19:50 aoki Exp
 *---------------------------------------------------------------
 */

#include "tmp/c.h"

RcsId("/usr/local/devel/postgres-4.2-devel/src/backend/main/RCS/main.c,v 1.9 1993/08/10 20:19:50 aoki Exp");

#include <string.h>

char *DataDir;
extern char *GetPGData();

main(argc, argv)
	int argc;
	char *argv[];
{
#if defined(NOFIXADE) || defined(NOPRINTADE)
	/*
	 * Must be first so that the bootstrap code calls it, too.
	 * (Only needed on some RISC architectures.)
	 */
	init_address_fixup();
#endif /* NOFIXADE || NOPRINTADE */

	/* 
	 * set up DataDir here; it's used by the bootstrap and regular systems 
	 */
	DataDir = GetPGData();
	if (argc > 1 && strcmp(argv[1], "-boot") == 0)
		BootstrapMain(argc, argv);
	else
		PostgresMain(argc, argv);
}
