FreeBSD/sys/contrib/dev/acpica/compiler/aslerror.c
void
AslCommonError2 (
    UINT8                   Level,
    UINT16                  MessageId,
    UINT32                  LineNumber,
    UINT32                  Column,
    char                    *SourceLine,
    char                    *Filename,
    char                    *ExtraMessage)
{
    char                    *MessageBuffer = NULL;
    char                    *LineBuffer;
    ASL_ERROR_MSG           *Enode;


    Enode = UtLocalCalloc (sizeof (ASL_ERROR_MSG));

    if (ExtraMessage)
    {
        /* Allocate a buffer for the message and a new error node */

        MessageBuffer = UtStringCacheCalloc (strlen (ExtraMessage) + 1);

        /* Keep a copy of the extra message */

        strcpy (MessageBuffer, ExtraMessage);
    }

    LineBuffer = UtLocalCalloc (strlen (SourceLine) + 1);
    strcpy (LineBuffer, SourceLine);

    /* Initialize the error node */

    if (Filename)
    {
        Enode->Filename = Filename;
        Enode->FilenameLength = strlen (Filename);
        if (Enode->FilenameLength < 6)
        {
            Enode->FilenameLength = 6;
        }
    }

    Enode->MessageId            = MessageId;
    Enode->Level                = Level;
    Enode->LineNumber           = LineNumber;
    Enode->LogicalLineNumber    = LineNumber;
    Enode->LogicalByteOffset    = 0;
    Enode->Column               = Column;
    Enode->Message              = MessageBuffer;
    Enode->SourceLine           = LineBuffer;

    /* Add the new node to the error node list */

    AeAddToErrorLog (Enode);

    if (Gbl_DebugFlag)
    {
        /* stderr is a file, send error to it immediately */

        AePrintException (ASL_FILE_STDERR, Enode, NULL);
    }

    Gbl_ExceptionCount[Level]++;
}
/*******************************************************************************
 *
 * FUNCTION:    AslCommonError2
 *
 * PARAMETERS:  Level               - Seriousness (Warning/error, etc.)
 *              MessageId           - Index into global message buffer
 *              LineNumber          - Actual file line number
 *              Column              - Column in current line
 *              SourceLine          - Actual source code line
 *              Filename            - source filename
 *              ExtraMessage        - additional error message
 *
 * RETURN:      None
 *
 * DESCRIPTION: Create a new error node and add it to the error log
 *
 ******************************************************************************/


None

Create a new error node and add it to the error log
None Create a new error node and add it to the error log
void
AslCommonError2 (
    UINT8                   Level,
    UINT16                  MessageId,
    UINT32                  LineNumber,
    UINT32                  Column,
    char                    *SourceLine,
    char                    *Filename,
    char                    *ExtraMessage)
{
    char                    *MessageBuffer = NULL;
    char                    *LineBuffer;
    ASL_ERROR_MSG           *Enode;
    Enode = UtLocalCalloc (sizeof (ASL_ERROR_MSG));
    if (ExtraMessage)
    {
        MessageBuffer = UtStringCacheCalloc (strlen (ExtraMessage) + 1);
        strcpy (MessageBuffer, ExtraMessage);
    }
    LineBuffer = UtLocalCalloc (strlen (SourceLine) + 1);
    strcpy (LineBuffer, SourceLine);
    if (Filename)
    {
        Enode->Filename = Filename;
        Enode->FilenameLength = strlen (Filename);
        if (Enode->FilenameLength < 6)
        {
            Enode->FilenameLength = 6;
        }
    }
    Enode->MessageId            = MessageId;
    Enode->Level                = Level;
    Enode->LineNumber           = LineNumber;
    Enode->LogicalLineNumber    = LineNumber;
    Enode->LogicalByteOffset    = 0;
    Enode->Column               = Column;
    Enode->Message              = MessageBuffer;
    Enode->SourceLine           = LineBuffer;
    AeAddToErrorLog (Enode);
    if (Gbl_DebugFlag)
    {
        AePrintException (ASL_FILE_STDERR, Enode, NULL);
    }
    Gbl_ExceptionCount[Level]++;
}
void AslCommonError2 ( UINT8 Level , UINT16 MessageId , UINT32 LineNumber , UINT32 Column , char * SourceLine , char * Filename , char * ExtraMessage ) { char * MessageBuffer = NULL ; char * LineBuffer ; ASL_ERROR_MSG * Enode ; Enode = UtLocalCalloc ( sizeof ( ASL_ERROR_MSG ) ) ; if ( ExtraMessage ) { MessageBuffer = UtStringCacheCalloc ( strlen ( ExtraMessage ) + 1 ) ; strcpy ( MessageBuffer , ExtraMessage ) ; } LineBuffer = UtLocalCalloc ( strlen ( SourceLine ) + 1 ) ; strcpy ( LineBuffer , SourceLine ) ; if ( Filename ) { Enode -> Filename = Filename ; Enode -> FilenameLength = strlen ( Filename ) ; if ( Enode -> FilenameLength < 6 ) { Enode -> FilenameLength = 6 ; } } Enode -> MessageId = MessageId ; Enode -> Level = Level ; Enode -> LineNumber = LineNumber ; Enode -> LogicalLineNumber = LineNumber ; Enode -> LogicalByteOffset = 0 ; Enode -> Column = Column ; Enode -> Message = MessageBuffer ; Enode -> SourceLine = LineBuffer ; AeAddToErrorLog ( Enode ) ; if ( Gbl_DebugFlag ) { AePrintException ( ASL_FILE_STDERR , Enode , NULL ) ; } Gbl_ExceptionCount [ Level ] ++ ; }
FUNCTION:    AslCommonError2
 PARAMETERS:  Level               - Seriousness (Warning/error, etc.)
FUNCTION : AslCommonError2 PARAMETERS : Level - Seriousness ( Warning / error etc . )
/* Allocate a buffer for the message and a new error node */ /* Keep a copy of the extra message */ /* Initialize the error node */ /* Add the new node to the error node list */ /* stderr is a file, send error to it immediately */