cvs commit: ALFS/nALFS/src editor.c libXML-tree.c nalfs.c parser.c parser.h

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Sat Mar 13 22:26:02 PST 2004


kpfleming    04/03/13 23:26:02

  Modified:    nALFS/src editor.c libXML-tree.c nalfs.c parser.c parser.h
  Log:
  remove old parsing system attribute storage in element structure
  
  Revision  Changes    Path
  1.5       +6 -1      ALFS/nALFS/src/editor.c
  
  Index: editor.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/editor.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- editor.c	3 Nov 2003 21:45:04 -0000	1.4
  +++ editor.c	14 Mar 2004 06:26:02 -0000	1.5
  @@ -308,7 +308,8 @@
   
   	xfree(value);
   
  -
  +/* TODO: figure out if this is even relevant */
  +#if 0
   	/* Update attributes. */
   	for (i = 6; fields[i]; i += 2) {
   		attr = field_to_text(field_buffer(fields[i], 0));
  @@ -343,6 +344,7 @@
   		xfree(value);
   		xfree(attr);
   	}
  +#endif
   }
   
   typedef enum quit_type_e {
  @@ -445,7 +447,9 @@
   
   	fields[num] = NULL;
   
  +/* TODO: figure out if this is relevant */
   	/* Add fields for attributes (if any). */
  +#if 0
   	if (el->attr) {
   		for (i = 0; el->attr[i]; i += 2) {
   			int row = (i/2 % windows.main->lines);
  @@ -466,6 +470,7 @@
   			}
   		}
   	}
  +#endif
   
   	return fields;
   }
  
  
  
  1.20      +0 -20     ALFS/nALFS/src/libXML-tree.c
  
  Index: libXML-tree.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/libXML-tree.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- libXML-tree.c	14 Mar 2004 06:11:07 -0000	1.19
  +++ libXML-tree.c	14 Mar 2004 06:26:02 -0000	1.20
  @@ -95,24 +95,6 @@
   
   static unsigned int element_id;
   
  -
  -static INLINE void set_attributes(element_s *el, xmlNodePtr node)
  -{
  -	int i = 0;
  -	xmlAttrPtr attr;
  -
  -
  -	for (attr = node->properties; attr; attr = attr->next) {
  -		el->attr = xrealloc(el->attr, (i + 3) * sizeof *el->attr);
  -
  -		el->attr[i] = xstrdup((const char *)attr->name);
  -		el->attr[i+1] = xstrdup((const char *)attr->children->content);
  -		el->attr[i+2] = NULL;
  -
  -		i += 2;
  -	}
  -}
  -
   static const struct handler_attribute *find_handler_attribute(const handler_info_s *handler,
   							      const char *name)
   {
  @@ -360,8 +342,6 @@
   					xfree(c);
   				}
   			}
  -
  -			set_attributes(el, node);
   
   			break;
   		case XML_COMMENT_NODE:
  
  
  
  1.44      +5 -1      ALFS/nALFS/src/nalfs.c
  
  Index: nalfs.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/nalfs.c,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- nalfs.c	14 Mar 2004 05:40:27 -0000	1.43
  +++ nalfs.c	14 Mar 2004 06:26:02 -0000	1.44
  @@ -2973,7 +2973,8 @@
   	
   	Xwprintw(windows.main->name, "Element name  : %s\n\n", el->name);
   
  -	/* Print attributes (if any). */
  +/* TODO: get content from handler */
  +	/* Print attributes (if any).
   	if (el->attr) {
   		for (i = 0; el->attr[i]; i += 2) {
   			Xwprintw(windows.main->name, "%s = %s\n",
  @@ -2983,6 +2984,7 @@
   	} else {
   		Xwaddstr(windows.main->name, "No attributes.\n");
           }
  +	*/
   
   	Xwaddch(windows.main->name, '\n');
   
  @@ -3507,6 +3509,7 @@
   		}
   	}
   
  +/* TODO: handle content from handler
   	if ((what & SEARCH_ATTRIBUTES) && el->attr) {
   		int i;
   
  @@ -3516,6 +3519,7 @@
   			}
   		}
   	}
  +*/
   
   	if ((what & SEARCH_CONTENT) && el->content) {
   		if (xstrcasestr(el->content, string + offset)) {
  
  
  
  1.12      +0 -13     ALFS/nALFS/src/parser.c
  
  Index: parser.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/parser.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- parser.c	14 Mar 2004 05:40:27 -0000	1.11
  +++ parser.c	14 Mar 2004 06:26:02 -0000	1.12
  @@ -51,7 +51,6 @@
   	new->id = 0;
   
   	new->name = NULL;
  -	new->attr = NULL;
   	new->content = NULL;
   
   	new->should_run = 0;
  @@ -71,7 +70,6 @@
   
   void free_element(element_s *el)
   {
  -	int i;
   	element_s *tmp;
   	element_s *child = el->children;
   
  @@ -89,17 +87,6 @@
   
   	xfree(el->name);
   	xfree(el->content);
  -
  -	if (el->attr) {
  -		for (i = 0; el->attr[i]; i += 2) {
  -			xfree(el->attr[i]);
  -			xfree(el->attr[i+1]);
  -		}
  -		xfree(el->attr[i]);
  -
  -		xfree(el->attr);
  -		el->attr = NULL;
  -	}
   
   	xfree(el);
   }
  
  
  
  1.9       +0 -1      ALFS/nALFS/src/parser.h
  
  Index: parser.h
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/parser.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- parser.h	14 Mar 2004 05:40:27 -0000	1.8
  +++ parser.h	14 Mar 2004 06:26:02 -0000	1.9
  @@ -68,7 +68,6 @@
   	void *handler_data;
   
   	char *name;
  -	char **attr;
   	char *content;
   
   	struct element_s *parent;
  
  
  



More information about the alfs-log mailing list