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

merge
author Ben Wing <ben@xemacs.org>
date Wed, 24 Feb 2010 01:58:04 -0600
parents 623d57b7fbe8 4aebb0131297
children 308d34e9f07d
comparison
equal deleted inserted replaced
5124:623d57b7fbe8 5125:b5df3737028a
690 * which fits into Lisp_Int. No return value indicates an error, the method 690 * which fits into Lisp_Int. No return value indicates an error, the method
691 * must signal an error instead. 691 * must signal an error instead.
692 */ 692 */
693 693
694 static DOESNT_RETURN 694 static DOESNT_RETURN
695 mswindows_report_winsock_error (const char *string, Lisp_Object data, 695 mswindows_report_winsock_error (const Ascbyte *reason, Lisp_Object data,
696 int errnum) 696 int errnum)
697 { 697 {
698 report_file_type_error (Qnetwork_error, mswindows_lisp_error (errnum), 698 signal_error_2 (Qnetwork_error, reason, mswindows_lisp_error (errnum), data);
699 string, data);
700 } 699 }
701 700
702 static void 701 static void
703 ensure_console_window_exists (void) 702 ensure_console_window_exists (void)
704 { 703 {
858 invalid_argument 857 invalid_argument
859 ("Bogus return value from `mswindows-construct-process-command-line'", 858 ("Bogus return value from `mswindows-construct-process-command-line'",
860 args_or_ret); 859 args_or_ret);
861 860
862 /* #### What about path names, which may be links? */ 861 /* #### What about path names, which may be links? */
863 LISP_STRING_TO_TSTR (args_or_ret, command_line); 862 command_line = LISP_STRING_TO_TSTR (args_or_ret);
864 863
865 UNGCPRO; /* args_or_ret */ 864 UNGCPRO; /* args_or_ret */
866 } 865 }
867 866
868 /* Set `proc_env' to a nul-separated array of the strings in 867 /* Set `proc_env' to a nul-separated array of the strings in
1234 /* First check if HOST is already a numeric address */ 1233 /* First check if HOST is already a numeric address */
1235 { 1234 {
1236 Extbyte *hostext; 1235 Extbyte *hostext;
1237 unsigned long inaddr; 1236 unsigned long inaddr;
1238 1237
1239 LISP_STRING_TO_EXTERNAL (host, hostext, Qmswindows_host_name_encoding); 1238 hostext = LISP_STRING_TO_EXTERNAL (host, Qmswindows_host_name_encoding);
1240 inaddr = inet_addr (hostext); 1239 inaddr = inet_addr (hostext);
1241 if (inaddr != INADDR_NONE) 1240 if (inaddr != INADDR_NONE)
1242 { 1241 {
1243 address->sin_addr.s_addr = inaddr; 1242 address->sin_addr.s_addr = inaddr;
1244 return 0; 1243 return 0;
1252 1251
1253 /* Post name resolution request */ 1252 /* Post name resolution request */
1254 { 1253 {
1255 Extbyte *hostext; 1254 Extbyte *hostext;
1256 1255
1257 LISP_STRING_TO_EXTERNAL (host, hostext, Qmswindows_host_name_encoding); 1256 hostext = LISP_STRING_TO_EXTERNAL (host, Qmswindows_host_name_encoding);
1258 1257
1259 hasync = WSAAsyncGetHostByName (hwnd, XM_SOCKREPLY, hostext, 1258 hasync = WSAAsyncGetHostByName (hwnd, XM_SOCKREPLY, hostext,
1260 buf, sizeof (buf)); 1259 buf, sizeof (buf));
1261 if (hasync == NULL) 1260 if (hasync == NULL)
1262 { 1261 {
1310 1309
1311 if (get_internet_address (host, &address)) /* error */ 1310 if (get_internet_address (host, &address)) /* error */
1312 return host; 1311 return host;
1313 1312
1314 if (address.sin_family == AF_INET) 1313 if (address.sin_family == AF_INET)
1315 return build_string (inet_ntoa (address.sin_addr)); 1314 return build_extstring (inet_ntoa (address.sin_addr),
1315 Qunix_host_name_encoding);
1316 else 1316 else
1317 return host; 1317 return host;
1318 } 1318 }
1319 1319
1320 /* open a TCP network connection to a given HOST/SERVICE. Treated 1320 /* open a TCP network connection to a given HOST/SERVICE. Treated
1345 { 1345 {
1346 struct servent *svc_info; 1346 struct servent *svc_info;
1347 Extbyte *servext; 1347 Extbyte *servext;
1348 1348
1349 CHECK_STRING (service); 1349 CHECK_STRING (service);
1350 LISP_STRING_TO_EXTERNAL (service, servext, 1350 servext = LISP_STRING_TO_EXTERNAL (service,
1351 Qmswindows_service_name_encoding); 1351 Qmswindows_service_name_encoding);
1352 1352
1353 svc_info = getservbyname (servext, "tcp"); 1353 svc_info = getservbyname (servext, "tcp");
1354 if (svc_info == 0) 1354 if (svc_info == 0)
1355 invalid_argument ("Unknown service", service); 1355 invalid_argument ("Unknown service", service);
1356 port = svc_info->s_port; 1356 port = svc_info->s_port;