Export mesh tangents

Hello!

I’ve written an exporter for (triangle-only) meshes for use in my game engine. I’ve extended it with normals to get correct lighting and now I’d also like to export the vertex tangents as they are needed for bump-mapping. In OpenGL (which my engine is based on) there’s no function for automatically calculating the tangents as there is in DirectX. Any idea on how to solve this?
At the moment I do like this:

import Blender
/.../
object = Blender.Object.GetSelected()[0]
mesh = object.getData()

But the only members of mesh are:
co, index, no, sel, uvco
As tangent-space based normal mapping has now appeared in Blender 2.43 there must be some way to get those tangents (either by just fetching them, or calculate them in the script). But how should I do?

Cheers,
Stefanos