mio:mio.git
7 years agoUse function VTable function-table
Colomban Wendling [Thu, 8 Jul 2010 17:58:12 +0000 (19:58 +0200)]
Use function VTable

Don't check for the type of the stream on each call but rather call
a virtual function binded to the correct one at stream creation time.

7 years agoAdd new function mio_new_file_full()
Colomban Wendling [Sat, 26 Jun 2010 18:36:25 +0000 (20:36 +0200)]
Add new function mio_new_file_full()

This allow user to have more control over how a MIO is created from
a filename it she needs to.

7 years agoAllow user to provide the fclose() function to close a FILE object
Colomban Wendling [Fri, 25 Jun 2010 01:17:41 +0000 (03:17 +0200)]
Allow user to provide the fclose() function to close a FILE object

This is probably unlikely to be really useful, but it simply replaces
the boolean to choose whether to close or not the stream, and allow
for example to pass an hypothetical g_fclose() function to close a
g_fopen()-ed object or so. In one word, it's only more extensible.

This breaks both API and ABI.

7 years agoFix some implicit type conversions and possible overflow
Colomban Wendling [Fri, 25 Jun 2010 00:30:49 +0000 (02:30 +0200)]
Fix some implicit type conversions and possible overflow

7 years agoAdd some introspection annotations
Colomban Wendling [Fri, 25 Jun 2010 00:10:29 +0000 (02:10 +0200)]
Add some introspection annotations

7 years agoAdd functions mio_file_get_fp() and mio_memory_get_data()
Colomban Wendling [Thu, 24 Jun 2010 18:49:22 +0000 (20:49 +0200)]
Add functions mio_file_get_fp() and mio_memory_get_data()

These allow to retrieve the underlying data of a MIO stream, mainly
useful for memory streams that are not freed on mio_free().

7 years agoBuild Gtk-Doc documentation
Colomban Wendling [Wed, 23 Jun 2010 19:52:33 +0000 (21:52 +0200)]
Build Gtk-Doc documentation

7 years agoAdd some documentation
Colomban Wendling [Tue, 22 Jun 2010 18:20:29 +0000 (20:20 +0200)]
Add some documentation

7 years agoImplement vprintf(), printf() and their test entry
Colomban Wendling [Tue, 22 Jun 2010 15:38:10 +0000 (17:38 +0200)]
Implement vprintf(), printf() and their test entry

7 years agoFix allocation sizes on writes
Colomban Wendling [Mon, 21 Jun 2010 19:42:07 +0000 (21:42 +0200)]
Fix allocation sizes on writes

Don't grow the buffer if we have enough space from current position
to the end of the buffer, since we override the data in-between.
This fixes allocation if we are writing before the end of the buffer.

7 years agoImplement puts() and its test entry
Colomban Wendling [Mon, 21 Jun 2010 13:19:49 +0000 (15:19 +0200)]
Implement puts() and its test entry

7 years agoImplement putc() and it test entry
Colomban Wendling [Mon, 21 Jun 2010 01:07:28 +0000 (03:07 +0200)]
Implement putc() and it test entry

7 years agoImprove tell() test
Colomban Wendling [Sun, 20 Jun 2010 23:59:31 +0000 (01:59 +0200)]
Improve tell() test

 * do some stuff around tell() calls;
 * don't call tell() directly on only one of both streams to get the
   actual position of the stream to avoid failure due to possible
   side effects of a tell() call.

7 years agoDon't try seeking after the end of the stream
Colomban Wendling [Sun, 20 Jun 2010 23:47:46 +0000 (01:47 +0200)]
Don't try seeking after the end of the stream

We don't support this feature (undocumented for fseek() if I'm
right) but glibc does, then the test would fail if we do so.
This was already disabled in the main seek() test, but might still
happen on setpos() test with an empty input stream.

7 years agoOnly show detailed/debugging infos of test when run verbosely
Colomban Wendling [Sun, 20 Jun 2010 22:23:12 +0000 (00:23 +0200)]
Only show detailed/debugging infos of test when run verbosely

7 years agoRewrite tests to be more automated and readable
Colomban Wendling [Sun, 20 Jun 2010 21:22:02 +0000 (23:22 +0200)]
Rewrite tests to be more automated and readable

