• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/remote_cmds-47/revnetgroup.tproj/

Lines Matching +defs:new +defs:table

101  * We mask off all but the lower 8 bits since our table array
113 /* Find an entry in the hash table (may be hanging off a linked list). */
115 lookup(struct group_entry *table[], char *key)
119 cur = table[hashkey(key)];
131 * Store an entry in the main netgroup hash table. Here's how this
132 * works: the table can only be so big when we initialize it (TABLESIZE)
134 * much larger than the table. Since our hash values are adjusted to
138 * One way to deal with this is to malloc(2) a second table and start
141 * we turn each table entry into a linked list and simply link keys
143 * the table.
148 store(struct group_entry *table[], char *key, char *data)
150 struct group_entry *new;
155 new = (struct group_entry *)malloc(sizeof(struct group_entry));
156 new->key = strdup(key);
157 new->data = strdup(data);
158 new->next = table[i];
159 table[i] = new;
167 * maintain not only the hash table of group members, each group member
170 * two things: add that member to the table (possibly hanging them
173 * an entry in the table, then we just have to do one thing, which is
177 mstore(struct member_entry *table[], char *key, char *data, char *domain)
179 struct member_entry *cur, *new;
184 cur = table[i];
190 /* Check if all we have to do is insert a new groupname. */
206 /* Didn't find a match -- add the whole mess to the table. */
207 new = (struct member_entry *)malloc(sizeof(struct member_entry));
208 new->key = strdup(key);
209 new->domain = domain ? strdup(domain) : "*";
210 new->groups = tmp;
211 new->next = table[i];
212 table[i] = new;