本文整理汇总了C++中ACPI_STRCPY函数的典型用法代码示例。如果您正苦于以下问题:C++ ACPI_STRCPY函数的具体用法?C++ ACPI_STRCPY怎么用?C++ ACPI_STRCPY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ACPI_STRCPY函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: 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
示例2: 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
示例3: acpi_ut_get_expected_return_types
void acpi_ut_get_expected_return_types(char *buffer, u32 expected_btypes)
{
u32 this_rtype;
u32 i;
u32 j;
if (!expected_btypes) {
ACPI_STRCPY(buffer, "NONE");
return;
}
j = 1;
buffer[0] = 0;
this_rtype = ACPI_RTYPE_INTEGER;
for (i = 0; i < ACPI_NUM_RTYPES; i++) {
/* If one of the expected types, concatenate the name of this type */
if (expected_btypes & this_rtype) {
ACPI_STRCAT(buffer, &ut_rtype_names[i][j]);
j = 0; /* Use name separator from now on */
}
this_rtype <<= 1; /* Next Rtype */
}
}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:27,代码来源:utpredef.c
示例4: 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
示例5: acpi_ut_execute_HID
/*******************************************************************************
*
* FUNCTION: acpi_ut_execute_HID
*
* PARAMETERS: device_node - Node for the device
* return_id - Where the string HID is returned
*
* RETURN: Status
*
* DESCRIPTION: Executes the _HID control method that returns the hardware
* ID of the device. The HID is either an 32-bit encoded EISAID
* Integer or a String. A string is always returned. An EISAID
* is converted to a string.
*
* NOTE: Internal function, no parameter validation
*
******************************************************************************/
acpi_status
acpi_ut_execute_HID(struct acpi_namespace_node *device_node,
struct acpi_pnp_device_id **return_id)
{
union acpi_operand_object *obj_desc;
struct acpi_pnp_device_id *hid;
u32 length;
acpi_status status;
ACPI_FUNCTION_TRACE(ut_execute_HID);
status = acpi_ut_evaluate_object(device_node, METHOD_NAME__HID,
ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING,
&obj_desc);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* Get the size of the String to be returned, includes null terminator */
if (obj_desc->common.type == ACPI_TYPE_INTEGER) {
length = ACPI_EISAID_STRING_SIZE;
} else {
length = obj_desc->string.length + 1;
}
/* Allocate a buffer for the HID */
hid =
ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_pnp_device_id) +
(acpi_size) length);
if (!hid) {
status = AE_NO_MEMORY;
goto cleanup;
}
/* Area for the string starts after PNP_DEVICE_ID struct */
hid->string =
ACPI_ADD_PTR(char, hid, sizeof(struct acpi_pnp_device_id));
/* Convert EISAID to a string or simply copy existing string */
if (obj_desc->common.type == ACPI_TYPE_INTEGER) {
acpi_ex_eisa_id_to_string(hid->string, obj_desc->integer.value);
} else {
ACPI_STRCPY(hid->string, obj_desc->string.pointer);
}
hid->length = length;
*return_id = hid;
cleanup:
/* On exit, we must delete the return object */
acpi_ut_remove_reference(obj_desc);
return_ACPI_STATUS(status);
}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:76,代码来源:utids.c
示例6: acpi_ut_execute_UID
acpi_status
acpi_ut_execute_UID(struct acpi_namespace_node *device_node,
struct acpica_device_id **return_id)
{
union acpi_operand_object *obj_desc;
struct acpica_device_id *uid;
u32 length;
acpi_status status;
ACPI_FUNCTION_TRACE(ut_execute_UID);
status = acpi_ut_evaluate_object(device_node, METHOD_NAME__UID,
ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING,
&obj_desc);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* Get the size of the String to be returned, includes null terminator */
if (obj_desc->common.type == ACPI_TYPE_INTEGER) {
length = ACPI_MAX64_DECIMAL_DIGITS + 1;
} else {
length = obj_desc->string.length + 1;
}
/* Allocate a buffer for the UID */
uid =
ACPI_ALLOCATE_ZEROED(sizeof(struct acpica_device_id) +
(acpi_size) length);
if (!uid) {
status = AE_NO_MEMORY;
goto cleanup;
}
/* Area for the string starts after DEVICE_ID struct */
uid->string = ACPI_ADD_PTR(char, uid, sizeof(struct acpica_device_id));
/* Convert an Integer to string, or just copy an existing string */
if (obj_desc->common.type == ACPI_TYPE_INTEGER) {
acpi_ex_integer_to_string(uid->string, obj_desc->integer.value);
} else {
ACPI_STRCPY(uid->string, obj_desc->string.pointer);
}
uid->length = length;
*return_id = uid;
cleanup:
/* On exit, we must delete the return object */
acpi_ut_remove_reference(obj_desc);
return_ACPI_STATUS(status);
}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:58,代码来源:utids.c
示例7: 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
示例8: 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
示例9: AcpiDbSetScope
void
AcpiDbSetScope (
char *Name)
{
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
if (!Name || Name[0] == 0)
{
AcpiOsPrintf ("Current scope: %s\n", AcpiGbl_DbScopeBuf);
return;
}
AcpiDbPrepNamestring (Name);
if (Name[0] == '\\')
{
/* Validate new scope from the root */
Status = AcpiNsGetNode (AcpiGbl_RootNode, Name, ACPI_NS_NO_UPSEARCH,
&Node);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
ACPI_STRCPY (AcpiGbl_DbScopeBuf, Name);
ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
}
else
{
/* Validate new scope relative to old scope */
Status = AcpiNsGetNode (AcpiGbl_DbScopeNode, Name, ACPI_NS_NO_UPSEARCH,
&Node);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
ACPI_STRCAT (AcpiGbl_DbScopeBuf, Name);
ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
}
AcpiGbl_DbScopeNode = Node;
AcpiOsPrintf ("New scope: %s\n", AcpiGbl_DbScopeBuf);
return;
ErrorExit:
AcpiOsPrintf ("Could not attach scope: %s, %s\n",
Name, AcpiFormatException (Status));
}
开发者ID:Aresthu,项目名称:ucore_plus,代码行数:54,代码来源:dbnames.c
示例10: AcpiDbUInt32ToHexString
void
AcpiDbUInt32ToHexString (
UINT32 Value,
char *Buffer)
{
UINT8 i;
if (Value == 0)
{
ACPI_STRCPY (Buffer, "0");
return;
}
ACPI_STRCPY (Buffer, "0x");
Buffer[10] = '\0';
for (i = 9; i > 1; i--)
{
Buffer[i] = Converter [Value & 0x0F];
Value = Value >> 4;
}
}
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:23,代码来源:dbutils.c
示例11: acpi_ut_execute_SUB
acpi_status
acpi_ut_execute_SUB(struct acpi_namespace_node *device_node,
struct acpi_pnp_device_id **return_id)
{
union acpi_operand_object *obj_desc;
struct acpi_pnp_device_id *sub;
u32 length;
acpi_status status;
ACPI_FUNCTION_TRACE(ut_execute_SUB);
status = acpi_ut_evaluate_object(device_node, METHOD_NAME__SUB,
ACPI_BTYPE_STRING, &obj_desc);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* Get the size of the String to be returned, includes null terminator */
length = obj_desc->string.length + 1;
/* Allocate a buffer for the SUB */
sub =
ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_pnp_device_id) +
(acpi_size) length);
if (!sub) {
status = AE_NO_MEMORY;
goto cleanup;
}
/* Area for the string starts after PNP_DEVICE_ID struct */
sub->string =
ACPI_ADD_PTR(char, sub, sizeof(struct acpi_pnp_device_id));
/* Simply copy existing string */
ACPI_STRCPY(sub->string, obj_desc->string.pointer);
sub->length = length;
*return_id = sub;
cleanup:
/* On exit, we must delete the return object */
acpi_ut_remove_reference(obj_desc);
return_ACPI_STATUS(status);
}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:49,代码来源:utids.c
示例12: AcpiUtSafeStrcpy
BOOLEAN
AcpiUtSafeStrcpy (
char *Dest,
ACPI_SIZE DestSize,
char *Source)
{
if (ACPI_STRLEN (Source) >= DestSize)
{
return (TRUE);
}
ACPI_STRCPY (Dest, Source);
return (FALSE);
}
开发者ID:zenny,项目名称:DragonFlyBSD,代码行数:15,代码来源:utstring.c
示例13: AcpiUtDeleteCaches
ACPI_STATUS
AcpiUtDeleteCaches (
void)
{
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
char Buffer[7];
if (AcpiGbl_DisplayFinalMemStats)
{
ACPI_STRCPY (Buffer, "MEMORY");
(void) AcpiDbDisplayStatistics (Buffer);
}
#endif
(void) AcpiOsDeleteCache (AcpiGbl_NamespaceCache);
AcpiGbl_NamespaceCache = NULL;
(void) AcpiOsDeleteCache (AcpiGbl_StateCache);
AcpiGbl_StateCache = NULL;
(void) AcpiOsDeleteCache (AcpiGbl_OperandCache);
AcpiGbl_OperandCache = NULL;
(void) AcpiOsDeleteCache (AcpiGbl_PsNodeCache);
AcpiGbl_PsNodeCache = NULL;
(void) AcpiOsDeleteCache (AcpiGbl_PsNodeExtCache);
AcpiGbl_PsNodeExtCache = NULL;
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
/* Debug only - display leftover memory allocation, if any */
AcpiUtDumpAllocations (ACPI_UINT32_MAX, NULL);
/* Free memory lists */
AcpiOsFree (AcpiGbl_GlobalList);
AcpiGbl_GlobalList = NULL;
AcpiOsFree (AcpiGbl_NsNodeList);
AcpiGbl_NsNodeList = NULL;
#endif
return (AE_OK);
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:47,代码来源:utalloc.c
示例14: AcpiDmAddToExternalFileList
ACPI_STATUS
AcpiDmAddToExternalFileList (
char *PathList)
{
ACPI_EXTERNAL_FILE *ExternalFile;
char *Path;
char *TmpPath;
if (!PathList)
{
return (AE_OK);
}
Path = strtok (PathList, ",");
while (Path)
{
TmpPath = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (Path) + 1);
if (!TmpPath)
{
return (AE_NO_MEMORY);
}
ACPI_STRCPY (TmpPath, Path);
ExternalFile = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_FILE));
if (!ExternalFile)
{
ACPI_FREE (TmpPath);
return (AE_NO_MEMORY);
}
ExternalFile->Path = TmpPath;
if (AcpiGbl_ExternalFileList)
{
ExternalFile->Next = AcpiGbl_ExternalFileList;
}
AcpiGbl_ExternalFileList = ExternalFile;
Path = strtok (NULL, ",");
}
return (AE_OK);
}
开发者ID:DonCN,项目名称:haiku,代码行数:46,代码来源:dmextern.c
示例15: acpi_ut_copy_id_string
static void acpi_ut_copy_id_string(char *destination, char *source)
{
/*
* Workaround for ID strings that have a leading asterisk. This construct
* is not allowed by the ACPI specification (ID strings must be
* alphanumeric), but enough existing machines have this embedded in their
* ID strings that the following code is useful.
*/
if (*source == '*') {
source++;
}
/* Do the actual copy */
ACPI_STRCPY(destination, source);
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:17,代码来源:utids.c
示例16: acpi_ut_delete_caches
acpi_status acpi_ut_delete_caches(void)
{
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
char buffer[7];
if (acpi_gbl_display_final_mem_stats) {
ACPI_STRCPY(buffer, "MEMORY");
(void)acpi_db_display_statistics(buffer);
}
#endif
(void)acpi_os_delete_cache(acpi_gbl_namespace_cache);
acpi_gbl_namespace_cache = NULL;
(void)acpi_os_delete_cache(acpi_gbl_state_cache);
acpi_gbl_state_cache = NULL;
(void)acpi_os_delete_cache(acpi_gbl_operand_cache);
acpi_gbl_operand_cache = NULL;
(void)acpi_os_delete_cache(acpi_gbl_ps_node_cache);
acpi_gbl_ps_node_cache = NULL;
(void)acpi_os_delete_cache(acpi_gbl_ps_node_ext_cache);
acpi_gbl_ps_node_ext_cache = NULL;
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
/* Debug only - display leftover memory allocation, if any */
acpi_ut_dump_allocations(ACPI_UINT32_MAX, NULL);
/* Free memory lists */
ACPI_FREE(acpi_gbl_global_list);
acpi_gbl_global_list = NULL;
ACPI_FREE(acpi_gbl_ns_node_list);
acpi_gbl_ns_node_list = NULL;
#endif
return (AE_OK);
}
开发者ID:PyroOS,项目名称:Pyro,代码行数:43,代码来源:utalloc.c
示例17: AcpiDbOpenDebugFile
void
AcpiDbOpenDebugFile (
char *Name)
{
#ifdef ACPI_APPLICATION
AcpiDbCloseDebugFile ();
AcpiGbl_DebugFile = fopen (Name, "w+");
if (!AcpiGbl_DebugFile)
{
AcpiOsPrintf ("Could not open debug file %s\n", Name);
return;
}
AcpiOsPrintf ("Debug output file %s opened\n", Name);
ACPI_STRCPY (AcpiGbl_DbDebugFilename, Name);
AcpiGbl_DbOutputToFile = TRUE;
#endif
}
开发者ID:cloudius-systems,项目名称:acpica,代码行数:21,代码来源:dbfileio.c
示例18: AcpiDbGetLine
UINT32
AcpiDbGetLine (
NATIVE_CHAR *InputBuffer)
{
UINT32 i;
UINT32 Count;
NATIVE_CHAR *Next;
NATIVE_CHAR *This;
ACPI_STRCPY (AcpiGbl_DbParsedBuf, InputBuffer);
ACPI_STRUPR (AcpiGbl_DbParsedBuf);
This = AcpiGbl_DbParsedBuf;
for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++)
{
AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next);
if (!AcpiGbl_DbArgs[i])
{
break;
}
This = Next;
}
/* Uppercase the actual command */
if (AcpiGbl_DbArgs[0])
{
ACPI_STRUPR (AcpiGbl_DbArgs[0]);
}
Count = i;
if (Count)
{
Count--; /* Number of args only */
}
return (Count);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:40,代码来源:dbinput.c
示例19: AcpiDbGetLine
static UINT32
AcpiDbGetLine (
char *InputBuffer)
{
UINT32 i;
UINT32 Count;
char *Next;
char *This;
ACPI_STRCPY (AcpiGbl_DbParsedBuf, InputBuffer);
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;
}
/* Uppercase the actual command */
if (AcpiGbl_DbArgs[0])
{
AcpiUtStrupr (AcpiGbl_DbArgs[0]);
}
Count = i;
if (Count)
{
Count--; /* Number of args only */
}
return (Count);
}
开发者ID:RonnieDilli,项目名称:acpica,代码行数:40,代码来源:dbinput.c
示例20: AcpiDbUint32ToHexString
void
AcpiDbUint32ToHexString (
UINT32 Value,
char *Buffer)
{
int i;
if (Value == 0)
{
ACPI_STRCPY (Buffer, "0");
return;
}
Buffer[8] = '\0';
for (i = 7; i >= 0; i--)
{
Buffer[i] = Converter [Value & 0x0F];
Value = Value >> 4;
}
}
开发者ID:cloudius-systems,项目名称:acpica,代码行数:22,代码来源:dbutils.c
注:本文中的ACPI_STRCPY函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论