Meaning of ImportC without a library file name

Just starting out? Need help? Post your questions and find answers here.
QuimV
Enthusiast
Enthusiast
Posts: 337
Joined: Mon May 29, 2006 11:29 am
Location: BARCELONA - SPAIN

Meaning of ImportC without a library file name

Post by QuimV »

Code: Select all

  ImportC ""
    gmtime(*timer)
    localtime(*timer)
    setlocale(category, locale.p-UTF8)
    strftime(*s, maxsize, format.p-UTF8, *timeptr)
  EndImport
I have seen this piece of code that I do not understand why it works, although it works correctly.
According to the Purebasic help file, a library file name is required from which to import the functions it contains.
In this case, the Library file name does not exist, but the declared functions are available and can be used within the program.
Can someone explain to me why a library file name is not essential in this code?
Thank you
QuimV
Fred
Administrator
Administrator
Posts: 16687
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Meaning of ImportC without a library file name

Post by Fred »

It uses functions of the libc which is always linked with the PureBasic exe, so you don't have to put something in.
QuimV
Enthusiast
Enthusiast
Posts: 337
Joined: Mon May 29, 2006 11:29 am
Location: BARCELONA - SPAIN

Re: Meaning of ImportC without a library file name

Post by QuimV »

:D I understand now!
Where can I find a list of the functions contained in the "libc" library?
Thanks in advanced
QuimV
User avatar
kpeters58
Enthusiast
Enthusiast
Posts: 341
Joined: Tue Nov 22, 2011 5:11 pm
Location: Kelowna, BC, Canada

Re: Meaning of ImportC without a library file name

Post by kpeters58 »

Not all libc libraries are created equal, see here:

https://en.wikipedia.org/wiki/C_standard_library
PB 5.73 on Windows 10 & OS X High Sierra
QuimV
Enthusiast
Enthusiast
Posts: 337
Joined: Mon May 29, 2006 11:29 am
Location: BARCELONA - SPAIN

Re: Meaning of ImportC without a library file name

Post by QuimV »

:D OK, Thank you very much to all
QuimV
Post Reply