Thursday, March 03, 2011

glob.h and glob.c for the Android NDK

I've been playing around with the Android NDK (native development kit) recently, which lets you compile C and C++ code directly to your Android phone's ARM chip rather than writing Java. This is very useful for performance-critical apps. Unfortunately, the Android NDK doesn't have a full set of libraries, and when you're compiling third party libraries to Android, you often run into these missing pieces. One of the biggest missing pieces is glob.h / glob.c, libraries which are used for file name matching aka globbing (think the "*" in "*.txt").

I've massaged a glob.h / glob.c from FreeBSD to compile on Android. They might come in handy in your Android NDK adventures.

Download: glob.h | glob.c.

You'll need to add glob.c to the LOCAL_SRC_FILES in your Android.mk.

6 comments:

Natanael said...

Where exactly did you get these files from? Can you please post a link?

Gabor said...

Don't remember - I assembled them from FreeBSD sources somewhere.

Natanael said...

Do you know, if I'm allowed to put these files in my project, if I publish it under the terms of the GPL?

Gabor said...

The license for the files is inside the files. It's some type of BSD license.

Anonymous said...

These files appear not to be available from the links. Have they been removed?

Anonymous said...

Yes please could you post a new link! :)