當前位置: 首頁>>代碼示例>>C++>>正文


C++ ACPI_STRLEN函數代碼示例

本文整理匯總了C++中ACPI_STRLEN函數的典型用法代碼示例。如果您正苦於以下問題:C++ ACPI_STRLEN函數的具體用法?C++ ACPI_STRLEN怎麽用?C++ ACPI_STRLEN使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ACPI_STRLEN函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: AcpiDbAddToHistory

void
AcpiDbAddToHistory (
    char                    *CommandLine)
{
    UINT16                  CmdLen;
    UINT16                  BufferLen;

    /* Put command into the next available slot */

    CmdLen = (UINT16) ACPI_STRLEN (CommandLine);
    if (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command != NULL)
    {
        BufferLen = (UINT16) ACPI_STRLEN (
            AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command);
        if (CmdLen > BufferLen)
        {
            AcpiOsFree (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].
                Command);
            AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command =
                AcpiOsAllocate (CmdLen + 1);
        }
    }
    else
    {
        AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command =
            AcpiOsAllocate (CmdLen + 1);
    }

    ACPI_STRCPY (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command,
        CommandLine);

    AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].CmdNum =
        AcpiGbl_NextCmdNum;

    /* Adjust indexes */

    if ((AcpiGbl_NumHistory == HISTORY_SIZE) &&
        (AcpiGbl_NextHistoryIndex == AcpiGbl_LoHistory))
    {
        AcpiGbl_LoHistory++;
        if (AcpiGbl_LoHistory >= HISTORY_SIZE)
        {
            AcpiGbl_LoHistory = 0;
        }
    }

    AcpiGbl_NextHistoryIndex++;
    if (AcpiGbl_NextHistoryIndex >= HISTORY_SIZE)
    {
        AcpiGbl_NextHistoryIndex = 0;
    }

    AcpiGbl_NextCmdNum++;
    if (AcpiGbl_NumHistory < HISTORY_SIZE)
    {
        AcpiGbl_NumHistory++;
    }
}
開發者ID:Alkzndr,項目名稱:freebsd,代碼行數:58,代碼來源:dbhistry.c

示例2: acpi_tb_find_table

acpi_status
acpi_tb_find_table(char *signature,
		   char *oem_id,
		   char *oem_table_id, struct acpi_table_header ** table_ptr)
{
	acpi_status status;
	struct acpi_table_header *table;

	ACPI_FUNCTION_TRACE("tb_find_table");

	/* Validate string lengths */

	if ((ACPI_STRLEN(signature) > ACPI_NAME_SIZE) ||
	    (ACPI_STRLEN(oem_id) > sizeof(table->oem_id)) ||
	    (ACPI_STRLEN(oem_table_id) > sizeof(table->oem_table_id))) {
		return_ACPI_STATUS(AE_AML_STRING_LIMIT);
	}

	if (!ACPI_STRNCMP(signature, DSDT_SIG, ACPI_NAME_SIZE)) {
		/*
		 * The DSDT pointer is contained in the FADT, not the RSDT.
		 * This code should suffice, because the only code that would perform
		 * a "find" on the DSDT is the data_table_region() AML opcode -- in
		 * which case, the DSDT is guaranteed to be already loaded.
		 * If this becomes insufficient, the FADT will have to be found first.
		 */
		if (!acpi_gbl_DSDT) {
			return_ACPI_STATUS(AE_NO_ACPI_TABLES);
		}
		table = acpi_gbl_DSDT;
	} else {
		/* Find the table */

		status = acpi_get_firmware_table(signature, 1,
						 ACPI_LOGICAL_ADDRESSING,
						 &table);
		if (ACPI_FAILURE(status)) {
			return_ACPI_STATUS(status);
		}
	}

	/* Check oem_id and oem_table_id */

	if ((oem_id[0] && ACPI_STRNCMP(oem_id, table->oem_id,
				       sizeof(table->oem_id))) ||
	    (oem_table_id[0] && ACPI_STRNCMP(oem_table_id, table->oem_table_id,
					     sizeof(table->oem_table_id)))) {
		return_ACPI_STATUS(AE_AML_NAME_NOT_FOUND);
	}

	ACPI_DEBUG_PRINT((ACPI_DB_TABLES, "Found table [%4.4s]\n",
			  table->signature));

	*table_ptr = table;
	return_ACPI_STATUS(AE_OK);
}
開發者ID:BackupTheBerlios,項目名稱:tew632-brp-svn,代碼行數:56,代碼來源:tbxfroot.c

