~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/trie.c

Merged in Jay's tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
    Inserts new key into trie.
111
111
 
112
112
  RETURN VALUE
113
 
    Upon successful completion, `trie_insert' returns `FALSE'. Otherwise
114
 
    `TRUE' is returned.
 
113
    Upon successful completion, `trie_insert' returns `false'. Otherwise
 
114
    `true' is returned.
115
115
 
116
116
  NOTES
117
117
    If this function fails you must assume `trie' is broken.
140
140
      TRIE_NODE *tmp= (TRIE_NODE *)alloc_root(&trie->mem_root,
141
141
                                              sizeof(TRIE_NODE));
142
142
      if (! tmp)
143
 
        DBUG_RETURN(TRUE);
 
143
        DBUG_RETURN(true);
144
144
      tmp->leaf= 0;
145
145
      tmp->c= p;
146
146
      tmp->links= tmp->fail= tmp->next= NULL;
163
163
  }
164
164
  node->leaf= keylen;
165
165
  trie->nwords++;
166
 
  DBUG_RETURN(FALSE);
 
166
  DBUG_RETURN(false);
167
167
}
168
168
 
169
169
 
176
176
    Constructs Aho-Corasick automaton.
177
177
 
178
178
  RETURN VALUE
179
 
    Upon successful completion, `trie_prepare' returns `FALSE'. Otherwise
180
 
    `TRUE' is returned.
 
179
    Upon successful completion, `trie_prepare' returns `false'. Otherwise
 
180
    `true' is returned.
181
181
*/
182
182
 
183
183
bool ac_trie_prepare (TRIE *trie)
191
191
 
192
192
  tmp_nodes= (TRIE_NODE **)my_malloc(trie->nnodes * sizeof(TRIE_NODE *), MYF(0));
193
193
  if (! tmp_nodes)
194
 
    DBUG_RETURN(TRUE);
 
194
    DBUG_RETURN(true);
195
195
 
196
196
  trie->root.fail= &trie->root;
197
197
  for (node= trie->root.links; node; node= node->next)
212
212
    }
213
213
  }
214
214
  my_free((uchar*)tmp_nodes, MYF(0));
215
 
  DBUG_RETURN(FALSE);
 
215
  DBUG_RETURN(false);
216
216
}
217
217
 
218
218