diff --git a/BasicServicesKit/commonevent/oh_commonevent.h b/BasicServicesKit/commonevent/oh_commonevent.h index 44c6799268b25e0eeb9291a274f824275051d47d..bfe5c12354a01a0e17c2927b0a0cfd0e88a056f0 100644 --- a/BasicServicesKit/commonevent/oh_commonevent.h +++ b/BasicServicesKit/commonevent/oh_commonevent.h @@ -244,7 +244,7 @@ const CommonEvent_Parameters* OH_CommonEvent_GetParametersFromRcvData(const Comm /** * @brief Check whether the parameters contains a key. * - * @param rcvData Indicates the event of callback data. + * @param para Indicates the event of callback data. * @param key Indicates the key of parameter. * @return Returns the result of check, true means it contains. * @since 12 @@ -254,7 +254,7 @@ bool OH_CommonEvent_HasKeyInParameters(const CommonEvent_Parameters* para, const /** * @brief Get int data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param defaultValue Indicates default return value. * @return Returns the int data of the key in the parameters. @@ -265,7 +265,7 @@ int OH_CommonEvent_GetIntFromParameters(const CommonEvent_Parameters* para, cons /** * @brief Get int array data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param array Indicates the int array. * @return Returns the length of the array. @@ -276,7 +276,7 @@ int32_t OH_CommonEvent_GetIntArrayFromParameters(const CommonEvent_Parameters* p /** * @brief Get long data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param defaultValue Indicates default return value. * @return Returns the long data of the key in the parameters. @@ -287,7 +287,7 @@ long OH_CommonEvent_GetLongFromParameters(const CommonEvent_Parameters* para, co /** * @brief Get long array data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param array Indicates the long array. * @return Returns the length of the array. @@ -298,7 +298,7 @@ int32_t OH_CommonEvent_GetLongArrayFromParameters(const CommonEvent_Parameters* /** * @brief Get bool data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param defaultValue Indicates default return value. * @return Returns the bool data of the key in the parameters. @@ -309,7 +309,7 @@ bool OH_CommonEvent_GetBoolFromParameters(const CommonEvent_Parameters* para, co /** * @brief Get bool array data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param array Indicates the bool array. * @return Returns the length of the array. @@ -320,7 +320,7 @@ int32_t OH_CommonEvent_GetBoolArrayFromParameters(const CommonEvent_Parameters* /** * @brief Get char data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param defaultValue Indicates default return value. * @return Returns the char data of the key in the parameters. @@ -331,7 +331,7 @@ char OH_CommonEvent_GetCharFromParameters(const CommonEvent_Parameters* para, co /** * @brief Get char array data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param array Indicates the char array. * @return Returns the length of the array. @@ -342,7 +342,7 @@ int32_t OH_CommonEvent_GetCharArrayFromParameters(const CommonEvent_Parameters* /** * @brief Get double data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param defaultValue Indicates default return value. * @return Returns the double data of the key in the parameters. @@ -354,7 +354,7 @@ double OH_CommonEvent_GetDoubleFromParameters(const CommonEvent_Parameters* para /** * @brief Get double array data from parameters data by key. * - * @param rcvData Indicates the event of parameters data. + * @param para Indicates the event of parameters data. * @param key Indicates the key of parameters data. * @param array Indicates the double array. * @return Returns the length of the array, default is 0. diff --git a/ark_runtime/jsvm/jsvm.h b/ark_runtime/jsvm/jsvm.h index 3f47366b4e021dcd9f8861a3fb9d136619b31d81..b5771f1073e8ac75a1c51184ba76bf1aea1e16ba 100644 --- a/ark_runtime/jsvm/jsvm.h +++ b/ark_runtime/jsvm/jsvm.h @@ -12,10 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#ifndef ARK_RUNTIME_JSVM_JSVM_H -#define ARK_RUNTIME_JSVM_JSVM_H - /** * @addtogroup JSVM * @{ @@ -43,9 +39,15 @@ * @since 11 */ + +#ifndef ARK_RUNTIME_JSVM_JSVM_H +#define ARK_RUNTIME_JSVM_JSVM_H + + // This file needs to be compatible with C compilers. #include // NOLINT(modernize-deprecated-headers) #include // NOLINT(modernize-deprecated-headers) +#include "jsvm_types.h" // Use INT_MAX, this should only be consumed by the pre-processor anyway. #define JSVM_VERSION_EXPERIMENTAL 2147483647 @@ -63,8 +65,6 @@ #endif #endif -#include "jsvm_types.h" - #ifndef JSVM_EXTERN #ifdef _WIN32 /** @@ -102,7 +102,7 @@ EXTERN_C_START /** * @brief Init a JavaScript vm. * - * @param options: The options for initialize the JavaScript VM. + * @param options The options for initialize the JavaScript VM. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } in all cases.\n * @since 11 @@ -112,8 +112,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Init(const JSVM_InitOptions* options); /** * @brief This API create a new VM instance. * - * @param options: The options for create the VM instance. - * @param result: The new VM instance. + * @param options The options for create the VM instance. + * @param result The new VM instance. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -124,7 +124,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateVM(const JSVM_CreateVMOptions* options, /** * @brief Destroys VM instance. * - * @param vm: The VM instance to be Destroyed. + * @param vm The VM instance to be Destroyed. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -134,8 +134,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DestroyVM(JSVM_VM vm); /** * @brief This API open a new VM scope for the VM instance. * - * @param vm: The VM instance to open scope for. - * @param result: The new VM scope. + * @param vm The VM instance to open scope for. + * @param result The new VM scope. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -146,8 +146,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_OpenVMScope(JSVM_VM vm, /** * @brief This function close the VM scope for the VM instance. * - * @param vm: The VM instance to close scope for. - * @param scope: The VM scope to be closed. + * @param vm The VM instance to close scope for. + * @param scope The VM scope to be closed. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -158,10 +158,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CloseVMScope(JSVM_VM vm, /** * @brief This function create a new environment with optional properties for the context of the new environment. * - * @param vm: The VM instance that the env will be created in. - * @param propertyCount: The number of elements in the properties array. - * @param properties: The array of property descriptor. - * @param result: The new environment created. + * @param vm The VM instance that the env will be created in. + * @param propertyCount The number of elements in the properties array. + * @param properties The array of property descriptor. + * @param result The new environment created. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -174,9 +174,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateEnv(JSVM_VM vm, /** * @brief This function create a new environment from the start snapshot of the vm. * - * @param vm: The VM instance that the env will be created in. - * @param index: The index of the environment in the snapshot. - * @param result: The new environment created. + * @param vm The VM instance that the env will be created in. + * @param index The index of the environment in the snapshot. + * @param result The new environment created. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -188,7 +188,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateEnvFromSnapshot(JSVM_VM vm, /** * @brief This function destroys the environment. * - * @param env: The environment to be destroyed. + * @param env The environment to be destroyed. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -198,8 +198,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DestroyEnv(JSVM_Env env); /** * @brief This function open a new environment scope. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param result: The new environment scope. + * @param env The environment that the JSVM-API call is invoked under. + * @param result The new environment scope. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -210,8 +210,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_OpenEnvScope(JSVM_Env env, /** * @brief This function closes the environment scope of the environment. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param scope: The environment scope to be closed. + * @param env The environment that the JSVM-API call is invoked under. + * @param scope The environment scope to be closed. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -222,8 +222,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CloseEnvScope(JSVM_Env env, /** * @brief This function retrieves the VM instance of the given environment. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param result: The VM instance of the environment. + * @param env The environment that the JSVM-API call is invoked under. + * @param result The VM instance of the environment. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } in all cases.\n * @since 12 @@ -234,13 +234,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetVM(JSVM_Env env, /** * @brief This function compiles a string of JavaScript code and returns the compiled script. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param script: A JavaScript string containing the script yo be compiled. - * @param cachedData: Optional code cache data for the script. - * @param cacheDataLength: The length of cachedData array. - * @param eagerCompile: Whether to compile the script eagerly. - * @param cacheRejected: Whether the code cache rejected by compilation. - * @param result: The compiled script. + * @param env The environment that the JSVM-API call is invoked under. + * @param script A JavaScript string containing the script yo be compiled. + * @param cachedData Optional code cache data for the script. + * @param cacheDataLength The length of cachedData array. + * @param eagerCompile Whether to compile the script eagerly. + * @param cacheRejected Whether the code cache rejected by compilation. + * @param result The compiled script. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -257,14 +257,14 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CompileScript(JSVM_Env env, * @brief This function compiles a string of JavaScript code with the source code information * and returns the compiled script. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param script: A JavaScript string containing the script to be compiled. - * @param cachedData: Optional code cache data for the script. - * @param cacheDataLength: The length of cachedData array. - * @param eagerCompile: Whether to compile the script eagerly. - * @param cacheRejected: Whether the code cache rejected by compilation. - * @param origin: The information of source code. - * @param result: The compiled script. + * @param env The environment that the JSVM-API call is invoked under. + * @param script A JavaScript string containing the script to be compiled. + * @param cachedData Optional code cache data for the script. + * @param cacheDataLength The length of cachedData array. + * @param eagerCompile Whether to compile the script eagerly. + * @param cacheRejected Whether the code cache rejected by compilation. + * @param origin The information of source code. + * @param result The compiled script. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -281,10 +281,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CompileScriptWithOrigin(JSVM_Env env, /** * @brief This function creates code cache for the compiled script. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param script: A compiled script to create code cache for. - * @param data: The data of the code cache. - * @param length: The length of the code cache data. + * @param env The environment that the JSVM-API call is invoked under. + * @param script A compiled script to create code cache for. + * @param data The data of the code cache. + * @param length The length of the code cache data. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -302,9 +302,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateCodeCache(JSVM_Env env, * global object. Variable declarations made using let and const will be visible globally, but will not be added * to the global object.The value of this is global within the script. * - * @param env: The environment that the API is invoked under. - * @param script: A JavaScript string containing the script to execute. - * @param result: The value resulting from having executed the script. + * @param env The environment that the API is invoked under. + * @param script A JavaScript string containing the script to execute. + * @param result The value resulting from having executed the script. * @since 11 */ JSVM_EXTERN JSVM_Status OH_JSVM_RunScript(JSVM_Env env, @@ -315,11 +315,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_RunScript(JSVM_Env env, * @brief This API associates data with the currently running JSVM environment. data can later be retrieved * using OH_JSVM_GetInstanceData(). * - * @param env: The environment that the JSVM-API call is invoked under. - * @param data: The data item to make available to bindings of this instance. - * @param finalizeCb: The function to call when the environment is being torn down. The function receives + * @param env The environment that the JSVM-API call is invoked under. + * @param data The data item to make available to bindings of this instance. + * @param finalizeCb The function to call when the environment is being torn down. The function receives * data so that it might free it. JSVM_Finalize provides more details. - * @param finalizeHint: Optional hint to pass to the finalize callback during collection. + * @param finalizeHint Optional hint to pass to the finalize callback during collection. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -333,8 +333,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_SetInstanceData(JSVM_Env env, * @brief This API retrieves data that was previously associated with the currently running JSVM environment * via OH_JSVM_SetInstanceData(). If no data is set, the call will succeed and data will be set to NULL. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param data: The data item that was previously associated with the currently running JSVM environment by + * @param env The environment that the JSVM-API call is invoked under. + * @param data The data item that was previously associated with the currently running JSVM environment by * a call to OH_JSVM_SetInstanceData(). * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -347,8 +347,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetInstanceData(JSVM_Env env, * @brief This API retrieves a JSVM_ExtendedErrorInfo structure with information about the last error that * occurred. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param result: The JSVM_ExtendedErrorInfo structure with more information about the error. + * @param env The environment that the JSVM-API call is invoked under. + * @param result The JSVM_ExtendedErrorInfo structure with more information about the error. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -359,8 +359,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetLastErrorInfo(JSVM_Env env, /** * @brief This API throws the JavaScript value provided. * - * @param env: The environment that the API is invoked under. - * @param error: The JavaScript value to be thrown. + * @param env The environment that the API is invoked under. + * @param error The JavaScript value to be thrown. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -371,9 +371,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Throw(JSVM_Env env, /** * @brief This API throws a JavaScript Error with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional error code to be set on the error. - * @param msg: C string representing the text to be associated with the error. + * @param env The environment that the API is invoked under. + * @param code Optional error code to be set on the error. + * @param msg C string representing the text to be associated with the error. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -385,9 +385,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ThrowError(JSVM_Env env, /** * @brief This API throws a JavaScript TypeError with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional error code to be set on the error. - * @param msg: C string representing the text to be associated with the error. + * @param env The environment that the API is invoked under. + * @param code Optional error code to be set on the error. + * @param msg C string representing the text to be associated with the error. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -399,9 +399,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ThrowTypeError(JSVM_Env env, /** * @brief This API throws a JavaScript RangeError with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional error code to be set on the error. - * @param msg: C string representing the text to be associated with the error. + * @param env The environment that the API is invoked under. + * @param code Optional error code to be set on the error. + * @param msg C string representing the text to be associated with the error. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -413,9 +413,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ThrowRangeError(JSVM_Env env, /** * @brief This API throws a JavaScript SyntaxError with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional error code to be set on the error. - * @param msg: C string representing the text to be associated with the error. + * @param env The environment that the API is invoked under. + * @param code Optional error code to be set on the error. + * @param msg C string representing the text to be associated with the error. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -427,9 +427,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ThrowSyntaxError(JSVM_Env env, /** * @brief This API queries a JSVM_Value to check if it represents an error object. * - * @param env: The environment that the API is invoked under. - * @param value: The JSVM_Value to be checked. - * @param result: Boolean value that is set to true if JSVM_Value represents an error, + * @param env The environment that the API is invoked under. + * @param value The JSVM_Value to be checked. + * @param result Boolean value that is set to true if JSVM_Value represents an error, * false otherwise. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -442,10 +442,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsError(JSVM_Env env, /** * @brief This API returns a JavaScript Error with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional JSVM_Value with the string for the error code to be associated with the error. - * @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Error. - * @param result: JSVM_Value representing the error created. + * @param env The environment that the API is invoked under. + * @param code Optional JSVM_Value with the string for the error code to be associated with the error. + * @param msg JSVM_Value that references a JavaScript string to be used as the message for the Error. + * @param result JSVM_Value representing the error created. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -458,10 +458,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateError(JSVM_Env env, /** * @brief This API returns a JavaScript TypeError with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional JSVM_Value with the string for the error code to be associated with the error. - * @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Error. - * @param result: JSVM_Value representing the error created. + * @param env The environment that the API is invoked under. + * @param code Optional JSVM_Value with the string for the error code to be associated with the error. + * @param msg JSVM_Value that references a JavaScript string to be used as the message for the Error. + * @param result JSVM_Value representing the error created. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -474,10 +474,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateTypeError(JSVM_Env env, /** * @brief This API returns a JavaScript RangeError with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional JSVM_Value with the string for the error code to be associated with the error. - * @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Error. - * @param result: JSVM_Value representing the error created. + * @param env The environment that the API is invoked under. + * @param code Optional JSVM_Value with the string for the error code to be associated with the error. + * @param msg JSVM_Value that references a JavaScript string to be used as the message for the Error. + * @param result JSVM_Value representing the error created. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -490,10 +490,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateRangeError(JSVM_Env env, /** * @brief This API returns a JavaScript SyntaxError with the text provided. * - * @param env: The environment that the API is invoked under. - * @param code: Optional JSVM_Value with the string for the error code to be associated with the error. - * @param msg: JSVM_Value that references a JavaScript string to be used as the message for the Error. - * @param result: JSVM_Value representing the error created. + * @param env The environment that the API is invoked under. + * @param code Optional JSVM_Value with the string for the error code to be associated with the error. + * @param msg JSVM_Value that references a JavaScript string to be used as the message for the Error. + * @param result JSVM_Value representing the error created. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -506,8 +506,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateSyntaxError(JSVM_Env env, /** * @brief This API returns a JavaScript exception if one is pending, NULL otherwise. * - * @param env: The environment that the API is invoked under. - * @param result: The exception if one is pending, NULL otherwise. + * @param env The environment that the API is invoked under. + * @param result The exception if one is pending, NULL otherwise. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -518,8 +518,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetAndClearLastException(JSVM_Env env, /** * @brief This API returns true if an exception is pending, false otherwise. * - * @param env: The environment that the API is invoked under. - * @param result: Boolean value that is set to true if an exception is pending. + * @param env The environment that the API is invoked under. + * @param result Boolean value that is set to true if an exception is pending. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -530,8 +530,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsExceptionPending(JSVM_Env env, /** * @brief This API opens a new scope. * - * @param env: The environment that the API is invoked under. - * @param result: JSVM_Value representing the new scope. + * @param env The environment that the API is invoked under. + * @param result JSVM_Value representing the new scope. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -543,8 +543,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_OpenHandleScope(JSVM_Env env, * @brief This API closes the scope passed in. Scopes must be closed in the reverse * order from which they were created. * - * @param env: The environment that the API is invoked under. - * @param scope: JSVM_Value representing the scope to be closed. + * @param env The environment that the API is invoked under. + * @param scope JSVM_Value representing the scope to be closed. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -555,8 +555,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CloseHandleScope(JSVM_Env env, /** * @brief This API opens a new scope from which one object can be promoted to the outer scope. * - * @param env: The environment that the API is invoked under. - * @param result: JSVM_Value representing the new scope. + * @param env The environment that the API is invoked under. + * @param result JSVM_Value representing the new scope. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -568,8 +568,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_OpenEscapableHandleScope(JSVM_Env env, * @brief This API closes the scope passed in. Scopes must be closed in the reverse order * from which they were created. * - * @param env: The environment that the API is invoked under. - * @param scope: JSVM_Value representing the scope to be closed. + * @param env The environment that the API is invoked under. + * @param scope JSVM_Value representing the scope to be closed. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -582,10 +582,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CloseEscapableHandleScope(JSVM_Env env, * of the outer scope. It can only be called once per scope. If it is called more than once an error * will be returned. * - * @param env: The environment that the API is invoked under. - * @param scope: JSVM_Value representing the current scope. - * @param escapee: JSVM_Value representing the JavaScript Object to be escaped. - * @param result: JSVM_Value representing the handle to the escaped Object in the outer scope. + * @param env The environment that the API is invoked under. + * @param scope JSVM_Value representing the current scope. + * @param escapee JSVM_Value representing the JavaScript Object to be escaped. + * @param result JSVM_Value representing the handle to the escaped Object in the outer scope. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -598,10 +598,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_EscapeHandle(JSVM_Env env, /** * @brief This API creates a new reference with the specified reference count to the value passed in. * - * @param env: The environment that the API is invoked under. - * @param value: The JSVM_Value for which a reference is being created. - * @param initialRefcount: Initial reference count for the new reference. - * @param result: JSVM_Ref pointing to the new reference. + * @param env The environment that the API is invoked under. + * @param value The JSVM_Value for which a reference is being created. + * @param initialRefcount Initial reference count for the new reference. + * @param result JSVM_Ref pointing to the new reference. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -614,8 +614,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateReference(JSVM_Env env, /** * @brief his API deletes the reference passed in. * - * @param env: The environment that the API is invoked under. - * @param ref: JSVM_Ref to be deleted. + * @param env The environment that the API is invoked under. + * @param ref JSVM_Ref to be deleted. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -627,9 +627,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DeleteReference(JSVM_Env env, * @brief his API increments the reference count for the reference passed in and * returns the resulting reference count. * - * @param env: The environment that the API is invoked under. - * @param ref: JSVM_Ref for which the reference count will be incremented. - * @param result: The new reference count. + * @param env The environment that the API is invoked under. + * @param ref JSVM_Ref for which the reference count will be incremented. + * @param result The new reference count. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -642,9 +642,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ReferenceRef(JSVM_Env env, * @brief This API decrements the reference count for the reference passed in and * returns the resulting reference count. * - * @param env: The environment that the API is invoked under. - * @param ref: JSVM_Ref for which the reference count will be decremented. - * @param result: The new reference count. + * @param env The environment that the API is invoked under. + * @param ref JSVM_Ref for which the reference count will be decremented. + * @param result The new reference count. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -657,9 +657,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ReferenceUnref(JSVM_Env env, * @brief If still valid, this API returns the JSVM_Value representing the * JavaScript value associated with the JSVM_Ref. Otherwise, result will be NULL. * - * @param env: The environment that the API is invoked under. - * @param ref: The JSVM_Ref for which the corresponding value is being requested. - * @param result: The JSVM_Value referenced by the JSVM_Ref. + * @param env The environment that the API is invoked under. + * @param ref The JSVM_Ref for which the corresponding value is being requested. + * @param result The JSVM_Value referenced by the JSVM_Ref. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -671,8 +671,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetReferenceValue(JSVM_Env env, /** * @brief This API returns a JSVM-API value corresponding to a JavaScript Array type. * - * @param env: The environment that the API is invoked under. - * @param result: A JSVM_Value representing a JavaScript Array. + * @param env The environment that the API is invoked under. + * @param result A JSVM_Value representing a JavaScript Array. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -686,9 +686,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateArray(JSVM_Env env, * is set to the passed-in length parameter. However, the underlying buffer is not guaranteed to be pre-allocated * by the VM when the array is created. That behavior is left to the underlying VM implementation. * - * @param env: The environment that the API is invoked under. - * @param length: The initial length of the Array. - * @param result: A JSVM_Value representing a JavaScript Array. + * @param env The environment that the API is invoked under. + * @param length The initial length of the Array. + * @param result A JSVM_Value representing a JavaScript Array. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -705,10 +705,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateArrayWithLength(JSVM_Env env, * directly manipulate the buffer. This buffer can only be written to directly from native code. To write to this * buffer from JavaScript, a typed array or DataView object would need to be created. * - * @param env: The environment that the API is invoked under. - * @param byteLength: The length in bytes of the array buffer to create. - * @param data: Pointer to the underlying byte buffer of the ArrayBuffer.data can optionally be ignored by passing NULL. - * @param result: A JSVM_Value representing a JavaScript Array. + * @param env The environment that the API is invoked under. + * @param byteLength The length in bytes of the array buffer to create. + * @param data Pointer to the underlying byte buffer of the ArrayBuffer.data can optionally be ignored by passing NULL. + * @param result A JSVM_Value representing a JavaScript Array. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -721,9 +721,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateArraybuffer(JSVM_Env env, /** * @brief This API allocate the memory of array buffer backing store. * - * @param byteLength: size of backing store memory. - * @param initialized: initialization status of the backing store memory. - * @param data: pointer that recieve the backing store memory pointer. + * @param byteLength size of backing store memory. + * @param initialized initialization status of the backing store memory. + * @param data pointer that recieve the backing store memory pointer. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if allocation succeed.\n * Returns {@link JSVM_INVALID_ARG } if data is null pointer.\n @@ -737,7 +737,7 @@ JSVM_Status JSVM_CDECL OH_JSVM_AllocateArrayBufferBackingStoreData(size_t byteLe /** * @brief This API release the memory of an array buffer backing store. * - * @param data: pointer to the backing store memory. + * @param data pointer to the backing store memory. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if run succeed.\n * Returns {@link JSVM_INVALID_ARG } if data is null pointer.\n @@ -748,12 +748,12 @@ JSVM_Status JSVM_CDECL OH_JSVM_FreeArrayBufferBackingStoreData(void *data); /** * @brief This API create an array buffer using the backing store data. * - * @param env: The environment that the API is invoked under. - * @param data: pointer to the backing store memory. - * @param backingStoreSize: size of backing store memory. - * @param offset: start position of the array buffer in the backing store memory. - * @param arrayBufferSize: size of the array buffer. - * @param result: pointer that recieve the array buffer. + * @param env The environment that the API is invoked under. + * @param data pointer to the backing store memory. + * @param backingStoreSize size of backing store memory. + * @param offset start position of the array buffer in the backing store memory. + * @param arrayBufferSize size of the array buffer. + * @param result pointer that recieve the array buffer. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if creation succeed.\n * Returns {@link JSVM_INVALID_ARG } if any of the following condition reached:\n @@ -773,9 +773,9 @@ JSVM_Status JSVM_CDECL OH_JSVM_CreateArrayBufferFromBackingStoreData(JSVM_Env en * @brief This API does not observe leap seconds; they are ignored, as ECMAScript aligns with POSIX time specification. * This API allocates a JavaScript Date object. * - * @param env: The environment that the API is invoked under. - * @param time: ECMAScript time value in milliseconds since 01 January, 1970 UTC. - * @param result: A JSVM_Value representing a JavaScript Date. + * @param env The environment that the API is invoked under. + * @param time ECMAScript time value in milliseconds since 01 January, 1970 UTC. + * @param result A JSVM_Value representing a JavaScript Date. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -789,14 +789,14 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateDate(JSVM_Env env, * data through JavaScript code, so it can be retrieved later by native code using OH_JSVM_GetValueExternal. * The API adds a JSVM_Finalize callback which will be called when the JavaScript object just created has been garbage * collected.The created value is not an object, and therefore does not support additional properties. It is considered - * a distinct value type: calling OH_JSVM_Typeof() with an external value yields JSVM_EXTERNAL. + * a distinct value type calling OH_JSVM_Typeof() with an external value yields JSVM_EXTERNAL. * - * @param env: The environment that the API is invoked under. - * @param data: Raw pointer to the external data. - * @param finalizeCb: Optional callback to call when the external value is being collected. JSVM_Finalize provides + * @param env The environment that the API is invoked under. + * @param data Raw pointer to the external data. + * @param finalizeCb Optional callback to call when the external value is being collected. JSVM_Finalize provides * more details. - * @param finalizeHint: Optional hint to pass to the finalize callback during collection. - * @param result: A JSVM_Value representing an external value. + * @param finalizeHint Optional hint to pass to the finalize callback during collection. + * @param result A JSVM_Value representing an external value. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -810,8 +810,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateExternal(JSVM_Env env, /** * @brief This API allocates a default JavaScript Object. It is the equivalent of doing new Object() in JavaScript. * - * @param env: The environment that the API is invoked under. - * @param result: A JSVM_Value representing a JavaScript Object. + * @param env The environment that the API is invoked under. + * @param result A JSVM_Value representing a JavaScript Object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -822,10 +822,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateObject(JSVM_Env env, /** * @brief This API creates a JavaScript symbol value from a UTF8-encoded C string. * - * @param env: The environment that the API is invoked under. - * @param description: Optional JSVM_Value which refers to a JavaScript string to be set as the description + * @param env The environment that the API is invoked under. + * @param description Optional JSVM_Value which refers to a JavaScript string to be set as the description * for the symbol. - * @param result: A JSVM_Value representing a JavaScript symbol. + * @param result A JSVM_Value representing a JavaScript symbol. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -838,10 +838,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateSymbol(JSVM_Env env, * @brief This API searches in the global registry for an existing symbol with the given description. * If the symbol already exists it will be returned, otherwise a new symbol will be created in the registry. * - * @param env: The environment that the API is invoked under. - * @param utf8description: UTF-8 C string representing the text to be used as the description for the symbol. - * @param length: The length of the description string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated. - * @param result: A JSVM_Value representing a JavaScript symbol. + * @param env The environment that the API is invoked under. + * @param utf8description UTF-8 C string representing the text to be used as the description for the symbol. + * @param length The length of the description string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated. + * @param result A JSVM_Value representing a JavaScript symbol. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -857,12 +857,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_SymbolFor(JSVM_Env env, * same underlying binary scalar datatype.It's required that (length * size_of_element) + byte_offset should * be <= the size in bytes of the array passed in. If not, a RangeError exception is raised. * - * @param env: The environment that the API is invoked under. - * @param type: Scalar datatype of the elements within the TypedArray. - * @param length: Number of elements in the TypedArray. - * @param arraybuffer: ArrayBuffer underlying the typed array. - * @param byteOffset: The byte offset within the ArrayBuffer from which to start projecting the TypedArray. - * @param result: A JSVM_Value representing a JavaScript TypedArray + * @param env The environment that the API is invoked under. + * @param type Scalar datatype of the elements within the TypedArray. + * @param length Number of elements in the TypedArray. + * @param arraybuffer ArrayBuffer underlying the typed array. + * @param byteOffset The byte offset within the ArrayBuffer from which to start projecting the TypedArray. + * @param result A JSVM_Value representing a JavaScript TypedArray * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -881,11 +881,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateTypedarray(JSVM_Env env, * less than or equal to the size in bytes of the array passed in. If not, a RangeError exception * is raised. * - * @param env: The environment that the API is invoked under. - * @param length: Number of elements in the DataView. - * @param arraybuffer: ArrayBuffer underlying the DataView. - * @param byteOffset: The byte offset within the ArrayBuffer from which to start projecting the DataView. - * @param result:A JSVM_Value representing a JavaScript DataView. + * @param env The environment that the API is invoked under. + * @param length Number of elements in the DataView. + * @param arraybuffer ArrayBuffer underlying the DataView. + * @param byteOffset The byte offset within the ArrayBuffer from which to start projecting the DataView. + * @param result A JSVM_Value representing a JavaScript DataView. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -899,9 +899,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateDataview(JSVM_Env env, /** * @brief This API is used to convert from the C int32_t type to the JavaScript number type. * - * @param env: The environment that the API is invoked under. - * @param value: Integer value to be represented in JavaScript. - * @param result: A JSVM_Value representing a JavaScript number. + * @param env The environment that the API is invoked under. + * @param value Integer value to be represented in JavaScript. + * @param result A JSVM_Value representing a JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -913,9 +913,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateInt32(JSVM_Env env, /** * @brief This API is used to convert from the C uint32_t type to the JavaScript number type. * - * @param env: The environment that the API is invoked under. - * @param value: Unsigned integer value to be represented in JavaScript. - * @param result: A JSVM_Value representing a JavaScript number. + * @param env The environment that the API is invoked under. + * @param value Unsigned integer value to be represented in JavaScript. + * @param result A JSVM_Value representing a JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -927,9 +927,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateUint32(JSVM_Env env, /** * @brief This API is used to convert from the C int64_t type to the JavaScript number type. * - * @param env: The environment that the API is invoked under. - * @param value: Integer value to be represented in JavaScript. - * @param result: A JSVM_Value representing a JavaScript number. + * @param env The environment that the API is invoked under. + * @param value Integer value to be represented in JavaScript. + * @param result A JSVM_Value representing a JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -941,9 +941,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateInt64(JSVM_Env env, /** * @brief This API is used to convert from the C double type to the JavaScript number type. * - * @param env: The environment that the API is invoked under. - * @param value: Double-precision value to be represented in JavaScript. - * @param result: A JSVM_Value representing a JavaScript number. + * @param env The environment that the API is invoked under. + * @param value Double-precision value to be represented in JavaScript. + * @param result A JSVM_Value representing a JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -955,9 +955,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateDouble(JSVM_Env env, /** * @brief This API converts the C int64_t type to the JavaScript BigInt type. * - * @param env: The environment that the API is invoked under. - * @param value: Integer value to be represented in JavaScript. - * @param result: A JSVM_Value representing a JavaScript BigInt. + * @param env The environment that the API is invoked under. + * @param value Integer value to be represented in JavaScript. + * @param result A JSVM_Value representing a JavaScript BigInt. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -969,9 +969,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateBigintInt64(JSVM_Env env, /** * @brief This API converts the C uint64_t type to the JavaScript BigInt type. * - * @param env: The environment that the API is invoked under. - * @param value: Unsigned integer value to be represented in JavaScript. - * @param result: A JSVM_Value representing a JavaScript BigInt. + * @param env The environment that the API is invoked under. + * @param value Unsigned integer value to be represented in JavaScript. + * @param result A JSVM_Value representing a JavaScript BigInt. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -982,13 +982,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateBigintUint64(JSVM_Env env, /** * @brief This API converts an array of unsigned 64-bit words into a single BigInt value. - * The resulting BigInt is calculated as: (–1)sign_bit (words[0] × (264)0 + words[1] × (264)1 + …) + * The resulting BigInt is calculated as (–1)sign_bit (words[0] × (264)0 + words[1] × (264)1 + …) * - * @param env: The environment that the API is invoked under. - * @param signBit: Determines if the resulting BigInt will be positive or negative. - * @param wordCount: The length of the words array. - * @param words: An array of uint64_t little-endian 64-bit words. - * @param result: A JSVM_Value representing a JavaScript BigInt. + * @param env The environment that the API is invoked under. + * @param signBit Determines if the resulting BigInt will be positive or negative. + * @param wordCount The length of the words array. + * @param words An array of uint64_t little-endian 64-bit words. + * @param result A JSVM_Value representing a JavaScript BigInt. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1003,10 +1003,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateBigintWords(JSVM_Env env, * @brief This API creates a JavaScript string value from an ISO-8859-1-encoded C * string. The native string is copied. * - * @param env: The environment that the API is invoked under. - * @param str: Character buffer representing an ISO-8859-1-encoded string. - * @param length: The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated. - * @param result: A JSVM_Value representing a JavaScript string. + * @param env The environment that the API is invoked under. + * @param str Character buffer representing an ISO-8859-1-encoded string. + * @param length The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated. + * @param result A JSVM_Value representing a JavaScript string. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1020,11 +1020,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateStringLatin1(JSVM_Env env, * @brief This API creates a JavaScript string value from a UTF16-LE-encoded C * string. The native string is copied. * - * @param env: The environment that the API is invoked under. - * @param str: Character buffer representing a UTF16-LE-encoded string. - * @param length: The length of the string in two-byte code units, or JSVM_AUTO_LENGTH + * @param env The environment that the API is invoked under. + * @param str Character buffer representing a UTF16-LE-encoded string. + * @param length The length of the string in two-byte code units, or JSVM_AUTO_LENGTH * if it is null-terminated. - * @param result: A JSVM_Value representing a JavaScript string. + * @param result A JSVM_Value representing a JavaScript string. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1038,10 +1038,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateStringUtf16(JSVM_Env env, * @brief This API creates a JavaScript string value from a UTF8-encoded C * string. The native string is copied. * - * @param env: The environment that the API is invoked under. - * @param str: Character buffer representing a UTF8-encoded string. - * @param length: The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated. - * @param result: A JSVM_Value representing a JavaScript string. + * @param env The environment that the API is invoked under. + * @param str Character buffer representing a UTF8-encoded string. + * @param length The length of the string in bytes, or JSVM_AUTO_LENGTH if it is null-terminated. + * @param result A JSVM_Value representing a JavaScript string. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1054,9 +1054,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateStringUtf8(JSVM_Env env, /** * @brief This API returns the length of an array. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing the JavaScript Array whose length is being queried. - * @param result: uint32 representing length of the array. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing the JavaScript Array whose length is being queried. + * @param result uint32 representing length of the array. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1068,11 +1068,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetArrayLength(JSVM_Env env, /** * @brief This API is used to retrieve the underlying data buffer of an ArrayBuffer and its length. * - * @param env: The environment that the API is invoked under. - * @param arraybuffer: JSVM_Value representing the ArrayBuffer being queried. - * @param data: The underlying data buffer of the ArrayBuffer. If byte_length is 0, this may be NULL + * @param env The environment that the API is invoked under. + * @param arraybuffer JSVM_Value representing the ArrayBuffer being queried. + * @param data The underlying data buffer of the ArrayBuffer. If byte_length is 0, this may be NULL * or any other pointer value. - * @param byteLength: Length in bytes of the underlying data buffer. + * @param byteLength Length in bytes of the underlying data buffer. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1085,10 +1085,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetArraybufferInfo(JSVM_Env env, /** * @brief This API returns the length of an array. * - * @param env: The environment that the API is invoked under. - * @param object: JSVM_Value representing JavaScript Object whose prototype to return. This returns + * @param env The environment that the API is invoked under. + * @param object JSVM_Value representing JavaScript Object whose prototype to return. This returns * the equivalent of Object.getPrototypeOf (which is not the same as the function's prototype property). - * @param result: JSVM_Value representing prototype of the given object. + * @param result JSVM_Value representing prototype of the given object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1100,15 +1100,15 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetPrototype(JSVM_Env env, /** * @brief This API returns various properties of a typed array. * - * @param env: The environment that the API is invoked under. - * @param typedarray: JSVM_Value representing the TypedArray whose properties to query. - * @param type: Scalar datatype of the elements within the TypedArray. - * @param length: The number of elements in the TypedArray. - * @param data: The data buffer underlying the TypedArray adjusted by the byte_offset value so that it + * @param env The environment that the API is invoked under. + * @param typedarray JSVM_Value representing the TypedArray whose properties to query. + * @param type Scalar datatype of the elements within the TypedArray. + * @param length The number of elements in the TypedArray. + * @param data The data buffer underlying the TypedArray adjusted by the byte_offset value so that it * points to the first element in the TypedArray. If the length of the array is 0, this may be NULL or * any other pointer value. - * @param arraybuffer: The ArrayBuffer underlying the TypedArray. - * @param byteOffset: The byte offset within the underlying native array at which the first element of + * @param arraybuffer The ArrayBuffer underlying the TypedArray. + * @param byteOffset The byte offset within the underlying native array at which the first element of * the arrays is located. The value for the data parameter has already been adjusted so that data points * to the first element in the array. Therefore, the first byte of the native array would be at data - byte_offset. * @return Returns JSVM funtions result code. @@ -1127,13 +1127,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetTypedarrayInfo(JSVM_Env env, * @brief Any of the out parameters may be NULL if that property is unneeded. * This API returns various properties of a DataView. * - * @param env: The environment that the API is invoked under. - * @param dataview: JSVM_Value representing the DataView whose properties to query. - * @param bytelength: Number of bytes in the DataView. - * @param data: The data buffer underlying the DataView. + * @param env The environment that the API is invoked under. + * @param dataview JSVM_Value representing the DataView whose properties to query. + * @param bytelength Number of bytes in the DataView. + * @param data The data buffer underlying the DataView. * If byte_length is 0, this may be NULL or any other pointer value. - * @param arraybuffer: ArrayBuffer underlying the DataView. - * @param byteOffset: The byte offset within the data buffer from which to start projecting the DataView. + * @param arraybuffer ArrayBuffer underlying the DataView. + * @param byteOffset The byte offset within the data buffer from which to start projecting the DataView. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1150,9 +1150,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetDataviewInfo(JSVM_Env env, * passed in it returns JSVM_date_expected.This API returns the C double * primitive of time value for the given JavaScript Date. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing a JavaScript Date. - * @param result: Time value as a double represented as milliseconds + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing a JavaScript Date. + * @param result Time value as a double represented as milliseconds * since midnight at the beginning of 01 January, 1970 UTC. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -1166,9 +1166,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetDateValue(JSVM_Env env, /** * @brief This API returns the C boolean primitive equivalent of the given JavaScript Boolean. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript Boolean. - * @param result: C boolean primitive equivalent of the given JavaScript Boolean. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript Boolean. + * @param result C boolean primitive equivalent of the given JavaScript Boolean. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_BOOLEAN_EXPECTED }If a non-boolean JSVM_Value is passed in it.\n @@ -1181,9 +1181,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueBool(JSVM_Env env, /** * @brief This API returns the C double primitive equivalent of the given JavaScript number. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript number. - * @param result: C double primitive equivalent of the given JavaScript number. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript number. + * @param result C double primitive equivalent of the given JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_NUMBER_EXPECTED } If a non-number JSVM_Value is passed in.\n @@ -1197,10 +1197,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueDouble(JSVM_Env env, * @brief This API returns the C int64_t primitive equivalent of the given JavaScript BigInt. * If needed it will truncate the value, setting lossless to false. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript BigInt. - * @param result: C int64_t primitive equivalent of the given JavaScript BigInt. - * @param lossless: Indicates whether the BigInt value was converted losslessly. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript BigInt. + * @param result C int64_t primitive equivalent of the given JavaScript BigInt. + * @param lossless Indicates whether the BigInt value was converted losslessly. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_BIGINT_EXPECTED } If a non-BigInt is passed in it.\n @@ -1215,10 +1215,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueBigintInt64(JSVM_Env env, * @brief This API returns the C uint64_t primitive equivalent of the given JavaScript BigInt. * If needed it will truncate the value, setting lossless to false. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript BigInt. - * @param result: C uint64_t primitive equivalent of the given JavaScript BigInt. - * @param lossless: Indicates whether the BigInt value was converted losslessly. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript BigInt. + * @param result C uint64_t primitive equivalent of the given JavaScript BigInt. + * @param lossless Indicates whether the BigInt value was converted losslessly. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_BIGINT_EXPECTED } If a non-BigInt is passed in it.\n @@ -1233,12 +1233,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueBigintUint64(JSVM_Env env, * @brief This API converts a single BigInt value into a sign bit, 64-bit little-endian array, and the number * of elements in the array. signBit and words may be both set to NULL, in order to get only wordCount. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript BigInt. - * @param signBit: Integer representing if the JavaScript BigInt is positive or negative. - * @param wordCount: Must be initialized to the length of the words array. Upon return, it will be set to + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript BigInt. + * @param signBit Integer representing if the JavaScript BigInt is positive or negative. + * @param wordCount Must be initialized to the length of the words array. Upon return, it will be set to * the actual number of words that would be needed to store this BigInt. - * @param words: Pointer to a pre-allocated 64-bit word array. + * @param words Pointer to a pre-allocated 64-bit word array. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1252,9 +1252,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueBigintWords(JSVM_Env env, /** * @brief This API retrieves the external data pointer that was previously passed to OH_JSVM_CreateExternal(). * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript external value. - * @param result: Pointer to the data wrapped by the JavaScript external value. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript external value. + * @param result Pointer to the data wrapped by the JavaScript external value. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_INVALID_ARG } If a non-external JSVM_Value is passed in it.\n @@ -1267,9 +1267,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueExternal(JSVM_Env env, /** * @brief This API returns the C int32 primitive equivalent of the given JavaScript number. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript number. - * @param result: C int32 primitive equivalent of the given JavaScript number. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript number. + * @param result C int32 primitive equivalent of the given JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_NUMBER_EXPECTED } If a non-number JSVM_Value is passed in.\n @@ -1282,9 +1282,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueInt32(JSVM_Env env, /** * @brief This API returns the C int64 primitive equivalent of the given JavaScript number. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript number. - * @param result: C int64 primitive equivalent of the given JavaScript number. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript number. + * @param result C int64 primitive equivalent of the given JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_NUMBER_EXPECTED } If a non-number JSVM_Value is passed in.\n @@ -1297,13 +1297,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueInt64(JSVM_Env env, /** * @brief This API returns the ISO-8859-1-encoded string corresponding the value passed in. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript string. - * @param buf: Buffer to write the ISO-8859-1-encoded string into. If NULL is passed in, the + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript string. + * @param buf Buffer to write the ISO-8859-1-encoded string into. If NULL is passed in, the * length of the string in bytes and excluding the null terminator is returned in result. - * @param bufsize: Size of the destination buffer. When this value is insufficient, the returned string + * @param bufsize Size of the destination buffer. When this value is insufficient, the returned string * is truncated and null-terminated. - * @param result: Number of bytes copied into the buffer, excluding the null terminator. + * @param result Number of bytes copied into the buffer, excluding the null terminator. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_NUMBER_EXPECTED } If a non-number JSVM_Value is passed in.\n @@ -1318,13 +1318,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueStringLatin1(JSVM_Env env, /** * @brief This API returns the UTF8-encoded string corresponding the value passed in. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript string. - * @param buf: Buffer to write the UTF8-encoded string into. If NULL is passed in, the length + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript string. + * @param buf Buffer to write the UTF8-encoded string into. If NULL is passed in, the length * of the string in bytes and excluding the null terminator is returned in result. - * @param bufsize: Size of the destination buffer. When this value is insufficient, the returned + * @param bufsize Size of the destination buffer. When this value is insufficient, the returned * string is truncated and null-terminated. - * @param result: Number of bytes copied into the buffer, excluding the null terminator. + * @param result Number of bytes copied into the buffer, excluding the null terminator. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_NUMBER_EXPECTED } If a non-number JSVM_Value is passed in.\n @@ -1339,13 +1339,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueStringUtf8(JSVM_Env env, /** * @brief This API returns the UTF16-encoded string corresponding the value passed in. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript string. - * @param buf: Buffer to write the UTF16-LE-encoded string into. If NULL is passed in, + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript string. + * @param buf Buffer to write the UTF16-LE-encoded string into. If NULL is passed in, * the length of the string in 2-byte code units and excluding the null terminator is returned. - * @param bufsize: Size of the destination buffer. When this value is insufficient, + * @param bufsize Size of the destination buffer. When this value is insufficient, * the returned string is truncated and null-terminated. - * @param result: Number of 2-byte code units copied into the buffer, excluding the null terminator. + * @param result Number of 2-byte code units copied into the buffer, excluding the null terminator. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_NUMBER_EXPECTED } If a non-number JSVM_Value is passed in.\n @@ -1360,9 +1360,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueStringUtf16(JSVM_Env env, /** * @brief This API returns the C primitive equivalent of the given JSVM_Value as a uint32_t. * - * @param env: The environment that the API is invoked under. - * @param value: JSVM_Value representing JavaScript number. - * @param result: C primitive equivalent of the given JSVM_Value as a uint32_t. + * @param env The environment that the API is invoked under. + * @param value JSVM_Value representing JavaScript number. + * @param result C primitive equivalent of the given JSVM_Value as a uint32_t. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_NUMBER_EXPECTED } If a non-number JSVM_Value is passed in it.\n @@ -1375,9 +1375,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetValueUint32(JSVM_Env env, /** * @brief This API is used to return the JavaScript singleton object that is used to represent the given boolean value. * - * @param env: The environment that the API is invoked under. - * @param value: The value of the boolean to retrieve. - * @param result: JSVM_Value representing JavaScript Boolean singleton to retrieve. + * @param env The environment that the API is invoked under. + * @param value The value of the boolean to retrieve. + * @param result JSVM_Value representing JavaScript Boolean singleton to retrieve. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1389,8 +1389,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetBoolean(JSVM_Env env, /** * @brief This API returns the global object. * - * @param env: The environment that the API is invoked under. - * @param result: JSVM_Value representing JavaScript global object. + * @param env The environment that the API is invoked under. + * @param result JSVM_Value representing JavaScript global object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1401,8 +1401,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetGlobal(JSVM_Env env, /** * @brief This API returns the null object. * - * @param env: The environment that the API is invoked under. - * @param result: JSVM_Value representing JavaScript null object. + * @param env The environment that the API is invoked under. + * @param result JSVM_Value representing JavaScript null object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1413,8 +1413,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetNull(JSVM_Env env, /** * @brief This API returns the Undefined object. * - * @param env: The environment that the API is invoked under. - * @param result: JSVM_Value representing JavaScript Undefined value. + * @param env The environment that the API is invoked under. + * @param result JSVM_Value representing JavaScript Undefined value. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1425,9 +1425,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetUndefined(JSVM_Env env, /** * @brief This API implements the abstract operation ToBoolean() * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to coerce. - * @param result: JSVM_Value representing the coerced JavaScript Boolean. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to coerce. + * @param result JSVM_Value representing the coerced JavaScript Boolean. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1440,9 +1440,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CoerceToBool(JSVM_Env env, * @brief This API implements the abstract operation ToNumber() as defined. This * function potentially runs JS code if the passed-in value is an object. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to coerce. - * @param result: JSVM_Value representing the coerced JavaScript number. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to coerce. + * @param result JSVM_Value representing the coerced JavaScript number. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1454,9 +1454,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CoerceToNumber(JSVM_Env env, /** * @brief This API implements the abstract operation ToObject(). * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to coerce. - * @param result: JSVM_Value representing the coerced JavaScript Object. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to coerce. + * @param result JSVM_Value representing the coerced JavaScript Object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1469,9 +1469,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CoerceToObject(JSVM_Env env, * @brief This API implements the abstract operation ToString().This * function potentially runs JS code if the passed-in value is an object. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to coerce. - * @param result: JSVM_Value representing the coerced JavaScript string. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to coerce. + * @param result JSVM_Value representing the coerced JavaScript string. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1487,9 +1487,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CoerceToString(JSVM_Env env, * ECMAScript typeof would detect object.If value has a type that is invalid, * an error is returned. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value whose type to query. - * @param result: The type of the JavaScript value. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value whose type to query. + * @param result The type of the JavaScript value. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1501,11 +1501,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Typeof(JSVM_Env env, /** * @brief This API represents invoking the instanceof Operator on the object. * - * @param env: The environment that the API is invoked under. - * @param object: The JavaScript value to check. - * @param constructor: The JavaScript function object of the constructor function + * @param env The environment that the API is invoked under. + * @param object The JavaScript value to check. + * @param constructor The JavaScript function object of the constructor function * to check against. - * @param result: Boolean that is set to true if object instanceof constructor is true. + * @param result Boolean that is set to true if object instanceof constructor is true. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1518,9 +1518,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Instanceof(JSVM_Env env, /** * @brief This API represents invoking the IsArray operation on the object * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param result: Whether the given object is an array. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given object is an array. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1532,9 +1532,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsArray(JSVM_Env env, /** * @brief This API checks if the Object passed in is an array buffer. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param result: Whether the given object is an ArrayBuffer. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given object is an ArrayBuffer. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1546,9 +1546,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsArraybuffer(JSVM_Env env, /** * @brief This API checks if the Object passed in is a date. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param result: Whether the given JSVM_Value represents a JavaScript Date object. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param isDate Whether the given JSVM_Value represents a JavaScript Date object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1560,9 +1560,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsDate(JSVM_Env env, /** * @brief This API checks if the Object passed in is a typed array. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param result: Whether the given JSVM_Value represents a TypedArray. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given JSVM_Value represents a TypedArray. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1574,9 +1574,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsTypedarray(JSVM_Env env, /** * @brief This API checks if the Object passed in is a DataView. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param result: Whether the given JSVM_Value represents a DataView. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given JSVM_Value represents a DataView. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1588,10 +1588,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsDataview(JSVM_Env env, /** * @brief This API represents the invocation of the Strict Equality algorithm. * - * @param env: The environment that the API is invoked under. - * @param lhs: The JavaScript value to check. - * @param rhs: The JavaScript value to check against. - * @param result: Whether the two JSVM_Value objects are equal. + * @param env The environment that the API is invoked under. + * @param lhs The JavaScript value to check. + * @param rhs The JavaScript value to check against. + * @param result Whether the two JSVM_Value objects are equal. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1605,10 +1605,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_StrictEquals(JSVM_Env env, * @brief This API represents the invocation of the Relaxed Equality algorithm. * Returns true as long as the values are equal, regardless of type. * - * @param env: The environment that the API is invoked under. - * @param lhs: The JavaScript value to check. - * @param rhs: The JavaScript value to check against. - * @param result: Whether the two JSVM_Value objects are relaxed equal. + * @param env The environment that the API is invoked under. + * @param lhs The JavaScript value to check. + * @param rhs The JavaScript value to check against. + * @param result Whether the two JSVM_Value objects are relaxed equal. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -1621,8 +1621,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Equals(JSVM_Env env, /** * @brief This API represents the invocation of the ArrayBuffer detach operation. * - * @param env: The environment that the API is invoked under. - * @param arraybuffer: The JavaScript ArrayBuffer to be detached. + * @param env The environment that the API is invoked under. + * @param arraybuffer The JavaScript ArrayBuffer to be detached. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_DETACHABLE_ARRAYBUFFER_EXPECTED } If a non-detachable ArrayBuffer is passed in it.\n @@ -1634,9 +1634,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DetachArraybuffer(JSVM_Env env, /** * @brief This API represents the invocation of the ArrayBuffer IsDetachedBuffer operation. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript ArrayBuffer to be checked. - * @param result: Whether the arraybuffer is detached. + * @param env The environment that the API is invoked under. + * @param value The JavaScript ArrayBuffer to be checked. + * @param result Whether the arraybuffer is detached. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1649,9 +1649,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsDetachedArraybuffer(JSVM_Env env, * @brief This API returns the names of the enumerable properties of object as an array of * strings. The properties of object whose key is a symbol will not be included. * - * @param env: The environment that the API is invoked under. - * @param object: The object from which to retrieve the properties. - * @param result: A JSVM_Value representing an array of JavaScript values that represent + * @param env The environment that the API is invoked under. + * @param object The object from which to retrieve the properties. + * @param result A JSVM_Value representing an array of JavaScript values that represent * the property names of the object. The API can be used to iterate over result using * OH_JSVM_GetArrayLength and OH_JSVM_GetElement. * @return Returns JSVM funtions result code. @@ -1666,12 +1666,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetPropertyNames(JSVM_Env env, * @brief This API returns an array containing the names of the available properties * of this object. * - * @param env: The environment that the API is invoked under. - * @param object: The object from which to retrieve the properties. - * @param keyMode: Whether to retrieve prototype properties as well. - * @param keyFilter: Which properties to retrieve (enumerable/readable/writable). - * @param keyConversion: Whether to convert numbered property keys to strings. - * @param result: result: A JSVM_Value representing an array of JavaScript values + * @param env The environment that the API is invoked under. + * @param object The object from which to retrieve the properties. + * @param keyMode Whether to retrieve prototype properties as well. + * @param keyFilter Which properties to retrieve (enumerable/readable/writable). + * @param keyConversion Whether to convert numbered property keys to strings. + * @param result A JSVM_Value representing an array of JavaScript values * that represent the property names of the object. OH_JSVM_GetArrayLength and * OH_JSVM_GetElement can be used to iterate over result. * @return Returns JSVM funtions result code. @@ -1688,10 +1688,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetAllPropertyNames(JSVM_Env env, /** * @brief This API set a property on the Object passed in. * - * @param env: The environment that the API is invoked under. - * @param object: The object on which to set the property. - * @param key: The name of the property to set. - * @param value: The property value. + * @param env The environment that the API is invoked under. + * @param object The object on which to set the property. + * @param key The name of the property to set. + * @param value The property value. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1704,10 +1704,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_SetProperty(JSVM_Env env, /** * @brief This API gets the requested property from the Object passed in. * - * @param env: The environment that the API is invoked under. - * @param object: The object from which to retrieve the property. - * @param key: The name of the property to retrieve. - * @param result: The value of the property. + * @param env The environment that the API is invoked under. + * @param object The object from which to retrieve the property. + * @param key The name of the property to retrieve. + * @param result The value of the property. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1720,10 +1720,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetProperty(JSVM_Env env, /** * @brief This API checks if the Object passed in has the named property. * - * @param env: The environment that the API is invoked under. - * @param object: The object to query. - * @param key: The name of the property whose existence to check. - * @param result: Whether the property exists on the object or not. + * @param env The environment that the API is invoked under. + * @param object The object to query. + * @param key The name of the property whose existence to check. + * @param result Whether the property exists on the object or not. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1736,10 +1736,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_HasProperty(JSVM_Env env, /** * @brief This API attempts to delete the key own property from object. * - * @param env: The environment that the API is invoked under. - * @param object: The object to query. - * @param key: The name of the property to delete. - * @param result: Whether the property deletion succeeded or not. result + * @param env The environment that the API is invoked under. + * @param object The object to query. + * @param key The name of the property to delete. + * @param result Whether the property deletion succeeded or not. result * can optionally be ignored by passing NULL. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -1755,10 +1755,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DeleteProperty(JSVM_Env env, * key must be a string or a symbol, or an error will be thrown. JSVM-API will * not perform any conversion between data types. * - * @param env: The environment that the API is invoked under. - * @param object: The object to query. - * @param key: The name of the own property whose existence to check. - * @param result: Whether the own property exists on the object or not. + * @param env The environment that the API is invoked under. + * @param object The object to query. + * @param key The name of the own property whose existence to check. + * @param result Whether the own property exists on the object or not. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1770,12 +1770,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_HasOwnProperty(JSVM_Env env, /** * @brief This method is equivalent to calling OH_JSVM_SetProperty with - * a JSVM_Value created from the string passed in as utf8Name. + * a JSVM_Value created from the string passed in as utf8name. * - * @param env: The environment that the API is invoked under. - * @param object: The object on which to set the property. - * @param utf8Name: The name of the property to set. - * @param value: The property value. + * @param env The environment that the API is invoked under. + * @param object The object on which to set the property. + * @param utf8name The name of the property to set. + * @param value The property value. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1787,12 +1787,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_SetNamedProperty(JSVM_Env env, /** * @brief This method is equivalent to calling OH_JSVM_SetProperty with - * a JSVM_Value created from the string passed in as utf8Name. + * a JSVM_Value created from the string passed in as utf8name. * - * @param env: The environment that the API is invoked under. - * @param object: The object from which to retrieve the property. - * @param utf8Name: The name of the property to get. - * @param result: The value of the property. + * @param env The environment that the API is invoked under. + * @param object The object from which to retrieve the property. + * @param utf8name The name of the property to get. + * @param result The value of the property. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1804,12 +1804,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetNamedProperty(JSVM_Env env, /** * @brief This method is equivalent to calling OH_JSVM_SetProperty with - * a JSVM_Value created from the string passed in as utf8Name. + * a JSVM_Value created from the string passed in as utf8name. * - * @param env: The environment that the API is invoked under. - * @param object: The object to query. - * @param utf8Name: The name of the property whose existence to check. - * @param result: Whether the property exists on the object or not. + * @param env The environment that the API is invoked under. + * @param object The object to query. + * @param utf8name The name of the property whose existence to check. + * @param result Whether the property exists on the object or not. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1822,10 +1822,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_HasNamedProperty(JSVM_Env env, /** * @brief This API sets an element on the Object passed in. * - * @param env: The environment that the API is invoked under. - * @param object: The object from which to set the properties. - * @param index: The index of the property to set. - * @param value: The property value. + * @param env The environment that the API is invoked under. + * @param object The object from which to set the properties. + * @param index The index of the property to set. + * @param value The property value. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1838,10 +1838,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_SetElement(JSVM_Env env, /** * @brief This API gets the element at the requested index. * - * @param env: The environment that the API is invoked under. - * @param object: The object from which to retrieve the property. - * @param index: The index of the property to get. - * @param result: The value of the property. + * @param env The environment that the API is invoked under. + * @param object The object from which to retrieve the property. + * @param index The index of the property to get. + * @param result The value of the property. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1855,10 +1855,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetElement(JSVM_Env env, * @brief This API returns if the Object passed in has an element * at the requested index. * - * @param env: The environment that the API is invoked under. - * @param object: The object to query. - * @param index: The index of the property whose existence to check. - * @param result: Whether the property exists on the object or not. + * @param env The environment that the API is invoked under. + * @param object The object to query. + * @param index The index of the property whose existence to check. + * @param result Whether the property exists on the object or not. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1871,10 +1871,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_HasElement(JSVM_Env env, /** * @brief This API attempts to delete the specified index from object. * - * @param env: The environment that the API is invoked under. - * @param object: The object to query. - * @param index: The index of the property to delete. - * @param result: Whether the element deletion succeeded or not. result + * @param env The environment that the API is invoked under. + * @param object The object to query. + * @param index The index of the property to delete. + * @param result Whether the element deletion succeeded or not. result * can optionally be ignored by passing NULL. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -1891,10 +1891,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DeleteElement(JSVM_Env env, * Given an array of such property descriptors, this API will set the properties * on the object one at a time, as defined by DefineOwnProperty(). * - * @param env: The environment that the API is invoked under. - * @param object: The object from which to retrieve the properties. - * @param propertyCount: The number of elements in the properties array. - * @param properties: The array of property descriptors. + * @param env The environment that the API is invoked under. + * @param object The object from which to retrieve the properties. + * @param propertyCount The number of elements in the properties array. + * @param properties The array of property descriptors. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1911,8 +1911,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DefineProperties(JSVM_Env env, * properties, and prevents the values of existing properties from being changed. * It also prevents the object's prototype from being changed. * - * @param env: The environment that the API is invoked under. - * @param object: The object to freeze. + * @param env The environment that the API is invoked under. + * @param object The object to freeze. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1924,8 +1924,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ObjectFreeze(JSVM_Env env, * @brief This method seals a given object. This prevents new properties * from being added to it, as well as marking all existing properties as non-configurable. * - * @param env: The environment that the API is invoked under. - * @param object: The object to seal. + * @param env The environment that the API is invoked under. + * @param object The object to seal. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1938,12 +1938,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ObjectSeal(JSVM_Env env, * a native add-on. This is the primary mechanism of calling back from the * add-on's native code into JavaScript. * - * @param env: The environment that the API is invoked under. - * @param recv: The this value passed to the called function. - * @param func: JSVM_Value representing the JavaScript function to be invoked. - * @param argc: The count of elements in the argv array. - * @param argv: Array of JSVM_values representing JavaScript values passed in as arguments to the function. - * @param result: JSVM_Value representing the JavaScript object returned. + * @param env The environment that the API is invoked under. + * @param recv The this value passed to the called function. + * @param func JSVM_Value representing the JavaScript function to be invoked. + * @param argc The count of elements in the argv array. + * @param argv Array of JSVM_values representing JavaScript values passed in as arguments to the function. + * @param result JSVM_Value representing the JavaScript object returned. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -1963,14 +1963,14 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CallFunction(JSVM_Env env, * object that is visible to JavaScript, in order for the function to be accessible * from script. * - * @param env: The environment that the API is invoked under. - * @param utf8Name: Optional name of the function encoded as UTF8. This is visible + * @param env The environment that the API is invoked under. + * @param utf8name Optional name of the function encoded as UTF8. This is visible * within JavaScript as the new function object's name property. - * @param length: The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it + * @param length The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it * is null-terminated. - * @param cb: The native function which should be called when this function + * @param cb The native function which should be called when this function * object is invoked and data. JSVM_Callback provides more details. - * @param result: JSVM_Value representing the JavaScript function object for the newly + * @param result JSVM_Value representing the JavaScript function object for the newly * created function. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -1986,18 +1986,18 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateFunction(JSVM_Env env, * @brief This method is used within a callback function to retrieve details about * the call like the arguments and the this pointer from a given callback info. * - * @param env: The environment that the API is invoked under. - * @param cbinfo: The callback info passed into the callback function. - * @param argc: Specifies the length of the provided argv array and receives the + * @param env The environment that the API is invoked under. + * @param cbinfo The callback info passed into the callback function. + * @param argc Specifies the length of the provided argv array and receives the * actual count of arguments. argc can optionally be ignored by passing NULL. - * @param argv: C array of JSVM_values to which the arguments will be copied. If + * @param argv C array of JSVM_values to which the arguments will be copied. If * there are more arguments than the provided count, only the requested number of * arguments are copied. If there are fewer arguments provided than claimed, the * rest of argv is filled with JSVM_Value values that represent undefined. argv * can optionally be ignored by passing NULL. - * @param thisArg: Receives the JavaScript this argument for the call. thisArg + * @param thisArg Receives the JavaScript this argument for the call. thisArg * can optionally be ignored by passing NULL. - * @param data: Receives the data pointer for the callback. data can optionally + * @param data Receives the data pointer for the callback. data can optionally * be ignored by passing NULL. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -2014,9 +2014,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetCbInfo(JSVM_Env env, * @brief This API returns the new.target of the constructor call. If the * current callback is not a constructor call, the result is NULL. * - * @param env: The environment that the API is invoked under. - * @param cbinfo: The callback info passed into the callback function. - * @param result: The new.target of the constructor call. + * @param env The environment that the API is invoked under. + * @param cbinfo The callback info passed into the callback function. + * @param result The new.target of the constructor call. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2029,12 +2029,12 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetNewTarget(JSVM_Env env, * @brief his method is used to instantiate a new JavaScript value using * a given JSVM_Value that represents the constructor for the object. * - * @param env: The environment that the API is invoked under. - * @param constructor: JSVM_Value representing the JavaScript function to be invoked as a constructor. - * @param argc: The count of elements in the argv array. - * @param argv: Array of JavaScript values as JSVM_Value representing the arguments to + * @param env The environment that the API is invoked under. + * @param constructor JSVM_Value representing the JavaScript function to be invoked as a constructor. + * @param argc The count of elements in the argv array. + * @param argv Array of JavaScript values as JSVM_Value representing the arguments to * the constructor. If argc is zero this parameter may be omitted by passing in NULL. - * @param result: JSVM_Value representing the JavaScript object returned, which + * @param result JSVM_Value representing the JavaScript object returned, which * in this case is the constructed object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -2051,20 +2051,20 @@ JSVM_EXTERN JSVM_Status OH_JSVM_NewInstance(JSVM_Env env, * should be a static method on the class that calls the actual class constructor, then * wraps the new C++ instance in a JavaScript object, and returns the wrapper object. * - * @param env: The environment that the API is invoked under. - * @param utf8name: Name of the JavaScript constructor function. For clarity, it is + * @param env The environment that the API is invoked under. + * @param utf8name Name of the JavaScript constructor function. For clarity, it is * recommended to use the C++ class name when wrapping a C++ class. - * @param length: The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it + * @param length The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it * is null-terminated. - * @param constructor: Struct include callback function that handles constructing instances of the class. + * @param constructor Struct include callback function that handles constructing instances of the class. * When wrapping a C++ class, this method must be a static member with the JSVM_Callback.callback * signature. A C++ class constructor cannot be used. * Include Optional data to be passed to the constructor callback as the data * property of the callback info. JSVM_Callback provides more details. - * @param propertyCount: Number of items in the properties array argument. - * @param properties: Array of property descriptors describing static and instance data + * @param propertyCount Number of items in the properties array argument. + * @param properties Array of property descriptors describing static and instance data * properties, accessors, and methods on the class See JSVM_PropertyDescriptor. - * @param result: A JSVM_Value representing the constructor function for the class. + * @param result A JSVM_Value representing the constructor function for the class. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2081,14 +2081,14 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DefineClass(JSVM_Env env, * @brief Wraps a native instance in a JavaScript object. The native instance can * be retrieved later using OH_JSVM_Unwrap(). * - * @param env: The environment that the API is invoked under. - * @param jsObject: The JavaScript object that will be the wrapper for the native object. - * @param nativeObject: The native instance that will be wrapped in the JavaScript object. - * @param finalizeCb: Optional native callback that can be used to free the native instance + * @param env The environment that the API is invoked under. + * @param jsObject The JavaScript object that will be the wrapper for the native object. + * @param nativeObject The native instance that will be wrapped in the JavaScript object. + * @param finalizeCb Optional native callback that can be used to free the native instance * when the JavaScript object has been garbage-collected. - * @param finalizeHint: Optional contextual hint that is passed to the finalize callback. + * @param finalizeHint Optional contextual hint that is passed to the finalize callback. * properties, accessors, and methods on the class See JSVM_PropertyDescriptor. - * @param result: Optional reference to the wrapped object. + * @param result Optional reference to the wrapped object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2106,9 +2106,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Wrap(JSVM_Env env, * argument to the callback is the wrapper object; the wrapped C++ instance that is the target of * the call can be obtained then by calling OH_JSVM_Unwrap() on the wrapper object. * - * @param env: The environment that the API is invoked under. - * @param jsObject: The object associated with the native instance. - * @param result: Pointer to the wrapped native instance. + * @param env The environment that the API is invoked under. + * @param jsObject The object associated with the native instance. + * @param result Pointer to the wrapped native instance. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2122,9 +2122,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_Unwrap(JSVM_Env env, * using OH_JSVM_Wrap() and removes the wrapping. If a finalize callback was associated with the wrapping, * it will no longer be called when the JavaScript object becomes garbage-collected. * - * @param env: The environment that the API is invoked under. - * @param jsObject: The object associated with the native instance. - * @param result: Pointer to the wrapped native instance. + * @param env The environment that the API is invoked under. + * @param jsObject The object associated with the native instance. + * @param result Pointer to the wrapped native instance. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2139,9 +2139,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_RemoveWrap(JSVM_Env env, * object with one owned by the addon to ensure that the object has the right type. * If the object already has an associated type tag, this API will return JSVM_INVALID_ARG. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript object or external to be marked. - * @param typeTag: The tag with which the object is to be marked. + * @param env The environment that the API is invoked under. + * @param value The JavaScript object or external to be marked. + * @param typeTag The tag with which the object is to be marked. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * {@link JSVM_INVALID_ARG } If the object already has an associated type tag.\n @@ -2156,10 +2156,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_TypeTagObject(JSVM_Env env, * If no tag is found on js object or, if a tag is found but it does not match typeTag, * then result is set to false. If a tag is found and it matches typeTag, then result is set to true. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript object or external whose type tag to examine. - * @param typeTag: The tag with which to compare any tag found on the object. - * @param result: Whether the type tag given matched the type tag on the object. false is also returned + * @param env The environment that the API is invoked under. + * @param value The JavaScript object or external whose type tag to examine. + * @param typeTag The tag with which to compare any tag found on the object. + * @param result Whether the type tag given matched the type tag on the object. false is also returned * if no type tag was found on the object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n @@ -2173,13 +2173,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CheckObjectTypeTag(JSVM_Env env, /** * @brief This API can be called multiple times on a single JavaScript object. * - * @param env: The environment that the API is invoked under. - * @param jsObject: The JavaScript object to which the native data will be attached. - * @param finalizeData: Optional data to be passed to finalizeCb. - * @param finalizeCb: Native callback that will be used to free the native data when the + * @param env The environment that the API is invoked under. + * @param jsObject The JavaScript object to which the native data will be attached. + * @param finalizeData Optional data to be passed to finalizeCb. + * @param finalizeCb Native callback that will be used to free the native data when the * JavaScript object has been garbage-collected. JSVM_Finalize provides more details. - * @param finalizeHint: Optional contextual hint that is passed to the finalize callback. - * @param result: Optional reference to the JavaScript object. + * @param finalizeHint Optional contextual hint that is passed to the finalize callback. + * @param result Optional reference to the JavaScript object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2198,8 +2198,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_AddFinalizer(JSVM_Env env, * API functions. In order to allow an addon to use a newer function when running with versions * of JSVM that support it, while providing fallback behavior when running with JSVM * versions that don't support it. - * @param env: The environment that the API is invoked under. - * @param result: The highest version of JSVM-API supported. + * @param env The environment that the API is invoked under. + * @param result The highest version of JSVM-API supported. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2210,7 +2210,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetVersion(JSVM_Env env, /** * @brief Return information of the VM. * - * @param result: The information of the VM. + * @param result The information of the VM. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2224,10 +2224,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetVMInfo(JSVM_VMInfo* result); * externally allocated memory will trigger global garbage collections more often * than it would otherwise. * - * @param env: The environment that the API is invoked under. - * @param changeInBytes: The change in externally allocated memory that is kept + * @param env The environment that the API is invoked under. + * @param changeInBytes The change in externally allocated memory that is kept * alive by JavaScript objects. - * @param result: The adjusted value + * @param result The adjusted value * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2240,8 +2240,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_AdjustExternalMemory(JSVM_Env env, * @brief This function notifies the VM that the system is running low on memory * and optionally triggers a garbage collection. * - * @param env: The environment that the API is invoked under. - * @param level: The memory pressure level set to the current VM. + * @param env The environment that the API is invoked under. + * @param level The memory pressure level set to the current VM. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2252,11 +2252,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_MemoryPressureNotification(JSVM_Env env, /** * @brief This API creates a deferred object and a JavaScript promise. * - * @param env: The environment that the API is invoked under. - * @param deferred: A newly created deferred object which can later be + * @param env The environment that the API is invoked under. + * @param deferred A newly created deferred object which can later be * passed to OH_JSVM_ResolveDeferred() or OH_JSVM_RejectDeferred() to resolve * resp. reject the associated promise. - * @param promise: The JavaScript promise associated with the deferred object. + * @param promise The JavaScript promise associated with the deferred object. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2272,9 +2272,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreatePromise(JSVM_Env env, * that the promise must have been created using OH_JSVM_CreatePromise() and the deferred * object returned from that call must have been retained in order to be passed to this API. * - * @param env: The environment that the API is invoked under. - * @param deferred: The deferred object whose associated promise to resolve. - * @param resolution: The value with which to resolve the promise. + * @param env The environment that the API is invoked under. + * @param deferred The deferred object whose associated promise to resolve. + * @param resolution The value with which to resolve the promise. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2290,9 +2290,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ResolveDeferred(JSVM_Env env, * that the promise must have been created using OH_JSVM_CreatePromise() and the deferred * object returned from that call must have been retained in order to be passed to this API. * - * @param env: The environment that the API is invoked under. - * @param deferred: The deferred object whose associated promise to resolve. - * @param rejection: The value with which to reject the promise. + * @param env The environment that the API is invoked under. + * @param deferred The deferred object whose associated promise to resolve. + * @param rejection The value with which to reject the promise. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2303,9 +2303,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_RejectDeferred(JSVM_Env env, /** * @brief This API return indicating whether promise is a native promise object. - * @param env: The environment that the API is invoked under. - * @param value: The value to examine - * @param isPromise: Flag indicating whether promise is a native promise object + * @param env The environment that the API is invoked under. + * @param value The value to examine + * @param isPromise Flag indicating whether promise is a native promise object * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2316,9 +2316,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsPromise(JSVM_Env env, /** * @brief This API parses a JSON string and returns it as value if successful. - * @param env: The environment that the API is invoked under. - * @param jsonString: The string to parse. - * @param result: The parse value if successful. + * @param env The environment that the API is invoked under. + * @param jsonString The string to parse. + * @param result The parse value if successful. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2329,9 +2329,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_JsonParse(JSVM_Env env, /** * @brief This API stringifies the object and returns it as string if successful. - * @param env: The environment that the API is invoked under. - * @param jsonObject: The object to stringify. - * @param result: The string if successfully stringified. + * @param env The environment that the API is invoked under. + * @param jsonObject The object to stringify. + * @param result The string if successfully stringified. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2342,11 +2342,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_JsonStringify(JSVM_Env env, /** * @brief This API create the startup snapshot of the VM. - * @param vm: The environment that the API is invoked under. - * @param contextCount: The object to stringify. - * @param contexts: The array of contexts to add to the snapshot. - * @param blobData: The snapshot data. - * @param blobSize: The size of snapshot data. + * @param vm The environment that the API is invoked under. + * @param contextCount The object to stringify. + * @param contexts The array of contexts to add to the snapshot. + * @param blobData The snapshot data. + * @param blobSize The size of snapshot data. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 11 @@ -2360,8 +2360,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateSnapshot(JSVM_VM vm, /** * @brief This function returns a set of statistics data of the heap of the VM. * - * @param vm: The VM whose heap statistics are returned. - * @param result: The heap statistics data. + * @param vm The VM whose heap statistics are returned. + * @param result The heap statistics data. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } in all cases.\n * @since 12 @@ -2372,8 +2372,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_GetHeapStatistics(JSVM_VM vm, /** * @brief This function creates and starts a CPU profiler. * - * @param vm: The VM to start CPU profiler for. - * @param result: The pointer to the CPU profiler. + * @param vm The VM to start CPU profiler for. + * @param result The pointer to the CPU profiler. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } in all cases.\n * @since 12 @@ -2384,10 +2384,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_StartCpuProfiler(JSVM_VM vm, /** * @brief This function stops the CPU profiler and output to the stream. * - * @param vm: THe VM to start CPU profiler for. - * @param profiler: The CPU profiler to stop. - * @param stream: The output stream callback for receiving the data. - * @param streamData: Optional data to be passed to the stream callback. + * @param vm THe VM to start CPU profiler for. + * @param profiler The CPU profiler to stop. + * @param stream The output stream callback for receiving the data. + * @param streamData Optional data to be passed to the stream callback. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } in all cases.\n * @since 12 @@ -2400,9 +2400,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_StopCpuProfiler(JSVM_VM vm, /** * @brief This funciton takes the current heap snapshot and output to the stream. * - * @param vm: The VM whose heap snapshot is taken. - * @param stream: The output stream callback for receiving the data. - * @param streamData: Optional data to be passed to the stream callback. + * @param vm The VM whose heap snapshot is taken. + * @param stream The output stream callback for receiving the data. + * @param streamData Optional data to be passed to the stream callback. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } in all cases.\n * @since 12 @@ -2414,9 +2414,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_TakeHeapSnapshot(JSVM_VM vm, /** * @brief This functiong activates insepctor on host and port. * - * @param env: The environment that the API is invoked under. - * @param host: The host to listen to for inspector connections. - * @param port: The port to listen to for inspector connections. + * @param env The environment that the API is invoked under. + * @param host The host to listen to for inspector connections. + * @param port The port to listen to for inspector connections. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_PENDING_EXCEPTION } if an exception occurs.\n @@ -2429,7 +2429,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_OpenInspector(JSVM_Env env, /** * @brief This function attempts to close all remaining inspector connections. * - * @param env: The environment that the API is invoked under. + * @param env The environment that the API is invoked under. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_PENDING_EXCEPTION } if an exception occurs.\n @@ -2441,8 +2441,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CloseInspector(JSVM_Env env); * @brief This function will block until a client (existing or connected later) * has sent Runtime.runIfWaitingForDebugger command. * - * @param env: The environment that the API is invoked under. - * @param breakNextLine: Whether break on the next line of JavaScript code. + * @param env The environment that the API is invoked under. + * @param breakNextLine Whether break on the next line of JavaScript code. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_PENDING_EXCEPTION } if an exception occurs.\n @@ -2455,22 +2455,22 @@ JSVM_EXTERN JSVM_Status OH_JSVM_WaitForDebugger(JSVM_Env env, * @brief Define a JavaScript class with given class name, constructor, properties, callback handlers for * property operations including get, set, delete, enum etc., and call as function callback. * - * @param env: The environment that the API is invoked under. - * @param utf8name: Name of the JavaScript constructor function. For clarity, it is + * @param env The environment that the API is invoked under. + * @param utf8name Name of the JavaScript constructor function. For clarity, it is * recommended to use the C++ class name when wrapping a C++ class. - * @param length: The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it + * @param length The length of the utf8name in bytes, or JSVM_AUTO_LENGTH if it * is null-terminated. - * @param constructor: Struct include callback function that handles constructing instances of the class. + * @param constructor Struct include callback function that handles constructing instances of the class. * When wrapping a C++ class, this method must be a static member with the JSVM_Callback.callback * signature. A C++ class constructor cannot be used. * Include Optional data to be passed to the constructor callback as the data * property of the callback info. JSVM_Callback provides more details. - * @param propertyCount: Number of items in the properties array argument. - * @param properties: Array of property descriptors describing static and instance data + * @param propertyCount Number of items in the properties array argument. + * @param properties Array of property descriptors describing static and instance data * properties, accessors, and methods on the class See JSVM_PropertyDescriptor. - * @param propertyHandlerCfg: The instance object triggers the corresponding callback function. - * @param callAsFunctionCallback: Calling an instance object as a function will trigger this callback. - * @param result: A JSVM_Value representing the constructor function for the class. + * @param propertyHandlerCfg The instance object triggers the corresponding callback function. + * @param callAsFunctionCallback Calling an instance object as a function will trigger this callback. + * @param result A JSVM_Value representing the constructor function for the class. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -2489,8 +2489,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_DefineClassWithPropertyHandler(JSVM_Env env, * @brief Determines whether the current thread holds the lock for the specified environment. * Only threads that hold locks can use the environment. * - * @param env: The environment that the API is invoked under. - * @param isLocked: Flag indicating whether the current thread holds the lock for the specified environment. + * @param env The environment that the API is invoked under. + * @param isLocked Flag indicating whether the current thread holds the lock for the specified environment. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -2501,7 +2501,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsLocked(JSVM_Env env, /** * @brief Acquire the lock for the specified environment. Only threads that hold locks can use the environment. * - * @param env: The environment that the API is invoked under. + * @param env The environment that the API is invoked under. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -2511,7 +2511,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_AcquireLock(JSVM_Env env); /** * @brief Release the lock for the specified environment. Only threads that hold locks can use the environment. * - * @param env: The environment that the API is invoked under. + * @param env The environment that the API is invoked under. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -2522,8 +2522,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ReleaseLock(JSVM_Env env); * @brief Starts the running of the task queue inside the VM. * This task queue can be executed by an external event loop. * - * @param env: The VM instance on which to start the task queue. - * @param result: Whether the task queue was successfully started. + * @param vm The VM instance on which to start the task queue. + * @param result Whether the task queue was successfully started. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -2534,7 +2534,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_PumpMessageLoop(JSVM_VM vm, /** * @brief Check to see if there are any microtasks waiting in the queue, and if there are, execute them. * - * @param env: The VM instance on which to check microtasks. + * @param vm The VM instance on which to check microtasks. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -2544,9 +2544,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_PerformMicrotaskCheckpoint(JSVM_VM vm); /** * @brief This API checks if the value passed in is callable. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isCallable: Whether the given value is callable. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isCallable Whether the given value is callable. * @return Returns JSVM funtions result code. * {@link JSVM_OK } If the function executed successfully.\n * @since 12 @@ -2559,9 +2559,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsCallable(JSVM_Env env, * @brief This API checks if the value passed in is undefined. * This equals to `value === undefined` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isUndefined: Whether the given value is Undefined. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isUndefined Whether the given value is Undefined. * @return Returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2574,9 +2574,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsUndefined(JSVM_Env env, * @brief This API checks if the value passed in is a null object. * This equals to `value === null` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isNull: Whether the given value is Null. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isNull Whether the given value is Null. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2589,9 +2589,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsNull(JSVM_Env env, * @brief This API checks if the value passed in is either a null or an undefined object. * This is equivalent to `value == null` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isNullOrUndefined: Whether the given value is Null or Undefined. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isNullOrUndefined Whether the given value is Null or Undefined. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2604,9 +2604,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsNullOrUndefined(JSVM_Env env, * @brief This API checks if the value passed in is a boolean. * This equals to `typeof value === 'boolean'` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isBoolean: Whether the given value is Boolean. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isBoolean Whether the given value is Boolean. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2619,9 +2619,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsBoolean(JSVM_Env env, * @brief This API checks if the value passed in is a number. * This equals to `typeof value === 'number'` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isNumber: Whether the given value is Number. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isNumber Whether the given value is Number. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2634,9 +2634,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsNumber(JSVM_Env env, * @brief This API checks if the value passed in is a string. * This equals to `typeof value === 'string'` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isString: Whether the given value is String. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isString Whether the given value is String. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2649,9 +2649,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsString(JSVM_Env env, * @brief This API checks if the value passed in is a symbol. * This equals to `typeof value === 'symbol'` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isSymbol: Whether the given value is Symbol. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isSymbol Whether the given value is Symbol. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2664,9 +2664,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsSymbol(JSVM_Env env, * @brief This API checks if the value passed in is a function. * This equals to `typeof value === 'function'` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isFunction: Whether the given value is Function. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isFunction Whether the given value is Function. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2678,9 +2678,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsFunction(JSVM_Env env, /** * @brief This API checks if the value passed in is an object. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isObject: Whether the given value is Object. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isObject Whether the given value is Object. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2693,9 +2693,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsObject(JSVM_Env env, * @brief This API checks if the value passed in is a bigInt. * This equals to `typeof value === 'bigint'` in JS. * - * @param env: The VM instance on which to check microtasks. - * @param value: The JavaScript value to check. - * @param isBigInt: Whether the given value is BigInt. + * @param env The VM instance on which to check microtasks. + * @param value The JavaScript value to check. + * @param isBigInt Whether the given value is BigInt. * @return Only returns JSVM funtions result code. * {@link JSVM_OK } This API will not trigger any exception.\n * @since 12 @@ -2707,8 +2707,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsBigInt(JSVM_Env env, /** * @brief This API returns a JSVM-API value corresponding to a JavaScript Map type. * - * @param env: The environment that the API is invoked under. - * @param result: A JSVM_Value representing a JavaScript Map. + * @param env The environment that the API is invoked under. + * @param result A JSVM_Value representing a JavaScript Map. * @return Only returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2719,9 +2719,9 @@ JSVM_Status JSVM_CDECL OH_JSVM_CreateMap(JSVM_Env env, JSVM_Value* result); /** * @brief This API checks if the value passed in is a Map. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param isMap: Whether the given value is Map. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param isMap Whether the given value is Map. * @return Only returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2734,8 +2734,8 @@ JSVM_Status JSVM_CDECL OH_JSVM_IsMap(JSVM_Env env, /** * @brief This API returns a JSVM-API value corresponding to a JavaScript Set type. * - * @param env: The environment that the API is invoked under. - * @param result: A JSVM_Value representing a JavaScript Set. + * @param env The environment that the API is invoked under. + * @param result A JSVM_Value representing a JavaScript Set. * @return Returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2747,9 +2747,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateSet(JSVM_Env env, /** * @brief This API checks if the value passed in is a Set. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param isSet: Whether the given value is Set. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param isSet Whether the given value is Set. * @return Returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2763,11 +2763,11 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsSet(JSVM_Env env, * @brief This function compiles a string of JavaScript code with the compile options * and returns the compiled script. * - * @param env: The environment that the JSVM-API call is invoked under. - * @param script: A JavaScript string containing the script to be compiled. - * @param optionCount: length of option array. - * @param options: Compile options to be passed. - * @param result: The compiled script. + * @param env The environment that the JSVM-API call is invoked under. + * @param script A JavaScript string containing the script to be compiled. + * @param optionCount length of option array. + * @param options Compile options to be passed. + * @param result The compiled script. * @return Returns JSVM functions result code * {@link JSVM_OK } if the API succeeded. \n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2782,9 +2782,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CompileScriptWithOptions(JSVM_Env env, /** * @brief This API implements the abstract operation ToBigInt(). * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to coerce. - * @param result: JSVM_Value representing the coerced JavaScript BigInt. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to coerce. + * @param result JSVM_Value representing the coerced JavaScript BigInt. * @return Returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded. * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2799,9 +2799,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CoerceToBigInt(JSVM_Env env, * @brief This API checks if the value passed in is a regExp. * This equals to `value instanceof RegExp` in JS. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param result: Whether the given value is RegExp. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given value is RegExp. * @return Returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2815,9 +2815,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsRegExp(JSVM_Env env, /** * @brief This API checks if the value passed in is a constructor. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param isConstructor: Whether the given value is Constructor. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param isConstructor Whether the given value is Constructor. * @return Only returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2832,10 +2832,10 @@ JSVM_Status JSVM_CDECL OH_JSVM_IsConstructor(JSVM_Env env, * corresponding to the input. * The interface may throw an exception. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript string to convert to a regular expression. - * @param flags: Regular expression flag bits. - * @param result: A JSVM_Value representing a JavaScript RegExp. + * @param env The environment that the API is invoked under. + * @param value The JavaScript string to convert to a regular expression. + * @param flags Regular expression flag bits. + * @param result A JSVM_Value representing a JavaScript RegExp. * @return Only returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2852,10 +2852,10 @@ JSVM_Status JSVM_CDECL OH_JSVM_CreateRegExp(JSVM_Env env, /** * @brief This API returns the Object prototype. * - * @param env: The environment that the API is invoked under. - * @param object: JSVM_Value representing JavaScript Object whose prototype to return. This returns + * @param env The environment that the API is invoked under. + * @param object JSVM_Value representing JavaScript Object whose prototype to return. This returns * the equivalent of Object.getPrototypeOf (which is not the same as the function's prototype property). - * @param result: JSVM_Value representing prototype of the given object. + * @param result JSVM_Value representing prototype of the given object. * @return Returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2868,9 +2868,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ObjectGetPrototypeOf(JSVM_Env env, /** * @brief This API set the prototype on the Object passed in. * - * @param env: The environment that the API is invoked under. - * @param object: The object on which to set the prototype. - * @param prototype: The prototype value. + * @param env The environment that the API is invoked under. + * @param object The object on which to set the prototype. + * @param prototype The prototype value. * @return Returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded.\n * {@link JSVM_INVALID_ARG } If the input parameter is invalid.\n @@ -2883,14 +2883,14 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ObjectSetPrototypeOf(JSVM_Env env, /** * @brief Creates a function with a given script as its body. * - * @param env: The environment that the API is invoked under. - * @param funcName: A string containing the function's name. Pass NULL to create an anonymous function. - * @param length: The length of the funcName in bytes, or JSVM_AUTO_LENGTH if it + * @param env The environment that the API is invoked under. + * @param funcName A string containing the function's name. Pass NULL to create an anonymous function. + * @param length The length of the funcName in bytes, or JSVM_AUTO_LENGTH if it * is null-terminated. - * @param argc: The count of elements in the argv array. - * @param argv: Array of JSVM_Values representing JavaScript strings passed in as arguments to the function. - * @param script: A JavaScript string containing the script to use as the function's body. - * @param result: JSVM_Value representing the JavaScript function object for the newly + * @param argc The count of elements in the argv array. + * @param argv Array of JSVM_Values representing JavaScript strings passed in as arguments to the function. + * @param script A JavaScript string containing the script to use as the function's body. + * @param result JSVM_Value representing the JavaScript function object for the newly * created function. * @return Returns JSVM function's result code. * {@link JSVM_OK } If the API succeeded. @@ -2910,8 +2910,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateFunctionWithScript(JSVM_Env env, * @brief This function keep persistently save a JSVM_Script and extend its lifecycle * beyond the current scope. * - * @param env: The environment that the API is invoked under. - * @param script: A JavaScript string containing the script to be retained. + * @param env The environment that the API is invoked under. + * @param script A JavaScript string containing the script to be retained. * @return Returns JSVM functions result code * {@link JSVM_OK } if the API succeeded. \n * {@link JSVM_INVALID_ARG } if the script is empty or already retained. \n @@ -2922,8 +2922,8 @@ JSVM_EXTERN JSVM_Status OH_JSVM_RetainScript(JSVM_Env env, JSVM_Script script); /** * @brief This function release the script retained by OH_JSVM_RetainScript * - * @param env: The environment that the API is invoked under. - * @param script: A JavaScript string containing the script to be retained. + * @param env The environment that the API is invoked under. + * @param script A JavaScript string containing the script to be retained. * @return Returns JSVM functions result code * {@link JSVM_OK } if the API succeeded. \n * {@link JSVM_INVALID_ARG } if the script is empty or not retained. \n @@ -2934,9 +2934,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ReleaseScript(JSVM_Env env, JSVM_Script script); /** * @brief This function activates insepctor with pid and alias it. * - * @param env: The environment that the API is invoked under. - * @param pid: A process id to identify the inspector connection. - * @param name: An alias for the inspector that under a specific pid. + * @param env The environment that the API is invoked under. + * @param pid A process id to identify the inspector connection. + * @param name An alias for the inspector that under a specific pid. * default name is jsvm if a nullptr is passed in. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n @@ -2951,13 +2951,13 @@ JSVM_EXTERN JSVM_Status OH_JSVM_OpenInspectorWithName(JSVM_Env env, * @brief Compile WebAssembly bytecode into a WebAssembly module. * If WebAssembly cache provided, deserialization will be performed. * - * @param env: The environment that the API is invoked under. - * @param wasmBytecode: WebAssembly bytecode. - * @param wasmBytecodeLength: WebAssembly bytecode length in byte. - * @param cacheData: Optional WebAssembly cache. - * @param cacheDataLength: Optional WebAssembly cache length in byte. - * @param cacheRejected: Output parameter representing whether the provided cacheData is rejected. - * @param wasmModule: Output parameter representing compiled WebAssembly module. + * @param env The environment that the API is invoked under. + * @param wasmBytecode WebAssembly bytecode. + * @param wasmBytecodeLength WebAssembly bytecode length in byte. + * @param cacheData Optional WebAssembly cache. + * @param cacheDataLength Optional WebAssembly cache length in byte. + * @param cacheRejected Output parameter representing whether the provided cacheData is rejected. + * @param wasmModule Output parameter representing compiled WebAssembly module. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_INVALID_ARG } if any of env, wasmBytecode is NULL, or data length is invalid.\n @@ -2978,10 +2978,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CompileWasmModule(JSVM_Env env, * @brief Compile the function with the specified index in the WebAssembly module * into the specified optimization level. * - * @param env: The environment that the API is invoked under. - * @param wasmModule: The WebAssembly module to which the function to compiled belongs. - * @param functionIndex: The index of the function to be compiled, should never be out of range. - * @param optLevel: Optimization level the function will be compiled with. + * @param env The environment that the API is invoked under. + * @param wasmModule The WebAssembly module to which the function to compiled belongs. + * @param functionIndex The index of the function to be compiled, should never be out of range. + * @param optLevel Optimization level the function will be compiled with. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_INVALID_ARG } if env is NULL, or wasmModule is NULL or is not a WebAssembly module.\n @@ -2998,9 +2998,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CompileWasmFunction(JSVM_Env env, /** * @brief Check whether the given JSVM_Value is a WebAssembly module. * - * @param env: The environment that the API is invoked under. - * @param value: The JavaScript value to check. - * @param result: Whether the given value is a WebAssembly module. + * @param env The environment that the API is invoked under. + * @param value The JavaScript value to check. + * @param result Whether the given value is a WebAssembly module. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_INVALID_ARG } if any of the input arguments is NULL.\n @@ -3014,10 +3014,10 @@ JSVM_EXTERN JSVM_Status OH_JSVM_IsWasmModuleObject(JSVM_Env env, /** * @brief Create cache for compiled WebAssembly module. * - * @param env: The environment that the API is invoked under. - * @param wasmModule: The compiled WebAssembly module. - * @param data: Output parameter representing generated WebAssembly module cache. - * @param length: Output parameter representing byte length of generated WebAssembly module cache. + * @param env The environment that the API is invoked under. + * @param wasmModule The compiled WebAssembly module. + * @param data Output parameter representing generated WebAssembly module cache. + * @param length Output parameter representing byte length of generated WebAssembly module cache. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_INVALID_ARG } if any of the input arguments is NULL.\n @@ -3033,9 +3033,9 @@ JSVM_EXTERN JSVM_Status OH_JSVM_CreateWasmCache(JSVM_Env env, /** * @brief Release cache data with specified cache type. * - * @param env: The environment that the API is invoked under. - * @param cacheData: The cache data to be released, double free is undefined behaviors. - * @param cacheType: The type of cache data. + * @param env The environment that the API is invoked under. + * @param cacheData The cache data to be released, double free is undefined behaviors. + * @param cacheType The type of cache data. * @return Returns JSVM funtions result code. * Returns {@link JSVM_OK } if the function executed successfully.\n * Returns {@link JSVM_INVALID_ARG } if any of the pointer arguments is NULL or cacheType is illegal.\n @@ -3048,3 +3048,4 @@ JSVM_EXTERN JSVM_Status OH_JSVM_ReleaseCache(JSVM_Env env, EXTERN_C_END /** @} */ #endif /* ARK_RUNTIME_JSVM_JSVM_H */ + diff --git a/ark_runtime/jsvm/jsvm_types.h b/ark_runtime/jsvm/jsvm_types.h index 1141b051f8d71e2590a0ded319cf722d8fef7f0b..4ee1793b311032cf2d6dca111180ba4f7ad2468d 100644 --- a/ark_runtime/jsvm/jsvm_types.h +++ b/ark_runtime/jsvm/jsvm_types.h @@ -12,10 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#ifndef ARK_RUNTIME_JSVM_JSVM_TYPE_H -#define ARK_RUNTIME_JSVM_JSVM_TYPE_H - /** * @addtogroup JSVM * @{ @@ -43,6 +39,10 @@ * @since 11 */ +#ifndef ARK_RUNTIME_JSVM_JSVM_TYPE_H +#define ARK_RUNTIME_JSVM_JSVM_TYPE_H + + #include // NOLINT(modernize-deprecated-headers) #include // NOLINT(modernize-deprecated-headers) #include // NOLINT(modernize-deprecated-headers) @@ -772,3 +772,4 @@ typedef enum { } JSVM_CacheType; /** @} */ #endif /* ARK_RUNTIME_JSVM_JSVM_TYPE_H */ + diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 98b4908b78ef5f64d2b123c7984caada10f5da9e..1d822febf19e96061bd901ce00ee3268610c5be3 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2449,15 +2449,7 @@ }, { "first_introduced": "14", - "name": "OH_ArkUI_KeyEvent_GetDeviceId" - }, - { - "first_introduced": "14", - "name": "OH_ArkUI_KeyEvent_GetMetaKey" - }, - { - "first_introduced": "14", - "name": "OH_ArkUI_KeyEvent_GetTimestamp" + "name": "OH_ArkUI_UIInputEvent_GetDeviceId" }, { "first_introduced": "14", @@ -2465,7 +2457,7 @@ }, { "first_introduced": "14", - "name": "OH_ArkUI_KeyEvent_GetModifierKeyState" + "name": "OH_ArkUI_UIInputEvent_GetPressedKeys" }, { "first_introduced": "14", diff --git a/arkui/ace_engine/native/native_dialog.h b/arkui/ace_engine/native/native_dialog.h index 95b1a6cbefda04982a2e908f85bc796178a4954b..c399920d7edd803fdb37a8f62c8e374aaf8d7513 100644 --- a/arkui/ace_engine/native/native_dialog.h +++ b/arkui/ace_engine/native/native_dialog.h @@ -325,3 +325,4 @@ int32_t OH_ArkUI_DialogDismissEvent_GetDismissReason(ArkUI_DialogDismissEvent* e #endif #endif // ARKUI_NATIVE_DIALOG_H +/** @} */ diff --git a/arkui/ace_engine/native/native_gesture.h b/arkui/ace_engine/native/native_gesture.h index 42b37aa9c4b2fec751befab632b234d9ff24be14..4551c782c21b29218416fb7170cc6694741d500f 100644 --- a/arkui/ace_engine/native/native_gesture.h +++ b/arkui/ace_engine/native/native_gesture.h @@ -649,6 +649,7 @@ int32_t OH_ArkUI_ParallelInnerGestureEvent_GetConflictRecognizers(ArkUI_Parallel * @param userData Indicates the custom data. * @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. +* @since 12 */ int32_t OH_ArkUI_SetArkUIGestureRecognizerDisposeNotify(ArkUI_GestureRecognizer* recognizer, ArkUI_GestureRecognizerDisposeNotifyCallback callback, void* userData); diff --git a/arkui/ace_engine/native/native_interface_accessibility.h b/arkui/ace_engine/native/native_interface_accessibility.h index 09f8b97e56cf86c03016abe10997c91f1c27e601..d765c7d77a0b5fc757fd620db7b86c4bc4009f82 100644 --- a/arkui/ace_engine/native/native_interface_accessibility.h +++ b/arkui/ace_engine/native/native_interface_accessibility.h @@ -27,6 +27,8 @@ * @file native_interface_accessibility.h * * @brief Declares the APIs used to access the native Accessibility. + * + * @library libace_ndk.z.so * @syscap SystemCapability.ArkUI.ArkUI.Full * @kit ArkUI * @since 13 @@ -1031,3 +1033,4 @@ int32_t OH_ArkUI_FindAccessibilityActionArgumentByKey( }; #endif #endif // _NATIVE_INTERFACE_ACCESSIBILITY_H +/** @} */ \ No newline at end of file diff --git a/arkui/ace_engine/native/native_key_event.h b/arkui/ace_engine/native/native_key_event.h index 0ab0303a12598873217f2782af77e281d47ea5ae..70958a8139066300cbc9271b6b021031f98b518f 100644 --- a/arkui/ace_engine/native/native_key_event.h +++ b/arkui/ace_engine/native/native_key_event.h @@ -447,36 +447,6 @@ const char *OH_ArkUI_KeyEvent_GetKeyText(const ArkUI_UIInputEvent* event); */ ArkUI_KeySourceType OH_ArkUI_KeyEvent_GetKeySource(const ArkUI_UIInputEvent* event); -/** - * @brief Obtains the ID of device that triggers a key event. - * - * @param event Pointer to an ArkUI_UIInputEvent object. - * @return Returns the device ID. - * @since 14 - */ -int32_t OH_ArkUI_KeyEvent_GetDeviceId(const ArkUI_UIInputEvent* event); - -/** - * @brief Obtains the state of the meta key (that is, the WIN key on the Windows keyboard or the Command - * key on the Mac keyboard) when a key event occurs. - * - * @param event Pointer to an ArkUI_UIInputEvent object. - * @return Returns the state of the meta key. The value 1 means that the key is pressed, and 0 means the - * opposite. - * @since 14 - */ -int32_t OH_ArkUI_KeyEvent_GetMetaKey(const ArkUI_UIInputEvent* event); - -/** - * @brief Obtains the timestamp of a key event. It is the interval between the time when the event is triggered and the - * time when the system starts, in nanoseconds. - * - * @param event Pointer to an ArkUI_UIInputEvent object. - * @return Returns the event timestamp, in nanoseconds. - * @since 14 - */ -uint64_t OH_ArkUI_KeyEvent_GetTimestamp(const ArkUI_UIInputEvent* event); - /** * @brief Prevents a key event from bubbling up. * @@ -486,18 +456,6 @@ uint64_t OH_ArkUI_KeyEvent_GetTimestamp(const ArkUI_UIInputEvent* event); */ void OH_ArkUI_KeyEvent_StopPropagation(const ArkUI_UIInputEvent* event, bool stopPropagation); -/** - * @brief Obtains the pressed status of modifier keys from a key event. - * The following modifier keys are supported: Ctrl, Alt, Shift, Fn. However, the Fn key on external keyboards - * is not supported. - * - * @param event Pointer to an ArkUI_UIInputEvent object. - * @param modifierKeys Modifier keys to check, which must be created using {@link ArkUI_ModifierKeyName}. - * @return Returns whether the pressed status of the modifier keys. - * @since 14 - */ -bool OH_ArkUI_KeyEvent_GetModifierKeyState(const ArkUI_UIInputEvent* event, uint32_t modifierKeys); - /** * @brief Obtains the intention code associated with a key event. * diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 957b003fdc55dff9fcd7953cf845637ce200dd85..d46271f357305601d248d6fa932094e811995796 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -1792,6 +1792,16 @@ typedef enum { */ NODE_TRANSITION = 94, + /** + * @brief Defines the component ID. + * This attribute can be obtained through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for obtaining the attribute:\n + * .value[0].i32: component ID. \n + * + */ + NODE_UNIQUE_ID = 95, + /** * @brief Set the current component system focus box style. * @@ -1806,16 +1816,6 @@ typedef enum { */ NODE_FOCUS_BOX = 96, - /** - * @brief Defines the component ID. - * This attribute can be obtained through APIs. - * - * Format of the {@link ArkUI_AttributeItem} parameter for obtaining the attribute:\n - * .value[0].i32: component ID. \n - * - */ - NODE_UNIQUE_ID = 95, - /** * @brief Defines the moving distance limit for the component-bound tap gesture. * This attribute can be set as required through APIs. @@ -4534,6 +4534,9 @@ typedef enum { * The default unit is vp. \n * .value[1].f32: total height of all child components when fully expanded in the scrollable component. * The default unit is vp. \n + * When NODE_PADDING, NODE_MARGIN, or NODE_BORDER_WIDTH is set, the values are rounded to the + * nearest pixel when being converted from vp to px. + * The returned values are calculated based on these rounded pixel values. \n * * @since 14 */ @@ -4935,8 +4938,8 @@ typedef enum { * * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n * .value[0].i32:Specify the index value of the page in Swiper.\n - * .value[1]?.i32:Set whether there is an animation effect when flipping to the specified page. 1 indicates active - * effect, 0 indicates no active effect, default value is 0。\n + * .value[1]?.i32:Set the animation effect mode when turning to the specified page. 2 indicates the use of a fast + * animation effect, 1 indicates default animation effect, 0 indicates no active effect, default value is 0。\n */ NODE_SWIPER_SWIPE_TO_INDEX, @@ -7951,4 +7954,4 @@ float OH_ArkUI_SystemFontStyleEvent_GetFontWeightScale(const ArkUI_SystemFontSty #endif #endif // ARKUI_NATIVE_NODE_H -/** @}*/ +/** @} */ diff --git a/arkui/ace_engine/native/ui_input_event.h b/arkui/ace_engine/native/ui_input_event.h index c9373cf0e3e219c4c91eed6bdf251d9e95548fc1..85a377f12d03eab16bfb4f5af1655dc8d32ddf8c 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -716,6 +716,33 @@ int32_t OH_ArkUI_MouseEvent_GetMouseAction(const ArkUI_UIInputEvent* event); */ int32_t OH_ArkUI_PointerEvent_SetStopPropagation(const ArkUI_UIInputEvent* event, bool stopPropagation); +/** + * @brief Obtains the ID of device that triggers UI input event. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @return Returns the device ID. + * @since 14 + */ +int32_t OH_ArkUI_UIInputEvent_GetDeviceId(const ArkUI_UIInputEvent* event); + +/** + * @brief Obtains the pressed status of modifier keys from UI input event. + * The following modifier keys are supported: Ctrl, Alt, Shift, Fn. However, the Fn key on external keyboards + * is not supported. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @param pressedKeyCodes Array of all keys that are pressed. You need to allocate the memory space. + * @param length Length of the passed pressedKeyCodes array (when used as an input parameter); + * number of the keys pressed (when used as an output parameter). + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} if the giving buffer is not enough. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 14 + */ +int32_t OH_ArkUI_UIInputEvent_GetPressedKeys( + const ArkUI_UIInputEvent* event, int32_t* pressedKeyCodes, int32_t* length); + #ifdef __cplusplus }; #endif diff --git a/arkui/display_manager/oh_display_capture.h b/arkui/display_manager/oh_display_capture.h index a9fd997b1bc0b8ec5ec2c85f4af2164b0a7f2c5b..0e150db686cd5c4cf64fb5b12b8904352725c7ff 100644 --- a/arkui/display_manager/oh_display_capture.h +++ b/arkui/display_manager/oh_display_capture.h @@ -49,6 +49,7 @@ extern "C" { /** * @brief Capture a screen pixelmap of the specified display. * + * @permission {@code ohos.permission.CUSTOM_SCREEN_CAPTURE} * @param displayId The ID of the display to be captured. * @param pixelMap The output pixel map of the captured display. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful. diff --git a/arkui/display_manager/oh_display_info.h b/arkui/display_manager/oh_display_info.h index 2a4bda3fb7643a3de473854eb0dc58f5c2674331..82b38a098a0f8cb1d432206cead97a07f1bbaa4a 100644 --- a/arkui/display_manager/oh_display_info.h +++ b/arkui/display_manager/oh_display_info.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OH_NATIVE_DISPLAY_INFO_H -#define OH_NATIVE_DISPLAY_INFO_H - /** * @addtogroup OH_DisplayInfo * @{ @@ -39,6 +36,11 @@ * @version 1.0 */ + +#ifndef OH_NATIVE_DISPLAY_INFO_H +#define OH_NATIVE_DISPLAY_INFO_H + + #include "stdint.h" #ifdef __cplusplus diff --git a/arkui/display_manager/oh_display_manager.h b/arkui/display_manager/oh_display_manager.h index caf6480af564b5617e0639d8de5eeddd93131147..7f8e45c2b2c36a941c732a87c3a013c50db0eea8 100644 --- a/arkui/display_manager/oh_display_manager.h +++ b/arkui/display_manager/oh_display_manager.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OH_NATIVE_DISPLAY_MANAGER_H -#define OH_NATIVE_DISPLAY_MANAGER_H - /** * @addtogroup OH_DisplayManager * @{ @@ -33,12 +30,16 @@ * @brief Defines the data structures for the C APIs of the display module. * * @kit ArkUI - * @library libnative_display_manager.so. + * @library libnative_display_manager.so * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 12 * @version 1.0 */ +#ifndef OH_NATIVE_DISPLAY_MANAGER_H +#define OH_NATIVE_DISPLAY_MANAGER_H + + #include "oh_display_info.h" #ifdef __cplusplus @@ -48,7 +49,7 @@ extern "C" { /** * @brief Obtain the default display Id. * - * @param { *displayId } Indicates the pointer to an uint64_t object. + * @param displayId Indicates the pointer to an uint64_t object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -60,7 +61,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayId(uint6 /** * @brief Obtain the default display width. * - * @param { *displayWidth } Indicates the pointer to an int32_t object. + * @param displayWidth Indicates the pointer to an int32_t object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -72,7 +73,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayWidth(in /** * @brief Obtain the default display height. * - * @param { *displayHeight } Indicates the pointer to an int32_t object. + * @param displayHeight Indicates the pointer to an int32_t object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -84,7 +85,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayHeight(i /** * @brief Obtain the default display rotation. * - * @param { *displayRotation } Indicates the pointer to an NativeDisplayManager_Rotation object. + * @param displayRotation Indicates the pointer to an NativeDisplayManager_Rotation object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -97,7 +98,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayRotation /** * @brief Obtain the default display orientation. * - * @param { *displayOrientation } Indicates the pointer to an NativeDisplayManager_Orientation object. + * @param displayOrientation Indicates the pointer to an NativeDisplayManager_Orientation object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -110,7 +111,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayOrientat /** * @brief Obtain the default display virtualPixels. * - * @param { *virtualPixels } Indicates the pointer to an float object. + * @param virtualPixels Indicates the pointer to an float object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -122,7 +123,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayVirtualP /** * @brief Obtain the default display refreshRate. * - * @param { *refreshRate } Indicates the pointer to an uint32_t object. + * @param refreshRate Indicates the pointer to an uint32_t object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -134,7 +135,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayRefreshR /** * @brief Obtain the default display densityDpi. * - * @param { *densityDpi } Indicates the pointer to an int32_t object. + * @param densityDpi Indicates the pointer to an int32_t object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -146,7 +147,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityD /** * @brief Obtain the default display densityPixels. * - * @param { *densityPixels } Indicates the pointer to an float object. + * @param densityPixels Indicates the pointer to an float object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -158,7 +159,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityP /** * @brief Obtain the default display scaledDensity. * - * @param { *scaledDensity } Indicates the pointer to an float object. + * @param scaledDensity Indicates the pointer to an float object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -170,7 +171,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayScaledDe /** * @brief Obtain the default display xDpi. * - * @param { *xDpi } Indicates the pointer to an float object. + * @param xDpi Indicates the pointer to an float object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -182,7 +183,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityX /** * @brief Obtain the default display yDpi. * - * @param { *yDpi } Indicates the pointer to an float object. + * @param yDpi Indicates the pointer to an float object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -194,7 +195,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityY /** * @brief Create the cutout info of the device. * - * @param { **cutoutInfo } Indicates the pointer to an NativeDisplayManager_CutoutInfo object. + * @param cutoutInfo Indicates the pointer to an NativeDisplayManager_CutoutInfo object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -207,7 +208,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateDefaultDisplayCutou /** * @brief Destroy an NativeDisplayManager_CutoutInfo object and reclaims the memory occupied by the object. * - * @param { **cutoutInfo } Indicates the pointer to an NativeDisplayManager_CutoutInfo object. + * @param cutoutInfo Indicates the pointer to an NativeDisplayManager_CutoutInfo object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * @syscap SystemCapability.WindowManager.WindowManager.Core @@ -228,7 +229,7 @@ bool OH_NativeDisplayManager_IsFoldable(); /** * @brief Get the display mode of the foldable device. * - * @param { *displayMode } Indicates the pointer to an NativeDisplayManager_FoldDisplayMode object. + * @param displayMode Indicates the pointer to an NativeDisplayManager_FoldDisplayMode object. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. @@ -241,7 +242,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetFoldDisplayMode( /** * @brief the callback function type when display change. * - * @param { *displayId } change display id. + * @param displayId change display id. * @syscap SystemCapability.Window.SessionManager * @since 12 */ @@ -250,8 +251,8 @@ typedef void (*OH_NativeDisplayManager_DisplayChangeCallback)(uint64_t displayId /** * @brief Register the callback for display change listener. * - * @param { displayChangeCallback } display change callback. - * @param { *listenerIndex } Indicates the pointer to an uint32_t object. used in unregister call. + * @param displayChangeCallback display change callback. + * @param listenerIndex Indicates the pointer to an uint32_t object. used in unregister call. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -264,7 +265,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterDisplayChangeList /** * @brief Unregister the callback for display changes listener. * - * @param { listenerIndex } display changed listener index. + * @param listenerIndex display changed listener index. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally. @@ -276,7 +277,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterDisplayChangeLi /** * @brief the callback function type when display fold change. * - * @param { displayMode } current fold display mode. + * @param displayMode current fold display mode. * @syscap SystemCapability.Window.SessionManager * @since 12 */ @@ -286,8 +287,8 @@ typedef void (*OH_NativeDisplayManager_FoldDisplayModeChangeCallback)( /** * @brief Register the callback for display mode change listener. * - * @param { displayModeChangeCallback } display mode change callback. - * @param { *listenerIndex } Indicates the pointer to an uint32_t object. used in unregister call. + * @param displayModeChangeCallback display mode change callback. + * @param listenerIndex Indicates the pointer to an uint32_t object. used in unregister call. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. @@ -301,7 +302,7 @@ NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterFoldDisplayModeCh /** * @brief Unregister the callback for display mode change listener. * - * @param { listenerIndex } display mode change listener index. + * @param listenerIndex display mode change listener index. * @return { @link DISPLAY_MANAGER_OK } If the operation is successful * { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error. * { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support. diff --git a/arkui/napi/common.h b/arkui/napi/common.h index e5e5c8d5e219b6dd8929c702c469186742d31c7d..6e8ac4aa0366595475bfc0a2cade32401f5e7869 100644 --- a/arkui/napi/common.h +++ b/arkui/napi/common.h @@ -13,6 +13,28 @@ * limitations under the License. */ +/** + * @addtogroup ArkTS_Napi_NativeModule + * @{ + * + * + * @brief Provides native api of ArkTS native module. + * + * @since 10 + */ + +/** + * @file common.h + * + * @brief Defines common enum types of ArkTS native module. + * + * @kit ArkTS + * @library libace_napi.z.so + * @syscap SystemCapability.ArkUI.ArkUI.Napi + * @since 10 + * @version 1.0 + */ + #ifndef FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_COMMON_H #define FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_COMMON_H @@ -67,4 +89,5 @@ typedef enum { napi_priority_idle = 3, } napi_task_priority; -#endif /* FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H */ \ No newline at end of file +#endif /* FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H */ +/** @} */ \ No newline at end of file diff --git a/arkui/napi/native_api.h b/arkui/napi/native_api.h index a45ce8476fc01722462abbd8444fdf8bdbcd1433..b05497312cab650eef8fe65b03be1d38d6d546cf 100644 --- a/arkui/napi/native_api.h +++ b/arkui/napi/native_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * 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 @@ -13,35 +13,56 @@ * limitations under the License. */ +/** + * @addtogroup ArkTS_Napi_NativeModule + * @{ + * + * + * @brief Provides native api of ArkTS native module. + * + * @since 10 + */ + +/** + * @file native_api.h + * + * @brief Defines native api of ArkTS native module. + * + * @kit ArkTS + * @library libace_napi.z.so + * @syscap SystemCapability.ArkUI.ArkUI.Napi + * @since 10 + * @version 1.0 + */ + #ifndef FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H #define FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H #ifndef NAPI_VERSION #define NAPI_VERSION 8 -#endif +#endif // NAPI_VERSION #ifndef NAPI_EXPERIMENTAL #define NAPI_EXPERIMENTAL -#endif +#endif // NAPI_EXPERIMENTAL #include "common.h" #include "node_api.h" #ifdef NAPI_TEST -#ifdef _WIN32 +#ifdef _WIN32 // WIN32 #define NAPI_INNER_EXTERN __declspec(dllexport) -#else +#else // NON-WIN32 #define NAPI_INNER_EXTERN __attribute__((visibility("default"))) -#endif -#else +#endif // _WIN32 + +#else // NAPI_TEST #ifdef _WIN32 #define NAPI_INNER_EXTERN __declspec(deprecated) #else #define NAPI_INNER_EXTERN __attribute__((__deprecated__)) +#endif // __WIN32 #endif -#endif - -NAPI_EXTERN napi_status napi_fatal_exception(napi_env env, napi_value err); NAPI_EXTERN napi_status napi_create_string_utf16(napi_env env, const char16_t* str, @@ -67,7 +88,6 @@ NAPI_INNER_EXTERN napi_status napi_adjust_external_memory(napi_env env, int64_t change_in_bytes, int64_t* adjusted_value); - #ifdef __cplusplus extern "C" { #endif @@ -79,6 +99,7 @@ extern "C" { * @since 11 */ typedef void* (*napi_native_binding_detach_callback)(napi_env env, void* native_object, void* hint); + /** * @brief Native attach callback of napi_coerce_to_native_binding_object that can be used to * bind the js object and the native object. @@ -89,68 +110,218 @@ typedef napi_value (*napi_native_binding_attach_callback)(napi_env env, void* na NAPI_EXTERN napi_status napi_run_script_path(napi_env env, const char* path, napi_value* result); NAPI_EXTERN napi_status napi_queue_async_work_with_qos(napi_env env, napi_async_work work, napi_qos_t qos); -NAPI_EXTERN napi_status napi_load_module(napi_env env, const char* path, napi_value* result); /** - * @brief The module is loaded through the NAPI. By default, the default object is exported from the module. + * @brief Loads an .abc file as a module. This API returns the namespace of the module. + * @param env Current running virtual machine context. + * @param path Path of the .abc file or name of the module to load. + * @param result Result of the module object. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_load_module(napi_env env, + const char* path, + napi_value* result); + +/** + * @brief Associates data with the currently running environment. * * @param env Current running virtual machine context. - * @param path Path name of the module to be loaded, like @ohos.hilog. - * @param module_info Path names of bundle and module, like com.example.application/entry. - * @param result Result of loading a module, which is an exported object of the module. + * @param data Data item to bind with the 'env'. + * @param finalize_cb Optional native callback that will be triggered when 'env' is destroyed or this interface + * repeatedly calls. + * @param finalize_hint Optional contextual hint that is passed to the finalize callback. + * * @return Returns the function execution status. - * @since 12 -*/ -NAPI_EXTERN napi_status napi_load_module_with_info(napi_env env, - const char* path, - const char* module_info, - napi_value* result); -NAPI_EXTERN napi_status napi_get_instance_data(napi_env env, void** data); + * @since 11 + */ NAPI_EXTERN napi_status napi_set_instance_data(napi_env env, void* data, napi_finalize finalize_cb, void* finalize_hint); -NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(napi_env env, void (*fun)(void* arg), void* arg); -NAPI_EXTERN napi_status napi_add_env_cleanup_hook(napi_env env, void (*fun)(void* arg), void* arg); -NAPI_EXTERN napi_status napi_remove_async_cleanup_hook(napi_async_cleanup_hook_handle remove_handle); + +/** + * @brief Retrieves the data that was previously associated with the currently running environment. + * + * @param env Current running virtual machine context. + * @param data Data item is bound with the 'env'. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_get_instance_data(napi_env env, + void** data); + +/** + * @brief Registers a clean-up hook for releasing resources when the environment exits. + * + * @param env Current running virtual machine context. + * @param fun Function pointer which will be triggered when environment is destroy. + * @param arg The argument is passed to the function pointer 'fun'. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_add_env_cleanup_hook(napi_env env, + void (*fun)(void* arg), + void* arg); + +/** + * @brief Unregisters the clean-up hook. + * + * @param env Current running virtual machine context. + * @param fun Function pointer which will be triggered when environment is destroy. + * @param arg The argument is passed to the function pointer 'fun'. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(napi_env env, + void (*fun)(void* arg), + void* arg); + +/** + * @brief Registers an asynchronous clean-up hook for releasing resources when the environment exits. + * + * @param env Current running virtual machine context. + * @param hook The function pointer to call at environment teardown. + * @param arg The pointer to pass to `hook` when it gets called. + * @param remove_handle Optional handle that refers to the asynchronous cleanup. + * + * @return Returns the function execution status. + * @since 11 + */ NAPI_EXTERN napi_status napi_add_async_cleanup_hook(napi_env env, napi_async_cleanup_hook hook, void* arg, napi_async_cleanup_hook_handle* remove_handle); -NAPI_EXTERN napi_status napi_async_destroy(napi_env env, - napi_async_context async_context); + +/** + * @brief Unregisters the asynchronous clean-up hook. + * + * @param remove_handle Optional handle that refers to the asynchronous cleanup. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_remove_async_cleanup_hook(napi_async_cleanup_hook_handle remove_handle); + +/** + * @brief Creates an asynchronous context. The capabilities related to 'async_hook' are not supported currently. + * + * @param env Current running virtual machine context. + * @param async_resource Object associated with the async work that will be passed to possible 'async_hook'. + * @param async_resource_name Identifier for the kind of resource that is being provided for diagnostic information + * exposed by the async_hooks API. + * @param result The initialized async context. + * + * @return Returns the function execution status. + * @since 11 + */ NAPI_EXTERN napi_status napi_async_init(napi_env env, napi_value async_resource, napi_value async_resource_name, napi_async_context* result); -NAPI_EXTERN napi_status napi_close_callback_scope(napi_env env, napi_callback_scope scope); + +/** + * @brief Destroys the previously created asynchronous context. The capabilities related to 'async_hook' are not + * supported currently. + * + * @param env Current running virtual machine context. + * @param async_context The async context to be destroyed. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_async_destroy(napi_env env, + napi_async_context async_context); + +/** + * @brief Opens a callback scope. The capabilities related to 'async_hook' are not supported currently. + * @param env Current running virtual machine context. + * @param resource_object The resource object to be passed to possible 'async_hook'. + * @param context The context environment for the async operation. + * @param result The generated callback scope. + * + * @return Returns the function execution status. + * @since 11 + */ NAPI_EXTERN napi_status napi_open_callback_scope(napi_env env, napi_value resource_object, napi_async_context context, napi_callback_scope* result); -NAPI_EXTERN napi_status node_api_get_module_file_name(napi_env env, const char** result); -// Create JSObject with initial properties given by descriptors, note that property key must be String, -// and must can not convert to element_index, also all keys must not duplicate. + +/** + * @brief Closes the callback scope. The capabilities related to 'async_hook' are not supported currently. + * + * @param env Current running virtual machine context. + * @param scope The callback scope to be closed. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_close_callback_scope(napi_env env, + napi_callback_scope scope); + +/** + * @brief Obtains the absolute path of the location, from which the addon is loaded. + * + * @param env Current running virtual machine context. + * @param result The absolute path of the location of the loaded addon. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status node_api_get_module_file_name(napi_env env, + const char** result); + +/** + * @brief Create JSObject with initial properties given by descriptors, note that property key must be String, and + * must can not convert to element_index, also all keys must not duplicate. + * + * @param env Current running virtual machine context. + * @param result The created ArkTS object. + * @param property_count Number of the property descriptors. + * @param properties Array of property descriptors which are expected to be applied to the ArkTS object. + * + * @return Returns the function execution status. + * @since 11 + */ NAPI_EXTERN napi_status napi_create_object_with_properties(napi_env env, napi_value* result, size_t property_count, const napi_property_descriptor* properties); -// Create JSObject with initial properties given by keys and values, note that property key must be String, -// and must can not convert to element_index, also all keys must not duplicate. + +/** + * @brief Create JSObject with initial properties given by keys and values, note that property key must be String, and + * must can not convert to element_index, also all keys must not duplicate. + * + * @param env Current running virtual machine context. + * @param result The absolute path of the location of the loaded addon. + * @param property_count Number of the propertied which needs to be applied on the ArkTS object. + * @param keys Array of the keys of the properties. + * @param values Array of the values of the properties. + * + * @return Returns the function execution status. + * @since 11 + */ NAPI_EXTERN napi_status napi_create_object_with_named_properties(napi_env env, napi_value* result, size_t property_count, const char** keys, const napi_value* values); + /** * @brief This API sets native properties to a object and converts this js object to native binding object. * - * @param[in] env Current running virtual machine context. - * @param[in] js_object The JavaScript value to coerce. - * @param[in] detach_cb Native callback that can be used to detach the js object and the native object. - * @param[in] attach_cb Native callback that can be used to bind the js object and the native object. - * @param[in] native_object User-provided native instance to pass to thr detach callback and attach callback. - * @param[in] hint Optional hint to pass to the detach callback and attach callback. + * @param env Current running virtual machine context. + * @param js_object The JavaScript value to coerce. + * @param detach_cb Native callback that can be used to detach the js object and the native object. + * @param attach_cb Native callback that can be used to bind the js object and the native object. + * @param native_object User-provided native instance to pass to thr detach callback and attach callback. + * @param hint Optional hint to pass to the detach callback and attach callback. + * * @return Return the function execution status. * @since 11 */ @@ -160,16 +331,50 @@ NAPI_EXTERN napi_status napi_coerce_to_native_binding_object(napi_env env, napi_native_binding_attach_callback attach_cb, void* native_object, void* hint); + +/** + * @brief Adds a 'napi_finalize' callback, which will be called when the ArkTS object is garbage-collected. + * + * @param env Current running virtual machine context. + * @param js_object The ArkTS object value. + * @param native_object Native object to bind with the ArkTS object. + * @param finalize_cb Native callback that can be used to free the native object when the ArkTS object is + garbage-collected. + * @param finalize_hint Optional contextual hint that is passed to the finalize callback. + * @param result Optional reference of the ArkTS object. + * + * @return Return the function execution status. + * @since 11 + */ NAPI_EXTERN napi_status napi_add_finalizer(napi_env env, napi_value js_object, void* native_object, napi_finalize finalize_cb, void* finalize_hint, napi_ref* result); + +/** + * @brief The module is loaded through the NAPI. By default, the default object is exported from the module. + * + * @param env Current running virtual machine context. + * @param path Path name of the module to be loaded, like @ohos.hilog. + * @param module_info Path names of bundle and module, like com.example.application/entry. + * @param result Result of loading a module, which is an exported object of the module. + * + * @return Returns the function execution status. + * @since 12 + */ +NAPI_EXTERN napi_status napi_load_module_with_info(napi_env env, + const char* path, + const char* module_info, + napi_value* result); + /** * @brief Create the ark runtime. * * @param env Indicates the ark runtime environment. + * + * @return Return the function execution status. * @since 12 */ NAPI_EXTERN napi_status napi_create_ark_runtime(napi_env* env); @@ -178,23 +383,26 @@ NAPI_EXTERN napi_status napi_create_ark_runtime(napi_env* env); * @brief Destroy the ark runtime. * * @param env Indicates the ark runtime environment. + * + * @return Return the function execution status. * @since 12 */ NAPI_EXTERN napi_status napi_destroy_ark_runtime(napi_env* env); -/* +/** * @brief Defines a sendable class. * - * @param env: The environment that the API is invoked under. - * @param utf8name: Name of the ArkTS constructor function. - * @param length: The length of the utf8name in bytes, or NAPI_AUTO_LENGTH if it is null-terminated. - * @param constructor: Callback function that handles constructing instances of the class. - * @param data: Optional data to be passed to the constructor callback as the data property of the callback info. - * @param property_count: Number of items in the properties array argument. - * @param properties: Array of property descriptors describing static and instance data properties, accessors, and - * methods on the class. See napi_property_descriptor. - * @param parent: A napi_value representing the Superclass. - * @param result: A napi_value representing the constructor function for the class. + * @param env The environment that the API is invoked under. + * @param utf8name Name of the ArkTS constructor function. + * @param length The length of the utf8name in bytes, or NAPI_AUTO_LENGTH if it is null-terminated. + * @param constructor Callback function that handles constructing instances of the class. + * @param data Optional data to be passed to the constructor callback as the data property of the callback info. + * @param property_count Number of items in the properties array argument. + * @param properties Array of property descriptors describing static and instance data properties, accessors, and + * methods on the class. See napi_property_descriptor. + * @param parent A napi_value representing the Superclass. + * @param result A napi_value representing the constructor function for the class. + * * @return Return the function execution status. * @since 12 */ @@ -214,116 +422,151 @@ NAPI_EXTERN napi_status napi_define_sendable_class(napi_env env, * @param env The environment that the API is invoked under. * @param value The napi_value to be checked. * @param result Boolean value that is set to true if napi_value is sendable, false otherwise. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_is_sendable(napi_env env, napi_value value, bool* result); +NAPI_EXTERN napi_status napi_is_sendable(napi_env env, + napi_value value, + bool* result); + /** * @brief Defines a sendable object. * * @param env The environment that the API is invoked under. * @param property_count The count of object properties. * @param properties Object properties. + * @param result The created sendable object. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_create_sendable_object_with_properties(napi_env env, size_t property_count, +NAPI_EXTERN napi_status napi_create_sendable_object_with_properties(napi_env env, + size_t property_count, const napi_property_descriptor* properties, napi_value* result); + /** * @brief Wraps a native instance in a ArkTS object. * * @param env The environment that the API is invoked under. * @param js_object The ArkTS object that will be the wrapper for the native object. * @param native_object The native instance that will be wrapped in the ArkTS object. - * @param finalize_lib Optional native callback that can be used to free the native instance when the ArkTS object + * @param finalize_cb Optional native callback that can be used to free the native instance when the ArkTS object * has been garbage-collected. * @param finalize_hint Optional contextual hint that is passed to the finalize callback. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_wrap_sendable(napi_env env, napi_value js_object, void* native_object, - napi_finalize finalize_cb, void* finalize_hint); +NAPI_EXTERN napi_status napi_wrap_sendable(napi_env env, + napi_value js_object, + void* native_object, + napi_finalize finalize_cb, + void* finalize_hint); + /** * @brief Wraps a native instance in a ArkTS object. * * @param env The environment that the API is invoked under. * @param js_object The ArkTS object that will be the wrapper for the native object. * @param native_object The native instance that will be wrapped in the ArkTS object. - * @param finalize_lib Optional native callback that can be used to free the native instance when the ArkTS object - * has been garbage-collected. + * @param finalize_cb Optional native callback that can be used to free the native instance when the ArkTS object + * has been garbage-collected. * @param finalize_hint Optional contextual hint that is passed to the finalize callback. * @param native_binding_size The size of native binding. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_wrap_sendable_with_size(napi_env env, napi_value js_object, void* native_object, - napi_finalize finalize_cb, void* finalize_hint, +NAPI_EXTERN napi_status napi_wrap_sendable_with_size(napi_env env, + napi_value js_object, + void* native_object, + napi_finalize finalize_cb, + void* finalize_hint, size_t native_binding_size); + /** * @brief Retrieves a native instance that was previously wrapped in a ArkTS object. * * @param env The environment that the API is invoked under. * @param js_object The object associated with the native instance. * @param result Pointer to the wrapped native instance. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_unwrap_sendable(napi_env env, napi_value js_object, void** result); +NAPI_EXTERN napi_status napi_unwrap_sendable(napi_env env, + napi_value js_object, + void** result); + /** * @brief Retrieves a native instance that was previously wrapped in a ArkTS object and removes the wrapping. * * @param env The environment that the API is invoked under. * @param js_object The object associated with the native instance. * @param result Pointer to the wrapped native instance. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_remove_wrap_sendable(napi_env env, napi_value js_object, void** result); -/* +NAPI_EXTERN napi_status napi_remove_wrap_sendable(napi_env env, + napi_value js_object, + void** result); + +/** * @brief Create a sendable array. * - * @param env: The environment that the API is invoked under. - * @param result: A napi_value representing a sendable array. + * @param env The environment that the API is invoked under. + * @param result A napi_value representing a sendable array. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_create_sendable_array(napi_env env, napi_value* result); +NAPI_EXTERN napi_status napi_create_sendable_array(napi_env env, + napi_value* result); -/* +/** * @brief Create a sendable array with length. * - * @param env: The environment that the API is invoked under. - * @param length: The initial length of the sendable array. - * @param result: A napi_value representing a sendable array. + * @param env The environment that the API is invoked under. + * @param length The initial length of the sendable array. + * @param result A napi_value representing a sendable array. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_create_sendable_array_with_length(napi_env env, size_t length, napi_value* result); +NAPI_EXTERN napi_status napi_create_sendable_array_with_length(napi_env env, + size_t length, + napi_value* result); -/* +/** * @brief Create a sendable arraybuffer. * - * @param env: The environment that the API is invoked under. - * @param byte_length: The length in bytes of the sendable arraybuffer to create. - * @param data: Pointer to the underlying byte buffer of the sendable arraybuffer. - * @param result: A napi_value representing a sendable arraybuffer. + * @param env The environment that the API is invoked under. + * @param byte_length The length in bytes of the sendable arraybuffer to create. + * @param data Pointer to the underlying byte buffer of the sendable arraybuffer. + * @param result A napi_value representing a sendable arraybuffer. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_create_sendable_arraybuffer(napi_env env, size_t byte_length, - void** data, napi_value* result); +NAPI_EXTERN napi_status napi_create_sendable_arraybuffer(napi_env env, + size_t byte_length, + void** data, + napi_value* result); -/* +/** * @brief Create a sendable typedarray. * - * @param env: The environment that the API is invoked under. - * @param type: Scalar datatype of the elements within the sendable typedarray. - * @param length: Number of elements in the typedarray. - * @param arraybuffer: Sendable arraybuffer underlying the sendable typedarray. - * @param byte_offset: The byte offset within the sendable arraybuffer from - * which to start projecting the sendable typedarray. - * @param result: A napi_value representing a sendable typedarray. + * @param env The environment that the API is invoked under. + * @param type Scalar datatype of the elements within the sendable typedarray. + * @param length Number of elements in the typedarray. + * @param arraybuffer Sendable arraybuffer underlying the sendable typedarray. + * @param byte_offset The byte offset within the sendable arraybuffer from which to start projecting the + * sendable typedarray. + * @param result A napi_value representing a sendable typedarray. + * * @return Return the function execution status. * @since 12 */ @@ -341,10 +584,12 @@ NAPI_EXTERN napi_status napi_create_sendable_typedarray(napi_env env, * * @param env Current running virtual machine context. * @param mode Indicates the running mode of the native event loop. + * * @return Return the function execution status. * @since 12 */ -NAPI_EXTERN napi_status napi_run_event_loop(napi_env env, napi_event_mode mode); +NAPI_EXTERN napi_status napi_run_event_loop(napi_env env, + napi_event_mode mode); /** * @brief Stop the event loop in current thread. @@ -352,6 +597,7 @@ NAPI_EXTERN napi_status napi_run_event_loop(napi_env env, napi_event_mode mode); * Support to stop the running event loop in current native thread. * * @param env Current running virtual machine context. + * * @return Return the function execution status. * @since 12 */ @@ -365,9 +611,10 @@ NAPI_EXTERN napi_status napi_stop_event_loop(napi_env env); * @param transfer_list List of data to transfer in transfer mode. * @param clone_list List of Sendable data to transfer in clone mode. * @param result Serialization result of the JS object. + * * @return Returns the function execution status. * @since 12 -*/ + */ NAPI_EXTERN napi_status napi_serialize(napi_env env, napi_value object, napi_value transfer_list, @@ -380,20 +627,25 @@ NAPI_EXTERN napi_status napi_serialize(napi_env env, * @param env Current running virtual machine context. * @param buffer Data to deserialize. * @param object ArkTS object obtained by deserialization. + * * @return Returns the function execution status. * @since 12 -*/ -NAPI_EXTERN napi_status napi_deserialize(napi_env env, void* buffer, napi_value* object); + */ +NAPI_EXTERN napi_status napi_deserialize(napi_env env, + void* buffer, + napi_value* object); /** * @brief Delete serialization data. * * @param env Current running virtual machine context. * @param buffer Data to delete. + * * @return Returns the function execution status. * @since 12 -*/ -NAPI_EXTERN napi_status napi_delete_serialization_data(napi_env env, void* buffer); + */ +NAPI_EXTERN napi_status napi_delete_serialization_data(napi_env env, + void* buffer); /** * @brief Dispatch a task with specified priority from a native thread to an ArkTS thread, the task will execute @@ -405,6 +657,7 @@ NAPI_EXTERN napi_status napi_delete_serialization_data(napi_env env, void* buffe * @param isTail Indicates the way of the task dispatched into the native event queue. When "isTail" is true, * the task will be dispatched to the tail of the native event queue. Conversely, when "isTail" is false, the * tasks will be dispatched to the head of the native event queue. + * * @return Return the function execution status. * @since 12 */ @@ -412,7 +665,58 @@ NAPI_EXTERN napi_status napi_call_threadsafe_function_with_priority(napi_threads void *data, napi_task_priority priority, bool isTail); + +/** + * @brief Throws UncaughtException to ArkTS. + * @param env Current running virtual machine context. + * @param err Error object which is passed to 'UncaughtException'. + * + * @return Returns the function execution status. + * @since 12 + */ +NAPI_EXTERN napi_status napi_fatal_exception(napi_env env, + napi_value err); + +/** + * @brief Allows a JS function to be called in the asynchronous context. The capabilities related to 'async_hook' are + * not supported currently. + * @param env Current running virtual machine context. + * @param async_context The context environment for the async operation. + * @param recv The 'this' pointer of the function. + * @param func ArkTS function to be called. + * @param argc Size of the argument array which is passed to 'func'. + * @param argv Argument array. + * @param result Result returned by the ArkTS function. + * + * @return Returns the function execution status. + * @since 11 + */ +NAPI_EXTERN napi_status napi_make_callback(napi_env env, + napi_async_context async_context, + napi_value recv, + napi_value func, + size_t argc, + const napi_value* argv, + napi_value* result); + +/** + * @brief Creates a ArkTS buffer of the specified size. + * @param env Current running virtual machine context. + * @param length The size of the buffer to be created. + * @param data Raw pointer of the ArkTS buffer. + * @param result Result returned by the ArkTS function. + * + * @return Returns the function execution status. + * @since 10 + */ +NAPI_EXTERN napi_status napi_create_buffer(napi_env env, + size_t length, + void** data, + napi_value* result); + #ifdef __cplusplus } #endif + #endif /* FOUNDATION_ACE_NAPI_INTERFACES_KITS_NAPI_NATIVE_API_H */ +/** @} */ \ No newline at end of file diff --git a/commonlibrary/memory_utils/libpurgeablemem/purgeable_memory.h b/commonlibrary/memory_utils/libpurgeablemem/purgeable_memory.h index f8510ba94437ee9d225cd9b7d90e8488a1ac0bb6..2f9cb9ef27fb060dbad46176e0ec8e501949f74e 100644 --- a/commonlibrary/memory_utils/libpurgeablemem/purgeable_memory.h +++ b/commonlibrary/memory_utils/libpurgeablemem/purgeable_memory.h @@ -15,6 +15,7 @@ /** * @addtogroup memory + * @{ * * @brief provides memory management capabilities * @@ -32,7 +33,7 @@ * provides features include create, begin read ,end read, begin write, end write, rebuild, and so on. * when using, it is necessary to link libpurgeable_memory_ndk.z.so * - * @library libpurgeablemem.so + * @library libpurgeablemem.z.so * @syscap SystemCapability.Kernel.Memory * @kit KernelEnhanceKit * @since 10 @@ -206,4 +207,5 @@ bool OH_PurgeableMemory_AppendModify(OH_PurgeableMemory *purgObj, #ifdef __cplusplus } #endif /* End of #ifdef __cplusplus */ -#endif /* OHOS_UTILS_MEMORY_LIBPURGEABLEMEM_C_INCLUDE_PURGEABLE_MEMORY_H */ \ No newline at end of file +#endif /* OHOS_UTILS_MEMORY_LIBPURGEABLEMEM_C_INCLUDE_PURGEABLE_MEMORY_H */ +/** @} */ \ No newline at end of file diff --git a/distributeddatamgr/preferences/include/oh_preferences_err_code.h b/distributeddatamgr/preferences/include/oh_preferences_err_code.h index 5b77219b9d9647f416e18126d8014747b23ddf24..90a2c6818099095b5978f7d067f3c8f66f19e5b2 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_err_code.h +++ b/distributeddatamgr/preferences/include/oh_preferences_err_code.h @@ -73,5 +73,5 @@ typedef enum OH_Preferences_ErrCode { #ifdef __cplusplus }; #endif - +/** @} */ #endif // OH_PREFERENCES_ERR_CODE_H diff --git a/distributeddatamgr/preferences/include/oh_preferences_option.h b/distributeddatamgr/preferences/include/oh_preferences_option.h index a8a25af9f55287456e3595803981a3c727390acf..80ae78809baefe7c575f6593ada97d173769422e 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_option.h +++ b/distributeddatamgr/preferences/include/oh_preferences_option.h @@ -115,4 +115,5 @@ int OH_PreferencesOption_Destroy(OH_PreferencesOption *option); #ifdef __cplusplus }; #endif +/** @} */ #endif // OH_PREFERENCES_OPTION_H \ No newline at end of file diff --git a/distributeddatamgr/preferences/include/oh_preferences_value.h b/distributeddatamgr/preferences/include/oh_preferences_value.h index 945e28fc62980fe1de55cd342a2f1eb33e3d2bb7..5be471f187269ef8f1dc587217e49c3998364db9 100644 --- a/distributeddatamgr/preferences/include/oh_preferences_value.h +++ b/distributeddatamgr/preferences/include/oh_preferences_value.h @@ -172,4 +172,5 @@ int OH_PreferencesValue_GetString(const OH_PreferencesValue *object, char **valu #ifdef __cplusplus }; #endif +/** @} */ #endif // OH_PREFERENCES_VALUE_H \ No newline at end of file diff --git a/distributeddatamgr/relational_store/include/data_asset.h b/distributeddatamgr/relational_store/include/data_asset.h index a8bc9e16a83b3eb8ae17e0e73785b7ec72ede2f3..f791cbc9e815b1358fd4bb3b4054f1576b808521 100644 --- a/distributeddatamgr/relational_store/include/data_asset.h +++ b/distributeddatamgr/relational_store/include/data_asset.h @@ -13,8 +13,6 @@ * limitations under the License. */ -#ifndef DATA_ASSET_H -#define DATA_ASSET_H /** * @addtogroup RDB * @{ @@ -32,11 +30,20 @@ * * @brief Provides the data type of asset. * @kit ArkData - * @library libnative_rdb_ndk.z.so + * @library libnative_rdb_ndk.so * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 11 */ + +#ifndef DATA_ASSET_H +#define DATA_ASSET_H + +#ifdef __cplusplus #include +#else +#include +#endif + #include #ifdef __cplusplus extern "C" { @@ -350,4 +357,7 @@ int OH_Data_Asset_DestroyMultiple(Data_Asset **assets, uint32_t count); #ifdef __cplusplus }; #endif + +/** @} */ + #endif // DATA_ASSET_H diff --git a/distributeddatamgr/relational_store/include/oh_cursor.h b/distributeddatamgr/relational_store/include/oh_cursor.h index 30d208ab446635eee502b76bc7b4b04ac8e1fe70..0785f850ec7406546032006f72c3cfd7be0493f4 100644 --- a/distributeddatamgr/relational_store/include/oh_cursor.h +++ b/distributeddatamgr/relational_store/include/oh_cursor.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OH_CURSOR_H -#define OH_CURSOR_H - /** * @addtogroup RDB * @{ @@ -25,7 +22,6 @@ * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ @@ -35,10 +31,20 @@ * @brief Provides functions and enumerations related to the resultSet. * * @kit ArkData + * @library libnative_rdb_ndk.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ +#ifndef OH_CURSOR_H +#define OH_CURSOR_H + +#ifdef __cplusplus #include +#else +#include +#endif + #include #include #include "database/data/data_asset.h" @@ -93,7 +99,16 @@ typedef enum OH_ColumnType { * * @since 10 */ -typedef struct OH_Cursor { +typedef struct OH_Cursor OH_Cursor; + +/** + * @brief Define the OH_Cursor structure type. + * + * Provides methods for accessing a database result set generated by query the database. + * + * @since 10 + */ +struct OH_Cursor { /** * The id used to uniquely identify the OH_Cursor struct. */ @@ -286,10 +301,12 @@ typedef struct OH_Cursor { * @since 11 */ int (*getAssets)(OH_Cursor *cursor, int32_t columnIndex, Data_Asset **value, uint32_t *length); -} OH_Cursor; +}; #ifdef __cplusplus }; #endif +/** @} */ + #endif // OH_CURSOR_H diff --git a/distributeddatamgr/relational_store/include/oh_predicates.h b/distributeddatamgr/relational_store/include/oh_predicates.h index 71f4964591e50d5751ab93e25c15abbecca018d9..32d4e3e9eb260012d43dacd6778300c283769565 100644 --- a/distributeddatamgr/relational_store/include/oh_predicates.h +++ b/distributeddatamgr/relational_store/include/oh_predicates.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OH_PREDICATES_H -#define OH_PREDICATES_H - /** * @addtogroup RDB * @{ @@ -25,7 +22,6 @@ * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ @@ -35,10 +31,20 @@ * @brief Declared predicate related functions and enumerations. * * @kit ArkData + * @library libnative_rdb_ndk.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ +#ifndef OH_PREDICATES_H +#define OH_PREDICATES_H + +#ifdef __cplusplus #include +#else +#include +#endif + #include #include "database/rdb/oh_value_object.h" @@ -67,7 +73,14 @@ typedef enum OH_OrderType { * * @since 10 */ -typedef struct OH_Predicates { +typedef struct OH_Predicates OH_Predicates; + +/** + * @brief Define the OH_Predicates structure type. + * + * @since 10 + */ +struct OH_Predicates { /** * The id used to uniquely identify the OH_Predicates struct. */ @@ -395,10 +408,12 @@ typedef struct OH_Predicates { * @since 10 */ int (*destroy)(OH_Predicates *predicates); -} OH_Predicates; +}; #ifdef __cplusplus }; #endif +/** @} */ + #endif // OH_PREDICATES_H diff --git a/distributeddatamgr/relational_store/include/oh_value_object.h b/distributeddatamgr/relational_store/include/oh_value_object.h index dbe5d0d18a9598c7cf4cd15f12822f2a58141cb5..1c80013f4edb38b42fff1305b8ce33758a2afe82 100644 --- a/distributeddatamgr/relational_store/include/oh_value_object.h +++ b/distributeddatamgr/relational_store/include/oh_value_object.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OH_VALUE_OBJECT_H -#define OH_VALUE_OBJECT_H - /** * @addtogroup RDB * @{ @@ -25,7 +22,6 @@ * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ @@ -35,10 +31,20 @@ * @brief Provides numeric type conversion functions. * * @kit ArkData + * @library libnative_rdb_ndk.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ +#ifndef OH_VALUE_OBJECT_H +#define OH_VALUE_OBJECT_H + +#ifdef __cplusplus #include +#else +#include +#endif + #ifdef __cplusplus extern "C" { #endif @@ -48,7 +54,15 @@ extern "C" { * * @since 10 */ -typedef struct OH_VObject { +typedef struct OH_VObject OH_VObject; + + +/** + * @brief Define the OH_VObject structure type. + * + * @since 10 + */ +struct OH_VObject { /** * The id used to uniquely identify the OH_VObject struct. */ @@ -112,10 +126,12 @@ typedef struct OH_VObject { * @since 10 */ int (*destroy)(OH_VObject *valueObject); -} OH_VObject; +}; #ifdef __cplusplus }; #endif +/** @} */ + #endif // OH_VALUE_OBJECT_H diff --git a/distributeddatamgr/relational_store/include/oh_values_bucket.h b/distributeddatamgr/relational_store/include/oh_values_bucket.h index db822d1de1db6a2a20fa86bdc1b60896d4098374..99794efbbcb56aef3875b8488b6b2fc6d0a91487 100644 --- a/distributeddatamgr/relational_store/include/oh_values_bucket.h +++ b/distributeddatamgr/relational_store/include/oh_values_bucket.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef OH_VALUES_BUCKET_H -#define OH_VALUES_BUCKET_H - /** * @addtogroup RDB * @{ @@ -25,7 +22,6 @@ * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ @@ -35,10 +31,20 @@ * @brief Define the type of stored key value pairs. * * @kit ArkData + * @library libnative_rdb_ndk.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ +#ifndef OH_VALUES_BUCKET_H +#define OH_VALUES_BUCKET_H + +#ifdef __cplusplus #include +#else +#include +#endif + #include "database/data/data_asset.h" #ifdef __cplusplus extern "C" { @@ -49,7 +55,15 @@ extern "C" { * * @since 10 */ -typedef struct OH_VBucket { +typedef struct OH_VBucket OH_VBucket; + + +/** + * @brief Define the OH_VBucket structure type. + * + * @since 10 + */ +struct OH_VBucket { /** * The id used to uniquely identify the OH_VBucket struct. */ @@ -139,7 +153,7 @@ typedef struct OH_VBucket { * @since 10 */ int (*destroy)(OH_VBucket *bucket); -} OH_VBucket; +}; /** * @brief Put the {@link Data_Asset} * value to this {@link OH_VBucket} object for the given column name. @@ -173,4 +187,6 @@ int OH_VBucket_PutAssets(OH_VBucket *bucket, const char *field, Data_Asset **val }; #endif +/** @} */ + #endif // OH_VALUES_BUCKET_H diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index b8be9a6aa7948d0c7391250047554e9349400754..8f4d63962034f3eb9fbd531f05a061f6e1ff8375 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef RELATIONAL_STORE_H -#define RELATIONAL_STORE_H - /** * @addtogroup RDB * @{ @@ -25,7 +22,6 @@ * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ @@ -35,9 +31,14 @@ * @brief Provides database related functions and enumerations. * * @kit ArkData + * @library libnative_rdb_ndk.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ +#ifndef RELATIONAL_STORE_H +#define RELATIONAL_STORE_H + #include "database/rdb/oh_cursor.h" #include "database/rdb/oh_predicates.h" #include "database/rdb/oh_value_object.h" @@ -212,7 +213,7 @@ int OH_Rdb_DestroyConfig(OH_Rdb_ConfigV2 *config); * * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. * Indicates the configuration of the database related to this RDB store. - * @param dataBaseDir Indicates the directory of the database. + * @param databaseDir Indicates the directory of the database. * @return Returns the status code of the execution. Successful execution returns RDB_OK, * {@link RDB_OK} - success. * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. @@ -1250,4 +1251,6 @@ OH_Cursor *OH_Rdb_QueryLockedRow( }; #endif +/** @} */ + #endif // RELATIONAL_STORE_H diff --git a/distributeddatamgr/relational_store/include/relational_store_error_code.h b/distributeddatamgr/relational_store/include/relational_store_error_code.h index 9fc2f6d2d0a56f41c583b2eb61b21e856424c293..83b18cc8fc9670b1925d2064218bb4fbee207a84 100644 --- a/distributeddatamgr/relational_store/include/relational_store_error_code.h +++ b/distributeddatamgr/relational_store/include/relational_store_error_code.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef RELATIONAL_STORE_ERRNO_CODE_H -#define RELATIONAL_STORE_ERRNO_CODE_H - /** * @addtogroup RDB * @{ @@ -25,20 +22,23 @@ * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ - /** * @file relational_store_error_code.h * * @brief Declaration error code information. * * @kit ArkData + * @library libnative_rdb_ndk.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ +#ifndef RELATIONAL_STORE_ERRNO_CODE_H +#define RELATIONAL_STORE_ERRNO_CODE_H + #ifdef __cplusplus extern "C" { #endif @@ -314,4 +314,6 @@ typedef enum OH_Rdb_ErrCode { }; #endif +/** @} */ + #endif // RELATIONAL_STORE_ERRNO_CODE_H \ No newline at end of file diff --git a/distributeddatamgr/udmf/include/udmf.h b/distributeddatamgr/udmf/include/udmf.h index d8d7149e52ec66c7abbaeffcb6014f84114a669e..5a8491cfc5d240603dd6cdc79eed2ccd6e853310 100644 --- a/distributeddatamgr/udmf/include/udmf.h +++ b/distributeddatamgr/udmf/include/udmf.h @@ -206,7 +206,7 @@ OH_UdmfRecordProvider* OH_UdmfRecordProvider_Create(); /** * @brief Destroy an {@link OH_UdmfRecordProvider} instance. * - * @param subscriber Pointer to the {@link OH_UdmfRecordProvider} instance to destroy. + * @param provider Pointer to the {@link OH_UdmfRecordProvider} instance to destroy. * @return Returns the status code of the execution. For details, see {@link Udmf_ErrCode}. * Returns {@link UDMF_E_OK} if the operation is successful. * Returns {@link UDMF_E_INVALID_PARAM} if invalid args are detected. diff --git a/drivers/external_device_manager/hid/hid_ddk_api.h b/drivers/external_device_manager/hid/hid_ddk_api.h index ac9336efd4a1098c94eb41a9469c6449aa412cfb..44f16c8048bc2d36877b39e28c8821e662f5e567 100644 --- a/drivers/external_device_manager/hid/hid_ddk_api.h +++ b/drivers/external_device_manager/hid/hid_ddk_api.h @@ -83,8 +83,7 @@ int32_t OH_Hid_CreateDevice(Hid_Device *hidDevice, Hid_EventProperties *hidEvent * {@link HID_DDK_INVALID_OPERATION} connect hid ddk service failed or the caller is not the creator of device. * {@link HID_DDK_INVALID_PARAMETER} parameter check failed. Possible causes: 1.deviceId is less than 0;\n * 2.length exceeds 7; 3.items is null. - * {@link HID_DDK_NULL_PTR} the inject of device is null. - * {@link HID_DDK_FAILURE} the device does not exit. + * {@link HID_DDK_NULL_PTR} the device does not exist. * @since 11 * @version 1.0 */ @@ -98,7 +97,6 @@ int32_t OH_Hid_EmitEvent(int32_t deviceId, const Hid_EmitItem items[], uint16_t * @return {@link HID_DDK_SUCCESS} operation successful. * {@link HID_DDK_NO_PERM} permission check failed. * {@link HID_DDK_INVALID_OPERATION} connect hid ddk service failed or the caller is not the creator of device. - * {@link HID_DDK_FAILURE} the device does not exit. * @since 11 * @version 1.0 */ diff --git a/drivers/external_device_manager/hid/hid_ddk_types.h b/drivers/external_device_manager/hid/hid_ddk_types.h index 1029fbb12cf907ed78fc74dc36a1cfe6ced0ddcf..01dfc5d9b7942034697d6b66a0f388d25dead200 100644 --- a/drivers/external_device_manager/hid/hid_ddk_types.h +++ b/drivers/external_device_manager/hid/hid_ddk_types.h @@ -591,18 +591,18 @@ typedef struct Hid_EventProperties { typedef enum { /** @error Operation successful */ HID_DDK_SUCCESS = 0, - /** @error Operation failed */ - HID_DDK_FAILURE = -1, + /** @error Permission denied */ + HID_DDK_NO_PERM = 201, /** @error Invalid parameter */ - HID_DDK_INVALID_PARAMETER = -2, - /** @error Invalid operation */ - HID_DDK_INVALID_OPERATION = -3, + HID_DDK_INVALID_PARAMETER = 401, + /** @error Operation failed */ + HID_DDK_FAILURE = 27300001, /** @error Null pointer exception */ - HID_DDK_NULL_PTR = -4, + HID_DDK_NULL_PTR = 27300002, + /** @error Invalid operation */ + HID_DDK_INVALID_OPERATION = 27300003, /** @error Timeout */ - HID_DDK_TIMEOUT = -5, - /** @error Permission denied */ - HID_DDK_NO_PERM = -6 + HID_DDK_TIMEOUT = 27300004, } Hid_DdkErrCode; #ifdef __cplusplus } diff --git a/drivers/external_device_manager/usb/libusb.ndk.json b/drivers/external_device_manager/usb/libusb.ndk.json index d3ad5dbd33abd8e8b82db853b6e8df1818f4bea0..eb677bfeee99b3d144db38b9b9c6af425d602ca6 100644 --- a/drivers/external_device_manager/usb/libusb.ndk.json +++ b/drivers/external_device_manager/usb/libusb.ndk.json @@ -5,6 +5,9 @@ { "name": "OH_Usb_Release" }, + { + "name": "OH_Usb_ReleaseResource" + }, { "name": "OH_Usb_GetDeviceDescriptor" }, diff --git a/drivers/external_device_manager/usb/usb_ddk_api.h b/drivers/external_device_manager/usb/usb_ddk_api.h index 90ff08e69e6bd68e6d07879c76a876eb6fc8fbf3..1ee732e19db29b923f2d6ee8b3bff45a7c593aae 100644 --- a/drivers/external_device_manager/usb/usb_ddk_api.h +++ b/drivers/external_device_manager/usb/usb_ddk_api.h @@ -70,6 +70,17 @@ int32_t OH_Usb_Init(void); */ void OH_Usb_Release(void); +/** + * @brief Releases the DDK. + * + * @permission ohos.permission.ACCESS_DDK_USB + * @return {@link USB_DDK_SUCCESS} the operation is successful. + * {@link USB_DDK_NO_PERM} permission check failed. + * @since 14 + * @version 1.0 + */ +int32_t OH_Usb_ReleaseResource(void); + /** * @brief Obtains the USB device descriptor. * @@ -77,7 +88,7 @@ void OH_Usb_Release(void); * @param deviceId ID of the device whose descriptor is to be obtained. * @param desc Standard device descriptor defined in the USB protocol. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} desc is null. * @since 10 @@ -95,7 +106,7 @@ int32_t OH_Usb_GetDeviceDescriptor(uint64_t deviceId, struct UsbDeviceDescriptor * @param config Configuration descriptor, which includes the standard configuration descriptor defined in the\n * USB protocol and the associated interface descriptor and endpoint descriptor. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} config is null. * @since 10 @@ -124,7 +135,7 @@ void OH_Usb_FreeConfigDescriptor(struct UsbDdkConfigDescriptor * const config); * @param interfaceHandle Interface operation handle. After the interface is claimed successfully, a value will be\n * assigned to this parameter. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} interfaceHandle is null. * @since 10 @@ -138,7 +149,7 @@ int32_t OH_Usb_ClaimInterface(uint64_t deviceId, uint8_t interfaceIndex, uint64_ * @permission ohos.permission.ACCESS_DDK_USB * @param interfaceHandle Interface operation handle. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * @since 10 * @version 1.0 @@ -153,7 +164,7 @@ int32_t OH_Usb_ReleaseInterface(uint64_t interfaceHandle); * @param settingIndex Index of the alternate setting, which corresponds to bAlternateSetting\n * in the USB protocol. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * @since 10 * @version 1.0 @@ -168,7 +179,7 @@ int32_t OH_Usb_SelectInterfaceSetting(uint64_t interfaceHandle, uint8_t settingI * @param settingIndex Index of the alternate setting, which corresponds to bAlternateSetting\n * in the USB protocol. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} settingIndex is null. * @since 10 @@ -186,7 +197,7 @@ int32_t OH_Usb_GetCurrentInterfaceSetting(uint64_t interfaceHandle, uint8_t *set * @param data Data to be transferred. * @param dataLen Data length. The return value indicates the length of the actually read data. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} setup is null or data is null or dataLen is null or dataLen is less than\n * size of the read data. @@ -207,7 +218,7 @@ int32_t OH_Usb_SendControlReadRequest(uint64_t interfaceHandle, const struct Usb * @param data Data to be transferred. * @param dataLen Data length. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} setup is null or data is null. * @since 10 @@ -224,7 +235,7 @@ int32_t OH_Usb_SendControlWriteRequest(uint64_t interfaceHandle, const struct Us * @param pipe Pipe used to transfer data. * @param devMmap Device memory map, which can be obtained by calling OH_Usb_CreateDeviceMemMap. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} pipe is null or devMmap is null or address of devMmap is null. * @since 10 @@ -240,7 +251,7 @@ int32_t OH_Usb_SendPipeRequest(const struct UsbRequestPipe *pipe, UsbDeviceMemMa * @param pipe Pipe used to transfer data. * @param ashmem Shared memory, which can be obtained by calling OH_DDK_CreateAshmem. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_OPERATION} connect usb ddk service failed. * {@link USB_DDK_INVALID_PARAMETER} pipe is null or ashmem is null or address of ashmem is null. * @since 12 @@ -256,7 +267,7 @@ int32_t OH_Usb_SendPipeRequestWithAshmem(const struct UsbRequestPipe *pipe, DDK_ * @param size Buffer size. * @param devMmap Data memory map, through which the created buffer is returned to the caller. * @return {@link USB_DDK_SUCCESS} the operation is successful. - * {@link USB_DDK_FAILED} permission check failed or internal error failed. + * {@link USB_DDK_NO_PERM} permission check failed. * {@link USB_DDK_INVALID_PARAMETER} devMmap is null. * {@link USB_DDK_MEMORY_ERROR} mmap failed or alloc memory of devMmap failed. * @since 10 diff --git a/drivers/external_device_manager/usb/usb_ddk_types.h b/drivers/external_device_manager/usb/usb_ddk_types.h index 602baba11bddfd9ccfd23a44fb34e028cb07cfb3..8c51cd7263f1f62c16ac69a271f1206cd926f323 100644 --- a/drivers/external_device_manager/usb/usb_ddk_types.h +++ b/drivers/external_device_manager/usb/usb_ddk_types.h @@ -298,22 +298,32 @@ typedef struct UsbDeviceMemMap { typedef enum { /** @error The operation is successful. */ USB_DDK_SUCCESS = 0, - /** @error The operation failed. */ + /** @error The operation failed. + * @deprecate since 14 + */ USB_DDK_FAILED = -1, + /** @error Permission denied. */ + USB_DDK_NO_PERM = 201, /** @error Invalid parameter. */ - USB_DDK_INVALID_PARAMETER = -2, + USB_DDK_INVALID_PARAMETER = 401, /** @error Memory-related error, for example, insufficient memory, memory data copy failure,\n * or memory application failure. */ - USB_DDK_MEMORY_ERROR = -3, - /** @error Invalid operation. */ - USB_DDK_INVALID_OPERATION = -4, - /** @error Null pointer exception */ + USB_DDK_MEMORY_ERROR = 27400001, + /** @error Null pointer exception + * @deprecate since 14 + */ USB_DDK_NULL_PTR = -5, - /** @error Device busy. */ + /** @error Device busy. + * @deprecate since 14 + */ USB_DDK_DEVICE_BUSY = -6, + /** @error Invalid operation. */ + USB_DDK_INVALID_OPERATION = 27400002, + /** @error Device I/O operation failed. */ + USB_DDK_IO_FAILED = 27400003, /** @error Transmission timeout. */ - USB_DDK_TIMEOUT = -7 + USB_DDK_TIMEOUT = 27400004, } UsbDdkErrCode; #ifdef __cplusplus } diff --git a/filemanagement/environment/include/oh_environment.h b/filemanagement/environment/include/oh_environment.h index 71d1e849590c735ff12a0f52ebd25122fb5dad7c..299e1272b679dfaa396b93d878196a31bad5ecc8 100644 --- a/filemanagement/environment/include/oh_environment.h +++ b/filemanagement/environment/include/oh_environment.h @@ -15,6 +15,7 @@ /** * @addtogroup Environment + * @{ * * @brief This module provides the ability to access the environment directory and obtain the native interface for public root directory. @@ -80,3 +81,4 @@ FileManagement_ErrCode OH_Environment_GetUserDocumentDir(char **result); #endif #endif //FILE_MANAGEMENT_ENVIRONMENT_OH_ENVIRONMENT_H +/** @} */ diff --git a/filemanagement/fileio/include/error_code.h b/filemanagement/fileio/include/error_code.h index 2fb9847fe22ce2f667a233e529cbdae3e550a3cd..08b32f3a1d81de3d164f8f3bd3f441c12a5e9ec3 100644 --- a/filemanagement/fileio/include/error_code.h +++ b/filemanagement/fileio/include/error_code.h @@ -24,7 +24,7 @@ /** * @file error_code.h * @kit CoreFileKit - * + * @library NA * @brief Declare the error codes of file management module. * @syscap SystemCapability.FileManagement.File.FileIO * @since 12 @@ -81,3 +81,4 @@ typedef enum FileManagement_ErrCode { #endif #endif // FILE_MANAGEMENT_FILEIO_ERROR_CODE_H +/** @} */ diff --git a/filemanagement/fileio/include/oh_fileio.h b/filemanagement/fileio/include/oh_fileio.h index 5fa1677da14bfd6c903296fba0f078c3412f36b2..b318d4f84ade1251f90c834974bb196fdf8e1bde 100644 --- a/filemanagement/fileio/include/oh_fileio.h +++ b/filemanagement/fileio/include/oh_fileio.h @@ -15,6 +15,7 @@ /** * @addtogroup FileIO + * @{ * * @brief This module provides the basic file operations. * @since 12 @@ -78,3 +79,4 @@ FileManagement_ErrCode OH_FileIO_GetFileLocation(char *uri, int uriLength, #endif #endif //FILE_MANAGEMENT_FILEIO_OH_FILEIO_H +/** @} */ diff --git a/graphic/graphic_2d/native_drawing/drawing_font_collection.h b/graphic/graphic_2d/native_drawing/drawing_font_collection.h index a6097dad1954a1643bfa5307eca7fb0fa3f780dd..e6ac9f49424f699c6c830f9788619ca8093dec78 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font_collection.h +++ b/graphic/graphic_2d/native_drawing/drawing_font_collection.h @@ -105,6 +105,16 @@ OH_Drawing_FontCollection* OH_Drawing_CreateSharedFontCollection(void); * @version 1.0 */ void OH_Drawing_ClearFontCaches(OH_Drawing_FontCollection* fontCollection); + +/** + * @brief Get the OH_Drawing_FontCollection global instance. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @return Return the pointer to the OH_Drawing_FontCollection global instance. + * @since 14 + * @version 1.0 + */ +OH_Drawing_FontCollection* OH_Drawing_GetFontCollectionGlobalInstance(void); #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_image.h b/graphic/graphic_2d/native_drawing/drawing_image.h index f4c9fed109ff81d10b9a1d9a715fdcbf20e59539..ed2d09789dd38317b51411176bb33175a7184c4a 100644 --- a/graphic/graphic_2d/native_drawing/drawing_image.h +++ b/graphic/graphic_2d/native_drawing/drawing_image.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * 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 diff --git a/graphic/graphic_2d/native_drawing/drawing_memory_stream.h b/graphic/graphic_2d/native_drawing/drawing_memory_stream.h index 3188d3be988aef096de0538475dffc128ac73c0d..c131dc6b2bbde32e99f82d5269e2ea38fd0feefb 100644 --- a/graphic/graphic_2d/native_drawing/drawing_memory_stream.h +++ b/graphic/graphic_2d/native_drawing/drawing_memory_stream.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * 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 diff --git a/graphic/graphic_2d/native_drawing/drawing_path_effect.h b/graphic/graphic_2d/native_drawing/drawing_path_effect.h index 7e3bd8e16b19d6e7cd79179742505cebdbfc47f0..7576c2500775c362b6a4c3c8cc7e72710ddff468 100644 --- a/graphic/graphic_2d/native_drawing/drawing_path_effect.h +++ b/graphic/graphic_2d/native_drawing/drawing_path_effect.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * 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 diff --git a/graphic/graphic_2d/native_drawing/drawing_sampling_options.h b/graphic/graphic_2d/native_drawing/drawing_sampling_options.h index ee55c81b1cc8695e7703f17ccdb34de3665acb4f..12a90a087976fd9ac76ee607786ac032dc9b9d44 100644 --- a/graphic/graphic_2d/native_drawing/drawing_sampling_options.h +++ b/graphic/graphic_2d/native_drawing/drawing_sampling_options.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * 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 diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h index 3827d52ea9fcc503aa06597f276d4a3ed629d6c4..c1bfda620328da17b8819fcd18ea0f05eb3a6e61 100644 --- a/graphic/graphic_2d/native_drawing/drawing_types.h +++ b/graphic/graphic_2d/native_drawing/drawing_types.h @@ -106,20 +106,20 @@ typedef struct OH_Drawing_Bitmap OH_Drawing_Bitmap; typedef struct OH_Drawing_Point OH_Drawing_Point; /** - * @brief Define color space to determine color information. + * @brief Defines a pixelmap, which is used to wrap real pixelmap supported by image framework. * * @since 12 * @version 1.0 */ -typedef struct OH_Drawing_ColorSpace OH_Drawing_ColorSpace; +typedef struct OH_Drawing_PixelMap OH_Drawing_PixelMap; /** - * @brief Defines a pixelmap, which is used to wrap real pixelmap supported by image framework. + * @brief Define color space to determine color information. * * @since 12 * @version 1.0 */ -typedef struct OH_Drawing_PixelMap OH_Drawing_PixelMap; +typedef struct OH_Drawing_ColorSpace OH_Drawing_ColorSpace; /** * @brief Defines a point of 2d. diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 353ce3f539771d30cdac90947de31c81c38d3c4d..82740916529eb02214fdb23d47dee984f6cd3c4d 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -122,13 +122,10 @@ "first_introduced": "12", "name": "OH_Drawing_CanvasSkew" }, - { "name": "OH_Drawing_CanvasSetMatrix" }, { "first_introduced": "12", "name": "OH_Drawing_CanvasResetMatrix" }, - { "name": "OH_Drawing_CanvasReadPixels" }, - { "name": "OH_Drawing_CanvasReadPixelsToBitmap" }, { "name": "OH_Drawing_CanvasGetWidth" }, { "name": "OH_Drawing_CanvasGetHeight" }, { "name": "OH_Drawing_CanvasGetLocalClipBounds" }, @@ -139,6 +136,9 @@ "name": "OH_Drawing_MatrixGetAll" }, { "name": "OH_Drawing_CanvasDrawShadow" }, + { "name": "OH_Drawing_CanvasSetMatrix" }, + { "name": "OH_Drawing_CanvasReadPixels" }, + { "name": "OH_Drawing_CanvasReadPixelsToBitmap" }, { "first_introduced": "12", "name": "OH_Drawing_CanvasIsClipEmpty" @@ -284,8 +284,8 @@ { "name": "OH_Drawing_FontCountText" }, { "name": "OH_Drawing_FontSetTextSkewX" }, { "name": "OH_Drawing_FontSetTypeface" }, - { "name": "OH_Drawing_FontGetMetrics" }, { "name": "OH_Drawing_FontGetTypeface" }, + { "name": "OH_Drawing_FontGetMetrics" }, { "first_introduced": "12", "name": "OH_Drawing_GpuContextCreateFromGL" @@ -752,6 +752,12 @@ { "name": "OH_Drawing_ImageBuildFromBitmap" }, { "name": "OH_Drawing_ImageGetWidth" }, { "name": "OH_Drawing_ImageGetHeight" }, + { + "first_introduced": "12", + "name": "OH_Drawing_ImageGetImageInfo" + }, + { "name": "OH_Drawing_SamplingOptionsCreate" }, + { "name": "OH_Drawing_SamplingOptionsDestroy" }, { "first_introduced": "12", "name": "OH_Drawing_TextStyleGetShadowWithIndex" @@ -788,12 +794,6 @@ "first_introduced": "12", "name": "OH_Drawing_TypographySetIndents" }, - { - "first_introduced": "12", - "name": "OH_Drawing_ImageGetImageInfo" - }, - { "name": "OH_Drawing_SamplingOptionsCreate" }, - { "name": "OH_Drawing_SamplingOptionsDestroy" }, { "first_introduced": "11", "name": "OH_Drawing_TypographyHandlerAddPlaceholder" @@ -1721,5 +1721,9 @@ { "first_introduced": "14", "name":"OH_Drawing_GetRunGlyphCount" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_GetFontCollectionGlobalInstance" } ] \ No newline at end of file diff --git a/graphic/graphic_2d/native_image/libnative_image.ndk.json b/graphic/graphic_2d/native_image/libnative_image.ndk.json index 1a8c6688deed4d6b3103e20d66bb88dafaee707b..11e9be9cf6cf6dd46a4d53913f383290b83fcedc 100644 --- a/graphic/graphic_2d/native_image/libnative_image.ndk.json +++ b/graphic/graphic_2d/native_image/libnative_image.ndk.json @@ -11,6 +11,10 @@ { "name": "OH_NativeImage_UnsetOnFrameAvailableListener" }, { "name": "OH_NativeImage_Destroy" }, { "name": "OH_NativeImage_GetTransformMatrixV2" }, + { + "first_introduced": "14", + "name": "OH_NativeImage_GetBufferMatrix" + }, { "first_introduced": "12", "name": "OH_NativeImage_AcquireNativeWindowBuffer" diff --git a/graphic/graphic_2d/native_image/native_image.h b/graphic/graphic_2d/native_image/native_image.h index 38702c9e1c5f1ca103dc5d434c15c6f63f145ccf..4bb8ba30abae236624dd91865c3ca7f64ee56f5d 100644 --- a/graphic/graphic_2d/native_image/native_image.h +++ b/graphic/graphic_2d/native_image/native_image.h @@ -239,6 +239,24 @@ void OH_NativeImage_Destroy(OH_NativeImage** image); */ int32_t OH_NativeImage_GetTransformMatrixV2(OH_NativeImage* image, float matrix[16]); +/** + * @brief Obtains the transform matrix that combines with crop rect. + * + * This API returns a transform matrix that combines the crop rect. + * Note that the matrix will not be updated until OH_NativeImage_UpdateSurfaceImage is called.\n + * This interface is a non-thread-safe type interface.\n + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeImage + * @param image Indicates the pointer to a OH_NativeImage instance. + * @param matrix Indicates the retrieved 4*4 transform matrix . + * @return {@link NATIVE_ERROR_OK} 0 - Success. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - image is NULL. + * {@link NATIVE_ERROR_MEM_OPERATION_ERROR} 30001000 - Memory operation error, failed to get transform matrix. + * @since 14 + * @version 1.0 + */ +int32_t OH_NativeImage_GetBufferMatrix(OH_NativeImage* image, float matrix[16]); + /** * @brief Acquire an OHNativeWindowBuffer through an OH_NativeImage instance for content consumer.\n * This method can not be used at the same time with OH_NativeImage_UpdateSurfaceImage.\n diff --git a/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json b/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json index 28ff64c271c393e75c728466f161345fde544bae..5362d474e0217b0a4b53c0ed0924b05a53e69d88 100644 --- a/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json +++ b/graphic/graphic_2d/native_vsync/libnative_vsync.ndk.json @@ -4,6 +4,7 @@ { "name": "OH_NativeVSync_RequestFrame" }, { "name": "OH_NativeVSync_RequestFrameWithMultiCallback" }, { "name": "OH_NativeVSync_GetPeriod" }, + { "name": "OH_NativeVSync_Create_ForAssociatedWindow" }, { "first_introduced": "14", "name": "OH_NativeVSync_DVSyncSwitch" diff --git a/graphic/graphic_2d/native_vsync/native_vsync.h b/graphic/graphic_2d/native_vsync/native_vsync.h index a26d31c5be1b203197ccf97893cb7080718c3bcb..7c2f123d6f95c6dcb90dc6b56858312a9e74cf3d 100644 --- a/graphic/graphic_2d/native_vsync/native_vsync.h +++ b/graphic/graphic_2d/native_vsync/native_vsync.h @@ -64,12 +64,25 @@ OH_NativeVSync* OH_NativeVSync_Create(const char* name, unsigned int length); * @brief Delete the NativeVsync instance. * * @syscap SystemCapability.Graphic.Graphic2D.NativeVsync - * @param window Indicates the pointer to a NativeVsync instance. + * @param nativeVsync Indicates the pointer to a NativeVsync instance. * @since 9 * @version 1.0 */ void OH_NativeVSync_Destroy(OH_NativeVSync* nativeVsync); +/** + * @brief Creates a NativeVsync instance.\n + * A new NativeVsync instance is created each time this function is called. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeVsync + * @param windowID Indicates the id of the associated window. + * @param name Indicates the vsync connection name. + * @param length Indicates the name's length. + * @return Returns the pointer to the NativeVsync instance created. + * @since 14 + * @version 1.0 + */ +OH_NativeVSync* OH_NativeVSync_Create_ForAssociatedWindow(uint64_t windowID, const char* name, unsigned int length); /** * @brief Request next vsync with callback. * If you call this interface multiple times in one frame, it will only call the last callback. diff --git a/graphic/graphic_2d/native_window/graphic_error_code.h b/graphic/graphic_2d/native_window/graphic_error_code.h index 1c16d7b95f1dcfb94a261dcb4f059e3264c744fd..0bc361b6538cca126140c18bba5c885b9129409d 100644 --- a/graphic/graphic_2d/native_window/graphic_error_code.h +++ b/graphic/graphic_2d/native_window/graphic_error_code.h @@ -52,6 +52,11 @@ extern "C" { typedef enum OHNativeErrorCode { /** @error succeed */ NATIVE_ERROR_OK = 0, + /** + * @error memory operation error + * @since 14 + */ + NATIVE_ERROR_MEM_OPERATION_ERROR = 30001000, /** @error input invalid parameter */ NATIVE_ERROR_INVALID_ARGUMENTS = 40001000, /** @error unauthorized operation */ diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h index e4f847bacd84bfe22dea5f15569fcdd1ced9995e..26a001799050fb3d755884bd311293a0ef42c757 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent.h @@ -13,8 +13,6 @@ * limitations under the License. */ -#ifndef HIVIEWDFX_HIAPPEVENT_H -#define HIVIEWDFX_HIAPPEVENT_H /** * @addtogroup HiAppEvent * @{ @@ -25,9 +23,6 @@ * events reported during running. Based on event information, you will be able to analyze the running status of * applications. * - * @kit PerformanceAnalysisKit - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * * @since 8 * @version 1.0 */ @@ -71,10 +66,16 @@ * OH_HiAppEvent_DestroyParamList(list); * * + * @kit PerformanceAnalysisKit + * @library libhiappevent_ndk.z.so + * @syscap SystemCapability.HiviewDFX.HiAppEvent * @since 8 * @version 1.0 */ +#ifndef HIVIEWDFX_HIAPPEVENT_H +#define HIVIEWDFX_HIAPPEVENT_H + #include #include diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h index 7a6d6a2f8c0ef267066f6e617a616523cb8ab028..eb571995538b8b4059707cd457b23a3a82e9cb25 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_cfg.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef HIVIEWDFX_HIAPPEVENT_CONFIG_H -#define HIVIEWDFX_HIAPPEVENT_CONFIG_H - /** * @addtogroup HiAppEvent * @{ @@ -26,9 +23,6 @@ * events reported during running. Based on event information, you will be able to analyze the running status of * applications. * - * @kit PerformanceAnalysisKit - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * * @since 8 * @version 1.0 */ @@ -45,10 +39,16 @@ * bool res = OH_HiAppEvent_Configure(MAX_STORAGE, "100M"); * * + * @kit PerformanceAnalysisKit + * @library libhiappevent_ndk.z.so + * @syscap SystemCapability.HiviewDFX.HiAppEvent * @since 8 * @version 1.0 */ +#ifndef HIVIEWDFX_HIAPPEVENT_CONFIG_H +#define HIVIEWDFX_HIAPPEVENT_CONFIG_H + #ifdef __cplusplus extern "C" { #endif diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h index c14564794fc683e86dad3663a08ec2a03826b779..bfcad3409db21db84f1c7d5bbb1a2c5ec4f0894b 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_event.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef HIVIEWDFX_HIAPPEVENT_EVENT_H -#define HIVIEWDFX_HIAPPEVENT_EVENT_H - /** * @addtogroup HiAppEvent * @{ @@ -26,9 +23,6 @@ * events reported during running. Based on event information, you will be able to analyze the running status of * applications. * - * @kit PerformanceAnalysisKit - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * * @since 8 * @version 1.0 */ @@ -48,10 +42,16 @@ * OH_HiAppEvent_DestroyParamList(list); * * + * @kit PerformanceAnalysisKit + * @library libhiappevent_ndk.z.so + * @syscap SystemCapability.HiviewDFX.HiAppEvent * @since 8 * @version 1.0 */ +#ifndef HIVIEWDFX_HIAPPEVENT_EVENT_H +#define HIVIEWDFX_HIAPPEVENT_EVENT_H + #ifdef __cplusplus extern "C" { #endif diff --git a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h index ec984a36adfb1079d3f12349dc50753ca8a6886e..683bdabc204d2ca637104d8c4ac05dadcd898a16 100644 --- a/hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h +++ b/hiviewdfx/hiappevent/include/hiappevent/hiappevent_param.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef HIVIEWDFX_HIAPPEVENT_PARAM_H -#define HIVIEWDFX_HIAPPEVENT_PARAM_H - /** * @addtogroup HiAppEvent * @{ @@ -26,9 +23,6 @@ * events reported during running. Based on event information, you will be able to analyze the running status of * applications. * - * @kit PerformanceAnalysisKit - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * * @since 8 * @version 1.0 */ @@ -48,9 +42,16 @@ * OH_HiAppEvent_DestroyParamList(list); * * + * @kit PerformanceAnalysisKit + * @library libhiappevent_ndk.z.so + * @syscap SystemCapability.HiviewDFX.HiAppEvent * @since 8 * @version 1.0 */ + +#ifndef HIVIEWDFX_HIAPPEVENT_PARAM_H +#define HIVIEWDFX_HIAPPEVENT_PARAM_H + #ifdef __cplusplus extern "C" { #endif diff --git a/hiviewdfx/hidebug/libhidebug.ndk.json b/hiviewdfx/hidebug/libhidebug.ndk.json index 45be9500bc49dbe861892b3f955f4513901afac9..02d50bda96c7ac0c98dcb5b9274727d7d20f423d 100644 --- a/hiviewdfx/hidebug/libhidebug.ndk.json +++ b/hiviewdfx/hidebug/libhidebug.ndk.json @@ -36,7 +36,7 @@ "name": "OH_HiDebug_StopAppTraceCapture" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_HiDebug_GetGraphicsMemory" } ] \ No newline at end of file diff --git a/hiviewdfx/hitrace/include/hitrace/trace.h b/hiviewdfx/hitrace/include/hitrace/trace.h index d9ebed2560c4f2d5906da4fed74d06bea347ad2a..21c1c6d82406dcb7efd210fe85838f10c6452edf 100644 --- a/hiviewdfx/hitrace/include/hitrace/trace.h +++ b/hiviewdfx/hitrace/include/hitrace/trace.h @@ -687,4 +687,6 @@ void OH_HiTrace_CountTrace(const char *name, int64_t count); #ifdef __cplusplus } #endif +/** @} */ + #endif // HIVIEWDFX_HITRACE_H diff --git a/multimedia/av_codec/native_avcapability.h b/multimedia/av_codec/native_avcapability.h index 5f30e6c924f9603f3f2055bf631edae292c8c0ed..2b6288f4a428cb8858620cbd9add16aa9ebe4cbf 100644 --- a/multimedia/av_codec/native_avcapability.h +++ b/multimedia/av_codec/native_avcapability.h @@ -30,6 +30,7 @@ #include #include "native_averrors.h" #include "native_avformat.h" +#include "native_avcodec_base.h" #ifdef __cplusplus extern "C" { @@ -42,20 +43,6 @@ extern "C" { */ typedef struct OH_AVCapability OH_AVCapability; -/** - * @brief The bitrate mode of encoder. - * @syscap SystemCapability.Multimedia.Media.CodecBase - * @since 10 - */ -typedef enum OH_BitrateMode { - /* Constant Bit rate mode. */ - BITRATE_MODE_CBR = 0, - /* Variable Bit rate mode. */ - BITRATE_MODE_VBR = 1, - /* Constant Quality mode. */ - BITRATE_MODE_CQ = 2 -} OH_BitrateMode; - /** * @brief Range contain min and max value * @syscap SystemCapability.Multimedia.Media.CodecBase diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 147a7268eae44b15243a603f1ae8358541e87648..7a19300fa470e5e15a46aa89b3e1ccdfb8633825 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -348,6 +348,7 @@ extern const char *OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT; * @brief Key for timeStamp in surface's extraData, value type is int64_t. * * @syscap SystemCapability.Multimedia.Media.CodecBase + * @deprecated since 14 * @since 9 */ extern const char *OH_ED_KEY_TIME_STAMP; @@ -355,6 +356,7 @@ extern const char *OH_ED_KEY_TIME_STAMP; * @brief Key for endOfStream in surface's extraData, value type is bool. * * @syscap SystemCapability.Multimedia.Media.CodecBase + * @deprecated since 14 * @since 9 */ extern const char *OH_ED_KEY_EOS; @@ -662,6 +664,8 @@ extern const char *OH_MD_KEY_SETUP_HEADER; * @brief Key for video scale type, value type is int32_t, see {@link OH_ScalingMode}. * * @syscap SystemCapability.Multimedia.Media.CodecBase + * @deprecated since 14 + * @useinstead OH_NativeWindow_NativeWindowSetScalingModeV2 * @since 10 */ extern const char *OH_MD_KEY_SCALING_MODE; @@ -987,6 +991,16 @@ typedef enum OH_MediaType { */ typedef enum OH_AACProfile { AAC_PROFILE_LC = 0, + /** + * High-Efficiency AAC profile, contain the audio object types: AAC LC, SBR + * @since 14 + */ + AAC_PROFILE_HE = 3, + /** + * High-Efficiency AAC v2 profile, contain the audio object types: AAC LC, SBR, PS + * @since 14 + */ + AAC_PROFILE_HE_V2 = 4, } OH_AACProfile; /** @@ -1011,10 +1025,55 @@ typedef enum OH_HEVCProfile { HEVC_PROFILE_MAIN = 0, HEVC_PROFILE_MAIN_10 = 1, HEVC_PROFILE_MAIN_STILL = 2, + /** + * @deprecated since 14 + */ HEVC_PROFILE_MAIN_10_HDR10 = 3, + /** + * @deprecated since 14 + */ HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4, } OH_HEVCProfile; +/** + * @brief Profile: A specified subset of the syntax of VVC. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 14 + */ +typedef enum OH_VVCProfile { + /** Main 10 profile */ + VVC_PROFILE_MAIN_10 = 1, + /** Main 12 profile */ + VVC_PROFILE_MAIN_12 = 2, + /** Main 12 Intra profile */ + VVC_PROFILE_MAIN_12_INTRA = 10, + /** Multilayer Main 10 profile */ + VVC_PROFILE_MULTI_MAIN_10 = 17, + /** Main 10 4:4:4 profile */ + VVC_PROFILE_MAIN_10_444 = 33, + /** Main 12 4:4:4 profile */ + VVC_PROFILE_MAIN_12_444 = 34, + /** Main 16 4:4:4 profile */ + VVC_PROFILE_MAIN_16_444 = 36, + /** Main 12 4:4:4 Intra profile */ + VVC_PROFILE_MAIN_12_444_INTRA = 42, + /** Main 16 4:4:4 Intra profile */ + VVC_PROFILE_MAIN_16_444_INTRA = 44, + /** Multilayer Main 10 4:4:4 profile */ + VVC_PROFILE_MULTI_MAIN_10_444 = 49, + /** Main 10 Still Picture profile */ + VVC_PROFILE_MAIN_10_STILL = 65, + /** Main 12 Still Picture profile */ + VVC_PROFILE_MAIN_12_STILL = 66, + /** Main 10 4:4:4 Still Picture profile */ + VVC_PROFILE_MAIN_10_444_STILL = 97, + /** Main 12 4:4:4 Still Picture profile */ + VVC_PROFILE_MAIN_12_444_STILL = 98, + /** Main 16 4:4:4 Still Picture profile */ + VVC_PROFILE_MAIN_16_444_STILL = 100, +} OH_VVCProfile; + /** * @brief Enumerates the muxer output file format * @@ -1061,10 +1120,20 @@ typedef enum OH_AVSeekMode { * @brief Scaling Mode * * @syscap SystemCapability.Multimedia.Media.CodecBase + * @deprecated since 14 + * @useinstead OHScalingModeV2 * @since 10 */ typedef enum OH_ScalingMode { + /** + * @deprecated since 14 + * @useinstead OH_SCALING_MODE_SCALE_TO_WINDOW_V2 + */ SCALING_MODE_SCALE_TO_WINDOW = 1, + /** + * @deprecated since 14 + * @useinstead OH_SCALING_MODE_SCALE_CROP_V2 + */ SCALING_MODE_SCALE_CROP = 2, } OH_ScalingMode; @@ -1208,6 +1277,46 @@ typedef enum OH_HEVCLevel { HEVC_LEVEL_62 = 12, } OH_HEVCLevel; +/** + * @brief VVC Level: A defined set of constraints on the values that may be taken by the syntax elements and variables + * of VVC, or the value of a transform coefficient prior to scaling. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 14 + */ +typedef enum OH_VVCLevel { + /** VVC level 1.0 */ + VVC_LEVEL_1 = 16, + /** VVC level 2.0 */ + VVC_LEVEL_2 = 32, + /** VVC level 2.1 */ + VVC_LEVEL_21 = 35, + /** VVC level 3.0 */ + VVC_LEVEL_3 = 48, + /** VVC level 3.1 */ + VVC_LEVEL_31 = 51, + /** VVC level 4.0 */ + VVC_LEVEL_4 = 64, + /** VVC level 4.1 */ + VVC_LEVEL_41 = 67, + /** VVC level 5.0 */ + VVC_LEVEL_5 = 80, + /** VVC level 5.1 */ + VVC_LEVEL_51 = 83, + /** VVC level 5.2 */ + VVC_LEVEL_52 = 86, + /** VVC level 6.0 */ + VVC_LEVEL_6 = 96, + /** VVC level 6.1 */ + VVC_LEVEL_61 = 99, + /** VVC level 6.2 */ + VVC_LEVEL_62 = 102, + /** VVC level 6.3 */ + VVC_LEVEL_63 = 105, + /** VVC level 15.5 */ + VVC_LEVEL_155 = 255, +} OH_VVCLevel; + /** * @brief The reference mode in temporal group of picture. * @@ -1224,6 +1333,23 @@ typedef enum OH_TemporalGopReferenceMode { UNIFORMLY_SCALED_REFERENCE = 2, } OH_TemporalGopReferenceMode; +/** + * @brief The bitrate mode of encoder. + * + * Change the location of the header file, since 14. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 10 + */ +typedef enum OH_BitrateMode { + /** Constant Bit rate mode. */ + BITRATE_MODE_CBR = 0, + /** Variable Bit rate mode. */ + BITRATE_MODE_VBR = 1, + /** Constant Quality mode. */ + BITRATE_MODE_CQ = 2 +} OH_BitrateMode; + #ifdef __cplusplus } #endif diff --git a/multimedia/av_codec/native_avcodec_videoencoder.h b/multimedia/av_codec/native_avcodec_videoencoder.h index e66569f4f0967939cfbd2592fc8645cffe7d9abf..2781353f03751fdde81a7d4cdd24a4fe2383d5e6 100644 --- a/multimedia/av_codec/native_avcodec_videoencoder.h +++ b/multimedia/av_codec/native_avcodec_videoencoder.h @@ -428,14 +428,25 @@ OH_AVErrCode OH_VideoEncoder_IsValid(OH_AVCodec *codec, bool *isValid); /** * @brief The bitrate mode of video encoder. * @syscap SystemCapability.Multimedia.Media.VideoEncoder + * @deprecated since 14 + * @useinstead OH_BitrateMode * @since 9 */ typedef enum OH_VideoEncodeBitrateMode { - /* constant bit rate mode. */ + /** constant bit rate mode. + * @deprecated since 14 + * @useinstead BITRATE_MODE_CBR + */ CBR = 0, - /* variable bit rate mode. */ + /** variable bit rate mode. + * @deprecated since 14 + * @useinstead BITRATE_MODE_VBR + */ VBR = 1, - /* constant quality mode. */ + /** constant quality mode. + * @deprecated since 14 + * @useinstead BITRATE_MODE_CQ + */ CQ = 2, } OH_VideoEncodeBitrateMode; diff --git a/multimedia/av_codec/native_avdemuxer.h b/multimedia/av_codec/native_avdemuxer.h index 4913528156683067fd92bbbbfa0a0bd1d6574b73..738da2ed89b736bb8f094dd9f3e6ec5a7dbb8464 100644 --- a/multimedia/av_codec/native_avdemuxer.h +++ b/multimedia/av_codec/native_avdemuxer.h @@ -49,11 +49,12 @@ typedef struct OH_AVDemuxer OH_AVDemuxer; typedef struct DRM_MediaKeySystemInfo DRM_MediaKeySystemInfo; /** -* @brief Callback for getting media key system information from media source. -* @since 11 -* @version 1.0 -*/ -typedef void (*DRM_MediaKeySystemInfoCallback)(DRM_MediaKeySystemInfo* mediaKeySystemInfo); + * @brief Callback for getting media key system information from media source. + * @deprecated since 14 + * @useinstead Demuxer_MediaKeySystemInfoCallback + * @since 11 + */ +typedef void (*DRM_MediaKeySystemInfoCallback)(DRM_MediaKeySystemInfo *mediaKeySystemInfo); /** * @brief Call back will be invoked when updating DRM information. @@ -191,6 +192,8 @@ OH_AVErrCode OH_AVDemuxer_SeekToTime(OH_AVDemuxer *demuxer, int64_t millisecond, * @return {@link AV_ERR_OK} 0 - Success * {@link AV_ERR_OPERATE_NOT_PERMIT} 2 - If the demuxer engine is not inited or init failed. * {@link AV_ERR_INVALID_VAL} 3 - If the demuxer instance is nullptr or invalid. + * @deprecated since 14 + * @useinstead OH_AVDemuxer_SetDemuxerMediaKeySystemInfoCallback * @since 11 */ OH_AVErrCode OH_AVDemuxer_SetMediaKeySystemInfoCallback(OH_AVDemuxer *demuxer, diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index fb16d8c0da5d9557538ffb769b8ea788c881c6ef..c7ea3eb576f3ceb7f028f68ca88907fe5f878aed 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -568,10 +568,10 @@ Image_ErrorCode OH_PixelmapImageInfo_GetRowStride(OH_Pixelmap_ImageInfo *info, u Image_ErrorCode OH_PixelmapImageInfo_GetPixelFormat(OH_Pixelmap_ImageInfo *info, int32_t *pixelFormat); /** - * @brief Get density number for imageinfo struct. + * @brief Get alphaType number for imageinfo struct. * * @param info The imageinfo pointer will be operated. - * @param alphaType The number of image alphaType. + * @param alphaType The number of imageinfo alphaType. * @return Returns {@link Image_ErrorCode} * @since 12 */ @@ -858,21 +858,6 @@ Image_ErrorCode OH_PixelmapNative_SetMetadata(OH_PixelmapNative *pixelmap, OH_Pi */ Image_ErrorCode OH_PixelmapNative_GetNativeBuffer(OH_PixelmapNative *pixelmap, OH_NativeBuffer **nativeBuffer); -/** - * @brief Set pixelmap memory name. - * - * @param pixelmap The Pixelmap pointer to be operated. - * @param name The pointer of name that needs to be set. - * @param size The size of name size that needs to be set. - * @return Function result code: - * {@link IMAGE_SUCCESS} If the operation is successful. - * {@link IMAGE_BAD_PARAMETER} If invalid parameter, name and size are incorrect. - * {@link IMAGE_UNSUPPORTED_MEMORY_FORMAT} If memory format is unsupported. - * @see OH_PixelmapNative - * @since 13 - */ -Image_ErrorCode OH_PixelmapNative_SetMemoryName(OH_PixelmapNative *pixelmap, char *name, size_t *size); - /** * @brief Get the native colorspace from the PixelMap. * @@ -901,6 +886,21 @@ Image_ErrorCode OH_PixelmapNative_GetColorSpaceNative(OH_PixelmapNative *pixelma Image_ErrorCode OH_PixelmapNative_SetColorSpaceNative(OH_PixelmapNative *pixelmap, OH_NativeColorSpaceManager *colorSpaceNative); +/** + * @brief Set pixelmap memory name. + * + * @param pixelmap The Pixelmap pointer to be operated. + * @param name The pointer of name that needs to be set. + * @param size The size of name size that needs to be set. + * @return Function result code: + * {@link IMAGE_SUCCESS} If the operation is successful. + * {@link IMAGE_BAD_PARAMETER} If invalid parameter, name and size are incorrect. + * {@link IMAGE_UNSUPPORTED_MEMORY_FORMAT} If memory format is unsupported. + * @see OH_PixelmapNative + * @since 13 + */ +Image_ErrorCode OH_PixelmapNative_SetMemoryName(OH_PixelmapNative *pixelmap, char *name, size_t *size); + #ifdef __cplusplus }; #endif diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 90b91d7cbb8b76d2dbf2985eb68076023097f834..38470f93dc2d0377fc4a2107a3de83e19568dcf5 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -231,7 +231,7 @@ typedef struct Input_AxisEvent Input_AxisEvent; /** * @brief Defines the hot key structure. * - * @since 13 + * @since 14 */ typedef struct Input_Hotkey Input_Hotkey; @@ -255,19 +255,19 @@ typedef enum Input_Result { INPUT_REPEAT_INTERCEPTOR = 4200001, /** * @error Already occupied by the system - * @since 13 + * @since 14 */ INPUT_OCCUPIED_BY_SYSTEM = 4200002, /** * @error Already occupied by the other - * @since 13 + * @since 14 */ INPUT_OCCUPIED_BY_OTHER = 4200003, } Input_Result; /** * @brief Callback used to return shortcut key events. - * @since 13 + * @since 14 */ typedef void (*Input_HotkeyCallback)(Input_Hotkey* hotkey); @@ -1285,7 +1285,7 @@ Input_Result OH_Input_RemoveInputEventInterceptor(void); * {@Link INPUT_SERVICE_EXCEPTION} Failed to get the interval because the service is exception.\n * {@Link INPUT_PARAMETER_ERROR} The timeInterval is NULL.\n * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Result OH_Input_GetIntervalSinceLastInput(int64_t *timeInterval); @@ -1295,7 +1295,7 @@ Input_Result OH_Input_GetIntervalSinceLastInput(int64_t *timeInterval); * @return Returns an {@Link Input_Hotkey} pointer object if the operation is successful. Otherwise, a null pointer is * returned. The possible cause is memory allocation failure. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Hotkey *OH_Input_CreateHotkey(void); @@ -1304,7 +1304,7 @@ Input_Hotkey *OH_Input_CreateHotkey(void); * * @param hotkey Hot key object. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ void OH_Input_DestroyHotkey(Input_Hotkey **hotkey); @@ -1315,7 +1315,7 @@ void OH_Input_DestroyHotkey(Input_Hotkey **hotkey); * @param preKeys List of modifier keys. * @param size Number of modifier keys. One or two modifier keys are supported. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ void OH_Input_SetPreKeys(Input_Hotkey *hotkey, int32_t *preKeys, int32_t size); @@ -1330,7 +1330,7 @@ void OH_Input_SetPreKeys(Input_Hotkey *hotkey, int32_t *preKeys, int32_t size); * {@link INPUT_PARAMETER_ERROR} The hotkey is NULL or the pressedKeys is NULL or the pressedKeyCount * is NULL.\n * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Result OH_Input_GetPreKeys(const Input_Hotkey *hotkey, int32_t **preKeys, int32_t *preKeyCount); @@ -1340,7 +1340,7 @@ Input_Result OH_Input_GetPreKeys(const Input_Hotkey *hotkey, int32_t **preKeys, * @param hotkey Hotkey key object. * @param finalKey Modified key. Only one modified key is supported. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ void OH_Input_SetFinalKey(Input_Hotkey *hotkey, int32_t finalKey); @@ -1353,7 +1353,7 @@ void OH_Input_SetFinalKey(Input_Hotkey *hotkey, int32_t finalKey); * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} The hotkey is NULL or the finalKeyCode is NULL.\n * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Result OH_Input_GetFinalKey(const Input_Hotkey *hotkey, int32_t *finalKeyCode); @@ -1366,7 +1366,7 @@ Input_Result OH_Input_GetFinalKey(const Input_Hotkey *hotkey, int32_t *finalKeyC * operation fails, a null pointer is returned. The possible cause is memory allocation failure or count is not equal * to the number of system hotkeys. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Hotkey **OH_Input_CreateAllSystemHotkeys(int32_t count); @@ -1377,7 +1377,7 @@ Input_Hotkey **OH_Input_CreateAllSystemHotkeys(int32_t count); * {@Link OH_Input_CreateAllSystemHotkeys} method. * @param count Count of the array to be destroyed, which must be the same as the number of system shortcut keys. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ void OH_Input_DestroyAllSystemHotkeys(Input_Hotkey **hotkeys, int32_t count); @@ -1392,7 +1392,7 @@ void OH_Input_DestroyAllSystemHotkeys(Input_Hotkey **hotkeys, int32_t count); * {@link INPUT_PARAMETER_ERROR} The hotkey or count is NULL, or the value of count does not match the number * of system shortcut keys supported by the system. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Result OH_Input_GetAllSystemHotkeys(Input_Hotkey **hotkey, int32_t *count); @@ -1403,7 +1403,7 @@ Input_Result OH_Input_GetAllSystemHotkeys(Input_Hotkey **hotkey, int32_t *count) * @param isRepeat Whether to report repeated key events. * The value true means to report repeated key events, and the value false means the opposite. * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ void OH_Input_SetRepeat(Input_Hotkey* hotkey, bool isRepeat); @@ -1416,7 +1416,7 @@ void OH_Input_SetRepeat(Input_Hotkey* hotkey, bool isRepeat); * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} otherwise.\n * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Result OH_Input_GetRepeat(const Input_Hotkey* hotkey, bool *isRepeat); @@ -1432,7 +1432,7 @@ Input_Result OH_Input_GetRepeat(const Input_Hotkey* hotkey, bool *isRepeat); * GetAllSystemHotkeys} interface to query all system shortcut keys.\n * {@Link INPUT_OCCUPIED_BY_OTHER} The hotkey has been subscribed to by another.\n * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Result OH_Input_AddHotkeyMonitor(const Input_Hotkey* hotkey, Input_HotkeyCallback callback); @@ -1445,7 +1445,7 @@ Input_Result OH_Input_AddHotkeyMonitor(const Input_Hotkey* hotkey, Input_HotkeyC * {@link INPUT_SUCCESS} if the operation is successful;\n * {@link INPUT_PARAMETER_ERROR} if hotkey or callback is NULL;\n * @syscap SystemCapability.MultimodalInput.Input.Core - * @since 13 + * @since 14 */ Input_Result OH_Input_RemoveHotkeyMonitor(const Input_Hotkey* hotkey, Input_HotkeyCallback callback); diff --git a/multimodalinput/kits/c/ohinput.ndk.json b/multimodalinput/kits/c/ohinput.ndk.json index 0a906be7133067bf80f1d5789d8ace2272d313cd..35791ebb529b0d261dcb3f7e6e026bf3c73b5ea1 100644 --- a/multimodalinput/kits/c/ohinput.ndk.json +++ b/multimodalinput/kits/c/ohinput.ndk.json @@ -316,59 +316,59 @@ "name": "OH_Input_RemoveInputEventInterceptor" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_GetIntervalSinceLastInput" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_CreateAllSystemHotkeys" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_DestroyAllSystemHotkeys" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_GetAllSystemHotkeys" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_CreateHotkey" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_DestroyHotkey" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_SetPreKeys" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_GetPreKeys" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_SetFinalKey" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_GetFinalKey" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_AddHotkeyMonitor" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_RemoveHotkeyMonitor" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_SetRepeat" }, { - "first_introduced": "13", + "first_introduced": "14", "name": "OH_Input_GetRepeat" }, { diff --git a/ndk_targets.gni b/ndk_targets.gni index a97312222ece249e3c91d5a1b38a53145dc3d2fb..fa07e23a9f2548741bfec329862c84eb1b074136 100644 --- a/ndk_targets.gni +++ b/ndk_targets.gni @@ -294,10 +294,11 @@ _parse_args += _ndk_targets_list all_ndk_targets_list = exec_script(_parse_script, _parse_args, "list lines") -if (ndk_platform == "win") { +if (build_windows_ndk_target) { all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:windows_x86_64" ] -} else if (ndk_platform == "mac") { +} +if (build_mac_ndk_target) { if (host_cpu == "arm64") { all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:darwin_arm64" ] @@ -305,10 +306,12 @@ if (ndk_platform == "win") { all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:darwin_x86_64" ] } -} else if (ndk_platform == "linux") { +} +if (build_linux_ndk_target) { all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:linux_x86_64" ] -} else if (ndk_platform == "ohos") { +} +if (build_ohos_ndk_target) { all_ndk_targets_list += [ "//interface/sdk_c/third_party/musl/ndk_script:ohos_arm64" ] } else if (ndk_platform == "default") { diff --git a/network/netmanager/include/net_connection.h b/network/netmanager/include/net_connection.h index 6c5c4c2f2bfa8794d61ce12f8b8cdb56fadfb37d..13294313de0bf736e0eefc6c51e6d4de1cf9a87d 100644 --- a/network/netmanager/include/net_connection.h +++ b/network/netmanager/include/net_connection.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NATIVE_NET_CONN_API_H -#define NATIVE_NET_CONN_API_H - /** * @addtogroup NetConnection * @{ @@ -38,6 +35,9 @@ * @version 1.0 */ +#ifndef NATIVE_NET_CONN_API_H +#define NATIVE_NET_CONN_API_H + #include #include "net_connection_type.h" diff --git a/network/netmanager/include/net_connection_type.h b/network/netmanager/include/net_connection_type.h index 40e80760b13c8cc854164fda6c5eb77d5bc986bb..663f39a7d89f86502a5f51dd346ab38b517ef8bb 100644 --- a/network/netmanager/include/net_connection_type.h +++ b/network/netmanager/include/net_connection_type.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NATIVE_NET_CONN_TYPE_H -#define NATIVE_NET_CONN_TYPE_H - /** * @addtogroup NetConnection * @{ @@ -38,6 +35,9 @@ * */ +#ifndef NATIVE_NET_CONN_TYPE_H +#define NATIVE_NET_CONN_TYPE_H + #include #include #include diff --git a/network/netssl/include/net_ssl_c.h b/network/netssl/include/net_ssl_c.h index 779ccab79a6402acf5377a9a29ce5ec2715b6b5e..136ab3ca32aff3e05bfa15a50d659f42007ae3e5 100644 --- a/network/netssl/include/net_ssl_c.h +++ b/network/netssl/include/net_ssl_c.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NET_SSL_C_H -#define NET_SSL_C_H - /** * @addtogroup netstack * @{ @@ -38,6 +35,9 @@ * @version 1.0 */ +#ifndef NET_SSL_C_H +#define NET_SSL_C_H + #include "net_ssl_c_type.h" #ifdef __cplusplus @@ -113,4 +113,5 @@ void OH_Netstack_DestroyCertificatesContent(NetStack_Certificates *certs); } #endif +/** @} */ #endif // NET_SSL_C_H diff --git a/network/netssl/include/net_ssl_c_type.h b/network/netssl/include/net_ssl_c_type.h index d0bbea496b2d4b7ba5cef6cf490da65d6d905048..cea7eba7ea2ee032c38c0c80476ae02e941d7534 100644 --- a/network/netssl/include/net_ssl_c_type.h +++ b/network/netssl/include/net_ssl_c_type.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NET_SSL_C_TYPE_H -#define NET_SSL_C_TYPE_H - /** * @addtogroup netstack * @{ @@ -37,6 +34,9 @@ * @version 1.0 */ +#ifndef NET_SSL_C_TYPE_H +#define NET_SSL_C_TYPE_H + #include #ifdef __cplusplus #include @@ -134,4 +134,5 @@ typedef struct NetStack_Certificates { } #endif +/** @} */ #endif // NET_SSL_C_TYPE_H diff --git a/network/netstack/net_websocket/net_websocket.h b/network/netstack/net_websocket/net_websocket.h index d83f96f7389a4c8228d308b5fe49269bf1f46c8b..5381cb8acc05e2d3c3c5661ec460ef80e8775c54 100755 --- a/network/netstack/net_websocket/net_websocket.h +++ b/network/netstack/net_websocket/net_websocket.h @@ -13,13 +13,6 @@ * limitations under the License. */ -#ifndef NET_WEBSOCKET_H -#define NET_WEBSOCKET_H - -#include -#include -#include - /** * @addtogroup netstack * @{ @@ -42,6 +35,13 @@ * @version 1.0 */ +#ifndef NET_WEBSOCKET_H +#define NET_WEBSOCKET_H + +#include +#include +#include + #include "net_websocket_type.h" #ifdef __cplusplus @@ -51,10 +51,11 @@ extern "C" { /** * @brief Constructor of websocket. * + * @param onOpen Callback function invoked when a connection setup message is received. * @param onMessage Callback function invoked when a message is received. - * @param onClose Callback function invoked when a connection closing message is closed. * @param onError Callback function invoked when a connection error message is received. - * @param onOpen Callback function invoked when a connection setup message is received. + * @param onclose Callback function invoked when a connection closing message is closed. + * * @return Pointer to the websocket client if success; NULL otherwise. * @syscap SystemCapability.Communication.NetStack * @since 11 @@ -107,7 +108,6 @@ int OH_WebSocketClient_Send(struct WebSocket *client, char *data, size_t length) * @brief Closes a webSocket connection. * * @param client Pointer to the websocket client. - * @param url URL for the client to connect to the server. * @param options Optional parameters. * @return 0 if success; non-0 otherwise. For details about error codes, see {@link OH_Websocket_ErrCode}. * @permission ohos.permission.INTERNET @@ -133,4 +133,5 @@ int OH_WebSocketClient_Destroy(struct WebSocket *client); } #endif +/** @} */ #endif // NET_WEBSOCKET_H diff --git a/network/netstack/net_websocket/net_websocket_type.h b/network/netstack/net_websocket/net_websocket_type.h index c22e5ce130a0c661732091b20259bd4ce0d56810..c5f6f7b055067b8995d8e64c2e2192b1dd1eff2f 100755 --- a/network/netstack/net_websocket/net_websocket_type.h +++ b/network/netstack/net_websocket/net_websocket_type.h @@ -13,9 +13,6 @@ * limitations under the License. */ -#ifndef NET_WEBSOCKET_TYPE_H -#define NET_WEBSOCKET_TYPE_H - /** * @addtogroup netstack * @{ @@ -37,6 +34,9 @@ * @version 1.0 */ +#ifndef NET_WEBSOCKET_TYPE_H +#define NET_WEBSOCKET_TYPE_H + #ifdef __cplusplus extern "C" { #endif @@ -280,4 +280,5 @@ typedef enum WebSocket_ErrCode { } #endif +/** @} */ #endif // NET_WEBSOCKET_TYPE_H \ No newline at end of file diff --git a/resourceschedule/ffrt/c/condition_variable.h b/resourceschedule/ffrt/c/condition_variable.h index 0e80e02c2fe8b2e0ecba06e48f55c02c6c006b9d..0c05342463cd67958f62fc857d695d99a1ca3235 100644 --- a/resourceschedule/ffrt/c/condition_variable.h +++ b/resourceschedule/ffrt/c/condition_variable.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares the condition variable interfaces in C. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 10 * @version 1.0 @@ -117,3 +117,4 @@ FFRT_C_API int ffrt_cond_timedwait(ffrt_cond_t* cond, ffrt_mutex_t* mutex, const */ FFRT_C_API int ffrt_cond_destroy(ffrt_cond_t* cond); #endif +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/c/loop.h b/resourceschedule/ffrt/c/loop.h index 95d6a8befa494d9a1cb37659a0e85c5c282c03bc..0b330a18f448f1d6a2b569067916852c3fe9f686 100644 --- a/resourceschedule/ffrt/c/loop.h +++ b/resourceschedule/ffrt/c/loop.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares the loop interfaces in C. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 12 * @version 1.0 @@ -133,4 +133,5 @@ FFRT_C_API ffrt_timer_t ffrt_loop_timer_start( */ FFRT_C_API int ffrt_loop_timer_stop(ffrt_loop_t loop, ffrt_timer_t handle); -#endif \ No newline at end of file +#endif +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/c/mutex.h b/resourceschedule/ffrt/c/mutex.h index 1c397cdd31c02da8d4e853301faf87d4fac61a83..c8f28ac0fead198b1b5b055ad892b1d888e49b23 100644 --- a/resourceschedule/ffrt/c/mutex.h +++ b/resourceschedule/ffrt/c/mutex.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares the mutex interfaces in C. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 10 * @version 1.0 @@ -42,7 +42,6 @@ /** * @brief Initializes mutex attr. * - * @param mutex Indicates a pointer to the mutex. * @param attr Indicates a pointer to the mutex attribute. * @return {@link ffrt_success} 0 - success * {@link ffrt_error_inval} 22 - if attr is null. @@ -142,3 +141,4 @@ FFRT_C_API int ffrt_mutex_trylock(ffrt_mutex_t* mutex); */ FFRT_C_API int ffrt_mutex_destroy(ffrt_mutex_t* mutex); #endif +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/c/queue.h b/resourceschedule/ffrt/c/queue.h index 9b6deb65553a605826abd971212893738a3a2e32..fb077e38e4ac797f059ab7d924b32e81d8cb2b51 100644 --- a/resourceschedule/ffrt/c/queue.h +++ b/resourceschedule/ffrt/c/queue.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares the queue interfaces in C. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 10 * @version 1.0 @@ -72,7 +72,7 @@ FFRT_C_API void ffrt_queue_attr_destroy(ffrt_queue_attr_t* attr); * @brief Sets the QoS for a queue attribute. * * @param attr Indicates a pointer to the queue attribute. - * @param attr Indicates the QoS. + * @param qos Indicates the QoS. * @since 10 * @version 1.0 */ @@ -233,4 +233,5 @@ FFRT_C_API ffrt_queue_t ffrt_get_main_queue(); */ FFRT_C_API ffrt_queue_t ffrt_get_current_queue(); -#endif // FFRT_API_C_QUEUE_H \ No newline at end of file +#endif // FFRT_API_C_QUEUE_H +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/c/sleep.h b/resourceschedule/ffrt/c/sleep.h index ee4a7196fcffabab15ad79faf5c70b9e4a0e5585..777cb553de3d31a372c4d0de27c2b5a3205b426d 100644 --- a/resourceschedule/ffrt/c/sleep.h +++ b/resourceschedule/ffrt/c/sleep.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares the sleep and yield interfaces in C. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 10 * @version 1.0 @@ -59,3 +59,4 @@ FFRT_C_API int ffrt_usleep(uint64_t usec); */ FFRT_C_API void ffrt_yield(void); #endif +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/c/task.h b/resourceschedule/ffrt/c/task.h index b789fdc74ddf5d5bbea7b4770eb6aa022f49e939..786661d8214186e089bae896fe842dddc42a95a5 100644 --- a/resourceschedule/ffrt/c/task.h +++ b/resourceschedule/ffrt/c/task.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares the task interfaces in C. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 10 * @version 1.0 @@ -276,3 +276,4 @@ FFRT_C_API void ffrt_wait_deps(const ffrt_deps_t* deps); FFRT_C_API void ffrt_wait(void); #endif +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/c/timer.h b/resourceschedule/ffrt/c/timer.h index 99ce5254a22f5aa161a33f120c2b4f2f8828b94b..a12610aae44664395b4dd5ccf7ccfe99eaff8e86 100644 --- a/resourceschedule/ffrt/c/timer.h +++ b/resourceschedule/ffrt/c/timer.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares the timer interfaces in C. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 12 * @version 1.0 @@ -66,4 +66,5 @@ FFRT_C_API ffrt_timer_t ffrt_timer_start(ffrt_qos_t qos, uint64_t timeout, void* * @version 1.0 */ FFRT_C_API int ffrt_timer_stop(ffrt_qos_t qos, ffrt_timer_t handle); -#endif \ No newline at end of file +#endif +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/c/type_def.h b/resourceschedule/ffrt/c/type_def.h index 8d9f7c1abd02874a24720f933c86e47d4306251d..2a4343bff0731da5551c8c97d321c44e426109e3 100644 --- a/resourceschedule/ffrt/c/type_def.h +++ b/resourceschedule/ffrt/c/type_def.h @@ -30,7 +30,7 @@ * @kit FunctionFlowRuntimeKit * * @brief Declares common types. - * + * @library libffrt.z.so * @syscap SystemCapability.Resourceschedule.Ffrt.Core * @since 10 * @version 1.0 @@ -65,6 +65,7 @@ typedef enum { /** * @brief Enumerates the task QoS types. * + * @since 10 */ typedef enum { /** Inheritance. */ @@ -85,6 +86,7 @@ typedef void(*ffrt_function_t)(void*); /** * @brief Defines a task executor. * + * @since 10 */ typedef struct { /** Function used to execute a task. */ @@ -98,6 +100,7 @@ typedef struct { /** * @brief Defines the storage size of multiple types of structs. * + * @since 10 */ typedef enum { /** Task attribute storage size. */ @@ -115,6 +118,7 @@ typedef enum { /** * @brief Enumerates the task types. * + * @since 10 */ typedef enum { /** General task. */ @@ -126,6 +130,7 @@ typedef enum { /** * @brief dependency type. * + * @since 10 */ typedef enum { /** Data dependency type. */ @@ -137,6 +142,7 @@ typedef enum { /** * @brief dependency data structure. * + * @since 10 */ typedef struct { /** Dependency type. */ @@ -148,6 +154,7 @@ typedef struct { /** * @brief Defines the dependency struct. * + * @since 10 */ typedef struct { /** Number of dependencies. */ @@ -244,3 +251,4 @@ using qos = int; } #endif #endif +/** @} */ \ No newline at end of file diff --git a/resourceschedule/ffrt/ffrt.h b/resourceschedule/ffrt/ffrt.h deleted file mode 100644 index 32a4ccf54238998d93b9a02de53230f29151a4a0..0000000000000000000000000000000000000000 --- a/resourceschedule/ffrt/ffrt.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ -#ifndef FFRT_API_FFRT_H -#define FFRT_API_FFRT_H -#ifdef __cplusplus -#include "cpp/task.h" -#include "cpp/mutex.h" -#include "cpp/condition_variable.h" -#include "cpp/sleep.h" -#include "cpp/queue.h" -#include "c/timer.h" -#else -#include "c/task.h" -#include "c/mutex.h" -#include "c/condition_variable.h" -#include "c/sleep.h" -#include "c/queue.h" -#include "c/timer.h" -#endif -#endif diff --git a/tee/BUILD.gn b/tee/BUILD.gn deleted file mode 100644 index a04ca0b3a023bf1ae7cfd22ce4e93d2aff99148c..0000000000000000000000000000000000000000 --- a/tee/BUILD.gn +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. -# 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 -# -# 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. - -import("//build/ohos.gni") - -ohos_ndk_library("libteec") { - output_name = "teec" - output_extension = "so" - ndk_description_file = "./libteec.ndk.json" - min_compact_version = "12" - system_capability = "SystemCapability.Tee.TeeClient" - system_capability_headers = [ - "./include/tee_client_api.h", - "./include/tee_client_constants.h", - "./include/tee_client_type.h", - ] -} - -ohos_ndk_headers("libtee_header") { - dest_dir = "$ndk_headers_out_dir/tee" - sources = [ - "./include/oemkey.h", - "./include/rpmb_driver_rw_api.h", - "./include/rpmb_fcntl.h", - "./include/tee_arith_api.h", - "./include/tee_core_api.h", - "./include/tee_crypto_api.h", - "./include/tee_crypto_hal.h", - "./include/tee_defines.h", - "./include/tee_drv_client.h", - "./include/tee_dynamic_srv.h", - "./include/tee_ext_api.h", - "./include/tee_hw_ext_api.h", - "./include/tee_hw_ext_api_legacy.h", - "./include/tee_internal_se_api.h", - "./include/tee_log.h", - "./include/tee_mem_mgmt_api.h", - "./include/tee_mem_monitoring_api.h", - "./include/tee_object_api.h", - "./include/tee_property_api.h", - "./include/tee_rtc_time_api.h", - "./include/tee_service_public.h", - "./include/tee_sharemem_ops.h", - "./include/tee_time_api.h", - "./include/tee_trusted_storage_api.h", - "./include/tee_tui_gp_api.h", - ] -} - -ohos_ndk_headers("libteec_header") { - dest_dir = "$ndk_headers_out_dir/tee_client" - sources = [ - "./include/tee_client_api.h", - "./include/tee_client_constants.h", - "./include/tee_client_type.h", - ] -} - -group("tee_ndk_header") { - deps = [ - ":libtee_header", - ":libteec_header", - ] -} diff --git a/tee/include/oemkey.h b/tee/include/oemkey.h deleted file mode 100644 index dc2e3daeb314e094f060a392c55c0f49e7166001..0000000000000000000000000000000000000000 --- a/tee/include/oemkey.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef OEMKEY_H -#define OEMKEY_H -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file oemkey.h - * - * @brief Provides the method for obtaining the hardware provision key. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif -/** - * @brief Obtains the provision key. - * - * @param oem_key Indicates the pointer to the buffer for storing the provision key. - * @param key_size Indicates the length of the buffer used to store the provision key, which is 16. - * - * @return Returns 0 if the operation is successful. - * @return Returns other values otherwise. - * - * @since 12 - */ -uint32_t tee_hal_get_provision_key(uint8_t *oem_key, size_t key_size); - -#ifdef __cplusplus -} -#endif - -/** @} */ -#endif diff --git a/tee/include/pthread_attr.h b/tee/include/pthread_attr.h deleted file mode 100644 index d7753593dc218049d192a82b3582e91b02f84471..0000000000000000000000000000000000000000 --- a/tee/include/pthread_attr.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef PTHREAD_ATTR_H -#define PTHREAD_ATTR_H -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file pthread_attr.h - * - * @brief Provides the attr about TA multi-thread. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#define TEESMP_THREAD_ATTR_CA_WILDCARD 0 - -#define TEESMP_THREAD_ATTR_CA_INHERIT (-1U) - -#define TEESMP_THREAD_ATTR_TASK_ID_INHERIT (-1U) - -#define TEESMP_THREAD_ATTR_HAS_SHADOW 0x1 - -#define TEESMP_THREAD_ATTR_NO_SHADOW 0x0 - -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/rpmb_driver_rw_api.h b/tee/include/rpmb_driver_rw_api.h deleted file mode 100644 index 4c96f222e6568ad3dcef5c56943b9bf6c5b76913..0000000000000000000000000000000000000000 --- a/tee/include/rpmb_driver_rw_api.h +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef RPMB_DRIVER_RW_API_H -#define RPMB_DRIVER_RW_API_H -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file rpmb_driver_rw_api.h - * - * @brief APIs related to RPMB driver read and write. - * Provides the function of reading and writing RPMB driver. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Defines the total block number. - * - * @since 12 - * @version 1.0 - */ -#define TOTAL_BLK 4 - -/** - * @brief Defines the size of block. - * - * @since 12 - * @version 1.0 - */ -#define BLK_SIZE 256 - -/** - * @brief Defines the size of the total block. - * - * @since 12 - * @version 1.0 - */ -#define TOTAL_BLK_SIZE (TOTAL_BLK * BLK_SIZE) - -#define SEC_WRITE_PROTECT_ENTRY_NUM 4 -#define SEC_WRITE_PROTECT_ENTRY_RESERVED_NUM 3 -#define SEC_WRITE_PROTECT_ENTRY_RESERVED_SIZE 16 -#define SEC_WRITE_PROTECT_FRAME_RESERVED_NUM 14 -#define SEC_WRITE_PROTECT_FRAME_RESERVED_END_NUM 176 -#define SEC_WRITE_PROTECT_BLK_SIZE 256 -#define SEC_WRITE_PROTECT_LUN_MAX 5 - -/** - * @brief A WPF set to one specifies that the logical unit shall inhibit alteration of the medium for LBA within - * the range indicated by LOGICAL BLOCK ADDRESS field and NUMBER OF LOGICAL BLOCKS field. - * Commands requiring writes to the medium shall be terminated with CHECK CONDITION status, - * with the sense key set to DATA PROTECT, and the additional sense code set to WRITE PROTECTED. - * - * @since 12 - * @version 1.0 - */ -typedef enum { - SEC_WRITE_PROTECT_DISABLE = 0, - SEC_WRITE_PROTECT_ENABLE = 1, -} write_protect_flag; - -/** - * @brief Write Protect Type specifies how WPF bit may be modified. - * - * @since 12 - * @version 1.0 - */ -typedef enum { - /** WPF bit is persistent through power cycle and hardware reset. - * WPF value may only be changed writing to Secure Write Protect Configuration Block. - */ - NV_TYPE = 0, - /** WPF bit is automatically cleared to 0b after power cycle or hardware reset. */ - P_TYPE = 1, - /** WPF bit is automatically set to 1b after power cycle or hardware reset. */ - NV_AWP_TYPE = 2, -} write_protect_type; - -/** - * @brief Secure Write Protect Entry. - * +-----+---+---+---+---+---+---+---+----+ - * | | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | - * +-----+---+---+---+---+---+---+---+----+ - * | 0 | Reserved | WFT | WPF| -> wp_data - * +-----+---+---+---+---+---+---+---+----+ - * | 1 | Reserved | - * +-----+---+---+---+---+---+---+---+----+ - * | 2 | Reserved | - * +-----+---+---+---+---+---+---+---+----+ - * | 3 | Reserved | - * +-----+---+---+---+---+---+---+---+----+ - * | 4 | LOGICAL BLOCK ADDRESS | -> logical_blk_addr - * +-----+ + - * | ... | | - * +-----+ + - * | 11 | | - * +-----+ + - * | 12 | | - * +-----+---+---+---+---+---+---+---+----+ - * | ... | NUMBER OF LOGICAL BLOCKS | -> logical_blk_num - * +-----+---+---+---+---+---+---+---+----+ - * | 15 | | - * +-----+---+---+---+---+---+---+---+----+ - * - * @since 12 - * @version 1.0 - */ -struct rpmb_protect_cfg_blk_entry { - uint8_t wp_data; - uint8_t reserved[SEC_WRITE_PROTECT_ENTRY_RESERVED_NUM]; - /** This field specifies the LBA of the first logical address of the Secure Write Protect ares. */ - uint64_t logical_blk_addr; - /** This field specifies the number of contiguous logical size that belong to the Secure Write Protect. */ - uint32_t logical_blk_num; -}__attribute__((packed)); - - -/** - * @brief Secure Write Protect Configuration Block is supported by RPMB region 0 only. - * This block is used for configuring secure write protect areas in logical units. - * Each Secure Write Protect Configuration Block for each logical unit. - * Each entry represents one secure write protect area. - * If an entry is not used, then the related fields shall contain a value of zero. - * +-----+---+---+---+---+---+---+---+----+ - * | | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | - * +-----+---+---+---+---+---+---+---+----+ - * | 0 | LUN | - * +-----+---+---+---+---+---+---+---+----+ - * | 1 | DATA LENGTH | - * +-----+---+---+---+---+---+---+---+----+ - * | 2 | | - * +-----+ + - * | ... | Reserved | - * +-----+ + - * | 15 | | - * +-----+---+---+---+---+---+---+---+----+ - * | 16 | | - * +-----+ + - * | ... | Secure Write Protect Entry 0 | - * +-----+ + - * | 31 | | - * +-----+---+---+---+---+---+---+---+----+ - * | 32 | | - * +-----+ + - * | ... | Secure Write Protect Entry 1 | - * +-----+ + - * | 47 | | - * +-----+---+---+---+---+---+---+---+----+ - * | 48 | | - * +-----+ + - * | ... | Secure Write Protect Entry 1 | - * +-----+ + - * | 63 | | - * +-----+---+---+---+---+---+---+---+----+ - * | 64 | | - * +-----+ + - * | ... | Secure Write Protect Entry 1 | - * +-----+ + - * | 79 | | - * +-----+---+---+---+---+---+---+---+----+ - * | 80 | | - * +-----+ + - * | ... | Reserved | - * +-----+ + - * | 255 | | - * +-----+---+---+---+---+---+---+---+----+ - * - * @since 12 - * @version 1.0 - */ -struct rpmb_protect_cfg_block { - uint8_t lun; - uint8_t data_length; - uint8_t reserved[SEC_WRITE_PROTECT_FRAME_RESERVED_NUM]; - struct rpmb_protect_cfg_blk_entry entries[SEC_WRITE_PROTECT_ENTRY_NUM]; - uint8_t reserved_end[SEC_WRITE_PROTECT_FRAME_RESERVED_END_NUM]; -}__attribute__((packed)); - -/** - * @brief Write protect config block by RPMB driver. - * - * @param lun Indicates the logical unit to which secure write protection shall apply, - * and 0 <= lun <= {@code SEC_WRITE_PROTECT_LUN_MAX} - * @param entries Indicates the Secure Write Protect Entry array, The maximum length is 4. - * @param len Indicates the real length of the Secure Write Protect Entry array, which value is less than 4. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if the input parameter is incorrect. - * Returns {@code TEE_ERROR_OUT_OF_MEMORY} if the send message fail. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_rpmb_protect_cfg_blk_write(uint8_t lun, struct rpmb_protect_cfg_blk_entry *entries, uint32_t len); - -/** - * @brief Read protect config block by RPMB driver. - * - * @param lun Indicates the logical unit to which secure read protection shall apply, - * and 0 <= lun <= SEC_WRITE_PROTECT_LUN_MAX. - * @param entries Indicates the Secure Read Protect Entry array, The maximum length is 4. - * @param len Indicates the real length of the Secure Read Protect Entry array, which value is less than 4. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if the input parameter is incorrect. - * Returns {@code TEE_ERROR_OUT_OF_MEMORY} if the send message fail. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_rpmb_protect_cfg_blk_read(uint8_t lun, struct rpmb_protect_cfg_blk_entry *entries, uint32_t *len); - -/** - * @brief Write plaintext buffer to RPMB driver. - * - * @param buf Indicates the buffer for writing data. - * @param size Indicates the length of buffer, the maximum value is 1024. - * @param block Indicates the block index of the position of start block, the value is [0, 3]. - * @param offset Indicates the offset bytes of data position, and the value of offest bytes is less than 256. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if the input parameter is incorrect. - * Returns {@code TEE_ERROR_OUT_OF_MEMORY} if the send message fail. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_rpmb_driver_write(const uint8_t *buf, size_t size, uint32_t block, uint32_t offset); - -/** - * @brief Read plaintext buffer from RPMB driver. - * - * @param buf Indicates the buffer for read data. - * @param size Indicates the length of buffer, the maximum value is 1024. - * @param block Indicates the block index of the position of start block, the value is [0, 3]. - * @param offset Indicates the offset bytes of data position, and the value of offest bytes is less than 256. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if the input parameter is incorrect. - * Returns {@code TEE_ERROR_OUT_OF_MEMORY} if the send message fail. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_rpmb_driver_read(uint8_t *buf, size_t size, uint32_t block, uint32_t offset); - -/** - * @brief Remove data from RPMB driver. - * - * @param size Indicates the length of remove data, the maximum value is 1024. - * @param block Indicates the block index of the position of start block, the value is [0, 3]. - * @param offset Indicates the offset bytes of data position, and the value of offest bytes is less than 256. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if the input parameter is incorrect. - * Returns {@code TEE_ERROR_OUT_OF_MEMORY} if the send message fail. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_rpmb_driver_remove(size_t size, uint32_t block, uint32_t offset); - -#ifdef __cplusplus -} -#endif - -/** @} */ -#endif diff --git a/tee/include/rpmb_fcntl.h b/tee/include/rpmb_fcntl.h deleted file mode 100644 index bc38160d7d10af7a3deaee7f999d3fc241d86bbf..0000000000000000000000000000000000000000 --- a/tee/include/rpmb_fcntl.h +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef RPMB_RPMB_FCNTL_H -#define RPMB_RPMB_FCNTL_H -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file rpmb_fcntl.h - * - * @brief Provides the APIs related to RPMB service. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Partition initialization, perform RPMB Key writing and formatting operations. - * - * @attention This function only needs to be executed once. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_RPMB_GENERIC} if the RPMB controller general error. - * Returns {@code TEE_ERROR_RPMB_MAC_FAIL} if the RPMB controller MAC check error. - * Returns {@code TEE_ERROR_RPMB_RESP_UNEXPECT_MAC} if the RPMB response data MAC check error. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Init(void); - -/** - * @brief RPMB secure storage fully formatted operation. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_RPMB_GENERIC} if the RPMB controller general error. - * Returns {@code TEE_ERROR_RPMB_MAC_FAIL} if the RPMB controller MAC check error. - * Returns {@code TEE_ERROR_RPMB_RESP_UNEXPECT_MAC} if the RPMB response data MAC check error. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Format(void); - -/** - * @brief Write files to RPMB. - * - * @attention If you want to improve the performance of writing files, you need to define the heap size in TA's - * manifest to be at leaset 3 times the file size plus 256KB. - * For example: To write a file with a size of 100KB, the defined heap size is at least - * 556KB (3 * 100 + 256). If the heap size cannot be satisfied, the file writing will still succeed, - * but the performance will be poor. - * - * @param filename Indicates the file name of the data to be written, the maximum length is 64 bytes. - * @param buf Indicates the buffer for writting data. - * @param size Indicates the size of the written data, the maximum size is 160KB. - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect, or the file name is longer than 64 - * bytes. - * Returns {@code TEE_ERROR_RPMB_NOSPC} if the RPMB partition has insufficient disk space. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Write(const char *filename, const uint8_t *buf, size_t size); - -/** - * @brief Read files from RPMB. - * - * @attention If you want to improve the performance of reading files, you need to define the heap size in TA's - * manifest to be at leaset 3 times the file size plus 256KB. - * For example: To read a file with a size of 100KB, the defined heap size is at least - * 556KB (3 * 100 + 256). If the heap size cannot be satisfied, the file reading will still succeed, - * but the performance will be poor. - * - * @param filename Indicates the file name of the data to be read, the maximum length is 64 bytes. - * @param buf Indicates the buffer for reading data. - * @param size Indicates the read data size. - * @param count Indicates the size of the actual read. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect, or the file name is longer than 64 - * bytes. - * Returns {@code TEE_ERROR_RPMB_FILE_NOT_FOUND} if the file dose not exist. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Read(const char *filename, uint8_t *buf, size_t size, uint32_t *count); - -/** - * @brief Rename file name in RPMB. - * - * @param old_name Indicates the old file name. - * @param new_name Indicates the new file name. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect, or the file name is longer than 64 - * bytes. - * Returns {@code TEE_ERROR_RPMB_FILE_NOT_FOUND} if the file dose not exist. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Rename(const char *old_name, const char *new_name); - -/** - * @brief Delete files in RPMB. - * - * @param filename Indicates the file name to be deleted. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect, or the file name is longer than 64 - * bytes. - * Returns {@code TEE_ERROR_RPMB_FILE_NOT_FOUND} if the file dose not exist. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Rm(const char *filename); - -/** - * @brief File status stored in RPMB partition, used in {@code TEE_RPMB_FS_Stat}. - * - * @since 12 - */ -struct rpmb_fs_stat { - /** Indicates the file size. */ - uint32_t size; - uint32_t reserved; -}; - -/** - * @brief Get file status in RPMB. - * - * @param filename Indicates the file name in RPMB. - * @param stat Indicates the file status information obtained. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect, or the file name is longer than 64 - * bytes. - * Returns {@code TEE_ERROR_RPMB_FILE_NOT_FOUND} if the file dose not exist. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Stat(const char *filename, struct rpmb_fs_stat *stat); - -/** - * @brief Disk status stored in RPMB partition, used in {@code TEE_RPMB_FS_StatDisk}. - * - * @since 12 - */ -struct rpmb_fs_statdisk { - /** Indicates the total size of RPMB partition. */ - uint32_t disk_size; - /** Indicates the TA used size. */ - uint32_t ta_used_size; - /** Indicates the free size of the RPMB partition. */ - uint32_t free_size; - uint32_t reserved; -}; - -/** - * @brief Get the disk status. - * - * @param stat Indicates the disk status information obtained. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_StatDisk(struct rpmb_fs_statdisk *stat); - -/** - * @brief File attribute definition, which means that the file cannot be erased during the factory reset. - * - * @since 12 -*/ -#define TEE_RPMB_FMODE_NON_ERASURE (1U << 0) - -/** - * @brief File attribute definition, which means the attribute value of the cleard file. - * - * @since 12 -*/ -#define TEE_RPMB_FMODE_CLEAR 0 - - -/** - * @brief Set the file attribute in RPMB. - * - * @param filename Indicates the file name in RPMB. - * @param fmode Indicates the file attribute, currently supports {@code TEE_RPMB_FMODE_NON_ERASURE} and - * {@code TEE_RPMB_FMODE_CLEAR} two attributes, other values will return {@code TEE_ERROR_BAD_PARAMETERS}. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect, - * or the file name is longer than 64 bytes. - * Returns {@code TEE_ERROR_RPMB_FILE_NOT_FOUND} if the file dose not exist. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_SetAttr(const char *filename, uint32_t fmode); - -/** - * @brief Format, delete file attribute is erasable file, keep the file attribute is an inerasable file. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_RPMB_GENERIC} if the RPMB controller general error. - * Returns {@code TEE_ERROR_RPMB_MAC_FAIL} if the RPMB controller MAC check error. - * Returns {@code TEE_ERROR_RPMB_RESP_UNEXPECT_MAC} if the RPMB response data MAC check error. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_FS_Erase(void); - -/** - * @brief Enumerates the types of RPMB key status, used in {@code TEE_RPMB_KEY_Status}. - * - * @since 12 -*/ -enum TEE_RPMB_KEY_STAT { - /** RPMB Key status is invalid. */ - TEE_RPMB_KEY_INVALID = 0x0, - /** RPMB Key has been programmed and matched correctly. */ - TEE_RPMB_KEY_SUCCESS, - /** RPMB Key is not programmed. */ - TEE_RPMB_KEY_NOT_PROGRAM, - /** RPMB Key has been programmed but failed to match. */ - TEE_RPMB_KEY_NOT_MATCH, -}; - -/** - * @brief Obtain RPMB Key status. - * - * @return Returns {@code TEE_RPMB_KEY_SUCCESS} if the RPMB Key has been programmed and matched correctly. - * Returns {@code TEE_RPMB_KEY_NOT_PROGRAM} if the RPMB Key is not programmed. - * Returns {@code TEE_RPMB_KEY_NOT_MATCH} if RPMB Key has been programmed but failed to match. - * Returns {@code TEE_RPMB_KEY_INVALID} if the RPMB Key status is invalid. - * - * @since 12 - * @version 1.0 - */ -uint32_t TEE_RPMB_KEY_Status(void); - -/** - * @brief Process the current TA version information. - * - * @param ta_version Indicates the TA version. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_GENERIC} if the processing failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RPMB_TAVERSION_Process(uint32_t ta_version); -#ifdef __cplusplus -} -#endif - -/** @} */ -#endif diff --git a/tee/include/tee_arith_api.h b/tee/include/tee_arith_api.h deleted file mode 100644 index b76c6eb371960cd2fc882c19e425a036705f437a..0000000000000000000000000000000000000000 --- a/tee/include/tee_arith_api.h +++ /dev/null @@ -1,578 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef TEE_ARITH_API_H -#define TEE_ARITH_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_arith_api.h - * - * @brief Provides APIs for operating big integers. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef uint32_t TEE_BigInt; -typedef uint32_t TEE_BigIntFMM; -typedef uint32_t TEE_BigIntFMMContext; - -/** - * @brief Obtains the size of the array of uint32_t values required to represent a BigInt. - * - * @param n Indicates the TEE_BigInt type. - * - * @return Returns the BigInt size obtained. - * - * @since 12 - * @version 1.0 - */ -#define TEE_BigIntSizeInU32(n) ((((n) + 31) / 32) + 2) - -/** - * @brief Obtains the size of the array of uint32_t values. - * - * @param modulusSizeInBits Indicates the modulus size, in bits. - * - * @return Returns the number of bytes required to store a TEE_BigIntFMM, - * given a modulus of length modSizeInBits. - * - * @since 12 - * @version 1.0 - */ -size_t TEE_BigIntFMMSizeInU32(size_t modulusSizeInBits); - -/** - * @brief Obtains the size of an array of uint32_t values required to represent a fast modular context. - * - * @param modulusSizeInBits Indicates the modulus size, in bits. - * - * @return Returns the number of bytes required to store a TEE_BigIntFMMContext, - * given a modulus of length modSizeInBits. - * - * @since 12 - * @version 1.0 - */ -size_t TEE_BigIntFMMContextSizeInU32(size_t modulusSizeInBits); - -/** - * @brief Initializes a TEE_BigInt. - * - * @param bigInt Indicates the pointer to the TEE_BigInt to initialize. - * @param len Indicates the size of the memory pointed to by TEE_BigInt, in uint32_t. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntInit(TEE_BigInt *bigInt, size_t len); - -/** - * @brief Calculates the necessary prerequisites for fast modular multiplication and stores them in a context. - * - * @param context Indicates the pointer to the TEE_BigIntFMMContext to initialize. - * @param len Indicates the size of the memory pointed to by context, in uint32_t. - * @param modulus Indicates the pointer to the modulus. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntInitFMMContext(TEE_BigIntFMMContext *context, size_t len, const TEE_BigInt *modulus); - -/** - * @brief Calculates the necessary prerequisites for fast modular multiplication and stores them in a context. - * - * @param context Indicates the pointer to the TEE_BigIntFMMContext to initialize. - * @param len Indicates the size of the memory pointed to by context, in uint32_t. - * @param modulus Indicates the pointer to the modulus. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns other values if the operation fails. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntInitFMMContext1(TEE_BigIntFMMContext *context, size_t len, const TEE_BigInt *modulus); - -/** - * @brief Initializes a TEE_BigIntFMM and sets its represented value to zero. - * - * @param bigIntFMM Indicates the pointer to the TEE_BigIntFMM to initialize. - * @param len Indicates the size of the memory pointed to by bigIntFMM, in uint32_t. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntInitFMM(TEE_BigIntFMM *bigIntFMM, size_t len); - -/** - * @brief Converts an octet string buffer into the TEE_BigInt format. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result. - * @param buffer Indicates the pointer to the buffer that holds the octet string representation of the integer. - * @param bufferLen Indicates the buffer length, in bytes. - * @param sign Indicates the sign of dest, which is set to the sign of sign. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OVERFLOW if the memory allocated for dest is too small. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntConvertFromOctetString(TEE_BigInt *dest, const uint8_t *buffer, size_t bufferLen, int32_t sign); - -/** - * @brief Converts the absolute value of an integer in TEE_BigInt format into an octet string. - * - * @param buffer Indicates the pointer to the output buffer that holds the converted octet string representation - * of the integer. - * @param bufferLen Indicates the pointer to the buffer length, in bytes. - * @param bigInt Indicates the pointer to the integer to convert. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_SHORT_BUFFER if the output buffer is too small to hold the octet string. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntConvertToOctetString(void *buffer, size_t *bufferLen, const TEE_BigInt *bigInt); - -/** - * @brief Sets dest to the value shortVal. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result. - * @param shortVal Indicates the value to set. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntConvertFromS32(TEE_BigInt *dest, int32_t shortVal); - -/** - * @brief Sets dest to the value of src, including the sign of src. - * - * @param dest Indicates the pointer to the int32_t that holds the result. - * @param src Indicates the pointer to the value to set. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OVERFLOW if src does not fit within an int32_t. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntConvertToS32(int32_t *dest, const TEE_BigInt *src); - -/** - * @brief Checks whether op1 > op2, op1 == op2, or op1 < op2. - * - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * - * @return Returns 0 if op1 == op2. - * Returns a positive number if op1 > op2. - * - * @since 12 - * @version 1.0 - */ -int32_t TEE_BigIntCmp(const TEE_BigInt *op1, const TEE_BigInt *op2); - -/** - * @brief Checks whether op > shortVal, op == shortVal, or op < shortVal. - * - * @param op Indicates the pointer to the first operand. - * @param shortVal Indicates the pointer to the second operand. - * - * @return Returns 0 if op1 == shortVal. - * Returns a positive number if op1 > shortVal. - * - * @since 12 - * @version 1.0 - */ -int32_t TEE_BigIntCmpS32(const TEE_BigInt *op, int32_t shortVal); - -/** - * @brief Computes |dest| = |op| >> bits. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the shifted result. - * @param op Indicates the pointer to the operand to be shifted. - * @param bits Indicates the number of bits to shift. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntShiftRight(TEE_BigInt *dest, const TEE_BigInt *op, size_t bits); - -/** - * @brief Obtains the bitIndex bit of the natural binary representation of |src|. - * - * @param src Indicates the pointer to the integer. - * @param bitIndex Indicates the offset of the bit to read, starting from offset 0 of the least significant bit. - * - * @return Returns the Boolean value of bitIndexth in |src|. The value true represents a 1, - * and false represents a 0. - * - * @since 12 - * @version 1.0 - */ -bool TEE_BigIntGetBit(const TEE_BigInt *src, uint32_t bitIndex); - -/** - * @brief Obtains the number of bits in the natural binary representation of |src|, - * that is, the magnitude of src. - * - * @param src Indicates the pointer to the integer. - * - * @return Returns 0 if src is 0. - * Returns the number of bits in the natural binary representation of src. - * - * @since 12 - * @version 1.0 - */ -uint32_t TEE_BigIntGetBitCount(const TEE_BigInt *src); - -#if defined(API_LEVEL) && (API_LEVEL >= API_LEVEL1_2) -/** - * @brief Sets the first bit of bitIndex in the natural binary representation of op to - * 1 or 0. - * - * @param op Indicates the pointer to the integer. - * @param bitIndex Indicates the offset of the bit to set, starting from offset 0 of the least significant bit. - * @param value Indicates the bit value to set. The value true represents a 1, and the value false - * represents a 0. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OVERFLOW bitIndexth if the bitIndexth bit is larger than the allocated bit - * length of op. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntSetBit(TEE_BigInt *op, uint32_t bitIndex, bool value); - -/** - * @brief Assigns the value of src to dest. - * - * @param dest Indicates the pointer to the TEE_BigInt to be assigned. - * @param src Indicates the pointer to the source operand. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OVERFLOW if the dest operand cannot hold the value of src. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntAssign(TEE_BigInt *dest, const TEE_BigInt *src); - -/** - * @brief Assigns the value of src to dest. - * - * @param dest Indicates the pointer to the TEE_BigInt to be assigned. - * @param src Indicates the pointer to the source operand. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OVERFLOW if the dest operand cannot hold the value of src. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntAbs(TEE_BigInt *dest, const TEE_BigInt *src); -#endif /* API_LEVEL */ - -/** - * @brief Computes dest = op1 + op2. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the sum of op1 and op2. - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntAdd(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2); - -/** - * @brief Computes dest = op1 – op2. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the difference between op1 - * and op2. - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntSub(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2); - -/** - * @brief Negates an operand: dest = –op. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result –op. - * @param op Indicates the pointer to the operand to be negated. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntNeg(TEE_BigInt *dest, const TEE_BigInt *op); - -/** - * @brief Computes dest = op1 * op2. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the product of op1 and op2. - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntMul(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2); - -/** - * @brief Computes dest = op * op. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result op * op. - * @param op Indicates the pointer to the operand to be squared. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntSquare(TEE_BigInt *dest, const TEE_BigInt *op); - -/** - * @brief Computes dest_r and dest_q to make op1 = dest_q* op2 + dest_r. - * - * @param dest_q Indicates the pointer to the TEE_BigInt that holds the quotient. - * @param dest_r Indicates the pointer to the TEE_BigInt that holds the remainder. - * @param op1 Indicates the pointer to the first operand, which is the dividend. - * @param op2 Indicates the pointer to the second operand, which is the divisor. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if at least one parameter is null. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntDiv(TEE_BigInt *dest_q, TEE_BigInt *dest_r, const TEE_BigInt *op1, const TEE_BigInt *op2); - -/** - * @brief Computes dest = op (mod n) to make 0 <= dest < n. - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result op (mod n). - * @param op Indicates the pointer to the operand to be reduced mod n. - * @param n [IN] Indicates the pointer to the modulus, which must be greater than 1. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntMod(TEE_BigInt *dest, const TEE_BigInt *op, const TEE_BigInt *n); - -/** - * @brief Computes dest = (op1 + op2) (mod n). - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result op (op1 + op2)(mod n). - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * @param n Indicates the pointer to the modulus, which must be greater than 1. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntAddMod(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2, const TEE_BigInt *n); - -/** - * @brief Computes dest = (op1 – op2) (mod n). - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result op (op1 – op2)(mod n). - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * @param n Indicates the pointer to the modulus, which must be greater than 1. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntSubMod(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2, const TEE_BigInt *n); - -/** - * @brief Computes dest = (op1* op2)(mod n). - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result op (op1 * op2)(mod n). - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * @param n Indicates the pointer to the modulus, which must be greater than 1. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntMulMod(TEE_BigInt *dest, const TEE_BigInt *op1, const TEE_BigInt *op2, const TEE_BigInt *n); - -/** - * @brief Computes dest = (op * op) (mod n). - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result op (op * op)(mod n). - * @param op Indicates the pointer to the operand. - * @param n [IN] Indicates the pointer to the modulus, which must be greater than 1. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntSquareMod(TEE_BigInt *dest, const TEE_BigInt *op, const TEE_BigInt *n); - -/** - * @brief Computes dest to make dest* op = 1 (mod n). - * - * @param dest Indicates the pointer to the TEE_BigInt that holds the result (op^–1)(mod n). - * @param op Indicates the pointer to the operand. - * @param n [IN] Indicates the pointer to the modulus, which must be greater than 1. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntInvMod(TEE_BigInt *dest, const TEE_BigInt *op, const TEE_BigInt *n); - -/** - * @brief Checks whether gcd(op1, op2) == 1. - * - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * - * @return Returns true if gcd(op1, op2) == 1. - * Returns false if gcd(op1, op2) != 1. - * - * @since 12 - * @version 1.0 - */ -bool TEE_BigIntRelativePrime(const TEE_BigInt *op1, const TEE_BigInt *op2); - -/** - * @brief Computes the greatest common divisor of op1 and op2. - * - * @param gcd Indicates the pointer to the TEE_BigInt that holds the greatest common divisor of op1 - * and op2. - * @param u Indicates the pointer to the TEE_BigInt that holds the first coefficient. - * @param v Indicates the pointer to the TEE_BigInt that holds the second coefficient. - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntComputeExtendedGcd(TEE_BigInt *gcd, TEE_BigInt *u, TEE_BigInt *v, const TEE_BigInt *op1, - const TEE_BigInt *op2); -/** - * @brief Performs a probabilistic primality test on op. - * - * @param op Indicates the pointer to the candidate number that is tested for primality. - * @param confidenceLevel Indicates the expected confidence level for a non-conclusive test. - * - * @return Returns 0 if op is a composite number. - * Returns 1 if op is a prime number. - * Returns –1 if the test is non-conclusive but the probability that op is composite is - * less than 2^(-confidenceLevel). - * - * @since 12 - * @version 1.0 - */ -int32_t TEE_BigIntIsProbablePrime(const TEE_BigInt *op, uint32_t confidenceLevel); - -/** - * @brief Converts src into a representation suitable for doing fast modular multiplication. - * - * @param dest Indicates the pointer to an initialized TEE_BigIntFMM memory area. - * @param src Indicates the pointer to the TEE_BigInt to convert. - * @param n Indicates the pointer to the modulus. - * @param context Indicates the pointer to the context that is previously initialized using - * {@link TEE_BigIntInitFMMContext1}. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntConvertToFMM(TEE_BigIntFMM *dest, const TEE_BigInt *src, const TEE_BigInt *n, - const TEE_BigIntFMMContext *context); - -/** - * @brief Converts src in the fast modular multiplication representation back to a - * TEE_BigInt representation. - * - * @param dest Indicates the pointer to an initialized TEE_BigIntFMM memory area to store the converted result. - * @param src Indicates the pointer to a TEE_BigIntFMM holding the value in the fast modular multiplication - * representation. - * @param n Indicates the pointer to the modulus. - * @param context Indicates the pointer to the context that is previously initialized using - * {@link TEE_BigIntInitFMMContext1}. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntConvertFromFMM(TEE_BigInt *dest, const TEE_BigIntFMM *src, const TEE_BigInt *n, - const TEE_BigIntFMMContext *context); - -/** - * @brief Computes dest = op1* op2 in the fast modular multiplication representation. - * - * @param dest Indicates the pointer to the TEE_BigIntFMM that holds the result op1* op2. - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * @param n Indicates the pointer to the modulus. - * @param context Indicates the pointer to the context that is previously initialized using - * {@link TEE_BigIntInitFMMContext1}. - * - * @since 12 - * @version 1.0 - */ -void TEE_BigIntComputeFMM(TEE_BigIntFMM *dest, const TEE_BigIntFMM *op1, const TEE_BigIntFMM *op2, const TEE_BigInt *n, - const TEE_BigIntFMMContext *context); - -/** - * @brief Computes dest = (op1 ^ op2)(mod n). - * - * @param des Indicates the pointer to the TEE_BigInt that holds the result (op1 ^ op2)(mod n). - * @param op1 Indicates the pointer to the first operand. - * @param op2 Indicates the pointer to the second operand. - * @param n Indicates the pointer to the modulus. - * @param context Indicates the pointer to the context that is previously initialized using - * {@link TEE_BigIntInitFMMContext1} or initialized to null. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_NOT_SUPPORTED if the value of n is not supported. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_BigIntExpMod(TEE_BigInt *des, TEE_BigInt *op1, const TEE_BigInt *op2, const TEE_BigInt *n, - TEE_BigIntFMMContext *context); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_client_api.h b/tee/include/tee_client_api.h deleted file mode 100644 index e9d0a614a1443d2f1c42ae3fb364485405704427..0000000000000000000000000000000000000000 --- a/tee/include/tee_client_api.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef TEE_CLIENT_API_H -#define TEE_CLIENT_API_H -/** - * @addtogroup TeeClient - * @{ - * - * @brief Provides APIs for the client applications (CAs) in the Rich Execution Environment (normal mode) to - * access the trusted applications (TAs) in a Trusted Execution Environment (TEE). - * - * @since 12 - * @version 1.0 - */ - -/** - * @file tee_client_api.h - * - * @brief Defines APIs for CAs to access TAs. - * - *

Example: - *

1. Initialize a TEE: Call TEEC_InitializeContext to initialize the TEE. - *

2. Open a session: Call TEEC_OpenSession with the Universal Unique Identifier (UUID) of the TA. - *

3. Send a command: Call TEEC_InvokeCommand to send a command to the TA. - *

4. Close the session: Call TEEC_CloseSession to close the session. - *

5. Close the TEE: Call TEEC_FinalizeContext to close the TEE. - * - * @library libteec.so - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include -#include "tee_client_type.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Defines the values of the parameters transmitted between the REE and TEE. - * - * @since 12 - * @version 1.0 - */ -#define TEEC_PARAM_TYPES(param0Type, param1Type, param2Type, param3Type) \ - ((param3Type) << 12 | (param2Type) << 8 | (param1Type) << 4 | (param0Type)) - -/** - * @brief Defines the value of the parameter specified by paramTypes and index. - * - * @since 12 - * @version 1.0 - */ -#define TEEC_PARAM_TYPE_GET(paramTypes, index) \ - (((paramTypes) >> (4*(index))) & 0x0F) - -/** - * @brief Initializes a TEE. - * - * The TEE must be initialized before a session is open or commands are sent. - * After the initialization, a connection is set up between the CA and the TEE. - * - * @param name [IN] Indicates the pointer to the TEE path. - * @param context [IN/OUT] Indicates the context pointer, which is the handle of the TEE. - * - * @return Returns {@code TEEC_SUCCESS} if the TEE is successfully initialized. - * Returns {@code TEEC_ERROR_BAD_PARAMETERS} if name is incorrect or context is null. - * Returns {@code TEEC_ERROR_GENERIC} if the available system resources are insufficient. - * - * @since 12 - * @version 1.0 - */ -TEEC_Result TEEC_InitializeContext(const char *name, TEEC_Context *context); - -/** - * @brief Closes the TEE. - * - * After the TEE is closed, the CA is disconnected from the TEE. - * - * @param context [IN/OUT] Indicates the pointer to the TEE that is successfully initialized. - * - * @since 12 - * @version 1.0 - */ -void TEEC_FinalizeContext(TEEC_Context *context); - -/** - * @brief Opens a session. - * - * This function is used to set up a connection between the CA and the TA of the specified UUID in the specified TEE - * context. The data to be transferred is contained in operation. - * If a session is opened successfully, session is returned providing a description of the connection. - * If the session fails to open, returnOrigin is returned indicating the cause of the failure. - * - * @param context [IN/OUT] Indicates the pointer to the TEE that is successfully initialized. - * @param session [OUT] Indicates the pointer to the session. The value cannot be null. - * @param destination [IN] Indicates the pointer to the UUID of the target TA. Each TA has a unique UUID. - * @param connectionMethod [IN] Indicates the connection method. For details, see {@link TEEC_LoginMethod}. - * @param connectionData [IN] Indicates the pointer to the connection data, which varies with the connection mode. - * If the connection mode is {@code TEEC_LOGIN_PUBLIC}, {@code TEEC_LOGIN_USER}, - * {@code TEEC_LOGIN_USER_APPLICATION}, or {@code TEEC_LOGIN_GROUP_APPLICATION}, the connection data must be null. - * If the connection mode is {@code TEEC_LOGIN_GROUP} or {@code TEEC_LOGIN_GROUP_APPLICATION}, - * the connection data must point to data of the uint32_t type, which indicates the target group user to be connected - * by the CA. - * @param operation [IN/OUT] Indicates the pointer to the data to be transmitted between the CA and TA. - * @param returnOrigin [IN/OUT] Indicates the pointer to the error source. - * For details, see {@code TEEC_ReturnCodeOrigin}. - * - * @return Returns {@code TEEC_SUCCESS} if the session is open successfully. - * Returns {@code TEEC_ERROR_BAD_PARAMETERS} if context, session, or destination is null. - * Returns {@code TEEC_ERROR_ACCESS_DENIED} if the access request is denied. - * Returns {@code TEEC_ERROR_OUT_OF_MEMORY} if the available system resources are insufficient. - * Returns {@code TEEC_ERROR_TRUSTED_APP_LOAD_ERROR} if the TA failed to be loaded. - * For details about other return values, see {@code TEEC_ReturnCode}. - * - * @since 12 - * @version 1.0 - */ -TEEC_Result TEEC_OpenSession(TEEC_Context *context, TEEC_Session *session, const TEEC_UUID *destination, - uint32_t connectionMethod, const void *connectionData, TEEC_Operation *operation, uint32_t *returnOrigin); - -/** - * @brief Closes a session. - * - * After the session is closed, the CA is disconnected from the TA. - * - * @param session [IN/OUT] Indicates the pointer to the session to close. - * - * @since 12 - * @version 1.0 - */ -void TEEC_CloseSession(TEEC_Session *session); - -/** - * @brief Sends a command to a TA. - * - * The CA sends the command ID to the TA through the specified session. - * - * @param session [IN/OUT] Indicates the pointer to the session opened. - * @param commandID [IN] Indicates the command ID supported by the TA. It is defined by the TA. - * @param operation [IN/OUT] Indicates the pointer to the data to be sent from the CA to the TA. - * @param returnOrigin [IN/OUT] Indicates the pointer to the error source. - * For details, see {@code TEEC_ReturnCodeOrigin}. - * - * @return Returns {@code TEEC_SUCCESS} if the command is sent successfully. - * Returns {@code TEEC_ERROR_BAD_PARAMETERS} if session is null or - * operation is in incorrect format. - * Returns {@code TEEC_ERROR_ACCESS_DENIED} if the access request is denied. - * Returns {@code TEEC_ERROR_OUT_OF_MEMORY} if the available system resources are insufficient. - * For details about other return values, see {@code TEEC_ReturnCode}. - * - * @since 12 - * @version 1.0 - */ -TEEC_Result TEEC_InvokeCommand(TEEC_Session *session, uint32_t commandID, - TEEC_Operation *operation, uint32_t *returnOrigin); - -/** - * @brief Registers shared memory in the specified TEE context. - * - * The registered shared memory can implement zero-copy. - * The zero-copy function, however, also requires support by the operating system. - * At present, zero-copy cannot be implemented in this manner. - * - * @param context [IN/OUT] Indicates the pointer to the TEE that is successfully initialized. - * @param sharedMem [IN/OUT] Indicates the pointer to the shared memory. - * The pointed shared memory cannot be null and the size cannot be 0. - * - * @return Returns {@code TEEC_SUCCESS} if the operation is successful. - * Returns {@code TEEC_ERROR_BAD_PARAMETERS} if context or sharedMem is null or - * the pointed memory is empty. - * - * @since 12 - * @version 1.0 - */ -TEEC_Result TEEC_RegisterSharedMemory(TEEC_Context *context, TEEC_SharedMemory *sharedMem); - -/** - * @brief Requests shared memory in the specified TEE context. - * - * The shared memory can be used to implement zero-copy during data transmission between the REE and TEE. - * The zero-copy function, however, also requires support by the operating system. - * At present, zero-copy cannot be implemented in this manner. - * - * @attention If the size field of the input parameter sharedMem is set to 0, TEEC_SUCCESS - * will be returned but the shared memory cannot be used because this memory has neither an address nor size. - * @param context [IN/OUT] Indicates the pointer to the TEE that is successfully initialized. - * @param sharedMem [IN/OUT] Indicates the pointer to the shared memory. The size of the shared memory cannot be 0. - * - * @return Returns {@code TEEC_SUCCESS} if the operation is successful. - * Returns {@code TEEC_ERROR_BAD_PARAMETERS} if context or sharedMem is null. - * Returns {@code TEEC_ERROR_OUT_OF_MEMORY} if the available system resources are insufficient. - * - * @since 12 - * @version 1.0 - */ -TEEC_Result TEEC_AllocateSharedMemory(TEEC_Context *context, TEEC_SharedMemory *sharedMem); - -/** - * @brief Releases the shared memory registered or acquired. - * - * @attention If the shared memory is acquired by using {@code TEEC_AllocateSharedMemory}, - * the memory released will be reclaimed. If the shared memory is acquired by using {@code TEEC_RegisterSharedMemory}, - * the local memory released will not be reclaimed. - * @param sharedMem [IN/OUT] Indicates the pointer to the shared memory to release. - * - * @since 12 - * @version 1.0 - */ -void TEEC_ReleaseSharedMemory(TEEC_SharedMemory *sharedMem); - -/** - * @brief Cancels an operation. - * - * @attention This operation is only used to send a cancel message. Whether to perform the cancel operation is - * determined by the TEE or TA. - * At present, the cancel operation does not take effect. - * @param operation [IN/OUT] Indicates the pointer to the data to be sent from the CA to the TA. - * - * @since 12 - * @version 1.0 - */ -void TEEC_RequestCancellation(TEEC_Operation *operation); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_client_constants.h b/tee/include/tee_client_constants.h deleted file mode 100644 index b66056ef9161e9c98b6f008c37db87642bb27f4a..0000000000000000000000000000000000000000 --- a/tee/include/tee_client_constants.h +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef TEE_CLIENT_CONSTANTS_H -#define TEE_CLIENT_CONSTANTS_H -/** - * @addtogroup TeeClient - * @{ - * - * @brief Provides APIs for the client applications (CAs) in the Rich Execution Environment (normal mode) to - * access the trusted applications (TAs) in a Trusted Execution Environment (TEE). - * - * @since 12 - * @version 1.0 - */ - -/** - * @file tee_client_constants.h - * - * @brief Defines public data and constants. - * - * @library libteec.so - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -/** - * @brief Defines the number of TEEC_Parameters in TEEC_Operation. - * - * @since 12 - * @version 1.0 - */ -#define TEEC_PARAM_NUM 4 - -/** - * @brief Defines the error codes returned. - * - * @since 12 - * @version 1.0 - */ -enum TEEC_ReturnCode { - /** The operation is successful. */ - TEEC_SUCCESS = 0x0, - /** Invalid command. The command is not supported by the TA. */ - TEEC_ERROR_INVALID_CMD, - /** The TA does not exist. */ - TEEC_ERROR_SERVICE_NOT_EXIST, - /** The session between the CA and TA does not exist. */ - TEEC_ERROR_SESSION_NOT_EXIST, - /** The number of connections to the TA has reached the limit. */ - TEEC_ERROR_SESSION_MAXIMUM, - /** The TA to be registered already exists. */ - TEEC_ERROR_REGISTER_EXIST_SERVICE, - /** Secure OS framework error. */ - TEEC_ERROR_TAGET_DEAD_FATAL, - /** Failed to read the file. */ - TEEC_ERROR_READ_DATA, - /** Failed to write the file. */ - TEEC_ERROR_WRITE_DATA, - /** Failed to truncate the file. */ - TEEC_ERROR_TRUNCATE_OBJECT, - /** Failed to seek data. */ - TEEC_ERROR_SEEK_DATA, - /** File synchronization error. */ - TEEC_ERROR_FSYNC_DATA, - /** Failed to rename the file. */ - TEEC_ERROR_RENAME_OBJECT, - /** Failed to load the TA when opening a session. */ - TEEC_ERROR_TRUSTED_APP_LOAD_ERROR, - /** Failed to initialize the TA. */ - TEEC_ERROR_GENERIC = 0xFFFF0000, - /** Permission verification failed. Permission verification is performed before a TEE or session is opened or - a command is sent. */ - TEEC_ERROR_ACCESS_DENIED = 0xFFFF0001, - /** The operation is canceled. This error code is returned when you operate the parameter with - the cancallation flag. */ - TEEC_ERROR_CANCEL = 0xFFFF0002, - /** Concurrent access causes permission conflict. Concurrent access to files in the trusted storage - service may cause this error. */ - TEEC_ERROR_ACCESS_CONFLICT = 0xFFFF0003, - /** Too much data is passed in the requested operation for the TA to parse. */ - TEEC_ERROR_EXCESS_DATA = 0xFFFF0004, - /** Incorrect data format. The TA failed to parse the parameters sent from the CA. */ - TEEC_ERROR_BAD_FORMAT = 0xFFFF0005, - /** Invalid parameter. The input parameter is null or invalid. */ - TEEC_ERROR_BAD_PARAMETERS = 0xFFFF0006, - /** The operation in the current state is invalid. This error code is returned if the trusted storage service is not - initialized when a trusted storage service operation is requested. */ - TEEC_ERROR_BAD_STATE = 0xFFFF0007, - /** The requested data is not found. */ - TEEC_ERROR_ITEM_NOT_FOUND = 0xFFFF0008, - /** The requested operation has not been implemented yet. This error code is returned when - TEEC_RequestCancellation is called. */ - TEEC_ERROR_NOT_IMPLEMENTED = 0xFFFF0009, - /** The requested operation is valid but is not supported in this implementation. This error code is returned - when certain algorithms of the secure encryption and decryption service, such as DSA, are requested. */ - TEEC_ERROR_NOT_SUPPORTED = 0xFFFF000A, - /** Expected data for the requested operation is not found. */ - TEEC_ERROR_NO_DATA = 0xFFFF000B, - /** The available system resources are insufficient. */ - TEEC_ERROR_OUT_OF_MEMORY = 0xFFFF000C, - /** The system is busy. Some resources are exclusively used by the system. */ - TEEC_ERROR_BUSY = 0xFFFF000D, - /** Communication between an application in the REE and a TA failed. */ - TEEC_ERROR_COMMUNICATION = 0xFFFF000E, - /** A security fault is detected in the TEE. */ - TEEC_ERROR_SECURITY = 0xFFFF000F, - /** The supplied buffer is too short for the output generated. - This error may occur when {@code TEEC_MEMREF_TEMP_OUTPUT} is used. */ - TEEC_ERROR_SHORT_BUFFER = 0xFFFF0010, - /** MAC value check error. */ - TEEC_ERROR_MAC_INVALID = 0xFFFF3071, - /** The TA crashed. */ - TEEC_ERROR_TARGET_DEAD = 0xFFFF3024, - /** Common error. */ - TEEC_FAIL = 0xFFFF5002 -}; - -/** - * @brief Defines the sources of the error codes returned. - * - * @since 12 - * @version 1.0 - */ -enum TEEC_ReturnCodeOrigin { - /** The error code indicates an error originated from the client API. */ - TEEC_ORIGIN_API = 0x1, - /** The error code indicates an error originated from the communication between the REE and TEE. */ - TEEC_ORIGIN_COMMS = 0x2, - /** The error code indicates an error originated within the TEE code. */ - TEEC_ORIGIN_TEE = 0x3, - /** The error code indicates an error originated within the TA code. */ - TEEC_ORIGIN_TRUSTED_APP = 0x4, -}; - -/** - * @brief Defines the identifiers of the shared memory. - * - * @since 12 - * @version 1.0 - */ -enum TEEC_SharedMemCtl { - /** The shared memory can carry data from CAs to TAs. */ - TEEC_MEM_INPUT = 0x1, - /** The shared memory can carry data from TAs to CAs. */ - TEEC_MEM_OUTPUT = 0x2, - /** The shared memory can carry data transmitted between CAs and TAs. */ - TEEC_MEM_INOUT = 0x3, -}; - -/** - * @brief Defines the parameter types. - * - * @since 12 - * @version 1.0 - */ -enum TEEC_ParamType { - /** The parameter is not used. */ - TEEC_NONE = 0x0, - /** The parameter is a {@code TEEC_Value} tagged as input. Data flows from a CA to a TA. */ - TEEC_VALUE_INPUT = 0x01, - /** The parameter is a {@code TEEC_Value} tagged as output. Data flows from a TA to a CA. */ - TEEC_VALUE_OUTPUT = 0x02, - /** The parameter is a {@code TEEC_Value} tagged as both input and output. */ - TEEC_VALUE_INOUT = 0x03, - /** The parameter is a {@code TEEC_TempMemoryReference} tagged as input. Data flows from a CA to a TA. */ - TEEC_MEMREF_TEMP_INPUT = 0x05, - /** The parameter is a {@code TEEC_TempMemoryReference} tagged as output. Data flows from a TA to a CA. */ - TEEC_MEMREF_TEMP_OUTPUT = 0x06, - /** The parameter is a {@code TEEC_TempMemoryReference} tagged as both input and output. - Data is transmitted between a TA and a CA. */ - TEEC_MEMREF_TEMP_INOUT = 0x07, - /** The parameter is a {@code TEEC_IonReference} tagged as input. Data flows from a CA to a TA**/ - TEEC_ION_INPUT = 0x08, - /** The parameter is a {@code TEEC_IonSglistReference} tagged as input. Data flows from a CA to a TA**/ - TEEC_ION_SGLIST_INPUT = 0x09, - /** The parameter is a {@code TEEC_RegisteredMemoryReference} that refers to the entire memory block. - The data flow is the same as that of {@code TEEC_SharedMemCtl}. */ - TEEC_MEMREF_WHOLE = 0xc, - /** The parameter is a {@code TEEC_RegisteredMemoryReference} tagged as input. Data flows from a CA to a TA. */ - TEEC_MEMREF_PARTIAL_INPUT = 0xd, - /** The parameter is a {@code TEEC_RegisteredMemoryReference} tagged as output. Data flows from a TA to a CA. */ - TEEC_MEMREF_PARTIAL_OUTPUT = 0xe, - /** The parameter is a {@code TEEC_RegisteredMemoryReference} tagged as both input and output. - Data is transmitted between a TA and a CA. */ - TEEC_MEMREF_PARTIAL_INOUT = 0xf -}; - -/** - * @brief Defines the login methods. - * - * @since 12 - * @version 1.0 -*/ -enum TEEC_LoginMethod { - /** No login data is provided. */ - TEEC_LOGIN_PUBLIC = 0x0, - /** The login data about the user running the CA process is provided. */ - TEEC_LOGIN_USER, - /** The login data about the group running the CA process is provided. */ - TEEC_LOGIN_GROUP, - /** The login data about the running CA is provided. */ - TEEC_LOGIN_APPLICATION = 0x4, - /** The login data about the user running the CA process and about the CA are provided. */ - TEEC_LOGIN_USER_APPLICATION = 0x5, - /** The login data about the group running the CA process and about the CA are provided. */ - TEEC_LOGIN_GROUP_APPLICATION = 0x6, - /** Login method reserved for TEEOS. */ - TEEC_LOGIN_IDENTIFY = 0x7, -}; - -/** @} */ -#endif diff --git a/tee/include/tee_client_type.h b/tee/include/tee_client_type.h deleted file mode 100644 index 5b89ceb8d407c6b1d9e2e3e1c4491f527c04bcc2..0000000000000000000000000000000000000000 --- a/tee/include/tee_client_type.h +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef TEE_CLIENT_TYPE_H -#define TEE_CLIENT_TYPE_H -/** - * @addtogroup TeeClient - * @{ - * - * @brief Provides APIs for the client applications (CAs) in the Rich Execution Environment (normal mode) to - * access the trusted applications (TAs) in a Trusted Execution Environment (TEE). - * - * @since 12 - * @version 1.0 - */ - -/** - * @file tee_client_type.h - * - * @brief Defines basic data types and data structures. - * - * @library libteec.so - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include -#include -#include -#include -#include -#include "tee_client_constants.h" - -/** - * @brief Defines the linked list type. - * - * @since 12 - * @version 1.0 - */ -struct ListNode { - struct ListNode *next; - struct ListNode *prev; -}; - -/** - * @brief Defines the return values. - * - * @since 12 - * @version 1.0 - */ -typedef enum TEEC_ReturnCode TEEC_Result; - -/** - * @brief Defines the universally unique identifier (UUID) as defined in RFC4122 [2]. - * The UUIDs are used to identify TAs. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - uint32_t timeLow; - uint16_t timeMid; - uint16_t timeHiAndVersion; - uint8_t clockSeqAndNode[8]; -} TEEC_UUID; - -/** - * @brief Defines the context, a logical connection between a CA and a TEE. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - int32_t fd; - uint8_t *ta_path; - struct ListNode session_list; - struct ListNode shrd_mem_list; - union { - struct { - void *buffer; - sem_t buffer_barrier; - } share_buffer; - uint64_t imp; - }; -} TEEC_Context; - -/** - * @brief Defines the session between a CA and a TA. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - uint32_t session_id; - TEEC_UUID service_id; - uint32_t ops_cnt; - union { - struct ListNode head; - uint64_t imp; - }; - TEEC_Context *context; -} TEEC_Session; - -/** - * @brief Defines a shared memory block, which can be registered or allocated. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - void *buffer; - uint32_t size; - uint32_t flags; - uint32_t ops_cnt; - bool is_allocated; - union { - struct ListNode head; - void* imp; - }; - TEEC_Context *context; -} TEEC_SharedMemory; - -/** - * @brief Defines a pointer to a temporary buffer. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - void *buffer; - uint32_t size; -} TEEC_TempMemoryReference; - -/** - * @brief Defines a pointer to the shared memory that is registered or allocated. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - TEEC_SharedMemory *parent; - uint32_t size; - uint32_t offset; -} TEEC_RegisteredMemoryReference; - -/** - * @brief Describes a parameter that carries small raw data passed by value. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - uint32_t a; - uint32_t b; -} TEEC_Value; - -/** - * @brief Describes the size and handle of the ION memory. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - int ionShareFd; - uint32_t ionSize; -} TEEC_IonReference; - -/** - * @brief Defines a parameter of {@code TEEC_Operation}. - * - * @since 12 - * @version 1.0 - */ -typedef union { - TEEC_TempMemoryReference tmpref; - TEEC_RegisteredMemoryReference memref; - TEEC_Value value; - TEEC_IonReference ionref; -} TEEC_Parameter; - -/** - * @brief Defines the parameters for opening a session or sending a command. - * - * @since 12 - * @version 1.0 - */ -typedef struct { - /** The value 0 means to cancel the command, and other values mean to execute the command. */ - uint32_t started; - /** Use {@code TEEC_PARAM_TYPES} to create this parameter. */ - uint32_t paramTypes; - TEEC_Parameter params[TEEC_PARAM_NUM]; - TEEC_Session *session; - bool cancel_flag; -} TEEC_Operation; - -/** @} */ -#endif diff --git a/tee/include/tee_core_api.h b/tee/include/tee_core_api.h deleted file mode 100644 index 11a3b46d61c2889120c7403bcf5bf1d18fe3a4d9..0000000000000000000000000000000000000000 --- a/tee/include/tee_core_api.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef __TEE_CORE_API_H -#define __TEE_CORE_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - * @version 1.0 - */ - - /** - * @file tee_core_api.h - * - * @brief Provides APIs for managing trusted application (TA) sessions. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif -#ifndef _TEE_TA_SESSION_HANDLE -#define _TEE_TA_SESSION_HANDLE -/** - * @brief Defines the handle of TA session. - * - * @since 12 - */ -typedef uint32_t TEE_TASessionHandle; -#endif - -/** - * @brief Raises a panic in the TA instance. - * - * @param panicCode Indicates an informative panic code defined by the TA. - * - * @since 12 - * @version 1.0 - */ -void TEE_Panic(TEE_Result panicCode); - -/** - * @brief Opens a new session with a TA. - * - * @param destination Indicates the pointer to the TEE_UUID structure that contains - * the Universal Unique Identifier (UUID) of the target TA. - * @param cancellationRequestTimeout Indicates the timeout period in milliseconds or a special value - * if there is no timeout. - * @param paramTypes Indicates the types of all parameters passed in the operation. - * @param params Indicates the parameters passed in the operation. - * @param session Indicates the pointer to the variable that will receive the client session handle. - * @param returnOrigin Indicates the pointer to the variable that holds the return origin. - * - * @return Returns TEE_SUCCESS if the session is opened. - * Returns TEE_ERROR_ITEM_NOT_FOUND if the TA cannot be found in the Trusted Execution Environment (TEE). - * Returns TEE_ERROR_ACCESS_DENIED if the access request to the TA is denied. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_OpenTASession(const TEE_UUID *destination, uint32_t cancellationRequestTimeout, uint32_t paramTypes, - TEE_Param params[TEE_PARAMS_NUM], TEE_TASessionHandle *session, uint32_t *returnOrigin); - -/** - * @brief Closes a client session. - * - * @param session Indicates the handle of the session to close. - * - * @since 12 - * @version 1.0 - */ -void TEE_CloseTASession(TEE_TASessionHandle session); - -/** - * @brief Invokes a command in a session opened between this client TA instance and a target TA instance. - * - * @param session Indicates the handle of the opened session. - * @param cancellationRequestTimeout Indicates the timeout period in milliseconds or a special value - * if there is no timeout. - * @param commandID Indicates the identifier of the command to invoke. - * @param paramTypes Indicates the types of all parameters passed in the operation. - * @param params Indicates the parameters passed in the operation. - * @param returnOrigin Indicates the pointer to the variable that holds the return origin. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_ACCESS_DENIED if the command fails to be invoked. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_InvokeTACommand(TEE_TASessionHandle session, uint32_t cancellationRequestTimeout, uint32_t commandID, - uint32_t paramTypes, TEE_Param params[TEE_PARAMS_NUM], uint32_t *returnOrigin); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_crypto_api.h b/tee/include/tee_crypto_api.h deleted file mode 100644 index 1d0372e051dc5fbccb6497d6f3c9d082a0c4eb23..0000000000000000000000000000000000000000 --- a/tee/include/tee_crypto_api.h +++ /dev/null @@ -1,1045 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef TEE_CRYPTO_API_H -#define TEE_CRYPTO_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_crypto_api.h - * - * @brief Provides APIs for cryptographic operations. - * - * You can use these APIs to implement encryption and decryption. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include /* pthread_mutex_t */ -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef NULL -/** - * @brief Definition of NULL. - * - * @since 12 - */ -#define NULL ((void *)0) -#endif -/** - * @brief Defines the maximum key length, in bits. - * - * @since 12 - */ -#define TEE_MAX_KEY_SIZE_IN_BITS (1024 * 8) -/** - * @brief Defines the length of the SW_RSA key, in bytes. - * - * @since 12 - */ -#define SW_RSA_KEYLEN 1024 -/** - * @brief Defines the maximum length of other Diffie-Hellman (DH) information, in bytes. - * - * @since 12 - */ -#define TEE_DH_MAX_SIZE_OF_OTHER_INFO 64 /* bytes */ - -/** - * @brief Enumerates the cryptographic operation handles. - * - * @since 12 - */ -enum __TEE_Operation_Constants { - /** Cipher */ - TEE_OPERATION_CIPHER = 0x1, - /** MAC */ - TEE_OPERATION_MAC = 3, - /** AE */ - TEE_OPERATION_AE = 4, - /** Digest */ - TEE_OPERATION_DIGEST = 5, - /** Asymmetric Cipher */ - TEE_OPERATION_ASYMMETRIC_CIPHER = 6, - /** Asymmetric Signature */ - TEE_OPERATION_ASYMMETRIC_SIGNATURE = 7, - /** Key Derivation */ - TEE_OPERATION_KEY_DERIVATION = 8, -}; - -/** - * @brief Enumerates the cryptographic algorithms. - * - * @since 12 - */ -enum __tee_crypto_algorithm_id { - /** Invalid algorithm */ - TEE_ALG_INVALID = 0x0, - /** AES_ECB_NOPAD */ - TEE_ALG_AES_ECB_NOPAD = 0x10000010, - /** AES_CBC_NOPAD */ - TEE_ALG_AES_CBC_NOPAD = 0x10000110, - /** AES_CTR */ - TEE_ALG_AES_CTR = 0x10000210, - /** AES_CTS */ - TEE_ALG_AES_CTS = 0x10000310, - /** AES_XTS */ - TEE_ALG_AES_XTS = 0x10000410, - /** AES_CBC_MAC_NOPAD */ - TEE_ALG_AES_CBC_MAC_NOPAD = 0x30000110, - /** AES_CBC_MAC_PKCS5 */ - TEE_ALG_AES_CBC_MAC_PKCS5 = 0x30000510, - /** AES_CMAC */ - TEE_ALG_AES_CMAC = 0x30000610, - /** AES_GMAC */ - TEE_ALG_AES_GMAC = 0x30000810, - /** AES_CCM */ - TEE_ALG_AES_CCM = 0x40000710, - /** AES_GCM */ - TEE_ALG_AES_GCM = 0x40000810, - /** DES_ECB_NOPAD */ - TEE_ALG_DES_ECB_NOPAD = 0x10000011, - /** DES_CBC_NOPAD */ - TEE_ALG_DES_CBC_NOPAD = 0x10000111, - /** DES_CBC_MAC_NOPAD */ - TEE_ALG_DES_CBC_MAC_NOPAD = 0x30000111, - /** DES_CBC_MAC_PKCS5 */ - TEE_ALG_DES_CBC_MAC_PKCS5 = 0x30000511, - /** DES3_ECB_NOPAD */ - TEE_ALG_DES3_ECB_NOPAD = 0x10000013, - /** DES3_CBC_NOPAD */ - TEE_ALG_DES3_CBC_NOPAD = 0x10000113, - /** DES3_CBC_MAC_NOPAD */ - TEE_ALG_DES3_CBC_MAC_NOPAD = 0x30000113, - /** DES3_CBC_MAC_PKCS5 */ - TEE_ALG_DES3_CBC_MAC_PKCS5 = 0x30000513, - /** RSASSA_PKCS1_V1_5_MD5 */ - TEE_ALG_RSASSA_PKCS1_V1_5_MD5 = 0x70001830, - /** RSASSA_PKCS1_V1_5_SHA1 */ - TEE_ALG_RSASSA_PKCS1_V1_5_SHA1 = 0x70002830, - /** RSASSA_PKCS1_V1_5_SHA224 */ - TEE_ALG_RSASSA_PKCS1_V1_5_SHA224 = 0x70003830, - /** RSASSA_PKCS1_V1_5_SHA256 */ - TEE_ALG_RSASSA_PKCS1_V1_5_SHA256 = 0x70004830, - /** RSASSA_PKCS1_V1_5_SHA384 */ - TEE_ALG_RSASSA_PKCS1_V1_5_SHA384 = 0x70005830, - /** RSASSA_PKCS1_V1_5_SHA512 */ - TEE_ALG_RSASSA_PKCS1_V1_5_SHA512 = 0x70006830, - /** RSASSA_PKCS1_PSS_MGF1_MD5 */ - TEE_ALG_RSASSA_PKCS1_PSS_MGF1_MD5 = 0x70111930, - /** RSASSA_PKCS1_PSS_MGF1_SHA1 */ - TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1 = 0x70212930, - /** RSASSA_PKCS1_PSS_MGF1_SHA224 */ - TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224 = 0x70313930, - /** RSASSA_PKCS1_PSS_MGF1_SHA256 */ - TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256 = 0x70414930, - /** RSASSA_PKCS1_PSS_MGF1_SHA384 */ - TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384 = 0x70515930, - /** RSASSA_PKCS1_PSS_MGF1_SHA512 */ - TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512 = 0x70616930, - /** RSAES_PKCS1_V1_5 */ - TEE_ALG_RSAES_PKCS1_V1_5 = 0x60000130, - /** RSAES_PKCS1_OAEP_MGF1_SHA1 */ - TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1 = 0x60210230, - /** RSAES_PKCS1_OAEP_MGF1_SHA224 */ - TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA224 = 0x60211230, - /** RSAES_PKCS1_OAEP_MGF1_SHA256 */ - TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA256 = 0x60212230, - /** RSAES_PKCS1_OAEP_MGF1_SHA384 */ - TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA384 = 0x60213230, - /** RSAES_PKCS1_OAEP_MGF1_SHA512 */ - TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA512 = 0x60214230, - /** RSA_NOPAD */ - TEE_ALG_RSA_NOPAD = 0x60000030, - /** DSA_SHA1 */ - TEE_ALG_DSA_SHA1 = 0x70002131, - /** DSA_SHA224 */ - TEE_ALG_DSA_SHA224 = 0x70003131, - /** DSA_SHA256 */ - TEE_ALG_DSA_SHA256 = 0x70004131, - /** DH_DERIVE_SHARED_SECRET */ - TEE_ALG_DH_DERIVE_SHARED_SECRET = 0x80000032, - /** MD5 */ - TEE_ALG_MD5 = 0x50000001, - /** SHA1 */ - TEE_ALG_SHA1 = 0x50000002, - /** SHA224 */ - TEE_ALG_SHA224 = 0x50000003, - /** SHA256 */ - TEE_ALG_SHA256 = 0x50000004, - /** SHA384 */ - TEE_ALG_SHA384 = 0x50000005, - /** SHA512 */ - TEE_ALG_SHA512 = 0x50000006, - /** HMAC_MD5 */ - TEE_ALG_HMAC_MD5 = 0x30000001, - /** HMAC_SHA1 */ - TEE_ALG_HMAC_SHA1 = 0x30000002, - /** HMAC_SHA1 */ - TEE_ALG_HMAC_SHA224 = 0x30000003, - /** HMAC_SHA224 */ - TEE_ALG_HMAC_SHA256 = 0x30000004, - /** HMAC_SHA256 */ - TEE_ALG_HMAC_SHA384 = 0x30000005, - /** HMAC_SHA384 */ - TEE_ALG_HMAC_SHA512 = 0x30000006, - /** HMAC_SHA512 */ - TEE_ALG_HMAC_SM3 = 0x30000007, - /** HMAC_SM3 */ - TEE_ALG_AES_ECB_PKCS5 = 0x10000020, - /** AES_ECB_PKCS5 */ - TEE_ALG_AES_CBC_PKCS5 = 0x10000220, - /** AES_CBC_PKCS5 */ - TEE_ALG_ECDSA_SHA1 = 0x70001042, - /** ECDSA_SHA1 */ - TEE_ALG_ECDSA_SHA224 = 0x70002042, - /** ECDSA_SHA224 */ - TEE_ALG_ECDSA_SHA256 = 0x70003042, - /** ECDSA_SHA256 */ - TEE_ALG_ECDSA_SHA384 = 0x70004042, - /** ECDSA_SHA384 */ - TEE_ALG_ECDSA_SHA512 = 0x70005042, - /** ECDSA_SHA512 */ - TEE_ALG_ED25519 = 0x70005043, - /** ED25519 */ - TEE_ALG_ECDH_DERIVE_SHARED_SECRET = 0x80000042, - /** ECDH_DERIVE_SHARED_SECRET */ - TEE_ALG_X25519 = 0x80000044, - /** X25519 */ - TEE_ALG_ECC = 0x80000001, - /** ECC */ - TEE_ALG_ECDSA_P192 = 0x70001042, - /** ECDSA_P192 */ - TEE_ALG_ECDSA_P224 = 0x70002042, - /** ECDSA_P224 */ - TEE_ALG_ECDSA_P256 = 0x70003042, - /** ECDSA_P256 */ - TEE_ALG_ECDSA_P384 = 0x70004042, - /** ECDSA_P521 */ - TEE_ALG_ECDSA_P521 = 0x70005042, - /** ECDH_P192 */ - TEE_ALG_ECDH_P192 = 0x80001042, - /** ECDH_P224 */ - TEE_ALG_ECDH_P224 = 0x80002042, - /** ECDH_P256 */ - TEE_ALG_ECDH_P256 = 0x80003042, - /** ECDH_P384 */ - TEE_ALG_ECDH_P384 = 0x80004042, - /** ECDH_P521 */ - TEE_ALG_ECDH_P521 = 0x80005042, - /** SIP_HASH */ - TEE_ALG_SIP_HASH = 0xF0000002, - /** SM2_DSA_SM3 */ - TEE_ALG_SM2_DSA_SM3 = 0x70006045, - /** SM2_PKE */ - TEE_ALG_SM2_PKE = 0x80000045, - /** SM3 */ - TEE_ALG_SM3 = 0x50000007, - /** SM4_ECB_NOPAD */ - TEE_ALG_SM4_ECB_NOPAD = 0x10000014, - /** SM4_CBC_NOPAD */ - TEE_ALG_SM4_CBC_NOPAD = 0x10000114, - /** SM4_CBC_PKCS7 */ - TEE_ALG_SM4_CBC_PKCS7 = 0xF0000003, - /** SM4_CTR */ - TEE_ALG_SM4_CTR = 0x10000214, - /** SM4_CFB128 */ - TEE_ALG_SM4_CFB128 = 0xF0000000, - /** SM4_XTS */ - TEE_ALG_SM4_XTS = 0x10000414, - /** SM4_OFB */ - TEE_ALG_SM4_OFB = 0x10000514, - /** AES_OFB */ - TEE_ALG_AES_OFB = 0x10000510, - /** SM4_GCM */ - TEE_ALG_SM4_GCM = 0xF0000005, -}; - -/** - * @see __tee_crypto_algorithm_id - */ -typedef enum __tee_crypto_algorithm_id tee_crypto_algorithm_id; -/** - * @brief No element is available. - * - * @since 12 - */ -#define TEE_OPTIONAL_ELEMENT_NONE 0x00000000 - -/** - * @brief Enumerates the Elliptic-Curve Cryptography (ECC) curves supported. - * - * @since 12 - */ -typedef enum { - /** CURVE_NIST_P192 */ - TEE_ECC_CURVE_NIST_P192 = 0x00000001, - /** CURVE_NIST_P224 */ - TEE_ECC_CURVE_NIST_P224 = 0x00000002, - /** CURVE_NIST_P256 */ - TEE_ECC_CURVE_NIST_P256 = 0x00000003, - /** CURVE_NIST_P384 */ - TEE_ECC_CURVE_NIST_P384 = 0x00000004, - /** CURVE_NIST_P521 */ - TEE_ECC_CURVE_NIST_P521 = 0x00000005, - /** CURVE_SM2 256 bits */ - TEE_ECC_CURVE_SM2 = 0x00000300, - /** CURVE_25519 256 bits */ - TEE_ECC_CURVE_25519 = 0x00000200, -} TEE_ECC_CURVE; - -/** - * @brief Enumerates the Mask Generation Function (MGF1) modes. - * - * @since 12 - */ -typedef enum { - TEE_DH_HASH_SHA1_mode = 0, - TEE_DH_HASH_SHA224_mode = 1, - TEE_DH_HASH_SHA256_mode = 2, - TEE_DH_HASH_SHA384_mode = 3, - TEE_DH_HASH_SHA512_mode = 4, - TEE_DH_HASH_NumOfModes, -} TEE_DH_HASH_Mode; - -/** - * @brief Enumerates the cryptographic operation modes. - * - * @since 12 - */ -enum __TEE_OperationMode { - /** Encryption */ - TEE_MODE_ENCRYPT = 0x0, - /** Decryption */ - TEE_MODE_DECRYPT, - /** Signing */ - TEE_MODE_SIGN, - /** Signature verification */ - TEE_MODE_VERIFY, - /** MAC */ - TEE_MODE_MAC, - /** Digest */ - TEE_MODE_DIGEST, - /** Key derivation */ - TEE_MODE_DERIVE -}; - -/** - * @brief Enumerates the cryptographic operation states. - * - * @since 12 - */ -enum tee_operation_state { - /** Initial */ - TEE_OPERATION_STATE_INITIAL = 0x00000000, - /** Active */ - TEE_OPERATION_STATE_ACTIVE = 0x00000001, -}; - -/** - * @see __TEE_OperationMode - */ -typedef uint32_t TEE_OperationMode; - -/** - * @brief Defines the operation information. - * - * @since 12 - */ -struct __TEE_OperationInfo { - /** Algorithm ID */ - uint32_t algorithm; /* #__TEE_CRYPTO_ALGORITHM_ID */ - /** Operation type */ - uint32_t operationClass; /* #__TEE_Operation_Constants */ - /** Operation mode */ - uint32_t mode; /* #__TEE_OperationMode */ - /** Digest length */ - uint32_t digestLength; - /** Maximum key length */ - uint32_t maxKeySize; - /** Key length*/ - uint32_t keySize; - /** Required key usage */ - uint32_t requiredKeyUsage; - /** Handle state */ - uint32_t handleState; - /** Key */ - void *keyValue; -}; - -/** - * @brief Defines the __TEE_OperationInfo struct. - * - * @see __TEE_OperationInfo - */ -typedef struct __TEE_OperationInfo TEE_OperationInfo; - -/** - * @brief Defines the key information stored in the OperationInfo. - * - * @since 12 - */ -typedef struct { - /** Key length */ - uint32_t keySize; - /** Required key usage */ - uint32_t requiredKeyUsage; -} TEE_OperationInfoKey; - -/** - * @brief Defines information about an operation. - * - * @since 12 - */ -typedef struct { - /** Algorithm ID */ - uint32_t algorithm; - /** Operation type */ - uint32_t operationClass; - /** Operation mode */ - uint32_t mode; - /** Digest length */ - uint32_t digestLength; - /** Maximum key length */ - uint32_t maxKeySize; - /** Handle state */ - uint32_t handleState; - /** Operation state */ - uint32_t operationState; - /** Number of keys */ - uint32_t numberOfKeys; - /** Key information */ - TEE_OperationInfoKey keyInformation[]; -} TEE_OperationInfoMultiple; - -/** - * @brief Defines the cryptographic operation handle. - * - * @since 12 - */ -struct __TEE_OperationHandle { - /** Algorithm ID */ - uint32_t algorithm; - /** Operation type */ - uint32_t operationClass; - /** Operation mode */ - uint32_t mode; - /** Digest length */ - uint32_t digestLength; - /** Maximum key length */ - uint32_t maxKeySize; - /** Key length */ - uint32_t keySize; - /** Key length */ - uint32_t keySize2; - /** Required key usage */ - uint32_t requiredKeyUsage; - /** Handle state */ - uint32_t handleState; - /** Key */ - void *keyValue; - /** Key */ - void *keyValue2; - /** */ - void *crypto_ctxt; - /** */ - void *hmac_rest_ctext; - /** iv */ - void *IV; - /** Public key */ - void *publicKey; - /** Length of the public key */ - uint32_t publicKeyLen; - /** Private key */ - void *privateKey; - /** Length of the private key */ - uint32_t privateKeyLen; - /** Length of the IV */ - uint32_t IVLen; - /** Operation lock */ - pthread_mutex_t operation_lock; - /** HAL information */ - void *hal_info; -}; - -/** - * @brief Defines the data used for conversion of integers. - * - * @since 12 - */ -typedef struct { - /** Source */ - uint32_t src; - /** Destination */ - uint32_t dest; -} crypto_uint2uint; - -/** - * @brief Defines the maximum length of an RSA public key. - * - * @since 12 - */ -#define RSA_PUBKEY_MAXSIZE sizeof(CRYS_RSAUserPubKey_t) -/** - * @brief Defines the maximum length of an RES private key. - * - * @since 12 - */ -#define RSA_PRIVKEY_MAXSIZE sizeof(CRYS_RSAUserPrivKey_t) - -/** - * @brief Defines a structure to hold the input and output data. - * - * @since 12 - */ -typedef struct { - /** Source data */ - void *src_data; - /** Length of the source data */ - size_t src_len; - /** Destination data */ - void *dest_data; - /** Length of the destination data */ - size_t *dest_len; -} operation_src_dest; - -/** - * @brief Defines the AE initialization data. - * - * @since 12 - */ -typedef struct { - /** nonce */ - void *nonce; - /** Leng of nonce */ - size_t nonce_len; - /** Length of the tag */ - uint32_t tag_len; - /** Length of the additional authenticated data (AAD) */ - size_t aad_len; - /** Length of the payload */ - size_t payload_len; -} operation_ae_init; - -/** - * @brief Defines the pointer to __TEE_OperationHandle. - * - * @see __TEE_OperationHandle - * - * @since 12 - */ -typedef struct __TEE_OperationHandle *TEE_OperationHandle; - -/** - * @brief Defines the __TEE_OperationHandle struct. - * - * @see __TEE_OperationHandle - * - * @since 12 - */ -typedef struct __TEE_OperationHandle TEE_OperationHandleVar; - -/** - * @brief Defines the __TEE_ObjectHandle struct. - * - * @since 12 - */ -typedef struct __TEE_ObjectHandle TEE_ObjectHandleVar; - -/** - * @brief Allocates an operation handle. - * - * @param operation Indicates the pointer to the operation handle. - * @param algorithm Indicates the cipher algorithm. - * @param mode Indicates the operation mode. - * @param maxKeySize Indicates the maximum length of the key. - * - * @return Returns TEE_SUCCESS if the operation handle is allocated. - * Returns TEE_ERROR_OUT_OF_MEMORY if there is no enough memory for this operation. - * Returns TEE_ERROR_NOT_SUPPORTED if the specified algorithm is not supported. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AllocateOperation(TEE_OperationHandle *operation, uint32_t algorithm, uint32_t mode, - uint32_t maxKeySize); - -/** - * @brief Releases an operation handle. - * - * @param operation Indicates the operation handle to release. - * - * @since 12 - * @version 1.0 - */ -void TEE_FreeOperation(TEE_OperationHandle operation); - -/** - * @brief Obtains operation information. - * - * @param operation Indicates the operation handle. - * @param operationInfo Indicates the pointer to the operation information. - * - * @since 12 - * @version 1.0 - */ -void TEE_GetOperationInfo(const TEE_OperationHandle operation, TEE_OperationInfo *operationInfo); - -/** - * @brief Resets an operation handle. - * - * @param operation Indicates the operation handle to reset. - * - * @since 12 - * @version 1.0 - */ -void TEE_ResetOperation(TEE_OperationHandle operation); - -/** - * @brief Sets the key for an operation. - * - * @param operation Indicates the operation handle. - * @param key Indicates the key. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_OUT_OF_MEMORY if there is no enough memory for this operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SetOperationKey(TEE_OperationHandle operation, const TEE_ObjectHandle key); - -/** - * @brief Sets two keys for an operation. - * - * @param operation Indicates the operation handle. - * @param key1 Indicates key 1. - * @param key2 Indicates key 2. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SetOperationKey2(TEE_OperationHandle operation, const TEE_ObjectHandle key1, - const TEE_ObjectHandle key2); - -/** - * @brief Copies an operation handle. - * - * @param dstOperation Indicates the destination operation handle. - * @param srcOperation Indicates the source operation handle. - * - * @since 12 - * @version 1.0 - */ -void TEE_CopyOperation(TEE_OperationHandle dstOperation, const TEE_OperationHandle srcOperation); - -/** - * @brief Initializes the context to start a cipher operation. - * - * @param operation Indicates the operation handle. - * @param IV Indicates the pointer to the buffer storing the operation IV. If this parameter is not used, - * set it to NULL. - * @param IVLen Indicates the length of the IV buffer. - * - * @since 12 - * @version 1.0 - */ -void TEE_CipherInit(TEE_OperationHandle operation, const void *IV, size_t IVLen); - -/** - * @brief Updates the data for a cipher operation. - * - * @param operation Indicates the operation handle. - * @param srcData Indicates the pointer to the source data. - * @param srcLen Indicates the length of the source data. - * @param destData Indicates the pointer to the destination data. - * @param destLen Indicates the pointer to the destination data length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_CipherUpdate(TEE_OperationHandle operation, const void *srcData, size_t srcLen, void *destData, - size_t *destLen); - -/** - * @brief Finalizes a cipher operation. - * - * @param operation Indicates the operation handle. - * @param srcData Indicates the pointer to the source data. - * @param srcLen Indicates the length of the source data. - * @param destData Indicates the pointer to the destination data. - * @param destLen Indicates the pointer to the destination data length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_CipherDoFinal(TEE_OperationHandle operation, const void *srcData, size_t srcLen, void *destData, - size_t *destLen); - -/** - * @brief Updates the digest. - * - * @param operation Indicates the operation handle. - * @param chunk Indicates the pointer to the chunk of data to be hashed. - * @param chunkSize Indicates the length of the chunk. - * - * @since 12 - * @version 1.0 - */ -void TEE_DigestUpdate(TEE_OperationHandle operation, const void *chunk, size_t chunkSize); - -/** - * @brief Finalizes the message digest operation. - * - * @param operation Indicates the operation handle. - * @param chunk Indicates the pointer to the chunk of data to be hashed. - * @param chunkLen Indicates the length of the chunk. - * @param hash Indicates the pointer to the buffer storing the message hash. - * @param hashLen - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_DigestDoFinal(TEE_OperationHandle operation, const void *chunk, size_t chunkLen, void *hash, - size_t *hashLen); - -/** - * @brief Initializes a MAC operation. - * - * @param operation Indicates the operation handle. - * @param IV Indicates the pointer to the buffer storing the operation IV. If this parameter is not used, - * set it to NULL. - * @param IVLen Indicates the length of the IV buffer. - * - * @since 12 - * @version 1.0 - */ -void TEE_MACInit(TEE_OperationHandle operation, void *IV, size_t IVLen); - -/** - * @brief Updates the MAC. - * - * @param operation Indicates the operation handle. - * @param chunk Indicates the pointer to the chunk of MAC data. - * @param chunkSize Indicates the size of the chunk. - * - * @since 12 - * @version 1.0 - */ -void TEE_MACUpdate(TEE_OperationHandle operation, const void *chunk, size_t chunkSize); - -/** - * @brief MAC Finalizes the MAC operation with a last chunk of message and computes the MAC. - * - * @param operation Indicates the operation handle. - * @param message Indicates the pointer to the buffer containing the last message chunk to MAC. - * @param messageLen Indicates the length of the message buffer. - * @param mac Indicates the pointer to the buffer storing the computed MAC. - * @param macLen Indicates the pointer to the MAC buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_MACComputeFinal(TEE_OperationHandle operation, const void *message, size_t messageLen, void *mac, - size_t *macLen); - -/** - * @brief Finalizes the MAC operation and compares the MAC with the one passed in. - * - * @param operation Indicates the operation handle. - * @param message Indicates the pointer to the buffer containing the last message chunk to MAC. - * @param messageLen Indicates the length of the buffer. - * @param mac Indicates the pointer to the buffer storing the computed MAC. - * @param macLen Indicates the MAC buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * Returns TEE_ERROR_MAC_INVALID if the computed MAC is not the same as that passed in. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_MACCompareFinal(TEE_OperationHandle operation, const void *message, size_t messageLen, const void *mac, - const size_t macLen); - -/** - * @brief Derives a key. - * - * @param operation Indicates the operation handle. - * @param params Indicates the pointer to the parameters for this operation. - * @param paramCount Indicates the number of parameters. - * @param derivedKey Indicates the derived key. - * - * @since 12 - * @version 1.0 - */ -void TEE_DeriveKey(TEE_OperationHandle operation, const TEE_Attribute *params, uint32_t paramCount, - TEE_ObjectHandle derivedKey); - -/** - * @brief Generates random data. - * - * @param randomBuffer Indicates the pointer to the buffer storing the random data generated. - * @param randomBufferLen Indicates the length of the buffer storing the random data. - * - * @since 12 - * @version 1.0 - */ -void TEE_GenerateRandom(void *randomBuffer, size_t randomBufferLen); - -/** - * @brief Initializes an AE operation. - * - * @param operation Indicates the operation handle. - * @param nonce Indicates the pointer to the buffer for storing the nonce. - * @param nonceLen Indicates the length of the nonce. - * @param tagLen Indicates the length of the tag. - * @param AADLen Indicates the length of the AAD. - * @param payloadLen Indicates the length of the payload. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AEInit(TEE_OperationHandle operation, void *nonce, size_t nonceLen, uint32_t tagLen, size_t AADLen, - size_t payloadLen); - -/** - * @brief Updates the AAD in an AE operation. - * - * @param operation Indicates the operation handle. - * @param AADdata Indicates the pointer to the new AAD. - * @param AADdataLen Indicates the length of the new AAD. - * - * @since 12 - * @version 1.0 - */ -void TEE_AEUpdateAAD(TEE_OperationHandle operation, const void *AADdata, size_t AADdataLen); - -/** - * @brief Updates data for an AE operation. - * - * @param operation Indicates the operation handle. - * @param srcData Indicates the pointer to the source data. - * @param srcLen Indicates the length of the source data. - * @param destData Indicates the pointer to the destination data. - * @param destLen Indicates the pointer to the destination data length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AEUpdate(TEE_OperationHandle operation, void *srcData, size_t srcLen, void *destData, size_t *destLen); - -/** - * @brief Finalizes the AE encryption operation. - * - * @param operation Indicates the operation handle. - * @param srcData Indicates the pointer to the source data. - * @param srcLen Indicates the length of the source data. - * @param destData Indicates the pointer to the destination data. - * @param destLen Indicates the pointer to the destination data length. - * @param tag Indicates the pointer to the buffer storing the computed tag. - * @param tagLen Indicates the pointer to the tag buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AEEncryptFinal(TEE_OperationHandle operation, void *srcData, size_t srcLen, void *destData, - size_t *destLen, void *tag, size_t *tagLen); - -/** - * @brief Finalizes an AE decryption operation. - * - * @param operation Indicates the operation handle. - * @param srcData Indicates the pointer to the source data. - * @param srcLen Indicates the length of the source data. - * @param destData Indicates the pointer to the destination data. - * @param destLen Indicates the pointer to the destination data length. - * @param tag Indicates the pointer to the buffer storing the computed tag. - * @param tagLen Indicates the tag buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_MAC_INVALID if the computed tag does not match the provided tag. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AEDecryptFinal(TEE_OperationHandle operation, void *srcData, size_t srcLen, void *destData, - size_t *destLen, void *tag, size_t tagLen); - -/** - * @brief Performs asymmetric encryption. - * - * @param operation Indicates the operation handle. - * @param params Indicates the pointer to the parameters for this operation. - * @param paramCount Indicates the number of parameters. - * @param srcData Indicates the pointer to the source data. - * @param srcLen Indicates the length of the source data. - * @param destData Indicates the pointer to the destination data. - * @param destLen Indicates the pointer to the destination data length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AsymmetricEncrypt(TEE_OperationHandle operation, const TEE_Attribute *params, uint32_t paramCount, - void *srcData, size_t srcLen, void *destData, size_t *destLen); - -/** - * @brief Performs asymmetric decryption. - * - * @param operation Indicates the operation handle. - * @param params Indicates the pointer to the parameters for this operation. - * @param paramCount Indicates the number of parameters. - * @param srcData Indicates the pointer to the source data. - * @param srcLen Indicates the length of the source data. - * @param destData Indicates the pointer to the destination data. - * @param destLen Indicates the pointer to the destination data length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AsymmetricDecrypt(TEE_OperationHandle operation, const TEE_Attribute *params, uint32_t paramCount, - void *srcData, size_t srcLen, void *destData, size_t *destLen); - -/** - * @brief Signs a message digest in an asymmetric operation. - * - * @param operation Indicates the operation handle. - * @param params Indicates the pointer to the parameters for this operation. - * @param paramCount Indicates the number of parameters. - * @param digest Indicates the pointer to the message digest. - * @param digestLen Indicates the digest length. - * @param signature Indicates the pointer to the signature. - * @param signatureLen Indicates the pointer to the signature length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AsymmetricSignDigest(TEE_OperationHandle operation, const TEE_Attribute *params, uint32_t paramCount, - void *digest, size_t digestLen, void *signature, size_t *signatureLen); - -/** - * @brief Verifies a message digest signature in an asymmetric operation. - * - * @param operation Indicates the operation handle. - * @param params Indicates the pointer to the parameters for this operation. - * @param paramCount Indicates the number of parameters. - * @param digest Indicates the pointer to the message digest. - * @param digestLen Indicates the digest length. - * @param signature Indicates the pointer to the signature. - * @param signatureLen Indicates the signature length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_GENERIC if the operation fails due to other errors. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AsymmetricVerifyDigest(TEE_OperationHandle operation, const TEE_Attribute *params, uint32_t paramCount, - void *digest, size_t digestLen, void *signature, size_t signatureLen); - -/** - * @brief Obtains information about the operation involving multiple keys. - * - * @param operation Indicates the operation handle. - * @param operationInfoMultiple Indicates the pointer to the operation information obtained. - * @param operationSize [IN/OUT] Indicates the pointer to the operation information size. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if the operation fails due to invalid parameters. - * Returns TEE_ERROR_SHORT_BUFFER if the operationInfo buffer is not large enough to - * hold the information obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetOperationInfoMultiple(TEE_OperationHandle operation, TEE_OperationInfoMultiple *operationInfoMultiple, - const size_t *operationSize); - -/** - * @brief Checks whether the algorithm is supported. - * - * @param algId Indicates the algorithm to check. - * @param element Indicates the cryptographic element. - * - * @return Returns TEE_SUCCESS if the algorithm is supported. - * Returns TEE_ERROR_NOT_SUPPORTED otherwise. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_IsAlgorithmSupported(uint32_t algId, uint32_t element); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_crypto_hal.h b/tee/include/tee_crypto_hal.h deleted file mode 100644 index 6ae67f9a99ff5f8a19a4fc382dc45f24f9c064f7..0000000000000000000000000000000000000000 --- a/tee/include/tee_crypto_hal.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef TEE_CRYPTO_HAL_H -#define TEE_CRYPTO_HAL_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_crypto_hal.h - * - * @brief Provides APIs for cryptographic operations. - * - * You can use these APIs to implement encryption and decryption. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_crypto_api.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Enumerates the types of the crypto engine. - * - * @since 12 - */ -enum CRYPTO_ENGINE { - SOFT_CRYPTO = 2, - CRYPTO_ENGINE_MAX = 1024, -}; - -/** - * @brief Sets the encryption and decryption engines to an operation. - * - * @param operation Indicates the handle of the operation to set. - * @param crypto Indicates the engines to set. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if operation is null or crypto is invalid. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SetCryptoFlag(TEE_OperationHandle operation, uint32_t crypto); - -/** - * @brief Sets the encryption and decryption engines to an object. - * - * @param object Indicates the handle of the object to set. - * @param crypto Indicates the engines to set. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_BAD_PARAMETERS if object is null or crypto is invalid. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SetObjectFlag(TEE_ObjectHandle object, uint32_t crypto); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif - diff --git a/tee/include/tee_defines.h b/tee/include/tee_defines.h deleted file mode 100644 index e427afd1209e8dcecb4df8aa5fc8c5c62aecff4b..0000000000000000000000000000000000000000 --- a/tee/include/tee_defines.h +++ /dev/null @@ -1,607 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef __TEE_DEFINES_H -#define __TEE_DEFINES_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_defines.h - * - * @brief Defines basic data types and data structures of TEE. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif -#ifndef TA_EXPORT -#define TA_EXPORT -#endif - -/** - * @brief Defines the tee mutex handle. - * - * @since 12 - */ -typedef int *tee_mutex_handle; - -#define API_LEVEL1_1_1 2 -#define API_LEVEL1_2 3 - -#define TEE_PARAMS_NUM 4 -#undef true -#define true 1 - -#undef false -#define false 0 - -#ifndef NULL -#define NULL ((void *)0) -#endif - -#define PARAM_NOT_USED(val) ((void)(val)) - -/** - * @brief Enumerates the TEE parameter. - * - * @since 12 - */ -typedef union { - struct { - void *buffer; - size_t size; - } memref; - struct { - unsigned int a; - unsigned int b; - } value; - struct { - void *buffer; - size_t size; - } sharedmem; -} TEE_Param; - -#define TEE_PARAM_TYPES(param0Type, param1Type, param2Type, param3Type) \ - (((param3Type) << 12) | ((param2Type) << 8) | ((param1Type) << 4) | (param0Type)) - -#define TEE_PARAM_TYPE_GET(paramTypes, index) (((paramTypes) >> (4U * (index))) & 0x0F) - -/** - * @brief Checks parameter types. - * - * @param param_to_check Indicates the expected parameter values. - * @param valid0 Indicates the first parameter type to check. - * @param valid1 Indicates the second parameter type to check. - * @param valid2 Indicates the third parameter type to check. - * @param valid3 Indicates the fourth parameter type to check. - * - * @return Returns true if the parameter types are correct. - * Returns false otherwise. - * @since 12 - */ -static inline bool check_param_type(uint32_t param_to_check, uint32_t valid0, uint32_t valid1, uint32_t valid2, - uint32_t valid3) -{ - return (TEE_PARAM_TYPES(valid0, valid1, valid2, valid3) == param_to_check); -} - -/** - * @brief Enumerates the types of the TEE parameter. - * - * @since 12 - */ -enum TEE_ParamType { - TEE_PARAM_TYPE_NONE = 0x0, - TEE_PARAM_TYPE_VALUE_INPUT = 0x1, - TEE_PARAM_TYPE_VALUE_OUTPUT = 0x2, - TEE_PARAM_TYPE_VALUE_INOUT = 0x3, - TEE_PARAM_TYPE_MEMREF_INPUT = 0x5, - TEE_PARAM_TYPE_MEMREF_OUTPUT = 0x6, - TEE_PARAM_TYPE_MEMREF_INOUT = 0x7, - TEE_PARAM_TYPE_ION_INPUT = 0x8, - TEE_PARAM_TYPE_ION_SGLIST_INPUT = 0x9, - TEE_PARAM_TYPE_MEMREF_SHARED_INOUT = 0xa, - TEE_PARAM_TYPE_RESMEM_INPUT = 0xc, - TEE_PARAM_TYPE_RESMEM_OUTPUT = 0xd, - TEE_PARAM_TYPE_RESMEM_INOUT = 0xe, -}; - -#define S_VAR_NOT_USED(variable) \ - do { \ - (void)(variable); \ - } while (0) - -/** - * @brief Defines an object information. - * - * @since 12 - */ -typedef struct { - uint32_t objectType; - uint32_t objectSize; - uint32_t maxObjectSize; - uint32_t objectUsage; - uint32_t dataSize; - uint32_t dataPosition; - uint32_t handleFlags; -} TEE_ObjectInfo; - -/** - * @brief Defines an object attribute. - * - * @since 12 - */ -typedef struct { - uint32_t attributeID; - union { - struct { - void *buffer; - size_t length; - } ref; - struct { - uint32_t a; - uint32_t b; - } value; - } content; -} TEE_Attribute; - -/** - * @brief Enumerates the types of object attribute. - * - * @since 12 - */ -enum TEE_ObjectAttribute { - TEE_ATTR_SECRET_VALUE = 0xC0000000, - TEE_ATTR_RSA_MODULUS = 0xD0000130, - TEE_ATTR_RSA_PUBLIC_EXPONENT = 0xD0000230, - TEE_ATTR_RSA_PRIVATE_EXPONENT = 0xC0000330, - TEE_ATTR_RSA_PRIME1 = 0xC0000430, - TEE_ATTR_RSA_PRIME2 = 0xC0000530, - TEE_ATTR_RSA_EXPONENT1 = 0xC0000630, - TEE_ATTR_RSA_EXPONENT2 = 0xC0000730, - TEE_ATTR_RSA_COEFFICIENT = 0xC0000830, - TEE_ATTR_RSA_MGF1_HASH = 0xF0000830, - TEE_ATTR_DSA_PRIME = 0xD0001031, - TEE_ATTR_DSA_SUBPRIME = 0xD0001131, - TEE_ATTR_DSA_BASE = 0xD0001231, - TEE_ATTR_DSA_PUBLIC_VALUE = 0xD0000131, - TEE_ATTR_DSA_PRIVATE_VALUE = 0xC0000231, - TEE_ATTR_DH_PRIME = 0xD0001032, - TEE_ATTR_DH_SUBPRIME = 0xD0001132, - TEE_ATTR_DH_BASE = 0xD0001232, - TEE_ATTR_DH_X_BITS = 0xF0001332, - TEE_ATTR_DH_PUBLIC_VALUE = 0xD0000132, - TEE_ATTR_DH_PRIVATE_VALUE = 0xC0000232, - TEE_ATTR_RSA_OAEP_LABEL = 0xD0000930, - TEE_ATTR_RSA_PSS_SALT_LENGTH = 0xF0000A30, - TEE_ATTR_ECC_PUBLIC_VALUE_X = 0xD0000141, - TEE_ATTR_ECC_PUBLIC_VALUE_Y = 0xD0000241, - TEE_ATTR_ECC_PRIVATE_VALUE = 0xC0000341, - TEE_ATTR_ECC_CURVE = 0xF0000441, - TEE_ATTR_ED25519_CTX = 0xD0000643, - TEE_ATTR_ED25519_PUBLIC_VALUE = 0xD0000743, - TEE_ATTR_ED25519_PRIVATE_VALUE = 0xC0000843, - TEE_ATTR_ED25519_PH = 0xF0000543, - TEE_ATTR_X25519_PUBLIC_VALUE = 0xD0000944, - TEE_ATTR_X25519_PRIVATE_VALUE = 0xC0000A44, - TEE_ATTR_PBKDF2_HMAC_PASSWORD = 0xD0000133, - TEE_ATTR_PBKDF2_HMAC_SALT = 0xD0000134, - TEE_ATTR_PBKDF2_HMAC_DIGEST = 0xF0000135, -}; - -/** - * @brief Enumerates the types of object. - * - * @since 12 - */ -enum TEE_ObjectType { - TEE_TYPE_AES = 0xA0000010, - TEE_TYPE_DES = 0xA0000011, - TEE_TYPE_DES3 = 0xA0000013, - TEE_TYPE_HMAC_MD5 = 0xA0000001, - TEE_TYPE_HMAC_SHA1 = 0xA0000002, - TEE_TYPE_HMAC_SHA224 = 0xA0000003, - TEE_TYPE_HMAC_SHA256 = 0xA0000004, - TEE_TYPE_HMAC_SHA384 = 0xA0000005, - TEE_TYPE_HMAC_SHA512 = 0xA0000006, - TEE_TYPE_RSA_PUBLIC_KEY = 0xA0000030, - TEE_TYPE_RSA_KEYPAIR = 0xA1000030, - TEE_TYPE_DSA_PUBLIC_KEY = 0xA0000031, - TEE_TYPE_DSA_KEYPAIR = 0xA1000031, - TEE_TYPE_DH_KEYPAIR = 0xA1000032, - TEE_TYPE_GENERIC_SECRET = 0xA0000000, - TEE_TYPE_DATA = 0xA1000033, - TEE_TYPE_DATA_GP1_1 = 0xA00000BF, - TEE_TYPE_ECDSA_PUBLIC_KEY = 0xA0000041, - TEE_TYPE_ECDSA_KEYPAIR = 0xA1000041, - TEE_TYPE_ECDH_PUBLIC_KEY = 0xA0000042, - TEE_TYPE_ECDH_KEYPAIR = 0xA1000042, - TEE_TYPE_ED25519_PUBLIC_KEY = 0xA0000043, - TEE_TYPE_ED25519_KEYPAIR = 0xA1000043, - TEE_TYPE_X25519_PUBLIC_KEY = 0xA0000044, - TEE_TYPE_X25519_KEYPAIR = 0xA1000044, - TEE_TYPE_SM2_DSA_PUBLIC_KEY = 0xA0000045, - TEE_TYPE_SM2_DSA_KEYPAIR = 0xA1000045, - TEE_TYPE_SM2_KEP_PUBLIC_KEY = 0xA0000046, - TEE_TYPE_SM2_KEP_KEYPAIR = 0xA1000046, - TEE_TYPE_SM2_PKE_PUBLIC_KEY = 0xA0000047, - TEE_TYPE_SM2_PKE_KEYPAIR = 0xA1000047, - TEE_TYPE_HMAC_SM3 = 0xA0000007, - TEE_TYPE_SM4 = 0xA0000014, - TEE_TYPE_SIP_HASH = 0xF0000002, - TEE_TYPE_PBKDF2_HMAC = 0xF0000004, - - TEE_TYPE_CORRUPTED_OBJECT = 0xA00000BE, -}; - -#define OBJECT_NAME_LEN_MAX 255 - -/** - * @brief Defines an object handle. - * - * @since 12 - */ -struct __TEE_ObjectHandle { - void *dataPtr; - uint32_t dataLen; - uint8_t dataName[OBJECT_NAME_LEN_MAX]; - TEE_ObjectInfo *ObjectInfo; - TEE_Attribute *Attribute; - uint32_t attributesLen; - uint32_t CRTMode; - void *infoattrfd; - uint32_t generate_flag; - uint32_t storage_id; -}; - -/** - * @brief Defines the __TEE_ObjectHandle struct. - * - * @see __TEE_ObjectHandle - * - * @since 12 - */ -typedef struct __TEE_ObjectHandle *TEE_ObjectHandle; - -#define NODE_LEN 8 - -/** - * @brief Defines an UUID of TA. - * - * @since 12 - */ -typedef struct tee_uuid { - uint32_t timeLow; - uint16_t timeMid; - uint16_t timeHiAndVersion; - uint8_t clockSeqAndNode[NODE_LEN]; -} TEE_UUID; - -/** - * @brief Defines the type of spawn UUID. - * - * @since 12 - */ -typedef struct spawn_uuid { - uint64_t uuid_valid; - TEE_UUID uuid; -} spawn_uuid_t; - -/** - * @brief Enumerates the result codes used in the TEEKit APIs. - * - * @since 12 - */ -enum TEE_Result_Value { - /* The operation is successful. */ - TEE_SUCCESS = 0x00000000, - /* The command is invalid. */ - TEE_ERROR_INVALID_CMD = 0x00000001, - /* The service does not exist. */ - TEE_ERROR_SERVICE_NOT_EXIST = 0x00000002, - /* The session does not exist. */ - TEE_ERROR_SESSION_NOT_EXIST = 0x00000003, - /* The number of sessions exceeds the limit. */ - TEE_ERROR_SESSION_MAXIMUM = 0x00000004, - /* The service has been already registered. */ - TEE_ERROR_REGISTER_EXIST_SERVICE = 0x00000005, - /* An internal error occurs. */ - TEE_ERROR_TARGET_DEAD_FATAL = 0x00000006, - /* Failed to read data. */ - TEE_ERROR_READ_DATA = 0x00000007, - /* Failed to write data. */ - TEE_ERROR_WRITE_DATA = 0x00000008, - /* Failed to truncate data. */ - TEE_ERROR_TRUNCATE_OBJECT = 0x00000009, - /* Failed to seek data. */ - TEE_ERROR_SEEK_DATA = 0x0000000A, - /* Failed to synchronize data. */ - TEE_ERROR_SYNC_DATA = 0x0000000B, - /* Failed to rename the file. */ - TEE_ERROR_RENAME_OBJECT = 0x0000000C, - /* An error occurs when the TA is loaded. */ - TEE_ERROR_TRUSTED_APP_LOAD_ERROR = 0x0000000D, - /* An I/O error occurs when data is stored. */ - TEE_ERROR_STORAGE_EIO = 0x80001001, - /* The storage section is unavailable. */ - TEE_ERROR_STORAGE_EAGAIN = 0x80001002, - /* The operation target is not a directory. */ - TEE_ERROR_STORAGE_ENOTDIR = 0x80001003, - /* This operation cannot be performed on a directory. */ - TEE_ERROR_STORAGE_EISDIR = 0x80001004, - /* The number of opened files exceeds the limit in system. */ - TEE_ERROR_STORAGE_ENFILE = 0x80001005, - /* The number of files opened for the process exceeds the limit.*/ - TEE_ERROR_STORAGE_EMFILE = 0x80001006, - /* The storage section is read only. */ - TEE_ERROR_STORAGE_EROFS = 0x80001007, - /* The file path is not correct. */ - TEE_ERROR_STORAGE_PATH_WRONG = 0x8000100A, - /* The service message queue overflows. */ - TEE_ERROR_MSG_QUEUE_OVERFLOW = 0x8000100B, - /* The file object is corrupted. */ - TEE_ERROR_CORRUPT_OBJECT = 0xF0100001, - /* The storage section is unavailable. */ - TEE_ERROR_STORAGE_NOT_AVAILABLE = 0xF0100003, - /* The cipher text is incorrect. */ - TEE_ERROR_CIPHERTEXT_INVALID = 0xF0100006, - /* Protocol error in socket connection. */ - TEE_ISOCKET_ERROR_PROTOCOL = 0xF1007001, - /* The socket is closed by the remote end. */ - TEE_ISOCKET_ERROR_REMOTE_CLOSED = 0xF1007002, - /* The socket connection timed out. */ - TEE_ISOCKET_ERROR_TIMEOUT = 0xF1007003, - /* There is no resource available for the socket connection. */ - TEE_ISOCKET_ERROR_OUT_OF_RESOURCES = 0xF1007004, - /* The buffer is too large for the socket connection. */ - TEE_ISOCKET_ERROR_LARGE_BUFFER = 0xF1007005, - /* A warning is given in the socket connection. */ - TEE_ISOCKET_WARNING_PROTOCOL = 0xF1007006, - /* Generic error. */ - TEE_ERROR_GENERIC = 0xFFFF0000, - /* The access is denied. */ - TEE_ERROR_ACCESS_DENIED = 0xFFFF0001, - /* The operation has been canceled. */ - TEE_ERROR_CANCEL = 0xFFFF0002, - /* An access conflict occurs. */ - TEE_ERROR_ACCESS_CONFLICT = 0xFFFF0003, - /* The data size exceeds the maximum. */ - TEE_ERROR_EXCESS_DATA = 0xFFFF0004, - /* Incorrect data format. */ - TEE_ERROR_BAD_FORMAT = 0xFFFF0005, - /* Incorrect parameters. */ - TEE_ERROR_BAD_PARAMETERS = 0xFFFF0006, - /* The current state does not support the operation. */ - TEE_ERROR_BAD_STATE = 0xFFFF0007, - /* Failed to find the target item. */ - TEE_ERROR_ITEM_NOT_FOUND = 0xFFFF0008, - /* The API is not implemented. */ - TEE_ERROR_NOT_IMPLEMENTED = 0xFFFF0009, - /* The API is not supported. */ - TEE_ERROR_NOT_SUPPORTED = 0xFFFF000A, - /* There is no data available for this operation. */ - TEE_ERROR_NO_DATA = 0xFFFF000B, - /* There is no memory available for this operation. */ - TEE_ERROR_OUT_OF_MEMORY = 0xFFFF000C, - /* The system does not respond to this operation. */ - TEE_ERROR_BUSY = 0xFFFF000D, - /* Failed to communicate with the target. */ - TEE_ERROR_COMMUNICATION = 0xFFFF000E, - /* A security error occurs. */ - TEE_ERROR_SECURITY = 0xFFFF000F, - /* The buffer is insufficient for this operation. */ - TEE_ERROR_SHORT_BUFFER = 0xFFFF0010, - /* The operation has been canceled. */ - TEE_ERROR_EXTERNAL_CANCEL = 0xFFFF0011, - /* The service is in the pending state (asynchronous state). */ - TEE_PENDING = 0xFFFF2000, - /* The service is in the pending state(). */ - TEE_PENDING2 = 0xFFFF2001, - /* Reserved. */ - TEE_PENDING3 = 0xFFFF2002, - /* The operation timed out. */ - TEE_ERROR_TIMEOUT = 0xFFFF3001, - /* Overflow occurs. */ - TEE_ERROR_OVERFLOW = 0xFFFF300f, - /* The TA is crashed. */ - TEE_ERROR_TARGET_DEAD = 0xFFFF3024, - /* There is no enough space to store data. */ - TEE_ERROR_STORAGE_NO_SPACE = 0xFFFF3041, - /* The MAC operation failed. */ - TEE_ERROR_MAC_INVALID = 0xFFFF3071, - /* The signature verification failed. */ - TEE_ERROR_SIGNATURE_INVALID = 0xFFFF3072, - /* Interrupted by CFC. Broken control flow is detected. */ - TEE_CLIENT_INTR = 0xFFFF4000, - /* Time is not set. */ - TEE_ERROR_TIME_NOT_SET = 0xFFFF5000, - /* Time needs to be reset. */ - TEE_ERROR_TIME_NEEDS_RESET = 0xFFFF5001, - /* System error. */ - TEE_FAIL = 0xFFFF5002, - /* Base value of the timer error code. */ - TEE_ERROR_TIMER = 0xFFFF6000, - /* Failed to create the timer. */ - TEE_ERROR_TIMER_CREATE_FAILED = 0xFFFF6001, - /* Failed to destroy the timer. */ - TEE_ERROR_TIMER_DESTORY_FAILED = 0xFFFF6002, - /* The timer is not found. */ - TEE_ERROR_TIMER_NOT_FOUND = 0xFFFF6003, - /* Generic error of RPMB operations. */ - TEE_ERROR_RPMB_GENERIC = 0xFFFF7001, - /* Verify MAC failed in RPMB operations. */ - TEE_ERROR_RPMB_MAC_FAIL = 0xFFFF7002, - /* Incorrect message data MAC in RPMB response. */ - TEE_ERROR_RPMB_RESP_UNEXPECT_MAC = 0xFFFF7105, - /* The file is not found in RPMB. */ - TEE_ERROR_RPMB_FILE_NOT_FOUND = 0xFFFF7106, - /* No spece left for RPMB operations. */ - TEE_ERROR_RPMB_NOSPC = 0xFFFF7107, - /* sec flash is not available. */ - TEE_ERROR_SEC_FLASH_NOT_AVAILABLE = 0xFFFF7118, - /* The BIO service is not available. */ - TEE_ERROR_BIOSRV_NOT_AVAILABLE = 0xFFFF711A, - /* The ROT service is not available. */ - TEE_ERROR_ROTSRV_NOT_AVAILABLE = 0xFFFF711B, - /* The TA Anti-Rollback service is not available. */ - TEE_ERROR_ARTSRV_NOT_AVAILABLE = 0xFFFF711C, - /* The HSM service is not available. */ - TEE_ERROR_HSMSRV_NOT_AVAILABLE = 0xFFFF711D, - /* Failed to verify AntiRoot response. */ - TEE_ERROR_ANTIROOT_RSP_FAIL = 0xFFFF9110, - /* AntiRoot error in invokeCmd(). */ - TEE_ERROR_ANTIROOT_INVOKE_ERROR = 0xFFFF9111, - /* Audit failed. */ - TEE_ERROR_AUDIT_FAIL = 0xFFFF9112, - /* Unused. */ - TEE_FAIL2 = 0xFFFF9113, -}; - -/** - * @brief Login type definitions - * - * @since 12 - */ -enum TEE_LoginMethod { - TEE_LOGIN_PUBLIC = 0x0, - TEE_LOGIN_USER, - TEE_LOGIN_GROUP, - TEE_LOGIN_APPLICATION = 0x4, - TEE_LOGIN_USER_APPLICATION = 0x5, - TEE_LOGIN_GROUP_APPLICATION = 0x6, - TEE_LOGIN_IDENTIFY = 0x7, /* Customized login type */ -}; - -/** - * @brief Definitions the TEE Identity. - * - * @since 12 - */ -typedef struct { - uint32_t login; - TEE_UUID uuid; -} TEE_Identity; - -/** - * @brief Defines the return values. - * - * @since 12 - * @version 1.0 - */ -typedef uint32_t TEE_Result; - -/** - * @brief Defines the return values. - * - * @since 12 - * @version 1.0 - */ -typedef TEE_Result TEEC_Result; - -#define TEE_ORIGIN_TEE 0x00000003 -#define TEE_ORIGIN_TRUSTED_APP 0x00000004 - -#ifndef _TEE_TA_SESSION_HANDLE -#define _TEE_TA_SESSION_HANDLE -/** - * @brief Defines the handle of TA session. - * - * @since 12 - */ -typedef uint32_t TEE_TASessionHandle; -#endif - -/** - * @brief Defines the pointer to TEE_ObjectEnumHandle. - * - * @see __TEE_ObjectEnumHandle - * - * @since 12 - */ -typedef struct __TEE_ObjectEnumHandle *TEE_ObjectEnumHandle; - -/** - * @brief Defines the pointer to __TEE_OperationHandle. - * - * @see __TEE_OperationHandle - * - * @since 12 - */ -typedef struct __TEE_OperationHandle *TEE_OperationHandle; - -#define TEE_TIMEOUT_INFINITE (0xFFFFFFFF) - -/** - * @brief Definitions the TEE time. - * - * @since 12 - */ -typedef struct { - uint32_t seconds; - uint32_t millis; -} TEE_Time; - -/** - * @brief Definitions the date time of TEE. - * - * @since 12 - */ -typedef struct { - int32_t seconds; - int32_t millis; - int32_t min; - int32_t hour; - int32_t day; - int32_t month; - int32_t year; -} TEE_Date_Time; - -/** - * @brief Definitions the timer property of TEE. - * - * @since 12 - */ -typedef struct { - uint32_t type; - uint32_t timer_id; - uint32_t timer_class; - uint32_t reserved2; -} TEE_timer_property; - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_drv_client.h b/tee/include/tee_drv_client.h deleted file mode 100644 index 4adca85f7d8d1619b3676accf24b5f4c8c3b5199..0000000000000000000000000000000000000000 --- a/tee/include/tee_drv_client.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ -#ifndef TEE_DRV_CLIENT_H -#define TEE_DRV_CLIENT_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_drv_client.h - * - * @brief Declare tee driver client API. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Open the specified driver in the TEE. - * - * @param drv_name [IN] The driver name. - * @param param [IN] The parameter information. - * @param param_len [IN] The length of the parameter. - * - * @return Returns greater than 0, which means the fd of the corresponding driver. - * Returns less than or equal to 0, which means falied to open the driver. - * - * @since 12 - * @version 1.0 - */ -int64_t tee_drv_open(const char *drv_name, const void *param, uint32_t param_len); - -/** - * @brief Cancels an operation. - * - * @param fd [IN] The file descriptor of the driver. - * @param cmd_id [IN] The command id. - * @param param [IN] The parameter information. - * @param param_len [IN] The length of the parameter. - * - * @return Returns 0 if the operation is successful. - * Returns -1 if the operation is failed. - * - * @since 12 - * @version 1.0 - */ -int64_t tee_drv_ioctl(int64_t fd, uint32_t cmd_id, const void *param, uint32_t param_len); - -/** - * @brief Open the specified driver in the TEE. - * - * @param fd [IN] The file descriptor of the driver. - * - * @return Returns 0 if the operation is successful. - * Returns -1 if the operation is failed. - * - * @since 12 - * @version 1.0 - */ -int64_t tee_drv_close(int64_t fd); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif - diff --git a/tee/include/tee_dynamic_srv.h b/tee/include/tee_dynamic_srv.h deleted file mode 100644 index 37ef28f68d855893879b2231705e6f436c5d9766..0000000000000000000000000000000000000000 --- a/tee/include/tee_dynamic_srv.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef _TEE_DYNAMIC_SRV_H_ -#define _TEE_DYNAMIC_SRV_H_ - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_dynamic_srv.h - * - * @brief Provides APIs related to dynamic service development. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include -#include "tee_service_public.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Defines thread initialization information of the dynamic service. - * - * @since 12 - */ -struct srv_thread_init_info { - void *(*func)(void *arg); - /** The maximum number of parallel threads. */ - uint32_t max_thread; - int32_t shadow; - /** The stack size of the thread. */ - uint32_t stack_size; - /** The timeout period for thread (in seconds).*/ - uint32_t time_out_sec; -}; - -typedef void (*srv_dispatch_fn_t)(tee_service_ipc_msg *msg, - uint32_t sndr, tee_service_ipc_msg_rsp *rsp); - -struct srv_dispatch_t { - uint32_t cmd; - srv_dispatch_fn_t fn; -}; - -/** - * @brief Get UUID by sender. - * - * @param sender [IN] Indicates the sender's task Id. - * @param uuid [OUT] Indicates the universally unique identifier. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if the input parameter is incorrect, - * or the file name is longer than 64 bytes. - * Returns {@code TEE_ERROR_ITEM_NOT_FOUND} if failed to find the corresponding UUID by sender. - * Returns {@code TEE_ERROR_GENERIC} if failed to obtain the UUID. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_srv_get_uuid_by_sender(uint32_t sender, TEE_UUID *uuid); - -/** - * @brief Releasing the object mapping of a specified address area. - * - * @param va_addr [IN] Indicates the address of the memory area to be released. - * @param size [IN] Indicates the size of the released memory area. - * - * @since 12 - * @version 1.0 - */ -void tee_srv_unmap_from_task(uint32_t va_addr, uint32_t size); - -/** - * @brief Create a new mapping in the virtual address space of the calling process. - * - * @param in_task_id [IN] Indicates the task Id. - * @param va_addr [IN] Indicates the address of the memory area to be mapped. - * @param size [IN] Indicates the size of the memory area to be mapped. - * @param virt_addr [OUT] Indicates the new mapping vitural address. - * - * @return Returns 0 if the operation is successful. - * @return Returns -1 if the operation is failed. - * - * @since 12 - * @version 1.0 - */ -int tee_srv_map_from_task(uint32_t in_task_id, uint32_t va_addr, uint32_t size, uint32_t *virt_addr); - -/** - * @brief Dispatch task by task name. - * - * @param task_name [IN] Indicates the task name. - * @param dispatch [IN] Indicates the dispatch information. - * @param n_dispatch [IN] Indicates the dispatch number. - * @param cur_thread [IN] Indicates the current thread information. - * - * @since 12 - * @version 1.0 - */ -void tee_srv_cs_server_loop(const char *task_name, const struct srv_dispatch_t *dispatch, - uint32_t n_dispatch, struct srv_thread_init_info *cur_thread); -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_ext_api.h b/tee/include/tee_ext_api.h deleted file mode 100644 index 37481f6c685bf8e276974ab4e8eb3ac6daf329d3..0000000000000000000000000000000000000000 --- a/tee/include/tee_ext_api.h +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef TEE_EXT_API_H -#define TEE_EXT_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_ext_api.h - * - * @brief Provides extended interfaces. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" -#include "tee_hw_ext_api.h" - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif /* __cpluscplus */ -#endif /* __cpluscplus */ - -/** - * @brief Defines the value of invalid user ID. - * - * @since 12 - */ -#define INVALID_USERID 0xFFFFFFFU - -/** - * @brief Defines the SMC from user mode. - * - * @since 12 - */ -#define TEE_SMC_FROM_USR 0 - -/** - * @brief Defines the SMC from kernel mode. - * - * @since 12 - */ -#define TEE_SMC_FROM_KERNEL 1 - -/** - * @brief Defines the szie of reserved buffer. - * - * @since 12 - */ -#define RESERVED_BUF_SIZE 32 - -/** - * @brief Defines the caller information. - * - * @since 12 - */ -typedef struct ta_caller_info { - uint32_t session_type; - union { - struct { - TEE_UUID caller_uuid; - uint32_t group_id; - }; - uint8_t ca_info[RESERVED_BUF_SIZE]; - } caller_identity; - uint8_t smc_from_kernel_mode; - uint8_t reserved[RESERVED_BUF_SIZE - 1]; -} caller_info; - -/** - * @brief Get caller info of current session, refer caller_info struct for more details. - * - * @param ca_name Indicates the process name of the caller of the CA. - * @param ca_uid Indicates the UID of the caller. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other information otherwise. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_get_caller_info(caller_info *caller_info_data, uint32_t length); - -/** - * @brief Get user ID of current TA. - * - * @param user_id Indicates the user ID to be returned. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other information otherwise. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_get_caller_userid(uint32_t *user_id); - -/** - * @brief Adds information about a caller that can invoke this TA. - * This API applies to the client applications (CAs) in the binary executable file format. - * - * @param ca_name Indicates the process name of the caller of the CA. - * @param ca_uid Indicates the UID of the caller. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other information otherwise. - * - * @since 12 - * @version 1.0 - */ -TEE_Result AddCaller_CA_exec(const char *ca_name, uint32_t ca_uid); - -/** - * @brief Adds information about a caller that can invoke this TA. - * This API applies to the client applications (CAs) in the native CA and HAP format. - * - * @param cainfo_hash Indicates the hash value of the CA caller information. - * @param length Indicates the length of the hash value. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other information otherwise. - * - * @since 12 - * @version 1.0 - */ -TEE_Result AddCaller_CA(const uint8_t *cainfo_hash, uint32_t length); - -/** - * @brief TA call this API allow others TA open session with itself. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other information otherwise. - * - * @since 12 - * @version 1.0 - */ -TEE_Result AddCaller_TA_all(void); - -/** - * @brief Defines the session caller from CA. - * - * @since 12 - */ -#define SESSION_FROM_CA 0 - -/** - * @brief Defines the session caller from TA. - * - * @since 12 - */ -#define SESSION_FROM_TA 1 - -/** - * @brief Defines the TA task is not found, for example, from TA sub thread. - * - * @since 12 - */ -#define SESSION_FROM_NOT_SUPPORTED 0xFE - -/** - * @brief Defines the TA caller is not found. - * - * @since 12 - */ -#define SESSION_FROM_UNKNOWN 0xFF - -/** - * @brief Obtains the session type. - * - * @return Returns the session type obtained. - * - * @since 12 - * @version 1.0 - */ -uint32_t tee_get_session_type(void); - -#ifdef __cplusplus -#if __cplusplus -} -#endif /* __cpluscplus */ -#endif /* __cpluscplus */ - -#endif diff --git a/tee/include/tee_hw_ext_api.h b/tee/include/tee_hw_ext_api.h deleted file mode 100644 index 3fb3503674c627076f3f79a9102a23767ee54404..0000000000000000000000000000000000000000 --- a/tee/include/tee_hw_ext_api.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef TEE_HW_EXT_API_H -#define TEE_HW_EXT_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_hw_ext_api.h - * - * @brief Provides extended interfaces. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Obtains the unique device ID from the TEE. - * - * @param device_unique_id Indicates the pointer to the buffer for storing the device ID. - * @param length Indicates the pointer to the buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other information otherwise. - * - * @since 12 - */ -TEE_Result tee_ext_get_device_unique_id(uint8_t *device_unique_id, uint32_t *length); - -/** - * @brief Defines the memory information. - * - * @since 12 - */ -struct meminfo_t { - uint64_t buffer; - uint32_t size; -}; - -/** - * @brief Derive key from device rootkey and UUID of the current task for iteration. - * - * @param salt [IN] Indicates the data for salt. - * @param key [OUT] Indicates the pointer where key is saved. - * @param outer_iter_num [IN] Indicates the iteration times in huk service. - * @param inner_iter_num [IN] Indicates the iteration times in platform driver. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_GENERIC} if the processing failed. - * - * @since 12 - */ -TEE_Result tee_ext_derive_key_iter(const struct meminfo_t *salt, struct meminfo_t *key, - uint32_t outer_iter_num, uint32_t inner_iter_num); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/tee_hw_ext_api_legacy.h b/tee/include/tee_hw_ext_api_legacy.h deleted file mode 100644 index c50471ea98ca72700059e09ac0b0cd23dfba5ae1..0000000000000000000000000000000000000000 --- a/tee/include/tee_hw_ext_api_legacy.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef __TEE_HW_EXT_API_LEGACY_H__ -#define __TEE_HW_EXT_API_LEGACY_H__ - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_hw_ext_api_legacy.h - * - * @brief Provides extended interfaces. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Derive key from device root key. - * - * @param salt [IN] Indicates the data for salt. - * @param size [IN] Indicates the length of salt. - * @param key [OUT] Indicates the pointer where key is saved. - * @param key_size [IN] Indicates the size of the key, which must be integer times of 16. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_GENERIC} if the processing failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_EXT_DeriveTARootKey(const uint8_t *salt, uint32_t size, uint8_t *key, uint32_t key_size); - -/** - * @brief Derive key from device root key by HUK2. - * @attention If the device does not support HUK2, the key is derived by HUK. - * - * @param salt [IN] Indicates the data for salt. - * @param size [IN] Indicates the length of salt. - * @param key [OUT] Indicates the pointer where key is saved. - * @param key_size [IN] Indicates the size of the key, which must be integer times of 16. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_GENERIC} if the processing failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_derive_ta_root_key_by_huk2(const uint8_t *salt, uint32_t size, uint8_t *key, uint32_t key_size); - -/** - * @brief Derive key from device root key by HUK2. - * @attention If the device does not support HUK2, the key is derived by HUK. - * - * @param secret [IN] Indicates the input secret. - * @param secret_len [IN] Indicates the length of the input secret. - * @param key [OUT] Indicates the derived key. - * @param key_len [IN] Indicates the length of the derived key. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_GENERIC} if the processing failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_root_derive_key2_by_huk2(const uint8_t *secret, uint32_t secret_len, uint8_t *key, uint32_t key_len); - -/** - * @brief Derive key from device root key and UUID of the current task by HUK2. - * @attention If the device does not support HUK2, the key is derived by HUK. - * - * @param salt [IN] Indicates the data for salt. - * @param size [IN] Indicates the length of salt. - * @param key [OUT] Indicates the pointer where key is saved. - * @param key_size [IN] Indicates the size of the generated key, fix-size 32 bytes. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_GENERIC} if the processing failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_root_uuid_derive_key_by_huk2(const uint8_t *salt, uint32_t size, uint8_t *key, uint32_t key_size); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_internal_se_api.h b/tee/include/tee_internal_se_api.h deleted file mode 100644 index 9e4ad28e605dfaca6be348dd96ffb565c5993143..0000000000000000000000000000000000000000 --- a/tee/include/tee_internal_se_api.h +++ /dev/null @@ -1,498 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef TEE_INTERNAL_SE_API_H -#define TEE_INTERNAL_SE_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_internal_se_api.h - * - * @brief Provides APIs related to the TEE Secure Element. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct __TEE_SEServiceHandle; -struct __TEE_SEReaderHandle; -struct __TEE_SESessionHandle; -struct __TEE_SEChannelHandle; - -typedef struct __TEE_SEServiceHandle *TEE_SEServiceHandle; -typedef struct __TEE_SEReaderHandle *TEE_SEReaderHandle; -typedef struct __TEE_SESessionHandle *TEE_SESessionHandle; -typedef struct __TEE_SEChannelHandle *TEE_SEChannelHandle; - -#define ATR_LEN_MAX 32U -#define AID_LEN_MIN 5U -#define AID_LEN_MAX 16U - -/** - * @brief Defines the maximum of the logic channel. - * - * @since 12 - */ -#define SE_LOGIC_CHANNEL_MAX 8U - -#define TEE_SC_TYPE_SCP03 0x01 - -#define BYTE_LEN 8 - -/** - * @brief Represents the properties of the SE reader. - * - * @since 12 - */ -typedef struct __TEE_SEReaderProperties { - /** If an SE is present in the reader, the value is true. */ - bool sePresent; - /** If this reader is only accessible via the TEE, the value is true. */ - bool teeOnly; - /** If the response to a SELECT is available in the TEE, the value is true.*/ - bool selectResponseEnable; -} TEE_SEReaderProperties; - -/** - * @brief Defines the SE AID. - * - * @since 12 - */ -typedef struct __TEE_SEAID { - /** The value of the applet's AID. */ - uint8_t *buffer; - /** The lenght of the applet's AID. */ - uint32_t bufferLen; -} TEE_SEAID; - -/** - * @brief Enumerates the types of the key. - * - * @since 12 - */ -typedef enum { - /** A base key acc. to SCP02. */ - TEE_SC_BASE_KEY = 0, - /** A key set (key-MAC, key_ENC) acc. to SCP02, SCP03. */ - TEE_SC_KEY_SET = 1 -} TEE_SC_KeyType; - -typedef struct __TEE_SC_KeySetRef { - /** Key-ENC (Static encryption key). */ - TEE_ObjectHandle scKeyEncHandle; - /** Key-MAC (Static MAC key). */ - TEE_ObjectHandle scKeyMacHandle; -} TEE_SC_KeySetRef; - -/** - * @brief Enumerates the levels of the security. - * - * @since 12 - */ -typedef enum { - /** Nothing will be applied. */ - TEE_SC_NO_SECURE_MESSAGING = 0x00, - /** Command and response APDU not be secured. */ - TEE_SC_AUTHENTICATE = 0x80, - /** Command APDU shall be MAC protected. */ - TEE_SC_C_MAC = 0x01, - /** Response APDU shall be MAC protected. */ - TEE_SC_R_MAC = 0x10, - /** Command and response APDU shall be MAC protected. */ - TEE_SC_CR_MAC = 0x11, - /** Command APDU shall be encrypted and MAC protected. */ - TEE_SC_C_ENC_MAC = 0x03, - /** Response APDU shall be encrypted and MAC protected. */ - TEE_SC_R_ENC_MAC = 0x30, - /** Command and response APDU shall be encrypted and MAC protected. */ - TEE_SC_CR_ENC_MAC = 0x33, - /** Command APDU shall be encrypted, and the command and response APDU shall be MAC protected.*/ - TEE_SC_C_ENC_CR_MAC = 0x13 -} TEE_SC_SecurityLevel; - -#define TEE_AUTHENTICATE TEE_SC_AUTHENTICATE - -/** - * @brief Represents the reference about SC card key. - * - * @since 12 - */ -typedef struct __TEE_SC_CardKeyRef { - /** The key identifier of the SC card key. */ - uint8_t scKeyID; - /** The key version if the SC card key. */ - uint8_t scKeyVersion; -} TEE_SC_CardKeyRef; - -/** - * @brief Represents the reference about the SC device key. - * - * @since 12 - */ -typedef struct __TEE_SC_DeviceKeyRef { - TEE_SC_KeyType scKeyType; - union { - TEE_ObjectHandle scBaseKeyHandle; - TEE_SC_KeySetRef scKeySetRef; - } __TEE_key; -} TEE_SC_DeviceKeyRef; - -/** - * @brief Defines the OID of the SC. - * - * @since 12 - */ -typedef struct __TEE_SC_OID { - /** The value of the OID. */ - uint8_t *buffer; - /** The length of the OID. */ - uint32_t bufferLen; -} TEE_SC_OID; - -/** - * @brief Represents the paramaters about the SC. - * - * @since 12 - */ -typedef struct __TEE_SC_Params { - /** The SC type. */ - uint8_t scType; - /** The SC type defined by OID. */ - TEE_SC_OID scOID; - /** The SC security level. */ - TEE_SC_SecurityLevel scSecurityLevel; - /** Reference to SC card keys. */ - TEE_SC_CardKeyRef scCardKeyRef; - /** Reference to SC device keys. */ - TEE_SC_DeviceKeyRef scDeviceKeyRef; -} TEE_SC_Params; - -/** - * @brief Open the SE service. - * - * @param se_service_handle [IN] Indicates the handle of SE service. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_ACCESS_CONFLICT} if failed to access the SE service due to conflict. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEServiceOpen(TEE_SEServiceHandle *se_service_handle); - -/** - * @brief Close the SE service. - * - * @param se_service_handle [IN] Indicates the handle of SE service. - * - * @since 12 - * @version 1.0 - */ -void TEE_SEServiceClose(TEE_SEServiceHandle se_service_handle); - -/** - * @brief Get the available readers handle of the SE service. - * - * @param se_service_handle [IN] Indicates the handle of SE service. - * @param se_reader_handle_list [OUT] Indicates the available readers handle list. - * @param se_reader_handle_list_len [OUT] Indicates the length of the handle list. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ITEM_NOT_FOUND} if cannot find the input SE service handle. - * Returns {@code TEE_ERROR_SHORT_BUFFER} if the provided buffer is too small to store the readers handle. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEServiceGetReaders(TEE_SEServiceHandle se_service_handle, TEE_SEReaderHandle *se_reader_handle_list, - uint32_t *se_reader_handle_list_len); - -/** - * @brief Get the available readers handle of the SE service. - * - * @param se_reader_handle [IN] Indicates the SE readers handle. - * @param reader_properties [OUT] Indicates the reader's properties. - * - * @since 12 - * @version 1.0 - */ -void TEE_SEReaderGetProperties(TEE_SEReaderHandle se_reader_handle, TEE_SEReaderProperties *reader_properties); - -/** - * @brief Get the SE reader's name. - * - * @param se_reader_handle [IN] Indicates the SE readers handle. - * @param reader_name [OUT] Indicates the SE reader's name. - * @param reader_name_len [OUT] Indicates the length of the reader's name. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ITEM_NOT_FOUND} if cannot find the input SE reader handle. - * Returns {@code TEE_ERROR_BAD_FORMAT} if the input se_reader_handle points to the reader illegally. - * Returns {@code TEE_ERROR_SHORT_BUFFER} if the reader_name_len is too small to store the readers name. - * Returns {@code TEE_ERROR_SECURITY} if the security error is detected. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEReaderGetName(TEE_SEReaderHandle se_reader_handle, char *reader_name, uint32_t *reader_name_len); - -/** - * @brief Open a session between the SE reader to the SE. - * - * @param se_reader_handle Indicates the SE readers handle. - * @param se_session_handle Indicates the session handle. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ITEM_NOT_FOUND} if cannot find the input SE reader handle. - * Returns {@code TEE_ERROR_COMMUNICATION} if communicte failed with the SE. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEReaderOpenSession(TEE_SEReaderHandle se_reader_handle, TEE_SESessionHandle *se_session_handle); - -/** - * @brief Close sessions between the SE reader to the SE. - * - * @param se_reader_handle Indicates the SE readers handle. - * - * @since 12 - * @version 1.0 - */ -void TEE_SEReaderCloseSessions(TEE_SEReaderHandle se_reader_handle); - -/** - * @brief Get the SE ATR. - * - * @param se_session_handle Indicates the session handle. - * @param atr Indicates the SE ATR. - * @param atrLen Indicates the length of ATR. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_SHORT_BUFFER} if the provided buffer is too small to store the ATR. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SESessionGetATR(TEE_SESessionHandle se_session_handle, void *atr, uint32_t *atrLen); - -/** - * @brief Check whether the session is closed. - * - * @param se_session_handle Indicates the session handle. - * - * @return Returns {@code TEE_SUCCESS} if the session is closed or the input handle is invalid. - * Returns {@code TEE_ERROR_COMMUNICATION} if session state is invalid. - * Returns {@code TEE_ERROR_BAD_STATE} if the session is opened. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SESessionIsClosed(TEE_SESessionHandle se_session_handle); - -/** - * @brief Close the SE session. - * - * @param se_session_handle Indicates the session handle. - * - * @since 12 - * @version 1.0 - */ -void TEE_SESessionClose(TEE_SESessionHandle se_session_handle); - -/** - * @brief Close all channels which pointed to by the SE session. - * - * @param se_session_handle Indicates the session handle. - * - * @since 12 - * @version 1.0 - */ -void TEE_SESessionCloseChannels(TEE_SESessionHandle se_session_handle); - -/** - * @brief Open a basic channel which pointed to by the SE session. - * - * @param se_session_handle Indicates the session handle. - * @param se_aid Indicates the SE AID. - * @param se_channel_handle Indicates the SE channel handle. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_STATE} if the session is closed. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ITEM_NOT_FOUND} if cannot find the input SE reader handle. - * Returns other when SE responding to the abnormal status word. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SESessionOpenBasicChannel(TEE_SESessionHandle se_session_handle, TEE_SEAID *se_aid, - TEE_SEChannelHandle *se_channel_handle); - -/** - * @brief Open a logical channel which pointed to by the SE session. - * - * @param se_session_handle Indicates the session handle. - * @param se_aid Indicates the SE AID. - * @param se_channel_handle Indicates the SE channel handle. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_STATE} if the session is closed. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ITEM_NOT_FOUND} if cannot find the input SE reader handle. - * Returns other when SE responding to the abnormal status word. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SESessionOpenLogicalChannel(TEE_SESessionHandle se_session_handle, TEE_SEAID *se_aid, - TEE_SEChannelHandle *se_channel_handle); - -/** - * @brief Close the channel which pointed to by the channel handle. - * - * @param se_channel_handle Indicates the SE channel handle. - * - * @since 12 - * @version 1.0 - */ -void TEE_SEChannelClose(TEE_SEChannelHandle se_channel_handle); - -/** - * @brief Select the next SE service which pointed to by the channel handle. - * - * @param se_channel_handle Indicates the SE channel handle. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is invalid or the mode of SE is wrong. - * Returns other when SE responding to the abnormal status word. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEChannelSelectNext(TEE_SEChannelHandle se_channel_handle); - -/** - * @brief Get the SELECT command response of SE when open the channel handle. - * - * @param se_channel_handle Indicates the SE channel handle. - * @param response Indicates the response of SE. - * @param response_len Indicates the length of the response. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is invalid. - * Returns {@code TEE_ERROR_SHORT_BUFFER} if the provided buffer is too small to store the response. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEChannelGetSelectResponse(TEE_SEChannelHandle se_channel_handle, void *response, - uint32_t *response_len); - -/** - * @brief Transmit the command through the channle. - * - * @param se_channel_handle Indicates the SE channel handle. - * @param command Indicates the transmitted command. - * @param command_len Indicates the length of the command. - * @param response Indicates the response of SE. - * @param response_len Indicates the length of the response. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_COMMUNICATION} if length of command is less than 4. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is invalid. - * Returns {@code TEE_ERROR_BAD_STATE} if the channel is closed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEChannelTransmit(TEE_SEChannelHandle se_channel_handle, void *command, uint32_t command_len, - void *response, uint32_t *response_len); - -/** - * @brief Open a SE secure channel based on the input channel handle. - * Thereafter, when the {@code TEE_SEChannelTransmit} is called, all APDUs(ENC/MAC protected) transmitted based on - * the handle are automatically protected based on the defined secure channel parameter options. - * Currently, only SCP03 is supported. - * - * @param se_channel_handle Indicates the SE channel handle. - * @param sc_params Indicates the parameter reference for the secure channel protocol. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_COMMUNICATION} if communicate failed with the SE. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is invalid or the mode of SE is wrong. - * Returns {@code TEE_ERROR_NOT_SUPPORTED} if the parameter of the sc_params is not supported - * Returns {@code TEE_ERROR_MAC_INVALID} if the verification failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SESecureChannelOpen(TEE_SEChannelHandle se_channel_handle, TEE_SC_Params *sc_params); - -/** - * @brief Close the SE secure channel based on the input channel handle. - * The channel, which pointed to by the input channel handle, is not closed. - * It can be used for insecure communication, but the APDU that calls {@code TEE_SEChannelTransmit} - * transmission is not secure. - * - * @param se_channel_handle Indicates the SE channel handle. - * - * @since 12 - * @version 1.0 - */ -void TEE_SESecureChannelClose(TEE_SEChannelHandle se_channel_handle); - -/** - * @brief Get the channel Id which pointed to by the input channel handle. - * - * @param se_channel_handle Indicates the SE channel handle. - * @param channel_id Indicates the SE channel Id. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is invalid. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SEChannelGetID(TEE_SEChannelHandle se_channel_handle, uint8_t *channel_id); -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/tee_log.h b/tee/include/tee_log.h deleted file mode 100644 index 0489ba0efa72e0ce9001f86792f9977b1a7457a6..0000000000000000000000000000000000000000 --- a/tee/include/tee_log.h +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef __TEE_LOG_H -#define __TEE_LOG_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_log.h - * - * @brief Provides TEE log APIs. - * - * Reference of TEE log APIs and internal definitions. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Defines the ERROR level of the TA log. - * - * @since 12 - */ -#define TA_LOG_LEVEL_ERROR 0 - -/** - * @brief Defines the WARNING level of the TA log. - * - * @since 12 - */ -#define TA_LOG_LEVEL_WARNING 1 - -/** - * @brief Defines the INFO level of the TA log. - * - * @since 12 - */ -#define TA_LOG_LEVEL_INFO 2 - -/** - * @brief Defines the DEBUG level of the TA log. - * - * @since 12 - */ -#define TA_LOG_LEVEL_DEBUG 3 - -/** - * @brief Defines the VERBO level of the TA log. - * - * @since 12 - */ -#define TA_LOG_LEVEL_VERBO 4 - -/** - * @brief Defines the default level of the TA log. - * - * @since 12 - */ -#define TA_LOG_LEVEL_DEFAULT TA_LOG_LEVEL_INFO - -/** - * @brief Defines the default level of the TA log. - * {@code TA_LOG_LEVEL} can be redefined by TA developers - * - * @since 12 - */ -#ifndef TA_LOG_LEVEL -#define TA_LOG_LEVEL TA_LOG_LEVEL_DEFAULT -#endif - -/** - * @brief Defines the tag of the VERBO level TA log. - * - * @since 12 - */ -#define TAG_VERB "[verb]" - -/** - * @brief Defines the tag of the DEBUG level TA log. - * - * @since 12 - */ -#define TAG_DEBUG "[debug]" - -/** - * @brief Defines the tag of the INFO level TA log. - * - * @since 12 - */ -#define TAG_INFO "[info]" - -/** - * @brief Defines the tag of the WARNING level TA log. - * - * @since 12 - */ -#define TAG_WARN "[warn]" - -/** - * @brief Defines the tag of the ERROR level TA log. - * - * @since 12 - */ -#define TAG_ERROR "[error]" - -/** - * @brief Enumerates the levels of the log. - * - * @since 12 - */ -typedef enum { - LOG_LEVEL_ERROR = 0, - LOG_LEVEL_WARN = 1, - LOG_LEVEL_INFO = 2, - LOG_LEVEL_DEBUG = 3, - LOG_LEVEL_VERBO = 4, - LOG_LEVEL_ON = 5, -} LOG_LEVEL; - -/** - * @brief Provides to print UART logs. - * - * @param fmt [IN] The log information. - * - * @since 12 - */ -void uart_cprintf(const char *fmt, ...); - -/** - * @brief Provides to print UART logs. - * - * @param fmt [IN] The log information. - * - * @since 12 - */ -void uart_printf_func(const char *fmt, ...); - -/** - * @brief Provides to print TEE logs. - * - * @param log_level [IN] The level of the log. - * @param fmt [IN] The log information. - * - * @since 12 - */ -void tee_print(LOG_LEVEL log_level, const char *fmt, ...); - -/** - * @brief Provides to print TEE driver logs. - * - * @param log_level [IN] The level of the log. - * @param log_tag [IN] The tag of the log. - * @param fmt [IN] The log information. - * - * @since 12 - */ -void tee_print_driver(LOG_LEVEL log_level, const char *log_tag, const char *fmt, ...); - -extern const char *g_debug_prefix; - -/** - * @brief Defines the API to print TEE log at the VERBO level. - * - * @since 12 - */ -#if (TA_LOG_LEVEL >= TA_LOG_LEVEL_VERBO) -#ifdef DRIVER_LOG_TAG -#define tlogv(fmt, args...) \ - tee_print_driver(LOG_LEVEL_VERBO, DRIVER_LOG_TAG, "%s %d:" fmt "", TAG_VERB, __LINE__, ##args) -#else -#define tlogv(fmt, args...) tee_print(LOG_LEVEL_VERBO, "%s %d:" fmt "", TAG_VERB, __LINE__, ##args) -#endif /* DRIVER_LOG_TAG */ -#else -#define tlogv(fmt, args...) \ - do { \ - } while (0) -#endif /* TA_LOG_LEVEL >= TA_LOG_LEVEL_VERBO */ - -/** - * @brief Defines the API to print TEE log at the DEBUG level. - * - * @since 12 - */ -#if (TA_LOG_LEVEL >= TA_LOG_LEVEL_DEBUG) -#ifdef DRIVER_LOG_TAG -#define tlogd(fmt, args...) \ - tee_print_driver(LOG_LEVEL_DEBUG, DRIVER_LOG_TAG, "%s %d:" fmt "", TAG_DEBUG, __LINE__, ##args) -#else -#define tlogd(fmt, args...) tee_print(LOG_LEVEL_DEBUG, "%s %d:" fmt "", TAG_DEBUG, __LINE__, ##args) -#endif /* DRIVER_LOG_TAG */ -#else -#define tlogd(fmt, args...) \ - do { \ - } while (0) -#endif /* TA_LOG_LEVEL >= TA_LOG_LEVEL_DEBUG */ - -/** - * @brief Defines the API to print TEE log at the INFO level. - * - * @since 12 - */ -#if (TA_LOG_LEVEL >= TA_LOG_LEVEL_INFO) -#ifdef DRIVER_LOG_TAG -#define tlogi(fmt, args...) \ - tee_print_driver(LOG_LEVEL_INFO, DRIVER_LOG_TAG, "%s %d:" fmt "", TAG_INFO, __LINE__, ##args) -#else -#define tlogi(fmt, args...) tee_print(LOG_LEVEL_INFO, "%s %d:" fmt "", TAG_INFO, __LINE__, ##args) -#endif /* DRIVER_LOG_TAG */ -#else -#define tlogi(fmt, args...) \ - do { \ - } while (0) -#endif /* TA_LOG_LEVEL >= TA_LOG_LEVEL_INFO */ - -/** - * @brief Defines the API to print TEE log at the WARNING level. - * - * @since 12 - */ -#if (TA_LOG_LEVEL >= TA_LOG_LEVEL_WARNING) -#ifdef DRIVER_LOG_TAG -#define tlogw(fmt, args...) \ - tee_print_driver(LOG_LEVEL_WARN, DRIVER_LOG_TAG, "%s %d:" fmt "", TAG_WARN, __LINE__, ##args) -#else -#define tlogw(fmt, args...) tee_print(LOG_LEVEL_WARN, "%s %d:" fmt "", TAG_WARN, __LINE__, ##args) -#endif /* DRIVER_LOG_TAG */ -#else -#define tlogw(fmt, args...) \ - do { \ - } while (0) -#endif /* TA_LOG_LEVEL >= TA_LOG_LEVEL_WARNING */ - -/** - * @brief Defines the API to print TEE log at the ERROR level. - * - * @since 12 - */ -#if (TA_LOG_LEVEL >= TA_LOG_LEVEL_ERROR) /* Always meet this condition. */ -#ifndef TLOGE_NO_TIMESTAMP -#ifdef DRIVER_LOG_TAG -#define tloge(fmt, args...) \ - tee_print_driver(LOG_LEVEL_ERROR, DRIVER_LOG_TAG, "%s %d:" fmt " ", TAG_ERROR, __LINE__, ##args) -#else -#define tloge(fmt, args...) tee_print(LOG_LEVEL_ERROR, "%s %d:" fmt " ", TAG_ERROR, __LINE__, ##args) -#endif /* DRIVER_LOG_TAG */ -#else -#define tloge(fmt, args...) printf("[%s] %s %d:" fmt " ", g_debug_prefix, TAG_ERROR, __LINE__, ##args) -#endif /* TLOGE_NO_TIMESTAMP */ -#else -#define tloge(fmt, args...) \ - do { \ - } while (0) -#endif /* TA_LOG_LEVEL >= TA_LOG_LEVEL_ERROR */ - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif /* __TEE_LOG_H */ diff --git a/tee/include/tee_mem_mgmt_api.h b/tee/include/tee_mem_mgmt_api.h deleted file mode 100644 index fa636a38486a6d5efb6896d04e12f26a07bc8b81..0000000000000000000000000000000000000000 --- a/tee/include/tee_mem_mgmt_api.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - - -#ifndef TEE_MEM_MGMT_API_H -#define TEE_MEM_MGMT_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_mem_mgmt_api.h - * - * @brief Provides APIs for memory management. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" -#include "tee_mem_monitoring_api.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The definitions below are defined by Global Platform or Platform SDK released previously - * for compatibility. - * Do not make any change to the content below. - */ -#ifndef ZERO_SIZE_PTR -#define ZERO_SIZE_PTR ((void *)16) -#define zero_or_null_ptr(x) ((unsigned long)(x) <= (unsigned long)ZERO_SIZE_PTR) -#endif - -enum MALLOC_HINT { - ZERO = 0, - NOT_ZERO = 1, - ALIGN_004 = 0x80000002, - /* Buffer alignment */ - ALIGN_008 = 0x80000003, - ALIGN_016 = 0x80000004, - ALIGN_032 = 0x80000005, - ALIGN_064 = 0x80000006, - ALIGN_128 = 0x80000007, - ALIGN_256 = 0x80000008, - ALIGN_004_ZERO = 0x80000012, - /* The buffer is 8-byte aligned and initialized to zeros. */ - ALIGN_008_ZERO = 0x80000013, - ALIGN_016_ZERO = 0x80000014, - ALIGN_032_ZERO = 0x80000015, - ALIGN_064_ZERO = 0x80000016, - ALIGN_128_ZERO = 0x80000017, - ALIGN_256_ZERO = 0x80000018, -}; - -#define TEE_MALLOC_FILL_ZERO 0x00000000 -#define TEE_MALLOC_NO_FILL 0x00000001 -#define TEE_MALLOC_NO_SHARE 0x00000002 - -#define TEE_MEMORY_ACCESS_READ 0x00000001 -#define TEE_MEMORY_ACCESS_WRITE 0x00000002 -#define TEE_MEMORY_ACCESS_ANY_OWNER 0x00000004 - -#if defined(API_LEVEL) && (API_LEVEL >= API_LEVEL1_2) -/** - * @brief Fills x into the first size bytes of the buffer. - * - * @param buffer Indicates the pointer to the buffer. - * @param x Indicates the value to fill. - * @param size Indicates the number of bytes to fill. - * - * @since 12 - * @version 1.0 - */ -void TEE_MemFill(void *buffer, uint8_t x, size_t size); -#else -/** - * @brief Fills x into the first size bytes of the buffer. - * - * @param buffer Indicates the pointer to the buffer. - * @param x Indicates the value to fill. - * @param size Indicates the number of bytes to fill. - * - * @since 12 - * @version 1.0 - */ -void TEE_MemFill(void *buffer, uint32_t x, size_t size); -#endif - -/** - * @brief Copies bytes. - * - * @param dest Indicates the pointer to the buffer that holds the bytes copied. - * @param src Indicates the pointer to the buffer that holds the bytes to copy. - * @param size Indicates the number of bytes to copy. - * - * @since 12 - * @version 1.0 - */ -void TEE_MemMove(void *dest, const void *src, size_t size); - -/** - * @brief Allocates space of the specified size for an object. - * - * @param size Indicates the size of the memory to be allocated. - * @param hint Indicates a hint to the allocator. The value 0 indicates that the memory block - * returned is filled with "\0". - * - * @return Returns a pointer to the newly allocated space if the operation is successful. - * @return Returns a NULL pointer if the allocation fails. - * - * @since 12 - * @version 1.0 - */ -void *TEE_Malloc(size_t size, uint32_t hint); - - /** - * @brief Releases the memory allocated by TEE_Malloc. - * - * If the buffer is a NULL pointer, TEE_Free does nothing. - * The buffer to be released must have been allocated by TEE_Malloc or TEE_Realloc and cannot be - * released repeatedly. Otherwise, unexpected result may be caused. - * - * @param buffer Indicates the pointer to the memory to release. - * - * @since 12 - * @version 1.0 - */ -void TEE_Free(void *buffer); - -/** - * @brief Reallocates memory. - * - * If new_size is greater than the old size, the content of the original memory does not change - * and the space in excess of the old size contains unspecified content. - * If the new size of the memory object requires movement of the object, the space for the previous - * instantiation of the object is deallocated. - * If the space cannot be allocated, the original object remains allocated and this function - * returns a NULL pointer. - * If the buffer is NULL, this function is equivalent to TEE_Malloc. - * - * @param buffer Indicates the pointer to the memory to reallocate. - * @param new_size Indicates the new size required. - * - * @return Returns a pointer to the allocated memory if the operation is successful. - * @return Returns a NULL pointer if the operation fails. - * - * @since 12 - * @version 1.0 - */ -void *TEE_Realloc(void *buffer, size_t new_size); - -/** - * @brief Compares memory content from the beginning. - * - * @param buffer1 Indicates the pointer to the first buffer. - * @param buffer2 Indicates the pointer to the second buffer. - * @param size Indicates the number of the bytes to compare. - * - * @return Returns –1 if buffer1 < buffer2. - * @return Returns 0 if buffer1 == buffer2. - * @return Returns 1 if buffer1 > buffer2. - * - * @since 12 - * @version 1.0 - */ -int32_t TEE_MemCompare(const void *buffer1, const void *buffer2, size_t size); - -/** - * @brief Checks whether this TA has the requested permissions to access a buffer. - * - * @param accessFlags Indicates the access permissions to check. - * @param buffer Indicates the pointer to the target buffer. - * @param size Indicates the size of the buffer to check. - * - * @return Returns TEE_SUCCESS if the TA has the requested permissions. - * @return Returns TEE_ERROR_ACCESS_DENIED otherwise. - */ -TEE_Result TEE_CheckMemoryAccessRights(uint32_t accessFlags, const void *buffer, size_t size); - -/** - * @brief Sets the TA instance data pointer. - * - * @param instanceData Indicates the pointer to the global TA instance data. - * - * @since 12 - * @version 1.0 - */ -void TEE_SetInstanceData(void *instanceData); - -/** - * @brief Obtains the instance data pointer set by the TA using TEE_SetInstanceData. - * - * @return Returns the pointer to the instance data set by TEE_SetInstanceData - * @return or NULL if no instance data pointer has been set. - * - * @since 12 - * @version 1.0 - */ -void *TEE_GetInstanceData(void); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/tee_mem_monitoring_api.h b/tee/include/tee_mem_monitoring_api.h deleted file mode 100644 index a95a78efe0d0880f882121b08255c11523aaf573..0000000000000000000000000000000000000000 --- a/tee/include/tee_mem_monitoring_api.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef TEE_MEM_MONITORING_API_H -#define TEE_MEM_MONITORING_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_mem_monitoring_api.h - * - * @brief Provides APIs for memory monitoring. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Obtains the heap usage of this trusted application (TA). - * - * @param show Indicates whether to print the result in the log file. - * - * @return Returns the heap usage in percentage. - * - * @since 12 - * @version 1.0 - */ -uint32_t get_heap_usage(bool show); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_object_api.h b/tee/include/tee_object_api.h deleted file mode 100644 index 723f576c981f4b6db6624074d9c0e6f9401d4ed4..0000000000000000000000000000000000000000 --- a/tee/include/tee_object_api.h +++ /dev/null @@ -1,384 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef __TEE_OBJECT_API_H -#define __TEE_OBJECT_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_object_api.h - * - * @brief Provides trusted storage APIs. - * - * You can use these APIs to implement trusted storage features. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Defines HANDLE_NULL, which is used to denote the absence of a handle. - * - * @since 12 - */ -#define TEE_HANDLE_NULL 0x00000000 - -/** - * @brief Enumerates the usages of the key of the TEE_ObjectHandle. - * - * @since 12 - */ -enum Usage_Constants { - /** The object's key is extractable. */ - TEE_USAGE_EXTRACTABLE = 0x00000001, - /** Used for encryption. */ - TEE_USAGE_ENCRYPT = 0x00000002, - /** Used for decryption. */ - TEE_USAGE_DECRYPT = 0x00000004, - /** Used for hash calculation. */ - TEE_USAGE_MAC = 0x00000008, - /** Used for creating a signature. */ - TEE_USAGE_SIGN = 0x00000010, - /** Used for signature verification. */ - TEE_USAGE_VERIFY = 0x00000020, - /** Used for key derivation. */ - TEE_USAGE_DERIVE = 0x00000040, - /** Used for object initialization, with all permissions assigned by default. */ - TEE_USAGE_DEFAULT = 0xFFFFFFFF, -}; - -/** - * @brief Defines information about the object pointed to by the flag of the TEE_ObjectHandle, - * for example, whether the object is a persistent object or is initialized. - * - * @since 12 - */ -enum Handle_Flag_Constants { - /** The object is a persistent object. */ - TEE_HANDLE_FLAG_PERSISTENT = 0x00010000, - /** The object is initialized. */ - TEE_HANDLE_FLAG_INITIALIZED = 0x00020000, - /** Reserved */ - TEE_HANDLE_FLAG_KEY_SET = 0x00040000, - /** Reserved */ - TEE_HANDLE_FLAG_EXPECT_TWO_KEYS = 0x00080000, -}; - -/** - * @brief Defines a value attribute identifier flag. - * - * @since 12 - */ -#define TEE_ATTR_FLAG_VALUE 0x20000000 - -/** - * @brief Defines a public attribute identifier flag. - * - * @since 12 - */ -#define TEE_ATTR_FLAG_PUBLIC 0x10000000 - -/** - * @brief Check whether the attribute is a buffer. - * - * @since 12 - */ -#define TEE_ATTR_IS_BUFFER(attribute_id) ((((attribute_id) << 2) >> 31) == 0) - -/** - * @brief Check whether the attribute is a value. - * - * @since 12 - */ -#define TEE_ATTR_IS_VALUE(attribute_id) ((((attribute_id) << 2) >> 31) == 1) - -/** - * @brief Check whether the attribute is protected. - * - * @since 12 - */ -#define TEE_ATTR_IS_PROTECTED(attribute_id) ((((attribute_id) << 3) >> 31) == 0) - -/** - * @brief Check whether the attribute is public. - * - * @since 12 - */ -#define TEE_ATTR_IS_PUBLIC(attribute_id) ((((attribute_id) << 3) >> 31) == 1) - -/** - * @brief Obtains a buffer attribute from the TEE_Attribute struct of the object pointed - * to by TEE_ObjectHandle. - * - * The members in the TEE_Attribute struct must be ref. If the TEE_Attribute is private, - * the Usage_Constants of the object must include TEE_USAGE_EXTRACTABLE. - * - * @param object Indicates the handle of the object. - * @param attributeID Indicates the ID of the attribute to obtain, for example, TEE_ObjectAttribute. - * The attribute ID can also be customized. - * @param buffer Indicates the pointer to the buffer that stores the attribute obtained. - * @param size Indicates the pointer to the length of the content stored. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the TEE_Attribute cannot be found in the object - * or the object is not initialized. - * @return Returns TEE_ERROR_SHORT_BUFFER if the buffer is too small to store the content obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetObjectBufferAttribute(TEE_ObjectHandle object, uint32_t attributeID, void *buffer, size_t *size); - -/** - * @brief Obtains a value attribute from the TEE_Attribute of an object. - * - * The members of the TEE_Attribute struct must be values. If the TEE_Attribute is private, - * the Usage_Constants of the object must include TEE_USAGE_EXTRACTABLE. - * - * @param object Indicates the handle of the object. - * @param attributeID Indicates the ID of the attribute to obtain, for example, TEE_ObjectAttribute. - * The attribute ID can also be customized. - * @param a Indicates the pointer to the placeholder filled with the attribute field a. - * @param b Indicates the pointer to the placeholder filled with the attribute field b. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the TEE_Attribute cannot be found in the object - * or the object is not initialized. - * @return Returns TEE_ERROR_ACCESS_DENIED if TEE_Attribute is private - * but the object Usage_Constants does not contain the TEE_USAGE_EXTRACTABLE flag. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetObjectValueAttribute(TEE_ObjectHandle object, uint32_t attributeID, uint32_t *a, uint32_t *b); - -/** - * @brief Closes a TEE_ObjectHandle object. - * - * The object can be persistent or transient. - * - * @param object Indicates the TEE_ObjectHandle object to close. - * - * @since 12 - * @version 1.0 - */ -void TEE_CloseObject(TEE_ObjectHandle object); - -/** - * @brief Allocates an uninitialized object to store keys. - * - * objectType and maxObjectSize must be specified. - * - * @param objectType Indicates the type of the object to create. The value is TEE_ObjectType. - * @param maxObjectSize Indicates the maximum number of bytes of the object. - * @param object Indicates the pointer to the handle of the newly created object. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_OUT_OF_MEMORY if the memory is insufficient. - * @return Returns TEE_ERROR_NOT_SUPPORTED if the object type is not supported. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AllocateTransientObject(uint32_t objectType, uint32_t maxObjectSize, TEE_ObjectHandle *object); - -/** - * @brief Releases a transient object that is previously allocated with TEE_AllocateTransientObject. - * - * After the function is called, the handle becomes invalid and all allocated resources are released. - * TEE_FreeTransientObject and TEE_AllocateTransientObject are used in pairs. - * - * @param object Indicates the TEE_ObjectHandle to release. - * - * @since 12 - * @version 1.0 - */ -void TEE_FreeTransientObject(TEE_ObjectHandle object); - -/** - * @brief Resets a transient object to its initial state after allocation. - * - * You can use an allocated object, which has not been initialized or used to store a key, to store a key. - * - * @param object Indicates the TEE_ObjectHandle to reset. - * - * @since 12 - * @version 1.0 - */ -void TEE_ResetTransientObject(TEE_ObjectHandle object); - -/** - * @brief Populates an uninitialized object with object attributes passed by the TA in the attrs parameter. - * - * The object must be uninitialized. \n - * The attrs parameter is passed by a TA. - * - * @param object Indicates the handle on a created but uninitialized object. - * @param attrs Indicates the pointer to an array of object attributes, which can be one or more TEE_Attributes. - * @param attrCount Indicates the number of members in the attribute array. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_BAD_PARAMETERS if an incorrect or inconsistent attribute value is detected. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_PopulateTransientObject(TEE_ObjectHandle object, TEE_Attribute *attrs, uint32_t attrCount); - -/** - * @brief Initializes the TEE_Attribute of the buffer type. - * - * The members in the TEE_Attribute struct must be ref. - * - * @param attr Indicates the pointer to the TEE_Attribute initialized. - * @param attributeID Indicates the ID assigned to the TEE_Attribute. - * @param buffer Indicates the pointer to the buffer that stores the content to be allocated. - * @param length Indicates the length of the assigned value, in bytes. - * - * @since 12 - * @version 1.0 - */ -void TEE_InitRefAttribute(TEE_Attribute *attr, uint32_t attributeID, void *buffer, size_t length); - -/** - * @brief Initializes a TEE_Attribute. - * - * @param attr Indicates the pointer to the TEE_Attribute initialized. - * @param attributeID Indicates the ID assigned to the TEE_Attribute. - * @param a Indicates the value to be assigned to the member a in the TEE_Attribute. - * @param b Indicates the value to be assigned to the member b in the TEE_Attribute. - * - * @since 12 - * @version 1.0 - */ -void TEE_InitValueAttribute(TEE_Attribute *attr, uint32_t attributeID, uint32_t a, uint32_t b); - -/** - * @brief Generates a random key or a key pair and populates a transient key object with the generated key. - * - * @param object Indicates a transient object used to hold the generated key. - * @param keySize Indicates the number of bytes of the key. - * @param params Indicates the pointer to the parameters for key generation. - * @param paramCount Indicates the number of parameters required for key generation. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_BAD_PARAMETERS if the type of the key generated does not match - * the key that can be held in the transient object. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GenerateKey(TEE_ObjectHandle object, uint32_t keySize, TEE_Attribute *params, uint32_t paramCount); - -/** - * @brief Get the information of the object data part, the total length of the data part and the current - * position of the data stream. - * - * @param object Indicates the handle of the object. - * @param pos Indicates the data stream position. - * @param len Indicates the data stream length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns others if the operation is failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_InfoObjectData(TEE_ObjectHandle object, uint32_t *pos, uint32_t *len); - -/** - * @brief Obtains TEE_ObjectInfo. - * - * This function obtains TEE_ObjectInfo and copies the obtained information to the pre-allocated space - * pointed to by objectInfo. - * - * @param object Indicates the handle of the object. - * @param objectInfo Indicates the pointer to the TEE_ObjectInfo obtained. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_CORRUPT_OBJECT if the object is corrupted and the object handle will be closed. - * @return Returns TEE_ERROR_STORAGE_NOT_AVAILABLE if the object is stored - * in a storage area that is inaccessible currently. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetObjectInfo1(TEE_ObjectHandle object, TEE_ObjectInfo *objectInfo); - -/** - * @brief Assigns the TEE_Attribute of an initialized object to an uninitialized object. - * - * This function populates an uninitialized object with TEE_Attribute. - * That is, it copies TEE_Attribute of srcobject to destobject. - * The TEE_Attribute types and IDs of the two objects must match. - * - * @param destObject Indicates the uninitialized object. - * @param srcObject Indicates the initialized object. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_CORRUPT_OBJECT if the object is corrupted and the object handle will be closed. - * @return Returns TEE_ERROR_STORAGE_NOT_AVAILABLE if the object is stored - * in a storage area that is inaccessible currently. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_CopyObjectAttributes1(TEE_ObjectHandle destObject, TEE_ObjectHandle srcObject); - -/** - * @brief Restricts the objectUse bit of an object. - * - * This bit determines the usage of the key in the object. The value range is Usage_Constant. - * The bit in the objectUse parameter can be set as follows: \n - * If it is set to 1, the corresponding usage flag in the object is left unchanged. \n - * If it is set to 0, the corresponding usage flag in the object is cleared. \n - * The newly created object contains all Usage_Constant, and the usage flag can be cleared only. - * - * @param object Indicates the TEE_ObjectHandle of the target object. - * @param objectUsage Indicates the new object usage. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_CORRUPT_OBJECT if the object is corrupted and the object handle will be closed. - * @return Returns TEE_ERROR_STORAGE_NOT_AVAILABLE if the object is stored - * in a storage area that is inaccessible currently. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RestrictObjectUsage1(TEE_ObjectHandle object, uint32_t objectUsage); -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_property_api.h b/tee/include/tee_property_api.h deleted file mode 100644 index 029e28eb74a81d251a0d8e4ca838d10b0f0581cd..0000000000000000000000000000000000000000 --- a/tee/include/tee_property_api.h +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef TEE_PROPERTY_API_H -#define TEE_PROPERTY_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_property_api.h - * - * @brief Reference of TEE object api definitions. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif -/** - * The definitions below are defined by Global Platform or Platform SDK released previously - * for compatibility. - * Do not make any change to the content below. - */ - -/** - * @brief Enumerates the types of the property set. - * - * @since 12 - */ -typedef enum { - TEE_PROPSET_UNKNOW = 0, - TEE_PROPSET_TEE_IMPLEMENTATION = 0xFFFFFFFD, - TEE_PROPSET_CURRENT_CLIENT = 0xFFFFFFFE, - TEE_PROPSET_CURRENT_TA = 0xFFFFFFFF, -} Pseudo_PropSetHandle; - -typedef uint32_t TEE_PropSetHandle; - -/** - * @brief Obtains a property from a property set and converts its value into a printable string. - * - * - * @param propsetOrEnumerator Indicates one of the TEE_PROPSET_XXX pseudo-handles or a handle on a property enumerator. - * @param name Indicates the pointer to the zero-terminated string containing the name of the property to obtain. - * @param valueBuffer Indicates the pointer to the buffer for holding the property value obtained. - * @param valueBufferLen Indicates the pointer to the buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the target property cannot be obtained. - * @return Returns TEE_ERROR_SHORT_BUFFER if the value buffer is too small to hold the property value obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyAsString(TEE_PropSetHandle propsetOrEnumerator, const char *name, char *valueBuffer, - size_t *valueBufferLen); - -/** - * @brief Obtains a property from a property set and converts its value into a Boolean value. - * - * @param propsetOrEnumerator Indicates one of the TEE_PROPSET_XXX pseudo-handles or a handle on a property enumerator. - * @param name Indicates the pointer to the zero-terminated string containing the name of the property to obtain. - * @param value Indicates the pointer to the variable that holds the property value obtained. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the target property cannot be obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyAsBool(TEE_PropSetHandle propsetOrEnumerator, const char *name, bool *value); - -/** - * @brief Obtains a property from a property set and converts its value into a 32-bit unsigned integer. - * - * @param propsetOrEnumerator Indicates one of the TEE_PROPSET_XXX pseudo-handles or a handle on a property enumerator. - * @param name Indicates the pointer to the zero-terminated string containing the name of the property to obtain. - * @param value Indicates the pointer to the variable that holds the property value obtained. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the target property cannot be obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyAsU32(TEE_PropSetHandle propsetOrEnumerator, const char *name, uint32_t *value); - -#if defined(API_LEVEL) && (API_LEVEL >= API_LEVEL1_2) -/** - * @brief Obtains a property from a property set and converts its value into a 64-bit unsigned integer. - * - * @param propsetOrEnumerator Indicates one of the TEE_PROPSET_XXX pseudo-handles or a handle on a property enumerator. - * @param name Indicates the pointer to the zero-terminated string containing the name of the property to obtain. - * @param value Indicates the pointer to the variable that holds the property value obtained. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the target property cannot be obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyAsU64(TEE_PropSetHandle propsetOrEnumerator, const char *name, uint64_t *value); -#endif // API_LEVEL - -/** - * @brief Obtains a property from a property set and converts its value into a binary block. - * - * @param propsetOrEnumerator Indicates one of the TEE_PROPSET_XXX pseudo-handles or a handle on a property enumerator. - * @param name Indicates the pointer to the zero-terminated string containing the name of the property to obtain. - * @param valueBuffer Indicates the pointer to the buffer for holding the property value obtained. - * @param valueBufferLen Indicates the pointer to the buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the target property cannot be obtained. - * @return TEE_ERROR_SHORT_BUFFER the value buffer is not large enough to hold the whole property value - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyAsBinaryBlock(TEE_PropSetHandle propsetOrEnumerator, const char *name, void *valueBuffer, - size_t *valueBufferLen); - -/** - * @brief Obtains a property from a property set and converts its value to the TEE_UUID struct. - * - * @param propsetOrEnumerator Indicates one of the TEE_PROPSET_XXX pseudo-handles or a handle on a property enumerator. - * @param name Indicates the pointer to the zero-terminated string containing the name of the property to obtain. - * @param value Indicates the pointer to the variable that holds the property value obtained. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the target property cannot be obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyAsUUID(TEE_PropSetHandle propsetOrEnumerator, const char *name, TEE_UUID *value); - -/** - * @brief Obtains a property from a property set and converts its value to the TEE_Identity struct. - * - * @param propsetOrEnumerator Indicates one of the TEE_PROPSET_XXX pseudo-handles or a handle on a property enumerator. - * @param name Indicates the pointer to the zero-terminated string containing the name of the property to obtain. - * @param value Indicates the pointer to the variable that holds the property value obtained. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the target property cannot be obtained. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyAsIdentity(TEE_PropSetHandle propsetOrEnumerator, const char *name, TEE_Identity *value); - -/** - * @brief Allocates a property enumerator object. - * - * @param enumerator Indicates the pointer to the property enumerator filled with an opaque handle. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_OUT_OF_MEMORY if there is no enough resources to allocate the property enumerator. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AllocatePropertyEnumerator(TEE_PropSetHandle *enumerator); - -/** - * @brief Releases a property enumerator object. - * - * @param enumerator Indicates the handle on the property enumerator to release. - * - * @return void - * - * @since 12 - * @version 1.0 - */ -void TEE_FreePropertyEnumerator(TEE_PropSetHandle enumerator); - -/** - * @brief Starts to enumerate the properties in an enumerator. - * - * @param enumerator Indicates the handle on the enumerator. - * @param propSet Indicates the pseudo-handle on the property set to enumerate. - * - * @return void - * - * @since 12 - * @version 1.0 - */ -void TEE_StartPropertyEnumerator(TEE_PropSetHandle enumerator, TEE_PropSetHandle propSet); - -/** - * @brief Resets a property enumerator immediately after allocation. - * - * @param enumerator Indicates the handle on the enumerator to reset. - * - * @return void - * - * @since 12 - * @version 1.0 - */ -void TEE_ResetPropertyEnumerator(TEE_PropSetHandle enumerator); - -/** - * @brief Obtains the name of this property in an enumerator. - * - * @param enumerator Indicates the handle on the enumerator. - * @param nameBuffer Indicates the pointer to the buffer that stores the property name obtained. - * @param nameBufferLen Indicates the pointer to the buffer length. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the property is not found because the enumerator has not started - * or has reached the end of the property set. - * @return Returns TEE_ERROR_SHORT_BUFFER if the buffer is too small to hold the property name. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetPropertyName(TEE_PropSetHandle enumerator, void *nameBuffer, size_t *nameBufferLen); - -/** - * @brief Obtains the next property in an enumerator. - * - * @param enumerator Indicates the handle on the enumerator. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_ITEM_NOT_FOUND if the property is not found because the enumerator - * has not started or has reached the end of the property set. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetNextProperty(TEE_PropSetHandle enumerator); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/tee_rtc_time_api.h b/tee/include/tee_rtc_time_api.h deleted file mode 100644 index 37b7047c53d072b306dbc393f04c4e4f6d4006fc..0000000000000000000000000000000000000000 --- a/tee/include/tee_rtc_time_api.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef __TEE_RTC_TIME_API_H -#define __TEE_RTC_TIME_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_rtc_time_api.h - * - * @brief Provides APIs about rtc timer. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Create a secure timer. - * - * @param time_seconds Indicates the security duration. - * @param timer_property Indicates the property of the timer, where only need to specify the timer type. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other values if the operation fails. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_create_timer(uint32_t time_seconds, TEE_timer_property *timer_property); - -/** - * @brief Destory a secure timer. - * - * @param timer_property Indicates the property of the timer, where only need to specify the timer type. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other values if the operation fails. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_destory_timer(TEE_timer_property *timer_property); - -/** - * @brief Obtain the set timing duration. - * - * @param timer_property Indicates the property of the timer, where only need to specify the timer type. - * @param time_seconds Indicates the timing duration. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other values if the operation fails. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_get_timer_expire(TEE_timer_property *timer_property, uint32_t *time_seconds); - -/** - * @brief Obtain the remain timing duration. - * - * @param timer_property Indicates the property of the timer, where only need to specify the timer type. - * @param time_seconds Indicates the remain timing duration. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns other values if the operation fails. - * - * @since 12 - * @version 1.0 - */ -TEE_Result tee_ext_get_timer_remain(TEE_timer_property *timer_property, uint32_t *time_seconds); - -/** - * @brief Obtain the current timing of the RTC clock. - * @attention The obtained time is in seconds and cannot be converted to universal time. - * - * @return The RTC clock count(in seconds). - * - * @since 12 - * @version 1.0 - */ -unsigned int tee_get_secure_rtc_time(void); -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/tee_service_public.h b/tee/include/tee_service_public.h deleted file mode 100644 index 3a3ea2e0df649fecb03b73965370db63fd436026..0000000000000000000000000000000000000000 --- a/tee/include/tee_service_public.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef _TEE_SERVICE_PUBLIC_H_ -#define _TEE_SERVICE_PUBLIC_H_ - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_service_public.h - * - * @brief Provides the TEE service public function for developers. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*func_ptr)(void); - -/** - * @brief Defines the size of the message queue for the TEE service - * - * @since 12 - */ -#define TEE_SERVICE_MSG_QUEUE_SIZE 100 - -/** - * @brief Defines the arguments of a message. - * - * @since 12 - */ -typedef struct { - uint64_t arg0; - uint64_t arg1; - uint64_t arg2; - uint64_t arg3; - uint64_t arg4; - uint64_t arg5; - uint64_t arg6; - uint64_t arg7; -} args_t; - -/** - * @brief Defines the register information of TA. - * - * @since 12 - */ -struct reg_ta_info { - uint32_t taskid; - TEE_UUID uuid; - uint32_t userid; - /** Just for ssa, other tasks shall ignore it. */ - bool ssa_enum_enable; -}; - -/** - * @brief Defines the IPC message of TEE service. - * - * @since 12 - */ -typedef union { - args_t args_data; - struct reg_ta_info reg_ta; -} tee_service_ipc_msg; - -/** - * @brief Defines the IPC request message of TEE service. - * - * @since 12 - */ -struct tee_service_ipc_msg_req { - uint32_t cmd; - tee_service_ipc_msg msg; -}; - -/** - * @brief Defines the IPC response message of TEE service. - * - * @since 12 - */ -typedef struct { - TEE_Result ret; - tee_service_ipc_msg msg; -} tee_service_ipc_msg_rsp; - -/** - * @brief Defines the message of the TEE service. - * - * @since 12 - */ -typedef struct { - uint32_t msg_id; - uint32_t sender; - tee_service_ipc_msg msg; -} tee_service_msg_t; - -/** - * @brief Defines the message queue for the TEE service. - * - * @since 12 - */ -typedef struct { - uint32_t in; - uint32_t out; - tee_service_msg_t msg[TEE_SERVICE_MSG_QUEUE_SIZE]; -} tee_service_msg_queue_t; - -/** - * @brief Provides to send IPC synchronization messages to a specified service - * and receive responses from the service. - * - * @param task_name Indicates the task name of recipient. - * @param snd_cmd Indicates the command ID of the send message. - * @param snd_msg Indicates the send message. - * @param ack_cmd Indicates the ID of the ack cmd to be received. - * @param rsp_msg Indicates the service response message. - * - * @since 12 - * @version 1.0 - */ -void tee_common_ipc_proc_cmd(const char *task_name, - uint32_t snd_cmd, const tee_service_ipc_msg *snd_msg, - uint32_t ack_cmd, tee_service_ipc_msg_rsp *rsp_msg); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/tee_sharemem_ops.h b/tee/include/tee_sharemem_ops.h deleted file mode 100644 index 479964ff3140a4547b7e7c8ad9da984a69790457..0000000000000000000000000000000000000000 --- a/tee/include/tee_sharemem_ops.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef TEE_SHAREMEM_OPS_H -#define TEE_SHAREMEM_OPS_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_sharemem_ops.h - * - * @brief Provides APIs for developers to apply for shared memory. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Alloc shared memory in TEE. - * - * @param uuid Indicates the UUID of TA. - * @param size Indicates the size of the requested shared memory. - * - * @return Returns a pointer to the newly allocated space if the operation is successful. - * Returns a NULL pointer if the allocation fails. - * - * @since 12 - * @version 1.0 - */ -void *tee_alloc_sharemem_aux(const struct tee_uuid *uuid, uint32_t size); - -/** - * @brief Alloc continuous shared memory in TEE. - * - * @param uuid Indicates the UUID of TA. - * @param size Indicates the size of the requested shared memory. - * - * @return Returns a pointer to the newly allocated space if the operation is successful. - * Returns a NULL pointer if the allocation fails. - * - * @since 12 - * @version 1.0 - */ -void *tee_alloc_coherent_sharemem_aux(const struct tee_uuid *uuid, uint32_t size); - -/** - * @brief Free the shared memory in TEE. - * - * @param addr Indicates the shared memory address that will be freed. - * @param size Indicates the size of the shared memory. - * - * @return Returns 0 if the operation is successful. - * Returns others if the operation is failed. - * - * @since 12 - * @version 1.0 - */ -uint32_t tee_free_sharemem(void *addr, uint32_t size); - -/** - * @brief Copy shared memory from source task. - * - * @param src_task Indicates the pid of the source task. - * @param src Indicates the address of the source buffer. - * @param src_size Indicates the size of the source buffer. - * @param dst Indicates the address of the destination buffer. - * @param dst_size Indicates the size of the destination buffer. - * - * @return Returns 0 if the operation is successful. - * Returns -1 if the operation is failed. - * - * @since 12 - * @version 1.0 - */ -int32_t copy_from_sharemem(uint32_t src_task, uint64_t src, uint32_t src_size, uintptr_t dst, uint32_t dst_size); - -/** - * @brief Copy shared memory to destination task. - * - * @param src Indicates the address of the source buffer. - * @param src_size Indicates the size of the source buffer. - * @param dst_task Indicates the pid of the destination task. - * @param dst Indicates the address of the destination buffer. - * @param dst_size Indicates the size of the destination buffer. - * - * @return Returns 0 if the operation is successful. - * Returns -1 if the operation is failed. - * - * @since 12 - * @version 1.0 - */ -int32_t copy_to_sharemem(uintptr_t src, uint32_t src_size, uint32_t dst_task, uint64_t dst, uint32_t dst_size); -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/include/tee_time_api.h b/tee/include/tee_time_api.h deleted file mode 100644 index 58ea6d51f0a94a5b09500f3df678033779f923e5..0000000000000000000000000000000000000000 --- a/tee/include/tee_time_api.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef __TEE_TIME_API_H -#define __TEE_TIME_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_time_api.h - * - * @brief Provides APIs for managing the Trusted Execution Environment (TEE) time. - * - * You can use these APIs to implement time-related features in a TEE. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Obtains the current TEE system time. - * - * @param time Indicates the pointer to the current system time obtained. - * - * @since 12 - * @version 1.0 - */ -void TEE_GetSystemTime(TEE_Time *time); - -/** - * @brief Waits for the specified period of time, in milliseconds. - * - * @param timeout Indicates the period of time to wait, in milliseconds. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_CANCEL if the wait is canceled. - * @return Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_Wait(uint32_t timeout); - -/** - * @brief Obtains the persistent time of this trusted application (TA). - * - * @param time Indicates the pointer to the persistent time of the TA. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_TIME_NOT_SET if the persistent time has not been set. - * @return Returns TEE_ERROR_TIME_NEEDS_RESET if the persistent time is corrupted and - * the application is not longer trusted. - * @return Returns TEE_ERROR_OVERFLOW if the number of seconds in the TA persistent time - * exceeds the range of uint32_t. - * @return Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetTAPersistentTime(TEE_Time *time); - -/** - * @brief Sets the persistent time for this TA. - * - * @param time Indicates the pointer to the persistent time of the TA. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * @return Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * @return Returns TEE_ERROR_STORAGE_NO_SPACE if the storage space is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SetTAPersistentTime(TEE_Time *time); - -/** - * @brief Obtains the current Rich Execution Environment (REE) system time. - * - * @param time Indicates the pointer to the REE system time obtained. - * - * @since 12 - * @version 1.0 - */ -void TEE_GetREETime(TEE_Time *time); - -/** - * @brief Obtains the string format of the current Rich Execution Environment (REE) system time. - * - * @param tim_str Indicates the REE system time string. - * @param time_str_len Indicates the length of the string. - * - * @since 12 - * @version 1.0 - */ -void TEE_GetREETimeStr(char *tim_str, uint32_t time_str_len); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_trusted_storage_api.h b/tee/include/tee_trusted_storage_api.h deleted file mode 100644 index 2638db1d48f7e794932220646e7f69492c459639..0000000000000000000000000000000000000000 --- a/tee/include/tee_trusted_storage_api.h +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef __TEE_TRUSTED_STORAGE_API_H -#define __TEE_TRUSTED_STORAGE_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_trusted_storage_api.h - * - * @brief Provides trusted storage APIs. - * - * You can use these APIs to implement trusted storage features. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include "tee_defines.h" -#include "tee_object_api.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Defines the start position in the data stream associated with an object. - * It is used in the TEE_SeekObjectData function. - * - * @since 12 - */ -enum __TEE_Whence { - /* Set the start position to the beginning of the data stream. */ - TEE_DATA_SEEK_SET = 0, - /* Set the start position to the current data stream position. */ - TEE_DATA_SEEK_CUR, - /* Set the start position to the end of the data stream. */ - TEE_DATA_SEEK_END -}; - -struct __TEE_ObjectEnumHandle; - -/** - * @brief Defines the pointer to TEE_ObjectEnumHandle. - * - * @see __TEE_ObjectEnumHandle - * - * @since 12 - */ -typedef struct __TEE_ObjectEnumHandle *TEE_ObjectEnumHandle; - -typedef uint32_t TEE_Whence; - -/** - * @brief Defines the storage ID, which identifies the storage space of the application. - * - * @since 12 - */ -enum Object_Storage_Constants { - /* Separate private storage space for each application. */ - TEE_OBJECT_STORAGE_PRIVATE = 0x00000001, - /* Separate personal storage space for application. */ - TEE_OBJECT_STORAGE_PERSO = 0x00000002, - /* Space for secure flash storage. */ - TEE_OBJECT_SEC_FLASH = 0x80000000, - /* Credential encrypted storage space. */ - TEE_OBJECT_STORAGE_CE = 0x80000002, -}; - -/** - * @brief Defines the system resource constraints, such as the maximum value for the data stream position indicator. - * - * @since 12 - */ -enum Miscellaneous_Constants { - /* Maximum length that the position indicator of the data stream can take. */ - TEE_DATA_MAX_POSITION = 0xFFFFFFFF, - /* Maximum length of the object ID, which can extend to 128 bytes. */ - TEE_OBJECT_ID_MAX_LEN = 64, -}; - -/** - * @brief Defines the maximum number of bytes that can be held in a data stream. - * - * @since 12 - */ -enum TEE_DATA_Size { - TEE_DATA_OBJECT_MAX_SIZE = 0xFFFFFFFF -}; - -/** - * @brief Defines the handleFlags of a TEE_ObjectHandle. - * The handleFlags determines the access permissions to the data stream associated with the object. - * - * @since 12 - */ -enum Data_Flag_Constants { - /** The data stream can be read. */ - TEE_DATA_FLAG_ACCESS_READ = 0x00000001, - /** The data stream can be written or truncated. */ - TEE_DATA_FLAG_ACCESS_WRITE = 0x00000002, - /** The data stream can be deleted or renamed. */ - TEE_DATA_FLAG_ACCESS_WRITE_META = 0x00000004, - /** Multiple TEE_ObjectHandles can be opened for concurrent read. */ - TEE_DATA_FLAG_SHARE_READ = 0x00000010, - /** Multiple TEE_ObjectHandles can be opened for concurrent write. */ - TEE_DATA_FLAG_SHARE_WRITE = 0x00000020, - /** Reserved. */ - TEE_DATA_FLAG_CREATE = 0x00000200, - /** - * Protect the existing file with the same name. Throw an error if the file with the same name exists; - * create a data file otherwise. - */ - TEE_DATA_FLAG_EXCLUSIVE = 0x00000400, - /** - * Protect the existing file with the same name. Throw an error if the file with the same name exists; - * create a data file otherwise. - */ - TEE_DATA_FLAG_OVERWRITE = 0x00000400, - /** Use AES256 if bit 28 is 1; use AES128 if bit 28 is 0. */ - TEE_DATA_FLAG_AES256 = 0x10000000, - /** If bit 29 is set to 1, open the earlier version preferentially. */ - TEE_DATA_FLAG_OPEN_AESC = 0x20000000, -}; - -/** - * @brief Creates a persistent object. - * - * This function creates a persistent object with initialized TEE_Attribute and data stream. - * You can use the returned handle to access the TEE_Attribute and data stream of the object. - * - * @param storageID Indicates the storage to use. The value is specified by Object_Storage_Constants. - * @param ojbectID Indicates the pointer to the object identifier, that is, the name of the object to create. - * @param objectIDLen Indicates the length of the object identifier, in bytes. It cannot exceed 128 bytes. - * @param flags Indicates the flags of the object created. The value can be - * one or more of Data_Flag_Constants or Handle_Flag_Constants. - * @param attributes Indicates the TEE_ObjectHandle of a transient object from which to take - * TEE_Attribute. It can be TEE_HANDLE_NULL if the persistent object contains no attribute. - * @param initialData Indicates the pointer to the initial data used to initialize the data stream data. - * @param initialDataLen Indicates the length of the initial data, in bytes. - * @param object Indicates the pointer to the TEE_ObjectHandle returned - * after the function is successfully executed. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_ITEM_NOT_FOUND if the storage specified by storageID does not exist. - * Returns TEE_ERROR_ACCESS_CONFLICT if an access conflict occurs. - * Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * Returns TEE_ERROR_STORAGE_NO_SPACE if there is no enough space to create the object. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_CreatePersistentObject(uint32_t storageID, const void *ojbectID, size_t objectIDLen, uint32_t flags, - TEE_ObjectHandle attributes, const void *initialData, size_t initialDataLen, - TEE_ObjectHandle *object); - -/** - * @brief Opens an existing persistent object. - * - * The handle returned can be used to access the TEE_Attribute and data stream of the object. - * - * @param storageID Indicates the storage to use. The value is specified by Object_Storage_Constants. - * @param ojbectID Indicates the pointer to the object identifier, that is, the name of the object to open. - * @param objectIDLen Indicates the length of the object identifier, in bytes. It cannot exceed 128 bytes. - * @param flags Indicates the flags of the object opened. - * The value can be one or more of Data_Flag_Constants or Handle_Flag_Constants. - * @param object Indicates the pointer to the TEE_ObjectHandle returned - * after the function is successfully executed. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_ITEM_NOT_FOUND if the storage specified by storageID does not exist - * or the object identifier cannot be found in the storage. - * Returns TEE_ERROR_ACCESS_CONFLICT if an access conflict occurs. - * Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_OpenPersistentObject(uint32_t storageID, const void *ojbectID, size_t objectIDLen, uint32_t flags, - TEE_ObjectHandle *object); - -/** - * @brief Reads data from the data stream associated with an object into the buffer. - * - * The TEE_ObjectHandle of the object must have been opened with the TEE_DATA_FLAG_ACCESS_READ permission. - * - * @param ojbect Indicates the TEE_ObjectHandle of the object to read. - * @param buffer Indicates the pointer to the buffer used to store the data read. - * @param size Indicates the number of bytes to read. - * @param count Indicates the pointer to the variable that contains the number of bytes read. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_ReadObjectData(TEE_ObjectHandle ojbect, void *buffer, size_t size, uint32_t *count); - -/** - * @brief Writes bytes from the buffer to the data stream associated with an object. - * - * The TEE_ObjectHandle must have been opened with the TEE_DATA_FLAG_ACCESS_WRITE permission. - * - * @param ojbect Indicates the TEE_ObjectHandle of the object. - * @param buffer Indicates the pointer to the buffer that stores the data to be written. - * @param size Indicates the number of bytes to be written. It cannot exceed 4096 bytes. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * Returns TEE_ERROR_STORAGE_NO_SPACE if the storage space is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_WriteObjectData(TEE_ObjectHandle ojbect, const void *buffer, size_t size); - -/** - * @brief Changes the size of a data stream. - * - * If the size is less than the current size of the data stream, all bytes beyond size are deleted. If the size - * is greater than the current size of the data stream, add 0s at the end of the stream to extend the stream. - * The object handle must be opened with the TEE_DATA_FLAG_ACCESS_WRITE permission. - * - * @param object Indicates the TEE_ObjectHandle of the object. - * @param size Indicates the new size of the data stream. It cannot exceed 4096 bytes. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_STORAGE_NO_SPACE if the storage space is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TruncateObjectData(TEE_ObjectHandle object, size_t size); - -/** - * @brief Sets the position of the data stream to which TEE_ObjectHandle points. - * - * The data position indicator is determined by the start position and an offset together. - * The whence parameter determines the start position. Its value is set in TEE_Whence as follows: - * TEE_DATA_SEEK_SET = 0: The start position is the beginning of the data stream. - * TEE_DATA_SEEK_CUR: The start position is the current position of the data stream. - * TEE_DATA_SEEK_END: The start position is the end of the data stream. - * If the parameter offset is a positive number, the data position is moved forward. - * If offset is a negative number, the data position is moved backward. - * - * @param object Indicates the TEE_ObjectHandle of the object. - * @param offset Indicates the number of bytes to move the data position. It cannot exceed 4096 bytes. - * @param whence Indicates the start position in the data stream to calculate the new position. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OVERFLOW if the position indicator resulting from this operation - * is greater than TEE_DATA_MAX_POSIT. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SeekObjectData(TEE_ObjectHandle object, int32_t offset, TEE_Whence whence); - -/** - * @brief Synchronizes the opened TEE_ObjectHandle and the corresponding security attribute file to the disk. - * - * @param object Indicates the TEE_ObjectHandle of the object. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_SyncPersistentObject(TEE_ObjectHandle object); - -/** - * @brief Changes the object identifier. - * - * The TEE_ObjectHandle must have been opened with the TEE_DATA_FLAG_ACCESS_WRITE_META permission. - * - * @param object Indicates the handle of the target object. - * @param newObjectID Indicates the pointer to the new object identifier. - * @param newObjectIDLen Indicates the length of the new object identifier. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_RenamePersistentObject(TEE_ObjectHandle object, void *newObjectID, size_t newObjectIDLen); - -/** - * @brief Allocates a handle on an uninitialized object enumerator. - * - * @param obj_enumerator Indicates the pointer to the handle of the newly created object enumerator. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_OUT_OF_MEMORY if the memory is not sufficient to complete the operation. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_AllocatePersistentObjectEnumerator(TEE_ObjectEnumHandle *obj_enumerator); - -/** - * @brief Releases all resources associated with an object enumerator handle. - * - * After this function is called, the object handle is no longer valid and all resources associated with - * the object enumerator handle will be reclaimed. - * TEE_FreePersistentObjectEnumerator and TEE_AllocatePersistentObjectEnumeratorare used in pairs. - * - * @param obj_enumerator Indicates the TEE_ObjectEnumHandle to release. - * - * @since 12 - * @version 1.0 - */ -void TEE_FreePersistentObjectEnumerator(TEE_ObjectEnumHandle obj_enumerator); - -/** - * @brief Resets an object enumerator handle to its initial state after allocation. - * - * @param obj_enumerator Indicates the TEE_ObjectEnumHandle of the object enumerator to reset. - * - * @since 12 - * @version 1.0 - */ -void TEE_ResetPersistentObjectEnumerator(TEE_ObjectEnumHandle obj_enumerator); - -/** - * @brief Starts the enumeration of all the objects in the given trusted storage. - * - * The object information can be obtained by using TEE_GetNextPersistentObject. - * - * @param obj_enumerator Indicates the TEE_ObjectEnumHandle of the object enumerator. - * @param storage_id Indicates the storage, in which the objects are enumerated. - * The value is specified by Object_Storage_Constants. - * Currently, only TEE_STORAGE_PRIVATE is supported. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ITEM_NOT_FOUND if storageID is not TEE_STORAGE_PRIVATE - * or there is no object in the specified storage. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_StartPersistentObjectEnumerator(TEE_ObjectEnumHandle obj_enumerator, uint32_t storage_id); - -/** - * @brief Obtains the next object in the object enumerator. - * - * Information such as TEE_ObjectInfo, objectID, and objectIDLen will be obtained. - * - * @param obj_enumerator Indicates the TEE_ObjectEnumHandle of the object enumerator. - * @param object_info Indicates the pointer to the obtainedTEE_ObjectInfo. - * @param object_id Indicates the pointer to the buffer used to store the obtained objectID. - * @param object_id_len Indicates the pointer to the objectIDLen. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ITEM_NOT_FOUND if the object enumerator has no element - * or the enumerator has not been initialized. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_GetNextPersistentObject(TEE_ObjectEnumHandle obj_enumerator, - TEE_ObjectInfo *object_info, void *object_id, size_t *object_id_len); - -/** - * @brief Closes a TEE_ObjectHandle and deletes the object. - * - * The object must be a persistent object, and the object handle must have been opened with - * the TEE_DATA_FLAG_ACCESS_WRITE_META permission. - * - * @param object Indicates the object handle to close. - * - * @return Returns TEE_SUCCESS if the operation is successful. - * Returns TEE_ERROR_STORAGE_NOT_AVAILABLE if the object is stored - * in a storage area that is inaccessible currently. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_CloseAndDeletePersistentObject1(TEE_ObjectHandle object); - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif diff --git a/tee/include/tee_tui_gp_api.h b/tee/include/tee_tui_gp_api.h deleted file mode 100644 index b50011f695169a34657f6c2b8156bc205e81169b..0000000000000000000000000000000000000000 --- a/tee/include/tee_tui_gp_api.h +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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 - * - * 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. - */ - -#ifndef TASK_TUI_GP_API_H -#define TASK_TUI_GP_API_H - -/** - * @addtogroup TeeTrusted - * @{ - * - * @brief TEE(Trusted Excution Environment) API. - * Provides security capability APIs such as trusted storage, encryption and decryption, - * and trusted time for trusted application development. - * - * @since 12 - */ - -/** - * @file tee_tui_gp_api.h - * - * @brief Provides APIs for operating big integers. - * - * @library NA - * @kit TEEKit - * @syscap SystemCapability.Tee.TeeClient - * @since 12 - * @version 1.0 - */ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define TEE_TUI_NUMBER_BUTTON_TYPES 0x00000006 -#define TEE_STORAGE_PRIVATE 0x00000001 -#define DEFAULT_MAX_ENTRY_FIELDS 3 - -#define TUI_EXIT 8 - -/** - * @brief Enumerates the modes supported when displaying characters within an input entry field. - * - * @since 12 - */ -typedef enum { - /** Never visible, displayed as '*'. */ - TEE_TUI_HIDDEN_MODE = 0, - /** Always visible. */ - TEE_TUI_CLEAR_MODE, - /** Visible then hidden. */ - TEE_TUI_TEMPORARY_CLEAR_MODE -} TEE_TUIEntryFieldMode; - -/** - * @brief Enumerates the input types supported of the TUI entry field. - * - * @since 12 - */ -typedef enum { - /** When the field accepts only digits as inputs. */ - TEE_TUI_NUMERICAL = 0, - /** When the field accepts characters and digits as inputs. */ - TEE_TUI_ALPHANUMERICAL, -} TEE_TUIEntryFieldType; - -/** - * @brief Enumerates the TUI screen orientation. - * @attention Currently {@code TEE_TUI_LANDSCAPE} is not supported. - * - * @since 12 - */ -typedef enum { - /** Displayed as a portrait, i.e. vertically. */ - TEE_TUI_PORTRAIT = 0, - /** Displayed as a landscape, i.e. horizontally. */ - TEE_TUI_LANDSCAPE, -} TEE_TUIScreenOrientation; - -/** - * @brief Enumerates the types of the button. - * - * @since 12 - */ -typedef enum { - /** Used to delete the previous input digit. */ - TEE_TUI_CORRECTION = 0, - /** Exits the interface. */ - TEE_TUI_OK, - /** Cancels the operation and exits the interface. */ - TEE_TUI_CANCEL, - /** Used to trigger PIN verifcation and exit the interface.*/ - TEE_TUI_VALIDATE, - /** Exit the current interface and ask the TA to display the previous interface. */ - TEE_TUI_PREVIOUS, - /** Exit the current interface and ask the TA to display the next interface. */ - TEE_TUI_NEXT, -} TEE_TUIButtonType; - -/** - * @brief Enumerates source of the uesd image. - * - * @since 12 - */ -typedef enum { - /** No picture provided in the input. */ - TEE_TUI_NO_SOURCE = 0, - /** The picture provided as a memory pointer. */ - TEE_TUI_REF_SOURCE, - /** The picture provided by an object in the secure storage. */ - TEE_TUI_OBJECT_SOURCE, - /** The picture provided as a file. */ - TEE_TUI_FILE_SOURCE = 0x8001 -} TEE_TUIImageSource; - -/** - * @brief Represents the image in PNG format. - * - * @since 12 - */ -typedef struct { - TEE_TUIImageSource source; - struct { - void *image; - size_t imageLength; - } ref; - struct { - uint32_t storageID; - void *objectID; - size_t objectIDLen; - } object; - /** Represents the number of pixels of the width of the image. */ - uint32_t width; - /** Represents the number of pixels of the height of the image. */ - uint32_t height; -} TEE_TUIImage; - -/** - * @brief Enumerates the GP color index. - * - * @since 12 - */ -enum gp_color_idx { - /** Red color index. */ - RED_IDX = 0, - /** Green color index. */ - GREEN_IDX = 1, - /** Blue color index. */ - BLUE_IDX = 2, - /** RGB color index. */ - RGB_COLOR_IDX = 3, -}; - -/** - * @brief Represents the label for TA branding/message, generally on the top of screen. - * - * @since 12 - */ -typedef struct { - /** It's the string to put in the label area, which can be NULL. */ - char *text; - /** X-coordinate of the upper left corner of the text information. */ - uint32_t textXOffset; - /** Y-coordinate of the upper left corner of the text information. */ - uint32_t textYOffset; - /** RGB color used for displaying the text information. */ - uint8_t textColor[RGB_COLOR_IDX]; - /** The image is placed in the label area. */ - TEE_TUIImage image; - /** X-coordinate of the upper left corner of the image to be displayed. */ - uint32_t imageXOffset; - /** Y-coordinate of the upper left corner of the image to be displayed. */ - uint32_t imageYOffset; -} TEE_TUIScreenLabel; - -/** - * @brief Represents the content displayed on a button. - * - * @since 12 - */ -typedef struct { - /** It's the string to associate with the button, which can be NULL. */ - char *text; - /** The image to associate with the button. */ - TEE_TUIImage image; -} TEE_TUIButton; - -/** - * @brief Represents the configuration about the TUI screen. - * - * @since 12 - */ -typedef struct { - /** The requested screen orientation. */ - TEE_TUIScreenOrientation screenOrientation; - /** The specifies label of the screen.*/ - TEE_TUIScreenLabel label; - /** Customizes the buttons compared to the default. */ - TEE_TUIButton *buttons[TEE_TUI_NUMBER_BUTTON_TYPES]; - /** Specifes which buttons to be displayed. */ - bool requestedButtons[TEE_TUI_NUMBER_BUTTON_TYPES]; -} TEE_TUIScreenConfiguration; - -/** - * @brief Represents the information about a TUI screen button. - * @attention The {@code buttonTextCustom} and {@code buttonImageCustom} cannot be set to true at the same time. - * - * @since 12 - */ -typedef struct { - /** Defaut label value of the button text. If the value is NULL means the parameter is unavailable. */ - const char *buttonText; - /** The pixel width of the button. - * If the text or image on the button cannot be customized, the value is 0. - */ - uint32_t buttonWidth; - /** The pixel height of the button. - * If the text or image on the button cannot be customized, the value is 0. - */ - uint32_t buttonHeight; - /** If the text on the button cannot be customized, the value is true. */ - bool buttonTextCustom; - /** If the image on the button cannot be customized, the value is true. */ - bool buttonImageCustom; -} TEE_TUIScreenButtonInfo; - -/** - * @brief Represents the information displayed on the TUI. - * - * @since 12 - */ -typedef struct { - /** Available grayscale. */ - uint32_t grayscaleBitsDepth; - /** Available red depth level. */ - uint32_t redBitsDepth; - /** Available green depth level. */ - uint32_t greenBitsDepth; - /** Available blue depth level. */ - uint32_t blueBitsDepth; - /** Indicates the number of pixels per inch in the width direction. */ - uint32_t widthInch; - /** Indicates the number of pixels per inch in the height direction. */ - uint32_t heightInch; - /** Indicates the maximum number of entries that can be displayed on the TUI. */ - uint32_t maxEntryFields; - /** Indicates the pixel width of the input region label. */ - uint32_t entryFieldLabelWidth; - /** Indicates the pixel height of the input region label. */ - uint32_t entryFieldLabelHeight; - /** Indicates the maximum number of characters that can be entered in the entry field. */ - uint32_t maxEntryFieldLength; - /** RGB value of the default label canvas. */ - uint8_t labelColor[RGB_COLOR_IDX]; - /** Indicates the pixel width of the label canvas. */ - uint32_t labelWidth; - /** Indicates the pixel height of the label canvas. */ - uint32_t labelHeight; - /** Indicates the information of the buttons on the interface. */ - TEE_TUIScreenButtonInfo buttonInfo[TEE_TUI_NUMBER_BUTTON_TYPES]; -} TEE_TUIScreenInfo; - -/** - * @brief Represents the information in an entry field that requires user input. - * - * @since 12 - */ -typedef struct { - /** Indicates the label of the entry field. */ - char *label; - /** Indicates the mode used to display characters. */ - TEE_TUIEntryFieldMode mode; - /** Indicates the type of the characters can be entered in the entry field. */ - TEE_TUIEntryFieldType type; - /** The minimum number of characters to be entered. */ - uint32_t minExpectedLength; - /** The maximum number of characters to be entered. */ - uint32_t maxExpectedLength; - /** Contains the content entered by user. */ - char *buffer; - /** Indicates the length of the buffer. */ - size_t bufferLength; -} TEE_TUIEntryField; - -/** - * @brief Initializing the TUI resources. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * Returns {@code TEE_ERROR_NOT_SUPPORTED} if the device is not support TUI. - * Returns {@code TEE_ERROR_BUSY} if the TUI resources cannot be reserved. - * Returns {@code TEE_ERROR_OUT_OF_MEMORY} if the system ran out of the resources. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUIInitSession(void); - - -/** - * @brief Releases TUI resources previously acquired. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_STATE} if the current TA is not within a TUI session initially - * started by a successful call to {@code TEE_TUIInitSession}. - * Returns {@code TEE_ERROR_BUSY} if the TUI resources currently are in use. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUICloseSession(void); - -/** - * @brief Allows a TA to check whether a given text can be rendered by the current implementation and - * retrieves information about the size and width that is needed to render it. - * - * @param text Indicates the string to be checked. - * @param width Indicates the width in pixels needed to render the text. - * @param height Indicates the height in pixels needed to render the text. - * @param last_index Indicates the last character that has been checked - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_NOT_SUPPORTED} if at least one of the characters present - * in the text string cannot be rendered. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUICheckTextFormat(const char *text, uint32_t *width, uint32_t *height, uint32_t *last_index); - -/** - * @brief Retrieves information about the screen depending on its orientation and - * the number of required entry fields. - * - * @param screenOrientation Defines for which orientation screen information is requested. - * @param nbEntryFields Indicates the number of the requested entry fields. - * @param screenInfo Indicates the information on the requested screen for a given orientation. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_NOT_SUPPORTED} if the number of entry fields is not supported. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUIGetScreenInfo(TEE_TUIScreenOrientation screenOrientation, - uint32_t nbEntryFields, - TEE_TUIScreenInfo *screenInfo); -/** - * @brief Display a TUI screen. - * - * @param screenConfiguration Indicates the configuration of the labels and optional buttons on the display interface. - * @param closeTUISession If the value is true, the TUI session will automatically closed when exiting the function. - * @param entryFields Indicates the information of entry field. - * @param entryFieldCount Indicates the count of the entry fields. - * @param selectedButton Indicates which button has been selected by the user to exit the TUI screen. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_OUT_OF_MEMORY} if the system ran out of the resources. - * Returns {@code TEE_ERROR_ITEM_NOT_FOUND} if at least one image provided by the TA refers to a storage - * denoted by a storageID which dose not exist or if the corresponding object identifier cannot be found in the storage. - * Returns {@code TEE_ERROR_ACCESS_CONFLICT} if at least one image provided by the TA refers to a data - * object in the trusted storage and an access right conflict was detected while opening the object. - * Returns {@code TEE_ERROR_BAD_FORMAT} if at least one input image is not compliant with PNG format. - * Returns {@code TEE_ERROR_BAD_STATE} if the current TA is not within a TUI session - * initially started by a successful call to {@code TEE_TUIInitSession}. - * Returns {@code TEE_ERROR_BUSY} if the TUI resources are currently in use, i.e. a TUI screen is displayed. - * Returns {@code TEE_ERROR_CANCEL} if the operation has been cancelled while a TUI screen is currently - * displayed. - * Returns {@code TEE_ERROR_EXTERNAL_CANCEL} if the operation has been cancelled by an external event which - * occurred in the REE while a TUI screen is currently displayed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUIDisplayScreen(TEE_TUIScreenConfiguration *screenConfiguration, - bool closeTUISession, - TEE_TUIEntryField *entryFields, - uint32_t entryFieldCount, - TEE_TUIButtonType *selectedButton); - -/** - * @brief Fringerprint identification port. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_NOT_SUPPORTED} if the device is not support TUI. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUINotify_fp(void); - -/** - * @brief Set the Chinese character encoding. The system supports UTF-8 by default. - * - * @param type Indicates the encoding type. The value 1 indicates GBK. Other values are not supported. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_NOT_SUPPORTED} if the device is not support this function. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUISetInfo(int32_t type); - -/** - * @brief Send message to TUI. - * - * @param type Indicates the messages send to the TUI. Only support {@code TUI_EXIT}. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUISendEvent(int32_t type); - -/** - * @brief Setting the TUI background image. - * - * @param label Configure the background image information in the label variable. - * The image must be a PNG image in array format. - * @param len Indicates the label size. - * - * @return Returns {@code TEE_SUCCESS} if the operation is successful. - * Returns {@code TEE_ERROR_GENERIC} if input parameter is incorrect. - * Returns {@code TEE_ERROR_ACCESS_DENIED} if the permission verification failed. - * - * @since 12 - * @version 1.0 - */ -TEE_Result TEE_TUISetLabel(TEE_TUIScreenLabel *label, uint32_t len); -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/tee/libteec.ndk.json b/tee/libteec.ndk.json deleted file mode 100644 index 2083549f8607165f3afe608f3191b1abdea29d38..0000000000000000000000000000000000000000 --- a/tee/libteec.ndk.json +++ /dev/null @@ -1,11 +0,0 @@ -[ - { "name": "TEEC_InitializeContext" }, - { "name": "TEEC_FinalizeContext" }, - { "name": "TEEC_OpenSession" }, - { "name": "TEEC_CloseSession" }, - { "name": "TEEC_InvokeCommand" }, - { "name": "TEEC_RegisterSharedMemory" }, - { "name": "TEEC_AllocateSharedMemory" }, - { "name": "TEEC_ReleaseSharedMemory" }, - { "name": "TEEC_RequestCancellation" } -] \ No newline at end of file diff --git a/third_party/musl/ndk_script/BUILD.gn b/third_party/musl/ndk_script/BUILD.gn index a71e33565ab354dd49bfb34bdfa2de31e336bbe8..0e08fa68fa4ce3b9f302b64c7121cea69c6bec80 100644 --- a/third_party/musl/ndk_script/BUILD.gn +++ b/third_party/musl/ndk_script/BUILD.gn @@ -14,6 +14,7 @@ import("//build/config/clang/clang.gni") import("//build/ohos/ndk/ndk.gni") +import("//build/version.gni") import("//third_party/musl/musl_config.gni") import("//third_party/musl/musl_src.gni") import("//third_party/musl/musl_template.gni") @@ -21,6 +22,8 @@ import("//third_party/musl/musl_template.gni") musl_target_out_dir = "${root_out_dir}/obj/third_party/musl" ndk_musl_include = "ndk_musl_include" interface_musl_dir = "//interface/sdk_c/third_party/musl" +target_version_dir = "ndk_musl_include/info" +target_version_file = "application_target_sdk_version.h" if (host_os == "mac") { if (host_cpu == "arm64") { @@ -223,6 +226,15 @@ action("copy_ndk_musl_headers") { deps = [ ":copy_ndk_uapi" ] } +action("updated_version") { + outputs = [ "${musl_target_out_dir}/${target_version_dir}" ] + script = "updated_version.py" + args = [ "-p" ] + [ rebase_path( + "${musl_target_out_dir}/${target_version_dir}/${target_version_file}") ] + args += [ "-v" ] + [ api_version ] + deps = [ ":copy_ndk_musl_headers" ] +} + action("copy_musl_sysroot") { outputs = [ "${ndk_headers_out_dir}" ] script = "copy_musl_sysroot.sh" @@ -230,7 +242,7 @@ action("copy_musl_sysroot") { [ "-i" ] + [ rebase_path("${musl_target_out_dir}/${ndk_musl_include}") ] args += [ "-o" ] + [ rebase_path("${ndk_headers_out_dir}") ] args += [ "-t" ] + [ "${musl_arch}" ] - deps = [ ":copy_ndk_musl_headers" ] + deps = [ ":updated_version" ] } musl_libs_arm32 = [ diff --git a/third_party/musl/ndk_script/updated_version.py b/third_party/musl/ndk_script/updated_version.py new file mode 100755 index 0000000000000000000000000000000000000000..3623845279fa0deb813750097d61dbf2b016676c --- /dev/null +++ b/third_party/musl/ndk_script/updated_version.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (c) 2024 Huawei Device Co., Ltd. +# 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 +# +# 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. + +import argparse + + +# 插入新版宏内容 +def updated_version(file_path: str, new_version: int): + version_define = '#define OH_API_VERSION_' + version_current_define = '#define OH_CURRENT_API_VERSION OH_API_VERSION_' + # 需要插入的内容 + new_content = '' + # 插入的标志位置 + insert_after_line = '#define SDK_VERSION_9 9' + # 旧版本 + old_version = 9 + # 更新需插入的内容 + for i in range(new_version - old_version): + new_content += '{}{} {}\n'.format(version_define, old_version + i + 1, old_version + i + 1) + new_content_tag = '{}{}\n'.format(version_current_define, new_version) + new_content += new_content_tag + + with open(file_path, 'r') as fp: + lines = fp.readlines() + + # 查找插入位置的索引 + insert_position = None + for i, line in enumerate(lines): + if insert_after_line in line: + insert_position = i + 1 # 插入在该行之后 + break + + # 如果找到插入位置 + if (insert_position is not None) and (new_content_tag not in lines): + # 插入新内容 + lines.insert(insert_position, new_content) + # 更新修改后的内容 + with open(file_path, 'w') as fp: + fp.writelines(lines) + elif insert_position is None: + raise Exception('未找到插入位置: {},写入失败'.format(insert_after_line)) + + +# 入口 +def process_target_version(): + try: + parser = argparse.ArgumentParser(description='Updated version') + # 定义命令行参数 + parser.add_argument('-p', '--path', type=str, required=True, help='Path to the input file') + parser.add_argument('-v', '--version', type=str, required=True, help='Version of the api') + args = parser.parse_args() + # 获取文件路径和版本 + input_file = args.path + api_version = int(args.version) + # 写入新版宏内容 + updated_version(input_file, api_version) + except Exception as e: + raise e + + +if __name__ == '__main__': + process_target_version() diff --git a/web/webview/interfaces/native/arkweb_error_code.h b/web/webview/interfaces/native/arkweb_error_code.h index a445de2c717c0e35ae1df73fd6cf6f26a6be6514..64db3082c4fa8496a392e37585e4b04dec261516 100644 --- a/web/webview/interfaces/native/arkweb_error_code.h +++ b/web/webview/interfaces/native/arkweb_error_code.h @@ -56,3 +56,4 @@ ARKWEB_INVALID_COOKIE_VALUE = 17100104, } ArkWeb_ErrorCode; #endif // ARKWEB_ERROR_CODE_H +/** @} */ diff --git a/web/webview/interfaces/native/arkweb_interface.h b/web/webview/interfaces/native/arkweb_interface.h index f204dab326bb68f2e8af432fdebb8bd681ac61e2..03f9f612bbe08fc5978dc50dd8734ddd976c403a 100644 --- a/web/webview/interfaces/native/arkweb_interface.h +++ b/web/webview/interfaces/native/arkweb_interface.h @@ -87,4 +87,5 @@ ArkWeb_AnyNativeAPI* OH_ArkWeb_GetNativeAPI(ArkWeb_NativeAPIVariantKind type); #ifdef __cplusplus }; #endif -#endif // ARKWEB_INTERFACE_H \ No newline at end of file +#endif // ARKWEB_INTERFACE_H +/** @} */ \ No newline at end of file diff --git a/web/webview/interfaces/native/arkweb_net_error_list.h b/web/webview/interfaces/native/arkweb_net_error_list.h index 4a579c45eee3adbf6f1c000000759bbc02c44000..feabf1440c64fa2c15eca875a9df63d555a69c0d 100644 --- a/web/webview/interfaces/native/arkweb_net_error_list.h +++ b/web/webview/interfaces/native/arkweb_net_error_list.h @@ -1402,3 +1402,4 @@ typedef enum ArkWeb_NetError { } ArkWeb_NetError; #endif // ARKWEB_NET_ERROR_LIST_H +/** @} */ diff --git a/web/webview/interfaces/native/arkweb_scheme_handler.h b/web/webview/interfaces/native/arkweb_scheme_handler.h index 4ab4b8b94be74d5abb1edaabca4c68a04d24e834..d88272e7e8e630d3f02f493c1dc4af4af1e06d58 100644 --- a/web/webview/interfaces/native/arkweb_scheme_handler.h +++ b/web/webview/interfaces/native/arkweb_scheme_handler.h @@ -672,7 +672,7 @@ void OH_ArkWeb_CreateSchemeHandler(ArkWeb_SchemeHandler** schemeHandler); /** * @brief Destroy a SchemeHandler. - * @param The ArkWeb_SchemeHandler to be destroy. + * @param schemeHandler The ArkWeb_SchemeHandler to be destroy. * * @syscap SystemCapability.Web.Webview.Core * @since 12 @@ -995,3 +995,4 @@ void OH_ArkWeb_ReleaseByteArray(uint8_t* byteArray); }; #endif #endif // ARKWEB_SCHEME_HANDLER_H +/** @} */ diff --git a/web/webview/interfaces/native/arkweb_type.h b/web/webview/interfaces/native/arkweb_type.h index e6738810a9dcfbc50cd310e370104a9826b9b9fe..206d6b5d15b7219248c71d34c49cfe206d58837b 100644 --- a/web/webview/interfaces/native/arkweb_type.h +++ b/web/webview/interfaces/native/arkweb_type.h @@ -538,4 +538,5 @@ typedef struct { #ifdef __cplusplus } #endif -#endif // ARKWEB_TYPE_H \ No newline at end of file +#endif // ARKWEB_TYPE_H +/** @} */ \ No newline at end of file diff --git a/web/webview/interfaces/native/native_interface_arkweb.h b/web/webview/interfaces/native/native_interface_arkweb.h index 48c114fce6b90828b892c8484f0bd84cc1d23b91..96b779bf4f572be5f9f493a9100db59acd4cf858 100644 --- a/web/webview/interfaces/native/native_interface_arkweb.h +++ b/web/webview/interfaces/native/native_interface_arkweb.h @@ -156,4 +156,5 @@ NativeArkWeb_OnDestroyCallback OH_NativeArkWeb_GetDestroyCallback(const char* we #ifdef __cplusplus }; #endif -#endif // NATIVE_INTERFACE_ARKWEB_H \ No newline at end of file +#endif // NATIVE_INTERFACE_ARKWEB_H +/** @} */ \ No newline at end of file