| Tom Cherry | b734990 | 2015-08-26 11:43:36 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (C) 2015 The Android Open Source Project | 
|  | 3 | * | 
|  | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 5 | * you may not use this file except in compliance with the License. | 
|  | 6 | * You may obtain a copy of the License at | 
|  | 7 | * | 
|  | 8 | *      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 9 | * | 
|  | 10 | * Unless required by applicable law or agreed to in writing, software | 
|  | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 13 | * See the License for the specific language governing permissions and | 
|  | 14 | * limitations under the License. | 
|  | 15 | */ | 
|  | 16 |  | 
| Tom Cherry | d52a5b3 | 2019-07-22 16:05:36 -0700 | [diff] [blame] | 17 | #pragma once | 
| Tom Cherry | b734990 | 2015-08-26 11:43:36 -0700 | [diff] [blame] | 18 |  | 
| Tom Cherry | ad54d09 | 2017-04-19 16:18:50 -0700 | [diff] [blame] | 19 | #include <functional> | 
| Tom Cherry | b734990 | 2015-08-26 11:43:36 -0700 | [diff] [blame] | 20 | #include <map> | 
|  | 21 | #include <string> | 
|  | 22 | #include <vector> | 
|  | 23 |  | 
| Tom Cherry | cb0f9bb | 2017-09-12 15:58:47 -0700 | [diff] [blame] | 24 | #include "builtin_arguments.h" | 
| Tom Cherry | b734990 | 2015-08-26 11:43:36 -0700 | [diff] [blame] | 25 | #include "keyword_map.h" | 
| Tom Cherry | 557946e | 2017-08-01 13:50:23 -0700 | [diff] [blame] | 26 | #include "result.h" | 
| Tom Cherry | b734990 | 2015-08-26 11:43:36 -0700 | [diff] [blame] | 27 |  | 
| Tom Cherry | 81f5d3e | 2017-06-22 12:53:17 -0700 | [diff] [blame] | 28 | namespace android { | 
|  | 29 | namespace init { | 
|  | 30 |  | 
| Tom Cherry | bbcbc2f | 2019-06-10 11:08:01 -0700 | [diff] [blame] | 31 | using BuiltinFunction = std::function<Result<void>(const BuiltinArguments&)>; | 
| Tom Cherry | cb0f9bb | 2017-09-12 15:58:47 -0700 | [diff] [blame] | 32 |  | 
| Tom Cherry | d52a5b3 | 2019-07-22 16:05:36 -0700 | [diff] [blame] | 33 | struct BuiltinFunctionMapValue { | 
|  | 34 | bool run_in_subcontext; | 
|  | 35 | BuiltinFunction function; | 
| Tom Cherry | b734990 | 2015-08-26 11:43:36 -0700 | [diff] [blame] | 36 | }; | 
|  | 37 |  | 
| Tom Cherry | d52a5b3 | 2019-07-22 16:05:36 -0700 | [diff] [blame] | 38 | using BuiltinFunctionMap = KeywordMap<BuiltinFunctionMapValue>; | 
|  | 39 |  | 
|  | 40 | const BuiltinFunctionMap& GetBuiltinFunctionMap(); | 
|  | 41 |  | 
| Tom Cherry | 172c83f | 2019-06-26 14:44:37 -0700 | [diff] [blame] | 42 | extern std::vector<std::string> late_import_paths; | 
|  | 43 |  | 
| Tom Cherry | 81f5d3e | 2017-06-22 12:53:17 -0700 | [diff] [blame] | 44 | }  // namespace init | 
|  | 45 | }  // namespace android |