[freenos] r359 committed - Synchronized libteken with FreeBSD revision 196863.

  • From: codesite-noreply@xxxxxxxxxx
  • To: freenos@xxxxxxxxxxxxx
  • Date: Sat, 05 Sep 2009 17:54:53 +0000

Revision: 359
Author: nieklinnenbank
Date: Sat Sep  5 10:50:50 2009
Log: Synchronized libteken with FreeBSD revision 196863.

http://code.google.com/p/freenos/source/detail?r=359

Modified:
 /trunk/lib/libteken/gensequences
 /trunk/lib/libteken/sequences
 /trunk/lib/libteken/teken.c
 /trunk/lib/libteken/teken.h
 /trunk/lib/libteken/teken_scs.h
 /trunk/lib/libteken/teken_subr.h
 /trunk/lib/libteken/teken_subr_compat.h
 /trunk/lib/libteken/teken_wcwidth.h

=======================================
--- /trunk/lib/libteken/gensequences    Thu Apr  9 14:46:04 2009
+++ /trunk/lib/libteken/gensequences    Sat Sep  5 10:50:50 2009
@@ -25,7 +25,7 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $FreeBSD: head/sys/dev/syscons/teken/gensequences 186681 2009-01-01 13:26:53Z ed $
+# $FreeBSD$

 function die(msg) {
        print msg;
=======================================
--- /trunk/lib/libteken/sequences       Thu Apr  9 14:46:04 2009
+++ /trunk/lib/libteken/sequences       Sat Sep  5 10:50:50 2009
@@ -23,7 +23,7 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $FreeBSD: head/sys/dev/syscons/teken/sequences 187469 2009-01-20 11:34:28Z ed $
+# $FreeBSD$

 # File format is as follows:
 #      Abbr            Abbreviation of sequence name
@@ -102,6 +102,7 @@
 # Cons25 compatibility sequences
 C25ADBG        Cons25 set adapter background           ^[ [ = G        r
 C25ADFG        Cons25 set adapter foreground           ^[ [ = F        r
+C25BLPD        Cons25 set bell pitch duration          ^[ [ = B        r r
 C25CURS        Cons25 set cursor type                  ^[ [ = S        r
 C25VTSW        Cons25 switch virtual terminal          ^[ [ z          r

=======================================
--- /trunk/lib/libteken/teken.c Sat Jun 27 15:52:58 2009
+++ /trunk/lib/libteken/teken.c Sat Sep  5 10:50:50 2009
@@ -23,34 +23,22 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: head/sys/dev/syscons/teken/teken.c 190157 2009-03-20 14:31:08Z ed $
+ * $FreeBSD$
  */

-#if defined(__FreeBSD__) && defined(_KERNEL)
-#include <sys/param.h>
-#include <sys/lock.h>
-#include <sys/systm.h>
-#define        teken_assert(x)         MPASS(x)
-#define        teken_printf(x,...)
-#else /* !(__FreeBSD__ && _KERNEL) */
-#include <sys/types.h>
 #define __unused __attribute((unused))
+#include <sys/types.h>
+#include <Assert.h>
 #include <stdio.h>
 #include <string.h>
-#include <Assert.h>
 #define        teken_assert(x)         assert(x)
-/*
- #define       teken_printf(x,...)     do { \
+#define        teken_printf(x,...)     do { \
        if (df != NULL) \
-               fprintf(df, x, ## __VA_ARGS__); \
- } while (0)
- */
-#define teken_printf(x,...) \
-    printf(x, ## __VA_ARGS__);
+               printf(x, ## __VA_ARGS__); \
+} while (0)

 /* debug messages */
-//static FILE *df;
-#endif /* __FreeBSD__ && _KERNEL */
+static FILE *df;

 #include "teken.h"

@@ -74,9 +62,6 @@
 #define        teken_scs_switch(t, g)
 #endif /* TEKEN_XTERM && TEKEN_UTF8 */

-/* Private flags for teken_format_t. */
-#define        TF_REVERSE      0x08
-
 /* Private flags for t_stateflags. */
 #define        TS_FIRSTDIGIT   0x01    /* First numeric digit in escape 
sequence. */
 #define        TS_INSERT       0x02    /* Insert mode. */
@@ -118,18 +103,9 @@
 teken_funcs_putchar(teken_t *t, const teken_pos_t *p, teken_char_t c,
     const teken_attr_t *a)
 {
-       teken_attr_t ta;

        teken_assert(p->tp_row < t->t_winsize.tp_row);
        teken_assert(p->tp_col < t->t_winsize.tp_col);
-
-       /* Apply inversion. */
-       if (a->ta_format & TF_REVERSE) {
-               ta.ta_format = a->ta_format;
-               ta.ta_fgcolor = a->ta_bgcolor;
-               ta.ta_bgcolor = a->ta_fgcolor;
-               a = &ta;
-       }

        t->t_funcs->tf_putchar(t->t_softc, p, c, a);
 }
@@ -138,20 +114,11 @@
 teken_funcs_fill(teken_t *t, const teken_rect_t *r,
     const teken_char_t c, const teken_attr_t *a)
 {
-       teken_attr_t ta;

        teken_assert(r->tr_end.tp_row > r->tr_begin.tp_row);
        teken_assert(r->tr_end.tp_row <= t->t_winsize.tp_row);
        teken_assert(r->tr_end.tp_col > r->tr_begin.tp_col);
        teken_assert(r->tr_end.tp_col <= t->t_winsize.tp_col);
-
-       /* Apply inversion. */
-       if (a->ta_format & TF_REVERSE) {
-               ta.ta_format = a->ta_format;
-               ta.ta_fgcolor = a->ta_bgcolor;
-               ta.ta_bgcolor = a->ta_fgcolor;
-               a = &ta;
-       }

        t->t_funcs->tf_fill(t->t_softc, r, c, a);
 }
@@ -171,7 +138,7 @@
 }

 static inline void
-teken_funcs_param(teken_t *t, int cmd, int value)
+teken_funcs_param(teken_t *t, int cmd, unsigned int value)
 {

        t->t_funcs->tf_param(t->t_softc, cmd, value);
@@ -196,12 +163,6 @@
 {
        teken_pos_t tp = { .tp_row = 24, .tp_col = 80 };

-#if 0 && !(defined(__FreeBSD__) && defined(_KERNEL))
-       df = fopen("teken.log", "w");
-       if (df != NULL)
-               setvbuf(df, NULL, _IOLBF, BUFSIZ);
-#endif /* !(__FreeBSD__ && _KERNEL) */
-
        t->t_funcs = tf;
        t->t_softc = softc;

@@ -304,7 +265,7 @@
                t->t_utf8_left--;
                t->t_utf8_partial = (t->t_utf8_partial << 6) | (c & 0x3f);
                if (t->t_utf8_left == 0) {
-                       teken_printf("Got UTF-8 char %u\n", t->t_utf8_partial);
+                       teken_printf("Got UTF-8 char %x\n", t->t_utf8_partial);
                        teken_input_char(t, t->t_utf8_partial);
                }
        }
=======================================
--- /trunk/lib/libteken/teken.h Mon Jun  1 15:41:52 2009
+++ /trunk/lib/libteken/teken.h Sat Sep  5 10:50:50 2009
@@ -23,17 +23,11 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: head/sys/dev/syscons/teken/teken.h 189617 2009-03-10 11:28:54Z ed $
+ * $FreeBSD$
  */

 #ifndef _TEKEN_H_
 #define        _TEKEN_H_
-#ifndef __ASSEMBLER__
-
-/**
- * @defgroup libteken libteken
- * @{
- */

 /*
  * libteken: terminal emulation library.
@@ -59,6 +53,7 @@
 #define        TF_BOLD         0x01
 #define        TF_UNDERLINE    0x02
 #define        TF_BLINK        0x04
+#define        TF_REVERSE      0x08
 typedef unsigned char teken_color_t;
 #define        TC_BLACK        0
 #define        TC_RED          1
@@ -103,13 +98,16 @@
 typedef void tf_fill_t(void *, const teken_rect_t *, teken_char_t,
     const teken_attr_t *);
 typedef void tf_copy_t(void *, const teken_rect_t *, const teken_pos_t *);
-typedef void tf_param_t(void *, int, int);
+typedef void tf_param_t(void *, int, unsigned int);
 #define        TP_SHOWCURSOR   0
 #define        TP_CURSORKEYS   1
 #define        TP_KEYPADAPP    2
 #define        TP_AUTOREPEAT   3
 #define        TP_SWITCHVT     4
 #define        TP_132COLS      5
+#define        TP_SETBELLPD    6
+#define        TP_SETBELLPD_PITCH(pd)          ((pd) >> 16)
+#define        TP_SETBELLPD_DURATION(pd)       ((pd) & 0xffff)
 typedef void tf_respond_t(void *, const void *, size_t);

 typedef struct {
@@ -183,9 +181,4 @@
 extern C void teken_set_defattr(teken_t *, const teken_attr_t *);
 extern C void teken_set_winsize(teken_t *, const teken_pos_t *);

-/**
- * @}
- */
-
-#endif /* __ASSEMBLER__ */
 #endif /* !_TEKEN_H_ */
=======================================
--- /trunk/lib/libteken/teken_scs.h     Thu Apr  9 14:46:04 2009
+++ /trunk/lib/libteken/teken_scs.h     Sat Sep  5 10:50:50 2009
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: head/sys/dev/syscons/teken/teken_scs.h 187562 2009-01-21 19:43:10Z ed $
+ * $FreeBSD$
  */

 static void
=======================================
--- /trunk/lib/libteken/teken_subr.h    Thu Apr  9 14:46:04 2009
+++ /trunk/lib/libteken/teken_subr.h    Sat Sep  5 10:50:50 2009
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: head/sys/dev/syscons/teken/teken_subr.h 190158 2009-03-20 14:32:51Z ed $
+ * $FreeBSD$
  */

 static void teken_subr_cursor_up(teken_t *, unsigned int);
=======================================
--- /trunk/lib/libteken/teken_subr_compat.h     Thu Apr  9 14:46:04 2009
+++ /trunk/lib/libteken/teken_subr_compat.h     Sat Sep  5 10:50:50 2009
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: head/sys/dev/syscons/teken/teken_subr_compat.h 187382 2009-01-18 09:44:33Z ed $
+ * $FreeBSD$
  */

 static void
@@ -66,12 +66,3 @@
        teken_funcs_param(t, TP_SWITCHVT, vt);
 }

-#if 0
-static void
-teken_subr_vt52_decid(teken_t *t)
-{
-       const char response[] = "\x1B/Z";
-
-       teken_funcs_respond(t, response, sizeof response - 1);
-}
-#endif
=======================================
--- /trunk/lib/libteken/teken_wcwidth.h Thu Apr  9 14:46:04 2009
+++ /trunk/lib/libteken/teken_wcwidth.h Sat Sep  5 10:50:50 2009
@@ -7,7 +7,7 @@
  *
  * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
  *
- * $FreeBSD: head/sys/dev/syscons/teken/teken_wcwidth.h 186681 2009-01-01 13:26:53Z ed $
+ * $FreeBSD$
  */

 struct interval {

Other related posts:

  • » [freenos] r359 committed - Synchronized libteken with FreeBSD revision 196863. - codesite-noreply