blob: f0ff1eb8a4d87f9f30dc18d43e392df4e405d09e [file] [log] [blame]
Tom Cherryb7349902015-08-26 11:43:36 -07001/*
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 Cherryd52a5b32019-07-22 16:05:36 -070017#pragma once
Tom Cherryb7349902015-08-26 11:43:36 -070018
Tom Cherryad54d092017-04-19 16:18:50 -070019#include <functional>
Tom Cherryb7349902015-08-26 11:43:36 -070020#include <map>
21#include <string>
22#include <vector>
23
Tom Cherrycb0f9bb2017-09-12 15:58:47 -070024#include "builtin_arguments.h"
Tom Cherryb7349902015-08-26 11:43:36 -070025#include "keyword_map.h"
Tom Cherry557946e2017-08-01 13:50:23 -070026#include "result.h"
Tom Cherryb7349902015-08-26 11:43:36 -070027
Tom Cherry81f5d3e2017-06-22 12:53:17 -070028namespace android {
29namespace init {
30
Tom Cherrybbcbc2f2019-06-10 11:08:01 -070031using BuiltinFunction = std::function<Result<void>(const BuiltinArguments&)>;
Tom Cherrycb0f9bb2017-09-12 15:58:47 -070032
Tom Cherryd52a5b32019-07-22 16:05:36 -070033struct BuiltinFunctionMapValue {
34 bool run_in_subcontext;
35 BuiltinFunction function;
Tom Cherryb7349902015-08-26 11:43:36 -070036};
37
Tom Cherryd52a5b32019-07-22 16:05:36 -070038using BuiltinFunctionMap = KeywordMap<BuiltinFunctionMapValue>;
39
40const BuiltinFunctionMap& GetBuiltinFunctionMap();
41
Tom Cherry172c83f2019-06-26 14:44:37 -070042extern std::vector<std::string> late_import_paths;
43
Tom Cherry81f5d3e2017-06-22 12:53:17 -070044} // namespace init
45} // namespace android