-2

There're two commands:

static int Abc_CommandTest      ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandPrintExdc ( Abc_Frame_t * pAbc, int argc, char ** argv );

How to call Abc_CommandPrintExdc inside Abc_CommandTest?

int Abc_CommandTest      ( Abc_Frame_t * pAbc, int argc, char ** argv )
{
    Abc_CommandPrintExdc(...); // arg?
}

EDIT:

Users use "Abc_CommandPrintExdc [argument]" in terminal.

Users use "Abc_CommandTest" in terminal.

Abc_CommandTest will determine [argument] used in Abc_CommandPrintExdc.

The two argv are different?

user2261693
  • 405
  • 3
  • 7
  • 11

2 Answers2

2

It looks like both of those commands take the same parameters; is there a reason you can't just pass them straight through?

Abc_CommandPrintExdc(pApb, argc, argv);
Carl Norum
  • 219,201
  • 40
  • 422
  • 469
0

Is this a trick question? What's wrong with:

static int Abc_CommandTest(Abc_Frame_t *pAbc, int argc, char **argv)
{
    return Abc_CommandPrintExdc(pAbc, argc, argv);
}
Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278