Lines Matching refs:scannerOptions

173 void FreeScannerOptionsMemory(Scan_ScannerOptions* scannerOptions)
175 if (scannerOptions == nullptr) {
176 SCAN_HILOGW("scannerOptions is a nullptr.");
180 for (int i = 0; i < scannerOptions->optionCount; i++) {
181 DELETE_AND_NULLIFY(scannerOptions->titles[i])
183 DELETE_ARRAY_AND_NULLIFY(scannerOptions->titles)
185 for (int i = 0; i < scannerOptions->optionCount; i++) {
186 DELETE_AND_NULLIFY(scannerOptions->descriptions[i])
188 DELETE_ARRAY_AND_NULLIFY(scannerOptions->descriptions)
190 for (int i = 0; i < scannerOptions->optionCount; i++) {
191 DELETE_AND_NULLIFY(scannerOptions->ranges[i])
193 DELETE_ARRAY_AND_NULLIFY(scannerOptions->ranges)
194 DELETE_AND_NULLIFY(scannerOptions)
199 Scan_ScannerOptions* scannerOptions = new (std::nothrow) Scan_ScannerOptions();
200 if (scannerOptions == nullptr) {
201 SCAN_HILOGE("scannerOptions is a nullptr");
205 if (memset_s(scannerOptions, scannerOptionsMemSize, 0, scannerOptionsMemSize) != 0) {
207 FreeScannerOptionsMemory(scannerOptions);
210 scannerOptions->titles = new (std::nothrow) char* [optionCount];
211 scannerOptions->descriptions = new (std::nothrow) char* [optionCount];
212 scannerOptions->ranges = new (std::nothrow) char* [optionCount];
213 scannerOptions->optionCount = optionCount;
214 if (scannerOptions->titles == nullptr || scannerOptions->descriptions == nullptr ||
215 scannerOptions->ranges == nullptr) {
216 FreeScannerOptionsMemory(scannerOptions);
220 if (memset_s(scannerOptions->titles, stringMemSize, 0, stringMemSize) != 0 ||
221 memset_s(scannerOptions->descriptions, stringMemSize, 0, stringMemSize) != 0 ||
222 memset_s(scannerOptions->ranges, stringMemSize, 0, stringMemSize) != 0) {
224 FreeScannerOptionsMemory(scannerOptions);
227 return scannerOptions;
248 bool MemSetScannerOptions(Scan_ScannerOptions* scannerOptions, int32_t &optionCount, ScanParaTable &paraTable)
259 scannerOptions->titles[i] = titBuff;
269 scannerOptions->descriptions[i] = desBuff;
279 scannerOptions->ranges[i] = rangesBuff;
291 Scan_ScannerOptions* scannerOptions = CreateScannerOptions(optionCount);
292 if (scannerOptions == nullptr) {
293 SCAN_HILOGE("scannerOptions is a nullptr");
296 if (!MemSetScannerOptions(scannerOptions, optionCount, paraTable)) {
298 FreeScannerOptionsMemory(scannerOptions);
301 return scannerOptions;