Lichen

lib/native.py

342:d9053172e0ff
2016-12-07 Paul Boddie Implemented the join method for strings.
     1 #!/usr/bin/env python     2      3 """     4 Native library functions.     5      6 None of these are actually defined here. Instead, native implementations are     7 substituted when each program is built. It is, however, important to declare     8 non-core exceptions used by the native functions because they need to be     9 identified as being needed by the program.    10     11 Copyright (C) 2011, 2015, 2016 Paul Boddie <paul@boddie.org.uk>    12     13 This program is free software; you can redistribute it and/or modify it under    14 the terms of the GNU General Public License as published by the Free Software    15 Foundation; either version 3 of the License, or (at your option) any later    16 version.    17     18 This program is distributed in the hope that it will be useful, but WITHOUT    19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    20 FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more    21 details.    22     23 You should have received a copy of the GNU General Public License along with    24 this program.  If not, see <http://www.gnu.org/licenses/>.    25 """    26     27 # Environment support.    28     29 def _exit(status): pass    30 def _get_argv(): pass    31 def _get_path(): pass    32     33 # Identity testing.    34     35 def _is(x, y): pass    36 def _is_not(x, y): pass    37     38 # Limit definition.    39     40 def _get_maxint(): pass    41 def _get_minint(): pass    42     43 # Integer operations.    44     45 def _int_add(self, other): pass    46 def _int_div(self, other): pass    47 def _int_mod(self, other): pass    48 def _int_mul(self, other): pass    49 def _int_neg(self): pass    50 def _int_pow(self, other): pass    51 def _int_sub(self, other): pass    52     53 def _int_and(self, other): pass    54 def _int_not(self): pass    55 def _int_or(self, other): pass    56 def _int_xor(self, other): pass    57     58 def _int_lt(self, other): pass    59 def _int_gt(self, other): pass    60 def _int_eq(self, other): pass    61 def _int_ne(self, other): pass    62     63 def _int_str(self): pass    64     65 # String operations.    66     67 def _str_add(self, other): pass    68 def _str_eq(self, other): pass    69 def _str_gt(self, other): pass    70 def _str_lt(self, other): pass    71 def _str_len(self): pass    72 def _str_nonempty(self): pass    73 def _str_ord(self): pass    74 def _str_substr(self, start, size): pass    75     76 # List operations.    77     78 def _list_init(size): pass    79 def _list_setsize(self, size): pass    80 def _list_append(self, value): pass    81 def _list_concat(self, other): pass    82 def _list_len(self): pass    83 def _list_nonempty(self): pass    84 def _list_element(self, index): pass    85 def _list_setelement(self, index, value): pass    86     87 # Buffer operations.    88     89 def _buffer_str(self): pass    90     91 # Method binding.    92     93 def _get_using(callable, instance): pass    94     95 # Introspection.    96     97 def _object_getattr(obj, name, default): pass    98 def _isinstance(obj, cls): pass    99 def _issubclass(obj, cls): pass   100    101 # Input/output.   102    103 def _fdopen(fd, mode): IOError   104 def _read(fd, n): IOError   105 def _write(fd, str): pass   106    107 def _fread(fd, n):   108     IOError   109     EOFError   110    111 def _fwrite(fd, str):   112     IOError   113     EOFError   114    115 # vim: tabstop=4 expandtab shiftwidth=4