-1

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
  • 397
  • 2
  • 6
  • 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
  • 210,715
  • 34
  • 410
  • 462
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
  • 698,132
  • 130
  • 858
  • 1,229