FreeBSD/sys/contrib/dev/acpica/components/parser/psargs.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiPsGetNextNamestring
 *
 * PARAMETERS:  ParserState         - Current parser state object
 *
 * RETURN:      Pointer to the start of the name string (pointer points into
 *              the AML.
 *
 * DESCRIPTION: Get next raw namestring within the AML stream. Handles all name
 *              prefix characters. Set parser state to point past the string.
 *              (Name is consumed from the AML.)
 *
 ******************************************************************************/
AcpiPsGetNextNamestring
PARAMETERS:  ParserState         - Current parser state object

Pointer to the start of the name string (pointer points into
the AML.

Get next raw namestring within the AML stream. Handles all name
prefix characters. Set parser state to point past the string.
(Name is consumed from the AML.)
AcpiPsGetNextNamestring PARAMETERS : ParserState - Current parser state object Pointer to the start of the name string ( pointer points into the AML . Get next raw namestring within the AML stream . Handles all name prefix characters . Set parser state to point past the string . ( Name is consumed from the AML . )
char *
AcpiPsGetNextNamestring (
    ACPI_PARSE_STATE        *ParserState)
{
    UINT8                   *Start = ParserState->Aml;
    UINT8                   *End = ParserState->Aml;
    ACPI_FUNCTION_TRACE (PsGetNextNamestring);
    while (ACPI_IS_ROOT_PREFIX (*End) ||
           ACPI_IS_PARENT_PREFIX (*End))
    {
        End++;
    }
    switch (*End)
    {
    case 0:
        if (End == Start)
        {
            Start = NULL;
        }
        End++;
        break;
    case AML_DUAL_NAME_PREFIX:
        End += 1 + (2 * ACPI_NAME_SIZE);
        break;
    case AML_MULTI_NAME_PREFIX_OP:
        End += 2 + (*(End + 1) * ACPI_NAME_SIZE);
        break;
    default:
        End += ACPI_NAME_SIZE;
        break;
    }
    ParserState->Aml = End;
    return_PTR ((char *) Start);
}
char * AcpiPsGetNextNamestring ( ACPI_PARSE_STATE * ParserState ) { UINT8 * Start = ParserState -> Aml ; UINT8 * End = ParserState -> Aml ; ACPI_FUNCTION_TRACE ( PsGetNextNamestring ) ; while ( ACPI_IS_ROOT_PREFIX ( * End ) || ACPI_IS_PARENT_PREFIX ( * End ) ) { End ++ ; } switch ( * End ) { case 0 : if ( End == Start ) { Start = NULL ; } End ++ ; break ; case AML_DUAL_NAME_PREFIX : End += 1 + ( 2 * ACPI_NAME_SIZE ) ; break ; case AML_MULTI_NAME_PREFIX_OP : End += 2 + ( * ( End + 1 ) * ACPI_NAME_SIZE ) ; break ; default : End += ACPI_NAME_SIZE ; break ; } ParserState -> Aml = End ; return_PTR ( ( char * ) Start ) ; }
FUNCTION:    AcpiPsGetNextNamestring
 PARAMETERS:  ParserState         - Current parser state object
FUNCTION : AcpiPsGetNextNamestring PARAMETERS : ParserState - Current parser state object
/* Point past any namestring prefix characters (backslash or carat) */ /* Decode the path prefix character */ /* NullName */ /* Two name segments */ /* Multiple name segments, 4 chars each, count in next byte */ /* Single name segment */