示例3: acpi_ut_safe_strcat

u8 acpi_ut_safe_strcat(char *dest, acpi_size dest_size, char *source)
{

	if ((ACPI_STRLEN(dest) + ACPI_STRLEN(source)) >= dest_size) {
		return (TRUE);
	}

	ACPI_STRCAT(dest, source);
	return (FALSE);
}
開發者ID:7799,項目名稱:linux,代碼行數:10,代碼來源:utstring.c

示例4: AcpiUtSafeStrcat

BOOLEAN
AcpiUtSafeStrcat (
    char                    *Dest,
    ACPI_SIZE               DestSize,
    char                    *Source)
{

    if ((ACPI_STRLEN (Dest) + ACPI_STRLEN (Source)) >= DestSize)
    {
        return (TRUE);
    }

    ACPI_STRCAT (Dest, Source);
    return (FALSE);
}
開發者ID:zenny,項目名稱:DragonFlyBSD,代碼行數:15,代碼來源:utstring.c

示例5: AcpiDbFindNameInNamespace

ACPI_STATUS
AcpiDbFindNameInNamespace (
    char                    *NameArg)
{
    char                    AcpiName[5] = "____";
    char                    *AcpiNamePtr = AcpiName;


    if (ACPI_STRLEN (NameArg) > 4)
    {
        AcpiOsPrintf ("Name must be no longer than 4 characters\n");
        return (AE_OK);
    }

    /* Pad out name with underscores as necessary to create a 4-char name */

    AcpiUtStrupr (NameArg);
    while (*NameArg)
    {
        *AcpiNamePtr = *NameArg;
        AcpiNamePtr++;
        NameArg++;
    }

    /* Walk the namespace from the root */

    (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
                        AcpiDbWalkAndMatchName, NULL, AcpiName, NULL);

    AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
    return (AE_OK);
}
開發者ID:Aresthu,項目名稱:ucore_plus,代碼行數:32,代碼來源:dbnames.c

示例6: AcpiUtInstallInterface

ACPI_STATUS
AcpiUtInstallInterface (
    ACPI_STRING             InterfaceName)
{
    ACPI_INTERFACE_INFO     *InterfaceInfo;


    /* Allocate info block and space for the name string */

    InterfaceInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_INTERFACE_INFO));
    if (!InterfaceInfo)
    {
        return (AE_NO_MEMORY);
    }

    InterfaceInfo->Name = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (InterfaceName) + 1);
    if (!InterfaceInfo->Name)
    {
        ACPI_FREE (InterfaceInfo);
        return (AE_NO_MEMORY);
    }

    /* Initialize new info and insert at the head of the global list */

    ACPI_STRCPY (InterfaceInfo->Name, InterfaceName);
    InterfaceInfo->Flags = ACPI_OSI_DYNAMIC;
    InterfaceInfo->Next = AcpiGbl_SupportedInterfaces;

    AcpiGbl_SupportedInterfaces = InterfaceInfo;
    return (AE_OK);
}
開發者ID:alexandermerritt,項目名稱:dragonfly,代碼行數:31,代碼來源:utosi.c

示例7: AcpiDbConvertToObject

static ACPI_STATUS
AcpiDbConvertToObject (
    ACPI_OBJECT_TYPE        Type,
    char                    *String,
    ACPI_OBJECT             *Object)
{
    ACPI_STATUS             Status = AE_OK;


    switch (Type)
    {
    case ACPI_TYPE_STRING:
        Object->Type = ACPI_TYPE_STRING;
        Object->String.Pointer = String;
        Object->String.Length = (UINT32) ACPI_STRLEN (String);
        break;

    case ACPI_TYPE_BUFFER:
        Status = AcpiDbConvertToBuffer (String, Object);
        break;

    case ACPI_TYPE_PACKAGE:
        Status = AcpiDbConvertToPackage (String, Object);
        break;

    default:
        Object->Type = ACPI_TYPE_INTEGER;
        Status = AcpiUtStrtoul64 (String, 16, &Object->Integer.Value);
        break;
    }

    return (Status);
}
開發者ID:BillTheBest,項目名稱:libuinet,代碼行數:33,代碼來源:dbexec.c

