diff src/process.c @ 5125:b5df3737028a ben-lisp-object

merge
author Ben Wing <ben@xemacs.org>
date Wed, 24 Feb 2010 01:58:04 -0600
parents 623d57b7fbe8 ae48681c47fa
children a9c41067dd88
line wrap: on
line diff
--- a/src/process.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/process.c	Wed Feb 24 01:58:04 2010 -0600
@@ -2,7 +2,7 @@
    Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 1995
    Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1995, 1996, 2001, 2002, 2004, 2005 Ben Wing.
+   Copyright (C) 1995, 1996, 2001, 2002, 2004, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -145,12 +145,12 @@
 }
 
 static void
-print_process (Lisp_Object object, Lisp_Object printcharfun, int escapeflag)
+print_process (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
 {
-  Lisp_Process *process = XPROCESS (object);
+  Lisp_Process *process = XPROCESS (obj);
 
   if (print_readably)
-    printing_unreadable_object ("#<process %s>", XSTRING_DATA (process->name));
+    printing_unreadable_lcrecord (obj, XSTRING_DATA (process->name));
 
   if (!escapeflag)
     {
@@ -158,16 +158,16 @@
     }
   else
     {
-      int netp = network_connection_p (object);
-      write_c_string (printcharfun,
+      int netp = network_connection_p (obj);
+      write_ascstring (printcharfun,
 		      netp ? GETTEXT ("#<network connection ") :
 		      GETTEXT ("#<process "));
       print_internal (process->name, printcharfun, 1);
-      write_c_string (printcharfun, (netp ? " " : " pid "));
+      write_ascstring (printcharfun, (netp ? " " : " pid "));
       print_internal (process->pid, printcharfun, 1);
       write_fmt_string_lisp (printcharfun, " state:%S", 1, process->status_symbol);
       MAYBE_PROCMETH (print_process_data, (process, printcharfun));
-      write_c_string (printcharfun, ">");
+      write_ascstring (printcharfun, ">");
     }
 }
 
@@ -188,7 +188,7 @@
   if (p->process_data)
     {
       MAYBE_PROCMETH (finalize_process_data, (p));
-      xfree (p->process_data, void *);
+      xfree (p->process_data);
     }
 }
 
@@ -227,7 +227,7 @@
   if (gethash ((const void*)usid, usid_to_process, &vval))
     {
       Lisp_Object process;
-      process = VOID_TO_LISP (vval);
+      process = GET_LISP_FROM_VOID (vval);
       return XPROCESS (process);
     }
   else
@@ -449,15 +449,15 @@
 /************************************************************************/
 
 DOESNT_RETURN
-report_process_error (const char *string, Lisp_Object data)
+report_process_error (const Ascbyte *reason, Lisp_Object data)
 {
-  report_error_with_errno (Qprocess_error, string, data);
+  report_error_with_errno (Qprocess_error, reason, data);
 }
 
 DOESNT_RETURN
-report_network_error (const char *string, Lisp_Object data)
+report_network_error (const Ascbyte *reason, Lisp_Object data)
 {
-  report_error_with_errno (Qnetwork_error, string, data);
+  report_error_with_errno (Qnetwork_error, reason, data);
 }
 
 Lisp_Object
@@ -475,12 +475,12 @@
   name1 = name;
   for (i = 1; ; i++)
     {
-      char suffix[10];
+      Ascbyte suffix[10];
       Lisp_Object tem = Fget_process (name1);
       if (NILP (tem))
         break;
       sprintf (suffix, "<%d>", i);
-      name1 = concat2 (name, build_string (suffix));
+      name1 = concat2 (name, build_ascstring (suffix));
     }
   name = name1;
   p->name = name;
@@ -554,14 +554,14 @@
     {
       Lisp_Object process = Qnil;
       process = wrap_process (p);
-      puthash ((const void*) in_usid, LISP_TO_VOID (process), usid_to_process);
+      puthash ((const void*) in_usid, STORE_LISP_IN_VOID (process), usid_to_process);
     }
 
   if (err_usid != USID_DONTHASH)
     {
       Lisp_Object process = Qnil;
       process = wrap_process (p);
-      puthash ((const void*) err_usid, LISP_TO_VOID (process),
+      puthash ((const void*) err_usid, STORE_LISP_IN_VOID (process),
 	       usid_to_process);
     }
 
@@ -740,7 +740,7 @@
 
       tem = Qnil;
       NGCPRO1 (tem);
-      locate_file (list1 (build_string ("")), program, Vlisp_EXEC_SUFFIXES,
+      locate_file (list1 (build_ascstring ("")), program, Vlisp_EXEC_SUFFIXES,
 		   &tem, X_OK);
       if (NILP (tem))
 	signal_error (Qprocess_error, "Searching for program", program);
@@ -1564,11 +1564,11 @@
 
   if (EQ (symbol, Qsignal) || EQ (symbol, Qstop))
     {
-      string = build_string (signal_name (code));
+      string = build_cistring (signal_name (code));
       if (coredump)
 	string2 = build_msg_string (" (core dumped)\n");
       else
-	string2 = build_string ("\n");
+	string2 = build_ascstring ("\n");
       set_string_char (string, 0,
 		       DOWNCASE (0, string_ichar (string, 0)));
       return concat2 (string, string2);
@@ -1581,7 +1581,7 @@
       if (coredump)
 	string2 = build_msg_string (" (core dumped)\n");
       else
-	string2 = build_string ("\n");
+	string2 = build_ascstring ("\n");
       return concat2 (build_msg_string ("exited abnormally with code "),
 		      concat2 (string, string2));
     }
@@ -1690,9 +1690,9 @@
 	      int spec = process_setup_for_insertion (process, 0);
 
 	      NGCPRO1 (process);
-	      buffer_insert_c_string (current_buffer, "\nProcess ");
+	      buffer_insert_ascstring (current_buffer, "\nProcess ");
 	      Finsert (1, &p->name);
-	      buffer_insert_c_string (current_buffer, " ");
+	      buffer_insert_ascstring (current_buffer, " ");
 	      Finsert (1, &msg);
 	      Fset_marker (p->mark, make_int (BUF_PT (current_buffer)),
 			   p->buffer);
@@ -2302,14 +2302,14 @@
 	  )
 	{
 	  XCAR (scan) = concat3 (make_string (var, varlen),
-				 build_string ("="),
+				 build_ascstring ("="),
 				 make_string (value, valuelen));
 	  return;
 	}
     }
 
   Vprocess_environment = Fcons (concat3 (make_string (var, varlen),
-					 build_string ("="),
+					 build_ascstring ("="),
 					 make_string (value, valuelen)),
 				Vprocess_environment);
 }
