From 1485fff9135882a494e3adbd75f6e4fc59e51340 Mon Sep 17 00:00:00 2001 From: Dongsun Lee Date: Fri, 6 Jan 2017 07:55:20 +0900 Subject: [PATCH] Apply the reviewed API documentation Change-Id: Id6503fbbd225a29459b10937136fe2effd5ee011 Signed-off-by: Dongsun Lee (cherry picked from commit acd455ac7aaa58c0d5ae667a3ea2f24a34214ab7) --- src/include/csr/csr-content-screening-types.h | 38 +++--- src/include/csr/csr-content-screening.h | 188 +++++++++++++------------- src/include/csr/csr-engine-manager.h | 46 ++++--- src/include/csr/csr-error.h | 28 ++-- src/include/csr/csr-web-protection-types.h | 29 ++-- src/include/csr/csr-web-protection.h | 41 +++--- 6 files changed, 201 insertions(+), 169 deletions(-) diff --git a/src/include/csr/csr-content-screening-types.h b/src/include/csr/csr-content-screening-types.h index be4125b..0d52e25 100644 --- a/src/include/csr/csr-content-screening-types.h +++ b/src/include/csr/csr-content-screening-types.h @@ -1,17 +1,17 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License */ /* * @file csr-content-screening-types.h @@ -19,13 +19,17 @@ * @version 1.0 * @brief Content screening CAPI enums, handles and callbacks */ + + #ifndef __CSR_CONTENT_SCREENING_TYPES_H_ #define __CSR_CONTENT_SCREENING_TYPES_H_ + #ifdef __cplusplus extern "C" { #endif + /** * @addtogroup CAPI_CSR_FRAMEWORK_CS_MODULE * @{ @@ -132,7 +136,7 @@ typedef struct __csr_cs_engine_s *csr_cs_engine_h; * @remarks Only for asynchronous scan functions. * @remarks Called for each file or application which is not detected malware. * @param[in] file_path A path of the file scanned. It would be package path if it's in application - * @param[in] user_data A pointer of a user data. It's provided by client when calling asyncronous scanning method + * @param[in] user_data A pointer of a user data. It's provided by client when calling asynchronous scanning method * @see csr_cs_set_file_scanned_cb() * @see csr_cs_scan_files_async() * @see csr_cs_scan_dir_async() @@ -148,8 +152,8 @@ typedef void (*csr_cs_file_scanned_cb)(const char *file_path, void *user_data); * @remarks Only for asynchronous scan functions. * @remarks Called for each file or application which is detected malware. * @remarks @a malware will be released when a context is released using csr_cs_context_destroy(). - * @param[in] malware The detected malware handle. - * @param[in] user_data A pointer of a user data. It's provided by client when calling asyncronous scanning method. + * @param[in] malware The detected malware handle + * @param[in] user_data A pointer of a user data. It's provided by client when calling asynchronous scanning method * @see csr_cs_set_detected_cb() * @see csr_cs_scan_files_async() * @see csr_cs_scan_dir_async() @@ -164,7 +168,7 @@ typedef void (*csr_cs_detected_cb)(csr_cs_malware_h malware, void *user_data); * @since_tizen 3.0 * @remarks Only for asynchronous scan functions. * @remarks Called only once at the end of scanning when success. - * @param[in] user_data A pointer of a user data. It's provided by client when calling asyncronous scanning method + * @param[in] user_data A pointer of a user data. It's provided by client when calling asynchronous scanning method * @see csr_cs_set_completed_cb() * @see csr_cs_scan_files_async() * @see csr_cs_scan_dir_async() @@ -178,8 +182,8 @@ typedef void (*csr_cs_completed_cb)(void *user_data); * @brief Called when scanning is cancelled by csr_cs_cancel_scanning(). * @since_tizen 3.0 * @remarks Only for asynchronous scan functions. - * @remarks Called only once at the end of scanning by being canceled. - * @param[in] user_data A pointer of a user data. It's provided by client when calling asyncronous scanning method + * @remarks Called only once at the end of scanning by being cancelled. + * @param[in] user_data A pointer of a user data. It's provided by client when calling asynchronous scanning method * @see csr_cs_set_cancelled_cb() * @see csr_cs_cancel_scanning() * @see csr_cs_scan_files_async() @@ -218,8 +222,10 @@ typedef void (*csr_cs_error_cb)(int error_code, void *user_data); * @} */ + #ifdef __cplusplus } #endif + #endif diff --git a/src/include/csr/csr-content-screening.h b/src/include/csr/csr-content-screening.h index b956d53..d345806 100644 --- a/src/include/csr/csr-content-screening.h +++ b/src/include/csr/csr-content-screening.h @@ -1,17 +1,17 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License */ /* * @file csr-content-screening.h @@ -19,19 +19,25 @@ * @version 1.0 * @brief Content screening to detect malware in files */ + + #ifndef __CSR_CONTENT_SCREENING_API_H_ #define __CSR_CONTENT_SCREENING_API_H_ + #include #include + #include #include + #ifdef __cplusplus extern "C" { #endif + /** * @addtogroup CAPI_CSR_FRAMEWORK_CS_MODULE * @{ @@ -42,7 +48,7 @@ extern "C" { * @partner * @brief Initializes and returns a Content Screening API handle. * @details A Content Screening API handle (or CSR CS handle) is obtained by this method. - * The handle is required for subsequent CSR CS API calls. + * The handle is required for subsequent CSR CS API calls. * @since_tizen 3.0 * @remarks @a handle should be released using csr_cs_context_destroy(). * @remarks Multiple handles can be obtained. @@ -51,18 +57,18 @@ extern "C" { * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful * @retval #CSR_ERROR_INVALID_HANDLE @a handle may be null - * @retval #CSR_ERROR_OUT_OF_MEMORY Not enough memory - * @retval #CSR_ERROR_SYSTEM System error - * + * @retval #CSR_ERROR_OUT_OF_MEMORY Not enough memory + * @retval #CSR_ERROR_SYSTEM System error * @see csr_cs_context_destroy() */ int csr_cs_context_create(csr_cs_context_h *handle); + /** * @partner * @brief Releases all system resources associated with a Content Screening API handle. * @since_tizen 3.0 - * @param[in] handle CSR CS context handle returned by csr_cs_context_create(). + * @param[in] handle CSR CS context handle returned by csr_cs_context_create() * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful @@ -90,7 +96,7 @@ int csr_cs_context_destroy(csr_cs_context_h handle); * @retval #CSR_ERROR_NONE Successful * @retval #CSR_ERROR_INVALID_HANDLE Invalid handle * @retval #CSR_ERROR_INVALID_PARAMETER @a ask_user is invalid - * @retval #CSR_ERROR_SYSTEM System error + * @retval #CSR_ERROR_SYSTEM System error * @see csr_cs_context_create() * @see csr_cs_context_destroy() */ @@ -131,7 +137,7 @@ int csr_cs_set_popup_message(csr_cs_context_h handle, const char *message); * @retval #CSR_ERROR_NONE Successful * @retval #CSR_ERROR_INVALID_HANDLE Invalid handle * @retval #CSR_ERROR_INVALID_PARAMETER @a usage is invalid - * @retval #CSR_ERROR_SYSTEM System error + * @retval #CSR_ERROR_SYSTEM System error * @see csr_cs_context_create() * @see csr_cs_context_destroy() */ @@ -145,7 +151,7 @@ int csr_cs_set_core_usage(csr_cs_context_h handle, csr_cs_core_usage_e usage); * @remarks Scan on cloud option is turned off as a default. * @remarks If an engine does not support "scanning on cloud", this option is silently ignored. * @param[in] handle CSR CS context handle returned by csr_cs_context_create() - * @param[int] scan_on_cloud Flag to turn on(#true) or off(#false) of scanning on cloud option + * @param[in] scan_on_cloud Flag of scanning on cloud option * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful @@ -169,9 +175,9 @@ int csr_cs_set_scan_on_cloud(csr_cs_context_h handle, bool scan_on_cloud); * @remarks @a malware will be released when @a handle is released using csr_cs_context_destroy(). * @remarks If multiple malwares exists in @a data, the malware with the highest severity will be returned. * @param[in] handle CSR CS context handle returned by csr_cs_context_create() - * @param[in] data A scan target data. - * @param[in] length A size of a scan target data. - * @param[out] malware A pointer of the detected malware handle. It can be null when there is no malware detected + * @param[in] data A scan target data + * @param[in] length A size of a scan target data + * @param[out] malware A pointer of the detected malware handle. It can be null when no malware detected * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful @@ -183,7 +189,7 @@ int csr_cs_set_scan_on_cloud(csr_cs_context_h handle, bool scan_on_cloud); * @retval #CSR_ERROR_SOCKET Socket error between client and server * @retval #CSR_ERROR_SERVER Server has been failed for some reason * @retval #CSR_ERROR_USER_RESPONSE_FAILED Getting user response is failed. - * @a malware will be allocated on this error + * @a malware will be allocated on this error * @retval #CSR_ERROR_ENGINE_NOT_EXIST No engine exists * @retval #CSR_ERROR_ENGINE_DISABLED Engine is in disabled state * @retval #CSR_ERROR_ENGINE_NOT_ACTIVATED Engine is not activated @@ -204,9 +210,9 @@ int csr_cs_scan_data(csr_cs_context_h handle, const unsigned char *data, size_t * @remarks Scan file synchronously. * @remarks @a malware will be released when @a handle is released using csr_cs_context_destroy(). * @remarks If multiple malwares exists in a file, the malware with the highest severity will be returned. - * @param[in] handle CSR CS context handle returned by csr_cs_context_create(). - * @param[in] file_path A path of scan target file. - * @param[out] malware A pointer of the detected malware handle. It can be null when there is no malware detected. + * @param[in] handle CSR CS context handle returned by csr_cs_context_create() + * @param[in] file_path A path of scan target file + * @param[out] malware A pointer of the detected malware handle. It can be null when no malware detected * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful @@ -216,11 +222,10 @@ int csr_cs_scan_data(csr_cs_context_h handle, const unsigned char *data, size_t * @retval #CSR_ERROR_PERMISSION_DENIED Access denied * @retval #CSR_ERROR_NOT_SUPPORTED Device needed to run API is not supported * @retval #CSR_ERROR_DB DB transaction error - * @retval #CSR_ERROR_REMOVE_FAILED Removing file or application is failed when - * malware exist and user select to remove by popup. - * @a malware will be allocated on this error - * @retval #CSR_ERROR_USER_RESPONSE_FAILED Getting user response is failed, - @a malware will be allocated on this error + * @retval #CSR_ERROR_REMOVE_FAILED Removing file or application is failed when malware exist and user select to remove by popup. + * @a malware will be allocated on this error + * @retval #CSR_ERROR_USER_RESPONSE_FAILED Getting user response is failed + * @a malware will be allocated on this error * @retval #CSR_ERROR_FILE_DO_NOT_EXIST File not found * @retval #CSR_ERROR_SOCKET Socket error between client and server * @retval #CSR_ERROR_SERVER Server has been failed for some reason @@ -241,14 +246,14 @@ int csr_cs_scan_file(csr_cs_context_h handle, const char *file_path, csr_cs_malw * @brief Sets a callback function for the case that a file scan is completed. * @since_tizen 3.0 * @remarks Callback for asynchronous scan functions. - * @param[in] handle CSR CS context handle returned by csr_cs_context_create(). + * @param[in] handle CSR CS context handle returned by csr_cs_context_create() * @param[in] callback A callback function for each file or application scanning done without any malware. * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful * @retval #CSR_ERROR_INVALID_HANDLE Invalid handle * @retval #CSR_ERROR_INVALID_PARAMETER @a callback is invalid - * @retval #CSR_ERROR_SYSTEM System error + * @retval #CSR_ERROR_SYSTEM System error * @see csr_cs_scan_files_async() * @see csr_cs_scan_dir_async() * @see csr_cs_scan_dirs_async() @@ -262,7 +267,7 @@ int csr_cs_set_file_scanned_cb(csr_cs_context_h handle, csr_cs_file_scanned_cb c * @since_tizen 3.0 * @remarks Callback for asynchronous scan functions. * @param[in] handle CSR CS context handle returned by csr_cs_context_create() - * @param[in] callback A callback function for each file or application scanning done with malware detected + * @param[in] callback A callback function for each file or application scanning done with malware detected * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful @@ -282,7 +287,7 @@ int csr_cs_set_detected_cb(csr_cs_context_h handle, csr_cs_detected_cb callback) * @since_tizen 3.0 * @remarks Callback for asynchronous scan functions. * @param[in] handle CSR CS context handle returned by csr_cs_context_create() - * @param[in] callback A callback function for scanning completed successfully + * @param[in] callback A callback function for scanning completed successfully * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful @@ -298,7 +303,7 @@ int csr_cs_set_completed_cb(csr_cs_context_h handle, csr_cs_completed_cb callbac /** * @partner - * @brief Sets a callback function for scanning canceled. + * @brief Sets a callback function for scanning cancelled. * @since_tizen 3.0 * @remarks Callback for asynchronous scan functions. * @remarks Client can cancel asynchronous scanning by csr_cs_cancel_scanning(). @@ -309,7 +314,7 @@ int csr_cs_set_completed_cb(csr_cs_context_h handle, csr_cs_completed_cb callbac * @retval #CSR_ERROR_NONE Successful * @retval #CSR_ERROR_INVALID_HANDLE Invalid handle * @retval #CSR_ERROR_INVALID_PARAMETER @a callback is invalid - * @retval #CSR_ERROR_SYSTEM System error + * @retval #CSR_ERROR_SYSTEM System error * @see csr_cs_scan_files_async() * @see csr_cs_scan_dir_async() * @see csr_cs_scan_dirs_async() @@ -330,7 +335,7 @@ int csr_cs_set_cancelled_cb(csr_cs_context_h handle, csr_cs_cancelled_cb callbac * @retval #CSR_ERROR_NONE Successful * @retval #CSR_ERROR_INVALID_HANDLE Invalid handle * @retval #CSR_ERROR_INVALID_PARAMETER @a callback is invalid - * @retval #CSR_ERROR_SYSTEM System error + * @retval #CSR_ERROR_SYSTEM System error * @see csr_cs_scan_files_async() * @see csr_cs_scan_dir_async() * @see csr_cs_scan_dirs_async() @@ -343,7 +348,7 @@ int csr_cs_set_error_cb(csr_cs_context_h handle, csr_cs_error_cb callback); * @brief Scan files specified by an array of file paths for malware. * @details If scanning of the single file is done without detected malware, * csr_cs_file_scanned_cb() is called and else if malware detected - * csr_cs_detected_cb() is called. If scanning is canceled by + * csr_cs_detected_cb() is called. If scanning is cancelled by * csr_cs_cancel_scanning(), csr_cs_cancelled_cb() is called. If scanning is failed * with error, csr_cs_error_cb() is called. If scanning is completed without * error, csr_cs_completed_cb(). Every callbacks are registered by callback @@ -357,11 +362,11 @@ int csr_cs_set_error_cb(csr_cs_context_h handle, csr_cs_error_cb callback); * @a handle is released using csr_cs_context_destroy(). * @remarks If multiple malwares exists in a file, the malware with the highest * severity will be returned for the file via csr_cs_set_detected_cb(). - * @param[in] handle CSR CS context handle returned by csr_cs_context_create(). - * @param[in] file_paths An array of scan target files. - * @param[in] count A number of scan target files. - * @param[in] user_data The pointer of a user data. It can be null - * It is delivered back to the client when a callback function is called. + * @param[in] handle CSR CS context handle returned by csr_cs_context_create() + * @param[in] file_paths An array of scan target files + * @param[in] count A number of scan target files + * @param[in] user_data The pointer of a user data. It can be null. + * It is delivered back to the client when a callback function is called * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful @@ -380,7 +385,7 @@ int csr_cs_set_error_cb(csr_cs_context_h handle, csr_cs_error_cb callback); * @retval #CSR_ERROR_ENGINE_DISABLED Engine is in disabled state * @retval #CSR_ERROR_ENGINE_NOT_ACTIVATED Engine is not activated * @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error - * @retval #CSR_ERROR_SYSTEM System error= + * @retval #CSR_ERROR_SYSTEM System error * @pre It is required to set callbacks, csr_cs_completed_cb, csr_cs_error_cb(), * csr_cs_cancel_scanning(), csr_cs_detected_cb(), and/or csr_cs_file_scanned_cb(). * @see csr_cs_set_file_scanned_cb() @@ -396,10 +401,9 @@ int csr_cs_scan_files_async(csr_cs_context_h handle, const char *file_paths[], s /** * @partner * @brief Scans a directory specified by directory path for malware. - * * @details If scanning of the single file is done without detected malware, * csr_cs_file_scanned_cb() is called and else if malware detected - * csr_cs_detected_cb() is called. If scanning is canceled by + * csr_cs_detected_cb() is called. If scanning is cancelled by * csr_cs_cancel_scanning(), csr_cs_cancelled_cb() is called. If scanning is failed * with error, csr_cs_error_cb() is called. If scanning is completed without * error, csr_cs_completed_cb(). Every callbacks are registered by callback @@ -415,13 +419,13 @@ int csr_cs_scan_files_async(csr_cs_context_h handle, const char *file_paths[], s * severity will be returned for the file via csr_cs_set_detected_cb(). * @param[in] handle CSR CS context handle returned by csr_cs_context_create() * @param[in] dir_path A path of scan target directory - * @param[in] user_data The pointer of a user data. It can be null. It is used on - * the callback functions which are registered to @a handle + * @param[in] user_data The pointer of a user data. It can be null. + * It is used on the callback functions which are registered to @a handle * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful * @retval #CSR_ERROR_INVALID_HANDLE Invalid handle - * @retval #CSR_ERROR_OUT_OF_MEMORYNot enough memory + * @retval #CSR_ERROR_OUT_OF_MEMORY Not enough memory * @retval #CSR_ERROR_INVALID_PARAMETER @a dir_path is invalid * @retval #CSR_ERROR_PERMISSION_DENIED Access denied * @retval #CSR_ERROR_NOT_SUPPORTED Device needed to run API is not supported @@ -436,7 +440,7 @@ int csr_cs_scan_files_async(csr_cs_context_h handle, const char *file_paths[], s * @retval #CSR_ERROR_ENGINE_DISABLED Engine is in disabled state * @retval #CSR_ERROR_ENGINE_NOT_ACTIVATED Engine is not activated * @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error - * @retval #CSR_ERROR_SYSTEM System error + * @retval #CSR_ERROR_SYSTEM System error * @pre It is required to set callbacks, csr_cs_completed_cb, csr_cs_error_cb(), * csr_cs_cancel_scanning(), csr_cs_detected_cb(), and/or csr_cs_file_scanned_cb(). * @see csr_cs_set_file_scanned_cb() @@ -454,8 +458,8 @@ int csr_cs_scan_dir_async(csr_cs_context_h handle, const char *dir_path, void *u * @brief Scan directories specified by an array of directory paths for malware. * @details If scanning of the single file is done without detected malware, * csr_cs_file_scanned_cb() is called and else if malware detected - * csr_cs_detected_cb() is called. If scanning is canceled by - * csr_cs_cancel_scanning(), csr_cs_canceled_cb() is called. If scanning is failed + * csr_cs_detected_cb() is called. If scanning is cancelled by + * csr_cs_cancel_scanning(), csr_cs_cancelled_cb() is called. If scanning is failed * with error, csr_cs_error_cb() is called. If scanning is completed without * error, csr_cs_completed_cb(). Every callbacks are registered by callback * setter methods to @a handle and if callback is not registered, it will just be skipped to be called. @@ -477,7 +481,7 @@ int csr_cs_scan_dir_async(csr_cs_context_h handle, const char *dir_path, void *u * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful * @retval #CSR_ERROR_INVALID_HANDLE Invalid handle - * @retval #CSR_ERROR_OUT_OF_MEMORY Not enough memory + * @retval #CSR_ERROR_OUT_OF_MEMORY Not enough memory * @retval #CSR_ERROR_INVALID_PARAMETER @a dir_paths is invalid * @retval #CSR_ERROR_PERMISSION_DENIED Access denied * @retval #CSR_ERROR_NOT_SUPPORTED Device needed to run API is not supported @@ -527,9 +531,7 @@ int csr_cs_cancel_scanning(csr_cs_context_h handle); /** * @partner * @brief Extracts the severity of a detected malware from the detected malware handle. - * * @since_tizen 3.0 - * * @param[in] malware A detected malware handle returned by csr_cs_scan_data(), * csr_cs_scan_file() or csr_cs_malware_list_get_malware() * @param[out] severity A pointer of the severity of a detected malware @@ -549,7 +551,7 @@ int csr_cs_malware_get_severity(csr_cs_malware_h malware, csr_cs_severity_level_ * @since_tizen 3.0 * @remarks @a name must be released using free(). * @param[in] malware A detected malware handle - * @param[out]name A pointer of the name of a detected malware + * @param[out] name A pointer of the name of a detected malware * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful @@ -562,16 +564,16 @@ int csr_cs_malware_get_name(csr_cs_malware_h malware, char **name); /** * @partner - * @brief Extracts a url that contains detailed information on vendor's web site from the detected malware handle. + * @brief Extracts an url that contains detailed information on vendor's web site from the detected malware handle. * @since_tizen 3.0 * @remarks @a detailed_url must be released using free(). - * @param[in] malware A detected malware handle. - * @param[out] detailed_url A pointer of a url that contains detailed information on - * vendor's web site. It can be null if a vendor doesn't provide this information. + * @param[in] malware A detected malware handle + * @param[out] detailed_url A pointer of an url that contains detailed information on + * vendor's web site. It can be null if a vendor doesn't provide this information * @return #CSR_ERROR_NONE on success, * otherwise a negative error value - * @retval #CSR_ERROR_NONES uccessful - * @retval #CSR_ERROR_INVALID_HANDLEInvalid detected malware handle + * @retval #CSR_ERROR_NONE Successful + * @retval #CSR_ERROR_INVALID_HANDLE Invalid detected malware handle * @retval #CSR_ERROR_INVALID_PARAMETER @a detailed_url is invalid. * @retval #CSR_ERROR_SYSTEM System error */ @@ -583,7 +585,7 @@ int csr_cs_malware_get_detailed_url(csr_cs_malware_h malware, char **detailed_ur * @brief Extracts the time stamp when a malware is detected from the detected malware handle. * @since_tizen 3.0 * @param[in] malware A detected malware handle - * @param[out] timestamp A pointer of the time stamp in milliseconds when a malware is detected. + * @param[out] timestamp A pointer of the time stamp in milli second when a malware is detected * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful @@ -599,9 +601,8 @@ int csr_cs_malware_get_timestamp(csr_cs_malware_h malware, time_t *timestamp); * @brief Extracts the file name where a malware is detected from the detected malware handle. * @since_tizen 3.0 * @remarks @a file_name must be released using free(). - * @param[in] malware A detected malware handle. - * @param[out] file_name A pointer of the file name where a malware is detected. The - * file name is null for csr_cs_scan_data() + * @param[in] malware A detected malware handle + * @param[out] file_name A pointer of the file name where a malware is detected. The file name is null for csr_cs_scan_data() * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful @@ -616,8 +617,8 @@ int csr_cs_malware_get_file_name(csr_cs_malware_h malware, char **file_name); * @partner * @brief Extracts a user response of a popup from the detected malware handle. * @since_tizen 3.0 - * @param[in] malware A detected malware handle. - * @param[out] response A pointer of the user response. + * @param[in] malware A detected malware handle + * @param[out] response A pointer of the user response * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful @@ -632,7 +633,7 @@ int csr_cs_malware_get_user_response(csr_cs_malware_h malware, csr_cs_user_respo * @partner * @brief Checks if a malware was detected in an application or in a file. * @since_tizen 3.0 - * @param[in] malware A detected malware handle. + * @param[in] malware A detected malware handle * @param[out] is_app A pointer of a flag indicating the position where a malware was detected. * @return #CSR_ERROR_NONE on success, * otherwise a negative error value @@ -648,10 +649,10 @@ int csr_cs_malware_is_app(csr_cs_malware_h malware, bool *is_app); * @partner * @brief Extracts the package id of an application where a malware is detected from detected malware handle. * @since_tizen 3.0 - * @remarks @a pkg_id must be released using free(). - * @param[in] malware A detected malware handle. + * @remarks @a pkg_id must be released using free(). + * @param[in] malware A detected malware handle * @param[out] pkg_id A pointer of the package id where a malware is detected. - * It is null when a malware was not detected in an application + * It is null when a malware was not detected in an application * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful @@ -675,7 +676,7 @@ int csr_cs_malware_get_pkg_id(csr_cs_malware_h malware, char **pkg_id); * @privilege %http://tizen.org/privilege/antivirus.admin * @remarks Detected malware can be removed or ignored. * @param[in] handle CSR CS context handle returned by csr_cs_context_create() - * @param[in] malware A handle of a detected malwar + * @param[in] malware A handle of a detected malware * @param[in] action An action to be taken * @return #CSR_ERROR_NONE on success, * otherwise a negative error value @@ -705,13 +706,13 @@ int csr_cs_judge_detected_malware(csr_cs_context_h handle, csr_cs_malware_h malw * @remarks @a file_path will be null if it's result of csr_cs_scan_data(). * @param[in] handle CSR CS context handle returned by csr_cs_context_create() * @param[in] file_path A path of a detected malware file - * @param[out] malware A pointer of the detected malware handle. It can be null when there is no malware file + * @param[out] malware A pointer of the detected malware handle. It can be null when no malware file * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful * @retval #CSR_ERROR_INVALID_HANDLE Invalid handle * @retval #CSR_ERROR_OUT_OF_MEMORY Not enough memory - * @retval #CSR_ERROR_INVALID_PARAMETER @a file_path or @a malware is invalid + * @retval #CSR_ERROR_INVALID_PARAMETER @a file_path or @a malware is invalid * @retval #CSR_ERROR_PERMISSION_DENIED No permission to remove * @retval #CSR_ERROR_FILE_DO_NOT_EXIST No malware file * @retval #CSR_ERROR_SOCKET Socket error between client and server @@ -741,14 +742,14 @@ int csr_cs_get_detected_malware(csr_cs_context_h handle, const char *file_path, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful * @retval #CSR_ERROR_INVALID_HANDLE Invalid handle - * @retval #CSR_ERROR_OUT_OF_MEMORY Not enough memory - * @retval #CSR_ERROR_INVALID_PARAMETER@a dir_paths, @a list, or @a count is invalid - * @retval #CSR_ERROR_PERMISSION_DENIEDNo permission to remove - * @retval #CSR_ERROR_FILE_DO_NOT_EXISTNo malware file - * @retval #CSR_ERROR_SOCKETSocket error between client and server - * @retval #CSR_ERROR_SERVERServer has been failed for some reason - * @retval #CSR_ERROR_DBDB transaction error - * @retval #CSR_ERROR_SYSTEM System error + * @retval #CSR_ERROR_OUT_OF_MEMORY Not enough memory + * @retval #CSR_ERROR_INVALID_PARAMETER @a dir_paths, @a list, or @a count is invalid + * @retval #CSR_ERROR_PERMISSION_DENIED No permission to remove + * @retval #CSR_ERROR_FILE_DO_NOT_EXIST No malware file + * @retval #CSR_ERROR_SOCKET Socket error between client and server + * @retval #CSR_ERROR_SERVER Server has been failed for some reason + * @retval #CSR_ERROR_DB DB transaction error + * @retval #CSR_ERROR_SYSTEM System error */ int csr_cs_get_detected_malwares(csr_cs_context_h handle, const char *dir_paths[], size_t count, csr_cs_malware_list_h *list, size_t *list_count); @@ -759,10 +760,10 @@ int csr_cs_get_detected_malwares(csr_cs_context_h handle, const char *dir_paths[ * @since_tizen 3.0 * @privlevel partner * @privilege %http://tizen.org/privilege/antivirus.scan - * @remarks @a malware will be released when @a handle is destroyed. - * @param[in] handle CSR CS context handle returned by csr_cs_context_create(). - * @param[in] file_path A path of a ignored malware file. - * @param[out] malware A pointer of the detected malware handle. It can be null when there is no ignored file + * @remarks @a malware will be released when @a handle is destroyed. + * @param[in] handle CSR CS context handle returned by csr_cs_context_create() + * @param[in] file_path A path of a ignored malware file + * @param[out] malware A pointer of the detected malware handle. It can be null when no ignored file * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful @@ -786,10 +787,10 @@ int csr_cs_get_ignored_malware(csr_cs_context_h handle, const char *file_path, c * @privlevel partner * @privilege %http://tizen.org/privilege/antivirus.scan * @remarks @a list will be released when @a handle is destroyed. - * @param[in] handle CSR CS context handle returned by csr_cs_context_create(). - * @param[in] dir_paths A directory path where ignored malware files exists. + * @param[in] handle CSR CS context handle returned by csr_cs_context_create() + * @param[in] dir_paths A directory path where ignored malware files exists * @param[in] count Count of array element of @a dir_paths - * @param[out] list A pointer of the detected malware list handle. It can be null when there is no ignored file + * @param[out] list A pointer of the detected malware list handle. It can be null when no ignored file * @param[out] list_count Count of ignored malware files which existed in the specified directory * @return #CSR_ERROR_NONE on success, * otherwise a negative error value @@ -812,15 +813,14 @@ int csr_cs_get_ignored_malwares(csr_cs_context_h handle, const char *dir_paths[] * @brief Extracts the detected malware handle from the detected malware list handle. * @since_tizen 3.0 * @remarks @a malware will be released when a context is released using csr_cs_context_destroy(). - * @param[in] list A detected malware list handle returned by csr_cs_get_detected_malwares() or - * csr_cs_get_ignored_malwares() + * @param[in] list A detected malware list handle returned by csr_cs_get_detected_malwares() or csr_cs_get_ignored_malwares() * @param[in] index An index of a target detected malware handle to get * @param[out] malware A pointer of the detected malware handle. It can be null when index is invalid * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful * @retval #CSR_ERROR_INVALID_HANDLE Invalid list - * @retval #CSR_ERROR_INVALID_PARAMETER @a index or @a malware is invalid. + * @retval #CSR_ERROR_INVALID_PARAMETER @a index or @a malware is invalid * @retval #CSR_ERROR_SYSTEM System error */ int csr_cs_malware_list_get_malware(csr_cs_malware_list_h list, size_t index, csr_cs_malware_h *malware); @@ -830,8 +830,10 @@ int csr_cs_malware_list_get_malware(csr_cs_malware_list_h list, size_t index, cs * @} */ + #ifdef __cplusplus } #endif + #endif diff --git a/src/include/csr/csr-engine-manager.h b/src/include/csr/csr-engine-manager.h index b67f7cd..879d05a 100644 --- a/src/include/csr/csr-engine-manager.h +++ b/src/include/csr/csr-engine-manager.h @@ -1,17 +1,17 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License */ /* * @file csr-engine-manager.h @@ -19,16 +19,21 @@ * @version 1.0 * @brief Engine management CAPI header */ + + #ifndef __CSR_ENGINE_MANAGER_H_ #define __CSR_ENGINE_MANAGER_H_ + #include #include + #ifdef __cplusplus extern "C" { #endif + /** * @addtogroup CAPI_CSR_FRAMEWORK_ADMIN_MODULE * @{ @@ -37,7 +42,7 @@ extern "C" { /** * @platform - * @brief Engine handle + * @brief Engine handle. * @since_tizen 3.0 */ typedef struct __csr_engine_h *csr_engine_h; @@ -45,7 +50,7 @@ typedef struct __csr_engine_h *csr_engine_h; /** * @platform - * @brief Enumeration for engine identifier + * @brief Enumeration for engine identifier. * @since_tizen 3.0 */ typedef enum { @@ -56,7 +61,7 @@ typedef enum { /** * @platform - * @brief Enumeration for state of engine activation + * @brief Enumeration for state of engine activation. * @since_tizen 3.0 */ typedef enum { @@ -67,7 +72,7 @@ typedef enum { /** * @platform - * @brief Enumeration for state of engine + * @brief Enumeration for state of engine. * @since_tizen 3.0 */ typedef enum { @@ -103,7 +108,7 @@ int csr_get_current_engine(csr_engine_id_e id, csr_engine_h *engine); * @privlevel platform * @privilege %http://tizen.org/privilege/antivirus.admin * @remarks @a vendor must be released using free(). - * @param[in] engine The engine information handle. + * @param[in] engine The engine information handle * @param[out] vendor A pointer of the engine's vendor name * @return #CSR_ERROR_NONE on success, * otherwise a negative error value @@ -169,7 +174,7 @@ int csr_engine_get_version(csr_engine_h engine, char **version); * @privlevel platform * @privilege %http://tizen.org/privilege/antivirus.admin * @remarks @a version must be released using free(). - * @param[in] engine The engine information handle. + * @param[in] engine The engine information handle * @param[out] version A pointer of the data version. It can be null * @return #CSR_ERROR_NONE on success, * otherwise a negative error value @@ -232,8 +237,7 @@ int csr_engine_get_activated(csr_engine_h engine, csr_activated_e *activated); * @since_tizen 3.0 * @privlevel platform * @privilege %http://tizen.org/privilege/antivirus.admin - * @remarks If an engine is disabled, all major operations would be failed with - * #CSR_ERROR_ENGINE_DISABLED error code. + * @remarks If an engine is disabled, all major operations would be failed with #CSR_ERROR_ENGINE_DISABLED error code. * @param[in] engine The engine information handle * @param[in] state The engine state * @return #CSR_ERROR_NONE on success, @@ -261,7 +265,7 @@ int csr_engine_set_state(csr_engine_h engine, csr_state_e state); * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful * @retval #CSR_ERROR_INVALID_HANDLE Invalid engine information handle - * @retval #CSR_ERROR_INVALID__PARAMETER @a state is invalid + * @retval #CSR_ERROR_INVALID_PARAMETER @a state is invalid * @retval #CSR_ERROR_PERMISSION_DENIED Permission denied * @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error * @retval #CSR_ERROR_SYSTEM System error @@ -274,7 +278,7 @@ int csr_engine_get_state(csr_engine_h engine, csr_state_e *state); * @platform * @brief Releases all system resources associated with a engine information handle. * @since_tizen 3.0 - * @param[in] engine The engine information handle. + * @param[in] engine The engine information handle * @return #CSR_ERROR_NONE on success, * otherwise a negative error value * @retval #CSR_ERROR_NONE Successful @@ -287,8 +291,10 @@ int csr_engine_destroy(csr_engine_h engine); * @} */ + #ifdef __cplusplus } #endif + #endif diff --git a/src/include/csr/csr-error.h b/src/include/csr/csr-error.h index f1c1582..449b746 100644 --- a/src/include/csr/csr-error.h +++ b/src/include/csr/csr-error.h @@ -1,17 +1,17 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License */ /* * @file csr-error.h @@ -19,20 +19,26 @@ * @version 1.0 * @brief Error defining header */ + + #ifndef __CSR_ERROR_H_ #define __CSR_ERROR_H_ + #include + #ifdef __cplusplus extern "C" { #endif + /** * @addtogroup CAPI_CSR_FRAMEWORK_CS_MODULE * @{ */ + /* define it temporary until this code goes into capi-base-common package */ #ifndef TIZEN_ERROR_CSR #define TIZEN_ERROR_CSR -0x01E30000 @@ -74,8 +80,10 @@ typedef enum { * @} */ + #ifdef __cplusplus } #endif + #endif diff --git a/src/include/csr/csr-web-protection-types.h b/src/include/csr/csr-web-protection-types.h index 2fb9ebd..3747e5e 100644 --- a/src/include/csr/csr-web-protection-types.h +++ b/src/include/csr/csr-web-protection-types.h @@ -1,17 +1,17 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License */ /* * @file csr-web-protection-types.h @@ -19,18 +19,23 @@ * @version 1.0 * @brief Type defining header for web protection */ + + #ifndef __CSR_WEB_PROTECTION_TYPES_H_ #define __CSR_WEB_PROTECTION_TYPES_H_ + #ifdef __cplusplus extern "C" { #endif + /** * @addtogroup CAPI_CSR_FRAMEWORK_WP_MODULE * @{ */ + /** * @partner * @brief CSR WP context handle. @@ -66,7 +71,7 @@ typedef enum { typedef enum { CSR_WP_USER_RESPONSE_USER_NOT_ASKED = 0x00, /**< There was no popup for asking the user. */ CSR_WP_USER_RESPONSE_PROCESSING_ALLOWED = 0x01, /**< A user allowed to process the url. */ - CSR_WP_USER_RESPONSE_PROCESSING_DISALLOWED = 0x02 /**< A user disallowed to process the url. */ + CSR_WP_USER_RESPONSE_PROCESSING_DISALLOWED = 0x02 /**< A user disallowed to process the url. */ } csr_wp_user_response_e; @@ -87,8 +92,10 @@ typedef enum { * @} */ + #ifdef __cplusplus } #endif + #endif diff --git a/src/include/csr/csr-web-protection.h b/src/include/csr/csr-web-protection.h index 7947a0b..7fcb8ce 100644 --- a/src/include/csr/csr-web-protection.h +++ b/src/include/csr/csr-web-protection.h @@ -1,17 +1,17 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License */ /* * @file csr-web-protection.h @@ -19,12 +19,16 @@ * @version 1.0 * @brief Web Protection CAPI Header */ + + #ifndef __CSR_WEB_PROTECTION_API_H_ #define __CSR_WEB_PROTECTION_API_H_ + #include #include + #ifdef __cplusplus extern "C" { #endif @@ -77,9 +81,8 @@ int csr_wp_context_destroy(csr_wp_context_h handle); /** * @partner * @brief Sets a popup option for risky URL checked. - * @details If #CSR_WP_ASK_USER_YES is set, a popup will be prompted to a user when a URL - * turns out risky. If #CSR_WP_ASK_USER_NO is set, no popup will be prompted - * even when a URL turns out risky. + * @details If #CSR_WP_ASK_USER_YES is set, a popup will be prompted to a user when a URL turns out risky. + * If #CSR_WP_ASK_USER_NO is set, no popup will be prompted even when a URL turns out risky. * @since_tizen 3.0 * @remarks This option is disabled(#CSR_WP_ASK_USER_NO) as a default. * @param[in] handle CSR WP context handle returned by csr_wp_context_create() @@ -119,8 +122,7 @@ int csr_wp_set_popup_message(csr_wp_context_h handle, const char *message); /** * @partner * @brief Checks URL reputation against the engine vendor's database. - * @details Checks whether accessing the URL is risky or not and returns a result handle - * with the risk level for the URL. + * @details Checks whether accessing the URL is risky or not and returns a result handle with the risk level for the URL. * @since_tizen 3.0 * @privlevel partner * @privilege %http://tizen.org/privilege/antivirus.webprotect @@ -138,8 +140,8 @@ int csr_wp_set_popup_message(csr_wp_context_h handle, const char *message); * @retval #CSR_ERROR_INVALID_PARAMETER @a url or @a result is invalid * @retval #CSR_ERROR_SOCKET Socket error between client and server * @retval #CSR_ERROR_SERVER Server has been failed for some reason - * @retval #CSR_ERROR_USER_RESPONSE_FAILED Getting user response is failed. - * @a result will be allocated on this error + * @retval #CSR_ERROR_USER_RESPONSE_FAILED Getting user response is failed. + * @a result will be allocated on this error * @retval #CSR_ERROR_ENGINE_NOT_EXIST No engine exists * @retval #CSR_ERROR_ENGINE_DISABLED Engine is in disabled state * @retval #CSR_ERROR_ENGINE_NOT_ACTIVATED Engine is not activated @@ -171,8 +173,7 @@ int csr_wp_result_get_risk_level(csr_wp_check_result_h result, csr_wp_risk_level /** * @partner - * @brief Extracts a url of vendor's web site that contains detailed information about - * the risk from the result handle. + * @brief Extracts an url of vendor's web site that contains detailed information about the risk from the result handle. * @since_tizen 3.0 * @remarks @a detailed_url must be released using free(). * @param[in] result A result handle returned by csr_wp_check_url() @@ -212,8 +213,10 @@ int csr_wp_result_get_user_response(csr_wp_check_result_h result, csr_wp_user_re * @} */ + #ifdef __cplusplus } #endif + #endif -- 2.7.4