qemacs-commit
[Top][All Lists]
Advanced

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

[Qemacs-commit] qemacs qe.c qe.h htmlsrc.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs qe.c qe.h htmlsrc.c
Date: Thu, 06 Mar 2014 20:36:51 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        14/03/06 20:36:50

Modified files:
        .              : qe.c qe.h htmlsrc.c 

Log message:
        extend colorize_states to 16 bits per line
        
        * extend colorize_states to 16 bits to allow for more recursive
          coloring, such as html-src -> js...
        * make htmlsrc-colorize_line public

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.c?cvsroot=qemacs&r1=1.154&r2=1.155
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.144&r2=1.145
http://cvs.savannah.gnu.org/viewcvs/qemacs/htmlsrc.c?cvsroot=qemacs&r1=1.9&r2=1.10

Patches:
Index: qe.c
===================================================================
RCS file: /sources/qemacs/qemacs/qe.c,v
retrieving revision 1.154
retrieving revision 1.155
diff -u -b -r1.154 -r1.155
--- qe.c        4 Mar 2014 10:13:14 -0000       1.154
+++ qe.c        6 Mar 2014 20:36:50 -0000       1.155
@@ -3246,9 +3246,11 @@
     /* realloc line buffer if needed */
     if ((line_num + 2) > s->colorize_nb_lines) {
         s->colorize_nb_lines = line_num + 2 + COLORIZED_LINE_PREALLOC_SIZE;
-        if (!qe_realloc(&s->colorize_states, s->colorize_nb_lines))
+        if (!qe_realloc(&s->colorize_states,
+                        s->colorize_nb_lines * sizeof(*s->colorize_states))) {
             return 0;
     }
+    }
 
     /* propagate state if needed */
     if (line_num >= s->colorize_nb_valid_lines) {

Index: qe.h
===================================================================
RCS file: /sources/qemacs/qemacs/qe.h,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -b -r1.144 -r1.145
--- qe.h        3 Mar 2014 23:35:46 -0000       1.144
+++ qe.h        6 Mar 2014 20:36:50 -0000       1.145
@@ -1083,7 +1083,7 @@
     EditBuffer *b;
 
     /* state before line n, one byte per line */
-    unsigned char *colorize_states;
+    unsigned short *colorize_states;
     int colorize_nb_lines;
     int colorize_nb_valid_lines;
     /* maximum valid offset, INT_MAX if not modified. Needed to invalide
@@ -1905,6 +1905,11 @@
 
 extern ModeDef xml_mode;
 
+/* htmlsrc.c */
+
+void htmlsrc_colorize_line(unsigned int *buf, int len,
+                           int *colorize_state_ptr, int state_only);
+
 /* html.c */
 
 extern ModeDef html_mode;

Index: htmlsrc.c
===================================================================
RCS file: /sources/qemacs/qemacs/htmlsrc.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- htmlsrc.c   10 Feb 2014 03:24:35 -0000      1.9
+++ htmlsrc.c   6 Mar 2014 20:36:50 -0000       1.10
@@ -66,7 +66,7 @@
     HTML_SCRIPT    = 0x80,      /* <SCRIPT> [...] </SCRIPT> */
 };
 
-static void htmlsrc_colorize_line(unsigned int *buf, int len,
+void htmlsrc_colorize_line(unsigned int *buf, int len,
                                   int *colorize_state_ptr, int state_only)
 {
     int c, state, js_state, l;



reply via email to

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