7 years agoReset EOF and error markers on rewind()
Colomban Wendling [Sat, 19 Jun 2010 17:47:40 +0000 (19:47 +0200)]
Reset EOF and error markers on rewind()

7 years agoDon't test tell() right after an ungetc() at positions 0
Colomban Wendling [Sat, 19 Jun 2010 15:26:07 +0000 (17:26 +0200)]
Don't test tell() right after an ungetc() at positions 0

This is obsolescent (see other commits message) and glibc has
strange behavior with it.

7 years agoImplement write() and its test entry
Colomban Wendling [Sat, 19 Jun 2010 15:11:41 +0000 (17:11 +0200)]
Implement write() and its test entry

7 years agoRename TEST_FILE to TEST_FILE_R
Colomban Wendling [Sat, 19 Jun 2010 15:10:17 +0000 (17:10 +0200)]
Rename TEST_FILE to TEST_FILE_R

7 years agoFix missing initialization of eof and error flags of memory streams (oops)
Colomban Wendling [Sat, 19 Jun 2010 13:57:31 +0000 (15:57 +0200)]
Fix missing initialization of eof and error flags of memory streams (oops)

7 years agoImprove errno assertion message
Colomban Wendling [Sat, 19 Jun 2010 12:54:05 +0000 (14:54 +0200)]
Improve errno assertion message

7 years agoImplement eof(), error(), clearerr() and their test entries
Colomban Wendling [Fri, 18 Jun 2010 23:12:01 +0000 (01:12 +0200)]
Implement eof(), error(), clearerr() and their test entries

7 years agoDon't test behavior of ungetc() at the start of a stream
Colomban Wendling [Fri, 18 Jun 2010 23:09:31 +0000 (01:09 +0200)]
Don't test behavior of ungetc() at the start of a stream

This is an obsolescent feature (c.f. ISO/IEC 9899:1999 ยง7.26.9)
and it has strange behavior on glibc.

7 years agoLittle improvement of the getc() test entry
Colomban Wendling [Fri, 18 Jun 2010 20:09:13 +0000 (22:09 +0200)]
Little improvement of the getc() test entry

7 years agoClear effects of prior call to ungetc() on setpos()
Colomban Wendling [Fri, 18 Jun 2010 19:14:34 +0000 (21:14 +0200)]
Clear effects of prior call to ungetc() on setpos()

7 years agoImprove read() if size or nmemb is 0
Colomban Wendling [Fri, 18 Jun 2010 18:54:05 +0000 (20:54 +0200)]
Improve read() if size or nmemb is 0

7 years agoProperly handle EOF as parameter of ungetc()
Colomban Wendling [Fri, 18 Jun 2010 18:39:39 +0000 (20:39 +0200)]
Properly handle EOF as parameter of ungetc()

7 years agoReset errno to 0 if we expected the error
Colomban Wendling [Fri, 18 Jun 2010 16:19:33 +0000 (18:19 +0200)]
Reset errno to 0 if we expected the error

7 years agoOnly use EIO if it exists
Colomban Wendling [Fri, 18 Jun 2010 16:08:10 +0000 (18:08 +0200)]
Only use EIO if it exists

7 years agoBetter checks for gets()
Colomban Wendling [Fri, 18 Jun 2010 15:32:10 +0000 (17:32 +0200)]
Better checks for gets()

7 years agoAdd PkgConfig file
Colomban Wendling [Fri, 18 Jun 2010 13:25:24 +0000 (15:25 +0200)]
Add PkgConfig file

7 years agoImplement mio_getpos(), mio_setpos() and their test entries
Colomban Wendling [Thu, 17 Jun 2010 23:28:20 +0000 (01:28 +0200)]
Implement mio_getpos(), mio_setpos() and their test entries

7 years agoCheck errno status too
Colomban Wendling [Thu, 17 Jun 2010 22:44:53 +0000 (00:44 +0200)]
Check errno status too

7 years agoEnable debugging
Colomban Wendling [Thu, 17 Jun 2010 22:09:01 +0000 (00:09 +0200)]
Enable debugging

7 years agoFix non-GLib return type
Colomban Wendling [Thu, 17 Jun 2010 18:24:05 +0000 (20:24 +0200)]
Fix non-GLib return type

