d2item.c 1.39 KB
#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 _getItemIDIndex(D2S_ITEMDATA_IDENTIFIER itemID) {
    // TODO (LONG!)
}

unsigned int _getRunewordIDIndex(D2S_ITEMDATA_RUNEWORD_IDENTIFIER runewordID) {
    // TODO (LONG!)
}

unsigned int _getPrefixIDIndex(D2S_ITEMDATA_PREFIX_IDENTIFIER prefixID) {
    // TODO (LONG!)
}

unsigned int _getSuffixIDIndex(D2S_ITEMDATA_SUFFIX_IDENTIFIER suffixID) {
    // TODO (LONG!)
}

unsigned int _getMagicAttrIDIndex(D2S_ITEMDATA_MAGIC_ATTRIBUTE attrID) {
    // 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
}