The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 1 | /* Copyright (C) 2008 The Android Open Source Project |
| 2 | ** |
| 3 | ** This software is licensed under the terms of the GNU General Public |
| 4 | ** License version 2, as published by the Free Software Foundation, and |
| 5 | ** may be copied, distributed, and modified under those terms. |
| 6 | ** |
| 7 | ** This program is distributed in the hope that it will be useful, |
| 8 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | ** GNU General Public License for more details. |
| 11 | */ |
| 12 | #ifndef _ANDROID_OPTION_H |
| 13 | #define _ANDROID_OPTION_H |
| 14 | |
David 'Digit' Turner | 318e4f2 | 2009-05-25 18:01:03 +0200 | [diff] [blame] | 15 | /* a structure used to model a linked list of parameters |
| 16 | */ |
| 17 | typedef struct ParamList { |
| 18 | char* param; |
| 19 | struct ParamList* next; |
| 20 | } ParamList; |
| 21 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 22 | /* define a structure that will hold all option variables |
| 23 | */ |
| 24 | typedef struct { |
David 'Digit' Turner | 318e4f2 | 2009-05-25 18:01:03 +0200 | [diff] [blame] | 25 | #define OPT_LIST(n,t,d) ParamList* n; |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 26 | #define OPT_PARAM(n,t,d) char* n; |
| 27 | #define OPT_FLAG(n,d) int n; |
| 28 | #include "android/cmdline-options.h" |
| 29 | } AndroidOptions; |
| 30 | |
| 31 | |
| 32 | /* parse command-line arguments options and remove them from (argc,argv) |
| 33 | * 'opt' will be set to the content of parsed options |
| 34 | * returns 0 on success, -1 on error (unknown option) |
| 35 | */ |
| 36 | extern int |
| 37 | android_parse_options( int *pargc, char** *pargv, AndroidOptions* opt ); |
| 38 | |
| 39 | /* name of default keyset file */ |
| 40 | #define KEYSET_FILE "default.keyset" |
| 41 | |
| 42 | /* the default device DPI if none is specified by the skin |
| 43 | */ |
| 44 | #define DEFAULT_DEVICE_DPI 165 |
| 45 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 46 | #endif /* _ANDROID_OPTION_H */ |