d2item.c 1023 Bytes
#include "d2item.h"

#define readBits(start,size) ((*((unsigned long *) &data[(start) / 8]) >> ((start) & 7)) & ((1 << (size)) - 1))

// This function translates the item identifiers (the 4 
// character item ID used by the game, to an internal, 
// sequential ID used for more efficient lookups instead 
// of looping to find a match)
unsigned int _getItemIndex(D2S_ITEMDATA_IDENTIFIER itemID) {
    // TODO (LONG!)
}

void* _exportItemData(D2Item* item) {
    // TODO
}

void* _findInventoryClassOffset(D2S_INVENTORYCLASS inv, void* charData, size_t dataLen) {
    // TODO
}

D2Item* getItem(D2S_INVENTORYCLASS inv, unsigned int offset, void* charData, size_t dataLen) {
    // TODO
}

void freeItem(D2Item* item) {
    // TODO
}

int setItem(D2S_INVENTORYCLASS inv, unsigned int offset, D2Item* item, void* charData, size_t dataLen) {
    // TODO
}

int exportItem(D2Item* item, const char* filename) {
    // TODO
}

D2Item* importItem(const char* filename) {
    // TODO
}

void printItem(D2Item* item) {
    // TODO
}