Exemple #1
0
/* show all  command */
int ShowAllMenuItem(tLinkTable* head)
{
    tMenuItem* pNode = (tMenuItem*)GetLinkTableHead(head);
    while(pNode != NULL)
    {
        printf("%s - %s\n", pNode->cmd, pNode->desc);
        pNode = (tMenuItem*)GetNextLinkTableNode(head,(tLinkTableNode *)pNode);
    }
    return 0;
}
Exemple #2
0
/* show all commands */
int FindAllCmd(tLinkTable * head)
{
    tDataNode * pNode = (tDataNode*)GetLinkTableHead(head);
    while(pNode != NULL)
    {
        printf("%s - %s\n", pNode->cmd, pNode->desc);
        pNode = (tDataNode*)GetNextLinkTableNode(head,(tLinkTableNode *)pNode);
    }
    return 0;
}
Exemple #3
0
int ShowAllCmd(tLinkTable * pLinkTable)
{
	printf("*****************************************\n");
	printf("Menu List:				 \n");
	tDataNode *pNode = (tDataNode *)GetLinkTableHead(pLinkTable);		
	while(pNode != NULL)
	{
		printf("	%s, %s\n", pNode->cmd, pNode->desc);
		pNode = (tDataNode *)GetNextLinkTableNode(pLinkTable,(tLinkTableNode *)pNode);
	}
	printf("*****************************************\n");
	return 0;
}
Exemple #4
0
/* search MenuItem*/
tMenuItem* SearchMenuItem(tLinkTable* head, char* cmd)
{
    tMenuItem* pNode = (tMenuItem*)GetLinkTableHead(head);
    while(pNode != NULL)
    {
        if(!strcmp(pNode->cmd, cmd))
        {
            return  pNode;  
        }
        pNode = (tMenuItem*)GetNextLinkTableNode(head, (tLinkTableNode *)pNode);
    }
    return NULL;
}
Exemple #5
0
/* find a cmd in the linklist and return the datanode pointer */
tDataNode* FindCmd(tLinkTable * head, char * cmd)
{
    tDataNode * pNode = (tDataNode*)GetLinkTableHead(head);
    while(pNode != NULL)
    {
        if(!strcmp(pNode->cmd, cmd))
        {
            return  pNode;  
        }
        pNode = (tDataNode*)GetNextLinkTableNode(head,(tLinkTableNode *)pNode);
    }
    return NULL;
}
Exemple #6
0
tNode * Search(tLinkTable *pLinkTable)
{
    debug("Search GetLinkTableHead\n");
    tNode * pNode = (tNode*)GetLinkTableHead(pLinkTable);
    while(pNode != NULL)
    {
        if(pNode->data == 5)
        {
            return  pNode;  
        }
        debug("GetNextLinkTableNode\n");
        pNode = (tNode*)GetNextLinkTableNode(pLinkTable,(tLinkTableNode *)pNode);
    }
    return NULL;
}
Exemple #7
0
/* Check whether cmd existed */
int CheckCmdExist(char * cmd)
{
    if(head == NULL || cmd == NULL)
    {
        return FAILURE;
    }

    tDataNode * pNode = (tDataNode*)GetLinkTableHead(head);
    while(pNode != NULL)
    {
        if(!strcmp(pNode->cmd, cmd))
        {
            return  SUCCESS;  
        }
        pNode = (tDataNode*)GetNextLinkTableNode(head,(tLinkTableNode *)pNode);
    }
    return FAILURE;
}
Exemple #8
0
tDataNode* FindCmd(tLinkTable * pLinkTable, char *cmd)
{
	//printf("%s",cmd);
	if((pLinkTable == NULL)||(cmd == NULL))
	{
		return NULL;
	}
	tDataNode *pNode = (tDataNode *)GetLinkTableHead(pLinkTable);

	while(pNode != NULL)
	{
		if(!strcmp(pNode->cmd, cmd))
		{
			return pNode;
			
		}
		pNode = (tDataNode *)GetNextLinkTableNode(pLinkTable,(tLinkTableNode *)pNode);
	}
	return NULL;
}