qemacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-commit] qemacs buffer.c clang.c dired.c qe.c qe.h shell...


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs buffer.c clang.c dired.c qe.c qe.h shell...
Date: Sat, 15 Dec 2007 16:44:32 +0000

CVSROOT:        /cvsroot/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        07/12/15 16:44:32

Modified files:
        .              : buffer.c clang.c dired.c qe.c qe.h shell.c 
                         tty.c util.c win32.c xml.c 
        libqhtml       : css.c cssparse.c xmlparse.c 

Log message:
        renamed css_isxxx and css_toxxx ctype alternatives to qe_*

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/buffer.c?cvsroot=qemacs&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/qemacs/clang.c?cvsroot=qemacs&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/qemacs/dired.c?cvsroot=qemacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.c?cvsroot=qemacs&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/qemacs/shell.c?cvsroot=qemacs&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/qemacs/tty.c?cvsroot=qemacs&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/qemacs/util.c?cvsroot=qemacs&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/qemacs/win32.c?cvsroot=qemacs&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/qemacs/xml.c?cvsroot=qemacs&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/qemacs/libqhtml/css.c?cvsroot=qemacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/qemacs/libqhtml/cssparse.c?cvsroot=qemacs&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/qemacs/libqhtml/xmlparse.c?cvsroot=qemacs&r1=1.13&r2=1.14

Patches:
Index: buffer.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/buffer.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- buffer.c    15 Dec 2007 16:33:20 -0000      1.18
+++ buffer.c    15 Dec 2007 16:44:31 -0000      1.19
@@ -1522,7 +1522,7 @@
         c = eb_nextc(b, offset, &offset);
         if (c == '\n')
             return 1;
-        if (!css_isspace(c))
+        if (!qe_isspace(c))
             break;
     }
     return 0;

Index: clang.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/clang.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- clang.c     15 Dec 2007 16:33:20 -0000      1.16
+++ clang.c     15 Dec 2007 16:44:31 -0000      1.17
@@ -38,13 +38,13 @@
 
     c = *p;
     q = buf;
-    if (css_isalpha(c) || c == '_') {
+    if (qe_isalpha(c) || c == '_') {
         do {
             if ((q - buf) < buf_size - 1)
                 *q++ = c;
             p++;
             c = *p;
-        } while (css_isalnum(c) || c == '_');
+        } while (qe_isalnum(c) || c == '_');
     }
     *q = '\0';
     return q - buf;
@@ -191,14 +191,14 @@
         normal:
             if (state & C_PREPROCESS)
                 break;
