36 block = (
char *)calloc(1, size);
37 memcpy(
block, iBlock, size);
79 memcpy(&rawSize,
block +
METAHEADERSIZE + (index * METAENTRYSIZE) +
sizeof(rawOffset),
sizeof(rawSize));
95 memcpy(
block +
METAHEADERSIZE + (index * METAENTRYSIZE) +
sizeof(rawOffset), &rawSize,
sizeof(rawSize));
100 unsigned long max = 4;
102 unsigned long offset;
104 for (loop = 0; loop <
getCount(); loop++) {
106 max = ((offset +
size) > max) ? (offset +
size) : max;
114 unsigned long dataSize;
116 unsigned long len = strlen(entry);
117 unsigned long offset;
124 memmove(block + dataStart +
METAENTRYSIZE, block + dataStart, dataSize - dataStart);
126 for (
int loop = 0; loop < count; loop++) {
148 unsigned long offset;
150 static const char *empty =
"";
153 return (offset) ?
block+offset : empty;
158 unsigned long offset;
162 return (offset) ? size : 0;
167 unsigned long offset;
169 unsigned long dataSize;
178 memmove(
block + offset,
block + offset + size, dataSize - (offset + size));
181 for (
int loop = entryIndex + 1; loop < count; loop++) {
#define SWORD_NAMESPACE_START
static const int METAHEADERSIZE
int addEntry(const char *entry)
const char * getEntry(int entryIndex)
void removeEntry(int entryIndex)
const char * getRawData(unsigned long *size)
void setMetaEntry(int index, unsigned long offset, unsigned long size)
static const int METAENTRYSIZE
unsigned long getEntrySize(int entryIndex)
#define SWORD_NAMESPACE_END
void getMetaEntry(int index, unsigned long *offset, unsigned long *size)