Here is the some pointers to get started work of libmetalink meta4 support.
We use bzr for VCS. You can get branch using `bzr branch lp:libmetalink`
1. We want to autodetect metalink version 3 and version 4 (aka meta4).
To do this, we use XML namespace URI.
"urn:ietf:params:xml:ns:metalink".
Unfortunately, current libmetalink codebase does use namespace aware API.
So the first work is to change the code to use namespace aware API.
The libmetalink supports both expat and libxml2 for reading XML file.
We concentrate on expat first. If we have spare time, then we can work with
libxml2 but I think it is optional.
For XML namespace handling, see expat documentation[1].
aria2 source code[2] is also useful though it is C++.
2. Move metalink3 parser state functions in metalink_pstate.{h,c} to metalink_pstate_v3.{h,c}.
Also append "_v3" to their name to indicate that they are metalink3 version functions.
I think the all *_state_{start,end}_fun functions other than null_state_start_fun, initial_state_start_fun and skip_state_start_fun are metalink3 parser state functions. Run test that make sure that
no regression is introduced.
3. Add meta4 parser state functions in metalink_pstate_v4.{h,c}.
The entry point to meta4 parser functions is initial_state_start_fun():
If the XML namespace indicates metalink4 then enter meta4 parser functions.
Otherwise metalink3 functions.
You may need to add some functions to metalink_pctrl.{h,c} for meta4
aria2 source code is also useful here: see [3].
We need to test case for meta4 in this step too.
After this step, we will have working library to support both Metalink3 and meta4
with the auto-detection mechanism.
For each step, you commit your changes to your local branch and send me a patch using bzr send with -o option. You can learn about bzr send command in the page [4].
I review your changes and if it is OK, I'll merge and commit the changes to the official repository.
For each step, I can provide more detailed help if you ask me.
I think aria2 source code is very useful for this project. Checkout aria2 source file starts with "Metalink" and "Expat".