cvs commit: ALFS/nALFS/src options.c options.h

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Wed Nov 5 20:04:33 PST 2003


kpfleming    03/11/05 21:04:33

  Modified:    nALFS/src options.c options.h
  Log:
  change struct option_s initializers to make gcc-2.95.3 happy
  
  Revision  Changes    Path
  1.18      +26 -9     ALFS/nALFS/src/options.c
  
  Index: options.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/options.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- options.c	5 Nov 2003 04:28:56 -0000	1.17
  +++ options.c	6 Nov 2003 04:04:33 -0000	1.18
  @@ -42,28 +42,45 @@
      be allocated storage in this module.
   */
   
  -#define STRING_OPTION(opt_name, opt_def_value, opt_other...) \
  +#define STRING_OPTION(opt_name, opt_def_value, opt_validate, \
  +		      opt_post_validate) \
   		static struct option_s real_opt_##opt_name = { \
   			.name = #opt_name, \
   			.type = O_STRING, \
  -			.val.str = { .def_value = opt_def_value, \
  -				     ## opt_other } \
  +			.val = { \
  +				.str = { .value = NULL, \
  +					 .def_value = opt_def_value, \
  +					 .validate = opt_validate, \
  +					 .post_validate = opt_post_validate } \
  +				} \
   		}; \
   		STRING * const opt_##opt_name = &real_opt_##opt_name .val.str.value
  -#define BOOL_OPTION(opt_name, opt_def_value, opt_other...) \
  +#define BOOL_OPTION(opt_name, opt_def_value, opt_validate, \
  +		    opt_post_validate) \
   		static struct option_s real_opt_##opt_name = { \
   			.name = #opt_name, \
   			.type = O_BOOL, \
  -			.val.bool = { .def_value = opt_def_value, \
  -				      ## opt_other } \
  +			.val = { \
  +				.bool = { .value = 0, \
  +					  .def_value = opt_def_value, \
  +					  .validate = opt_validate, \
  +					  .post_validate = opt_post_validate } \
  +				} \
   		}; \
   		BOOL * const opt_##opt_name = &real_opt_##opt_name .val.bool.value
  -#define NUMBER_OPTION(opt_name, opt_def_value, opt_other...) \
  +#define NUMBER_OPTION(opt_name, opt_def_value, opt_min_value, opt_max_value, \
  +		      opt_validate, opt_post_validate) \
   		static struct option_s real_opt_##opt_name = { \
   			.name = #opt_name, \
   			.type = O_NUMBER, \
  -			.val.num = { .def_value = opt_def_value, \
  -				     ## opt_other } \
  +			.val = { \
  +				.num = { .value = 0, \
  +					 .def_value = opt_def_value, \
  +					 .min_value = opt_min_value, \
  +					 .max_value = opt_max_value, \
  +					 .validate = opt_validate, \
  +					 .post_validate = opt_post_validate } \
  +				} \
   		}; \
   		NUMBER * const opt_##opt_name = &real_opt_##opt_name .val.num.value
   
  
  
  
  1.14      +49 -52    ALFS/nALFS/src/options.h
  
  Index: options.h
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/options.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- options.h	4 Nov 2003 18:48:48 -0000	1.13
  +++ options.h	6 Nov 2003 04:04:33 -0000	1.14
  @@ -28,58 +28,55 @@
   #define H_OPTIONS_
   
   
  -STRING_OPTION(alfs_directory, "");
  -BOOL_OPTION(start_immediately, 0);
  -STRING_OPTION(packages_directory, "packages");
  -STRING_OPTION(default_syntax, "3.0");
  -STRING_OPTION(cursor, "->");
  -NUMBER_OPTION(indentation_size, 4);
  -NUMBER_OPTION(sleep_after_stamp, 1);
  -BOOL_OPTION(beep_when_done, 0);
  -BOOL_OPTION(display_profile, 1);
  -BOOL_OPTION(display_options_line, 1);
  -NUMBER_OPTION(display_timer, TIMER_TOTAL, .validate=validate_number_minmax,
  -	      .min_value=TIMER_NONE, .max_value=TIMER_CURRENT);
  -BOOL_OPTION(expand_profiles, 0);
  -BOOL_OPTION(use_relative_dirs, 0);
  -BOOL_OPTION(log_status_window, 0);
  -STRING_OPTION(status_logfile, "log_file");
  -BOOL_OPTION(show_system_output, 1);
  -BOOL_OPTION(be_verbose, 0);
  -BOOL_OPTION(display_alfs, 0);
  -BOOL_OPTION(display_doctype, 0);
  -BOOL_OPTION(display_comments, 0);
  -BOOL_OPTION(run_interactive, 1);
  -NUMBER_OPTION(jumpto_element, JUMP_TO_RUNNING,
  -	      .validate=validate_number_minmax,
  -	      .min_value=JUMP_TO_FAILED, .max_value=JUMP_TO_PACKAGE);
  -NUMBER_OPTION(logging_method,LOG_OFF, .validate=validate_number_minmax,
  -	      .min_value=LOG_OFF, .max_value=LAST_LOGGING_METHOD);
  -BOOL_OPTION(log_handlers, 1);
  -BOOL_OPTION(log_backend, 1);
  -BOOL_OPTION(stamp_packages, 0);
  -STRING_OPTION(stamp_directory, "stamps");
  -BOOL_OPTION(display_stage_header, 0);
  -STRING_OPTION(find_base, "/");
  -STRING_OPTION(find_prunes, "");
  -STRING_OPTION(find_prunes_file, "");
  -STRING_OPTION(profiles_directory, "/");
  -BOOL_OPTION(warn_if_set, 0);
  -BOOL_OPTION(follow_running, 0);
  -STRING_OPTION(warn_if_set_variables, "CPPFLAGS CXXFLAGS CFLAGS LDFLAGS");
  -BOOL_OPTION(print_startup_help, 1);
  -NUMBER_OPTION(windows_relation, 50, .validate=validate_number_minmax,
  -	      .min_value=10, .max_value=90);
  -NUMBER_OPTION(status_history, 500, .validate=validate_number_minmax,
  -	      .min_value=20, .max_value=5000);
  -STRING_OPTION(editor, "");
  -STRING_OPTION(bunzip2_command, "bunzip2 -dc %s", validate_command);
  -STRING_OPTION(gunzip_command, "zcat %s", validate_command);
  -STRING_OPTION(uncompress_command, "zcat %s", validate_command);
  -STRING_OPTION(untar_command, "tar xv", validate_command);
  -STRING_OPTION(unpax_command, "pax -rv", validate_command);
  -STRING_OPTION(uncpio_command, "cpio -idv", validate_command);
  -STRING_OPTION(unzip_command, "unzip %s", validate_command);
  +STRING_OPTION(alfs_directory, "", NULL, NULL);
  +BOOL_OPTION(start_immediately, 0, NULL, NULL);
  +STRING_OPTION(packages_directory, "packages", NULL, NULL);
  +STRING_OPTION(default_syntax, "3.0", NULL, NULL);
  +STRING_OPTION(cursor, "->", NULL, NULL);
  +NUMBER_OPTION(indentation_size, 4, 0, 0, NULL, NULL);
  +NUMBER_OPTION(sleep_after_stamp, 1, 0, 0, NULL, NULL);
  +BOOL_OPTION(beep_when_done, 0, NULL, NULL);
  +BOOL_OPTION(display_profile, 1, NULL, NULL);
  +BOOL_OPTION(display_options_line, 1, NULL, NULL);
  +NUMBER_OPTION(display_timer, TIMER_TOTAL, TIMER_NONE, TIMER_CURRENT,
  +	      validate_number_minmax, NULL);
  +BOOL_OPTION(expand_profiles, 0, NULL, NULL);
  +BOOL_OPTION(use_relative_dirs, 0, NULL, NULL);
  +BOOL_OPTION(log_status_window, 0, NULL, NULL);
  +STRING_OPTION(status_logfile, "log_file", NULL, NULL);
  +BOOL_OPTION(show_system_output, 1, NULL, NULL);
  +BOOL_OPTION(be_verbose, 0, NULL, NULL);
  +BOOL_OPTION(display_alfs, 0, NULL, NULL);
  +BOOL_OPTION(display_doctype, 0, NULL, NULL);
  +BOOL_OPTION(display_comments, 0, NULL, NULL);
  +BOOL_OPTION(run_interactive, 1, NULL, NULL);
  +NUMBER_OPTION(jumpto_element, JUMP_TO_RUNNING, JUMP_TO_FAILED, JUMP_TO_PACKAGE,
  +	      validate_number_minmax, NULL);
  +NUMBER_OPTION(logging_method, LOG_OFF, LOG_OFF, LAST_LOGGING_METHOD,
  +	      validate_number_minmax, NULL);
  +BOOL_OPTION(log_handlers, 1, NULL, NULL);
  +BOOL_OPTION(log_backend, 1, NULL, NULL);
  +BOOL_OPTION(stamp_packages, 0, NULL, NULL);
  +STRING_OPTION(stamp_directory, "stamps", NULL, NULL);
  +BOOL_OPTION(display_stage_header, 0, NULL, NULL);
  +STRING_OPTION(find_base, "/", NULL, NULL);
  +STRING_OPTION(find_prunes, "", NULL, NULL);
  +STRING_OPTION(find_prunes_file, "", NULL, NULL);
  +STRING_OPTION(profiles_directory, "/", NULL, NULL);
  +BOOL_OPTION(warn_if_set, 0, NULL, NULL);
  +BOOL_OPTION(follow_running, 0, NULL, NULL);
  +STRING_OPTION(warn_if_set_variables, "CPPFLAGS CXXFLAGS CFLAGS LDFLAGS", NULL, NULL);
  +BOOL_OPTION(print_startup_help, 1, NULL, NULL);
  +NUMBER_OPTION(windows_relation, 50, 10, 90, validate_number_minmax, NULL);
  +NUMBER_OPTION(status_history, 500, 20, 5000, validate_number_minmax, NULL);
  +STRING_OPTION(editor, "", NULL, NULL);
  +STRING_OPTION(bunzip2_command, "bunzip2 -dc %s", validate_command, NULL);
  +STRING_OPTION(gunzip_command, "zcat %s", validate_command, NULL);
  +STRING_OPTION(uncompress_command, "zcat %s", validate_command, NULL);
  +STRING_OPTION(untar_command, "tar xv", validate_command, NULL);
  +STRING_OPTION(unpax_command, "pax -rv", validate_command, NULL);
  +STRING_OPTION(uncpio_command, "cpio -idv", validate_command, NULL);
  +STRING_OPTION(unzip_command, "unzip %s", validate_command, NULL);
   
   
   #endif /* H_OPTIONS_ */
  
  
  



More information about the alfs-log mailing list