There have been several C cross-reference generators distributed with AT&T/Bell Labs UNIX; some of them also handled other languages as well. I recall "xref" and "cref". The current UNIX System V offering along these lines is "cxref". If you have a license you might try porting that; it works well enough.