7 years agoImplement mio_rewind() and its test entry
Colomban Wendling [Thu, 17 Jun 2010 15:22:36 +0000 (17:22 +0200)]
Implement mio_rewind() and its test entry

7 years agoImplement mio_seek() and its test entry
Colomban Wendling [Thu, 17 Jun 2010 14:21:27 +0000 (16:21 +0200)]
Implement mio_seek() and its test entry

7 years agoImplement mio_tell() and its test entry
Colomban Wendling [Thu, 17 Jun 2010 12:43:18 +0000 (14:43 +0200)]
Implement mio_tell() and its test entry

7 years agoFix memory stream positioning when using mio_ungetc()
Colomban Wendling [Thu, 17 Jun 2010 12:41:50 +0000 (14:41 +0200)]
Fix memory stream positioning when using mio_ungetc()

7 years agoAllow memory MIO to free their underlying data without being resizable
Colomban Wendling [Thu, 17 Jun 2010 10:57:19 +0000 (12:57 +0200)]
Allow memory MIO to free their underlying data without being resizable

7 years agoFree MIO object when test done not to leak memory around
Colomban Wendling [Thu, 17 Jun 2010 10:47:26 +0000 (12:47 +0200)]
Free MIO object when test done not to leak memory around

7 years agoRemoved unrelated debug code (oops)
Colomban Wendling [Wed, 16 Jun 2010 23:03:49 +0000 (01:03 +0200)]
Removed unrelated debug code (oops)

7 years agoA little more assertions
Colomban Wendling [Wed, 16 Jun 2010 22:59:50 +0000 (00:59 +0200)]
A little more assertions

7 years agoFix mio_read() to pass its test
Colomban Wendling [Wed, 16 Jun 2010 22:59:19 +0000 (00:59 +0200)]
Fix mio_read() to pass its test

7 years agoAdd mio_read() test entry
Colomban Wendling [Wed, 16 Jun 2010 21:32:05 +0000 (23:32 +0200)]
Add mio_read() test entry

7 years agoMore test writing automation
Colomban Wendling [Wed, 16 Jun 2010 21:09:19 +0000 (23:09 +0200)]
More test writing automation

7 years agoImplement mio_ungetch()
Colomban Wendling [Wed, 16 Jun 2010 17:41:25 +0000 (19:41 +0200)]
Implement mio_ungetch()

7 years agoFix mio_gets() implementation
Colomban Wendling [Wed, 16 Jun 2010 17:24:20 +0000 (19:24 +0200)]
Fix mio_gets() implementation

7 years agoRename the library to MIO
Colomban Wendling [Wed, 16 Jun 2010 17:20:15 +0000 (19:20 +0200)]
Rename the library to MIO

7 years agoAdd missing copying information
Colomban Wendling [Wed, 16 Jun 2010 15:01:14 +0000 (17:01 +0200)]
Add missing copying information

7 years agoSwitch to an Autotools build system
Colomban Wendling [Wed, 16 Jun 2010 13:31:45 +0000 (15:31 +0200)]
Switch to an Autotools build system

7 years agoAdd virtual tests (does not compile for now, needs fio to grow up)
Colomban Wendling [Wed, 16 Jun 2010 10:50:45 +0000 (12:50 +0200)]
Add virtual tests (does not compile for now, needs fio to grow up)

7 years agoNew "run" target
Colomban Wendling [Wed, 16 Jun 2010 10:49:45 +0000 (12:49 +0200)]
New "run" target

7 years agoLink the test executable to the library
Colomban Wendling [Wed, 16 Jun 2010 10:47:46 +0000 (12:47 +0200)]
Link the test executable to the library

7 years agoFix shlib and program suffixes
Colomban Wendling [Wed, 16 Jun 2010 10:46:57 +0000 (12:46 +0200)]
Fix shlib and program suffixes

7 years agoUse GLib type limits constants
Colomban Wendling [Wed, 16 Jun 2010 10:44:33 +0000 (12:44 +0200)]
Use GLib type limits constants

7 years agoInitial check-in
Colomban Wendling [Fri, 11 Jun 2010 20:18:57 +0000 (22:18 +0200)]
Initial check-in