| 6547 | // |
| 6548 | |
| 6549 | static 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(); |
no test coverage detected