import gdb-1999-06-14 snapshot
[deliverable/binutils-gdb.git] / gdb / serial.c
index 89a116e565c8223006e986f264488601206bcbb0..75a221cbc7ad7cf6c800cb92fbcd3f9c75d7a485 100644 (file)
@@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "gdb_string.h"
 #include "gdbcmd.h"
 
+extern void _initialize_serial PARAMS ((void));
+
 /* Linked list of serial I/O handlers */
 
 static struct serial_ops *serial_ops_list = NULL;
@@ -39,10 +41,10 @@ static serial_t scb_base;
    suitable for playback by gdbserver. */
 
 static char *serial_logfile = NULL;
-static FILE *serial_logfp = NULL;
+static GDB_FILE *serial_logfp = NULL;
 
 static struct serial_ops *serial_interface_lookup PARAMS ((char *));
-static void serial_logchar PARAMS ((int chtype, int ch, int timeout));
+static void serial_logchar PARAMS ((int, int, int));
 static char logbase_hex[] = "hex";
 static char logbase_octal[] = "octal";
 static char logbase_ascii[] = "ascii";
@@ -59,15 +61,15 @@ static int serial_current_type = 0;
 #define SERIAL_BREAK 1235
 
 static void
-serial_logchar (chtype, ch, timeout)
-     int chtype;
+serial_logchar (ch_type, ch, timeout)
+     int ch_type;
      int ch;
      int timeout;
 {
-  if (chtype != serial_current_type)
+  if (ch_type != serial_current_type)
     {
-      fprintf_unfiltered (serial_logfp, "\n%c ", chtype);
-      serial_current_type = chtype;
+      fprintf_unfiltered (serial_logfp, "\n%c ", ch_type);
+      serial_current_type = ch_type;
     }
 
   if (serial_logbase != logbase_ascii)
@@ -308,7 +310,8 @@ serial_close (scb, really_close)
       fputs_unfiltered ("\nEnd of log\n", serial_logfp);
       serial_current_type = 0;
 
-      fclose (serial_logfp);   /* XXX - What if serial_logfp == stdout or stderr? */
+      /* XXX - What if serial_logfp == gdb_stdout or gdb_stderr? */
+      gdb_fclose (&serial_logfp); 
       serial_logfp = NULL;
     }
 
@@ -507,17 +510,19 @@ _initialize_serial ()
 Use <CR>~. or <CR>~^D to break out.");
 #endif /* 0 */
 
-  add_show_from_set (add_set_cmd ("remotelogfile", no_class,
-                                 var_filename, (char *)&serial_logfile,
-                                 "Set filename for remote session recording.\n\
+  add_show_from_set 
+    (add_set_cmd ("remotelogfile", no_class,
+                 var_filename, (char *) &serial_logfile,
+                 "Set filename for remote session recording.\n\
 This file is used to record the remote session for future playback\n\
-by gdbserver.", &setlist),
-                    &showlist);
-
-  add_show_from_set (add_set_enum_cmd ("remotelogbase", no_class,
-                                      logbase_enums,
-                                      (char *)&serial_logbase,
-                                      "Set numerical base for remote session logging",
-                                      &setlist),
-                          &showlist);
+by gdbserver.", 
+                 &setlist),
+     &showlist);
+
+  add_show_from_set 
+    (add_set_enum_cmd ("remotelogbase", no_class,
+                      logbase_enums, (char *) &serial_logbase,
+                      "Set numerical base for remote session logging",
+                      &setlist),
+     &showlist);
 }
This page took 0.024638 seconds and 4 git commands to generate.