/[dotgnu-pnet]/pnet/image/item.c
ViewVC logotype

Diff of /pnet/image/item.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by rweather, Fri Jun 13 04:33:27 2003 UTC revision 1.8 by ktreichel, Sun Jun 26 15:56:30 2005 UTC
# Line 100  void ILProgramItemAddAttribute(ILProgram Line 100  void ILProgramItemAddAttribute(ILProgram
100  ILAttribute *ILProgramItemRemoveAttribute(ILProgramItem *item,  ILAttribute *ILProgramItemRemoveAttribute(ILProgramItem *item,
101                                                                                    ILAttribute *attr)                                                                                    ILAttribute *attr)
102  {  {
         ILAttribute **start;  
103          ILAttribute *current;          ILAttribute *current;
104    
105          /* Find the start of the attribute list */          /* Find the start of the attribute list */
106          if(item->linked)          if(item->linked)
107          {          {
108                  start = &(((ILProgramItemLink *)(item->attrsOrLink))->customAttrs);                  /* Check if first attribute is the one we are looking for */
109                    if(((ILProgramItemLink *)(item->attrsOrLink))->customAttrs == attr)
110                    {
111                            /* Yes it is. So remove it from the list and return the next one. */
112                            ((ILProgramItemLink *)(item->attrsOrLink))->customAttrs = attr->next;
113                            return attr->next;
114                    }
115                    /* Set the first attribute as staring point */
116                    current = ((ILProgramItemLink *)(item->attrsOrLink))->customAttrs;
117          }          }
118          else          else
119          {          {
120                  start = (ILAttribute **)(&(item->attrsOrLink));                  /* Check if first attribute is the one we are looking for */
121                    if(((ILAttribute *)(item->attrsOrLink)) == attr)
122                    {
123                            /* Yes it is. So remove it from the list and return the next one. */
124                            item->attrsOrLink = ((void *)attr->next);
125                            return attr->next;
126                    }
127                    /* Set the first attribute as staring point */
128                    current = (ILAttribute *)(item->attrsOrLink);
129          }          }
130    
131          /* Find the attribute and remove it from the list */          /* Find the attribute and remove it from the list */
132          if(*start == attr)          if(current != 0)
         {  
                 *start = attr->next;  
         }  
         else if(*start != 0)  
133          {          {
                 current = *start;  
134                  while(current->next != 0 && current->next != attr)                  while(current->next != 0 && current->next != attr)
135                  {                  {
136                          current = current->next;                          current = current->next;

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26