From a47c5c334245e2c93edd37be156d9560843deca6 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?= Date: Wed, 18 Sep 2019 07:12:18 +0800 Subject: More consistent namespace Change RT_ and rt_ to RTCLIENT_ and rtclient_ respectively --- main.c | 4 +- rtclient/client.h | 6 +- rtclient/ticket.h | 7 +- rtclient/user.h | 820 +++++++++++++++++++++++++++--------------------------- ticket.c | 14 +- user.c | 20 +- 6 files changed, 436 insertions(+), 435 deletions(-) diff --git a/main.c b/main.c index b2545b6..7ab6aff 100644 --- a/main.c +++ b/main.c @@ -28,7 +28,7 @@ int main(void) rtclient_login(name, pass); free(pass); - struct rt_user *user = NULL; + struct rtclient_user *user = NULL; rtclient_user_show(&user, name); if (user) { @@ -60,7 +60,7 @@ int main(void) , user->disabled); rtclient_user_free(user); - struct rt_ticketlist *list = NULL; + struct rtclient_ticketlist *list = NULL; static const char *prefix = "Owner='"; char query[strlen(prefix) + strlen(name) + 2]; sprintf(query, "%s%s'", prefix, name); diff --git a/rtclient/client.h b/rtclient/client.h index 5ffcce3..b132564 100644 --- a/rtclient/client.h +++ b/rtclient/client.h @@ -1,5 +1,5 @@ -#ifndef RTCLIENT_H -#define RTCLIENT_H +#ifndef RTCLIENT_CLIENT_H +#define RTCLIENT_CLIENT_H #include "user.h" #include "ticket.h" @@ -16,4 +16,4 @@ extern "C" { } #endif -#endif // RTCLIENT_H +#endif // RTCLIENT_CLIENT_H diff --git a/rtclient/ticket.h b/rtclient/ticket.h index e21508b..cd782a3 100644 --- a/rtclient/ticket.h +++ b/rtclient/ticket.h @@ -1,7 +1,7 @@ #ifndef RTCLIENT_TICKET_H #define RTCLIENT_TICKET_H -struct rt_ticketlist { +struct rtclient_ticketlist { unsigned int length; char *tickets[]; }; @@ -10,8 +10,9 @@ struct rt_ticketlist { extern "C" { #endif - void rtclient_ticket_search(struct rt_ticketlist **listptr, const char *query); - void rtclient_ticket_freelist(struct rt_ticketlist *list); + void rtclient_ticket_search(struct rtclient_ticketlist **listptr + , const char *query); + void rtclient_ticket_freelist(struct rtclient_ticketlist *list); #ifdef __cplusplus } diff --git a/rtclient/user.h b/rtclient/user.h index 9511f9f..eca7e09 100644 --- a/rtclient/user.h +++ b/rtclient/user.h @@ -3,414 +3,414 @@ #include -enum rt_lang { - RT_LANG_NONE = 0 - , RT_LANG_ar - , RT_LANG_eu - , RT_LANG_nb - , RT_LANG_bg - , RT_LANG_ca - , RT_LANG_zh_cn - , RT_LANG_zh_tw - , RT_LANG_hr - , RT_LANG_cs - , RT_LANG_da - , RT_LANG_nl - , RT_LANG_en - , RT_LANG_en_gb - , RT_LANG_et - , RT_LANG_fi - , RT_LANG_fr - , RT_LANG_de - , RT_LANG_el - , RT_LANG_hu - , RT_LANG_is - , RT_LANG_id - , RT_LANG_it - , RT_LANG_ja - , RT_LANG_lv - , RT_LANG_lt - , RT_LANG_nn - , RT_LANG_fa - , RT_LANG_pl - , RT_LANG_pt - , RT_LANG_pt_br - , RT_LANG_pt_pt - , RT_LANG_ro - , RT_LANG_ru - , RT_LANG_sr - , RT_LANG_sk - , RT_LANG_sl - , RT_LANG_es - , RT_LANG_sv - , RT_LANG_tr +enum rtclient_lang { + RTCLIENT_LANG_NONE = 0 + , RTCLIENT_LANG_ar + , RTCLIENT_LANG_eu + , RTCLIENT_LANG_nb + , RTCLIENT_LANG_bg + , RTCLIENT_LANG_ca + , RTCLIENT_LANG_zh_cn + , RTCLIENT_LANG_zh_tw + , RTCLIENT_LANG_hr + , RTCLIENT_LANG_cs + , RTCLIENT_LANG_da + , RTCLIENT_LANG_nl + , RTCLIENT_LANG_en + , RTCLIENT_LANG_en_gb + , RTCLIENT_LANG_et + , RTCLIENT_LANG_fi + , RTCLIENT_LANG_fr + , RTCLIENT_LANG_de + , RTCLIENT_LANG_el + , RTCLIENT_LANG_hu + , RTCLIENT_LANG_is + , RTCLIENT_LANG_id + , RTCLIENT_LANG_it + , RTCLIENT_LANG_ja + , RTCLIENT_LANG_lv + , RTCLIENT_LANG_lt + , RTCLIENT_LANG_nn + , RTCLIENT_LANG_fa + , RTCLIENT_LANG_pl + , RTCLIENT_LANG_pt + , RTCLIENT_LANG_pt_br + , RTCLIENT_LANG_pt_pt + , RTCLIENT_LANG_ro + , RTCLIENT_LANG_ru + , RTCLIENT_LANG_sr + , RTCLIENT_LANG_sk + , RTCLIENT_LANG_sl + , RTCLIENT_LANG_es + , RTCLIENT_LANG_sv + , RTCLIENT_LANG_tr }; -enum rt_timezone { - RT_TIMEZONE_NONE = 0 - , RT_TIMEZONE_Africa_Abidjan - , RT_TIMEZONE_Africa_Accra - , RT_TIMEZONE_Africa_Algiers - , RT_TIMEZONE_Africa_Bissau - , RT_TIMEZONE_Africa_Cairo - , RT_TIMEZONE_Africa_Casablanca - , RT_TIMEZONE_Africa_Ceuta - , RT_TIMEZONE_Africa_El_Aaiun - , RT_TIMEZONE_Africa_Johannesburg - , RT_TIMEZONE_Africa_Juba - , RT_TIMEZONE_Africa_Khartoum - , RT_TIMEZONE_Africa_Lagos - , RT_TIMEZONE_Africa_Maputo - , RT_TIMEZONE_Africa_Monrovia - , RT_TIMEZONE_Africa_Nairobi - , RT_TIMEZONE_Africa_Ndjamena - , RT_TIMEZONE_Africa_Sao_Tome - , RT_TIMEZONE_Africa_Tripoli - , RT_TIMEZONE_Africa_Tunis - , RT_TIMEZONE_Africa_Windhoek - , RT_TIMEZONE_America_Adak - , RT_TIMEZONE_America_Anchorage - , RT_TIMEZONE_America_Araguaina - , RT_TIMEZONE_America_Argentina_Buenos_Aires - , RT_TIMEZONE_America_Argentina_Catamarca - , RT_TIMEZONE_America_Argentina_Cordoba - , RT_TIMEZONE_America_Argentina_Jujuy - , RT_TIMEZONE_America_Argentina_La_Rioja - , RT_TIMEZONE_America_Argentina_Mendoza - , RT_TIMEZONE_America_Argentina_Rio_Gallegos - , RT_TIMEZONE_America_Argentina_Salta - , RT_TIMEZONE_America_Argentina_San_Juan - , RT_TIMEZONE_America_Argentina_San_Luis - , RT_TIMEZONE_America_Argentina_Tucuman - , RT_TIMEZONE_America_Argentina_Ushuaia - , RT_TIMEZONE_America_Asuncion - , RT_TIMEZONE_America_Atikokan - , RT_TIMEZONE_America_Bahia - , RT_TIMEZONE_America_Bahia_Banderas - , RT_TIMEZONE_America_Barbados - , RT_TIMEZONE_America_Belem - , RT_TIMEZONE_America_Belize - , RT_TIMEZONE_America_Blanc_Sablon - , RT_TIMEZONE_America_Boa_Vista - , RT_TIMEZONE_America_Bogota - , RT_TIMEZONE_America_Boise - , RT_TIMEZONE_America_Cambridge_Bay - , RT_TIMEZONE_America_Campo_Grande - , RT_TIMEZONE_America_Cancun - , RT_TIMEZONE_America_Caracas - , RT_TIMEZONE_America_Cayenne - , RT_TIMEZONE_America_Chicago - , RT_TIMEZONE_America_Chihuahua - , RT_TIMEZONE_America_Costa_Rica - , RT_TIMEZONE_America_Creston - , RT_TIMEZONE_America_Cuiaba - , RT_TIMEZONE_America_Curacao - , RT_TIMEZONE_America_Danmarkshavn - , RT_TIMEZONE_America_Dawson - , RT_TIMEZONE_America_Dawson_Creek - , RT_TIMEZONE_America_Denver - , RT_TIMEZONE_America_Detroit - , RT_TIMEZONE_America_Edmonton - , RT_TIMEZONE_America_Eirunepe - , RT_TIMEZONE_America_El_Salvador - , RT_TIMEZONE_America_Fort_Nelson - , RT_TIMEZONE_America_Fortaleza - , RT_TIMEZONE_America_Glace_Bay - , RT_TIMEZONE_America_Godthab - , RT_TIMEZONE_America_Goose_Bay - , RT_TIMEZONE_America_Grand_Turk - , RT_TIMEZONE_America_Guatemala - , RT_TIMEZONE_America_Guayaquil - , RT_TIMEZONE_America_Guyana - , RT_TIMEZONE_America_Halifax - , RT_TIMEZONE_America_Havana - , RT_TIMEZONE_America_Hermosillo - , RT_TIMEZONE_America_Indiana_Indianapolis - , RT_TIMEZONE_America_Indiana_Knox - , RT_TIMEZONE_America_Indiana_Marengo - , RT_TIMEZONE_America_Indiana_Petersburg - , RT_TIMEZONE_America_Indiana_Tell_City - , RT_TIMEZONE_America_Indiana_Vevay - , RT_TIMEZONE_America_Indiana_Vincennes - , RT_TIMEZONE_America_Indiana_Winamac - , RT_TIMEZONE_America_Inuvik - , RT_TIMEZONE_America_Iqaluit - , RT_TIMEZONE_America_Jamaica - , RT_TIMEZONE_America_Juneau - , RT_TIMEZONE_America_Kentucky_Louisville - , RT_TIMEZONE_America_Kentucky_Monticello - , RT_TIMEZONE_America_La_Paz - , RT_TIMEZONE_America_Lima - , RT_TIMEZONE_America_Los_Angeles - , RT_TIMEZONE_America_Maceio - , RT_TIMEZONE_America_Managua - , RT_TIMEZONE_America_Manaus - , RT_TIMEZONE_America_Martinique - , RT_TIMEZONE_America_Matamoros - , RT_TIMEZONE_America_Mazatlan - , RT_TIMEZONE_America_Menominee - , RT_TIMEZONE_America_Merida - , RT_TIMEZONE_America_Metlakatla - , RT_TIMEZONE_America_Mexico_City - , RT_TIMEZONE_America_Miquelon - , RT_TIMEZONE_America_Moncton - , RT_TIMEZONE_America_Monterrey - , RT_TIMEZONE_America_Montevideo - , RT_TIMEZONE_America_Nassau - , RT_TIMEZONE_America_New_York - , RT_TIMEZONE_America_Nipigon - , RT_TIMEZONE_America_Nome - , RT_TIMEZONE_America_Noronha - , RT_TIMEZONE_America_North_Dakota_Beulah - , RT_TIMEZONE_America_North_Dakota_Center - , RT_TIMEZONE_America_North_Dakota_New_Salem - , RT_TIMEZONE_America_Ojinaga - , RT_TIMEZONE_America_Panama - , RT_TIMEZONE_America_Pangnirtung - , RT_TIMEZONE_America_Paramaribo - , RT_TIMEZONE_America_Phoenix - , RT_TIMEZONE_America_Port_au_Prince - , RT_TIMEZONE_America_Port_of_Spain - , RT_TIMEZONE_America_Porto_Velho - , RT_TIMEZONE_America_Puerto_Rico - , RT_TIMEZONE_America_Punta_Arenas - , RT_TIMEZONE_America_Rainy_River - , RT_TIMEZONE_America_Rankin_Inlet - , RT_TIMEZONE_America_Recife - , RT_TIMEZONE_America_Regina - , RT_TIMEZONE_America_Resolute - , RT_TIMEZONE_America_Rio_Branco - , RT_TIMEZONE_America_Santarem - , RT_TIMEZONE_America_Santiago - , RT_TIMEZONE_America_Santo_Domingo - , RT_TIMEZONE_America_Sao_Paulo - , RT_TIMEZONE_America_Scoresbysund - , RT_TIMEZONE_America_Sitka - , RT_TIMEZONE_America_St_Johns - , RT_TIMEZONE_America_Swift_Current - , RT_TIMEZONE_America_Tegucigalpa - , RT_TIMEZONE_America_Thule - , RT_TIMEZONE_America_Thunder_Bay - , RT_TIMEZONE_America_Tijuana - , RT_TIMEZONE_America_Toronto - , RT_TIMEZONE_America_Vancouver - , RT_TIMEZONE_America_Whitehorse - , RT_TIMEZONE_America_Winnipeg - , RT_TIMEZONE_America_Yakutat - , RT_TIMEZONE_America_Yellowknife - , RT_TIMEZONE_Antarctica_Casey - , RT_TIMEZONE_Antarctica_Davis - , RT_TIMEZONE_Antarctica_DumontDUrville - , RT_TIMEZONE_Antarctica_Macquarie - , RT_TIMEZONE_Antarctica_Mawson - , RT_TIMEZONE_Antarctica_Palmer - , RT_TIMEZONE_Antarctica_Rothera - , RT_TIMEZONE_Antarctica_Syowa - , RT_TIMEZONE_Antarctica_Troll - , RT_TIMEZONE_Antarctica_Vostok - , RT_TIMEZONE_Asia_Almaty - , RT_TIMEZONE_Asia_Amman - , RT_TIMEZONE_Asia_Anadyr - , RT_TIMEZONE_Asia_Aqtau - , RT_TIMEZONE_Asia_Aqtobe - , RT_TIMEZONE_Asia_Ashgabat - , RT_TIMEZONE_Asia_Atyrau - , RT_TIMEZONE_Asia_Baghdad - , RT_TIMEZONE_Asia_Baku - , RT_TIMEZONE_Asia_Bangkok - , RT_TIMEZONE_Asia_Barnaul - , RT_TIMEZONE_Asia_Beirut - , RT_TIMEZONE_Asia_Bishkek - , RT_TIMEZONE_Asia_Brunei - , RT_TIMEZONE_Asia_Chita - , RT_TIMEZONE_Asia_Choibalsan - , RT_TIMEZONE_Asia_Colombo - , RT_TIMEZONE_Asia_Damascus - , RT_TIMEZONE_Asia_Dhaka - , RT_TIMEZONE_Asia_Dili - , RT_TIMEZONE_Asia_Dubai - , RT_TIMEZONE_Asia_Dushanbe - , RT_TIMEZONE_Asia_Famagusta - , RT_TIMEZONE_Asia_Gaza - , RT_TIMEZONE_Asia_Hebron - , RT_TIMEZONE_Asia_Ho_Chi_Minh - , RT_TIMEZONE_Asia_Hong_Kong - , RT_TIMEZONE_Asia_Hovd - , RT_TIMEZONE_Asia_Irkutsk - , RT_TIMEZONE_Asia_Jakarta - , RT_TIMEZONE_Asia_Jayapura - , RT_TIMEZONE_Asia_Jerusalem - , RT_TIMEZONE_Asia_Kabul - , RT_TIMEZONE_Asia_Kamchatka - , RT_TIMEZONE_Asia_Karachi - , RT_TIMEZONE_Asia_Kathmandu - , RT_TIMEZONE_Asia_Khandyga - , RT_TIMEZONE_Asia_Kolkata - , RT_TIMEZONE_Asia_Krasnoyarsk - , RT_TIMEZONE_Asia_Kuala_Lumpur - , RT_TIMEZONE_Asia_Kuching - , RT_TIMEZONE_Asia_Macau - , RT_TIMEZONE_Asia_Magadan - , RT_TIMEZONE_Asia_Makassar - , RT_TIMEZONE_Asia_Manila - , RT_TIMEZONE_Asia_Nicosia - , RT_TIMEZONE_Asia_Novokuznetsk - , RT_TIMEZONE_Asia_Novosibirsk - , RT_TIMEZONE_Asia_Omsk - , RT_TIMEZONE_Asia_Oral - , RT_TIMEZONE_Asia_Pontianak - , RT_TIMEZONE_Asia_Pyongyang - , RT_TIMEZONE_Asia_Qatar - , RT_TIMEZONE_Asia_Qostanay - , RT_TIMEZONE_Asia_Qyzylorda - , RT_TIMEZONE_Asia_Riyadh - , RT_TIMEZONE_Asia_Sakhalin - , RT_TIMEZONE_Asia_Samarkand - , RT_TIMEZONE_Asia_Seoul - , RT_TIMEZONE_Asia_Shanghai - , RT_TIMEZONE_Asia_Singapore - , RT_TIMEZONE_Asia_Srednekolymsk - , RT_TIMEZONE_Asia_Taipei - , RT_TIMEZONE_Asia_Tashkent - , RT_TIMEZONE_Asia_Tbilisi - , RT_TIMEZONE_Asia_Tehran - , RT_TIMEZONE_Asia_Thimphu - , RT_TIMEZONE_Asia_Tokyo - , RT_TIMEZONE_Asia_Tomsk - , RT_TIMEZONE_Asia_Ulaanbaatar - , RT_TIMEZONE_Asia_Urumqi - , RT_TIMEZONE_Asia_Ust_Nera - , RT_TIMEZONE_Asia_Vladivostok - , RT_TIMEZONE_Asia_Yakutsk - , RT_TIMEZONE_Asia_Yangon - , RT_TIMEZONE_Asia_Yekaterinburg - , RT_TIMEZONE_Asia_Yerevan - , RT_TIMEZONE_Atlantic_Azores - , RT_TIMEZONE_Atlantic_Bermuda - , RT_TIMEZONE_Atlantic_Canary - , RT_TIMEZONE_Atlantic_Cape_Verde - , RT_TIMEZONE_Atlantic_Faroe - , RT_TIMEZONE_Atlantic_Madeira - , RT_TIMEZONE_Atlantic_Reykjavik - , RT_TIMEZONE_Atlantic_South_Georgia - , RT_TIMEZONE_Atlantic_Stanley - , RT_TIMEZONE_Australia_Adelaide - , RT_TIMEZONE_Australia_Brisbane - , RT_TIMEZONE_Australia_Broken_Hill - , RT_TIMEZONE_Australia_Currie - , RT_TIMEZONE_Australia_Darwin - , RT_TIMEZONE_Australia_Eucla - , RT_TIMEZONE_Australia_Hobart - , RT_TIMEZONE_Australia_Lindeman - , RT_TIMEZONE_Australia_Lord_Howe - , RT_TIMEZONE_Australia_Melbourne - , RT_TIMEZONE_Australia_Perth - , RT_TIMEZONE_Australia_Sydney - , RT_TIMEZONE_CET - , RT_TIMEZONE_CST6CDT - , RT_TIMEZONE_EET - , RT_TIMEZONE_EST - , RT_TIMEZONE_EST5EDT - , RT_TIMEZONE_Europe_Amsterdam - , RT_TIMEZONE_Europe_Andorra - , RT_TIMEZONE_Europe_Astrakhan - , RT_TIMEZONE_Europe_Athens - , RT_TIMEZONE_Europe_Belgrade - , RT_TIMEZONE_Europe_Berlin - , RT_TIMEZONE_Europe_Brussels - , RT_TIMEZONE_Europe_Bucharest - , RT_TIMEZONE_Europe_Budapest - , RT_TIMEZONE_Europe_Chisinau - , RT_TIMEZONE_Europe_Copenhagen - , RT_TIMEZONE_Europe_Dublin - , RT_TIMEZONE_Europe_Gibraltar - , RT_TIMEZONE_Europe_Helsinki - , RT_TIMEZONE_Europe_Istanbul - , RT_TIMEZONE_Europe_Kaliningrad - , RT_TIMEZONE_Europe_Kiev - , RT_TIMEZONE_Europe_Kirov - , RT_TIMEZONE_Europe_Lisbon - , RT_TIMEZONE_Europe_London - , RT_TIMEZONE_Europe_Luxembourg - , RT_TIMEZONE_Europe_Madrid - , RT_TIMEZONE_Europe_Malta - , RT_TIMEZONE_Europe_Minsk - , RT_TIMEZONE_Europe_Monaco - , RT_TIMEZONE_Europe_Moscow - , RT_TIMEZONE_Europe_Oslo - , RT_TIMEZONE_Europe_Paris - , RT_TIMEZONE_Europe_Prague - , RT_TIMEZONE_Europe_Riga - , RT_TIMEZONE_Europe_Rome - , RT_TIMEZONE_Europe_Samara - , RT_TIMEZONE_Europe_Saratov - , RT_TIMEZONE_Europe_Simferopol - , RT_TIMEZONE_Europe_Sofia - , RT_TIMEZONE_Europe_Stockholm - , RT_TIMEZONE_Europe_Tallinn - , RT_TIMEZONE_Europe_Tirane - , RT_TIMEZONE_Europe_Ulyanovsk - , RT_TIMEZONE_Europe_Uzhgorod - , RT_TIMEZONE_Europe_Vienna - , RT_TIMEZONE_Europe_Vilnius - , RT_TIMEZONE_Europe_Volgograd - , RT_TIMEZONE_Europe_Warsaw - , RT_TIMEZONE_Europe_Zaporozhye - , RT_TIMEZONE_Europe_Zurich - , RT_TIMEZONE_HST - , RT_TIMEZONE_Indian_Chagos - , RT_TIMEZONE_Indian_Christmas - , RT_TIMEZONE_Indian_Cocos - , RT_TIMEZONE_Indian_Kerguelen - , RT_TIMEZONE_Indian_Mahe - , RT_TIMEZONE_Indian_Maldives - , RT_TIMEZONE_Indian_Mauritius - , RT_TIMEZONE_Indian_Reunion - , RT_TIMEZONE_MET - , RT_TIMEZONE_MST - , RT_TIMEZONE_MST7MDT - , RT_TIMEZONE_PST8PDT - , RT_TIMEZONE_Pacific_Apia - , RT_TIMEZONE_Pacific_Auckland - , RT_TIMEZONE_Pacific_Bougainville - , RT_TIMEZONE_Pacific_Chatham - , RT_TIMEZONE_Pacific_Chuuk - , RT_TIMEZONE_Pacific_Easter - , RT_TIMEZONE_Pacific_Efate - , RT_TIMEZONE_Pacific_Enderbury - , RT_TIMEZONE_Pacific_Fakaofo - , RT_TIMEZONE_Pacific_Fiji - , RT_TIMEZONE_Pacific_Funafuti - , RT_TIMEZONE_Pacific_Galapagos - , RT_TIMEZONE_Pacific_Gambier - , RT_TIMEZONE_Pacific_Guadalcanal - , RT_TIMEZONE_Pacific_Guam - , RT_TIMEZONE_Pacific_Honolulu - , RT_TIMEZONE_Pacific_Kiritimati - , RT_TIMEZONE_Pacific_Kosrae - , RT_TIMEZONE_Pacific_Kwajalein - , RT_TIMEZONE_Pacific_Majuro - , RT_TIMEZONE_Pacific_Marquesas - , RT_TIMEZONE_Pacific_Nauru - , RT_TIMEZONE_Pacific_Niue - , RT_TIMEZONE_Pacific_Norfolk - , RT_TIMEZONE_Pacific_Noumea - , RT_TIMEZONE_Pacific_Pago_Pago - , RT_TIMEZONE_Pacific_Palau - , RT_TIMEZONE_Pacific_Pitcairn - , RT_TIMEZONE_Pacific_Pohnpei - , RT_TIMEZONE_Pacific_Port_Moresby - , RT_TIMEZONE_Pacific_Rarotonga - , RT_TIMEZONE_Pacific_Tahiti - , RT_TIMEZONE_Pacific_Tarawa - , RT_TIMEZONE_Pacific_Tongatapu - , RT_TIMEZONE_Pacific_Wake - , RT_TIMEZONE_Pacific_Wallis - , RT_TIMEZONE_UTC - , RT_TIMEZONE_WET +enum rtclient_timezone { + RTCLIENT_TIMEZONE_NONE = 0 + , RTCLIENT_TIMEZONE_Africa_Abidjan + , RTCLIENT_TIMEZONE_Africa_Accra + , RTCLIENT_TIMEZONE_Africa_Algiers + , RTCLIENT_TIMEZONE_Africa_Bissau + , RTCLIENT_TIMEZONE_Africa_Cairo + , RTCLIENT_TIMEZONE_Africa_Casablanca + , RTCLIENT_TIMEZONE_Africa_Ceuta + , RTCLIENT_TIMEZONE_Africa_El_Aaiun + , RTCLIENT_TIMEZONE_Africa_Johannesburg + , RTCLIENT_TIMEZONE_Africa_Juba + , RTCLIENT_TIMEZONE_Africa_Khartoum + , RTCLIENT_TIMEZONE_Africa_Lagos + , RTCLIENT_TIMEZONE_Africa_Maputo + , RTCLIENT_TIMEZONE_Africa_Monrovia + , RTCLIENT_TIMEZONE_Africa_Nairobi + , RTCLIENT_TIMEZONE_Africa_Ndjamena + , RTCLIENT_TIMEZONE_Africa_Sao_Tome + , RTCLIENT_TIMEZONE_Africa_Tripoli + , RTCLIENT_TIMEZONE_Africa_Tunis + , RTCLIENT_TIMEZONE_Africa_Windhoek + , RTCLIENT_TIMEZONE_America_Adak + , RTCLIENT_TIMEZONE_America_Anchorage + , RTCLIENT_TIMEZONE_America_Araguaina + , RTCLIENT_TIMEZONE_America_Argentina_Buenos_Aires + , RTCLIENT_TIMEZONE_America_Argentina_Catamarca + , RTCLIENT_TIMEZONE_America_Argentina_Cordoba + , RTCLIENT_TIMEZONE_America_Argentina_Jujuy + , RTCLIENT_TIMEZONE_America_Argentina_La_Rioja + , RTCLIENT_TIMEZONE_America_Argentina_Mendoza + , RTCLIENT_TIMEZONE_America_Argentina_Rio_Gallegos + , RTCLIENT_TIMEZONE_America_Argentina_Salta + , RTCLIENT_TIMEZONE_America_Argentina_San_Juan + , RTCLIENT_TIMEZONE_America_Argentina_San_Luis + , RTCLIENT_TIMEZONE_America_Argentina_Tucuman + , RTCLIENT_TIMEZONE_America_Argentina_Ushuaia + , RTCLIENT_TIMEZONE_America_Asuncion + , RTCLIENT_TIMEZONE_America_Atikokan + , RTCLIENT_TIMEZONE_America_Bahia + , RTCLIENT_TIMEZONE_America_Bahia_Banderas + , RTCLIENT_TIMEZONE_America_Barbados + , RTCLIENT_TIMEZONE_America_Belem + , RTCLIENT_TIMEZONE_America_Belize + , RTCLIENT_TIMEZONE_America_Blanc_Sablon + , RTCLIENT_TIMEZONE_America_Boa_Vista + , RTCLIENT_TIMEZONE_America_Bogota + , RTCLIENT_TIMEZONE_America_Boise + , RTCLIENT_TIMEZONE_America_Cambridge_Bay + , RTCLIENT_TIMEZONE_America_Campo_Grande + , RTCLIENT_TIMEZONE_America_Cancun + , RTCLIENT_TIMEZONE_America_Caracas + , RTCLIENT_TIMEZONE_America_Cayenne + , RTCLIENT_TIMEZONE_America_Chicago + , RTCLIENT_TIMEZONE_America_Chihuahua + , RTCLIENT_TIMEZONE_America_Costa_Rica + , RTCLIENT_TIMEZONE_America_Creston + , RTCLIENT_TIMEZONE_America_Cuiaba + , RTCLIENT_TIMEZONE_America_Curacao + , RTCLIENT_TIMEZONE_America_Danmarkshavn + , RTCLIENT_TIMEZONE_America_Dawson + , RTCLIENT_TIMEZONE_America_Dawson_Creek + , RTCLIENT_TIMEZONE_America_Denver + , RTCLIENT_TIMEZONE_America_Detroit + , RTCLIENT_TIMEZONE_America_Edmonton + , RTCLIENT_TIMEZONE_America_Eirunepe + , RTCLIENT_TIMEZONE_America_El_Salvador + , RTCLIENT_TIMEZONE_America_Fortclient_Nelson + , RTCLIENT_TIMEZONE_America_Fortaleza + , RTCLIENT_TIMEZONE_America_Glace_Bay + , RTCLIENT_TIMEZONE_America_Godthab + , RTCLIENT_TIMEZONE_America_Goose_Bay + , RTCLIENT_TIMEZONE_America_Grand_Turk + , RTCLIENT_TIMEZONE_America_Guatemala + , RTCLIENT_TIMEZONE_America_Guayaquil + , RTCLIENT_TIMEZONE_America_Guyana + , RTCLIENT_TIMEZONE_America_Halifax + , RTCLIENT_TIMEZONE_America_Havana + , RTCLIENT_TIMEZONE_America_Hermosillo + , RTCLIENT_TIMEZONE_America_Indiana_Indianapolis + , RTCLIENT_TIMEZONE_America_Indiana_Knox + , RTCLIENT_TIMEZONE_America_Indiana_Marengo + , RTCLIENT_TIMEZONE_America_Indiana_Petersburg + , RTCLIENT_TIMEZONE_America_Indiana_Tell_City + , RTCLIENT_TIMEZONE_America_Indiana_Vevay + , RTCLIENT_TIMEZONE_America_Indiana_Vincennes + , RTCLIENT_TIMEZONE_America_Indiana_Winamac + , RTCLIENT_TIMEZONE_America_Inuvik + , RTCLIENT_TIMEZONE_America_Iqaluit + , RTCLIENT_TIMEZONE_America_Jamaica + , RTCLIENT_TIMEZONE_America_Juneau + , RTCLIENT_TIMEZONE_America_Kentucky_Louisville + , RTCLIENT_TIMEZONE_America_Kentucky_Monticello + , RTCLIENT_TIMEZONE_America_La_Paz + , RTCLIENT_TIMEZONE_America_Lima + , RTCLIENT_TIMEZONE_America_Los_Angeles + , RTCLIENT_TIMEZONE_America_Maceio + , RTCLIENT_TIMEZONE_America_Managua + , RTCLIENT_TIMEZONE_America_Manaus + , RTCLIENT_TIMEZONE_America_Martinique + , RTCLIENT_TIMEZONE_America_Matamoros + , RTCLIENT_TIMEZONE_America_Mazatlan + , RTCLIENT_TIMEZONE_America_Menominee + , RTCLIENT_TIMEZONE_America_Merida + , RTCLIENT_TIMEZONE_America_Metlakatla + , RTCLIENT_TIMEZONE_America_Mexico_City + , RTCLIENT_TIMEZONE_America_Miquelon + , RTCLIENT_TIMEZONE_America_Moncton + , RTCLIENT_TIMEZONE_America_Monterrey + , RTCLIENT_TIMEZONE_America_Montevideo + , RTCLIENT_TIMEZONE_America_Nassau + , RTCLIENT_TIMEZONE_America_New_York + , RTCLIENT_TIMEZONE_America_Nipigon + , RTCLIENT_TIMEZONE_America_Nome + , RTCLIENT_TIMEZONE_America_Noronha + , RTCLIENT_TIMEZONE_America_North_Dakota_Beulah + , RTCLIENT_TIMEZONE_America_North_Dakota_Center + , RTCLIENT_TIMEZONE_America_North_Dakota_New_Salem + , RTCLIENT_TIMEZONE_America_Ojinaga + , RTCLIENT_TIMEZONE_America_Panama + , RTCLIENT_TIMEZONE_America_Pangnirtung + , RTCLIENT_TIMEZONE_America_Paramaribo + , RTCLIENT_TIMEZONE_America_Phoenix + , RTCLIENT_TIMEZONE_America_Portclient_au_Prince + , RTCLIENT_TIMEZONE_America_Portclient_of_Spain + , RTCLIENT_TIMEZONE_America_Porto_Velho + , RTCLIENT_TIMEZONE_America_Puerto_Rico + , RTCLIENT_TIMEZONE_America_Punta_Arenas + , RTCLIENT_TIMEZONE_America_Rainy_River + , RTCLIENT_TIMEZONE_America_Rankin_Inlet + , RTCLIENT_TIMEZONE_America_Recife + , RTCLIENT_TIMEZONE_America_Regina + , RTCLIENT_TIMEZONE_America_Resolute + , RTCLIENT_TIMEZONE_America_Rio_Branco + , RTCLIENT_TIMEZONE_America_Santarem + , RTCLIENT_TIMEZONE_America_Santiago + , RTCLIENT_TIMEZONE_America_Santo_Domingo + , RTCLIENT_TIMEZONE_America_Sao_Paulo + , RTCLIENT_TIMEZONE_America_Scoresbysund + , RTCLIENT_TIMEZONE_America_Sitka + , RTCLIENT_TIMEZONE_America_St_Johns + , RTCLIENT_TIMEZONE_America_Swift_Current + , RTCLIENT_TIMEZONE_America_Tegucigalpa + , RTCLIENT_TIMEZONE_America_Thule + , RTCLIENT_TIMEZONE_America_Thunder_Bay + , RTCLIENT_TIMEZONE_America_Tijuana + , RTCLIENT_TIMEZONE_America_Toronto + , RTCLIENT_TIMEZONE_America_Vancouver + , RTCLIENT_TIMEZONE_America_Whitehorse + , RTCLIENT_TIMEZONE_America_Winnipeg + , RTCLIENT_TIMEZONE_America_Yakutat + , RTCLIENT_TIMEZONE_America_Yellowknife + , RTCLIENT_TIMEZONE_Antarctica_Casey + , RTCLIENT_TIMEZONE_Antarctica_Davis + , RTCLIENT_TIMEZONE_Antarctica_DumontDUrville + , RTCLIENT_TIMEZONE_Antarctica_Macquarie + , RTCLIENT_TIMEZONE_Antarctica_Mawson + , RTCLIENT_TIMEZONE_Antarctica_Palmer + , RTCLIENT_TIMEZONE_Antarctica_Rothera + , RTCLIENT_TIMEZONE_Antarctica_Syowa + , RTCLIENT_TIMEZONE_Antarctica_Troll + , RTCLIENT_TIMEZONE_Antarctica_Vostok + , RTCLIENT_TIMEZONE_Asia_Almaty + , RTCLIENT_TIMEZONE_Asia_Amman + , RTCLIENT_TIMEZONE_Asia_Anadyr + , RTCLIENT_TIMEZONE_Asia_Aqtau + , RTCLIENT_TIMEZONE_Asia_Aqtobe + , RTCLIENT_TIMEZONE_Asia_Ashgabat + , RTCLIENT_TIMEZONE_Asia_Atyrau + , RTCLIENT_TIMEZONE_Asia_Baghdad + , RTCLIENT_TIMEZONE_Asia_Baku + , RTCLIENT_TIMEZONE_Asia_Bangkok + , RTCLIENT_TIMEZONE_Asia_Barnaul + , RTCLIENT_TIMEZONE_Asia_Beirut + , RTCLIENT_TIMEZONE_Asia_Bishkek + , RTCLIENT_TIMEZONE_Asia_Brunei + , RTCLIENT_TIMEZONE_Asia_Chita + , RTCLIENT_TIMEZONE_Asia_Choibalsan + , RTCLIENT_TIMEZONE_Asia_Colombo + , RTCLIENT_TIMEZONE_Asia_Damascus + , RTCLIENT_TIMEZONE_Asia_Dhaka + , RTCLIENT_TIMEZONE_Asia_Dili + , RTCLIENT_TIMEZONE_Asia_Dubai + , RTCLIENT_TIMEZONE_Asia_Dushanbe + , RTCLIENT_TIMEZONE_Asia_Famagusta + , RTCLIENT_TIMEZONE_Asia_Gaza + , RTCLIENT_TIMEZONE_Asia_Hebron + , RTCLIENT_TIMEZONE_Asia_Ho_Chi_Minh + , RTCLIENT_TIMEZONE_Asia_Hong_Kong + , RTCLIENT_TIMEZONE_Asia_Hovd + , RTCLIENT_TIMEZONE_Asia_Irkutsk + , RTCLIENT_TIMEZONE_Asia_Jakarta + , RTCLIENT_TIMEZONE_Asia_Jayapura + , RTCLIENT_TIMEZONE_Asia_Jerusalem + , RTCLIENT_TIMEZONE_Asia_Kabul + , RTCLIENT_TIMEZONE_Asia_Kamchatka + , RTCLIENT_TIMEZONE_Asia_Karachi + , RTCLIENT_TIMEZONE_Asia_Kathmandu + , RTCLIENT_TIMEZONE_Asia_Khandyga + , RTCLIENT_TIMEZONE_Asia_Kolkata + , RTCLIENT_TIMEZONE_Asia_Krasnoyarsk + , RTCLIENT_TIMEZONE_Asia_Kuala_Lumpur + , RTCLIENT_TIMEZONE_Asia_Kuching + , RTCLIENT_TIMEZONE_Asia_Macau + , RTCLIENT_TIMEZONE_Asia_Magadan + , RTCLIENT_TIMEZONE_Asia_Makassar + , RTCLIENT_TIMEZONE_Asia_Manila + , RTCLIENT_TIMEZONE_Asia_Nicosia + , RTCLIENT_TIMEZONE_Asia_Novokuznetsk + , RTCLIENT_TIMEZONE_Asia_Novosibirsk + , RTCLIENT_TIMEZONE_Asia_Omsk + , RTCLIENT_TIMEZONE_Asia_Oral + , RTCLIENT_TIMEZONE_Asia_Pontianak + , RTCLIENT_TIMEZONE_Asia_Pyongyang + , RTCLIENT_TIMEZONE_Asia_Qatar + , RTCLIENT_TIMEZONE_Asia_Qostanay + , RTCLIENT_TIMEZONE_Asia_Qyzylorda + , RTCLIENT_TIMEZONE_Asia_Riyadh + , RTCLIENT_TIMEZONE_Asia_Sakhalin + , RTCLIENT_TIMEZONE_Asia_Samarkand + , RTCLIENT_TIMEZONE_Asia_Seoul + , RTCLIENT_TIMEZONE_Asia_Shanghai + , RTCLIENT_TIMEZONE_Asia_Singapore + , RTCLIENT_TIMEZONE_Asia_Srednekolymsk + , RTCLIENT_TIMEZONE_Asia_Taipei + , RTCLIENT_TIMEZONE_Asia_Tashkent + , RTCLIENT_TIMEZONE_Asia_Tbilisi + , RTCLIENT_TIMEZONE_Asia_Tehran + , RTCLIENT_TIMEZONE_Asia_Thimphu + , RTCLIENT_TIMEZONE_Asia_Tokyo + , RTCLIENT_TIMEZONE_Asia_Tomsk + , RTCLIENT_TIMEZONE_Asia_Ulaanbaatar + , RTCLIENT_TIMEZONE_Asia_Urumqi + , RTCLIENT_TIMEZONE_Asia_Ust_Nera + , RTCLIENT_TIMEZONE_Asia_Vladivostok + , RTCLIENT_TIMEZONE_Asia_Yakutsk + , RTCLIENT_TIMEZONE_Asia_Yangon + , RTCLIENT_TIMEZONE_Asia_Yekaterinburg + , RTCLIENT_TIMEZONE_Asia_Yerevan + , RTCLIENT_TIMEZONE_Atlantic_Azores + , RTCLIENT_TIMEZONE_Atlantic_Bermuda + , RTCLIENT_TIMEZONE_Atlantic_Canary + , RTCLIENT_TIMEZONE_Atlantic_Cape_Verde + , RTCLIENT_TIMEZONE_Atlantic_Faroe + , RTCLIENT_TIMEZONE_Atlantic_Madeira + , RTCLIENT_TIMEZONE_Atlantic_Reykjavik + , RTCLIENT_TIMEZONE_Atlantic_South_Georgia + , RTCLIENT_TIMEZONE_Atlantic_Stanley + , RTCLIENT_TIMEZONE_Australia_Adelaide + , RTCLIENT_TIMEZONE_Australia_Brisbane + , RTCLIENT_TIMEZONE_Australia_Broken_Hill + , RTCLIENT_TIMEZONE_Australia_Currie + , RTCLIENT_TIMEZONE_Australia_Darwin + , RTCLIENT_TIMEZONE_Australia_Eucla + , RTCLIENT_TIMEZONE_Australia_Hobart + , RTCLIENT_TIMEZONE_Australia_Lindeman + , RTCLIENT_TIMEZONE_Australia_Lord_Howe + , RTCLIENT_TIMEZONE_Australia_Melbourne + , RTCLIENT_TIMEZONE_Australia_Perth + , RTCLIENT_TIMEZONE_Australia_Sydney + , RTCLIENT_TIMEZONE_CET + , RTCLIENT_TIMEZONE_CST6CDT + , RTCLIENT_TIMEZONE_EET + , RTCLIENT_TIMEZONE_EST + , RTCLIENT_TIMEZONE_EST5EDT + , RTCLIENT_TIMEZONE_Europe_Amsterdam + , RTCLIENT_TIMEZONE_Europe_Andorra + , RTCLIENT_TIMEZONE_Europe_Astrakhan + , RTCLIENT_TIMEZONE_Europe_Athens + , RTCLIENT_TIMEZONE_Europe_Belgrade + , RTCLIENT_TIMEZONE_Europe_Berlin + , RTCLIENT_TIMEZONE_Europe_Brussels + , RTCLIENT_TIMEZONE_Europe_Bucharest + , RTCLIENT_TIMEZONE_Europe_Budapest + , RTCLIENT_TIMEZONE_Europe_Chisinau + , RTCLIENT_TIMEZONE_Europe_Copenhagen + , RTCLIENT_TIMEZONE_Europe_Dublin + , RTCLIENT_TIMEZONE_Europe_Gibraltar + , RTCLIENT_TIMEZONE_Europe_Helsinki + , RTCLIENT_TIMEZONE_Europe_Istanbul + , RTCLIENT_TIMEZONE_Europe_Kaliningrad + , RTCLIENT_TIMEZONE_Europe_Kiev + , RTCLIENT_TIMEZONE_Europe_Kirov + , RTCLIENT_TIMEZONE_Europe_Lisbon + , RTCLIENT_TIMEZONE_Europe_London + , RTCLIENT_TIMEZONE_Europe_Luxembourg + , RTCLIENT_TIMEZONE_Europe_Madrid + , RTCLIENT_TIMEZONE_Europe_Malta + , RTCLIENT_TIMEZONE_Europe_Minsk + , RTCLIENT_TIMEZONE_Europe_Monaco + , RTCLIENT_TIMEZONE_Europe_Moscow + , RTCLIENT_TIMEZONE_Europe_Oslo + , RTCLIENT_TIMEZONE_Europe_Paris + , RTCLIENT_TIMEZONE_Europe_Prague + , RTCLIENT_TIMEZONE_Europe_Riga + , RTCLIENT_TIMEZONE_Europe_Rome + , RTCLIENT_TIMEZONE_Europe_Samara + , RTCLIENT_TIMEZONE_Europe_Saratov + , RTCLIENT_TIMEZONE_Europe_Simferopol + , RTCLIENT_TIMEZONE_Europe_Sofia + , RTCLIENT_TIMEZONE_Europe_Stockholm + , RTCLIENT_TIMEZONE_Europe_Tallinn + , RTCLIENT_TIMEZONE_Europe_Tirane + , RTCLIENT_TIMEZONE_Europe_Ulyanovsk + , RTCLIENT_TIMEZONE_Europe_Uzhgorod + , RTCLIENT_TIMEZONE_Europe_Vienna + , RTCLIENT_TIMEZONE_Europe_Vilnius + , RTCLIENT_TIMEZONE_Europe_Volgograd + , RTCLIENT_TIMEZONE_Europe_Warsaw + , RTCLIENT_TIMEZONE_Europe_Zaporozhye + , RTCLIENT_TIMEZONE_Europe_Zurich + , RTCLIENT_TIMEZONE_HST + , RTCLIENT_TIMEZONE_Indian_Chagos + , RTCLIENT_TIMEZONE_Indian_Christmas + , RTCLIENT_TIMEZONE_Indian_Cocos + , RTCLIENT_TIMEZONE_Indian_Kerguelen + , RTCLIENT_TIMEZONE_Indian_Mahe + , RTCLIENT_TIMEZONE_Indian_Maldives + , RTCLIENT_TIMEZONE_Indian_Mauritius + , RTCLIENT_TIMEZONE_Indian_Reunion + , RTCLIENT_TIMEZONE_MET + , RTCLIENT_TIMEZONE_MST + , RTCLIENT_TIMEZONE_MST7MDT + , RTCLIENT_TIMEZONE_PST8PDT + , RTCLIENT_TIMEZONE_Pacific_Apia + , RTCLIENT_TIMEZONE_Pacific_Auckland + , RTCLIENT_TIMEZONE_Pacific_Bougainville + , RTCLIENT_TIMEZONE_Pacific_Chatham + , RTCLIENT_TIMEZONE_Pacific_Chuuk + , RTCLIENT_TIMEZONE_Pacific_Easter + , RTCLIENT_TIMEZONE_Pacific_Efate + , RTCLIENT_TIMEZONE_Pacific_Enderbury + , RTCLIENT_TIMEZONE_Pacific_Fakaofo + , RTCLIENT_TIMEZONE_Pacific_Fiji + , RTCLIENT_TIMEZONE_Pacific_Funafuti + , RTCLIENT_TIMEZONE_Pacific_Galapagos + , RTCLIENT_TIMEZONE_Pacific_Gambier + , RTCLIENT_TIMEZONE_Pacific_Guadalcanal + , RTCLIENT_TIMEZONE_Pacific_Guam + , RTCLIENT_TIMEZONE_Pacific_Honolulu + , RTCLIENT_TIMEZONE_Pacific_Kiritimati + , RTCLIENT_TIMEZONE_Pacific_Kosrae + , RTCLIENT_TIMEZONE_Pacific_Kwajalein + , RTCLIENT_TIMEZONE_Pacific_Majuro + , RTCLIENT_TIMEZONE_Pacific_Marquesas + , RTCLIENT_TIMEZONE_Pacific_Nauru + , RTCLIENT_TIMEZONE_Pacific_Niue + , RTCLIENT_TIMEZONE_Pacific_Norfolk + , RTCLIENT_TIMEZONE_Pacific_Noumea + , RTCLIENT_TIMEZONE_Pacific_Pago_Pago + , RTCLIENT_TIMEZONE_Pacific_Palau + , RTCLIENT_TIMEZONE_Pacific_Pitcairn + , RTCLIENT_TIMEZONE_Pacific_Pohnpei + , RTCLIENT_TIMEZONE_Pacific_Portclient_Moresby + , RTCLIENT_TIMEZONE_Pacific_Rarotonga + , RTCLIENT_TIMEZONE_Pacific_Tahiti + , RTCLIENT_TIMEZONE_Pacific_Tarawa + , RTCLIENT_TIMEZONE_Pacific_Tongatapu + , RTCLIENT_TIMEZONE_Pacific_Wake + , RTCLIENT_TIMEZONE_Pacific_Wallis + , RTCLIENT_TIMEZONE_UTC + , RTCLIENT_TIMEZONE_WET }; -struct rt_user { +struct rtclient_user { char *id; char *name; char *password; @@ -432,8 +432,8 @@ struct rt_user { char *comments; char *signature; char *gecos; - enum rt_lang lang; - enum rt_timezone timezone; + enum rtclient_lang lang; + enum rtclient_timezone timezone; bool privileged; bool disabled; }; @@ -442,7 +442,7 @@ struct rt_user { extern "C" { #endif - void rtclient_user_show(struct rt_user **userptr, const char *name); + void rtclient_user_show(struct rtclient_user **userptr, const char *name); void rtclient_user_new(const char *name , const char *password , const char *emailaddress @@ -463,11 +463,11 @@ extern "C" { , const char *comments , const char *signature , const char *gecos - , enum rt_lang lang - , enum rt_timezone timezone + , enum rtclient_lang lang + , enum rtclient_timezone timezone , bool disabled , bool privileged); - void rtclient_user_free(struct rt_user *user); + void rtclient_user_free(struct rtclient_user *user); #ifdef __cplusplus } diff --git a/ticket.c b/ticket.c index 38b7210..2751b37 100644 --- a/ticket.c +++ b/ticket.c @@ -2,7 +2,7 @@ #include "rtclient/request.h" #include "rtclient/ticket.h" -typedef struct rt_ticketlist rt_ticketlist; +typedef struct rtclient_ticketlist rtclient_ticketlist; static size_t search_callback(void *contents, size_t size, size_t nmemb , void *writedata) @@ -13,7 +13,7 @@ static size_t search_callback(void *contents, size_t size, size_t nmemb response[realsize] = '\0'; char lines[strlen(response) + 1]; strcpy(lines, response); - rt_ticketlist **listptr = (rt_ticketlist **)writedata; + rtclient_ticketlist **listptr = (rtclient_ticketlist **)writedata; char *line = strtok(response, "\n"); if (strstr(line, "200 Ok")) { @@ -22,10 +22,10 @@ static size_t search_callback(void *contents, size_t size, size_t nmemb do { (*listptr)->length++; } while ((line = strtok(NULL, "\n"))); - rt_ticketlist *ptr = realloc(*listptr, sizeof(*listptr) + rtclient_ticketlist *ptr = realloc(*listptr, sizeof(*listptr) + (*listptr)->length * sizeof(char *)); *listptr = ptr; - rt_ticketlist *list = *listptr; + rtclient_ticketlist *list = *listptr; char *linesaveptr = NULL; line = strtok_r(lines, "\n", &linesaveptr); line = strtok_r(NULL, "\n", &linesaveptr); @@ -48,14 +48,14 @@ static size_t search_callback(void *contents, size_t size, size_t nmemb return realsize; } -void rtclient_ticket_search(rt_ticketlist **listptr, const char *query) +void rtclient_ticket_search(rtclient_ticketlist **listptr, const char *query) { - *listptr = malloc(sizeof(rt_ticketlist)); + *listptr = malloc(sizeof(rtclient_ticketlist)); request("/REST/1.0/search/ticket?query=", query, search_callback , (void *)listptr, NULL); } -void rtclient_ticket_freelist(rt_ticketlist *list) +void rtclient_ticket_freelist(rtclient_ticketlist *list) { for (unsigned short i = 0; i < list->length; i++) free(list->tickets[i]); diff --git a/user.c b/user.c index cef4411..ff50319 100644 --- a/user.c +++ b/user.c @@ -2,7 +2,7 @@ #include "rtclient/request.h" #include "rtclient/user.h" -typedef struct rt_user rt_user; +typedef struct rtclient_user rtclient_user; static size_t show_callback(void *contents, size_t size, size_t nmemb , void *writedata) @@ -12,8 +12,8 @@ static size_t show_callback(void *contents, size_t size, size_t nmemb memcpy(response, contents, realsize); response[realsize] = '\0'; - rt_user **userptr = (rt_user **)writedata; - rt_user *user = *userptr; + rtclient_user **userptr = (rtclient_user **)writedata; + rtclient_user *user = *userptr; user->id = NULL; user->name = NULL; user->password = NULL; @@ -35,8 +35,8 @@ static size_t show_callback(void *contents, size_t size, size_t nmemb user->comments = NULL; user->signature = NULL; user->gecos = NULL; - user->lang = RT_LANG_NONE; - user->timezone = RT_TIMEZONE_NONE; + user->lang = RTCLIENT_LANG_NONE; + user->timezone = RTCLIENT_TIMEZONE_NONE; user->privileged = false; user->disabled = true; @@ -150,9 +150,9 @@ static size_t show_callback(void *contents, size_t size, size_t nmemb return realsize; } -void rtclient_user_show(rt_user **userptr, const char *name) +void rtclient_user_show(rtclient_user **userptr, const char *name) { - *userptr = malloc(sizeof(rt_user)); + *userptr = malloc(sizeof(rtclient_user)); request("/REST/1.0/user/", name, show_callback, (void *)userptr, NULL); } @@ -176,8 +176,8 @@ void rtclient_user_new(const char *name , const char *comments , const char *signature , const char *gecos - , enum rt_lang lang - , enum rt_timezone timezone + , enum rtclient_lang lang + , enum rtclient_timezone timezone , bool disabled , bool privileged) { @@ -279,7 +279,7 @@ void rtclient_user_new(const char *name post = NULL; } -void rtclient_user_free(rt_user *user) +void rtclient_user_free(rtclient_user *user) { if (user->id) free(user->id); -- cgit v1.2.3