Exemple #1
0
status_t
IMAPMailbox::FetchMessages(int32 firstMessage, int32 lastMessage)
{
	FetchMessageCommand fetchCommand(*this, firstMessage, lastMessage,
		fFetchBodyLimit);
	return ProcessCommand(&fetchCommand);
}
Exemple #2
0
static int
getCommand()
{

	char letra;
	int i;

	for ( i= 0; i < SHELL_BUFFER_LENGTH; i++)
	{
		shellBuffer[i]=0x00;
	}
	index = 0;

	do{

		kprintf("%s",PROMPT);
		kprintf("%s$ ",shellGetCWD());

		do{

			letra = getchar();

			if( isArrow(letra))
			{
				fetchCommand(letra);

			}
			else if ( letra == '\b')
			{

				if ( index > 0)
				{	backSpace();
				index--;
				}
			}
			else if( letra == '\t')
			{
				//autoFill();
			}
			else
			{
				shellBuffer[index++] = letra;
				kprintf("%c",letra);
			}

		}while (letra != '\n' && index < MAX_COMM_LENGTH);

		/*Esta condicion se cumple si solo presiono enter
		 * asi no muestro error y muestro el prompt otra vez
		 */
		if( index <= 1 )
			index = 0;
		if(index >= (MAX_COMM_LENGTH - 1))
			kprintf("\n");
	}while( index == 0);


	/*Guarda el comando en el historial*/
	commitCommand();

	/*Recupero la primera palabra del shell y la trato como si fuera un comando*/
	getCommandFromPrompt(shellBuffer);

	/*Recupero los flags, estos son de la forma
	 * -flag
	 * Si no hay flags, recupero los parametros
	 */


	if(getFlagsFromPrompt(shellBuffer) == 0)
		getParamsFromPrompt(shellBuffer,strlen(command));


	for ( i = 0; i < COMM_QTY; i++ )
	{

		if ( !strcmp(command,myCommands[i].command))
			return myCommands[i].code;
	}

	return -1;

}