Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
144dc24
WIP
asfernandes Mar 6, 2026
26f6259
WIP
asfernandes Mar 6, 2026
175ee96
Move Why namespace inside Firebird
asfernandes Mar 6, 2026
a2d9941
WIP yvalve
asfernandes Mar 6, 2026
e717c82
Move obj.h and constants.h to common
asfernandes Mar 6, 2026
83b2416
Move Replication namespace to Firebird::Jrd::Replication
asfernandes Mar 6, 2026
20b6d74
Move namespace Ods to Firebird::Jrd::Ods
asfernandes Mar 6, 2026
ee1e474
WIP
asfernandes Mar 6, 2026
d8091e7
WIP
asfernandes Mar 6, 2026
502e110
WIP
asfernandes Mar 6, 2026
44095e1
WIP (revert)
asfernandes Mar 6, 2026
8029911
WIP
asfernandes Mar 6, 2026
eedd98a
WIP Jrd
asfernandes Mar 6, 2026
5f31d4d
WIP Jrd
asfernandes Mar 6, 2026
2959c97
WIP Jrd
asfernandes Mar 6, 2026
983e1ff
WIP Auth
asfernandes Mar 6, 2026
7139d49
WIP Alice
asfernandes Mar 6, 2026
4609057
WIP Burp
asfernandes Mar 6, 2026
37b3568
WIP Jrd
asfernandes Mar 6, 2026
ce337f3
WIP Jrd
asfernandes Mar 6, 2026
220262d
WIP Jrd
asfernandes Mar 6, 2026
a479dc8
WIP Jrd
asfernandes Mar 6, 2026
718f391
WIP Jrd
asfernandes Mar 6, 2026
fe2ef6c
WIP Jrd
asfernandes Mar 6, 2026
4f80c95
WIP Jrd
asfernandes Mar 6, 2026
195bd49
WIP Jrd
asfernandes Mar 6, 2026
700f303
WIP Jrd
asfernandes Mar 6, 2026
ef4d093
WIP Jrd
asfernandes Mar 6, 2026
02fe1db
WIP Jrd
asfernandes Mar 6, 2026
dc1c545
WIP Jrd
asfernandes Mar 6, 2026
cd26cfe
WIP Jrd
asfernandes Mar 6, 2026
f0dc387
WIP Jrd
asfernandes Mar 6, 2026
b2a84c3
WIP Jrd
asfernandes Mar 6, 2026
494ed8c
WIP Jrd
asfernandes Mar 6, 2026
60c287e
WIP Jrd
asfernandes Mar 6, 2026
e84e119
WIP Jrd
asfernandes Mar 6, 2026
5dccf12
WIP Jrd
asfernandes Mar 6, 2026
f7b452b
WIP Jrd
asfernandes Mar 6, 2026
40dd31e
WIP Jrd
asfernandes Mar 6, 2026
3036fc0
WIP Jrd
asfernandes Mar 6, 2026
bc2716b
WIP Jrd
asfernandes Mar 6, 2026
b282a24
WIP Jrd
asfernandes Mar 6, 2026
ebf18e3
WIP Jrd
asfernandes Mar 6, 2026
cb6fdc0
WIP Jrd
asfernandes Mar 6, 2026
d079410
WIP Jrd
asfernandes Mar 6, 2026
df67430
WIP Jrd
asfernandes Mar 6, 2026
f47dfc1
WIP Jrd
asfernandes Mar 6, 2026
020101a
WIP Jrd
asfernandes Mar 6, 2026
d930f49
WIP Jrd
asfernandes Mar 6, 2026
310a7aa
WIP Jrd
asfernandes Mar 6, 2026
fc5d205
WIP Jrd
asfernandes Mar 6, 2026
246baba
WIP Jrd
asfernandes Mar 6, 2026
6e77d8e
WIP Jrd
asfernandes Mar 6, 2026
b266339
WIP Jrd
asfernandes Mar 6, 2026
19970b8
WIP Jrd
asfernandes Mar 6, 2026
252d3c1
WIP Jrd
asfernandes Mar 6, 2026
3b3baae
WIP Jrd
asfernandes Mar 6, 2026
4c96f1f
WIP Jrd
asfernandes Mar 6, 2026
b12dea0
WIP Jrd
asfernandes Mar 6, 2026
abb25b5
WIP Jrd
asfernandes Mar 6, 2026
ccdde52
WIP
asfernandes Mar 6, 2026
50a15dc
WIP Jrd
asfernandes Mar 6, 2026
dec338c
WIP Remote
asfernandes Mar 6, 2026
f70681a
WIP Remote
asfernandes Mar 6, 2026
cc756e4
WIP Remote
asfernandes Mar 6, 2026
cdff1d5
WIP Why
asfernandes Mar 6, 2026
bb6b39b
WIP Isql
asfernandes Mar 6, 2026
c676809
WIP Isql
asfernandes Mar 6, 2026
646db08
WIP Alice
asfernandes Mar 6, 2026
05ca9bb
WIP Auth
asfernandes Mar 6, 2026
12a86bf
WIP Burp
asfernandes Mar 6, 2026
0839a09
WIP common
asfernandes Mar 6, 2026
5ed6b50
WIP common
asfernandes Mar 6, 2026
405d966
WIP common
asfernandes Mar 6, 2026
02675d1
WIP Gsec
asfernandes Mar 6, 2026
80d91d8
WIP NBackup
asfernandes Mar 6, 2026
c0729aa
WIP Ntrace
asfernandes Mar 6, 2026
3083996
WIP Gpre
asfernandes Mar 6, 2026
f965b82
WIP Gpre
asfernandes Mar 6, 2026
1abab33
Remove compatibility layers
asfernandes Mar 6, 2026
f6a1b86
WIP
asfernandes Mar 6, 2026
2a8bbe6
Remove compatibility layers
asfernandes Mar 6, 2026
ba528ae
WIP Why
asfernandes Mar 6, 2026
dee4b2f
WIP Why
asfernandes Mar 6, 2026
5530906
WIP Why
asfernandes Mar 6, 2026
fe98066
Remove compatibility layers
asfernandes Mar 6, 2026
d4af36e
Remove compatibility layers (Ods)
asfernandes Mar 6, 2026
4b8b119
Fix Windows build
asfernandes Mar 6, 2026
93c4472
Fix Linux build
asfernandes Mar 6, 2026
3f76736
Fix gpre in files with namespace blocks
asfernandes Mar 6, 2026
dcfb11d
WIP
asfernandes Mar 6, 2026
fdeb6df
WIP common
asfernandes Mar 6, 2026
9599c6f
Fix Windows build
asfernandes Mar 6, 2026
2646d9f
Fix
asfernandes Mar 6, 2026
0f67d8e
Fix MacOS build
asfernandes Mar 6, 2026
3307ff8
Fix Windows build
asfernandes Mar 6, 2026
9bb71b0
Fix Windows build
asfernandes Mar 6, 2026
df10841
Fix Windows build
asfernandes Mar 6, 2026
f9bfef8
WIP
asfernandes Mar 6, 2026
e005494
WIP
asfernandes Mar 6, 2026
c38c805
WIP
asfernandes Mar 6, 2026
70ac850
WIP
asfernandes Mar 6, 2026
b5e6216
Remove extra qualifications in parse.y
asfernandes Mar 6, 2026
1b782bf
Fix Windows build
asfernandes Mar 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 16 additions & 10 deletions src/alice/alice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
#include <io.h>
#endif

