Vertex/faces lists?

Im working on an exporter for blender and Im stuck in a detail, how can I create an indexed list of faces? this what I mean

lets suppose vertices 1,2,3 create a face. and 2.3,4 create another one. in data I have faces, using 3 vertices and then another face with another 3 vertices. how can I know which vertices are being shared?