主题:请教一个函数指针的问题
正在看一段程序
struct KM_SETUP_TAB
{
INT8U *lcdMessage;
struct KM_SETUP_TAB *nextMenuPtr;
INT32S (*SetupItemFunc) (S_PHONE_DATA_BASE *devptr,INT8S msg);
INT32U wAuthority;
} ;
typedef struct KM_SETUP_TAB S_KM_SETUP_TAB;
static S_KM_SETUP_TAB KM_AddressBook_EN[]=
{
{"1.Search", NULL, swKM_aBookSearch, KSETUP_AUTH_NONE },
{"2.Add entry", NULL, swKM_aBookAdd, KSETUP_AUTH_NONE },
{"3.Speed dial", NULL, swKM_aBookSpeedDial, KSETUP_AUTH_NONE },
{"4.Erase all", NULL, swKM_aBookEraseAll, KSETUP_AUTH_NONE },
{NULL, NULL, NULL, 0 },
{"Name:", NULL, NULL, 0 },
{"Number:", NULL, NULL, 0 },
{"SIP Phone:", NULL, NULL, 0 },
{"Dial key", NULL, NULL, 0 },
{"P-Book is empty", NULL, NULL, 0 },
{"Search:", NULL, NULL, 0 },
{"P-Book is full", NULL, NULL, 0 },
{"Press M1..Mx to", NULL, NULL, 0 },
{"strore number", NULL, NULL, 0 },
{NULL, NULL, NULL, 0 }
};
static INT32S swKM_aBookAdd(S_PHONE_DATA_BASE *devptr,INT8S msg)
{
//S_DB_SIP_ADDR_PORT *BookPtr;
if(devptr->FunState == FUN_STATE_SELECTION)
{
abkSorting(devptr);
devptr->aBkName[0]=0;
devptr->aBkPhoneNo[0]=0;
devptr->aBkJob=0;
devptr->Update=FALSE;
if(devptr->aBkTotals==C_DB_SIP_PHONEBOOK_NUM)
{
CLR_LCD_SCREEN();
PRINT_LCD_LINE_STRING(0,devptr->ItemList[PROMPT_7],C_NOT_UPDATE_LCD_BUF);
}
}
if(devptr->aBkTotals==C_DB_SIP_PHONEBOOK_NUM)
{
devptr->FunState = FUN_STATE_SELECTION; // exit
}
else
{
//devptr->aBkSelect=devptr->aBkTotals;
devptr->temp=TRUE; // add item
abkEditEntry(devptr,msg);
}
}
请问为什么在调用swKM_aBookAdd 时可以不带参数,要是可以不带的话,那些参数从哪里来呢?
实在是郁闷!
struct KM_SETUP_TAB
{
INT8U *lcdMessage;
struct KM_SETUP_TAB *nextMenuPtr;
INT32S (*SetupItemFunc) (S_PHONE_DATA_BASE *devptr,INT8S msg);
INT32U wAuthority;
} ;
typedef struct KM_SETUP_TAB S_KM_SETUP_TAB;
static S_KM_SETUP_TAB KM_AddressBook_EN[]=
{
{"1.Search", NULL, swKM_aBookSearch, KSETUP_AUTH_NONE },
{"2.Add entry", NULL, swKM_aBookAdd, KSETUP_AUTH_NONE },
{"3.Speed dial", NULL, swKM_aBookSpeedDial, KSETUP_AUTH_NONE },
{"4.Erase all", NULL, swKM_aBookEraseAll, KSETUP_AUTH_NONE },
{NULL, NULL, NULL, 0 },
{"Name:", NULL, NULL, 0 },
{"Number:", NULL, NULL, 0 },
{"SIP Phone:", NULL, NULL, 0 },
{"Dial key", NULL, NULL, 0 },
{"P-Book is empty", NULL, NULL, 0 },
{"Search:", NULL, NULL, 0 },
{"P-Book is full", NULL, NULL, 0 },
{"Press M1..Mx to", NULL, NULL, 0 },
{"strore number", NULL, NULL, 0 },
{NULL, NULL, NULL, 0 }
};
static INT32S swKM_aBookAdd(S_PHONE_DATA_BASE *devptr,INT8S msg)
{
//S_DB_SIP_ADDR_PORT *BookPtr;
if(devptr->FunState == FUN_STATE_SELECTION)
{
abkSorting(devptr);
devptr->aBkName[0]=0;
devptr->aBkPhoneNo[0]=0;
devptr->aBkJob=0;
devptr->Update=FALSE;
if(devptr->aBkTotals==C_DB_SIP_PHONEBOOK_NUM)
{
CLR_LCD_SCREEN();
PRINT_LCD_LINE_STRING(0,devptr->ItemList[PROMPT_7],C_NOT_UPDATE_LCD_BUF);
}
}
if(devptr->aBkTotals==C_DB_SIP_PHONEBOOK_NUM)
{
devptr->FunState = FUN_STATE_SELECTION; // exit
}
else
{
//devptr->aBkSelect=devptr->aBkTotals;
devptr->temp=TRUE; // add item
abkEditEntry(devptr,msg);
}
}
请问为什么在调用swKM_aBookAdd 时可以不带参数,要是可以不带的话,那些参数从哪里来呢?
实在是郁闷!