namespace Firebird::Alice
{

using MsgFormat::SafeArg;


Expand Down Expand Up @@ -90,7 +93,7 @@ constexpr int ALICE_MSG_FAC = FB_IMPL_MSG_FACILITY_GFIX;
[[noreturn]] void ALICE_exit(int code, AliceGlobals* tdgbl)
{
tdgbl->exit_code = code;
Firebird::LongJump::raise();
LongJump::raise();
}

static void alice_output(bool error, const SCHAR*, ...) ATTRIBUTE_FORMAT(2,3);
Expand All @@ -102,16 +105,16 @@ static void alice_output(bool error, const SCHAR*, ...) ATTRIBUTE_FORMAT(2,3);
// Entry point for GFIX in case of service manager.
//

int ALICE_main(Firebird::UtilSvc* uSvc)
int ALICE_main(UtilSvc* uSvc)
{
int exit_code = FINI_OK;

try {
exit_code = alice(uSvc);
}
catch (const Firebird::Exception& e)
catch (const Exception& e)
{
Firebird::StaticStatusVector status;
StaticStatusVector status;
e.stuffException(status);
uSvc->getStatusAccessor().setServiceStatus(status.begin());
uSvc->started();
Expand All @@ -127,7 +130,7 @@ int ALICE_main(Firebird::UtilSvc* uSvc)
// Parse switches and do work
//

int alice(Firebird::UtilSvc* uSvc)
int alice(UtilSvc* uSvc)
{
AliceGlobals gblInstance(uSvc);
AliceGlobals* tdgbl = &gblInstance;
Expand Down Expand Up @@ -579,16 +582,16 @@ int alice(Firebird::UtilSvc* uSvc)

} // try

catch (const Firebird::LongJump&)
catch (const LongJump&)
{
// All "calls" to ALICE_exit(), normal and error exits, wind up here
exit_code = tdgbl->exit_code;
}

catch (const Firebird::Exception& e)
catch (const Exception& e)
{
// Non-alice exception was caught
Firebird::StaticStatusVector status;
StaticStatusVector status;
e.stuffException(status);
fb_utils::copyStatus(tdgbl->status_vector, ISC_STATUS_LENGTH, status.begin(), status.getCount());
ALICE_print_status(true, tdgbl->status_vector);
Expand All @@ -607,7 +610,7 @@ int alice(Firebird::UtilSvc* uSvc)
if ((exit_code != FINI_OK) && uSvc->isService() &&
(tdgbl->status[0] == 1) && (tdgbl->status[1] != 0))
{
Firebird::UtilSvc::StatusAccessor sa = uSvc->getStatusAccessor();
UtilSvc::StatusAccessor sa = uSvc->getStatusAccessor();
sa.init();
uSvc->getStatusAccessor().setServiceStatus(tdgbl->status);
}
Expand Down Expand Up @@ -720,7 +723,7 @@ static void alice_output(bool error, const SCHAR* format, ...)

va_list arglist;
va_start(arglist, format);
Firebird::string buf;
string buf;
buf.vprintf(format, arglist);
va_end(arglist);

Expand All @@ -729,3 +732,6 @@ static void alice_output(bool error, const SCHAR* format, ...)
else
tdgbl->uSvc->outputVerbose(buf.c_str());
}


} // namespace Firebird::Alice
25 changes: 14 additions & 11 deletions src/alice/alice.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "../common/classes/array.h"
#include "../common/UtilSvc.h"

namespace Firebird::Alice {

enum val_errors {
VAL_INVALID_DB_VERSION = 0,

Expand Down Expand Up @@ -105,16 +107,16 @@ struct tdr : public pool_alloc<alice_type_tdr>
{
tdr* tdr_next; // next sub-transaction
TraNumber tdr_id; // database-specific transaction id
Firebird::string tdr_fullpath; // full (possibly) remote pathname
Firebird::string tdr_filename; // filename
Firebird::string tdr_host_site; // host for transaction
Firebird::string tdr_remote_site; // site for remote transaction
string tdr_fullpath; // full (possibly) remote pathname
string tdr_filename; // filename
string tdr_host_site; // host for transaction
string tdr_remote_site; // site for remote transaction
FB_API_HANDLE tdr_handle; // reconnected transaction handle
FB_API_HANDLE tdr_db_handle; // re-attached database handle
USHORT tdr_db_caps; // capabilities of database
USHORT tdr_state; // see flags below

tdr(Firebird::MemoryPool& p)
tdr(MemoryPool& p)
: tdr_fullpath(p), tdr_filename(p), tdr_host_site(p), tdr_remote_site(p)
{ }
};
Expand Down Expand Up @@ -149,19 +151,19 @@ enum tdr_state_vals {

// Global data

class AliceGlobals : public Firebird::ThreadData
class AliceGlobals : public ThreadData
{
private:
MemoryPool* ALICE_default_pool;
friend class Firebird::SubsystemContextPoolHolder <AliceGlobals, MemoryPool>;
friend class SubsystemContextPoolHolder <AliceGlobals, MemoryPool>;

void setDefaultPool(MemoryPool* p)
{
ALICE_default_pool = p;
}

public:
AliceGlobals(Firebird::UtilSvc* us)
AliceGlobals(UtilSvc* us)
: ThreadData(ThreadData::tddALICE),
ALICE_default_pool(0),
exit_code(FINI_ERROR), // prevent FINI_OK in case of unknown error thrown
Expand All @@ -184,7 +186,7 @@ class AliceGlobals : public Firebird::ThreadData
user_action ALICE_data;
ISC_STATUS_ARRAY status_vector;
int exit_code;
Firebird::UtilSvc* uSvc;
UtilSvc* uSvc;
FILE* output_file;
isc_db_handle db_handle;
isc_tr_handle tr_handle;
Expand All @@ -206,7 +208,8 @@ class AliceGlobals : public Firebird::ThreadData
}
};

typedef Firebird::SubsystemContextPoolHolder <AliceGlobals, MemoryPool> AliceContextPoolHolder;
typedef SubsystemContextPoolHolder <AliceGlobals, MemoryPool> AliceContextPoolHolder;

#endif // ALICE_ALICE_H
} // namespace Firebird::Alice

#endif // ALICE_ALICE_H
22 changes: 13 additions & 9 deletions src/alice/alice_meta.epp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ DATABASE DB = STATIC FILENAME "yachts.lnk";
#define DB tdgbl->db_handle
#define gds_trans tdgbl->tr_handle

typedef Firebird::HalfStaticArray<TEXT, 1024> TextBuffer;
namespace Firebird::Alice {

static void get_string(const TEXT**, Firebird::string&);
typedef HalfStaticArray<TEXT, 1024> TextBuffer;

static void get_string(const TEXT**, string&);
static USHORT get_capabilities(ISC_STATUS*);
static tdr* get_description(ISC_QUAD*);
static void parse_fullpath(tdr*);
Expand All @@ -81,7 +83,7 @@ static const rfr_tab_t rfr_table[] =
static inline void return_error(const ISC_STATUS* /*user_status*/)
{
ALICE_print_status(true, gds_status);
Firebird::LongJump::raise();
LongJump::raise();
}

/*____________________________________________________________
Expand Down Expand Up @@ -243,7 +245,7 @@ void MET_set_capabilities(ISC_STATUS* user_status, tdr* trans)
* Eat a string with a byte-encoded length.
*/

static void get_string(const TEXT** ptr, Firebird::string& str)
static void get_string(const TEXT** ptr, string& str)
{
AliceGlobals* tdgbl = AliceGlobals::getSpecific();

Expand Down Expand Up @@ -316,11 +318,11 @@ static tdr* get_description(ISC_QUAD* blob_id)
return NULL;

tdr* trans = NULL;
Firebird::string host_site;
Firebird::string database_path;
string host_site;
string database_path;

const TEXT* p = buffer.begin();
Firebird::MemoryPool& pool(*tdgbl->getDefaultPool());
MemoryPool& pool(*tdgbl->getDefaultPool());

// skip version number
++p;
Expand Down Expand Up @@ -380,8 +382,8 @@ static tdr* get_description(ISC_QUAD* blob_id)

static void parse_fullpath(tdr* trans)
{
Firebird::PathName filename = trans->tdr_fullpath.c_str();
Firebird::PathName hostname;
PathName filename = trans->tdr_fullpath.c_str();
PathName hostname;

// Find the last remote node in the path

Expand Down Expand Up @@ -442,3 +444,5 @@ static bool snarf_blob(ISC_QUAD* blob_id, TextBuffer& buffer)

return true;
}

} // namespace Firebird::Alice
5 changes: 4 additions & 1 deletion src/alice/alice_meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@
#ifndef ALICE_ALICE_META_H
#define ALICE_ALICE_META_H

namespace Firebird::Alice {

void MET_disable_wal(ISC_STATUS*, isc_db_handle);
void MET_get_state(ISC_STATUS*, tdr*);
tdr* MET_get_transaction(ISC_STATUS*, isc_db_handle, TraNumber);
void MET_set_capabilities(ISC_STATUS*, tdr*);

#endif // ALICE_ALICE_META_H
} // namespace Firebird::Alice

#endif // ALICE_ALICE_META_H
11 changes: 9 additions & 2 deletions src/alice/alice_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@
#include "../common/classes/MsgPrint.h"
#include "../common/UtilSvc.h"

int ALICE_main(Firebird::UtilSvc*);
int alice(Firebird::UtilSvc*);
namespace Firebird::Alice
{


int ALICE_main(UtilSvc*);
int alice(UtilSvc*);

class AliceGlobals;

Expand All @@ -39,4 +43,7 @@ void ALICE_print(USHORT, const MsgFormat::SafeArg& arg = MsgFormat::SafeArg());
void ALICE_print_status(bool error, const ISC_STATUS*);
[[noreturn]] void ALICE_exit(int, AliceGlobals*);


} // namespace Firebird::Alice

#endif // ALICE_ALICE_PROTO_H
9 changes: 8 additions & 1 deletion src/alice/aliceswi.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
#define ALICE_ALICESWI_H

#include "ibase.h"
#include "../jrd/constants.h"
#include "../common/constants.h"

namespace Firebird::Alice
{


// switch definitions

Expand Down Expand Up @@ -331,4 +335,7 @@ static inline constexpr const char* alice_repl_mode_sw_table[] =
ALICE_SW_MODE_NONE, ALICE_SW_MODE_RO, ALICE_SW_MODE_RW
};


} // namespace Firebird::Alice

#endif // ALICE_ALICESWI_H
24 changes: 15 additions & 9 deletions src/alice/exe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@
#include "../alice/alice_meta.h"
#include "../alice/tdr_proto.h"
#include "../yvalve/gds_proto.h"
#include "../jrd/constants.h"
#include "../common/constants.h"
#include "../common/classes/ClumpletWriter.h"

namespace Firebird::Alice
{


static void buildDpb(Firebird::ClumpletWriter&, const SINT64);
static void buildDpb(ClumpletWriter&, const SINT64);
static void extract_db_info(const UCHAR*, size_t);

// Keep always in sync with function extract_db_info()
Expand All @@ -73,7 +76,7 @@ int EXE_action(const TEXT* database, const SINT64 switches)
bool error = false;
AliceGlobals* tdgbl = AliceGlobals::getSpecific();
{
Firebird::AutoMemoryPool newPool(MemoryPool::createPool());
AutoMemoryPool newPool(MemoryPool::createPool());
AliceContextPoolHolder context(tdgbl, newPool);

for (USHORT i = 0; i < MAX_VAL_ERRORS; i++)
Expand All @@ -83,7 +86,7 @@ int EXE_action(const TEXT* database, const SINT64 switches)

// generate the database parameter block for the attach,
// based on the various switches
Firebird::ClumpletWriter dpb(Firebird::ClumpletReader::Tagged, MAX_DPB_SIZE);
ClumpletWriter dpb(ClumpletReader::Tagged, MAX_DPB_SIZE);
buildDpb(dpb, switches);

FB_API_HANDLE handle = 0;
Expand All @@ -110,8 +113,8 @@ int EXE_action(const TEXT* database, const SINT64 switches)
if ((switches & sw_validate) && (tdgbl->status[1] != isc_bug_check))
{
isc_database_info(tdgbl->status, &handle, sizeof(val_errors),
val_errors, sizeof(error_string),
reinterpret_cast<char*>(error_string));
val_errors, sizeof(error_string),
reinterpret_cast<char*>(error_string));

extract_db_info(error_string, sizeof(error_string));
}
Expand Down Expand Up @@ -145,7 +148,7 @@ int EXE_two_phase(const TEXT* database, const SINT64 switches)
bool error = false;
AliceGlobals* tdgbl = AliceGlobals::getSpecific();
{
Firebird::AutoMemoryPool newPool(MemoryPool::createPool());
AutoMemoryPool newPool(MemoryPool::createPool());
AliceContextPoolHolder context(tdgbl, newPool);

for (USHORT i = 0; i < MAX_VAL_ERRORS; i++)
Expand All @@ -155,7 +158,7 @@ int EXE_two_phase(const TEXT* database, const SINT64 switches)

// generate the database parameter block for the attach,
// based on the various switches
Firebird::ClumpletWriter dpb(Firebird::ClumpletReader::Tagged, MAX_DPB_SIZE);
ClumpletWriter dpb(ClumpletReader::Tagged, MAX_DPB_SIZE);
buildDpb(dpb, switches);

FB_API_HANDLE handle = 0;
Expand Down Expand Up @@ -198,7 +201,7 @@ int EXE_two_phase(const TEXT* database, const SINT64 switches)
// based on the various switches
//

static void buildDpb(Firebird::ClumpletWriter& dpb, const SINT64 switches)
static void buildDpb(ClumpletWriter& dpb, const SINT64 switches)
{
AliceGlobals* tdgbl = AliceGlobals::getSpecific();
dpb.reset(isc_dpb_version1);
Expand Down Expand Up @@ -483,3 +486,6 @@ static void extract_db_info(const UCHAR* db_info_buffer, size_t buf_size)
p += length;
}
}


} // namespace Firebird::Alice
4 changes: 4 additions & 0 deletions src/alice/exe_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
#ifndef ALICE_EXE_PROTO_H
#define ALICE_EXE_PROTO_H

namespace Firebird::Alice {

int EXE_action(const TEXT*, const SINT64);
int EXE_two_phase(const TEXT*, const SINT64);

} // namespace Firebird::Alice

#endif // ALICE_EXE_PROTO_H
Loading
Loading