wut/include/coreinit/memlist.h

77 lines
1.4 KiB
C
Raw Normal View History

2016-01-07 14:20:45 +01:00
#pragma once
#include <wut.h>
2016-01-07 17:02:54 +01:00
/**
* \defgroup coreinit_memlist Memory List
* \ingroup coreinit
* @{
*/
2016-01-07 15:09:43 +01:00
#ifdef __cplusplus
extern "C" {
#endif
2016-01-07 14:20:45 +01:00
2016-01-08 17:52:12 +01:00
typedef struct MEMMemoryLink MEMMemoryLink;
typedef struct MEMMemoryList MEMMemoryList;
2016-01-07 14:20:45 +01:00
struct MEMMemoryLink
{
void *prev;
void *next;
};
2016-01-08 17:52:12 +01:00
CHECK_OFFSET(MEMMemoryLink, 0x0, prev);
CHECK_OFFSET(MEMMemoryLink, 0x4, next);
CHECK_SIZE(MEMMemoryLink, 0x8);
2016-01-07 14:20:45 +01:00
struct MEMMemoryList
{
void *head;
void *tail;
uint16_t count;
uint16_t offsetToMemoryLink;
};
CHECK_OFFSET(MEMMemoryList, 0x0, head);
CHECK_OFFSET(MEMMemoryList, 0x4, tail);
CHECK_OFFSET(MEMMemoryList, 0x8, count);
CHECK_OFFSET(MEMMemoryList, 0xa, offsetToMemoryLink);
CHECK_SIZE(MEMMemoryList, 0xc);
void
MEMInitList(MEMMemoryList *list,
uint16_t offsetToMemoryLink);
void
MEMAppendListObject(MEMMemoryList *list,
void *object);
void
MEMPrependListObject(MEMMemoryList *list,
void *object);
void
MEMInsertListObject(MEMMemoryList *list,
void *before,
void *object);
void
MEMRemoveListObject(MEMMemoryList *list,
void *object);
void *
MEMGetNextListObject(MEMMemoryList *list,
void *object);
void *
MEMGetPrevListObject(MEMMemoryList *list,
void *object);
void *
2016-01-08 17:52:12 +01:00
MEMGetNthListObject(MEMMemoryList *list,
2016-01-07 14:20:45 +01:00
uint16_t n);
2016-01-07 15:09:43 +01:00
#ifdef __cplusplus
}
#endif
2016-01-07 17:02:54 +01:00
/** @} */