Convert frasetup.c to C++