Moved string-to-oflag convertion to C code