# Foundation Library (Fnd) API Function List

### Shared Heap

NNS_FndGetHeapStartAddress | Gets the starting address of the memory region used by the heap.
NNS_FndGetHeapEndAddress | Gets the ending address +1 of the memory region used by the heap.
NNS_FndFindContainHeap | Finds the heap that includes the memory block.
NNS_FndSetFillValForHeap | Sets the value in memory at the time of heap creation and at the time of memory block allocation/deallocation. (Used in debugging)
NNS_FndGetFillValForHeap | Gets the value in memory at the time of heap creation and at the time of memory block allocation/deallocation. (Used in debugging)
NNS_FndDumpHeap | Displays heap contents (for debug). (Used in debugging)

### Extended Heap

NNS_FndCreateExpHeap | Creates the extended heap.
NNS_FndCreateExpHeapEx | Creates the extended heap. (Option designation)
NNS_FndDestroyExpHeap | Gets rid of the extended heap.
NNS_FndAllocFromExpHeap | Allocates a memory block from the extended heap.
NNS_FndAllocFromExpHeapEx | Allocates a memory block from the extended heap. (Alignment designation)
NNS_FndResizeForMBlockExpHeap | Changes the size of a memory block.
NNS_FndFreeToExpHeap | Deallocates a memory block.
NNS_FndSetAllocModeForExpHeap | Sets the allocation mode of the memory block of the extended heap.
NNS_FndGetAllocModeForExpHeap | Gets the allocation mode of the memory block of the extended heap.
NNS_FndSetGroupIDForExpHeap | Sets the group ID of the extended heap.
NNS_FndGetGroupIDForExpHeap | Gets the group ID of the extended heap.
NNS_FndVisitAllocatedForExpHeap | Applies the specified function to all memory blocks.
NNS_FndGetTotalFreeSizeForExpHeap | Gets the total size of the empty region inside the extended heap.
NNS_FndGetAllocatableSizeForExpHeap | Gets the maximum size of the allocatable memory block.
NNS_FndGetAllocatableSizeForExpHeapEx | Gets the maximum size of the allocatable memory block. (Alignment designation)
NNS_FndGetSizeForMBlockExpHeap | Gets the size of the memory block.
NNS_FndGetGroupIDForMBlockExpHeap | Gets the group ID of the memory block.
NNS_FndGetAllocDirForMBlockExpHeap | Gets the allocation direction of the memory block.
NNS_FndCheckExpHeap | Checks whether the extended heap is corrupted. (Used in debugging)
NNS_FndCheckForMBlockExpHeap | Checks whether a memory block in the extended heap is corrupted. (Used in debugging)

### Frame Heap

NNS_FndCreateFrmHeap | Creates the frame heap.
NNS_FndCreateFrmHeapEx | Creates the frame heap. (Option designation)
NNS_FndDestroyFrmHeap | Gets rid of the frame heap.
NNS_FndAllocFromFrmHeap | Allocates the memory block from a frame heap.
NNS_FndAllocFromFrmHeapEx | Allocates the memory block from a frame heap. (Alignment designation)
NNS_FndResizeForMBlockFrmHeap | Changes the size of a memory block.
NNS_FndFreeToFrmHeap | Deallocates a memory block.
NNS_FndRecordStateForFrmHeap | Records the allocation state of the memory block of the frame heap.
NNS_FndFreeByStateToFrmHeap | Returns to the memory block allocation state right before recording using the recorded information about the allocation state of the memory block of the frame heap.
NNS_FndAdjustFrmHeap | Deallocates the empty space of the frame heap, and reduces the memory region used by the frame heap.
NNS_FndGetAllocatableSizeForFrmHeap | Gets the maximum size of the allocatable memory block.
NNS_FndGetAllocatableSizeForFrmHeapEx | Gets the maximum size of the allocatable memory block. (Alignment designation)

### Unit Heap

NNS_FndCreateUnitHeap | Creates the unit heap.
NNS_FndCreateUnitHeapEx | Creates the unit heap. (Alignment, option designation)
NNS_FndDestroyUnitHeap | Gets rid of the unit heap.
NNS_FndAllocFromUnitHeap | Allocates a memory block from the unit heap.
NNS_FndFreeToUnitHeap | Deallocates a memory block.
NNS_FndCountFreeBlockForUnitHeap | Gets the number of memory blocks allocatable from the unit heap.
NNS_FndCalcHeapSizeForUnitHeap | Obtains the size of the required unit heap by taking the size and quantity of the memory block.
NNS_FndGetMemBlockSizeForUnitHeap | Obtains the size of the memory block of the unit heap.

### Archive

NNS_FndMountArchive | Mounts the archive on the file system.
NNS_FndUnmountArchive | Unmounts an archive mounted on the file system.
NNS_FndGetArchiveFileByIndex | Gets the address where the file is stored by file ID.
NNS_FndGetArchiveFileByName | Gets the address where the file is stored by file name.
NNS_FndOpenArchiveFileByIndex | Specifies the file ID and opens the file.

### List

NNS_FND_INIT_LIST | Initializes the list structure. (Macro version)
NNS_FndInitList | Initializes the list structure.
NNS_FndAppendListObject | Adds an object to the end of the list.
NNS_FndPrependListObject | Adds an object to the beginning of the list.
NNS_FndInsertListObject | Inserts an object at a specified position in the list.
NNS_FndRemoveListObject | Deletes an object from the list.
NNS_FndGetNextListObject | Gets the next object connected to the specified object.
NNS_FndGetPrevListObject | Gets the previous object connected to the specified object.
NNS_FndGetNthListObject | Gets the object in the nth position from the beginning of the list.
NNS_FndGetListSize | Gets the number of objects registered in the list.

### Memory Allocator

NNS_FndAllocFromAllocator | Allocates a memory block from the allocator.
NNS_FndFreeToAllocator | Returns the memory block to the allocator and frees the memory block.
NNS_FndInitAllocatorForExpHeap | Initializes the allocator to allocate and deallocates the memory from the extended heap.
NNS_FndInitAllocatorForFrmHeap | Initializes the allocator to allocate and deallocates the memory from the frame heap.
NNS_FndInitAllocatorForUnitHeap | Initializes the allocator to allocate and deallocates the memory from the unit heap.
NNS_FndInitAllocatorForSDKHeap | Initializes the allocator to allocate and deallocates the memory from the TWL-SDK heap.

CONFIDENTIAL