@@ -2342,7 +2342,7 @@
 */
        (var, interactivep))
 {
-  Ibyte *value;
+  Ibyte *value = NULL;
   Bytecount valuelen;
   Lisp_Object v = Qnil;
   struct gcpro gcpro1;
@@ -2428,12 +2428,13 @@
     _wgetenv (L""); /* force initialization of _wenviron */
     for (envp = (Extbyte **) _wenviron; envp && *envp; envp++)
       Vprocess_environment =
-	Fcons (build_ext_string (*envp, Qmswindows_unicode),
+	Fcons (build_extstring (*envp, Qmswindows_unicode),
 	       Vprocess_environment);
 #else
     for (envp = environ; envp && *envp; envp++)
       Vprocess_environment =
-	Fcons (build_ext_string (*envp, Qnative), Vprocess_environment);
+	Fcons (build_extstring (*envp, Qenvironment_variable_encoding),
+	       Vprocess_environment);
 #endif
     /* This gets set back to 0 in disksave_object_finalization() */
     env_initted = 1;
@@ -2472,12 +2473,12 @@
       {
 	Ibyte *faux_var = alloca_ibytes (7 + qxestrlen (shell));
 	qxesprintf (faux_var, "SHELL=%s", shell);
-	Vprocess_environment = Fcons (build_intstring (faux_var),
+	Vprocess_environment = Fcons (build_istring (faux_var),
 				      Vprocess_environment);
       }
 #endif /* 0 */
 
-    Vshell_file_name = build_intstring (shell);
+    Vshell_file_name = build_istring (shell);
   }
 }
 
@@ -2598,7 +2599,7 @@
 the operations needing this are lower level than what ELisp programs
 typically do, and in any case no equivalent exists under native MS Windows.
 */ );
-  Vnull_device = build_string (NULL_DEVICE);
+  Vnull_device = build_ascstring (NULL_DEVICE);
 
   DEFVAR_LISP ("process-connection-type", &Vprocess_connection_type /*
 Control type of device used to communicate with subprocesses.
@@ -2678,6 +2679,6 @@
 when Emacs starts.
 */ );
 
-  Vlisp_EXEC_SUFFIXES = build_string (EXEC_SUFFIXES);
+  Vlisp_EXEC_SUFFIXES = build_ascstring (EXEC_SUFFIXES);
   staticpro (&Vlisp_EXEC_SUFFIXES);
 }