X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=fbset.c;h=3f36a701122898623a7a4637024c8a7938b2b914;hb=e714bce003a1b0e2c49e58fe14af86abc8b31f23;hp=4e5609e4181c4eacf8e516317ba6e4cf7e01ccda;hpb=9cf3bfa7c1bf3ad959c61711c9a5ac1969149300;p=oweals%2Fbusybox.git diff --git a/fbset.c b/fbset.c index 4e5609e41..3f36a7011 100644 --- a/fbset.c +++ b/fbset.c @@ -61,28 +61,29 @@ /* #define CMD_XCOMPAT 10 */ #define CMD_ALL 11 #define CMD_INFO 12 +#define CMD_CHANGE 13 #ifdef BB_FEATURE_FBSET_FANCY -#define CMD_XRES 13 -#define CMD_YRES 14 -#define CMD_VXRES 15 -#define CMD_VYRES 16 -#define CMD_DEPTH 17 -#define CMD_MATCH 18 -#define CMD_PIXCLOCK 19 -#define CMD_LEFT 20 -#define CMD_RIGHT 21 -#define CMD_UPPER 22 -#define CMD_LOWER 23 -#define CMD_HSLEN 24 -#define CMD_VSLEN 25 -#define CMD_CSYNC 26 -#define CMD_GSYNC 27 -#define CMD_EXTSYNC 28 -#define CMD_BCAST 29 -#define CMD_RGBA 30 -#define CMD_STEP 31 -#define CMD_MOVE 32 +#define CMD_XRES 100 +#define CMD_YRES 101 +#define CMD_VXRES 102 +#define CMD_VYRES 103 +#define CMD_DEPTH 104 +#define CMD_MATCH 105 +#define CMD_PIXCLOCK 106 +#define CMD_LEFT 107 +#define CMD_RIGHT 108 +#define CMD_UPPER 109 +#define CMD_LOWER 110 +#define CMD_HSLEN 111 +#define CMD_VSLEN 112 +#define CMD_CSYNC 113 +#define CMD_GSYNC 114 +#define CMD_EXTSYNC 115 +#define CMD_BCAST 116 +#define CMD_RGBA 117 +#define CMD_STEP 118 +#define CMD_MOVE 119 #endif static unsigned int g_options = 0; @@ -105,9 +106,10 @@ struct cmdoptions_t { "-vsync", 1, CMD_VSYNC}, { "-laced", 1, CMD_LACED}, { "-double", 1, CMD_DOUBLE}, { - "--help", 0, CMD_HELP}, { + "-help", 0, CMD_HELP}, { + "-n", 0, CMD_CHANGE}, { #ifdef BB_FEATURE_FBSET_FANCY - "--help", 0, CMD_HELP}, { + "-help", 0, CMD_HELP}, { "-all", 0, CMD_ALL}, { "-xres", 1, CMD_XRES}, { "-yres", 1, CMD_YRES}, { @@ -115,7 +117,7 @@ struct cmdoptions_t { "-vyres", 1, CMD_VYRES}, { "-depth", 1, CMD_DEPTH}, { "-match", 0, CMD_MATCH}, { - "--geometry", 5, CMD_GEOMETRY}, { + "-geometry", 5, CMD_GEOMETRY}, { "-pixclock", 1, CMD_PIXCLOCK}, { "-left", 1, CMD_LEFT}, { "-right", 1, CMD_RIGHT}, { @@ -123,7 +125,7 @@ struct cmdoptions_t { "-lower", 1, CMD_LOWER}, { "-hslen", 1, CMD_HSLEN}, { "-vslen", 1, CMD_VSLEN}, { - "--timings", 7, CMD_TIMING}, { + "-timings", 7, CMD_TIMING}, { "-csync", 1, CMD_CSYNC}, { "-gsync", 1, CMD_GSYNC}, { "-extsync", 1, CMD_EXTSYNC}, { @@ -138,7 +140,7 @@ struct cmdoptions_t { static int readmode(struct fb_var_screeninfo *base, const char *fn, const char *mode) { -#ifdef BB_FBSET_READMODE +#ifdef BB_FEATURE_FBSET_READMODE FILE *f; char buf[256]; char *p = buf; @@ -221,17 +223,21 @@ static void showmode(struct fb_var_screeninfo *v) static void fbset_usage(void) { +#ifndef BB_FEATURE_TRIVIAL_HELP int i; +#endif #ifndef STANDALONE fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n", BB_VER, BB_BT); #endif - fprintf(stderr, "Usage: fbset [options] [mode]\n\n"); - fprintf(stderr, "Show and modify frame buffer device settings\n\n"); + fprintf(stderr, "Usage: fbset [options] [mode]\n"); +#ifndef BB_FEATURE_TRIVIAL_HELP + fprintf(stderr, "\nShows and modifies frame buffer device settings\n\n"); fprintf(stderr, "The following options are recognized:\n"); for (i = 0; g_cmdoptions[i].name; i++) fprintf(stderr, "\t%s\n", g_cmdoptions[i].name); +#endif exit(-1); } @@ -282,6 +288,9 @@ extern int fbset_main(int argc, char **argv) varset.hsync_len = strtoul(argv[6], 0, 0); varset.vsync_len = strtoul(argv[7], 0, 0); break; + case CMD_CHANGE: + g_options |= OPT_CHANGE; + break; #ifdef BB_FEATURE_FBSET_FANCY case CMD_XRES: varset.xres = strtoul(argv[1], 0, 0); @@ -325,5 +334,5 @@ extern int fbset_main(int argc, char **argv) /* Don't close the file, as exiting will take care of that */ /* close(fh); */ - exit (TRUE); + return (TRUE); }