commit-hurd
[Top][All Lists]
Advanced

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

hurd/libcons ChangeLog file-changed.c opts-std-...


From: Marcus Brinkmann
Subject: hurd/libcons ChangeLog file-changed.c opts-std-...
Date: Sat, 02 Aug 2003 17:43:46 -0400

CVSROOT:        /cvsroot/hurd
Module name:    hurd
Branch:         
Changes by:     Marcus Brinkmann <address@hidden>       03/08/02 17:43:46

Modified files:
        libcons        : ChangeLog file-changed.c opts-std-startup.c 
                         priv.h 

Log message:
        2003-08-01  Marco Gerards  <address@hidden>
        
        * opts-std-startup.c: Include <string.h>.
        (OPT_VISUAL_BELL): New macro.
        (OPT_AUDIBLE_BELL): Likewise.
        (_cons_visual_bell): New variable.
        (_cons_audible_bell): Likewise.
        (startup_options): Added options "--visual-bell" and
        "--audible-bell" ...
        (parse_startup_opt): ...and parse those new options here.
        * priv.h (bell_type_t): New enumeration.
        (_cons_visual_bell): New external variable.
        (_cons_audible_bell): Likewise.
        * file-changed.c (cons_S_file_changed): Use the right bell.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd/libcons/ChangeLog.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd/libcons/file-changed.c.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd/libcons/opts-std-startup.c.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd/libcons/priv.h.diff?tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: hurd/libcons/ChangeLog
diff -u hurd/libcons/ChangeLog:1.13 hurd/libcons/ChangeLog:1.14
--- hurd/libcons/ChangeLog:1.13 Fri Oct  4 06:23:00 2002
+++ hurd/libcons/ChangeLog      Sat Aug  2 17:43:46 2003
@@ -1,3 +1,18 @@
+2003-08-01  Marco Gerards  <address@hidden>
+
+       * opts-std-startup.c: Include <string.h>.
+       (OPT_VISUAL_BELL): New macro.
+       (OPT_AUDIBLE_BELL): Likewise.
+       (_cons_visual_bell): New variable.
+       (_cons_audible_bell): Likewise.
+       (startup_options): Added options "--visual-bell" and
+       "--audible-bell" ...
+       (parse_startup_opt): ...and parse those new options here.
+       * priv.h (bell_type_t): New enumeration.
+       (_cons_visual_bell): New external variable.
+       (_cons_audible_bell): Likewise.
+       * file-changed.c (cons_S_file_changed): Use the right bell.
+
 2002-10-04  Marcus Brinkmann  <address@hidden>
 
        * vcons-open.c (cons_vcons_open): Add casts to silence gcc
Index: hurd/libcons/file-changed.c
diff -u hurd/libcons/file-changed.c:1.9 hurd/libcons/file-changed.c:1.10
--- hurd/libcons/file-changed.c:1.9     Tue Sep 17 07:47:15 2002
+++ hurd/libcons/file-changed.c Sat Aug  2 17:43:46 2003
@@ -1,5 +1,5 @@
 /* file-changed.c - Handling file changed notifications.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
    Written by Marcus Brinkmann.
 
    This file is part of the GNU Hurd.
@@ -202,7 +202,10 @@
                  while (vcons->state.bell.audible
                         < vcons->display->bell.audible)
                    {
-                     cons_vcons_beep (vcons);
+                     if (_cons_audible_bell == BELL_AUDIBLE)
+                       cons_vcons_beep (vcons);
+                     else if (_cons_audible_bell == BELL_VISUAL)
+                       cons_vcons_flash (vcons);
                      vcons->state.bell.audible++;
                    }
                }
@@ -211,7 +214,10 @@
                  while (vcons->state.bell.visible
                         < vcons->display->bell.visible)
                    {
-                     cons_vcons_flash (vcons);
+                     if (_cons_visual_bell == BELL_VISUAL)
+                       cons_vcons_flash (vcons);
+                     else if (_cons_visual_bell == BELL_AUDIBLE)
+                       cons_vcons_beep (vcons);
                      vcons->state.bell.visible++;
                    }
                }
Index: hurd/libcons/opts-std-startup.c
diff -u hurd/libcons/opts-std-startup.c:1.5 hurd/libcons/opts-std-startup.c:1.6
--- hurd/libcons/opts-std-startup.c:1.5 Tue Sep 17 13:25:14 2002
+++ hurd/libcons/opts-std-startup.c     Sat Aug  2 17:43:46 2003
@@ -1,5 +1,5 @@
 /* opts-std-startup.c - Standard startup-time command line parser.
-   Copyright (C) 1995,96,97,98,99,2001,02 Free Software Foundation, Inc.
+   Copyright (C) 1995,96,97,98,99,2001,02,2003 Free Software Foundation, Inc.
    Written by Miles Bader <address@hidden> and Marcus Brinkmann.
 
    This file is part of the GNU Hurd.
@@ -20,6 +20,7 @@
 
 #include <stdio.h>
 #include <argp.h>
+#include <string.h>
 
 #include "priv.h"
 
@@ -30,6 +31,8 @@
 #define OPT_NO_JUMP_DOWN_ON_INPUT      602     /* --no-jump-down-on-input */
 #define OPT_JUMP_DOWN_ON_OUTPUT                603     /* 
