tentacle *find(const string_array &group) {
int indy = find_index(group);
- if (negative(indy)) return NIL;
+ if (negative(indy)) return NULL_POINTER;
return borrow(indy)->_limb;
}
octopus::~octopus()
{
-// FUNCDEF("destructor");
+ FUNCDEF("destructor");
WHACK(_filters);
WHACK(_tentacles);
WHACK(_responses);
void octopus::unlock_tentacle(tentacle *to_unlock)
{
- to_unlock = NIL;
+ to_unlock = NULL_POINTER;
_molock->unlock();
}
outcome octopus::zap_tentacle(const string_array &tentacle_name)
{
- tentacle *found = NIL;
+ tentacle *found = NULL_POINTER;
outcome ret = remove_tentacle(tentacle_name, found);
WHACK(found);
return ret;
}
GRAB_LOCK;
tentacle *found = _tentacles->find(to_add->group());
- // if found is non-NIL, then that would be a serious logic error since
+ // if found is non-null, then that would be a serious logic error since
// we just zapped it above.
if (found) return tentacle::ALREADY_EXISTS;
to_add->attach_storage(*_responses);
tentacle * &free_me)
{
FUNCDEF("remove_tentacle");
- free_me = NIL;
+ free_me = NULL_POINTER;
if (!group_name.length()) return tentacle::BAD_INPUT;
while (true) {
// repeatedly grab the lock and make sure we're allowed to remove. if
free_me = freeing->_limb;
_filters->remove(free_me);
_molock->unlock();
- freeing->_limb = NIL;
+ freeing->_limb = NULL_POINTER;
WHACK(freeing);
return tentacle::OKAY;
}
#endif
periodic_cleaning(); // freshen up if it's that time.
- reformed = NIL;
+ reformed = NULL_POINTER;
if (!classifier.length()) return tentacle::BAD_INPUT;
if (!packed_form.length()) return tentacle::BAD_INPUT;
if (!classifier.length()) return tentacle::BAD_INPUT;
if (!worked) {
LOG("failed to fast_unpack the transformed data.");
} else {
- infoton *new_req = NIL;
+ infoton *new_req = NULL_POINTER;
outcome rest_ret = restore(classif, decro, new_req);
if (rest_ret == tentacle::OKAY) {
// we got a good transformed version.
void octopus::periodic_cleaning()
{
-// FUNCDEF("periodic_cleaning");
+ FUNCDEF("periodic_cleaning");
time_stamp next_time;
{
auto_synchronizer l(*_clean_lock);
tentacle *octopus::lock_tentacle(const string_array &tentacle_name)
{
- if (!tentacle_name.length()) return NIL;
+ if (!tentacle_name.length()) return NULL_POINTER;
_molock->lock();
tentacle *found = _tentacles->find(tentacle_name);
if (!found) {
_molock->unlock();
- return NIL;
+ return NULL_POINTER;
}
return found;
}