cvs commit: ALFS/nALFS/src/handlers conditionals.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Thu Feb 12 18:46:53 PST 2004


kpfleming    04/02/12 19:46:53

  Modified:    nALFS/src backend.c handlers.c libXML-tree.c nalfs.c
                        parser.h
               nALFS/src/handlers conditionals.c
  Log:
  change element_s structure to hold pointer to handler_info_s instead of handler_s, handler_s does not contain any information useful to most of the application
  
  Revision  Changes    Path
  1.12      +4 -4      ALFS/nALFS/src/backend.c
  
  Index: backend.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/backend.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- backend.c	11 Feb 2004 05:08:12 -0000	1.11
  +++ backend.c	13 Feb 2004 02:46:53 -0000	1.12
  @@ -306,7 +306,7 @@
   	va_end(ap);
   
   	if (status > -1 && status < (int) sizeof command) {
  -		if (element && element->handler->info->alternate_shell) {
  +		if (element && element->handler->alternate_shell) {
   			shell = alloc_stage_shell(element);
   		} else {
   			shell = xstrdup("sh");
  @@ -371,7 +371,7 @@
   				change_to_profiles_dir(el);
   			}
   
  -			i = el->handler->info->main(el);
  +			i = el->handler->main(el);
   
   		} else { /* Never reached.
   			  * (Only elements with ->handler have TYPE_ELEMENT
  @@ -413,7 +413,7 @@
   	if (*opt_use_relative_dirs)
   		change_to_profiles_dir(element);
   
  -	i = element->handler->info->test(element, result);
  +	i = element->handler->test(element, result);
   
   	if (i == 0) {
   		// TODO: Is there a point of setting these at all?
  @@ -445,7 +445,7 @@
   		int i;
   
   		if (child->handler &&
  -		    ((child->handler->info->type & type_filter) == 0))
  +		    ((child->handler->type & type_filter) == 0))
   			continue;
   
   		if ((i = do_execute_element(child)))
  
  
  
  1.17      +7 -7      ALFS/nALFS/src/handlers.c
  
  Index: handlers.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- handlers.c	11 Feb 2004 04:21:54 -0000	1.16
  +++ handlers.c	13 Feb 2004 02:46:53 -0000	1.17
  @@ -270,12 +270,12 @@
   
   char *alloc_package_name(element_s *el)
   {
  -	return el->handler->info->alloc_data(el, HDATA_NAME);
  +	return el->handler->alloc_data(el, HDATA_NAME);
   }
   
   char *alloc_package_version(element_s *el)
   {
  -	return el->handler->info->alloc_data(el, HDATA_VERSION);
  +	return el->handler->alloc_data(el, HDATA_VERSION);
   }
   
   char *alloc_package_string(element_s *el)
  @@ -315,12 +315,12 @@
   
   char *alloc_textdump_file(element_s *el)
   {
  -	return el->handler->info->alloc_data(el, HDATA_FILE);
  +	return el->handler->alloc_data(el, HDATA_FILE);
   }
   
   char *alloc_execute_command(element_s *el)
   {
  -	return el->handler->info->alloc_data(el, HDATA_COMMAND);
  +	return el->handler->alloc_data(el, HDATA_COMMAND);
   }
   
   /* Used by old syntax (2.0). */
  @@ -361,7 +361,7 @@
   	for (s = el->parent; s; s = s->parent) {
   		if (!s->handler) continue;
   
  -		if (s->handler->info->type & HTYPE_STAGE) {
  +		if (s->handler->type & HTYPE_STAGE) {
   			element_s *sinfo;
   
   			if ((sinfo = first_param("stageinfo", s)) == NULL) {
  @@ -390,7 +390,7 @@
   	for (s = el->parent; s; s = s->parent) {
   		if (!s->handler) continue;
   
  -		if (s->handler->info->type & HTYPE_STAGE) {
  +		if (s->handler->type & HTYPE_STAGE) {
   			element_s *sinfo;
   
   			if ((sinfo = first_param("stageinfo", s)) == NULL) {
  @@ -414,7 +414,7 @@
   	for (s = el->parent; s; s = s->parent) {
   		if (!s->handler) continue;
   
  -		if (s->handler->info->type & HTYPE_STAGE) {
  +		if (s->handler->type & HTYPE_STAGE) {
   			element_s *sinfo;
   
   			if ((sinfo = first_param("stageinfo", s)) == NULL) {
  
  
  
  1.6       +1 -1      ALFS/nALFS/src/libXML-tree.c
  
  Index: libXML-tree.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/libXML-tree.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- libXML-tree.c	3 Nov 2003 21:45:04 -0000	1.5
  +++ libXML-tree.c	13 Feb 2004 02:46:53 -0000	1.6
  @@ -138,7 +138,7 @@
   
   			if ((handler = find_handler(el->name, syntax_version))) {
   				el->type = TYPE_ELEMENT;
  -				el->handler = handler;
  +				el->handler = handler->info;
   
   			} else if (parameter_exists(el->name)) {
   				el->type = TYPE_PARAMETER;
  
  
  
  1.41      +2 -2      ALFS/nALFS/src/nalfs.c
  
  Index: nalfs.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/nalfs.c,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- nalfs.c	8 Feb 2004 05:57:23 -0000	1.40
  +++ nalfs.c	13 Feb 2004 02:46:53 -0000	1.41
  @@ -108,7 +108,7 @@
   #define State_changed(s, el) ( \
   	s.exists && ! is_corresponding_state(s.filename, el) && \
   	el->handler && \
  -	el->handler->info->is_action)
  +	el->handler->is_action)
   
   
   /* Currently displayed elements in the main window. */
  @@ -1475,7 +1475,7 @@
   
   	if (el->handler) { /* Description and some element-specific info. */
   		if (! Is_element_name(el, "stage") || *opt_display_stage_header) {
  -			append_str(&line, el->handler->info->description);
  +			append_str(&line, el->handler->description);
   		}
   
   		add_element_specific_info(&line, el);
  
  
  
  1.4       +1 -1      ALFS/nALFS/src/parser.h
  
  Index: parser.h
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/parser.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- parser.h	23 Oct 2003 22:02:56 -0000	1.3
  +++ parser.h	13 Feb 2004 02:46:53 -0000	1.4
  @@ -65,7 +65,7 @@
   	int should_run;
   	int hide_children;
   
  -	struct handler_s *handler;
  +	struct handler_info_s *handler;
   
   	char *name;
   	char **attr;
  
  
  
  1.5       +4 -4      ALFS/nALFS/src/handlers/conditionals.c
  
  Index: conditionals.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/conditionals.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- conditionals.c	11 Feb 2004 05:08:12 -0000	1.4
  +++ conditionals.c	13 Feb 2004 02:46:53 -0000	1.5
  @@ -129,7 +129,7 @@
   			Nprint_h_err("<%s> element not allowed inside <if>.", child->name);
   			return -1;
   		}
  -		if ((child->handler->info->type & HTYPE_TEST) != 0) {
  +		if ((child->handler->type & HTYPE_TEST) != 0) {
   			i = do_execute_test_element(child, &test_result);
   			if (i != 0)
   				return i;
  @@ -150,7 +150,7 @@
   	*result = 1;
   	for (child = element->children; *result && child; child = child->next) {
   		if (child->handler &&
  -		    ((child->handler->info->type & HTYPE_TEST) != 0)) {
  +		    ((child->handler->type & HTYPE_TEST) != 0)) {
   			i = do_execute_test_element(child, result);
   			if (i != 0)
   				return i;
  @@ -171,7 +171,7 @@
   	*result = 0;
   	for (child = element->children; !*result && child; child = child->next) {
   		if (child->handler &&
  -		    ((child->handler->info->type & HTYPE_TEST) != 0)) {
  +		    ((child->handler->type & HTYPE_TEST) != 0)) {
   			i = do_execute_test_element(child, result);
   			if (i != 0)
   				return i;
  @@ -196,7 +196,7 @@
   	}
   
   	if (child->handler &&
  -	    ((child->handler->info->type & HTYPE_TEST) != 0)) {
  +	    ((child->handler->type & HTYPE_TEST) != 0)) {
   		i = do_execute_test_element(child, result);
   		if (i != 0)
   			return i;
  
  
  



More information about the alfs-log mailing list