From: John Hodge Date: Fri, 21 Mar 2014 13:40:44 +0000 (+0800) Subject: Itemdb - Add 'membership' pseudo item type X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=a3ef38a0e3c7869bac3da397a56330ed61d26cb3;p=tpg%2Fopendispense2.git Itemdb - Add 'membership' pseudo item type --- diff --git a/src/server/itemdb.c b/src/server/itemdb.c index 06c8257..5b2d828 100644 --- a/src/server/itemdb.c +++ b/src/server/itemdb.c @@ -34,7 +34,11 @@ char *trim(char *__str); tItem *gaItems = NULL; time_t gItems_LastUpdated; tHandler gPseudo_Handler = {.Name="pseudo"}; -tHandler *gaHandlers[] = {&gPseudo_Handler, &gCoke_Handler, &gSnack_Handler, &gDoor_Handler}; +tHandler gMembership_Handler = {.Name="membership"}; +tHandler *gaHandlers[] = { + &gPseudo_Handler, &gMembership_Handler, + &gCoke_Handler, &gSnack_Handler, &gDoor_Handler + }; int giNumHandlers = sizeof(gaHandlers)/sizeof(gaHandlers[0]); char *gsItemListFile = DEFAULT_ITEM_FILE; #if USE_INOTIFY @@ -45,8 +49,7 @@ regex_t gItemFile_Regex; // === CODE === void Init_Handlers() { - int i; - for( i = 0; i < giNumHandlers; i ++ ) + for( int i = 0; i < giNumHandlers; i ++ ) { if( gaHandlers[i]->Init ) gaHandlers[i]->Init(0, NULL); // TODO: Arguments