MQTTSuite
Loading...
Searching...
No Matches
smtp-address-validator.hpp File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool is_address (const char *p, const char *pe)

Function Documentation

◆ is_address()

bool is_address ( const char * p,
const char * pe )

Definition at line 673 of file smtp-address-validator.cpp.

674{
675 int cs = 0;
676
677 const char *eof = pe;
678
679 bool result = false;
680
681 {
682 cs = (int) address_start;
683 }
684 {
685 int _klen;
686 unsigned int _trans = 0;
687 const signed char *_keys;
688 const signed char *_acts;
689 unsigned int _nacts;
690 _resume : {
691 }
692 if (p == pe && p != eof)
693 goto _out;
694 if (p == eof) {
695 if (_address_eof_trans[cs] > 0) {
696 _trans = (unsigned int) _address_eof_trans[cs] - 1;
697 }
698 } else {
700 _trans = (unsigned int) _address_index_offsets[cs];
701
702 _klen = (int) _address_single_lengths[cs];
703 if (_klen > 0) {
704 const signed char *_lower = _keys;
705 const signed char *_upper = _keys + _klen - 1;
706 const signed char *_mid;
707 while (1) {
708 if (_upper < _lower) {
709 _keys += _klen;
710 _trans += (unsigned int) _klen;
711 break;
712 }
713
714 _mid = _lower + ((_upper - _lower) >> 1);
715 if (((*(p))) < (*(_mid)))
716 _upper = _mid - 1;
717 else if (((*(p))) > (*(_mid)))
718 _lower = _mid + 1;
719 else {
720 _trans += (unsigned int) (_mid - _keys);
721 goto _match;
722 }
723 }
724 }
725
726 _klen = (int) _address_range_lengths[cs];
727 if (_klen > 0) {
728 const signed char *_lower = _keys;
729 const signed char *_upper = _keys + (_klen << 1) - 2;
730 const signed char *_mid;
731 while (1) {
732 if (_upper < _lower) {
733 _trans += (unsigned int) _klen;
734 break;
735 }
736
737 _mid = _lower + (((_upper - _lower) >> 1) & ~1);
738 if (((*(p))) < (*(_mid)))
739 _upper = _mid - 2;
740 else if (((*(p))) > (*(_mid + 1)))
741 _lower = _mid + 2;
742 else {
743 _trans += (unsigned int) ((_mid - _keys) >> 1);
744 break;
745 }
746 }
747 }
748
749 _match : {
750 }
751 }
752 cs = (int) _address_cond_targs[_trans];
753
754 if (_address_cond_actions[_trans] != 0) {
755
756 _acts = (_address_actions + (_address_cond_actions[_trans]));
757 _nacts = (unsigned int) (*(_acts));
758 _acts += 1;
759 while (_nacts > 0) {
760 switch ((*(_acts))) {
761 case 0: {
762 {
763 result = true;
764 }
765 break;
766 }
767 case 1: {
768 {
769 result = false;
770 }
771 break;
772 }
773 }
774 _nacts -= 1;
775 _acts += 1;
776 }
777 }
778
779 if (p == eof) {
780 if (cs >= 196)
781 goto _out;
782 } else {
783 if (cs != 0) {
784 p += 1;
785 goto _resume;
786 }
787 }
788 _out : {
789 }
790 }
791 return result;
792}
static const short _address_index_offsets[]
static const short _address_eof_trans[]
static const signed char _address_range_lengths[]
static const short _address_cond_targs[]
static const short _address_key_offsets[]
static const int address_start
static const signed char _address_single_lengths[]
static const signed char _address_trans_keys[]
static const signed char _address_cond_actions[]
static const signed char _address_actions[]

References _address_actions, _address_cond_actions, _address_cond_targs, _address_eof_trans, _address_index_offsets, _address_key_offsets, _address_range_lengths, _address_single_lengths, _address_trans_keys, and address_start.

Referenced by nlohmann::json_schema::default_string_format_check().

Here is the caller graph for this function: