How to create a component composed by a lot of faces using sketchup_c_api?

I studyed the sketchup_c_api, there are two header files about component, which are component_definition and component_instance. Which one do i need to create a component?
I find that there is little direct connection between a component and the faces.How can i turn many faces into a component?
And in the code samples, I can create a face by filling three vertex into a loop,then using the entites.
There is no “Sufaceref” at all, but a sufaceref is needed to create an entity.How can i achieve my goals?

Usually you don’t create entities and then a component around them, but you rather create the component first and then add faces to its entities collection.
If you don’t want to create faces individually one by one, you can also create a mesh (from arrays) and let SketchUp create the faces for the mesh all at once.

Was that your question?