mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 23:23:04 +01:00
CORE-1758 - added forgotten new files
This commit is contained in:
parent
2946e810a4
commit
f3ed005757
58
src/utilities/nbackup/nbkMain.cpp
Normal file
58
src/utilities/nbackup/nbkMain.cpp
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* PROGRAM: Firebird utilities
|
||||
* MODULE: nbkMain.cpp
|
||||
* DESCRIPTION: Proxy for real nbackup main function
|
||||
*
|
||||
* The contents of this file are subject to the Initial
|
||||
* Developer's Public License Version 1.0 (the "License");
|
||||
* you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
* http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
|
||||
*
|
||||
* Software distributed under the License is distributed AS IS,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing rights
|
||||
* and limitations under the License.
|
||||
*
|
||||
* The Original Code was created by Alex Peshkov
|
||||
* for the Firebird Open Source RDBMS project.
|
||||
*
|
||||
* Copyright (c) 2008 Alex Peshkov <peshkoff at mail dot ru>
|
||||
* and all contributors signed below.
|
||||
*
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
#include "../utilities/nbackup/nbk_proto.h"
|
||||
#include "../common/classes/auto.h"
|
||||
|
||||
|
||||
int CLIB_ROUTINE main(int argc, char* argv[])
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* m a i n
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Invoke real nbackup main function
|
||||
*
|
||||
**************************************/
|
||||
try
|
||||
{
|
||||
Firebird::AutoPtr<Firebird::UtilSvc> uSvc(Firebird::UtilSvc::createStandalone(argc, argv));
|
||||
nbackup(uSvc);
|
||||
}
|
||||
catch (const Firebird::Exception&)
|
||||
{
|
||||
// should be already printed, no need to print once more here
|
||||
return FINI_ERROR;
|
||||
}
|
||||
|
||||
return FINI_OK;
|
||||
}
|
36
src/utilities/nbackup/nbk_proto.h
Normal file
36
src/utilities/nbackup/nbk_proto.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* PROGRAM: Firebird utilities
|
||||
* MODULE: nbk_proto.h
|
||||
* DESCRIPTION: nbackup prototypes
|
||||
*
|
||||
* The contents of this file are subject to the Initial
|
||||
* Developer's Public License Version 1.0 (the "License");
|
||||
* you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
* http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
|
||||
*
|
||||
* Software distributed under the License is distributed AS IS,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing rights
|
||||
* and limitations under the License.
|
||||
*
|
||||
* The Original Code was created by Alex Peshkov
|
||||
* for the Firebird Open Source RDBMS project.
|
||||
*
|
||||
* Copyright (c) 2008 Alex Peshkov <peshkoff at mail dot ru>
|
||||
* and all contributors signed below.
|
||||
*
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
*/
|
||||
|
||||
#ifndef NBK_PROTO_H
|
||||
#define NBK_PROTO_H
|
||||
|
||||
#include "../jrd/ThreadData.h"
|
||||
#include "../common/UtilSvc.h"
|
||||
|
||||
void nbackup(Firebird::UtilSvc*);
|
||||
THREAD_ENTRY_DECLARE NBACKUP_main(THREAD_ENTRY_PARAM);
|
||||
|
||||
#endif // NBK_PROTO_H
|
61
src/utilities/nbackup/nbkswi.h
Normal file
61
src/utilities/nbackup/nbkswi.h
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* PROGRAM: Firebird utilities
|
||||
* MODULE: nbkswi.h
|
||||
* DESCRIPTION: nbackup switches
|
||||
*
|
||||
* The contents of this file are subject to the Initial
|
||||
* Developer's Public License Version 1.0 (the "License");
|
||||
* you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
* http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
|
||||
*
|
||||
* Software distributed under the License is distributed AS IS,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing rights
|
||||
* and limitations under the License.
|
||||
*
|
||||
* The Original Code was created by Alex Peshkov
|
||||
* for the Firebird Open Source RDBMS project.
|
||||
*
|
||||
* Copyright (c) 2008 Alex Peshkov <peshkoff at mail dot ru>
|
||||
* and all contributors signed below.
|
||||
*
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
*/
|
||||
|
||||
#ifndef NBACKUP_NBKSWI_H
|
||||
#define NBACKUP_NBKSWI_H
|
||||
|
||||
#include "../jrd/common.h"
|
||||
#include "../jrd/constants.h"
|
||||
|
||||
// Switch handling constants
|
||||
|
||||
const int IN_SW_NBK_0 = 0;
|
||||
const int IN_SW_NBK_LOCK = 1;
|
||||
const int IN_SW_NBK_UNLOCK = 2;
|
||||
const int IN_SW_NBK_FIXUP = 3;
|
||||
const int IN_SW_NBK_BACKUP = 4;
|
||||
const int IN_SW_NBK_RESTORE = 5;
|
||||
const int IN_SW_NBK_NODBTRIG = 6;
|
||||
const int IN_SW_NBK_USER_NAME = 7;
|
||||
const int IN_SW_NBK_PASSWORD = 8;
|
||||
const int IN_SW_NBK_SIZE = 9;
|
||||
|
||||
// taking into an account that this is used only by services, describe only interesting switches
|
||||
|
||||
static const struct in_sw_tab_t nbackup_in_sw_table [] =
|
||||
{
|
||||
{IN_SW_NBK_NODBTRIG, isc_spb_nbk_no_triggers, "T", 0, 0, 0, FALSE, 0, 1, NULL},
|
||||
{IN_SW_NBK_0, 0, NULL, 0, 0, 0, FALSE, 0, 0, NULL} // End of List
|
||||
};
|
||||
|
||||
static const struct in_sw_tab_t nbackup_action_in_sw_table [] =
|
||||
{
|
||||
{IN_SW_NBK_BACKUP, isc_action_svc_nbak, "B", 0, 0, 0, FALSE, 0, 1, NULL},
|
||||
{IN_SW_NBK_RESTORE, isc_action_svc_nrest, "R", 0, 0, 0, FALSE, 0, 1, NULL},
|
||||
{IN_SW_NBK_0, 0, NULL, 0, 0, 0, FALSE, 0, 0, NULL} // End of List
|
||||
};
|
||||
#endif // NBACKUP_NBKSWI_H
|
||||
|
Loading…
Reference in New Issue
Block a user