aboutsummaryrefslogtreecommitdiff
path: root/libbutl/builtin.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-06-01 19:51:17 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-06-03 12:23:29 +0300
commit70314b3303f712a0277b80b23bc3613744e6178e (patch)
treec20b0cddf91b2d2303feee440ec07c36fd5d0cd6 /libbutl/builtin.cxx
parentc0a025542988b63275fe1f9281020f4d4bec58a6 (diff)
Add builtin weight
Also invent the notion of external builtin (builtin_info::function is NULL).
Diffstat (limited to 'libbutl/builtin.cxx')
-rw-r--r--libbutl/builtin.cxx29
1 files changed, 15 insertions, 14 deletions
diff --git a/libbutl/builtin.cxx b/libbutl/builtin.cxx
index 9efa697..fe74b05 100644
--- a/libbutl/builtin.cxx
+++ b/libbutl/builtin.cxx
@@ -2109,19 +2109,20 @@ namespace butl
const builtin_map builtins
{
- {"cat", &async_impl<&cat>},
- {"cp", &sync_impl<&cp>},
- {"echo", &async_impl<&echo>},
- {"false", &false_},
- {"ln", &sync_impl<&ln>},
- {"mkdir", &sync_impl<&mkdir>},
- {"mv", &sync_impl<&mv>},
- {"rm", &sync_impl<&rm>},
- {"rmdir", &sync_impl<&rmdir>},
- {"sed", &async_impl<&sed>},
- {"sleep", &sync_impl<&sleep>},
- {"test", &sync_impl<&test>},
- {"touch", &sync_impl<&touch>},
- {"true", &true_}
+ {"cat", {&async_impl<&cat>, 2}},
+ {"cp", {&sync_impl<&cp>, 2}},
+ {"diff", {nullptr, 2}},
+ {"echo", {&async_impl<&echo>, 2}},
+ {"false", {&false_, 0}},
+ {"ln", {&sync_impl<&ln>, 2}},
+ {"mkdir", {&sync_impl<&mkdir>, 2}},
+ {"mv", {&sync_impl<&mv>, 2}},
+ {"rm", {&sync_impl<&rm>, 1}},
+ {"rmdir", {&sync_impl<&rmdir>, 1}},
+ {"sed", {&async_impl<&sed>, 2}},
+ {"sleep", {&sync_impl<&sleep>, 1}},
+ {"test", {&sync_impl<&test>, 1}},
+ {"touch", {&sync_impl<&touch>, 2}},
+ {"true", {&true_, 0}}
};
}