Jeff Thompson | 2e0e088 | 2013-08-12 17:55:13 -0700 | [diff] [blame^] | 1 | /** |
| 2 | * @author: Jeff Thompson |
| 3 | * See COPYING for copyright and distribution information. |
| 4 | */ |
| 5 | |
| 6 | #include "util/ndn_memory.h" |
| 7 | #include "interest.h" |
| 8 | |
| 9 | int ndn_Exclude_compareComponents(struct ndn_NameComponent *component1, struct ndn_NameComponent *component2) |
| 10 | { |
| 11 | if (component1->valueLength < component2->valueLength) |
| 12 | return -1; |
| 13 | if (component1->valueLength > component2->valueLength) |
| 14 | return 1; |
| 15 | |
| 16 | // The components are equal length. Just do a byte compare. |
| 17 | return ndn_memcmp(component1->value, component2->value, component1->valueLength); |
| 18 | } |