cvs commit: ALFS/nALFS/src handlers.c handlers.h nalfs.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Sat Mar 20 20:54:34 PST 2004


kpfleming    04/03/20 21:54:34

  Modified:    nALFS/src handlers.c handlers.h nalfs.c
  Log:
  fix bug in find_element_by_key
  move handler loading to before option processing so handlers can eventually provide options
  
  Revision  Changes    Path
  1.34      +5 -1      ALFS/nALFS/src/handlers.c
  
  Index: handlers.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers.c,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- handlers.c	21 Mar 2004 03:40:51 -0000	1.33
  +++ handlers.c	21 Mar 2004 04:54:33 -0000	1.34
  @@ -369,9 +369,13 @@
   	(void) parse_handler_info(embedded_handlers_info, NULL);
   
   	lt_dlforeach(&load_handler, NULL);
  -	Nprint("Total %d handlers loaded.", handlers.cnt);
   
   	return 0;
  +}
  +
  +unsigned int get_handler_count(void)
  +{
  +	return handlers.cnt;
   }
   
   /*
  
  
  
  1.31      +1 -0      ALFS/nALFS/src/handlers.h
  
  Index: handlers.h
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers.h,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- handlers.h	16 Mar 2004 04:21:58 -0000	1.30
  +++ handlers.h	21 Mar 2004 04:54:33 -0000	1.31
  @@ -138,6 +138,7 @@
   int parameter_exists(const char *name);
   
   int load_all_handlers(void);
  +unsigned int get_handler_count(void);
   
   /*
    * Handlers' utility functions.
  
  
  
  1.50      +4 -6      ALFS/nALFS/src/nalfs.c
  
  Index: nalfs.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/nalfs.c,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- nalfs.c	21 Mar 2004 04:38:52 -0000	1.49
  +++ nalfs.c	21 Mar 2004 04:54:33 -0000	1.50
  @@ -691,7 +691,7 @@
   	char *endptr;
   	unsigned int id = strtoul(str, &endptr, 10);
   
  -	if (*endptr == NULL)
  +	if (*endptr == 0)
   		return get_element_by_id(id);
   
   	return NULL;
  @@ -4469,6 +4469,8 @@
   
   	nprint = nprint_init;
   
  +	/* Load all handlers (before options, so handlers can provide options). */
  +	load_all_handlers();
   
   	set_options_to_defaults();
   
  @@ -4493,7 +4495,6 @@
   
   	init_needed_directories();
   
  -
   	init_state_file();
   
   	if (! Empty_string(*opt_find_prunes_file)) {
  @@ -4502,7 +4503,6 @@
   
   	set_main_signals();
   
  -
   	if (*opt_run_interactive) { /* Start ncurses. */
   		start_display();
   		draw_static_border();
  @@ -4512,9 +4512,7 @@
   	/* Print some useful information. */
   	Nprint("Using \"%s\" directory.", *opt_alfs_directory);
   	Nprint("Using libxml2, version %s.", LIBXML_DOTTED_VERSION);
  -
  -	/* Load all handlers. */
  -	load_all_handlers();
  +	Nprint("Total %d handlers loaded.", get_handler_count());
   
   	/* Add profiles from command line. */
   	for (i = optind; i < argc; ++i) {
  
  
  



More information about the alfs-log mailing list