![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
Diff: utils.cpp
- Revision:
- 78:1353744f01e1
- Parent:
- 74:81c47fff88a5
- Child:
- 81:3656f00ab3db
--- a/utils.cpp Tue Nov 25 18:43:01 2014 +0000 +++ b/utils.cpp Tue Dec 16 12:13:01 2014 +0000 @@ -57,11 +57,21 @@ *dest = 0; } -void xmemcpy(uint8_t * dest, uint8_t * src, uint16_t size ){ +void xmemcpy(uint8_t * dest, const uint8_t * src, uint16_t size ){ while (size--) *dest++ = *src++; } void xmemcpy32(uint32_t * dest, uint32_t * src, uint16_t size){ size >>= 2; while (size--) *dest++ = *src++; +} + +uint8_t xstrmatch(const uint8_t * s1, const uint8_t * s2){ + while (*s1) { + if (*s1++ != *s2++) return 0; /* does not match */ + } + if ( *s2 == 0 ) + return 1; /* matches */ + else + return 0; /* does not match */ } \ No newline at end of file