I am trying to revive and compile some old sources under XE2.

There's routine that uses 'ToolServices.GetUnitCount' which is defined in ExptIntf.pas (which is deprecated) as ToolServices: TIToolServices = nil;

And, TIToolServices is defined in ToolIntf.pas (which is also deprecated) as TIToolServices = class(TInterface)

And, finally, GetUnitCount is described as "returns the current number of units belonging to the project".

Question is this: How can I (without the use of ExptIntf.pas or ToolIntf.pas) get the current number of units belonging to the project?