示例8: acpi_ut_install_interface

acpi_status acpi_ut_install_interface(acpi_string interface_name)
{
	struct acpi_interface_info *interface_info;

	/* Allocate info block and space for the name string */

	interface_info =
	    ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_interface_info));
	if (!interface_info) {
		return (AE_NO_MEMORY);
	}

	interface_info->name =
	    ACPI_ALLOCATE_ZEROED(ACPI_STRLEN(interface_name) + 1);
	if (!interface_info->name) {
		ACPI_FREE(interface_info);
		return (AE_NO_MEMORY);
	}

	/* Initialize new info and insert at the head of the global list */

	ACPI_STRCPY(interface_info->name, interface_name);
	interface_info->flags = ACPI_OSI_DYNAMIC;
	interface_info->next = acpi_gbl_supported_interfaces;

	acpi_gbl_supported_interfaces = interface_info;
	return (AE_OK);
}
開發者ID:bjayesh,項目名稱:chandra,代碼行數:28,代碼來源:utosi.c

示例9: acpi_ut_install_interface

acpi_status acpi_ut_install_interface(acpi_string interface_name)
{
	struct acpi_interface_info *interface_info;

	

	interface_info =
	    ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_interface_info));
	if (!interface_info) {
		return (AE_NO_MEMORY);
	}

	interface_info->name =
	    ACPI_ALLOCATE_ZEROED(ACPI_STRLEN(interface_name) + 1);
	if (!interface_info->name) {
		ACPI_FREE(interface_info);
		return (AE_NO_MEMORY);
	}

	

	ACPI_STRCPY(interface_info->name, interface_name);
	interface_info->flags = ACPI_OSI_DYNAMIC;
	interface_info->next = acpi_gbl_supported_interfaces;

	acpi_gbl_supported_interfaces = interface_info;
	return (AE_OK);
}
開發者ID:DirtyDroidX,項目名稱:android_kernel_htc_m8ul,代碼行數:28,代碼來源:utosi.c

示例10: acpi_ut_safe_strncat

u8
acpi_ut_safe_strncat(char *dest,
		     acpi_size dest_size,
		     char *source, acpi_size max_transfer_length)
{
	acpi_size actual_transfer_length;

	actual_transfer_length =
	    ACPI_MIN(max_transfer_length, ACPI_STRLEN(source));

	if ((ACPI_STRLEN(dest) + actual_transfer_length) >= dest_size) {
		return (TRUE);
	}

	ACPI_STRNCAT(dest, source, max_transfer_length);
	return (FALSE);
}
開發者ID:7799,項目名稱:linux,代碼行數:17,代碼來源:utstring.c

示例11: acpi_ut_safe_strcpy

u8 acpi_ut_safe_strcpy(char *dest, acpi_size dest_size, char *source)
{

	if (ACPI_STRLEN(source) >= dest_size) {
		return (TRUE);
	}

	ACPI_STRCPY(dest, source);
	return (FALSE);
}
開發者ID:7799,項目名稱:linux,代碼行數:10,代碼來源:utstring.c

示例12: AcpiTbFindTable

ACPI_STATUS
AcpiTbFindTable (
    char                    *Signature,
    char                    *OemId,
    char                    *OemTableId,
    ACPI_TABLE_HEADER       **TablePtr)
{
    ACPI_STATUS             Status;
    ACPI_TABLE_HEADER       *Table;


    ACPI_FUNCTION_TRACE ("TbFindTable");


    /* Validate string lengths */

    if ((ACPI_STRLEN (Signature)  > ACPI_NAME_SIZE) ||
        (ACPI_STRLEN (OemId)      > sizeof (Table->OemId)) ||
        (ACPI_STRLEN (OemTableId) > sizeof (Table->OemTableId)))
    {
        return_ACPI_STATUS (AE_AML_STRING_LIMIT);
    }

    /* Find the table */

    Status = AcpiGetFirmwareTable (Signature, 1,
                        ACPI_LOGICAL_ADDRESSING, &Table);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

    /* Check OemId and OemTableId */

    if ((OemId[0]      && ACPI_STRCMP (OemId, Table->OemId)) ||
        (OemTableId[0] && ACPI_STRCMP (OemTableId, Table->OemTableId)))
    {
        return_ACPI_STATUS (AE_AML_NAME_NOT_FOUND);
    }

    *TablePtr = Table;
    return_ACPI_STATUS (AE_OK);
}
開發者ID:UnitedMarsupials,項目名稱:kame,代碼行數:43,代碼來源:tbxfroot.c

