… | |
… | |
3 | * Rights to this code are documented in doc/pod/license.pod. |
3 | * Rights to this code are documented in doc/pod/license.pod. |
4 | * |
4 | * |
5 | * Services binary tree manipulation. (add_service, del_service, et al.) |
5 | * Services binary tree manipulation. (add_service, del_service, et al.) |
6 | */ |
6 | */ |
7 | |
7 | |
8 | static char const rcsid[] = "$Id: servtree.C,v 1.4 2007/08/28 17:08:12 pippijn Exp $"; |
8 | static char const rcsid[] = "$Id: servtree.C,v 1.5 2007/08/30 19:56:26 pippijn Exp $"; |
9 | |
9 | |
10 | #include "atheme.h" |
10 | #include "atheme.h" |
11 | #include <boost/foreach.hpp> |
11 | #include <boost/foreach.hpp> |
12 | |
12 | |
13 | service_map services; |
13 | service_map services; |
… | |
… | |
107 | |
107 | |
108 | phandler->quit_sts (sptr->me, "Service unloaded."); |
108 | phandler->quit_sts (sptr->me, "Service unloaded."); |
109 | user_delete (sptr->me); |
109 | user_delete (sptr->me); |
110 | sptr->me = NULL; |
110 | sptr->me = NULL; |
111 | sptr->handler = NULL; |
111 | sptr->handler = NULL; |
112 | sfree (sptr->disp); /* service_name() does an alloc() */ |
112 | sfree (sptr->disp); /* service_name() does a salloc() */ |
113 | sfree (sptr->name); |
113 | sfree (sptr->name); |
114 | sfree (sptr->user); |
114 | sfree (sptr->user); |
115 | sfree (sptr->host); |
115 | sfree (sptr->host); |
116 | sfree (sptr->real); |
116 | sfree (sptr->real); |
117 | sfree (sptr->uid); |
117 | sfree (sptr->uid); |
… | |
… | |
170 | } |
170 | } |
171 | |
171 | |
172 | char * |
172 | char * |
173 | service_name (char const * const name) |
173 | service_name (char const * const name) |
174 | { |
174 | { |
175 | char *buf = alloc<char> (BUFSIZE); |
175 | char *buf = salloc<char> (BUFSIZE); |
176 | |
176 | |
177 | snprintf (buf, BUFSIZE, "%s%s%s", name, (config_options.secure) ? "@" : "", (config_options.secure) ? me.name : ""); |
177 | snprintf (buf, BUFSIZE, "%s%s%s", name, (config_options.secure) ? "@" : "", (config_options.secure) ? me.name : ""); |
178 | |
178 | |
179 | return buf; |
179 | return buf; |
180 | } |
180 | } |