summaryrefslogtreecommitdiff
path: root/src/command-line.h
blob: fd1ed7fd629df911d4bf0a47cc6852373fd33cd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
 * nvidia-settings: A tool for configuring the NVIDIA X driver on Unix
 * and Linux systems.
 *
 * Copyright (C) 2004 NVIDIA Corporation.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of Version 2 of the GNU General Public
 * License as published by the Free Software Foundation.
 *
 * 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 Version 2
 * of 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
 *
 */

#ifndef __COMMAND_LINE_H__
#define __COMMAND_LINE_H__

#include <NvCtrlAttributes.h>

#define DEFAULT_RC_FILE "~/.nvidia-settings-rc"

#define VERBOSITY_ERROR    0 /* errors only */
#define VERBOSITY_WARNING  1 /* errors and warnings */
#define VERBOSITY_ALL      2 /* errors, warnings and other info */

#define VERBOSITY_DEFAULT  VERBOSITY_ERROR

/*
 * Options structure -- stores the parameters specified on the
 * commandline.
 */

typedef struct {
    
    char *ctrl_display;  /*
                          * The name of the display to control
                          * (doesn't have to be the same as the
                          * display on which the gui is shown
                          */
    
    char *config;        /*
                          * The name of the configuration file (to be
                          * read from, and to be writen to); defaults
                          * to the value of the constant
                          * DEFAULT_RC_FILE.
                          */

    char **assignments;  /*
                          * Dyanamically allocated array of assignment
                          * strings specified on the commandline.
                          */
    
    int num_assignments; /*
                          * Number of assignment strings in the
                          * assignment array.
                          */
    
    char **queries;      /*
                          * Dyanamically allocated array of query
                          * strings specified on the commandline.
                          */
    
    int num_queries;     /*
                          * Number of query strings in the query
                          * array.
                          */
    
    int only_load;       /*
                          * If true, just read the configuration file,
                          * send the attributes to the X server, and
                          * exit.
                          */

    int no_load;         /*
                          * If true, do not load the configuration file.
                          * The attributes are not sent to the X Server.
                          */

} Options;


Options *parse_command_line(int argc, char *argv[], char *dpy);

#endif /* __COMMAND_LINE_H__ */