small update to SDK (posix's glob/globfree, attached)

Have a question about our Software Developer Kit? Ask them here.

small update to SDK (posix's glob/globfree, attached)

Postby kas1e » Mon Jun 20, 2011 1:00 pm

As we have many posix functions in the SDK already, i think it will worth to add some more functions which already tested and works. There i mean Glob() and GlobFree() functions, which generate pathnames matching a pattern.

Full description of glob() function are here
Full sescription of globfree() function are here

Functions uses from time to time in the unix games/apps (for example in the ports which do i, it was used in the Pentagram, Warzone2100, SuperTuxKart, AssaultCube , Epiar and some others). So having it in SDK will help as plain developers who want linux-unix kind functions, and the same for porters who just want to port one-two games to os4.

The source of the functions done by Frank Wille in 2005 for his posix-compilant library for VBCC, and which with very small changes i adapt for our SDK Changes are related to just adding of:

#ifdef __cplusplus
extern "C" {
#endif

....

#ifdef __cplusplus
}
#endif


To include file (to make plain C and C++ works fine with it), as well as some changes in includes and have added at top define __USE_INLINE__. No real source changes here, just some adaptation.

In attach you can found: all the source for those functions (for including it to any .a where most posix functions is stored) , main glob.h include (for put to SDK's includes) , and just as an example libglob.a , which can be used just for tests to see that all of this works. If any real-live examples will necessary, i will upload some small example as well.
Attachments
glob.zip
glob() and globfree() for SDK
(7.76 KiB) Downloaded 254 times
kas1e
Beta Tester
Beta Tester
 
Posts: 453
Joined: Sat Jun 18, 2011 8:56 am

Re: small update to SDK (posix's glob/globfree, attached)

Postby Slayer » Wed Jun 22, 2011 9:25 am

I'm all for this kind of thing!

Now if we can only convince you to release your secret fork() implementation that would be absolutely awesome! ;)

Thanks for the resource kas1e

please excuse the attempt at humor :lol:
~Yes I am a Kiwi, No, I did not appear as an extra in 'Lord of the Rings'~
1x AmigaOne X5000 2.0GHz 2gM RadeonR9280X AOS4.x
3x AmigaOne X1000 1.8GHz 2gM RadeonHD7970 AOS4.x
User avatar
Slayer
Beta Tester
Beta Tester
 
Posts: 851
Joined: Tue Dec 21, 2010 5:19 am
Location: New Zealand

Re: small update to SDK (posix's glob/globfree, attached)

Postby salass00 » Tue Apr 16, 2013 8:17 am

There is a more advanced implementation of glob()/globfree() in libaos4util in amicygnix SDK. This one is BSD licensed and supports also GNU extensions.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 477
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: small update to SDK (posix's glob/globfree, attached)

Postby kas1e » Tue Apr 16, 2013 9:25 am

@salas00
The better version we will have in newlib, the better :) Its just sometime some apps from unix world want it, and will be nice to have them by default, especially if they implemented right.
kas1e
Beta Tester
Beta Tester
 
Posts: 453
Joined: Sat Jun 18, 2011 8:56 am


Return to SDK Support

Who is online

Users browsing this forum: No registered users and 2 guests