• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  * @addtogroup OsAccount
18  * @{
19  *
20  * @brief Provide the definition of the C interface for the native OsAccount.
21  * @since 12
22  */
23 
24 /**
25  * @file os_account.h
26  *
27  * @brief Declares the APIs for accessing and managing the OS account information.
28  * @library libos_account_ndk.so
29  * @kit BasicServicesKit
30  * @syscap SystemCapability.Account.OsAccount
31  * @since 12
32  */
33 
34 #ifndef OS_ACCOUNT_H
35 #define OS_ACCOUNT_H
36 
37 #include <stddef.h>
38 #include "os_account_common.h"
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 /**
45  * @brief Gets the name of the OS account to which the caller process belongs.
46  *
47  * @param buffer The name character array which should have space for the name and the terminating character ('\0').
48  * @param buffer_size The size of the name character array.
49  * @return {@link OS_ACCOUNT_ERR_OK} Indicates successful;<br>
50  *         {@link OS_ACCOUNT_ERR_INTERNAL_ERROR} Indicates the internal error.<br>
51  *         {@link OS_ACCOUNT_ERR_INVALID_PARAMETER} Indicates the <i>buffer</i> is NULL pointer or the size of the name,
52  *         including the terminating character ('\0'), is larger than <i>buffer_size</i>;
53  * @syscap SystemCapability.Account.OsAccount
54  * @since 12
55  */
56 OsAccount_ErrCode OH_OsAccount_GetName(char *buffer, size_t buffer_size);
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 /** @} */
63 
64 #endif // OS_ACCOUNT_H
65