FreeBSD/sys/contrib/dev/acpica/components/debugger/dbinput.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiDbGetLine
 *
 * PARAMETERS:  InputBuffer         - Command line buffer
 *
 * RETURN:      Count of arguments to the command
 *
 * DESCRIPTION: Get the next command line from the user. Gets entire line
 *              up to the next newline
 *
 ******************************************************************************/
AcpiDbGetLine
PARAMETERS:  InputBuffer         - Command line buffer

Count of arguments to the command

Get the next command line from the user. Gets entire line
up to the next newline
AcpiDbGetLine PARAMETERS : InputBuffer - Command line buffer Count of arguments to the command Get the next command line from the user . Gets entire line up to the next newline
static UINT32
AcpiDbGetLine (
    char                    *InputBuffer)
{
    UINT32                  i;
    UINT32                  Count;
    char                    *Next;
    char                    *This;
    if (AcpiUtSafeStrcpy (AcpiGbl_DbParsedBuf, sizeof (AcpiGbl_DbParsedBuf),
        InputBuffer))
    {
        AcpiOsPrintf (
            "Buffer overflow while parsing input line (max %u characters)\n",
            sizeof (AcpiGbl_DbParsedBuf));
        return (0);
    }
    This = AcpiGbl_DbParsedBuf;
    for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++)
    {
        AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next,
            &AcpiGbl_DbArgTypes[i]);
        if (!AcpiGbl_DbArgs[i])
        {
            break;
        }
        This = Next;
    }
    AcpiUtStrupr (AcpiGbl_DbArgs[0]);
    Count = i;
    if (Count)
    {
        Count--;  
    }
    return (Count);
}
static UINT32 AcpiDbGetLine ( char * InputBuffer ) { UINT32 i ; UINT32 Count ; char * Next ; char * This ; if ( AcpiUtSafeStrcpy ( AcpiGbl_DbParsedBuf , sizeof ( AcpiGbl_DbParsedBuf ) , InputBuffer ) ) { AcpiOsPrintf ( " \n " , sizeof ( AcpiGbl_DbParsedBuf ) ) ; return ( 0 ) ; } This = AcpiGbl_DbParsedBuf ; for ( i = 0 ; i < ACPI_DEBUGGER_MAX_ARGS ; i ++ ) { AcpiGbl_DbArgs [ i ] = AcpiDbGetNextToken ( This , & Next , & AcpiGbl_DbArgTypes [ i ] ) ; if ( ! AcpiGbl_DbArgs [ i ] ) { break ; } This = Next ; } AcpiUtStrupr ( AcpiGbl_DbArgs [ 0 ] ) ; Count = i ; if ( Count ) { Count -- ; } return ( Count ) ; }
FUNCTION:    AcpiDbGetLine
 PARAMETERS:  InputBuffer         - Command line buffer
FUNCTION : AcpiDbGetLine PARAMETERS : InputBuffer - Command line buffer
/* Uppercase the actual command */ /* Number of args only */