Home | History | Annotate | Download | only in layout
      1 /*
      2  *
      3  * Copyright (C) 2016 and later: Unicode, Inc. and others.
      4  * License & terms of use: http://www.unicode.org/copyright.html#License
      5  *
      6  * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
      7  *
      8  */
      9 
     10 #ifndef __ARRAYMEM_H
     11 #define __ARRAYMEM_H
     12 
     13 #include <stdlib.h>
     14 
     15 #define ARRAY_SIZE(array) (sizeof array / sizeof array[0])
     16 
     17 #define ARRAY_COPY(dst, src, count) memcpy((void *) (dst), (void *) (src), (count) * sizeof (src)[0])
     18 
     19 #define NEW_ARRAY(type,count) (type *) malloc((count) * sizeof(type))
     20 
     21 #define DELETE_ARRAY(array) free((void *) (array))
     22 
     23 #define GROW_ARRAY(array,newSize) realloc((void *) (array), (newSize) * sizeof (array)[0])
     24 
     25 #endif
     26