While I don't do enough C to comment on some of the other items, the global static variable named "last" seems likely to collide with a variable name that would be commonly used.
Give me an email :)
Anyone can modify that. I might have a global namespace in some way. I might use a certain prefix.
Or I can have an inline function that gets the pointer.