Skip to content

Get Account By Login

GetAccountByLogin

Retrieves account information by the specified login.

int GetAccountByLogin(int login, AccountRecord* account);

Parameters

  • login — integer representing the account login ID.
  • account — pointer to an AccountRecord structure where the retrieved account data will be stored.

Return Value

  • RET_OK — account found, data successfully retrieved.
  • RET_NOT_FOUND — account with the specified login does not exist.
  • RET_* — other error codes.
  • Return Codes

Example

AccountRecord acc;
if (GetAccountByLogin(1001, &acc) == RET_OK) {
    // Use data from acc
}

Warning

  • The account pointer must point to a valid, pre-allocated AccountRecord structure.
  • If an error occurs, the data in account may be invalid — always check the return code.