18 | | |
19 | | == Ideas == |
20 | | |
21 | | * Create "StreamDescriptor" PMC type to abstract out system-dependent IO descriptors. Would allow FileHandles and Sockets to be subclassed more easily |
22 | | |
23 | | * Create a "StreamBuffer" PMC type to abstract out buffering details. Would allow FileHandles and Sockets to be subclassed more easily, and give all IO types easy access to buffering |
24 | | |
| 7 | * Add an improved file-like API to the Socket PMC (open, close, readline, etc). Internally, these methods should direct to similar functions in src/io/api.c |
| 8 | * Move buffering logic from FileHandle and StringHandle to Handle. Be able to inherit it from all other PMC types. (include buffering-related ATTRs, METHOD_buffer_type, and METHOD_buffer_size) |
| 9 | * Move METHOD_get_fd from FileHandle to Handle. Be able to inherit this into Socket, Pipe, etc. |
| 10 | * Move encoding logic (METHOD_encoding, ATTR_encoding, etc) from StringHandle and FileHandle to Handle. Be able to inherit it from all other PMC types. |
| 11 | * Unify logic wherever possible so multiple IO types can share |
| 12 | * Use GET_ATTR macros in src/io/filehandle.c so all functions will be able to handle subclasses |
28 | | * Change IO API to not use PCCINVOKE calls |
| 16 | * Change IO API to not use PCCINVOKE calls. Method calls on IO PMCs should call the API functions, not the other way around |
| 17 | * Unify the codepaths for Socket and Pipe into the IO API. Refactor the IO API to be more unified. |
| 18 | * Add externally-visible socket functions to src/io/api.c from src/io/socket_*.c |
| 19 | * Rename Parrot_io_new_pmc to Parrot_io_new_filehandle_pmc |
| 20 | * Add Pipe and Socket logic to Parrot_io_open. Call into Parrot_io_open from the "Open" method of each |
| 21 | * Add Pipe and Socket logic to Parrot_io_close. |
| 22 | * Add Pipe and Socket logic to Parrot_io_is_closed. |
| 23 | * Add Pipe and Socket logic to Parrot_io_flush |
| 24 | * Add Pipe and Socket logic to Parrot_io_reads |
| 25 | * Add Pipe and Socket logic to Parrot_io_readline |
| 26 | * Error handling: Figure out what happens if an unsuitable PMC type is passed to Parrot_io_seek, Parrot_io_tell, Parrot_io_eof, Parrot_io_is_tty |
| 27 | * Extract a sane buffering API. |
| 28 | * Cleanup Parrot_io_write, Parrot_io_puts, Parrot_io_putps. Unify where possible and remove duplicated effort |
| 29 | |
| 30 | = Misc Cleanup = |
| 31 | |
| 32 | * Add an src/io/pipe.c and src/io/stringhandle.c files for type-specific logic similar to src/io/filehandle.c |
| 33 | * Make sure the functions in src/io/buffer.c will work with all buffer-enabled PMC types |
| 34 | * Evaluate Parrot_io_make_offset, Parrot_io_make_offset32, Parrot_io_make_offset_pmc. If they do not need to be in src/io/api.c, move them elsewhere (src/io/filehandle.c?) |
| 35 | * Make 'print' and 'say' stringify the same way. (See http://rt.perl.org/rt3/Ticket/Display.html?id=55196) |
| 36 | * Change 'fprintf' to 'PIO_fprintf' where relevant. |
| 37 | * Plain %s in parrot printf-alike functions do not handle NULL C strings well. Fix. |
| 38 | * Further optimize where possible. |
| 39 | * Move src/io/filehandle.c:Parrot_io_clear_buffer to src/io/buffer.c |
| 40 | * Move src/io/filehandle.c:Parrot_io_is_encoding to src/io/core.c |
| 41 | * Rename PARROT_NET_DEVEL to PARROT_NETWORKING_SUPPORT. Cleanup it's uses (#534) |