CountResources
CountResources Find how many of a selected resource type exist
#include <Resources.h> Resource Manager
short CountResources(rType );
ResType rType ; a 4-byte ResType; the resource type to count
returns total rType resources in all open resource files
CountResources returns the number of resources of a specified resource
type that exist among the currently-open resource files.
rType is a 4-byte ResType value identifying the resource type you wish to
count (e.g. 'FONT', 'MENU', etc.).
Returns: a positive integer; the number of resources of the specified type
contained in all currently-open resource files. Returns 0 if none are
found.

Notes: This function is used as the first step in generating a list of
currently-available resources of a particular type. To generate the list,
use GetIndResource with an index ranging from 1 to the
CountResources return value.
Use Count1Types and Get1IndResource to count and access only the
resources in the current resource file.
The following example prints a list of the names of all resources of type
'DRVR' (i.e., desk accessories).
Example
#include <Resources.h>
short rCount, rID, j;
Handle rHandle;
ResType rType;
Str255 rName;
printf("\n"); [TOKEN:12074] ensure printf can get fonts */
/* before calling SetResLoad */
rCount = CountResources( 'DRVR' );
SetResLoad( FALSE ); [TOKEN:12074] do not need resource, just info */
for( j=1; j <= rCount; j++ ) {
rHandle = GetIndResource('DRVR', j );
GetResInfo( rHandle, &rID, &rType, rName );
printf(" 'DRVR' Rsrc ID: %6d, Name: %s\n", rID, PtoCstr(rName)+1);
}
SetResLoad(TRUE); [TOKEN:12074] better do this! */