Example #1
0
/*
 * Main program.
 */
int main( int argc, const char * argv [] )
{
    do_source        ( "-"         );
    fix_conditionals ( config_list );
    dump_tk_script   ( config_list );
    free(vartable);
    return 0;
}
Example #2
0
/*
 * Main program.
 */
int main( int argc, char * argv [] )
{
    if (argc >= 3) genv = argv[2];
    if (argc == 4) genv_extra = argv[3];
    do_source        ( argv[1]         );
    fix_conditionals ( config_list );
    dump_tk_script   ( config_list );
    return 0;
}
Example #3
0
int main(int argc, char * argv[])
{
#if 0
  char buffer[1024];
  char * pnt;
  struct kconfig * cfg;
  int    i;
#endif

  /*
   * Read stdin to get the top level script.
   */
  do_source("-");

  if( menus_seen == 0 )
    {
      fprintf(stderr,"The config.in file for this platform does not support\n");
      fprintf(stderr,"menus.\n");
      exit(1);
    }
  /*
   * Input file is now parsed.  Next we need to go through and attach
   * the correct conditions to each of the actual menu items and kill
   * the if/else/endif tokens from the list.  We also flag the menu items
   * that have other things that depend upon its setting.
   */
  fix_conditionals(config);

  /*
   * Finally, we generate the wish script.
   */
  dump_tk_script(config);

#if 0
  /*
   * Now dump what we have so far.  This is only for debugging so that
   * we can display what we think we have in the list.
   */
  for(cfg = config; cfg; cfg = cfg->next)
    {

      if(cfg->cond != NULL && cfg->tok != tok_if)
	dump_if(cfg->cond);

      switch(cfg->tok)
	{
	case tok_menuname:
	  printf("main_menuname ");
	  break;
	case tok_bool:
	  printf("bool ");
	  break;
	case tok_tristate:
	  printf("tristate ");
	  break;
	case tok_dep_tristate:
	  printf("dep_tristate ");
	  break;
	case tok_int:
	  printf("int ");
	  break;
	case tok_hex:
	  printf("hex ");
	  break;
	case tok_comment:
	  printf("comment ");
	  break;
	case tok_menuoption:
	  printf("menuoption ");
	  break;
	case tok_else:
	  printf("else");
	  break;
	case tok_fi:
	  printf("fi");
	  break;
	case tok_if:
	  printf("if");
	  break;
	default:
	}

      switch(cfg->tok)
	{
	case tok_menuoption:
	case tok_comment:
	case tok_menuname:
	  printf("%s\n", cfg->label);
	  break;
	case tok_bool:
	case tok_tristate:
	case tok_dep_tristate:
	case tok_int:
	case tok_hex:
	  printf("%s %s\n", cfg->label, cfg->optionname);
	  break;
	case tok_if:
	  dump_if(cfg->cond);
	  break;
	case tok_nop:
	case tok_endmenu:
	  break;
	default:
	  printf("\n");
	}
    }
#endif

  return 0;

}