Damien George
7c6c843965
unix: Add missing stdio.h header for readline.
11 years ago
Dave Hylands
117c46d9eb
Add input command for unix
11 years ago
Paul Sokolovsky
0ef015b253
stream: Make non-blcoking stream support configurable.
Enable only on unix. To avoid unpleasant surprises with error codes.
11 years ago
Paul Sokolovsky
6c62e7257f
unix modsocket: Add comments re: recv() vs read(), etc. semantics.
11 years ago
Paul Sokolovsky
f9e54e0ea5
modgc: Add new module for GC-related functionality.
11 years ago
Paul Sokolovsky
6b344d7816
py, unix: Add -v option, print bytecode dump if used.
This will work if MICROPY_DEBUG_PRINTERS is defined, which is only for
unix/windows ports. This makes it convenient to user uPy normally, but
easily get bytecode dump on the spot if needed, without constant recompiles
back and forth.
TODO: Add more useful debug output, adjust verbosity level on which
specifically bytecode dump happens.
11 years ago
Damien George
c327c0de5d
unix: Remove test class and code.
11 years ago
Damien George
04b9147e15
Add license header to (almost) all files.
Blanket wide to all .c and .h files. Some files originating from ST are
difficult to deal with (license wise) so it was left out of those.
Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
11 years ago
Damien George
d5f5b2f766
py, stream: Implement readlines for a stream.
11 years ago
Damien George
6ec835dfef
Don't print git hash as well as git tag in banner.
11 years ago
Damien George
977a0ce287
py: Print tag/version/git describe in uPy banner.
11 years ago
Damien George
e69b7e8288
unix, file.c: adhere to coding conventions.
11 years ago
stijn
4cd21deebc
mingw: Add implementation of realpath()
The mingw port used _fullpath() until now, but the behaviour is not exactly
the same as realpath()'s on unix; major difference being that it doesn't
return an error for non-existing files, which would bypass main's error
checking and bail out without any error message.
Also realpath() will return forward slashes only since main() relies on that.
11 years ago
stijn
a89e93e050
CPython compatibility: raise an error for operations on a closed file descriptor
In CPython any operations on a file that has been closed already reaises
a ValueError with message "I/O operation on closed file"
11 years ago
Paul Sokolovsky
9b71b16a94
unix,stmhal: Make "mpconfig.h" be first included, as other headers depend on it.
11 years ago
Paul Sokolovsky
f54bcbf099
py, unix: Make "mpconfig.h" be first included, as other headers depend on it.
Specifically, nlr.h does.
11 years ago
Paul Sokolovsky
1f85d6255d
py: Add tentative scheme for error messages configuration.
11 years ago
Paul Sokolovsky
27f5bdd6d4
py: "read" & "write" are so common that make them core.
Few other strings move to core, but make depend on "io" module.
11 years ago
Damien George
6d3c5e4301
Add ARRAY_SIZE macro, and use it where possible.
11 years ago
Paul Sokolovsky
12a9cfed76
modsocket: Make .send() support arbitrary objects with buffer interface.
This is CPython-compliant (except that CPython doesn't support buffer
protocol for str).
11 years ago
Paul Sokolovsky
fa6f0506c1
unix: Workaround MP_OBJ_NEW_SMALL_INT() 64-bit issues.
11 years ago
Paul Sokolovsky
5d3a830171
modsocket: Clean up OSError-like exception a bit.
Some BSD socket functions don't return error numbers in errno namespace, but
rather in other error namespaces. CPython resolves this by using OSError
subclasses for them. We don't do that so far, so there's ambiguity here.
11 years ago
Paul Sokolovsky
acb13886fc
unix: OSError's args[0] should be errno numeric value.
Well, Python3 also defines an attribute for that, but that's bloat.
11 years ago
Paul Sokolovsky
b418b6fb0d
modffi: Don't use OSError for clearly unrelated errors.
11 years ago
Paul Sokolovsky
88972b0d94
modffi: Describe typecodes where they differ from used by struct module.
Exact behavior of typecodes may be not yet enforced.
11 years ago
Paul Sokolovsky
a196d08dfc
unix windows: mingw32 doesn't have realpath(), use _fullpath() instead.
11 years ago
Paul Sokolovsky
1f2ca1c1f9
unix file: mingw32 has STDIN_FILENO and friends in stdio.h .
TODO: Never "optimize" includes any more!
11 years ago
Paul Sokolovsky
b76fd842f0
unix mem_info(): Dump GC info only if it's enabled.
11 years ago
Paul Sokolovsky
9fd02e186d
modsocket: Add setblocking() method.
11 years ago
Ilya Dmitrichenko
8e998ed280
modffi: Fix how we call `pkg-config`
11 years ago
Paul Sokolovsky
9ae0912496
modffi: Update for MP_OBJ_STOP_ITERATION refactor.
11 years ago
Paul Sokolovsky
752d2080b7
modffi: Mark 'p' type spec deprecated, replace with 'P'.
'p' in struct module is "pascal string". 'P' is void*.
11 years ago
Damien George
b11b85adaa
py: Allow to pass buffer protocol flags to get_buffer helper funcs.
11 years ago
Damien George
738bdeb73a
unix: Update to use new buffer protocol interface with typecode.
11 years ago
Damien George
5b65f0c7d3
py: Rename USE_COMPUTED_GOTOS to USE_COMPUTED_GOTO and enable on stmhal.
On stmhal, computed gotos make the binary about 1k bigger, but makes it
run faster, and we have the room, so why not. All tests pass on
pyboard using computed gotos.
11 years ago
Paul Sokolovsky
4abaa1b12b
unix modffi: Convert to static module structures.
11 years ago
Paul Sokolovsky
e1e4249a67
unix modsocket: Convert to static module structures.
11 years ago
Paul Sokolovsky
59a2f4828d
unix: Make mem_info() dump GC info too.
mem_info() is already pretty hacky, let it be more hacky.
11 years ago
Paul Sokolovsky
eb2fc9787a
unix modtime: Convert to static module structures.
11 years ago
Paul Sokolovsky
de8292202e
unix modtime: Adhere to MICROPY_ENABLE_FLOAT better.
11 years ago
Damien George
d553be5982
build: Simplify build directory layout by putting all headers in genhdr.
Any generated headers go in $(BUILD)/genhdr/, and are #included as
'genhdr/xxx.h'.
11 years ago
Damien George
dbdfee15a1
py: Add cmath module, for complex math. Disabled by default.
Not all functions implemented. Not enabled on pyboard.
11 years ago
Paul Sokolovsky
f200c30d53
modffi: Support float types.
11 years ago
Andrew Scheller
e02b77bf6b
Updated the envvar used by ./run-tests
As discussed in #504
11 years ago
Andrew Scheller
70a7d7a943
build directory can now be renamed
The autogenerated header files have been moved about, and an extra
include dir has been added, which means you can give a custom
BUILD=newbuilddir option to make, and everything "just works"
Also tidied up the way the different Makefiles build their include-
directory flags
11 years ago
Andrew Scheller
d5ce916f26
Add 'test' target to unix/Makefile
In conjunction with #504 this allows you to do things like:
```shell
make -C unix clean && make -C unix test CC=gcc-4.7
```
all from the top-level micropython directory :-)
Something similar could probably be done for windows/Makefile too, but I don't have a cygwin setup to test with.
11 years ago
Andrew Scheller
571d5a3363
New config option MICROPY_FORCE_32BIT (defaulted to 0)
Makes it easier for 64-bit unix hosts to build 32-bit unix
binaries (for testing)
11 years ago
AZ Huang
9309d9982f
Move entry_table to separated header file.
11 years ago
Damien George
3bb8bd899b
Make USE_COMPUTED_GOTO a config option in mpconfig.h.
Disabled by default. Enabled in unix port.
11 years ago
AZ Huang
b1f692e82e
Use computed goto instead of switching op-codes.
11 years ago