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

Function make_name

src/gpre/c_cxx.cpp:3648–3678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3646// so after this call the pointer is at the position of the null terminator.
3647
3648static TEXT* make_name( TEXT* const string, const gpre_sym* symbol)
3649{
3650
3651 if (symbol->sym_type == SYM_delimited_cursor)
3652 {
3653 // All This elaborate code is just to put double quotes around
3654 // the cursor names and to escape any embeded quotes.
3655 int i = 0;
3656 strcpy(string, "\"\\\"");
3657 const char* source = symbol->sym_string;
3658 for (i = static_cast<int>(strlen(string)); *source && i + 4 < MAX_CURSOR_SIZE; i++)
3659 {
3660 if (*source == '\"' || *source == '\'')
3661 {
3662 if (i + 7 >= MAX_CURSOR_SIZE)
3663 break;
3664
3665 string[i++] = '\\';
3666 string[i++] = *source;
3667 string[i++] = '\\';
3668 }
3669 string[i] = *source++;
3670 }
3671 string[i] = 0;
3672 strcat(string, "\\\"\"");
3673 }
3674 else
3675 fb_utils::snprintf(string, MAX_CURSOR_SIZE, "\"%s\"", symbol->sym_string);
3676
3677 return string;
3678}
3679
3680
3681//____________________________________________________________

Callers 9

gen_cursor_openFunction · 0.70
gen_dyn_closeFunction · 0.70
gen_dyn_declareFunction · 0.70
gen_dyn_describeFunction · 0.70
gen_dyn_executeFunction · 0.70
gen_dyn_fetchFunction · 0.70
gen_dyn_insertFunction · 0.70
gen_dyn_openFunction · 0.70
gen_dyn_prepareFunction · 0.70

Calls 1

snprintfFunction · 0.50

Tested by

no test coverage detected