home *** CD-ROM | disk | FTP | other *** search
- /*
- chunk.h
- Application Kit, Release 2.0
- Copyright (c) 1988, 1989, 1990, NeXT, Inc. All rights reserved.
- */
-
- #import <Foundation/NSZone.h>
- /*
- * NXChunks implement variable sized arrays of records. Allocation is by
- * the given size (in bytes) --- typically a multiple number of records, say 10.
- * The block of memory never shrinks, and the chunk records the current number
- * of elements. To use the NXChunks, you declare a struct w/ NXChunk as its
- * first field.
- */
-
- typedef struct _NXChunk {
- short growby; /* increment to grow by */
- int allocated; /* how much is allocated */
- int used; /* how much is used */
- } NSTextChunk;
-
- extern NSTextChunk *NSChunkMalloc(int growBy, int initUsed);
- extern NSTextChunk *NSChunkRealloc(NSTextChunk *pc);
- extern NSTextChunk *NSChunkGrow(NSTextChunk *pc, int newUsed);
- extern NSTextChunk *NSChunkCopy(NSTextChunk *pc, NSTextChunk *dpc);
-
- extern NSTextChunk *NSChunkZoneMalloc(int growBy, int initUsed, NSZone *zone);
- extern NSTextChunk *NSChunkZoneRealloc(NSTextChunk *pc, NSZone *zone);
- extern NSTextChunk *NSChunkZoneGrow(NSTextChunk *pc, int newUsed, NSZone *zone);
- extern NSTextChunk *NSChunkZoneCopy(NSTextChunk *pc, NSTextChunk *dpc, NSZone *zone);
-