source: main/tags/2.80/indexers/mg/src/text/words.c@ 24541

Last change on this file since 24541 was 8694, checked in by kjdon, 19 years ago

added some changes made by Emanuel Dejanu (Simple Words)

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 917 bytes
Line 
1#include "words.h"
2
3
4/* Takes the place of the old INAWORD macro. It determines
5 whether a given place in a UTF-8 encoded Unicode string
6 is part of a word. */
7int inaword (const u_char *here, const u_char *end) {
8 unsigned short c;
9 if (parse_utf8_char(here, end, &c) > 0) return is_unicode_letdig (c);
10 return 0;
11}
12
13/* Return a the UTF-8 encoded Unicode string with begining
14 unicode spaces skipped. */
15u_char *skipspace(u_char *here, u_char *end)
16{
17 unsigned short c;
18 int length;
19 while(here != end) {
20 length = parse_utf8_char(here, end, &c);
21 if (length == 0 || !is_unicode_space(c)) break;
22 here += length;
23 }
24 return here;
25}
26
27/* It determines whether a given place in a UTF-8 encoded
28 Unicode string is a unicode space. */
29int isaspace (const u_char *here, const u_char *end)
30{
31 unsigned short c;
32 if (parse_utf8_char(here, end, &c) > 0) return is_unicode_space(c);
33 return 0;
34}
Note: See TracBrowser for help on using the repository browser.