--jump-down-on-output */
 #define OPT_NO_JUMP_DOWN_ON_OUTPUT     604     /* --no-jump-down-on-output */
+#define OPT_VISUAL_BELL                        605     /* --visual-bell */
+#define OPT_AUDIBLE_BELL               606     /* --audible-bell */
 
 /* Common value for diskfs_common_options and diskfs_default_sync_interval. */
 #define DEFAULT_SLACK 100
@@ -50,6 +53,12 @@
 /* The filename of the console server.  */
 char *_cons_file;
 
+/* The type of bell used for the visual bell.  */
+bell_type_t _cons_visual_bell = BELL_VISUAL;
+
+/* The type of bell used for the audible bell.  */
+bell_type_t _cons_audible_bell = BELL_AUDIBLE;
+
 static const struct argp_option
 startup_options[] =
 {
@@ -63,6 +72,10 @@
     "End scrollback when something is printed" },
   { "no-jump-down-on-output", OPT_NO_JUMP_DOWN_ON_OUTPUT, NULL, 0,
     "End scrollback when something is printed (default)" },
+  { "visual-bell", OPT_VISUAL_BELL, "BELL", 0, "Visual bell: on (default), "
+    "off, visual, audible" },
+  { "audible-bell", OPT_AUDIBLE_BELL, "BELL", 0, "Audible bell: on (default), "
+    "off, visual, audible" },
   { 0, 0 }
 };
 
@@ -95,6 +108,30 @@
       _cons_jump_down_on_output = 0;
       break;
 
+    case OPT_AUDIBLE_BELL:
+      if (!strcasecmp ("on", arg) || !strcasecmp ("audible", arg))
+       _cons_audible_bell = BELL_AUDIBLE;
+      else if (!strcasecmp ("off", arg))
+       _cons_audible_bell = BELL_OFF;
+      else if (!strcasecmp ("visual", arg))
+       _cons_audible_bell = BELL_VISUAL;
+      else
+       argp_error (state, "The audible bell can be one of: on, off, visual, "
+                   "audible");
+      break;
+
+    case OPT_VISUAL_BELL:
+      if (!strcasecmp ("on", arg) || !strcasecmp ("visual", arg))
+       _cons_visual_bell = BELL_VISUAL;
+      else if (!strcasecmp ("off", arg))
+       _cons_visual_bell = BELL_OFF;
+      else if (!strcasecmp ("audible", arg))
+       _cons_visual_bell = BELL_AUDIBLE;
+      else
+       argp_error (state, "The visual bell can be one of: on, off, visual, "
+                   "audible");
+      break;
+      
     case ARGP_KEY_ARG:
       if (state->arg_num > 0)
        /* Too many arguments.  */
Index: hurd/libcons/priv.h
diff -u hurd/libcons/priv.h:1.3 hurd/libcons/priv.h:1.4
--- hurd/libcons/priv.h:1.3     Fri Sep 13 19:53:55 2002
+++ hurd/libcons/priv.h Sat Aug  2 17:43:46 2003
@@ -1,5 +1,5 @@
 /* Private declarations for cons library
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -21,6 +21,15 @@
 #include "cons.h"
 
 
+/* The kind of bells available.  */
+typedef enum
+  {
+    BELL_OFF,
+    BELL_VISUAL,
+    BELL_AUDIBLE
+  } bell_type_t;
+
+
 /* Number of records the client is allowed to lag behind the
    server.  */
 extern int _cons_slack;
@@ -33,6 +42,12 @@
 
 /* The filename of the console server.  */
 extern char *_cons_file;
+
+/* The type of bell used for the visual bell.  */
+extern bell_type_t _cons_visual_bell;
+
+/* The type of bell used for the audible bell.  */
+extern bell_type_t _cons_audible_bell;
 
 
 /* Non-locking version of cons_vcons_scrollback.  Does also not update




reply via email to

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