Rev 4346 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4346 | Rev 4691 | ||
|---|---|---|---|
| Line 47... | Line 47... | ||
| 47 | * not leaving garbage on the input if it does not recognize the specific |
47 | * not leaving garbage on the input if it does not recognize the specific |
| 48 | * sequence. |
48 | * sequence. |
| 49 | */ |
49 | */ |
| 50 | 50 | ||
| 51 | #include <gsp.h> |
51 | #include <gsp.h> |
| 52 | #include <libadt/hash_table.h> |
52 | #include <adt/hash_table.h> |
| 53 | #include <stdlib.h> |
53 | #include <stdlib.h> |
| 54 | #include <stdio.h> |
54 | #include <stdio.h> |
| 55 | 55 | ||
| 56 | #define TRANS_TABLE_CHAINS 256 |
56 | #define TRANS_TABLE_CHAINS 256 |
| 57 | 57 | ||
| Line 242... | Line 242... | ||
| 242 | unsigned long key[2]; |
242 | unsigned long key[2]; |
| 243 | 243 | ||
| 244 | key[0] = t->old_state; |
244 | key[0] = t->old_state; |
| 245 | key[1] = t->input; |
245 | key[1] = t->input; |
| 246 | 246 | ||
| 247 | hash_table_insert(&p->trans, &key, &t->link); |
247 | hash_table_insert(&p->trans, key, &t->link); |
| 248 | } |
248 | } |
| 249 | 249 | ||
| 250 | /** Allocate transition structure. */ |
250 | /** Allocate transition structure. */ |
| 251 | static gsp_trans_t *trans_new(void) |
251 | static gsp_trans_t *trans_new(void) |
| 252 | { |
252 | { |
| Line 274... | Line 274... | ||
| 274 | link_t *item) |
274 | link_t *item) |
| 275 | { |
275 | { |
| 276 | gsp_trans_t *t; |
276 | gsp_trans_t *t; |
| 277 | 277 | ||
| 278 | t = hash_table_get_instance(item, gsp_trans_t, link); |
278 | t = hash_table_get_instance(item, gsp_trans_t, link); |
| - | 279 | return ((key[0] == (unsigned long) t->old_state) |
|
| 279 | return (key[0] == t->old_state && key[1] == t->input); |
280 | && (key[1] == (unsigned long) t->input)); |
| 280 | } |
281 | } |
| 281 | 282 | ||
| 282 | static void trans_op_remove_callback(link_t *item) |
283 | static void trans_op_remove_callback(link_t *item) |
| 283 | { |
284 | { |
| 284 | } |
285 | } |