-            if (css_isdigit(c)) {
-                while (css_isalnum(*p) || *p == '.') {
+            if (qe_isdigit(c)) {
+                while (qe_isalnum(*p) || *p == '.') {
                     p++;
                 }
                 set_color(p_start, p, QE_STYLE_NUMBER);
                 continue;
             }
-            if (css_isalpha(c) || c == '_') {
+            if (qe_isalpha(c) || c == '_') {
                 
                 /* XXX: should support :: and $ */
                 klen = 0;
@@ -208,14 +208,14 @@
                         kbuf[klen++] = c;
                     p++;
                     c = *p;
-                } while (css_isalnum(c) || c == '_');
+                } while (qe_isalnum(c) || c == '_');
 
                 kbuf[klen] = '\0';
                 p1 = p;
-                while (css_isblank(*p1))
+                while (qe_isblank(*p1))
                     p1++;
                 p2 = p1;
-                while (*p2 == '*' || css_isblank(*p2))
+                while (*p2 == '*' || qe_isblank(*p2))
                     p2++;
                 if (strfind(c_keywords, kbuf, 0)) {
                     set_color(p_start, p, QE_STYLE_KEYWORD);

Index: dired.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/dired.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- dired.c     15 Dec 2007 16:02:48 -0000      1.12
+++ dired.c     15 Dec 2007 16:44:31 -0000      1.13
@@ -177,7 +177,7 @@
     const char *p;
     
     for (p = sort_order; *p; p++) {
-        switch (css_tolower((unsigned char)*p)) {
+        switch (qe_tolower((unsigned char)*p)) {
         case 'n':       /* name */
             hs->sort_mode &= ~DIRED_SORT_MASK;
             hs->sort_mode |= DIRED_SORT_NAME;

Index: qe.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/qe.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- qe.c        15 Dec 2007 16:02:48 -0000      1.43
+++ qe.c        15 Dec 2007 16:44:31 -0000      1.44
@@ -439,7 +439,7 @@
         if (s->offset >= s->b->total_size)
             break;
         c = eb_nextc(s->b, s->offset, &offset1);
-        if (css_isword(c) == w)
+        if (qe_isword(c) == w)
             break;
         s->offset = offset1;
     }
@@ -453,7 +453,7 @@
         if (s->offset == 0)
             break;
         c = eb_prevc(s->b, s->offset, &offset1);
-        if (css_isword(c) == w)
+        if (qe_isword(c) == w)
             break;
         s->offset = offset1;
     }
@@ -572,7 +572,7 @@
     if (!eb_is_empty_line(s->b, offset)) {
         while (offset < par_end) {
             c = eb_nextc(s->b, offset, &offset);
-            if (!css_isspace(c))
+            if (!qe_isspace(c))
                 break;
             indent_size++;
         }
@@ -589,7 +589,7 @@
         space_size = 0;
         while (offset < par_end) {
             c = eb_nextc(s->b, offset, &offset1);
-            if (!css_isspace(c))
+            if (!qe_isspace(c))
                 break;
             offset = offset1;
             space_size++;
@@ -599,7 +599,7 @@
         word_size = 0;
         while (offset < par_end) {
             c = eb_nextc(s->b, offset, &offset1);
-            if (css_isspace(c))
+            if (qe_isspace(c))
                 break;
             offset = offset1;
             word_size++;
@@ -655,9 +655,9 @@
 
     ch = eb_nextc(b, offset, &offset1);
     if (up)
-        ch1 = css_toupper(ch);
+        ch1 = qe_toupper(ch);
     else
-        ch1 = css_tolower(ch);
+        ch1 = qe_tolower(ch);
 
     if (ch == ch1) {
         return offset1;
@@ -682,7 +682,7 @@
         if (s->offset >= s->b->total_size)
             break;
         c = eb_nextc(s->b, s->offset, NULL);
-        if (!css_isword(c))
+        if (!qe_isword(c))
             break;
         s->offset = eb_changecase(s->b, s->offset, up);
     }
@@ -3908,7 +3908,7 @@
         if (c->nb_keys == 1) {
             if (!KEY_SPECIAL(key)) {
                 if (c->is_universal_arg) {
-                    if (css_isdigit(key)) {
+                    if (qe_isdigit(key)) {
                         if (c->argval == NO_ARG)
                             c->argval = 0;
                         c->argval = c->argval * 10 + (key - '0');
@@ -5333,8 +5333,8 @@
         lower_count = 0;
         for (i = 0; i < size; i++) {
             c = buf[i];
-            lower_count += css_islower(c);
-            upper_count += css_isupper(c);
+            lower_count += qe_islower(c);
+            upper_count += qe_isupper(c);
         }
         if (lower_count > 0 && upper_count == 0)
             flags |= SEARCH_FLAG_IGNORECASE;
@@ -5344,7 +5344,7 @@
     for (i = 0; i < size; i++) {
         c = buf[i];
         if (flags & SEARCH_FLAG_IGNORECASE) 
-            buf1[i] = css_toupper(c);
+            buf1[i] = qe_toupper(c);
         else
             buf1[i] = c;
     }
@@ -5373,7 +5373,7 @@
             if (offset == 0)
                 goto word_start_found;
             eb_read(b, offset - 1, &ch, 1);
-            if (!css_isword(ch))
+            if (!qe_isword(ch))
                 goto word_start_found;
             else
                 continue;
@@ -5384,7 +5384,7 @@
         for (;;) {
             eb_read(b, offset + i, &ch, 1);
             if (flags & SEARCH_FLAG_IGNORECASE) 
-                ch = css_toupper(ch);
+                ch = qe_toupper(ch);
             if (ch != buf1[i])
                     break;
             i++;
@@ -5394,7 +5394,7 @@
                     if (offset + size >= total_size)
                         goto word_end_found;
                     eb_read(b, offset + size, &ch, 1);
-                    if (!css_isword(ch))
+                    if (!qe_isword(ch))
                         goto word_end_found;
                     break;
                 }

Index: qe.h
===================================================================
RCS file: /cvsroot/qemacs/qemacs/qe.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- qe.h        15 Dec 2007 16:33:20 -0000      1.36
+++ qe.h        15 Dec 2007 16:44:31 -0000      1.37
@@ -160,41 +160,41 @@
 void splitpath(char *dirname, int dirname_size,
                char *filename, int filename_size, const char *pathname);
 
-static inline int css_isspace(int ch) {
+static inline int qe_isspace(int ch) {
     /* CG: what about \v and \f */
     return (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r');
 }
-static inline int css_isblank(int ch) {
+static inline int qe_isblank(int ch) {
     return (ch == ' ' || ch == '\t');
 }
-static inline int css_isdigit(int ch) {
+static inline int qe_isdigit(int ch) {
     return (ch >= '0' && ch <= '9');
 }
-static inline int css_isupper(int ch) {
+static inline int qe_isupper(int ch) {
     return (ch >= 'A' && ch <= 'Z');
 }
-static inline int css_islower(int ch) {
+static inline int qe_islower(int ch) {
     return (ch >= 'a' && ch <= 'z');
 }
-static inline int css_isalpha(int ch) {
+static inline int qe_isalpha(int ch) {
     return ((ch | ('a' - 'A')) >= 'a' && (ch | ('a' - 'A')) <= 'z');
 }
-static inline int css_isxdigit(int ch) {
+static inline int qe_isxdigit(int ch) {
     return ((ch >= '0' && ch <= '9') ||
             ((ch | ('a' - 'A')) >= 'a' && (ch | ('a' - 'A')) <= 'f'));
 }
-static inline int css_isalnum(int ch) {
+static inline int qe_isalnum(int ch) {
     return ((ch >= '0' && ch <= '9') ||
             ((ch | ('a' - 'A')) >= 'a' && (ch | ('a' - 'A')) <= 'z'));
 }
-static inline int css_isword(int c) {
+static inline int qe_isword(int c) {
     /* XXX: any unicode char >= 128 is considered as word. */
-    return css_isalnum(c) || (c == '_') || (c >= 128);
+    return qe_isalnum(c) || (c == '_') || (c >= 128);
 }
-static inline int css_toupper(int ch) {
+static inline int qe_toupper(int ch) {
     return (ch >= 'a' && ch <= 'z') ? ch + 'A' - 'a' : ch;
 }
-static inline int css_tolower(int ch) {
+static inline int qe_tolower(int ch) {
     return (ch >= 'A' && ch <= 'Z') ? ch + 'a' - 'A' : ch;
 }
 

Index: shell.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/shell.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- shell.c     15 Dec 2007 16:02:47 -0000      1.27
+++ shell.c     15 Dec 2007 16:44:31 -0000      1.28
@@ -750,7 +750,7 @@
             s->esc1 = c;
             break;
         }
-        if (css_isdigit(c)) {
+        if (qe_isdigit(c)) {
             if (s->nb_esc_params < MAX_ESC_PARAMS) {
                 if (!s->has_params[s->nb_esc_params]) {
                     s->esc_params[s->nb_esc_params] = 0;
@@ -1356,7 +1356,7 @@
             c = eb_nextc(b, offset, &offset);
             if (c == ':')
                 break;
-            if (!css_isdigit(c))
+            if (!qe_isdigit(c))
                 goto next_line;
             line_num = line_num * 10 + c - '0';
         }

Index: tty.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/tty.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- tty.c       15 Dec 2007 16:02:47 -0000      1.25
+++ tty.c       15 Dec 2007 16:44:31 -0000      1.26
@@ -412,7 +412,7 @@
         }
         break;
     case IS_CSI:
-        if (css_isdigit(ch)) {
+        if (qe_isdigit(ch)) {
             ts->input_param = ts->input_param * 10 + ch - '0';
             break;
         }

Index: util.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/util.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- util.c      15 Dec 2007 16:02:48 -0000      1.25
+++ util.c      15 Dec 2007 16:44:31 -0000      1.26
@@ -359,7 +359,7 @@
     const char *p;
 
     p = *pp;
-    while (css_isspace(*p))
+    while (qe_isspace(*p))
         p++;
     *pp = p;
 }
@@ -380,7 +380,7 @@
     p = str;
     q = val;
     while (*q != '\0') {
-        if (css_toupper((unsigned char)*p) != css_toupper((unsigned char)*q)) {
+        if (qe_toupper((unsigned char)*p) != qe_toupper((unsigned char)*q)) {
             return 0;
         }
         p++;
@@ -408,7 +408,7 @@
     p = str;
     q = val;
     while (*q != '\0') {
-        if (css_toupper((unsigned char)*p) != css_toupper((unsigned char)*q)) {
+        if (qe_toupper((unsigned char)*p) != qe_toupper((unsigned char)*q)) {
             if (*p == '-' || *p == '_' || *p == ' ') {
                 p++;
                 continue;
@@ -443,7 +443,7 @@
     p = str1;
     q = str2;
     for (;;) {
-        d = css_toupper((unsigned char)*p) - css_toupper((unsigned char)*q);
+        d = qe_toupper((unsigned char)*p) - qe_toupper((unsigned char)*q);
         if (d) {
             if (*p == '-' || *p == '_' || *p == ' ') {
                 p++;
@@ -471,7 +471,7 @@
     p = str;
     q = val;
     while (*q != '\0') {
-        if (css_toupper(*p) != css_toupper(*q))
+        if (qe_toupper(*p) != qe_toupper(*q))
             return 0;
         p++;
         q++;
@@ -496,7 +496,7 @@
     for (;;) {
         c = *p;
         /* Should stop on spaces and eat them */
-        if (c == '\0' || css_isspace(c) || strchr(stop, c))
+        if (c == '\0' || qe_isspace(c) || strchr(stop, c))
             break;
         if ((q - buf) < buf_size - 1)
             *q++ = c;
@@ -607,7 +607,7 @@
     if (p[0] == 'f' && p[1] >= '1' && p[1] <= '9') {
         i = p[1] - '0';
         p += 2;
-        if (css_isdigit(*p))
+        if (qe_isdigit(*p))
             i = i * 10 + *p++ - '0';
         key = KEY_F1 + i - 1;
         *pp = p1;
@@ -700,7 +700,7 @@
 
 int to_hex(int key)
 {
-    if (css_isdigit(key))
+    if (qe_isdigit(key))
         return key - '0';
     else if (key >= 'a' && key <= 'f')
         return key - 'a' + 10;
@@ -827,7 +827,7 @@
     }
     
     rgba[3] = 0xff;
-    if (css_isxdigit((unsigned char)*p)) {
+    if (qe_isxdigit((unsigned char)*p)) {
         goto parse_num;
     } else if (*p == '#') {
         /* handle '#' notation */
@@ -925,7 +925,7 @@
 
     /* XXX: handle unicode / utf8 */
     while ((c = (unsigned char)*buf) != '\0') {
-        *buf++ = css_tolower(c);
+        *buf++ = qe_tolower(c);
     }
 }
 

Index: win32.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/win32.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- win32.c     15 Dec 2007 16:02:47 -0000      1.9
+++ win32.c     15 Dec 2007 16:44:31 -0000      1.10
@@ -72,7 +72,7 @@
         skip_spaces((const char **)&p);
         if (*p == '\0')
             break;
-        while (*p != '\0' && !css_isspace(*p))
+        while (*p != '\0' && !qe_isspace(*p))
             p++;
         count++;
     }
@@ -88,7 +88,7 @@
         if (*p == '\0')
             break;
         argv[argc++] = p;
-        while (*p != '\0' && !css_isspace(*p))
+        while (*p != '\0' && !qe_isspace(*p))
             p++;
         *p = '\0';
         p++;

Index: xml.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/xml.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- xml.c       15 Dec 2007 16:02:47 -0000      1.8
+++ xml.c       15 Dec 2007 16:44:31 -0000      1.9
@@ -165,13 +165,13 @@
     const char *p;
 
     p = (const char *)p1->buf;
-    while (css_isspace((unsigned char)*p))
+    while (qe_isspace((unsigned char)*p))
         p++;
     if (*p != '<')
         return 0;
     p++;
     if (*p != '!' && *p != '?' && *p != '/' && 
-        !css_isalpha((unsigned char)*p))
+        !qe_isalpha((unsigned char)*p))
         return 0;
     return 90; /* leave some room for more specific XML parser */
 }

Index: libqhtml/css.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/libqhtml/css.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- libqhtml/css.c      15 Dec 2007 16:02:48 -0000      1.12
+++ libqhtml/css.c      15 Dec 2007 16:44:32 -0000      1.13
@@ -2314,7 +2314,7 @@
                         break;
                 }
 
-                space = css_isspace(ch);
+                space = qe_isspace(ch);
                 /* collapse spaces if needed */
                 if (space && s->last_space &&
                     (props->white_space == CSS_WHITE_SPACE_NORMAL ||
@@ -3709,7 +3709,7 @@
         c = nextc(s->b, &offset);
         if (c == CSS_CONTENT_EOL)
             continue;
-        space = css_isspace(c);
+        space = qe_isspace(c);
         if (space_collapse) {
             if (last_space && space)
                 continue;

Index: libqhtml/cssparse.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/libqhtml/cssparse.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- libqhtml/cssparse.c 15 Dec 2007 16:02:48 -0000      1.10
+++ libqhtml/cssparse.c 15 Dec 2007 16:44:32 -0000      1.11
@@ -61,11 +61,11 @@
     p1 = p;
     if (*p == '+' || *p == '-')
         p++;
-    while (css_isdigit(*p))
+    while (qe_isdigit(*p))
         p++;
     if (*p == '.') {
         p++;
-        while (css_isdigit(*p))
+        while (qe_isdigit(*p))
             p++;
     }
     len = p - p1;
@@ -730,7 +730,7 @@
     c = *ch_ptr;
     q = ident;
     for (;;) {
-        if (!(css_isalnum(c) || c == '*' || c == '_' || c == '-'))
+        if (!(qe_isalnum(c) || c == '*' || c == '_' || c == '-'))
             break;
         if ((q - ident) < ident_size - 1)
             *q++ = c;
@@ -745,7 +745,7 @@
     int c;
 
     c = *ch_ptr;
-    while (css_isspace(c))
+    while (qe_isspace(c))
         c = bgetc(b);
     *ch_ptr = c;
 }
@@ -1058,7 +1058,7 @@
                     ch = bgetc(b);
                     goto add_tree;
                 } else
-                if (css_isalpha(ch)) {
+                if (qe_isalpha(ch)) {
                     tree_op = CSS_TREE_OP_DESCENDANT;
                 add_tree:
                     ss1 = qe_malloc_dup(ss, sizeof(CSSSimpleSelector));

Index: libqhtml/xmlparse.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/libqhtml/xmlparse.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- libqhtml/xmlparse.c 15 Dec 2007 16:02:48 -0000      1.13
+++ libqhtml/xmlparse.c 15 Dec 2007 16:44:32 -0000      1.14
@@ -1045,7 +1045,7 @@
     int d;
 
     while (*s2) {
-        d = (unsigned char)*s2 - css_tolower((unsigned char)*s1);
+        d = (unsigned char)*s2 - qe_tolower((unsigned char)*s1);
         if (d)
             return d;
         s2++;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]