示例13: AcpiUtSafeStrncat

BOOLEAN
AcpiUtSafeStrncat (
    char                    *Dest,
    ACPI_SIZE               DestSize,
    char                    *Source,
    ACPI_SIZE               MaxTransferLength)
{
    ACPI_SIZE               ActualTransferLength;


    ActualTransferLength = ACPI_MIN (MaxTransferLength, ACPI_STRLEN (Source));

    if ((ACPI_STRLEN (Dest) + ActualTransferLength) >= DestSize)
    {
        return (TRUE);
    }

    ACPI_STRNCAT (Dest, Source, MaxTransferLength);
    return (FALSE);
}
開發者ID:zenny,項目名稱:DragonFlyBSD,代碼行數:20,代碼來源:utstring.c

示例14: acpi_tb_find_table

acpi_status
acpi_tb_find_table (
	char                            *signature,
	char                            *oem_id,
	char                            *oem_table_id,
	struct acpi_table_header        **table_ptr)
{
	acpi_status                     status;
	struct acpi_table_header        *table;


	ACPI_FUNCTION_TRACE ("tb_find_table");


	/* Validate string lengths */

	if ((ACPI_STRLEN (signature)  > ACPI_NAME_SIZE) ||
		(ACPI_STRLEN (oem_id)     > sizeof (table->oem_id)) ||
		(ACPI_STRLEN (oem_table_id) > sizeof (table->oem_table_id))) {
		return_ACPI_STATUS (AE_AML_STRING_LIMIT);
	}

	/* Find the table */

	status = acpi_get_firmware_table (signature, 1,
			   ACPI_LOGICAL_ADDRESSING, &table);
	if (ACPI_FAILURE (status)) {
		return_ACPI_STATUS (status);
	}

	/* Check oem_id and oem_table_id */

	if ((oem_id[0]     && ACPI_STRCMP (oem_id, table->oem_id)) ||
		(oem_table_id[0] && ACPI_STRCMP (oem_table_id, table->oem_table_id))) {
		return_ACPI_STATUS (AE_AML_NAME_NOT_FOUND);
	}

	*table_ptr = table;
	return_ACPI_STATUS (AE_OK);
}
開發者ID:iPodLinux,項目名稱:linux-2.4.24-ipod,代碼行數:40,代碼來源:tbxfroot.c

示例15: DtNormalizeBuffer

static char *
DtNormalizeBuffer (
    char                    *Buffer,
    UINT32                  *Count)
{
    char                    *NewBuffer;
    char                    *TmpBuffer;
    UINT32                  BufferCount = 0;
    BOOLEAN                 Separator = TRUE;
    char                    c;


    NewBuffer = UtLocalCalloc (ACPI_STRLEN (Buffer) + 1);
    TmpBuffer = NewBuffer;

    while ((c = *Buffer++))
    {
        switch (c)
        {
        /* Valid separators */

        case '[':
        case ']':
        case ' ':
        case ',':

            Separator = TRUE;
            break;

        default:

            if (Separator)
            {
                /* Insert blank as the standard separator */

                if (NewBuffer[0])
                {
                    *TmpBuffer++ = ' ';
                    BufferCount++;
                }

                Separator = FALSE;
            }

            *TmpBuffer++ = c;
            break;
        }
    }

    *Count = BufferCount + 1;
    return (NewBuffer);
}
開發者ID:coyizumi,項目名稱:cs111,代碼行數:52,代碼來源:dtfield.c


注:本文中的ACPI_STRLEN函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。