summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-19 18:21:30 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-19 18:21:30 +0800
commit7b6b765ec2a7322e9d9bae8ecd5f7775325d5e7f (patch)
treec68fdb77f6bfb2bb8094b19b1b5741e62d821895
parentb339eebaefeb28ec6b9e4cac612b2f7777f21eb1 (diff)
Two ways to show user properties, the other one by integer ID
The ID-based version is not implemented yet.
-rw-r--r--main.c2
-rw-r--r--rtclient/user.h3
-rw-r--r--user.c6
3 files changed, 8 insertions, 3 deletions
diff --git a/main.c b/main.c
index 7ab6aff..adf3dfb 100644
--- a/main.c
+++ b/main.c
@@ -29,7 +29,7 @@ int main(void)
free(pass);
struct rtclient_user *user = NULL;
- rtclient_user_show(&user, name);
+ rtclient_user_showname(&user, name);
if (user) {
printf("id: %s\nname: %s\npassword: %s\nemailaddress: %s\nrealname: %s\nnickname: %s\norganization: %s\naddress1: %s\naddress2: %s\ncity: %s\nstate: %s\nzip: %s\ncountry: %s\nhomephone: %s\nworkphone: %s\nmobilephone: %s\npagerphone: %s\ncontactinfo: %s\ncomments: %s\nsignature: %s\ngecos: %s\nlang: %d\ntimezone: %d\nprivileged: %d\ndisabled: %d\n"
diff --git a/rtclient/user.h b/rtclient/user.h
index 9058d02..e9768a6 100644
--- a/rtclient/user.h
+++ b/rtclient/user.h
@@ -466,7 +466,8 @@ extern "C" {
, enum rtclient_timezone timezone
, bool disabled
, bool privileged);
- void rtclient_user_show(struct rtclient_user **userptr, const char *name);
+ void rtclient_user_showid(struct rtclient_user **userptr, unsigned int id);
+ void rtclient_user_showname(struct rtclient_user **userptr, const char *name);
void rtclient_user_free(struct rtclient_user *user);
#ifdef __cplusplus
diff --git a/user.c b/user.c
index 1edfe74..7cad6ee 100644
--- a/user.c
+++ b/user.c
@@ -174,7 +174,11 @@ static size_t show_callback(void *contents, size_t size, size_t nmemb
return realsize;
}
-void rtclient_user_show(rtclient_user **userptr, const char *name)
+void rtclient_user_showid(rtclient_user **userptr, unsigned int id)
+{
+}
+
+void rtclient_user_showname(rtclient_user **userptr, const char *name)
{
*userptr = malloc(sizeof(rtclient_user));
rtclient_user *user = *userptr;