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

Function make_name

src/gpre/obj_cxx.cpp:3650–3680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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