MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / tail_database

Function tail_database

src/gpre/sql.cpp:6549–6742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6547//
6548
6549static bool tail_database(act_t action_type, gpre_dbb* database)
6550{
6551 TEXT* string = NULL;
6552
6553 // parse options for the database parameter block
6554
6555 bool extend_dpb = false;
6556
6557 while (true)
6558 {
6559 if (MSC_match(KW_LENGTH))
6560 {
6561 database->dbb_length = EXP_ULONG_ordinal(true);
6562 MSC_match(KW_PAGES);
6563 }
6564 else if (MSC_match(KW_USER))
6565 {
6566 if (isQuoted(gpreGlob.token_global.tok_type))
6567 {
6568 database->dbb_c_user = string =
6569 (TEXT*) MSC_alloc(gpreGlob.token_global.tok_length + 1);
6570 MSC_copy(gpreGlob.token_global.tok_string, gpreGlob.token_global.tok_length, string);
6571
6572 // - 2 here ???
6573 string[gpreGlob.token_global.tok_length - 2] = '\0';
6574 PAR_get_token();
6575 }
6576 else
6577 {
6578 // Some non-C languages (such as Fortran) have problems
6579 // with extending the static DPB to add the runtime options
6580 // needed for a runtime user name or password.
6581 // 11 April 1995
6582
6583 if (gpreGlob.sw_language == lang_c)
6584 {
6585 if (!MSC_match(KW_COLON))
6586 CPR_s_error("<colon> or <quoted string>");
6587 // Should I bother about dialects here ??
6588 if (isQuoted(gpreGlob.token_global.tok_type))
6589 CPR_s_error("<host variable>");
6590 database->dbb_r_user = PAR_native_value(false, false);
6591 extend_dpb = true;
6592 }
6593 else
6594 CPR_s_error("<quoted string>");
6595 }
6596
6597 }
6598 else if (MSC_match(KW_PASSWORD))
6599 {
6600 if (isQuoted(gpreGlob.token_global.tok_type))
6601 {
6602 database->dbb_c_password = string =
6603 (TEXT*) MSC_alloc(gpreGlob.token_global.tok_length + 1);
6604 MSC_copy(gpreGlob.token_global.tok_string, gpreGlob.token_global.tok_length, string);
6605 string[gpreGlob.token_global.tok_length] = '\0';
6606 PAR_get_token();

Callers 1

act_create_databaseFunction · 0.85

Calls 14

MSC_matchFunction · 0.85
EXP_ULONG_ordinalFunction · 0.85
isQuotedFunction · 0.85
MSC_allocFunction · 0.85
MSC_copyFunction · 0.85
PAR_get_tokenFunction · 0.85
CPR_s_errorFunction · 0.85
PAR_native_valueFunction · 0.85
define_fileFunction · 0.85
par_page_sizeFunction · 0.85
EXP_USHORT_ordinalFunction · 0.85
define_log_fileFunction · 0.85

Tested by

no test coverage detected