libnx
acc.h
Go to the documentation of this file.
1 /**
2  * @file acc.h
3  * @brief Account (acc:*) service IPC wrapper.
4  * @author yellows8
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "sm.h"
10 
11 typedef struct {
12  Service s;
14 
15 typedef struct
16 {
17  u32 unk_x0;
18  u32 iconID; ///< Icon ID. 0 = Mii, the rest are character icon IDs.
19  u8 iconBackgroundColorID; ///< Profile icon background color ID
20  u8 unk_x9[0x7];
21  u8 miiID[0x10]; ///< Some ID related to the Mii? All zeros when a character icon is used.
22  u8 unk_x20[0x60]; ///< Usually zeros?
24 
25 typedef struct
26 {
27  u128 userID;
28  u64 lastEditTimestamp; ///< POSIX UTC timestamp, for the last account edit.
29  char username[0x20]; ///< UTF-8 Username.
31 
32 Result accountInitialize(void);
33 void accountExit(void);
34 Service* accountGetService(void);
35 
36 /// Get the userID for the currently active user. The output userID is only valid when the output account_selected==1, otherwise no user is currently selected.
37 /// An user is only selected when the user-account selection applet was used to select an user at least once before.
38 Result accountGetActiveUser(u128 *userID, bool *account_selected);
39 
40 /// Get an AccountProfile for the specified userID.
42 
43 /// Get \ref AccountUserData and \ref AccountProfileBase for the specified profile, userdata is optional (can be NULL).
45 
46 /// Get the icon image size.
47 Result accountProfileGetImageSize(AccountProfile* profile, size_t* image_size);
48 
49 /// Load the JPEG profile icon, valid for both Miis and character icons. The output image_size is the same as the one from \ref accountProfileGetImageSize.
50 Result accountProfileLoadImage(AccountProfile* profile, void* buf, size_t len, size_t* image_size);
51 
52 void accountProfileClose(AccountProfile* profile);
#define PACKED
Packs a struct (and other types?) so it won&#39;t include padding bytes.
Definition: types.h:56
Service manager (sm) IPC wrapper.
Definition: acc.h:11
Result accountGetActiveUser(u128 *userID, bool *account_selected)
Get the userID for the currently active user.
Result accountGetProfile(AccountProfile *out, u128 userID)
Get an AccountProfile for the specified userID.
Definition: acc.h:25
u8 iconBackgroundColorID
Profile icon background color ID.
Definition: acc.h:19
u64 lastEditTimestamp
POSIX UTC timestamp, for the last account edit.
Definition: acc.h:28
Service object structure.
Definition: sm.h:23
u32 Result
Function error code result type.
Definition: types.h:46
uint8_t u8
8-bit unsigned integer.
Definition: types.h:21
Result accountProfileLoadImage(AccountProfile *profile, void *buf, size_t len, size_t *image_size)
Load the JPEG profile icon, valid for both Miis and character icons. The output image_size is the sam...
uint64_t u64
64-bit unsigned integer.
Definition: types.h:24
Result accountProfileGetImageSize(AccountProfile *profile, size_t *image_size)
Get the icon image size.
uint32_t u32
32-bit unsigned integer.
Definition: types.h:23
__uint128_t u128
128-bit unsigned integer.
Definition: types.h:25
Result accountProfileGet(AccountProfile *profile, AccountUserData *userdata, AccountProfileBase *profilebase)
Get AccountUserData and AccountProfileBase for the specified profile, userdata is optional (can be NU...
Definition: acc.h:15
u32 iconID
Icon ID. 0 = Mii, the rest are character icon IDs.
Definition: acc.h:18