| 463 | -------------------------------------------------------------------------*/ |
| 464 | |
| 465 | int |
| 466 | hdrtoken_tokenize_dfa(const char *string, int string_len, const char **wks_string_out) |
| 467 | { |
| 468 | int wks_idx; |
| 469 | |
| 470 | wks_idx = hdrtoken_strs_dfa->match({string, size_t(string_len)}); |
| 471 | |
| 472 | if (wks_idx < 0) { |
| 473 | wks_idx = -1; |
| 474 | } |
| 475 | if (wks_string_out) { |
| 476 | if (wks_idx >= 0) { |
| 477 | *wks_string_out = hdrtoken_index_to_wks(wks_idx); |
| 478 | } else { |
| 479 | *wks_string_out = nullptr; |
| 480 | } |
| 481 | } |
| 482 | // printf("hdrtoken_tokenize_dfa(%d,*s) - return %d\n",string_len,string,wks_idx); |
| 483 | |
| 484 | return wks_idx; |
| 485 | } |
| 486 | |
| 487 | /*------------------------------------------------------------------------- |
| 488 | Have to work around that methods are case insensitive while the DFA is |
no test coverage detected