add: case 'C': options->configDir = optarg; break;
context: parseOptions(int argc, char *argv[], struct options_struct *options){	int optionIndex = 0;	BOOLEAN badArg = 0;	options->addons = HMalloc(1 * sizeof (const char *));	options->addons[0] = NULL;	options->numAddons = 0;	if (argc == 0)	{		fprintf (stderr, "Error: Bad command line.\n");		return EXIT_FAILURE;	}	while (!badArg)	{		int c;		c = getopt_long(argc, argv, optString, longOptions, &optionIndex);		if (c == -1)			break;		switch (c) {			case 'r':			{				int width, height;				if (sscanf (optarg, "%dx%d", &width, &height) != 2)				{					fprintf (stderr, "Error: invalid argument specified "							"as resolution.\n");					badArg = TRUE;					break;				}				options->width = width;				options->height = height;				break;			}			case 'd':			{				int bpp;				int err = parseIntOption(optarg, &bpp, "bpp");				if (err)				{					badArg = TRUE;					break;				}				if (bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32)				{					fprintf (stderr, "Error: Invalid value specified for "							"bpp; it should be either 8, 16, 24, or 32.\n");					badArg = TRUE;					break;				}				options->bpp = bpp;				break;			}			case 'f':				options->gfxFlags |= TFB_GFXFLAGS_FULLSCREEN;				break;			case 'o':				options->gfxDriver = TFB_GFXDRIVER_SDL_OPENGL;				break;			case 'c':				if (!strcmp (optarg, "bilinear"))					options->gfxFlags |= TFB_GFXFLAGS_SCALE_BILINEAR;				else if (!strcmp (optarg, "biadapt"))					options->gfxFlags |= TFB_GFXFLAGS_SCALE_BIADAPT;				else if (!strcmp (optarg, "biadv"))					options->gfxFlags |= TFB_GFXFLAGS_SCALE_BIADAPTADV;				else if (!strcmp (optarg, "triscan"))					options->gfxFlags |= TFB_GFXFLAGS_SCALE_TRISCAN;				else				{					InvalidArgument(optarg, "--scale or -c");					badArg = TRUE;				}				break;			case 'b':				if (!strcmp (optarg, "nearest"))					options->meleeScale = TFB_SCALE_NEAREST;				else if (!strcmp (optarg, "trilinear"))					options->meleeScale = TFB_SCALE_TRILINEAR;				else				{					InvalidArgument(optarg, "--meleescale or -b");					badArg = TRUE;				}				break;			case 's':				options->gfxFlags |= TFB_GFXFLAGS_SCANLINES;				break;			case 'p':				options->gfxFlags |= TFB_GFXFLAGS_SHOWFPS;				break;			case 'n':				options->contentDir = optarg;				break;			case 'M':			{				int err = parseVolume(optarg, &options->musicVolumeScale,						"music volume");				if (err)					badArg = TRUE;				break;			}			case 'S':			{				int err = parseVolume(optarg, &options->sfxVolumeScale,						"sfx volume");				if (err)					badArg = TRUE;				break;			}			case 'T':			{				int err = parseVolume(optarg, &options->speechVolumeScale,						"speech volume");				if (err)					badArg = TRUE;				break;			}			case 'q':				if (!strcmp (optarg, "high"))				{					options->soundFlags &=							~(audio_QUALITY_MEDIUM | audio_QUALITY_LOW);					options->soundFlags |= audio_QUALITY_HIGH;				}				else if (!strcmp (optarg, "medium"))				{					options->soundFlags &=							~(audio_QUALITY_MEDIUM | audio_QUALITY_LOW);					options->soundFlags |= audio_QUALITY_MEDIUM;				}				else if (!strcmp (optarg, "low"))				{					options->soundFlags &=							~(audio_QUALITY_MEDIUM | audio_QUALITY_LOW);					options->soundFlags |= audio_QUALITY_LOW;				}				else				{					InvalidArgument(optarg, "--audioquality or -q");					badArg = TRUE;				}				break;			case 'u':				options->subTitles = FALSE;				break;			case 'm':			{				if (Check_PC_3DO_opt (optarg, OPT_PC | OPT_3DO,						longOptions[optionIndex].name,						&options->whichMusic) == -1)					badArg = TRUE;				break;			}			case 'g':			{				int err = parseFloatOption(optarg, &options->gamma,						"gamma correction");				if (err)					badArg = TRUE;				else					options->gammaSet = TRUE;				break;			}			case 'l':				// -l is a no-op on the second pass..				break;			case CSCAN_OPT:				if (Check_PC_3DO_opt (optarg, OPT_PC | OPT_3DO,						longOptions[optionIndex].name,						&options->whichCoarseScan) == -1)					badArg = TRUE;				break;			case MENU_OPT:				if (Check_PC_3DO_opt (optarg, OPT_PC | OPT_3DO,						longOptions[optionIndex].name,						&options->whichMenu) == -1)					badArg = TRUE;				break;			case FONT_OPT:				if (Check_PC_3DO_opt (optarg, OPT_PC | OPT_3DO,						longOptions[optionIndex].name,						&options->whichFonts) == -1)					badArg = TRUE;				break;			case SCROLL_OPT:				if (Check_PC_3DO_opt (optarg, OPT_PC | OPT_3DO,						longOptions[optionIndex].name,						&options->smoothScroll) == -1)					badArg = TRUE;				break;			case SOUND_OPT:				if (!strcmp (optarg, "openal"))					options->soundDriver = audio_DRIVER_OPENAL;				else if (!strcmp (optarg, "none"))					options->soundDriver = audio_DRIVER_NOSOUND;				else if (!strcmp (optarg, "mixsdl"))					options->soundDriver = audio_DRIVER_MIXSDL;				else				{					fprintf (stderr, "Error: Invalid sound driver "							"specified.\n");					badArg = TRUE;				}				break;			case STEREOSFX_OPT:				options->stereoSFX = TRUE;				break;			case ADDON_OPT:				options->numAddons++;				options->addons = HRealloc ((void *) options->addons,						(options->numAddons + 1) * sizeof (const char *));				options->addons[options->numAddons - 1] = optarg;				options->addons[options->numAddons] = NULL;				break;			default:				fprintf (stderr, "Error: Invalid option '%s' not found.\n",							longOptions[optionIndex].name);				badArg = TRUE;				break;			case '?':			case 'h':				options->runMode = runMode_usage;				return EXIT_SUCCESS;			break;		}	}	if (optind != argc)	{		fprintf (stderr, "\nError: Extra arguments found on the command "				"line.\n");		badArg = TRUE;	}	if (badArg)	{		fprintf (stderr, "Run with -h to see the allowed arguments.\n");		return EXIT_FAILURE;	}	return EXIT_SUCCESS;}