/* * blkid.c - User command-line interface for libblkid * * Copyright (C) 2001 Andreas Dilger * * %Begin-Header% * This file may be redistributed under the terms of the * GNU Lesser General Public License. * %End-Header% */ #include #include #include #include #include #include #include #include #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_GETOPT_H #include #else extern int getopt(int argc, char * const argv[], const char *optstring); extern char *optarg; extern int optind; #endif #define OUTPUT_VALUE_ONLY 0x0001 #define OUTPUT_DEVICE_ONLY 0x0002 #define OUTPUT_PRETTY_LIST 0x0004 #define OUTPUT_UDEV_LIST 0x0008 #include #include "ismounted.h" const char *progname = "blkid"; static void print_version(FILE *out) { fprintf(out, "%s from %s (libblkid %s, %s)\n", progname, PACKAGE_STRING, LIBBLKID_VERSION, LIBBLKID_DATE); } static void usage(int error) { FILE *out = error ? stderr : stdout; print_version(out); fprintf(out, "Usage:\n" " %1$s -L