Malcolm Nooning said:
Is there a C equivalent to Perl CPAN?
None that I am aware of - except for different efforts by
individuals or organizations who maintain library
catalogues. But there is no /single/ outstanding central
catalogue such as CPAN, there is no »/the/ C library
catalogue«.
CPAN modules usually depend only on portable Perl (and,
possibly, other CPAN modules). In C, this would be much more
difficult, because one cannot do so much with portable C.
(Or, by a twist of the Englisch language, »... one can only
do so much with portable C.«.)
I am looking for C code that will get the current time from a
NIST server. That problem has to have been solved already by
hundreds of C programmers.
Did you try using a web search engine?
This, BTW, is an example of something that actually cannot
be done in portable C, because portable C does not have
means for TCP/IP communication. See also:
http://www.purl.org/stefan_ram/pub/c++_standard_extensions_en
FWIW: I would have an idea how to »embed« some TCP/IP into
standard C:
if( source = fopen( "
HTTP://www.example.com", "r" ))...
or
if( source = fopen( "NTP:time.example.com", "r" ))...
, but, of course, that also is not portable, because not
every environment needs to support it.