diff options
Diffstat (limited to 'option_table.h')
-rw-r--r-- | option_table.h | 115 |
1 files changed, 68 insertions, 47 deletions
diff --git a/option_table.h b/option_table.h index 8463e49..7ad2e99 100644 --- a/option_table.h +++ b/option_table.h @@ -1,14 +1,34 @@ -#define NVOPT_HAS_ARGUMENT 0x1 -#define NVOPT_IS_BOOLEAN 0x2 - -#define OPTION_HELP_ALWAYS 0x8000 - -typedef struct { - const char *name; - int val; - unsigned int flags; - char *description; /* not used by nvgetopt() */ -} NVOption; +/* + * nvidia-installer: A tool for installing/un-installing the + * NVIDIA Linux graphics driver. + * + * Copyright (C) 2004-2010 NVIDIA Corporation + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + *? + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + *? + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the: + * + * Free Software Foundation, Inc. + * 59 Temple Place - Suite 330 + * Boston, MA 02111-1307, USA + * + * + * option_table.h + */ + +#ifndef __OPT_TABLE_H__ +#define __OPT_TABLE_H__ + +#include "nvgetopt.h" enum { XFREE86_PREFIX_OPTION = 1, @@ -57,31 +77,31 @@ enum { NO_DISTRO_SCRIPTS_OPTION }; -static const NVOption __options[] = { +static const NVGetoptOption __options[] = { /* These options are printed by "nvidia-installer --help" */ - { "accept-license", 'a', OPTION_HELP_ALWAYS, + { "accept-license", 'a', NVGETOPT_HELP_ALWAYS, "Bypass the display and prompting for acceptance of the " "NVIDIA Software License Agreement. By passing this option to " "nvidia-installer, you indicate that you have read and accept the " "License Agreement contained in the file 'LICENSE' (in the top " "level directory of the driver package)." }, - { "update", UPDATE_OPTION, OPTION_HELP_ALWAYS, + { "update", UPDATE_OPTION, NVGETOPT_HELP_ALWAYS, "Connect to the NVIDIA FTP server ' " DEFAULT_FTP_SITE " ' and determine the " "latest available driver version. If there is a more recent " "driver available, automatically download and install it. Any " "other options given on the commandline will be passed on to the " "downloaded driver package when installing it." }, - { "version", 'v', OPTION_HELP_ALWAYS, + { "version", 'v', NVGETOPT_HELP_ALWAYS, "Print the nvidia-installer version and exit." }, - { "help", 'h', OPTION_HELP_ALWAYS, + { "help", 'h', NVGETOPT_HELP_ALWAYS, "Print usage information for the common commandline options " "and exit." }, - { "advanced-options", 'A', OPTION_HELP_ALWAYS, + { "advanced-options", 'A', NVGETOPT_HELP_ALWAYS, "Print usage information for the common commandline options " "as well as the advanced options, and then exit." }, @@ -118,17 +138,17 @@ static const NVOption __options[] = { "printed, except for error messages to stderr. This option " "implies '--ui=none --no-questions --accept-license'." }, - { "x-prefix", X_PREFIX_OPTION, NVOPT_HAS_ARGUMENT, + { "x-prefix", X_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, "The prefix under which the X components of the " "NVIDIA driver will be installed; the default is '" DEFAULT_X_PREFIX "' unless nvidia-installer detects that X.Org >= 7.0 is installed, " "in which case the default is '" XORG7_DEFAULT_X_PREFIX "'. Only " "under rare circumstances should this option be used." }, - { "xfree86-prefix", XFREE86_PREFIX_OPTION, NVOPT_HAS_ARGUMENT, + { "xfree86-prefix", XFREE86_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, "This is a deprecated synonym for --x-prefix." }, - { "x-module-path", X_MODULE_PATH_OPTION, NVOPT_HAS_ARGUMENT, + { "x-module-path", X_MODULE_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, "The path under which the NVIDIA X server modules will be installed. " "If this option is not specified, nvidia-installer uses the following " "search order and selects the first valid directory it finds: 1) " @@ -138,7 +158,7 @@ static const NVOption __options[] = { "than X.Org 7.0) or '" XORG7_DEFAULT_X_MODULEDIR "' (for X.Org 7.0 or " "later)." }, - { "x-library-path", X_LIBRARY_PATH_OPTION, NVOPT_HAS_ARGUMENT, + { "x-library-path", X_LIBRARY_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, "The path under which the NVIDIA X libraries will be installed. " "If this option is not specified, nvidia-installer uses the following " "search order and selects the first valid directory it finds: 1) " @@ -148,14 +168,14 @@ static const NVOption __options[] = { DEFAULT_64BIT_LIBDIR "' or '" DEFAULT_LIBDIR "' on 64bit systems, " "depending on the installed Linux distribution." }, - { "opengl-prefix", OPENGL_PREFIX_OPTION, NVOPT_HAS_ARGUMENT, + { "opengl-prefix", OPENGL_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, "The prefix under which the OpenGL components of the " "NVIDIA driver will be installed; the default is: '" DEFAULT_OPENGL_PREFIX "'. Only under rare circumstances should this option be used. " "The Linux OpenGL ABI (http://oss.sgi.com/projects/ogl-sample/ABI/) " "mandates this default value." }, - { "opengl-libdir", OPENGL_LIBDIR_OPTION, NVOPT_HAS_ARGUMENT, + { "opengl-libdir", OPENGL_LIBDIR_OPTION, NVGETOPT_STRING_ARGUMENT, "The path relative to the OpenGL library installation prefix under " "which the NVIDIA OpenGL components will be installed. The " "default is '" DEFAULT_LIBDIR "' on 32bit systems, and '" @@ -164,7 +184,7 @@ static const NVOption __options[] = { "circumstances should this option be used." }, #if defined(NV_X86_64) - { "compat32-chroot", COMPAT32_CHROOT_OPTION, NVOPT_HAS_ARGUMENT, + { "compat32-chroot", COMPAT32_CHROOT_OPTION, NVGETOPT_STRING_ARGUMENT, "The top-level prefix (chroot) relative to which the 32bit " "compatibility OpenGL libraries will be installed on Linux/x86-64 " "systems; this option is unset by default, the 32bit OpenGL " @@ -172,13 +192,13 @@ static const NVOption __options[] = { "path alone determine the target location. Only under very rare " "circumstances should this option be used." }, - { "compat32-prefix", COMPAT32_PREFIX_OPTION, NVOPT_HAS_ARGUMENT, + { "compat32-prefix", COMPAT32_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, "The prefix under which the 32bit compatibility OpenGL components " "of the NVIDIA driver will be installed; the default is: '" DEFAULT_OPENGL_PREFIX "'. Only under rare circumstances should " "this option be used." }, - { "compat32-libdir", COMPAT32_LIBDIR_OPTION, NVOPT_HAS_ARGUMENT, + { "compat32-libdir", COMPAT32_LIBDIR_OPTION, NVGETOPT_STRING_ARGUMENT, "The path relative to the 32bit compatibility prefix under which the " "32bit compatibility OpenGL components of the NVIDIA driver will " "be installed. The default is '" DEFAULT_LIBDIR "' or '" @@ -187,36 +207,36 @@ static const NVOption __options[] = { "option be used." }, #endif /* NV_X86_64 */ - { "installer-prefix", INSTALLER_PREFIX_OPTION, NVOPT_HAS_ARGUMENT, + { "installer-prefix", INSTALLER_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, "The prefix under which the installer binary will be " "installed; the default is: '" DEFAULT_UTILITY_PREFIX "'. Note: please " "use the '--utility-prefix' option instead." }, - { "utility-prefix", UTILITY_PREFIX_OPTION, NVOPT_HAS_ARGUMENT, + { "utility-prefix", UTILITY_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, "The prefix under which the NVIDIA utilities (nvidia-installer, " "nvidia-settings, nvidia-xconfig, nvidia-bug-report.sh) and the NVIDIA " "utility libraries will be installed; the default is: '" DEFAULT_UTILITY_PREFIX "'." }, - { "utility-libdir", UTILITY_LIBDIR_OPTION, NVOPT_HAS_ARGUMENT, + { "utility-libdir", UTILITY_LIBDIR_OPTION, NVGETOPT_STRING_ARGUMENT, "The path relative to the utility installation prefix under which the " "NVIDIA utility libraries will be installed. The default is '" DEFAULT_LIBDIR "' on 32bit systems, and '" DEFAULT_64BIT_LIBDIR "' or '" DEFAULT_LIBDIR "' on 64bit " "systems, depending on the " "installed Linux distribution." }, - { "documentation-prefix", DOCUMENTATION_PREFIX_OPTION, NVOPT_HAS_ARGUMENT, + { "documentation-prefix", DOCUMENTATION_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, "The prefix under which the documentation files for the NVIDIA " "driver will be installed. The default is: '" DEFAULT_DOCUMENTATION_PREFIX "'." }, - { "kernel-include-path", KERNEL_INCLUDE_PATH_OPTION, NVOPT_HAS_ARGUMENT, + { "kernel-include-path", KERNEL_INCLUDE_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, "The directory containing the kernel include files that " "should be used when compiling the NVIDIA kernel module. " "This option is deprecated; please use '--kernel-source-path' " "instead." }, - { "kernel-source-path", KERNEL_SOURCE_PATH_OPTION, NVOPT_HAS_ARGUMENT, + { "kernel-source-path", KERNEL_SOURCE_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, "The directory containing the kernel source files that " "should be used when compiling the NVIDIA kernel module. " "When not specified, the installer will use " @@ -224,20 +244,20 @@ static const NVOption __options[] = { "directory exists. Otherwise, it will use " "'/usr/src/linux'." }, - { "kernel-output-path", KERNEL_OUTPUT_PATH_OPTION, NVOPT_HAS_ARGUMENT, + { "kernel-output-path", KERNEL_OUTPUT_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, "The directory containing any KBUILD output files if " "either one of the 'KBUILD_OUTPUT' or 'O' parameters were " "passed to KBUILD when building the kernel image/modules. " "When not specified, the installer will assume that no " "separate output directory was used." }, - { "kernel-install-path", KERNEL_INSTALL_PATH_OPTION, NVOPT_HAS_ARGUMENT, + { "kernel-install-path", KERNEL_INSTALL_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, "The directory in which the NVIDIA kernel module should be " "installed. The default value is either '/lib/modules/`uname " "-r`/kernel/drivers/video' (if '/lib/modules/`uname -r`/kernel' " "exists) or '/lib/modules/`uname -r`/video'." }, - { "proc-mount-point", PROC_MOUNT_POINT_OPTION, NVOPT_HAS_ARGUMENT, + { "proc-mount-point", PROC_MOUNT_POINT_OPTION, NVGETOPT_STRING_ARGUMENT, "The mount point for the proc file system; if not " "specified, then this value defaults to '" DEFAULT_PROC_MOUNT_POINT "' (which is normally " @@ -247,18 +267,18 @@ static const NVOption __options[] = { "the currently running kernel. This option should only be needed " "in very rare circumstances." }, - { "log-file-name", LOG_FILE_NAME_OPTION, NVOPT_HAS_ARGUMENT, + { "log-file-name", LOG_FILE_NAME_OPTION, NVGETOPT_STRING_ARGUMENT, "File name of the installation log file (the default is: " "'" DEFAULT_LOG_FILE_NAME "')." }, - { "tmpdir", TMPDIR_OPTION, NVOPT_HAS_ARGUMENT, + { "tmpdir", TMPDIR_OPTION, NVGETOPT_STRING_ARGUMENT, "Use the specified directory as a temporary directory when " "downloading files from the NVIDIA ftp site; " "if not given, then the following list will be searched, and " "the first one that exists will be used: $TMPDIR, /tmp, ., " "$HOME." }, - { "ftp-mirror", 'm', NVOPT_HAS_ARGUMENT, + { "ftp-mirror", 'm', NVGETOPT_STRING_ARGUMENT, "Use the specified FTP mirror rather than the default ' " DEFAULT_FTP_SITE " ' when downloading driver updates." }, @@ -274,7 +294,7 @@ static const NVOption __options[] = { "thinks the latest driver is already installed; this option " "implies '--update'." }, - { "ui", USER_INTERFACE_OPTION, NVOPT_HAS_ARGUMENT, + { "ui", USER_INTERFACE_OPTION, NVGETOPT_STRING_ARGUMENT, "Specify what user interface to use, if available. " "Valid values for [UI] are 'ncurses' (the default) or 'none'. " "If the ncurses interface fails to initialize, or 'none' " @@ -289,7 +309,7 @@ static const NVOption __options[] = { "header files. This option disables installation of the NVIDIA " "OpenGL header files." }, - { "force-tls", FORCE_TLS_OPTION, NVOPT_HAS_ARGUMENT, + { "force-tls", FORCE_TLS_OPTION, NVGETOPT_STRING_ARGUMENT, "NVIDIA's OpenGL libraries are compiled with one of two " "different thread local storage (TLS) mechanisms: 'classic tls' " "which is used on systems with glibc 2.2 or older, and 'new tls' " @@ -300,13 +320,13 @@ static const NVOption __options[] = { "for [FORCE-TLS] are 'new' and 'classic'." }, #if defined(NV_X86_64) - { "force-tls-compat32", FORCE_TLS_COMPAT32_OPTION, NVOPT_HAS_ARGUMENT, + { "force-tls-compat32", FORCE_TLS_COMPAT32_OPTION, NVGETOPT_STRING_ARGUMENT, "This option forces the installer to install a specific " "32bit compatibility OpenGL TLS library; further details " "can be found in the description of the '--force-tls' option." }, #endif /* NV_X86_64 */ - { "kernel-name", 'k', NVOPT_HAS_ARGUMENT, + { "kernel-name", 'k', NVGETOPT_STRING_ARGUMENT, "Build and install the NVIDIA kernel module for the " "non-running kernel specified by [KERNEL-NAME] ([KERNEL-NAME] " "should be the output of `uname -r` when the target kernel is " @@ -379,12 +399,12 @@ static const NVOption __options[] = { "this option be used." }, { "precompiled-kernel-interfaces-path", - PRECOMPILED_KERNEL_INTERFACES_PATH_OPTION, NVOPT_HAS_ARGUMENT, + PRECOMPILED_KERNEL_INTERFACES_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, "Before searching for a precompiled kernel interface in the " ".run file, search in the specified directory." }, { "precompiled-kernel-interfaces-url", - PRECOMPILED_KERNEL_INTERFACES_URL_OPTION, NVOPT_HAS_ARGUMENT, + PRECOMPILED_KERNEL_INTERFACES_URL_OPTION, NVGETOPT_STRING_ARGUMENT, "If no precompiled kernel interfaces are found within the driver package " "or provided on the file system by the Linux distribution, check the " "specified URL for updates. NVIDIA does not intend to provide updated " @@ -402,7 +422,7 @@ static const NVOption __options[] = { "'yes'. This is useful with the '--no-questions' or '--silent' " "options, which assume the default values for all questions." }, - { "force-selinux", FORCE_SELINUX_OPTION, NVOPT_HAS_ARGUMENT, + { "force-selinux", FORCE_SELINUX_OPTION, NVGETOPT_STRING_ARGUMENT, "Linux installations using SELinux (Security-Enhanced Linux) " "require that the security type of all shared libraries be set " "to 'shlib_t' or 'textrel_shlib_t', depending on the distribution. " @@ -417,7 +437,7 @@ static const NVOption __options[] = { "'no' (prevent setting of the security type), and 'default' " "(let nvidia-installer decide when to set the security type)." }, - { "selinux-chcon-type", SELINUX_CHCON_TYPE_OPTION, NVOPT_HAS_ARGUMENT, + { "selinux-chcon-type", SELINUX_CHCON_TYPE_OPTION, NVGETOPT_STRING_ARGUMENT, "When SELinux support is enabled, nvidia-installer will try to determine " "which chcon argument to use by first trying 'textrel_shlib_t', then " "'texrel_shlib_t', then 'shlib_t'. Use this option to override this " @@ -450,9 +470,10 @@ static const NVOption __options[] = { { "debug", 'd', 0, NULL }, { "help-args-only", HELP_ARGS_ONLY_OPTION, 0, NULL }, { "add-this-kernel", ADD_THIS_KERNEL_OPTION, 0, NULL }, - { "rpm-file-list", RPM_FILE_LIST_OPTION, NVOPT_HAS_ARGUMENT, NULL }, + { "rpm-file-list", RPM_FILE_LIST_OPTION, NVGETOPT_STRING_ARGUMENT, NULL }, { "no-rpms", NO_RPMS_OPTION, 0, NULL}, { "advanced-options-args-only", ADVANCED_OPTIONS_ARGS_ONLY_OPTION, 0, NULL }, { NULL, 0, 0, NULL }, }; +#endif /* __OPT_TABLE_H__ */ |