Classes and races are set like bitfields in the items table. They use a power of two to specify which class/race can equip the item. From classes.h and races.h we can see the values (I took them out of alphabetical order for readibility).
Code:
#define warrior_1 1
#define cleric_1 2
#define paladin_1 4
#define ranger_1 8
#define shadow_1 16
#define druid_1 32
#define monk_1 64
#define bard_1 128
#define rogue_1 256
#define shaman_1 512
#define necromancer_1 1024
#define wizard_1 2048
#define mage_1 4096
#define enchanter_1 8192
#define beastlord_1 16384
#define berserker_1 32768
Code:
#define human_1 1
#define barbarian_1 2
#define erudite_1 4
#define woodelf_1 8
#define highelf_1 16
#define darkelf_1 32
#define halfelf_1 64
#define dwarf_1 128
#define troll_1 256
#define ogre_1 512
#define halfling_1 1024
#define gnome_1 2048
#define iksar_1 4096
#define vahshir_1 8192
If you wanted an item to be WAR only, you would set it's class field to 1. If you wanted it to be WAR and ROG usable, you can add the numbers together and set it to 257 (1 + 256) .. etc. The same goes for classes.
Look on the wiki or search the forums for a list of item types. I have seen a few.