Aw citizen attributes by name
|Added in version 2.1|
int aw_citizen_attributes_by_name (char *name)
Returns attributes associated with a citizen name.
If you are using this method in asynchronous mode, you should check the value of AW_CITIZEN_NAME within the callback to verify that it is the same name that you queried. Note that this comparison should take into account that the name returned in AW_CITIZEN_NAME will reflect the actual case of the citizen name, which may be different from the case of the name you queried. For example, you may have specified the name "bob" in the original query, but in the callback AW_CITIZEN_NAME could be "Bob".
- Citizen name.
- RC_SUCCESS (1) (2)
- RC_NOT_INITIALIZED (1)
- RC_NO_INSTANCE (1)
- RC_NO_CONNECTION (1)
- The connection to the universe is down.
- RC_NO_SUCH_CITIZEN (2)
- RC_CALL_LIMIT_EXCEEDED (2)
- Only applies to bots that are not owned by the root account (citizen #1 - universe administrator).
(1) Possible return values when a callback is installed.
(2) Returned by the universe server.
Note that all attributes are returned only if this instance is owned by the universe root account (citizen #1 - universe administrator). Otherwise, only AW_CITIZEN_NUMBER, AW_CITIZEN_URL, AW_CITIZEN_TRIAL and AW_CITIZEN_CAV_ENABLED are returned.
if (aw_citizen_attributes_by_name ("Bob") != RC_SUCCESS) puts ("No such citizen"); else printf ("Bob's email address is %s\n", aw_string (AW_CITIZEN_EMAIL));