One path for you to pursue is to check out the source code from
subversion, or get a recent source release in tar or zip form. Then
look at file eeschema/load_one_schematic_file.cpp. Look at function
ReadPartDesc() along with the structure definition for
EDA_SchComponentStruct which you can find in a header file.