Commit Graph

15 Commits

Author SHA1 Message Date
Damien George
69661f3343 all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-02-28 10:33:03 +11:00
Paul Sokolovsky
af5b509c75 examples/unix/ffi_example: Clean up and update the ffi example.
1. Use uctypes.bytearray_at().

Implementation of the "ffi" module predates that of "uctypes", so
initially some convenience functions to access memory were added
to ffi. Later, they landed in uctypes (which follows CPython's
ctype module).

So, replace undocumented experimental functions from ffi to
documented ones from uctypes.

2. Use more suitable type codes for arguments (e.g. "P" (const void*)
instead of "p" (void*).

3. Some better var naming.

4. Clarify some messages printed by the example.
2018-10-23 11:50:39 +11:00
Paul Sokolovsky
eb0e3bab1e tests/machine_mem.py: Too non-portable, rework as an example for unix port. 2016-07-31 04:22:09 +03:00
Paul Sokolovsky
70536212d5 examples/unix/ffi_example.py: Remove TODO, make output more clear. 2016-06-17 19:24:58 +03:00
Paul Sokolovsky
ecfd8e102d examples/unix/ffi_example.py: Update for current "ffi" module API. 2016-06-17 19:21:37 +03:00
Paul Sokolovsky
cf4b72bf13 examples: http_client.py, http_server.py aren't just unix, move to network/. 2016-04-01 20:53:23 +03:00
Paul Sokolovsky
bae052d420 examples/unix: Rename example be importable as modules.
Replace hyphens with undescores in modules.
2016-01-09 12:04:25 +02:00
Paul Sokolovsky
23b3b04072 unix: Rename "microsocket" module to "usocket".
Per new conventions, we'd like to consistently use "u*" naming conventions
for modules which don't offer complete CPython compatibility, while offer
subset or similar API.
2014-10-09 20:43:10 +03:00
Paul Sokolovsky
a2d8f98a7e examples: Rename unix socket examples to have more precise naming (http). 2014-10-09 20:35:56 +03:00
Paul Sokolovsky
8bc3516389 ffi: Implement ffivar.get()/set() methods.
Done by introducing another factored out helper API in binary.c. This API
can be reused also by array and struct modules.
2014-02-14 20:38:35 +02:00
Paul Sokolovsky
9945f33886 Rename "rawsocket" module to "microsocket".
It's no longer intended to provide just "raw" socket interface, may include
some convenience methods for compatibility with CPython socket - but anyway
just minimal set required to deal with socket client and servers, not wider
network functionality.
2014-02-08 21:20:32 +02:00
Paul Sokolovsky
809eaa2679 Add FFI module example. 2014-01-29 00:37:09 +02:00
Paul Sokolovsky
4795c58f3c sock-server.py: Use SO_REUSEADDR to avoid errors on quick restart. 2014-01-26 02:03:07 +02:00
Paul Sokolovsky
d991da7263 socket-client, socket-server examples now run on both Micro- and C-Python. 2014-01-20 20:37:01 +02:00
Paul Sokolovsky
e2f3e1d24a Add socket examples (simple HTTP client and server). 2014-01-19 07:29:30 +02:00