summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rtclient.c8
-rw-r--r--rtclient.h8
-rw-r--r--test.c8
3 files changed, 12 insertions, 12 deletions
diff --git a/rtclient.c b/rtclient.c
index ea8811a..c623c84 100644
--- a/rtclient.c
+++ b/rtclient.c
@@ -246,20 +246,20 @@ void rtclient_login(const char *name, const char *password)
post = NULL;
}
-void rtclient_userget(rt_user **userptr, const char *name)
+void rtclient_user_show(rt_user **userptr, const char *name)
{
*userptr = malloc(sizeof(rt_user));
request("/REST/1.0/user/", name, user_callback, (void *)userptr, NULL);
}
-void rtclient_ticketssearch(rt_ticketlist **listptr, const char *query)
+void rtclient_ticket_search(rt_ticketlist **listptr, const char *query)
{
*listptr = malloc(sizeof(rt_ticketlist));
request("/REST/1.0/search/ticket?query=", query, search_callback
, (void *)listptr, NULL);
}
-void rtclient_userfree(rt_user *user)
+void rtclient_user_free(rt_user *user)
{
free(user->id);
free(user->password);
@@ -286,7 +286,7 @@ void rtclient_userfree(rt_user *user)
user = NULL;
}
-void rtclient_ticketsfree(rt_ticketlist *list)
+void rtclient_ticket_freelist(rt_ticketlist *list)
{
for (unsigned short i = 0; i < list->length; i++)
free(list->tickets[i]);
diff --git a/rtclient.h b/rtclient.h
index e53591b..a872f37 100644
--- a/rtclient.h
+++ b/rtclient.h
@@ -10,10 +10,10 @@ extern "C" {
bool rtclient_init(const char *server_url);
void rtclient_login(const char *name, const char *password);
- void rtclient_userget(struct rt_user **userptr, const char *name);
- void rtclient_ticketssearch(struct rt_ticketlist **listptr, const char *query);
- void rtclient_userfree(struct rt_user *user);
- void rtclient_ticketsfree(struct rt_ticketlist *list);
+ void rtclient_user_show(struct rt_user **userptr, const char *name);
+ void rtclient_ticket_search(struct rt_ticketlist **listptr, const char *query);
+ void rtclient_ticket_freelist(struct rt_ticketlist *list);
+ void rtclient_user_free(struct rt_user *user);
void rtclient_cleanup();
#ifdef __cplusplus
diff --git a/test.c b/test.c
index 9be48dc..529da25 100644
--- a/test.c
+++ b/test.c
@@ -29,7 +29,7 @@ int main(void)
free(pass);
struct rt_user *user = NULL;
- rtclient_userget(&user, name);
+ rtclient_user_show(&user, name);
if (user) {
printf("id: %s\npassword: %s\nname: %s\nemailaddress: %s\nrealname: %s\nnickname: %s\ngecos: %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\nlang: %s\nprivileged: %d\ndisabled: %d\n"
@@ -41,19 +41,19 @@ int main(void)
, user->pagerphone, user->contactinfo, user->comments
, user->signature, user->lang, user->privileged
, user->disabled);
- rtclient_userfree(user);
+ rtclient_user_free(user);
struct rt_ticketlist *list = NULL;
static const char *prefix = "Owner='";
char query[strlen(prefix) + strlen(name) + 2];
sprintf(query, "%s%s'", prefix, name);
- rtclient_ticketssearch(&list, query);
+ rtclient_ticket_search(&list, query);
if (list) {
for (unsigned short i = 0; i < list->length; i++) {
char *ticket = list->tickets[i];
printf("Ticket %d: %s\n", i, ticket);
}
- rtclient_ticketsfree(list);
+ rtclient_ticket_freelist(list);
}
}
free(name);