MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / comp_n2n

Function comp_n2n

route.c:527–562  ·  view source on GitHub ↗

! \brief compare nr to nr */

Source from the content-addressed store, hash-verified

525
526/*! \brief compare nr to nr */
527inline static int comp_n2n(int op, int n1, int n2)
528{
529 switch(op) {
530 case EQUAL_OP:
531 case MATCH_OP:
532 case MATCHD_OP:
533 if(n1 == n2)
534 return 1;
535 return 0;
536 case NOTMATCH_OP:
537 case NOTMATCHD_OP:
538 case DIFF_OP:
539 if(n1 != n2)
540 return 1;
541 return 0;
542 case GT_OP:
543 if(n1 > n2)
544 return 1;
545 return 0;
546 case GTE_OP:
547 if(n1 >= n2)
548 return 1;
549 return 0;
550 case LT_OP:
551 if(n1 < n2)
552 return 1;
553 return 0;
554 case LTE_OP:
555 if(n1 <= n2)
556 return 1;
557 return 0;
558 default:
559 LM_CRIT("unknown op %d\n", op);
560 }
561 return -1;
562}
563
564
565static inline const char *op_id_2_string(int op_id)

Callers 1

comp_scriptvarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected