You’re quite correct in saying that sys1.nucleus(syscatlg) points to the master catalog. However most sites only have system datasets in their master catalog. All other datasets are in a handful of user catalogs (which are also cataloged in the master catalog). Also remember that catalogs are used for traditional z/OS datasets, and not for UNIX Systems Services (USS) files.
I’m assuming that you want to list traditional z/OS datasets (otherwise, you could simply open and read the USS directory). This has always been a bit of a difficult problem to solve for z/OS programmers.
z/OS provides the macros LOCATE and CAMLST to create parameter lists and call the Catalog access services (documented in the DFSMSdfp Advanced Services manual). You could look at these macros and convert them to C/C++. However this will be quite difficult. Unfortunately, I can’t find any C/C++ runtime functions to do the same thing.
The other option is to look at some freeware sites to see if anyone else has done this.
Hope this helps.