examples/vhost_crypto: enhance getopt_long usage
authorIbtisam Tariq <ibtisam.tariq@emumba.com>
Thu, 4 Feb 2021 07:34:20 +0000 (07:34 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 23 Mar 2021 12:00:29 +0000 (13:00 +0100)
commit270054edc931967b922dd9398befd7927fecbb33
treef0a9b813d4b5b13dc4307837c34a280db8ba4219
parent965b06f0358297513242f1f8029e5fc34580f101
examples/vhost_crypto: enhance getopt_long usage

Instead of using getopt_long return value, strcmp was used to
compare the input parameters with the struct option array. This
patch get rid of all those strcmp by directly binding each longopt
with an int enum. This is to improve readability and consistency in
all examples.

Bugzilla ID: 238

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
examples/vhost_crypto/main.c