Refactor|libcommon: Switched p_inventory.c, p_xg_line.c to C++