1.1 --- a/lib/native.py Tue Nov 29 17:29:42 2016 +0100
1.2 +++ b/lib/native.py Tue Nov 29 22:09:52 2016 +0100
1.3 @@ -1,7 +1,8 @@
1.4 #!/usr/bin/env python
1.5
1.6 """
1.7 -Native library functions.
1.8 +Native library functions. None of these are actually defined here. Instead,
1.9 +native implementations are substituted when each program is built.
1.10
1.11 Copyright (C) 2011, 2015, 2016 Paul Boddie <paul@boddie.org.uk>
1.12
1.13 @@ -19,13 +20,19 @@
1.14 this program. If not, see <http://www.gnu.org/licenses/>.
1.15 """
1.16
1.17 +# Environment support.
1.18 +
1.19 def _exit(status): pass
1.20 def _get_argv(): pass
1.21 def _get_path(): pass
1.22
1.23 +# Identity testing.
1.24 +
1.25 def _is(x, y): pass
1.26 def _is_not(x, y): pass
1.27
1.28 +# Integer operations.
1.29 +
1.30 def _int_add(self, other): pass
1.31 def _int_div(self, other): pass
1.32 def _int_mod(self, other): pass
1.33 @@ -45,6 +52,8 @@
1.34
1.35 def _int_str(self): pass
1.36
1.37 +# String operations.
1.38 +
1.39 def _str_add(self, other): pass
1.40 def _str_lt(self, other): pass
1.41 def _str_gt(self, other): pass
1.42 @@ -52,6 +61,8 @@
1.43 def _str_len(self): pass
1.44 def _str_nonempty(self): pass
1.45
1.46 +# List operations.
1.47 +
1.48 def _list_init(size): pass
1.49 def _list_setsize(self, size): pass
1.50 def _list_append(self, value): pass
1.51 @@ -61,15 +72,22 @@
1.52 def _list_element(self, index): pass
1.53 def _list_setelement(self, index, value): pass
1.54
1.55 +# Buffer operations.
1.56 +
1.57 def _buffer_str(self): pass
1.58
1.59 +# Method binding.
1.60 +
1.61 def _get_using(callable, instance): pass
1.62
1.63 +# Introspection.
1.64 +
1.65 def _object_getattr(obj, name, default): pass
1.66 -
1.67 def _isinstance(obj, cls): pass
1.68 def _issubclass(obj, cls): pass
1.69
1.70 +# Input/output.
1.71 +
1.72 def _read(fd, n): pass
1.73 def _write(fd, str): pass
1.74