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 15 #include "android/utils/compiler.h" 16 17 ANDROID_BEGIN_HEADER 18 19 /* a structure used to model a linked list of parameters 20 */ 21 typedef struct ParamList { 22 char* param; 23 struct ParamList* next; 24 } ParamList; 25 26 /* define a structure that will hold all option variables 27 */ 28 typedef struct { 29 #define OPT_LIST(n,t,d) ParamList* n; 30 #define OPT_PARAM(n,t,d) char* n; 31 #define OPT_FLAG(n,d) int n; 32 #include "android/cmdline-options.h" 33 } AndroidOptions; 34 35 36 /* parse command-line arguments options and remove them from (argc,argv) 37 * 'opt' will be set to the content of parsed options 38 * returns 0 on success, -1 on error (unknown option) 39 */ 40 extern int 41 android_parse_options( int *pargc, char** *pargv, AndroidOptions* opt ); 42 43 /* name of default keyset file */ 44 #define KEYSET_FILE "default.keyset" 45 46 /* the default device DPI if none is specified by the skin 47 */ 48 #define DEFAULT_DEVICE_DPI 165 49 50 ANDROID_END_HEADER 51 52 #endif /* _ANDROID_OPTION_H */ 53