/[pspp]/pspp/src/case.c
ViewVC logotype

Diff of /pspp/src/case.c

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

revision 1.2 by blp, Mon Nov 15 09:51:22 2004 UTC revision 1.3 by blp, Tue Mar 1 08:16:15 2005 UTC
# Line 152  case_destroy (struct ccase *c) Line 152  case_destroy (struct ccase *c)
152  }  }
153  #endif /* GLOBAL_DEBUGGING */  #endif /* GLOBAL_DEBUGGING */
154    
155    /* Resizes case C from OLD_CNT to NEW_CNT values. */
156    void
157    case_resize (struct ccase *c, size_t old_cnt, size_t new_cnt)
158    {
159      struct ccase new;
160    
161      case_create (&new, new_cnt);
162      case_copy (&new, 0, c, 0, old_cnt < new_cnt ? old_cnt : new_cnt);
163      case_swap (&new, c);
164      case_destroy (&new);
165    }
166    
167    /* Swaps cases A and B. */
168    void
169    case_swap (struct ccase *a, struct ccase *b)
170    {
171      struct case_data *t = a->case_data;
172      a->case_data = b->case_data;
173      b->case_data = t;
174    }
175    
176  /* Attempts to create C as a new case that holds VALUE_CNT  /* Attempts to create C as a new case that holds VALUE_CNT
177     values.  Returns nonzero if successful, zero if memory     values.  Returns nonzero if successful, zero if memory
178     allocation failed. */     allocation failed. */

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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