| 5228 | // |
| 5229 | |
| 5230 | static 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 | //____________________________________________________________ |
no test coverage detected