enum animals {
ant
cat,
dog,
robin,
last_animal = INT_MAX;
};
By performing the most common tests first, you increase the efficiency of your code; fewer tests are required to meet the test conditions.
if (command.is_classg &&
command.len == 6 &&
!strcmp (command.str, "LOGON")) /* call to strcmp() most expensive */
logon ();