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

Function define_file

src/gpre/sql.cpp:5230–5267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5228//
5229
5230static gpre_file* define_file()
5231{
5232 gpre_file* file = (gpre_file*) MSC_alloc(FIL_LEN);
5233 if (isQuoted(gpreGlob.token_global.tok_type))
5234 {
5235 TEXT* string = (TEXT*) MSC_alloc(gpreGlob.token_global.tok_length + 1);
5236 file->fil_name = string;
5237 MSC_copy(gpreGlob.token_global.tok_string, gpreGlob.token_global.tok_length, string);
5238 gpreGlob.token_global.tok_length += 2;
5239 PAR_get_token();
5240 }
5241 else
5242 CPR_s_error("<quoted filename>");
5243
5244 if (!check_filename(file->fil_name))
5245 PAR_error("node name not permitted"); // A node name is not permitted in a shadow or secondary file name
5246
5247 while (true)
5248 {
5249 if (MSC_match(KW_LENGTH))
5250 {
5251 MSC_match(KW_EQUALS);
5252 file->fil_length = EXP_ULONG_ordinal(true);
5253 MSC_match(KW_PAGES);
5254 MSC_match(KW_PAGE);
5255 }
5256 else if (MSC_match(KW_STARTS) || MSC_match(KW_STARTING))
5257 {
5258 MSC_match(KW_AT);
5259 MSC_match(KW_PAGE);
5260 file->fil_start = EXP_ULONG_ordinal(true);
5261 }
5262 else
5263 break;
5264 }
5265
5266 return file;
5267}
5268
5269
5270//____________________________________________________________

Callers 3

act_alter_databaseFunction · 0.85
act_create_shadowFunction · 0.85
tail_databaseFunction · 0.85

Calls 9

MSC_allocFunction · 0.85
isQuotedFunction · 0.85
MSC_copyFunction · 0.85
PAR_get_tokenFunction · 0.85
CPR_s_errorFunction · 0.85
check_filenameFunction · 0.85
MSC_matchFunction · 0.85
EXP_ULONG_ordinalFunction · 0.85
PAR_errorFunction · 0.70

Tested by

no test coverage detected