bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnulib] wordexp function available on Android versions different fr


From: Bruno Haible
Subject: Re: [Gnulib] wordexp function available on Android versions different from 9? And how can we know? How do I discover that?
Date: Fri, 03 Sep 2021 15:48:22 +0200

[CCing bug-gnulib. Please always use the mailing list, not private email,
 to discuss Gnulib topics.]

Luca Saiu wrote:
> I would like to use the function wordexp, which is in posix; it would be
> better if that was also available on Android.
> 
> Just looking on the web I happened to find the Gnulib documentation,
> listing the function as unavailable on “Android 9.0”.  What about other
> Android versions, newer or older?  And, much more importantly, is there
> a way for me to discover whether a certain function is available or not,
> other then having a system running and trying?
> 
> Please forgive me if the question is naïve.

Hi Luca,

> listing the function as unavailable on “Android 9.0”.  What about other
> Android versions, newer or older?

Typically functions get added to an OS or libc over time, and don't get
removed. Therefore, if the doc says "unavailable in Android 9.0" it also
means "unavailable in all Android versions ≤ 9.0".

There is no statement about newer versions of Android, because I didn't
take the time to make the list of functions in Android 10 and 11. AFAICS,
C development on Android is a small niche:
  - The development environments ("Termux", "Terminal emulator", ...) are
    merely for developers.
  - PariDroid (the port of Pari/GP to Android) is the only useful Android
    app that I know of that makes use of a large library written in C.
Most Android apps are written in Java or languages that run in the JVM
(such as Kotlin, Groovy, or Clojure).

> is there
> a way for me to discover whether a certain function is available or not,
> other then having a system running and trying?

Regarding Android: The Android include files from the newest Android
Development Toolkit contain information when each function was introduced;
so that after setting the target Android version you get errors when you
attempt to use a function that did not exist in that older target Android
version.

Regarding other platforms: I have a database of which OS version contains
which function. But since I regularly update the Gnulib documentation from
this database, you rarely need that database.

> I would like to use the function wordexp, which is in posix

Are you sure you don't want to use glob() or fnmatch() instead? In my
understanding, wordexp() is only useful when you are creating a POSIX-
compliant or nearly POSIX-compliant shell. Then, why not just use GNU bash
instead?

Gnulib has modules for glob and fnmatch.

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]