From 7b6b765ec2a7322e9d9bae8ecd5f7775325d5e7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?=
 =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?=
 =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= <erik@darapsa.co.id>
Date: Thu, 19 Sep 2019 18:21:30 +0800
Subject: Two ways to show user properties, the other one by integer ID

The ID-based version is not implemented yet.
---
 main.c          | 2 +-
 rtclient/user.h | 3 ++-
 user.c          | 6 +++++-
 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;
-- 
cgit v1.2.3