/* * 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 #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 (1 << 1) #define OUTPUT_DEVICE_ONLY (1 << 2) #define OUTPUT_PRETTY_LIST (1 << 3) #define OUTPUT_UDEV_LIST (1 << 4) #define OUTPUT_EXPORT_LIST (1 << 5) #define LOWPROBE_TOPOLOGY (1 << 1) #define LOWPROBE_SUPERBLOCKS (1 << 2) #include #include "ismounted.h" #include "strutils.h" const char *progname = "blkid"; int raw_chars; 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