Home
last modified time | relevance | path

Searched refs:stream (Results 1 – 25 of 74) sorted by relevance

123

/base/startup/init/services/param/linux/
Dparam_msgadp.c47 int ParamServerCreate(ParamTaskPtr *stream, const ParamStreamInfo *streamInfo) in ParamServerCreate() argument
49 PARAM_CHECK(stream != NULL && streamInfo != NULL, return -1, "Invalid param"); in ParamServerCreate()
56 return LE_CreateStreamServer(LE_GetDefaultLoop(), stream, &info); in ParamServerCreate()
59 int ParamStreamCreate(ParamTaskPtr *stream, ParamTaskPtr server, in ParamStreamCreate() argument
62 PARAM_CHECK(stream != NULL && streamInfo != NULL, return -1, "Invalid stream"); in ParamStreamCreate()
76 LE_STATUS status = LE_AcceptStreamClient(LE_GetDefaultLoop(), server, stream, &info); in ParamStreamCreate()
81 void *ParamGetTaskUserData(const ParamTaskPtr stream) in ParamGetTaskUserData() argument
83 PARAM_CHECK(stream != NULL, return NULL, "Invalid stream"); in ParamGetTaskUserData()
84 return LE_GetUserData(stream); in ParamGetTaskUserData()
87 int ParamTaskSendMsg(const ParamTaskPtr stream, const ParamMessage *msg) in ParamTaskSendMsg() argument
[all …]
Dparam_message.h73 typedef int (*RecvMessage)(const ParamTaskPtr stream, const ParamMessage *msg);
86 int ParamTaskClose(const ParamTaskPtr stream);
87 int ParamServerCreate(ParamTaskPtr *stream, const ParamStreamInfo *streamInfo);
88 int ParamStreamCreate(ParamTaskPtr *stream, ParamTaskPtr server,
90 int ParamTaskSendMsg(const ParamTaskPtr stream, const ParamMessage *msg);
92 int ParamEventTaskCreate(ParamTaskPtr *stream, LE_ProcessAsyncEvent eventProcess);
93 int ParamEventSend(const ParamTaskPtr stream, uint64_t eventId, const char *content, uint32_t size);
95 void *ParamGetTaskUserData(const ParamTaskPtr stream);
/base/powermgr/thermal_manager/application/protector/src/
Dthermal_protector_utils.cpp29 FILE *stream = fopen(path.c_str(), "w+"); in WriteFile() local
30 if (stream == nullptr) { in WriteFile()
33 size_t ret = fwrite(buf.c_str(), strlen(buf.c_str()), 1, stream); in WriteFile()
37 int32_t state = fseek(stream, 0, SEEK_SET); in WriteFile()
39 fclose(stream); in WriteFile()
42 state = fclose(stream); in WriteFile()
/base/update/updater/services/package/pkg_manager/
Dpkg_managerImpl.cpp90 PkgStreamPtr stream = (*iter1).second; in ClearPkgFile() local
91 delete stream; in ClearPkgFile()
92 stream = nullptr; in ClearPkgFile()
169 PkgStreamPtr stream = nullptr; in CreatePackage() local
170 int32_t ret = CreatePkgStream(stream, path, 0, PkgStream::PkgStreamType_Write); in CreatePackage()
176 PkgFilePtr pkgFile = CreatePackage(PkgStreamImpl::ConvertPkgStream(stream), in CreatePackage()
180 ClosePkgStream(stream); in CreatePackage()
221 PkgFilePtr PkgManagerImpl::CreatePackage(PkgStreamPtr stream, PkgFile::PkgType type, PkgInfoPtr hea… in CreatePackage() argument
225 std::string pkgName = stream->GetFileName(); in CreatePackage()
232 pkgFile = iter->second(this, stream, header); in CreatePackage()
[all …]
Dpkg_manager_impl.h60 …int32_t DecompressBuffer(FileInfoPtr info, const PkgBuffer &buffer, StreamPtr stream) const overri…
62 …int32_t CompressBuffer(FileInfoPtr info, const PkgBuffer &buffer, StreamPtr stream) const override;
67 std::vector<std::string> &fileIds, uint8_t type, StreamPtr stream) override;
69 … int32_t ParsePackage(StreamPtr stream, std::vector<std::string> &fileIds, int32_t type) override;
71 …int32_t CreatePkgStream(StreamPtr &stream, const std::string &fileName, const PkgBuffer &buffer) o…
73 int32_t CreatePkgStream(PkgStreamPtr &stream, const std::string &fileName,
76 …int32_t CreatePkgStream(StreamPtr &stream, const std::string &fileName, Updater::RingBuffer *buffe…
92 …int32_t CreatePkgStream(PkgStreamPtr &stream, const std::string &fileName, size_t size, int32_t ty…
94 void ClosePkgStream(PkgStreamPtr &stream) override;
99 … PkgFilePtr CreatePackage(PkgStreamPtr stream, PkgFile::PkgType type, PkgInfoPtr header = nullptr);
[all …]
/base/update/updater/test/unittest/test_data/applypatch/
DTestDecompressGzip.new.gz ... = pkgStreams_.end()) { 67 PkgStreamPtr stream = (*iter1).second; 68 delete ...
/base/startup/init/services/loopevent/task/
Dle_streamtask.c28 StreamTask *stream = (StreamTask *)taskHandle; in HandleSendMsg_() local
29 LE_Buffer *buffer = GetFirstBuffer(stream); in HandleSendMsg_()
37 FreeBuffer(loopHandle, stream, buffer); in HandleSendMsg_()
38 buffer = GetFirstBuffer(stream); in HandleSendMsg_()
40 if (IsBufferEmpty(stream)) { in HandleSendMsg_()
85 StreamConnectTask *stream = (StreamConnectTask *)handle; in HandleStreamEvent_() local
90 status = HandleSendMsg_(loopHandle, handle, stream->sendMessageComplete); in HandleStreamEvent_()
93 status = HandleRecvMsg_(loopHandle, handle, stream->recvMessage); in HandleStreamEvent_()
97 if (stream->disConnectComplete) { in HandleStreamEvent_()
98 stream->disConnectComplete(handle); in HandleStreamEvent_()
[all …]
Dle_task.c32 BaseTask *stream = (BaseTask *)task; in GetSocketFd() local
33 return stream->taskId.fd; in GetSocketFd()
62 StreamTask *stream = (StreamTask *)task; in CloseTask() local
63 LE_Buffer *buffer = GetFirstBuffer(stream); in CloseTask()
65 FreeBuffer(loopHandle, stream, (BufferHandle)buffer); in CloseTask()
66 buffer = GetFirstBuffer(stream); in CloseTask()
202 BaseTask *stream = (BaseTask *)handle; in LE_GetUserData() local
203 return (void *)(((char *)stream) + stream->userDataOffset); in LE_GetUserData()
Dle_asynctask.c33 StreamTask *task = &asyncTask->stream; in DoAsyncEvent_()
61 while (!IsBufferEmpty(&asyncTask->stream)) { in LE_DoAsyncEvent()
76 if (!IsBufferEmpty(&asyncTask->stream)) { in HandleAsyncEvent_()
109 task->stream.base.handleEvent = HandleAsyncEvent_; in LE_CreateAsyncTask()
110 task->stream.base.innerClose = HandleAsyncTaskClose_; in LE_CreateAsyncTask()
112 OH_ListInit(&task->stream.buffHead); in LE_CreateAsyncTask()
113 LoopMutexInit(&task->stream.mutex); in LE_CreateAsyncTask()
/base/update/updater/test/fuzztest/UpdaterStartUpdaterProc_fuzzer/
DUpdaterStartUpdaterProc_fuzzer.cpp51 PkgManager::StreamPtr stream = nullptr; in BuildFileDigest() local
54 …int32_t ret = packageManager->CreatePkgStream(stream, packagePath, 0, PkgStream::PkgStreamType_Rea… in BuildFileDigest()
57 packageManager->ClosePkgStream(stream); in BuildFileDigest()
61 size_t fileLen = stream->GetFileLength(); in BuildFileDigest()
63 PKG_LOGE("Invalid file len %zu to load %s", fileLen, stream->GetFileName().c_str()); in BuildFileDigest()
64 packageManager->ClosePkgStream(stream); in BuildFileDigest()
74 PKG_LOGE("Invalid file %s", stream->GetFileName().c_str()); in BuildFileDigest()
75 packageManager->ClosePkgStream(stream); in BuildFileDigest()
84 ret = stream->Read(buff, offset, buffSize, readLen); in BuildFileDigest()
86 PKG_LOGE("read buffer fail %s", stream->GetFileName().c_str()); in BuildFileDigest()
[all …]
/base/update/updater/test/unittest/updater_binary/
Dupdater_binary_unittest.cpp76 PkgManager::StreamPtr stream = nullptr; in BuildFileDigest() local
77 … int32_t ret = pkgManager->CreatePkgStream(stream, packagePath, 0, PkgStream::PkgStreamType_Read); in BuildFileDigest()
80 pkgManager->ClosePkgStream(stream); in BuildFileDigest()
84 size_t fileLen = stream->GetFileLength(); in BuildFileDigest()
86 LOG(ERROR) << "invalid file to load " << stream->GetFileName(); in BuildFileDigest()
87 pkgManager->ClosePkgStream(stream); in BuildFileDigest()
97 LOG(ERROR) << "Invalid file " << stream->GetFileName(); in BuildFileDigest()
98 pkgManager->ClosePkgStream(stream); in BuildFileDigest()
107 ret = stream->Read(buff, offset, buffSize, readLen); in BuildFileDigest()
109 LOG(ERROR) << "read buffer fail " << stream->GetFileName(); in BuildFileDigest()
[all …]
/base/update/updater/test/unittest/package/
Dpkg_package_unittest.cpp44 explicit TestFile(PkgManager::PkgManagerPtr pkgManager, PkgStreamPtr stream) in TestFile() argument
45 : PkgFileImpl(pkgManager, stream, PKG_TYPE_MAX) {} in TestFile()
77 PkgManager::StreamPtr stream = nullptr; in TestPkgFile() local
80 … int ret = pkgManager_->CreatePkgStream(stream, packagePath, 0, PkgStream::PkgStreamType_Read); in TestPkgFile()
81 … auto file = std::make_unique<Lz4PkgFile>(pkgManager_, PkgStreamImpl::ConvertPkgStream(stream)); in TestPkgFile()
89 ret = entry->Init(&fileInfo.fileInfo, PkgStreamImpl::ConvertPkgStream(stream)); in TestPkgFile()
99 PkgManager::StreamPtr stream = nullptr; in TestPkgFileInvalid() local
102 … int ret = pkgManager_->CreatePkgStream(stream, packagePath, 0, PkgStream::PkgStreamType_Read); in TestPkgFileInvalid()
105 PkgStreamImpl::ConvertPkgStream(stream)); in TestPkgFileInvalid()
107 ret = file->AddEntry(&fileInfo, PkgStreamImpl::ConvertPkgStream(stream)); in TestPkgFileInvalid()
[all …]
Dpkg_test.h72 PkgManager::StreamPtr stream = nullptr; in BuildFileDigest() local
73 … int32_t ret = pkgManager_->CreatePkgStream(stream, packagePath, 0, PkgStream::PkgStreamType_Read); in BuildFileDigest()
78 size_t fileLen = stream->GetFileLength(); in BuildFileDigest()
80 PKG_LOGE("Invalid file len %zu to load %s", fileLen, stream->GetFileName().c_str()); in BuildFileDigest()
81 pkgManager_->ClosePkgStream(stream); in BuildFileDigest()
91 PKG_LOGE("Invalid file %s", stream->GetFileName().c_str()); in BuildFileDigest()
92 pkgManager_->ClosePkgStream(stream); in BuildFileDigest()
100 ret = stream->Read(buff, offset, buffSize, readLen); in BuildFileDigest()
102 PKG_LOGE("read buffer fail %s", stream->GetFileName().c_str()); in BuildFileDigest()
103 pkgManager_->ClosePkgStream(stream); in BuildFileDigest()
[all …]
Dpkg_manager_unittest.cpp177 std::unique_ptr<TestPkgStream> stream = std::make_unique<TestPkgStream>(pkgManager_, path); in TestPkgStreamImpl() local
178 EXPECT_NE(stream, nullptr); in TestPkgStreamImpl()
185 int ret = ((PkgStreamPtr)(stream.get()))->Read(buffer, start, size, readLen); in TestPkgStreamImpl()
188 ret = ((PkgStreamPtr)(stream.get()))->GetBuffer(data); in TestPkgStreamImpl()
191 ret = ((PkgStreamPtr)(stream.get()))->GetStreamType(); in TestPkgStreamImpl()
201 auto stream = std::make_unique<FileStream>(pkgManager_, testPackageName, nullptr, 0); in TestInvalidStream() local
206 int ret = stream->Read(buffer, start, bufferSize, readLen); in TestInvalidStream()
380 PkgManager::StreamPtr stream, void *mappedData, std::vector<uint8_t> &digest) in CheckDataIntegrityLz4() argument
385 int32_t ret = pkgManager_->DecompressBuffer(&lz4Info.fileInfo, buffer, stream); in CheckDataIntegrityLz4()
414 PkgManager::StreamPtr stream = nullptr; in TestDecompressLz4() local
[all …]
/base/powermgr/thermal_manager/utils/native/src/
Dfile_operation.cpp65 FILE *stream = fopen(path.c_str(), "w+"); in WriteFile() local
66 if (stream == nullptr) { in WriteFile()
69 size_t ret = fwrite(buf.c_str(), strlen(buf.c_str()), 1, stream); in WriteFile()
73 int32_t state = fseek(stream, 0, SEEK_SET); in WriteFile()
75 fclose(stream); in WriteFile()
78 state = fclose(stream); in WriteFile()
/base/update/updater/services/diffpatch/patch/
Dupdate_patch.cpp139 Hpackage::PkgManager::StreamPtr stream = nullptr; in ApplyBlockPatch() local
140 int32_t ret = pkgManager->CreatePkgStream(stream, "", {oldInfo.buffer, oldInfo.length}); in ApplyBlockPatch()
141 if (stream == nullptr || ret != PKG_SUCCESS) { in ApplyBlockPatch()
143 pkgManager->ClosePkgStream(stream); in ApplyBlockPatch()
148 …ique_ptr<BlocksStreamPatch> patch = std::make_unique<BlocksStreamPatch>(patchInfo, stream, writer); in ApplyBlockPatch()
151 pkgManager->ClosePkgStream(stream); in ApplyBlockPatch()
156 pkgManager->ClosePkgStream(stream); in ApplyBlockPatch()
185 Hpackage::PkgManager::StreamPtr stream = nullptr; in ApplyBlockPatch() local
186 ret = pkgManager->CreatePkgStream(stream, "", {oldInfo.buffer, oldInfo.length}); in ApplyBlockPatch()
187 if (stream == nullptr) { in ApplyBlockPatch()
[all …]
/base/update/sys_installer/test/fuzztest/
Dsys_installer_fuzzer.cpp44 PkgManager::StreamPtr stream = nullptr; in BuildFileDigest() local
47 …int32_t ret = packageManager->CreatePkgStream(stream, packagePath, 0, PkgStream::PkgStreamType_Rea… in BuildFileDigest()
49 packageManager->ClosePkgStream(stream); in BuildFileDigest()
54 size_t fileLen = stream->GetFileLength(); in BuildFileDigest()
56 packageManager->ClosePkgStream(stream); in BuildFileDigest()
65 packageManager->ClosePkgStream(stream); in BuildFileDigest()
74 ret = stream->Read(buff, offset, buffSize, readLen); in BuildFileDigest()
76 PKG_LOGE("read buffer fail %s", stream->GetFileName().c_str()); in BuildFileDigest()
77 packageManager->ClosePkgStream(stream); in BuildFileDigest()
88 packageManager->ClosePkgStream(stream); in BuildFileDigest()
/base/update/updater/test/fuzztest/extractandexecutescript_fuzzer/
Dextractandexecutescript_fuzzer.cpp183 PkgManager::StreamPtr stream = nullptr; in BuildFileDigest() local
184 …int32_t ret = packageManager->CreatePkgStream(stream, packagePath, 0, PkgStream::PkgStreamType_Rea… in BuildFileDigest()
187 packageManager->ClosePkgStream(stream); in BuildFileDigest()
190 size_t fileLen = stream->GetFileLength(); in BuildFileDigest()
193 packageManager->ClosePkgStream(stream); in BuildFileDigest()
197 PKG_LOGE("Invalid file len %zu to load %s", fileLen, stream->GetFileName().c_str()); in BuildFileDigest()
198 packageManager->ClosePkgStream(stream); in BuildFileDigest()
207 PKG_LOGE("Invalid file %s", stream->GetFileName().c_str()); in BuildFileDigest()
208 packageManager->ClosePkgStream(stream); in BuildFileDigest()
216 ret = stream->Read(buff, offset, buffSize, readLen); in BuildFileDigest()
[all …]
/base/powermgr/battery_manager/test/utils/
Dtest_utils.cpp55 std::ofstream stream(path.c_str()); in WriteMock() local
56 if (!stream.is_open()) { in WriteMock()
60 stream << content.c_str() << std::endl; in WriteMock()
61 stream.close(); in WriteMock()
/base/update/updater/services/flow_update/update_bin/
Dbin_process.cpp81 PkgManager::StreamPtr stream) in ExtractBinFile() argument
85 stream->Stop(); in ExtractBinFile()
106 ret = pkgManager->CreatePkgStream(processStream, upgradeFileName, processor, stream); in ExtractBinFile()
190 PkgManager::StreamPtr stream) in ProcessBinFile() argument
192 if (stream == nullptr) { in ProcessBinFile()
198 stream->Stop(); in ProcessBinFile()
215 innerFileNames, PkgFile::PKG_TYPE_UPGRADE, stream); in ProcessBinFile()
231 if (ComponentProcess(env, stream, partitionName, info->unpackedSize) != USCRIPT_SUCCESS) { in ProcessBinFile()
241 …ptInstructionBinFlowWrite::ComponentProcess(Uscript::UScriptEnv &env, PkgManager::StreamPtr stream, in ComponentProcess() argument
262 processor->SetPkgFileSize(stream->GetReadOffset(), stream->GetFileLength()); in ComponentProcess()
[all …]
Dbin_process.h34 Hpackage::PkgManager::StreamPtr stream);
35 int32_t ComponentProcess(Uscript::UScriptEnv &env, Hpackage::PkgManager::StreamPtr stream,
41 Hpackage::PkgManager::StreamPtr stream);
/base/update/updater/test/unittest/script/
Dscript_unittest.h71 int32_t CreatePkgStream(StreamPtr &stream, const std::string &fileName, size_t size, in CreatePkgStream() argument
76 int32_t CreatePkgStream(StreamPtr &stream, const std::string &fileName, in CreatePkgStream() argument
81 …int32_t CreatePkgStream(StreamPtr &stream, const std::string &fileName, const PkgBuffer &buffer) o… in CreatePkgStream() argument
85 void ClosePkgStream(StreamPtr &stream) override { } in ClosePkgStream() argument
99 int32_t ParsePackage(StreamPtr stream, std::vector<std::string> &fileIds, int32_t type) override in ParsePackage() argument
106 std::vector<std::string> &fileIds, uint8_t type, StreamPtr stream) override in LoadPackageWithStream() argument
110 …int32_t CreatePkgStream(StreamPtr &stream, const std::string &fileName, Updater::RingBuffer *buffe… in CreatePkgStream() argument
Dscript_unittest.cpp72 …int32_t CreatePkgStream(StreamPtr &stream, const std::string &fileName, const PkgBuffer &buffer) o… in CreatePkgStream() argument
74 stream = new MemoryMapStream(this, fileName, buffer, PkgStream::PkgStreamType_Buffer); in CreatePkgStream()
85 auto stream = static_cast<MemoryMapStream *>(output); in ExtractFile() local
100 stream->GetBuffer(buffer); in ExtractFile()
108 int32_t CreatePkgStream(StreamPtr &stream, const std::string &fileName, in CreatePkgStream() argument
127 stream = new FileStream(this, fileNameReal, file, PkgStream::PkgStreamType_Read); in CreatePkgStream()
130 void ClosePkgStream(StreamPtr &stream) override in ClosePkgStream() argument
132 delete stream; in ClosePkgStream()
/base/hiviewdfx/hiview/base/utility/include/
Dstring_util.h71 std::stringstream stream; in IsConvertable() local
72 stream << inValue; in IsConvertable()
74 stream >> outValue; in IsConvertable()
76 stream.clear(); in IsConvertable()
77 stream.str(""); in IsConvertable()
78 stream << (value + 0); in IsConvertable()
79 std::string tempValue = stream.str(); in IsConvertable()
/base/update/updater/services/include/package/
Dpkg_manager.h212 PkgManagerPtr manager, PkgStreamPtr stream, PkgManager::PkgInfoPtr header)>;
300 virtual int32_t CreatePkgStream(StreamPtr &stream, const std::string &fileName, size_t size,
312 virtual int32_t CreatePkgStream(StreamPtr &stream, const std::string &fileName,
323 …virtual int32_t CreatePkgStream(StreamPtr &stream, const std::string &fileName, const PkgBuffer &b…
333 …virtual int32_t CreatePkgStream(StreamPtr &stream, const std::string &fileName, Updater::RingBuffe…
340 virtual void ClosePkgStream(StreamPtr &stream) = 0;
349 std::vector<std::string> &fileIds, uint8_t type, StreamPtr stream) = 0;
351 …virtual int32_t ParsePackage(StreamPtr stream, std::vector<std::string> &fileIds, int32_t type) = …
363 PkgFilePtr NewPkgFile(PkgManager::PkgManagerPtr manager, PkgStreamPtr stream, PkgInfoPtr header) in NewPkgFile() argument
365 return new FileClassName (manager, stream, header); in NewPkgFile()

123