FireBirdLib - Topfield TMS PVR TAP Programming Library
StringEndsWith.c
Go to the documentation of this file.
1#include <string.h>
2#include "libFireBird.h"
3
4bool StringEndsWith(const char *text, const char *postfix)
5{
7
8 const char *p;
9 int l, i;
10 bool ret = FALSE;
11
12 if(!text || !*text || !postfix || !*postfix)
13 {
14 TRACEEXIT();
15 return FALSE;
16 }
17
18 l = strlen(text);
19 i = strlen(postfix);
20
21 if (l >= i)
22 {
23 p = &text[l - i];
24 ret = (memcmp(p, postfix, i) == 0);
25 }
26
27 TRACEEXIT();
28 return ret;
29}
bool StringEndsWith(const char *text, const char *postfix)
Definition: StringEndsWith.c:4
#define TRACEEXIT()
Definition: libFireBird.h:1244
#define TRACEENTER()
Definition: libFireBird.h:1243