C glue code. Most unused now, but some are needed.