3 #include "ace/OS_NS_string.h"
4 #include "ace/OS_Memory.h"
6 // Insert a KEY_NAME into the hash table, if it doesn't already exist
7 // there. What gets returned is a pointer to the node inserted. Note
8 // that we do our own memory allocation here...
11 HT_Server::insert (const char *key_name
, int max_len
)
13 Protocol_Record
**prpp
= 0;
17 for (prpp
= &this->hash_table
[ACE::hash_pjw (key_name
) % this->hash_table_size
];
18 *prpp
!= 0 && ACE_OS::strncmp ((*prpp
)->get_login (), key_name
, max_len
) != 0;
19 prpp
= &(*prpp
)->next_
)
24 // Remember, the server must be very careful about stuff it
25 // receives from the rwho manager, since it may not be
26 // NUL-terminated. That's why we use ACE::strnnew ()...
28 ACE_NEW_RETURN (*prpp
,
29 Protocol_Record (ACE::strnnew (key_name
,