sblgnt.php and related ported to c++