/[global]/global/libutil/varray.c
ViewVC logotype

Diff of /global/libutil/varray.c

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

revision 1.3 by h-iwamoto, Mon Jul 11 10:28:36 2005 UTC revision 1.4 by shigio, Tue Oct 4 07:59:04 2005 UTC
# Line 84  static int debug = 0; Line 84  static int debug = 0;
84   *      r)      vb      VARRAY structure   *      r)      vb      VARRAY structure
85   */   */
86  VARRAY *  VARRAY *
87  varray_open(size, expand)  varray_open(int size, int expand)
         int size;  
         int expand;  
88  {  {
89          VARRAY *vb = (VARRAY *)malloc(sizeof(VARRAY));          VARRAY *vb = (VARRAY *)malloc(sizeof(VARRAY));
90    
# Line 115  varray_open(size, expand) Line 113  varray_open(size, expand)
113   * This procedure doesn't operate the contents of the array.   * This procedure doesn't operate the contents of the array.
114   */   */
115  void *  void *
116  varray_assign(vb, index, force)  varray_assign(VARRAY *vb, int index, int force)
         VARRAY *vb;  
         int index;  
         int force;  
117  {  {
118          if (index < 0)          if (index < 0)
119                  die("varray_assign: illegal index value.");                  die("varray_assign: illegal index value.");
# Line 164  varray_assign(vb, index, force) Line 159  varray_assign(vb, index, force)
159   * This procedure doesn't operate the contents of the array.   * This procedure doesn't operate the contents of the array.
160   */   */
161  void *  void *
162  varray_append(vb)  varray_append(VARRAY *vb)
         VARRAY *vb;  
163  {  {
164          return varray_assign(vb, vb->length, 1);          return varray_assign(vb, vb->length, 1);
165  }  }
# Line 175  varray_append(vb) Line 169  varray_append(vb)
169   *      i)      vb      VARRAY structure   *      i)      vb      VARRAY structure
170   */   */
171  void  void
172  varray_reset(vb)  varray_reset(VARRAY *vb)
         VARRAY  *vb;  
173  {  {
174          vb->length = 0;          vb->length = 0;
175  }  }
# Line 186  varray_reset(vb) Line 179  varray_reset(vb)
179   *      i)      vb      VARRAY structure   *      i)      vb      VARRAY structure
180   */   */
181  void  void
182  varray_close(vb)  varray_close(VARRAY *vb)
         VARRAY  *vb;  
183  {  {
184          if (vb) {          if (vb) {
185                  if (vb->vbuf)                  if (vb->vbuf)

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

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