git-annex/Utility/libmounts.h
Joey Hess 43b4b7d43a can now build Android targeted binary
Various things that don't work on Android are just ifdefed out.

* the webapp (needs template haskell for arm)
* --include and --exclude globbing (needs libpcre, which is not ported;
  probably I'll make it use the pure haskell glob library instead)
* annex.diskreserve checking (missing sys/statvfs.h)
* timestamp preservation support (yawn)
* S3
* WebDAV
* XMPP

The resulting 17mb binary has been tested on Android, and it is able to,
at least, print its usage message.
2013-02-10 15:48:38 -04:00

38 lines
873 B
C

/* Include appropriate headers for the OS, and define what will be used. */
#if defined (__FreeBSD__) || defined (__APPLE__)
# include <sys/param.h>
# include <sys/ucred.h>
# include <sys/mount.h>
# define GETMNTINFO
#else
#if defined WITH_ANDROID
# warning mounts listing code not available for Android
# define UNKNOWN
#else
#if defined (__linux__) || defined (__FreeBSD_kernel__)
/* Linux or Debian kFreeBSD */
#include <mntent.h>
# define GETMNTENT
#else
# warning mounts listing code not available for this OS
# define UNKNOWN
#endif
#endif
#endif
#include <stdio.h>
#ifndef GETMNTENT
struct mntent {
char *mnt_fsname;
char *mnt_dir;
char *mnt_type;
char *mnt_opts; /* not filled in */
int mnt_freq; /* not filled in */
int mnt_passno; /* not filled in */
};
#endif
FILE *mounts_start (void);
int mounts_end (FILE *fp);
struct mntent *mounts_next (FILE *fp);