I haven't tagged this as a patch because I know full well it wont be
accepted. I have not followed any commenting convention other than my own
and I've only made a half-hearted attempt to format the code in the project
approved manner. I felt it better to get some code written first.
What I want is some people with more experience of this project to look
over the code and tell me if I have missed any library code I could use to
make life easier. If I've done anything wrong within the terms of the
project. (comment and code formatting asside) And generally pass comment.
I have attached the file libsvn_subr/mime_nix.c which is used to interogate
the mime.types file on a *nix system. I envisage other platforms having
similar files, e.g. mime_macosx, mime_riscos.
I have also attached libsvn_subr/svn_mime.c which holds the statistical
scanner which used to live in io.c and the function
svn_mime_guess_type_from_file which is where the #ifdef's live to decide
which platform specific call to make.
I have removed svn_io_detect_mimetype from libsvn_subr/io.c but I can't
really attach that change. :-)
Here is the output of the test suite I've written to exercise the API:
PASS: lt-mime-test 1: discern MIME type of extensionless text file
PASS: lt-mime-test 2: discern MIME type of extensionless binary file
PASS: lt-mime-test 3: discern MIME type of extensionless mostly text file
PASS: lt-mime-test 4: discern MIME type of an extensioned text file
PASS: lt-mime-test 5: discern MIME type of an extensioned binary file
PASS: lt-mime-test 6: discern MIME type of an extensioned mostly text file
PASS: lt-mime-test 7: discern MIME type of text file, non-existant extension
PASS: lt-mime-test 8: discern MIME type of binary file, non-existant extension
PASS: lt-mime-test 9: discern MIME type of mostly text file, non-existant
extension
PASS: lt-mime-test 10: discern MIME type of a non-existant file
So how did I do?
--
(\/)atthew )-(ambley
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Mar 10 20:09:30 2003