/base/security/device_auth/deps_adapter/os_adapter/impl/src/ |
D | hc_log.c | 28 #define DEV_AUTH_LOG_DEBUG(buf) printf("[D][DEVAUTH]: %s\n", buf) argument 29 #define DEV_AUTH_LOG_INFO(buf) printf("[I][DEVAUTH]: %s\n", buf) argument 30 #define DEV_AUTH_LOG_WARN(buf) printf("[W][DEVAUTH]: %s\n", buf) argument 31 #define DEV_AUTH_LOG_ERROR(buf) printf("[E][DEVAUTH]: %s\n", buf) argument 37 #define DEV_AUTH_LOG_DEBUG(buf) HiLogPrint(LOG_CORE, LOG_DEBUG, DEV_AUTH_LOG_DOMAIN, "[DEVAUTH]", "… argument 38 #define DEV_AUTH_LOG_INFO(buf) HiLogPrint(LOG_CORE, LOG_INFO, DEV_AUTH_LOG_DOMAIN, "[DEVAUTH]", "%{… argument 39 #define DEV_AUTH_LOG_WARN(buf) HiLogPrint(LOG_CORE, LOG_WARN, DEV_AUTH_LOG_DOMAIN, "[DEVAUTH]", "%{… argument 40 #define DEV_AUTH_LOG_ERROR(buf) HiLogPrint(LOG_CORE, LOG_ERROR, DEV_AUTH_LOG_DOMAIN, "[DEVAUTH]", "… argument 47 static void DevAuthOutPrint(const char *buf, DevAuthLogLevel level) in DevAuthOutPrint() argument 51 DEV_AUTH_LOG_DEBUG(buf); in DevAuthOutPrint() [all …]
|
/base/security/appverify/interfaces/innerkits/appverify_lite/src/ |
D | app_common.c | 18 long long HapGetInt64(const unsigned char *buf, int32_t len) in HapGetInt64() argument 20 if (buf == NULL) { in HapGetInt64() 28 value = (value << BYTE_BITS) | (*(buf + len)); in HapGetInt64() 33 int32_t HapGetInt(const unsigned char *buf, int32_t len) in HapGetInt() argument 35 uint32_t value = HapGetUnsignedInt(buf, len); in HapGetInt() 39 uint32_t HapGetUnsignedInt(const unsigned char *buf, int32_t len) in HapGetUnsignedInt() argument 41 if (buf == NULL) { in HapGetUnsignedInt() 49 value = (value << BYTE_BITS) | (*(buf + len)); in HapGetUnsignedInt() 54 short HapGetShort(const unsigned char *buf, int32_t len) in HapGetShort() argument 56 if (buf == NULL) { in HapGetShort() [all …]
|
/base/security/selinux_adapter/interfaces/policycoreutils/src/ |
D | selinux_log.c | 41 char *buf = (char *)malloc(MAX_LOG_BUFF_LEN); in SelinuxHilog() local 42 if (buf == NULL) { in SelinuxHilog() 46 (void)memset_s(buf, MAX_LOG_BUFF_LEN, 0, MAX_LOG_BUFF_LEN); in SelinuxHilog() 50 if (vsnprintf_s(buf, MAX_LOG_BUFF_LEN, MAX_LOG_BUFF_LEN - 1, fmt, ap) < 0) { in SelinuxHilog() 52 free(buf); in SelinuxHilog() 53 buf = NULL; in SelinuxHilog() 61 HILOG_INFO(LOG_CORE, "%{public}s\n", buf); in SelinuxHilog() 64 HILOG_WARN(LOG_CORE, "%{public}s\n", buf); in SelinuxHilog() 68 HILOG_ERROR(LOG_CORE, "%{public}s\n", buf); in SelinuxHilog() 71 free(buf); in SelinuxHilog() [all …]
|
/base/security/huks/frameworks/crypto_lite/cipher/src/ |
D | cipher_log_lite.c | 27 char *buf = (char *)malloc(MAX_LOG_BUFF_LEN); in CipherLog() local 28 if (buf == NULL) { in CipherLog() 32 (void)memset_s(buf, MAX_LOG_BUFF_LEN, 0, MAX_LOG_BUFF_LEN); in CipherLog() 36 int32_t ret = vsnprintf_s(buf, MAX_LOG_BUFF_LEN, MAX_LOG_BUFF_LEN - 1, format, ap); in CipherLog() 40 free(buf); in CipherLog() 41 buf = NULL; in CipherLog() 48 HILOG_ERROR(HILOG_MODULE_SCY, "%s[%u]: %s\n", funcName, lineNo, buf); in CipherLog() 50 … HILOG_ERROR(HILOG_MODULE_SCY, "%{public}s[%{public}u]: %{public}s\n", funcName, lineNo, buf); in CipherLog() 54 free(buf); in CipherLog() 55 buf = NULL; in CipherLog() [all …]
|
D | cipher_log.c | 26 char *buf = (char *)malloc(MAX_LOG_BUFF_LEN); in CipherLog() local 27 if (buf == NULL) { in CipherLog() 31 (void)memset_s(buf, MAX_LOG_BUFF_LEN, 0, MAX_LOG_BUFF_LEN); in CipherLog() 35 int32_t ret = vsnprintf_s(buf, MAX_LOG_BUFF_LEN, MAX_LOG_BUFF_LEN - 1, format, ap); in CipherLog() 39 free(buf); in CipherLog() 40 buf = NULL; in CipherLog() 46 HILOG_ERROR(LOG_CORE, "%{public}s[%{public}u]: %{public}s\n", funcName, lineNo, buf); in CipherLog() 49 free(buf); in CipherLog() 50 buf = NULL; in CipherLog() 54 free(buf); in CipherLog() [all …]
|
/base/hiviewdfx/faultloggerd/frameworks/unwinder/ |
D | dfx_regs_arm64.cpp | 69 char buf[REGS_PRINT_LEN_ARM64] = {0}; in PrintRegs() local 72 BufferPrintf(buf, sizeof(buf), "x0:%016lx x1:%016lx x2:%016lx x3:%016lx\n", \ in PrintRegs() 75 …BufferPrintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "x4:%016lx x5:%016lx x6:%016lx x7:%016l… in PrintRegs() 78 …BufferPrintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "x8:%016lx x9:%016lx x10:%016lx x11:%01… in PrintRegs() 81 …BufferPrintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "x12:%016lx x13:%016lx x14:%016lx x15:%… in PrintRegs() 84 …BufferPrintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "x16:%016lx x17:%016lx x18:%016lx x19:%… in PrintRegs() 87 …BufferPrintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "x20:%016lx x21:%016lx x22:%016lx x23:%… in PrintRegs() 90 …BufferPrintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "x24:%016lx x25:%016lx x26:%016lx x27:%… in PrintRegs() 93 BufferPrintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "x28:%016lx x29:%016lx\n", \ in PrintRegs() 96 BufferPrintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "lr:%016lx sp:%016lx pc:%016lx\n", \ in PrintRegs() [all …]
|
D | dfx_regs_arm.cpp | 55 char buf[REGS_PRINT_LEN_ARM] = {0}; in PrintRegs() local 58 BufferPrintf(buf, sizeof(buf), "r0:%08x r1:%08x r2:%08x r3:%08x\n", \ in PrintRegs() 61 … BufferPrintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "r4:%08x r5:%08x r6:%08x r7:%08x\n", \ in PrintRegs() 64 BufferPrintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "r8:%08x r9:%08x r10:%08x\n", \ in PrintRegs() 67 …BufferPrintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "fp:%08x ip:%08x sp:%08x lr:%08x pc:%08… in PrintRegs() 70 std::string regString = StringPrintf("Registers:\n%s", buf); in PrintRegs()
|
D | dfx_regs_x86_64.cpp | 56 char buf[REGS_PRINT_LEN_X86] = {0}; in PrintRegs() local 59 BufferPrintf(buf, sizeof(buf), " rax:%016lx rdx:%016lx rcx:%016lx rbx:%016lx\n", \ in PrintRegs() 62 …BufferPrintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " rsi:%016lx rdi:%016lx rbp:%016lx rsp… in PrintRegs() 65 …BufferPrintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " r8:%016lx r9:%016lx r10:%016lx r11:%… in PrintRegs() 68 BufferPrintf(buf + strlen(buf), sizeof(buf) - strlen(buf), \ in PrintRegs() 72 std::string regString = StringPrintf("Registers:\n%s", buf); in PrintRegs()
|
/base/hiviewdfx/faultloggerd/common/dfxlog/ |
D | dfx_log.cpp | 45 char buf[LOG_BUF_LEN] = {0}; in LogToDmesg() local 46 if (snprintf_s(buf, sizeof(buf), sizeof(buf) - 1, "%s[pid=%d %d][%s][%s]%s", in LogToDmesg() 52 if (write(g_dmesgFd, buf, strlen(buf)) < 0) { in LogToDmesg() 76 char buf[LOG_BUF_LEN] = {0}; in DfxLog() local 79 ret = vsnprintf_s(buf, sizeof(buf), sizeof(buf) - 1, fmt, args); in DfxLog() 86 HiLogBasePrint(LOG_CORE, LOG_LEVEL[logLevel], domain, tag, "%{public}s", buf); in DfxLog() 91 OHOS::HiviewDFX::HiLog::Debug(LOG_LABEL, "%{public}s", buf); in DfxLog() 94 OHOS::HiviewDFX::HiLog::Info(LOG_LABEL, "%{public}s", buf); in DfxLog() 97 OHOS::HiviewDFX::HiLog::Warn(LOG_LABEL, "%{public}s", buf); in DfxLog() 100 OHOS::HiviewDFX::HiLog::Error(LOG_LABEL, "%{public}s", buf); in DfxLog() [all …]
|
/base/sensors/sensor/utils/ipc/src/ |
D | stream_buffer.cpp | 20 StreamBuffer::StreamBuffer(const StreamBuffer &buf) in StreamBuffer() argument 22 Clone(buf); in StreamBuffer() 58 bool StreamBuffer::Read(std::string &buf) in Read() argument 67 buf = ReadBuf(); in Read() 69 StreamBufferGetRpos(streamBufferPtr_.get()) + static_cast<int32_t>(buf.length()) + 1); in Read() 70 return (buf.length() > 0); in Read() 77 buf = ReadBuf(); in Read() 78 rPos_ += buf.length() + 1; in Read() 79 return (buf.length() > 0); in Read() 83 bool StreamBuffer::Write(const std::string &buf) in Write() argument [all …]
|
/base/security/certificate_manager/frameworks/cert_manager_standard/main/os_dependency/log/ |
D | cm_log.c | 32 char *buf = (char *)CmMalloc(MAX_LOG_BUFF_LEN); in CmLog() local 33 if (buf == NULL) { in CmLog() 37 (void)memset_s(buf, MAX_LOG_BUFF_LEN, 0, MAX_LOG_BUFF_LEN); in CmLog() 41 int32_t ret = vsnprintf_s(buf, MAX_LOG_BUFF_LEN, MAX_LOG_BUFF_LEN - 1, format, ap); in CmLog() 45 CM_FREE_PTR(buf); in CmLog() 51 HILOG_INFO(LOG_CORE, "%{public}s[%{public}u]: %{public}s\n", funcName, lineNo, buf); in CmLog() 54 HILOG_ERROR(LOG_CORE, "%{public}s[%{public}u]: %{public}s\n", funcName, lineNo, buf); in CmLog() 57 HILOG_WARN(LOG_CORE, "%{public}s[%{public}u]: %{public}s\n", funcName, lineNo, buf); in CmLog() 60 HILOG_DEBUG(LOG_CORE, "%{public}s[%{public}u]: %{private}s\n", funcName, lineNo, buf); in CmLog() 63 CM_FREE_PTR(buf); in CmLog() [all …]
|
/base/msdp/device_status/utils/ipc/src/ |
D | stream_buffer.cpp | 22 StreamBuffer::StreamBuffer(const StreamBuffer &buf) in StreamBuffer() argument 24 Clone(buf); in StreamBuffer() 64 bool StreamBuffer::Read(std::string &buf) in Read() argument 71 buf = ReadBuf(); in Read() 72 rPos_ += static_cast<int32_t>(buf.length()) + 1; in Read() 73 return (buf.length() > 0); in Read() 76 bool StreamBuffer::Write(const std::string &buf) in Write() argument 78 return Write(buf.c_str(), buf.length()+1); in Write() 81 bool StreamBuffer::Read(StreamBuffer &buf) in Read() argument 83 return buf.Write(Data(), Size()); in Read() [all …]
|
/base/security/huks/services/huks_standard/huks_engine/main/device_cert_manager/src/ |
D | dcm_asn1.c | 58 static int32_t Asn1InsertValue(struct HksBlob *buf, struct HksAsn1Obj *obj, const struct HksAsn1Blo… in Asn1InsertValue() argument 73 if (buf->size < outSize) { in Asn1InsertValue() 74 …HKS_LOG_E("output buffer too small: %" LOG_PUBLIC "u. expected%" LOG_PUBLIC "u", buf->size, outSiz… in Asn1InsertValue() 78 … if (memmove_s(buf->data + header.size, buf->size - header.size, value.data, value.size) != EOK) { in Asn1InsertValue() 82 (void)memcpy_s(buf->data, buf->size, header.data, header.size); in Asn1InsertValue() 83 buf->data += outSize; in Asn1InsertValue() 84 buf->size -= outSize; in Asn1InsertValue() 87 obj->header.data = buf->data; in Asn1InsertValue() 90 obj->value.data = buf->data + header.size; in Asn1InsertValue() 97 int32_t DcmAsn1InsertValue(struct HksBlob *buf, struct HksAsn1Obj *obj, const struct HksAsn1Blob *t… in DcmAsn1InsertValue() argument [all …]
|
/base/msdp/device_status/utils/common/src/ |
D | utility.cpp | 114 struct stat buf {}; in GetFileSize() struct 117 if (stat(path, &buf) == 0) { in GetFileSize() 118 if (S_ISREG(buf.st_mode)) { in GetFileSize() 119 sz = buf.st_size; in GetFileSize() 135 struct stat buf {}; in ShowFileAttributes() struct 136 if (stat(path, &buf) != 0) { in ShowFileAttributes() 140 if (S_ISDIR(buf.st_mode)) { in ShowFileAttributes() 142 } else if (S_ISCHR(buf.st_mode)) { in ShowFileAttributes() 144 } else if (S_ISREG(buf.st_mode)) { in ShowFileAttributes() 149 if (buf.st_mode & S_IRUSR) { in ShowFileAttributes() [all …]
|
/base/security/appverify/interfaces/innerkits/appverify_lite/include/ |
D | app_common.h | 98 #define APPV_FREE(buf) \ argument 100 if ((buf) != NULL) { \ 101 free(buf); \ 102 (buf) = NULL; \ 106 long long HapGetInt64(const unsigned char *buf, int32_t len); 107 int32_t HapGetInt(const unsigned char *buf, int32_t len); 108 uint32_t HapGetUnsignedInt(const unsigned char *buf, int32_t len); 109 short HapGetShort(const unsigned char *buf, int32_t len); 110 void HapPutInt32(unsigned char *buf, int32_t len, int32_t value);
|
/base/update/updater/test/unittest/common/ring_buffer/ |
D | ring_buffer_unittest.cpp | 42 uint8_t buf[4] {}; // 4: test buffer size in ProducerTask() local 43 buf[0] = i % BYTE_SIZE; in ProducerTask() 44 buf[1] = i / BYTE_SIZE; in ProducerTask() 45 ringBuffer->Push(buf, sizeof(buf)); in ProducerTask() 53 uint8_t buf[4] {}; // 4: test buffer size in ConsumerTask() local 55 ringBuffer->Pop(buf, sizeof(buf), len); in ConsumerTask() 56 if (buf[0] != g_num % BYTE_SIZE || buf[1] != g_num / BYTE_SIZE) { in ConsumerTask()
|
/base/web/webview/interfaces/kits/napi/js/ |
D | webview_export_module.cpp | 21 extern "C" __attribute__((visibility("default"))) void NAPI_web_webview_GetJSCode(const char **buf,… in NAPI_web_webview_GetJSCode() argument 23 if (buf != nullptr) { in NAPI_web_webview_GetJSCode() 24 *buf = _binary_webview_export_js_start; in NAPI_web_webview_GetJSCode() 32 extern "C" __attribute__((visibility("default"))) void NAPI_web_webview_GetABCCode(const char** buf… in NAPI_web_webview_GetABCCode() argument 34 if (buf != nullptr) { in NAPI_web_webview_GetABCCode() 35 *buf = _binary_webview_export_abc_start; in NAPI_web_webview_GetABCCode()
|
/base/print/print_fwk/interfaces/kits/jsnapi/extensionctx/ |
D | print_extension_context_module.cpp | 35 const char **buf, int *bufLen) in NAPI_PrintExtensionContext_GetJSCode() argument 37 if (buf != nullptr) { in NAPI_PrintExtensionContext_GetJSCode() 38 *buf = _binary_print_extension_context_js_start; in NAPI_PrintExtensionContext_GetJSCode() 48 const char **buf, int *buflen) in NAPI_PrintExtensionContext_GetABCCode() argument 50 if (buf != nullptr) { in NAPI_PrintExtensionContext_GetABCCode() 51 *buf = _binary_print_extension_context_abc_start; in NAPI_PrintExtensionContext_GetABCCode()
|
/base/useriam/user_auth_framework/frameworks/js/napi/user_auth_extension/user_auth_extension/ |
D | user_auth_extension_ability_module.cpp | 36 const char **buf, int *bufLen) in NAPI_app_ability_UserAuthExtensionAbility_GetJSCode() argument 38 if (buf != nullptr) { in NAPI_app_ability_UserAuthExtensionAbility_GetJSCode() 39 *buf = _binary_user_auth_extension_ability_js_start; in NAPI_app_ability_UserAuthExtensionAbility_GetJSCode() 48 const char **buf, int *buflen) in NAPI_app_ability_UserAuthExtensionAbility_GetABCCode() argument 50 if (buf != nullptr) { in NAPI_app_ability_UserAuthExtensionAbility_GetABCCode() 51 *buf = _binary_user_auth_extension_ability_abc_start; in NAPI_app_ability_UserAuthExtensionAbility_GetABCCode()
|
/base/notification/common_event_service/interfaces/kits/napi/static_subscriber_extension/ |
D | static_subscriber_extension_ability_module.cpp | 36 void NAPI_application_StaticSubscriberExtensionAbility_GetJSCode(const char **buf, int *bufLen) in NAPI_application_StaticSubscriberExtensionAbility_GetJSCode() argument 38 if (buf != nullptr) { in NAPI_application_StaticSubscriberExtensionAbility_GetJSCode() 39 *buf = _binary_static_subscriber_extension_ability_js_start; in NAPI_application_StaticSubscriberExtensionAbility_GetJSCode() 50 void NAPI_application_StaticSubscriberExtensionAbility_GetABCCode(const char **buf, int *buflen) in NAPI_application_StaticSubscriberExtensionAbility_GetABCCode() argument 52 if (buf != nullptr) { in NAPI_application_StaticSubscriberExtensionAbility_GetABCCode() 53 *buf = _binary_static_subscriber_extension_ability_abc_start; in NAPI_application_StaticSubscriberExtensionAbility_GetABCCode()
|
/base/customization/enterprise_device_management/interfaces/kits/enterprise_admin_extension/ |
D | enterprise_admin_extension_ability_module.cpp | 35 const char **buf, int *bufLen) in NAPI_enterprise_EnterpriseAdminExtensionAbility_GetJSCode() argument 37 if (buf != nullptr) { in NAPI_enterprise_EnterpriseAdminExtensionAbility_GetJSCode() 38 *buf = _binary_enterprise_admin_extension_ability_js_start; in NAPI_enterprise_EnterpriseAdminExtensionAbility_GetJSCode() 49 const char **buf, int *buflen) in NAPI_enterprise_EnterpriseAdminExtensionAbility_GetABCCode() argument 51 if (buf != nullptr) { in NAPI_enterprise_EnterpriseAdminExtensionAbility_GetABCCode() 52 *buf = _binary_enterprise_admin_extension_ability_abc_start; in NAPI_enterprise_EnterpriseAdminExtensionAbility_GetABCCode()
|
/base/customization/enterprise_device_management/interfaces/kits/enterprise_admin_extension_context/ |
D | enterprise_admin_extension_context_module.cpp | 35 const char **buf, int *bufLen) in NAPI_enterprise_EnterpriseAdminExtensionContext_GetJSCode() argument 37 if (buf != nullptr) { in NAPI_enterprise_EnterpriseAdminExtensionContext_GetJSCode() 38 *buf = _binary_enterprise_admin_extension_context_js_start; in NAPI_enterprise_EnterpriseAdminExtensionContext_GetJSCode() 49 const char **buf, int *buflen) in NAPI_enterprise_EnterpriseAdminExtensionContext_GetABCCode() argument 51 if (buf != nullptr) { in NAPI_enterprise_EnterpriseAdminExtensionContext_GetABCCode() 52 *buf = _binary_enterprise_admin_extension_context_abc_start; in NAPI_enterprise_EnterpriseAdminExtensionContext_GetABCCode()
|
/base/theme/wallpaper_mgr/frameworks/js/napi/wallpaperextensionability/ |
D | wallpaper_extension_ability_module.cpp | 35 const char **buf, int *bufLen) in NAPI_WallpaperExtensionAbility_GetJSCode() argument 37 if (buf != nullptr) { in NAPI_WallpaperExtensionAbility_GetJSCode() 38 *buf = _binary_wallpaper_extension_ability_js_start; in NAPI_WallpaperExtensionAbility_GetJSCode() 48 const char **buf, int *buflen) in NAPI_WallpaperExtensionAbility_GetABCCode() argument 50 if (buf != nullptr) { in NAPI_WallpaperExtensionAbility_GetABCCode() 51 *buf = _binary_wallpaper_extension_ability_abc_start; in NAPI_WallpaperExtensionAbility_GetABCCode()
|
/base/theme/wallpaper_mgr/frameworks/js/napi/wallpaper_extension_context/ |
D | wallpaper_extension_context_module.cpp | 34 …ttribute__((visibility("default"))) void NAPI_WallpaperExtensionContext_GetJSCode(const char **buf, in NAPI_WallpaperExtensionContext_GetJSCode() argument 37 if (buf != nullptr) { in NAPI_WallpaperExtensionContext_GetJSCode() 38 *buf = _binary_wallpaper_extension_context_js_start; in NAPI_WallpaperExtensionContext_GetJSCode() 47 …tribute__((visibility("default"))) void NAPI_WallpaperExtensionContext_GetABCCode(const char **buf, in NAPI_WallpaperExtensionContext_GetABCCode() argument 50 if (buf != nullptr) { in NAPI_WallpaperExtensionContext_GetABCCode() 51 *buf = _binary_wallpaper_extension_context_abc_start; in NAPI_WallpaperExtensionContext_GetABCCode()
|
/base/print/print_fwk/interfaces/kits/jsnapi/extension/ |
D | print_extension_module.cpp | 34 …ribute__((visibility("default"))) void NAPI_PrintExtension_GetJSCode(const char **buf, int *bufLen) in NAPI_PrintExtension_GetJSCode() argument 36 if (buf != nullptr) { in NAPI_PrintExtension_GetJSCode() 37 *buf = _binary_print_extension_js_start; in NAPI_PrintExtension_GetJSCode() 46 …ibute__((visibility("default"))) void NAPI_PrintExtension_GetABCCode(const char **buf, int *buflen) in NAPI_PrintExtension_GetABCCode() argument 48 if (buf != nullptr) { in NAPI_PrintExtension_GetABCCode() 49 *buf = _binary_print_extension_abc_start; in NAPI_PrintExtension_GetABCCode()
|