cgGetNamedParameter
Example code:
CGprogram cgprog;
cgprog = cgCreateProgram(...);
cgGLLoadProgram(cgprog);
cgprog_modelviewprojCGparameter modelviewproj, lightpos;
modelviewproj = cgGetNamedParameter(cgprog, "modelviewproj");
cgprog_lightposlightpos = cgGetNamedParameter(cgprog, "lightpos");
Sample code paraphrased from the book Advanced Game Development with Programmable Graphics Hardware by Watt Policarpo.