comparison mcabber/src/screen.c @ 1209:47579e8c73d0

Aspell: is_alpha() isn't needed
author Mikael Berthe <mikael@lilotux.net>
date Sun, 29 Apr 2007 11:53:33 +0200
parents 0dbe51d1e62e
children 0e9e9724d643
comparison
equal deleted inserted replaced
1208:0dbe51d1e62e 1209:47579e8c73d0
60 static void scr_insert_text(const char*); 60 static void scr_insert_text(const char*);
61 static void scr_handle_tab(void); 61 static void scr_handle_tab(void);
62 62
63 #ifdef HAVE_ASPELL_H 63 #ifdef HAVE_ASPELL_H
64 static void spellcheck(char *, char *); 64 static void spellcheck(char *, char *);
65 static inline int is_alpha(const char *);
66 #endif 65 #endif
67 66
68 static GHashTable *winbufhash; 67 static GHashTable *winbufhash;
69 68
70 typedef struct { 69 typedef struct {
3281 3280
3282 line_start = line; 3281 line_start = line;
3283 3282
3284 while (*line) { 3283 while (*line) {
3285 3284
3286 if (!is_alpha(line)) { 3285 if (!iswalpha(get_char(line))) {
3287 line = next_char(line); 3286 line = next_char(line);
3288 continue; 3287 continue;
3289 } 3288 }
3290 3289
3291 if (!strncmp(line, "http://", 7)) { 3290 if (!strncmp(line, "http://", 7)) {
3306 continue; 3305 continue;
3307 } 3306 }
3308 3307
3309 start = line; 3308 start = line;
3310 3309
3311 while (is_alpha(line)) 3310 while (iswalpha(get_char(line)))
3312 line = next_char(line); 3311 line = next_char(line);
3313 3312
3314 if (spell_checker && 3313 if (spell_checker &&
3315 aspell_speller_check(spell_checker, start, line - start) == 0) 3314 aspell_speller_check(spell_checker, start, line - start) == 0)
3316 memset(&checked[start - line_start], ASPELLBADCHAR, line - start); 3315 memset(&checked[start - line_start], ASPELLBADCHAR, line - start);
3317 } 3316 }
3318 } 3317 }
3319
3320 // Universal isalpha function
3321 static inline int is_alpha(const char *c)
3322 {
3323 if (utf8_mode) {
3324 if (iswalpha(get_char(c)))
3325 return 1;
3326 } else {
3327 if (isalpha(*c))
3328 return 1;
3329 }
3330 return 0;
3331 }
3332 #endif 3318 #endif
3333 3319
3334 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ 3320 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */