FireBirdLib - Topfield TMS PVR TAP Programming Library
strlenUC.c
Go to the documentation of this file.
1#include <string.h>
2#include "libFireBird.h"
3
4int strlenUC(const byte *s)
5{
7
8 byte *p, *pEnd;
9 int Count;
10 byte BPC;
11
12 if(!s || !*s)
13 {
14 TRACEEXIT();
15 return 0;
16 }
17
18 p = SkipCharTableBytes(s);
19 pEnd = p + strlen(p);
20
21 Count = 0;
22 while(p < pEnd)
23 {
24 isUTF8Char(p, &BPC);
25 Count++;
26 p += BPC;
27 }
28
29 TRACEEXIT();
30 return Count;
31}
#define TRACEEXIT()
Definition: libFireBird.h:1244
#define TRACEENTER()
Definition: libFireBird.h:1243
byte * SkipCharTableBytes(const byte *p)
bool isUTF8Char(const byte *p, byte *BytesPerChar)
Definition: isUTF8Char.c:3
int strlenUC(const byte *s)
Definition: strlenUC.c:4