Well, I don't think anyone actually uses the API directly due to its memory leak.
1 question though.
Why doesn't it work on Linux?
Reading the code to get the get the type and material ids is correct and identical to how DF itself does it. The only other way to do it would be to find the exact offset of the id for each item class and switching for it. I'm assuming it has different code due to linux having a different c++ runtime, but I don't know due to the fact I have never reverse engineering any code on linux (never had a job where it came up).
EDIT: wow, I should have done this sooner. IDA's output on linux binaries is a lot more informative

Switch statements are organized so much better... MSVC does some sneaky shit to optimize switches. I should have some code for you by next weekend you can build a proper item and material module with.