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

Function connect_opts

src/gpre/sql.cpp:5184–5224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5182//
5183
5184static void connect_opts(const TEXT** user,
5185 const TEXT** password,
5186 const TEXT** sql_role,
5187 const TEXT** lc_messages,
5188 USHORT* buffers)
5189{
5190 for (;;)
5191 {
5192 if (MSC_match(KW_CACHE))
5193 {
5194 *buffers = atoi(gpreGlob.token_global.tok_string);
5195 PAR_get_token();
5196 MSC_match(KW_BUFFERS);
5197 }
5198 else if (MSC_match(KW_USER))
5199 *user = SQL_var_or_string(false);
5200 else if (MSC_match(KW_PASSWORD))
5201 *password = SQL_var_or_string(false);
5202 else if (MSC_match(KW_ROLE))
5203 {
5204 if (gpreGlob.token_global.tok_type == tok_ident)
5205 {
5206 // reserve extra bytes for quotes and NULL
5207 //TEXT* s = (TEXT*) MSC_alloc(gpreGlob.token_global.tok_length + 3);
5208 TEXT* s = (TEXT*) MSC_alloc(NAME_SIZE + 2);
5209
5210 SQL_resolve_identifier("<Role Name>", s + 1, NAME_SIZE);
5211 s[0] = '\"';
5212 strcat(s, "\"");
5213 *sql_role = s;
5214 }
5215 else
5216 *sql_role = SQL_var_or_string(false);
5217 }
5218 else if (MSC_match(KW_LC_MESSAGES))
5219 *lc_messages = SQL_var_or_string(false);
5220 else
5221 break;
5222 }
5223
5224}
5225//____________________________________________________________
5226//
5227// Add a new file to an existing database.

Callers 1

act_connectFunction · 0.85

Calls 5

MSC_matchFunction · 0.85
PAR_get_tokenFunction · 0.85
SQL_var_or_stringFunction · 0.85
MSC_allocFunction · 0.85
SQL_resolve_identifierFunction · 0.85

Tested by

no test coverage detected